/* @preserve * The MIT License (MIT) * * Copyright (c) 2013-2018 Petka Antonov * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *//** * bluebird build version 3.7.2 * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each*/!function(t){if("object"==typeofexports&&"undefined"!=typeofmodule)module.exports=t();elseif("function"==typeofdefine&&define.amd)define([],t);else{vare;"undefined"!=typeofwindow?e=window:"undefined"!=typeofglobal?e=global:"undefined"!=typeofself&&(e=self),e.Promise=t()}}(function(){vart,e,n;returnfunctionr(t,e,n){functioni(s,a){if(!e[s]){if(!t[s]){varc="function"==typeof_dereq_&&_dereq_;if(!a&&c)returnc(s,!0);if(o)returno(s,!0);varu=newError("Cannot find module '"+s+"'");throwu.code="MODULE_NOT_FOUND",u}varl=e[s]={exports:{}};t[s][0].call(l.exports,function(e){varn=t[s][1][e];returni(n?n:e)},l,l.exports,r,t,e,n)}returne[s].exports}for(varo="function"==typeof_dereq_&&_dereq_,s=0;s<n.length;s++)i(n[s]);returni}({1:[function(t,e,n){"use strict";e.exports=function(t){functione(t){vare=newn(t),r=e.promise();returne.setHowMany(1),e.setUnwrap(),e.init(),r}varn=t._SomePromiseArray;t.any=function(t){returne(t)},t.prototype.any=function(){returne(this)}}},{}],2:[function(t,e,n){"use strict";functionr(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=newf(16),this._normalQueue=newf(16),this._haveDrainedQueues=!1;vart=this;this.drainQueues=function(){t._drainQueues()},this._schedule=p}functioni(t,e,n){this._lateQueue.push(t,e,n),this._queueTick()}functiono(t,e,n){this._normalQueue.push(t,e,n),this._queueTick()}functions(t){this._normalQueue._pushOne(t),this._queueTick()}functiona(t){for(;t.length()>0;)c(t)}functionc(t){vare=t.shift();if("function"!=typeofe)e._settlePromises();else{varn=t.shift(),r=t.shift();e.call(n,r)}}varu;try{thrownewError}catch(l){u=l}varp=t("./schedule"),f=t("./queue");r.prototype.setScheduler=function(t){vare=this._schedule;returnthis._schedule=t,this._customScheduler=!0,e},r.prototype.hasCustomScheduler=function(){returnthis._customScheduler},r.prototype.haveItemsQueued=function(){returnthis._isTickUsed||this._haveDrainedQueues},r.prototype.fatalError=function(t,e){e?(process.stderr.write("Fatal "+(tinstanceofError?t.stack:t)+"\n"),process.exit(2)):this.throwLater(t)},r.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function(){throwe}),"undefined"!=typeofsetTimeout)setTimeout(function(){t(e)},0);elsetry{this._schedule(function(){t(e)})}catch(n){thrownewError("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},r.prototype.invokeLater=i,r.prototype.invoke=o,r.prototype.settlePromises=s,r.prototype._drainQueues=function(){a(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,a(this._lateQueue)},r.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},r.prototype._reset=function(){this._isTickUsed=!1},e.exports=r,e.exports.firstLineError=u},{"./queue":26,"./schedule":29}],3:[function(t,e,n){"use strict";e.exports=function(t,e,n,r){vari=!1,o=function(t,e){this._reject(e)},s=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(o,o,null,this,t)},a=function(t,e){0===(50397184&this._bitField)&&this._resolveCallback(e.target)},c=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(o){i||(i=!0,t.prototype._propagateFrom=r.propagateFromFunction(),t.prototype._boundValue=r.boundValueFunction());varu=n(o),l=newt(e);l._propagateFrom(this,1);varp=this._target();if(l._setBoundTo(u),uinstanceoft){varf={promiseRejectionQueued:!1,promise:l,target:p,bindingPromise:u};p._then(e,s,void0,l,f),u._then(a,c,void0,l,f),l._setOnCancel(u)}elsel._resolveCallback(p);returnl},t.prototype._setBoundTo=function(t){void0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return2097152===(2097152&this._bitField)},t.bind=function(e,n){returnt.resolve(n).bind(e)}}},{}],4:[function(t,e,n){"use strict";functionr(){try{Promise===o&&(Promise=i)}catch(t){}returno}vari;"undefined"!=typeofPromise&&(i=Promise);varo=t("./promise")();o.noConflict=r,e.exports=o},{"./promise":22}],5:[function(t,e,n){"use strict";varr=Object.create;if(r){vari=r(null),o=r(null);i[" size"]=o[" size"]=0}e.exports=function(e){functionn(t,n){varr;if(null!=t&&(r=t[n]),"function"!=typeofr){vari="Object "+a.classString(t)+" has no method '"+a.toString(n)+"'";thrownewe.TypeError(i)}returnr}functionr(t){vare=this.pop(),r=n(t,e);returnr.apply(t,this)}functioni(t){returnt[this]}functiono(t){vare=+this;return0>e&&(e=Math.max(0,e+t.length)),t[e]}vars,a=t("./util"),c=a.canEvaluate;a.isIdentifier;e.prototype.call=function(t){vare=[].slice.call(arguments,1);returne.push(t),this._then(r,void0,void0,e,void0)},e.prototype.get=function(t){vare,n="number"==typeoft;if(n)e=o;elseif(c){varr=s(t);e=null!==r?r:i}elsee=i;returnthis._then(e,void0,void0,t,void0)}}},{"./util":36}],6:[function(t,e,n){"use strict";e.exports=function(e,n,r,i){varo=t("./util"),s=o.tryCatch,a=o.errorObj,c=e._async;e.prototype["break"]=e.prototype.cancel=function(){if(!i.cancellation())returnthis._warn("cancellation is disabled");for(vart=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}varn=t._cancellationParent;if(null==n||!n._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=n}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){returnvoid0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){returnt===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),this._enoughBranchesHaveCancelled()?(this._invokeOnCancel(),!0):!1)},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),c.invoke(this._cancelPromises,this,void0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void0},e.prototype._isCancellable=function(){returnthis.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){returnthis.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(o.isArray(t))for(varn=0;n<t.length;++n)this._doInvokeOnCancel(t[n],e);elseif(void0!==t)if("function"==typeoft){if(!e){varr=s(t).call(this._boundValue());r===a&&(this._attachExtraTrace(r.e),c.throwLater(r.e))}}elset._resultCancelled(this)},e.prototype._invokeOnCancel=function(){vart=this._onCancel();this._unsetOnCancel(),c.invoke(this._doInvokeOnCancel,this,t)},e.prototype._invokeInternalOnCancel=function(){this._isCancellable()&&(this._doInvokeOnCancel(this._onCancel(),!0),this._unsetOnCancel())},e.prototype._resultCancelled=function(){this.cancel()}}},{"./util":36}],7:[function(t,e,n){"use strict";e.exports=function(e){functionn(t,n,a){returnfunction(c){varu=a._boundValue();t:for(varl=0;l<t.length;++l){varp=t[l];if(p===Error||null!=p&&p.prototypeinstanceofError){if(cinstanceofp)returno(n).call(u,c)}elseif("function"==typeofp){varf=o(p).call(u,c);if(f===s)returnf;if(f)returno(n).call(u,c)}elseif(r.isObject(c)){for(varh=i(p),_=0;_<h.length;++_){vard=h[_];if(p[d]!=c[d])continuet}returno(n).call(u,c)}}returne}}varr=t("./util"),i=t("./es5").keys,o=r.tryCatch,s=r.errorObj;returnn}},{"./es5":13,"./util":36}],8:[function(t,e,n){"use strict";e.exports=function(t){functione(){this._trace=newe.CapturedTrace(r())}functionn(){returni?newe:void0}functionr(){vart=o.length-1;returnt>=0?o[t]:void0}vari=!1,o=[];returnt.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){returnnull},t._peekContext=t.prototype._peekContext=function(){},e.prototype._pushContext=function(){void0!==this._trace&&(this._trace._promiseCreated=null,o.push(this._trace))},e.prototype._popContext=function(){if(void0!==this._trace){vart=o.pop(),e=t._promiseCreated;returnt._promiseCreated=null,e}returnnull},e.CapturedTrace=null,e.create=n,e.deactivateLongStackTraces=function(){},e.activateLongStackTraces=function(){varn=t.prototype._pushContext,o=t.prototype._popContext,s=t._peekContext,a=t.prototype._peekContext,c=t.prototype._promiseCreated;e.deactivateLongStackTraces=function(){t.prototype._pushContext=n,t.prototype._popContext=o,t._peekContext=s,t.prototype._peekContext=a,t.prototype._promiseCreated=c,i=!1},i=!0,t.prototype._pushContext=e.prototype._pushContext,t.prototype._popContext=e.prototype._popContext,t._peekContext=t.prototype._peekContext=r,t.prototype._promiseCreated=function(){vart=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},e}},{}],9:[function(t,e,n){"use strict";e.exports=function(e,n,r,i){functiono(t,e){return{promise:e}}functions(){return!1}functiona(t,e,n){varr=this;try{t(e,n,function(t){if("function"!=typeoft)thrownewTypeError("onCancel must be a function, got: "+B.toString(t));r._attachCancellationCallback(t)})}catch(i){returni}}functionc(t){if(!this._isCancellable())returnthis;vare=this._onCancel();void0!==e?B.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}functionu(){returnthis._onCancelField}functionl(t){this._onCancelField=t}functionp(){this._cancellationParent=void0,this._onCancelField=void0}functionf(t,e){if(0!==(1&e)){this._cancellationParent=t;varn=t._branchesRemainingToCancel;void0===n&&(n=0),t._branchesRemainingToCancel=n+1}0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}functionh(t,e){0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function_(){vart=this._boundTo;returnvoid0!==t&&tinstanceofe?t.isFulfilled()?t.value():void0:t}functiond(){this._trace=newV(this._peekContext())}functionv(t,e){if(q(t)){varn=this._trace;if(void0!==n&&e&&(n=n._parent),void0!==n)n.attachExtraTrace(t);elseif(!t.__stackCleaned__){varr=F(t);B.notEnumerableProp(t,"stack",r.message+"\n"+r.stack.join("\n")),B.notEnumerableProp(t,"__stackCleaned__",!0)}}}functiony(){this._trace=void0}functiong(t,e,n,r,i){if(void0===t&&null!==e&&Z){if(void0!==i&&i._returnedNonUndefined())return;if(0===(65535&r._bitField))return;n&&(n+=" ");varo="",s="";if(e._trace){for(vara=e._trace.stack.split("\n"),c=k(a),u=c.length-1;u>=0;--u){varl=c[u];if(!Q.test(l)){varp=l.match(G);p&&(o="at "+p[1]+":"+p[2]+":"+p[3]+" ");break}}if(c.length>0)for(varf=c[0],u=0;u<a.length;++u)if(a[u]===f){u>0&&(s="\n"+a[u-1]);break}}varh="a promise was created in a "+n+"handler "+o+"but was not returned from it, see http://goo.gl/rRqMUw"+s;r._warn(h,!0,e)}}functionm(t,e){varn=t+" is deprecated and will be removed in a future version.";returne&&(n+=" Use "+e+" instead."),b(n)}functionb(t,n,r){if(lt.warnings){vari,o=newU(t);if(n)r._attachExtraTrace(o);elseif(lt.longStackTraces&&(i=e._peekContext()))i.attachExtraTrace(o);else{vars=F(o);o.stack=s.message+"\n"+s.stack.join("\n")}ot("warning",o)||x(o,"",!0)}}functionw(t,e){for(varn=0;n<e.length-1;++n)e[n].push("From previous event:"),e[n]=e[n].join("\n");returnn<e.length&&(e[n]=e[n].join("\n")),t+"\n"+e.join("\n")}functionC(t){for(vare=0;e<t.length;++e)(0===t[e].length||e+1<t.length&&t[e][0]===t[e+1][0])&&(t.splice(e,1),e--)}functionj(t){for(vare=t[0],n=1;n<t.length;++n){for(varr=t[n],i=e.length-1,o=e[i],s=-1,a=r.length-1;a>=0;--a)if(r[a]===o){s=a;break}for(vara=s;a>=0;--a){varc=r[a];if(e[i]!==c)break;e.pop(),i--}e=r}}functionk(t){for(vare=[],n=0;n<t.length;++n){varr=t[n],i=" (No stack trace)"===r||z.test(r),o=i&&at(r);i&&!o&&(W&&" "!==r.charAt(0)&&(r=" "+r),e.push(r))}returne}functionE(t){for(vare=t.stack.replace(/\s+$/g,"").split("\n"),n=0;n<e.length;++n){varr=e[n];if(" (No stack trace)"===r||z.test(r))break}returnn>0&&"SyntaxError"!=t.name&&(e=e.slice(n)),e}functionF(t){vare=t.stack,n=t.toString();returne="string"==typeofe&&e.length>0?E(t):[" (No stack trace)"],{message:n,stack:"SyntaxError"==t.name?e:k(e)}}functionx(t,e,n){if("undefined"!=typeofconsole){varr;if(B.isObject(t)){vari=t.stack;r=e+X(i,t)}elser=e+String(t);"function"==typeofI?I(r,n):("function"==typeofconsole.log||"object"==typeofconsole.log)&&console.log(r)}}functionT(t,e,n,r){vari=!1;try{"function"==typeofe&&(i=!0,"rejectionHandled"===t?e(r):e(n,r))}catch(o){N.throwLater(o)}"unhandledRejection"===t?ot(t,n,r)||i||x(n,"Unhandled rejection "):ot(t,r)}functionP(t){vare;if("function"==typeoft)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeoft.toString?t.toString():B.toString(t);varn=/\[object [a-zA-Z0-9$_]+\]/;if(n.test(e))try{varr=JSON.stringify(t);e=r}catch(i){}0===e.length&&(e="(empty array)")}return"(<"+R(e)+">, no stack trace)"}functionR(t){vare=41;returnt.length<e?t:t.substr(0,e-3)+"..."}functionS(){return"function"==typeofut}functionO(t){vare=t.match(ct);returne?{fileName:e[1],line:parseInt(e[2],10)}:void0}functionA(t,e){if(S()){for(varn,r,i=(t.stack||"").split("\n"),o=(e.stack||"").split("\n"),s=-1,a=-1,c=0;c<i.length;++c){varu=O(i[c]);if(u){n=u.fileName,s=u.line;break}}for(varc=0;c<o.length;++c){varu=O(o[c]);if(u){r=u.fileName,a=u.line;break}}0>s||0>a||!n||!r||n!==r||s>=a||(at=function(t){if($.test(t))return!0;vare=O(t);returne&&e.fileName===n&&s<=e.line&&e.line<=a?!0:!1})}}functionV(t){this._parent=t,this._promisesCreated=0;vare=this._length=1+(void0===t?0:t._length);ut(this,V),e>32&&this.uncycle()}varH,D,I,L,N=e._async,U=t("./errors").Warning,B=t("./util"),M=t("./es5"),q=B.canAttachTrace,$=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,Q=/\((?:timers\.js):\d+:\d+\)/,G=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,z=null,X=null,W=!1,K=!(0==B.env("BLUEBIRD_DEBUG")||!B.env("BLUEBIRD_DEBUG")&&"development"!==B.env("NODE_ENV")),J=!(0==B.env("BLUEBIRD_WARNINGS")||!K&&!B.env("BLUEBIRD_WARNINGS")),Y=!(0==B.env("BLUEBIRD_LONG_STACK_TRACES")||!K&&!B.env("BLUEBIRD_LONG_STACK_TRACES")),Z=0!=B.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(J||!!B.env("BLUEBIRD_W_FORGOTTEN_RETURN"));!function(){functiont(){for(vart=0;t<r.length;++t)r[t]._notifyUnhandledRejection();n()}functionn(){r.length=0}varr=[];L=function(e){r.push(e),setTimeout(t,1)},M.defineProperty(e,"_unhandledRejectionCheck",{value:t}),M.defineProperty(e,"_unhandledRejectionClear",{value:n})}(),e.prototype.suppressUnhandledRejections=function(){vart=this._target();t._bitField=-1048577&t._bitField|524288},e.prototype._ensurePossibleRejectionHandled=function(){0===(524288&this._bitField)&&(this._setRejectionIsUnhandled(),L(this))},e.prototype._notifyUnhandledRejectionIsHandled=function(){T("rejectionHandled",H,void0,this)},e.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},e.prototype._returnedNonUndefined=function(){return0!==(268435456&this._bitField)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){vart=this._settledValue();this._setUnhandledRejectionIsNotified(),T("unhandledRejection",D,t,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},e.prototype._warn=function(t,e,n){returnb(t,e,n||this)},e.onPossiblyUnhandledRejection=function(t){varn=e._getContext();D=B.contextBind(n,t)},e.onUnhandledRejectionHandled=function(t){varn=e._getContext();H=B.contextBind(n,t)};vartt=function(){};e.longStackTraces=function(){if(N.haveItemsQueued()&&!lt.longStackTraces)thrownewError("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!lt.longStackTraces&&S()){vart=e.prototype._captureStackTrace,r=e.prototype._attachExtraTrace,i=e.prototype._dereferenceTrace;lt.longStackTraces=!0,tt=function(){if(N.haveItemsQueued()&&!lt.longStackTraces)thrownewError("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");e.prototype._captureStackTrace=t,e.prototype._attachExtraTrace=r,e.prototype._dereferenceTrace=i,n.deactivateLongStackTraces(),lt.longStackTraces=!1},e.prototype._captureStackTrace=d,e.prototype._attachExtraTrace=v,e.prototype._dereferenceTrace=y,n.activateLongStackTraces()}},e.hasLongStackTraces=function(){returnlt.longStackTraces&&S()};varet={unhandledrejection:{before:function(){vart=B.global.onunhandledrejection;returnB.global.onunhandledrejection=null,t},after:function(t){B.global.onunhandledrejection=t}},rejectionhandled:{before:function(){vart=B.global.onrejectionhandled;returnB.global.onrejectionhandled=null,t},after:function(t){B.global.onrejectionhandled=t}}},nt=function(){vart=function(t,e){if(!t)return!B.global.dispatchEvent(e);varn;try{returnn=t.before(),!B.global.dispatchEvent(e)}finally{t.after(n)}};try{if("function"==typeofCustomEvent){vare=newCustomEvent("CustomEvent");returnB.global.dispatchEvent(e),function(e,n){e=e.toLowerCase();varr={detail:n,cancelable:!0},i=newCustomEvent(e,r);returnM.defineProperty(i,"promise",{value:n.promise}),M.defineProperty(i,"reason",{value:n.reason}),t(et[e],i)}}if("function"==typeofEvent){vare=newEvent("CustomEvent");returnB.global.dispatchEvent(e),function(e,n){e=e.toLowerCase();varr=newEvent(e,{cancelable:!0});returnr.detail=n,M.defineProperty(r,"promise",{value:n.promise}),M.defineProperty(r,"reason",{value:n.reason}),t(et[e],r)}}vare=document.createEvent("CustomEvent");returne.initCustomEvent("testingtheevent",!1,!0,{}),B.global.dispatchEvent(e),function(e,n){e=e.toLowerCase();varr=document.createEvent("CustomEvent");returnr.initCustomEvent(e,!1,!0,n),t(et[e],r)}}catch(n){}returnfunction(){return!1}}(),rt=function(){returnB.isNode?function(){returnprocess.emit.apply(process,arguments)}:B.global?function(t){vare="on"+t.toLowerCase(),n=B.global[e];returnn?(n.apply(B.global,[].slice.call(arguments,1)),!0):!1}:function(){return!1}}(),it={promiseCreated:o,promiseFulfilled:o,promiseRejected:o,promiseResolved:o,promiseCancelled:o,promiseChained:function(t,e,n){return{promise:e,child:n}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,n){return{reason:e,promise:n}},rejectionHandled:o},ot=function(t){vare=!1;try{e=rt.apply(null,arguments)}catch(n){N.throwLater(n),e=!0}varr=!1;try{r=nt(t,it[t].apply(null,arguments))}catch(n){N.throwLater(n),r=!0}returnr||e};e.config=function(t){if(t=Object(t),"longStackTraces"int&&(t.longStackTraces?e.longStackTraces():!t.longStackTraces&&e.hasLongStackTraces()&&tt()),"warnings"int){varn=t.warnings;lt.warnings=!!n,Z=lt.warnings,B.isObject(n)&&"wForgottenReturn"inn&&(Z=!!n.wForgottenReturn)}if("cancellation"int&&t.cancellation&&!lt.cancellation){if(N.haveItemsQueued())thrownewError("cannot enable cancellation after promises are in use");e.prototype._clearCancellationData=p,e.prototype._propagateFrom=f,e.prototype._onCancel=u,e.prototype._setOnCancel=l,e.prototype._attachCancellationCallback=c,e.prototype._execute=a,st=f,lt.cancellation=!0}if("monitoring"int&&(t.monitoring&&!lt.monitoring?(lt.monitoring=!0,e.prototype._fireEvent=ot):!t.monitoring&<.monitoring&&(lt.monitoring=!1,e.prototype._fireEvent=s)),"asyncHooks"int&&B.nodeSupportsAsyncResource){varo=lt.asyncHooks,h=!!t.asyncHooks;o!==h&&(lt.asyncHooks=h,h?r():i())}returne},e.prototype._fireEvent=s,e.prototype._execute=function(t,e,n){try{t(e,n)}catch(r){returnr}},e.prototype._onCancel=function(){},e.prototype._setOnCancel=function(t){},e.prototype._attachCancellationCallback=function(t){},e.prototype._captureStackTrace=function(){},e.prototype._attachExtraTrace=function(){},e.prototype._dereferenceTrace=function(){},e.prototype._clearCancellationData=function(){},e.prototype._propagateFrom=function(t,e){};varst=h,at=function(){return!1},ct=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;B.inherits(V,Error),n.CapturedTrace=V,V.prototype.uncycle=function(){vart=this._length;if(!(2>t)){for(vare=[],n={},r=0,i=this;void0!==i;++r)e.push(i),i=i._parent;t=this._length=r;for(varr=t-1;r>=0;--r){varo=e[r].stack;void0===n[o]&&(n[o]=r)}for(varr=0;t>r;++r){vars=e[r].stack,a=n[s];if(void0!==a&&a!==r){a>0&&(e[a-1]._parent=void0,e[a-1]._length=1),e[r]._parent=void0,e[r]._length=1;varc=r>0?e[r-1]:this;t-1>a?(c._parent=e[a+1],c._parent.uncycle(),c._length=c._parent._length+1):(c._parent=void0,c._length=1);for(varu=c._length+1,l=r-2;l>=0;--l)e[l]._length=u,u++;return}}}},V.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(vare=F(t),n=e.message,r=[e.stack],i=this;void0!==i;)r.push(k(i.stack.split("\n"))),i=i._parent;j(r),C(r),B.notEnumerableProp(t,"stack",w(n,r)),B.notEnumerableProp(t,"__stackCleaned__",!0)}};varut=function(){vart=/^\s*at\s*/,e=function(t,e){return"string"==typeoft?t:void0!==e.name&&void0!==e.message?e.toString():P(e)};if("number"==typeofError.stackTraceLimit&&"function"==typeofError.captureStackTrace){Error.stackTraceLimit+=6,z=t,X=e;varn=Error.captureStackTrace;returnat=function(t){return$.test(t)},function(t,e){Error.stackTraceLimit+=6,n(t,e),Error.stackTraceLimit-=6}}varr=newError;if("string"==typeofr.stack&&r.stack.split("\n")[0].indexOf("stackDetection@")>=0)returnz=/@/,X=e,W=!0,function(t){t.stack=(newError).stack};vari;try{thrownewError}catch(o){i="stack"ino}return"stack"inr||!i||"number"!=typeofError.stackTraceLimit?(X=function(t,e){return"string"==typeoft?t:"object"!=typeofe&&"function"!=typeofe||void0===e.name||void0===e.message?P(e):e.toString()},null):(z=t,X=e,function(t){Error.stackTraceLimit+=6;try{thrownewError}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}([]);"undefined"!=typeofconsole&&"undefined"!=typeofconsole.warn&&(I=function(t){console.warn(t)},B.isNode&&process.stderr.isTTY?I=function(t,e){varn=e?"[33m":"[31m";console.warn(n+t+"[0m\n")}:B.isNode||"string"!=typeof(newError).stack||(I=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));varlt={warnings:J,longStackTraces:!1,cancellation:!1,monitoring:!1,asyncHooks:!1};returnY&&e.longStackTraces(),{asyncHooks:function(){returnlt.asyncHooks},longStackTraces:function(){returnlt.longStackTraces},warnings:function(){returnlt.warnings},cancellation:function(){returnlt.cancellation},monitoring:function(){returnlt.monitoring},propagateFromFunction:function(){returnst},boundValueFunction:function(){return_},checkForgottenReturns:g,setBounds:A,warn:b,deprecated:m,CapturedTrace:V,fireDomEvent:nt,fireGlobalEvent:rt}}},{"./errors":12,"./es5":13,"./util":36}],10:[function(t,e,n){"use strict";e.exports=function(t){functione(){returnthis.value}functionn(){throwthis.reason}t.prototype["return"]=t.prototype.thenReturn=function(n){returnninstanceoft&&n.suppressUnhandledRejections(),this._then(e,void0,void0,{value:n},void0)},t.prototype["throw"]=t.prototype.thenThrow=function(t){returnthis._then(n,void0,void0,{reason:t},void0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)returnthis._then(void0,n,void0,{reason:t},void0);vare=arguments[1],r=function(){throwe};returnthis.caught(t,r)},t.prototype.catchReturn=function(n){if(arguments.length<=1)returnninstanceoft&&n.suppressUnhandledRejections(),this._then(void0,e,void0,{value:n},void0);varr=arguments[1];rinstanceoft&&r.suppressUnhandledRejections();vari=function(){returnr};returnthis.caught(n,i)}}},{}],11:[function(t,e,n){"use strict";e.exports=function(t,e){functionn(){returno(this)}functionr(t,n){returni(t,n,e,e)}vari=t.reduce,o=t.all;t.prototype.each=function(t){returni(this,t,e,0)._then(n,void0,void0,this,void0)},t.prototype.mapSeries=function(t){returni(this,t,e,e)},t.each=function(t,r){returni(t,r,e,0)._then(n,void0,void0,t,void0)},t.mapSeries=r}},{}],12:[function(t,e,n){"use strict";functionr(t,e){functionn(r){returnthisinstanceofn?(p(this,"message","string"==typeofr?r:e),p(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):newn(r)}returnl(n,Error),n}functioni(t){returnthisinstanceofi?(p(this,"name","OperationalError"),p(this,"message",t),this.cause=t,this.isOperational=!0,void(tinstanceofError?(p(this,"message",t.message),p(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):newi(t)}varo,s,a=t("./es5"),c=a.freeze,u=t("./util"),l=u.inherits,p=u.notEnumerableProp,f=r("Warning","warning"),h=r("CancellationError","cancellation error"),_=r("TimeoutError","timeout error"),d=r("AggregateError","aggregate error");try{o=TypeError,s=RangeError}catch(v){o=r("TypeError","type error"),s=r("RangeError","range error")}for(vary="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),g=0;g<y.length;++g)"function"==typeofArray.prototype[y[g]]&&(d.prototype[y[g]]=Array.prototype[y[g]]);a.defineProperty(d.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),d.prototype.isOperational=!0;varm=0;d.prototype.toString=function(){vart=Array(4*m+1).join(" "),e="\n"+t+"AggregateError of:\n";m++,t=Array(4*m+1).join(" ");for(varn=0;n<this.length;++n){for(varr=this[n]===this?"[Circular AggregateError]":this[n]+"",i=r.split("\n"),o=0;o<i.length;++o)i[o]=t+i[o];r=i.join("\n"),e+=r+"\n"}returnm--,e},l(i,Error);varb=Error.__BluebirdErrorTypes__;b||(b=c({CancellationError:h,TimeoutError:_,OperationalError:i,RejectionError:i,AggregateError:d}),a.defineProperty(Error,"__BluebirdErrorTypes__",{value:b,writable:!1,enumerable:!1,configurable:!1})),e.exports={Error:Error,TypeError:o,RangeError:s,CancellationError:b.CancellationError,OperationalError:b.OperationalError,TimeoutError:b.TimeoutError,AggregateError:b.AggregateError,Warning:f}},{"./es5":13,"./util":36}],13:[function(t,e,n){varr=function(){"use strict";returnvoid0===this}();if(r)e.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:r,propertyIsWritable:function(t,e){varn=Object.getOwnPropertyDescriptor(t,e);return!(n&&!n.writable&&!n.set)}};else{vari={}.hasOwnProperty,o={}.toString,s={}.constructor.prototype,a=function(t){vare=[];for(varnint)i.call(t,n)&&e.push(n);returne},c=function(t,e){return{value:t[e]}},u=function(t,e,n){returnt[e]=n.value,t},l=function(t){returnt},p=function(t){try{returnObject(t).constructor.prototype}catch(e){returns}},f=function(t){try{return"[object Array]"===o.call(t)}catch(e){return!1}};e.exports={isArray:f,keys:a,names:a,defineProperty:u,getDescriptor:c,freeze:l,getPrototypeOf:p,isES5:r,propertyIsWritable:function(){return!0}}}},{}],14:[function(t,e,n){"use strict";e.exports=function(t,e){varn=t.map;t.prototype.filter=function(t,r){returnn(this,t,r,e)},t.filter=function(t,r,i){returnn(t,r,i,e)}}},{}],15:[function(t,e,n){"use strict";e.exports=function(e,n,r){functioni(t,e,n){this.promise=t,this.type=e,this.handler=n,this.called=!1,this.cancelPromise=null}functiono(t){this.finallyHandler=t}functions(t,e){returnnull!=t.cancelPromise?(arguments.length>1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0):!1}functiona(){returnu.call(this,this.promise._target()._settledValue())}functionc(t){returns(this,t)?void0:(f.e=t,f)}functionu(t){vari=this.promise,u=this.handler;if(!this.called){this.called=!0;varl=this.isFinallyHandler()?u.call(i._boundValue()):u.call(i._boundValue(),t);if(l===r)returnl;if(void0!==l){i._setReturnedNonUndefined();varh=n(l,i);if(hinstanceofe){if(null!=this.cancelPromise){if(h._isCancelled()){var_=newp("late cancellation observer");returni._attachExtraTrace(_),f.e=_,f}h.isPending()&&h._attachCancellationCallback(newo(this))}returnh._then(a,c,void0,this,void0)}}}returni.isRejected()?(s(this),f.e=t,f):(s(this),t)}varl=t("./util"),p=e.CancellationError,f=l.errorObj,h=t("./catch_filter")(r);returni.prototype.isFinallyHandler=function(){return0===this.type},o.prototype._resultCancelled=function(){s(this.finallyHandler)},e.prototype._passThrough=function(t,e,n,r){return"function"!=typeoft?this.then():this._then(n,r,void0,newi(this,e,t),void0)},e.prototype.lastly=e.prototype["finally"]=function(t){returnthis._passThrough(t,0,u,u)},e.prototype.tap=function(t){returnthis._passThrough(t,1,u)},e.prototype.tapCatch=function(t){varn=arguments.length;if(1===n)returnthis._passThrough(t,1,void0,u);varr,i=newArray(n-1),o=0;for(r=0;n-1>r;++r){vars=arguments[r];if(!l.isObject(s))returne.reject(newTypeError("tapCatch statement predicate: expecting an object but got "+l.classString(s)));i[o++]=s}i.length=o;vara=arguments[r];returnthis._passThrough(h(i,a,this),1,void0,u)},i}},{"./catch_filter":7,"./util":36}],16:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){functiona(t,n,r){for(varo=0;o<n.length;++o){r._pushContext();vars=h(n[o])(t);if(r._popContext(),s===f){r._pushContext();vara=e.reject(f.e);returnr._popContext(),a}varc=i(s,r);if(cinstanceofe)returnc}returnnull}functionc(t,n,i,o){if(s.cancellation()){vara=newe(r),c=this._finallyPromise=newe(r);this._promise=a.lastly(function(){returnc}),a._captureStackTrace(),a._setOnCancel(this)}else{varu=this._promise=newe(r);u._captureStackTrace()}this._stack=o,this._generatorFunction=t,this._receiver=n,this._generator=void0,this._yieldHandlers="function"==typeofi?[i].concat(_):_,this._yieldedPromise=null,this._cancellationPhase=!1}varu=t("./errors"),l=u.TypeError,p=t("./util"),f=p.errorObj,h=p.tryCatch,_=[];p.inherits(c,o),c.prototype._isResolved=function(){returnnull===this._promise},c.prototype._cleanup=function(){this._promise=this._generator=null,s.cancellation()&&null!==this._finallyPromise&&(this._finallyPromise._fulfill(),this._finallyPromise=null)},c.prototype._promiseCancelled=function(){if(!this._isResolved()){vart,n="undefined"!=typeofthis._generator["return"];if(n)this._promise._pushContext(),t=h(this._generator["return"]).call(this._generator,void0),this._promise._popContext();else{varr=newe.CancellationError("generator .return() sentinel");e.coroutine.returnSentinel=r,this._promise._attachExtraTrace(r),this._promise._pushContext(),t=h(this._generator["throw"]).call(this._generator,r),this._promise._popContext()}this._cancellationPhase=!0,this._yieldedPromise=null,this._continue(t)}},c.prototype._promiseFulfilled=function(t){this._yieldedPromise=null,this._promise._pushContext();vare=h(this._generator.next).call(this._generator,t);this._promise._popContext(),this._continue(e)},c.prototype._promiseRejected=function(t){this._yieldedPromise=null,this._promise._attachExtraTrace(t),this._promise._pushContext();vare=h(this._generator["throw"]).call(this._generator,t);this._promise._popContext(),this._continue(e)},c.prototype._resultCancelled=function(){if(this._yieldedPromiseinstanceofe){vart=this._yieldedPromise;this._yieldedPromise=null,t.cancel()}},c.prototype.promise=function(){returnthis._promise},c.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void0,this._promiseFulfilled(void0)},c.prototype._continue=function(t){varn=this._promise;if(t===f)returnthis._cleanup(),this._cancellationPhase?n.cancel():n._rejectCallback(t.e,!1);varr=t.value;if(t.done===!0)returnthis._cleanup(),this._cancellationPhase?n.cancel():n._resolveCallback(r);varo=i(r,this._promise);if(!(oinstanceofe)&&(o=a(o,this._yieldHandlers,this._promise),null===o))returnvoidthis._promiseRejected(newl("A value %s was yielded that could not be treated as a promise\n\n See http://goo.gl/MqrFmX\n\n".replace("%s",String(r))+"From coroutine:\n"+this._stack.split("\n").slice(1,-7).join("\n")));o=o._target();vars=o._bitField;0===(50397184&s)?(this._yieldedPromise=o,o._proxy(this,null)):0!==(33554432&s)?e._async.invoke(this._promiseFulfilled,this,o._value()):0!==(16777216&s)?e._async.invoke(this._promiseRejected,this,o._reason()):this._promiseCancelled()},e.coroutine=function(t,e){if("function"!=typeoft)thrownewl("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");varn=Object(e).yieldHandler,r=c,i=(newError).stack;returnfunction(){vare=t.apply(this,arguments),o=newr(void0,void0,n,i),s=o.promise();returno._generator=e,o._promiseFulfilled(void0),s}},e.coroutine.addYieldHandler=function(t){if("function"!=typeoft)thrownewl("expecting a function but got "+p.classString(t));_.push(t)},e.spawn=function(t){if(s.deprecated("Promise.spawn()","Promise.coroutine()"),"function"!=typeoft)returnn("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");varr=newc(t,this),i=r.promise();returnr._run(e.spawn),i}}},{"./errors":12,"./util":36}],17:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){vars=t("./util");s.canEvaluate,s.tryCatch,s.errorObj;e.join=function(){vart,e=arguments.length-1;if(e>0&&"function"==typeofarguments[e]){t=arguments[e];varr}vari=[].slice.call(arguments);t&&i.pop();varr=newn(i).promise();returnvoid0!==t?r.spread(t):r}}},{"./util":36}],18:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){functiona(t,n,r,i){this.constructor$(t),this._promise._captureStackTrace();vars=e._getContext();if(this._callback=u.contextBind(s,n),this._preservedValues=i===o?newArray(this.length()):null,this._limit=r,this._inFlight=0,this._queue=[],f.invoke(this._asyncInit,this,void0),u.isArray(t))for(vara=0;a<t.length;++a){varc=t[a];cinstanceofe&&c.suppressUnhandledRejections()}}functionc(t,n,i,o){if("function"!=typeofn)returnr("expecting a function but got "+u.classString(n));vars=0;if(void0!==i){if("object"!=typeofi||null===i)returne.reject(newTypeError("options argument must be an object but it is "+u.classString(i)));if("number"!=typeofi.concurrency)returne.reject(newTypeError("'concurrency' must be a number but it is "+u.classString(i.concurrency)));s=i.concurrency}returns="number"==typeofs&&isFinite(s)&&s>=1?s:0,newa(t,n,s,o).promise()}varu=t("./util"),l=u.tryCatch,p=u.errorObj,f=e._async;u.inherits(a,n),a.prototype._asyncInit=function(){this._init$(void0,-2)},a.prototype._init=function(){},a.prototype._promiseFulfilled=function(t,n){varr=this._values,o=this.length(),a=this._preservedValues,c=this._limit;if(0>n){if(n=-1*n-1,r[n]=t,c>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(c>=1&&this._inFlight>=c)returnr[n]=t,this._queue.push(n),!1;null!==a&&(a[n]=t);varu=this._promise,f=this._callback,h=u._boundValue();u._pushContext();var_=l(f).call(h,t,n,o),d=u._popContext();if(s.checkForgottenReturns(_,d,null!==a?"Promise.filter":"Promise.map",u),_===p)returnthis._reject(_.e),!0;varv=i(_,this._promise);if(vinstanceofe){v=v._target();vary=v._bitField;if(0===(50397184&y))returnc>=1&&this._inFlight++,r[n]=v,v._proxy(this,-1*(n+1)),!1;if(0===(33554432&y))return0!==(16777216&y)?(this._reject(v._reason()),!0):(this._cancel(),!0);_=v._value()}r[n]=_}varg=++this._totalResolved;returng>=o?(null!==a?this._filter(r,a):this._resolve(r),!0):!1},a.prototype._drainQueue=function(){for(vart=this._queue,e=this._limit,n=this._values;t.length>0&&this._inFlight<e;){if(this._isResolved())return;varr=t.pop();this._promiseFulfilled(n[r],r)}},a.prototype._filter=function(t,e){for(varn=e.length,r=newArray(n),i=0,o=0;n>o;++o)t[o]&&(r[i++]=e[o]);r.length=i,this._resolve(r)},a.prototype.preservedValues=function(){returnthis._preservedValues},e.prototype.map=function(t,e){returnc(this,t,e,null)},e.map=function(t,e,n,r){returnc(t,e,n,r)}}},{"./util":36}],19:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){vars=t("./util"),a=s.tryCatch;e.method=function(t){if("function"!=typeoft)thrownewe.TypeError("expecting a function but got "+s.classString(t));returnfunction(){varr=newe(n);r._captureStackTrace(),r._pushContext();vari=a(t).apply(this,arguments),s=r._popContext();returno.checkForgottenReturns(i,s,"Promise.method",r),r._resolveFromSyncValue(i),r}},e.attempt=e["try"]=function(t){if("function"!=typeoft)returni("expecting a function but got "+s.classString(t));varr=newe(n);r._captureStackTrace(),r._pushContext();varc;if(arguments.length>1){o.deprecated("calling Promise.try with more than 1 argument");varu=arguments[1],l=arguments[2];c=s.isArray(u)?a(t).apply(l,u):a(t).call(l,u)}elsec=a(t)();varp=r._popContext();returno.checkForgottenReturns(c,p,"Promise.try",r),r._resolveFromSyncValue(c),r},e.prototype._resolveFromSyncValue=function(t){t===s.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{"./util":36}],20:[function(t,e,n){"use strict";functionr(t){returntinstanceofError&&l.getPrototypeOf(t)===Error.prototype}functioni(t){vare;if(r(t)){e=newu(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(varn=l.keys(t),i=0;i<n.length;++i){varo=n[i];p.test(o)||(e[o]=t[o])}returne}returns.markAsOriginatingFromRejection(t),t}functiono(t,e){returnfunction(n,r){if(null!==t){if(n){varo=i(a(n));t._attachExtraTrace(o),t._reject(o)}elseif(e){vars=[].slice.call(arguments,1);t._fulfill(s)}elset._fulfill(r);t=null}}}vars=t("./util"),a=s.maybeWrapAsError,c=t("./errors"),u=c.OperationalError,l=t("./es5"),p=/^(?:name|message|stack|cause)$/;e.exports=o},{"./errors":12,"./es5":13,"./util":36}],21:[function(t,e,n){"use strict";e.exports=function(e){functionn(t,e){varn=this;if(!o.isArray(t))returnr.call(n,t,e);vari=a(e).apply(n._boundValue(),[null].concat(t));i===c&&s.throwLater(i.e)}functionr(t,e){varn=this,r=n._boundValue(),i=void0===t?a(e).call(r,null):a(e).call(r,null,t);i===c&&s.throwLater(i.e)}functioni(t,e){varn=this;if(!t){varr=newError(t+"");r.cause=t,t=r}vari=a(e).call(n._boundValue(),t);i===c&&s.throwLater(i.e)}varo=t("./util"),s=e._async,a=o.tryCatch,c=o.errorObj;e.prototype.asCallback=e.prototype.nodeify=function(t,e){if("function"==typeoft){varo=r;void0!==e&&Object(e).spread&&(o=n),this._then(o,i,void0,this,t)}returnthis}}},{"./util":36}],22:[function(t,e,n){"use strict";e.exports=function(){functionn(){}functionr(t,e){if(null==t||t.constructor!==i)thrownewE("the promise constructor cannot be invoked directly\n\n See http://goo.gl/MqrFmX\n");if("function"!=typeofe)thrownewE("expecting a function but got "+f.classString(e))}functioni(t){t!==x&&r(this,t),this._bitField=0,this._fulfillmentHandler0=void0,this._rejectionHandler0=void0,this._promise0=void0,this._receiver0=void0,this._resolveFromExecutor(t),this._promiseCreated(),this._fireEvent("promiseCreated",this)}functiono(t){this.promise._resolveCallback(t)}functions(t){this.promise._rejectCallback(t,!1)}functiona(t){vare=newi(x);e._fulfillmentHandler0=t,e._rejectionHandler0=t,e._promise0=t,e._receiver0=t}varc=function(){returnnewE("circular promise resolution chain\n\n See http://goo.gl/MqrFmX\n")},u=function(){returnnewi.PromiseInspection(this._target())},l=function(t){returni.reject(newE(t))},p={},f=t("./util");f.setReflectHandler(u);varh=function(){vart=process.domain;returnvoid0===t?null:t},_=function(){returnnull},d=function(){return{domain:h(),async:null}},v=f.isNode&&f.nodeSupportsAsyncResource?t("async_hooks").AsyncResource:null,y=function(){return{domain:h(),async:newv("Bluebird::Promise")}},g=f.isNode?d:_;f.notEnumerableProp(i,"_getContext",g);varm=function(){g=y,f.notEnumerableProp(i,"_getContext",y)},b=function(){g=d,f.notEnumerableProp(i,"_getContext",d)},w=t("./es5"),C=t("./async"),j=newC;w.defineProperty(i,"_async",{value:j});vark=t("./errors"),E=i.TypeError=k.TypeError;i.RangeError=k.RangeError;varF=i.CancellationError=k.CancellationError;i.TimeoutError=k.TimeoutError,i.OperationalError=k.OperationalError,i.RejectionError=k.OperationalError,i.AggregateError=k.AggregateError;varx=function(){},T={},P={},R=t("./thenables")(i,x),S=t("./promise_array")(i,x,R,l,n),O=t("./context")(i),A=O.create,V=t("./debuggability")(i,O,m,b),H=(V.CapturedTrace,t("./finally")(i,R,P)),D=t("./catch_filter")(P),I=t("./nodeback"),L=f.errorObj,N=f.tryCatch;returni.prototype.toString=function(){return"[object Promise]"},i.prototype.caught=i.prototype["catch"]=function(t){vare=arguments.length;if(e>1){varn,r=newArray(e-1),i=0;for(n=0;e-1>n;++n){varo=arguments[n];if(!f.isObject(o))returnl("Catch statement predicate: expecting an object but got "+f.classString(o));r[i++]=o}if(r.length=i,t=arguments[n],"function"!=typeoft)thrownewE("The last argument to .catch() must be a function, got "+f.toString(t));returnthis.then(void0,D(r,t,this))}returnthis.then(void0,t)},i.prototype.reflect=function(){returnthis._then(u,u,void0,this,void0)},i.prototype.then=function(t,e){if(V.warnings()&&arguments.length>0&&"function"!=typeoft&&"function"!=typeofe){varn=".then() only accepts functions but was passed: "+f.classString(t);arguments.length>1&&(n+=", "+f.classString(e)),this._warn(n)}returnthis._then(t,e,void0,void0,void0)},i.prototype.done=function(t,e){varn=this._then(t,e,void0,void0,void0);n._setIsFinal()},i.prototype.spread=function(t){return"function"!=typeoft?l("expecting a function but got "+f.classString(t)):this.all()._then(t,void0,void0,T,void0)},i.prototype.toJSON=function(){vart={isFulfilled:!1,isRejected:!1,fulfillmentValue:void0,rejectionReason:void0};returnthis.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},i.prototype.all=function(){returnarguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),newS(this).promise()},i.prototype.error=function(t){returnthis.caught(f.originatesFromRejection,t)},i.getNewLibraryCopy=e.exports,i.is=function(t){returntinstanceofi},i.fromNode=i.fromCallback=function(t){vare=newi(x);e._captureStackTrace();varn=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,r=N(t)(I(e,n));returnr===L&&e._rejectCallback(r.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},i.all=function(t){returnnewS(t).promise()},i.cast=function(t){vare=R(t);returneinstanceofi||(e=newi(x),e._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},i.resolve=i.fulfilled=i.cast,i.reject=i.rejected=function(t){vare=newi(x);returne._captureStackTrace(),e._rejectCallback(t,!0),e},i.setScheduler=function(t){if("function"!=typeoft)thrownewE("expecting a function but got "+f.classString(t));returnj.setScheduler(t)},i.prototype._then=function(t,e,n,r,o){vars=void0!==o,a=s?o:newi(x),c=this._target(),u=c._bitField;s||(a._propagateFrom(this,3),a._captureStackTrace(),void0===r&&0!==(2097152&this._bitField)&&(r=0!==(50397184&u)?this._boundValue():c===this?void0:this._boundTo),this._fireEvent("promiseChained",this,a));varl=g();if(0!==(50397184&u)){varp,h,_=c._settlePromiseCtx;0!==(33554432&u)?(h=c._rejectionHandler0,p=t):0!==(16777216&u)?(h=c._fulfillmentHandler0,p=e,c._unsetRejectionIsUnhandled()):(_=c._settlePromiseLateCancellationObserver,h=newF("late cancellation observer"),c._attachExtraTrace(h),p=e),j.invoke(_,c,{handler:f.contextBind(l,p),promise:a,receiver:r,value:h})}elsec._addCallbacks(t,e,a,r,l);returna},i.prototype._length=function(){return65535&this._bitField},i.prototype._isFateSealed=function(){return0!==(117506048&this._bitField)},i.prototype._isFollowing=function(){return67108864===(67108864&this._bitField)},i.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t},i.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},i.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},i.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},i.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},i.prototype._isFinal=function(){return(4194304&this._bitField)>0},i.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},i.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},i.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},i.prototype._setAsyncGuaranteed=function(){if(!j.hasCustomScheduler()){vart=this._bitField;this._bitField=t|(536870912&t)>>2^134217728}},i.prototype._setNoAsyncGuarantee=function(){this._bitField=-134217729&(536870912|this._bitField)},i.prototype._receiverAt=function(t){vare=0===t?this._receiver0:this[4*t-4+3];returne===p?void0:void0===e&&this._isBound()?this._boundValue():e},i.prototype._promiseAt=function(t){returnthis[4*t-4+2]},i.prototype._fulfillmentHandlerAt=function(t){returnthis[4*t-4+0]},i.prototype._rejectionHandlerAt=function(t){returnthis[4*t-4+1]},i.prototype._boundValue=function(){},i.prototype._migrateCallback0=function(t){vare=(t._bitField,t._fulfillmentHandler0),n=t._rejectionHandler0,r=t._promise0,i=t._receiverAt(0);void0===i&&(i=p),this._addCallbacks(e,n,r,i,null)},i.prototype._migrateCallbackAt=function(t,e){varn=t._fulfillmentHandlerAt(e),r=t._rejectionHandlerAt(e),i=t._promiseAt(e),o=t._receiverAt(e);void0===o&&(o=p),this._addCallbacks(n,r,i,o,null)},i.prototype._addCallbacks=function(t,e,n,r,i){varo=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=n,this._receiver0=r,"function"==typeoft&&(this._fulfillmentHandler0=f.contextBind(i,t)),"function"==typeofe&&(this._rejectionHandler0=f.contextBind(i,e));else{vars=4*o-4;this[s+2]=n,this[s+3]=r,"function"==typeoft&&(this[s+0]=f.contextBind(i,t)),"function"==typeofe&&(this[s+1]=f.contextBind(i,e))}returnthis._setLength(o+1),o},i.prototype._proxy=function(t,e){this._addCallbacks(void0,void0,e,t,null)},i.prototype._resolveCallback=function(t,e){if(0===(117506048&this._bitField)){if(t===this)returnthis._rejectCallback(c(),!1);varn=R(t,this);if(!(ninstanceofi))returnthis._fulfill(t);e&&this._propagateFrom(n,2);varr=n._target();if(r===this)returnvoidthis._reject(c());varo=r._bitField;if(0===(50397184&o)){vars=this._length();s>0&&r._migrateCallback0(this);for(vara=1;s>a;++a)r._migrateCallbackAt(this,a);this._setFollowing(),this._setLength(0),this._setFollowee(n)}elseif(0!==(33554432&o))this._fulfill(r._value());elseif(0!==(16777216&o))this._reject(r._reason());else{varu=newF("late cancellation observer");r._attachExtraTrace(u),this._reject(u)}}},i.prototype._rejectCallback=function(t,e,n){varr=f.ensureErrorObject(t),i=r===t;if(!i&&!n&&V.warnings()){varo="a promise was rejected with a non-error: "+f.classString(t);this._warn(o,!0)}this._attachExtraTrace(r,e?i:!1),this._reject(t)},i.prototype._resolveFromExecutor=function(t){if(t!==x){vare=this;this._captureStackTrace(),this._pushContext();varn=!0,r=this._execute(t,function(t){e._resolveCallback(t)},function(t){e._rejectCallback(t,n)});n=!1,this._popContext(),void0!==r&&e._rejectCallback(r,!0)}},i.prototype._settlePromiseFromHandler=function(t,e,n,r){vari=r._bitField;if(0===(65536&i)){r._pushContext();varo;e===T?n&&"number"==typeofn.length?o=N(t).apply(this._boundValue(),n):(o=L,o.e=newE("cannot .spread() a non-array: "+f.classString(n))):o=N(t).call(e,n);vars=r._popContext();i=r._bitField,0===(65536&i)&&(o===P?r._reject(n):o===L?r._rejectCallback(o.e,!1):(V.checkForgottenReturns(o,s,"",r,this),r._resolveCallback(o)))}},i.prototype._target=function(){for(vart=this;t._isFollowing();)t=t._followee();returnt},i.prototype._followee=function(){returnthis._rejectionHandler0},i.prototype._setFollowee=function(t){this._rejectionHandler0=t},i.prototype._settlePromise=function(t,e,r,o){vars=tinstanceofi,a=this._bitField,c=0!==(134217728&a);0!==(65536&a)?(s&&t._invokeInternalOnCancel(),rinstanceofH&&r.isFinallyHandler()?(r.cancelPromise=t,N(e).call(r,o)===L&&t._reject(L.e)):e===u?t._fulfill(u.call(r)):rinstanceofn?r._promiseCancelled(t):s||tinstanceofS?t._cancel():r.cancel()):"function"==typeofe?s?(c&&t._setAsyncGuaranteed(),this._settlePromiseFromHandler(e,r,o,t)):e.call(r,o,t):rinstanceofn?r._isResolved()||(0!==(33554432&a)?r._promiseFulfilled(o,t):r._promiseRejected(o,t)):s&&(c&&t._setAsyncGuaranteed(),0!==(33554432&a)?t._fulfill(o):t._reject(o))},i.prototype._settlePromiseLateCancellationObserver=function(t){vare=t.handler,n=t.promise,r=t.receiver,o=t.value;"function"==typeofe?ninstanceofi?this._settlePromiseFromHandler(e,r,o,n):e.call(r,o,n):ninstanceofi&&n._reject(o)},i.prototype._settlePromiseCtx=function(t){this._settlePromise(t.promise,t.handler,t.receiver,t.value)},i.prototype._settlePromise0=function(t,e,n){varr=this._promise0,i=this._receiverAt(0);this._promise0=void0,this._receiver0=void0,this._settlePromise(r,t,i,e)},i.prototype._clearCallbackDataAtIndex=function(t){vare=4*t-4;this[e+2]=this[e+3]=this[e+0]=this[e+1]=void0},i.prototype._fulfill=function(t){vare=this._bitField;if(!((117506048&e)>>>16)){if(t===this){varn=c();returnthis._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!==(134217728&e)?this._settlePromises():j.settlePromises(this),this._dereferenceTrace())}},i.prototype._reject=function(t){vare=this._bitField;if(!((117506048&e)>>>16))returnthis._setRejected(),this._fulfillmentHandler0=t,this._isFinal()?j.fatalError(t,f.isNode):void((65535&e)>0?j.settlePromises(this):this._ensurePossibleRejectionHandled())},i.prototype._fulfillPromises=function(t,e){for(varn=1;t>n;n++){varr=this._fulfillmentHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},i.prototype._rejectPromises=function(t,e){for(varn=1;t>n;n++){varr=this._rejectionHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},i.prototype._settlePromises=function(){vart=this._bitField,e=65535&t;if(e>0){if(0!==(16842752&t)){varn=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,t),this._rejectPromises(e,n)}else{varr=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,r,t),this._fulfillPromises(e,r)}this._setLength(0)}this._clearCancellationData()},i.prototype._settledValue=function(){vart=this._bitField;return0!==(33554432&t)?this._rejectionHandler0:0!==(16777216&t)?this._fulfillmentHandler0:void0},"undefined"!=typeofSymbol&&Symbol.toStringTag&&w.defineProperty(i.prototype,Symbol.toStringTag,{get:function(){return"Object"}}),i.defer=i.pending=function(){V.deprecated("Promise.defer","new Promise");vart=newi(x);return{promise:t,resolve:o,reject:s}},f.notEnumerableProp(i,"_makeSelfResolutionError",c),t("./method")(i,x,R,l,V),t("./bind")(i,x,R,V),t("./cancel")(i,S,l,V),t("./direct_resolve")(i),t("./synchronous_inspection")(i),t("./join")(i,S,R,x,j),i.Promise=i,i.version="3.7.2",t("./call_get.js")(i),t("./generators.js")(i,l,x,R,n,V),t("./map.js")(i,S,l,R,x,V),t("./nodeify.js")(i),t("./promisify.js")(i,x),t("./props.js")(i,S,R,l),t("./race.js")(i,x,R,l),t("./reduce.js")(i,S,l,R,x,V),t("./settle.js")(i,S,V),t("./some.js")(i,S,l),t("./timers.js")(i,x,V),t("./using.js")(i,l,R,A,x,V),t("./any.js")(i),t("./each.js")(i,x),t("./filter.js")(i,x),f.toFastProperties(i),f.toFastProperties(i.prototype),a({a:1}),a({b:2}),a({c:3}),a(1),a(function(){}),a(void0),a(!1),a(newi(x)),V.setBounds(C.firstLineError,f.lastLineError),i}},{"./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,async_hooks:void0}],23:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){functions(t){switch(t){case-2:return[];case-3:return{};case-6:returnnewMap}}functiona(t){varr=this._promise=newe(n);tinstanceofe&&(r._propagateFrom(t,3),t.suppressUnhandledRejections()),r._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void0,-2)}varc=t("./util");c.isArray;returnc.inherits(a,o),a.prototype.length=function(){returnthis._length},a.prototype.promise=function(){returnthis._promise},a.prototype._init=functionu(t,n){varo=r(this._values,this._promise);if(oinstanceofe){o=o._target();vara=o._bitField;if(this._values=o,0===(50397184&a))returnthis._promise._setAsyncGuaranteed(),o._then(u,this._reject,void0,this,n);if(0===(33554432&a))return0!==(16777216&a)?this._reject(o._reason()):this._cancel();o=o._value()}if(o=c.asArray(o),null===o){varl=i("expecting an array or an iterable object but got "+c.classString(o)).reason();returnvoidthis._promise._rejectCallback(l,!1)}return0===o.length?void(-5===n?this._resolveEmptyArray():this._resolve(s(n))):voidthis._iterate(o)},a.prototype._iterate=function(t){varn=this.getActualLength(t.length);this._length=n,this._values=this.shouldCopyValues()?newArray(n):this._values;for(vari=this._promise,o=!1,s=null,a=0;n>a;++a){varc=r(t[a],i);cinstanceofe?(c=c._target(),s=c._bitField):s=null,o?null!==s&&c.suppressUnhandledRejections():null!==s?0===(50397184&s)?(c._proxy(this,a),this._values[a]=c):o=0!==(33554432&s)?this._promiseFulfilled(c._value(),a):0!==(16777216&s)?this._promiseRejected(c._reason(),a):this._promiseCancelled(a):o=this._promiseFulfilled(c,a)}o||i._setAsyncGuaranteed()},a.prototype._isResolved=function(){returnnull===this._values},a.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},a.prototype._cancel=function(){!this._isResolved()&&this._promise._isCancellable()&&(this._values=null,this._promise._cancel())},a.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1)},a.prototype._promiseFulfilled=function(t,e){this._values[e]=t;varn=++this._totalResolved;returnn>=this._length?(this._resolve(this._values),!0):!1},a.prototype._promiseCancelled=function(){returnthis._cancel(),!0},a.prototype._promiseRejected=function(t){returnthis._totalResolved++,this._reject(t),!0},a.prototype._resultCancelled=function(){if(!this._isResolved()){vart=this._values;if(this._cancel(),tinstanceofe)t.cancel();elsefor(varn=0;n<t.length;++n)t[n]instanceofe&&t[n].cancel()}},a.prototype.shouldCopyValues=function(){return!0},a.prototype.getActualLength=function(t){returnt},a}},{"./util":36}],24:[function(t,e,n){"use strict";e.exports=function(e,n){functionr(t){return!C.test(t)}functioni(t){try{returnt.__isPromisified__===!0}catch(e){return!1}}functiono(t,e,n){varr=h.getDataPropertyOrDefault(t,e+n,b);returnr?i(r):!1}functions(t,e,n){for(varr=0;r<t.length;r+=2){vari=t[r];if(n.test(i))for(varo=i.replace(n,""),s=0;s<t.length;s+=2)if(t[s]===o)thrownewg("Cannot promisify an API that has normal methods with '%s'-suffix\n\n See http://goo.gl/MqrFmX\n".replace("%s",e))}}functiona(t,e,n,r){for(vara=h.inheritedDataKeys(t),c=[],u=0;u<a.length;++u){varl=a[u],p=t[l],f=r===j?!0:j(l,p,t);"function"!=typeofp||i(p)||o(t,l,e)||!r(l,p,t,f)||c.push(l,p)}returns(c,e,n),c}functionc(t,r,i,o,s,a){functionc(){vari=r;r===f&&(i=this);varo=newe(n);o._captureStackTrace();vars="string"==typeofl&&this!==u?this[l]:t,c=_(o,a);try{s.apply(i,d(arguments,c))}catch(p){o._rejectCallback(v(p),!0,!0)}returno._isFateSealed()||o._setAsyncGuaranteed(),o}varu=function(){returnthis}(),l=t;return"string"==typeofl&&(t=o),h.notEnumerableProp(c,"__isPromisified__",!0),c}functionu(t,e,n,r,i){for(varo=newRegExp(k(e)+"$"),s=a(t,e,o,n),c=0,u=s.length;u>c;c+=2){varl=s[c],p=s[c+1],_=l+e;if(r===E)t[_]=E(l,f,l,p,e,i);else{vard=r(p,function(){returnE(l,f,l,p,e,i)});h.notEnumerableProp(d,"__isPromisified__",!0),t[_]=d}}returnh.toFastProperties(t),t}functionl(t,e,n){returnE(t,e,void0,t,null,n)}varp,f={},h=t("./util"),_=t("./nodeback"),d=h.withAppended,v=h.maybeWrapAsError,y=h.canEvaluate,g=t("./errors").TypeError,m="Async",b={__isPromisified__:!0},w=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],C=newRegExp("^(?:"+w.join("|")+")$"),j=function(t){returnh.isIdentifier(t)&&"_"!==t.charAt(0)&&"constructor"!==t},k=function(t){returnt.replace(/([$])/,"\\$")},E=y?p:c;e.promisify=function(t,e){if("function"!=typeoft)thrownewg("expecting a function but got "+h.classString(t));if(i(t))returnt;e=Object(e);varn=void0===e.context?f:e.context,o=!!e.multiArgs,s=l(t,n,o);returnh.copyDescriptors(t,s,r),s},e.promisifyAll=function(t,e){if("function"!=typeoft&&"object"!=typeoft)thrownewg("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/MqrFmX\n");e=Object(e);varn=!!e.multiArgs,r=e.suffix;"string"!=typeofr&&(r=m);vari=e.filter;"function"!=typeofi&&(i=j);varo=e.promisifier;if("function"!=typeofo&&(o=E),!h.isIdentifier(r))thrownewRangeError("suffix must be a valid identifier\n\n See http://goo.gl/MqrFmX\n");for(vars=h.inheritedDataKeys(t),a=0;a<s.length;++a){varc=t[s[a]];"constructor"!==s[a]&&h.isClass(c)&&(u(c.prototype,r,i,o,n),u(c,r,i,o,n))}returnu(t,r,i,o,n)}}},{"./errors":12,"./nodeback":20,"./util":36}],25:[function(t,e,n){"use strict";e.exports=function(e,n,r,i){functiono(t){vare,n=!1;if(void0!==a&&tinstanceofa)e=p(t),n=!0;else{varr=l.keys(t),i=r.length;e=newArray(2*i);for(varo=0;i>o;++o){vars=r[o];e[o]=t[s],e[o+i]=s}}this.constructor$(e),this._isMap=n,this._init$(void0,n?-6:-3)}functions(t){varn,s=r(t);returnu(s)?(n=sinstanceofe?s._then(e.props,void0,void0,void0,void0):newo(s).promise(),sinstanceofe&&n._propagateFrom(s,2),n):i("cannot await properties of a non-object\n\n See http://goo.gl/MqrFmX\n")}vara,c=t("./util"),u=c.isObject,l=t("./es5");"function"==typeofMap&&(a=Map);varp=function(){functiont(t,r){this[e]=t,this[e+n]=r,e++}vare=0,n=0;returnfunction(r){n=r.size,e=0;vari=newArray(2*r.size);returnr.forEach(t,i),i}}(),f=function(t){for(vare=newa,n=t.length/2|0,r=0;n>r;++r){vari=t[n+r],o=t[r];e.set(i,o)}returne};c.inherits(o,n),o.prototype._init=function(){},o.prototype._promiseFulfilled=function(t,e){this._values[e]=t;varn=++this._totalResolved;if(n>=this._length){varr;if(this._isMap)r=f(this._values);else{r={};for(vari=this.length(),o=0,s=this.length();s>o;++o)r[this._values[o+i]]=this._values[o]}returnthis._resolve(r),!0}return!1},o.prototype.shouldCopyValues=function(){return!1},o.prototype.getActualLength=function(t){returnt>>1},e.prototype.props=function(){returns(this)},e.props=function(t){returns(t)}}},{"./es5":13,"./util":36}],26:[function(t,e,n){"use strict";functionr(t,e,n,r,i){for(varo=0;i>o;++o)n[o+r]=t[o+e],t[o+e]=void0}functioni(t){this._capacity=t,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(t){returnthis._capacity<t},i.prototype._pushOne=function(t){vare=this.length();this._checkCapacity(e+1);varn=this._front+e&this._capacity-1;this[n]=t,this._length=e+1},i.prototype.push=function(t,e,n){varr=this.length()+3;if(this._willBeOverCapacity(r))returnthis._pushOne(t),this._pushOne(e),voidthis._pushOne(n);vari=this._front+r-3;this._checkCapacity(r);varo=this._capacity-1;this[i+0&o]=t,this[i+1&o]=e,this[i+2&o]=n,this._length=r},i.prototype.shift=function(){vart=this._front,e=this[t];returnthis[t]=void0,this._front=t+1&this._capacity-1,this._length--,e},i.prototype.length=function(){returnthis._length},i.prototype._checkCapacity=function(t){this._capacity<t&&this._resizeTo(this._capacity<<1)},i.prototype._resizeTo=function(t){vare=this._capacity;this._capacity=t;varn=this._front,i=this._length,o=n+i&e-1;r(this,0,this,e,o)},e.exports=i},{}],27:[function(t,e,n){"use strict";e.exports=function(e,n,r,i){functiono(t,o){varc=r(t);if(cinstanceofe)returna(c);if(t=s.asArray(t),null===t)returni("expecting an array or an iterable object but got "+s.classString(t));varu=newe(n);void0!==o&&u._propagateFrom(o,3);for(varl=u._fulfill,p=u._reject,f=0,h=t.length;h>f;++f){var_=t[f];(void0!==_||fint)&&e.cast(_)._then(l,p,void0,u,null)}returnu}vars=t("./util"),a=function(t){returnt.then(function(e){returno(e,t)})};e.race=function(t){returno(t,void0)},e.prototype.race=function(){returno(this,void0)}}},{"./util":36}],28:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){functiona(t,n,r,i){this.constructor$(t);vars=e._getContext();this._fn=f.contextBind(s,n),void0!==r&&(r=e.resolve(r),r._attachCancellationCallback(this)),this._initialValue=r,this._currentCancellable=null,i===o?this._eachValues=Array(this._length):0===i?this._eachValues=null:this._eachValues=void0,this._promise._captureStackTrace(),this._init$(void0,-5)}functionc(t,e){this.isFulfilled()?e._resolve(t):e._reject(t)}functionu(t,e,n,i){if("function"!=typeofe)returnr("expecting a function but got "+f.classString(e));varo=newa(t,e,n,i);returno.promise()}functionl(t){this.accum=t,this.array._gotAccum(t);varn=i(this.value,this.array._promise);returnninstanceofe?(this.array._currentCancellable=n,n._then(p,void0,void0,this,void0)):p.call(this,n)}functionp(t){varn=this.array,r=n._promise,i=h(n._fn);r._pushContext();varo;o=void0!==n._eachValues?i.call(r._boundValue(),t,this.index,this.length):i.call(r._boundValue(),this.accum,t,this.index,this.length),oinstanceofe&&(n._currentCancellable=o);vara=r._popContext();returns.checkForgottenReturns(o,a,void0!==n._eachValues?"Promise.each":"Promise.reduce",r),o}varf=t("./util"),h=f.tryCatch;f.inherits(a,n),a.prototype._gotAccum=function(t){void0!==this._eachValues&&null!==this._eachValues&&t!==o&&this._eachValues.push(t)},a.prototype._eachComplete=function(t){returnnull!==this._eachValues&&this._eachValues.push(t),this._eachValues},a.prototype._init=function(){},a.prototype._resolveEmptyArray=function(){this._resolve(void0!==this._eachValues?this._eachValues:this._initialValue)},a.prototype.shouldCopyValues=function(){return!1},a.prototype._resolve=function(t){this._promise._resolveCallback(t),this._values=null},a.prototype._resultCancelled=function(t){returnt===this._initialValue?this._cancel():void(this._isResolved()||(this._resultCancelled$(),this._currentCancellableinstanceofe&&this._currentCancellable.cancel(),this._initialValueinstanceofe&&this._initialValue.cancel()))},a.prototype._iterate=function(t){this._values=t;varn,r,i=t.length;void0!==this._initialValue?(n=this._initialValue,r=0):(n=e.resolve(t[0]),r=1),this._currentCancellable=n;for(varo=r;i>o;++o){vars=t[o];sinstanceofe&&s.suppressUnhandledRejections()}if(!n.isRejected())for(;i>r;++r){vara={accum:null,value:t[r],index:r,length:i,array:this};n=n._then(l,void0,void0,a,void0),0===(127&r)&&n._setNoAsyncGuarantee()}void0!==this._eachValues&&(n=n._then(this._eachComplete,void0,void0,this,void0)),n._then(c,c,void0,n,this)},e.prototype.reduce=function(t,e){returnu(this,t,e,null)},e.reduce=function(t,e,n,r){returnu(t,e,n,r)}}},{"./util":36}],29:[function(t,e,n){"use strict";varr,i=t("./util"),o=function(){thrownewError("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")},s=i.getNativePromise();if(i.isNode&&"undefined"==typeofMutationObserver){vara=global.setImmediate,c=process.nextTick;r=i.isRecentNode?function(t){a.call(global,t)}:function(t){c.call(process,t)}}elseif("function"==typeofs&&"function"==typeofs.resolve){varu=s.resolve();r=function(t){u.then(t)}}elser="undefined"!=typeofMutationObserver&&("undefined"==typeofwindow||!window.navigator||!window.navigator.standalone&&!window.cordova)&&"classList"indocument.documentElement?function(){vart=document.createElement("div"),e={attributes:!0},n=!1,r=document.createElement("div"),i=newMutationObserver(function(){t.classList.toggle("foo"),n=!1});i.observe(r,e);varo=function(){n||(n=!0,r.classList.toggle("foo"))};returnfunction(n){varr=newMutationObserver(function(){r.disconnect(),n()});r.observe(t,e),o()}}():"undefined"!=typeofsetImmediate?function(t){setImmediate(t)}:"undefined"!=typeofsetTimeout?function(t){setTimeout(t,0)}:o;e.exports=r},{"./util":36}],30:[function(t,e,n){"use strict";e.exports=function(e,n,r){functioni(t){this.constructor$(t)}varo=e.PromiseInspection,s=t("./util");s.inherits(i,n),i.prototype._promiseResolved=function(t,e){this._values[t]=e;varn=++this._totalResolved;returnn>=this._length?(this._resolve(this._values),!0):!1},i.prototype._promiseFulfilled=function(t,e){varn=newo;returnn._bitField=33554432,n._settledValueField=t,this._promiseResolved(e,n)},i.prototype._promiseRejected=function(t,e){varn=newo;returnn._bitField=16777216,n._settledValueField=t,this._promiseResolved(e,n)},e.settle=function(t){returnr.deprecated(".settle()",".reflect()"),newi(t).promise()},e.allSettled=function(t){returnnewi(t).promise()},e.prototype.settle=function(){returne.settle(this)}}},{"./util":36}],31:[function(t,e,n){"use strict";e.exports=function(e,n,r){functioni(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}functiono(t,e){if((0|e)!==e||0>e)returnr("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");varn=newi(t),o=n.promise();returnn.setHowMany(e),n.init(),o}vars=t("./util"),a=t("./errors").RangeError,c=t("./errors").AggregateError,u=s.isArray,l={};s.inherits(i,n),i.prototype._init=function(){if(this._initialized){if(0===this._howMany)returnvoidthis._resolve([]);this._init$(void0,-5);vart=u(this._values);!this._isResolved()&&t&&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(){returnthis._howMany},i.prototype.setHowMany=function(t){this._howMany=t},i.prototype._promiseFulfilled=function(t){returnthis._addFulfilled(t),this._fulfilled()===this.howMany()?(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0):!1},i.prototype._promiseRejected=function(t){returnthis._addRejected(t),this._checkOutcome()},i.prototype._promiseCancelled=function(){returnthis._valuesinstanceofe||null==this._values?this._cancel():(this._addRejected(l),this._checkOutcome())},i.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(vart=newc,e=this.length();e<this._values.length;++e)this._values[e]!==l&&t.push(this._values[e]);returnt.length>0?this._reject(t):this._cancel(),!0}return!1},i.prototype._fulfilled=function(){returnthis._totalResolved},i.prototype._rejected=function(){returnthis._values.length-this.length()},i.prototype._addRejected=function(t){this._values.push(t)},i.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},i.prototype._canPossiblyFulfill=function(){returnthis.length()-this._rejected()},i.prototype._getRangeError=function(t){vare="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";returnnewa(e)},i.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){returno(t,e)},e.prototype.some=function(t){returno(this,t)},e._SomePromiseArray=i}},{"./errors":12,"./util":36}],32:[function(t,e,n){"use strict";e.exports=function(t){functione(t){void0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void0):(this._bitField=0,this._settledValueField=void0)}e.prototype._settledValue=function(){returnthis._settledValueField};varn=e.prototype.value=function(){if(!this.isFulfilled())thrownewTypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");returnthis._settledValue()},r=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())thrownewTypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");returnthis._settledValue()},i=e.prototype.isFulfilled=function(){return0!==(33554432&this._bitField)},o=e.prototype.isRejected=function(){return0!==(16777216&this._bitField)},s=e.prototype.isPending=function(){return0===(50397184&this._bitField)},a=e.prototype.isResolved=function(){return0!==(50331648&this._bitField)};e.prototype.isCancelled=function(){return0!==(8454144&this._bitField)},t.prototype.__isCancelled=function(){return65536===(65536&this._bitField)},t.prototype._isCancelled=function(){returnthis._target().__isCancelled()},t.prototype.isCancelled=function(){return0!==(8454144&this._target()._bitField)},t.prototype.isPending=function(){returns.call(this._target())},t.prototype.isRejected=function(){returno.call(this._target())},t.prototype.isFulfilled=function(){returni.call(this._target())},t.prototype.isResolved=function(){returna.call(this._target())},t.prototype.value=function(){returnn.call(this._target())},t.prototype.reason=function(){vart=this._target();returnt._unsetRejectionIsUnhandled(),r.call(t)},t.prototype._value=function(){returnthis._settledValue()},t.prototype._reason=function(){returnthis._unsetRejectionIsUnhandled(),this._settledValue()},t.PromiseInspection=e}},{}],33:[function(t,e,n){"use strict";e.exports=function(e,n){functionr(t,r){if(l(t)){if(tinstanceofe)returnt;vari=o(t);if(i===u){r&&r._pushContext();varc=e.reject(i.e);returnr&&r._popContext(),c}if("function"==typeofi){if(s(t)){varc=newe(n);returnt._then(c._fulfill,c._reject,void0,c,null),c}returna(t,i,r)}}returnt}functioni(t){returnt.then}functiono(t){try{returni(t)}catch(e){returnu.e=e,u}}functions(t){try{returnp.call(t,"_promise0")}catch(e){return!1}}functiona(t,r,i){functiono(t){a&&(a._resolveCallback(t),a=null)}functions(t){a&&(a._rejectCallback(t,p,!0),a=null)}vara=newe(n),l=a;i&&i._pushContext(),a._captureStackTrace(),i&&i._popContext();varp=!0,f=c.tryCatch(r).call(t,o,s);returnp=!1,a&&f===u&&(a._rejectCallback(f.e,!0,!0),a=null),l}varc=t("./util"),u=c.errorObj,l=c.isObject,p={}.hasOwnProperty;returnr}},{"./util":36}],34:[function(t,e,n){"use strict";e.exports=function(e,n,r){functioni(t){this.handle=t}functiono(t){returnclearTimeout(this.handle),t}functions(t){throwclearTimeout(this.handle),t}vara=t("./util"),c=e.TimeoutError;i.prototype._resultCancelled=function(){clearTimeout(this.handle)};varu=function(t){returnl(+this).thenReturn(t)},l=e.delay=function(t,o){vars,a;returnvoid0!==o?(s=e.resolve(o)._then(u,null,null,t,void0),r.cancellation()&&oinstanceofe&&s._setOnCancel(o)):(s=newe(n),a=setTimeout(function(){s._fulfill()},+t),r.cancellation()&&s._setOnCancel(newi(a)),s._captureStackTrace()),s._setAsyncGuaranteed(),s};e.prototype.delay=function(t){returnl(t,this)};varp=function(t,e,n){varr;r="string"!=typeofe?einstanceofError?e:newc("operation timed out"):newc(e),a.markAsOriginatingFromRejection(r),t._attachExtraTrace(r),t._reject(r),null!=n&&n.cancel()};e.prototype.timeout=function(t,e){t=+t;varn,a,c=newi(setTimeout(function(){n.isPending()&&p(n,e,a)},t));returnr.cancellation()?(a=this.then(),n=a._then(o,s,void0,c,void0),n._setOnCancel(c)):n=this._then(o,s,void0,c,void0),n}}},{"./util":36}],35:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){functiona(t){setTimeout(function(){throwt},0)}functionc(t){vare=r(t);returne!==t&&"function"==typeoft._isDisposable&&"function"==typeoft._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}functionu(t,n){functioni(){if(s>=u)returnl._fulfill();varo=c(t[s++]);if(oinstanceofe&&o._isDisposable()){try{o=r(o._getDisposer().tryDispose(n),t.promise)}catch(p){returna(p)}if(oinstanceofe)returno._then(i,a,null,null,null)}i()}vars=0,u=t.length,l=newe(o);returni(),l}functionl(t,e,n){this._data=t,this._promise=e,this._context=n}functionp(t,e,n){this.constructor$(t,e,n)}functionf(t){returnl.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}functionh(t){this.length=t,this.promise=null,this[t-1]=null}var_=t("./util"),d=t("./errors").TypeError,v=t("./util").inherits,y=_.errorObj,g=_.tryCatch,m={};l.prototype.data=function(){returnthis._data},l.prototype.promise=function(){returnthis._promise},l.prototype.resource=function(){returnthis.promise().isFulfilled()?this.promise().value():m},l.prototype.tryDispose=function(t){vare=this.resource(),n=this._context;void0!==n&&n._pushContext();varr=e!==m?this.doDispose(e,t):null;returnvoid0!==n&&n._popContext(),this._promise._unsetDisposable(),this._data=null,r},l.isDisposer=function(t){returnnull!=t&&"function"==typeoft.resource&&"function"==typeoft.tryDispose},v(p,l),p.prototype.doDispose=function(t,e){varn=this.data();returnn.call(t,t,e)},h.prototype._resultCancelled=function(){for(vart=this.length,n=0;t>n;++n){varr=this[n];rinstanceofe&&r.cancel()}},e.using=function(){vart=arguments.length;if(2>t)returnn("you must pass at least 2 arguments to Promise.using");vari=arguments[t-1];if("function"!=typeofi)returnn("expecting a function but got "+_.classString(i));varo,a=!0;2===t&&Array.isArray(arguments[0])?(o=arguments[0],t=o.length,a=!1):(o=arguments,t--);for(varc=newh(t),p=0;t>p;++p){vard=o[p];if(l.isDisposer(d)){varv=d;d=d.promise(),d._setDisposable(v)}else{varm=r(d);minstanceofe&&(d=m._then(f,null,null,{resources:c,index:p},void0))}c[p]=d}for(varb=newArray(c.length),p=0;p<b.length;++p)b[p]=e.resolve(c[p]).reflect();varw=e.all(b).then(function(t){for(vare=0;e<t.length;++e){varn=t[e];if(n.isRejected())returny.e=n.error(),y;if(!n.isFulfilled())returnvoidw.cancel();t[e]=n.value()}C._pushContext(),i=g(i);varr=a?i.apply(void0,t):i(t),o=C._popContext();returns.checkForgottenReturns(r,o,"Promise.using",C),r}),C=w.lastly(function(){vart=newe.PromiseInspection(w);returnu(c,t)});returnc.promise=C,C._setOnCancel(c),C},e.prototype._setDisposable=function(t){this._bitField=131072|this._bitField,this._disposer=t},e.prototype._isDisposable=function(){return(131072&this._bitField)>0},e.prototype._getDisposer=function(){returnthis._disposer},e.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void0},e.prototype.disposer=function(t){if("function"==typeoft)returnnewp(t,this,i());thrownewd}}},{"./errors":12,"./util":36}],36:[function(t,e,n){"use strict";functionr(){try{vart=P;returnP=null,t.apply(this,arguments)}catch(e){returnT.e=e,T}}functioni(t){returnP=t,r}functiono(t){returnnull==t||t===!0||t===!1||"string"==typeoft||"number"==typeoft}functions(t){return"function"==typeoft||"object"==typeoft&&null!==t}functiona(t){returno(t)?newError(v(t)):t}functionc(t,e){varn,r=t.length,i=newArray(r+1);for(n=0;r>n;++n)i[n]=t[n];returni[n]=e,i}functionu(t,e,n){if(!F.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void0;varr=Object.getOwnPropertyDescriptor(t,e);returnnull!=r?null==r.get&&null==r.set?r.value:n:void0}functionl(t,e,n){if(o(t))returnt;varr={value:n,configurable:!0,enumerable:!1,writable:!0};returnF.defineProperty(t,e,r),t}functionp(t){throwt}functionf(t){try{if("function"==typeoft){vare=F.names(t.prototype),n=F.isES5&&e.length>1,r=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=A.test(t+"")&&F.names(t).length>0;if(n||r||i)return!0}return!1}catch(o){return!1}}functionh(t){functione(){}functionn(){returntypeofr.foo}e.prototype=t;varr=newe;returnn(),n(),t}function_(t){returnV.test(t)}functiond(t,e,n){for(varr=newArray(t),i=0;t>i;++i)r[i]=e+i+n;returnr}functionv(t){try{returnt+""}catch(e){return"[no string representation]"}}functiony(t){returntinstanceofError||null!==t&&"object"==typeoft&&"string"==typeoft.message&&"string"==typeoft.name}functiong(t){try{l(t,"isOperational",!0)}catch(e){}}functionm(t){returnnull==t?!1:tinstanceofError.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0}functionb(t){returny(t)&&F.propertyIsWritable(t,"stack")}functionw(t){return{}.toString.call(t)}functionC(t,e,n){for(varr=F.names(t),i=0;i<r.length;++i){varo=r[i];if(n(o))try{F.defineProperty(e,o,F.getDescriptor(t,o))}catch(s){}}}functionj(t){returnN?process.env[t]:void0}functionk(){if("function"==typeofPromise)try{vart=newPromise(function(){});if("[object Promise]"===w(t))returnPromise}catch(e){}}functionE(t,e){if(null===t||"function"!=typeofe||e===U)returne;null!==t.domain&&(e=t.domain.bind(e));varn=t.async;if(null!==n){varr=e;e=function(){vart=newArray(2).concat([].slice.call(arguments));returnt[0]=r,t[1]=this,n.runInAsyncScope.apply(n,t)}}returne}varF=t("./es5"),x="undefined"==typeofnavigator,T={e:{}},P,R="undefined"!=typeofself?self:"undefined"!=typeofwindow?window:"undefined"!=typeofglobal?global:void0!==this?this:null,S=function(t,e){functionn(){this.constructor=t,this.constructor$=e;for(varnine.prototype)r.call(e.prototype,n)&&"$"!==n.charAt(n.length-1)&&(this[n+"$"]=e.prototype[n])}varr={}.hasOwnProperty;returnn.prototype=e.prototype,t.prototype=newn,t.prototype},O=function(){vart=[Array.prototype,Object.prototype,Function.prototype],e=function(e){for(varn=0;n<t.length;++n)if(t[n]===e)return!0;return!1};if(F.isES5){varn=Object.getOwnPropertyNames;returnfunction(t){for(varr=[],i=Object.create(null);null!=t&&!e(t);){varo;try{o=n(t)}catch(s){returnr}for(vara=0;a<o.length;++a){varc=o[a];if(!i[c]){i[c]=!0;varu=Object.getOwnPropertyDescriptor(t,c);null!=u&&null==u.get&&null==u.set&&r.push(c)}}t=F.getPrototypeOf(t)}returnr}}varr={}.hasOwnProperty;returnfunction(n){if(e(n))return[];vari=[];t:for(varoinn)if(r.call(n,o))i.push(o);else{for(vars=0;s<t.length;++s)if(r.call(t[s],o))continuet;i.push(o)}returni}}(),A=/this\s*\.\s*\S+\s*=/,V=/^[a-z$_][a-z$_0-9]*$/i,H=function(){return"stack"innewError?function(t){returnb(t)?t:newError(v(t))}:function(t){if(b(t))returnt;try{thrownewError(v(t))}catch(e){returne}}}(),D=function(t){returnF.isArray(t)?t:null};if("undefined"!=typeofSymbol&&Symbol.iterator){varI="function"==typeofArray.from?function(t){returnArray.from(t)}:function(t){for(vare,n=[],r=t[Symbol.iterator]();!(e=r.next()).done;)n.push(e.value);returnn};D=function(t){returnF.isArray(t)?t:null!=t&&"function"==typeoft[Symbol.iterator]?I(t):null}}varL="undefined"!=typeofprocess&&"[object process]"===w(process).toLowerCase(),N="undefined"!=typeofprocess&&"undefined"!=typeofprocess.env,U,B={setReflectHandler:function(t){U=t},isClass:f,isIdentifier:_,inheritedDataKeys:O,getDataPropertyOrDefault:u,thrower:p,isArray:F.isArray,asArray:D,notEnumerableProp:l,isPrimitive:o,isObject:s,isError:y,canEvaluate:x,errorObj:T,tryCatch:i,inherits:S,withAppended:c,maybeWrapAsError:a,toFastProperties:h,filledRange:d,toString:v,canAttachTrace:b,ensureErrorObject:H,originatesFromRejection:m,markAsOriginatingFromRejection:g,classString:w,copyDescriptors:C,isNode:L,hasEnvVariables:N,env:j,global:R,getNativePromise:k,contextBind:E};B.isRecentNode=B.isNode&&function(){vart;returnprocess.versions&&process.versions.node?t=process.versions.node.split(".").map(Number):process.version&&(t=process.version.split(".").map(Number)),0===t[0]&&t[1]>10||t[0]>0}(),B.nodeSupportsAsyncResource=B.isNode&&function(){vare=!1;try{varn=t("async_hooks").AsyncResource;e="function"==typeofn.prototype.runInAsyncScope}catch(r){e=!1}returne}(),B.isNode&&B.toFastProperties(process);try{thrownewError}catch(M){B.lastLineError=M}e.exports=B},{"./es5":13,async_hooks:void0}]},{},[4])(4)}),"undefined"!=typeofwindow&&null!==window?window.P=window.Promise:"undefined"!=typeofself&&null!==self&&(self.P=self.Promise);