From 76d5d0e7c6ef6dd9e5ffd87ea1f79e95649cabea Mon Sep 17 00:00:00 2001 From: Floris Date: Tue, 3 Jan 2017 15:34:35 +0100 Subject: [PATCH] Version 0.0.8 --- build/phaser-amazon-cognito.d.ts | 78 --------- build/phaser-amazon-cognito.js | 268 ----------------------------- build/phaser-amazon-cognito.js.map | 1 - build/phaser-amazon-cognito.min.js | 20 --- package.json | 2 +- 5 files changed, 1 insertion(+), 368 deletions(-) delete mode 100644 build/phaser-amazon-cognito.d.ts delete mode 100644 build/phaser-amazon-cognito.js delete mode 100644 build/phaser-amazon-cognito.js.map delete mode 100644 build/phaser-amazon-cognito.min.js diff --git a/build/phaser-amazon-cognito.d.ts b/build/phaser-amazon-cognito.d.ts deleted file mode 100644 index 96b9587..0000000 --- a/build/phaser-amazon-cognito.d.ts +++ /dev/null @@ -1,78 +0,0 @@ -/// -declare module Fabrique { - module Plugins { - interface ICognitoGame extends Phaser.Game { - cognito: Fabrique.Plugins.Cognito; - } - class Cognito extends Phaser.Plugin { - private userPool; - private currentUser; - constructor(game: ICognitoGame, pluginManager: Phaser.PluginManager, region: string, IdentityPoolId: string); - /** - * Setting userPool configuration. - */ - setPoolInfo(userPoolId: string, clientId: string): void; - /** - * Register a new user to the userPool. - * @param attributes Optional attributes, saved with the user. - * @returns {Promise|Promise} The user or an error in a promise - */ - register(username: string, password: string, email: string, attributes?: { - name: string; - value: string; - }[]): Promise; - /** - * Confirm the user, allowing him to login. - * @param confirmationCode Code sent to users email. - * @returns {Promise|Promise} Returns null or an error in a promise - */ - confirmRegistration(confirmationCode: string): Promise; - /** - * Resends the confirmation email to the user. - * @returns {Promise|Promise} Returns null or an error in a promise - */ - resendConfirmation(): Promise; - /** - * Logs in a user with given credentials. - * @returns {Promise|Promise} An object with the user and sessionToken or an error in a promise - */ - login(username: string, password: string): Promise; - /** - * Logs the user out. - */ - logout(): void; - /** - * Sends a reset password code to the user's email. - * @returns {Promise|Promise} Returns null or an error in a promise - */ - resetPassword(): Promise; - /** - * Changes the users password after reset. - * @param code The code given in the reset email. - * @param newPassword The new password to be used. - * @returns {Promise|Promise} Returns null or an error in a promise - */ - confirmResetPassword(code: string, newPassword: string): Promise; - /** - * Changes the password for the current user. The user has to be logged in. - * @param oldPassword The current password for the user. - * @param newPassword The new password for the user. - * @returns {Promise|Promise} Returns null or an error in a promise - */ - changePassword(oldPassword: string, newPassword: string): Promise; - /** - * Checks if the current user has a valid session with the server. - * @returns {Promise|Promise} The session of the user or an error in a promise - */ - validateSession(): Promise; - /** - * Sets the current user to use for all commands except login and register. - */ - setUser(username: string): void; - /** - * Loads the user and session from localStorage, saved on the device. - */ - loadStorageUser(): void; - } - } -} diff --git a/build/phaser-amazon-cognito.js b/build/phaser-amazon-cognito.js deleted file mode 100644 index b604d34..0000000 --- a/build/phaser-amazon-cognito.js +++ /dev/null @@ -1,268 +0,0 @@ -/*! - * phaser-amazon-cognito - version 0.0.6 - * A Phaser plugin that adds User Login/Sync support trough Amazon Cognito Identity/Syn - * - * OrangeGames - * Build at 03-01-2017 - * Released under MIT License - */ - -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; -var Fabrique; -(function (Fabrique) { - var Plugins; - (function (Plugins) { - var Cognito = (function (_super) { - __extends(Cognito, _super); - function Cognito(game, pluginManager, region, IdentityPoolId) { - _super.call(this, game, pluginManager); - Object.defineProperty(game, 'cognito', { - value: this - }); - } - /** - * Setting userPool configuration. - */ - Cognito.prototype.setPoolInfo = function (userPoolId, clientId) { - this.userPool = new AWSCognito.CognitoIdentityServiceProvider.CognitoUserPool({ - UserPoolId: userPoolId, - ClientId: clientId - }); - }; - /** - * Register a new user to the userPool. - * @param attributes Optional attributes, saved with the user. - * @returns {Promise|Promise} The user or an error in a promise - */ - Cognito.prototype.register = function (username, password, email, attributes) { - var _this = this; - if (attributes === void 0) { attributes = null; } - var attr = []; - // Add required fields first - attr.push(new AWSCognito.CognitoIdentityServiceProvider.CognitoUserAttribute({ - Name: 'preferred_username', - Value: username - })); - attr.push(new AWSCognito.CognitoIdentityServiceProvider.CognitoUserAttribute({ - Name: 'email', - Value: email - })); - // Add all others - if (attributes !== null && attributes.length > 0) { - for (var i = 0; i < attributes.length; i++) { - attr.push(new AWSCognito.CognitoIdentityServiceProvider.CognitoUserAttribute({ - Name: attributes[i].name, - Value: attributes[i].value - })); - } - } - return new Promise(function (resolve, reject) { - _this.userPool.signUp(username, password, attr, null, function (error, res) { - if (error !== null) { - reject(error); - } - else { - _this.currentUser = res.user; - resolve(res.user); - } - }); - }); - }; - /** - * Confirm the user, allowing him to login. - * @param confirmationCode Code sent to users email. - * @returns {Promise|Promise} Returns null or an error in a promise - */ - Cognito.prototype.confirmRegistration = function (confirmationCode) { - var _this = this; - return new Promise(function (resolve, reject) { - if (!_this.currentUser) { - reject('User was not set!'); - } - else { - _this.currentUser.confirmRegistration(confirmationCode, true, function (error, res) { - if (error !== null) { - reject(error); - } - else { - resolve(null); - } - }); - } - }); - }; - /** - * Resends the confirmation email to the user. - * @returns {Promise|Promise} Returns null or an error in a promise - */ - Cognito.prototype.resendConfirmation = function () { - var _this = this; - return new Promise(function (resolve, reject) { - if (!_this.currentUser) { - reject('User was not set!'); - } - else { - _this.currentUser.resendConfirmationCode(function (error, result) { - if (error !== null) { - reject(error); - } - else { - resolve(null); - } - }); - } - }); - }; - /** - * Logs in a user with given credentials. - * @returns {Promise|Promise} An object with the user and sessionToken or an error in a promise - */ - Cognito.prototype.login = function (username, password) { - var _this = this; - var authentication = new AWSCognito.CognitoIdentityServiceProvider.AuthenticationDetails({ - Username: username, - Password: password - }); - this.setUser(username); - return new Promise(function (resolve, reject) { - _this.currentUser.authenticateUser(authentication, { - onSuccess: function (res) { - resolve({ - user: _this.currentUser, - sessionToken: res.getAccessToken().getJwtToken() - }); - }, - onFailure: function (error) { - reject(error); - } - }); - }); - }; - /** - * Logs the user out. - */ - Cognito.prototype.logout = function () { - this.currentUser.signOut(); - }; - /** - * Sends a reset password code to the user's email. - * @returns {Promise|Promise} Returns null or an error in a promise - */ - Cognito.prototype.resetPassword = function () { - var _this = this; - return new Promise(function (resolve, reject) { - if (!_this.currentUser) { - reject('User was not set!'); - } - else { - _this.currentUser.forgotPassword({ - onSuccess: function (res) { - resolve(); - }, - onFailure: function (error) { - reject(error); - } - }); - } - }); - }; - /** - * Changes the users password after reset. - * @param code The code given in the reset email. - * @param newPassword The new password to be used. - * @returns {Promise|Promise} Returns null or an error in a promise - */ - Cognito.prototype.confirmResetPassword = function (code, newPassword) { - var _this = this; - return new Promise(function (resolve, reject) { - if (!_this.currentUser) { - reject('User was not set!'); - } - else { - _this.currentUser.confirmPassword(code, newPassword, { - onSuccess: function (res) { - resolve(); - }, - onFailure: function (error) { - reject(error); - } - }); - } - }); - }; - /** - * Changes the password for the current user. The user has to be logged in. - * @param oldPassword The current password for the user. - * @param newPassword The new password for the user. - * @returns {Promise|Promise} Returns null or an error in a promise - */ - Cognito.prototype.changePassword = function (oldPassword, newPassword) { - var _this = this; - return new Promise(function (resolve, reject) { - if (!_this.currentUser) { - reject('User was not set!'); - } - else { - _this.currentUser.changePassword(oldPassword, newPassword, function (error, result) { - if (error !== null) { - reject(error); - } - else { - resolve(null); - } - }); - } - }); - }; - /** - * Checks if the current user has a valid session with the server. - * @returns {Promise|Promise} The session of the user or an error in a promise - */ - Cognito.prototype.validateSession = function () { - var _this = this; - return new Promise(function (resolve, reject) { - if (!_this.currentUser) { - reject('User was not set!'); - } - else { - _this.currentUser.getSession(function (error, session) { - if (error !== null) { - reject(error); - } - else { - if (session.isValid()) { - resolve(session); - } - else { - reject(null); - } - } - }); - } - }); - }; - /** - * Sets the current user to use for all commands except login and register. - */ - Cognito.prototype.setUser = function (username) { - this.currentUser = new AWSCognito.CognitoIdentityServiceProvider.CognitoUser({ - Username: username, - Pool: this.userPool - }); - }; - /** - * Loads the user and session from localStorage, saved on the device. - */ - Cognito.prototype.loadStorageUser = function () { - this.currentUser = this.userPool.getCurrentUser(); - }; - return Cognito; - }(Phaser.Plugin)); - Plugins.Cognito = Cognito; - })(Plugins = Fabrique.Plugins || (Fabrique.Plugins = {})); -})(Fabrique || (Fabrique = {})); -//# sourceMappingURL=phaser-amazon-cognito.js.map \ No newline at end of file diff --git a/build/phaser-amazon-cognito.js.map b/build/phaser-amazon-cognito.js.map deleted file mode 100644 index 31f4186..0000000 --- a/build/phaser-amazon-cognito.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"phaser-amazon-cognito.js","sourceRoot":"","sources":["../ts/Cognito.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/build/phaser-amazon-cognito.min.js b/build/phaser-amazon-cognito.min.js deleted file mode 100644 index c22fb0f..0000000 --- a/build/phaser-amazon-cognito.min.js +++ /dev/null @@ -1,20 +0,0 @@ -/*! - * phaser-amazon-cognito - version 0.0.6 - * A Phaser plugin that adds User Login/Sync support trough Amazon Cognito Identity/Syn - * - * OrangeGames - * Build at 03-01-2017 - * Released under MIT License - */ - -"use strict";function BigInteger(a,b,c){null!=a&&("number"==typeof a?this.fromNumber(a,b,c):null==b&&"string"!=typeof a?this.fromString(a,256):this.fromString(a,b))}function nbi(){return new BigInteger(null)}function am1(a,b,c,d,e,f){for(;--f>=0;){var g=b*this[a++]+c[d]+e;e=Math.floor(g/67108864),c[d++]=67108863&g}return e}function am2(a,b,c,d,e,f){for(var g=32767&b,h=b>>15;--f>=0;){var i=32767&this[a],j=this[a++]>>15,k=h*i+j*g;i=g*i+((32767&k)<<15)+c[d]+(1073741823&e),e=(i>>>30)+(k>>>15)+h*j+(e>>>30),c[d++]=1073741823&i}return e}function am3(a,b,c,d,e,f){for(var g=16383&b,h=b>>14;--f>=0;){var i=16383&this[a],j=this[a++]>>14,k=h*i+j*g;i=g*i+((16383&k)<<14)+c[d]+e,e=(i>>28)+(k>>14)+h*j,c[d++]=268435455&i}return e}function int2char(a){return BI_RM.charAt(a)}function intAt(a,b){var c=BI_RC[a.charCodeAt(b)];return null==c?-1:c}function bnpCopyTo(a){for(var b=this.t-1;b>=0;--b)a[b]=this[b];a.t=this.t,a.s=this.s}function bnpFromInt(a){this.t=1,this.s=a<0?-1:0,a>0?this[0]=a:a<-1?this[0]=a+this.DV:this.t=0}function nbv(a){var b=nbi();return b.fromInt(a),b}function bnpFromString(a,b){var c;if(16==b)c=4;else if(8==b)c=3;else if(256==b)c=8;else if(2==b)c=1;else if(32==b)c=5;else{if(4!=b)return void this.fromRadix(a,b);c=2}this.t=0,this.s=0;for(var d=a.length,e=!1,f=0;--d>=0;){var g=8==c?255&a[d]:intAt(a,d);g<0?"-"==a.charAt(d)&&(e=!0):(e=!1,0==f?this[this.t++]=g:f+c>this.DB?(this[this.t-1]|=(g&(1<>this.DB-f):this[this.t-1]|=g<=this.DB&&(f-=this.DB))}8==c&&0!=(128&a[0])&&(this.s=-1,f>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==a;)--this.t}function bnToString(a){if(this.s<0)return"-"+this.negate().toString(a);var b;if(16==a)b=4;else if(8==a)b=3;else if(2==a)b=1;else if(32==a)b=5;else{if(4!=a)return this.toRadix(a);b=2}var c,d=(1<0)for(h>h)>0&&(e=!0,f=int2char(c));g>=0;)h>(h+=this.DB-b)):(c=this[g]>>(h-=b)&d,h<=0&&(h+=this.DB,--g)),c>0&&(e=!0),e&&(f+=int2char(c));return e?f:"0"}function bnNegate(){var a=nbi();return BigInteger.ZERO.subTo(this,a),a}function bnAbs(){return this.s<0?this.negate():this}function bnCompareTo(a){var b=this.s-a.s;if(0!=b)return b;var c=this.t;if(b=c-a.t,0!=b)return this.s<0?-b:b;for(;--c>=0;)if(0!=(b=this[c]-a[c]))return b;return 0}function nbits(a){var b,c=1;return 0!=(b=a>>>16)&&(a=b,c+=16),0!=(b=a>>8)&&(a=b,c+=8),0!=(b=a>>4)&&(a=b,c+=4),0!=(b=a>>2)&&(a=b,c+=2),0!=(b=a>>1)&&(a=b,c+=1),c}function bnBitLength(){return this.t<=0?0:this.DB*(this.t-1)+nbits(this[this.t-1]^this.s&this.DM)}function bnpDLShiftTo(a,b){var c;for(c=this.t-1;c>=0;--c)b[c+a]=this[c];for(c=a-1;c>=0;--c)b[c]=0;b.t=this.t+a,b.s=this.s}function bnpDRShiftTo(a,b){for(var c=a;c=0;--c)b[c+g+1]=this[c]>>e|h,h=(this[c]&f)<=0;--c)b[c]=0;b[g]=h,b.t=this.t+g+1,b.s=this.s,b.clamp()}function bnpRShiftTo(a,b){b.s=this.s;var c=Math.floor(a/this.DB);if(c>=this.t)return void(b.t=0);var d=a%this.DB,e=this.DB-d,f=(1<>d;for(var g=c+1;g>d;d>0&&(b[this.t-c-1]|=(this.s&f)<>=this.DB;if(a.t>=this.DB;d+=this.s}else{for(d+=this.s;c>=this.DB;d-=a.s}b.s=d<0?-1:0,d<-1?b[c++]=this.DV+d:d>0&&(b[c++]=d),b.t=c,b.clamp()}function bnpMultiplyTo(a,b){var c=this.abs(),d=a.abs(),e=c.t;for(b.t=e+d.t;--e>=0;)b[e]=0;for(e=0;e=0;)a[c]=0;for(c=0;c=b.DV&&(a[c+b.t]-=b.DV,a[c+b.t+1]=1)}a.t>0&&(a[a.t-1]+=b.am(c,b[c],a,2*c,0,1)),a.s=0,a.clamp()}function bnpDivRemTo(a,b,c){var d=a.abs();if(!(d.t<=0)){var e=this.abs();if(e.t0?(d.lShiftTo(i,f),e.lShiftTo(i,c)):(d.copyTo(f),e.copyTo(c));var j=f.t,k=f[j-1];if(0!=k){var l=k*(1<1?f[j-2]>>this.F2:0),m=this.FV/l,n=(1<=0&&(c[c.t++]=1,c.subTo(r,c)),BigInteger.ONE.dlShiftTo(j,r),r.subTo(f,f);f.t=0;){var s=c[--p]==k?this.DM:Math.floor(c[p]*m+(c[p-1]+o)*n);if((c[p]+=f.am(0,s,c,q,0,j))0&&c.rShiftTo(i,c),g<0&&BigInteger.ZERO.subTo(c,c)}}}function bnMod(a){var b=nbi();return this.abs().divRemTo(a,null,b),this.s<0&&b.compareTo(BigInteger.ZERO)>0&&a.subTo(b,b),b}function Classic(a){this.m=a}function cConvert(a){return a.s<0||a.compareTo(this.m)>=0?a.mod(this.m):a}function cRevert(a){return a}function cReduce(a){a.divRemTo(this.m,null,a)}function cMulTo(a,b,c){a.multiplyTo(b,c),this.reduce(c)}function cSqrTo(a,b){a.squareTo(b),this.reduce(b)}function bnpInvDigit(){if(this.t<1)return 0;var a=this[0];if(0==(1&a))return 0;var b=3&a;return b=b*(2-(15&a)*b)&15,b=b*(2-(255&a)*b)&255,b=b*(2-((65535&a)*b&65535))&65535,b=b*(2-a*b%this.DV)%this.DV,b>0?this.DV-b:-b}function Montgomery(a){this.m=a,this.mp=a.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(b,b),b}function montRevert(a){var b=nbi();return a.copyTo(b),this.reduce(b),b}function montReduce(a){for(;a.t<=this.mt2;)a[a.t++]=0;for(var b=0;b>15)*this.mpl&this.um)<<15)&a.DM;for(c=b+this.m.t,a[c]+=this.m.am(0,d,a,b,0,this.m.t);a[c]>=a.DV;)a[c]-=a.DV,a[++c]++}a.clamp(),a.drShiftTo(this.m.t,a),a.compareTo(this.m)>=0&&a.subTo(this.m,a)}function montSqrTo(a,b){a.squareTo(b),this.reduce(b)}function montMulTo(a,b,c){a.multiplyTo(b,c),this.reduce(c)}function bnpIsEven(){return 0==(this.t>0?1&this[0]:this.s)}function bnpExp(a,b){if(a>4294967295||a<1)return BigInteger.ONE;var c=nbi(),d=nbi(),e=b.convert(this),f=nbits(a)-1;for(e.copyTo(c);--f>=0;)if(b.sqrTo(c,d),(a&1<0)b.mulTo(d,e,c);else{var g=c;c=d,d=g}return b.revert(c)}function bnModPowInt(a,b){var c;return c=a<256||b.isEven()?new Classic(b):new Montgomery(b),this.exp(a,c)}function bnClone(){var a=nbi();return this.copyTo(a),a}function bnIntValue(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<>24}function bnShortValue(){return 0==this.t?this.s:this[0]<<16>>16}function bnpChunkSize(a){return Math.floor(Math.LN2*this.DB/Math.log(a))}function bnSigNum(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}function bnpToRadix(a){if(null==a&&(a=10),0==this.signum()||a<2||a>36)return"0";var b=this.chunkSize(a),c=Math.pow(a,b),d=nbv(c),e=nbi(),f=nbi(),g="";for(this.divRemTo(d,e,f);e.signum()>0;)g=(c+f.intValue()).toString(a).substr(1)+g,e.divRemTo(d,e,f);return f.intValue().toString(a)+g}function bnpFromRadix(a,b){this.fromInt(0),null==b&&(b=10);for(var c=this.chunkSize(b),d=Math.pow(b,c),e=!1,f=0,g=0,h=0;h=c&&(this.dMultiply(d),this.dAddOffset(g,0),f=0,g=0))}f>0&&(this.dMultiply(Math.pow(b,f)),this.dAddOffset(g,0)),e&&BigInteger.ZERO.subTo(this,this)}function bnpFromNumber(a,b,c){if("number"==typeof b)if(a<2)this.fromInt(1);else for(this.fromNumber(a,c),this.testBit(a-1)||this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(b);)this.dAddOffset(2,0),this.bitLength()>a&&this.subTo(BigInteger.ONE.shiftLeft(a-1),this);else{var d=new Array,e=7&a;d.length=(a>>3)+1,b.nextBytes(d),e>0?d[0]&=(1<0)for(d>d)!=(this.s&this.DM)>>d&&(b[e++]=c|this.s<=0;)d<8?(c=(this[a]&(1<>(d+=this.DB-8)):(c=this[a]>>(d-=8)&255,d<=0&&(d+=this.DB,--a)),0!=(128&c)&&(c|=-256),0==e&&(128&this.s)!=(128&c)&&++e,(e>0||c!=this.s)&&(b[e++]=c);return b}function bnEquals(a){return 0==this.compareTo(a)}function bnMin(a){return this.compareTo(a)<0?this:a}function bnMax(a){return this.compareTo(a)>0?this:a}function bnpBitwiseTo(a,b,c){var d,e,f=Math.min(a.t,this.t);for(d=0;d>=16,b+=16),0==(255&a)&&(a>>=8,b+=8),0==(15&a)&&(a>>=4,b+=4),0==(3&a)&&(a>>=2,b+=2),0==(1&a)&&++b,b}function bnGetLowestSetBit(){for(var a=0;a=this.t?0!=this.s:0!=(this[b]&1<>=this.DB;if(a.t>=this.DB;d+=this.s}else{for(d+=this.s;c>=this.DB;d+=a.s}b.s=d<0?-1:0,d>0?b[c++]=d:d<-1&&(b[c++]=this.DV+d),b.t=c,b.clamp()}function bnAdd(a){var b=nbi();return this.addTo(a,b),b}function bnSubtract(a){var b=nbi();return this.subTo(a,b),b}function bnMultiply(a){var b=nbi();return this.multiplyTo(a,b),b}function bnSquare(){var a=nbi();return this.squareTo(a),a}function bnDivide(a){var b=nbi();return this.divRemTo(a,b,null),b}function bnRemainder(a){var b=nbi();return this.divRemTo(a,null,b),b}function bnDivideAndRemainder(a){var b=nbi(),c=nbi();return this.divRemTo(a,b,c),new Array(b,c)}function bnpDMultiply(a){this[this.t]=this.am(0,a-1,this,0,0,this.t),++this.t,this.clamp()}function bnpDAddOffset(a,b){if(0!=a){for(;this.t<=b;)this[this.t++]=0;for(this[b]+=a;this[b]>=this.DV;)this[b]-=this.DV,++b>=this.t&&(this[this.t++]=0),++this[b]}}function NullExp(){}function nNop(a){return a}function nMulTo(a,b,c){a.multiplyTo(b,c)}function nSqrTo(a,b){a.squareTo(b)}function bnPow(a){return this.exp(a,new NullExp)}function bnpMultiplyLowerTo(a,b,c){var d=Math.min(this.t+a.t,b);for(c.s=0,c.t=d;d>0;)c[--d]=0;var e;for(e=c.t-this.t;d=0;)c[d]=0;for(d=Math.max(b-this.t,0);d2*this.m.t)return a.mod(this.m);if(a.compareTo(this.m)<0)return a;var b=nbi();return a.copyTo(b),this.reduce(b),b}function barrettRevert(a){return a}function barrettReduce(a){for(a.drShiftTo(this.m.t-1,this.r2),a.t>this.m.t+1&&(a.t=this.m.t+1,a.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);a.compareTo(this.r2)<0;)a.dAddOffset(1,this.m.t+1);for(a.subTo(this.r2,a);a.compareTo(this.m)>=0;)a.subTo(this.m,a)}function barrettSqrTo(a,b){a.squareTo(b),this.reduce(b)}function barrettMulTo(a,b,c){a.multiplyTo(b,c),this.reduce(c)}function bnModPow(a,b){var c,d,e=a.bitLength(),f=nbv(1);if(e<=0)return f;c=e<18?1:e<48?3:e<144?4:e<768?5:6,d=e<8?new Classic(b):b.isEven()?new Barrett(b):new Montgomery(b);var g=new Array,h=3,i=c-1,j=(1<1){var k=nbi();for(d.sqrTo(g[1],k);h<=j;)g[h]=nbi(),d.mulTo(k,g[h-2],g[h]),h+=2}var l,m,n=a.t-1,o=!0,p=nbi();for(e=nbits(a[n])-1;n>=0;){for(e>=i?l=a[n]>>e-i&j:(l=(a[n]&(1<0&&(l|=a[n-1]>>this.DB+e-i)),h=c;0==(1&l);)l>>=1,--h;if((e-=h)<0&&(e+=this.DB,--n),o)g[l].copyTo(f),o=!1;else{for(;h>1;)d.sqrTo(f,p),d.sqrTo(p,f),h-=2;h>0?d.sqrTo(f,p):(m=f,f=p,p=m),d.mulTo(p,g[l],f)}for(;n>=0&&0==(a[n]&1<0&&(b.rShiftTo(f,b),c.rShiftTo(f,c));b.signum()>0;)(e=b.getLowestSetBit())>0&&b.rShiftTo(e,b),(e=c.getLowestSetBit())>0&&c.rShiftTo(e,c),b.compareTo(c)>=0?(b.subTo(c,b),b.rShiftTo(1,b)):(c.subTo(b,c),c.rShiftTo(1,c));return f>0&&c.lShiftTo(f,c),c}function bnpModInt(a){if(a<=0)return 0;var b=this.DV%a,c=this.s<0?a-1:0;if(this.t>0)if(0==b)c=this[0]%a;else for(var d=this.t-1;d>=0;--d)c=(b*c+this[d])%a;return c}function bnModInverse(a){var b=a.isEven();if(this.isEven()&&b||0==a.signum())return BigInteger.ZERO;for(var c=a.clone(),d=this.clone(),e=nbv(1),f=nbv(0),g=nbv(0),h=nbv(1);0!=c.signum();){for(;c.isEven();)c.rShiftTo(1,c),b?(e.isEven()&&f.isEven()||(e.addTo(this,e),f.subTo(a,f)),e.rShiftTo(1,e)):f.isEven()||f.subTo(a,f),f.rShiftTo(1,f);for(;d.isEven();)d.rShiftTo(1,d),b?(g.isEven()&&h.isEven()||(g.addTo(this,g),h.subTo(a,h)),g.rShiftTo(1,g)):h.isEven()||h.subTo(a,h),h.rShiftTo(1,h);c.compareTo(d)>=0?(c.subTo(d,c),b&&e.subTo(g,e),f.subTo(h,f)):(d.subTo(c,d),b&&g.subTo(e,g),h.subTo(f,h))}return 0!=d.compareTo(BigInteger.ONE)?BigInteger.ZERO:h.compareTo(a)>=0?h.subtract(a):h.signum()<0?(h.addTo(a,h),h.signum()<0?h.add(a):h):h}function bnIsProbablePrime(a){var b,c=this.abs();if(1==c.t&&c[0]<=lowprimes[lowprimes.length-1]){for(b=0;b>1,a>lowprimes.length&&(a=lowprimes.length);for(var e=nbi(),f=0;f>>24]^o[f>>16&255]^p[g>>8&255]^q[255&b]^d[m],i=a[f>>>24]^o[g>>16&255]^p[b>>8&255]^q[255&e]^d[m+1],j=a[g>>>24]^o[b>>16&255]^p[e>>8&255]^q[255&f]^d[m+2],b=a[b>>>24]^o[e>>16&255]^p[f>>8&255]^q[255&g]^d[m+3],m+=4,e=h,f=i,g=j;for(k=0;4>k;k++)n[c?3&-k:k]=r[e>>>24]<<24^r[f>>16&255]<<16^r[g>>8&255]<<8^r[255&b]^d[m++],h=e,e=f,f=g,g=b,b=h;return n}function u(a,b){var c,d,e,f=a.F,g=a.b,h=f[0],i=f[1],j=f[2],k=f[3],l=f[4],m=f[5],n=f[6],o=f[7];for(c=0;64>c;c++)16>c?d=b[c]:(d=b[c+1&15],e=b[c+14&15],d=b[15&c]=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+b[15&c]+b[c+9&15]|0),d=d+o+(l>>>6^l>>>11^l>>>25^l<<26^l<<21^l<<7)+(n^l&(m^n))+g[c],o=n,n=m,m=l,l=k+d|0,k=j,j=i,i=h,h=d+(i&j^k&(i^j))+(i>>>2^i>>>13^i>>>22^i<<30^i<<19^i<<10)|0;f[0]=f[0]+h|0,f[1]=f[1]+i|0,f[2]=f[2]+j|0,f[3]=f[3]+k|0,f[4]=f[4]+l|0,f[5]=f[5]+m|0,f[6]=f[6]+n|0,f[7]=f[7]+o|0}function A(a,b){var c,d=sjcl.random.K[a],e=[];for(c in d)d.hasOwnProperty(c)&&e.push(d[c]);for(c=0;cb&&(a.h[b]=a.h[b]+1|0,!a.h[b]);b++);return a.L.encrypt(a.h)}function B(a,b){return function(){b.apply(a,arguments)}}var dbits,canary=0xdeadbeefcafe,j_lm=15715070==(16777215&canary);j_lm&&"Microsoft Internet Explorer"==navigator.appName?(BigInteger.prototype.am=am2,dbits=30):j_lm&&"Netscape"!=navigator.appName?(BigInteger.prototype.am=am1,dbits=26):(BigInteger.prototype.am=am3,dbits=28),BigInteger.prototype.DB=dbits,BigInteger.prototype.DM=(1<>>24]<<24^f[c>>16&255]<<16^f[c>>8&255]<<8^f[255&c],0===a%b&&(c=c<<8^c>>>24^h<<24,h=h<<1^283*(h>>7))),d[a]=d[a-b]^c;for(b=0;a;b++,a--)c=d[3&b?a:a-4],e[b]=4>=a||4>b?c:g[0][f[c>>>24]]^g[1][f[c>>16&255]]^g[2][f[c>>8&255]]^g[3][f[255&c]]},sjcl.cipher.aes.prototype={encrypt:function(a){return t(this,a,0)},decrypt:function(a){return t(this,a,1)},s:[[[],[],[],[],[]],[[],[],[],[],[]]],O:function(){var a,b,c,d,e,f,g,h=this.s[0],i=this.s[1],j=h[4],k=i[4],l=[],m=[];for(a=0;256>a;a++)m[(l[a]=a<<1^283*(a>>7))^a]=a;for(b=c=0;!j[b];b^=d||1,c=m[c]||1)for(f=c^c<<1^c<<2^c<<3^c<<4,f=f>>8^255&f^99,j[b]=f,k[f]=b,e=l[a=l[d=l[b]]],g=16843009*e^65537*a^257*d^16843008*b,e=257*l[f]^16843008*f,a=0;4>a;a++)h[a][b]=e=e<<24^e>>>8,i[a][f]=g=g<<24^g>>>8;for(a=0;5>a;a++)h[a]=h[a].slice(0),i[a]=i[a].slice(0)}},sjcl.bitArray={bitSlice:function(a,b,c){return a=sjcl.bitArray.$(a.slice(b/32),32-(31&b)).slice(1),void 0===c?a:sjcl.bitArray.clamp(a,c-b)},extract:function(a,b,c){var d=Math.floor(-b-c&31);return((b+c-1^b)&-32?a[b/32|0]<<32-d^a[b/32+1|0]>>>d:a[b/32|0]>>>d)&(1<>b-1,1)),a},partial:function(a,b,c){return 32===a?b:(c?0|b:b<<32-a)+1099511627776*a},getPartial:function(a){return Math.round(a/1099511627776)||32},equal:function(a,b){if(sjcl.bitArray.bitLength(a)!==sjcl.bitArray.bitLength(b))return!1;var c,d=0;for(c=0;c>>b),c=a[e]<<32-b;return e=a.length?a[a.length-1]:0,a=sjcl.bitArray.getPartial(e),d.push(sjcl.bitArray.partial(b+a&31,32>>24|c>>>8&65280|(65280&c)<<8|c<<24;return a}},sjcl.codec.utf8String={fromBits:function(a){var b,c,d="",e=sjcl.bitArray.bitLength(a);for(b=0;b>>24),c<<=8;return decodeURIComponent(escape(d))},toBits:function(a){a=unescape(encodeURIComponent(a));var b,c=[],d=0;for(b=0;b>>g)>>>e),gd){if(!b)try{return sjcl.codec.base32hex.toBits(a)}catch(m){}throw new sjcl.exception.invalid("this isn't "+l+"!")}i>g?(i-=g,h.push(k^d>>>i),k=d<>>e)>>>26),6>e?(g=a[c]<<6-e,e+=26,c++):(g<<=6,e-=6);for(;3&d.length&&!b;)d+="=";return d},toBits:function(a,b){a=a.replace(/\s|=/g,"");var c,d,e=[],f=0,g=sjcl.codec.base64.B,h=0;for(b&&(g=g.substr(0,62)+"-_"),c=0;cd)throw new sjcl.exception.invalid("this isn't base64!");26>>f),h=d<<32-f):(f+=6,h^=d<<32-f)}return 56&f&&e.push(sjcl.bitArray.partial(56&f,h,1)),e}},sjcl.codec.base64url={fromBits:function(a){return sjcl.codec.base64.fromBits(a,1,1)},toBits:function(a){return sjcl.codec.base64.toBits(a,1)}},sjcl.hash.sha256=function(a){this.b[0]||this.O(),a?(this.F=a.F.slice(0),this.A=a.A.slice(0),this.l=a.l):this.reset()},sjcl.hash.sha256.hash=function(a){return(new sjcl.hash.sha256).update(a).finalize()},sjcl.hash.sha256.prototype={blockSize:512,reset:function(){return this.F=this.Y.slice(0),this.A=[],this.l=0,this},update:function(a){"string"==typeof a&&(a=sjcl.codec.utf8String.toBits(a));var b,c=this.A=sjcl.bitArray.concat(this.A,a);if(b=this.l,a=this.l=b+sjcl.bitArray.bitLength(a),9007199254740991d;e++){for(c=!0,b=2;b*b<=e;b++)if(0===e%b){c=!1;break}c&&(8>d&&(this.Y[d]=a(Math.pow(e,.5))),this.b[d]=a(Math.pow(e,1/3)),d++)}}},sjcl.mode.ccm={name:"ccm",G:[],listenProgress:function(a){sjcl.mode.ccm.G.push(a)},unListenProgress:function(a){a=sjcl.mode.ccm.G.indexOf(a),-1i)throw new sjcl.exception.invalid("ccm: iv must be at least 7 bytes");for(f=2;4>f&&j>>>8*f;f++);return f<15-i&&(f=15-i),c=h.clamp(c,8*(15-f)),b=sjcl.mode.ccm.V(a,b,c,d,e,f),g=sjcl.mode.ccm.C(a,g,c,b,e,f),h.concat(g.data,g.tag)},decrypt:function(a,b,c,d,e){e=e||64,d=d||[];var f=sjcl.bitArray,g=f.bitLength(c)/8,h=f.bitLength(b),i=f.clamp(b,h-e),j=f.bitSlice(b,h-e),h=(h-e)/8;if(7>g)throw new sjcl.exception.invalid("ccm: iv must be at least 7 bytes");for(b=2;4>b&&h>>>8*b;b++);if(b<15-g&&(b=15-g),c=f.clamp(c,8*(15-b)),i=sjcl.mode.ccm.C(a,i,c,j,e,b),a=sjcl.mode.ccm.V(a,i.data,c,d,e,b),!f.equal(i.tag,a))throw new sjcl.exception.corrupt("ccm: tag doesn't match");return i.data},na:function(a,b,c,d,e,f){var g=[],h=sjcl.bitArray,i=h.i;if(d=[h.partial(8,(b.length?64:0)|d-2<<2|f-1)],d=h.concat(d,c),d[3]|=e,d=a.encrypt(d),b.length)for(c=h.bitLength(b)/8,65279>=c?g=[h.partial(16,c)]:4294967295>=c&&(g=h.concat([h.partial(16,65534)],[c])),g=h.concat(g,b),b=0;be||16k&&(sjcl.mode.ccm.fa(g/i),k+=l),c[3]++,e=a.encrypt(c),b[g]^=e[0],b[g+1]^=e[1],b[g+2]^=e[2],b[g+3]^=e[3];return{tag:d,data:h.clamp(b,j)}}},sjcl.mode.ocb2={name:"ocb2",encrypt:function(a,b,c,d,e,f){if(128!==sjcl.bitArray.bitLength(c))throw new sjcl.exception.invalid("ocb iv must be 128 bits"); -var g,h=sjcl.mode.ocb2.S,i=sjcl.bitArray,j=i.i,k=[0,0,0,0];c=h(a.encrypt(c));var l,m=[];for(d=d||[],e=e||64,g=0;g+4e.bitLength(c)&&(h=f(h,d(h)),c=e.concat(c,[-2147483648,0,0,0])),g=f(g,c),a.encrypt(f(d(f(h,d(h))),g))},S:function(a){return[a[0]<<1^a[1]>>>31,a[1]<<1^a[2]>>>31,a[2]<<1^a[3]>>>31,a[3]<<1^135*(a[0]>>>31)]}},sjcl.mode.gcm={name:"gcm",encrypt:function(a,b,c,d,e){var f=b.slice(0);return b=sjcl.bitArray,d=d||[],a=sjcl.mode.gcm.C(!0,a,f,d,c,e||128),b.concat(a.data,a.tag)},decrypt:function(a,b,c,d,e){var f=b.slice(0),g=sjcl.bitArray,h=g.bitLength(f);if(e=e||128,d=d||[],e<=h?(b=g.bitSlice(f,h-e),f=g.bitSlice(f,0,h-e)):(b=f,f=[]),a=sjcl.mode.gcm.C(!1,a,f,d,c,e),!g.equal(a.tag,b))throw new sjcl.exception.corrupt("gcm: tag doesn't match");return a.data},ka:function(a,b){var c,d,e,f,g,h=sjcl.bitArray.i;for(e=[0,0,0,0],f=b.slice(0),c=0;128>c;c++){for((d=0!==(a[Math.floor(c/32)]&1<<31-c%32))&&(e=h(e,f)),g=0!==(1&f[3]),d=3;0>>1|(1&f[d-1])<<31;f[0]>>>=1,g&&(f[0]^=-520093696)}return e},j:function(a,b,c){var d,e=c.length;for(b=b.slice(0),d=0;de&&(a=b.hash(a)),c=0;cd||0>c)throw new sjcl.exception.invalid("invalid params to pbkdf2");"string"==typeof a&&(a=sjcl.codec.utf8String.toBits(a)),"string"==typeof b&&(b=sjcl.codec.utf8String.toBits(b)),e=e||sjcl.misc.hmac,a=new e(a);var f,g,h,i,j=[],k=sjcl.bitArray;for(i=1;32*j.length<(d||1);i++){for(e=f=a.encrypt(k.concat(b,[i])),g=1;gf;f++)e.push(4294967296*Math.random()|0);for(f=0;f=1<this.o&&(this.o=g),this.P++,this.b=sjcl.hash.sha256.hash(this.b.concat(e)),this.L=new sjcl.cipher.aes(this.b),c=0;4>c&&(this.h[c]=this.h[c]+1|0,!this.h[c]);c++);}for(c=0;c>>=1;this.c[g].update([d,this.N++,2,b,f,a.length].concat(a))}break;case"string":void 0===b&&(b=a.length),this.c[g].update([d,this.N++,3,b,f,a.length]),this.c[g].update(a);break;default:i=1}if(i)throw new sjcl.exception.bug("random: addEntropy only supports number, array of numbers or string");this.m[g]+=b,this.f+=b,h===this.u&&(this.isReady()!==this.u&&A("seeded",Math.max(this.o,this.f)),A("progress",this.getProgress()))},isReady:function(a){return a=this.T[void 0!==a?a:this.M],this.o&&this.o>=a?this.m[0]>this.ba&&(new Date).valueOf()>this.Z?this.J|this.I:this.I:this.f>=a?this.J|this.u:this.u},getProgress:function(a){return a=this.T[a?a:this.M],this.o>=a?1:this.f>a?1:this.f/a},startCollectors:function(){if(!this.D){if(this.a={loadTimeCollector:B(this,this.ma),mouseCollector:B(this,this.oa),keyboardCollector:B(this,this.la),accelerometerCollector:B(this,this.ea),touchCollector:B(this,this.qa)},window.addEventListener)window.addEventListener("load",this.a.loadTimeCollector,!1),window.addEventListener("mousemove",this.a.mouseCollector,!1),window.addEventListener("keypress",this.a.keyboardCollector,!1),window.addEventListener("devicemotion",this.a.accelerometerCollector,!1),window.addEventListener("touchmove",this.a.touchCollector,!1);else{if(!document.attachEvent)throw new sjcl.exception.bug("can't attach event");document.attachEvent("onload",this.a.loadTimeCollector),document.attachEvent("onmousemove",this.a.mouseCollector),document.attachEvent("keypress",this.a.keyboardCollector)}this.D=!0}},stopCollectors:function(){this.D&&(window.removeEventListener?(window.removeEventListener("load",this.a.loadTimeCollector,!1),window.removeEventListener("mousemove",this.a.mouseCollector,!1),window.removeEventListener("keypress",this.a.keyboardCollector,!1),window.removeEventListener("devicemotion",this.a.accelerometerCollector,!1),window.removeEventListener("touchmove",this.a.touchCollector,!1)):document.detachEvent&&(document.detachEvent("onload",this.a.loadTimeCollector),document.detachEvent("onmousemove",this.a.mouseCollector),document.detachEvent("keypress",this.a.keyboardCollector)),this.D=!1)},addEventListener:function(a,b){this.K[a][this.ga++]=b},removeEventListener:function(a,b){var c,d,e=this.K[a],f=[];for(d in e)e.hasOwnProperty(d)&&e[d]===b&&f.push(d);for(c=0;c=g.iter||64!==g.ts&&96!==g.ts&&128!==g.ts||128!==g.ks&&192!==g.ks&&256!==g.ks||2>g.iv.length||4=b.iter||64!==b.ts&&96!==b.ts&&128!==b.ts||128!==b.ks&&192!==b.ks&&256!==b.ks||!b.iv||2>b.iv.length||4this.expireTime)||this.expired||!this.accessKeyId||!this.secretAccessKey},get:function(a){var b=this;this.needsRefresh()?this.refresh(function(c){c||(b.expired=!1),a&&a(c)}):a&&a()},refresh:function(a){this.expired=!1,a()}})},{"./core":11}],13:[function(a,b,c){var d=a("../core"),e=a("../../clients/cognitoidentity"),f=a("../../clients/sts");d.CognitoIdentityCredentials=d.util.inherit(d.Credentials,{localStorageKey:{id:"aws.cognito.identity-id.",providers:"aws.cognito.identity-providers."},constructor:function(a){d.Credentials.call(this),this.expired=!0,this.params=a,this.data=null,this.identityId=null,this.loadCachedId()},refresh:function(a){var b=this;b.createClients(),b.data=null,b.identityId=null,b.getId(function(c){c?(b.clearIdOnNotAuthorized(c),a(c)):b.params.RoleArn?b.getCredentialsFromSTS(a):b.getCredentialsForIdentity(a)})},clearCachedId:function(){this.identityId=null,delete this.params.IdentityId;var a=this.params.IdentityPoolId,b=this.params.LoginId||"";delete this.storage[this.localStorageKey.id+a+b],delete this.storage[this.localStorageKey.providers+a+b]},clearIdOnNotAuthorized:function(a){var b=this;"NotAuthorizedException"==a.code&&b.clearCachedId()},getId:function(a){var b=this;return"string"==typeof b.params.IdentityId?a(null,b.params.IdentityId):void b.cognito.getId(function(c,d){!c&&d.IdentityId?(b.params.IdentityId=d.IdentityId,a(null,d.IdentityId)):a(c)})},loadCredentials:function(a,b){a&&b&&(b.expired=!1,b.accessKeyId=a.Credentials.AccessKeyId,b.secretAccessKey=a.Credentials.SecretKey,b.sessionToken=a.Credentials.SessionToken,b.expireTime=a.Credentials.Expiration)},getCredentialsForIdentity:function(a){var b=this;b.cognito.getCredentialsForIdentity(function(c,d){c?b.clearIdOnNotAuthorized(c):(b.cacheId(d),b.data=d,b.loadCredentials(b.data,b)),a(c)})},getCredentialsFromSTS:function(a){var b=this;b.cognito.getOpenIdToken(function(c,d){c?(b.clearIdOnNotAuthorized(c),a(c)):(b.cacheId(d),b.params.WebIdentityToken=d.Token,b.webIdentityCredentials.refresh(function(c){c||(b.data=b.webIdentityCredentials.data,b.sts.credentialsFrom(b.data,b)),a(c)}))})},loadCachedId:function(){var a=this;if(d.util.isBrowser()&&!a.params.IdentityId){var b=a.getStorage("id");if(b&&a.params.Logins){var c=Object.keys(a.params.Logins),e=(a.getStorage("providers")||"").split(","),f=e.filter(function(a){return c.indexOf(a)!==-1});0!==f.length&&(a.params.IdentityId=b)}else b&&(a.params.IdentityId=b)}},createClients:function(){this.webIdentityCredentials=this.webIdentityCredentials||new d.WebIdentityCredentials(this.params),this.cognito=this.cognito||new e({params:this.params}),this.sts=this.sts||new f},cacheId:function(a){this.identityId=a.IdentityId,this.params.IdentityId=this.identityId,d.util.isBrowser()&&(this.setStorage("id",a.IdentityId),this.params.Logins&&this.setStorage("providers",Object.keys(this.params.Logins).join(",")))},getStorage:function(a){return this.storage[this.localStorageKey[a]+this.params.IdentityPoolId+(this.params.LoginId||"")]},setStorage:function(a,b){try{this.storage[this.localStorageKey[a]+this.params.IdentityPoolId+(this.params.LoginId||"")]=b}catch(a){}},storage:function(){try{return d.util.isBrowser()&&null!==window.localStorage&&"object"==typeof window.localStorage?window.localStorage:{}}catch(a){return{}}}()})},{"../../clients/cognitoidentity":5,"../../clients/sts":6,"../core":11}],14:[function(a,b,c){var d=a("../core");d.CredentialProviderChain=d.util.inherit(d.Credentials,{constructor:function(a){a?this.providers=a:this.providers=d.CredentialProviderChain.defaultProviders.slice(0)},resolve:function(a){function b(e,f){if(!e&&f||c===d.length)return void a(e,f);var g=d[c++];f="function"==typeof g?g.call():g,f.get?f.get(function(a){b(a,a?null:f)}):b(null,f)}if(0===this.providers.length)return a(new Error("No providers")),this;var c=0,d=this.providers.slice(0);return b(),this}}),d.CredentialProviderChain.defaultProviders=[]},{"../core":11}],15:[function(a,b,c){var d=a("../core"),e=a("../../clients/sts");d.SAMLCredentials=d.util.inherit(d.Credentials,{constructor:function(a){d.Credentials.call(this),this.expired=!0,this.params=a},refresh:function(a){var b=this;b.createClients(),a||(a=function(a){if(a)throw a}),b.service.assumeRoleWithSAML(function(c,d){c||b.service.credentialsFrom(d,b),a(c)})},createClients:function(){this.service=this.service||new e({params:this.params})}})},{"../../clients/sts":6,"../core":11}],16:[function(a,b,c){var d=a("../core"),e=a("../../clients/sts");d.TemporaryCredentials=d.util.inherit(d.Credentials,{constructor:function(a){d.Credentials.call(this),this.loadMasterCredentials(),this.expired=!0,this.params=a||{},this.params.RoleArn&&(this.params.RoleSessionName=this.params.RoleSessionName||"temporary-credentials")},refresh:function(a){var b=this;b.createClients(),a||(a=function(a){if(a)throw a}),b.service.config.credentials=b.masterCredentials;var c=b.params.RoleArn?b.service.assumeRole:b.service.getSessionToken;c.call(b.service,function(c,d){c||b.service.credentialsFrom(d,b),a(c)})},loadMasterCredentials:function(){for(this.masterCredentials=d.config.credentials;this.masterCredentials.masterCredentials;)this.masterCredentials=this.masterCredentials.masterCredentials},createClients:function(){this.service=this.service||new e({params:this.params})}})},{"../../clients/sts":6,"../core":11}],17:[function(a,b,c){var d=a("../core"),e=a("../../clients/sts");d.WebIdentityCredentials=d.util.inherit(d.Credentials,{constructor:function(a){d.Credentials.call(this),this.expired=!0,this.params=a,this.params.RoleSessionName=this.params.RoleSessionName||"web-identity",this.data=null},refresh:function(a){var b=this;b.createClients(),a||(a=function(a){if(a)throw a}),b.service.assumeRoleWithWebIdentity(function(c,d){b.data=null,c||(b.data=d,b.service.credentialsFrom(d,b)),a(c)})},createClients:function(){this.service=this.service||new e({params:this.params})}})},{"../../clients/sts":6,"../core":11}],18:[function(a,b,c){var d=a("./core"),e=a("./sequential_executor");d.EventListeners={Core:{}},d.EventListeners={Core:(new e).addNamedListeners(function(a,b){b("VALIDATE_CREDENTIALS","validate",function(a,b){return a.service.api.signatureVersion?void a.service.config.getCredentials(function(c){c&&(a.response.error=d.util.error(c,{code:"CredentialsError",message:"Missing credentials in config"})),b()}):b()}),a("VALIDATE_REGION","validate",function(a){a.service.config.region||a.service.isGlobalEndpoint||(a.response.error=d.util.error(new Error,{code:"ConfigError",message:"Missing region in config"}))}),a("VALIDATE_PARAMETERS","validate",function(a){var b=a.service.api.operations[a.operation].input,c=a.service.config.paramValidation;new d.ParamValidator(c).validate(b,a.params)}),b("COMPUTE_SHA256","afterBuild",function(a,b){if(a.haltHandlersOnError(),!a.service.api.signatureVersion)return b();if(a.service.getSignerClass(a)===d.Signers.V4){var c=a.httpRequest.body||"";d.util.computeSha256(c,function(c,d){c?b(c):(a.httpRequest.headers["X-Amz-Content-Sha256"]=d,b())})}else b()}),a("SET_CONTENT_LENGTH","afterBuild",function(a){if(void 0===a.httpRequest.headers["Content-Length"]){var b=d.util.string.byteLength(a.httpRequest.body);a.httpRequest.headers["Content-Length"]=b}}),a("SET_HTTP_HOST","afterBuild",function(a){a.httpRequest.headers.Host=a.httpRequest.endpoint.host}),a("RESTART","restart",function(){var a=this.response.error;a&&a.retryable&&(this.httpRequest=new d.HttpRequest(this.service.endpoint,this.service.region),this.response.retryCount=600?this.emit("sign",[this],function(a){a?b(a):g()}):g()}),a("HTTP_HEADERS","httpHeaders",function(a,b,c){c.httpResponse.statusCode=a,c.httpResponse.headers=b,c.httpResponse.body=new d.util.Buffer(""),c.httpResponse.buffers=[],c.httpResponse.numBytes=0;var e=b.date||b.Date;if(e){var f=Date.parse(e);c.request.service.config.correctClockSkew&&d.util.isClockSkewed(f)&&d.util.applyClockOffset(f)}}),a("HTTP_DATA","httpData",function(a,b){if(a){if(d.util.isNode()){b.httpResponse.numBytes+=a.length;var c=b.httpResponse.headers["content-length"],e={loaded:b.httpResponse.numBytes,total:c};b.request.emit("httpDownloadProgress",[e,b])}b.httpResponse.buffers.push(new d.util.Buffer(a))}}),a("HTTP_DONE","httpDone",function(a){if(a.httpResponse.buffers&&a.httpResponse.buffers.length>0){var b=d.util.buffer.concat(a.httpResponse.buffers);a.httpResponse.body=b}delete a.httpResponse.numBytes,delete a.httpResponse.buffers}),a("FINALIZE_ERROR","retry",function(a){a.httpResponse.statusCode&&(a.error.statusCode=a.httpResponse.statusCode,void 0===a.error.retryable&&(a.error.retryable=this.service.retryableError(a.error,this)))}),a("INVALIDATE_CREDENTIALS","retry",function(a){if(a.error)switch(a.error.code){case"RequestExpired":case"ExpiredTokenException":case"ExpiredToken":a.error.retryable=!0,a.request.service.config.credentials.expired=!0}}),a("EXPIRED_SIGNATURE","retry",function(a){var b=a.error;b&&"string"==typeof b.code&&"string"==typeof b.message&&b.code.match(/Signature/)&&b.message.match(/expired/)&&(a.error.retryable=!0)}),a("CLOCK_SKEWED","retry",function(a){a.error&&this.service.clockSkewError(a.error)&&this.service.config.correctClockSkew&&d.config.isClockSkewed&&(a.error.retryable=!0)}),a("REDIRECT","retry",function(a){a.error&&a.error.statusCode>=300&&a.error.statusCode<400&&a.httpResponse.headers.location&&(this.httpRequest.endpoint=new d.Endpoint(a.httpResponse.headers.location),this.httpRequest.headers.Host=this.httpRequest.endpoint.host,a.error.redirect=!0,a.error.retryable=!0)}),a("RETRY_CHECK","retry",function(a){a.error&&(a.error.redirect&&a.redirectCount=this.HEADERS_RECEIVED&&!l){try{k.responseType="arraybuffer"}catch(a){}i.statusCode=k.status,i.headers=g.parseHeaders(k.getAllResponseHeaders()),i.emit("headers",i.statusCode,i.headers),l=!0}this.readyState===this.DONE&&g.finishRequest(k,i)},!1),k.upload.addEventListener("progress",function(a){i.emit("sendProgress",a)}),k.addEventListener("progress",function(a){i.emit("receiveProgress",a)},!1),k.addEventListener("timeout",function(){f(d.util.error(new Error("Timeout"),{code:"TimeoutError"}))},!1),k.addEventListener("error",function(){f(d.util.error(new Error("Network Failure"),{code:"NetworkingError"}))},!1),c(i),k.open(a.method,j,b.xhrAsync!==!1),d.util.each(a.headers,function(a,b){"Content-Length"!==a&&"User-Agent"!==a&&"Host"!==a&&k.setRequestHeader(a,b)}),b.timeout&&b.xhrAsync!==!1&&(k.timeout=b.timeout),b.xhrWithCredentials&&(k.withCredentials=!0);try{k.send(a.body)}catch(b){if(!a.body||"object"!=typeof a.body.buffer)throw b;k.send(a.body.buffer)}return i},parseHeaders:function(a){var b={};return d.util.arrayEach(a.split(/\r?\n/),function(a){var c=a.split(":",1)[0],d=a.substring(c.length+2);c.length>0&&(b[c.toLowerCase()]=d)}),b},finishRequest:function(a,b){var c;if("arraybuffer"===a.responseType&&a.response){var e=a.response;c=new d.util.Buffer(e.byteLength);for(var f=new Uint8Array(e),g=0;g1){var e=this.errors.join("\n* ");throw e="There were "+this.errors.length+" validation errors:\n* "+e,d.util.error(new Error(e),{code:"MultipleValidationErrors",errors:this.errors})}if(1===this.errors.length)throw this.errors[0];return!0},fail:function(a,b){this.errors.push(d.util.error(new Error(b),{code:a}))},validateStructure:function(a,b,c){this.validateType(b,c,["object"],"structure");for(var d,e=0;a.required&&e= "+a.min+", but found "+b+" for "+c),this.validation.max&&void 0!==a.max&&b>a.max&&this.fail("MaxRangeError","Expected "+d+" <= "+a.max+", but found "+b+" for "+c)},validateEnum:function(a,b,c){this.validation["enum"]&&void 0!==a["enum"]&&a["enum"].indexOf(b)===-1&&this.fail("EnumError","Found string value of "+b+", but expected "+a["enum"].join("|")+" for "+c)},validateType:function(a,b,c,e){if(null===a||void 0===a)return!1;for(var f=!1,g=0;g0){var d=JSON.parse(c.body.toString());(d.__type||d.code)&&(b.code=(d.__type||d.code).split("#").pop()),"RequestEntityTooLarge"===b.code?b.message="Request body must be less than 1 MB":b.message=d.message||d.Message||null}else b.statusCode=c.statusCode,b.message=c.statusCode.toString();a.error=g.error(new Error,b)}function f(a){var b=a.httpResponse.body.toString()||"{}";if(a.request.service.config.convertResponseTypes===!1)a.data=JSON.parse(b);else{var c=a.request.service.api.operations[a.request.operation],d=c.output||{},e=new i;a.data=e.parse(b,d)}}var g=a("../util"),h=a("../json/builder"),i=a("../json/parser");b.exports={buildRequest:d,extractError:e,extractData:f}},{"../json/builder":21,"../json/parser":22,"../util":53}],31:[function(a,b,c){function d(a){var b=a.service.api.operations[a.operation],c=a.httpRequest;c.headers["Content-Type"]="application/x-www-form-urlencoded; charset=utf-8",c.params={Version:a.service.api.apiVersion,Action:b.name};var d=new i;d.serialize(a.params,b.input,function(a,b){c.params[a]=b}),c.body=h.queryParamsToString(c.params)}function e(a){var b,c=a.httpResponse.body.toString();b=c.match("=0?"&":"?";var g=[];j.arrayEach(Object.keys(e).sort(),function(a){Array.isArray(e[a])||(e[a]=[e[a]]);for(var b=0;b0){b=new h.XML.Parser;var l=b.parse(d.toString(),f);i.update(a.data,l)}}var h=a("../core"),i=a("../util"),j=a("./rest");b.exports={buildRequest:e,extractError:f,extractData:g}},{"../core":11,"../util":53,"./rest":32}],35:[function(a,b,c){function d(){}function e(a){return a.isQueryName||"ec2"!==a.api.protocol?a.name:a.name[0].toUpperCase()+a.name.substr(1)}function f(a,b,c,d){j.each(c.members,function(c,f){var g=b[c];if(null!==g&&void 0!==g){var h=e(f);h=a?a+"."+h:h,i(h,g,f,d)}})}function g(a,b,c,d){var e=1;j.each(b,function(b,f){var g=c.flattened?".":".entry.",h=g+e++ +".",j=h+(c.key.name||"key"),k=h+(c.value.name||"value");i(a+j,b,c.key,d),i(a+k,f,c.value,d)})}function h(a,b,c,d){var f=c.member||{};return 0===b.length?void d.call(this,a,null):void j.arrayEach(b,function(b,g){var h="."+(g+1);if("ec2"===c.api.protocol)h+="";else if(c.flattened){if(f.name){var j=a.split(".");j.pop(),j.push(e(f)),a=j.join(".")}}else h=".member"+h;i(a+h,b,f,d)})}function i(a,b,c,d){null!==b&&void 0!==b&&("structure"===c.type?f(a,b,c,d):"list"===c.type?h(a,b,c,d):"map"===c.type?g(a,b,c,d):d(a,c.toWireFormat(b).toString()))}var j=a("../util");d.prototype.serialize=function(a,b,c){f("",a,b,c)},b.exports=d},{"../util":53}],36:[function(a,b,c){function d(a){if(!a)return null;var b=a.split("-");return b.length<3?null:b.slice(0,b.length-2).join("-")+"-*"}function e(a){var b=a.config.region,c=d(b),e=a.api.endpointPrefix;return[[b,e],[c,e],[b,"*"],[c,"*"],["*",e],["*","*"]].map(function(a){return a[0]&&a[1]?a.join("/"):null})}function f(a,b){h.each(b,function(b,c){"globalEndpoint"!==b&&(void 0!==a.config[b]&&null!==a.config[b]||(a.config[b]=c))})}function g(a){for(var b=e(a),c=0;c=0){i=!0;var j=0}var k=function(){i&&j!==h?e.emit("error",d.util.error(new Error("Stream content length mismatch. Received "+j+" of "+h+" bytes."),{ -code:"StreamContentLengthMismatch"})):2===d.HttpClient.streamsApiVersion?e.end():e.emit("end")},l=g.httpResponse.createUnbufferedStream();if(2===d.HttpClient.streamsApiVersion)if(i){var m=new a.PassThrough;m._write=function(b){return b&&b.length&&(j+=b.length),a.PassThrough.prototype._write.apply(this,arguments)},m.on("end",k),l.pipe(m).pipe(e,{end:!1})}else l.pipe(e);else i&&l.on("data",function(a){a&&a.length&&(j+=a.length)}),l.on("data",function(a){e.emit("data",a)}),l.on("end",k);l.on("error",function(a){i=!1,e.emit("error",a)})}}),this.on("error",function(a){e.emit("error",a)}),e},emitEvent:function(a,b,c){"function"==typeof b&&(c=b,b=null),c||(c=function(){}),b||(b=this.eventParameters(a,this.response));var e=d.SequentialExecutor.prototype.emit;e.call(this,a,b,function(a){a&&(this.response.error=a),c.call(this,a)})},eventParameters:function(a){switch(a){case"restart":case"validate":case"sign":case"build":case"afterValidate":case"afterBuild":return[this];case"error":return[this.response.error,this.response];default:return[this.response]}},presign:function(a,b){return b||"function"!=typeof a||(b=a,a=null),(new d.Signers.Presign).sign(this.toGet(),a,b)},isPresigned:function(){return Object.prototype.hasOwnProperty.call(this.httpRequest.headers,"presigned-expires")},toUnauthenticated:function(){return this.removeListener("validate",d.EventListeners.Core.VALIDATE_CREDENTIALS),this.removeListener("sign",d.EventListeners.Core.SIGN),this},toGet:function(){return"query"!==this.service.api.protocol&&"ec2"!==this.service.api.protocol||(this.removeListener("build",this.buildAsGet),this.addListener("build",this.buildAsGet)),this},buildAsGet:function(a){a.httpRequest.method="GET",a.httpRequest.path=a.service.endpoint.path+"?"+a.httpRequest.body,a.httpRequest.body="",delete a.httpRequest.headers["Content-Length"],delete a.httpRequest.headers["Content-Type"]},haltHandlersOnError:function(){this._haltHandlersOnError=!0}}),d.util.addPromisesToRequests(d.Request),d.util.mixin(d.Request,d.SequentialExecutor)}).call(this,a("FWaASH"))},{"./core":11,"./state_machine":52,FWaASH:62,jmespath:79}],39:[function(a,b,c){function d(a){var b=a.request._waiter,c=b.config.acceptors,d=!1,e="retry";c.forEach(function(c){if(!d){var f=b.matchers[c.matcher];f&&f(a,c.expected,c.argument)&&(d=!0,e=c.state)}}),!d&&a.error&&(e="failure"),"success"===e?b.setSuccess(a):b.setError(a,"retry"===e)}var e=a("./core"),f=e.util.inherit,g=a("jmespath");e.ResourceWaiter=f({constructor:function(a,b){this.service=a,this.state=b,this.loadWaiterConfig(this.state)},service:null,state:null,config:null,matchers:{path:function(a,b,c){var d=g.search(a.data,c);return g.strictDeepEqual(d,b)},pathAll:function(a,b,c){var d=g.search(a.data,c);Array.isArray(d)||(d=[d]);var e=d.length;if(!e)return!1;for(var f=0;f-1&&c.splice(e,1)}return this},removeAllListeners:function(a){return a?delete this._events[a]:this._events={},this},emit:function(a,b,c){c||(c=function(){});var d=this.listeners(a),e=d.length;return this.callListeners(d,b,c),e>0},callListeners:function(a,b,c,e){function f(e){return e&&(h=d.util.error(h||new Error,e),g._haltHandlersOnError)?c.call(g,h):void g.callListeners(a,b,c,h)}for(var g=this,h=e||null;a.length>0;){var i=a.shift();if(i._isAsync)return void i.apply(g,b.concat([f]));try{i.apply(g,b)}catch(a){h=d.util.error(h||new Error,a)}if(h&&g._haltHandlersOnError)return void c.call(g,h)}c.call(g,h)},addListeners:function(a){var b=this;return a._events&&(a=a._events),d.util.each(a,function(a,c){"function"==typeof c&&(c=[c]),d.util.arrayEach(c,function(c){b.on(a,c)})}),b},addNamedListener:function(a,b,c){return this[a]=c,this.addListener(b,c),this},addNamedAsyncListener:function(a,b,c){return c._isAsync=!0,this.addNamedListener(a,b,c)},addNamedListeners:function(a){var b=this;return a(function(){b.addNamedListener.apply(b,arguments)},function(){b.addNamedAsyncListener.apply(b,arguments)}),this}}),d.SequentialExecutor.prototype.addListener=d.SequentialExecutor.prototype.on,b.exports=d.SequentialExecutor},{"./core":11}],42:[function(a,b,c){var d=a("./core"),e=a("./model/api"),f=a("./region_config"),g=d.util.inherit,h=0;d.Service=g({constructor:function(a){if(!this.loadServiceClass)throw d.util.error(new Error,"Service must be constructed with `new' operator");var b=this.loadServiceClass(a||{});if(b){var c=d.util.copy(a),e=new b(a);return Object.defineProperty(e,"_originalConfig",{get:function(){return c},enumerable:!1,configurable:!0}),e._clientId=++h,e}this.initialize(a)},initialize:function(a){var b=d.config[this.serviceIdentifier];this.config=new d.Config(d.config),b&&this.config.update(b,!0),a&&this.config.update(a,!0),this.validateService(),this.config.endpoint||f(this),this.config.endpoint=this.endpointFromTemplate(this.config.endpoint),this.setEndpoint(this.config.endpoint)},validateService:function(){},loadServiceClass:function(a){var b=a;if(d.util.isEmpty(this.api)){if(b.apiConfig)return d.Service.defineServiceApi(this.constructor,b.apiConfig);if(this.constructor.services){b=new d.Config(d.config),b.update(a,!0);var c=b.apiVersions[this.constructor.serviceIdentifier];return c=c||b.apiVersion,this.getLatestServiceClass(c)}return null}return null},getLatestServiceClass:function(a){return a=this.getLatestServiceVersion(a),null===this.constructor.services[a]&&d.Service.defineServiceApi(this.constructor,a),this.constructor.services[a]},getLatestServiceVersion:function(a){if(!this.constructor.services||0===this.constructor.services.length)throw new Error("No services defined on "+this.constructor.serviceIdentifier);if(a?d.util.isType(a,Date)&&(a=d.util.date.iso8601(a).split("T")[0]):a="latest",Object.hasOwnProperty(this.constructor.services,a))return a;for(var b=Object.keys(this.constructor.services).sort(),c=null,e=b.length-1;e>=0;e--)if("*"!==b[e][b[e].length-1]&&(c=b[e]),b[e].substr(0,10)<=a)return c;throw new Error("Could not find "+this.constructor.serviceIdentifier+" API to satisfy version constraint `"+a+"'")},api:{},defaultRetryCount:3,makeRequest:function(a,b,c){if("function"==typeof b&&(c=b,b=null),b=b||{},this.config.params){var e=this.api.operations[a];e&&(b=d.util.copy(b),d.util.each(this.config.params,function(a,c){e.input.members[a]&&(void 0!==b[a]&&null!==b[a]||(b[a]=c))}))}var f=new d.Request(this,a,b);return this.addAllRequestListeners(f),c&&f.send(c),f},makeUnauthenticatedRequest:function(a,b,c){"function"==typeof b&&(c=b,b={});var d=this.makeRequest(a,b).toUnauthenticated();return c?d.send(c):d},waitFor:function(a,b,c){var e=new d.ResourceWaiter(this,a);return e.wait(b,c)},addAllRequestListeners:function(a){for(var b=[d.events,d.EventListeners.Core,this.serviceInterface(),d.EventListeners.CorePost],c=0;c=500},networkingError:function(a){return"NetworkingError"===a.code},expiredCredentialsError:function(a){return"ExpiredTokenException"===a.code},clockSkewError:function(a){switch(a.code){case"RequestTimeTooSkewed":case"RequestExpired":case"InvalidSignatureException":case"SignatureDoesNotMatch":case"AuthFailure":case"RequestInTheFuture":return!0;default:return!1}},throttledError:function(a){switch(a.code){case"ProvisionedThroughputExceededException":case"Throttling":case"ThrottlingException":case"RequestLimitExceeded":case"RequestThrottled":return!0;default:return!1}},endpointFromTemplate:function(a){if("string"!=typeof a)return a;var b=a;return b=b.replace(/\{service\}/g,this.api.endpointPrefix),b=b.replace(/\{region\}/g,this.config.region),b=b.replace(/\{scheme\}/g,this.config.sslEnabled?"https":"http")},setEndpoint:function(a){this.endpoint=new d.Endpoint(a,this.config)},paginationConfig:function(a,b){var c=this.api.operations[a].paginator;if(!c){if(b){var e=new Error;throw d.util.error(e,"No pagination configuration for "+a)}return null}return c}}),d.util.update(d.Service,{defineMethods:function(a){d.util.each(a.prototype.api.operations,function(b){if(!a.prototype[b]){var c=a.prototype.api.operations[b];"none"===c.authtype?a.prototype[b]=function(a,c){return this.makeUnauthenticatedRequest(b,a,c)}:a.prototype[b]=function(a,c){return this.makeRequest(b,a,c)}}})},defineService:function(a,b,c){d.Service._serviceMap[a]=!0,Array.isArray(b)||(c=b,b=[]);var e=g(d.Service,c||{});if("string"==typeof a){d.Service.addVersions(e,b);var f=e.serviceIdentifier||a;e.serviceIdentifier=f}else e.prototype.api=a,d.Service.defineMethods(e);return e},addVersions:function(a,b){Array.isArray(b)||(b=[b]),a.services=a.services||{};for(var c=0;c604800){var d="Presigning does not support expiry time greater than a week with SigV4 signing.";throw f.util.error(new Error,{code:"InvalidExpiryTime",message:d,retryable:!1})}a.httpRequest.headers[h]=b}else{if(c!==f.Signers.S3)throw f.util.error(new Error,{message:"Presigning only supports S3 or SigV4 signing.",code:"UnsupportedSigner",retryable:!1});a.httpRequest.headers[h]=parseInt(f.util.date.unixTimestamp()+b,10).toString()}}function e(a){var b=a.httpRequest.endpoint,c=f.util.urlParse(a.httpRequest.path),d={};c.search&&(d=f.util.queryStringParse(c.search.substr(1))),f.util.each(a.httpRequest.headers,function(a,b){a===h&&(a="Expires"),0===a.indexOf("x-amz-meta-")&&(delete d[a],a=a.toLowerCase()),d[a]=b}),delete a.httpRequest.headers[h];var e=d.Authorization.split(" ");if("AWS"===e[0])e=e[1].split(":"),d.AWSAccessKeyId=e[0],d.Signature=e[1];else if("AWS4-HMAC-SHA256"===e[0]){e.shift();var g=e.join(" "),i=g.match(/Signature=(.*?)(?:,|\s|\r?\n|$)/)[1];d["X-Amz-Signature"]=i,delete d.Expires}delete d.Authorization,delete d.Host,b.pathname=c.pathname,b.search=f.util.queryParamsToString(d)}var f=a("../core"),g=f.util.inherit,h="presigned-expires";f.Signers.Presign=g({sign:function(a,b,c){if(a.httpRequest.headers[h]=b||3600,a.on("build",d),a.on("sign",e),a.removeListener("afterBuild",f.EventListeners.Core.SET_CONTENT_LENGTH),a.removeListener("afterBuild",f.EventListeners.Core.COMPUTE_SHA256),a.emit("beforePresign",[a]),!c){if(a.build(),a.response.error)throw a.response.error;return f.util.urlFormat(a.httpRequest.endpoint)}a.build(function(){this.response.error?c(this.response.error):c(null,f.util.urlFormat(a.httpRequest.endpoint))})}}),b.exports=f.Signers.Presign},{"../core":11}],46:[function(a,b,c){var d=a("../core"),e=d.util.inherit;d.Signers.RequestSigner=e({constructor:function(a){this.request=a},setServiceClientId:function(a){this.serviceClientId=a},getServiceClientId:function(){return this.serviceClientId}}),d.Signers.RequestSigner.getVersion=function(a){switch(a){case"v2":return d.Signers.V2;case"v3":return d.Signers.V3;case"v4":return d.Signers.V4;case"s3":return d.Signers.S3;case"v3https":return d.Signers.V3Https}throw new Error("Unknown signing version "+a)},a("./v2"),a("./v3"),a("./v3https"),a("./v4"),a("./s3"),a("./presign")},{"../core":11,"./presign":45,"./s3":47,"./v2":48,"./v3":49,"./v3https":50,"./v4":51}],47:[function(a,b,c){var d=a("../core"),e=d.util.inherit;d.Signers.S3=e(d.Signers.RequestSigner,{subResources:{acl:1,accelerate:1,cors:1,lifecycle:1,"delete":1,location:1,logging:1,notification:1,partNumber:1,policy:1,requestPayment:1,replication:1,restore:1,tagging:1,torrent:1,uploadId:1,uploads:1,versionId:1,versioning:1,versions:1,website:1},responseHeaders:{"response-content-type":1,"response-content-language":1,"response-expires":1,"response-cache-control":1,"response-content-disposition":1,"response-content-encoding":1},addAuthorization:function(a,b){this.request.headers["presigned-expires"]||(this.request.headers["X-Amz-Date"]=d.util.date.rfc822(b)),a.sessionToken&&(this.request.headers["x-amz-security-token"]=a.sessionToken);var c=this.sign(a.secretAccessKey,this.stringToSign()),e="AWS "+a.accessKeyId+":"+c;this.request.headers.Authorization=e},stringToSign:function(){var a=this.request,b=[];b.push(a.method),b.push(a.headers["Content-MD5"]||""),b.push(a.headers["Content-Type"]||""),b.push(a.headers["presigned-expires"]||"");var c=this.canonicalizedAmzHeaders();return c&&b.push(c),b.push(this.canonicalizedResource()),b.join("\n")},canonicalizedAmzHeaders:function(){var a=[];d.util.each(this.request.headers,function(b){b.match(/^x-amz-/i)&&a.push(b)}),a.sort(function(a,b){return a.toLowerCase()=0?"&":"?";this.request.path+=f+d.util.queryParamsToString(e)},authorization:function(a,b){var c=[],d=this.credentialString(b);return c.push(this.algorithm+" Credential="+a.accessKeyId+"/"+d),c.push("SignedHeaders="+this.signedHeaders()),c.push("Signature="+this.signature(a,b)),c.join(", ")},signature:function(a,b){var c=null,e=this.serviceName+(this.getServiceClientId()?"_"+this.getServiceClientId():"");if(this.signatureCache){var c=f[e];c||(g.push(e),g.length>h&&delete f[g.shift()])}var i=b.substr(0,8);if(!c||c.akid!==a.accessKeyId||c.region!==this.request.region||c.date!==i){var j=a.secretAccessKey,k=d.util.crypto.hmac("AWS4"+j,i,"buffer"),l=d.util.crypto.hmac(k,this.request.region,"buffer"),m=d.util.crypto.hmac(l,this.serviceName,"buffer"),n=d.util.crypto.hmac(m,"aws4_request","buffer");if(!this.signatureCache)return d.util.crypto.hmac(n,this.stringToSign(b),"hex");f[e]={region:this.request.region,date:i,key:n,akid:a.accessKeyId}}var o=f[e].key;return d.util.crypto.hmac(o,this.stringToSign(b),"hex")},stringToSign:function(a){var b=[];return b.push("AWS4-HMAC-SHA256"),b.push(a),b.push(this.credentialString(a)),b.push(this.hexEncodedHash(this.canonicalString())),b.join("\n")},canonicalString:function(){var a=[],b=this.request.pathname();return"s3"!==this.serviceName&&(b=d.util.uriEscapePath(b)),a.push(this.request.method),a.push(b),a.push(this.request.search()),a.push(this.canonicalHeaders()+"\n"),a.push(this.signedHeaders()),a.push(this.hexEncodedBodyHash()),a.join("\n")},canonicalHeaders:function(){var a=[];d.util.each.call(this,this.request.headers,function(b,c){a.push([b,c])}),a.sort(function(a,b){return a[0].toLowerCase()=a.length)return b.push(null);var e=c+d;e>a.length&&(e=a.length),b.push(a.slice(c,e)),c=e},b},concat:function(a){var b,c=0,d=0,f=null;for(b=0;b>>8^b[255&(c^f)]}return(c^-1)>>>0},hmac:function(a,b,c,d){return c||(c="binary"),"buffer"===c&&(c=void 0),d||(d="sha256"),"string"==typeof b&&(b=new e.Buffer(b)),e.crypto.lib.createHmac(d,a).update(b).digest(c)},md5:function(a,b,c){return e.crypto.hash("md5",a,b,c)},sha256:function(a,b,c){return e.crypto.hash("sha256",a,b,c)},hash:function(a,b,c,d){var f=e.crypto.createHash(a);c||(c="binary"),"buffer"===c&&(c=void 0),"string"==typeof b&&(b=new e.Buffer(b));var g=e.arraySliceFn(b),h=e.Buffer.isBuffer(b);if(e.isBrowser()&&"undefined"!=typeof ArrayBuffer&&b&&b.buffer instanceof ArrayBuffer&&(h=!0),d&&"object"==typeof b&&"function"==typeof b.on&&!h)b.on("data",function(a){f.update(a)}),b.on("error",function(a){d(a)}),b.on("end",function(){d(null,f.digest(c))});else{if(!d||!g||h||"undefined"==typeof FileReader){e.isBrowser()&&"object"==typeof b&&!h&&(b=new e.Buffer(new Uint8Array(b)));var i=f.update(b).digest(c);return d&&d(null,i),i}var j=0,k=524288,l=new FileReader;l.onerror=function(){d(new Error("Failed to read data."))},l.onload=function(){var a=new e.Buffer(new Uint8Array(l.result));f.update(a),j+=a.length,l._continueReading()},l._continueReading=function(){if(j>=b.size)return void d(null,f.digest(c));var a=j+k;a>b.size&&(a=b.size),l.readAsArrayBuffer(g.call(b,j,a))},l._continueReading()}},toHex:function(a){for(var b=[],c=0;c=3e5,!1),d.config.isClockSkewed},applyClockOffset:function(a){a&&(d.config.systemClockOffset=a-(new Date).getTime())},extractRequestId:function(a){var b=a.httpResponse.headers["x-amz-request-id"]||a.httpResponse.headers["x-amzn-requestid"];!b&&a.data&&a.data.ResponseMetadata&&(b=a.data.ResponseMetadata.RequestId),b&&(a.requestId=b),a.error&&(a.error.requestId=b)},addPromisesToRequests:function(a,b){return b=b||null,b||"undefined"==typeof Promise||(b=Promise),"function"!=typeof b?void delete a.prototype.promise:void(a.prototype.promise=function(){var a=this;return new b(function(b,c){a.on("complete",function(a){a.error?c(a.error):b(a.data)}),a.runTo()})})},isDualstackAvailable:function(b){if(!b)return!1;var c=a("../apis/metadata.json");return"string"!=typeof b&&(b=b.serviceIdentifier),!("string"!=typeof b||!c.hasOwnProperty(b)||!c[b].dualstackAvailable)},calculateRetryDelay:function(a,b){b||(b={});var c=b.customBackoff||null;if("function"==typeof c)return c(a);var d=b.base||100,e=Math.random()*(Math.pow(2,a)*d);return e},handleRequestWithRetries:function(a,b,f){b||(b={});var g=d.HttpClient.getInstance(),h=b.httpOptions||{},i=0,j=function(a){var c=b.maxRetries||0;if(a&&"TimeoutError"===a.code&&(a.retryable=!0),a&&a.retryable&&i=500||429===c});d&&g.retryable&&(g.retryAfter=d),j(g)}})},j)};c.nextTick(k)}};b.exports=e}).call(this,a("FWaASH"))},{"../apis/metadata.json":3,"./core":11,FWaASH:62,fs:56}],54:[function(a,b,c){function d(){}function e(a,b){switch(b||(b={}),b.type){case"structure":return f(a,b);case"map":return g(a,b);case"list":return h(a,b);case void 0:case null:return j(a);default:return i(a,b)}}function f(a,b){var c={};return null===a?c:(k.each(b.members,function(b,d){if(d.isXmlAttribute){if(Object.prototype.hasOwnProperty.call(a.attributes,d.name)){var f=a.attributes[d.name].value;c[b]=e({textContent:f},d)}}else{var g=d.flattened?a:a.getElementsByTagName(d.name)[0];g?c[b]=e(g,d):d.flattened||"list"!==d.type||(c[b]=d.defaultValue)}}),c)}function g(a,b){for(var c={},d=b.key.name||"key",f=b.value.name||"value",g=b.flattened?b.name:"entry",h=a.firstElementChild;h;){if(h.nodeName===g){var i=h.getElementsByTagName(d)[0].textContent,j=h.getElementsByTagName(f)[0];c[i]=e(j,b.value)}h=h.nextElementSibling}return c}function h(a,b){for(var c=[],d=b.flattened?b.name:b.member.name||"member",f=a.firstElementChild;f;)f.nodeName===d&&c.push(e(f,b.member)),f=f.nextElementSibling;return c}function i(a,b){if(a.getAttribute){var c=a.getAttribute("encoding");"base64"===c&&(b=new l.create({type:c}))}var d=a.textContent;return""===d&&(d=null),"function"==typeof b.toType?b.toType(d):d}function j(a){if(void 0===a||null===a)return"";if(!a.firstElementChild)return null===a.parentNode.parentNode?{}:0===a.childNodes.length?"":a.textContent;for(var b={type:"structure",members:{}},c=a.firstElementChild;c;){var d=c.nodeName;Object.prototype.hasOwnProperty.call(b.members,d)?b.members[d].type="list":b.members[d]={name:d},c=c.nextElementSibling}return f(a,b)}var k=a("../util"),l=a("../model/shape");d.prototype.parse=function(a,b){if(""===a.replace(/^\s+/,""))return{};var c,d;try{if(window.DOMParser){try{var f=new DOMParser;c=f.parseFromString(a,"text/xml")}catch(a){throw k.error(new Error("Parse error in document"),{originalError:a,code:"XMLParserError",retryable:!0})}if(null===c.documentElement)throw k.error(new Error("Cannot parse empty document."),{code:"XMLParserError",retryable:!0});var g=c.getElementsByTagName("parsererror")[0];if(g&&(g.parentNode===c||"body"===g.parentNode.nodeName||g.parentNode.parentNode===c||"body"===g.parentNode.parentNode.nodeName)){var h=g.getElementsByTagName("div")[0]||g;throw k.error(new Error(h.textContent||"Parser error in document"),{code:"XMLParserError",retryable:!0})}}else{if(!window.ActiveXObject)throw new Error("Cannot load XML parser");if(c=new window.ActiveXObject("Microsoft.XMLDOM"),c.async=!1,!c.loadXML(a))throw k.error(new Error("Parse error in document"),{code:"XMLParserError",retryable:!0})}}catch(a){d=a}if(c&&c.documentElement&&!d){var i=e(c.documentElement,b),j=c.getElementsByTagName("ResponseMetadata")[0];return j&&(i.ResponseMetadata=e(j,{})),i}if(d)throw k.error(d||new Error,{code:"XMLParserError",retryable:!0});return{}},b.exports=d},{"../model/shape":28,"../util":53}],55:[function(a,b,c){function d(){}function e(a,b,c){switch(c.type){case"structure":return f(a,b,c);case"map":return g(a,b,c);case"list":return h(a,b,c);default:return i(a,b,c)}}function f(a,b,c){k.arrayEach(c.memberNames,function(d){var f=c.members[d];if("body"===f.location){var g=b[d],h=f.name;if(void 0!==g&&null!==g)if(f.isXmlAttribute)a.att(h,g);else if(f.flattened)e(a,g,f);else{var i=a.ele(h);j(i,f),e(i,g,f)}}})}function g(a,b,c){var d=c.key.name||"key",f=c.value.name||"value";k.each(b,function(b,g){var h=a.ele(c.flattened?c.name:"entry");e(h.ele(d),b,c.key),e(h.ele(f),g,c.value)})}function h(a,b,c){c.flattened?k.arrayEach(b,function(b){var d=c.member.name||c.name,f=a.ele(d);e(f,b,c.member)}):k.arrayEach(b,function(b){var d=c.member.name||"member",f=a.ele(d);e(f,b,c.member)})}function i(a,b,c){a.txt(c.toWireFormat(b))}function j(a,b){var c,d="xmlns";b.xmlNamespaceUri?(c=b.xmlNamespaceUri,b.xmlNamespacePrefix&&(d+=":"+b.xmlNamespacePrefix)):a.isRoot&&b.api.xmlNamespaceUri&&(c=b.api.xmlNamespaceUri),c&&a.att(d,c)}var k=a("../util"),l=a("xmlbuilder");d.prototype.toXML=function(a,b,c,d){var f=l.create(c);return j(f,b),e(f,a,b),f.children.length>0||d?f.root().toString():""},b.exports=d},{"../util":53,xmlbuilder:100}],56:[function(a,b,c){},{}],57:[function(a,b,c){function d(a,b,c){if(!(this instanceof d))return new d(a,b,c);var e=typeof a;if("base64"===b&&"string"===e)for(a=C(a);a.length%4!==0;)a+="=";var f;if("number"===e)f=E(a);else if("string"===e)f=d.byteLength(a,b);else{if("object"!==e)throw new Error("First argument needs to be a number, array or string.");f=E(a.length)}var g;d._useTypedArrays?g=d._augment(new Uint8Array(f)):(g=this,g.length=f,g._isBuffer=!0);var h;if(d._useTypedArrays&&"number"==typeof a.byteLength)g._set(a);else if(G(a))for(h=0;hf&&(e=f)):e=f;var g=b.length;R(g%2===0,"Invalid hex string"),e>g/2&&(e=g/2);for(var h=0;hd)&&(c=d);for(var e="",f=b;f=e)){var f;return c?(f=a[b],b+1=e)){var f;return c?(b+2>>0)):(b+1>>0),f}}function s(a,b,c,d){d||(R("boolean"==typeof c,"missing or invalid endian"),R(void 0!==b&&null!==b,"missing offset"),R(b+1=e)){var f=q(a,b,c,!0),g=32768&f;return g?(65535-f+1)*-1:f}}function t(a,b,c,d){d||(R("boolean"==typeof c,"missing or invalid endian"),R(void 0!==b&&null!==b,"missing offset"),R(b+3=e)){var f=r(a,b,c,!0),g=2147483648&f;return g?(4294967295-f+1)*-1:f}}function u(a,b,c,d){return d||(R("boolean"==typeof c,"missing or invalid endian"),R(b+3=f))for(var g=0,h=Math.min(f-c,2);g>>8*(d?g:1-g)}function x(a,b,c,d,e){e||(R(void 0!==b&&null!==b,"missing value"),R("boolean"==typeof d,"missing or invalid endian"),R(void 0!==c&&null!==c,"missing offset"),R(c+3=f))for(var g=0,h=Math.min(f-c,4);g>>8*(d?g:3-g)&255}function y(a,b,c,d,e){e||(R(void 0!==b&&null!==b,"missing value"),R("boolean"==typeof d,"missing or invalid endian"),R(void 0!==c&&null!==c,"missing offset"),R(c+1=f||(b>=0?w(a,b,c,d,e):w(a,65535+b+1,c,d,e))}function z(a,b,c,d,e){e||(R(void 0!==b&&null!==b,"missing value"),R("boolean"==typeof d,"missing or invalid endian"),R(void 0!==c&&null!==c,"missing offset"),R(c+3=f||(b>=0?x(a,b,c,d,e):x(a,4294967295+b+1,c,d,e))}function A(a,b,c,d,e){e||(R(void 0!==b&&null!==b,"missing value"),R("boolean"==typeof d,"missing or invalid endian"),R(void 0!==c&&null!==c,"missing offset"),R(c+3=f||T.write(a,b,c,d,23,4)}function B(a,b,c,d,e){e||(R(void 0!==b&&null!==b,"missing value"),R("boolean"==typeof d,"missing or invalid endian"),R(void 0!==c&&null!==c,"missing offset"),R(c+7=f||T.write(a,b,c,d,52,8)}function C(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function D(a,b,c){return"number"!=typeof a?c:(a=~~a,a>=b?b:a>=0?a:(a+=b,a>=0?a:0))}function E(a){return a=~~Math.ceil(+a),a<0?0:a}function F(a){return(Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)})(a)}function G(a){return F(a)||d.isBuffer(a)||a&&"object"==typeof a&&"number"==typeof a.length}function H(a){return a<16?"0"+a.toString(16):a.toString(16)}function I(a){for(var b=[],c=0;c=55296&&d<=57343&&c++;for(var f=encodeURIComponent(a.slice(e,c+1)).substr(1).split("%"),g=0;g>8,d=b%256,e.push(d),e.push(c);return e}function L(a){return S.toByteArray(a)}function M(a,b,c,d){for(var e=0;e=b.length||e>=a.length);e++)b[e+c]=a[e];return e}function N(a){try{return decodeURIComponent(a)}catch(a){return String.fromCharCode(65533)}}function O(a,b){R("number"==typeof a,"cannot write a non-number as a number"),R(a>=0,"specified a negative value for writing an unsigned value"),R(a<=b,"value is larger than maximum value for type"),R(Math.floor(a)===a,"value has a fractional component")}function P(a,b,c){R("number"==typeof a,"cannot write a non-number as a number"),R(a<=b,"value larger than maximum allowed value"),R(a>=c,"value smaller than minimum allowed value"),R(Math.floor(a)===a,"value has a fractional component")}function Q(a,b,c){R("number"==typeof a,"cannot write a non-number as a number"),R(a<=b,"value larger than maximum allowed value"),R(a>=c,"value smaller than minimum allowed value")}function R(a,b){if(!a)throw new Error(b||"Failed assertion")}var S=a("base64-js"),T=a("ieee754");c.Buffer=d,c.SlowBuffer=d,c.INSPECT_MAX_BYTES=50,d.poolSize=8192,d._useTypedArrays=function(){try{var a=new ArrayBuffer(0),b=new Uint8Array(a);return b.foo=function(){return 42},42===b.foo()&&"function"==typeof b.subarray}catch(a){return!1}}(),d.isEncoding=function(a){switch(String(a).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(a){return!(null===a||void 0===a||!a._isBuffer)},d.byteLength=function(a,b){var c;switch(a+="",b||"utf8"){case"hex":c=a.length/2;break;case"utf8":case"utf-8":c=I(a).length;break;case"ascii":case"binary":case"raw":c=a.length;break;case"base64":c=L(a).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":c=2*a.length;break;default:throw new Error("Unknown encoding")}return c},d.concat=function(a,b){if(R(F(a),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===a.length)return new d(0);if(1===a.length)return a[0];var c;if("number"!=typeof b)for(b=0,c=0;cl&&(c=l)):c=l,d=String(d||"utf8").toLowerCase();var m;switch(d){case"hex":m=e(this,a,b,c);break;case"utf8":case"utf-8":m=f(this,a,b,c);break;case"ascii":m=g(this,a,b,c);break;case"binary":m=h(this,a,b,c);break;case"base64":m=i(this,a,b,c);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":m=j(this,a,b,c);break;default:throw new Error("Unknown encoding")}return m},d.prototype.toString=function(a,b,c){var d=this;if(a=String(a||"utf8").toLowerCase(),b=Number(b)||0,c=void 0!==c?Number(c):c=d.length,c===b)return"";var e;switch(a){case"hex":e=o(d,b,c);break;case"utf8":case"utf-8":e=l(d,b,c);break;case"ascii":e=m(d,b,c);break;case"binary":e=n(d,b,c);break;case"base64":e=k(d,b,c);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":e=p(d,b,c);break;default:throw new Error("Unknown encoding")}return e},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},d.prototype.copy=function(a,b,c,e){var f=this;if(c||(c=0),e||0===e||(e=this.length),b||(b=0),e!==c&&0!==a.length&&0!==f.length){R(e>=c,"sourceEnd < sourceStart"),R(b>=0&&b=0&&c=0&&e<=f.length,"sourceEnd out of bounds"),e>this.length&&(e=this.length),a.length-b=this.length))return this[a]},d.prototype.readUInt16LE=function(a,b){return q(this,a,!0,b)},d.prototype.readUInt16BE=function(a,b){return q(this,a,!1,b)},d.prototype.readUInt32LE=function(a,b){return r(this,a,!0,b)},d.prototype.readUInt32BE=function(a,b){return r(this,a,!1,b)},d.prototype.readInt8=function(a,b){if(b||(R(void 0!==a&&null!==a,"missing offset"),R(a=this.length)){var c=128&this[a];return c?(255-this[a]+1)*-1:this[a]}},d.prototype.readInt16LE=function(a,b){return s(this,a,!0,b)},d.prototype.readInt16BE=function(a,b){return s(this,a,!1,b)},d.prototype.readInt32LE=function(a,b){return t(this,a,!0,b)},d.prototype.readInt32BE=function(a,b){return t(this,a,!1,b)},d.prototype.readFloatLE=function(a,b){return u(this,a,!0,b)},d.prototype.readFloatBE=function(a,b){return u(this,a,!1,b)},d.prototype.readDoubleLE=function(a,b){return v(this,a,!0,b)},d.prototype.readDoubleBE=function(a,b){return v(this,a,!1,b)},d.prototype.writeUInt8=function(a,b,c){c||(R(void 0!==a&&null!==a,"missing value"),R(void 0!==b&&null!==b,"missing offset"),R(b=this.length||(this[b]=a)},d.prototype.writeUInt16LE=function(a,b,c){w(this,a,b,!0,c)},d.prototype.writeUInt16BE=function(a,b,c){w(this,a,b,!1,c)},d.prototype.writeUInt32LE=function(a,b,c){x(this,a,b,!0,c)},d.prototype.writeUInt32BE=function(a,b,c){x(this,a,b,!1,c)},d.prototype.writeInt8=function(a,b,c){c||(R(void 0!==a&&null!==a,"missing value"),R(void 0!==b&&null!==b,"missing offset"),R(b=this.length||(a>=0?this.writeUInt8(a,b,c):this.writeUInt8(255+a+1,b,c))},d.prototype.writeInt16LE=function(a,b,c){y(this,a,b,!0,c)},d.prototype.writeInt16BE=function(a,b,c){y(this,a,b,!1,c)},d.prototype.writeInt32LE=function(a,b,c){z(this,a,b,!0,c)},d.prototype.writeInt32BE=function(a,b,c){z(this,a,b,!1,c)},d.prototype.writeFloatLE=function(a,b,c){A(this,a,b,!0,c)},d.prototype.writeFloatBE=function(a,b,c){A(this,a,b,!1,c)},d.prototype.writeDoubleLE=function(a,b,c){B(this,a,b,!0,c)},d.prototype.writeDoubleBE=function(a,b,c){B(this,a,b,!1,c)},d.prototype.fill=function(a,b,c){if(a||(a=0),b||(b=0),c||(c=this.length),"string"==typeof a&&(a=a.charCodeAt(0)),R("number"==typeof a&&!isNaN(a),"value is not a number"),R(c>=b,"end < start"),c!==b&&0!==this.length){R(b>=0&&b=0&&c<=this.length,"end out of bounds");for(var d=b;d"},d.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(d._useTypedArrays)return new d(this).buffer;for(var a=new Uint8Array(this.length),b=0,c=a.length;b0)throw new Error("Invalid string. Length must be a multiple of 4");var k=a.length;i="="===a.charAt(k-2)?2:"="===a.charAt(k-1)?1:0,j=new f(3*a.length/4-i),g=i>0?a.length-4:a.length;var l=0;for(d=0,e=0;d>16),c((65280&h)>>8),c(255&h);return 2===i?(h=b(a.charAt(d))<<2|b(a.charAt(d+1))>>4,c(255&h)):1===i&&(h=b(a.charAt(d))<<10|b(a.charAt(d+1))<<4|b(a.charAt(d+2))>>2,c(h>>8&255),c(255&h)),j}function e(a){function b(a){return d.charAt(a)}function c(a){return b(a>>18&63)+b(a>>12&63)+b(a>>6&63)+b(63&a)}var e,f,g,h=a.length%3,i="";for(e=0,g=a.length-h;e>2),i+=b(f<<4&63),i+="==";break;case 2:f=(a[a.length-2]<<8)+a[a.length-1],i+=b(f>>10),i+=b(f>>4&63),i+=b(f<<2&63),i+="="}return i}var f="undefined"!=typeof Uint8Array?Uint8Array:Array,g="+".charCodeAt(0),h="/".charCodeAt(0),i="0".charCodeAt(0),j="a".charCodeAt(0),k="A".charCodeAt(0),l="-".charCodeAt(0),m="_".charCodeAt(0);a.toByteArray=c,a.fromByteArray=e}("undefined"==typeof c?this.base64js={}:c)},{}],59:[function(a,b,c){c.read=function(a,b,c,d,e){var f,g,h=8*e-d-1,i=(1<>1,k=-7,l=c?e-1:0,m=c?-1:1,n=a[b+l];for(l+=m,f=n&(1<<-k)-1,n>>=-k,k+=h;k>0;f=256*f+a[b+l],l+=m,k-=8);for(g=f&(1<<-k)-1,f>>=-k,k+=d;k>0;g=256*g+a[b+l],l+=m,k-=8);if(0===f)f=1-j;else{if(f===i)return g?NaN:(n?-1:1)*(1/0);g+=Math.pow(2,d),f-=j}return(n?-1:1)*g*Math.pow(2,f-d)},c.write=function(a,b,c,d,e,f){var g,h,i,j=8*f-e-1,k=(1<>1,m=23===e?Math.pow(2,-24)-Math.pow(2,-77):0,n=d?0:f-1,o=d?1:-1,p=b<0||0===b&&1/b<0?1:0;for(b=Math.abs(b),isNaN(b)||b===1/0?(h=isNaN(b)?1:0,g=k):(g=Math.floor(Math.log(b)/Math.LN2),b*(i=Math.pow(2,-g))<1&&(g--,i*=2),b+=g+l>=1?m/i:m*Math.pow(2,1-l),b*i>=2&&(g++,i/=2),g+l>=k?(h=0,g=k):g+l>=1?(h=(b*i-1)*Math.pow(2,e),g+=l):(h=b*Math.pow(2,l-1)*Math.pow(2,e),g=0));e>=8;a[c+n]=255&h,n+=o,h/=256,e-=8);for(g=g<0;a[c+n]=255&g,n+=o,g/=256,j-=8);a[c+n-o]|=128*p}},{}],60:[function(a,b,c){function d(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function e(a){return"function"==typeof a}function f(a){return"number"==typeof a}function g(a){return"object"==typeof a&&null!==a}function h(a){return void 0===a}b.exports=d,d.EventEmitter=d,d.prototype._events=void 0,d.prototype._maxListeners=void 0,d.defaultMaxListeners=10,d.prototype.setMaxListeners=function(a){if(!f(a)||a<0||isNaN(a))throw TypeError("n must be a positive number");return this._maxListeners=a,this},d.prototype.emit=function(a){var b,c,d,f,i,j;if(this._events||(this._events={}),"error"===a&&(!this._events.error||g(this._events.error)&&!this._events.error.length)){if(b=arguments[1],b instanceof Error)throw b;throw TypeError('Uncaught, unspecified "error" event.')}if(c=this._events[a],h(c))return!1;if(e(c))switch(arguments.length){case 1:c.call(this);break;case 2:c.call(this,arguments[1]);break;case 3:c.call(this,arguments[1],arguments[2]);break;default:for(d=arguments.length,f=new Array(d-1),i=1;i0&&this._events[a].length>c&&(this._events[a].warned=!0,"function"==typeof console.trace&&void 0)}return this},d.prototype.on=d.prototype.addListener,d.prototype.once=function(a,b){function c(){this.removeListener(a,c),d||(d=!0,b.apply(this,arguments))}if(!e(b))throw TypeError("listener must be a function");var d=!1;return c.listener=b,this.on(a,c),this},d.prototype.removeListener=function(a,b){var c,d,f,h;if(!e(b))throw TypeError("listener must be a function");if(!this._events||!this._events[a])return this;if(c=this._events[a],f=c.length,d=-1,c===b||e(c.listener)&&c.listener===b)delete this._events[a],this._events.removeListener&&this.emit("removeListener",a,b);else if(g(c)){for(h=f;h-- >0;)if(c[h]===b||c[h].listener&&c[h].listener===b){d=h;break}if(d<0)return this;1===c.length?(c.length=0,delete this._events[a]):c.splice(d,1),this._events.removeListener&&this.emit("removeListener",a,b)}return this},d.prototype.removeAllListeners=function(a){var b,c;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[a]&&delete this._events[a],this;if(0===arguments.length){for(b in this._events)"removeListener"!==b&&this.removeAllListeners(b);return this.removeAllListeners("removeListener"),this._events={},this}if(c=this._events[a],e(c))this.removeListener(a,c);else for(;c.length;)this.removeListener(a,c[c.length-1]);return delete this._events[a],this},d.prototype.listeners=function(a){var b;return b=this._events&&this._events[a]?e(this._events[a])?[this._events[a]]:this._events[a].slice():[]},d.listenerCount=function(a,b){var c;return c=a._events&&a._events[b]?e(a._events[b])?1:a._events[b].length:0}},{}],61:[function(a,b,c){"function"==typeof Object.create?b.exports=function(a,b){a.super_=b,a.prototype=Object.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}})}:b.exports=function(a,b){a.super_=b;var c=function(){};c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a}},{}],62:[function(a,b,c){function d(){}var e=b.exports={};e.nextTick=function(){var a="undefined"!=typeof window&&window.setImmediate,b="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(a)return function(a){return window.setImmediate(a)};if(b){var c=[];return window.addEventListener("message",function(a){var b=a.source;if((b===window||null===b)&&"process-tick"===a.data&&(a.stopPropagation(),c.length>0)){var d=c.shift();d()}},!0),function(a){c.push(a),window.postMessage("process-tick","*")}}return function(a){setTimeout(a,0)}}(),e.title="browser",e.browser=!0,e.env={},e.argv=[],e.on=d,e.addListener=d,e.once=d,e.off=d,e.removeListener=d,e.removeAllListeners=d,e.emit=d,e.binding=function(a){throw new Error("process.binding is not supported"); -},e.cwd=function(){return"/"},e.chdir=function(a){throw new Error("process.chdir is not supported")}},{}],63:[function(a,b,c){(function(a){!function(d){function e(a){throw RangeError(H[a])}function f(a,b){for(var c=a.length;c--;)a[c]=b(a[c]);return a}function g(a,b){return f(a.split(G),b).join(".")}function h(a){for(var b,c,d=[],e=0,f=a.length;e=55296&&b<=56319&&e65535&&(a-=65536,b+=K(a>>>10&1023|55296),a=56320|1023&a),b+=K(a)}).join("")}function j(a){return a-48<10?a-22:a-65<26?a-65:a-97<26?a-97:w}function k(a,b){return a+22+75*(a<26)-((0!=b)<<5)}function l(a,b,c){var d=0;for(a=c?J(a/A):a>>1,a+=J(a/b);a>I*y>>1;d+=w)a=J(a/I);return J(d+(I+1)*a/(a+z))}function m(a){var b,c,d,f,g,h,k,m,n,o,p=[],q=a.length,r=0,s=C,t=B;for(c=a.lastIndexOf(D),c<0&&(c=0),d=0;d=128&&e("not-basic"),p.push(a.charCodeAt(d));for(f=c>0?c+1:0;f=q&&e("invalid-input"),m=j(a.charCodeAt(f++)),(m>=w||m>J((v-r)/h))&&e("overflow"),r+=m*h,n=k<=t?x:k>=t+y?y:k-t,!(mJ(v/o)&&e("overflow"),h*=o;b=p.length+1,t=l(r-g,b,0==g),J(r/b)>v-s&&e("overflow"),s+=J(r/b),r%=b,p.splice(r++,0,s)}return i(p)}function n(a){var b,c,d,f,g,i,j,m,n,o,p,q,r,s,t,u=[];for(a=h(a),q=a.length,b=C,c=0,g=B,i=0;i=b&&pJ((v-c)/r)&&e("overflow"),c+=(j-b)*r,b=j,i=0;iv&&e("overflow"),p==b){for(m=c,n=w;o=n<=g?x:n>=g+y?y:n-g,!(m= 0x80 (not a basic code point)","invalid-input":"Invalid input"},I=w-x,J=Math.floor,K=String.fromCharCode;if(t={version:"1.2.4",ucs2:{decode:h,encode:i},decode:m,encode:n,toASCII:p,toUnicode:o},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return t});else if(q&&!q.nodeType)if(r)r.exports=t;else for(u in t)t.hasOwnProperty(u)&&(q[u]=t[u]);else d.punycode=t}(this)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],64:[function(a,b,c){function d(a,b){return Object.prototype.hasOwnProperty.call(a,b)}b.exports=function(a,b,c,f){b=b||"&",c=c||"=";var g={};if("string"!=typeof a||0===a.length)return g;var h=/\+/g;a=a.split(b);var i=1e3;f&&"number"==typeof f.maxKeys&&(i=f.maxKeys);var j=a.length;i>0&&j>i&&(j=i);for(var k=0;k=0?(l=p.substr(0,q),m=p.substr(q+1)):(l=p,m=""),n=decodeURIComponent(l),o=decodeURIComponent(m),d(g,n)?e(g[n])?g[n].push(o):g[n]=[g[n],o]:g[n]=o}return g};var e=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)}},{}],65:[function(a,b,c){function d(a,b){if(a.map)return a.map(b);for(var c=[],d=0;d=3&&(d.depth=arguments[2]),arguments.length>=4&&(d.colors=arguments[3]),p(b)?d.showHidden=b:b&&c._extend(d,b),v(d.showHidden)&&(d.showHidden=!1),v(d.depth)&&(d.depth=2),v(d.colors)&&(d.colors=!1),v(d.customInspect)&&(d.customInspect=!0),d.colors&&(d.stylize=f),i(d,a,d.depth)}function f(a,b){var c=e.styles[b];return c?"["+e.colors[c][0]+"m"+a+"["+e.colors[c][1]+"m":a}function g(a,b){return a}function h(a){var b={};return a.forEach(function(a,c){b[a]=!0}),b}function i(a,b,d){if(a.customInspect&&b&&A(b.inspect)&&b.inspect!==c.inspect&&(!b.constructor||b.constructor.prototype!==b)){var e=b.inspect(d,a);return t(e)||(e=i(a,e,d)),e}var f=j(a,b);if(f)return f;var g=Object.keys(b),p=h(g);if(a.showHidden&&(g=Object.getOwnPropertyNames(b)),z(b)&&(g.indexOf("message")>=0||g.indexOf("description")>=0))return k(b);if(0===g.length){if(A(b)){var q=b.name?": "+b.name:"";return a.stylize("[Function"+q+"]","special")}if(w(b))return a.stylize(RegExp.prototype.toString.call(b),"regexp");if(y(b))return a.stylize(Date.prototype.toString.call(b),"date");if(z(b))return k(b)}var r="",s=!1,u=["{","}"];if(o(b)&&(s=!0,u=["[","]"]),A(b)){var v=b.name?": "+b.name:"";r=" [Function"+v+"]"}if(w(b)&&(r=" "+RegExp.prototype.toString.call(b)),y(b)&&(r=" "+Date.prototype.toUTCString.call(b)),z(b)&&(r=" "+k(b)),0===g.length&&(!s||0==b.length))return u[0]+r+u[1];if(d<0)return w(b)?a.stylize(RegExp.prototype.toString.call(b),"regexp"):a.stylize("[Object]","special");a.seen.push(b);var x;return x=s?l(a,b,d,p,g):g.map(function(c){return m(a,b,d,p,c,s)}),a.seen.pop(),n(x,r,u)}function j(a,b){if(v(b))return a.stylize("undefined","undefined");if(t(b)){var c="'"+JSON.stringify(b).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return a.stylize(c,"string")}return s(b)?a.stylize(""+b,"number"):p(b)?a.stylize(""+b,"boolean"):q(b)?a.stylize("null","null"):void 0}function k(a){return"["+Error.prototype.toString.call(a)+"]"}function l(a,b,c,d,e){for(var f=[],g=0,h=b.length;g-1&&(h=f?h.split("\n").map(function(a){return" "+a}).join("\n").substr(2):"\n"+h.split("\n").map(function(a){return" "+a}).join("\n"))):h=a.stylize("[Circular]","special")),v(g)){if(f&&e.match(/^\d+$/))return h;g=JSON.stringify(""+e),g.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(g=g.substr(1,g.length-2),g=a.stylize(g,"name")):(g=g.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),g=a.stylize(g,"string"))}return g+": "+h}function n(a,b,c){var d=0,e=a.reduce(function(a,b){return d++,b.indexOf("\n")>=0&&d++,a+b.replace(/\u001b\[\d\d?m/g,"").length+1},0);return e>60?c[0]+(""===b?"":b+"\n ")+" "+a.join(",\n ")+" "+c[1]:c[0]+b+" "+a.join(", ")+" "+c[1]}function o(a){return Array.isArray(a)}function p(a){return"boolean"==typeof a}function q(a){return null===a}function r(a){return null==a}function s(a){return"number"==typeof a}function t(a){return"string"==typeof a}function u(a){return"symbol"==typeof a}function v(a){return void 0===a}function w(a){return x(a)&&"[object RegExp]"===C(a)}function x(a){return"object"==typeof a&&null!==a}function y(a){return x(a)&&"[object Date]"===C(a)}function z(a){return x(a)&&("[object Error]"===C(a)||a instanceof Error)}function A(a){return"function"==typeof a}function B(a){return null===a||"boolean"==typeof a||"number"==typeof a||"string"==typeof a||"symbol"==typeof a||"undefined"==typeof a}function C(a){return Object.prototype.toString.call(a)}function D(a,b){return Object.prototype.hasOwnProperty.call(a,b)}var E=/%[sdj%]/g;c.format=function(a){if(!t(a)){for(var b=[],c=0;c=f)return a;switch(a){case"%s":return String(d[c++]);case"%d":return Number(d[c++]);case"%j":try{return JSON.stringify(d[c++])}catch(a){return"[Circular]"}default:return a}}),h=d[c];c=e())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+e().toString(16)+" bytes");return 0|a}function q(a){return+a!=a&&(a=0),g.alloc(+a)}function r(a,b){if(g.isBuffer(a))return a.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(a)||a instanceof ArrayBuffer))return a.byteLength;"string"!=typeof a&&(a=""+a);var c=a.length;if(0===c)return 0;for(var d=!1;;)switch(b){case"ascii":case"latin1":case"binary":return c;case"utf8":case"utf-8":case void 0:return T(a).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*c;case"hex":return c>>>1;case"base64":return W(a).length;default:if(d)return T(a).length;b=(""+b).toLowerCase(),d=!0}}function s(a,b,c){var d=!1;if((void 0===b||b<0)&&(b=0),b>this.length)return"";if((void 0===c||c>this.length)&&(c=this.length),c<=0)return"";if(c>>>=0,b>>>=0,c<=b)return"";for(a||(a="utf8");;)switch(a){case"hex":return H(this,b,c);case"utf8":case"utf-8":return D(this,b,c);case"ascii":return F(this,b,c);case"latin1":case"binary":return G(this,b,c);case"base64":return C(this,b,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,b,c);default:if(d)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase(),d=!0}}function t(a,b,c){var d=a[b];a[b]=a[c],a[c]=d}function u(a,b,c,d,e){if(0===a.length)return-1;if("string"==typeof c?(d=c,c=0):c>2147483647?c=2147483647:c<-2147483648&&(c=-2147483648),c=+c,isNaN(c)&&(c=e?0:a.length-1),c<0&&(c=a.length+c),c>=a.length){if(e)return-1;c=a.length-1}else if(c<0){if(!e)return-1;c=0}if("string"==typeof b&&(b=g.from(b,d)),g.isBuffer(b))return 0===b.length?-1:v(a,b,c,d,e);if("number"==typeof b)return b=255&b,g.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?e?Uint8Array.prototype.indexOf.call(a,b,c):Uint8Array.prototype.lastIndexOf.call(a,b,c):v(a,[b],c,d,e);throw new TypeError("val must be string, number or Buffer")}function v(a,b,c,d,e){function f(a,b){return 1===g?a[b]:a.readUInt16BE(b*g)}var g=1,h=a.length,i=b.length;if(void 0!==d&&(d=String(d).toLowerCase(),"ucs2"===d||"ucs-2"===d||"utf16le"===d||"utf-16le"===d)){if(a.length<2||b.length<2)return-1;g=2,h/=2,i/=2,c/=2}var j;if(e){var k=-1;for(j=c;jh&&(c=h-i),j=c;j>=0;j--){for(var l=!0,m=0;me&&(d=e)):d=e;var f=b.length;if(f%2!==0)throw new TypeError("Invalid hex string");d>f/2&&(d=f/2);for(var g=0;g239?4:f>223?3:f>191?2:1;if(e+h<=c){var i,j,k,l;switch(h){case 1:f<128&&(g=f);break;case 2:i=a[e+1],128===(192&i)&&(l=(31&f)<<6|63&i,l>127&&(g=l));break;case 3:i=a[e+1],j=a[e+2],128===(192&i)&&128===(192&j)&&(l=(15&f)<<12|(63&i)<<6|63&j,l>2047&&(l<55296||l>57343)&&(g=l));break;case 4:i=a[e+1],j=a[e+2],k=a[e+3],128===(192&i)&&128===(192&j)&&128===(192&k)&&(l=(15&f)<<18|(63&i)<<12|(63&j)<<6|63&k,l>65535&&l<1114112&&(g=l))}}null===g?(g=65533,h=1):g>65535&&(g-=65536,d.push(g>>>10&1023|55296),g=56320|1023&g),d.push(g),e+=h}return E(d)}function E(a){var b=a.length;if(b<=aa)return String.fromCharCode.apply(String,a);for(var c="",d=0;dd)&&(c=d);for(var e="",f=b;fc)throw new RangeError("Trying to access beyond buffer length")}function K(a,b,c,d,e,f){if(!g.isBuffer(a))throw new TypeError('"buffer" argument must be a Buffer instance');if(b>e||ba.length)throw new RangeError("Index out of range")}function L(a,b,c,d){b<0&&(b=65535+b+1);for(var e=0,f=Math.min(a.length-c,2);e>>8*(d?e:1-e)}function M(a,b,c,d){b<0&&(b=4294967295+b+1);for(var e=0,f=Math.min(a.length-c,4);e>>8*(d?e:3-e)&255}function N(a,b,c,d,e,f){if(c+d>a.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("Index out of range")}function O(a,b,c,d,e){return e||N(a,b,c,4,3.4028234663852886e38,-3.4028234663852886e38),$.write(a,b,c,d,23,4),c+4}function P(a,b,c,d,e){return e||N(a,b,c,8,1.7976931348623157e308,-1.7976931348623157e308),$.write(a,b,c,d,52,8),c+8}function Q(a){if(a=R(a).replace(ba,""),a.length<2)return"";for(;a.length%4!==0;)a+="=";return a}function R(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function S(a){return a<16?"0"+a.toString(16):a.toString(16)}function T(a,b){b=b||1/0;for(var c,d=a.length,e=null,f=[],g=0;g55295&&c<57344){if(!e){if(c>56319){(b-=3)>-1&&f.push(239,191,189);continue}if(g+1===d){(b-=3)>-1&&f.push(239,191,189);continue}e=c;continue}if(c<56320){(b-=3)>-1&&f.push(239,191,189),e=c;continue}c=(e-55296<<10|c-56320)+65536}else e&&(b-=3)>-1&&f.push(239,191,189);if(e=null,c<128){if((b-=1)<0)break;f.push(c)}else if(c<2048){if((b-=2)<0)break;f.push(c>>6|192,63&c|128)}else if(c<65536){if((b-=3)<0)break;f.push(c>>12|224,c>>6&63|128,63&c|128)}else{if(!(c<1114112))throw new Error("Invalid code point");if((b-=4)<0)break;f.push(c>>18|240,c>>12&63|128,c>>6&63|128,63&c|128)}}return f}function U(a){for(var b=[],c=0;c>8,e=c%256,f.push(e),f.push(d);return f}function W(a){return Z.toByteArray(Q(a))}function X(a,b,c,d){for(var e=0;e=b.length||e>=a.length);++e)b[e+c]=a[e];return e}function Y(a){return a!==a}var Z=a("base64-js"),$=a("ieee754"),_=a("isarray");c.Buffer=g,c.SlowBuffer=q,c.INSPECT_MAX_BYTES=50,g.TYPED_ARRAY_SUPPORT=void 0!==b.TYPED_ARRAY_SUPPORT?b.TYPED_ARRAY_SUPPORT:d(),c.kMaxLength=e(),g.poolSize=8192,g._augment=function(a){return a.__proto__=g.prototype,a},g.from=function(a,b,c){return h(null,a,b,c)},g.TYPED_ARRAY_SUPPORT&&(g.prototype.__proto__=Uint8Array.prototype,g.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&g[Symbol.species]===g&&Object.defineProperty(g,Symbol.species,{value:null,configurable:!0})),g.alloc=function(a,b,c){return j(null,a,b,c)},g.allocUnsafe=function(a){return k(null,a)},g.allocUnsafeSlow=function(a){return k(null,a)},g.isBuffer=function(a){return!(null==a||!a._isBuffer)},g.compare=function(a,b){if(!g.isBuffer(a)||!g.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var c=a.length,d=b.length,e=0,f=Math.min(c,d);e0&&(a=this.toString("hex",0,b).match(/.{2}/g).join(" "),this.length>b&&(a+=" ... ")),""},g.prototype.compare=function(a,b,c,d,e){if(!g.isBuffer(a))throw new TypeError("Argument must be a Buffer");if(void 0===b&&(b=0),void 0===c&&(c=a?a.length:0),void 0===d&&(d=0),void 0===e&&(e=this.length),b<0||c>a.length||d<0||e>this.length)throw new RangeError("out of range index");if(d>=e&&b>=c)return 0;if(d>=e)return-1;if(b>=c)return 1;if(b>>>=0,c>>>=0,d>>>=0,e>>>=0,this===a)return 0;for(var f=e-d,h=c-b,i=Math.min(f,h),j=this.slice(d,e),k=a.slice(b,c),l=0;le)&&(c=e),a.length>0&&(c<0||b<0)||b>this.length)throw new RangeError("Attempt to write outside buffer bounds");d||(d="utf8");for(var f=!1;;)switch(d){case"hex":return w(this,a,b,c);case"utf8":case"utf-8":return x(this,a,b,c);case"ascii":return y(this,a,b,c);case"latin1":case"binary":return z(this,a,b,c);case"base64":return A(this,a,b,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,a,b,c);default:if(f)throw new TypeError("Unknown encoding: "+d);d=(""+d).toLowerCase(),f=!0}},g.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var aa=4096;g.prototype.slice=function(a,b){var c=this.length;a=~~a,b=void 0===b?c:~~b,a<0?(a+=c,a<0&&(a=0)):a>c&&(a=c),b<0?(b+=c,b<0&&(b=0)):b>c&&(b=c),b0&&(e*=256);)d+=this[a+--b]*e;return d},g.prototype.readUInt8=function(a,b){return b||J(a,1,this.length),this[a]},g.prototype.readUInt16LE=function(a,b){return b||J(a,2,this.length),this[a]|this[a+1]<<8},g.prototype.readUInt16BE=function(a,b){return b||J(a,2,this.length),this[a]<<8|this[a+1]},g.prototype.readUInt32LE=function(a,b){return b||J(a,4,this.length),(this[a]|this[a+1]<<8|this[a+2]<<16)+16777216*this[a+3]},g.prototype.readUInt32BE=function(a,b){return b||J(a,4,this.length),16777216*this[a]+(this[a+1]<<16|this[a+2]<<8|this[a+3])},g.prototype.readIntLE=function(a,b,c){a=0|a,b=0|b,c||J(a,b,this.length);for(var d=this[a],e=1,f=0;++f=e&&(d-=Math.pow(2,8*b)),d},g.prototype.readIntBE=function(a,b,c){a=0|a,b=0|b,c||J(a,b,this.length);for(var d=b,e=1,f=this[a+--d];d>0&&(e*=256);)f+=this[a+--d]*e;return e*=128,f>=e&&(f-=Math.pow(2,8*b)),f},g.prototype.readInt8=function(a,b){return b||J(a,1,this.length),128&this[a]?(255-this[a]+1)*-1:this[a]},g.prototype.readInt16LE=function(a,b){b||J(a,2,this.length);var c=this[a]|this[a+1]<<8;return 32768&c?4294901760|c:c},g.prototype.readInt16BE=function(a,b){b||J(a,2,this.length);var c=this[a+1]|this[a]<<8;return 32768&c?4294901760|c:c},g.prototype.readInt32LE=function(a,b){return b||J(a,4,this.length),this[a]|this[a+1]<<8|this[a+2]<<16|this[a+3]<<24},g.prototype.readInt32BE=function(a,b){return b||J(a,4,this.length),this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]},g.prototype.readFloatLE=function(a,b){return b||J(a,4,this.length),$.read(this,a,!0,23,4)},g.prototype.readFloatBE=function(a,b){return b||J(a,4,this.length),$.read(this,a,!1,23,4)},g.prototype.readDoubleLE=function(a,b){return b||J(a,8,this.length),$.read(this,a,!0,52,8)},g.prototype.readDoubleBE=function(a,b){return b||J(a,8,this.length),$.read(this,a,!1,52,8)},g.prototype.writeUIntLE=function(a,b,c,d){if(a=+a,b=0|b,c=0|c,!d){var e=Math.pow(2,8*c)-1;K(this,a,b,c,e,0)}var f=1,g=0;for(this[b]=255&a;++g=0&&(g*=256);)this[b+f]=a/g&255;return b+c},g.prototype.writeUInt8=function(a,b,c){return a=+a,b=0|b,c||K(this,a,b,1,255,0),g.TYPED_ARRAY_SUPPORT||(a=Math.floor(a)),this[b]=255&a,b+1},g.prototype.writeUInt16LE=function(a,b,c){return a=+a,b=0|b,c||K(this,a,b,2,65535,0),g.TYPED_ARRAY_SUPPORT?(this[b]=255&a,this[b+1]=a>>>8):L(this,a,b,!0),b+2},g.prototype.writeUInt16BE=function(a,b,c){return a=+a,b=0|b,c||K(this,a,b,2,65535,0),g.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=255&a):L(this,a,b,!1),b+2},g.prototype.writeUInt32LE=function(a,b,c){return a=+a,b=0|b,c||K(this,a,b,4,4294967295,0),g.TYPED_ARRAY_SUPPORT?(this[b+3]=a>>>24,this[b+2]=a>>>16,this[b+1]=a>>>8,this[b]=255&a):M(this,a,b,!0),b+4},g.prototype.writeUInt32BE=function(a,b,c){return a=+a,b=0|b,c||K(this,a,b,4,4294967295,0),g.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=255&a):M(this,a,b,!1),b+4},g.prototype.writeIntLE=function(a,b,c,d){if(a=+a,b=0|b,!d){var e=Math.pow(2,8*c-1);K(this,a,b,c,e-1,-e)}var f=0,g=1,h=0;for(this[b]=255&a;++f>0)-h&255;return b+c},g.prototype.writeIntBE=function(a,b,c,d){if(a=+a,b=0|b,!d){var e=Math.pow(2,8*c-1);K(this,a,b,c,e-1,-e)}var f=c-1,g=1,h=0;for(this[b+f]=255&a;--f>=0&&(g*=256);)a<0&&0===h&&0!==this[b+f+1]&&(h=1),this[b+f]=(a/g>>0)-h&255;return b+c},g.prototype.writeInt8=function(a,b,c){return a=+a,b=0|b,c||K(this,a,b,1,127,-128),g.TYPED_ARRAY_SUPPORT||(a=Math.floor(a)),a<0&&(a=255+a+1),this[b]=255&a,b+1},g.prototype.writeInt16LE=function(a,b,c){return a=+a,b=0|b,c||K(this,a,b,2,32767,-32768),g.TYPED_ARRAY_SUPPORT?(this[b]=255&a,this[b+1]=a>>>8):L(this,a,b,!0),b+2},g.prototype.writeInt16BE=function(a,b,c){return a=+a,b=0|b,c||K(this,a,b,2,32767,-32768),g.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=255&a):L(this,a,b,!1),b+2},g.prototype.writeInt32LE=function(a,b,c){return a=+a,b=0|b,c||K(this,a,b,4,2147483647,-2147483648),g.TYPED_ARRAY_SUPPORT?(this[b]=255&a,this[b+1]=a>>>8,this[b+2]=a>>>16,this[b+3]=a>>>24):M(this,a,b,!0),b+4},g.prototype.writeInt32BE=function(a,b,c){return a=+a,b=0|b,c||K(this,a,b,4,2147483647,-2147483648),a<0&&(a=4294967295+a+1),g.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=255&a):M(this,a,b,!1),b+4},g.prototype.writeFloatLE=function(a,b,c){return O(this,a,b,!0,c)},g.prototype.writeFloatBE=function(a,b,c){return O(this,a,b,!1,c)},g.prototype.writeDoubleLE=function(a,b,c){return P(this,a,b,!0,c)},g.prototype.writeDoubleBE=function(a,b,c){return P(this,a,b,!1,c)},g.prototype.copy=function(a,b,c,d){if(c||(c=0),d||0===d||(d=this.length),b>=a.length&&(b=a.length),b||(b=0),d>0&&d=this.length)throw new RangeError("sourceStart out of bounds");if(d<0)throw new RangeError("sourceEnd out of bounds");d>this.length&&(d=this.length),a.length-b=0;--e)a[e+b]=this[e+c];else if(f<1e3||!g.TYPED_ARRAY_SUPPORT)for(e=0;e>>=0,c=void 0===c?this.length:c>>>0,a||(a=0);var f;if("number"==typeof a)for(f=b;f0)throw new Error("Invalid string. Length must be a multiple of 4");f="="===a[h-2]?2:"="===a[h-1]?1:0,g=new k(3*h/4-f),d=f>0?h-4:h;var i=0;for(b=0,c=0;b>16&255,g[i++]=e>>8&255,g[i++]=255&e;return 2===f?(e=j[a.charCodeAt(b)]<<2|j[a.charCodeAt(b+1)]>>4,g[i++]=255&e):1===f&&(e=j[a.charCodeAt(b)]<<10|j[a.charCodeAt(b+1)]<<4|j[a.charCodeAt(b+2)]>>2,g[i++]=e>>8&255,g[i++]=255&e),g}function f(a){return i[a>>18&63]+i[a>>12&63]+i[a>>6&63]+i[63&a]}function g(a,b,c){for(var d,e=[],g=b;gk?k:j+h));return 1===d?(b=a[c-1],e+=i[b>>2],e+=i[b<<4&63],e+="=="):2===d&&(b=(a[c-2]<<8)+a[c-1],e+=i[b>>10],e+=i[b>>4&63],e+=i[b<<2&63],e+="="),f.push(e),f.join("")}c.toByteArray=e,c.fromByteArray=h;var i=[],j=[],k="undefined"!=typeof Uint8Array?Uint8Array:Array;d()},{}],71:[function(a,b,c){b.exports=a(59)},{}],72:[function(a,b,c){var d={}.toString;b.exports=Array.isArray||function(a){return"[object Array]"==d.call(a)}},{}],73:[function(a,b,c){function d(a,b){if(a.length%h!==0){var c=a.length+(h-a.length%h);a=g.concat([a,i],c)}for(var d=[],e=b?a.readInt32BE:a.readInt32LE,f=0;fn?b=a(b):b.length>5]|=128<>>9<<4)+14]=b;for(var c=1732584193,d=-271733879,e=-1732584194,k=271733878,l=0;l>16)+(b>>16)+(c>>16);return d<<16|65535&c}function k(a,b){return a<>>32-b}var l=a("./helpers");b.exports=function(a){return l.hash(a,d,16)}},{"./helpers":73}],76:[function(a,b,c){!function(){var a,c,d=this;a=function(a){for(var b,b,c=new Array(a),d=0;d>>((3&d)<<3)&255;return c},d.crypto&&crypto.getRandomValues&&(c=function(a){var b=new Uint8Array(a);return crypto.getRandomValues(b),b}),b.exports=c||a}()},{}],77:[function(a,b,c){function d(a,b){a[b>>5]|=128<<24-b%32,a[(b+64>>9<<4)+15]=b;for(var c=Array(80),d=1732584193,i=-271733879,j=-1732584194,k=271733878,l=-1009589776,m=0;m>16)+(b>>16)+(c>>16);return d<<16|65535&c}function h(a,b){return a<>>32-b}var i=a("./helpers");b.exports=function(a){return i.hash(a,d,20,!0)}},{"./helpers":73}],78:[function(a,b,c){var d=a("./helpers"),e=function(a,b){var c=(65535&a)+(65535&b),d=(a>>16)+(b>>16)+(c>>16);return d<<16|65535&c},f=function(a,b){return a>>>b|a<<32-b},g=function(a,b){return a>>>b},h=function(a,b,c){return a&b^~a&c},i=function(a,b,c){return a&b^a&c^b&c},j=function(a){return f(a,2)^f(a,13)^f(a,22)},k=function(a){return f(a,6)^f(a,11)^f(a,25)},l=function(a){return f(a,7)^f(a,18)^g(a,3)},m=function(a){return f(a,17)^f(a,19)^g(a,10)},n=function(a,b){var c,d,f,g,n,o,p,q,r,s,t,u,v=new Array(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),w=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),x=new Array(64);a[b>>5]|=128<<24-b%32,a[(b+64>>9<<4)+15]=b;for(var r=0;r="a"&&a<="z"||a>="A"&&a<="Z"||"_"===a}function h(a){return a>="0"&&a<="9"||"-"===a}function i(a){return a>="a"&&a<="z"||a>="A"&&a<="Z"||a>="0"&&a<="9"||"_"===a}function j(){}function k(){}function l(a){this.runtime=a}function m(a){this._interpreter=a,this.functionTable={abs:{_func:this._functionAbs,_signature:[{types:[r]}]},avg:{_func:this._functionAvg,_signature:[{types:[z]}]},ceil:{_func:this._functionCeil,_signature:[{types:[r]}]},contains:{_func:this._functionContains,_signature:[{types:[t,u]},{types:[s]}]},ends_with:{_func:this._functionEndsWith,_signature:[{types:[t]},{types:[t]}]},floor:{_func:this._functionFloor,_signature:[{types:[r]}]},length:{_func:this._functionLength,_signature:[{types:[t,u,v]}]},map:{_func:this._functionMap,_signature:[{types:[x]},{types:[u]}]},max:{_func:this._functionMax,_signature:[{types:[z,A]}]},merge:{_func:this._functionMerge,_signature:[{types:[v],variadic:!0}]},max_by:{_func:this._functionMaxBy,_signature:[{types:[u]},{types:[x]}]},sum:{_func:this._functionSum,_signature:[{types:[z]}]},starts_with:{_func:this._functionStartsWith,_signature:[{types:[t]},{types:[t]}]},min:{_func:this._functionMin,_signature:[{types:[z,A]}]},min_by:{_func:this._functionMinBy,_signature:[{types:[u]},{types:[x]}]},type:{_func:this._functionType,_signature:[{types:[s]}]},keys:{_func:this._functionKeys,_signature:[{types:[v]}]},values:{_func:this._functionValues,_signature:[{types:[v]}]},sort:{_func:this._functionSort,_signature:[{types:[A,z]}]},sort_by:{_func:this._functionSortBy,_signature:[{types:[u]},{types:[x]}]},join:{_func:this._functionJoin,_signature:[{types:[t]},{types:[A]}]},reverse:{_func:this._functionReverse,_signature:[{types:[t,u]}]},to_array:{_func:this._functionToArray,_signature:[{types:[s]}]},to_string:{_func:this._functionToString,_signature:[{types:[s]}]},to_number:{_func:this._functionToNumber,_signature:[{types:[s]}]},not_null:{_func:this._functionNotNull,_signature:[{types:[s],variadic:!0}]}}}function n(a){var b=new k,c=b.parse(a);return c}function o(a){var b=new j;return b.tokenize(a)}function p(a,b){var c=new k,d=new m,e=new l(d);d._interpreter=e;var f=c.parse(b);return e.search(f,a)}var q;q="function"==typeof String.prototype.trimLeft?function(a){return a.trimLeft()}:function(a){return a.match(/^\s*(.*)/)[1]};var r=0,s=1,t=2,u=3,v=4,w=5,x=6,y=7,z=8,A=9,B="EOF",C="UnquotedIdentifier",D="QuotedIdentifier",E="Rbracket",F="Rparen",G="Comma",H="Colon",I="Rbrace",J="Number",K="Current",L="Expref",M="Pipe",N="Or",O="And",P="EQ",Q="GT",R="LT",S="GTE",T="LTE",U="NE",V="Flatten",W="Star",X="Filter",Y="Dot",Z="Not",$="Lbrace",_="Lbracket",aa="Lparen",ba="Literal",ca={".":Y,"*":W,",":G,":":H,"{":$,"}":I,"]":E,"(":aa,")":F,"@":K},da={"<":!0,">":!0,"=":!0,"!":!0},ea={" ":!0,"\t":!0,"\n":!0};j.prototype={tokenize:function(a){var b=[];this._current=0;for(var c,d,e;this._current"===c?"="===a[this._current]?(this._current++,{type:S,value:">=",start:b}):{type:Q,value:">",start:b}:"="===c&&"="===a[this._current]?(this._current++,{type:P,value:"==",start:b}):void 0},_consumeLiteral:function(a){this._current++;for(var b,c=this._current,d=a.length;"`"!==a[this._current]&&this._current=0)return!0;if(c.indexOf(a)>=0)return!0;if(!(d.indexOf(a[0])>=0))return!1;try{return JSON.parse(a),!0}catch(a){return!1}}};var fa={};fa[B]=0,fa[C]=0,fa[D]=0,fa[E]=0,fa[F]=0,fa[G]=0,fa[I]=0,fa[J]=0,fa[K]=0,fa[L]=0,fa[M]=1,fa[N]=2,fa[O]=3,fa[P]=5,fa[Q]=5,fa[R]=5,fa[S]=5,fa[T]=5,fa[U]=5,fa[V]=9,fa[W]=20,fa[X]=21,fa[Y]=40,fa[Z]=45,fa[$]=50,fa[_]=55,fa[aa]=60,k.prototype={parse:function(a){this._loadTokens(a),this.index=0;var b=this.expression(0);if(this._lookahead(0)!==B){var c=this._lookaheadToken(0),d=new Error("Unexpected token type: "+c.type+", value: "+c.value);throw d.name="ParserError",d}return b},_loadTokens:function(a){var b=new j,c=b.tokenize(a);c.push({type:B,value:"",start:a.length}),this.tokens=c},expression:function(a){var b=this._lookaheadToken(0);this._advance();for(var c=this.nud(b),d=this._lookahead(0);a=0?this.expression(a):b===_?(this._match(_),this._parseMultiselectList()):b===$?(this._match($),this._parseMultiselectHash()):void 0},_parseProjectionRHS:function(a){var b;if(fa[this._lookahead(0)]<10)b={type:"Identity"};else if(this._lookahead(0)===_)b=this.expression(a);else if(this._lookahead(0)===X)b=this.expression(a);else{if(this._lookahead(0)!==Y){var c=this._lookaheadToken(0),d=new Error("Sytanx error, unexpected token: "+c.value+"("+c.type+")");throw d.name="ParserError",d}this._match(Y),b=this._parseDotRHS(a)}return b},_parseMultiselectList:function(){for(var a=[];this._lookahead(0)!==E;){var b=this.expression(0);if(a.push(b),this._lookahead(0)===G&&(this._match(G),this._lookahead(0)===E))throw new Error("Unexpected token Rbracket")}return this._match(E),{type:"MultiSelectList",children:a}},_parseMultiselectHash:function(){for(var a,b,c,d,e=[],f=[C,D];;){if(a=this._lookaheadToken(0),f.indexOf(a.type)<0)throw new Error("Expecting an identifier token, got: "+a.type);if(b=a.value,this._advance(),this._match(H),c=this.expression(0),d={type:"KeyValuePair",name:b,value:c},e.push(d),this._lookahead(0)===G)this._match(G);else if(this._lookahead(0)===I){this._match(I);break}}return{type:"MultiSelectHash",children:e}}},l.prototype={search:function(a,b){return this.visit(a,b)},visit:function(a,g){var h,i,j,k,l,m,n,o,p,q;switch(a.type){case"Field":return null===g?null:c(g)?(m=g[a.name],void 0===m?null:m):null;case"Subexpression":for(j=this.visit(a.children[0],g),q=1;q0)for(q=u;qv;q+=w)j.push(g[q]);return j;case"Projection":var x=this.visit(a.children[0],g);if(!b(x))return null;for(p=[],q=0;ql;break;case S:j=k>=l;break;case R:j=k=a&&(b=c<0?a-1:a),b}},m.prototype={callFunction:function(a,b){var c=this.functionTable[a];if(void 0===c)throw new Error("Unknown function: "+a+"()");return this._validateArgs(a,b,c._signature),c._func.call(this,b)},_validateArgs:function(a,b,c){var d;if(c[c.length-1].variadic){if(b.length=0;e--)d+=c[e];return d}var f=a[0].slice(0);return f.reverse(),f},_functionAbs:function(a){return Math.abs(a[0])},_functionCeil:function(a){return Math.ceil(a[0])},_functionAvg:function(a){for(var b=0,c=a[0],d=0;d=0},_functionFloor:function(a){return Math.floor(a[0])},_functionLength:function(a){return c(a[0])?Object.keys(a[0]).length:a[0].length},_functionMap:function(a){for(var b=[],c=this._interpreter,d=a[0],e=a[1],f=0;f0){var b=this._getTypeName(a[0][0]);if(b===r)return Math.max.apply(Math,a[0]);for(var c=a[0],d=c[0],e=1;e0){var b=this._getTypeName(a[0][0]);if(b===r)return Math.min.apply(Math,a[0]);for(var c=a[0],d=c[0],e=1;eh?1:gg&&(g=c,b=e[h]);return b},_functionMinBy:function(a){for(var b,c,d=a[1],e=a[0],f=this.createKeyFunction(d,[r,t]),g=1/0,h=0;h0&&i>h&&(i=h);for(var j=0;j=0?(k=o.substr(0,p),l=o.substr(p+1)):(k=o,l=""),m=decodeURIComponent(k),n=decodeURIComponent(l),d(f,m)?Array.isArray(f[m])?f[m].push(n):f[m]=[f[m],n]:f[m]=n}return f}},{}],81:[function(a,b,c){var d=function(a){switch(typeof a){case"string":return a;case"boolean":return a?"true":"false";case"number":return isFinite(a)?a:"";default:return""}};b.exports=function(a,b,c,e){return b=b||"&",c=c||"=",null===a&&(a=void 0),"object"==typeof a?Object.keys(a).map(function(e){var f=encodeURIComponent(d(e))+c;return Array.isArray(a[e])?a[e].map(function(a){return f+encodeURIComponent(d(a))}).join(b):f+encodeURIComponent(d(a[e]))}).join(b):e?encodeURIComponent(d(e))+c+encodeURIComponent(d(a)):""}},{}],82:[function(a,b,c){arguments[4][66][0].apply(c,arguments)},{"./decode":80,"./encode":81}],83:[function(a,b,c){function d(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function e(a,b,c){if(a&&j(a)&&a instanceof d)return a;var e=new d;return e.parse(a,b,c),e}function f(a){return i(a)&&(a=e(a)),a instanceof d?a.format():d.prototype.format.call(a)}function g(a,b){return e(a,!1,!0).resolve(b)}function h(a,b){return a?e(a,!1,!0).resolveObject(b):b}function i(a){return"string"==typeof a}function j(a){return"object"==typeof a&&null!==a}function k(a){return null===a}function l(a){return null==a}var m=a("punycode");c.parse=e,c.resolve=g,c.resolveObject=h,c.format=f,c.Url=d;var n=/^([a-z0-9.+-]+:)/i,o=/:[0-9]*$/,p=["<",">",'"',"`"," ","\r","\n","\t"],q=["{","}","|","\\","^","`"].concat(p),r=["'"].concat(q),s=["%","/","?",";","#"].concat(r),t=["/","?","#"],u=255,v=/^[a-z0-9A-Z_-]{0,63}$/,w=/^([a-z0-9A-Z_-]{0,63})(.*)$/,x={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},z={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},A=a("querystring");d.prototype.parse=function(a,b,c){if(!i(a))throw new TypeError("Parameter 'url' must be a string, not "+typeof a);var d=a;d=d.trim();var e=n.exec(d);if(e){e=e[0];var f=e.toLowerCase();this.protocol=f,d=d.substr(e.length)}if(c||e||d.match(/^\/\/[^@\/]+@[^@\/]+/)){var g="//"===d.substr(0,2);!g||e&&y[e]||(d=d.substr(2),this.slashes=!0)}if(!y[e]&&(g||e&&!z[e])){for(var h=-1,j=0;j127?"x":C[E];if(!D.match(v)){var G=q.slice(0,j),H=q.slice(j+1),I=C.match(w);I&&(G.push(I[1]),H.unshift(I[2])),H.length&&(d="/"+H.join(".")+d),this.hostname=G.join(".");break}}}if(this.hostname.length>u?this.hostname="":this.hostname=this.hostname.toLowerCase(),!p){for(var J=this.hostname.split("."),K=[],j=0;j0)&&c.host.split("@");q&&(c.auth=q.shift(),c.host=c.hostname=q.shift())}return c.search=a.search,c.query=a.query,k(c.pathname)&&k(c.search)||(c.path=(c.pathname?c.pathname:"")+(c.search?c.search:"")),c.href=c.format(),c}if(!o.length)return c.pathname=null,c.search?c.path="/"+c.search:c.path=null,c.href=c.format(),c;for(var r=o.slice(-1)[0],s=(c.host||a.host)&&("."===r||".."===r)||""===r,t=0,u=o.length;u>=0;u--)r=o[u],"."==r?o.splice(u,1):".."===r?(o.splice(u,1),t++):t&&(o.splice(u,1),t--);if(!m&&!n)for(;t--;t)o.unshift("..");!m||""===o[0]||o[0]&&"/"===o[0].charAt(0)||o.unshift(""),s&&"/"!==o.join("/").substr(-1)&&o.push("");var v=""===o[0]||o[0]&&"/"===o[0].charAt(0);if(p){c.hostname=c.host=v?"":o.length?o.shift():"";var q=!!(c.host&&c.host.indexOf("@")>0)&&c.host.split("@");q&&(c.auth=q.shift(),c.host=c.hostname=q.shift())}return m=m||c.host&&o.length,m&&!v&&o.unshift(""),o.length?c.pathname=o.join("/"):(c.pathname=null,c.path=null),k(c.pathname)&&k(c.search)||(c.path=(c.pathname?c.pathname:"")+(c.search?c.search:"")),c.auth=a.auth||c.auth,c.slashes=c.slashes||a.slashes,c.href=c.format(),c},d.prototype.parseHost=function(){var a=this.host,b=o.exec(a);b&&(b=b[0],":"!==b&&(this.port=b.substr(1)),a=a.substr(0,a.length-b.length)),a&&(this.hostname=a)}},{punycode:63,querystring:66}],84:[function(a,b,c){(function(){var c,d;d=a("lodash/object/create"),b.exports=c=function(){function a(a,b,c){if(this.stringify=a.stringify,null==b)throw new Error("Missing attribute name of element "+a.name);if(null==c)throw new Error("Missing attribute value for attribute "+b+" of element "+a.name);this.name=this.stringify.attName(b),this.value=this.stringify.attValue(c)}return a.prototype.clone=function(){return d(a.prototype,this)},a.prototype.toString=function(a,b){return" "+this.name+'="'+this.value+'"'},a}()}).call(this)},{"lodash/object/create":143}],85:[function(a,b,c){(function(){var c,d,e,f,g;g=a("./XMLStringifier"),d=a("./XMLDeclaration"),e=a("./XMLDocType"),f=a("./XMLElement"),b.exports=c=function(){function a(a,b){var c,d;if(null==a)throw new Error("Root element needs a name");null==b&&(b={}),this.options=b,this.stringify=new g(b),d=new f(this,"doc"),c=d.element(a),c.isRoot=!0,c.documentObject=this,this.rootObject=c,b.headless||(c.declaration(b),null==b.pubID&&null==b.sysID||c.doctype(b))}return a.prototype.root=function(){return this.rootObject},a.prototype.end=function(a){return this.toString(a)},a.prototype.toString=function(a){var b,c,d,e,f,g,h,i;return e=(null!=a?a.pretty:void 0)||!1,b=null!=(g=null!=a?a.indent:void 0)?g:" ",d=null!=(h=null!=a?a.offset:void 0)?h:0,c=null!=(i=null!=a?a.newline:void 0)?i:"\n",f="",null!=this.xmldec&&(f+=this.xmldec.toString(a)),null!=this.doctype&&(f+=this.doctype.toString(a)),f+=this.rootObject.toString(a),e&&f.slice(-c.length)===c&&(f=f.slice(0,-c.length)),f},a}()}).call(this)},{"./XMLDeclaration":92,"./XMLDocType":93,"./XMLElement":94,"./XMLStringifier":98}],86:[function(a,b,c){(function(){var c,d,e,f=function(a,b){function c(){this.constructor=a}for(var d in b)g.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},g={}.hasOwnProperty;e=a("lodash/object/create"),d=a("./XMLNode"),b.exports=c=function(a){function b(a,c){if(b.__super__.constructor.call(this,a),null==c)throw new Error("Missing CDATA text");this.text=this.stringify.cdata(c)}return f(b,a),b.prototype.clone=function(){return e(b.prototype,this)},b.prototype.toString=function(a,b){var c,d,e,f,g,h,i,j,k;return f=(null!=a?a.pretty:void 0)||!1,c=null!=(h=null!=a?a.indent:void 0)?h:" ",e=null!=(i=null!=a?a.offset:void 0)?i:0,d=null!=(j=null!=a?a.newline:void 0)?j:"\n",b||(b=0),k=new Array(b+e+1).join(c),g="",f&&(g+=k),g+="",f&&(g+=d),g},b}(d)}).call(this)},{"./XMLNode":95,"lodash/object/create":143}],87:[function(a,b,c){(function(){var c,d,e,f=function(a,b){function c(){this.constructor=a}for(var d in b)g.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},g={}.hasOwnProperty;e=a("lodash/object/create"),d=a("./XMLNode"),b.exports=c=function(a){function b(a,c){if(b.__super__.constructor.call(this,a),null==c)throw new Error("Missing comment text");this.text=this.stringify.comment(c)}return f(b,a),b.prototype.clone=function(){return e(b.prototype,this)},b.prototype.toString=function(a,b){var c,d,e,f,g,h,i,j,k;return f=(null!=a?a.pretty:void 0)||!1,c=null!=(h=null!=a?a.indent:void 0)?h:" ",e=null!=(i=null!=a?a.offset:void 0)?i:0,d=null!=(j=null!=a?a.newline:void 0)?j:"\n",b||(b=0),k=new Array(b+e+1).join(c),g="",f&&(g+=k),g+="",f&&(g+=d),g},b}(d)}).call(this)},{"./XMLNode":95,"lodash/object/create":143}],88:[function(a,b,c){(function(){var c,d;d=a("lodash/object/create"),b.exports=c=function(){function a(a,b,c,d,e,f){if(this.stringify=a.stringify,null==b)throw new Error("Missing DTD element name");if(null==c)throw new Error("Missing DTD attribute name");if(!d)throw new Error("Missing DTD attribute type");if(!e)throw new Error("Missing DTD attribute default");if(0!==e.indexOf("#")&&(e="#"+e),!e.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT");if(f&&!e.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT");this.elementName=this.stringify.eleName(b),this.attributeName=this.stringify.attName(c),this.attributeType=this.stringify.dtdAttType(d),this.defaultValue=this.stringify.dtdAttDefault(f),this.defaultValueType=e}return a.prototype.clone=function(){return d(a.prototype,this)},a.prototype.toString=function(a,b){var c,d,e,f,g,h,i,j,k;return f=(null!=a?a.pretty:void 0)||!1,c=null!=(h=null!=a?a.indent:void 0)?h:" ",e=null!=(i=null!=a?a.offset:void 0)?i:0,d=null!=(j=null!=a?a.newline:void 0)?j:"\n",b||(b=0),k=new Array(b+e+1).join(c),g="",f&&(g+=k),g+="",f&&(g+=d),g},a}()}).call(this)},{"lodash/object/create":143}],89:[function(a,b,c){(function(){var c,d,e;d=a("lodash/object/create"),e=a("lodash/lang/isArray"),b.exports=c=function(){function a(a,b,c){if(this.stringify=a.stringify,null==b)throw new Error("Missing DTD element name");c||(c="(#PCDATA)"),e(c)&&(c="("+c.join(",")+")"),this.name=this.stringify.eleName(b),this.value=this.stringify.dtdElementValue(c)}return a.prototype.clone=function(){return d(a.prototype,this)},a.prototype.toString=function(a,b){var c,d,e,f,g,h,i,j,k;return f=(null!=a?a.pretty:void 0)||!1,c=null!=(h=null!=a?a.indent:void 0)?h:" ",e=null!=(i=null!=a?a.offset:void 0)?i:0,d=null!=(j=null!=a?a.newline:void 0)?j:"\n",b||(b=0),k=new Array(b+e+1).join(c),g="",f&&(g+=k),g+="",f&&(g+=d),g},a}()}).call(this)},{"lodash/lang/isArray":135,"lodash/object/create":143}],90:[function(a,b,c){(function(){var c,d,e;d=a("lodash/object/create"),e=a("lodash/lang/isObject"),b.exports=c=function(){function a(a,b,c,d){if(this.stringify=a.stringify,null==c)throw new Error("Missing entity name");if(null==d)throw new Error("Missing entity value");if(this.pe=!!b,this.name=this.stringify.eleName(c),e(d)){if(!d.pubID&&!d.sysID)throw new Error("Public and/or system identifiers are required for an external entity");if(d.pubID&&!d.sysID)throw new Error("System identifier is required for a public external entity");if(null!=d.pubID&&(this.pubID=this.stringify.dtdPubID(d.pubID)),null!=d.sysID&&(this.sysID=this.stringify.dtdSysID(d.sysID)),null!=d.nData&&(this.nData=this.stringify.dtdNData(d.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity")}else this.value=this.stringify.dtdEntityValue(d)}return a.prototype.clone=function(){return d(a.prototype,this)},a.prototype.toString=function(a,b){var c,d,e,f,g,h,i,j,k;return f=(null!=a?a.pretty:void 0)||!1,c=null!=(h=null!=a?a.indent:void 0)?h:" ",e=null!=(i=null!=a?a.offset:void 0)?i:0,d=null!=(j=null!=a?a.newline:void 0)?j:"\n",b||(b=0),k=new Array(b+e+1).join(c),g="",f&&(g+=k),g+="",f&&(g+=d),g},a}()}).call(this)},{"lodash/lang/isObject":139,"lodash/object/create":143}],91:[function(a,b,c){(function(){var c,d;d=a("lodash/object/create"),b.exports=c=function(){function a(a,b,c){if(this.stringify=a.stringify,null==b)throw new Error("Missing notation name");if(!c.pubID&&!c.sysID)throw new Error("Public or system identifiers are required for an external entity");this.name=this.stringify.eleName(b),null!=c.pubID&&(this.pubID=this.stringify.dtdPubID(c.pubID)),null!=c.sysID&&(this.sysID=this.stringify.dtdSysID(c.sysID))}return a.prototype.clone=function(){return d(a.prototype,this)},a.prototype.toString=function(a,b){var c,d,e,f,g,h,i,j,k;return f=(null!=a?a.pretty:void 0)||!1,c=null!=(h=null!=a?a.indent:void 0)?h:" ",e=null!=(i=null!=a?a.offset:void 0)?i:0,d=null!=(j=null!=a?a.newline:void 0)?j:"\n",b||(b=0),k=new Array(b+e+1).join(c),g="",f&&(g+=k),g+="",f&&(g+=d),g},a}()}).call(this)},{"lodash/object/create":143}],92:[function(a,b,c){(function(){var c,d,e,f,g=function(a,b){function c(){this.constructor=a}for(var d in b)h.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},h={}.hasOwnProperty;e=a("lodash/object/create"),f=a("lodash/lang/isObject"),d=a("./XMLNode"),b.exports=c=function(a){function b(a,c,d,e){var g;b.__super__.constructor.call(this,a),f(c)&&(g=c,c=g.version,d=g.encoding,e=g.standalone),c||(c="1.0"),null!=c&&(this.version=this.stringify.xmlVersion(c)),null!=d&&(this.encoding=this.stringify.xmlEncoding(d)),null!=e&&(this.standalone=this.stringify.xmlStandalone(e))}return g(b,a),b.prototype.clone=function(){return e(b.prototype,this)},b.prototype.toString=function(a,b){var c,d,e,f,g,h,i,j,k;return f=(null!=a?a.pretty:void 0)||!1,c=null!=(h=null!=a?a.indent:void 0)?h:" ",e=null!=(i=null!=a?a.offset:void 0)?i:0,d=null!=(j=null!=a?a.newline:void 0)?j:"\n",b||(b=0),k=new Array(b+e+1).join(c),g="",f&&(g+=k),g+="",f&&(g+=d),g},b}(d)}).call(this)},{"./XMLNode":95,"lodash/lang/isObject":139,"lodash/object/create":143}],93:[function(a,b,c){(function(){var c,d,e,f,g,h,i,j,k,l;k=a("lodash/object/create"),l=a("lodash/lang/isObject"),c=a("./XMLCData"),d=a("./XMLComment"),e=a("./XMLDTDAttList"),g=a("./XMLDTDEntity"),f=a("./XMLDTDElement"),h=a("./XMLDTDNotation"),j=a("./XMLProcessingInstruction"),b.exports=i=function(){function a(a,b,c){var d,e;this.documentObject=a,this.stringify=this.documentObject.stringify,this.children=[],l(b)&&(d=b,b=d.pubID,c=d.sysID),null==c&&(e=[b,c],c=e[0],b=e[1]),null!=b&&(this.pubID=this.stringify.dtdPubID(b)),null!=c&&(this.sysID=this.stringify.dtdSysID(c))}return a.prototype.clone=function(){return k(a.prototype,this)},a.prototype.element=function(a,b){var c;return c=new f(this,a,b),this.children.push(c),this},a.prototype.attList=function(a,b,c,d,f){var g;return g=new e(this,a,b,c,d,f),this.children.push(g),this},a.prototype.entity=function(a,b){var c;return c=new g(this,(!1),a,b),this.children.push(c),this},a.prototype.pEntity=function(a,b){var c;return c=new g(this,(!0),a,b),this.children.push(c),this},a.prototype.notation=function(a,b){var c;return c=new h(this,a,b),this.children.push(c),this},a.prototype.cdata=function(a){var b;return b=new c(this,a),this.children.push(b),this},a.prototype.comment=function(a){var b;return b=new d(this,a),this.children.push(b),this},a.prototype.instruction=function(a,b){var c;return c=new j(this,a,b),this.children.push(c),this},a.prototype.root=function(){return this.documentObject.root()},a.prototype.document=function(){return this.documentObject},a.prototype.toString=function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o;if(i=(null!=a?a.pretty:void 0)||!1,e=null!=(k=null!=a?a.indent:void 0)?k:" ",h=null!=(l=null!=a?a.offset:void 0)?l:0,g=null!=(m=null!=a?a.newline:void 0)?m:"\n",b||(b=0),o=new Array(b+h+1).join(e),j="",i&&(j+=o),j+="0){for(j+=" [",i&&(j+=g),n=this.children,d=0,f=n.length;d",p&&(q+=n);else if(p&&1===this.children.length&&null!=this.children[0].value)q+=">",q+=this.children[0].value,q+="",q+=n;else{for(q+=">",p&&(q+=n),w=this.children,i=0,k=w.length;i",p&&(q+=n)}return q},b.prototype.att=function(a,b){return this.attribute(a,b)},b.prototype.ins=function(a,b){return this.instruction(a,b)},b.prototype.a=function(a,b){return this.attribute(a,b)},b.prototype.i=function(a,b){return this.instruction(a,b)},b}(e)}).call(this)},{"./XMLAttribute":84,"./XMLNode":95,"./XMLProcessingInstruction":96,"lodash/collection/every":101,"lodash/lang/isArray":135,"lodash/lang/isFunction":137,"lodash/lang/isObject":139,"lodash/object/create":143}],95:[function(a,b,c){(function(){var c,d,e,f,g,h,i,j,k,l,m,n,o={}.hasOwnProperty;n=a("lodash/lang/isObject"),k=a("lodash/lang/isArray"),m=a("lodash/lang/isFunction"),l=a("lodash/lang/isEmpty"),g=null,c=null,d=null,e=null,f=null,i=null,j=null,b.exports=h=function(){function b(b){this.parent=b,this.options=this.parent.options,this.stringify=this.parent.stringify,null===g&&(g=a("./XMLElement"),c=a("./XMLCData"),d=a("./XMLComment"),e=a("./XMLDeclaration"),f=a("./XMLDocType"),i=a("./XMLRaw"),j=a("./XMLText"))}return b.prototype.clone=function(){throw new Error("Cannot clone generic XMLNode")},b.prototype.element=function(a,b,c){var d,e,f,g,h,i,j;if(g=null,null==b&&(b={}),b=b.valueOf(),n(b)||(i=[b,c],c=i[0],b=i[1]),null!=a&&(a=a.valueOf()),k(a))for(e=0,h=a.length;e/))throw new Error("Invalid CDATA text: "+a);return this.assertLegalChar(a)},a.prototype.comment=function(a){if(a=""+a||"",a.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+a);return this.assertLegalChar(a)},a.prototype.raw=function(a){return""+a||""},a.prototype.attName=function(a){return""+a||""},a.prototype.attValue=function(a){return a=""+a||"",this.attEscape(a)},a.prototype.insTarget=function(a){return""+a||""},a.prototype.insValue=function(a){if(a=""+a||"",a.match(/\?>/))throw new Error("Invalid processing instruction value: "+a);return a},a.prototype.xmlVersion=function(a){if(a=""+a||"",!a.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+a);return a},a.prototype.xmlEncoding=function(a){if(a=""+a||"",!a.match(/[A-Za-z](?:[A-Za-z0-9._-]|-)*/))throw new Error("Invalid encoding: "+a);return a},a.prototype.xmlStandalone=function(a){return a?"yes":"no"},a.prototype.dtdPubID=function(a){return""+a||""},a.prototype.dtdSysID=function(a){return""+a||""},a.prototype.dtdElementValue=function(a){return""+a||""},a.prototype.dtdAttType=function(a){return""+a||""},a.prototype.dtdAttDefault=function(a){return null!=a?""+a||"":a},a.prototype.dtdEntityValue=function(a){return""+a||""},a.prototype.dtdNData=function(a){return""+a||""},a.prototype.convertAttKey="@",a.prototype.convertPIKey="?",a.prototype.convertTextKey="#text",a.prototype.convertCDataKey="#cdata",a.prototype.convertCommentKey="#comment",a.prototype.convertRawKey="#raw",a.prototype.convertListKey="#list",a.prototype.assertLegalChar=function(a){var b,c;if(b=this.allowSurrogateChars?/[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uFFFE-\uFFFF]/:/[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uD800-\uDFFF\uFFFE-\uFFFF]/,c=a.match(b))throw new Error("Invalid character ("+c+") in string: "+a+" at index "+c.index);return a},a.prototype.elEscape=function(a){return a.replace(/&/g,"&").replace(//g,">").replace(/\r/g," ")},a.prototype.attEscape=function(a){return a.replace(/&/g,"&").replace(/3&&"function"==typeof g?(g=e(g,h,5),c-=2):(g=c>2&&"function"==typeof h?h:null,c-=g?1:0),i&&f(b[1],b[2],i)&&(g=3==c?null:g,c=2);for(var j=0;++ji))return!1;for(;k&&++h-1&&a%1==0&&a-1&&a%1==0&&a<=e}var e=Math.pow(2,53)-1;b.exports=d},{}],129:[function(a,b,c){function d(a){return a&&"object"==typeof a||!1}b.exports=d},{}],130:[function(a,b,c){function d(a){return a===a&&(0===a?1/a>0:!e(a))}var e=a("../lang/isObject");b.exports=d},{"../lang/isObject":139}],131:[function(a,b,c){(function(c){var d=a("../lang/isNative"),e=d(e=c.WeakMap)&&e,f=e&&new e;b.exports=f}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../lang/isNative":138}],132:[function(a,b,c){function d(a){for(var b=i(a),c=b.length,d=c&&a.length,k=d&&h(d)&&(f(a)||j.nonEnumArgs&&e(a)),m=-1,n=[];++m0;++d0)for(var g=0;g