!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){W=t}functionr(t){z=t}functiono(){returnfunction(){returnprocess.nextTick(a)}}functioni(){return"undefined"!=typeofU?function(){U(a)}:c()}functions(){vart=0,e=newH(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<N;t+=2){vare=Q[t],n=Q[t+1];e(n),Q[t]=void0,Q[t+1]=void0}N=0}functionf(){try{vart=Function("return this")().require("vertx");returnU=t.runOnLoop||t.runOnContext,i()}catch(e){returnc()}}functionl(t,e){varn=this,r=newthis.constructor(v);void0===r[V]&&x(r);varo=n._state;if(o){vari=arguments[o-1];z(function(){returnT(o,r,i,n._result)})}elsej(n,r,t,e);returnr}functionh(t){vare=this;if(t&&"object"==typeoft&&t.constructor===e)returnt;varn=newe(v);returnw(n,t),n}functionv(){}functionp(){returnnewTypeError("You cannot resolve a promise with itself")}functiond(){returnnewTypeError("A promises callback cannot return that same promise.")}function_(t,e,n,r){try{t.call(e,n,r)}catch(o){returno}}functiony(t,e,n){z(function(t){varr=!1,o=_(n,e,function(n){r||(r=!0,e!==n?w(t,n):A(t,n))},function(e){r||(r=!0,S(t,e))},"Settle: "+(t._label||" unknown promise"));!r&&o&&(r=!0,S(t,o))},t)}functionm(t,e){e._state===Z?A(t,e._result):e._state===$?S(t,e._result):j(e,void0,function(e){returnw(t,e)},function(e){returnS(t,e)})}functionb(t,n,r){n.constructor===t.constructor&&r===l&&n.constructor.resolve===h?m(t,n):void0===r?A(t,n):e(r)?y(t,n,r):A(t,n)}functionw(e,n){if(e===n)S(e,p());elseif(t(n)){varr=void0;try{r=n.then}catch(o){returnvoidS(e,o)}b(e,n,r)}elseA(e,n)}functiong(t){t._onerror&&t._onerror(t._result),E(t)}functionA(t,e){t._state===X&&(t._result=e,t._state=Z,0!==t._subscribers.length&&z(E,t))}functionS(t,e){t._state===X&&(t._state=$,t._result=e,z(g,t))}functionj(t,e,n,r){varo=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+Z]=n,o[i+$]=r,0===i&&t._state&&z(E,t)}functionE(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?T(n,r,o,i):o(i);t._subscribers.length=0}}functionT(t,n,r,o){vari=e(r),s=void0,u=void0,c=!0;if(i){try{s=r(o)}catch(a){c=!1,u=a}if(n===s)returnvoidS(n,d())}elses=o;n._state!==X||(i&&c?w(n,s):c===!1?S(n,u):t===Z?A(n,s):t===$&&S(n,s))}functionM(t,e){try{e(function(e){w(t,e)},function(e){S(t,e)})}catch(n){S(t,n)}}functionP(){returntt++}functionx(t){t[V]=tt++,t._state=void0,t._result=void0,t._subscribers=[]}functionC(){returnnewError("Array Methods must be provided an Array")}functionO(t){returnnewet(this,t).promise}functionk(t){vare=this;returnnewe(L(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."))})}functionF(t){vare=this,n=newe(v);returnS(n,t),n}functionY(){thrownewTypeError("You must pass a resolver function as the first argument to the promise constructor")}functionq(){thrownewTypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}functionD(){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=nt}varK=void0;K=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};varL=K,N=0,U=void0,W=void0,z=function(t,e){Q[N]=t,Q[N+1]=e,N+=2,2===N&&(W?W(a):R())},B="undefined"!=typeofwindow?window:void0,G=B||{},H=G.MutationObserver||G.WebKitMutationObserver,I="undefined"==typeofself&&"undefined"!=typeofprocess&&"[object process]"==={}.toString.call(process),J="undefined"!=typeofUint8ClampedArray&&"undefined"!=typeofimportScripts&&"undefined"!=typeofMessageChannel,Q=newArray(1e3),R=void0;R=I?o():H?s():J?u():void0===B&&"function"==typeofrequire?f():c();varV=Math.random().toString(36).substring(2),X=void0,Z=1,$=2,tt=0,et=function(){functiont(t,e){this._instanceConstructor=t,this.promise=newt(v),this.promise[V]||x(this.promise),L(e)?(this.length=e.length,this._remaining=e.length,this._result=newArray(this.length),0===this.length?A(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&A(this.promise,this._result))):S(this.promise,C())}returnt.prototype._enumerate=function(t){for(vare=0;this._state===X&&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=void0,i=void0,s=!1;try{o=t.then}catch(u){s=!0,i=u}if(o===l&&t._state!==X)this._settledAt(t._state,e,t._result);elseif("function"!=typeofo)this._remaining--,this._result[e]=t;elseif(n===nt){varc=newn(v);s?S(c,i):b(c,t,o),this._willSettleAt(c,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===X&&(this._remaining--,t===$?S(r,n):this._result[e]=n),0===this._remaining&&A(r,this._result)},t.prototype._willSettleAt=function(t,e){varn=this;j(t,void0,function(t){returnn._settledAt(Z,e,t)},function(t){returnn._settledAt($,e,t)})},t}(),nt=function(){functiont(e){this[V]=P(),this._result=this._state=void0,this._subscribers=[],v!==e&&("function"!=typeofe&&Y(),thisinstanceoft?M(this,e):q())}returnt.prototype["catch"]=function(t){returnthis.then(null,t)},t.prototype["finally"]=function(t){varn=this,r=n.constructor;returne(t)?n.then(function(e){returnr.resolve(t()).then(function(){returne})},function(e){returnr.resolve(t()).then(function(){throwe})}):n.then(t,t)},t}();returnnt.prototype.then=l,nt.all=O,nt.race=k,nt.resolve=h,nt.reject=F,nt._setScheduler=n,nt._setAsap=r,nt._asap=z,nt.polyfill=D,nt.Promise=nt,nt});