Module 812389

2,831 characters · in f905a536bbba1915.js
Dependencies
Source Raw
function(e,t,n){"use strict";var r,a,o,i,s=n(834647),l=n(780940),c=n(184110),u=n(308227),d=n(664886),p=n(735811),h=n(740628),f=n(469516),m=n(337082),y=n(999843),v=n(309270),g=n(407057),b=n(443216),_=n(304334),k=n(282532).set,C=n(848320),w=n(518292),S=n(564904),N=n(74414),x=n(605944),P=n(145595),A=n(976467),R=n(794938),F="Promise",E=A.CONSTRUCTOR,O=A.REJECTION_EVENT,I=A.SUBCLASSING,M=x.getterFor(F),T=x.set,B=P&&P.prototype,D=P,L=B,V=u.TypeError,j=u.document,U=u.process,q=R.f,K=q,H=!!(j&&j.createEvent&&u.dispatchEvent),z="unhandledrejection",W=function(e){var t;return!!(g(e)&&v(t=e.then))&&t},G=function(e,t){var n,r,a,o=t.value,i=1===t.state,s=i?e.ok:e.fail,l=e.resolve,c=e.reject,u=e.domain;try{s?(i||(2===t.rejection&&J(t),t.rejection=1),!0===s?n=o:(u&&u.enter(),n=s(o),u&&(u.exit(),a=!0)),n===e.promise?c(new V("Promise-chain cycle")):(r=W(n))?d(r,n,l,c):l(n)):c(o)}catch(e){u&&!a&&u.exit(),c(e)}},$=function(e,t){e.notified||(e.notified=!0,C(function(){for(var n,r=e.reactions;n=r.get();)G(n,e);e.notified=!1,t&&!e.rejection&&Q(e)}))},Y=function(e,t,n){var r,a;H?((r=j.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),u.dispatchEvent(r)):r={promise:t,reason:n},!O&&(a=u["on"+e])?a(r):e===z&&w("Unhandled promise rejection",n)},Q=function(e){d(k,u,function(){var t,n=e.facade,r=e.value;if(Z(e)&&(t=S(function(){c?U.emit("unhandledRejection",r,n):Y(z,n,r)}),e.rejection=c||Z(e)?2:1,t.error))throw t.value})},Z=function(e){return 1!==e.rejection&&!e.parent},J=function(e){d(k,u,function(){var t=e.facade;c?U.emit("rejectionHandled",t):Y("rejectionhandled",t,e.value)})},X=function(e,t,n){return function(r){e(t,r,n)}},ee=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,$(e,!0))},et=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw new V("Promise can't be resolved itself");var r=W(t);r?C(function(){var n={done:!1};try{d(r,t,X(et,n,e),X(ee,n,e))}catch(t){ee(n,t,e)}}):(e.value=t,e.state=1,$(e,!1))}catch(t){ee({done:!1},t,e)}}};if(E&&(L=(D=function(e){b(this,L),y(e),d(r,this);var t=M(this);try{e(X(et,t),X(ee,t))}catch(e){ee(t,e)}}).prototype,(r=function(e){T(this,{type:F,done:!1,notified:!1,parent:!1,reactions:new N,rejection:!1,state:0,value:null})}).prototype=p(L,"then",function(e,t){var n=M(this),r=q(_(this,D));return n.parent=!0,r.ok=!v(e)||e,r.fail=v(t)&&t,r.domain=c?U.domain:void 0,0===n.state?n.reactions.add(r):C(function(){G(r,n)}),r.promise}),a=function(){var e=new r,t=M(e);this.promise=e,this.resolve=X(et,t),this.reject=X(ee,t)},R.f=q=function(e){return e===D||e===o?new a(e):K(e)},!l&&v(P)&&B!==Object.prototype)){i=B.then,I||p(B,"then",function(e,t){var n=this;return new D(function(e,t){d(i,n,e,t)}).then(e,t)},{unsafe:!0});try{delete B.constructor}catch(e){}h&&h(B,L)}s({global:!0,constructor:!0,wrap:!0,forced:E},{Promise:D}),f(D,F,!1,!0),m(F)}