/*! * Copyright 2016 Amazon.com, * Inc. or its affiliates. All Rights Reserved. * * Licensed under the Amazon Software License (the "License"). * You may not use this file except in compliance with the * License. A copy of the License is located at * * http://aws.amazon.com/asl/ * * or in the "license" file accompanying this file. This file is * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, express or implied. See the License * for the specific language governing permissions and * limitations under the License. */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Cognitauth=e():t.Cognitauth=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var i=n(37);Object.defineProperty(e,"AuthenticationDetails",{enumerable:!0,get:function(){return r(i).default}});var s=n(14);Object.defineProperty(e,"AuthenticationHelper",{enumerable:!0,get:function(){return r(s).default}});var o=n(16);Object.defineProperty(e,"CognitoAccessToken",{enumerable:!0,get:function(){return r(o).default}});var a=n(17);Object.defineProperty(e,"CognitoIdToken",{enumerable:!0,get:function(){return r(a).default}});var u=n(19);Object.defineProperty(e,"CognitoRefreshToken",{enumerable:!0,get:function(){return r(u).default}});var h=n(20);Object.defineProperty(e,"CognitoUser",{enumerable:!0,get:function(){return r(h).default}});var f=n(21);Object.defineProperty(e,"CognitoUserAttribute",{enumerable:!0,get:function(){return r(f).default}});var l=n(39);Object.defineProperty(e,"CognitoUserPool",{enumerable:!0,get:function(){return r(l).default}});var c=n(22);Object.defineProperty(e,"CognitoUserSession",{enumerable:!0,get:function(){return r(c).default}});var d=n(40);Object.defineProperty(e,"CookieStorage",{enumerable:!0,get:function(){return r(d).default}});var p=n(23);Object.defineProperty(e,"DateHelper",{enumerable:!0,get:function(){return r(p).default}})},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},function(t,e,n){function r(t,e){for(var n in t)e[n]=t[n]}function i(t,e,n){return o(t,e,n)}var s=n(3),o=s.Buffer;o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?t.exports=s:(r(s,e),e.Buffer=i),r(o,i),i.from=function(t,e,n){if("number"==typeof t)throw new TypeError("Argument must not be a number");return o(t,e,n)},i.alloc=function(t,e,n){if("number"!=typeof t)throw new TypeError("Argument must be a number");var r=o(t);return void 0!==e?"string"==typeof n?r.fill(e,n):r.fill(e):r.fill(0),r},i.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return o(t)},i.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return s.SlowBuffer(t)}},function(t,e,n){(function(t){/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ "use strict";function r(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}function i(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(i()=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function v(t){return+t!=t&&(t=0),o.alloc(+t)}function y(t,e){if(o.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return W(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(t).length;default:if(r)return W(t).length;e=(""+e).toLowerCase(),r=!0}}function _(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,e>>>=0,n<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return P(this,e,n);case"utf8":case"utf-8":return D(this,e,n);case"ascii":return R(this,e,n);case"latin1":case"binary":return B(this,e,n);case"base64":return I(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function m(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function w(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=o.from(e,r)),o.isBuffer(e))return 0===e.length?-1:b(t,e,n,r,i);if("number"==typeof e)return e&=255,o.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):b(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function b(t,e,n,r,i){function s(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}var o=1,a=t.length,u=e.length;if(void 0!==r&&(r=String(r).toLowerCase(),"ucs2"===r||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;o=2,a/=2,u/=2,n/=2}var h;if(i){var f=-1;for(h=n;ha&&(n=a-u),h=n;h>=0;h--){for(var l=!0,c=0;ci&&(r=i)):r=i;var s=e.length;if(s%2!==0)throw new TypeError("Invalid hex string");r>s/2&&(r=s/2);for(var o=0;o239?4:s>223?3:s>191?2:1;if(i+a<=n){var u,h,f,l;switch(a){case 1:s<128&&(o=s);break;case 2:u=t[i+1],128===(192&u)&&(l=(31&s)<<6|63&u,l>127&&(o=l));break;case 3:u=t[i+1],h=t[i+2],128===(192&u)&&128===(192&h)&&(l=(15&s)<<12|(63&u)<<6|63&h,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:u=t[i+1],h=t[i+2],f=t[i+3],128===(192&u)&&128===(192&h)&&128===(192&f)&&(l=(15&s)<<18|(63&u)<<12|(63&h)<<6|63&f,l>65535&&l<1114112&&(o=l))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=a}return k(r)}function k(t){var e=t.length;if(e<=tt)return String.fromCharCode.apply(String,t);for(var n="",r=0;rr)&&(n=r);for(var i="",s=e;sn)throw new RangeError("Trying to access beyond buffer length")}function F(t,e,n,r,i,s){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function O(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,s=Math.min(t.length-n,2);i>>8*(r?i:1-i)}function N(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,s=Math.min(t.length-n,4);i>>8*(r?i:3-i)&255}function L(t,e,n,r,i,s){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function V(t,e,n,r,i){return i||L(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),$.write(t,e,n,r,23,4),n+4}function j(t,e,n,r,i){return i||L(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),$.write(t,e,n,r,52,8),n+8}function q(t){if(t=K(t).replace(et,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function K(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Y(t){return t<16?"0"+t.toString(16):t.toString(16)}function W(t,e){e=e||1/0;for(var n,r=t.length,i=null,s=[],o=0;o55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===r){(e-=3)>-1&&s.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&s.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;s.push(n)}else if(n<2048){if((e-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function H(t){for(var e=[],n=0;n>8,i=n%256,s.push(i),s.push(r);return s}function z(t){return X.toByteArray(q(t))}function G(t,e,n,r){for(var i=0;i=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function Z(t){return t!==t}var X=n(41),$=n(46),Q=n(27);e.Buffer=o,e.SlowBuffer=v,e.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:r(),e.kMaxLength=i(),o.poolSize=8192,o._augment=function(t){return t.__proto__=o.prototype,t},o.from=function(t,e,n){return a(null,t,e,n)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(t,e,n){return h(null,t,e,n)},o.allocUnsafe=function(t){return f(null,t)},o.allocUnsafeSlow=function(t){return f(null,t)},o.isBuffer=function(t){return!(null==t||!t._isBuffer)},o.compare=function(t,e){if(!o.isBuffer(t)||!o.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,s=Math.min(n,r);i0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),""},o.prototype.compare=function(t,e,n,r,i){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,r>>>=0,i>>>=0,this===t)return 0;for(var s=i-r,a=n-e,u=Math.min(s,a),h=this.slice(r,i),f=t.slice(e,n),l=0;li)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var s=!1;;)switch(r){case"hex":return S(this,t,e,n);case"utf8":case"utf-8":return E(this,t,e,n);case"ascii":return C(this,t,e,n);case"latin1":case"binary":return A(this,t,e,n);case"base64":return T(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,e,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;o.prototype.slice=function(t,e){var n=this.length;t=~~t,e=void 0===e?n:~~e,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e0&&(i*=256);)r+=this[t+--e]*i;return r},o.prototype.readUInt8=function(t,e){return e||M(t,1,this.length),this[t]},o.prototype.readUInt16LE=function(t,e){return e||M(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUInt16BE=function(t,e){return e||M(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUInt32LE=function(t,e){return e||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUInt32BE=function(t,e){return e||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||M(t,e,this.length);for(var r=this[t],i=1,s=0;++s=i&&(r-=Math.pow(2,8*e)),r},o.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||M(t,e,this.length);for(var r=e,i=1,s=this[t+--r];r>0&&(i*=256);)s+=this[t+--r]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*e)),s},o.prototype.readInt8=function(t,e){return e||M(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},o.prototype.readInt16LE=function(t,e){e||M(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(t,e){e||M(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(t,e){return e||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return e||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readFloatLE=function(t,e){return e||M(t,4,this.length),$.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return e||M(t,4,this.length),$.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return e||M(t,8,this.length),$.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return e||M(t,8,this.length),$.read(this,t,!1,52,8)},o.prototype.writeUIntLE=function(t,e,n,r){if(t=+t,e|=0,n|=0,!r){var i=Math.pow(2,8*n)-1;F(this,t,e,n,i,0)}var s=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+s]=t/o&255;return e+n},o.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,1,255,0),o.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},o.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},o.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},o.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):N(this,t,e,!0),e+4},o.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},o.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);F(this,t,e,n,i-1,-i)}var s=0,o=1,a=0;for(this[e]=255&t;++s>0)-a&255;return e+n},o.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);F(this,t,e,n,i-1,-i)}var s=n-1,o=1,a=0;for(this[e+s]=255&t;--s>=0&&(o*=256);)t<0&&0===a&&0!==this[e+s+1]&&(a=1),this[e+s]=(t/o>>0)-a&255;return e+n},o.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,1,127,-128),o.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},o.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},o.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):N(this,t,e,!0),e+4},o.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},o.prototype.writeFloatLE=function(t,e,n){return V(this,t,e,!0,n)},o.prototype.writeFloatBE=function(t,e,n){return V(this,t,e,!1,n)},o.prototype.writeDoubleLE=function(t,e,n){return j(this,t,e,!0,n)},o.prototype.writeDoubleBE=function(t,e,n){return j(this,t,e,!1,n)},o.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e=0;--i)t[i+e]=this[i+n];else if(s<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,t||(t=0);var s;if("number"==typeof t)for(s=e;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,i=(n-r)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var s=this._hash();return t?s.toString(t):s},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=r},function(t,e,n){(function(t){function n(t){return Array.isArray?Array.isArray(t):"[object Array]"===v(t)}function r(t){return"boolean"==typeof t}function i(t){return null===t}function s(t){return null==t}function o(t){return"number"==typeof t}function a(t){return"string"==typeof t}function u(t){return"symbol"==typeof t}function h(t){return void 0===t}function f(t){return"[object RegExp]"===v(t)}function l(t){return"object"==typeof t&&null!==t}function c(t){return"[object Date]"===v(t)}function d(t){return"[object Error]"===v(t)||t instanceof Error}function p(t){return"function"==typeof t}function g(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function v(t){return Object.prototype.toString.call(t)}e.isArray=n,e.isBoolean=r,e.isNull=i,e.isNullOrUndefined=s,e.isNumber=o,e.isString=a,e.isSymbol=u,e.isUndefined=h,e.isRegExp=f,e.isObject=l,e.isDate=c,e.isError=d,e.isFunction=p,e.isPrimitive=g,e.isBuffer=t.isBuffer}).call(e,n(3).Buffer)},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(t){if(f===setTimeout)return setTimeout(t,0);if((f===n||!f)&&setTimeout)return f=setTimeout,setTimeout(t,0);try{return f(t,0)}catch(e){try{return f.call(null,t,0)}catch(e){return f.call(this,t,0)}}}function s(t){if(l===clearTimeout)return clearTimeout(t);if((l===r||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(t);try{return l(t)}catch(e){try{return l.call(null,t)}catch(e){return l.call(this,t)}}}function o(){g&&d&&(g=!1,d.length?p=d.concat(p):v=-1,p.length&&a())}function a(){if(!g){var t=i(o);g=!0;for(var e=p.length;e;){for(d=p,p=[];++v1)for(var n=1;n0&&this._events[t].length>i&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function n(){this.removeListener(t,n),i||(i=!0,e.apply(this,arguments))}if(!r(e))throw TypeError("listener must be a function");var i=!1;return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var n,i,o,a;if(!r(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],o=n.length,i=-1,n===e||r(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(s(n)){for(a=o;a-- >0;)if(n[a]===e||n[a].listener&&n[a].listener===e){i=a;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],r(n))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?r(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(r(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,n){(function(e,r,i){"use strict";function s(t){var e=this;this.next=null,this.entry=null,this.finish=function(){U(e,t)}}function o(t){return x.from(t)}function a(t){return x.isBuffer(t)||t instanceof M}function u(){}function h(t,e){D=D||n(4),t=t||{},this.objectMode=!!t.objectMode,e instanceof D&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var r=t.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=t.decodeStrings===!1;this.decodeStrings=!o,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){_(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function f(t){return D=D||n(4),O.call(f,this)||this instanceof D?(this._writableState=new h(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),void P.call(this)):new f(t)}function l(t,e){var n=new Error("write after end");t.emit("error",n),I(e,n)}function c(t,e,n,r){var i=!0,s=!1;return null===n?s=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||e.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(t.emit("error",s),I(r,s),i=!1),i}function d(t,e,n){return t.objectMode||t.decodeStrings===!1||"string"!=typeof e||(e=x.from(e,n)), e}function p(t,e,n,r,i,s){if(!n){var o=d(e,r,i);r!==o&&(n=!0,i="buffer",r=o)}var a=e.objectMode?1:r.length;e.length+=a;var u=e.length-1?r:I;f.WritableState=h;var R=n(6);R.inherits=n(1);var B={deprecate:n(60)},P=n(31),x=n(2).Buffer,M=i.Uint8Array||function(){},F=n(30);R.inherits(f,P),h.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(h.prototype,"buffer",{get:B.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}();var O;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(O=Function.prototype[Symbol.hasInstance],Object.defineProperty(f,Symbol.hasInstance,{value:function(t){return!!O.call(this,t)||t&&t._writableState instanceof h}})):O=function(t){return t instanceof this},f.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},f.prototype.write=function(t,e,n){var r=this._writableState,i=!1,s=a(t)&&!r.objectMode;return s&&!x.isBuffer(t)&&(t=o(t)),"function"==typeof e&&(n=e,e=null),s?e="buffer":e||(e=r.defaultEncoding),"function"!=typeof n&&(n=u),r.ended?l(this,n):(s||c(this,r,t,n))&&(r.pendingcb++,i=p(this,r,s,t,e,n)),i},f.prototype.cork=function(){var t=this._writableState;t.corked++},f.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||b(this,t))},f.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},f.prototype._write=function(t,e,n){n(new Error("_write() is not implemented"))},f.prototype._writev=null,f.prototype.end=function(t,e,n){var r=this._writableState;"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!==t&&void 0!==t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||T(this,r,n)},Object.defineProperty(f.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),f.prototype.destroy=F.destroy,f.prototype._undestroy=F.undestroy,f.prototype._destroy=function(t,e){this.end(),e(t)}}).call(e,n(7),n(61).setImmediate,function(){return this}())},function(t,e,n){e=t.exports=n(28),e.Stream=e,e.Readable=e,e.Writable=n(11),e.Duplex=n(4),e.Transform=n(29),e.PassThrough=n(50)},function(t,e,n){"use strict";function r(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function i(t){var e=r(t);if("string"!=typeof e&&(_.isEncoding===m||!m(t)))throw new Error("Unknown encoding: "+t);return e||t}function s(t){this.encoding=i(t);var e;switch(this.encoding){case"utf16le":this.text=c,this.end=d,e=4;break;case"utf8":this.fillLast=h,e=4;break;case"base64":this.text=p,this.end=g,e=3;break;default:return this.write=v,void(this.end=y)}this.lastNeed=0,this.lastTotal=0,this.lastChar=_.allocUnsafe(e)}function o(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:-1}function a(t,e,n){var r=e.length-1;if(r=0?(i>0&&(t.lastNeed=i-1),i):--r=0?(i>0&&(t.lastNeed=i-2),i):--r=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0))}function u(t,e,n){if(128!==(192&e[0]))return t.lastNeed=0,"�".repeat(n);if(t.lastNeed>1&&e.length>1){if(128!==(192&e[1]))return t.lastNeed=1,"�".repeat(n+1);if(t.lastNeed>2&&e.length>2&&128!==(192&e[2]))return t.lastNeed=2,"�".repeat(n+2)}}function h(t){var e=this.lastTotal-this.lastNeed,n=u(this,t,e);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function f(t,e){var n=a(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var r=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)}function l(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�".repeat(this.lastTotal-this.lastNeed):e}function c(t,e){if((t.length-e)%2===0){var n=t.toString("utf16le",e);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function d(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function p(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function g(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function v(t){return t.toString(this.encoding)}function y(t){return t&&t.length?this.write(t):""}var _=n(2).Buffer,m=_.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};e.StringDecoder=s,s.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(e=this.fillLast(t),void 0===e)return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0;){var o=e*this[t++]+n[r]+i;i=Math.floor(o/67108864),n[r++]=67108863&o}return i}function s(t,e,n,r,i,s){for(var o=32767&e,a=e>>15;--s>=0;){var u=32767&this[t],h=this[t++]>>15,f=a*u+h*o;u=o*u+((32767&f)<<15)+n[r]+(1073741823&i),i=(u>>>30)+(f>>>15)+a*h+(i>>>30),n[r++]=1073741823&u}return i}function o(t,e,n,r,i,s){for(var o=16383&e,a=e>>14;--s>=0;){var u=16383&this[t],h=this[t++]>>14,f=a*u+h*o;u=o*u+((16383&f)<<14)+n[r]+i,i=(u>>28)+(f>>14)+a*h,n[r++]=268435455&u}return i}function a(t){return Z.charAt(t)}function u(t,e){var n=X[t.charCodeAt(e)];return null==n?-1:n}function h(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function f(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0}function l(t){var e=r();return e.fromInt(t),e}function c(t,e){var r;if(16==e)r=4;else if(8==e)r=3;else if(2==e)r=1;else if(32==e)r=5;else{if(4!=e)throw new Error("Only radix 2, 4, 8, 16, 32 are supported");r=2}this.t=0,this.s=0;for(var i=t.length,s=!1,o=0;--i>=0;){var a=u(t,i);a<0?"-"==t.charAt(i)&&(s=!0):(s=!1,0==o?this[this.t++]=a:o+r>this.DB?(this[this.t-1]|=(a&(1<>this.DB-o):this[this.t-1]|=a<=this.DB&&(o-=this.DB))}this.clamp(),s&&n.ZERO.subTo(this,this)}function d(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t}function p(t){if(this.s<0)return"-"+this.negate().toString();var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)throw new Error("Only radix 2, 4, 8, 16, 32 are supported");e=2}var n,r=(1<0)for(u>u)>0&&(i=!0,s=a(n));o>=0;)u>(u+=this.DB-e)):(n=this[o]>>(u-=e)&r,u<=0&&(u+=this.DB,--o)),n>0&&(i=!0),i&&(s+=a(n));return i?s:"0"}function g(){var t=r();return n.ZERO.subTo(this,t),t}function v(){return this.s<0?this.negate():this}function y(t){var e=this.s-t.s;if(0!=e)return e;var n=this.t;if(e=n-t.t,0!=e)return this.s<0?-e:e;for(;--n>=0;)if(0!=(e=this[n]-t[n]))return e;return 0}function _(t){var e,n=1;return 0!=(e=t>>>16)&&(t=e,n+=16),0!=(e=t>>8)&&(t=e,n+=8),0!=(e=t>>4)&&(t=e,n+=4),0!=(e=t>>2)&&(t=e,n+=2),0!=(e=t>>1)&&(t=e,n+=1),n}function m(){return this.t<=0?0:this.DB*(this.t-1)+_(this[this.t-1]^this.s&this.DM)}function w(t,e){var n;for(n=this.t-1;n>=0;--n)e[n+t]=this[n];for(n=t-1;n>=0;--n)e[n]=0;e.t=this.t+t,e.s=this.s}function b(t,e){for(var n=t;n=0;--n)e[n+o+1]=this[n]>>i|a,a=(this[n]&s)<=0;--n)e[n]=0;e[o]=a,e.t=this.t+o+1,e.s=this.s,e.clamp()}function E(t,e){e.s=this.s;var n=Math.floor(t/this.DB);if(n>=this.t)return void(e.t=0);var r=t%this.DB,i=this.DB-r,s=(1<>r;for(var o=n+1;o>r;r>0&&(e[this.t-n-1]|=(this.s&s)<>=this.DB;if(t.t>=this.DB;r+=this.s}else{for(r+=this.s;n>=this.DB;r-=t.s}e.s=r<0?-1:0,r<-1?e[n++]=this.DV+r:r>0&&(e[n++]=r),e.t=n,e.clamp()}function A(t,e){var r=this.abs(),i=t.abs(),s=r.t;for(e.t=s+i.t;--s>=0;)e[s]=0;for(s=0;s=0;)t[n]=0;for(n=0;n=e.DV&&(t[n+e.t]-=e.DV,t[n+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(n,e[n],t,2*n,0,1)),t.s=0,t.clamp()}function U(t,e,i){var s=t.abs();if(!(s.t<=0)){var o=this.abs();if(o.t0?(s.lShiftTo(f,a),o.lShiftTo(f,i)):(s.copyTo(a),o.copyTo(i));var l=a.t,c=a[l-1];if(0!=c){var d=c*(1<1?a[l-2]>>this.F2:0),p=this.FV/d,g=(1<=0&&(i[i.t++]=1,i.subTo(w,i)),n.ONE.dlShiftTo(l,w),w.subTo(a,a);a.t=0;){var b=i[--y]==c?this.DM:Math.floor(i[y]*p+(i[y-1]+v)*g);if((i[y]+=a.am(0,b,i,m,0,l))0&&i.rShiftTo(f,i),u<0&&n.ZERO.subTo(i,i)}}}function I(t){var e=r();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(n.ZERO)>0&&t.subTo(e,e),e}function D(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return e=e*(2-(15&t)*e)&15,e=e*(2-(255&t)*e)&255,e=e*(2-((65535&t)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function k(t){return 0==this.compareTo(t)}function R(t,e){for(var n=0,r=0,i=Math.min(t.t,this.t);n>=this.DB;if(t.t>=this.DB;r+=this.s}else{for(r+=this.s;n>=this.DB;r+=t.s}e.s=r<0?-1:0,r>0?e[n++]=r:r<-1&&(e[n++]=this.DV+r),e.t=n,e.clamp()}function B(t){var e=r();return this.addTo(t,e),e}function P(t){var e=r();return this.subTo(t,e),e}function x(t){var e=r();return this.multiplyTo(t,e),e}function M(t){var e=r();return this.divRemTo(t,e,null),e}function F(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(e,e),e}function N(t){var e=r();return t.copyTo(e),this.reduce(e),e}function L(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(n=e+this.m.t,t[n]+=this.m.am(0,r,t,e,0,this.m.t);t[n]>=t.DV;)t[n]-=t.DV,t[++n]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function V(t,e){t.squareTo(e),this.reduce(e)}function j(t,e,n){t.multiplyTo(e,n),this.reduce(n)}function q(t,e,n){var i,s=t.bitLength(),o=l(1),a=new F(e);if(s<=0)return o;i=s<18?1:s<48?3:s<144?4:s<768?5:6;var u=new Array,h=3,f=i-1,c=(1<1){var d=r();for(a.sqrTo(u[1],d);h<=c;)u[h]=r(),a.mulTo(d,u[h-2],u[h]),h+=2}var p,g,v=t.t-1,y=!0,m=r();for(s=_(t[v])-1;v>=0;){for(s>=f?p=t[v]>>s-f&c:(p=(t[v]&(1<0&&(p|=t[v-1]>>this.DB+s-f)),h=i;0==(1&p);)p>>=1,--h;if((s-=h)<0&&(s+=this.DB,--v),y)u[p].copyTo(o),y=!1;else{for(;h>1;)a.sqrTo(o,m),a.sqrTo(m,o),h-=2;h>0?a.sqrTo(o,m):(g=o,o=m,m=g),a.mulTo(m,u[p],o)}for(;v>=0&&0==(t[v]&1<0&&void 0!==arguments[0]?arguments[0]:{},r=n.AccessToken;return i(this,e),s(this,t.call(this,r||""))}return o(e,t),e}(u.default);e.default=h},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}e.__esModule=!0;var a=n(18),u=r(a),h=function(t){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.IdToken;return i(this,e),s(this,t.call(this,r||""))}return o(e,t),e}(u.default);e.default=h},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;var i=n(3),s=function(){function t(e){r(this,t),this.jwtToken=e||"",this.payload=this.decodePayload()}return t.prototype.getJwtToken=function(){return this.jwtToken},t.prototype.getExpiration=function(){return this.payload.exp},t.prototype.getIssuedAt=function(){return this.payload.iat},t.prototype.decodePayload=function(){var t=this.jwtToken.split(".")[1];try{return JSON.parse(i.Buffer.from(t,"base64").toString("utf8"))}catch(t){return{}}},t}();e.default=s},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;/*! * Copyright 2016 Amazon.com, * Inc. or its affiliates. All Rights Reserved. * * Licensed under the Amazon Software License (the "License"). * You may not use this file except in compliance with the * License. A copy of the License is located at * * http://aws.amazon.com/asl/ * * or in the "license" file accompanying this file. This file is * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, express or implied. See the License * for the specific language governing permissions and * limitations under the License. */ var r=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.RefreshToken;n(this,t),this.token=r||""}return t.prototype.getToken=function(){return this.token},t}();e.default=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;var s=n(3),o=n(26),a=r(o),u=n(15),h=r(u),f=n(14),l=r(f),c=n(16),d=r(c),p=n(17),g=r(p),v=n(19),y=r(v),_=n(22),m=r(_),w=n(23),b=r(w),S=n(21),E=r(S),C=n(24),A=r(C),T=function(){function t(e){if(i(this,t),null==e||null==e.Username||null==e.Pool)throw new Error("Username and pool information are required.");this.username=e.Username||"",this.pool=e.Pool,this.Session=null,this.client=e.Pool.client,this.signInUserSession=null,this.authenticationFlowType="USER_SRP_AUTH",this.storage=e.Storage||(new A.default).getStorage()}return t.prototype.setSignInUserSession=function(t){this.clearCachedTokens(),this.signInUserSession=t,this.cacheTokens()},t.prototype.getSignInUserSession=function(){return this.signInUserSession},t.prototype.getUsername=function(){return this.username},t.prototype.getAuthenticationFlowType=function(){return this.authenticationFlowType},t.prototype.setAuthenticationFlowType=function(t){this.authenticationFlowType=t},t.prototype.initiateAuth=function(t,e){var n=this,r=t.getAuthParameters();r.USERNAME=this.username;var i={AuthFlow:"CUSTOM_AUTH",ClientId:this.pool.getClientId(),AuthParameters:r,ClientMetadata:t.getValidationData()};this.getUserContextData()&&(i.UserContextData=this.getUserContextData()),this.client.request("InitiateAuth",i,function(t,r){if(t)return e.onFailure(t);var i=r.ChallengeName,s=r.ChallengeParameters;return"CUSTOM_CHALLENGE"===i?(n.Session=r.Session,e.customChallenge(s)):(n.signInUserSession=n.getCognitoUserSession(r.AuthenticationResult),n.cacheTokens(),e.onSuccess(n.signInUserSession))})},t.prototype.authenticateUser=function(t,e){var n=this,r=new l.default(this.pool.getUserPoolId().split("_")[1]),i=new b.default,o=void 0,u=void 0,f={};null!=this.deviceKey&&(f.DEVICE_KEY=this.deviceKey),f.USERNAME=this.username,r.getLargeAValue(function(l,c){l&&e.onFailure(l),f.SRP_A=c.toString(16),"CUSTOM_AUTH"===n.authenticationFlowType&&(f.CHALLENGE_NAME="SRP_A");var d={AuthFlow:n.authenticationFlowType,ClientId:n.pool.getClientId(),AuthParameters:f,ClientMetadata:t.getValidationData()};n.getUserContextData(n.username)&&(d.UserContextData=n.getUserContextData(n.username)),n.client.request("InitiateAuth",d,function(f,l){if(f)return e.onFailure(f);var c=l.ChallengeParameters;n.username=c.USER_ID_FOR_SRP,o=new h.default(c.SRP_B,16),u=new h.default(c.SALT,16),n.getCachedDeviceKeyAndPassword(),r.getPasswordAuthenticationKey(n.username,t.getPassword(),o,u,function(t,o){t&&e.onFailure(t);var u=i.getNowString(),h=(0,a.default)("sha256",o).update(s.Buffer.concat([s.Buffer.from(n.pool.getUserPoolId().split("_")[1],"utf8"),s.Buffer.from(n.username,"utf8"),s.Buffer.from(c.SECRET_BLOCK,"base64"),s.Buffer.from(u,"utf8")])).digest("base64"),f={};f.USERNAME=n.username,f.PASSWORD_CLAIM_SECRET_BLOCK=c.SECRET_BLOCK,f.TIMESTAMP=u,f.PASSWORD_CLAIM_SIGNATURE=h,null!=n.deviceKey&&(f.DEVICE_KEY=n.deviceKey);var d=function t(e,r){return n.client.request("RespondToAuthChallenge",e,function(i,s){return i&&"ResourceNotFoundException"===i.code&&i.message.toLowerCase().indexOf("device")!==-1?(f.DEVICE_KEY=null,n.deviceKey=null,n.randomPassword=null,n.deviceGroupKey=null,n.clearCachedDeviceKeyAndPassword(),t(e,r)):r(i,s)})},p={ChallengeName:"PASSWORD_VERIFIER",ClientId:n.pool.getClientId(),ChallengeResponses:f,Session:l.Session};n.getUserContextData()&&(p.UserContextData=n.getUserContextData()),d(p,function(t,i){if(t)return e.onFailure(t);var s=i.ChallengeName;if("NEW_PASSWORD_REQUIRED"===s){n.Session=i.Session;var o=null,a=null,u=[],h=r.getNewPasswordRequiredChallengeUserAttributePrefix();if(i.ChallengeParameters&&(o=JSON.parse(i.ChallengeParameters.userAttributes),a=JSON.parse(i.ChallengeParameters.requiredAttributes)),a)for(var f=0;f0&&void 0!==arguments[0]?arguments[0]:{},r=e.Name,i=e.Value;n(this,t),this.Name=r||"",this.Value=i||""}return t.prototype.getValue=function(){return this.Value},t.prototype.setValue=function(t){return this.Value=t,this},t.prototype.getName=function(){return this.Name},t.prototype.setName=function(t){return this.Name=t,this},t.prototype.toString=function(){return JSON.stringify(this)},t.prototype.toJSON=function(){return{Name:this.Name,Value:this.Value}},t}();e.default=r},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;/*! * Copyright 2016 Amazon.com, * Inc. or its affiliates. All Rights Reserved. * * Licensed under the Amazon Software License (the "License"). * You may not use this file except in compliance with the * License. A copy of the License is located at * * http://aws.amazon.com/asl/ * * or in the "license" file accompanying this file. This file is * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, express or implied. See the License * for the specific language governing permissions and * limitations under the License. */ var r=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.IdToken,i=e.RefreshToken,s=e.AccessToken,o=e.ClockDrift;if(n(this,t),null==s||null==r)throw new Error("Id token and Access Token must be present.");this.idToken=r,this.refreshToken=i,this.accessToken=s,this.clockDrift=void 0===o?this.calculateClockDrift():o}return t.prototype.getIdToken=function(){return this.idToken},t.prototype.getRefreshToken=function(){return this.refreshToken},t.prototype.getAccessToken=function(){return this.accessToken},t.prototype.getClockDrift=function(){return this.clockDrift},t.prototype.calculateClockDrift=function(){var t=Math.floor(new Date/1e3),e=Math.min(this.accessToken.getIssuedAt(),this.idToken.getIssuedAt());return t-e},t.prototype.isValid=function(){var t=Math.floor(new Date/1e3),e=t-this.clockDrift;return e>5]|=128<>>9<<4)+14]=e;for(var n=1732584193,r=-271733879,i=-1732584194,f=271733878,l=0;l>16)+(e>>16)+(n>>16);return r<<16|65535&n}function f(t,e){return t<>>32-e}var l=n(43);t.exports=function(t){return l(t,r)}},function(t,e,n){"use strict";function r(t,e){o.call(this,"digest"),"string"==typeof e&&(e=a.from(e));var n="sha512"===t||"sha384"===t?128:64;if(this._alg=t,this._key=e,e.length>n){var r="rmd160"===t?new h:f(t);e=r.update(e).digest()}else e.length0?("string"==typeof e||o.objectMode||Object.getPrototypeOf(e)===O.prototype||(e=i(e)),r?o.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):f(t,o,e,!0):o.ended?t.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!n?(e=o.decoder.write(e),o.objectMode||0!==e.length?f(t,o,e,!1):_(t,o)):f(t,o,e,!1))):r||(o.reading=!1)}return c(o)}function f(t,e,n,r){e.flowing&&0===e.length&&!e.sync?(t.emit("data",n),t.read(0)):(e.length+=e.objectMode?1:n.length,r?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&v(t)),_(t,e)}function l(t,e){var n;return s(e)||"string"==typeof e||void 0===e||t.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function c(t){return!t.ended&&(t.needReadable||t.length=H?t=H:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function p(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=d(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function g(t,e){if(!e.ended){if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,v(t)}}function v(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(j("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?B(y,t):y(t))}function y(t){j("emit readable"),t.emit("readable"),C(t)}function _(t,e){e.readingMore||(e.readingMore=!0,B(m,t,e))}function m(t,e){for(var n=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):n=T(t,e.buffer,e.decoder),n}function T(t,e,n){var r;return ts.length?s.length:t;if(i+=o===s.length?s:s.slice(0,t),t-=o,0===t){o===s.length?(++r,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=s.slice(o));break}++r}return e.length-=r,i}function I(t,e){var n=O.allocUnsafe(t),r=e.head,i=1;for(r.data.copy(n),t-=r.data.length;r=r.next;){var s=r.data,o=t>s.length?s.length:t;if(s.copy(n,n.length-t,0,o),t-=o,0===t){o===s.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=s.slice(o));break}++i}return e.length-=i,n}function D(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,B(k,e,t))}function k(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function R(t,e){for(var n=0,r=t.length;n=e.highWaterMark||e.ended))return j("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?D(this):v(this),null;if(t=p(t,e),0===t&&e.ended)return 0===e.length&&D(this),null;var r=e.needReadable;j("need readable",r),(0===e.length||e.length-t0?A(t,e):null,null===i?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&D(this)),null!==i&&this.emit("data",i),i},u.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},u.prototype.pipe=function(t,e){function n(t,e){j("onunpipe"),t===c&&e&&e.hasUnpiped===!1&&(e.hasUnpiped=!0,s())}function i(){j("onend"),t.end()}function s(){j("cleanup"),t.removeListener("close",h),t.removeListener("finish",f),t.removeListener("drain",v),t.removeListener("error",u),t.removeListener("unpipe",n),c.removeListener("end",i),c.removeListener("end",l),c.removeListener("data",a),y=!0,!d.awaitDrain||t._writableState&&!t._writableState.needDrain||v()}function a(e){j("ondata"),_=!1;var n=t.write(e);!1!==n||_||((1===d.pipesCount&&d.pipes===t||d.pipesCount>1&&R(d.pipes,t)!==-1)&&!y&&(j("false write response, pause",c._readableState.awaitDrain),c._readableState.awaitDrain++,_=!0),c.pause())}function u(e){j("onerror",e),l(),t.removeListener("error",u),0===M(t,"error")&&t.emit("error",e)}function h(){t.removeListener("finish",f),l()}function f(){j("onfinish"),t.removeListener("close",h),l()}function l(){j("unpipe"),c.unpipe(t)}var c=this,d=this._readableState;switch(d.pipesCount){case 0:d.pipes=t;break;case 1:d.pipes=[d.pipes,t];break;default:d.pipes.push(t)}d.pipesCount+=1,j("pipe count=%d opts=%j",d.pipesCount,e);var p=(!e||e.end!==!1)&&t!==r.stdout&&t!==r.stderr,g=p?i:l;d.endEmitted?B(g):c.once("end",g),t.on("unpipe",n);var v=w(c);t.on("drain",v);var y=!1,_=!1;return c.on("data",a),o(t,"error",u),t.once("close",h),t.once("finish",f),t.emit("pipe",c),d.flowing||(j("pipe resume"),c.resume()),t},u.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n),this);if(!t){var r=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s>>32-e}function s(t,e,n,r,s,o,a,u){return i(t+(e^n^r)+o+a|0,u)+s|0}function o(t,e,n,r,s,o,a,u){return i(t+(e&n|~e&r)+o+a|0,u)+s|0}function a(t,e,n,r,s,o,a,u){return i(t+((e|~n)^r)+o+a|0,u)+s|0}function u(t,e,n,r,s,o,a,u){return i(t+(e&r|n&~r)+o+a|0,u)+s|0}function h(t,e,n,r,s,o,a,u){return i(t+(e^(n|~r))+o+a|0,u)+s|0}var f=n(1),l=n(45);f(r,l),r.prototype._update=function(){for(var t=new Array(16),e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var n=this._a,r=this._b,f=this._c,l=this._d,c=this._e;n=s(n,r,f,l,c,t[0],0,11),f=i(f,10),c=s(c,n,r,f,l,t[1],0,14),r=i(r,10),l=s(l,c,n,r,f,t[2],0,15),n=i(n,10),f=s(f,l,c,n,r,t[3],0,12),c=i(c,10),r=s(r,f,l,c,n,t[4],0,5),l=i(l,10),n=s(n,r,f,l,c,t[5],0,8),f=i(f,10),c=s(c,n,r,f,l,t[6],0,7),r=i(r,10),l=s(l,c,n,r,f,t[7],0,9),n=i(n,10),f=s(f,l,c,n,r,t[8],0,11),c=i(c,10),r=s(r,f,l,c,n,t[9],0,13),l=i(l,10),n=s(n,r,f,l,c,t[10],0,14),f=i(f,10),c=s(c,n,r,f,l,t[11],0,15),r=i(r,10),l=s(l,c,n,r,f,t[12],0,6),n=i(n,10),f=s(f,l,c,n,r,t[13],0,7),c=i(c,10),r=s(r,f,l,c,n,t[14],0,9),l=i(l,10),n=s(n,r,f,l,c,t[15],0,8),f=i(f,10),c=o(c,n,r,f,l,t[7],1518500249,7),r=i(r,10),l=o(l,c,n,r,f,t[4],1518500249,6),n=i(n,10),f=o(f,l,c,n,r,t[13],1518500249,8),c=i(c,10),r=o(r,f,l,c,n,t[1],1518500249,13),l=i(l,10),n=o(n,r,f,l,c,t[10],1518500249,11),f=i(f,10),c=o(c,n,r,f,l,t[6],1518500249,9),r=i(r,10),l=o(l,c,n,r,f,t[15],1518500249,7),n=i(n,10),f=o(f,l,c,n,r,t[3],1518500249,15),c=i(c,10),r=o(r,f,l,c,n,t[12],1518500249,7),l=i(l,10),n=o(n,r,f,l,c,t[0],1518500249,12),f=i(f,10),c=o(c,n,r,f,l,t[9],1518500249,15),r=i(r,10),l=o(l,c,n,r,f,t[5],1518500249,9),n=i(n,10),f=o(f,l,c,n,r,t[2],1518500249,11),c=i(c,10),r=o(r,f,l,c,n,t[14],1518500249,7),l=i(l,10),n=o(n,r,f,l,c,t[11],1518500249,13),f=i(f,10),c=o(c,n,r,f,l,t[8],1518500249,12),r=i(r,10),l=a(l,c,n,r,f,t[3],1859775393,11),n=i(n,10),f=a(f,l,c,n,r,t[10],1859775393,13),c=i(c,10),r=a(r,f,l,c,n,t[14],1859775393,6),l=i(l,10),n=a(n,r,f,l,c,t[4],1859775393,7),f=i(f,10),c=a(c,n,r,f,l,t[9],1859775393,14),r=i(r,10),l=a(l,c,n,r,f,t[15],1859775393,9),n=i(n,10),f=a(f,l,c,n,r,t[8],1859775393,13),c=i(c,10),r=a(r,f,l,c,n,t[1],1859775393,15),l=i(l,10),n=a(n,r,f,l,c,t[2],1859775393,14),f=i(f,10),c=a(c,n,r,f,l,t[7],1859775393,8),r=i(r,10),l=a(l,c,n,r,f,t[0],1859775393,13),n=i(n,10),f=a(f,l,c,n,r,t[6],1859775393,6),c=i(c,10),r=a(r,f,l,c,n,t[13],1859775393,5),l=i(l,10),n=a(n,r,f,l,c,t[11],1859775393,12),f=i(f,10),c=a(c,n,r,f,l,t[5],1859775393,7),r=i(r,10),l=a(l,c,n,r,f,t[12],1859775393,5),n=i(n,10),f=u(f,l,c,n,r,t[1],2400959708,11),c=i(c,10),r=u(r,f,l,c,n,t[9],2400959708,12),l=i(l,10),n=u(n,r,f,l,c,t[11],2400959708,14),f=i(f,10),c=u(c,n,r,f,l,t[10],2400959708,15),r=i(r,10),l=u(l,c,n,r,f,t[0],2400959708,14),n=i(n,10),f=u(f,l,c,n,r,t[8],2400959708,15),c=i(c,10),r=u(r,f,l,c,n,t[12],2400959708,9),l=i(l,10),n=u(n,r,f,l,c,t[4],2400959708,8),f=i(f,10),c=u(c,n,r,f,l,t[13],2400959708,9),r=i(r,10),l=u(l,c,n,r,f,t[3],2400959708,14),n=i(n,10),f=u(f,l,c,n,r,t[7],2400959708,5),c=i(c,10),r=u(r,f,l,c,n,t[15],2400959708,6),l=i(l,10),n=u(n,r,f,l,c,t[14],2400959708,8),f=i(f,10),c=u(c,n,r,f,l,t[5],2400959708,6),r=i(r,10),l=u(l,c,n,r,f,t[6],2400959708,5),n=i(n,10),f=u(f,l,c,n,r,t[2],2400959708,12),c=i(c,10),r=h(r,f,l,c,n,t[4],2840853838,9),l=i(l,10),n=h(n,r,f,l,c,t[0],2840853838,15),f=i(f,10),c=h(c,n,r,f,l,t[5],2840853838,5),r=i(r,10),l=h(l,c,n,r,f,t[9],2840853838,11),n=i(n,10),f=h(f,l,c,n,r,t[7],2840853838,6),c=i(c,10),r=h(r,f,l,c,n,t[12],2840853838,8),l=i(l,10),n=h(n,r,f,l,c,t[2],2840853838,13),f=i(f,10),c=h(c,n,r,f,l,t[10],2840853838,12),r=i(r,10),l=h(l,c,n,r,f,t[14],2840853838,5),n=i(n,10),f=h(f,l,c,n,r,t[1],2840853838,12),c=i(c,10),r=h(r,f,l,c,n,t[3],2840853838,13),l=i(l,10),n=h(n,r,f,l,c,t[8],2840853838,14),f=i(f,10),c=h(c,n,r,f,l,t[11],2840853838,11),r=i(r,10),l=h(l,c,n,r,f,t[6],2840853838,8),n=i(n,10),f=h(f,l,c,n,r,t[15],2840853838,5),c=i(c,10),r=h(r,f,l,c,n,t[13],2840853838,6),l=i(l,10);var d=this._a,p=this._b,g=this._c,v=this._d,y=this._e;d=h(d,p,g,v,y,t[5],1352829926,8),g=i(g,10),y=h(y,d,p,g,v,t[14],1352829926,9),p=i(p,10),v=h(v,y,d,p,g,t[7],1352829926,9),d=i(d,10),g=h(g,v,y,d,p,t[0],1352829926,11),y=i(y,10),p=h(p,g,v,y,d,t[9],1352829926,13),v=i(v,10),d=h(d,p,g,v,y,t[2],1352829926,15),g=i(g,10),y=h(y,d,p,g,v,t[11],1352829926,15),p=i(p,10),v=h(v,y,d,p,g,t[4],1352829926,5),d=i(d,10),g=h(g,v,y,d,p,t[13],1352829926,7),y=i(y,10),p=h(p,g,v,y,d,t[6],1352829926,7),v=i(v,10),d=h(d,p,g,v,y,t[15],1352829926,8),g=i(g,10),y=h(y,d,p,g,v,t[8],1352829926,11),p=i(p,10),v=h(v,y,d,p,g,t[1],1352829926,14),d=i(d,10),g=h(g,v,y,d,p,t[10],1352829926,14),y=i(y,10),p=h(p,g,v,y,d,t[3],1352829926,12),v=i(v,10),d=h(d,p,g,v,y,t[12],1352829926,6),g=i(g,10),y=u(y,d,p,g,v,t[6],1548603684,9),p=i(p,10),v=u(v,y,d,p,g,t[11],1548603684,13),d=i(d,10),g=u(g,v,y,d,p,t[3],1548603684,15),y=i(y,10),p=u(p,g,v,y,d,t[7],1548603684,7),v=i(v,10),d=u(d,p,g,v,y,t[0],1548603684,12),g=i(g,10),y=u(y,d,p,g,v,t[13],1548603684,8),p=i(p,10),v=u(v,y,d,p,g,t[5],1548603684,9),d=i(d,10),g=u(g,v,y,d,p,t[10],1548603684,11),y=i(y,10),p=u(p,g,v,y,d,t[14],1548603684,7),v=i(v,10),d=u(d,p,g,v,y,t[15],1548603684,7),g=i(g,10),y=u(y,d,p,g,v,t[8],1548603684,12),p=i(p,10),v=u(v,y,d,p,g,t[12],1548603684,7),d=i(d,10),g=u(g,v,y,d,p,t[4],1548603684,6),y=i(y,10),p=u(p,g,v,y,d,t[9],1548603684,15),v=i(v,10),d=u(d,p,g,v,y,t[1],1548603684,13),g=i(g,10),y=u(y,d,p,g,v,t[2],1548603684,11),p=i(p,10),v=a(v,y,d,p,g,t[15],1836072691,9),d=i(d,10),g=a(g,v,y,d,p,t[5],1836072691,7),y=i(y,10),p=a(p,g,v,y,d,t[1],1836072691,15),v=i(v,10),d=a(d,p,g,v,y,t[3],1836072691,11),g=i(g,10),y=a(y,d,p,g,v,t[7],1836072691,8),p=i(p,10),v=a(v,y,d,p,g,t[14],1836072691,6),d=i(d,10),g=a(g,v,y,d,p,t[6],1836072691,6),y=i(y,10),p=a(p,g,v,y,d,t[9],1836072691,14),v=i(v,10),d=a(d,p,g,v,y,t[11],1836072691,12),g=i(g,10),y=a(y,d,p,g,v,t[8],1836072691,13),p=i(p,10),v=a(v,y,d,p,g,t[12],1836072691,5),d=i(d,10),g=a(g,v,y,d,p,t[2],1836072691,14),y=i(y,10),p=a(p,g,v,y,d,t[10],1836072691,13),v=i(v,10),d=a(d,p,g,v,y,t[0],1836072691,13),g=i(g,10),y=a(y,d,p,g,v,t[4],1836072691,7),p=i(p,10),v=a(v,y,d,p,g,t[13],1836072691,5),d=i(d,10),g=o(g,v,y,d,p,t[8],2053994217,15),y=i(y,10),p=o(p,g,v,y,d,t[6],2053994217,5),v=i(v,10),d=o(d,p,g,v,y,t[4],2053994217,8),g=i(g,10),y=o(y,d,p,g,v,t[1],2053994217,11),p=i(p,10),v=o(v,y,d,p,g,t[3],2053994217,14),d=i(d,10),g=o(g,v,y,d,p,t[11],2053994217,14),y=i(y,10),p=o(p,g,v,y,d,t[15],2053994217,6),v=i(v,10),d=o(d,p,g,v,y,t[0],2053994217,14),g=i(g,10),y=o(y,d,p,g,v,t[5],2053994217,6),p=i(p,10),v=o(v,y,d,p,g,t[12],2053994217,9),d=i(d,10),g=o(g,v,y,d,p,t[2],2053994217,12),y=i(y,10),p=o(p,g,v,y,d,t[13],2053994217,9),v=i(v,10),d=o(d,p,g,v,y,t[9],2053994217,12),g=i(g,10),y=o(y,d,p,g,v,t[7],2053994217,5),p=i(p,10),v=o(v,y,d,p,g,t[10],2053994217,15),d=i(d,10),g=o(g,v,y,d,p,t[14],2053994217,8),y=i(y,10),p=s(p,g,v,y,d,t[12],0,8),v=i(v,10),d=s(d,p,g,v,y,t[15],0,5),g=i(g,10),y=s(y,d,p,g,v,t[10],0,12),p=i(p,10),v=s(v,y,d,p,g,t[4],0,9),d=i(d,10),g=s(g,v,y,d,p,t[1],0,12),y=i(y,10),p=s(p,g,v,y,d,t[5],0,5),v=i(v,10),d=s(d,p,g,v,y,t[8],0,14),g=i(g,10),y=s(y,d,p,g,v,t[7],0,6),p=i(p,10),v=s(v,y,d,p,g,t[6],0,8),d=i(d,10),g=s(g,v,y,d,p,t[2],0,13),y=i(y,10),p=s(p,g,v,y,d,t[13],0,6),v=i(v,10),d=s(d,p,g,v,y,t[14],0,5),g=i(g,10),y=s(y,d,p,g,v,t[0],0,15),p=i(p,10),v=s(v,y,d,p,g,t[3],0,13),d=i(d,10),g=s(g,v,y,d,p,t[9],0,11),y=i(y,10),p=s(p,g,v,y,d,t[11],0,11),v=i(v,10);var _=this._b+f+v|0;this._b=this._c+l+y|0,this._c=this._d+c+d|0,this._d=this._e+n+p|0,this._e=this._a+r+g|0,this._a=_},r.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=new e(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=r}).call(e,n(3).Buffer)},function(t,e,n){var e=t.exports=function(t){t=t.toLowerCase();var n=e[t];if(!n)throw new Error(t+" is not supported (we accept pull requests)");return new n};e.sha=n(56),e.sha1=n(57),e.sha224=n(58),e.sha256=n(34),e.sha384=n(59),e.sha512=n(35)},function(t,e,n){function r(){this.init(),this._w=p,l.call(this,64,56)}function i(t,e,n){return n^t&(e^n)}function s(t,e,n){return t&e|n&(t|e)}function o(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function a(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function u(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function h(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}var f=n(1),l=n(5),c=n(2).Buffer,d=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],p=new Array(64);f(r,l),r.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},r.prototype._update=function(t){for(var e=this._w,n=0|this._a,r=0|this._b,f=0|this._c,l=0|this._d,c=0|this._e,p=0|this._f,g=0|this._g,v=0|this._h,y=0;y<16;++y)e[y]=t.readInt32BE(4*y);for(;y<64;++y)e[y]=h(e[y-2])+e[y-7]+u(e[y-15])+e[y-16]|0;for(var _=0;_<64;++_){var m=v+a(c)+i(c,p,g)+d[_]+e[_]|0,w=o(n)+s(n,r,f)|0;v=g,g=p,p=c,c=l+m|0,l=f,f=r,r=n,n=m+w|0}this._a=n+this._a|0,this._b=r+this._b|0,this._c=f+this._c|0,this._d=l+this._d|0,this._e=c+this._e|0,this._f=p+this._f|0,this._g=g+this._g|0,this._h=v+this._h|0},r.prototype._hash=function(){var t=c.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=r},function(t,e,n){function r(){this.init(),this._w=y,p.call(this,128,112)}function i(t,e,n){return n^t&(e^n)}function s(t,e,n){return t&e|n&(t|e)}function o(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function a(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function u(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function h(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function f(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function l(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function c(t,e){return t>>>0>>0?1:0}var d=n(1),p=n(5),g=n(2).Buffer,v=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],y=new Array(160);d(r,p),r.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},r.prototype._update=function(t){for(var e=this._w,n=0|this._ah,r=0|this._bh,d=0|this._ch,p=0|this._dh,g=0|this._eh,y=0|this._fh,_=0|this._gh,m=0|this._hh,w=0|this._al,b=0|this._bl,S=0|this._cl,E=0|this._dl,C=0|this._el,A=0|this._fl,T=0|this._gl,U=0|this._hl,I=0;I<32;I+=2)e[I]=t.readInt32BE(4*I),e[I+1]=t.readInt32BE(4*I+4);for(;I<160;I+=2){var D=e[I-30],k=e[I-30+1],R=u(D,k),B=h(k,D);D=e[I-4],k=e[I-4+1];var P=f(D,k),x=l(k,D),M=e[I-14],F=e[I-14+1],O=e[I-32],N=e[I-32+1],L=B+F|0,V=R+M+c(L,B)|0;L=L+x|0,V=V+P+c(L,x)|0,L=L+N|0,V=V+O+c(L,N)|0,e[I]=V,e[I+1]=L}for(var j=0;j<160;j+=2){V=e[j],L=e[j+1];var q=s(n,r,d),K=s(w,b,S),Y=o(n,w),W=o(w,n),H=a(g,C),J=a(C,g),z=v[j],G=v[j+1],Z=i(g,y,_),X=i(C,A,T),$=U+J|0,Q=m+H+c($,U)|0;$=$+X|0,Q=Q+Z+c($,X)|0,$=$+G|0,Q=Q+z+c($,G)|0,$=$+L|0,Q=Q+V+c($,L)|0;var tt=W+K|0,et=Y+q+c(tt,W)|0;m=_,U=T,_=y,T=A,y=g,A=C,C=E+$|0,g=p+Q+c(C,E)|0,p=d,E=S,d=r,S=b,r=n,b=w,w=$+tt|0,n=Q+et+c(w,$)|0}this._al=this._al+w|0,this._bl=this._bl+b|0,this._cl=this._cl+S|0,this._dl=this._dl+E|0,this._el=this._el+C|0,this._fl=this._fl+A|0,this._gl=this._gl+T|0,this._hl=this._hl+U|0, this._ah=this._ah+n+c(this._al,w)|0,this._bh=this._bh+r+c(this._bl,b)|0,this._ch=this._ch+d+c(this._cl,S)|0,this._dh=this._dh+p+c(this._dl,E)|0,this._eh=this._eh+g+c(this._el,C)|0,this._fh=this._fh+y+c(this._fl,A)|0,this._gh=this._gh+_+c(this._gl,T)|0,this._hh=this._hh+m+c(this._hl,U)|0},r.prototype._hash=function(){function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}var e=g.allocUnsafe(64);return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},t.exports=r},function(t,e,n){function r(){i.call(this)}t.exports=r;var i=n(10).EventEmitter,s=n(1);s(r,i),r.Readable=n(12),r.Writable=n(54),r.Duplex=n(49),r.Transform=n(53),r.PassThrough=n(52),r.Stream=r,r.prototype.pipe=function(t,e){function n(e){t.writable&&!1===t.write(e)&&h.pause&&h.pause()}function r(){h.readable&&h.resume&&h.resume()}function s(){f||(f=!0,t.end())}function o(){f||(f=!0,"function"==typeof t.destroy&&t.destroy())}function a(t){if(u(),0===i.listenerCount(this,"error"))throw t}function u(){h.removeListener("data",n),t.removeListener("drain",r),h.removeListener("end",s),h.removeListener("close",o),h.removeListener("error",a),t.removeListener("error",a),h.removeListener("end",u),h.removeListener("close",u),t.removeListener("close",u)}var h=this;h.on("data",n),t.on("drain",r),t._isStdio||e&&e.end===!1||(h.on("end",s),h.on("close",o));var f=!1;return h.on("error",a),t.on("error",a),h.on("end",u),h.on("close",u),t.on("close",u),t.emit("pipe",h),t}},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;/*! * Copyright 2016 Amazon.com, * Inc. or its affiliates. All Rights Reserved. * * Licensed under the Amazon Software License (the "License"). * You may not use this file except in compliance with the * License. A copy of the License is located at * * http://aws.amazon.com/asl/ * * or in the "license" file accompanying this file. This file is * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, express or implied. See the License * for the specific language governing permissions and * limitations under the License. */ var r=function(){function t(e){n(this,t);var r=e||{},i=r.ValidationData,s=r.Username,o=r.Password,a=r.AuthParameters;this.validationData=i||{},this.authParameters=a||{},this.username=s,this.password=o}return t.prototype.getUsername=function(){return this.username},t.prototype.getPassword=function(){return this.password},t.prototype.getValidationData=function(){return this.validationData},t.prototype.getAuthParameters=function(){return this.authParameters},t}();e.default=r},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;var r=function(){function t(e,r){n(this,t),this.endpoint=r||"https://cognito-idp."+e+".amazonaws.com/"}return t.prototype.request=function(t,e,n){var r={"Content-Type":"application/x-amz-json-1.1","X-Amz-Target":"AWSCognitoIdentityProviderService."+t,"X-Amz-User-Agent":"cognitauth/1.0"},i={headers:r,method:"POST",mode:"cors",cache:"no-cache",body:JSON.stringify(e)},s=void 0;fetch(this.endpoint,i).then(function(t){return s=t,t}).then(function(t){return t.json().catch(function(){return{}})}).then(function(t){if(s.ok)return n(null,t);var e=(t.__type||t.code).split("#").pop(),r={code:e,name:e,message:t.message||t.Message||null};return n(r)}).catch(function(){var t=(s.headers.get("x-amzn-errortype")||"UnknownError").split(":")[0],e={code:t,name:t,statusCode:s.status,message:s.status.toString()};return n(e)})},t}();e.default=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;var s=n(38),o=r(s),a=n(20),u=r(a),h=n(24),f=r(h),l=function(){function t(e){i(this,t);var n=e||{},r=n.UserPoolId,s=n.ClientId,a=n.endpoint,u=n.AdvancedSecurityDataCollectionFlag;if(!r||!s)throw new Error("Both UserPoolId and ClientId are required.");if(!/^[\w-]+_.+$/.test(r))throw new Error("Invalid UserPoolId format.");var h=r.split("_")[0];this.userPoolId=r,this.clientId=s,this.client=new o.default(h,a),this.advancedSecurityDataCollectionFlag=u!==!1,this.storage=e.Storage||(new f.default).getStorage()}return t.prototype.getUserPoolId=function(){return this.userPoolId},t.prototype.getClientId=function(){return this.clientId},t.prototype.signUp=function(t,e,n,r,i){var s=this,o={ClientId:this.clientId,Username:t,Password:e,UserAttributes:n,ValidationData:r};this.getUserContextData(t)&&(o.UserContextData=this.getUserContextData(t)),this.client.request("SignUp",o,function(e,n){if(e)return i(e,null);var r={Username:t,Pool:s,Storage:s.storage},o={user:new u.default(r),userConfirmed:n.UserConfirmed,userSub:n.UserSub};return i(null,o)})},t.prototype.getCurrentUser=function(){var t="CognitoIdentityServiceProvider."+this.clientId+".LastAuthUser",e=this.storage.getItem(t);if(e){var n={Username:e,Pool:this,Storage:this.storage};return new u.default(n)}return null},t.prototype.getUserContextData=function(t){if("undefined"!=typeof AmazonCognitoAdvancedSecurityData){var e=AmazonCognitoAdvancedSecurityData;if(this.advancedSecurityDataCollectionFlag){var n=e.getData(t,this.userPoolId,this.clientId);if(n){var r={EncodedData:n};return r}}return{}}},t}();e.default=l},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;var s=n(47),o=r(s),a=function(){function t(e){i(this,t),this.domain=e.domain,e.path?this.path=e.path:this.path="/",Object.prototype.hasOwnProperty.call(e,"expires")?this.expires=e.expires:this.expires=365,Object.prototype.hasOwnProperty.call(e,"secure")?this.secure=e.secure:this.secure=!0}return t.prototype.setItem=function(t,e){return o.set(t,e,{path:this.path,expires:this.expires,domain:this.domain,secure:this.secure}),o.get(t)},t.prototype.getItem=function(t){return o.get(t)},t.prototype.removeItem=function(t){return o.remove(t,{path:this.path,domain:this.domain,secure:this.secure})},t.prototype.clear=function(){var t=o.get(),e=void 0;for(e=0;e0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function r(t){return 3*t.length/4-n(t)}function i(t){var e,r,i,s,o,a=t.length;s=n(t),o=new f(3*a/4-s),r=s>0?a-4:a;var u=0;for(e=0;e>16&255,o[u++]=i>>8&255,o[u++]=255&i;return 2===s?(i=h[t.charCodeAt(e)]<<2|h[t.charCodeAt(e+1)]>>4,o[u++]=255&i):1===s&&(i=h[t.charCodeAt(e)]<<10|h[t.charCodeAt(e+1)]<<4|h[t.charCodeAt(e+2)]>>2,o[u++]=i>>8&255,o[u++]=255&i),o}function s(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[63&t]}function o(t,e,n){for(var r,i=[],o=e;of?f:h+a));return 1===r?(e=t[n-1],i+=u[e>>2],i+=u[e<<4&63],i+="=="):2===r&&(e=(t[n-2]<<8)+t[n-1],i+=u[e>>10],i+=u[e>>4&63],i+=u[e<<2&63],i+="="),s.push(i),s.join("")}e.byteLength=r,e.toByteArray=i,e.fromByteArray=a;for(var u=[],h=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,d=l.length;c>>2),o=0,a=0;ou?e=t(e):e.length=this._blockSize;){for(var s=this._blockOffset;s0;++o)this._length[o]+=a,a=this._length[o]/4294967296|0,a>0&&(this._length[o]-=4294967296*a);return this},r.prototype._update=function(t){throw new Error("_update is not implemented")},r.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();return void 0!==t&&(e=e.toString(t)),e},r.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=r}).call(e,n(3).Buffer)},function(t,e){e.read=function(t,e,n,r,i){var s,o,a=8*i-r-1,u=(1<>1,f=-7,l=n?i-1:0,c=n?-1:1,d=t[e+l];for(l+=c,s=d&(1<<-f)-1,d>>=-f,f+=a;f>0;s=256*s+t[e+l],l+=c,f-=8);for(o=s&(1<<-f)-1,s>>=-f,f+=r;f>0;o=256*o+t[e+l],l+=c,f-=8);if(0===s)s=1-h;else{if(s===u)return o?NaN:(d?-1:1)*(1/0);o+=Math.pow(2,r),s-=h}return(d?-1:1)*o*Math.pow(2,s-r)},e.write=function(t,e,n,r,i,s){var o,a,u,h=8*s-i-1,f=(1<>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:s-1,p=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=f):(o=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-o))<1&&(o--,u*=2),e+=o+l>=1?c/u:c*Math.pow(2,1-l),e*u>=2&&(o++,u/=2),o+l>=f?(a=0,o=f):o+l>=1?(a=(e*u-1)*Math.pow(2,i),o+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,i),o=0));i>=8;t[n+d]=255&a,d+=p,a/=256,i-=8);for(o=o<0;t[n+d]=255&o,d+=p,o/=256,h-=8);t[n+d-p]|=128*g}},function(t,e,n){var r,i;!function(s){var o=!1;if(r=s,i="function"==typeof r?r.call(e,n,e,t):r,!(void 0!==i&&(t.exports=i)),o=!0,t.exports=s(),o=!0,!o){var a=window.Cookies,u=window.Cookies=s();u.noConflict=function(){return window.Cookies=a,u}}}(function(){function t(){for(var t=0,e={};t1){if(s=t({path:"/"},r.defaults,s),"number"==typeof s.expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*s.expires),s.expires=a}s.expires=s.expires?s.expires.toUTCString():"";try{o=JSON.stringify(i),/^[\{\[]/.test(o)&&(i=o)}catch(t){}i=n.write?n.write(i,e):encodeURIComponent(String(i)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=encodeURIComponent(String(e)),e=e.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),e=e.replace(/[\(\)]/g,escape);var u="";for(var h in s)s[h]&&(u+="; "+h,s[h]!==!0&&(u+="="+s[h]));return document.cookie=e+"="+i+u}e||(o={});for(var f=document.cookie?document.cookie.split("; "):[],l=/(%[0-9A-Z]{2})+/g,c=0;c65536)throw new Error("requested too many random bytes");var i=new e.Uint8Array(t);t>0&&a.getRandomValues(i);var s=o.from(i.buffer);return"function"==typeof n?r.nextTick(function(){n(null,s)}):s}var o=n(2).Buffer,a=e.crypto||e.msCrypto;a&&a.getRandomValues?t.exports=s:t.exports=i}).call(e,function(){return this}(),n(7))},function(t,e,n){t.exports=n(4)},function(t,e,n){"use strict";function r(t){return this instanceof r?void i.call(this,t):new r(t)}t.exports=r;var i=n(29),s=n(6);s.inherits=n(1),s.inherits(r,i),r.prototype._transform=function(t,e,n){n(null,t)}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e,n){t.copy(e,n)}var s=n(2).Buffer;t.exports=function(){function t(){r(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n},t.prototype.concat=function(t){if(0===this.length)return s.alloc(0);if(1===this.length)return this.head.data;for(var e=s.allocUnsafe(t>>>0),n=this.head,r=0;n;)i(n.data,e,r),r+=n.data.length,n=n.next;return e},t}()},function(t,e,n){t.exports=n(12).PassThrough},function(t,e,n){t.exports=n(12).Transform},function(t,e,n){t.exports=n(11)},function(t,e,n){(function(t,e){!function(t,n){"use strict";function r(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n>>27}function s(t){return t<<30|t>>>2}function o(t,e,n,r){return 0===t?e&n|~e&r:2===t?e&n|e&r|n&r:e^n^r}var a=n(1),u=n(5),h=n(2).Buffer,f=[1518500249,1859775393,-1894007588,-899497514],l=new Array(80);a(r,u),r.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},r.prototype._update=function(t){for(var e=this._w,n=0|this._a,r=0|this._b,a=0|this._c,u=0|this._d,h=0|this._e,l=0;l<16;++l)e[l]=t.readInt32BE(4*l);for(;l<80;++l)e[l]=e[l-3]^e[l-8]^e[l-14]^e[l-16];for(var c=0;c<80;++c){var d=~~(c/20),p=i(n)+o(d,r,a,u)+h+e[c]+f[d]|0;h=u,u=a,a=s(r),r=n,n=p}this._a=n+this._a|0,this._b=r+this._b|0,this._c=a+this._c|0,this._d=u+this._d|0,this._e=h+this._e|0},r.prototype._hash=function(){var t=h.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=r},function(t,e,n){function r(){this.init(),this._w=c,h.call(this,64,56)}function i(t){return t<<1|t>>>31}function s(t){return t<<5|t>>>27}function o(t){return t<<30|t>>>2}function a(t,e,n,r){return 0===t?e&n|~e&r:2===t?e&n|e&r|n&r:e^n^r}var u=n(1),h=n(5),f=n(2).Buffer,l=[1518500249,1859775393,-1894007588,-899497514],c=new Array(80);u(r,h),r.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},r.prototype._update=function(t){for(var e=this._w,n=0|this._a,r=0|this._b,u=0|this._c,h=0|this._d,f=0|this._e,c=0;c<16;++c)e[c]=t.readInt32BE(4*c);for(;c<80;++c)e[c]=i(e[c-3]^e[c-8]^e[c-14]^e[c-16]);for(var d=0;d<80;++d){var p=~~(d/20),g=s(n)+a(p,r,u,h)+f+e[d]+l[p]|0;f=h,h=u,u=o(r),r=n,n=g}this._a=n+this._a|0,this._b=r+this._b|0,this._c=u+this._c|0,this._d=h+this._d|0,this._e=f+this._e|0},r.prototype._hash=function(){var t=f.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=r},function(t,e,n){function r(){this.init(),this._w=u,o.call(this,64,56)}var i=n(1),s=n(34),o=n(5),a=n(2).Buffer,u=new Array(64);i(r,s),r.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},r.prototype._hash=function(){var t=a.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=r},function(t,e,n){function r(){this.init(),this._w=u,o.call(this,128,112)}var i=n(1),s=n(35),o=n(5),a=n(2).Buffer,u=new Array(160);i(r,s),r.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},r.prototype._hash=function(){function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}var e=a.allocUnsafe(48);return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},t.exports=r},function(t,e){(function(e){function n(t,e){function n(){if(!i){if(r("throwDeprecation"))throw new Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),i=!0}return t.apply(this,arguments)}if(r("noDeprecation"))return t;var i=!1;return n}function r(t){try{if(!e.localStorage)return!1}catch(t){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=n}).call(e,function(){return this}())},function(t,e,n){(function(t){function r(t,e){this._id=t,this._clearFn=e}var i=Function.prototype.apply;e.setTimeout=function(){return new r(i.call(setTimeout,window,arguments),clearTimeout)},e.setInterval=function(){return new r(i.call(setInterval,window,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(window,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(55),e.setImmediate="undefined"!=typeof self&&self.setImmediate||"undefined"!=typeof t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||"undefined"!=typeof t&&t.clearImmediate||this&&this.clearImmediate}).call(e,function(){return this}())},function(t,e){}])}); //# sourceMappingURL=cognitauth.min.js.map