diff --git a/README.md b/README.md index 97f04915b1..0505f02aa2 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ to work with the new major version. To use the SDK in the browser, simply add the following script tag to your HTML pages: - + ### In Node.js diff --git a/dist/aws-sdk.js b/dist/aws-sdk.js index e8dd59c148..e87eaf6374 100644 --- a/dist/aws-sdk.js +++ b/dist/aws-sdk.js @@ -1,4 +1,4 @@ -// AWS SDK for JavaScript v2.0.5 +// AWS SDK for JavaScript v2.0.6 // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // License at https://sdk.amazonaws.com/js/BUNDLE_LICENSE.txt (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;oi){n=i}}var a=t.length;W(a%2===0,"Invalid hex string");if(n>a/2){n=a/2}for(var o=0;os){r=s}}n=String(n||"utf8").toLowerCase();var h;switch(n){case"hex":h=a(this,e,t,r);break;case"utf8":case"utf-8":h=o(this,e,t,r);break;case"ascii":h=u(this,e,t,r);break;case"binary":h=f(this,e,t,r);break;case"base64":h=c(this,e,t,r);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":h=l(this,e,t,r);break;default:throw new Error("Unknown encoding")}return h};s.prototype.toString=function(e,t,r){var n=this;e=String(e||"utf8").toLowerCase();t=Number(t)||0;r=r!==undefined?Number(r):r=n.length;if(r===t)return"";var i;switch(e){case"hex":i=m(n,t,r);break;case"utf8":case"utf-8":i=p(n,t,r);break;case"ascii":i=d(n,t,r);break;case"binary":i=v(n,t,r);break;case"base64":i=h(n,t,r);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":i=g(n,t,r);break;default:throw new Error("Unknown encoding")}return i};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};s.prototype.copy=function(e,t,r,n){var i=this;if(!r)r=0;if(!n&&n!==0)n=this.length;if(!t)t=0;if(n===r)return;if(e.length===0||i.length===0)return;W(n>=r,"sourceEnd < sourceStart");W(t>=0&&t=0&&r=0&&n<=i.length,"sourceEnd out of bounds");if(n>this.length)n=this.length;if(e.length-tn)r=n;var i="";for(var s=t;s=this.length)return;return this[e]};function y(e,t,r,n){if(!n){W(typeof r==="boolean","missing or invalid endian");W(t!==undefined&&t!==null,"missing offset");W(t+1=i)return;var s;if(r){s=e[t];if(t+1=i)return;var s;if(r){if(t+2>>0)}else{if(t+1>>0)}return s}s.prototype.readUInt32LE=function(e,t){return b(this,e,true,t)};s.prototype.readUInt32BE=function(e,t){return b(this,e,false,t)};s.prototype.readInt8=function(e,t){if(!t){W(e!==undefined&&e!==null,"missing offset");W(e=this.length)return;var r=this[e]&128;if(r)return(255-this[e]+1)*-1;else return this[e]};function w(e,t,r,n){if(!n){W(typeof r==="boolean","missing or invalid endian");W(t!==undefined&&t!==null,"missing offset");W(t+1=i)return;var s=y(e,t,r,true);var a=s&32768;if(a)return(65535-s+1)*-1;else return s}s.prototype.readInt16LE=function(e,t){return w(this,e,true,t)};s.prototype.readInt16BE=function(e,t){return w(this,e,false,t)};function E(e,t,r,n){if(!n){W(typeof r==="boolean","missing or invalid endian");W(t!==undefined&&t!==null,"missing offset");W(t+3=i)return;var s=b(e,t,r,true);var a=s&2147483648;if(a)return(4294967295-s+1)*-1;else return s}s.prototype.readInt32LE=function(e,t){return E(this,e,true,t)};s.prototype.readInt32BE=function(e,t){return E(this,e,false,t)};function x(e,t,r,n){if(!n){W(typeof r==="boolean","missing or invalid endian");W(t+3=this.length)return;this[t]=e};function R(e,t,r,n,i){if(!i){W(t!==undefined&&t!==null,"missing value");W(typeof n==="boolean","missing or invalid endian");W(r!==undefined&&r!==null,"missing offset");W(r+1=s)return;for(var a=0,o=Math.min(s-r,2);a>>(n?a:1-a)*8}}s.prototype.writeUInt16LE=function(e,t,r){R(this,e,t,true,r)};s.prototype.writeUInt16BE=function(e,t,r){R(this,e,t,false,r)};function A(e,t,r,n,i){if(!i){W(t!==undefined&&t!==null,"missing value");W(typeof n==="boolean","missing or invalid endian");W(r!==undefined&&r!==null,"missing offset");W(r+3=s)return;for(var a=0,o=Math.min(s-r,4);a>>(n?a:3-a)*8&255}}s.prototype.writeUInt32LE=function(e,t,r){A(this,e,t,true,r)};s.prototype.writeUInt32BE=function(e,t,r){A(this,e,t,false,r)};s.prototype.writeInt8=function(e,t,r){if(!r){W(e!==undefined&&e!==null,"missing value");W(t!==undefined&&t!==null,"missing offset");W(t=this.length)return;if(e>=0)this.writeUInt8(e,t,r);else this.writeUInt8(255+e+1,t,r)};function C(e,t,r,n,i){if(!i){W(t!==undefined&&t!==null,"missing value");W(typeof n==="boolean","missing or invalid endian");W(r!==undefined&&r!==null,"missing offset");W(r+1=s)return;if(t>=0)R(e,t,r,n,i);else R(e,65535+t+1,r,n,i)}s.prototype.writeInt16LE=function(e,t,r){C(this,e,t,true,r)};s.prototype.writeInt16BE=function(e,t,r){C(this,e,t,false,r)};function q(e,t,r,n,i){if(!i){W(t!==undefined&&t!==null,"missing value");W(typeof n==="boolean","missing or invalid endian");W(r!==undefined&&r!==null,"missing offset");W(r+3=s)return;if(t>=0)A(e,t,r,n,i);else A(e,4294967295+t+1,r,n,i)}s.prototype.writeInt32LE=function(e,t,r){q(this,e,t,true,r)};s.prototype.writeInt32BE=function(e,t,r){q(this,e,t,false,r)};function T(e,t,r,n,s){if(!s){W(t!==undefined&&t!==null,"missing value");W(typeof n==="boolean","missing or invalid endian");W(r!==undefined&&r!==null,"missing offset");W(r+3=a)return;i.write(e,t,r,n,23,4)}s.prototype.writeFloatLE=function(e,t,r){T(this,e,t,true,r)};s.prototype.writeFloatBE=function(e,t,r){T(this,e,t,false,r)};function _(e,t,r,n,s){if(!s){W(t!==undefined&&t!==null,"missing value");W(typeof n==="boolean","missing or invalid endian");W(r!==undefined&&r!==null,"missing offset");W(r+7=a)return;i.write(e,t,r,n,52,8)}s.prototype.writeDoubleLE=function(e,t,r){_(this,e,t,true,r)};s.prototype.writeDoubleBE=function(e,t,r){_(this,e,t,false,r)};s.prototype.fill=function(e,t,r){if(!e)e=0;if(!t)t=0;if(!r)r=this.length;if(typeof e==="string"){e=e.charCodeAt(0)}W(typeof e==="number"&&!isNaN(e),"value is not a number");W(r>=t,"end < start");if(r===t)return;if(this.length===0)return;W(t>=0&&t=0&&r<=this.length,"end out of bounds");for(var n=t;n"};s.prototype.toArrayBuffer=function(){if(typeof Uint8Array!=="undefined"){if(s._useTypedArrays){return new s(this).buffer}else{var e=new Uint8Array(this.length);for(var t=0,r=e.length;t=t)return t;if(e>=0)return e;e+=t;if(e>=0)return e;return 0}function j(e){e=~~Math.ceil(+e);return e<0?0:e}function N(e){return(Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"})(e)}function k(e){return N(e)||s.isBuffer(e)||e&&typeof e==="object"&&typeof e.length==="number"}function O(e){if(e<16)return"0"+e.toString(16);return e.toString(16)}function D(e){var t=[];for(var r=0;r=55296&&n<=57343)r++;var s=encodeURIComponent(e.slice(i,r+1)).substr(1).split("%");for(var a=0;a>8;n=t%256;i.push(n);i.push(r)}return i}function H(e){return n.toByteArray(e)}function M(e,t,r,n){var i;for(var s=0;s=t.length||s>=e.length)break;t[s+r]=e[s]}return s}function z(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}function V(e,t){W(typeof e==="number","cannot write a non-number as a number");W(e>=0,"specified a negative value for writing an unsigned value");W(e<=t,"value is larger than maximum value for type");W(Math.floor(e)===e,"value has a fractional component")}function F(e,t,r){W(typeof e==="number","cannot write a non-number as a number");W(e<=t,"value larger than maximum allowed value");W(e>=r,"value smaller than minimum allowed value");W(Math.floor(e)===e,"value has a fractional component")}function X(e,t,r){W(typeof e==="number","cannot write a non-number as a number");W(e<=t,"value larger than maximum allowed value");W(e>=r,"value smaller than minimum allowed value")}function W(e,t){if(!e)throw new Error(t||"Failed assertion")}},{"base64-js":2,ieee754:3}],2:[function(e,t,r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(e){"use strict";var t=typeof Uint8Array!=="undefined"?Uint8Array:Array;var r="+".charCodeAt(0);var i="/".charCodeAt(0);var s="0".charCodeAt(0);var a="a".charCodeAt(0);var o="A".charCodeAt(0);function u(e){var t=e.charCodeAt(0);if(t===r)return 62;if(t===i)return 63;if(t0){throw new Error("Invalid string. Length must be a multiple of 4")}var f=e.length;a="="===e.charAt(f-2)?2:"="===e.charAt(f-1)?1:0;o=new t(e.length*3/4-a);i=a>0?e.length-4:e.length;var c=0;function l(e){o[c++]=e}for(r=0,n=0;r>16);l((s&65280)>>8);l(s&255)}if(a===2){s=u(e.charAt(r))<<2|u(e.charAt(r+1))>>4;l(s&255)}else if(a===1){s=u(e.charAt(r))<<10|u(e.charAt(r+1))<<4|u(e.charAt(r+2))>>2;l(s>>8&255);l(s&255)}return o}function c(e){var t,r=e.length%3,i="",s,a;function o(e){return n.charAt(e)}function u(e){return o(e>>18&63)+o(e>>12&63)+o(e>>6&63)+o(e&63)}for(t=0,a=e.length-r;t>2);i+=o(s<<4&63);i+="==";break;case 2:s=(e[e.length-2]<<8)+e[e.length-1];i+=o(s>>10);i+=o(s>>4&63);i+=o(s<<2&63);i+="=";break}return i}e.toByteArray=f;e.fromByteArray=c})(typeof r==="undefined"?this.base64js={}:r)},{}],3:[function(e,t,r){r.read=function(e,t,r,n,i){var s,a,o=i*8-n-1,u=(1<>1,c=-7,l=r?i-1:0,h=r?-1:1,p=e[t+l];l+=h;s=p&(1<<-c)-1;p>>=-c;c+=o;for(;c>0;s=s*256+e[t+l],l+=h,c-=8);a=s&(1<<-c)-1;s>>=-c;c+=n;for(;c>0;a=a*256+e[t+l],l+=h,c-=8);if(s===0){s=1-f}else if(s===u){return a?NaN:(p?-1:1)*Infinity}else{a=a+Math.pow(2,n);s=s-f}return(p?-1:1)*a*Math.pow(2,s-n)};r.write=function(e,t,r,n,i,s){var a,o,u,f=s*8-i-1,c=(1<>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:s-1,d=n?1:-1,v=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){o=isNaN(t)?1:0;a=c}else{a=Math.floor(Math.log(t)/Math.LN2);if(t*(u=Math.pow(2,-a))<1){a--;u*=2}if(a+l>=1){t+=h/u}else{t+=h*Math.pow(2,1-l)}if(t*u>=2){a++;u/=2}if(a+l>=c){o=0;a=c}else if(a+l>=1){o=(t*u-1)*Math.pow(2,i);a=a+l}else{o=t*Math.pow(2,l-1)*Math.pow(2,i);a=0}}for(;i>=8;e[r+p]=o&255,p+=d,o/=256,i-=8);a=a<0;e[r+p]=a&255,p+=d,a/=256,f-=8);e[r+p-d]|=v*128}},{}],4:[function(e,t,r){var n=e("buffer").Buffer;var i=4;var s=new n(i);s.fill(0);var a=8;function o(e,t){if(e.length%i!==0){var r=e.length+(i-e.length%i);e=n.concat([e,s],r)}var a=[];var o=t?e.readInt32BE:e.readInt32LE;for(var u=0;uf){t=e(t)}else if(t.length>5]|=128<>>9<<4)+14]=t;var r=1732584193;var n=-271733879;var i=-1732584194;var s=271733878;for(var a=0;a>16)+(t>>16)+(r>>16);return n<<16|r&65535}function h(e,t){return e<>>32-t}t.exports=function p(e){return n.hash(e,s,16)}},{"./helpers":4}],7:[function(e,t,r){(function(){var e=this;var r,n;r=function(e){var t=new Array(e);var r;for(var n=0,r;n>>((n&3)<<3)&255}return t};if(e.crypto&&crypto.getRandomValues){n=function(e){var t=new Uint8Array(e);crypto.getRandomValues(t);return t}}t.exports=n||r})()},{}],8:[function(e,t,r){var n=e("./helpers");function i(e,t){e[t>>5]|=128<<24-t%32;e[(t+64>>9<<4)+15]=t;var r=Array(80);var n=1732584193;var i=-271733879;var f=-1732584194;var c=271733878;var l=-1009589776;for(var h=0;h>16)+(t>>16)+(r>>16);return n<<16|r&65535}function u(e,t){return e<>>32-t}t.exports=function f(e){return n.hash(e,i,20,true)}},{"./helpers":4}],9:[function(e,t,r){var n=e("./helpers");var i=function(e,t){var r=(e&65535)+(t&65535);var n=(e>>16)+(t>>16)+(r>>16);return n<<16|r&65535};var s=function(e,t){return e>>>t|e<<32-t};var a=function(e,t){return e>>>t};var o=function(e,t,r){return e&t^~e&r};var u=function(e,t,r){return e&t^e&r^t&r};var f=function(e){return s(e,2)^s(e,13)^s(e,22)};var c=function(e){return s(e,6)^s(e,11)^s(e,25)};var l=function(e){return s(e,7)^s(e,18)^a(e,3)};var h=function(e){return s(e,17)^s(e,19)^a(e,10)};var p=function(e,t){var r=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);var n=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225);var s=new Array(64);var a,p,d,v,m,g,y,b,w,E;var x,S;e[t>>5]|=128<<24-t%32;e[(t+64>>9<<4)+15]=t;for(var w=0;w0&&this._events[e].length>r){this._events[e].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[e].length);if(typeof console.trace==="function"){console.trace()}}}return this};n.prototype.on=n.prototype.addListener;n.prototype.once=function(e,t){if(!i(t))throw TypeError("listener must be a function");var r=false;function n(){this.removeListener(e,n);if(!r){r=true;t.apply(this,arguments)}}n.listener=t;this.on(e,n);return this};n.prototype.removeListener=function(e,t){var r,n,s,o;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;r=this._events[e];s=r.length;n=-1;if(r===t||i(r.listener)&&r.listener===t){delete this._events[e];if(this._events.removeListener)this.emit("removeListener",e,t)}else if(a(r)){for(o=s;o-->0;){if(r[o]===t||r[o].listener&&r[o].listener===t){n=o;break}}if(n<0)return this;if(r.length===1){r.length=0;delete this._events[e]}else{r.splice(n,1)}if(this._events.removeListener)this.emit("removeListener",e,t)}return this};n.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[e])delete this._events[e];return this}if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}this.removeAllListeners("removeListener");this._events={};return this}r=this._events[e];if(i(r)){this.removeListener(e,r)}else{while(r.length)this.removeListener(e,r[r.length-1])}delete this._events[e];return this};n.prototype.listeners=function(e){var t;if(!this._events||!this._events[e])t=[];else if(i(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};n.listenerCount=function(e,t){var r;if(!e._events||!e._events[t])r=0;else if(i(e._events[t]))r=1;else r=e._events[t].length;return r};function i(e){return typeof e==="function"}function s(e){return typeof e==="number"}function a(e){return typeof e==="object"&&e!==null}function o(e){return e===void 0}},{}],11:[function(e,t,r){if(typeof Object.create==="function"){t.exports=function n(e,t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{t.exports=function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype;e.prototype=new r;e.prototype.constructor=e}}},{}],12:[function(e,t,r){var n=t.exports={};n.nextTick=function(){var e=typeof window!=="undefined"&&window.setImmediate;var t=typeof window!=="undefined"&&window.postMessage&&window.addEventListener;if(e){return function(e){return window.setImmediate(e)}}if(t){var r=[];window.addEventListener("message",function(e){var t=e.source;if((t===window||t===null)&&e.data==="process-tick"){e.stopPropagation();if(r.length>0){var n=r.shift();n()}}},true);return function n(e){r.push(e);window.postMessage("process-tick","*")}}return function i(e){setTimeout(e,0)}}();n.title="browser";n.browser=true;n.env={};n.argv=[];function i(){}n.on=i;n.addListener=i;n.once=i;n.off=i;n.removeListener=i;n.removeAllListeners=i;n.emit=i;n.binding=function(e){throw new Error("process.binding is not supported")};n.cwd=function(){return"/"};n.chdir=function(e){throw new Error("process.chdir is not supported")}},{}],13:[function(e,t,r){(function(e){(function(n){var i=typeof r=="object"&&r;var s=typeof t=="object"&&t&&t.exports==i&&t;var a=typeof e=="object"&&e;if(a.global===a||a.window===a){n=a}var o,u=2147483647,f=36,c=1,l=26,h=38,p=700,d=72,v=128,m="-",g=/^xn--/,y=/[^ -~]/,b=/\x2E|\u3002|\uFF0E|\uFF61/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},E=f-c,x=Math.floor,S=String.fromCharCode,R;function A(e){throw RangeError(w[e])}function C(e,t){var r=e.length;while(r--){e[r]=t(e[r])}return e}function q(e,t){return C(e.split(b),t).join(".")}function T(e){var t=[],r=0,n=e.length,i,s;while(r=55296&&i<=56319&&r65535){e-=65536;t+=S(e>>>10&1023|55296);e=56320|e&1023}t+=S(e);return t}).join("")}function L(e){if(e-48<10){return e-22}if(e-65<26){return e-65}if(e-97<26){return e-97}return f}function I(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function P(e,t,r){var n=0;e=r?x(e/p):e>>1;e+=x(e/t);for(;e>E*l>>1;n+=f){e=x(e/E)}return x(n+(E+1)*e/(e+h))}function j(e){var t=[],r=e.length,n,i=0,s=v,a=d,o,h,p,g,y,b,w,E,S;o=e.lastIndexOf(m);if(o<0){o=0}for(h=0;h=128){A("not-basic")}t.push(e.charCodeAt(h))}for(p=o>0?o+1:0;p=r){A("invalid-input")}w=L(e.charCodeAt(p++));if(w>=f||w>x((u-i)/y)){A("overflow")}i+=w*y;E=b<=a?c:b>=a+l?l:b-a;if(wx(u/S)){A("overflow")}y*=S}n=t.length+1;a=P(i-g,n,g==0);if(x(i/n)>u-s){A("overflow")}s+=x(i/n);i%=n;t.splice(i++,0,s)}return _(t)}function N(e){var t,r,n,i,s,a,o,h,p,g,y,b=[],w,E,R,C;e=T(e);w=e.length;t=v;r=0;s=d;for(a=0;a=t&&yx((u-r)/E)){A("overflow")}r+=(o-t)*E;t=o;for(a=0;au){A("overflow")}if(y==t){for(h=r,p=f;;p+=f){g=p<=s?c:p>=s+l?l:p-s;if(h0&&f>u){f=u}for(var c=0;c=0){p=l.substr(0,h);d=l.substr(h+1)}else{p=l;d=""}v=decodeURIComponent(p);m=decodeURIComponent(d);if(!n(a,v)){a[v]=m}else if(i(a[v])){a[v].push(m)}else{a[v]=[a[v],m]}}return a};var i=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}},{}],15:[function(e,t,r){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,o){t=t||"&";r=r||"=";if(e===null){e=undefined}if(typeof e==="object"){return s(a(e),function(s){var a=encodeURIComponent(n(s))+r;if(i(e[s])){return e[s].map(function(e){return a+encodeURIComponent(n(e))}).join(t)}else{return a+encodeURIComponent(n(e[s]))}}).join(t)}if(!o)return"";return encodeURIComponent(n(o))+r+encodeURIComponent(n(e))};var i=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function s(e,t){if(e.map)return e.map(t);var r=[];for(var n=0;n",'"',"`"," ","\r","\n"," "],u=["{","}","|","\\","^","`"].concat(o),f=["'"].concat(u),c=["%","/","?",";","#"].concat(f),l=["/","?","#"],h=255,p=/^[a-z0-9A-Z_-]{0,63}$/,d=/^([a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:true,"javascript:":true},m={javascript:true,"javascript:":true},g={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},y=e("querystring");function b(e,t,r){if(e&&R(e)&&e instanceof i)return e;var n=new i;n.parse(e,t,r);return n}i.prototype.parse=function(e,t,r){if(!S(e)){throw new TypeError("Parameter 'url' must be a string, not "+typeof e)}var i=e;i=i.trim();var a=s.exec(i);if(a){a=a[0];var o=a.toLowerCase();this.protocol=o;i=i.substr(a.length)}if(r||a||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var u=i.substr(0,2)==="//";if(u&&!(a&&m[a])){i=i.substr(2);this.slashes=true}}if(!m[a]&&(u||a&&!g[a])){var b=-1;for(var w=0;w127){_+="x"}else{_+=T[L]}}if(!_.match(p)){var P=C.slice(0,w);var j=C.slice(w+1);var N=T.match(d);if(N){P.push(N[1]);j.unshift(N[2])}if(j.length){i="/"+j.join(".")+i}this.hostname=P.join(".");break}}}}if(this.hostname.length>h){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!A){var k=this.hostname.split(".");var O=[];for(var w=0;w0?r.host.split("@"):false;if(p){r.auth=p.shift();r.host=r.hostname=p.shift()}}r.search=e.search;r.query=e.query;if(!A(r.pathname)||!A(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.href=r.format();return r}if(!l.length){r.pathname=null;if(r.search){r.path="/"+r.search}else{r.path=null}r.href=r.format();return r}var d=l.slice(-1)[0];var v=(r.host||e.host)&&(d==="."||d==="..")||d==="";var y=0;for(var b=l.length;b>=0;b--){d=l[b];if(d=="."){l.splice(b,1)}else if(d===".."){l.splice(b,1);y++}else if(y){l.splice(b,1);y--}}if(!f&&!c){for(;y--;y){l.unshift("..")}}if(f&&l[0]!==""&&(!l[0]||l[0].charAt(0)!=="/")){l.unshift("")}if(v&&l.join("/").substr(-1)!=="/"){l.push("")}var w=l[0]===""||l[0]&&l[0].charAt(0)==="/";if(h){r.hostname=r.host=w?"":l.length?l.shift():"";var p=r.host&&r.host.indexOf("@")>0?r.host.split("@"):false;if(p){r.auth=p.shift();r.host=r.hostname=p.shift()}}f=f||r.host&&l.length;if(f&&!w){l.unshift("")}if(!l.length){r.pathname=null;r.path=null}else{r.pathname=l.join("/")}if(!A(r.pathname)||!A(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.auth=e.auth||r.auth;r.slashes=r.slashes||e.slashes;r.href=r.format();return r};i.prototype.parseHost=function(){var e=this.host;var t=a.exec(e);if(t){t=t[0];if(t!==":"){this.port=t.substr(1)}e=e.substr(0,e.length-t.length)}if(e)this.hostname=e};function S(e){return typeof e==="string"}function R(e){return typeof e==="object"&&e!==null}function A(e){return e===null}function C(e){return e==null}},{punycode:13,querystring:16}],18:[function(e,t,r){t.exports=function n(e){return e&&typeof e==="object"&&typeof e.copy==="function"&&typeof e.fill==="function"&&typeof e.readUInt8==="function"}},{}],19:[function(e,t,r){(function(t,n){var i=/%[sdj%]/g;r.format=function(e){if(!x(e)){var t=[];for(var r=0;r=s)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return e}});for(var u=n[r];r=3)n.depth=arguments[2];if(arguments.length>=4)n.colors=arguments[3];if(y(t)){n.showHidden=t}else if(t){r._extend(n,t)}if(R(n.showHidden))n.showHidden=false;if(R(n.depth))n.depth=2;if(R(n.colors))n.colors=false;if(R(n.customInspect))n.customInspect=true;if(n.colors)n.stylize=u;return l(n,e,n.depth)}r.inspect=o;o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};o.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"};function u(e,t){var r=o.styles[t];if(r){return"["+o.colors[r][0]+"m"+e+"["+o.colors[r][1]+"m"}else{return e}}function f(e,t){return e}function c(e){var t={};e.forEach(function(e,r){t[e]=true});return t}function l(e,t,n){if(e.customInspect&&t&&_(t.inspect)&&t.inspect!==r.inspect&&!(t.constructor&&t.constructor.prototype===t)){var i=t.inspect(n,e);if(!x(i)){i=l(e,i,n)}return i}var s=h(e,t);if(s){return s}var a=Object.keys(t);var o=c(a);if(e.showHidden){a=Object.getOwnPropertyNames(t)}if(T(t)&&(a.indexOf("message")>=0||a.indexOf("description")>=0)){return p(t)}if(a.length===0){if(_(t)){var u=t.name?": "+t.name:"";return e.stylize("[Function"+u+"]","special")}if(A(t)){return e.stylize(RegExp.prototype.toString.call(t),"regexp")}if(q(t)){return e.stylize(Date.prototype.toString.call(t),"date")}if(T(t)){return p(t)}}var f="",y=false,b=["{","}"];if(g(t)){y=true;b=["[","]"]}if(_(t)){var w=t.name?": "+t.name:"";f=" [Function"+w+"]"}if(A(t)){f=" "+RegExp.prototype.toString.call(t)}if(q(t)){f=" "+Date.prototype.toUTCString.call(t)}if(T(t)){f=" "+p(t)}if(a.length===0&&(!y||t.length==0)){return b[0]+f+b[1]}if(n<0){if(A(t)){return e.stylize(RegExp.prototype.toString.call(t),"regexp")}else{return e.stylize("[Object]","special")}}e.seen.push(t);var E;if(y){E=d(e,t,n,o,a)}else{E=a.map(function(r){return v(e,t,n,o,r,y)})}e.seen.pop();return m(E,f,b)}function h(e,t){if(R(t))return e.stylize("undefined","undefined");if(x(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(E(t))return e.stylize(""+t,"number");if(y(t))return e.stylize(""+t,"boolean");if(b(t))return e.stylize("null","null")}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,r,n,i){var s=[];for(var a=0,o=t.length;a-1){if(s){o=o.split("\n").map(function(e){return" "+e}).join("\n").substr(2)}else{o="\n"+o.split("\n").map(function(e){return" "+e}).join("\n")}}}else{o=e.stylize("[Circular]","special")}}if(R(a)){if(s&&i.match(/^\d+$/)){return o}a=JSON.stringify(""+i);if(a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){a=a.substr(1,a.length-2);a=e.stylize(a,"name")}else{a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");a=e.stylize(a,"string")}}return a+": "+o}function m(e,t,r){var n=0;var i=e.reduce(function(e,t){n++;if(t.indexOf("\n")>=0)n++;return e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(i>60){return r[0]+(t===""?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]}return r[0]+t+" "+e.join(", ")+" "+r[1]}function g(e){return Array.isArray(e)}r.isArray=g;function y(e){return typeof e==="boolean"}r.isBoolean=y;function b(e){return e===null}r.isNull=b;function w(e){return e==null}r.isNullOrUndefined=w;function E(e){return typeof e==="number"}r.isNumber=E;function x(e){return typeof e==="string"}r.isString=x;function S(e){return typeof e==="symbol"}r.isSymbol=S;function R(e){return e===void 0}r.isUndefined=R;function A(e){return C(e)&&I(e)==="[object RegExp]"}r.isRegExp=A;function C(e){return typeof e==="object"&&e!==null}r.isObject=C;function q(e){return C(e)&&I(e)==="[object Date]"}r.isDate=q;function T(e){return C(e)&&(I(e)==="[object Error]"||e instanceof Error)}r.isError=T;function _(e){return typeof e==="function"}r.isFunction=_;function L(e){return e===null||typeof e==="boolean"||typeof e==="number"||typeof e==="string"||typeof e==="symbol"||typeof e==="undefined"}r.isPrimitive=L;r.isBuffer=e("./support/isBuffer");function I(e){return Object.prototype.toString.call(e)}function P(e){return e<10?"0"+e.toString(10):e.toString(10)}var j=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function N(){var e=new Date;var t=[P(e.getHours()),P(e.getMinutes()),P(e.getSeconds())].join(":");return[e.getDate(),j[e.getMonth()],t].join(" ")}r.log=function(){console.log("%s - %s",N(),r.format.apply(r,arguments))};r.inherits=e("inherits");r._extend=function(e,t){if(!t||!C(t))return e;var r=Object.keys(t);var n=r.length;while(n--){e[r[n]]=t[r[n]]}return e};function k(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}).call(this,e("G+mPsH"),typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":18,"G+mPsH":12,inherits:11}],20:[function(e,t,r){var n=e("./core");n.XML.Parser=e("./xml/browser_parser");e("./http/xhr");if(typeof window!=="undefined")window.AWS=n},{"./core":22,"./http/xhr":30,"./xml/browser_parser":62}],21:[function(e,t,r){var n=e("./core");e("./credentials");e("./credentials/credential_provider_chain");n.Config=n.util.inherit({constructor:function i(e){if(e===undefined)e={};e=this.extractCredentials(e);n.util.each.call(this,this.keys,function(t,r){this.set(t,e[t],r)})},update:function s(e,t){t=t||false;e=this.extractCredentials(e);n.util.each.call(this,e,function(e,r){if(t||this.keys.hasOwnProperty(e))this[e]=r})},getCredentials:function a(e){var t=this;function r(r){e(r,r?null:t.credentials)}function i(e,t){return new n.util.error(t||new Error,{code:"CredentialsError",message:e})}function s(){t.credentials.get(function(e){if(e){var n="Could not load credentials from "+t.credentials.constructor.name;e=i(n,e)}r(e)})}function a(){var e=null;if(!t.credentials.accessKeyId||!t.credentials.secretAccessKey){e=i("Missing credentials")}r(e)}if(t.credentials){if(typeof t.credentials.get==="function"){s()}else{a()}}else if(t.credentialProvider){t.credentialProvider.resolve(function(e,n){if(e){e=i("Could not load credentials from any providers",e)}t.credentials=n;r(e)})}else{r(i("No credentials to load"))}},loadFromPath:function o(e){this.clear();var t=JSON.parse(n.util.readFileSync(e));var r=new n.FileSystemCredentials(e);var i=new n.CredentialProviderChain;i.providers.unshift(r);i.resolve(function(e,r){if(e)throw e;else t.credentials=r});this.constructor(t);return this},clear:function u(){n.util.each.call(this,this.keys,function(e){delete this[e]});this.set("credentials",undefined);this.set("credentialProvider",undefined)},set:function f(e,t,r){if(t===undefined){if(r===undefined){r=this.keys[e]}if(typeof r==="function"){this[e]=r.call(this)}else{this[e]=r}}else{this[e]=t}},keys:{credentials:null,credentialProvider:null,region:null,logger:null,apiVersions:{},apiVersion:null,endpoint:undefined,httpOptions:{},maxRetries:undefined,maxRedirects:10,paramValidation:true,sslEnabled:true,s3ForcePathStyle:false,computeChecksums:true,convertResponseTypes:true,dynamoDbCrc32:true,signatureVersion:null},extractCredentials:function c(e){if(e.accessKeyId&&e.secretAccessKey){e=n.util.copy(e);e.credentials=new n.Credentials(e)}return e}});n.config=new n.Config},{"./core":22,"./credentials":23,"./credentials/credential_provider_chain":24}],22:[function(e,t,r){var n={util:e("./util")};var i={};i.toString();t.exports=n;n.util.update(n,{VERSION:"2.0.5",Signers:{},Protocol:{Json:e("./protocol/json"),Query:e("./protocol/query"),Rest:e("./protocol/rest"),RestJson:e("./protocol/rest_json"),RestXml:e("./protocol/rest_xml")},XML:{Builder:e("./xml/builder"),Parser:null},JSON:{Builder:e("./json/builder"),Parser:e("./json/parser")},Model:{Api:e("./model/api"),Operation:e("./model/operation"),Shape:e("./model/shape"),Paginator:e("./model/paginator"),ResourceWaiter:e("./model/resource_waiter")},util:e("./util")});e("./service");e("./credentials");e("./credentials/credential_provider_chain");e("./credentials/temporary_credentials");e("./credentials/web_identity_credentials");e("./credentials/saml_credentials");e("./config");e("./http");e("./sequential_executor");e("./event_listeners");e("./request");e("./response");e("./resource_waiter");e("./signers/request_signer");e("./param_validator");n.events=new n.SequentialExecutor},{"./config":21,"./credentials":23,"./credentials/credential_provider_chain":24,"./credentials/saml_credentials":25,"./credentials/temporary_credentials":26,"./credentials/web_identity_credentials":27,"./event_listeners":28,"./http":29,"./json/builder":31,"./json/parser":32,"./model/api":33,"./model/operation":35,"./model/paginator":36,"./model/resource_waiter":37,"./model/shape":38,"./param_validator":39,"./protocol/json":40,"./protocol/query":41,"./protocol/rest":42,"./protocol/rest_json":43,"./protocol/rest_xml":44,"./request":48,"./resource_waiter":49,"./response":50,"./sequential_executor":51,"./service":52,"./signers/request_signer":54,"./util":61,"./xml/builder":63}],23:[function(e,t,r){var n=e("./core");n.Credentials=n.util.inherit({constructor:function i(){n.util.hideProperties(this,["secretAccessKey"]);this.expired=false;this.expireTime=null;if(arguments.length===1&&typeof arguments[0]==="object"){var e=arguments[0].credentials||arguments[0];this.accessKeyId=e.accessKeyId;this.secretAccessKey=e.secretAccessKey;this.sessionToken=e.sessionToken}else{this.accessKeyId=arguments[0];this.secretAccessKey=arguments[1];this.sessionToken=arguments[2]}},expiryWindow:15,needsRefresh:function s(){var e=n.util.date.getDate().getTime();var t=new Date(e+this.expiryWindow*1e3);if(this.expireTime&&t>this.expireTime){return true}else{return this.expired||!this.accessKeyId||!this.secretAccessKey}},get:function a(e){var t=this;if(this.needsRefresh()){this.refresh(function(r){if(!r)t.expired=false;if(e)e(r)})}else if(e){e()}},refresh:function o(e){this.expired=false;e()}})},{"./core":22}],24:[function(e,t,r){var n=e("../core");n.CredentialProviderChain=n.util.inherit(n.Credentials,{constructor:function i(e){if(e){this.providers=e}else{this.providers=n.CredentialProviderChain.defaultProviders.slice(0)}},resolve:function s(e){if(this.providers.length===0){e(new Error("No providers"));return this}var t=0;var r=this.providers.slice(0);function n(i,s){if(!i&&s||t===r.length){e(i,s);return}var a=r[t++];if(typeof a==="function"){s=a.call()}else{s=a}if(s.get){s.get(function(e){n(e,e?null:s)})}else{n(null,s)}}n();return this}});n.CredentialProviderChain.defaultProviders=[]},{"../core":22}],25:[function(e,t,r){var n=e("../core");n.SAMLCredentials=n.util.inherit(n.Credentials,{constructor:function i(e){n.Credentials.call(this);this.expired=true;this.service=new n.STS;this.params=e},refresh:function s(e){var t=this;if(!e)e=function(e){if(e)throw e};t.service.assumeRoleWithSAML(t.params,function(r,n){if(!r){t.service.credentialsFrom(n,t)}e(r)})}})},{"../core":22}],26:[function(e,t,r){var n=e("../core");n.TemporaryCredentials=n.util.inherit(n.Credentials,{constructor:function i(e){n.Credentials.call(this);this.loadMasterCredentials();this.service=new n.STS;this.expired=true;this.params=e||{};if(this.params.RoleArn){this.params.RoleSessionName=this.params.RoleSessionName||"temporary-credentials"}},refresh:function s(e){var t=this;if(!e)e=function(e){if(e)throw e};t.service.config.credentials=t.masterCredentials;var r=t.params.RoleArn?t.service.assumeRole:t.service.getSessionToken;r.call(t.service,t.params,function(r,n){if(!r){t.service.credentialsFrom(n,t)}e(r)})},loadMasterCredentials:function a(){this.masterCredentials=n.config.credentials;while(this.masterCredentials.masterCredentials){this.masterCredentials=this.masterCredentials.masterCredentials}}})},{"../core":22}],27:[function(e,t,r){var n=e("../core");n.WebIdentityCredentials=n.util.inherit(n.Credentials,{constructor:function i(e){n.Credentials.call(this);this.expired=true;this.service=new n.STS;this.params=e;this.data=null;this.params.RoleSessionName=this.params.RoleSessionName||"web-identity"},refresh:function s(e){var t=this;if(!e)e=function(e){if(e)throw e};t.service.assumeRoleWithWebIdentity(t.params,function(r,n){t.data=null;if(!r){t.data=n;t.service.credentialsFrom(n,t)}e(r)})}})},{"../core":22}],28:[function(e,t,r){var n=e("./core");var i=e("./sequential_executor");n.EventListeners={Core:{}};n.EventListeners={Core:(new i).addNamedListeners(function(e,t){t("VALIDATE_CREDENTIALS","validate",function r(e,t){if(!e.service.api.signatureVersion)return t();e.service.config.getCredentials(function(r){if(r){e.response.err=n.util.error(r,{code:"SigningError",message:"Missing credentials in config"})}t()})});e("VALIDATE_REGION","validate",function i(e){if(!e.service.config.region&&!e.service.isGlobalEndpoint){e.response.error=n.util.error(new Error,{code:"SigningError",message:"Missing region in config"})}});e("VALIDATE_PARAMETERS","validate",function s(e){var t=e.service.api.operations[e.operation].input;(new n.ParamValidator).validate(t,e.params)});e("SET_CONTENT_LENGTH","afterBuild",function a(e){if(e.httpRequest.headers["Content-Length"]===undefined){var t=n.util.string.byteLength(e.httpRequest.body);e.httpRequest.headers["Content-Length"]=t}});e("SET_HTTP_HOST","afterBuild",function o(e){e.httpRequest.headers["Host"]=e.httpRequest.endpoint.host});e("RESTART","restart",function u(e){var t=this.response.error;if(!t||!t.retryable)return;if(this.response.retryCount=60*10){this.emit("sign",[this],function(e){if(e)t(e);else a()})}else{a()}});e("HTTP_HEADERS","httpHeaders",function h(e,t,r){r.httpResponse.statusCode=e;r.httpResponse.headers=t;r.httpResponse.body=new n.util.Buffer("");r.httpResponse.buffers=[];r.httpResponse.numBytes=0});e("HTTP_DATA","httpData",function p(e,t){if(e){if(n.util.isNode()){t.httpResponse.numBytes+=e.length;var r=t.httpResponse.headers["content-length"];var i={loaded:t.httpResponse.numBytes,total:r};t.request.emit("httpDownloadProgress",[i,t])}t.httpResponse.buffers.push(new n.util.Buffer(e))}});e("HTTP_DONE","httpDone",function d(e){if(e.httpResponse.buffers&&e.httpResponse.buffers.length>0){var t=n.util.buffer.concat(e.httpResponse.buffers);e.httpResponse.body=t}delete e.httpResponse.numBytes;delete e.httpResponse.buffers});e("FINALIZE_ERROR","retry",function v(e){if(e.httpResponse.statusCode){e.error.statusCode=e.httpResponse.statusCode;if(e.error.retryable===undefined){e.error.retryable=this.service.retryableError(e.error,this)}}});e("INVALIDATE_CREDENTIALS","retry",function m(e){if(!e.error)return;switch(e.error.code){case"RequestExpired":case"ExpiredTokenException":case"ExpiredToken":e.error.retryable=true;e.request.service.config.credentials.expired=true}});e("REDIRECT","retry",function g(e){if(e.error&&e.error.statusCode>=300&&e.error.statusCode<400&&e.httpResponse.headers["location"]){this.httpRequest.endpoint=new n.Endpoint(e.httpResponse.headers["location"]);e.error.redirect=true;e.error.retryable=true}});e("RETRY_CHECK","retry",function y(e){if(e.error){if(e.error.redirect&&e.redirectCount=this.HEADERS_RECEIVED&&!h){try{l.responseType="arraybuffer"}catch(e){}f.statusCode=l.status;f.headers=o.parseHeaders(l.getAllResponseHeaders());f.emit("headers",f.statusCode,f.headers);h=true}if(this.readyState===this.DONE){o.finishRequest(l,f)}},false);l.upload.addEventListener("progress",function(e){f.emit("sendProgress",e)});l.addEventListener("progress",function(e){f.emit("receiveProgress",e)},false);l.addEventListener("timeout",function(){a(n.util.error(new Error("Timeout"),{code:"TimeoutError"}))},false);l.addEventListener("error",function(){a(n.util.error(new Error("Network Failure"),{code:"NetworkingError"}))},false);r(f);l.open(e.method,c,t.xhrAsync!==false);n.util.each(e.headers,function(e,t){if(e!=="Content-Length"&&e!=="User-Agent"&&e!=="Host"){l.setRequestHeader(e,t)}});if(e.body&&typeof e.body.buffer==="object"){l.send(e.body.buffer)}else{l.send(e.body)}return f},parseHeaders:function a(e){var t={};n.util.arrayEach(e.split(/\r?\n/),function(e){var r=e.split(":",1)[0];var n=e.substring(r.length+2);if(r.length>0)t[r]=n});return t},finishRequest:function o(e,t){var r;if(e.responseType==="arraybuffer"&&e.response){var i=e.response;r=new n.util.Buffer(i.byteLength);var s=new Uint8Array(i);for(var a=0;a0){var i=JSON.parse(r.body.toString());if(i.__type||i.code){t.code=(i.__type||i.code).split("#").pop()}else{t.code="UnknownError"}if(t.code==="RequestEntityTooLarge"){t.message="Request body must be less than 1 MB"}else{t.message=i.message||i.Message||null}}else{t.code=r.statusCode;t.message=null}e.error=n.error(new Error,t)}function u(e){var t=e.httpResponse.body.toString()||"{}";if(e.request.service.config.convertResponseTypes===false){e.data=JSON.parse(t)}else{var r=e.request.service.api.operations[e.request.operation];var n=r.output||{};var i=new s;e.data=i.parse(t,n)}}t.exports={buildRequest:a,extractError:o,extractData:u}},{"../json/builder":31,"../json/parser":32,"../util":61}],41:[function(e,t,r){var n=e("../core");var i=e("../util");var s=e("../query/query_param_serializer");var a=e("../model/shape");function o(e){var t=e.service.api.operations[e.operation];var r=e.httpRequest;r.headers["Content-Type"]="application/x-www-form-urlencoded; charset=utf-8";r.params={Version:e.service.api.apiVersion,Action:t.name};var n=new s;n.serialize(e.params,t.input,function(e,t){r.params[e]=t});r.body=i.queryParamsToString(r.params)}function u(e){var t,r=e.httpResponse.body.toString();if(r.match("=0?"&":"?";var l=[];n.arrayEach(Object.keys(f).sort(),function(e){l.push(o(e)+"="+f[e])});i+=l.join("&")}e.httpRequest.path=i}function a(e){return n.uriEscape(String(e))}function o(e){return n.uriEscape(String(e))}function u(e){var t=e.service.api.operations[e.operation];n.each(t.input.members,function(t,r){var i=e.params[t];if(i===null||i===undefined)return;if(r.location==="headers"&&r.type==="map"){n.each(i,function(t,n){e.httpRequest.headers[r.name+t]=n})}else if(r.location==="header"){i=r.toWireFormat(i).toString();e.httpRequest.headers[r.name]=i}})}function f(e){i(e);s(e);u(e)}function c(){}function l(e){var t=e.request;var r={};var i=e.httpResponse;var s=t.service.api.operations[t.operation];var a=s.output;var o={};n.each(i.headers,function(e,t){o[e.toLowerCase()]=t});n.each(a.members,function(e,t){var s=(t.name||e).toLowerCase();if(t.location==="headers"&&t.type==="map"){r[e]={};n.each(i.headers,function(n,i){var s=n.match(new RegExp("^"+t.name+"(.+)","i"));if(s!==null){r[e][s[1]]=i}})}else if(t.location==="header"){if(o[s]!==undefined){r[e]=o[s]}}else if(t.location==="status"){r[e]=parseInt(i.statusCode,10)}});e.data=r}t.exports={buildRequest:f,extractError:c,extractData:l}},{"../util":61}],43:[function(e,t,r){var n=e("../util");var i=e("./rest");var s=e("./json");var a=e("../json/builder");function o(e){var t=new a;var r=e.service.api.operations[e.operation].input;if(r.payload){var n={};var i=r.members[r.payload];n=e.params[r.payload];if(n===undefined)return;if(i.type==="structure"){e.httpRequest.body=t.build(n,i)}else{e.httpRequest.body=n}}else{e.httpRequest.body=t.build(e.params,r)}}function u(e){i.buildRequest(e);o(e)}function f(e){s.extractError(e)}function c(e){i.extractData(e);var t=e.request;var r=t.service.api.operations[t.operation].output||{};if(r.payload){var a=r.members[r.payload];if(a.isStreaming){e.data[r.payload]=e.httpResponse.body}else if(a.type==="structure"){s.extractData(e)}else{e.data[r.payload]=e.httpResponse.body.toString()}}else{var o=e.data;s.extractData(e);e.data=n.merge(o,e.data)}}t.exports={buildRequest:u,extractError:f,extractData:c}},{"../json/builder":31,"../util":61,"./json":40,"./rest":42}],44:[function(e,t,r){var n=e("../core");var i=e("../util");var s=e("./rest");function a(e){var t=e.service.api.operations[e.operation].input;var r=new n.XML.Builder;var s=e.params;var a=t.payload;if(a){var o=t.members[a];s=s[a];if(s===undefined)return;if(o.type==="structure"){var u=o.name;e.httpRequest.body=r.toXML(s,o,u)}else{e.httpRequest.body=s}}else{e.httpRequest.body=r.toXML(s,t,t.shape||i.string.upperFirst(e.operation)+"Request")}}function o(e){s.buildRequest(e);a(e)}function u(e){s.extractError(e);var t=(new n.XML.Parser).parse(e.httpResponse.body.toString());if(t.Errors)t=t.Errors;if(t.Error)t=t.Error;if(t.Code){e.error=i.error(new Error,{code:t.Code,message:t.Message})}else{e.error=i.error(new Error,{code:e.httpResponse.statusCode,message:null})}}function f(e){s.extractData(e);var t;var r=e.request;var a=e.httpResponse.body;var o=r.service.api.operations[r.operation];var u=o.output;var f=u.payload;if(f){var c=u.members[f];if(c.isStreaming){e.data[f]=a}else if(c.type==="structure"){t=new n.XML.Parser;i.update(e.data,t.parse(a.toString(),c))}else{e.data[f]=a.toString()}}else if(a.length>0){t=new n.XML.Parser;var l=t.parse(a.toString(),u);i.update(e.data,l)}}t.exports={buildRequest:o,extractError:u,extractData:f}},{"../core":22,"../util":61,"./rest":42}],45:[function(e,t,r){var n=e("../util");function i(){}i.prototype.serialize=function(e,t,r){s("",e,t,r)};function s(e,t,r,i){n.each(r.members,function(r,n){var s=t[r];if(s===null||s===undefined)return;var a=e?e+"."+n.name:n.name;u(a,s,n,i)})}function a(e,t,r,i){var s=1;n.each(t,function(t,n){var a=r.flattened||r.queryFlattened?".":".entry.";var o=a+s++ +".";var f=o+(r.key.name||"key");var c=o+(r.value.name||"value");u(e+f,t,r.key,i);u(e+c,n,r.value,i)})}function o(e,t,r,i){var s=r.member||{};if(t.length===0){i.call(this,e,null);return}n.arrayEach(t,function(t,n){var a="."+(n+1);if(r.flattened||r.queryFlattened){if(s.name){var o=e.split(".");o.pop();o.push(s.name);e=o.join(".")}}else{a=".member"+a}u(e+a,t,s,i)})}function u(e,t,r,n){if(t===null||t===undefined)return;if(r.type==="structure"){s(e,t,r,n)}else if(r.type==="list"){o(e,t,r,n)}else if(r.type==="map"){a(e,t,r,n)}else{n(e,r.toWireFormat(t).toString())}}t.exports=i},{"../util":61}],46:[function(e,t,r){var n=e("./util");var i=e("./region_config.json");function s(e){var t=e.serviceIdentifier||"";var r=e.config.region||"";var s={};i.forEach(function(i){(i.regions||[]).forEach(function(a){if(r.match(new RegExp("^"+a.replace("*",".*")+"$"))){(i.serviceConfigs||[]).forEach(function(r){(r.services||[]).forEach(function(i){if(t.match(new RegExp("^"+i.replace("*",".*")+"$"))){n.update(s,r.config);e.isGlobalEndpoint=!!r.globalEndpoint}})})}})});n.each(s,function(t,r){if(e.config[t]===undefined||e.config[t]===null){e.config[t]=r}})}t.exports=s},{"./region_config.json":47,"./util":61}],47:[function(e,t,r){t.exports=[{regions:["*"],serviceConfigs:[{services:["*"],config:{endpoint:"{service}.{region}.amazonaws.com"}},{services:["cloudfront","iam","importexport","sts"],config:{endpoint:"{service}.amazonaws.com"},globalEndpoint:true},{services:["s3"],config:{endpoint:"{service}-{region}.amazonaws.com"}},{services:["route53"],config:{endpoint:"https://{service}.amazonaws.com"},globalEndpoint:true}]},{regions:["us-east-1"],serviceConfigs:[{services:["s3","simpledb"],config:{endpoint:"{service}.amazonaws.com"}}]},{regions:["cn-*"],serviceConfigs:[{services:["*"],config:{endpoint:"{service}.{region}.amazonaws.com.cn",signatureVersion:"v4"}}]}]},{}],48:[function(e,t,r){(function(t){var r=e("./core");var n=e("./state_machine");var i=r.util.inherit;var s={success:1,error:1,complete:1};function a(e){return s.hasOwnProperty(e._asm.currentState)}var o=new n;o.setupStates=function(){var e=function(e,t){try{var n=this;n.emit(n._asm.currentState,function(){var r=n.response.error;if(r&&r!==e&&a(n)){throw r}t(r)})}catch(i){if(i!==e&&a(n)){r.SequentialExecutor.prototype.unhandledErrorCallback.call(this,i);t()}else{t(i)}}};this.addState("validate","build","error",e);this.addState("build","afterBuild","restart",e);this.addState("afterBuild","sign","restart",e);this.addState("sign","send","retry",e);this.addState("retry","afterRetry","afterRetry",e);this.addState("afterRetry","sign","error",e);this.addState("send","validateResponse","retry",e);this.addState("validateResponse","extractData","extractError",e);this.addState("extractError","extractData","retry",e);this.addState("extractData","success","retry",e);this.addState("restart","build","error",e);this.addState("success","complete","complete",e);this.addState("error","complete","complete",e);this.addState("complete",null,null,e)};o.setupStates();r.Request=i({constructor:function u(e,t,i){var s=e.endpoint;var a=e.config.region;if(e.isGlobalEndpoint)a="us-east-1";this.service=e;this.operation=t;this.params=i||{};this.httpRequest=new r.HttpRequest(s,a);this.startTime=r.util.date.getDate();this.response=new r.Response(this);this._asm=new n(o.states,"validate");r.SequentialExecutor.call(this);this.emit=this.emitEvent},send:function f(e){if(e){this.on("complete",function(t){e.call(t,t.error,t.data)})}this.runTo();return this.response},build:function c(e){return this.runTo("send",e)},runTo:function l(e,t){this._asm.runTo(e,t,this);return this},abort:function h(){this.removeAllListeners("validateResponse");this.removeAllListeners("extractError");this.on("validateResponse",function e(t){t.error=r.util.error(new Error("Request aborted by user"),{code:"RequestAbortedError",retryable:false})});if(this.httpRequest.stream){this.httpRequest.stream.abort();if(this.httpRequest._abortCallback){this.httpRequest._abortCallback()}else{this.removeAllListeners("send")}}return this},eachPage:function p(e){e=r.util.fn.makeAsync(e,3);function t(n){e.call(n,n.error,n.data,function(i){if(i===false)return;if(n.hasNextPage()){n.nextPage().on("complete",t).send()}else{e.call(n,null,null,r.util.fn.noop)}})}this.on("complete",t).send()},eachItem:function d(e){function t(t,n){if(t)return e(t,null);if(n===null)return e(null,null);var i=this.request.service.paginationConfig(this.request.operation);var s=i.resultKey;if(Array.isArray(s))s=s[0];var a=r.util.jamespath.query(s,n);r.util.arrayEach(a,function(t){r.util.arrayEach(t,function(t){e(null,t)})})}this.eachPage(t)},isPageable:function v(){return this.service.paginationConfig(this.operation)?true:false},createReadStream:function m(){var e=r.util.nodeRequire("stream");var n=this;var i=null;var s=false;if(r.HttpClient.streamsApiVersion===2){i=new e.Readable;i._read=function(){i.push("")}}else{i=new e.Stream;i.readable=true}i.sent=false;i.on("newListener",function(e){if(!i.sent&&(e==="data"||e==="readable")){if(e==="data")s=true;i.sent=true;t.nextTick(function(){n.send(function(){})})}});this.on("httpHeaders",function a(e,t,o){if(e<300){this.httpRequest._streaming=true;n.removeListener("httpData",r.EventListeners.Core.HTTP_DATA);n.removeListener("httpError",r.EventListeners.Core.HTTP_ERROR);n.on("httpError",function c(e,t){t.error=e;t.error.retryable=false});var u=o.httpResponse.stream;i.response=o;i._read=function(){var e;do{e=u.read();if(e)i.push(e)}while(e);i.push("")};var f=["end","error",s?"data":"readable"];r.util.arrayEach(f,function(e){u.on(e,function(t){i.emit(e,t)})})}});this.on("error",function(e){i.emit("error",e)});return i},emitEvent:function g(e,t,n){if(typeof t==="function"){n=t;t=null}if(!n)n=this.unhandledErrorCallback;if(!t)t=this.eventParameters(e,this.response);var i=r.SequentialExecutor.prototype.emit;i.call(this,e,t,function(e){if(e)this.response.error=e;n.call(this,e)})},eventParameters:function y(e){switch(e){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 b(e,t){if(!t&&typeof e==="function"){t=e;e=null}return(new r.Signers.Presign).sign(this.toGet(),e,t)},toUnauthenticated:function w(){this.removeListener("validate",r.EventListeners.Core.VALIDATE_CREDENTIALS);this.removeListener("sign",r.EventListeners.Core.SIGN);return this.toGet()},toGet:function E(){if(this.service.api.protocol==="query"){this.removeListener("build",this.buildAsGet);this.addListener("build",this.buildAsGet)}return this},buildAsGet:function x(e){e.httpRequest.method="GET";e.httpRequest.path="/?"+e.httpRequest.body;e.httpRequest.body="";delete e.httpRequest.headers["Content-Length"];delete e.httpRequest.headers["Content-Type"]}});r.util.mixin(r.Request,r.SequentialExecutor)}).call(this,e("G+mPsH"))},{"./core":22,"./state_machine":60,"G+mPsH":12}],49:[function(e,t,r){var n=e("./core");var i=n.util.inherit;n.ResourceWaiter=i({constructor:function s(e,t){this.service=e;this.state=t;if(typeof this.state==="object"){n.util.each.call(this,this.state,function(e,t){this.state=e;this.expectedValue=t})}this.loadWaiterConfig(this.state);if(!this.expectedValue){this.expectedValue=this.config.successValue}},service:null,state:null,expectedValue:null,config:null,waitDone:false,Listeners:{retry:(new n.SequentialExecutor).addNamedListeners(function(e){e("RETRY_CHECK","retry",function(e){var t=e.request._waiter;if(e.error&&e.error.code==="ResourceNotReady"){e.error.retryDelay=t.config.interval*1e3}})}),output:(new n.SequentialExecutor).addNamedListeners(function(e){e("CHECK_OUT_ERROR","extractError",function t(e){if(e.error){e.request._waiter.setError(e,true)}});e("CHECK_OUTPUT","extractData",function r(e){var t=e.request._waiter;var r=t.checkSuccess(e);if(!r){t.setError(e,r===null?false:true)}else{e.error=null}})}),error:(new n.SequentialExecutor).addNamedListeners(function(e){e("CHECK_ERROR","extractError",function t(e){var t=e.request._waiter;var r=t.checkError(e);if(!r){t.setError(e,r===null?false:true)}else{e.error=null;e.request.removeAllListeners("extractData")}});e("CHECK_ERR_OUTPUT","extractData",function r(e){e.request._waiter.setError(e,true)})})},wait:function a(e,t){if(typeof e==="function"){t=e;e=undefined -}var r=this.service.makeRequest(this.config.operation,e);var n=this.Listeners[this.config.successType];r._waiter=this;r.response.maxRetries=this.config.maxAttempts;r.addListeners(this.Listeners.retry);if(n)r.addListeners(n);if(t)r.send(t);return r},setError:function o(e,t){e.data=null;e.error=n.util.error(e.error||new Error,{code:"ResourceNotReady",message:"Resource is not in the state "+this.state,retryable:t})},checkSuccess:function u(e){if(!this.config.successPath){return e.httpResponse.statusCode<300}var t=n.util.jamespath.find(this.config.successPath,e.data);if(this.config.failureValue&&this.config.failureValue.indexOf(t)>=0){return null}if(this.expectedValue){return t===this.expectedValue}else{return t?true:false}},checkError:function f(e){return e.httpResponse.statusCode===this.config.successValue},loadWaiterConfig:function c(e,t){if(!this.service.api.waiters[e]){if(t)return;throw new n.util.error(new Error,{code:"StateNotFoundError",message:"State "+e+" not found."})}this.config=this.service.api.waiters[e];var r=this.config;(function(){r.successType=r.successType||r.acceptorType;r.successPath=r.successPath||r.acceptorPath;r.successValue=r.successValue||r.acceptorValue;r.failureType=r.failureType||r.acceptorType;r.failurePath=r.failurePath||r.acceptorPath;r.failureValue=r.failureValue||r.acceptorValue})()}})},{"./core":22}],50:[function(e,t,r){var n=e("./core");var i=n.util.inherit;n.Response=i({constructor:function s(e){this.request=e;this.data=null;this.error=null;this.retryCount=0;this.redirectCount=0;this.httpResponse=new n.HttpResponse;if(e){this.maxRetries=e.service.numRetries();this.maxRedirects=e.service.config.maxRedirects}},nextPage:function a(e){var t;var r=this.request.service;var i=this.request.operation;try{t=r.paginationConfig(i,true)}catch(s){this.error=s}if(!this.hasNextPage()){if(e)e(this.error,null);else if(this.error)throw this.error;return null}var a=n.util.copy(this.request.params);if(!this.nextPageTokens){return e?e(null,null):null}else{var o=t.inputToken;if(typeof o==="string")o=[o];for(var u=0;u-1){r.splice(i,1)}}return this},removeAllListeners:function c(e){if(e){delete this._events[e]}else{this._events={}}return this},emit:function l(e,t,r){if(!r)r=this.unhandledErrorCallback;var n=this.listeners(e);var i=n.length;this.callListeners(n,t,r);return i>0},callListeners:function h(e,t,r){if(e.length===0){r.call(this);return}var n=this,i=e.shift();if(i._isAsync){var s=function(i){if(i){r.call(n,i)}else{n.callListeners(e,t,r)}};i.apply(n,t.concat([s]))}else{try{i.apply(n,t);n.callListeners(e,t,r)}catch(a){r.call(n,a)}}},addListeners:function p(e){var t=this;if(e._events)e=e._events;n.util.each(e,function(e,r){if(typeof r==="function")r=[r];n.util.arrayEach(r,function(r){t.on(e,r)})});return t},addNamedListener:function d(e,t,r){this[e]=r;this.addListener(t,r);return this},addNamedAsyncListener:function v(e,t,r){r._isAsync=true;return this.addNamedListener(e,t,r)},addNamedListeners:function m(e){var t=this;e(function(){t.addNamedListener.apply(t,arguments)},function(){t.addNamedAsyncListener.apply(t,arguments)});return this},unhandledErrorCallback:function g(e){if(e){if(i&&this.domain instanceof i.Domain){e.domainEmitter=this;e.domain=this.domain;e.domainThrown=false;this.domain.emit("error",e)}else{throw e}}}});n.SequentialExecutor.prototype.addListener=n.SequentialExecutor.prototype.on;t.exports=n.SequentialExecutor},{"./core":22}],52:[function(e,t,r){var n=e("./core");var i=e("./model/api");var s=e("./region_config");var a=n.util.inherit;n.Service=a({constructor:function o(e){if(!this.loadServiceClass){throw n.util.error(new Error,"Service must be constructed with `new' operator")}var t=this.loadServiceClass(e||{});if(t)return new t(e);this.initialize(e)},initialize:function u(e){this.config=new n.Config(n.config);if(e)this.config.update(e,true);this.validateService();s(this);this.config.endpoint=this.endpointFromTemplate(this.config.endpoint);this.setEndpoint(this.config.endpoint)},validateService:function f(){},loadServiceClass:function c(e){var t=e;if(!n.util.isEmpty(this.api)){return null}else if(t.apiConfig){return n.Service.defineServiceApi(this.constructor,t.apiConfig)}else if(!this.constructor.services){return null}else{t=new n.Config(n.config);t.update(e,true);var r=t.apiVersions[this.constructor.serviceIdentifier];r=r||t.apiVersion;return this.getLatestServiceClass(r)}},getLatestServiceClass:function l(e){e=this.getLatestServiceVersion(e);if(this.constructor.services[e]===null){n.Service.defineServiceApi(this.constructor,e)}return this.constructor.services[e]},getLatestServiceVersion:function h(e){if(!this.constructor.services||this.constructor.services.length===0){throw new Error("No services defined on "+this.constructor.serviceIdentifier)}if(!e){e="latest"}else if(n.util.isType(e,Date)){e=n.util.date.iso8601(e).split("T")[0]}if(Object.hasOwnProperty(this.constructor.services,e)){return e}var t=Object.keys(this.constructor.services).sort();var r=null;for(var i=t.length-1;i>=0;i--){if(t[i][t[i].length-1]!=="*"){r=t[i]}if(t[i].substr(0,10)<=e){return r}}throw new Error("Could not find "+this.constructor.serviceIdentifier+" API to satisfy version constraint `"+e+"'")},api:{},defaultRetryCount:3,makeRequest:function p(e,t,r){if(typeof t==="function"){r=t;t=null}t=t||{};if(this.config.params){var i=this.api.operations[e];if(i){t=n.util.copy(t);n.util.each(this.config.params,function(e,r){if(i.input.members[e]){if(t[e]===undefined||t[e]===null){t[e]=r}}})}}var s=new n.Request(this,e,t);this.addAllRequestListeners(s);if(r)s.send(r);return s},makeUnauthenticatedRequest:function d(e,t,r){if(typeof t==="function"){r=t;t={}}var n=this.makeRequest(e,t).toUnauthenticated();return r?n.send(r):n},waitFor:function v(e,t,r){var i=new n.ResourceWaiter(this,e);return i.wait(t,r)},addAllRequestListeners:function m(e){var t=[n.events,n.EventListeners.Core,this.serviceInterface(),n.EventListeners.CorePost];for(var r=0;r=500)return true;return false},networkingError:function R(e){return e.code==="NetworkingError"},expiredCredentialsError:function A(e){return e.code==="ExpiredTokenException"},throttledError:function C(e){return e.code==="ProvisionedThroughputExceededException"},endpointFromTemplate:function q(e){if(typeof e!=="string")return e;var t=e;t=t.replace(/\{service\}/g,this.api.endpointPrefix);t=t.replace(/\{region\}/g,this.config.region);t=t.replace(/\{scheme\}/g,this.config.sslEnabled?"https":"http");return t},setEndpoint:function T(e){this.endpoint=new n.Endpoint(e,this.config)},paginationConfig:function _(e,t){var r=this.api.operations[e].paginator;if(!r){if(t){var i=new Error;throw n.util.error(i,"No pagination configuration for "+e)}return null}return r}});n.util.update(n.Service,{defineMethods:function L(e){n.util.each(e.prototype.api.operations,function t(r){if(e.prototype[r])return;e.prototype[r]=function(e,t){return this.makeRequest(r,e,t)}})},defineService:function I(e,t,r){if(!Array.isArray(t)){r=t;t=[]}var i=a(n.Service,r||{});if(typeof e==="string"){n.Service.addVersions(i,t);var s=i.serviceIdentifier||e;i.serviceIdentifier=s}else{i.prototype.api=e;n.Service.defineMethods(i)}return i},addVersions:function P(e,t){if(!Array.isArray(t))t=[t];e.services=e.services||{};for(var r=0;r604800){var r="Presigning does not support expiry time greater "+"than a week with SigV4 signing.";throw n.util.error(new Error,{code:"InvalidExpiryTime",message:r,retryable:false})}e.httpRequest.headers[s]=t}else if(e.service.getSignerClass()===n.Signers.S3){e.httpRequest.headers[s]=parseInt(n.util.date.unixTimestamp()+t,10).toString()}else{throw n.util.error(new Error,{message:"Presigning only supports S3 or SigV4 signing.",code:"UnsupportedSigner",retryable:false})}}function o(e){var t=e.httpRequest.endpoint;var r=n.util.urlParse(e.httpRequest.path);var i={};if(r.search){i=n.util.queryStringParse(r.search.substr(1))}n.util.each(e.httpRequest.headers,function(e,t){if(e===s)e="Expires";i[e]=t});delete e.httpRequest.headers[s];var a=i["Authorization"].split(" ");if(a[0]==="AWS"){a=a[1].split(":");i["AWSAccessKeyId"]=a[0];i["Signature"]=a[1]}else if(a[0]==="AWS4-HMAC-SHA256"){a.shift();var o=a.join(" ");var u=o.match(/Signature=(.*?)(?:,|\s|\r?\n|$)/)[1];i["X-Amz-Signature"]=u;delete i["Expires"]}delete i["Authorization"];delete i["Host"];t.pathname=r.pathname;t.search=n.util.queryParamsToString(i)}n.Signers.Presign=i({sign:function u(e,t,r){e.httpRequest.headers[s]=t||3600;e.on("build",a);e.on("sign",o);e.removeListener("afterBuild",n.EventListeners.Core.SET_CONTENT_LENGTH);e.emit("beforePresign",[e]);if(r){e.build(function(){if(this.response.error)r(this.response.error);else{r(null,n.util.urlFormat(e.httpRequest.endpoint))}})}else{e.build();return n.util.urlFormat(e.httpRequest.endpoint)}}});t.exports=n.Signers.Presign},{"../core":22}],54:[function(e,t,r){var n=e("../core");var i=n.util.inherit;n.Signers.RequestSigner=i({constructor:function s(e){this.request=e}});n.Signers.RequestSigner.getVersion=function a(e){switch(e){case"v2":return n.Signers.V2;case"v3":return n.Signers.V3;case"v4":return n.Signers.V4;case"s3":return n.Signers.S3;case"v3https":return n.Signers.V3Https}throw new Error("Unknown signing version "+e)};e("./v2");e("./v3");e("./v3https");e("./v4");e("./s3");e("./presign")},{"../core":22,"./presign":53,"./s3":55,"./v2":56,"./v3":57,"./v3https":58,"./v4":59}],55:[function(e,t,r){var n=e("../core");var i=n.util.inherit;n.Signers.S3=i(n.Signers.RequestSigner,{subResources:{acl:1,cors:1,lifecycle:1,"delete":1,location:1,logging:1,notification:1,partNumber:1,policy:1,requestPayment: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 s(e,t){if(!this.request.headers["presigned-expires"]){this.request.headers["X-Amz-Date"]=n.util.date.rfc822(t)}if(e.sessionToken){this.request.headers["x-amz-security-token"]=e.sessionToken}var r=this.sign(e.secretAccessKey,this.stringToSign());var i="AWS "+e.accessKeyId+":"+r;this.request.headers["Authorization"]=i},stringToSign:function a(){var e=this.request;var t=[];t.push(e.method);t.push(e.headers["Content-MD5"]||"");t.push(e.headers["Content-Type"]||"");t.push(e.headers["presigned-expires"]||"");var r=this.canonicalizedAmzHeaders();if(r)t.push(r);t.push(this.canonicalizedResource());return t.join("\n")},canonicalizedAmzHeaders:function o(){var e=[];n.util.each(this.request.headers,function(t){if(t.match(/^x-amz-/i))e.push(t)});e.sort(function(e,t){return e.toLowerCase()=0?"&":"?";this.request.path+=s+n.util.queryParamsToString(i)},authorization:function h(e,t){var r=[];var n=this.credentialString(t);r.push(this.algorithm+" Credential="+e.accessKeyId+"/"+n);r.push("SignedHeaders="+this.signedHeaders());r.push("Signature="+this.signature(e,t));return r.join(", ")},signature:function p(e,t){var r=s[this.serviceName];var i=t.substr(0,8);if(!r||r.akid!==e.accessKeyId||r.region!==this.request.region||r.date!==i){var a=e.secretAccessKey;var o=n.util.crypto.hmac("AWS4"+a,i,"buffer");var u=n.util.crypto.hmac(o,this.request.region,"buffer");var f=n.util.crypto.hmac(u,this.serviceName,"buffer");var c=n.util.crypto.hmac(f,"aws4_request","buffer");s[this.serviceName]={region:this.request.region,date:i,key:c,akid:e.accessKeyId}}var l=s[this.serviceName].key;return n.util.crypto.hmac(l,this.stringToSign(t),"hex")},stringToSign:function d(e){var t=[];t.push("AWS4-HMAC-SHA256");t.push(e);t.push(this.credentialString(e));t.push(this.hexEncodedHash(this.canonicalString()));return t.join("\n")},canonicalString:function v(){var e=[];e.push(this.request.method);e.push(this.request.pathname());e.push(this.request.search());e.push(this.canonicalHeaders()+"\n");e.push(this.signedHeaders());e.push(this.hexEncodedBodyHash());return e.join("\n")},canonicalHeaders:function m(){var e=[];n.util.each.call(this,this.request.headers,function(t,r){e.push([t,r])});e.sort(function(e,t){return e[0].toLowerCase()0){r=n;return s.abort}});return r},find:function q(e,t){return s.jamespath.query(e,t)[0]}},date:{getDate:function T(){return new Date},iso8601:function _(e){if(e===undefined){e=s.date.getDate()}return e.toISOString()},rfc822:function L(e){if(e===undefined){e=s.date.getDate()}return e.toUTCString()},unixTimestamp:function I(e){if(e===undefined){e=s.date.getDate()}return e.getTime()/1e3},from:function P(e){if(typeof e==="number"){return new Date(e*1e3)}else{return new Date(e)}},format:function j(e,t){if(!t)t="iso8601";return s.date[t](s.date.from(e))},parseTimestamp:function N(e){if(typeof e==="number"){return new Date(e*1e3)}else if(e.match(/^\d+$/)){return new Date(e*1e3)}else if(e.match(/^\d{4}/)){return new Date(e)}else if(e.match(/^\w{3},/)){return new Date(e)}else{throw s.error(new Error("unhandled timestamp format: "+e),{code:"TimestampParserError"})}}},crypto:{crc32Table:[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],crc32:function k(e){var t=s.crypto.crc32Table;var r=0^-1;if(typeof e==="string"){e=new i(e)}for(var n=0;n>>8^t[(r^a)&255]}return(r^-1)>>>0},hmac:function O(e,t,r,s){if(!r)r="binary";if(r==="buffer"){r=undefined}if(!s)s="sha256";if(typeof t==="string")t=new i(t);return n.createHmac(s,e).update(t).digest(r)},md5:function D(e,t){if(!t){t="binary"}if(t==="buffer"){t=undefined}if(typeof e==="string")e=new i(e);return s.crypto.createHash("md5").update(e).digest(t)},sha256:function B(e,t){if(!t){t="binary"}if(t==="buffer"){t=undefined}if(typeof e==="string")e=new i(e);return s.crypto.createHash("sha256").update(e).digest(t)},toHex:function U(e){var t=[];for(var r=0;r/)){throw new Error("Invalid CDATA text: "+t)}r=new e(this,"",{},"");this.children.push(r);return this};e.prototype.comment=function(t){var r;if(!(t!=null)){throw new Error("Missing comment text")}t=""+t||"";t=this.escape(t);this.assertLegalChar(t);if(t.match(/--/)){throw new Error("Comment text cannot contain double-hypen: "+t)}r=new e(this,"",{},"");this.children.push(r);return this};e.prototype.raw=function(t){var r;if(!(t!=null)){throw new Error("Missing raw text")}t=""+t||"";r=new e(this,"",{},t);this.children.push(r);return this};e.prototype.up=function(){if(this.isRoot){throw new Error("This node has no parent. Use doc() if you need to get the document object.")}return this.parent};e.prototype.root=function(){var e;if(this.isRoot){return this}e=this.parent;while(!e.isRoot){e=e.parent}return e};e.prototype.document=function(){return this.root().documentObject};e.prototype.end=function(e){return this.document().toString(e)};e.prototype.prev=function(){var e;if(this.isRoot){throw new Error("Root node has no siblings")}e=this.parent.children.indexOf(this);if(e<1){throw new Error("Already at the first node")}return this.parent.children[e-1]};e.prototype.next=function(){var e;if(this.isRoot){throw new Error("Root node has no siblings")}e=this.parent.children.indexOf(this);if(e===-1||e===this.parent.children.length-1){throw new Error("Already at the last node")}return this.parent.children[e+1]};e.prototype.clone=function(t){var r;r=new e(this.parent,this.name,this.attributes,this.value);if(t){this.children.forEach(function(e){var n;n=e.clone(t);n.parent=r;return r.children.push(n)})}return r};e.prototype.importXMLBuilder=function(e){var t;t=e.root().clone(true);t.parent=this;this.children.push(t);t.isRoot=false;return this};e.prototype.attribute=function(e,t){var r;if(!(e!=null)){throw new Error("Missing attribute name")}if(!(t!=null)){throw new Error("Missing attribute value")}e=""+e||"";t=""+t||"";if((r=this.attributes)==null){this.attributes={}}this.attributes[e]=this.escape(t);return this};e.prototype.removeAttribute=function(e){if(!(e!=null)){throw new Error("Missing attribute name")}e=""+e||"";delete this.attributes[e];return this};e.prototype.toString=function(e,t){var r,n,i,s,a,o,u,f,c,l,h,p;o=e!=null&&e.pretty||false;s=e!=null&&e.indent||" ";a=e!=null&&e.newline||"\n";t||(t=0);f=new Array(t+1).join(s);u="";if(o){u+=f}if(!(this.value!=null)){u+="<"+this.name}else{u+=""+this.value}h=this.attributes;for(r in h){n=h[r];if(this.name==="!DOCTYPE"){u+=" "+n}else{u+=" "+r+'="'+n+'"'}}if(this.children.length===0){if(!(this.value!=null)){u+=this.name==="?xml"?"?>":this.name==="!DOCTYPE"?">":"/>"}if(o){u+=a}}else if(o&&this.children.length===1&&this.children[0].value){u+=">";u+=this.children[0].value;u+="";u+=a}else{u+=">";if(o){u+=a}p=this.children;for(c=0,l=p.length;c";if(o){u+=a}}return u};e.prototype.escape=function(e){return e.replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")};e.prototype.assertLegalChar=function(e){var t,r;t=/[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uD800-\uDFFF\uFFFE-\uFFFF]/;r=e.match(t);if(r){throw new Error("Invalid character ("+r+") in string: "+e)}};e.prototype.is=function(e,t){var r;r=Object.prototype.toString.call(e).slice(8,-1);return e!=null&&r===t};e.prototype.ele=function(e,t,r){return this.element(e,t,r)};e.prototype.txt=function(e){return this.text(e)};e.prototype.dat=function(e){return this.cdata(e)};e.prototype.att=function(e,t){return this.attribute(e,t)};e.prototype.com=function(e){return this.comment(e)};e.prototype.doc=function(){return this.document()};e.prototype.e=function(e,t,r){return this.element(e,t,r)};e.prototype.t=function(e){return this.text(e)};e.prototype.d=function(e){return this.cdata(e)};e.prototype.a=function(e,t){return this.attribute(e,t)};e.prototype.c=function(e){return this.comment(e)};e.prototype.r=function(e){return this.raw(e)};e.prototype.u=function(){return this.up()};return e}();t.exports=e}).call(this)},{}],66:[function(e,t,r){(function(){var r;r=e("./XMLBuilder");t.exports.create=function(e,t,n){if(e!=null){return new r(e,t,n).root()}else{return new r}}}).call(this)},{"./XMLBuilder":64}]},{},[20]);;AWS.CloudWatch=AWS.Service.defineService("cloudwatch"); -AWS.Service.defineServiceApi(AWS.CloudWatch, "2010-08-01", {"metadata":{"apiVersion":"2010-08-01","endpointPrefix":"monitoring","serviceAbbreviation":"CloudWatch","serviceFullName":"Amazon CloudWatch","signatureVersion":"v4","xmlNamespace":"http://monitoring.amazonaws.com/doc/2010-08-01/","protocol":"query"},"operations":{"DeleteAlarms":{"input":{"type":"structure","required":["AlarmNames"],"members":{"AlarmNames":{"shape":"S2"}}}},"DescribeAlarmHistory":{"input":{"type":"structure","members":{"AlarmName":{},"HistoryItemType":{},"StartDate":{"type":"timestamp"},"EndDate":{"type":"timestamp"},"MaxRecords":{"type":"integer"},"NextToken":{}}},"output":{"resultWrapper":"DescribeAlarmHistoryResult","type":"structure","members":{"AlarmHistoryItems":{"type":"list","member":{"type":"structure","members":{"AlarmName":{},"Timestamp":{"type":"timestamp"},"HistoryItemType":{},"HistorySummary":{},"HistoryData":{}}}},"NextToken":{}}}},"DescribeAlarms":{"input":{"type":"structure","members":{"AlarmNames":{"shape":"S2"},"AlarmNamePrefix":{},"StateValue":{},"ActionPrefix":{},"MaxRecords":{"type":"integer"},"NextToken":{}}},"output":{"resultWrapper":"DescribeAlarmsResult","type":"structure","members":{"MetricAlarms":{"shape":"Sj"},"NextToken":{}}}},"DescribeAlarmsForMetric":{"input":{"type":"structure","required":["MetricName","Namespace"],"members":{"MetricName":{},"Namespace":{},"Statistic":{},"Dimensions":{"shape":"Sv"},"Period":{"type":"integer"},"Unit":{}}},"output":{"resultWrapper":"DescribeAlarmsForMetricResult","type":"structure","members":{"MetricAlarms":{"shape":"Sj"}}}},"DisableAlarmActions":{"input":{"type":"structure","required":["AlarmNames"],"members":{"AlarmNames":{"shape":"S2"}}}},"EnableAlarmActions":{"input":{"type":"structure","required":["AlarmNames"],"members":{"AlarmNames":{"shape":"S2"}}}},"GetMetricStatistics":{"input":{"type":"structure","required":["Namespace","MetricName","StartTime","EndTime","Period","Statistics"],"members":{"Namespace":{},"MetricName":{},"Dimensions":{"shape":"Sv"},"StartTime":{"type":"timestamp"},"EndTime":{"type":"timestamp"},"Period":{"type":"integer"},"Statistics":{"type":"list","member":{}},"Unit":{}}},"output":{"resultWrapper":"GetMetricStatisticsResult","type":"structure","members":{"Label":{},"Datapoints":{"type":"list","member":{"type":"structure","members":{"Timestamp":{"type":"timestamp"},"SampleCount":{"type":"double"},"Average":{"type":"double"},"Sum":{"type":"double"},"Minimum":{"type":"double"},"Maximum":{"type":"double"},"Unit":{}},"xmlOrder":["Timestamp","SampleCount","Average","Sum","Minimum","Maximum","Unit"]}}}}},"ListMetrics":{"input":{"type":"structure","members":{"Namespace":{},"MetricName":{},"Dimensions":{"type":"list","member":{"type":"structure","required":["Name"],"members":{"Name":{},"Value":{}}}},"NextToken":{}}},"output":{"xmlOrder":["Metrics","NextToken"],"resultWrapper":"ListMetricsResult","type":"structure","members":{"Metrics":{"type":"list","member":{"type":"structure","members":{"Namespace":{},"MetricName":{},"Dimensions":{"shape":"Sv"}},"xmlOrder":["Namespace","MetricName","Dimensions"]}},"NextToken":{}}}},"PutMetricAlarm":{"input":{"type":"structure","required":["AlarmName","MetricName","Namespace","Statistic","Period","EvaluationPeriods","Threshold","ComparisonOperator"],"members":{"AlarmName":{},"AlarmDescription":{},"ActionsEnabled":{"type":"boolean"},"OKActions":{"shape":"So"},"AlarmActions":{"shape":"So"},"InsufficientDataActions":{"shape":"So"},"MetricName":{},"Namespace":{},"Statistic":{},"Dimensions":{"shape":"Sv"},"Period":{"type":"integer"},"Unit":{},"EvaluationPeriods":{"type":"integer"},"Threshold":{"type":"double"},"ComparisonOperator":{}}}},"PutMetricData":{"input":{"type":"structure","required":["Namespace","MetricData"],"members":{"Namespace":{},"MetricData":{"type":"list","member":{"type":"structure","required":["MetricName"],"members":{"MetricName":{},"Dimensions":{"shape":"Sv"},"Timestamp":{"type":"timestamp"},"Value":{"type":"double"},"StatisticValues":{"type":"structure","required":["SampleCount","Sum","Minimum","Maximum"],"members":{"SampleCount":{"type":"double"},"Sum":{"type":"double"},"Minimum":{"type":"double"},"Maximum":{"type":"double"}}},"Unit":{}}}}}}},"SetAlarmState":{"input":{"type":"structure","required":["AlarmName","StateValue","StateReason"],"members":{"AlarmName":{},"StateValue":{},"StateReason":{},"StateReasonData":{}}}}},"shapes":{"S2":{"type":"list","member":{}},"Sj":{"type":"list","member":{"type":"structure","members":{"AlarmName":{},"AlarmArn":{},"AlarmDescription":{},"AlarmConfigurationUpdatedTimestamp":{"type":"timestamp"},"ActionsEnabled":{"type":"boolean"},"OKActions":{"shape":"So"},"AlarmActions":{"shape":"So"},"InsufficientDataActions":{"shape":"So"},"StateValue":{},"StateReason":{},"StateReasonData":{},"StateUpdatedTimestamp":{"type":"timestamp"},"MetricName":{},"Namespace":{},"Statistic":{},"Dimensions":{"shape":"Sv"},"Period":{"type":"integer"},"Unit":{},"EvaluationPeriods":{"type":"integer"},"Threshold":{"type":"double"},"ComparisonOperator":{}},"xmlOrder":["AlarmName","AlarmArn","AlarmDescription","AlarmConfigurationUpdatedTimestamp","ActionsEnabled","OKActions","AlarmActions","InsufficientDataActions","StateValue","StateReason","StateReasonData","StateUpdatedTimestamp","MetricName","Namespace","Statistic","Dimensions","Period","Unit","EvaluationPeriods","Threshold","ComparisonOperator"]}},"So":{"type":"list","member":{}},"Sv":{"type":"list","member":{"type":"structure","required":["Name","Value"],"members":{"Name":{},"Value":{}},"xmlOrder":["Name","Value"]}}},"paginators":{"DescribeAlarmHistory":{"input_token":"NextToken","output_token":"NextToken","limit_key":"MaxRecords","result_key":"AlarmHistoryItems"},"DescribeAlarms":{"input_token":"NextToken","output_token":"NextToken","limit_key":"MaxRecords","result_key":"MetricAlarms"},"DescribeAlarmsForMetric":{"result_key":"MetricAlarms"},"ListMetrics":{"input_token":"NextToken","output_token":"NextToken","result_key":"Metrics"}}}); +(function e(t,r,n){function i(a,o){if(!r[a]){if(!t[a]){var u=typeof require=="function"&&require;if(!o&&u)return u(a,!0);if(s)return s(a,!0);throw new Error("Cannot find module '"+a+"'")}var f=r[a]={exports:{}};t[a][0].call(f.exports,function(e){var r=t[a][1][e];return i(r?r:e)},f,f.exports,e,t,r,n)}return r[a].exports}var s=typeof require=="function"&&require;for(var a=0;ai){n=i}}var a=t.length;W(a%2===0,"Invalid hex string");if(n>a/2){n=a/2}for(var o=0;os){r=s}}n=String(n||"utf8").toLowerCase();var h;switch(n){case"hex":h=a(this,e,t,r);break;case"utf8":case"utf-8":h=o(this,e,t,r);break;case"ascii":h=u(this,e,t,r);break;case"binary":h=f(this,e,t,r);break;case"base64":h=c(this,e,t,r);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":h=l(this,e,t,r);break;default:throw new Error("Unknown encoding")}return h};s.prototype.toString=function(e,t,r){var n=this;e=String(e||"utf8").toLowerCase();t=Number(t)||0;r=r!==undefined?Number(r):r=n.length;if(r===t)return"";var i;switch(e){case"hex":i=m(n,t,r);break;case"utf8":case"utf-8":i=p(n,t,r);break;case"ascii":i=d(n,t,r);break;case"binary":i=v(n,t,r);break;case"base64":i=h(n,t,r);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":i=g(n,t,r);break;default:throw new Error("Unknown encoding")}return i};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};s.prototype.copy=function(e,t,r,n){var i=this;if(!r)r=0;if(!n&&n!==0)n=this.length;if(!t)t=0;if(n===r)return;if(e.length===0||i.length===0)return;W(n>=r,"sourceEnd < sourceStart");W(t>=0&&t=0&&r=0&&n<=i.length,"sourceEnd out of bounds");if(n>this.length)n=this.length;if(e.length-tn)r=n;var i="";for(var s=t;s=this.length)return;return this[e]};function y(e,t,r,n){if(!n){W(typeof r==="boolean","missing or invalid endian");W(t!==undefined&&t!==null,"missing offset");W(t+1=i)return;var s;if(r){s=e[t];if(t+1=i)return;var s;if(r){if(t+2>>0)}else{if(t+1>>0)}return s}s.prototype.readUInt32LE=function(e,t){return b(this,e,true,t)};s.prototype.readUInt32BE=function(e,t){return b(this,e,false,t)};s.prototype.readInt8=function(e,t){if(!t){W(e!==undefined&&e!==null,"missing offset");W(e=this.length)return;var r=this[e]&128;if(r)return(255-this[e]+1)*-1;else return this[e]};function w(e,t,r,n){if(!n){W(typeof r==="boolean","missing or invalid endian");W(t!==undefined&&t!==null,"missing offset");W(t+1=i)return;var s=y(e,t,r,true);var a=s&32768;if(a)return(65535-s+1)*-1;else return s}s.prototype.readInt16LE=function(e,t){return w(this,e,true,t)};s.prototype.readInt16BE=function(e,t){return w(this,e,false,t)};function E(e,t,r,n){if(!n){W(typeof r==="boolean","missing or invalid endian");W(t!==undefined&&t!==null,"missing offset");W(t+3=i)return;var s=b(e,t,r,true);var a=s&2147483648;if(a)return(4294967295-s+1)*-1;else return s}s.prototype.readInt32LE=function(e,t){return E(this,e,true,t)};s.prototype.readInt32BE=function(e,t){return E(this,e,false,t)};function x(e,t,r,n){if(!n){W(typeof r==="boolean","missing or invalid endian");W(t+3=this.length)return;this[t]=e};function R(e,t,r,n,i){if(!i){W(t!==undefined&&t!==null,"missing value");W(typeof n==="boolean","missing or invalid endian");W(r!==undefined&&r!==null,"missing offset");W(r+1=s)return;for(var a=0,o=Math.min(s-r,2);a>>(n?a:1-a)*8}}s.prototype.writeUInt16LE=function(e,t,r){R(this,e,t,true,r)};s.prototype.writeUInt16BE=function(e,t,r){R(this,e,t,false,r)};function A(e,t,r,n,i){if(!i){W(t!==undefined&&t!==null,"missing value");W(typeof n==="boolean","missing or invalid endian");W(r!==undefined&&r!==null,"missing offset");W(r+3=s)return;for(var a=0,o=Math.min(s-r,4);a>>(n?a:3-a)*8&255}}s.prototype.writeUInt32LE=function(e,t,r){A(this,e,t,true,r)};s.prototype.writeUInt32BE=function(e,t,r){A(this,e,t,false,r)};s.prototype.writeInt8=function(e,t,r){if(!r){W(e!==undefined&&e!==null,"missing value");W(t!==undefined&&t!==null,"missing offset");W(t=this.length)return;if(e>=0)this.writeUInt8(e,t,r);else this.writeUInt8(255+e+1,t,r)};function C(e,t,r,n,i){if(!i){W(t!==undefined&&t!==null,"missing value");W(typeof n==="boolean","missing or invalid endian");W(r!==undefined&&r!==null,"missing offset");W(r+1=s)return;if(t>=0)R(e,t,r,n,i);else R(e,65535+t+1,r,n,i)}s.prototype.writeInt16LE=function(e,t,r){C(this,e,t,true,r)};s.prototype.writeInt16BE=function(e,t,r){C(this,e,t,false,r)};function q(e,t,r,n,i){if(!i){W(t!==undefined&&t!==null,"missing value");W(typeof n==="boolean","missing or invalid endian");W(r!==undefined&&r!==null,"missing offset");W(r+3=s)return;if(t>=0)A(e,t,r,n,i);else A(e,4294967295+t+1,r,n,i)}s.prototype.writeInt32LE=function(e,t,r){q(this,e,t,true,r)};s.prototype.writeInt32BE=function(e,t,r){q(this,e,t,false,r)};function T(e,t,r,n,s){if(!s){W(t!==undefined&&t!==null,"missing value");W(typeof n==="boolean","missing or invalid endian");W(r!==undefined&&r!==null,"missing offset");W(r+3=a)return;i.write(e,t,r,n,23,4)}s.prototype.writeFloatLE=function(e,t,r){T(this,e,t,true,r)};s.prototype.writeFloatBE=function(e,t,r){T(this,e,t,false,r)};function _(e,t,r,n,s){if(!s){W(t!==undefined&&t!==null,"missing value");W(typeof n==="boolean","missing or invalid endian");W(r!==undefined&&r!==null,"missing offset");W(r+7=a)return;i.write(e,t,r,n,52,8)}s.prototype.writeDoubleLE=function(e,t,r){_(this,e,t,true,r)};s.prototype.writeDoubleBE=function(e,t,r){_(this,e,t,false,r)};s.prototype.fill=function(e,t,r){if(!e)e=0;if(!t)t=0;if(!r)r=this.length;if(typeof e==="string"){e=e.charCodeAt(0)}W(typeof e==="number"&&!isNaN(e),"value is not a number");W(r>=t,"end < start");if(r===t)return;if(this.length===0)return;W(t>=0&&t=0&&r<=this.length,"end out of bounds");for(var n=t;n"};s.prototype.toArrayBuffer=function(){if(typeof Uint8Array!=="undefined"){if(s._useTypedArrays){return new s(this).buffer}else{var e=new Uint8Array(this.length);for(var t=0,r=e.length;t=t)return t;if(e>=0)return e;e+=t;if(e>=0)return e;return 0}function j(e){e=~~Math.ceil(+e);return e<0?0:e}function k(e){return(Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"})(e)}function O(e){return k(e)||s.isBuffer(e)||e&&typeof e==="object"&&typeof e.length==="number"}function N(e){if(e<16)return"0"+e.toString(16);return e.toString(16)}function D(e){var t=[];for(var r=0;r=55296&&n<=57343)r++;var s=encodeURIComponent(e.slice(i,r+1)).substr(1).split("%");for(var a=0;a>8;n=t%256;i.push(n);i.push(r)}return i}function H(e){return n.toByteArray(e)}function M(e,t,r,n){var i;for(var s=0;s=t.length||s>=e.length)break;t[s+r]=e[s]}return s}function z(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}function V(e,t){W(typeof e==="number","cannot write a non-number as a number");W(e>=0,"specified a negative value for writing an unsigned value");W(e<=t,"value is larger than maximum value for type");W(Math.floor(e)===e,"value has a fractional component")}function F(e,t,r){W(typeof e==="number","cannot write a non-number as a number");W(e<=t,"value larger than maximum allowed value");W(e>=r,"value smaller than minimum allowed value");W(Math.floor(e)===e,"value has a fractional component")}function X(e,t,r){W(typeof e==="number","cannot write a non-number as a number");W(e<=t,"value larger than maximum allowed value");W(e>=r,"value smaller than minimum allowed value")}function W(e,t){if(!e)throw new Error(t||"Failed assertion")}},{"base64-js":2,ieee754:3}],2:[function(e,t,r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(e){"use strict";var t=typeof Uint8Array!=="undefined"?Uint8Array:Array;var r="+".charCodeAt(0);var i="/".charCodeAt(0);var s="0".charCodeAt(0);var a="a".charCodeAt(0);var o="A".charCodeAt(0);function u(e){var t=e.charCodeAt(0);if(t===r)return 62;if(t===i)return 63;if(t0){throw new Error("Invalid string. Length must be a multiple of 4")}var f=e.length;a="="===e.charAt(f-2)?2:"="===e.charAt(f-1)?1:0;o=new t(e.length*3/4-a);i=a>0?e.length-4:e.length;var c=0;function l(e){o[c++]=e}for(r=0,n=0;r>16);l((s&65280)>>8);l(s&255)}if(a===2){s=u(e.charAt(r))<<2|u(e.charAt(r+1))>>4;l(s&255)}else if(a===1){s=u(e.charAt(r))<<10|u(e.charAt(r+1))<<4|u(e.charAt(r+2))>>2;l(s>>8&255);l(s&255)}return o}function c(e){var t,r=e.length%3,i="",s,a;function o(e){return n.charAt(e)}function u(e){return o(e>>18&63)+o(e>>12&63)+o(e>>6&63)+o(e&63)}for(t=0,a=e.length-r;t>2);i+=o(s<<4&63);i+="==";break;case 2:s=(e[e.length-2]<<8)+e[e.length-1];i+=o(s>>10);i+=o(s>>4&63);i+=o(s<<2&63);i+="=";break}return i}e.toByteArray=f;e.fromByteArray=c})(typeof r==="undefined"?this.base64js={}:r)},{}],3:[function(e,t,r){r.read=function(e,t,r,n,i){var s,a,o=i*8-n-1,u=(1<>1,c=-7,l=r?i-1:0,h=r?-1:1,p=e[t+l];l+=h;s=p&(1<<-c)-1;p>>=-c;c+=o;for(;c>0;s=s*256+e[t+l],l+=h,c-=8);a=s&(1<<-c)-1;s>>=-c;c+=n;for(;c>0;a=a*256+e[t+l],l+=h,c-=8);if(s===0){s=1-f}else if(s===u){return a?NaN:(p?-1:1)*Infinity}else{a=a+Math.pow(2,n);s=s-f}return(p?-1:1)*a*Math.pow(2,s-n)};r.write=function(e,t,r,n,i,s){var a,o,u,f=s*8-i-1,c=(1<>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:s-1,d=n?1:-1,v=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){o=isNaN(t)?1:0;a=c}else{a=Math.floor(Math.log(t)/Math.LN2);if(t*(u=Math.pow(2,-a))<1){a--;u*=2}if(a+l>=1){t+=h/u}else{t+=h*Math.pow(2,1-l)}if(t*u>=2){a++;u/=2}if(a+l>=c){o=0;a=c}else if(a+l>=1){o=(t*u-1)*Math.pow(2,i);a=a+l}else{o=t*Math.pow(2,l-1)*Math.pow(2,i);a=0}}for(;i>=8;e[r+p]=o&255,p+=d,o/=256,i-=8);a=a<0;e[r+p]=a&255,p+=d,a/=256,f-=8);e[r+p-d]|=v*128}},{}],4:[function(e,t,r){var n=e("buffer").Buffer;var i=4;var s=new n(i);s.fill(0);var a=8;function o(e,t){if(e.length%i!==0){var r=e.length+(i-e.length%i);e=n.concat([e,s],r)}var a=[];var o=t?e.readInt32BE:e.readInt32LE;for(var u=0;uf){t=e(t)}else if(t.length>5]|=128<>>9<<4)+14]=t;var r=1732584193;var n=-271733879;var i=-1732584194;var s=271733878;for(var a=0;a>16)+(t>>16)+(r>>16);return n<<16|r&65535}function h(e,t){return e<>>32-t}t.exports=function p(e){return n.hash(e,s,16)}},{"./helpers":4}],7:[function(e,t,r){(function(){var e=this;var r,n;r=function(e){var t=new Array(e);var r;for(var n=0,r;n>>((n&3)<<3)&255}return t};if(e.crypto&&crypto.getRandomValues){n=function(e){var t=new Uint8Array(e);crypto.getRandomValues(t);return t}}t.exports=n||r})()},{}],8:[function(e,t,r){var n=e("./helpers");function i(e,t){e[t>>5]|=128<<24-t%32;e[(t+64>>9<<4)+15]=t;var r=Array(80);var n=1732584193;var i=-271733879;var f=-1732584194;var c=271733878;var l=-1009589776;for(var h=0;h>16)+(t>>16)+(r>>16);return n<<16|r&65535}function u(e,t){return e<>>32-t}t.exports=function f(e){return n.hash(e,i,20,true)}},{"./helpers":4}],9:[function(e,t,r){var n=e("./helpers");var i=function(e,t){var r=(e&65535)+(t&65535);var n=(e>>16)+(t>>16)+(r>>16);return n<<16|r&65535};var s=function(e,t){return e>>>t|e<<32-t};var a=function(e,t){return e>>>t};var o=function(e,t,r){return e&t^~e&r};var u=function(e,t,r){return e&t^e&r^t&r};var f=function(e){return s(e,2)^s(e,13)^s(e,22)};var c=function(e){return s(e,6)^s(e,11)^s(e,25)};var l=function(e){return s(e,7)^s(e,18)^a(e,3)};var h=function(e){return s(e,17)^s(e,19)^a(e,10)};var p=function(e,t){var r=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);var n=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225);var s=new Array(64);var a,p,d,v,m,g,y,b,w,E;var x,S;e[t>>5]|=128<<24-t%32;e[(t+64>>9<<4)+15]=t;for(var w=0;w0&&this._events[e].length>r){this._events[e].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[e].length);if(typeof console.trace==="function"){console.trace()}}}return this};n.prototype.on=n.prototype.addListener;n.prototype.once=function(e,t){if(!i(t))throw TypeError("listener must be a function");var r=false;function n(){this.removeListener(e,n);if(!r){r=true;t.apply(this,arguments)}}n.listener=t;this.on(e,n);return this};n.prototype.removeListener=function(e,t){var r,n,s,o;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;r=this._events[e];s=r.length;n=-1;if(r===t||i(r.listener)&&r.listener===t){delete this._events[e];if(this._events.removeListener)this.emit("removeListener",e,t)}else if(a(r)){for(o=s;o-->0;){if(r[o]===t||r[o].listener&&r[o].listener===t){n=o;break}}if(n<0)return this;if(r.length===1){r.length=0;delete this._events[e]}else{r.splice(n,1)}if(this._events.removeListener)this.emit("removeListener",e,t)}return this};n.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[e])delete this._events[e];return this}if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}this.removeAllListeners("removeListener");this._events={};return this}r=this._events[e];if(i(r)){this.removeListener(e,r)}else{while(r.length)this.removeListener(e,r[r.length-1])}delete this._events[e];return this};n.prototype.listeners=function(e){var t;if(!this._events||!this._events[e])t=[];else if(i(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};n.listenerCount=function(e,t){var r;if(!e._events||!e._events[t])r=0;else if(i(e._events[t]))r=1;else r=e._events[t].length;return r};function i(e){return typeof e==="function"}function s(e){return typeof e==="number"}function a(e){return typeof e==="object"&&e!==null}function o(e){return e===void 0}},{}],11:[function(e,t,r){if(typeof Object.create==="function"){t.exports=function n(e,t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{t.exports=function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype;e.prototype=new r;e.prototype.constructor=e}}},{}],12:[function(e,t,r){var n=t.exports={};n.nextTick=function(){var e=typeof window!=="undefined"&&window.setImmediate;var t=typeof window!=="undefined"&&window.postMessage&&window.addEventListener;if(e){return function(e){return window.setImmediate(e)}}if(t){var r=[];window.addEventListener("message",function(e){var t=e.source;if((t===window||t===null)&&e.data==="process-tick"){e.stopPropagation();if(r.length>0){var n=r.shift();n()}}},true);return function n(e){r.push(e);window.postMessage("process-tick","*")}}return function i(e){setTimeout(e,0)}}();n.title="browser";n.browser=true;n.env={};n.argv=[];function i(){}n.on=i;n.addListener=i;n.once=i;n.off=i;n.removeListener=i;n.removeAllListeners=i;n.emit=i;n.binding=function(e){throw new Error("process.binding is not supported")};n.cwd=function(){return"/"};n.chdir=function(e){throw new Error("process.chdir is not supported")}},{}],13:[function(e,t,r){(function(e){(function(n){var i=typeof r=="object"&&r;var s=typeof t=="object"&&t&&t.exports==i&&t;var a=typeof e=="object"&&e;if(a.global===a||a.window===a){n=a}var o,u=2147483647,f=36,c=1,l=26,h=38,p=700,d=72,v=128,m="-",g=/^xn--/,y=/[^ -~]/,b=/\x2E|\u3002|\uFF0E|\uFF61/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},E=f-c,x=Math.floor,S=String.fromCharCode,R;function A(e){throw RangeError(w[e])}function C(e,t){var r=e.length;while(r--){e[r]=t(e[r])}return e}function q(e,t){return C(e.split(b),t).join(".")}function T(e){var t=[],r=0,n=e.length,i,s;while(r=55296&&i<=56319&&r65535){e-=65536;t+=S(e>>>10&1023|55296);e=56320|e&1023}t+=S(e);return t}).join("")}function L(e){if(e-48<10){return e-22}if(e-65<26){return e-65}if(e-97<26){return e-97}return f}function I(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function P(e,t,r){var n=0;e=r?x(e/p):e>>1;e+=x(e/t);for(;e>E*l>>1;n+=f){e=x(e/E)}return x(n+(E+1)*e/(e+h))}function j(e){var t=[],r=e.length,n,i=0,s=v,a=d,o,h,p,g,y,b,w,E,S;o=e.lastIndexOf(m);if(o<0){o=0}for(h=0;h=128){A("not-basic")}t.push(e.charCodeAt(h))}for(p=o>0?o+1:0;p=r){A("invalid-input")}w=L(e.charCodeAt(p++));if(w>=f||w>x((u-i)/y)){A("overflow")}i+=w*y;E=b<=a?c:b>=a+l?l:b-a;if(wx(u/S)){A("overflow")}y*=S}n=t.length+1;a=P(i-g,n,g==0);if(x(i/n)>u-s){A("overflow")}s+=x(i/n);i%=n;t.splice(i++,0,s)}return _(t)}function k(e){var t,r,n,i,s,a,o,h,p,g,y,b=[],w,E,R,C;e=T(e);w=e.length;t=v;r=0;s=d;for(a=0;a=t&&yx((u-r)/E)){A("overflow")}r+=(o-t)*E;t=o;for(a=0;au){A("overflow")}if(y==t){for(h=r,p=f;;p+=f){g=p<=s?c:p>=s+l?l:p-s;if(h0&&f>u){f=u}for(var c=0;c=0){p=l.substr(0,h);d=l.substr(h+1)}else{p=l;d=""}v=decodeURIComponent(p);m=decodeURIComponent(d);if(!n(a,v)){a[v]=m}else if(i(a[v])){a[v].push(m)}else{a[v]=[a[v],m]}}return a};var i=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}},{}],15:[function(e,t,r){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,o){t=t||"&";r=r||"=";if(e===null){e=undefined}if(typeof e==="object"){return s(a(e),function(s){var a=encodeURIComponent(n(s))+r;if(i(e[s])){return e[s].map(function(e){return a+encodeURIComponent(n(e))}).join(t)}else{return a+encodeURIComponent(n(e[s]))}}).join(t)}if(!o)return"";return encodeURIComponent(n(o))+r+encodeURIComponent(n(e))};var i=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function s(e,t){if(e.map)return e.map(t);var r=[];for(var n=0;n",'"',"`"," ","\r","\n"," "],u=["{","}","|","\\","^","`"].concat(o),f=["'"].concat(u),c=["%","/","?",";","#"].concat(f),l=["/","?","#"],h=255,p=/^[a-z0-9A-Z_-]{0,63}$/,d=/^([a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:true,"javascript:":true},m={javascript:true,"javascript:":true},g={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},y=e("querystring");function b(e,t,r){if(e&&R(e)&&e instanceof i)return e;var n=new i;n.parse(e,t,r);return n}i.prototype.parse=function(e,t,r){if(!S(e)){throw new TypeError("Parameter 'url' must be a string, not "+typeof e)}var i=e;i=i.trim();var a=s.exec(i);if(a){a=a[0];var o=a.toLowerCase();this.protocol=o;i=i.substr(a.length)}if(r||a||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var u=i.substr(0,2)==="//";if(u&&!(a&&m[a])){i=i.substr(2);this.slashes=true}}if(!m[a]&&(u||a&&!g[a])){var b=-1;for(var w=0;w127){_+="x"}else{_+=T[L]}}if(!_.match(p)){var P=C.slice(0,w);var j=C.slice(w+1);var k=T.match(d);if(k){P.push(k[1]);j.unshift(k[2])}if(j.length){i="/"+j.join(".")+i}this.hostname=P.join(".");break}}}}if(this.hostname.length>h){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!A){var O=this.hostname.split(".");var N=[];for(var w=0;w0?r.host.split("@"):false;if(p){r.auth=p.shift();r.host=r.hostname=p.shift()}}r.search=e.search;r.query=e.query;if(!A(r.pathname)||!A(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.href=r.format();return r}if(!l.length){r.pathname=null;if(r.search){r.path="/"+r.search}else{r.path=null}r.href=r.format();return r}var d=l.slice(-1)[0];var v=(r.host||e.host)&&(d==="."||d==="..")||d==="";var y=0;for(var b=l.length;b>=0;b--){d=l[b];if(d=="."){l.splice(b,1)}else if(d===".."){l.splice(b,1);y++}else if(y){l.splice(b,1);y--}}if(!f&&!c){for(;y--;y){l.unshift("..")}}if(f&&l[0]!==""&&(!l[0]||l[0].charAt(0)!=="/")){l.unshift("")}if(v&&l.join("/").substr(-1)!=="/"){l.push("")}var w=l[0]===""||l[0]&&l[0].charAt(0)==="/";if(h){r.hostname=r.host=w?"":l.length?l.shift():"";var p=r.host&&r.host.indexOf("@")>0?r.host.split("@"):false;if(p){r.auth=p.shift();r.host=r.hostname=p.shift()}}f=f||r.host&&l.length;if(f&&!w){l.unshift("")}if(!l.length){r.pathname=null;r.path=null}else{r.pathname=l.join("/")}if(!A(r.pathname)||!A(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.auth=e.auth||r.auth;r.slashes=r.slashes||e.slashes;r.href=r.format();return r};i.prototype.parseHost=function(){var e=this.host;var t=a.exec(e);if(t){t=t[0];if(t!==":"){this.port=t.substr(1)}e=e.substr(0,e.length-t.length)}if(e)this.hostname=e};function S(e){return typeof e==="string"}function R(e){return typeof e==="object"&&e!==null}function A(e){return e===null}function C(e){return e==null}},{punycode:13,querystring:16}],18:[function(e,t,r){t.exports=function n(e){return e&&typeof e==="object"&&typeof e.copy==="function"&&typeof e.fill==="function"&&typeof e.readUInt8==="function"}},{}],19:[function(e,t,r){(function(t,n){var i=/%[sdj%]/g;r.format=function(e){if(!x(e)){var t=[];for(var r=0;r=s)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return e}});for(var u=n[r];r=3)n.depth=arguments[2];if(arguments.length>=4)n.colors=arguments[3];if(y(t)){n.showHidden=t}else if(t){r._extend(n,t)}if(R(n.showHidden))n.showHidden=false;if(R(n.depth))n.depth=2;if(R(n.colors))n.colors=false;if(R(n.customInspect))n.customInspect=true;if(n.colors)n.stylize=u;return l(n,e,n.depth)}r.inspect=o;o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};o.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"};function u(e,t){var r=o.styles[t];if(r){return"["+o.colors[r][0]+"m"+e+"["+o.colors[r][1]+"m"}else{return e}}function f(e,t){return e}function c(e){var t={};e.forEach(function(e,r){t[e]=true});return t}function l(e,t,n){if(e.customInspect&&t&&_(t.inspect)&&t.inspect!==r.inspect&&!(t.constructor&&t.constructor.prototype===t)){var i=t.inspect(n,e);if(!x(i)){i=l(e,i,n)}return i}var s=h(e,t);if(s){return s}var a=Object.keys(t);var o=c(a);if(e.showHidden){a=Object.getOwnPropertyNames(t)}if(T(t)&&(a.indexOf("message")>=0||a.indexOf("description")>=0)){return p(t)}if(a.length===0){if(_(t)){var u=t.name?": "+t.name:"";return e.stylize("[Function"+u+"]","special")}if(A(t)){return e.stylize(RegExp.prototype.toString.call(t),"regexp")}if(q(t)){return e.stylize(Date.prototype.toString.call(t),"date")}if(T(t)){return p(t)}}var f="",y=false,b=["{","}"];if(g(t)){y=true;b=["[","]"]}if(_(t)){var w=t.name?": "+t.name:"";f=" [Function"+w+"]"}if(A(t)){f=" "+RegExp.prototype.toString.call(t)}if(q(t)){f=" "+Date.prototype.toUTCString.call(t)}if(T(t)){f=" "+p(t)}if(a.length===0&&(!y||t.length==0)){return b[0]+f+b[1]}if(n<0){if(A(t)){return e.stylize(RegExp.prototype.toString.call(t),"regexp")}else{return e.stylize("[Object]","special")}}e.seen.push(t);var E;if(y){E=d(e,t,n,o,a)}else{E=a.map(function(r){return v(e,t,n,o,r,y)})}e.seen.pop();return m(E,f,b)}function h(e,t){if(R(t))return e.stylize("undefined","undefined");if(x(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(E(t))return e.stylize(""+t,"number");if(y(t))return e.stylize(""+t,"boolean");if(b(t))return e.stylize("null","null")}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,r,n,i){var s=[];for(var a=0,o=t.length;a-1){if(s){o=o.split("\n").map(function(e){return" "+e}).join("\n").substr(2)}else{o="\n"+o.split("\n").map(function(e){return" "+e}).join("\n")}}}else{o=e.stylize("[Circular]","special")}}if(R(a)){if(s&&i.match(/^\d+$/)){return o}a=JSON.stringify(""+i);if(a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){a=a.substr(1,a.length-2);a=e.stylize(a,"name")}else{a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");a=e.stylize(a,"string")}}return a+": "+o}function m(e,t,r){var n=0;var i=e.reduce(function(e,t){n++;if(t.indexOf("\n")>=0)n++;return e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(i>60){return r[0]+(t===""?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]}return r[0]+t+" "+e.join(", ")+" "+r[1]}function g(e){return Array.isArray(e)}r.isArray=g;function y(e){return typeof e==="boolean"}r.isBoolean=y;function b(e){return e===null}r.isNull=b;function w(e){return e==null}r.isNullOrUndefined=w;function E(e){return typeof e==="number"}r.isNumber=E;function x(e){return typeof e==="string"}r.isString=x;function S(e){return typeof e==="symbol"}r.isSymbol=S;function R(e){return e===void 0}r.isUndefined=R;function A(e){return C(e)&&I(e)==="[object RegExp]"}r.isRegExp=A;function C(e){return typeof e==="object"&&e!==null}r.isObject=C;function q(e){return C(e)&&I(e)==="[object Date]"}r.isDate=q;function T(e){return C(e)&&(I(e)==="[object Error]"||e instanceof Error)}r.isError=T;function _(e){return typeof e==="function"}r.isFunction=_;function L(e){return e===null||typeof e==="boolean"||typeof e==="number"||typeof e==="string"||typeof e==="symbol"||typeof e==="undefined"}r.isPrimitive=L;r.isBuffer=e("./support/isBuffer");function I(e){return Object.prototype.toString.call(e)}function P(e){return e<10?"0"+e.toString(10):e.toString(10)}var j=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function k(){var e=new Date;var t=[P(e.getHours()),P(e.getMinutes()),P(e.getSeconds())].join(":");return[e.getDate(),j[e.getMonth()],t].join(" ")}r.log=function(){console.log("%s - %s",k(),r.format.apply(r,arguments))};r.inherits=e("inherits");r._extend=function(e,t){if(!t||!C(t))return e;var r=Object.keys(t);var n=r.length;while(n--){e[r[n]]=t[r[n]]}return e};function O(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}).call(this,e("G+mPsH"),typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":18,"G+mPsH":12,inherits:11}],20:[function(e,t,r){var n=e("./core");n.XML.Parser=e("./xml/browser_parser");e("./http/xhr");if(typeof window!=="undefined")window.AWS=n},{"./core":22,"./http/xhr":30,"./xml/browser_parser":62}],21:[function(e,t,r){var n=e("./core");e("./credentials");e("./credentials/credential_provider_chain");n.Config=n.util.inherit({constructor:function i(e){if(e===undefined)e={};e=this.extractCredentials(e);n.util.each.call(this,this.keys,function(t,r){this.set(t,e[t],r)})},update:function s(e,t){t=t||false;e=this.extractCredentials(e);n.util.each.call(this,e,function(e,r){if(t||this.keys.hasOwnProperty(e))this[e]=r})},getCredentials:function a(e){var t=this;function r(r){e(r,r?null:t.credentials)}function i(e,t){return new n.util.error(t||new Error,{code:"CredentialsError",message:e})}function s(){t.credentials.get(function(e){if(e){var n="Could not load credentials from "+t.credentials.constructor.name;e=i(n,e)}r(e)})}function a(){var e=null;if(!t.credentials.accessKeyId||!t.credentials.secretAccessKey){e=i("Missing credentials")}r(e)}if(t.credentials){if(typeof t.credentials.get==="function"){s()}else{a()}}else if(t.credentialProvider){t.credentialProvider.resolve(function(e,n){if(e){e=i("Could not load credentials from any providers",e)}t.credentials=n;r(e)})}else{r(i("No credentials to load"))}},loadFromPath:function o(e){this.clear();var t=JSON.parse(n.util.readFileSync(e));var r=new n.FileSystemCredentials(e);var i=new n.CredentialProviderChain;i.providers.unshift(r);i.resolve(function(e,r){if(e)throw e;else t.credentials=r});this.constructor(t);return this},clear:function u(){n.util.each.call(this,this.keys,function(e){delete this[e]});this.set("credentials",undefined);this.set("credentialProvider",undefined)},set:function f(e,t,r){if(t===undefined){if(r===undefined){r=this.keys[e]}if(typeof r==="function"){this[e]=r.call(this)}else{this[e]=r}}else{this[e]=t}},keys:{credentials:null,credentialProvider:null,region:null,logger:null,apiVersions:{},apiVersion:null,endpoint:undefined,httpOptions:{},maxRetries:undefined,maxRedirects:10,paramValidation:true,sslEnabled:true,s3ForcePathStyle:false,computeChecksums:true,convertResponseTypes:true,dynamoDbCrc32:true,signatureVersion:null},extractCredentials:function c(e){if(e.accessKeyId&&e.secretAccessKey){e=n.util.copy(e);e.credentials=new n.Credentials(e)}return e}});n.config=new n.Config},{"./core":22,"./credentials":23,"./credentials/credential_provider_chain":24}],22:[function(e,t,r){var n={util:e("./util")};var i={};i.toString();t.exports=n;n.util.update(n,{VERSION:"2.0.6",Signers:{},Protocol:{Json:e("./protocol/json"),Query:e("./protocol/query"),Rest:e("./protocol/rest"),RestJson:e("./protocol/rest_json"),RestXml:e("./protocol/rest_xml")},XML:{Builder:e("./xml/builder"),Parser:null},JSON:{Builder:e("./json/builder"),Parser:e("./json/parser")},Model:{Api:e("./model/api"),Operation:e("./model/operation"),Shape:e("./model/shape"),Paginator:e("./model/paginator"),ResourceWaiter:e("./model/resource_waiter")},util:e("./util")});e("./service");e("./credentials");e("./credentials/credential_provider_chain");e("./credentials/temporary_credentials");e("./credentials/web_identity_credentials");e("./credentials/saml_credentials");e("./config");e("./http");e("./sequential_executor");e("./event_listeners");e("./request");e("./response");e("./resource_waiter");e("./signers/request_signer");e("./param_validator");n.events=new n.SequentialExecutor},{"./config":21,"./credentials":23,"./credentials/credential_provider_chain":24,"./credentials/saml_credentials":25,"./credentials/temporary_credentials":26,"./credentials/web_identity_credentials":27,"./event_listeners":28,"./http":29,"./json/builder":31,"./json/parser":32,"./model/api":33,"./model/operation":35,"./model/paginator":36,"./model/resource_waiter":37,"./model/shape":38,"./param_validator":39,"./protocol/json":40,"./protocol/query":41,"./protocol/rest":42,"./protocol/rest_json":43,"./protocol/rest_xml":44,"./request":48,"./resource_waiter":49,"./response":50,"./sequential_executor":51,"./service":52,"./signers/request_signer":54,"./util":61,"./xml/builder":63}],23:[function(e,t,r){var n=e("./core");n.Credentials=n.util.inherit({constructor:function i(){n.util.hideProperties(this,["secretAccessKey"]);this.expired=false;this.expireTime=null;if(arguments.length===1&&typeof arguments[0]==="object"){var e=arguments[0].credentials||arguments[0];this.accessKeyId=e.accessKeyId;this.secretAccessKey=e.secretAccessKey;this.sessionToken=e.sessionToken}else{this.accessKeyId=arguments[0];this.secretAccessKey=arguments[1];this.sessionToken=arguments[2]}},expiryWindow:15,needsRefresh:function s(){var e=n.util.date.getDate().getTime();var t=new Date(e+this.expiryWindow*1e3);if(this.expireTime&&t>this.expireTime){return true}else{return this.expired||!this.accessKeyId||!this.secretAccessKey}},get:function a(e){var t=this;if(this.needsRefresh()){this.refresh(function(r){if(!r)t.expired=false;if(e)e(r)})}else if(e){e()}},refresh:function o(e){this.expired=false;e()}})},{"./core":22}],24:[function(e,t,r){var n=e("../core");n.CredentialProviderChain=n.util.inherit(n.Credentials,{constructor:function i(e){if(e){this.providers=e}else{this.providers=n.CredentialProviderChain.defaultProviders.slice(0)}},resolve:function s(e){if(this.providers.length===0){e(new Error("No providers"));return this}var t=0;var r=this.providers.slice(0);function n(i,s){if(!i&&s||t===r.length){e(i,s);return}var a=r[t++];if(typeof a==="function"){s=a.call()}else{s=a}if(s.get){s.get(function(e){n(e,e?null:s)})}else{n(null,s)}}n();return this}});n.CredentialProviderChain.defaultProviders=[]},{"../core":22}],25:[function(e,t,r){var n=e("../core");n.SAMLCredentials=n.util.inherit(n.Credentials,{constructor:function i(e){n.Credentials.call(this);this.expired=true;this.service=new n.STS;this.params=e},refresh:function s(e){var t=this;if(!e)e=function(e){if(e)throw e};t.service.assumeRoleWithSAML(t.params,function(r,n){if(!r){t.service.credentialsFrom(n,t)}e(r)})}})},{"../core":22}],26:[function(e,t,r){var n=e("../core");n.TemporaryCredentials=n.util.inherit(n.Credentials,{constructor:function i(e){n.Credentials.call(this);this.loadMasterCredentials();this.service=new n.STS;this.expired=true;this.params=e||{};if(this.params.RoleArn){this.params.RoleSessionName=this.params.RoleSessionName||"temporary-credentials"}},refresh:function s(e){var t=this;if(!e)e=function(e){if(e)throw e};t.service.config.credentials=t.masterCredentials;var r=t.params.RoleArn?t.service.assumeRole:t.service.getSessionToken;r.call(t.service,t.params,function(r,n){if(!r){t.service.credentialsFrom(n,t)}e(r)})},loadMasterCredentials:function a(){this.masterCredentials=n.config.credentials;while(this.masterCredentials.masterCredentials){this.masterCredentials=this.masterCredentials.masterCredentials}}})},{"../core":22}],27:[function(e,t,r){var n=e("../core");n.WebIdentityCredentials=n.util.inherit(n.Credentials,{constructor:function i(e){n.Credentials.call(this);this.expired=true;this.service=new n.STS;this.params=e;this.data=null;this.params.RoleSessionName=this.params.RoleSessionName||"web-identity"},refresh:function s(e){var t=this;if(!e)e=function(e){if(e)throw e};t.service.assumeRoleWithWebIdentity(t.params,function(r,n){t.data=null;if(!r){t.data=n;t.service.credentialsFrom(n,t)}e(r)})}})},{"../core":22}],28:[function(e,t,r){var n=e("./core");var i=e("./sequential_executor");n.EventListeners={Core:{}};n.EventListeners={Core:(new i).addNamedListeners(function(e,t){t("VALIDATE_CREDENTIALS","validate",function r(e,t){if(!e.service.api.signatureVersion)return t();e.service.config.getCredentials(function(r){if(r){e.response.err=n.util.error(r,{code:"SigningError",message:"Missing credentials in config"})}t()})});e("VALIDATE_REGION","validate",function i(e){if(!e.service.config.region&&!e.service.isGlobalEndpoint){e.response.error=n.util.error(new Error,{code:"SigningError",message:"Missing region in config"})}});e("VALIDATE_PARAMETERS","validate",function s(e){var t=e.service.api.operations[e.operation].input;(new n.ParamValidator).validate(t,e.params)});e("SET_CONTENT_LENGTH","afterBuild",function a(e){if(e.httpRequest.headers["Content-Length"]===undefined){var t=n.util.string.byteLength(e.httpRequest.body);e.httpRequest.headers["Content-Length"]=t}});e("SET_HTTP_HOST","afterBuild",function o(e){e.httpRequest.headers["Host"]=e.httpRequest.endpoint.host});e("RESTART","restart",function u(e){var t=this.response.error;if(!t||!t.retryable)return;if(this.response.retryCount=60*10){this.emit("sign",[this],function(e){if(e)t(e);else a()})}else{a()}});e("HTTP_HEADERS","httpHeaders",function h(e,t,r){r.httpResponse.statusCode=e;r.httpResponse.headers=t;r.httpResponse.body=new n.util.Buffer("");r.httpResponse.buffers=[];r.httpResponse.numBytes=0});e("HTTP_DATA","httpData",function p(e,t){if(e){if(n.util.isNode()){t.httpResponse.numBytes+=e.length;var r=t.httpResponse.headers["content-length"];var i={loaded:t.httpResponse.numBytes,total:r};t.request.emit("httpDownloadProgress",[i,t])}t.httpResponse.buffers.push(new n.util.Buffer(e))}});e("HTTP_DONE","httpDone",function d(e){if(e.httpResponse.buffers&&e.httpResponse.buffers.length>0){var t=n.util.buffer.concat(e.httpResponse.buffers);e.httpResponse.body=t}delete e.httpResponse.numBytes;delete e.httpResponse.buffers});e("FINALIZE_ERROR","retry",function v(e){if(e.httpResponse.statusCode){e.error.statusCode=e.httpResponse.statusCode;if(e.error.retryable===undefined){e.error.retryable=this.service.retryableError(e.error,this)}}});e("INVALIDATE_CREDENTIALS","retry",function m(e){if(!e.error)return;switch(e.error.code){case"RequestExpired":case"ExpiredTokenException":case"ExpiredToken":e.error.retryable=true;e.request.service.config.credentials.expired=true}});e("REDIRECT","retry",function g(e){if(e.error&&e.error.statusCode>=300&&e.error.statusCode<400&&e.httpResponse.headers["location"]){this.httpRequest.endpoint=new n.Endpoint(e.httpResponse.headers["location"]);e.error.redirect=true;e.error.retryable=true}});e("RETRY_CHECK","retry",function y(e){if(e.error){if(e.error.redirect&&e.redirectCount=this.HEADERS_RECEIVED&&!h){try{l.responseType="arraybuffer"}catch(e){}f.statusCode=l.status;f.headers=o.parseHeaders(l.getAllResponseHeaders());f.emit("headers",f.statusCode,f.headers);h=true}if(this.readyState===this.DONE){o.finishRequest(l,f)}},false);l.upload.addEventListener("progress",function(e){f.emit("sendProgress",e)});l.addEventListener("progress",function(e){f.emit("receiveProgress",e)},false);l.addEventListener("timeout",function(){a(n.util.error(new Error("Timeout"),{code:"TimeoutError"}))},false);l.addEventListener("error",function(){a(n.util.error(new Error("Network Failure"),{code:"NetworkingError"}))},false);r(f);l.open(e.method,c,t.xhrAsync!==false);n.util.each(e.headers,function(e,t){if(e!=="Content-Length"&&e!=="User-Agent"&&e!=="Host"){l.setRequestHeader(e,t)}});if(e.body&&typeof e.body.buffer==="object"){l.send(e.body.buffer)}else{l.send(e.body)}return f},parseHeaders:function a(e){var t={};n.util.arrayEach(e.split(/\r?\n/),function(e){var r=e.split(":",1)[0];var n=e.substring(r.length+2);if(r.length>0)t[r]=n});return t},finishRequest:function o(e,t){var r;if(e.responseType==="arraybuffer"&&e.response){var i=e.response;r=new n.util.Buffer(i.byteLength);var s=new Uint8Array(i);for(var a=0;a0){var i=JSON.parse(r.body.toString());if(i.__type||i.code){t.code=(i.__type||i.code).split("#").pop()}else{t.code="UnknownError"}if(t.code==="RequestEntityTooLarge"){t.message="Request body must be less than 1 MB"}else{t.message=i.message||i.Message||null}}else{t.code=r.statusCode;t.message=null}e.error=n.error(new Error,t)}function u(e){var t=e.httpResponse.body.toString()||"{}";if(e.request.service.config.convertResponseTypes===false){e.data=JSON.parse(t)}else{var r=e.request.service.api.operations[e.request.operation];var n=r.output||{};var i=new s;e.data=i.parse(t,n)}}t.exports={buildRequest:a,extractError:o,extractData:u}},{"../json/builder":31,"../json/parser":32,"../util":61}],41:[function(e,t,r){var n=e("../core");var i=e("../util");var s=e("../query/query_param_serializer");var a=e("../model/shape");function o(e){var t=e.service.api.operations[e.operation];var r=e.httpRequest;r.headers["Content-Type"]="application/x-www-form-urlencoded; charset=utf-8";r.params={Version:e.service.api.apiVersion,Action:t.name};var n=new s;n.serialize(e.params,t.input,function(e,t){r.params[e]=t});r.body=i.queryParamsToString(r.params)}function u(e){var t,r=e.httpResponse.body.toString();if(r.match("=0?"&":"?";var l=[];n.arrayEach(Object.keys(f).sort(),function(e){l.push(o(e)+"="+f[e])});i+=l.join("&")}e.httpRequest.path=i}function a(e){return n.uriEscape(String(e))}function o(e){return n.uriEscape(String(e))}function u(e){var t=e.service.api.operations[e.operation];n.each(t.input.members,function(t,r){var i=e.params[t];if(i===null||i===undefined)return;if(r.location==="headers"&&r.type==="map"){n.each(i,function(t,n){e.httpRequest.headers[r.name+t]=n})}else if(r.location==="header"){i=r.toWireFormat(i).toString();e.httpRequest.headers[r.name]=i}})}function f(e){i(e);s(e);u(e)}function c(){}function l(e){var t=e.request;var r={};var i=e.httpResponse;var s=t.service.api.operations[t.operation];var a=s.output;var o={};n.each(i.headers,function(e,t){o[e.toLowerCase()]=t});n.each(a.members,function(e,t){var s=(t.name||e).toLowerCase();if(t.location==="headers"&&t.type==="map"){r[e]={};n.each(i.headers,function(n,i){var s=n.match(new RegExp("^"+t.name+"(.+)","i"));if(s!==null){r[e][s[1]]=i}})}else if(t.location==="header"){if(o[s]!==undefined){r[e]=o[s]}}else if(t.location==="status"){r[e]=parseInt(i.statusCode,10)}});e.data=r}t.exports={buildRequest:f,extractError:c,extractData:l}},{"../util":61}],43:[function(e,t,r){var n=e("../util");var i=e("./rest");var s=e("./json");var a=e("../json/builder");function o(e){var t=new a;var r=e.service.api.operations[e.operation].input;if(r.payload){var n={};var i=r.members[r.payload];n=e.params[r.payload];if(n===undefined)return;if(i.type==="structure"){e.httpRequest.body=t.build(n,i)}else{e.httpRequest.body=n}}else{e.httpRequest.body=t.build(e.params,r)}}function u(e){i.buildRequest(e);o(e)}function f(e){s.extractError(e)}function c(e){i.extractData(e);var t=e.request;var r=t.service.api.operations[t.operation].output||{};if(r.payload){var a=r.members[r.payload];if(a.isStreaming){e.data[r.payload]=e.httpResponse.body}else if(a.type==="structure"){s.extractData(e)}else{e.data[r.payload]=e.httpResponse.body.toString()}}else{var o=e.data;s.extractData(e);e.data=n.merge(o,e.data)}}t.exports={buildRequest:u,extractError:f,extractData:c}},{"../json/builder":31,"../util":61,"./json":40,"./rest":42}],44:[function(e,t,r){var n=e("../core");var i=e("../util");var s=e("./rest");function a(e){var t=e.service.api.operations[e.operation].input;var r=new n.XML.Builder;var s=e.params;var a=t.payload;if(a){var o=t.members[a];s=s[a];if(s===undefined)return;if(o.type==="structure"){var u=o.name;e.httpRequest.body=r.toXML(s,o,u)}else{e.httpRequest.body=s}}else{e.httpRequest.body=r.toXML(s,t,t.shape||i.string.upperFirst(e.operation)+"Request")}}function o(e){s.buildRequest(e);a(e)}function u(e){s.extractError(e);var t=(new n.XML.Parser).parse(e.httpResponse.body.toString());if(t.Errors)t=t.Errors;if(t.Error)t=t.Error;if(t.Code){e.error=i.error(new Error,{code:t.Code,message:t.Message})}else{e.error=i.error(new Error,{code:e.httpResponse.statusCode,message:null})}}function f(e){s.extractData(e);var t;var r=e.request;var a=e.httpResponse.body;var o=r.service.api.operations[r.operation];var u=o.output;var f=u.payload;if(f){var c=u.members[f];if(c.isStreaming){e.data[f]=a}else if(c.type==="structure"){t=new n.XML.Parser;i.update(e.data,t.parse(a.toString(),c))}else{e.data[f]=a.toString()}}else if(a.length>0){t=new n.XML.Parser;var l=t.parse(a.toString(),u);i.update(e.data,l)}}t.exports={buildRequest:o,extractError:u,extractData:f}},{"../core":22,"../util":61,"./rest":42}],45:[function(e,t,r){var n=e("../util");function i(){}i.prototype.serialize=function(e,t,r){s("",e,t,r)};function s(e,t,r,i){n.each(r.members,function(r,n){var s=t[r];if(s===null||s===undefined)return;var a=e?e+"."+n.name:n.name;u(a,s,n,i)})}function a(e,t,r,i){var s=1;n.each(t,function(t,n){var a=r.flattened?".":".entry.";var o=a+s++ +".";var f=o+(r.key.name||"key");var c=o+(r.value.name||"value");u(e+f,t,r.key,i);u(e+c,n,r.value,i)})}function o(e,t,r,i){var s=r.member||{};if(t.length===0){i.call(this,e,null);return}n.arrayEach(t,function(t,n){var a="."+(n+1);if(r.flattened){if(s.name){var o=e.split(".");o.pop();o.push(s.name);e=o.join(".")}}else{a=".member"+a}u(e+a,t,s,i)})}function u(e,t,r,n){if(t===null||t===undefined)return;if(r.type==="structure"){s(e,t,r,n)}else if(r.type==="list"){o(e,t,r,n)}else if(r.type==="map"){a(e,t,r,n)}else{n(e,r.toWireFormat(t).toString())}}t.exports=i},{"../util":61}],46:[function(e,t,r){var n=e("./util");var i=e("./region_config.json");function s(e){var t=e.serviceIdentifier||"";var r=e.config.region||"";var s={};i.forEach(function(i){(i.regions||[]).forEach(function(a){if(r.match(new RegExp("^"+a.replace("*",".*")+"$"))){(i.serviceConfigs||[]).forEach(function(r){(r.services||[]).forEach(function(i){if(t.match(new RegExp("^"+i.replace("*",".*")+"$"))){n.update(s,r.config);e.isGlobalEndpoint=!!r.globalEndpoint}})})}})});n.each(s,function(t,r){if(e.config[t]===undefined||e.config[t]===null){e.config[t]=r}})}t.exports=s},{"./region_config.json":47,"./util":61}],47:[function(e,t,r){t.exports=[{regions:["*"],serviceConfigs:[{services:["*"],config:{endpoint:"{service}.{region}.amazonaws.com"}},{services:["cloudfront","iam","importexport","sts"],config:{endpoint:"{service}.amazonaws.com"},globalEndpoint:true},{services:["s3"],config:{endpoint:"{service}-{region}.amazonaws.com"}},{services:["route53"],config:{endpoint:"https://{service}.amazonaws.com"},globalEndpoint:true}]},{regions:["us-east-1"],serviceConfigs:[{services:["s3","simpledb"],config:{endpoint:"{service}.amazonaws.com"}}]},{regions:["cn-*"],serviceConfigs:[{services:["*"],config:{endpoint:"{service}.{region}.amazonaws.com.cn",signatureVersion:"v4"}}]}]},{}],48:[function(e,t,r){(function(t){var r=e("./core");var n=e("./state_machine");var i=r.util.inherit;var s={success:1,error:1,complete:1};function a(e){return s.hasOwnProperty(e._asm.currentState)}var o=new n;o.setupStates=function(){var e=function(e,t){try{var n=this;n.emit(n._asm.currentState,function(){var r=n.response.error;if(r&&r!==e&&a(n)){throw r}t(r)})}catch(i){if(i!==e&&a(n)){r.SequentialExecutor.prototype.unhandledErrorCallback.call(this,i);t()}else{t(i)}}};this.addState("validate","build","error",e);this.addState("build","afterBuild","restart",e);this.addState("afterBuild","sign","restart",e);this.addState("sign","send","retry",e);this.addState("retry","afterRetry","afterRetry",e);this.addState("afterRetry","sign","error",e);this.addState("send","validateResponse","retry",e);this.addState("validateResponse","extractData","extractError",e);this.addState("extractError","extractData","retry",e);this.addState("extractData","success","retry",e);this.addState("restart","build","error",e);this.addState("success","complete","complete",e);this.addState("error","complete","complete",e);this.addState("complete",null,null,e)};o.setupStates();r.Request=i({constructor:function u(e,t,i){var s=e.endpoint;var a=e.config.region;if(e.isGlobalEndpoint)a="us-east-1";this.service=e;this.operation=t;this.params=i||{};this.httpRequest=new r.HttpRequest(s,a);this.startTime=r.util.date.getDate();this.response=new r.Response(this);this._asm=new n(o.states,"validate");r.SequentialExecutor.call(this);this.emit=this.emitEvent},send:function f(e){if(e){this.on("complete",function(t){e.call(t,t.error,t.data)})}this.runTo();return this.response},build:function c(e){return this.runTo("send",e)},runTo:function l(e,t){this._asm.runTo(e,t,this);return this},abort:function h(){this.removeAllListeners("validateResponse");this.removeAllListeners("extractError");this.on("validateResponse",function e(t){t.error=r.util.error(new Error("Request aborted by user"),{code:"RequestAbortedError",retryable:false})});if(this.httpRequest.stream){this.httpRequest.stream.abort();if(this.httpRequest._abortCallback){this.httpRequest._abortCallback()}else{this.removeAllListeners("send")}}return this},eachPage:function p(e){e=r.util.fn.makeAsync(e,3);function t(n){e.call(n,n.error,n.data,function(i){if(i===false)return;if(n.hasNextPage()){n.nextPage().on("complete",t).send()}else{e.call(n,null,null,r.util.fn.noop)}})}this.on("complete",t).send()},eachItem:function d(e){function t(t,n){if(t)return e(t,null);if(n===null)return e(null,null);var i=this.request.service.paginationConfig(this.request.operation);var s=i.resultKey;if(Array.isArray(s))s=s[0];var a=r.util.jamespath.query(s,n);r.util.arrayEach(a,function(t){r.util.arrayEach(t,function(t){e(null,t)})})}this.eachPage(t)},isPageable:function v(){return this.service.paginationConfig(this.operation)?true:false},createReadStream:function m(){var e=r.util.nodeRequire("stream");var n=this;var i=null;var s=false;if(r.HttpClient.streamsApiVersion===2){i=new e.Readable;i._read=function(){}}else{i=new e.Stream;i.readable=true}i.sent=false;i.on("newListener",function(e){if(!i.sent&&(e==="data"||e==="readable")){if(e==="data")s=true;i.sent=true;t.nextTick(function(){n.send(function(){})})}});this.on("httpHeaders",function a(e,t,o){if(e<300){this.httpRequest._streaming=true;n.removeListener("httpData",r.EventListeners.Core.HTTP_DATA);n.removeListener("httpError",r.EventListeners.Core.HTTP_ERROR);n.on("httpError",function f(e,t){t.error=e;t.error.retryable=false});var u=o.httpResponse.stream;if(s){u.on("data",function(e){i.emit("data",e)});u.on("end",function(){i.emit("end")})}else{u.on("readable",function(){var e;do{e=u.read();if(e!==null)i.push(e)}while(e!==null);i.read(0)});u.on("end",function(){i.push(null)})}u.on("error",function(e){i.emit("error",e)})}});this.on("error",function(e){i.emit("error",e)});return i},emitEvent:function g(e,t,n){if(typeof t==="function"){n=t;t=null}if(!n)n=this.unhandledErrorCallback;if(!t)t=this.eventParameters(e,this.response);var i=r.SequentialExecutor.prototype.emit;i.call(this,e,t,function(e){if(e)this.response.error=e;n.call(this,e)})},eventParameters:function y(e){switch(e){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 b(e,t){if(!t&&typeof e==="function"){t=e;e=null}return(new r.Signers.Presign).sign(this.toGet(),e,t)},toUnauthenticated:function w(){this.removeListener("validate",r.EventListeners.Core.VALIDATE_CREDENTIALS);this.removeListener("sign",r.EventListeners.Core.SIGN);return this.toGet()},toGet:function E(){if(this.service.api.protocol==="query"){this.removeListener("build",this.buildAsGet);this.addListener("build",this.buildAsGet)}return this},buildAsGet:function x(e){e.httpRequest.method="GET";e.httpRequest.path="/?"+e.httpRequest.body;e.httpRequest.body="";delete e.httpRequest.headers["Content-Length"];delete e.httpRequest.headers["Content-Type"]}});r.util.mixin(r.Request,r.SequentialExecutor)}).call(this,e("G+mPsH"))},{"./core":22,"./state_machine":60,"G+mPsH":12}],49:[function(e,t,r){var n=e("./core");var i=n.util.inherit;n.ResourceWaiter=i({constructor:function s(e,t){this.service=e;this.state=t;if(typeof this.state==="object"){n.util.each.call(this,this.state,function(e,t){this.state=e;this.expectedValue=t})}this.loadWaiterConfig(this.state);if(!this.expectedValue){this.expectedValue=this.config.successValue}},service:null,state:null,expectedValue:null,config:null,waitDone:false,Listeners:{retry:(new n.SequentialExecutor).addNamedListeners(function(e){e("RETRY_CHECK","retry",function(e){var t=e.request._waiter;if(e.error&&e.error.code==="ResourceNotReady"){e.error.retryDelay=t.config.interval*1e3}})}),output:(new n.SequentialExecutor).addNamedListeners(function(e){e("CHECK_OUT_ERROR","extractError",function t(e){if(e.error){e.request._waiter.setError(e,true)}});e("CHECK_OUTPUT","extractData",function r(e){var t=e.request._waiter;var r=t.checkSuccess(e);if(!r){t.setError(e,r===null?false:true)}else{e.error=null}})}),error:(new n.SequentialExecutor).addNamedListeners(function(e){e("CHECK_ERROR","extractError",function t(e){var t=e.request._waiter;var r=t.checkError(e);if(!r){t.setError(e,r===null?false:true)}else{e.error=null;e.request.removeAllListeners("extractData")}});e("CHECK_ERR_OUTPUT","extractData",function r(e){e.request._waiter.setError(e,true)})})},wait:function a(e,t){if(typeof e==="function"){t=e;e=undefined}var r=this.service.makeRequest(this.config.operation,e);var n=this.Listeners[this.config.successType];r._waiter=this;r.response.maxRetries=this.config.maxAttempts;r.addListeners(this.Listeners.retry); +if(n)r.addListeners(n);if(t)r.send(t);return r},setError:function o(e,t){e.data=null;e.error=n.util.error(e.error||new Error,{code:"ResourceNotReady",message:"Resource is not in the state "+this.state,retryable:t})},checkSuccess:function u(e){if(!this.config.successPath){return e.httpResponse.statusCode<300}var t=n.util.jamespath.find(this.config.successPath,e.data);if(this.config.failureValue&&this.config.failureValue.indexOf(t)>=0){return null}if(this.expectedValue){return t===this.expectedValue}else{return t?true:false}},checkError:function f(e){return e.httpResponse.statusCode===this.config.successValue},loadWaiterConfig:function c(e,t){if(!this.service.api.waiters[e]){if(t)return;throw new n.util.error(new Error,{code:"StateNotFoundError",message:"State "+e+" not found."})}this.config=this.service.api.waiters[e];var r=this.config;(function(){r.successType=r.successType||r.acceptorType;r.successPath=r.successPath||r.acceptorPath;r.successValue=r.successValue||r.acceptorValue;r.failureType=r.failureType||r.acceptorType;r.failurePath=r.failurePath||r.acceptorPath;r.failureValue=r.failureValue||r.acceptorValue})()}})},{"./core":22}],50:[function(e,t,r){var n=e("./core");var i=n.util.inherit;n.Response=i({constructor:function s(e){this.request=e;this.data=null;this.error=null;this.retryCount=0;this.redirectCount=0;this.httpResponse=new n.HttpResponse;if(e){this.maxRetries=e.service.numRetries();this.maxRedirects=e.service.config.maxRedirects}},nextPage:function a(e){var t;var r=this.request.service;var i=this.request.operation;try{t=r.paginationConfig(i,true)}catch(s){this.error=s}if(!this.hasNextPage()){if(e)e(this.error,null);else if(this.error)throw this.error;return null}var a=n.util.copy(this.request.params);if(!this.nextPageTokens){return e?e(null,null):null}else{var o=t.inputToken;if(typeof o==="string")o=[o];for(var u=0;u-1){r.splice(i,1)}}return this},removeAllListeners:function c(e){if(e){delete this._events[e]}else{this._events={}}return this},emit:function l(e,t,r){if(!r)r=this.unhandledErrorCallback;var n=this.listeners(e);var i=n.length;this.callListeners(n,t,r);return i>0},callListeners:function h(e,t,r){if(e.length===0){r.call(this);return}var n=this,i=e.shift();if(i._isAsync){var s=function(i){if(i){r.call(n,i)}else{n.callListeners(e,t,r)}};i.apply(n,t.concat([s]))}else{try{i.apply(n,t);n.callListeners(e,t,r)}catch(a){r.call(n,a)}}},addListeners:function p(e){var t=this;if(e._events)e=e._events;n.util.each(e,function(e,r){if(typeof r==="function")r=[r];n.util.arrayEach(r,function(r){t.on(e,r)})});return t},addNamedListener:function d(e,t,r){this[e]=r;this.addListener(t,r);return this},addNamedAsyncListener:function v(e,t,r){r._isAsync=true;return this.addNamedListener(e,t,r)},addNamedListeners:function m(e){var t=this;e(function(){t.addNamedListener.apply(t,arguments)},function(){t.addNamedAsyncListener.apply(t,arguments)});return this},unhandledErrorCallback:function g(e){if(e){if(i&&this.domain instanceof i.Domain){e.domainEmitter=this;e.domain=this.domain;e.domainThrown=false;this.domain.emit("error",e)}else{throw e}}}});n.SequentialExecutor.prototype.addListener=n.SequentialExecutor.prototype.on;t.exports=n.SequentialExecutor},{"./core":22}],52:[function(e,t,r){var n=e("./core");var i=e("./model/api");var s=e("./region_config");var a=n.util.inherit;n.Service=a({constructor:function o(e){if(!this.loadServiceClass){throw n.util.error(new Error,"Service must be constructed with `new' operator")}var t=this.loadServiceClass(e||{});if(t)return new t(e);this.initialize(e)},initialize:function u(e){this.config=new n.Config(n.config);if(e)this.config.update(e,true);this.validateService();s(this);this.config.endpoint=this.endpointFromTemplate(this.config.endpoint);this.setEndpoint(this.config.endpoint)},validateService:function f(){},loadServiceClass:function c(e){var t=e;if(!n.util.isEmpty(this.api)){return null}else if(t.apiConfig){return n.Service.defineServiceApi(this.constructor,t.apiConfig)}else if(!this.constructor.services){return null}else{t=new n.Config(n.config);t.update(e,true);var r=t.apiVersions[this.constructor.serviceIdentifier];r=r||t.apiVersion;return this.getLatestServiceClass(r)}},getLatestServiceClass:function l(e){e=this.getLatestServiceVersion(e);if(this.constructor.services[e]===null){n.Service.defineServiceApi(this.constructor,e)}return this.constructor.services[e]},getLatestServiceVersion:function h(e){if(!this.constructor.services||this.constructor.services.length===0){throw new Error("No services defined on "+this.constructor.serviceIdentifier)}if(!e){e="latest"}else if(n.util.isType(e,Date)){e=n.util.date.iso8601(e).split("T")[0]}if(Object.hasOwnProperty(this.constructor.services,e)){return e}var t=Object.keys(this.constructor.services).sort();var r=null;for(var i=t.length-1;i>=0;i--){if(t[i][t[i].length-1]!=="*"){r=t[i]}if(t[i].substr(0,10)<=e){return r}}throw new Error("Could not find "+this.constructor.serviceIdentifier+" API to satisfy version constraint `"+e+"'")},api:{},defaultRetryCount:3,makeRequest:function p(e,t,r){if(typeof t==="function"){r=t;t=null}t=t||{};if(this.config.params){var i=this.api.operations[e];if(i){t=n.util.copy(t);n.util.each(this.config.params,function(e,r){if(i.input.members[e]){if(t[e]===undefined||t[e]===null){t[e]=r}}})}}var s=new n.Request(this,e,t);this.addAllRequestListeners(s);if(r)s.send(r);return s},makeUnauthenticatedRequest:function d(e,t,r){if(typeof t==="function"){r=t;t={}}var n=this.makeRequest(e,t).toUnauthenticated();return r?n.send(r):n},waitFor:function v(e,t,r){var i=new n.ResourceWaiter(this,e);return i.wait(t,r)},addAllRequestListeners:function m(e){var t=[n.events,n.EventListeners.Core,this.serviceInterface(),n.EventListeners.CorePost];for(var r=0;r=500)return true;return false},networkingError:function R(e){return e.code==="NetworkingError"},expiredCredentialsError:function A(e){return e.code==="ExpiredTokenException"},throttledError:function C(e){return e.code==="ProvisionedThroughputExceededException"},endpointFromTemplate:function q(e){if(typeof e!=="string")return e;var t=e;t=t.replace(/\{service\}/g,this.api.endpointPrefix);t=t.replace(/\{region\}/g,this.config.region);t=t.replace(/\{scheme\}/g,this.config.sslEnabled?"https":"http");return t},setEndpoint:function T(e){this.endpoint=new n.Endpoint(e,this.config)},paginationConfig:function _(e,t){var r=this.api.operations[e].paginator;if(!r){if(t){var i=new Error;throw n.util.error(i,"No pagination configuration for "+e)}return null}return r}});n.util.update(n.Service,{defineMethods:function L(e){n.util.each(e.prototype.api.operations,function t(r){if(e.prototype[r])return;e.prototype[r]=function(e,t){return this.makeRequest(r,e,t)}})},defineService:function I(e,t,r){if(!Array.isArray(t)){r=t;t=[]}var i=a(n.Service,r||{});if(typeof e==="string"){n.Service.addVersions(i,t);var s=i.serviceIdentifier||e;i.serviceIdentifier=s}else{i.prototype.api=e;n.Service.defineMethods(i)}return i},addVersions:function P(e,t){if(!Array.isArray(t))t=[t];e.services=e.services||{};for(var r=0;r604800){var r="Presigning does not support expiry time greater "+"than a week with SigV4 signing.";throw n.util.error(new Error,{code:"InvalidExpiryTime",message:r,retryable:false})}e.httpRequest.headers[s]=t}else if(e.service.getSignerClass()===n.Signers.S3){e.httpRequest.headers[s]=parseInt(n.util.date.unixTimestamp()+t,10).toString()}else{throw n.util.error(new Error,{message:"Presigning only supports S3 or SigV4 signing.",code:"UnsupportedSigner",retryable:false})}}function o(e){var t=e.httpRequest.endpoint;var r=n.util.urlParse(e.httpRequest.path);var i={};if(r.search){i=n.util.queryStringParse(r.search.substr(1))}n.util.each(e.httpRequest.headers,function(e,t){if(e===s)e="Expires";i[e]=t});delete e.httpRequest.headers[s];var a=i["Authorization"].split(" ");if(a[0]==="AWS"){a=a[1].split(":");i["AWSAccessKeyId"]=a[0];i["Signature"]=a[1]}else if(a[0]==="AWS4-HMAC-SHA256"){a.shift();var o=a.join(" ");var u=o.match(/Signature=(.*?)(?:,|\s|\r?\n|$)/)[1];i["X-Amz-Signature"]=u;delete i["Expires"]}delete i["Authorization"];delete i["Host"];t.pathname=r.pathname;t.search=n.util.queryParamsToString(i)}n.Signers.Presign=i({sign:function u(e,t,r){e.httpRequest.headers[s]=t||3600;e.on("build",a);e.on("sign",o);e.removeListener("afterBuild",n.EventListeners.Core.SET_CONTENT_LENGTH);e.emit("beforePresign",[e]);if(r){e.build(function(){if(this.response.error)r(this.response.error);else{r(null,n.util.urlFormat(e.httpRequest.endpoint))}})}else{e.build();return n.util.urlFormat(e.httpRequest.endpoint)}}});t.exports=n.Signers.Presign},{"../core":22}],54:[function(e,t,r){var n=e("../core");var i=n.util.inherit;n.Signers.RequestSigner=i({constructor:function s(e){this.request=e}});n.Signers.RequestSigner.getVersion=function a(e){switch(e){case"v2":return n.Signers.V2;case"v3":return n.Signers.V3;case"v4":return n.Signers.V4;case"s3":return n.Signers.S3;case"v3https":return n.Signers.V3Https}throw new Error("Unknown signing version "+e)};e("./v2");e("./v3");e("./v3https");e("./v4");e("./s3");e("./presign")},{"../core":22,"./presign":53,"./s3":55,"./v2":56,"./v3":57,"./v3https":58,"./v4":59}],55:[function(e,t,r){var n=e("../core");var i=n.util.inherit;n.Signers.S3=i(n.Signers.RequestSigner,{subResources:{acl:1,cors:1,lifecycle:1,"delete":1,location:1,logging:1,notification:1,partNumber:1,policy:1,requestPayment: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 s(e,t){if(!this.request.headers["presigned-expires"]){this.request.headers["X-Amz-Date"]=n.util.date.rfc822(t)}if(e.sessionToken){this.request.headers["x-amz-security-token"]=e.sessionToken}var r=this.sign(e.secretAccessKey,this.stringToSign());var i="AWS "+e.accessKeyId+":"+r;this.request.headers["Authorization"]=i},stringToSign:function a(){var e=this.request;var t=[];t.push(e.method);t.push(e.headers["Content-MD5"]||"");t.push(e.headers["Content-Type"]||"");t.push(e.headers["presigned-expires"]||"");var r=this.canonicalizedAmzHeaders();if(r)t.push(r);t.push(this.canonicalizedResource());return t.join("\n")},canonicalizedAmzHeaders:function o(){var e=[];n.util.each(this.request.headers,function(t){if(t.match(/^x-amz-/i))e.push(t)});e.sort(function(e,t){return e.toLowerCase()=0?"&":"?";this.request.path+=s+n.util.queryParamsToString(i)},authorization:function h(e,t){var r=[];var n=this.credentialString(t);r.push(this.algorithm+" Credential="+e.accessKeyId+"/"+n);r.push("SignedHeaders="+this.signedHeaders());r.push("Signature="+this.signature(e,t));return r.join(", ")},signature:function p(e,t){var r=s[this.serviceName];var i=t.substr(0,8);if(!r||r.akid!==e.accessKeyId||r.region!==this.request.region||r.date!==i){var a=e.secretAccessKey;var o=n.util.crypto.hmac("AWS4"+a,i,"buffer");var u=n.util.crypto.hmac(o,this.request.region,"buffer");var f=n.util.crypto.hmac(u,this.serviceName,"buffer");var c=n.util.crypto.hmac(f,"aws4_request","buffer");s[this.serviceName]={region:this.request.region,date:i,key:c,akid:e.accessKeyId}}var l=s[this.serviceName].key;return n.util.crypto.hmac(l,this.stringToSign(t),"hex")},stringToSign:function d(e){var t=[];t.push("AWS4-HMAC-SHA256");t.push(e);t.push(this.credentialString(e));t.push(this.hexEncodedHash(this.canonicalString()));return t.join("\n")},canonicalString:function v(){var e=[],t=this.request.pathname();if(this.serviceName!=="s3")t=n.util.uriEscapePath(t);e.push(this.request.method);e.push(t);e.push(this.request.search());e.push(this.canonicalHeaders()+"\n");e.push(this.signedHeaders());e.push(this.hexEncodedBodyHash());return e.join("\n")},canonicalHeaders:function m(){var e=[];n.util.each.call(this,this.request.headers,function(t,r){e.push([t,r])});e.sort(function(e,t){return e[0].toLowerCase()0){r=n;return s.abort}});return r},find:function q(e,t){return s.jamespath.query(e,t)[0]}},date:{getDate:function T(){return new Date},iso8601:function _(e){if(e===undefined){e=s.date.getDate()}return e.toISOString()},rfc822:function L(e){if(e===undefined){e=s.date.getDate()}return e.toUTCString()},unixTimestamp:function I(e){if(e===undefined){e=s.date.getDate()}return e.getTime()/1e3},from:function P(e){if(typeof e==="number"){return new Date(e*1e3)}else{return new Date(e)}},format:function j(e,t){if(!t)t="iso8601";return s.date[t](s.date.from(e))},parseTimestamp:function k(e){if(typeof e==="number"){return new Date(e*1e3)}else if(e.match(/^\d+$/)){return new Date(e*1e3)}else if(e.match(/^\d{4}/)){return new Date(e)}else if(e.match(/^\w{3},/)){return new Date(e)}else{throw s.error(new Error("unhandled timestamp format: "+e),{code:"TimestampParserError"})}}},crypto:{crc32Table:[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],crc32:function O(e){var t=s.crypto.crc32Table;var r=0^-1;if(typeof e==="string"){e=new i(e)}for(var n=0;n>>8^t[(r^a)&255]}return(r^-1)>>>0},hmac:function N(e,t,r,s){if(!r)r="binary";if(r==="buffer"){r=undefined}if(!s)s="sha256";if(typeof t==="string")t=new i(t);return n.createHmac(s,e).update(t).digest(r)},md5:function D(e,t){if(!t){t="binary"}if(t==="buffer"){t=undefined}if(typeof e==="string")e=new i(e);return s.crypto.createHash("md5").update(e).digest(t)},sha256:function B(e,t){if(!t){t="binary"}if(t==="buffer"){t=undefined}if(typeof e==="string")e=new i(e);return s.crypto.createHash("sha256").update(e).digest(t)},toHex:function U(e){var t=[];for(var r=0;r/)){throw new Error("Invalid CDATA text: "+t)}r=new e(this,"",{},"");this.children.push(r);return this};e.prototype.comment=function(t){var r;if(!(t!=null)){throw new Error("Missing comment text")}t=""+t||"";t=this.escape(t);this.assertLegalChar(t);if(t.match(/--/)){throw new Error("Comment text cannot contain double-hypen: "+t)}r=new e(this,"",{},"");this.children.push(r);return this};e.prototype.raw=function(t){var r;if(!(t!=null)){throw new Error("Missing raw text")}t=""+t||"";r=new e(this,"",{},t);this.children.push(r);return this};e.prototype.up=function(){if(this.isRoot){throw new Error("This node has no parent. Use doc() if you need to get the document object.")}return this.parent};e.prototype.root=function(){var e;if(this.isRoot){return this}e=this.parent;while(!e.isRoot){e=e.parent}return e};e.prototype.document=function(){return this.root().documentObject};e.prototype.end=function(e){return this.document().toString(e)};e.prototype.prev=function(){var e;if(this.isRoot){throw new Error("Root node has no siblings")}e=this.parent.children.indexOf(this);if(e<1){throw new Error("Already at the first node")}return this.parent.children[e-1]};e.prototype.next=function(){var e;if(this.isRoot){throw new Error("Root node has no siblings")}e=this.parent.children.indexOf(this);if(e===-1||e===this.parent.children.length-1){throw new Error("Already at the last node")}return this.parent.children[e+1]};e.prototype.clone=function(t){var r;r=new e(this.parent,this.name,this.attributes,this.value);if(t){this.children.forEach(function(e){var n;n=e.clone(t);n.parent=r;return r.children.push(n)})}return r};e.prototype.importXMLBuilder=function(e){var t;t=e.root().clone(true);t.parent=this;this.children.push(t);t.isRoot=false;return this};e.prototype.attribute=function(e,t){var r;if(!(e!=null)){throw new Error("Missing attribute name")}if(!(t!=null)){throw new Error("Missing attribute value")}e=""+e||"";t=""+t||"";if((r=this.attributes)==null){this.attributes={}}this.attributes[e]=this.escape(t);return this};e.prototype.removeAttribute=function(e){if(!(e!=null)){throw new Error("Missing attribute name")}e=""+e||"";delete this.attributes[e];return this};e.prototype.toString=function(e,t){var r,n,i,s,a,o,u,f,c,l,h,p;o=e!=null&&e.pretty||false;s=e!=null&&e.indent||" ";a=e!=null&&e.newline||"\n";t||(t=0);f=new Array(t+1).join(s);u="";if(o){u+=f}if(!(this.value!=null)){u+="<"+this.name}else{u+=""+this.value}h=this.attributes;for(r in h){n=h[r];if(this.name==="!DOCTYPE"){u+=" "+n}else{u+=" "+r+'="'+n+'"'}}if(this.children.length===0){if(!(this.value!=null)){u+=this.name==="?xml"?"?>":this.name==="!DOCTYPE"?">":"/>"}if(o){u+=a}}else if(o&&this.children.length===1&&this.children[0].value){u+=">";u+=this.children[0].value;u+="";u+=a}else{u+=">";if(o){u+=a}p=this.children;for(c=0,l=p.length;c";if(o){u+=a}}return u};e.prototype.escape=function(e){return e.replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")};e.prototype.assertLegalChar=function(e){var t,r;t=/[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uD800-\uDFFF\uFFFE-\uFFFF]/;r=e.match(t);if(r){throw new Error("Invalid character ("+r+") in string: "+e)}};e.prototype.is=function(e,t){var r;r=Object.prototype.toString.call(e).slice(8,-1);return e!=null&&r===t};e.prototype.ele=function(e,t,r){return this.element(e,t,r)};e.prototype.txt=function(e){return this.text(e)};e.prototype.dat=function(e){return this.cdata(e)};e.prototype.att=function(e,t){return this.attribute(e,t)};e.prototype.com=function(e){return this.comment(e)};e.prototype.doc=function(){return this.document()};e.prototype.e=function(e,t,r){return this.element(e,t,r)};e.prototype.t=function(e){return this.text(e)};e.prototype.d=function(e){return this.cdata(e)};e.prototype.a=function(e,t){return this.attribute(e,t)};e.prototype.c=function(e){return this.comment(e)};e.prototype.r=function(e){return this.raw(e)};e.prototype.u=function(){return this.up()};return e}();t.exports=e}).call(this)},{}],66:[function(e,t,r){(function(){var r;r=e("./XMLBuilder");t.exports.create=function(e,t,n){if(e!=null){return new r(e,t,n).root()}else{return new r}}}).call(this)},{"./XMLBuilder":64}]},{},[20]);;AWS.CloudWatch=AWS.Service.defineService("cloudwatch"); +AWS.Service.defineServiceApi(AWS.CloudWatch, "2010-08-01", {"metadata":{"apiVersion":"2010-08-01","endpointPrefix":"monitoring","serviceAbbreviation":"CloudWatch","serviceFullName":"Amazon CloudWatch","signatureVersion":"v4","xmlNamespace":"http://monitoring.amazonaws.com/doc/2010-08-01/","protocol":"query"},"operations":{"DeleteAlarms":{"input":{"type":"structure","required":["AlarmNames"],"members":{"AlarmNames":{"shape":"S2"}}}},"DescribeAlarmHistory":{"input":{"type":"structure","members":{"AlarmName":{},"HistoryItemType":{},"StartDate":{"type":"timestamp"},"EndDate":{"type":"timestamp"},"MaxRecords":{"type":"integer"},"NextToken":{}}},"output":{"resultWrapper":"DescribeAlarmHistoryResult","type":"structure","members":{"AlarmHistoryItems":{"type":"list","member":{"type":"structure","members":{"AlarmName":{},"Timestamp":{"type":"timestamp"},"HistoryItemType":{},"HistorySummary":{},"HistoryData":{}}}},"NextToken":{}}}},"DescribeAlarms":{"input":{"type":"structure","members":{"AlarmNames":{"shape":"S2"},"AlarmNamePrefix":{},"StateValue":{},"ActionPrefix":{},"MaxRecords":{"type":"integer"},"NextToken":{}}},"output":{"resultWrapper":"DescribeAlarmsResult","type":"structure","members":{"MetricAlarms":{"shape":"Sj"},"NextToken":{}}}},"DescribeAlarmsForMetric":{"input":{"type":"structure","required":["MetricName","Namespace"],"members":{"MetricName":{},"Namespace":{},"Statistic":{},"Dimensions":{"shape":"Sv"},"Period":{"type":"integer"},"Unit":{}}},"output":{"resultWrapper":"DescribeAlarmsForMetricResult","type":"structure","members":{"MetricAlarms":{"shape":"Sj"}}}},"DisableAlarmActions":{"input":{"type":"structure","required":["AlarmNames"],"members":{"AlarmNames":{"shape":"S2"}}}},"EnableAlarmActions":{"input":{"type":"structure","required":["AlarmNames"],"members":{"AlarmNames":{"shape":"S2"}}}},"GetMetricStatistics":{"input":{"type":"structure","required":["Namespace","MetricName","StartTime","EndTime","Period","Statistics"],"members":{"Namespace":{},"MetricName":{},"Dimensions":{"shape":"Sv"},"StartTime":{"type":"timestamp"},"EndTime":{"type":"timestamp"},"Period":{"type":"integer"},"Statistics":{"type":"list","member":{}},"Unit":{}}},"output":{"resultWrapper":"GetMetricStatisticsResult","type":"structure","members":{"Label":{},"Datapoints":{"type":"list","member":{"type":"structure","members":{"Timestamp":{"type":"timestamp"},"SampleCount":{"type":"double"},"Average":{"type":"double"},"Sum":{"type":"double"},"Minimum":{"type":"double"},"Maximum":{"type":"double"},"Unit":{}}}}}}},"ListMetrics":{"input":{"type":"structure","members":{"Namespace":{},"MetricName":{},"Dimensions":{"type":"list","member":{"type":"structure","required":["Name"],"members":{"Name":{},"Value":{}}}},"NextToken":{}}},"output":{"resultWrapper":"ListMetricsResult","type":"structure","members":{"Metrics":{"type":"list","member":{"type":"structure","members":{"Namespace":{},"MetricName":{},"Dimensions":{"shape":"Sv"}}}},"NextToken":{}}}},"PutMetricAlarm":{"input":{"type":"structure","required":["AlarmName","MetricName","Namespace","Statistic","Period","EvaluationPeriods","Threshold","ComparisonOperator"],"members":{"AlarmName":{},"AlarmDescription":{},"ActionsEnabled":{"type":"boolean"},"OKActions":{"shape":"So"},"AlarmActions":{"shape":"So"},"InsufficientDataActions":{"shape":"So"},"MetricName":{},"Namespace":{},"Statistic":{},"Dimensions":{"shape":"Sv"},"Period":{"type":"integer"},"Unit":{},"EvaluationPeriods":{"type":"integer"},"Threshold":{"type":"double"},"ComparisonOperator":{}}}},"PutMetricData":{"input":{"type":"structure","required":["Namespace","MetricData"],"members":{"Namespace":{},"MetricData":{"type":"list","member":{"type":"structure","required":["MetricName"],"members":{"MetricName":{},"Dimensions":{"shape":"Sv"},"Timestamp":{"type":"timestamp"},"Value":{"type":"double"},"StatisticValues":{"type":"structure","required":["SampleCount","Sum","Minimum","Maximum"],"members":{"SampleCount":{"type":"double"},"Sum":{"type":"double"},"Minimum":{"type":"double"},"Maximum":{"type":"double"}}},"Unit":{}}}}}}},"SetAlarmState":{"input":{"type":"structure","required":["AlarmName","StateValue","StateReason"],"members":{"AlarmName":{},"StateValue":{},"StateReason":{},"StateReasonData":{}}}}},"shapes":{"S2":{"type":"list","member":{}},"Sj":{"type":"list","member":{"type":"structure","members":{"AlarmName":{},"AlarmArn":{},"AlarmDescription":{},"AlarmConfigurationUpdatedTimestamp":{"type":"timestamp"},"ActionsEnabled":{"type":"boolean"},"OKActions":{"shape":"So"},"AlarmActions":{"shape":"So"},"InsufficientDataActions":{"shape":"So"},"StateValue":{},"StateReason":{},"StateReasonData":{},"StateUpdatedTimestamp":{"type":"timestamp"},"MetricName":{},"Namespace":{},"Statistic":{},"Dimensions":{"shape":"Sv"},"Period":{"type":"integer"},"Unit":{},"EvaluationPeriods":{"type":"integer"},"Threshold":{"type":"double"},"ComparisonOperator":{}}}},"So":{"type":"list","member":{}},"Sv":{"type":"list","member":{"type":"structure","required":["Name","Value"],"members":{"Name":{},"Value":{}}}}},"paginators":{"DescribeAlarmHistory":{"input_token":"NextToken","output_token":"NextToken","limit_key":"MaxRecords","result_key":"AlarmHistoryItems"},"DescribeAlarms":{"input_token":"NextToken","output_token":"NextToken","limit_key":"MaxRecords","result_key":"MetricAlarms"},"DescribeAlarmsForMetric":{"result_key":"MetricAlarms"},"ListMetrics":{"input_token":"NextToken","output_token":"NextToken","result_key":"Metrics"}}}); AWS.DynamoDB=AWS.Service.defineService("dynamodb");AWS.util.update(AWS.DynamoDB.prototype,{setupRequestListeners:function e(r){if(r.service.config.dynamoDbCrc32){r.addListener("extractData",this.checkCrc32)}},checkCrc32:function r(e){if(!e.request.service.crc32IsValid(e)){e.error=AWS.util.error(new Error,{code:"CRC32CheckFailed",message:"CRC32 integrity check failed",retryable:true})}},crc32IsValid:function t(e){var r=e.httpResponse.headers["x-amz-crc32"];if(!r)return true;return parseInt(r,10)===AWS.util.crypto.crc32(e.httpResponse.body)},defaultRetryCount:10,retryDelays:function c(){var e=this.numRetries();var r=[];for(var t=0;t + + You can also download this package by clicking the following link: -[aws-sdk-2.0.5.min.js](https://sdk.amazonaws.com/js/aws-sdk-2.0.5.min.js) +[aws-sdk-2.0.6.min.js](https://sdk.amazonaws.com/js/aws-sdk-2.0.6.min.js) Once the SDK is loaded in your page, the module will be available from the global variable `AWS` (or `window.AWS`). diff --git a/lib/core.js b/lib/core.js index 08d56bd0b5..5701fe4acb 100644 --- a/lib/core.js +++ b/lib/core.js @@ -17,7 +17,7 @@ AWS.util.update(AWS, { /** * @constant */ - VERSION: '2.0.5', + VERSION: '2.0.6', /** * @api private diff --git a/package.json b/package.json index a373f14108..47b344bdb9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "aws-sdk", "description": "AWS SDK for JavaScript", - "version": "2.0.5", + "version": "2.0.6", "author": { "name":"Amazon Web Services", "email":"",