0byt3m1n1
Path:
/
home
/
mgatv524
/
cms.mgaplay.com.br
/
web
/
dist
/
vendor
/
ckeditor
/
vendor
/
[
Home
]
File: promise.js
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.ES6Promise=e()}(this,(function(){function t(t){return"function"==typeof t}function e(){var t=setTimeout;return function(){return t(r,1)}}function r(){for(var t=0;t<w;t+=2)(0,P[t])(P[t+1]),P[t]=void 0,P[t+1]=void 0;w=0}function n(t,e){var r=this,n=new this.constructor(i);void 0===n[C]&&v(n);var o=r._state;if(o){var s=arguments[o-1];S((function(){return d(o,n,s,r._result)}))}else h(r,n,t,e);return n}function o(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(i);return c(e,t),e}function i(){}function s(t){try{return t.then}catch(t){return k.error=t,k}}function u(e,r,i){r.constructor===e.constructor&&i===n&&r.constructor.resolve===o?function(t,e){e._state===F?f(t,e._result):e._state===Y?l(t,e._result):h(e,void 0,(function(e){return c(t,e)}),(function(e){return l(t,e)}))}(e,r):i===k?(l(e,k.error),k.error=null):void 0===i?f(e,r):t(i)?function(t,e,r){S((function(t){var n=!1,o=function(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}(r,e,(function(r){n||(n=!0,e!==r?c(t,r):f(t,r))}),(function(e){n||(n=!0,l(t,e))}),t._label);!n&&o&&(n=!0,l(t,o))}),t)}(e,r,i):f(e,r)}function c(t,e){if(t===e)l(t,new TypeError("You cannot resolve a promise with itself"));else{var r=typeof e;null===e||"object"!==r&&"function"!==r?f(t,e):u(t,e,s(e))}}function a(t){t._onerror&&t._onerror(t._result),p(t)}function f(t,e){t._state===O&&(t._result=e,t._state=F,0!==t._subscribers.length&&S(p,t))}function l(t,e){t._state===O&&(t._state=Y,t._result=e,S(a,t))}function h(t,e,r,n){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+F]=r,o[i+Y]=n,0===i&&t._state&&S(p,t)}function p(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n=void 0,o=void 0,i=t._result,s=0;s<e.length;s+=3)n=e[s],o=e[s+r],n?d(r,n,o,i):o(i);t._subscribers.length=0}}function d(e,r,n,o){var i=t(n),s=void 0,u=void 0,a=void 0,h=void 0;if(i){try{s=n(o)}catch(t){k.error=t,s=k}if(s===k?(h=!0,u=s.error,s.error=null):a=!0,r===s)return void l(r,new TypeError("A promises callback cannot return that same promise."))}else s=o,a=!0;r._state===O&&(i&&a?c(r,s):h?l(r,u):e===F?f(r,s):e===Y&&l(r,s))}function v(t){t[C]=q++,t._state=void 0,t._result=void 0,t._subscribers=[]}var _,y,m,b,g=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},w=0,A=void 0,j=void 0,S=function(t,e){P[w]=t,P[w+1]=e,2===(w+=2)&&(j?j(r):x())},E=(T=(_="undefined"!=typeof window?window:void 0)||{}).MutationObserver||T.WebKitMutationObserver,T="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),M="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,P=Array(1e3),x=void 0,C=(x=T?function(){return process.nextTick(r)}:E?(y=0,m=new E(r),b=document.createTextNode(""),m.observe(b,{characterData:!0}),function(){b.data=y=++y%2}):M?function(){var t=new MessageChannel;return t.port1.onmessage=r,function(){return t.port2.postMessage(0)}}():void 0===_&&"function"==typeof require?function(){try{var t=Function("return this")().require("vertx");return void 0!==(A=t.runOnLoop||t.runOnContext)?function(){A(r)}:e()}catch(t){return e()}}():e(),Math.random().toString(36).substring(2)),O=void 0,F=1,Y=2,k={error:null},q=0,D=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(i),this.promise[C]||v(this.promise),g(e)?(this._remaining=this.length=e.length,this._result=Array(this.length),0===this.length?f(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&f(this.promise,this._result))):l(this.promise,Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===O&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,c=r.resolve;c===o?(c=s(t))===n&&t._state!==O?this._settledAt(t._state,e,t._result):"function"!=typeof c?(this._remaining--,this._result[e]=t):r===K?(u(r=new r(i),t,c),this._willSettleAt(r,e)):this._willSettleAt(new r((function(e){return e(t)})),e):this._willSettleAt(c(t),e)},t.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===O&&(this._remaining--,t===Y?l(n,r):this._result[e]=r),0===this._remaining&&f(n,this._result)},t.prototype._willSettleAt=function(t,e){var r=this;h(t,void 0,(function(t){return r._settledAt(F,e,t)}),(function(t){return r._settledAt(Y,e,t)}))},t}(),K=function(){function e(t){if(this[C]=q++,this._result=this._state=void 0,this._subscribers=[],i!==t){if("function"!=typeof t)throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof e))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");!function(t,e){try{e((function(e){c(t,e)}),(function(e){l(t,e)}))}catch(e){l(t,e)}}(this,t)}}return e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(e){var r=this.constructor;return t(e)?this.then((function(t){return r.resolve(e()).then((function(){return t}))}),(function(t){return r.resolve(e()).then((function(){throw t}))})):this.then(e,e)},e}();return K.prototype.then=n,K.all=function(t){return new D(this,t).promise},K.race=function(t){var e=this;return g(t)?new e((function(r,n){for(var o=t.length,i=0;i<o;i++)e.resolve(t[i]).then(r,n)})):new e((function(t,e){return e(new TypeError("You must pass an array to race."))}))},K.resolve=o,K.reject=function(t){var e=new this(i);return l(e,t),e},K._setScheduler=function(t){j=t},K._setAsap=function(t){S=t},K._asap=S,K.polyfill=function(){var t=void 0;if("undefined"!=typeof global)t=global;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var r=null;try{r=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===r&&!e.cast)return}t.Promise=K},K.Promise=K}));