u?u:s+16383));return 1===r?(t=e[n-1],i+=c[t>>2],i+=c[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=c[t>>10],i+=c[t>>4&63],i+=c[t<<2&63],i+="="),o.push(i),o.join("")}n.byteLength=i,n.toByteArray=o,n.fromByteArray=u;for(var c=[],l=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,p=h.length;d0;){var t=e.shift();if("function"==typeof t){var n=e.shift(),r=e.shift();t.call(n,r)}else t._settlePromises()}},r.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},r.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},r.prototype._reset=function(){this._isTickUsed=!1},t.exports=r,t.exports.firstLineError=u},{"./queue":26,"./schedule":29,"./util":36}],3:[function(e,t,n){"use strict";t.exports=function(e,t,n,r){var i=!1,o=function(e,t){this._reject(t)},s=function(e,t){t.promiseRejectionQueued=!0,t.bindingPromise._then(o,o,null,this,e)},a=function(e,t){0==(50397184&this._bitField)&&this._resolveCallback(t.target)},u=function(e,t){t.promiseRejectionQueued||this._reject(e)};e.prototype.bind=function(o){i||(i=!0,e.prototype._propagateFrom=r.propagateFromFunction(),e.prototype._boundValue=r.boundValueFunction());var c=n(o),l=new e(t);l._propagateFrom(this,1);var f=this._target();if(l._setBoundTo(c),c instanceof e){var h={promiseRejectionQueued:!1,promise:l,target:f,bindingPromise:c};f._then(t,s,void 0,l,h),c._then(a,u,void 0,l,h),l._setOnCancel(c)}else l._resolveCallback(f);return l},e.prototype._setBoundTo=function(e){void 0!==e?(this._bitField=2097152|this._bitField,this._boundTo=e):this._bitField=-2097153&this._bitField},e.prototype._isBound=function(){return 2097152==(2097152&this._bitField)},e.bind=function(t,n){return e.resolve(n).bind(t)}}},{}],4:[function(e,t,n){"use strict";function r(){try{Promise===o&&(Promise=i)}catch(e){}return o}var i;"undefined"!=typeof Promise&&(i=Promise);var o=e("./promise")();o.noConflict=r,t.exports=o},{"./promise":22}],5:[function(e,t,n){"use strict";var r=Object.create;if(r){var i=r(null),o=r(null);i[" size"]=o[" size"]=0}t.exports=function(t){function n(e,n){var r;if(null!=e&&(r=e[n]),"function"!=typeof r){var i="Object "+a.classString(e)+" has no method '"+a.toString(n)+"'";throw new t.TypeError(i)}return r}function r(e){return n(e,this.pop()).apply(e,this)}function i(e){return e[this]}function o(e){var t=+this;return t<0&&(t=Math.max(0,t+e.length)),e[t]}var s,a=e("./util"),u=a.canEvaluate;a.isIdentifier;t.prototype.call=function(e){var t=[].slice.call(arguments,1);return t.push(e),this._then(r,void 0,void 0,t,void 0)},t.prototype.get=function(e){var t,n="number"==typeof e;if(n)t=o;else if(u){var r=s(e);t=null!==r?r:i}else t=i;return this._then(t,void 0,void 0,e,void 0)}}},{"./util":36}],6:[function(e,t,n){"use strict";t.exports=function(t,n,r,i){var o=e("./util"),s=o.tryCatch,a=o.errorObj,u=t._async;t.prototype.break=t.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var e=this,t=e;e._isCancellable();){if(!e._cancelBy(t)){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}var n=e._cancellationParent;if(null==n||!n._isCancellable()){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}e._isFollowing()&&e._followee().cancel(),e._setWillBeCancelled(),t=e,e=n}},t.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},t.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},t.prototype._cancelBy=function(e){return e===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},t.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},t.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),u.invoke(this._cancelPromises,this,void 0))},t.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},t.prototype._unsetOnCancel=function(){this._onCancelField=void 0},t.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},t.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},t.prototype._doInvokeOnCancel=function(e,t){if(o.isArray(e))for(var n=0;n=0)return o[e]}var i=!1,o=[];return e.prototype._promiseCreated=function(){},e.prototype._pushContext=function(){},e.prototype._popContext=function(){return null},e._peekContext=e.prototype._peekContext=function(){},t.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,o.push(this._trace))},t.prototype._popContext=function(){if(void 0!==this._trace){var e=o.pop(),t=e._promiseCreated;return e._promiseCreated=null,t}return null},t.CapturedTrace=null,t.create=n,t.deactivateLongStackTraces=function(){},t.activateLongStackTraces=function(){var n=e.prototype._pushContext,o=e.prototype._popContext,s=e._peekContext,a=e.prototype._peekContext,u=e.prototype._promiseCreated;t.deactivateLongStackTraces=function(){e.prototype._pushContext=n,e.prototype._popContext=o,e._peekContext=s,e.prototype._peekContext=a,e.prototype._promiseCreated=u,i=!1},i=!0,e.prototype._pushContext=t.prototype._pushContext,e.prototype._popContext=t.prototype._popContext,e._peekContext=e.prototype._peekContext=r,e.prototype._promiseCreated=function(){var e=this._peekContext();e&&null==e._promiseCreated&&(e._promiseCreated=this)}},t}},{}],9:[function(e,t,n){"use strict";t.exports=function(t,n){function r(e,t){return{promise:t}}function o(){return!1}function s(e,t,n){var r=this;try{e(t,n,function(e){if("function"!=typeof e)throw new TypeError("onCancel must be a function, got: "+L.toString(e));r._attachCancellationCallback(e)})}catch(e){return e}}function a(e){if(!this._isCancellable())return this;var t=this._onCancel();void 0!==t?L.isArray(t)?t.push(e):this._setOnCancel([t,e]):this._setOnCancel(e)}function u(){return this._onCancelField}function c(e){this._onCancelField=e}function l(){this._cancellationParent=void 0,this._onCancelField=void 0}function f(e,t){if(0!=(1&t)){this._cancellationParent=e;var n=e._branchesRemainingToCancel;void 0===n&&(n=0),e._branchesRemainingToCancel=n+1}0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)}function h(e,t){0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)}function d(){var e=this._boundTo;return void 0!==e&&e instanceof t?e.isFulfilled()?e.value():void 0:e}function p(){this._trace=new I(this._peekContext())}function m(e,t){if(B(e)){var n=this._trace;if(void 0!==n&&t&&(n=n._parent),void 0!==n)n.attachExtraTrace(e);else if(!e.__stackCleaned__){var r=C(e);L.notEnumerableProp(e,"stack",r.message+"\n"+r.stack.join("\n")),L.notEnumerableProp(e,"__stackCleaned__",!0)}}}function v(e,t,n,r,i){if(void 0===e&&null!==t&&X){if(void 0!==i&&i._returnedNonUndefined())return;if(0==(65535&r._bitField))return;n&&(n+=" ");var o="",s="";if(t._trace){for(var a=t._trace.stack.split("\n"),u=w(a),c=u.length-1;c>=0;--c){var l=u[c];if(!z.test(l)){var f=l.match(H);f&&(o="at "+f[1]+":"+f[2]+":"+f[3]+" ");break}}if(u.length>0)for(var h=u[0],c=0;c0&&(s="\n"+a[c-1]);break}}var d="a promise was created in a "+n+"handler "+o+"but was not returned from it, see http://goo.gl/rRqMUw"+s;r._warn(d,!0,t)}}function b(e,t){var n=e+" is deprecated and will be removed in a future version.";return t&&(n+=" Use "+t+" instead."),y(n)}function y(e,n,r){if(se.warnings){var i,o=new D(e);if(n)r._attachExtraTrace(o);else if(se.longStackTraces&&(i=t._peekContext()))i.attachExtraTrace(o);else{var s=C(o);o.stack=s.message+"\n"+s.stack.join("\n")}te("warning",o)||j(o,"",!0)}}function _(e,t){for(var n=0;n=0;--a)if(r[a]===o){s=a;break}for(var a=s;a>=0;--a){var u=r[a];if(t[i]!==u)break;t.pop(),i--}t=r}}function w(e){for(var t=[],n=0;n0&&"SyntaxError"!=e.name&&(t=t.slice(n)),t}function C(e){var t=e.stack,n=e.toString();return t="string"==typeof t&&t.length>0?x(e):[" (No stack trace)"],{message:n,stack:"SyntaxError"==e.name?t:w(t)}}function j(e,t,n){if("undefined"!=typeof console){var r;if(L.isObject(e)){var i=e.stack;r=t+V(i,e)}else r=t+String(e);"function"==typeof F?F(r,n):"function"!=typeof console.log&&"object"!=typeof console.log||console.log(r)}}function E(e,t,n,r){var i=!1;try{"function"==typeof t&&(i=!0,"rejectionHandled"===e?t(r):t(n,r))}catch(e){N.throwLater(e)}"unhandledRejection"===e?te(e,n,r)||i||j(n,"Unhandled rejection "):te(e,r)}function S(e){var t;if("function"==typeof e)t="[function "+(e.name||"anonymous")+"]";else{t=e&&"function"==typeof e.toString?e.toString():L.toString(e);if(/\[object [a-zA-Z0-9$_]+\]/.test(t))try{t=JSON.stringify(e)}catch(e){}0===t.length&&(t="(empty array)")}return"(<"+T(t)+">, no stack trace)"}function T(e){return e.length<41?e:e.substr(0,38)+"..."}function R(){return"function"==typeof oe}function A(e){var t=e.match(ie);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function P(e,t){if(R()){for(var n,r,i=e.stack.split("\n"),o=t.stack.split("\n"),s=-1,a=-1,u=0;u=a||(re=function(e){if(q.test(e))return!0;var t=A(e);return!!(t&&t.fileName===n&&s<=t.line&&t.line<=a)})}}function I(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);oe(this,I),t>32&&this.uncycle()}var O,M,F,U=t._getDomain,N=t._async,D=e("./errors").Warning,L=e("./util"),B=L.canAttachTrace,q=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,z=/\((?:timers\.js):\d+:\d+\)/,H=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,W=null,V=null,G=!1,J=!(0==L.env("BLUEBIRD_DEBUG")),$=!(0==L.env("BLUEBIRD_WARNINGS")||!J&&!L.env("BLUEBIRD_WARNINGS")),K=!(0==L.env("BLUEBIRD_LONG_STACK_TRACES")||!J&&!L.env("BLUEBIRD_LONG_STACK_TRACES")),X=0!=L.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&($||!!L.env("BLUEBIRD_W_FORGOTTEN_RETURN"));t.prototype.suppressUnhandledRejections=function(){var e=this._target();e._bitField=-1048577&e._bitField|524288},t.prototype._ensurePossibleRejectionHandled=function(){0==(524288&this._bitField)&&(this._setRejectionIsUnhandled(),N.invokeLater(this._notifyUnhandledRejection,this,void 0))},t.prototype._notifyUnhandledRejectionIsHandled=function(){E("rejectionHandled",O,void 0,this)},t.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},t.prototype._returnedNonUndefined=function(){return 0!=(268435456&this._bitField)},t.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var e=this._settledValue();this._setUnhandledRejectionIsNotified(),E("unhandledRejection",M,e,this)}},t.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},t.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},t.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},t.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},t.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},t.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},t.prototype._warn=function(e,t,n){return y(e,t,n||this)},t.onPossiblyUnhandledRejection=function(e){var t=U();M="function"==typeof e?null===t?e:L.domainBind(t,e):void 0},t.onUnhandledRejectionHandled=function(e){var t=U();O="function"==typeof e?null===t?e:L.domainBind(t,e):void 0};var Q=function(){};t.longStackTraces=function(){if(N.haveItemsQueued()&&!se.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!se.longStackTraces&&R()){var e=t.prototype._captureStackTrace,r=t.prototype._attachExtraTrace;se.longStackTraces=!0,Q=function(){if(N.haveItemsQueued()&&!se.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");t.prototype._captureStackTrace=e,t.prototype._attachExtraTrace=r,n.deactivateLongStackTraces(),N.enableTrampoline(),se.longStackTraces=!1},t.prototype._captureStackTrace=p,t.prototype._attachExtraTrace=m,n.activateLongStackTraces(),N.disableTrampolineIfNecessary()}},t.hasLongStackTraces=function(){return se.longStackTraces&&R()};var Y=function(){try{if("function"==typeof CustomEvent){var e=new CustomEvent("CustomEvent");return L.global.dispatchEvent(e),function(e,t){var n=new CustomEvent(e.toLowerCase(),{detail:t,cancelable:!0});return!L.global.dispatchEvent(n)}}if("function"==typeof Event){var e=new Event("CustomEvent");return L.global.dispatchEvent(e),function(e,t){var n=new Event(e.toLowerCase(),{cancelable:!0});return n.detail=t,!L.global.dispatchEvent(n)}}var e=document.createEvent("CustomEvent");return e.initCustomEvent("testingtheevent",!1,!0,{}),L.global.dispatchEvent(e),function(e,t){var n=document.createEvent("CustomEvent");return n.initCustomEvent(e.toLowerCase(),!1,!0,t),!L.global.dispatchEvent(n)}}catch(e){}return function(){return!1}}(),Z=function(){return L.isNode?function(){return i.emit.apply(i,arguments)}:L.global?function(e){var t="on"+e.toLowerCase(),n=L.global[t];return!!n&&(n.apply(L.global,[].slice.call(arguments,1)),!0)}:function(){return!1}}(),ee={promiseCreated:r,promiseFulfilled:r,promiseRejected:r,promiseResolved:r,promiseCancelled:r,promiseChained:function(e,t,n){return{promise:t,child:n}},warning:function(e,t){return{warning:t}},unhandledRejection:function(e,t,n){return{reason:t,promise:n}},rejectionHandled:r},te=function(e){var t=!1;try{t=Z.apply(null,arguments)}catch(e){N.throwLater(e),t=!0}var n=!1;try{n=Y(e,ee[e].apply(null,arguments))}catch(e){N.throwLater(e),n=!0}return n||t};t.config=function(e){if(e=Object(e),"longStackTraces"in e&&(e.longStackTraces?t.longStackTraces():!e.longStackTraces&&t.hasLongStackTraces()&&Q()),"warnings"in e){var n=e.warnings;se.warnings=!!n,X=se.warnings,L.isObject(n)&&"wForgottenReturn"in n&&(X=!!n.wForgottenReturn)}if("cancellation"in e&&e.cancellation&&!se.cancellation){if(N.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");t.prototype._clearCancellationData=l,t.prototype._propagateFrom=f,t.prototype._onCancel=u,t.prototype._setOnCancel=c,t.prototype._attachCancellationCallback=a,t.prototype._execute=s,ne=f,se.cancellation=!0}return"monitoring"in e&&(e.monitoring&&!se.monitoring?(se.monitoring=!0,t.prototype._fireEvent=te):!e.monitoring&&se.monitoring&&(se.monitoring=!1,t.prototype._fireEvent=o)),t},t.prototype._fireEvent=o,t.prototype._execute=function(e,t,n){try{e(t,n)}catch(e){return e}},t.prototype._onCancel=function(){},t.prototype._setOnCancel=function(e){},t.prototype._attachCancellationCallback=function(e){},t.prototype._captureStackTrace=function(){},t.prototype._attachExtraTrace=function(){},t.prototype._clearCancellationData=function(){},t.prototype._propagateFrom=function(e,t){};var ne=h,re=function(){return!1},ie=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;L.inherits(I,Error),n.CapturedTrace=I,I.prototype.uncycle=function(){var e=this._length;if(!(e<2)){for(var t=[],n={},r=0,i=this;void 0!==i;++r)t.push(i),i=i._parent;e=this._length=r;for(var r=e-1;r>=0;--r){var o=t[r].stack;void 0===n[o]&&(n[o]=r)}for(var r=0;r0&&(t[a-1]._parent=void 0,t[a-1]._length=1),t[r]._parent=void 0,t[r]._length=1;var u=r>0?t[r-1]:this;a=0;--l)t[l]._length=c,c++;return}}}},I.prototype.attachExtraTrace=function(e){if(!e.__stackCleaned__){this.uncycle();for(var t=C(e),n=t.message,r=[t.stack],i=this;void 0!==i;)r.push(w(i.stack.split("\n"))),i=i._parent;k(r),g(r),L.notEnumerableProp(e,"stack",_(n,r)),L.notEnumerableProp(e,"__stackCleaned__",!0)}};var oe=function(){var e=function(e,t){return"string"==typeof e?e:void 0!==t.name&&void 0!==t.message?t.toString():S(t)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,W=/^\s*at\s*/,V=e;var t=Error.captureStackTrace;return re=function(e){return q.test(e)},function(e,n){Error.stackTraceLimit+=6,t(e,n),Error.stackTraceLimit-=6}}var n=new Error;if("string"==typeof n.stack&&n.stack.split("\n")[0].indexOf("stackDetection@")>=0)return W=/@/,V=e,G=!0,function(e){e.stack=(new Error).stack};var r;try{throw new Error}catch(e){r="stack"in e}return"stack"in n||!r||"number"!=typeof Error.stackTraceLimit?(V=function(e,t){return"string"==typeof e?e:"object"!=typeof t&&"function"!=typeof t||void 0===t.name||void 0===t.message?S(t):t.toString()},null):(W=/^\s*at\s*/,V=e,function(e){Error.stackTraceLimit+=6;try{throw new Error}catch(t){e.stack=t.stack}Error.stackTraceLimit-=6})}();"undefined"!=typeof console&&void 0!==console.warn&&(F=function(e){console.warn(e)},L.isNode&&i.stderr.isTTY?F=function(e,t){var n=t?"\x1b[33m":"\x1b[31m";console.warn(n+e+"\x1b[0m\n")}:L.isNode||"string"!=typeof(new Error).stack||(F=function(e,t){console.warn("%c"+e,t?"color: darkorange":"color: red")}));var se={warnings:$,longStackTraces:!1,cancellation:!1,monitoring:!1};return K&&t.longStackTraces(),{longStackTraces:function(){return se.longStackTraces},warnings:function(){return se.warnings},cancellation:function(){return se.cancellation},monitoring:function(){return se.monitoring},propagateFromFunction:function(){return ne},boundValueFunction:function(){return d},checkForgottenReturns:v,setBounds:P,warn:y,deprecated:b,CapturedTrace:I,fireDomEvent:Y,fireGlobalEvent:Z}}},{"./errors":12,"./util":36}],10:[function(e,t,n){"use strict";t.exports=function(e){function t(){return this.value}function n(){throw this.reason}e.prototype.return=e.prototype.thenReturn=function(n){return n instanceof e&&n.suppressUnhandledRejections(),this._then(t,void 0,void 0,{value:n},void 0)},e.prototype.throw=e.prototype.thenThrow=function(e){return this._then(n,void 0,void 0,{reason:e},void 0)},e.prototype.catchThrow=function(e){if(arguments.length<=1)return this._then(void 0,n,void 0,{reason:e},void 0);var t=arguments[1],r=function(){throw t};return this.caught(e,r)},e.prototype.catchReturn=function(n){if(arguments.length<=1)return n instanceof e&&n.suppressUnhandledRejections(),this._then(void 0,t,void 0,{value:n},void 0);var r=arguments[1];r instanceof e&&r.suppressUnhandledRejections();var i=function(){return r};return this.caught(n,i)}}},{}],11:[function(e,t,n){"use strict";t.exports=function(e,t){function n(){return o(this)}function r(e,n){return i(e,n,t,t)}var i=e.reduce,o=e.all;e.prototype.each=function(e){return i(this,e,t,0)._then(n,void 0,void 0,this,void 0)},e.prototype.mapSeries=function(e){return i(this,e,t,t)},e.each=function(e,r){return i(e,r,t,0)._then(n,void 0,void 0,e,void 0)},e.mapSeries=r}},{}],12:[function(e,t,n){"use strict";function r(e,t){function n(r){if(!(this instanceof n))return new n(r);f(this,"message","string"==typeof r?r:t),f(this,"name",e),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return l(n,Error),n}function i(e){if(!(this instanceof i))return new i(e);f(this,"name","OperationalError"),f(this,"message",e),this.cause=e,this.isOperational=!0,e instanceof Error?(f(this,"message",e.message),f(this,"stack",e.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}var o,s,a=e("./es5"),u=a.freeze,c=e("./util"),l=c.inherits,f=c.notEnumerableProp,h=r("Warning","warning"),d=r("CancellationError","cancellation error"),p=r("TimeoutError","timeout error"),m=r("AggregateError","aggregate error");try{o=TypeError,s=RangeError}catch(e){o=r("TypeError","type error"),s=r("RangeError","range error")}for(var v="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),b=0;b1?e.cancelPromise._reject(t):e.cancelPromise._cancel(),e.cancelPromise=null,!0)}function s(){return u.call(this,this.promise._target()._settledValue())}function a(e){if(!o(this,e))return f.e=e,f}function u(e){var r=this.promise,u=this.handler;if(!this.called){this.called=!0;var c=this.isFinallyHandler()?u.call(r._boundValue()):u.call(r._boundValue(),e);if(void 0!==c){r._setReturnedNonUndefined();var h=n(c,r);if(h instanceof t){if(null!=this.cancelPromise){if(h._isCancelled()){var d=new l("late cancellation observer");return r._attachExtraTrace(d),f.e=d,f}h.isPending()&&h._attachCancellationCallback(new i(this))}return h._then(s,a,void 0,this,void 0)}}}return r.isRejected()?(o(this),f.e=e,f):(o(this),e)}var c=e("./util"),l=t.CancellationError,f=c.errorObj;return r.prototype.isFinallyHandler=function(){return 0===this.type},i.prototype._resultCancelled=function(){o(this.finallyHandler)},t.prototype._passThrough=function(e,t,n,i){return"function"!=typeof e?this.then():this._then(n,i,void 0,new r(this,t,e),void 0)},t.prototype.lastly=t.prototype.finally=function(e){return this._passThrough(e,0,u,u)},t.prototype.tap=function(e){return this._passThrough(e,1,u)},r}},{"./util":36}],16:[function(e,t,n){"use strict";t.exports=function(t,n,r,i,o,s){function a(e,n,r){for(var o=0;o0&&"function"==typeof arguments[t]){e=arguments[t];var r}var i=[].slice.call(arguments);e&&i.pop();var r=new n(i).promise();return void 0!==e?r.spread(e):r}}},{"./util":36}],18:[function(e,t,n){"use strict";t.exports=function(t,n,r,i,o,s){function a(e,t,n,r){this.constructor$(e),this._promise._captureStackTrace();var i=c();this._callback=null===i?t:l.domainBind(i,t),this._preservedValues=r===o?new Array(this.length()):null,this._limit=n,this._inFlight=0,this._queue=[],d.invoke(this._asyncInit,this,void 0)}function u(e,n,i,o){if("function"!=typeof n)return r("expecting a function but got "+l.classString(n));var s=0;if(void 0!==i){if("object"!=typeof i||null===i)return t.reject(new TypeError("options argument must be an object but it is "+l.classString(i)));if("number"!=typeof i.concurrency)return t.reject(new TypeError("'concurrency' must be a number but it is "+l.classString(i.concurrency)));s=i.concurrency}return s="number"==typeof s&&isFinite(s)&&s>=1?s:0,new a(e,n,s,o).promise()}var c=t._getDomain,l=e("./util"),f=l.tryCatch,h=l.errorObj,d=t._async;l.inherits(a,n),a.prototype._asyncInit=function(){this._init$(void 0,-2)},a.prototype._init=function(){},a.prototype._promiseFulfilled=function(e,n){var r=this._values,o=this.length(),a=this._preservedValues,u=this._limit;if(n<0){if(n=-1*n-1,r[n]=e,u>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(u>=1&&this._inFlight>=u)return r[n]=e,this._queue.push(n),!1;null!==a&&(a[n]=e);var c=this._promise,l=this._callback,d=c._boundValue();c._pushContext();var p=f(l).call(d,e,n,o),m=c._popContext();if(s.checkForgottenReturns(p,m,null!==a?"Promise.filter":"Promise.map",c),p===h)return this._reject(p.e),!0;var v=i(p,this._promise);if(v instanceof t){v=v._target();var b=v._bitField;if(0==(50397184&b))return u>=1&&this._inFlight++,r[n]=v,v._proxy(this,-1*(n+1)),!1;if(0==(33554432&b))return 0!=(16777216&b)?(this._reject(v._reason()),!0):(this._cancel(),!0);p=v._value()}r[n]=p}return++this._totalResolved>=o&&(null!==a?this._filter(r,a):this._resolve(r),!0)},a.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,n=this._values;e.length>0&&this._inFlight1){o.deprecated("calling Promise.try with more than 1 argument");var c=arguments[1],l=arguments[2];u=s.isArray(c)?a(e).apply(l,c):a(e).call(l,c)}else u=a(e)();var f=r._popContext();return o.checkForgottenReturns(u,f,"Promise.try",r),r._resolveFromSyncValue(u),r},t.prototype._resolveFromSyncValue=function(e){e===s.errorObj?this._rejectCallback(e.e,!1):this._resolveCallback(e,!0)}}},{"./util":36}],20:[function(e,t,n){"use strict";function r(e){return e instanceof Error&&l.getPrototypeOf(e)===Error.prototype}function i(e){var t;if(r(e)){t=new c(e),t.name=e.name,t.message=e.message,t.stack=e.stack;for(var n=l.keys(e),i=0;i1){var n,r=new Array(t-1),i=0;for(n=0;n0&&"function"!=typeof e&&"function"!=typeof t){var n=".then() only accepts functions but was passed: "+p.classString(e);arguments.length>1&&(n+=", "+p.classString(t)),this._warn(n)}return this._then(e,t,void 0,void 0,void 0)},o.prototype.done=function(e,t){this._then(e,t,void 0,void 0,void 0)._setIsFinal()},o.prototype.spread=function(e){return"function"!=typeof e?h("expecting a function but got "+p.classString(e)):this.all()._then(e,void 0,void 0,w,void 0)},o.prototype.toJSON=function(){var e={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(e.fulfillmentValue=this.value(),e.isFulfilled=!0):this.isRejected()&&(e.rejectionReason=this.reason(),e.isRejected=!0),e},o.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new j(this).promise()},o.prototype.error=function(e){return this.caught(p.originatesFromRejection,e)},o.getNewLibraryCopy=t.exports,o.is=function(e){return e instanceof o},o.fromNode=o.fromCallback=function(e){var t=new o(k);t._captureStackTrace();var n=arguments.length>1&&!!Object(arguments[1]).multiArgs,r=O(e)(P(t,n));return r===I&&t._rejectCallback(r.e,!0),t._isFateSealed()||t._setAsyncGuaranteed(),t},o.all=function(e){return new j(e).promise()},o.cast=function(e){var t=C(e);return t instanceof o||(t=new o(k),t._captureStackTrace(),t._setFulfilled(),t._rejectionHandler0=e),t},o.resolve=o.fulfilled=o.cast,o.reject=o.rejected=function(e){var t=new o(k);return t._captureStackTrace(),t._rejectCallback(e,!0),t},o.setScheduler=function(e){if("function"!=typeof e)throw new _("expecting a function but got "+p.classString(e));return b.setScheduler(e)},o.prototype._then=function(e,t,n,r,i){var s=void 0!==i,a=s?i:new o(k),u=this._target(),l=u._bitField;s||(a._propagateFrom(this,3),a._captureStackTrace(),void 0===r&&0!=(2097152&this._bitField)&&(r=0!=(50397184&l)?this._boundValue():u===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,a));var f=c();if(0!=(50397184&l)){var h,d,m=u._settlePromiseCtx;0!=(33554432&l)?(d=u._rejectionHandler0,h=e):0!=(16777216&l)?(d=u._fulfillmentHandler0,h=t,u._unsetRejectionIsUnhandled()):(m=u._settlePromiseLateCancellationObserver,d=new g("late cancellation observer"),u._attachExtraTrace(d),h=t),b.invoke(m,u,{handler:null===f?h:"function"==typeof h&&p.domainBind(f,h),promise:a,receiver:r,value:d})}else u._addCallbacks(e,t,a,r,f);return a},o.prototype._length=function(){return 65535&this._bitField},o.prototype._isFateSealed=function(){return 0!=(117506048&this._bitField)},o.prototype._isFollowing=function(){return 67108864==(67108864&this._bitField)},o.prototype._setLength=function(e){this._bitField=-65536&this._bitField|65535&e},o.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},o.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},o.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},o.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},o.prototype._isFinal=function(){return(4194304&this._bitField)>0},o.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},o.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},o.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},o.prototype._setAsyncGuaranteed=function(){b.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},o.prototype._receiverAt=function(e){var t=0===e?this._receiver0:this[4*e-4+3];if(t!==d)return void 0===t&&this._isBound()?this._boundValue():t},o.prototype._promiseAt=function(e){return this[4*e-4+2]},o.prototype._fulfillmentHandlerAt=function(e){return this[4*e-4+0]},o.prototype._rejectionHandlerAt=function(e){return this[4*e-4+1]},o.prototype._boundValue=function(){},o.prototype._migrateCallback0=function(e){var t=(e._bitField,e._fulfillmentHandler0),n=e._rejectionHandler0,r=e._promise0,i=e._receiverAt(0);void 0===i&&(i=d),this._addCallbacks(t,n,r,i,null)},o.prototype._migrateCallbackAt=function(e,t){var n=e._fulfillmentHandlerAt(t),r=e._rejectionHandlerAt(t),i=e._promiseAt(t),o=e._receiverAt(t);void 0===o&&(o=d),this._addCallbacks(n,r,i,o,null)},o.prototype._addCallbacks=function(e,t,n,r,i){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=n,this._receiver0=r,"function"==typeof e&&(this._fulfillmentHandler0=null===i?e:p.domainBind(i,e)),"function"==typeof t&&(this._rejectionHandler0=null===i?t:p.domainBind(i,t));else{var s=4*o-4;this[s+2]=n,this[s+3]=r,"function"==typeof e&&(this[s+0]=null===i?e:p.domainBind(i,e)),"function"==typeof t&&(this[s+1]=null===i?t:p.domainBind(i,t))}return this._setLength(o+1),o},o.prototype._proxy=function(e,t){this._addCallbacks(void 0,void 0,t,e,null)},o.prototype._resolveCallback=function(e,t){if(0==(117506048&this._bitField)){if(e===this)return this._rejectCallback(l(),!1);var n=C(e,this);if(!(n instanceof o))return this._fulfill(e);t&&this._propagateFrom(n,2);var r=n._target();if(r===this)return void this._reject(l());var i=r._bitField;if(0==(50397184&i)){var s=this._length();s>0&&r._migrateCallback0(this);for(var a=1;a>>16)){if(e===this){var n=l();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=e,(65535&t)>0&&(0!=(134217728&t)?this._settlePromises():b.settlePromises(this))}},o.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return b.fatalError(e,p.isNode);(65535&t)>0?b.settlePromises(this):this._ensurePossibleRejectionHandled()}},o.prototype._fulfillPromises=function(e,t){for(var n=1;n0){if(0!=(16842752&e)){var n=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,e),this._rejectPromises(t,n)}else{var r=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,r,e),this._fulfillPromises(t,r)}this._setLength(0)}this._clearCancellationData()},o.prototype._settledValue=function(){var e=this._bitField;return 0!=(33554432&e)?this._rejectionHandler0:0!=(16777216&e)?this._fulfillmentHandler0:void 0},o.defer=o.pending=function(){return T.deprecated("Promise.defer","new Promise"),{promise:new o(k),resolve:s,reject:a}},p.notEnumerableProp(o,"_makeSelfResolutionError",l),e("./method")(o,k,C,h,T),e("./bind")(o,k,C,T),e("./cancel")(o,j,h,T),e("./direct_resolve")(o),e("./synchronous_inspection")(o),e("./join")(o,j,C,k,b,c),o.Promise=o,o.version="3.4.7",e("./map.js")(o,j,h,C,k,T),e("./call_get.js")(o),e("./using.js")(o,h,C,S,k,T),e("./timers.js")(o,k,T),e("./generators.js")(o,h,k,C,n,T),e("./nodeify.js")(o),e("./promisify.js")(o,k),e("./props.js")(o,j,C,h),e("./race.js")(o,k,C,h),e("./reduce.js")(o,j,h,C,k,T),e("./settle.js")(o,j,T),e("./some.js")(o,j,h),e("./filter.js")(o,k),e("./each.js")(o,k),e("./any.js")(o),p.toFastProperties(o),p.toFastProperties(o.prototype),u({a:1}),u({b:2}),u({c:3}),u(1),u(function(){}),u(void 0),u(!1),u(new o(k)),T.setBounds(v.firstLineError,p.lastLineError),o}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(e,t,n){"use strict";t.exports=function(t,n,r,i,o){function s(e){switch(e){case-2:return[];case-3:return{}}}function a(e){var r=this._promise=new t(n);e instanceof t&&r._propagateFrom(e,3),r._setOnCancel(this),this._values=e,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var u=e("./util");u.isArray;return u.inherits(a,o),a.prototype.length=function(){return this._length},a.prototype.promise=function(){return this._promise},a.prototype._init=function e(n,o){var a=r(this._values,this._promise);if(a instanceof t){a=a._target();var c=a._bitField;if(this._values=a,0==(50397184&c))return this._promise._setAsyncGuaranteed(),a._then(e,this._reject,void 0,this,o);if(0==(33554432&c))return 0!=(16777216&c)?this._reject(a._reason()):this._cancel();a=a._value()}if(null===(a=u.asArray(a))){var l=i("expecting an array or an iterable object but got "+u.classString(a)).reason();return void this._promise._rejectCallback(l,!1)}if(0===a.length)return void(-5===o?this._resolveEmptyArray():this._resolve(s(o)));this._iterate(a)},a.prototype._iterate=function(e){var n=this.getActualLength(e.length);this._length=n,this._values=this.shouldCopyValues()?new Array(n):this._values;for(var i=this._promise,o=!1,s=null,a=0;a=this._length&&(this._resolve(this._values),!0)},a.prototype._promiseCancelled=function(){return this._cancel(),!0},a.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},a.prototype._resultCancelled=function(){if(!this._isResolved()){var e=this._values;if(this._cancel(),e instanceof t)e.cancel();else for(var n=0;n=this._length){var n;if(this._isMap)n=h(this._values);else{n={};for(var r=this.length(),i=0,o=this.length();i>1},t.prototype.props=function(){return s(this)},t.props=function(e){return s(e)}}},{"./es5":13,"./util":36}],26:[function(e,t,n){"use strict";function r(e,t,n,r,i){for(var o=0;o=this._length&&(this._resolve(this._values),!0)},i.prototype._promiseFulfilled=function(e,t){var n=new o;return n._bitField=33554432,n._settledValueField=e,this._promiseResolved(t,n)},i.prototype._promiseRejected=function(e,t){var n=new o;return n._bitField=16777216,n._settledValueField=e,this._promiseResolved(t,n)},t.settle=function(e){return r.deprecated(".settle()",".reflect()"),new i(e).promise()},t.prototype.settle=function(){return t.settle(this)}}},{"./util":36}],31:[function(e,t,n){"use strict";t.exports=function(t,n,r){function i(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}function o(e,t){if((0|t)!==t||t<0)return r("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var n=new i(e),o=n.promise();return n.setHowMany(t),n.init(),o}var s=e("./util"),a=e("./errors").RangeError,u=e("./errors").AggregateError,c=s.isArray,l={};s.inherits(i,n),i.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var e=c(this._values);!this._isResolved()&&e&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},i.prototype.init=function(){this._initialized=!0,this._init()},i.prototype.setUnwrap=function(){this._unwrap=!0},i.prototype.howMany=function(){return this._howMany},i.prototype.setHowMany=function(e){
this._howMany=e},i.prototype._promiseFulfilled=function(e){return this._addFulfilled(e),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},i.prototype._promiseRejected=function(e){return this._addRejected(e),this._checkOutcome()},i.prototype._promiseCancelled=function(){return this._values instanceof t||null==this._values?this._cancel():(this._addRejected(l),this._checkOutcome())},i.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var e=new u,t=this.length();t0?this._reject(e):this._cancel(),!0}return!1},i.prototype._fulfilled=function(){return this._totalResolved},i.prototype._rejected=function(){return this._values.length-this.length()},i.prototype._addRejected=function(e){this._values.push(e)},i.prototype._addFulfilled=function(e){this._values[this._totalResolved++]=e},i.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},i.prototype._getRangeError=function(e){var t="Input array must contain at least "+this._howMany+" items but contains only "+e+" items";return new a(t)},i.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},t.some=function(e,t){return o(e,t)},t.prototype.some=function(e){return o(this,e)},t._SomePromiseArray=i}},{"./errors":12,"./util":36}],32:[function(e,t,n){"use strict";t.exports=function(e){function t(e){void 0!==e?(e=e._target(),this._bitField=e._bitField,this._settledValueField=e._isFateSealed()?e._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}t.prototype._settledValue=function(){return this._settledValueField};var n=t.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},r=t.prototype.error=t.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},i=t.prototype.isFulfilled=function(){return 0!=(33554432&this._bitField)},o=t.prototype.isRejected=function(){return 0!=(16777216&this._bitField)},s=t.prototype.isPending=function(){return 0==(50397184&this._bitField)},a=t.prototype.isResolved=function(){return 0!=(50331648&this._bitField)};t.prototype.isCancelled=function(){return 0!=(8454144&this._bitField)},e.prototype.__isCancelled=function(){return 65536==(65536&this._bitField)},e.prototype._isCancelled=function(){return this._target().__isCancelled()},e.prototype.isCancelled=function(){return 0!=(8454144&this._target()._bitField)},e.prototype.isPending=function(){return s.call(this._target())},e.prototype.isRejected=function(){return o.call(this._target())},e.prototype.isFulfilled=function(){return i.call(this._target())},e.prototype.isResolved=function(){return a.call(this._target())},e.prototype.value=function(){return n.call(this._target())},e.prototype.reason=function(){var e=this._target();return e._unsetRejectionIsUnhandled(),r.call(e)},e.prototype._value=function(){return this._settledValue()},e.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},e.PromiseInspection=t}},{}],33:[function(e,t,n){"use strict";t.exports=function(t,n){function r(e,r){if(l(e)){if(e instanceof t)return e;var i=o(e);if(i===c){r&&r._pushContext();var u=t.reject(i.e);return r&&r._popContext(),u}if("function"==typeof i){if(s(e)){var u=new t(n);return e._then(u._fulfill,u._reject,void 0,u,null),u}return a(e,i,r)}}return e}function i(e){return e.then}function o(e){try{return i(e)}catch(e){return c.e=e,c}}function s(e){try{return f.call(e,"_promise0")}catch(e){return!1}}function a(e,r,i){function o(e){a&&(a._resolveCallback(e),a=null)}function s(e){a&&(a._rejectCallback(e,f,!0),a=null)}var a=new t(n),l=a;i&&i._pushContext(),a._captureStackTrace(),i&&i._popContext();var f=!0,h=u.tryCatch(r).call(e,o,s);return f=!1,a&&h===c&&(a._rejectCallback(h.e,!0,!0),a=null),l}var u=e("./util"),c=u.errorObj,l=u.isObject,f={}.hasOwnProperty;return r}},{"./util":36}],34:[function(e,t,n){"use strict";t.exports=function(t,n,r){function i(e){this.handle=e}function o(e){return clearTimeout(this.handle),e}function s(e){throw clearTimeout(this.handle),e}var a=e("./util"),u=t.TimeoutError;i.prototype._resultCancelled=function(){clearTimeout(this.handle)};var c=function(e){return l(+this).thenReturn(e)},l=t.delay=function(e,o){var s,a;return void 0!==o?(s=t.resolve(o)._then(c,null,null,e,void 0),r.cancellation()&&o instanceof t&&s._setOnCancel(o)):(s=new t(n),a=setTimeout(function(){s._fulfill()},+e),r.cancellation()&&s._setOnCancel(new i(a)),s._captureStackTrace()),s._setAsyncGuaranteed(),s};t.prototype.delay=function(e){return l(e,this)};var f=function(e,t,n){var r;r="string"!=typeof t?t instanceof Error?t:new u("operation timed out"):new u(t),a.markAsOriginatingFromRejection(r),e._attachExtraTrace(r),e._reject(r),null!=n&&n.cancel()};t.prototype.timeout=function(e,t){e=+e;var n,a,u=new i(setTimeout(function(){n.isPending()&&f(n,t,a)},e));return r.cancellation()?(a=this.then(),n=a._then(o,s,void 0,u,void 0),n._setOnCancel(u)):n=this._then(o,s,void 0,u,void 0),n}}},{"./util":36}],35:[function(e,t,n){"use strict";t.exports=function(t,n,r,i,o,s){function a(e){setTimeout(function(){throw e},0)}function u(e){var t=r(e);return t!==e&&"function"==typeof e._isDisposable&&"function"==typeof e._getDisposer&&e._isDisposable()&&t._setDisposable(e._getDisposer()),t}function c(e,n){function i(){if(s>=c)return l._fulfill();var o=u(e[s++]);if(o instanceof t&&o._isDisposable()){try{o=r(o._getDisposer().tryDispose(n),e.promise)}catch(e){return a(e)}if(o instanceof t)return o._then(i,a,null,null,null)}i()}var s=0,c=e.length,l=new t(o);return i(),l}function l(e,t,n){this._data=e,this._promise=t,this._context=n}function f(e,t,n){this.constructor$(e,t,n)}function h(e){return l.isDisposer(e)?(this.resources[this.index]._setDisposable(e),e.promise()):e}function d(e){this.length=e,this.promise=null,this[e-1]=null}var p=e("./util"),m=e("./errors").TypeError,v=e("./util").inherits,b=p.errorObj,y=p.tryCatch,_={};l.prototype.data=function(){return this._data},l.prototype.promise=function(){return this._promise},l.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():_},l.prototype.tryDispose=function(e){var t=this.resource(),n=this._context;void 0!==n&&n._pushContext();var r=t!==_?this.doDispose(t,e):null;return void 0!==n&&n._popContext(),this._promise._unsetDisposable(),this._data=null,r},l.isDisposer=function(e){return null!=e&&"function"==typeof e.resource&&"function"==typeof e.tryDispose},v(f,l),f.prototype.doDispose=function(e,t){return this.data().call(e,e,t)},d.prototype._resultCancelled=function(){for(var e=this.length,n=0;n0},t.prototype._getDisposer=function(){return this._disposer},t.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},t.prototype.disposer=function(e){if("function"==typeof e)return new f(e,this,i());throw new m}}},{"./errors":12,"./util":36}],36:[function(e,t,n){"use strict";function r(){try{var e=P;return P=null,e.apply(this,arguments)}catch(e){return A.e=e,A}}function s(e){return P=e,r}function a(e){return null==e||!0===e||!1===e||"string"==typeof e||"number"==typeof e}function u(e){return"function"==typeof e||"object"==typeof e&&null!==e}function c(e){return a(e)?new Error(y(e)):e}function l(e,t){var n,r=e.length,i=new Array(r+1);for(n=0;n1,r=t.length>0&&!(1===t.length&&"constructor"===t[0]),i=F.test(e+"")&&T.names(e).length>0;if(n||r||i)return!0}return!1}catch(e){return!1}}function m(e){function t(){}t.prototype=e;for(var n=8;n--;)new t;return e}function v(e){return U.test(e)}function b(e,t,n){for(var r=new Array(e),i=0;i10||e[0]>0}(),z.isNode&&z.toFastProperties(i);try{throw new Error}catch(e){z.lastLineError=e}t.exports=z},{"./es5":13}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:209}],62:[function(e,t,n){(function(){var n,r,i,o=function(e,t){return function(){return e.apply(t,arguments)}},s=[].slice;i=10,r=5,n=function(){function t(e,n,r,i,s){this.maxNb=null!=e?e:0,this.minTime=null!=n?n:0,this.highWater=null!=r?r:-1,this.strategy=null!=i?i:t.prototype.strategy.LEAK,this.rejectOnDrop=null!=s&&s,this.schedulePriority=o(this.schedulePriority,this),this.submitPriority=o(this.submitPriority,this),this.submit=o(this.submit,this),this._nextRequest=Date.now(),this._nbRunning=0,this._queues=this._makeQueues(),this._running={},this._nextIndex=0,this._unblockTime=0,this.penalty=15*this.minTime||5e3,this.interrupt=!1,this.reservoir=null,this.limiter=null,this.events={}}var n;return t.strategy=t.prototype.strategy={LEAK:1,OVERFLOW:2,OVERFLOW_PRIORITY:4,BLOCK:3},t.Cluster=t.prototype.Cluster=e("./Cluster"),t.DLList=t.prototype.DLList=e("./DLList"),t.Promise=t.prototype.Promise=function(){try{return e("bluebird")}catch(e){return n=e,"undefined"!=typeof Promise&&null!==Promise?Promise:function(){throw new Error("Bottleneck: install 'bluebird' or use Node 0.12 or higher for Promise support")}}}(),t.prototype._trigger=function(e,t){return this.rejectOnDrop&&"dropped"===e&&t[0].cb.apply({},[new Error("This job has been dropped by Bottleneck")]),setTimeout(function(n){return function(){var r;return null!=(r=n.events[e])?r.forEach(function(e){return e.apply({},t)}):void 0}}(this),0)},t.prototype._makeQueues=function(){var e,n,r;for(r=[],e=1,n=i;1<=n?e<=n:e>=n;1<=n?++e:--e)r.push(new t.prototype.DLList);return r},t.prototype.chain=function(e){return this.limiter=e,this},t.prototype.isBlocked=function(){return this._unblockTime>=Date.now()},t.prototype._sanitizePriority=function(e){var t;return t=~~e!==e?r:e,t<0?0:t>i-1?i-1:t},t.prototype._find=function(e,t){var n,r,i,o;for(n=r=0,i=e.length;r0})},t.prototype._conditionsCheck=function(){return(this.nbRunning()0)},t.prototype.check=function(){return this._conditionsCheck()&&this._nextRequest-Date.now()<=0},t.prototype._tryToRun=function(){var e,t,n,r,i;return!!(this._conditionsCheck()&&(r=this.nbQueued())>0)&&(this._nbRunning++,null!=this.reservoir&&this.reservoir--,i=Math.max(this._nextRequest-Date.now(),0),this._nextRequest=Date.now()+i+this.minTime,n=this._getFirst(this._queues).shift(),1===r&&this._trigger("empty",[]),e=!1,t=this._nextIndex++,this._running[t]={timeout:setTimeout(function(r){return function(){var i;return i=function(){var i;if(!e&&(e=!0,delete r._running[t],r._nbRunning--,r._tryToRun(),0===r.nbRunning()&&0===r.nbQueued()&&r._trigger("idle",[]),!r.interrupt))return null!=(i=n.cb)?i.apply({},Array.prototype.slice.call(arguments,0)):void 0},null!=r.limiter?r.limiter.submit.apply(r.limiter,Array.prototype.concat(n.task,n.args,i)):n.task.apply({},n.args.concat(i))}}(this),i),job:n},!0)},t.prototype.submit=function(){var e;return e=1<=arguments.length?s.call(arguments,0):[],this.submitPriority.apply({},Array.prototype.concat(r,e))},t.prototype.submitPriority=function(){var e,n,r,i,o,a,u,c;return o=arguments[0],c=arguments[1],e=4<=arguments.length?s.call(arguments,2,r=arguments.length-1):(r=2,[]),n=arguments[r++],i={task:c,args:e,cb:n},o=this._sanitizePriority(o),a=this.highWater>=0&&this.nbQueued()===this.highWater&&!this.check(),this.strategy===t.prototype.strategy.BLOCK&&(a||this.isBlocked())?(this._unblockTime=Date.now()+this.penalty,this._nextRequest=this._unblockTime+this.minTime,this._queues=this._makeQueues(),this._trigger("dropped",[i]),!0):a&&(u=this.strategy===t.prototype.strategy.LEAK?this._getFirst(this._queues.slice(o).reverse()).shift():this.strategy===t.prototype.strategy.OVERFLOW_PRIORITY?this._getFirst(this._queues.slice(o+1).reverse()).shift():this.strategy===t.prototype.strategy.OVERFLOW?i:void 0,null!=u&&this._trigger("dropped",[u]),null==u||this.strategy===t.prototype.strategy.OVERFLOW)?a:(this._queues[o].push(i),this._tryToRun(),a)},t.prototype.schedule=function(){var e;return e=1<=arguments.length?s.call(arguments,0):[],this.schedulePriority.apply({},Array.prototype.concat(r,e))},t.prototype.schedulePriority=function(){var e,n,r,i;return n=arguments[0],r=arguments[1],e=3<=arguments.length?s.call(arguments,2):[],i=function(){var e,t,n;return e=2<=arguments.length?s.call(arguments,0,n=arguments.length-1):(n=0,[]),t=arguments[n++],r.apply({},e).then(function(){var e;return e=1<=arguments.length?s.call(arguments,0):[],t.apply({},Array.prototype.concat(null,e))}).catch(function(){var e;return e=1<=arguments.length?s.call(arguments,0):[],t.apply({},e)})},new t.prototype.Promise(function(t){return function(r,o){return t.submitPriority.apply({},Array.prototype.concat(n,i,e,function(){var e;return e=1<=arguments.length?s.call(arguments,0):[],(null!=e[0]?o:(e.shift(),r)).apply({},e)}))}}(this))},t.prototype.changeSettings=function(e,t,n,r,i){for(this.maxNb=null!=e?e:this.maxNb,this.minTime=null!=t?t:this.minTime,this.highWater=null!=n?n:this.highWater,this.strategy=null!=r?r:this.strategy,this.rejectOnDrop=null!=i?i:this.rejectOnDrop;this._tryToRun(););return this},t.prototype.changePenalty=function(e){return this.penalty=null!=e?e:this.penalty,this},t.prototype.changeReservoir=function(e){for(this.reservoir=e;this._tryToRun(););return this},t.prototype.incrementReservoir=function(e){return null==e&&(e=0),this.changeReservoir(this.reservoir+e),this},t.prototype.on=function(e,t){return null!=this.events[e]?this.events[e].push(t):this.events[e]=[t],this},t.prototype.removeAllListeners=function(e){return null==e&&(e=null),null!=e?delete this.events[e]:this.events={},this},t.prototype.stopAll=function(e){var t,n,r,i,o,a,u;for(this.interrupt=null!=e?e:this.interrupt,i=Object.keys(this._running),t=0,a=i.length;t
* @license MIT
*/
"use strict";function r(e){if(e>K)throw new RangeError("Invalid typed array length");var t=new Uint8Array(e);return t.__proto__=i.prototype,t}function i(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return u(e)}return o(e,t,n)}function o(e,t,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return e instanceof ArrayBuffer?f(e,t,n):"string"==typeof e?c(e,t):h(e)}function s(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function a(e,t,n){return s(e),e<=0?r(e):void 0!==t?"string"==typeof n?r(e).fill(t,n):r(e).fill(t):r(e)}function u(e){return s(e),r(e<0?0:0|d(e))}function c(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!i.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var n=0|m(e,t),o=r(n),s=o.write(e,t);return s!==n&&(o=o.slice(0,s)),o}function l(e){for(var t=e.length<0?0:0|d(e.length),n=r(t),i=0;i=K)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+K.toString(16)+" bytes");return 0|e}function p(e){return+e!=e&&(e=0),i.alloc(+e)}function m(e,t){if(i.isBuffer(e))return e.length;if(V(e)||e instanceof ArrayBuffer)return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return H(e).length;default:if(r)return B(e).length;t=(""+t).toLowerCase(),r=!0}}function v(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,t>>>=0,n<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,n);case"utf8":case"utf-8":return S(this,t,n);case"ascii":return R(this,t,n);case"latin1":case"binary":return A(this,t,n);case"base64":return E(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function b(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,G(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=i.from(t,r)),i.isBuffer(t))return 0===t.length?-1:_(e,t,n,r,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):_(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function _(e,t,n,r,i){function o(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}var s=1,a=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,n/=2}var c;if(i){var l=-1;for(c=n;ca&&(n=a-u),c=n;c>=0;c--){for(var f=!0,h=0;hi&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s239?4:o>223?3:o>191?2:1;if(i+a<=n){var u,c,l,f;switch(a){case 1:o<128&&(s=o);break;case 2:u=e[i+1],128==(192&u)&&(f=(31&o)<<6|63&u)>127&&(s=f);break;case 3:u=e[i+1],c=e[i+2],128==(192&u)&&128==(192&c)&&(f=(15&o)<<12|(63&u)<<6|63&c)>2047&&(f<55296||f>57343)&&(s=f);break;case 4:u=e[i+1],c=e[i+2],l=e[i+3],128==(192&u)&&128==(192&c)&&128==(192&l)&&(f=(15&o)<<18|(63&u)<<12|(63&c)<<6|63&l)>65535&&f<1114112&&(s=f)}}null===s?(s=65533,a=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),i+=a}return T(r)}function T(e){var t=e.length;if(t<=X)return String.fromCharCode.apply(String,e);for(var n="",r=0;rr)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,n,r,o,s){if(!i.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function F(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function U(e,t,n,r,i){return t=+t,n>>>=0,i||F(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),$.write(e,t,n,r,23,4),n+4}function N(e,t,n,r,i){return t=+t,n>>>=0,i||F(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),$.write(e,t,n,r,52,8),n+8}function D(e){if(e=e.trim().replace(Q,""),e.length<2)return"";for(;e.length%4!=0;)e+="=";return e}function L(e){return e<16?"0"+e.toString(16):e.toString(16)}function B(e,t){t=t||1/0;for(var n,r=e.length,i=null,o=[],s=0;s55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function q(e){for(var t=[],n=0;n>8,i=n%256,o.push(i),o.push(r);return o}function H(e){return J.toByteArray(D(e))}function W(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function V(e){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(e)}function G(e){return e!==e}var J=e("base64-js"),$=e("ieee754");n.Buffer=i,n.SlowBuffer=p,n.INSPECT_MAX_BYTES=50;var K=2147483647;n.kMaxLength=K,i.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}(),i.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(e,t,n){return o(e,t,n)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(e,t,n){return a(e,t,n)},i.allocUnsafe=function(e){return u(e)},i.allocUnsafeSlow=function(e){return u(e)},i.isBuffer=function(e){return null!=e&&!0===e._isBuffer},i.compare=function(e,t){if(!i.isBuffer(e)||!i.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,o=0,s=Math.min(n,r);o0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),""},i.prototype.compare=function(e,t,n,r,o){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,o>>>=0,this===e)return 0;for(var s=o-r,a=n-t,u=Math.min(s,a),c=this.slice(r,o),l=e.slice(t,n),f=0;f>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return g(this,e,t,n);case"utf8":case"utf-8":return k(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return x(this,e,t,n);case"base64":return C(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var X=4096;i.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||O(e,t,this.length);for(var r=this[e],i=1,o=0;++o>>=0,t>>>=0,n||O(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},i.prototype.readUInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),this[e]},i.prototype.readUInt16LE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUInt16BE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},i.prototype.readUInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||O(e,t,this.length);for(var r=this[e],i=1,o=0;++o=i&&(r-=Math.pow(2,8*t)),r},i.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||O(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},i.prototype.readInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,t){e>>>=0,t||O(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt16BE=function(e,t){e>>>=0,t||O(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readFloatLE=function(e,t){return e>>>=0,t||O(e,4,this.length),$.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,t){return e>>>=0,t||O(e,4,this.length),$.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,t){return e>>>=0,t||O(e,8,this.length),$.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,t){return e>>>=0,t||O(e,8,this.length),$.read(this,e,!1,52,8)},i.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){M(this,e,t,n,Math.pow(2,8*n)-1,0)}var i=1,o=0;for(this[t]=255&e;++o>>=0,n>>>=0,!r){M(this,e,t,n,Math.pow(2,8*n)-1,0)}var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},i.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,1,255,0),this[t]=255&e,t+1},i.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},i.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},i.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o>0)-a&255;return t+n},i.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+n},i.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},i.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},i.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},i.prototype.writeFloatLE=function(e,t,n){return U(this,e,t,!0,n)},i.prototype.writeFloatBE=function(e,t,n){return U(this,e,t,!1,n)},i.prototype.writeDoubleLE=function(e,t,n){return N(this,e,t,!0,n)},i.prototype.writeDoubleBE=function(e,t,n){return N(this,e,t,!1,n)},i.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(o<1e3)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var s;if("number"==typeof e)for(s=t;sl;)if((a=u[l++])!=a)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}}},{"./_to-index":158,"./_to-iobject":160,"./_to-length":161}],93:[function(e,t,n){var r=e("./_ctx"),i=e("./_iobject"),o=e("./_to-object"),s=e("./_to-length"),a=e("./_array-species-create");t.exports=function(e,t){var n=1==e,u=2==e,c=3==e,l=4==e,f=6==e,h=5==e||f,d=t||a;return function(t,a,p){for(var m,v,b=o(t),y=i(b),_=r(a,p,3),g=s(y.length),k=0,w=n?d(t,g):u?d(t,0):void 0;g>k;k++)if((h||k in y)&&(m=y[k],v=_(m,k,b),e))if(n)w[k]=v;else if(v)switch(e){case 3:return!0;case 5:return m;case 6:return k;case 2:w.push(m)}else if(l)return!1;return f?-1:c||l?l:w}}},{"./_array-species-create":95,"./_ctx":104,"./_iobject":119,"./_to-length":161,"./_to-object":162}],94:[function(e,t,n){var r=e("./_is-object"),i=e("./_is-array"),o=e("./_wks")("species");t.exports=function(e){var t;return i(e)&&(t=e.constructor,"function"!=typeof t||t!==Array&&!i(t.prototype)||(t=void 0),r(t)&&null===(t=t[o])&&(t=void 0)),void 0===t?Array:t}},{"./_is-array":121,"./_is-object":123,"./_wks":167}],95:[function(e,t,n){var r=e("./_array-species-constructor");t.exports=function(e,t){return new(r(e))(t)}},{"./_array-species-constructor":94}],96:[function(e,t,n){"use strict";var r=e("./_a-function"),i=e("./_is-object"),o=e("./_invoke"),s=[].slice,a={},u=function(e,t,n){if(!(t in a)){for(var r=[],i=0;i1?arguments[1]:void 0,3);t=t?t.n:this._f;)for(n(t.v,t.k,this);t&&t.r;)t=t.p},has:function(e){return!!v(this,e)}}),d&&r(f.prototype,"size",{get:function(){return u(this[m])}}),f},def:function(e,t,n){var r,i,o=v(e,t);return o?o.v=n:(e._l=o={i:i=p(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},e._f||(e._f=o),r&&(r.n=o),e[m]++,"F"!==i&&(e._i[i]=o)),e},getEntry:v,setStrong:function(e,t,n){l(e,t,function(e,t){this._t=e,this._k=t,this._l=void 0},function(){for(var e=this,t=e._k,n=e._l;n&&n.r;)n=n.p;return e._t&&(e._l=n=n?n.n:e._t._f)?"keys"==t?f(0,n.k):"values"==t?f(0,n.v):f(0,[n.k,n.v]):(e._t=void 0,f(1))},n?"entries":"values",!n,!0),h(t)}}},{"./_an-instance":89,"./_ctx":104,"./_defined":105,"./_descriptors":106,"./_for-of":112,"./_iter-define":126,"./_iter-step":128,"./_meta":132,"./_object-create":135,"./_object-dp":136,"./_redefine-all":148,"./_set-species":151}],100:[function(e,t,n){var r=e("./_classof"),i=e("./_array-from-iterable");t.exports=function(e){return function(){if(r(this)!=e)throw TypeError(e+"#toJSON isn't generic");return i(this)}}},{"./_array-from-iterable":91,"./_classof":97}],101:[function(e,t,n){"use strict";var r=e("./_global"),i=e("./_export"),o=e("./_meta"),s=e("./_fails"),a=e("./_hide"),u=e("./_redefine-all"),c=e("./_for-of"),l=e("./_an-instance"),f=e("./_is-object"),h=e("./_set-to-string-tag"),d=e("./_object-dp").f,p=e("./_array-methods")(0),m=e("./_descriptors");t.exports=function(e,t,n,v,b,y){var _=r[e],g=_,k=b?"set":"add",w=g&&g.prototype,x={};return m&&"function"==typeof g&&(y||w.forEach&&!s(function(){(new g).entries().next()}))?(g=t(function(t,n){l(t,g,e,"_c"),t._c=new _,void 0!=n&&c(n,b,t[k],t)}),p("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(e){var t="add"==e||"set"==e;e in w&&(!y||"clear"!=e)&&a(g.prototype,e,function(n,r){if(l(this,g,e),!t&&y&&!f(n))return"get"==e&&void 0;var i=this._c[e](0===n?0:n,r);return t?this:i})}),"size"in w&&d(g.prototype,"size",{get:function(){return this._c.size}})):(g=v.getConstructor(t,e,b,k),u(g.prototype,n),o.NEED=!0),h(g,e),x[e]=g,i(i.G+i.W+i.F,x),y||v.setStrong(g,e,b),g}},{"./_an-instance":89,"./_array-methods":93,"./_descriptors":106,"./_export":110,"./_fails":111,"./_for-of":112,"./_global":113,"./_hide":115,"./_is-object":123,"./_meta":132,"./_object-dp":136,"./_redefine-all":148,"./_set-to-string-tag":152}],102:[function(e,t,n){var r=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=r)},{}],103:[function(e,t,n){"use strict";var r=e("./_object-dp"),i=e("./_property-desc");t.exports=function(e,t,n){t in e?r.f(e,t,i(0,n)):e[t]=n}},{"./_object-dp":136,"./_property-desc":147}],104:[function(e,t,n){var r=e("./_a-function");t.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},{"./_a-function":87}],105:[function(e,t,n){t.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},{}],106:[function(e,t,n){t.exports=!e("./_fails")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{"./_fails":111}],107:[function(e,t,n){var r=e("./_is-object"),i=e("./_global").document,o=r(i)&&r(i.createElement);t.exports=function(e){return o?i.createElement(e):{}}},{"./_global":113,"./_is-object":123}],108:[function(e,t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],109:[function(e,t,n){var r=e("./_object-keys"),i=e("./_object-gops"),o=e("./_object-pie");t.exports=function(e){var t=r(e),n=i.f;if(n)for(var s,a=n(e),u=o.f,c=0;a.length>c;)u.call(e,s=a[c++])&&t.push(s);return t}},{"./_object-gops":141,"./_object-keys":144,"./_object-pie":145}],110:[function(e,t,n){var r=e("./_global"),i=e("./_core"),o=e("./_ctx"),s=e("./_hide"),a=function(e,t,n){var u,c,l,f=e&a.F,h=e&a.G,d=e&a.S,p=e&a.P,m=e&a.B,v=e&a.W,b=h?i:i[t]||(i[t]={}),y=b.prototype,_=h?r:d?r[t]:(r[t]||{}).prototype;h&&(n=t);for(u in n)(c=!f&&_&&void 0!==_[u])&&u in b||(l=c?_[u]:n[u],b[u]=h&&"function"!=typeof _[u]?n[u]:m&&c?o(l,r):v&&_[u]==l?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(l):p&&"function"==typeof l?o(Function.call,l):l,p&&((b.virtual||(b.virtual={}))[u]=l,
e&a.R&&y&&!y[u]&&s(y,u,l)))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a},{"./_core":102,"./_ctx":104,"./_global":113,"./_hide":115}],111:[function(e,t,n){t.exports=function(e){try{return!!e()}catch(e){return!0}}},{}],112:[function(e,t,n){var r=e("./_ctx"),i=e("./_iter-call"),o=e("./_is-array-iter"),s=e("./_an-object"),a=e("./_to-length"),u=e("./core.get-iterator-method"),c={},l={},n=t.exports=function(e,t,n,f,h){var d,p,m,v,b=h?function(){return e}:u(e),y=r(n,f,t?2:1),_=0;if("function"!=typeof b)throw TypeError(e+" is not iterable!");if(o(b)){for(d=a(e.length);d>_;_++)if((v=t?y(s(p=e[_])[0],p[1]):y(e[_]))===c||v===l)return v}else for(m=b.call(e);!(p=m.next()).done;)if((v=i(m,y,p.value,t))===c||v===l)return v};n.BREAK=c,n.RETURN=l},{"./_an-object":90,"./_ctx":104,"./_is-array-iter":120,"./_iter-call":124,"./_to-length":161,"./core.get-iterator-method":168}],113:[function(e,t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},{}],114:[function(e,t,n){var r={}.hasOwnProperty;t.exports=function(e,t){return r.call(e,t)}},{}],115:[function(e,t,n){var r=e("./_object-dp"),i=e("./_property-desc");t.exports=e("./_descriptors")?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},{"./_descriptors":106,"./_object-dp":136,"./_property-desc":147}],116:[function(e,t,n){t.exports=e("./_global").document&&document.documentElement},{"./_global":113}],117:[function(e,t,n){t.exports=!e("./_descriptors")&&!e("./_fails")(function(){return 7!=Object.defineProperty(e("./_dom-create")("div"),"a",{get:function(){return 7}}).a})},{"./_descriptors":106,"./_dom-create":107,"./_fails":111}],118:[function(e,t,n){t.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},{}],119:[function(e,t,n){var r=e("./_cof");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},{"./_cof":98}],120:[function(e,t,n){var r=e("./_iterators"),i=e("./_wks")("iterator"),o=Array.prototype;t.exports=function(e){return void 0!==e&&(r.Array===e||o[i]===e)}},{"./_iterators":129,"./_wks":167}],121:[function(e,t,n){var r=e("./_cof");t.exports=Array.isArray||function(e){return"Array"==r(e)}},{"./_cof":98}],122:[function(e,t,n){var r=e("./_is-object"),i=Math.floor;t.exports=function(e){return!r(e)&&isFinite(e)&&i(e)===e}},{"./_is-object":123}],123:[function(e,t,n){t.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},{}],124:[function(e,t,n){var r=e("./_an-object");t.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var o=e.return;throw void 0!==o&&r(o.call(e)),t}}},{"./_an-object":90}],125:[function(e,t,n){"use strict";var r=e("./_object-create"),i=e("./_property-desc"),o=e("./_set-to-string-tag"),s={};e("./_hide")(s,e("./_wks")("iterator"),function(){return this}),t.exports=function(e,t,n){e.prototype=r(s,{next:i(1,n)}),o(e,t+" Iterator")}},{"./_hide":115,"./_object-create":135,"./_property-desc":147,"./_set-to-string-tag":152,"./_wks":167}],126:[function(e,t,n){"use strict";var r=e("./_library"),i=e("./_export"),o=e("./_redefine"),s=e("./_hide"),a=e("./_has"),u=e("./_iterators"),c=e("./_iter-create"),l=e("./_set-to-string-tag"),f=e("./_object-gpo"),h=e("./_wks")("iterator"),d=!([].keys&&"next"in[].keys()),p=function(){return this};t.exports=function(e,t,n,m,v,b,y){c(n,t,m);var _,g,k,w=function(e){if(!d&&e in E)return E[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},x=t+" Iterator",C="values"==v,j=!1,E=e.prototype,S=E[h]||E["@@iterator"]||v&&E[v],T=S||w(v),R=v?C?w("entries"):T:void 0,A="Array"==t?E.entries||S:S;if(A&&(k=f(A.call(new e)))!==Object.prototype&&(l(k,x,!0),r||a(k,h)||s(k,h,p)),C&&S&&"values"!==S.name&&(j=!0,T=function(){return S.call(this)}),r&&!y||!d&&!j&&E[h]||s(E,h,T),u[t]=T,u[x]=p,v)if(_={values:C?T:w("values"),keys:b?T:w("keys"),entries:R},y)for(g in _)g in E||o(E,g,_[g]);else i(i.P+i.F*(d||j),t,_);return _}},{"./_export":110,"./_has":114,"./_hide":115,"./_iter-create":125,"./_iterators":129,"./_library":131,"./_object-gpo":142,"./_redefine":149,"./_set-to-string-tag":152,"./_wks":167}],127:[function(e,t,n){var r=e("./_wks")("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(e){}t.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var o=[7],s=o[r]();s.next=function(){return{done:n=!0}},o[r]=function(){return s},e(o)}catch(e){}return n}},{"./_wks":167}],128:[function(e,t,n){t.exports=function(e,t){return{value:t,done:!!e}}},{}],129:[function(e,t,n){t.exports={}},{}],130:[function(e,t,n){var r=e("./_object-keys"),i=e("./_to-iobject");t.exports=function(e,t){for(var n,o=i(e),s=r(o),a=s.length,u=0;a>u;)if(o[n=s[u++]]===t)return n}},{"./_object-keys":144,"./_to-iobject":160}],131:[function(e,t,n){t.exports=!0},{}],132:[function(e,t,n){var r=e("./_uid")("meta"),i=e("./_is-object"),o=e("./_has"),s=e("./_object-dp").f,a=0,u=Object.isExtensible||function(){return!0},c=!e("./_fails")(function(){return u(Object.preventExtensions({}))}),l=function(e){s(e,r,{value:{i:"O"+ ++a,w:{}}})},f=function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,r)){if(!u(e))return"F";if(!t)return"E";l(e)}return e[r].i},h=function(e,t){if(!o(e,r)){if(!u(e))return!0;if(!t)return!1;l(e)}return e[r].w},d=function(e){return c&&p.NEED&&u(e)&&!o(e,r)&&l(e),e},p=t.exports={KEY:r,NEED:!1,fastKey:f,getWeak:h,onFreeze:d}},{"./_fails":111,"./_has":114,"./_is-object":123,"./_object-dp":136,"./_uid":164}],133:[function(e,t,n){var r=e("./_global"),i=e("./_task").set,o=r.MutationObserver||r.WebKitMutationObserver,s=r.process,a=r.Promise,u="process"==e("./_cof")(s);t.exports=function(){var e,t,n,c=function(){var r,i;for(u&&(r=s.domain)&&r.exit();e;){i=e.fn,e=e.next;try{i()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(u)n=function(){s.nextTick(c)};else if(o){var l=!0,f=document.createTextNode("");new o(c).observe(f,{characterData:!0}),n=function(){f.data=l=!l}}else if(a&&a.resolve){var h=a.resolve();n=function(){h.then(c)}}else n=function(){i.call(r,c)};return function(r){var i={fn:r,next:void 0};t&&(t.next=i),e||(e=i,n()),t=i}}},{"./_cof":98,"./_global":113,"./_task":157}],134:[function(e,t,n){"use strict";var r=e("./_object-keys"),i=e("./_object-gops"),o=e("./_object-pie"),s=e("./_to-object"),a=e("./_iobject"),u=Object.assign;t.exports=!u||e("./_fails")(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=u({},e)[n]||Object.keys(u({},t)).join("")!=r})?function(e,t){for(var n=s(e),u=arguments.length,c=1,l=i.f,f=o.f;u>c;)for(var h,d=a(arguments[c++]),p=l?r(d).concat(l(d)):r(d),m=p.length,v=0;m>v;)f.call(d,h=p[v++])&&(n[h]=d[h]);return n}:u},{"./_fails":111,"./_iobject":119,"./_object-gops":141,"./_object-keys":144,"./_object-pie":145,"./_to-object":162}],135:[function(e,t,n){var r=e("./_an-object"),i=e("./_object-dps"),o=e("./_enum-bug-keys"),s=e("./_shared-key")("IE_PROTO"),a=function(){},u=function(){var t,n=e("./_dom-create")("iframe"),r=o.length;for(n.style.display="none",e("./_html").appendChild(n),n.src="javascript:",t=n.contentWindow.document,t.open(),t.write("