this._preservedValues=r===o?newArray(this.length()):null,this._limit=n,this._inFlight=0,this._queue=n>=1?[]:f,this._init$(void0,-2)}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()}varl=e._getDomain,u=t("./util"),p=u.tryCatch,h=u.errorObj,f=[];u.inherits(a,n),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);varl=this._promise,u=this._callback,f=l._boundValue();l._pushContext();var_=p(u).call(f,t,n,o),d=l._popContext();if(s.checkForgottenReturns(_,d,null!==a?"Promise.filter":"Promise.map",l),_===h)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]=_}varm=++this._totalResolved;returnm>=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");varl=arguments[1],u=arguments[2];c=s.isArray(l)?a(t).apply(u,l):a(t).call(u,l)}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&&u.getPrototypeOf(t)===Error.prototype}functioni(t){vare;if(r(t)){e=newl(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(varn=u.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"),l=c.OperationalError,u=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=vo
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=t.prototype._isCancelled=function(){return65536===(65536&this._bitField)},t.prototype.isCancelled=function(){returnthis._target()._isCancelled()},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(u(t)){if(tinstanceofe)returnt;vari=o(t);if(i===l){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){returnl.e=e,l}}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),u=a;i&&i._pushContext(),a._captureStackTrace(),i&&i._popContext();varp=!0,h=c.tryCatch(r).call(t,o,s);returnp=!1,a&&h===l&&(a._rejectCallback(h.e,!0,!0),a=null),u}varc=t("./util"),l=c.errorObj,u=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)};varl=function(t){returnu(+this).thenReturn(t)},u=e.delay=function(t,o){vars,a;returnvoid0!==o?(s=e.resolve(o)._then(l,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._setAsyncGuaranteed(),s};e.prototype.delay=function(t){returnu(t,this)};va