!function(t,e){"object"==typeofexports&&"undefined"!=typeofmodule?module.exports=e():"function"==typeofdefine&&define.amd?define(e):t.ES6Promise=e()}(this,function(){"use strict";functiont(t){vare=typeoft;returnnull!==t&&("object"===e||"function"===e)}functione(t){return"function"==typeoft}functionn(t){B=t}functionr(t){G=t}functiono(){returnfunction(){returnprocess.nextTick(a)}}functioni(){return"undefined"!=typeofz?function(){z(a)}:c()}functions(){vart=0,e=newJ(a),n=document.createTextNode("");returne.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}functionu(){vart=newMessageChannel;returnt.port1.onmessage=a,function(){returnt.port2.postMessage(0)}}functionc(){vart=setTimeout;returnfunction(){returnt(a,1)}}functiona(){for(vart=0;t<W;t+=2){vare=V[t],n=V[t+1];e(n),V[t]=void0,V[t+1]=void0}W=0}functionf(){try{vart=Function("return this")().require("vertx");returnz=t.runOnLoop||t.runOnContext,i()}catch(e){returnc()}}functionl(t,e){varn=this,r=newthis.constructor(p);void0===r[Z]&&O(r);varo=n._state;if(o){vari=arguments[o-1];G(function(){returnP(o,r,i,n._result)})}elseE(n,r,t,e);returnr}functionh(t){vare=this;if(t&&"object"==typeoft&&t.constructor===e)returnt;varn=newe(p);returng(n,t),n}functionp(){}functionv(){returnnewTypeError("You cannot resolve a promise with itself")}functiond(){returnnewTypeError("A promises callback cannot return that same promise.")}function_(t){try{returnt.then}catch(e){returnnt.error=e,nt}}functiony(t,e,n,r){try{t.call(e,n,r)}catch(o){returno}}functionm(t,e,n){G(function(t){varr=!1,o=y(n,e,function(n){r||(r=!0,e!==n?g(t,n):S(t,n))},function(e){r||(r=!0,j(t,e))},"Settle: "+(t._label||" unknown promise"));!r&&o&&(r=!0,j(t,o))},t)}functionb(t,e){e._state===tt?S(t,e._result):e._state===et?j(t,e._result):E(e,void0,function(e){returng(t,e)},function(e){returnj(t,e)})}functionw(t,n,r){n.constructor===t.constructor&&r===l&&n.constructor.resolve===h?b(t,n):r===nt?(j(t,nt.error),nt.error=null):void0===r?S(t,n):e(r)?m(t,n,r):S(t,n)}functiong(e,n){e===n?j(e,v()):t(n)?w(e,n,_(n)):S(e,n)}functionA(t){t._onerror&&t._onerror(t._result),T(t)}functionS(t,e){t._state===$&&(t._result=e,t._state=tt,0!==t._subscribers.length&&G(T,t))}functionj(t,e){t._state===$&&(t._state=et,t._result=e,G(A,t))}functionE(t,e,n,r){varo=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+tt]=n,o[i+et]=r,0===i&&t._state&&G(T,t)}functionT(t){vare=t._subscribers,n=t._state;if(0!==e.length){for(varr=void0,o=void0,i=t._result,s=0;s<e.length;s+=3)r=e[s],o=e[s+n],r?P(n,r,o,i):o(i);t._subscribers.length=0}}functionM(t,e){try{returnt(e)}catch(n){returnnt.error=n,nt}}functionP(t,n,r,o){vari=e(r),s=void0,u=void0,c=void0,a=void0;if(i){if(s=M(r,o),s===nt?(a=!0,u=s.error,s.error=null):c=!0,n===s)returnvoidj(n,d())}elses=o,c=!0;n._state!==$||(i&&c?g(n,s):a?j(n,u):t===tt?S(n,s):t===et&&j(n,s))}functionx(t,e){try{e(function(e){g(t,e)},function(e){j(t,e)})}catch(n){j(t,n)}}functionC(){returnrt++}functionO(t){t[Z]=rt++,t._state=void0,t._result=void0,t._subscribers=[]}functionk(){returnnewError("Array Methods must be provided an Array")}functionF(t){returnnewot(this,t).promise}functionY(t){vare=this;returnnewe(U(t)?function(n,r){for(varo=t.length,i=0;i<o;i++)e.resolve(t[i]).then(n,r)}:function(t,e){returne(newTypeError("You must pass an array to race."))})}functionq(t){vare=this,n=newe(p);returnj(n,t),n}functionD(){thrownewTypeError("You must pass a resolver function as the first argument to the promise constructor")}functionK(){thrownewTypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}functionL(){vart=void0;if("undefined"!=typeofglobal)t=global;elseif("undefined"!=typeofself)t=self;elsetry{t=Function("return this")()}catch(e){thrownewError("polyfill failed because global object is unavailable in this environment")}varn=t.Promise;if(n){varr=null;try{r=Object.prototype.toString.call(n.resolve())}catch(e){}if("[object Promise]"===r&&!n.cast)return}t.Promise=it}varN=void0;N=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};varU=N,W=0,z=void0,B=void0,G=function(t,e){V[W]=t,V[W+1]=e,W+=2,2===W&&(B?B(a):X())},H="undefined"!=typeofwindow?window:void0,I=H||{},J=I.MutationObserver||I.WebKitMutationObserver,Q="undefined"==typeofself&&"undefined"!=typeofprocess&&"[object process]"==={}.toString.call(process),R="undefined"!=typeofUint8ClampedArray&&"undefined"!=typeofimportScripts&&"undefined"!=typeofMessageChannel,V=newArray(1e3),X=void0;X=Q?o():J?s():R?u():void0===H&&"function"==typeofrequire?f():c();varZ=Math.random().toString(36).substring(2),$=void0,tt=1,et=2,nt={error:null},rt=0,ot=function(){functiont(t,e){this._instanceConstructor=t,this.promise=newt(p),this.promise[Z]||O(this.promise),U(e)?(this.length=e.length,this._remaining=e.length,this._result=newArray(this.length),0===this.length?S(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&S(this.promise,this._result))):j(this.promise,k())}returnt.prototype._enumerate=function(t){for(vare=0;this._state===$&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){varn=this._instanceConstructor,r=n.resolve;if(r===h){varo=_(t);if(o===l&&t._state!==$)this._settledAt(t._state,e,t._result);elseif("function"!=typeofo)this._remaining--,this._result[e]=t;elseif(n===it){vari=newn(p);w(i,t,o),this._willSettleAt(i,e)}elsethis._willSettleAt(newn(function(e){returne(t)}),e)}elsethis._willSettleAt(r(t),e)},t.prototype._settledAt=function(t,e,n){varr=this.promise;r._state===$&&(this._remaining--,t===et?j(r,n):this._result[e]=n),0===this._remaining&&S(r,this._result)},t.prototype._willSettleAt=function(t,e){varn=this;E(t,void0,function(t){returnn._settledAt(tt,e,t)},function(t){returnn._settledAt(et,e,t)})},t}(),it=function(){functiont(e){this[Z]=C(),this._result=this._state=void0,this._subscribers=[],p!==e&&("function"!=typeofe&&D(),thisinstanceoft?x(this,e):K())}returnt.prototype["catch"]=function(t){returnthis.then(null,t)},t.prototype["finally"]=function(t){vare=this,n=e.constructor;returne.then(function(e){returnn.resolve(t()).then(function(){returne})},function(e){returnn.resolve(t()).then(function(){throwe})})},t}();returnit.prototype.then=l,it.all=F,it.race=Y,it.resolve=h,it.reject=q,it._setScheduler=n,it._setAsap=r,it._asap=G,it.polyfill=L,it.Promise=it,it});