UNPKG

rxjs-mp

Version:
115 lines (113 loc) 128 kB
/** @license Apache License 2.0 https://github.com/ReactiveX/RxJS/blob/master/LICENSE.txt **/ /* ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. *****************************************************************************/ (function(k,h){"object"===typeof exports&&"undefined"!==typeof module?h(exports):"function"===typeof define&&define.amd?define("rxjs",["exports"],h):h(k.rxjs={})})(this,function(k){function h(c,a){function b(){this.constructor=c}Pb(c,a);c.prototype=null===a?Object.create(a):(b.prototype=a.prototype,new b)}function Qb(c,a){var b={},d;for(d in c)Object.prototype.hasOwnProperty.call(c,d)&&0>a.indexOf(d)&&(b[d]=c[d]);if(null!=c&&"function"===typeof Object.getOwnPropertySymbols){var e=0;for(d=Object.getOwnPropertySymbols(c);e< d.length;e++)0>a.indexOf(d[e])&&(b[d[e]]=c[d[e]])}return b}function R(c){return"function"===typeof c}function S(c){setTimeout(function(){throw c;},0)}function ua(c){return null!==c&&"object"===typeof c}function Oa(c){return c.reduce(function(a,b){return a.concat(b instanceof aa?b.errors:b)},[])}function va(c){for(;c;){var a=c.destination,b=c.isStopped;if(c.closed||b)return!1;c=a&&a instanceof m?a:null}return!0}function I(c){return c}function wa(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a]; return Pa(c)}function Pa(c){return 0===c.length?I:1===c.length?c[0]:function(a){return c.reduce(function(b,a){return a(b)},a)}}function Qa(c){c||(c=D.Promise||Promise);if(!c)throw Error("no Promise impl found");return c}function xa(){return function(c){return c.lift(new Rb(c))}}function T(c){return c?Sb(c):U}function Sb(c){return new n(function(a){return c.schedule(function(){return a.complete()})})}function B(c){return c&&"function"===typeof c.schedule}function ya(c,a){return new n(function(b){var d= new p,e=0;d.add(a.schedule(function(){e===c.length?b.complete():(b.next(c[e++]),b.closed||d.add(this.schedule()))}));return d})}function ba(c,a){return a?ya(c,a):new n(Ra(c))}function ka(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];a=c[c.length-1];return B(a)?(c.pop(),ya(c,a)):ba(c)}function za(c,a){return a?new n(function(b){return a.schedule(Tb,0,{error:c,subscriber:b})}):new n(function(b){return b.error(c)})}function Tb(c){c.subscriber.error(c.error)}function Sa(c){return c in Aa? (delete Aa[c],!0):!1}function E(){}function C(c,a){return function(b){if("function"!==typeof c)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return b.lift(new Ub(c,a))}}function Ta(c,a,b){if(a)if(B(a))b=a;else return function(){for(var d=[],e=0;e<arguments.length;e++)d[e]=arguments[e];return Ta(c,b).apply(void 0,d).pipe(C(function(b){return y(b)?a.apply(void 0,b):a(b)}))};return function(){for(var a=[],e=0;e<arguments.length;e++)a[e]=arguments[e];var f=this,g,l= {context:f,subject:g,callbackFunc:c,scheduler:b};return new n(function(d){if(b)return b.schedule(Vb,0,{args:a,subscriber:d,params:l});if(!g){g=new V;try{c.apply(f,a.concat([function(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];g.next(1>=b.length?b[0]:b);g.complete()}]))}catch(L){va(g)?g.error(L):console.warn(L)}}return g.subscribe(d)})}}function Vb(c){var a=this,b=c.args,d=c.subscriber;c=c.params;var e=c.callbackFunc,f=c.context,g=c.scheduler,l=c.subject;if(!l){l=c.subject=new V;try{e.apply(f, b.concat([function(){for(var b=[],c=0;c<arguments.length;c++)b[c]=arguments[c];a.add(g.schedule(Wb,0,{value:1>=b.length?b[0]:b,subject:l}))}]))}catch(t){l.error(t)}}this.add(l.subscribe(d))}function Wb(c){var a=c.subject;a.next(c.value);a.complete()}function Ua(c,a,b){if(a)if(B(a))b=a;else return function(){for(var d=[],e=0;e<arguments.length;e++)d[e]=arguments[e];return Ua(c,b).apply(void 0,d).pipe(C(function(b){return y(b)?a.apply(void 0,b):a(b)}))};return function(){for(var a=[],e=0;e<arguments.length;e++)a[e]= arguments[e];var f={subject:void 0,args:a,callbackFunc:c,scheduler:b,context:this};return new n(function(d){var e=f.context,g=f.subject;if(b)return b.schedule(Xb,0,{params:f,subscriber:d,context:e});if(!g){g=f.subject=new V;try{c.apply(e,a.concat([function(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];(a=b.shift())?g.error(a):(g.next(1>=b.length?b[0]:b),g.complete())}]))}catch(L){va(g)?g.error(L):console.warn(L)}}return g.subscribe(d)})}}function Xb(c){var a=this,b=c.params,d=c.subscriber; c=c.context;var e=b.callbackFunc,f=b.args,g=b.scheduler,l=b.subject;if(!l){l=b.subject=new V;try{e.apply(c,f.concat([function(){for(var b=[],c=0;c<arguments.length;c++)b[c]=arguments[c];(c=b.shift())?a.add(g.schedule(Va,0,{err:c,subject:l})):a.add(g.schedule(Yb,0,{value:1>=b.length?b[0]:b,subject:l}))}]))}catch(t){this.add(g.schedule(Va,0,{err:t,subject:l}))}}this.add(l.subscribe(d))}function Yb(c){var a=c.subject;a.next(c.value);a.complete()}function Va(c){c.subject.error(c.err)}function Wa(c){return!!c&& "function"!==typeof c.subscribe&&"function"===typeof c.then}function G(c,a,b,d,e){void 0===e&&(e=new Zb(c,b,d));if(!e.closed)return a instanceof n?a.subscribe(e):ca(a)(e)}function $b(c,a){return new n(function(b){var d=new p;d.add(a.schedule(function(){var e=c[W]();d.add(e.subscribe({next:function(c){d.add(a.schedule(function(){return b.next(c)}))},error:function(c){d.add(a.schedule(function(){return b.error(c)}))},complete:function(){d.add(a.schedule(function(){return b.complete()}))}}))}));return d})} function ac(c,a){return new n(function(b){var d=new p;d.add(a.schedule(function(){return c.then(function(c){d.add(a.schedule(function(){b.next(c);d.add(a.schedule(function(){return b.complete()}))}))},function(c){d.add(a.schedule(function(){return b.error(c)}))})}));return d})}function bc(c,a){if(!c)throw Error("Iterable cannot be null");return new n(function(b){var d=new p,e;d.add(function(){e&&"function"===typeof e.return&&e.return()});d.add(a.schedule(function(){e=c[H]();d.add(a.schedule(function(){if(!b.closed){var a, c;try{var d=e.next();a=d.value;c=d.done}catch(t){b.error(t);return}c?b.complete():(b.next(a),this.schedule())}}))}));return d})}function Xa(c,a){if(null!=c){if(c&&"function"===typeof c[W])return $b(c,a);if(Wa(c))return ac(c,a);if(Ya(c))return ya(c,a);if(c&&"function"===typeof c[H]||"string"===typeof c)return bc(c,a)}throw new TypeError((null!==c&&typeof c||c)+" is not observable");}function F(c,a){return a?Xa(c,a):c instanceof n?c:new n(ca(c))}function v(c,a){if(!a.closed){if(c instanceof n)return c.subscribe(a); var b;try{b=ca(c)(a)}catch(d){a.error(d)}return b}}function M(c,a,b){void 0===b&&(b=Number.POSITIVE_INFINITY);if("function"===typeof a)return function(d){return d.pipe(M(function(b,d){return F(c(b,d)).pipe(C(function(c,e){return a(b,c,d,e)}))},b))};"number"===typeof a&&(b=a);return function(a){return a.lift(new cc(c,b))}}function Ba(c){void 0===c&&(c=Number.POSITIVE_INFINITY);return M(I,c)}function Za(){return Ba(1)}function da(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return Za()(ka.apply(void 0, c))}function Ca(c){return new n(function(a){var b;try{b=c()}catch(d){a.error(d);return}return(b?F(b):T()).subscribe(a)})}function la(c,a){return new n(function(b){var d=c.length;if(0===d)b.complete();else for(var e=Array(d),f=0,g=0,l=function(l){var h=F(c[l]),t=!1;b.add(h.subscribe({next:function(b){t||(t=!0,g++);e[l]=b},error:function(a){return b.error(a)},complete:function(){f++;f!==d&&t||(g===d&&b.next(a?a.reduce(function(b,a,c){return b[a]=e[c],b},{}):e),b.complete())}}))},h=0;h<d;h++)l(h)})} function $a(c,a,b,d){R(b)&&(d=b,b=void 0);return d?$a(c,a,b).pipe(C(function(b){return y(b)?d.apply(void 0,b):d(b)})):new n(function(d){ab(c,a,function(b){1<arguments.length?d.next(Array.prototype.slice.call(arguments)):d.next(b)},d,b)})}function ab(c,a,b,d,e){var f;if(c&&"function"===typeof c.addEventListener&&"function"===typeof c.removeEventListener)c.addEventListener(a,b,e),f=function(){return c.removeEventListener(a,b,e)};else if(c&&"function"===typeof c.on&&"function"===typeof c.off)c.on(a, b),f=function(){return c.off(a,b)};else if(c&&"function"===typeof c.addListener&&"function"===typeof c.removeListener)c.addListener(a,b),f=function(){return c.removeListener(a,b)};else if(c&&c.length)for(var g=0,l=c.length;g<l;g++)ab(c[g],a,b,d,e);else throw new TypeError("Invalid event target");d.add(f)}function bb(c,a,b){return b?bb(c,a).pipe(C(function(a){return y(a)?b.apply(void 0,a):b(a)})):new n(function(b){var d=function(){for(var a=[],c=0;c<arguments.length;c++)a[c]=arguments[c];return b.next(1=== a.length?a[0]:a)},f;try{f=c(d)}catch(g){b.error(g);return}if(R(a))return function(){return a(d,f)}})}function gc(c){var a=c.subscriber,b=c.condition;if(!a.closed){if(c.needIterate)try{c.state=c.iterate(c.state)}catch(f){a.error(f);return}else c.needIterate=!0;if(b){var d=void 0;try{d=b(c.state)}catch(f){a.error(f);return}if(!d){a.complete();return}if(a.closed)return}var e;try{e=c.resultSelector(c.state)}catch(f){a.error(f);return}if(!a.closed&&(a.next(e),!a.closed))return this.schedule(c)}}function X(c){return!y(c)&& 0<=c-parseFloat(c)+1}function hc(c){var a=c.subscriber,b=c.counter;c=c.period;a.next(b);this.schedule({subscriber:a,counter:b+1,period:c},c)}function cb(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];var a=Number.POSITIVE_INFINITY,b=null,d=c[c.length-1];B(d)?(b=c.pop(),1<c.length&&"number"===typeof c[c.length-1]&&(a=c.pop())):"number"===typeof d&&(a=c.pop());return null===b&&1===c.length&&c[0]instanceof n?c[0]:Ba(a)(ba(c,b))}function Da(){for(var c=[],a=0;a<arguments.length;a++)c[a]= arguments[a];if(0===c.length)return U;var b=c[0],d=c.slice(1);return 1===c.length&&y(b)?Da.apply(void 0,b):new n(function(a){var c=function(){return a.add(Da.apply(void 0,d).subscribe(a))};return F(b).subscribe({next:function(b){a.next(b)},error:c,complete:c})})}function ic(c){var a=c.keys,b=c.index,d=c.subscriber,e=c.subscription;c=c.obj;if(!d.closed)if(b<a.length){var f=a[b];d.next([f,c[f]]);e.add(this.schedule({keys:a,index:b+1,subscriber:d,subscription:e,obj:c}))}else d.complete()}function db(c, a){function b(){return!b.pred.apply(b.thisArg,arguments)}b.pred=c;b.thisArg=a;return b}function J(c,a){return function(b){return b.lift(new jc(c,a))}}function eb(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];if(1===c.length)if(y(c[0]))c=c[0];else return c[0];return ba(c,void 0).lift(new kc)}function lc(c){var a=c.start,b=c.index,d=c.subscriber;b>=c.count?d.complete():(d.next(a),d.closed||(c.index=b+1,c.start=a+1,this.schedule(c)))}function fb(c,a,b){void 0===c&&(c=0);var d=-1;X(a)?d= 1>Number(a)&&1||Number(a):B(a)&&(b=a);B(b)||(b=z);return new n(function(a){var e=X(c)?c:+c-b.now();return b.schedule(mc,e,{index:0,period:d,subscriber:a})})}function mc(c){var a=c.index,b=c.period,d=c.subscriber;d.next(a);if(!d.closed){if(-1===b)return d.complete();c.index=a+1;this.schedule(c,b)}}function gb(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];a=c[c.length-1];"function"===typeof a&&c.pop();return ba(c,void 0).lift(new hb(a))}function ib(c){return function(a){return a.lift(new nc(c))}} function jb(c){var a=c.subscriber,b=c.context;b&&a.closeContext(b);a.closed||(c.context=a.openContext(),c.context.closeAction=this.schedule(c,c.bufferTimeSpan))}function oc(c){var a=c.bufferCreationInterval,b=c.bufferTimeSpan,d=c.subscriber,e=c.scheduler,f=d.openContext();d.closed||(d.add(f.closeAction=e.schedule(kb,b,{subscriber:d,context:f})),this.schedule(c,a))}function kb(c){c.subscriber.closeContext(c.context)}function lb(c,a){return M(c,a,1)}function pc(c){c.debouncedNext()}function ea(c){void 0=== c&&(c=null);return function(a){return a.lift(new qc(c))}}function mb(c,a){return function(b){return b.lift(new rc(c,a))}}function na(c){void 0===c&&(c=sc);return function(a){return a.lift(new tc(c))}}function sc(){return new fa}function Ea(c){return function(a){return 0===c?T():a.lift(new uc(c))}}function nb(c,a){return a?function(b){return b.pipe(nb(function(b,e){return F(c(b,e)).pipe(C(function(c,d){return a(b,c,e,d)}))}))}:function(b){return b.lift(new vc(c))}}function oa(c){return function(a){return 0=== c?T():a.lift(new wc(c))}}function pa(c,a){var b=!1;2<=arguments.length&&(b=!0);return function(d){return d.lift(new xc(c,a,b))}}function qa(c,a){return 2<=arguments.length?function(b){return wa(pa(c,a),oa(1),ea(a))(b)}:function(b){return wa(pa(function(b,a,f){return c(b,a,f+1)}),oa(1))(b)}}function N(c,a){return function(b){var d;d="function"===typeof c?c:function(){return c};if("function"===typeof a)return b.lift(new yc(d,a));var e=Object.create(b,zc);e.source=b;e.subjectFactory=d;return e}}function Ac(c, a){return function(b){var d=b;for(b=0;b<a;b++)if(d=null!=d?d[c[b]]:void 0,void 0===d)return;return d}}function Bc(c){var a=c.period;c.subscriber.notifyNext();this.schedule(c,a)}function Cc(){return new w}function Dc(c){var a=c.bufferSize,b=void 0===a?Number.POSITIVE_INFINITY:a,a=c.windowTime,d=void 0===a?Number.POSITIVE_INFINITY:a,e=c.refCount,f=c.scheduler,g,l=0,h,k=!1,q=!1;return function(a){l++;var c;!g||k?(k=!1,g=new Y(b,d,f),c=g.subscribe(this),h=a.subscribe({next:function(b){g.next(b)},error:function(b){k= !0;g.error(b)},complete:function(){q=!0;h=void 0;g.complete()}}),q&&(h=void 0)):c=g.subscribe(this);this.add(function(){l--;c.unsubscribe();c=void 0;h&&!q&&e&&0===l&&(h.unsubscribe(),g=h=void 0)})}}function ga(c,a){return"function"===typeof a?function(b){return b.pipe(ga(function(b,e){return F(c(b,e)).pipe(C(function(c,d){return a(b,c,e,d)}))}))}:function(b){return b.lift(new Ec(c))}}function Fc(c){c.subscriber.clearThrottle()}function ob(c,a,b){void 0===b&&(b=z);return function(d){var e=c instanceof Date&&!isNaN(+c),f=e?+c-b.now():Math.abs(c);return d.lift(new Gc(f,e,a,b))}}function Hc(c,a,b){if(0===b)return[a];c.push(a);return c}function Ic(c){var a=c.subscriber,b=c.windowTimeSpan,d=c.window;d&&a.closeWindow(d);c.window=a.openWindow();this.schedule(c,b)}function Jc(c){var a=c.windowTimeSpan,b=c.subscriber,d=c.scheduler,e=c.windowCreationInterval,f=b.openWindow(),g={action:this,subscription:null};g.subscription=d.schedule(pb,a,{subscriber:b,window:f,context:g});this.add(g.subscription);this.schedule(c, e)}function pb(c){var a=c.subscriber,b=c.window;(c=c.context)&&c.action&&c.subscription&&c.action.remove(c.subscription);a.closeWindow(b)}function qb(c,a){for(var b=0,d=a.length;b<d;b++)for(var e=a[b],f=Object.getOwnPropertyNames(e.prototype),g=0,l=f.length;g<l;g++){var h=f[g];c.prototype[h]=e.prototype[h]}}function Kc(c,a){void 0===a&&(a=null);return new O({method:"GET",url:c,headers:a})}function Lc(c,a,b){return new O({method:"POST",url:c,body:a,headers:b})}function Mc(c,a){return new O({method:"DELETE", url:c,headers:a})}function Nc(c,a,b){return new O({method:"PUT",url:c,body:a,headers:b})}function Oc(c,a,b){return new O({method:"PATCH",url:c,body:a,headers:b})}function Pc(c,a){return Qc(new O({method:"GET",url:c,responseType:"json",headers:a}))}function rb(c,a){switch(c){case "json":return c="response"in a?a.responseType?a.response:JSON.parse(a.response||a.responseText||"null"):JSON.parse(a.responseText||"null"),c;case "xml":return a.responseXML;default:return"response"in a?a.response:a.responseText}} var Pb=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,a){c.__proto__=a}||function(c,a){for(var b in a)a.hasOwnProperty(b)&&(c[b]=a[b])},sb=Object.assign||function(c){for(var a,b=1,d=arguments.length;b<d;b++){a=arguments[b];for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&(c[e]=a[e])}return c},Fa=!1,D={Promise:void 0,set useDeprecatedSynchronousErrorHandling(c){c?console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+ Error().stack):Fa&&console.log("RxJS: Back to a better error behavior. Thank you. \x3c3");Fa=c},get useDeprecatedSynchronousErrorHandling(){return Fa}},ra={closed:!0,next:function(c){},error:function(c){if(D.useDeprecatedSynchronousErrorHandling)throw c;S(c)},complete:function(){}},y=function(){return Array.isArray||function(c){return c&&"number"===typeof c.length}}(),aa=function(){function c(a){Error.call(this);this.message=a?a.length+" errors occurred during unsubscription:\n"+a.map(function(b, a){return a+1+") "+b.toString()}).join("\n "):"";this.name="UnsubscriptionError";this.errors=a;return this}c.prototype=Object.create(Error.prototype);return c}(),p=function(){function c(a){this.closed=!1;this._subscriptions=this._parentOrParents=null;a&&(this._ctorUnsubscribe=!0,this._unsubscribe=a)}c.prototype.unsubscribe=function(){var a;if(!this.closed){var b=this._parentOrParents,d=this._ctorUnsubscribe,e=this._unsubscribe,f=this._subscriptions;this.closed=!0;this._subscriptions=this._parentOrParents= null;if(b instanceof c)b.remove(this);else if(null!==b)for(var g=0;g<b.length;++g)b[g].remove(this);if(R(e)){d&&(this._unsubscribe=void 0);try{e.call(this)}catch(l){a=l instanceof aa?Oa(l.errors):[l]}}if(y(f))for(g=-1,b=f.length;++g<b;)if(d=f[g],ua(d))try{d.unsubscribe()}catch(l){a=a||[],l instanceof aa?a=a.concat(Oa(l.errors)):a.push(l)}if(a)throw new aa(a);}};c.prototype.add=function(a){var b=a;if(!a)return c.EMPTY;switch(typeof a){case "function":b=new c(a);case "object":if(b===this||b.closed|| "function"!==typeof b.unsubscribe)return b;if(this.closed)return b.unsubscribe(),b;b instanceof c||(a=b,b=new c,b._subscriptions=[a]);break;default:throw Error("unrecognized teardown "+a+" added to Subscription.");}a=b._parentOrParents;if(null===a)b._parentOrParents=this;else if(a instanceof c){if(a===this)return b;b._parentOrParents=[a,this]}else if(-1===a.indexOf(this))a.push(this);else return b;a=this._subscriptions;null===a?this._subscriptions=[b]:a.push(b);return b};c.prototype.remove=function(a){var b= this._subscriptions;b&&(a=b.indexOf(a),-1!==a&&b.splice(a,1))};c.EMPTY=function(a){a.closed=!0;return a}(new c);return c}(),sa="function"===typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random(),m=function(c){function a(b,d,e){var f=c.call(this)||this;f.syncErrorValue=null;f.syncErrorThrown=!1;f.syncErrorThrowable=!1;f.isStopped=!1;switch(arguments.length){case 0:f.destination=ra;break;case 1:if(!b){f.destination=ra;break}if("object"===typeof b){b instanceof a?(f.syncErrorThrowable= b.syncErrorThrowable,f.destination=b,b.add(f)):(f.syncErrorThrowable=!0,f.destination=new tb(f,b));break}default:f.syncErrorThrowable=!0,f.destination=new tb(f,b,d,e)}return f}h(a,c);a.prototype[sa]=function(){return this};a.create=function(b,c,e){b=new a(b,c,e);b.syncErrorThrowable=!1;return b};a.prototype.next=function(b){this.isStopped||this._next(b)};a.prototype.error=function(b){this.isStopped||(this.isStopped=!0,this._error(b))};a.prototype.complete=function(){this.isStopped||(this.isStopped= !0,this._complete())};a.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,c.prototype.unsubscribe.call(this))};a.prototype._next=function(b){this.destination.next(b)};a.prototype._error=function(b){this.destination.error(b);this.unsubscribe()};a.prototype._complete=function(){this.destination.complete();this.unsubscribe()};a.prototype._unsubscribeAndRecycle=function(){var b=this._parentOrParents;this._parentOrParents=null;this.unsubscribe();this.isStopped=this.closed=!1;this._parentOrParents= b;return this};return a}(p),tb=function(c){function a(b,a,e,f){var d=c.call(this)||this;d._parentSubscriber=b;var l;b=d;R(a)?l=a:a&&(l=a.next,e=a.error,f=a.complete,a!==ra&&(b=Object.create(a),R(b.unsubscribe)&&d.add(b.unsubscribe.bind(b)),b.unsubscribe=d.unsubscribe.bind(d)));d._context=b;d._next=l;d._error=e;d._complete=f;return d}h(a,c);a.prototype.next=function(b){if(!this.isStopped&&this._next){var a=this._parentSubscriber;D.useDeprecatedSynchronousErrorHandling&&a.syncErrorThrowable?this.__tryOrSetError(a, this._next,b)&&this.unsubscribe():this.__tryOrUnsub(this._next,b)}};a.prototype.error=function(b){if(!this.isStopped){var a=this._parentSubscriber,c=D.useDeprecatedSynchronousErrorHandling;if(this._error)c&&a.syncErrorThrowable?this.__tryOrSetError(a,this._error,b):this.__tryOrUnsub(this._error,b),this.unsubscribe();else if(a.syncErrorThrowable)c?(a.syncErrorValue=b,a.syncErrorThrown=!0):S(b),this.unsubscribe();else{this.unsubscribe();if(c)throw b;S(b)}}};a.prototype.complete=function(){var b=this; if(!this.isStopped){var a=this._parentSubscriber;if(this._complete){var c=function(){return b._complete.call(b._context)};D.useDeprecatedSynchronousErrorHandling&&a.syncErrorThrowable?this.__tryOrSetError(a,c):this.__tryOrUnsub(c)}this.unsubscribe()}};a.prototype.__tryOrUnsub=function(b,a){try{b.call(this._context,a)}catch(e){this.unsubscribe();if(D.useDeprecatedSynchronousErrorHandling)throw e;S(e)}};a.prototype.__tryOrSetError=function(b,a,c){if(!D.useDeprecatedSynchronousErrorHandling)throw Error("bad call"); try{a.call(this._context,c)}catch(f){return D.useDeprecatedSynchronousErrorHandling?(b.syncErrorValue=f,b.syncErrorThrown=!0):S(f),!0}return!1};a.prototype._unsubscribe=function(){var b=this._parentSubscriber;this._parentSubscriber=this._context=null;b.unsubscribe()};return a}(m),W="function"===typeof Symbol&&Symbol.observable||"@@observable",n=function(){function c(a){this._isScalar=!1;a&&(this._subscribe=a)}c.prototype.lift=function(a){var b=new c;b.source=this;b.operator=a;return b};c.prototype.subscribe= function(a,b,c){var d=this.operator;a:{if(a){if(a instanceof m)break a;if(a[sa]){a=a[sa]();break a}}a=a||b||c?new m(a,b,c):new m(ra)}d?a.add(d.call(a,this.source)):a.add(this.source||D.useDeprecatedSynchronousErrorHandling&&!a.syncErrorThrowable?this._subscribe(a):this._trySubscribe(a));if(D.useDeprecatedSynchronousErrorHandling&&a.syncErrorThrowable&&(a.syncErrorThrowable=!1,a.syncErrorThrown))throw a.syncErrorValue;return a};c.prototype._trySubscribe=function(a){try{return this._subscribe(a)}catch(b){D.useDeprecatedSynchronousErrorHandling&& (a.syncErrorThrown=!0,a.syncErrorValue=b),va(a)?a.error(b):console.warn(b)}};c.prototype.forEach=function(a,b){var c=this;b=Qa(b);return new b(function(b,d){var e;e=c.subscribe(function(b){try{a(b)}catch(t){d(t),e&&e.unsubscribe()}},d,b)})};c.prototype._subscribe=function(a){var b=this.source;return b&&b.subscribe(a)};c.prototype[W]=function(){return this};c.prototype.pipe=function(){for(var a=[],b=0;b<arguments.length;b++)a[b]=arguments[b];return 0===a.length?this:Pa(a)(this)};c.prototype.toPromise= function(a){var b=this;a=Qa(a);return new a(function(a,c){var d;b.subscribe(function(b){return d=b},function(b){return c(b)},function(){return a(d)})})};c.create=function(a){return new c(a)};return c}(),K=function(){function c(){Error.call(this);this.message="object unsubscribed";this.name="ObjectUnsubscribedError";return this}c.prototype=Object.create(Error.prototype);return c}(),ub=function(c){function a(b,a){var d=c.call(this)||this;d.subject=b;d.subscriber=a;d.closed=!1;return d}h(a,c);a.prototype.unsubscribe= function(){if(!this.closed){this.closed=!0;var b=this.subject,a=b.observers;this.subject=null;!a||0===a.length||b.isStopped||b.closed||(b=a.indexOf(this.subscriber),-1!==b&&a.splice(b,1))}};return a}(p),vb=function(c){function a(b){var a=c.call(this,b)||this;a.destination=b;return a}h(a,c);return a}(m),w=function(c){function a(){var b=c.call(this)||this;b.observers=[];b.closed=!1;b.isStopped=!1;b.hasError=!1;b.thrownError=null;return b}h(a,c);a.prototype[sa]=function(){return new vb(this)};a.prototype.lift= function(b){var a=new Ga(this,this);a.operator=b;return a};a.prototype.next=function(b){if(this.closed)throw new K;if(!this.isStopped)for(var a=this.observers,c=a.length,a=a.slice(),f=0;f<c;f++)a[f].next(b)};a.prototype.error=function(b){if(this.closed)throw new K;this.hasError=!0;this.thrownError=b;this.isStopped=!0;for(var a=this.observers,c=a.length,a=a.slice(),f=0;f<c;f++)a[f].error(b);this.observers.length=0};a.prototype.complete=function(){if(this.closed)throw new K;this.isStopped=!0;for(var b= this.observers,a=b.length,b=b.slice(),c=0;c<a;c++)b[c].complete();this.observers.length=0};a.prototype.unsubscribe=function(){this.closed=this.isStopped=!0;this.observers=null};a.prototype._trySubscribe=function(b){if(this.closed)throw new K;return c.prototype._trySubscribe.call(this,b)};a.prototype._subscribe=function(b){if(this.closed)throw new K;if(this.hasError)return b.error(this.thrownError),p.EMPTY;if(this.isStopped)return b.complete(),p.EMPTY;this.observers.push(b);return new ub(this,b)}; a.prototype.asObservable=function(){var b=new n;b.source=this;return b};a.create=function(b,a){return new Ga(b,a)};return a}(n),Ga=function(c){function a(b,a){var d=c.call(this)||this;d.destination=b;d.source=a;return d}h(a,c);a.prototype.next=function(b){var a=this.destination;a&&a.next&&a.next(b)};a.prototype.error=function(b){var a=this.destination;a&&a.error&&this.destination.error(b)};a.prototype.complete=function(){var b=this.destination;b&&b.complete&&this.destination.complete()};a.prototype._subscribe= function(b){return this.source?this.source.subscribe(b):p.EMPTY};return a}(w),Rb=function(){function c(a){this.connectable=a}c.prototype.call=function(a,b){var c=this.connectable;c._refCount++;a=new Rc(a,c);b=b.subscribe(a);a.closed||(a.connection=c.connect());return b};return c}(),Rc=function(c){function a(b,a){b=c.call(this,b)||this;b.connectable=a;return b}h(a,c);a.prototype._unsubscribe=function(){var b=this.connectable;if(b){this.connectable=null;var a=b._refCount;0>=a?this.connection=null:(b._refCount= a-1,1<a?this.connection=null:(a=this.connection,b=b._connection,this.connection=null,!b||a&&b!==a||b.unsubscribe()))}else this.connection=null};return a}(m),wb=function(c){function a(b,a){var d=c.call(this)||this;d.source=b;d.subjectFactory=a;d._refCount=0;d._isComplete=!1;return d}h(a,c);a.prototype._subscribe=function(b){return this.getSubject().subscribe(b)};a.prototype.getSubject=function(){var b=this._subject;if(!b||b.isStopped)this._subject=this.subjectFactory();return this._subject};a.prototype.connect= function(){var b=this._connection;b||(this._isComplete=!1,b=this._connection=new p,b.add(this.source.subscribe(new Sc(this.getSubject(),this))),b.closed&&(this._connection=null,b=p.EMPTY));return b};a.prototype.refCount=function(){return xa()(this)};return a}(n),zc=function(){var c=wb.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:c._subscribe},_isComplete:{value:c._isComplete,writable:!0}, getSubject:{value:c.getSubject},connect:{value:c.connect},refCount:{value:c.refCount}}}(),Sc=function(c){function a(b,a){b=c.call(this,b)||this;b.connectable=a;return b}h(a,c);a.prototype._error=function(b){this._unsubscribe();c.prototype._error.call(this,b)};a.prototype._complete=function(){this.connectable._isComplete=!0;this._unsubscribe();c.prototype._complete.call(this)};a.prototype._unsubscribe=function(){var b=this.connectable;if(b){this.connectable=null;var a=b._connection;b._refCount=0;b._subject= null;b._connection=null;a&&a.unsubscribe()}};return a}(vb);(function(c){function a(b,a){b=c.call(this,b)||this;b.connectable=a;return b}h(a,c);a.prototype._unsubscribe=function(){var b=this.connectable;if(b){this.connectable=null;var a=b._refCount;0>=a?this.connection=null:(b._refCount=a-1,1<a?this.connection=null:(a=this.connection,b=b._connection,this.connection=null,!b||a&&b!==a||b.unsubscribe()))}else this.connection=null};return a})(m);var Uc=function(){function c(a,b,c,e){this.keySelector=a; this.elementSelector=b;this.durationSelector=c;this.subjectSelector=e}c.prototype.call=function(a,b){return b.subscribe(new Tc(a,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))};return c}(),Tc=function(c){function a(b,a,e,f,g){b=c.call(this,b)||this;b.keySelector=a;b.elementSelector=e;b.durationSelector=f;b.subjectSelector=g;b.groups=null;b.attemptedToUnsubscribe=!1;b.count=0;return b}h(a,c);a.prototype._next=function(b){var a;try{a=this.keySelector(b)}catch(e){this.error(e); return}this._group(b,a)};a.prototype._group=function(b,a){var c=this.groups;c||(c=this.groups=new Map);var d=c.get(a),g;if(this.elementSelector)try{g=this.elementSelector(b)}catch(l){this.error(l)}else g=b;if(!d&&(d=this.subjectSelector?this.subjectSelector():new w,c.set(a,d),b=new Ha(a,d,this),this.destination.next(b),this.durationSelector)){b=void 0;try{b=this.durationSelector(new Ha(a,d))}catch(l){this.error(l);return}this.add(b.subscribe(new Vc(a,d,this)))}d.closed||d.next(g)};a.prototype._error= function(b){var a=this.groups;a&&(a.forEach(function(a,c){a.error(b)}),a.clear());this.destination.error(b)};a.prototype._complete=function(){var b=this.groups;b&&(b.forEach(function(b,a){b.complete()}),b.clear());this.destination.complete()};a.prototype.removeGroup=function(b){this.groups.delete(b)};a.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&c.prototype.unsubscribe.call(this))};return a}(m),Vc=function(c){function a(b,a,e){var d=c.call(this,a)|| this;d.key=b;d.group=a;d.parent=e;return d}h(a,c);a.prototype._next=function(b){this.complete()};a.prototype._unsubscribe=function(){var b=this.parent,a=this.key;this.key=this.parent=null;b&&b.removeGroup(a)};return a}(m),Ha=function(c){function a(b,a,e){var d=c.call(this)||this;d.key=b;d.groupSubject=a;d.refCountSubscription=e;return d}h(a,c);a.prototype._subscribe=function(b){var a=new p,c=this.refCountSubscription,f=this.groupSubject;c&&!c.closed&&a.add(new Wc(c));a.add(f.subscribe(b));return a}; return a}(n),Wc=function(c){function a(b){var a=c.call(this)||this;a.parent=b;b.count++;return a}h(a,c);a.prototype.unsubscribe=function(){var b=this.parent;b.closed||this.closed||(c.prototype.unsubscribe.call(this),--b.count,0===b.count&&b.attemptedToUnsubscribe&&b.unsubscribe())};return a}(p),xb=function(c){function a(b){var a=c.call(this)||this;a._value=b;return a}h(a,c);Object.defineProperty(a.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0});a.prototype._subscribe= function(b){var a=c.prototype._subscribe.call(this,b);a&&!a.closed&&b.next(this._value);return a};a.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new K;return this._value};a.prototype.next=function(b){c.prototype.next.call(this,this._value=b)};return a}(w),ha=function(c){function a(b,a){var d=c.call(this,b,a)||this;d.scheduler=b;d.work=a;d.pending=!1;return d}h(a,c);a.prototype.schedule=function(b,a){void 0===a&&(a=0);if(this.closed)return this;this.state= b;b=this.id;var c=this.scheduler;null!=b&&(this.id=this.recycleAsyncId(c,b,a));this.pending=!0;this.delay=a;this.id=this.id||this.requestAsyncId(c,this.id,a);return this};a.prototype.requestAsyncId=function(b,a,c){void 0===c&&(c=0);return setInterval(b.flush.bind(b,this),c)};a.prototype.recycleAsyncId=function(b,a,c){void 0===c&&(c=0);if(null!==c&&this.delay===c&&!1===this.pending)return a;clearInterval(a)};a.prototype.execute=function(b,a){if(this.closed)return Error("executing a cancelled action"); this.pending=!1;if(b=this._execute(b,a))return b;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))};a.prototype._execute=function(b,a){a=!1;var c=void 0;try{this.work(b)}catch(f){a=!0,c=!!f&&f||Error(f)}if(a)return this.unsubscribe(),c};a.prototype._unsubscribe=function(){var b=this.id,a=this.scheduler,c=a.actions,f=c.indexOf(this);this.state=this.work=null;this.pending=!1;this.scheduler=null;-1!==f&&c.splice(f,1);null!=b&&(this.id=this.recycleAsyncId(a, b,null));this.delay=null};return a}(function(c){function a(b,a){return c.call(this)||this}h(a,c);a.prototype.schedule=function(b,a){return this};return a}(p)),Xc=function(c){function a(b,a){var d=c.call(this,b,a)||this;d.scheduler=b;d.work=a;return d}h(a,c);a.prototype.schedule=function(b,a){void 0===a&&(a=0);if(0<a)return c.prototype.schedule.call(this,b,a);this.delay=a;this.state=b;this.scheduler.flush(this);return this};a.prototype.execute=function(b,a){return 0<a||this.closed?c.prototype.execute.call(this, b,a):this._execute(b,a)};a.prototype.requestAsyncId=function(b,a,e){void 0===e&&(e=0);return null!==e&&0<e||null===e&&0<this.delay?c.prototype.requestAsyncId.call(this,b,a,e):b.flush(this)};return a}(ha),Ia=function(){function c(a,b){void 0===b&&(b=c.now);this.SchedulerAction=a;this.now=b}c.prototype.schedule=function(a,b,c){void 0===b&&(b=0);return(new this.SchedulerAction(this,a)).schedule(c,b)};c.now=function(){return Date.now()};return c}(),P=function(c){function a(b,d){void 0===d&&(d=Ia.now); var e=c.call(this,b,function(){return a.delegate&&a.delegate!==e?a.delegate.now():d()})||this;e.actions=[];e.active=!1;e.scheduled=void 0;return e}h(a,c);a.prototype.schedule=function(b,d,e){void 0===d&&(d=0);return a.delegate&&a.delegate!==this?a.delegate.schedule(b,d,e):c.prototype.schedule.call(this,b,d,e)};a.prototype.flush=function(b){var a=this.actions;if(this.active)a.push(b);else{var c;this.active=!0;do if(c=b.execute(b.state,b.delay))break;while(b=a.shift());this.active=!1;if(c){for(;b=a.shift();)b.unsubscribe(); throw c;}}};return a}(Ia),Ja=new (function(c){function a(){return null!==c&&c.apply(this,arguments)||this}h(a,c);return a}(P))(Xc),U=new n(function(c){return c.complete()}),Ra=function(c){return function(a){for(var b=0,d=c.length;b<d&&!a.closed;b++)a.next(c[b]);a.complete()}};(function(c){c.NEXT="N";c.ERROR="E";c.COMPLETE="C"})(k.NotificationKind||(k.NotificationKind={}));var x=function(){function c(a,b,c){this.kind=a;this.value=b;this.error=c;this.hasValue="N"===a}c.prototype.observe=function(a){switch(this.kind){case "N":return a.next&& a.next(this.value);case "E":return a.error&&a.error(this.error);case "C":return a.complete&&a.complete()}};c.prototype.do=function(a,b,c){switch(this.kind){case "N":return a&&a(this.value);case "E":return b&&b(this.error);case "C":return c&&c()}};c.prototype.accept=function(a,b,c){return a&&"function"===typeof a.next?this.observe(a):this.do(a,b,c)};c.prototype.toObservable=function(){switch(this.kind){case "N":return ka(this.value);case "E":return za(this.error);case "C":return T()}throw Error("unexpected notification kind value"); };c.createNext=function(a){return"undefined"!==typeof a?new c("N",a):c.undefinedValueNotification};c.createError=function(a){return new c("E",void 0,a)};c.createComplete=function(){return c.completeNotification};c.completeNotification=new c("C");c.undefinedValueNotification=new c("N",void 0);return c}(),Yc=function(){function c(a,b){void 0===b&&(b=0);this.scheduler=a;this.delay=b}c.prototype.call=function(a,b){return b.subscribe(new yb(a,this.scheduler,this.delay))};return c}(),yb=function(c){function a(b, a,e){void 0===e&&(e=0);b=c.call(this,b)||this;b.scheduler=a;b.delay=e;return b}h(a,c);a.dispatch=function(b){b.notification.observe(b.destination);this.unsubscribe()};a.prototype.scheduleMessage=function(b){this.destination.add(this.scheduler.schedule(a.dispatch,this.delay,new Zc(b,this.destination)))};a.prototype._next=function(b){this.scheduleMessage(x.createNext(b))};a.prototype._error=function(b){this.scheduleMessage(x.createError(b));this.unsubscribe()};a.prototype._complete=function(){this.scheduleMessage(x.createComplete()); this.unsubscribe()};return a}(m),Zc=function(){return function(c,a){this.notification=c;this.destination=a}}(),Y=function(c){function a(b,a,e){void 0===b&&(b=Number.POSITIVE_INFINITY);void 0===a&&(a=Number.POSITIVE_INFINITY);var d=c.call(this)||this;d.scheduler=e;d._events=[];d._infiniteTimeWindow=!1;d._bufferSize=1>b?1:b;d._windowTime=1>a?1:a;a===Number.POSITIVE_INFINITY?(d._infiniteTimeWindow=!0,d.next=d.nextInfiniteTimeWindow):d.next=d.nextTimeWindow;return d}h(a,c);a.prototype.nextInfiniteTimeWindow= function(b){if(!this.isStopped){var a=this._events;a.push(b);a.length>this._bufferSize&&a.shift()}c.prototype.next.call(this,b)};a.prototype.nextTimeWindow=function(b){this.isStopped||(this._events.push(new $c(this._getNow(),b)),this._trimBufferThenGetEvents());c.prototype.next.call(this,b)};a.prototype._subscribe=function(b){var a=this._infiniteTimeWindow,c=a?this._events:this._trimBufferThenGetEvents(),f=this.scheduler,g=c.length,l;if(this.closed)throw new K;this.isStopped||this.hasError?l=p.EMPTY: (this.observers.push(b),l=new ub(this,b));f&&b.add(b=new yb(b,f));if(a)for(a=0;a<g&&!b.closed;a++)b.next(c[a]);else for(a=0;a<g&&!b.closed;a++)b.next(c[a].value);this.hasError?b.error(this.thrownError):this.isStopped&&b.complete();return l};a.prototype._getNow=function(){return(this.scheduler||Ja).now()};a.prototype._trimBufferThenGetEvents=function(){for(var b=this._getNow(),a=this._bufferSize,c=this._windowTime,f=this._events,g=f.length,l=0;l<g&&!(b-f[l].time<c);)l++;g>a&&(l=Math.max(l,g-a));0< l&&f.splice(0,l);return f};return a}(w),$c=function(){return function(c,a){this.time=c;this.value=a}}(),V=function(c){function a(){var b=null!==c&&c.apply(this,arguments)||this;b.value=null;b.hasNext=!1;b.hasCompleted=!1;return b}h(a,c);a.prototype._subscribe=function(b){return this.hasError?(b.error(this.thrownError),p.EMPTY):this.hasCompleted&&this.hasNext?(b.next(this.value),b.complete(),p.EMPTY):c.prototype._subscribe.call(this,b)};a.prototype.next=function(b){this.hasCompleted||(this.value=b, this.hasNext=!0)};a.prototype.error=function(b){this.hasCompleted||c.prototype.error.call(this,b)};a.prototype.complete=function(){this.hasCompleted=!0;this.hasNext&&c.prototype.next.call(this,this.value);c.prototype.complete.call(this)};return a}(w),ad=1,bd=Promise.resolve(),Aa={},zb={setImmediate:function(c){var a=ad++;Aa[a]=!0;bd.then(function(){return Sa(a)&&c()});return a},clearImmediate:function(c){Sa(c)}},cd=function(c){function a(b,a){var d=c.call(this,b,a)||this;d.scheduler=b;d.work=a;return d} h(a,c);a.prototype.requestAsyncId=function(b,a,e){void 0===e&&(e=0);if(null!==e&&0<e)return c.prototype.requestAsyncId.call(this,b,a,e);b.actions.push(this);return b.scheduled||(b.scheduled=zb.setImmediate(b.flush.bind(b,null)))};a.prototype.recycleAsyncId=function(b,a,e){void 0===e&&(e=0);if(null!==e&&0<e||null===e&&0<this.delay)return c.prototype.recycleAsyncId.call(this,b,a,e);0===b.actions.length&&(zb.clearImmediate(a),b.scheduled=void 0)};return a}(ha),ia=new (function(c){function a(){return null!== c&&c.apply(this,arguments)||this}h(a,c);a.prototype.flush=function(b){this.active=!0;this.scheduled=void 0;var a=this.actions,c,f=-1,g=a.length;b=b||a.shift();do if(c=b.execute(b.state,b.delay))break;while(++f<g&&(b=a.shift()));this.active=!1;if(c){for(;++f<g&&(b=a.shift());)b.unsubscribe();throw c;}};return a}(P))(cd),Ab=new P(ha),z=Ab,dd=function(c){function a(b,a){var d=c.call(this,b,a)||this;d.scheduler=b;d.work=a;return d}h(a,c);a.prototype.requestAsyncId=function(b,a,e){void 0===e&&(e=0);if(null!== e&&0<e)return c.prototype.requestAsyncId.call(this,b,a,e);b.actions.push(this);return b.scheduled||(b.scheduled=requestAnimationFrame(function(){return b.flush(null)}))};a.prototype.recycleAsyncId=function(b,a,e){void 0===e&&(e=0);if(null!==e&&0<e||null===e&&0<this.delay)return c.prototype.recycleAsyncId.call(this,b,a,e);0===b.actions.length&&(cancelAnimationFrame(a),b.scheduled=void 0)};return a}(ha),Bb=new (function(c){function a(){return null!==c&&c.apply(this,arguments)||this}h(a,c);a.prototype.flush= function(b){this.active=!0;this.scheduled=void 0;var a=this.actions,c,f=-1,g=a.length;b=b||a.shift();do if(c=b.execute(b.state,b.delay))break;while(++f<g&&(b=a.shift()));this.active=!1;if(c){for(;++f<g&&(b=a.shift());)b.unsubscribe();throw c;}};return a}(P))(dd),Cb=function(c){function a(b,a){void 0===b&&(b=Ka);void 0===a&&(a=Number.POSITIVE_INFINITY);var d=c.call(this,b,function(){return d.frame})||this;d.maxFrames=a;d.frame=0;d.index=-1;return d}h(a,c);a.prototype.flush=function(){for(var b=this.actions, a=this.maxFrames,c,f;(f=b[0])&&f.delay<=a&&!(b.shift(),this.frame=f.delay,c=f.execute(f.state,f.delay)););if(c){for(;f=b.shift();)f.unsubscribe();throw c;}};a.frameTimeFactor=10;return a}(P),Ka=function(c){function a(b,a,e){void 0===e&&(e=b.index+=1);var d=c.call(this,b,a)||this;d.scheduler=b;d.work=a;d.index=e;d.active=!0;d.index=b.index=e;return d}h(a,c);a.prototype.schedule=function(b,d){void 0===d&&(d=0);if(!this.id)return c.prototype.schedule.call(this,b,d);this.active=!1;var e=new a(this.scheduler, this.work);this.add(e);return e.schedule(b,d)};a.prototype.requestAsyncId=function(b,c,e){void 0===e&&(e=0);this.delay=b.frame+e;b=b.actions;b.push(this);b.sort(a.sortActions);return!0};a.prototype.recycleAsyncId=function(b,a,c){};a.prototype._execute=function(b,a){if(!0===this.active)return c.prototype._execute.call(this,b,a)};a.sortActions=function(b,a){return b.delay===a.delay?b.index===a.index?0:b.index>a.index?1:-1:b.delay>a.delay?1:-1};return a}(ha),Z=function(){function c(){Error.call(this); this.message="argument out of range";this.name="ArgumentOutOfRangeError";return this}c.prototype=Object.create(Error.prototype);return c}(),fa=function(){function c(){Error.call(this);this.message="no elements in sequence";this.name="EmptyError";return this}c.prototype=Object.create(Error.prototype);return c}(),Db=function(){function c(){Error.call(this);this.message="Timeout has occurred";this.name="TimeoutError";return this}c.prototype=Object.create(Error.prototype);return c}(),Ub=function(){function c(a, b){this.project=a;this.thisArg=b}c.prototype.call=function(a,b){return b.subscribe(new ed(a,this.project,this.thisArg))};return c}(),ed=function(c){function a(b,a,e){b=c.call(this,b)||this;b.project=a;b.count=0;b.thisArg=e||b;return b}h(a,c);a.prototype._next=function(b){var a;try{a=this.project.call(this.thisArg,b,this.count++)}catch(e){this.destination.error(e);return}this.destination.next(a)};return a}(m),Q=function(c){function a(){return null!==c&&c.apply(this,arguments)||this}h(a,c);a.prototype.notifyNext= function(b,a,c,f,g){this.destination.next(a)};a.prototype.notifyError=function(b,a){this.destination.error(b)};a.prototype.notifyComplete=function(b){this.destination.complete()};return a}(m),Zb=function(c){function a(b,a,e){var d=c.call(this)||this;d.parent=b;d.outerValue=a;d.outerIndex=e;d.index=0;return d}h(a,c);a.prototype._next=function(b){this.parent.notifyNext(this.outerValue,b,this.outerIndex,this.index++,this)};a.prototype._error=function(b){this.parent.notifyError(b,this);this.unsubscribe()}; a.prototype._complete=function(){this.parent.notifyComplete(this);this.unsubscribe()};return a}(m),fd=function(c){return function(a){c.then(function(b){a.closed||(a.next(b),a.complete())},function(b){return a.error(b)}).then(null,S);return a}},H;H="function"===typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";var gd=function(c){return function(a){var b=c[H]();do{var d=void 0;try{d=b.next()}catch(e){return a.error(e),a}if(d.done){a.complete();break}a.next(d.value);if(a.closed)break}while(1); "function"===typeof b.return&&a.add(function(){b.return&&b.return()});return a}},hd=function(c){return function(a){var b=c[W]();if("function"!==typeof b.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return b.subscribe(a)}},Ya=function(c){return c&&"number"===typeof c.length&&"function"!==typeof c},ca=function(c){if(c&&"function"===typeof c[W])return hd(c);if(Ya(c))return Ra(c);if(Wa(c))return fd(c);if(c&&"function"===typeof c[H])return gd(c);c=ua(c)? "an invalid object":"'"+c+"'";throw new TypeError("You provided "+c+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.");},Eb={},La=function(){function c(a){this.resultSelector=a}c.prototype.call=function(a,b){return b.subscribe(new id(a,this.resultSelector))};return c}(),id=function(c){function a(b,a){b=c.call(this,b)||this;b.resultSelector=a;b.active=0;b.values=[];b.observables=[];return b}h(a,c);a.prototype._next=function(b){this.values.push(Eb);this.observables.push(b)}; a.prototype._complete=function(){var b=this.observables,a=b.length;if(0===a)this.destination.complete();else{this.toRespond=this.active=a;for(var c=0;c<a;c++)this.add(G(this,b[c],void 0,c))}};a.prototype.notifyComplete=function(b){0===--this.active&&this.destination.complete()};a.prototype.notifyNext=function(b,a,c){b=this.values;var d=b[c],d=this.toRespond?d===Eb?--this.toRespond:this.toRespond:0;b[c]=a;0===d&&(this.resultSelector?this._tryResultSelector(b):this.destination.next(b.slice()))};a.prototype._tryResultSelector= function(b){var a;try{a=this.resultSelector.apply(this,b)}catch(e){this.destination.error(e);return}this.destination.next(a)};return a}(Q),u=function(c){function a(b){var a=c.call(this)||this;a.parent=b;return a}h(a,c);a.prototype._next=function(b){this.parent.notifyNext(b)};a.prototype._error=function(b){this.parent.notifyError(b);this.unsubscribe()};a.prototype._complete=function(){this.parent.notifyComplete();this.unsubscribe()};return a}(m);(function(c){function a(b,a,e){var d=c.call(this)||this; d.parent=b;d.outerValue=a;d.outerIndex=e;return d}h(a,c);a.prototype._next=function(b){this.parent.notifyNext(this.outerValue,b,this.outerIndex,this)};a.prototype._error=function(b){this.parent.notifyError(b);this.unsubscribe()};a.prototype._complete=function(){this.parent.notifyComplete(this);this.unsubscribe()};return a})(m);var r=function(c){function a(){return null!==c&&c.apply(this,arguments)||this}h(a,c);a.prototype.notifyNext=function(b){this.destination.next(b)};a.prototype.notifyError=function(b){this.destination.error(b)}; a.prototype.notifyComplete=function(){this.destination.complete()};return a}(m);(function(c){function a(){return null!==c&&c.apply(this,arguments)||this}h(a,c);a.prototype.notifyNext=function(b,a,c,f){this.destination.next(a)};a.prototype.notifyError=function(b){this.destination.error(b)};a.prototype.notifyComplete=function(b){this.destination.complete()};return a})(m);var cc=function(){function c(a,b){void 0===b&&(b=Number.POSITIVE_INFINITY);this.project=a;this.concurrent=b}c.prototype.call=function(a, b){return b.subscribe(new jd(a,this.project,this.concurrent))};return c}(),jd=function(c){function a(b,a,e){void 0===e&&(e=Number.POSITIVE_INFINITY);b=c.call(this,b)||this;b.project=a;b.concurrent=e;b.hasCompleted=!1;b.buffer=[];b.active=0;b.index=0;return b}h(a,c);a.prototype._next=function(b){this.active<this.concurrent?this._tryNext(b):this.buffer.push(b)};a.prototype._tryNext=function(b){var a,c=this.index++;try{a=this.project(b,c)}catch(f){this.destination.error(f);return}this.active++;this._innerSub(a)}; a.prototype._innerSub=function(b){var a=new u(this),c=this.destination;c.add(a);b=v(b,a);b!==a&&c.add(b)};a.prototype._complete=function(){this.hasCompleted=!0;0===this.active&&0===this.buffer.length&&this.destination.complete();this.unsubscribe()};a.prototype.notifyNext=function(b){this.destination.next(b)};a.prototype.notifyComplete=function(){var b=this.buffer;this.active--;0<b.length?this._next(b.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()};return a}(r),Fb=new n(E), jc=function(){function c(a,b){this.predicate=a;this.thisArg=b}c.prototype.call=function(a,b){return b.subscribe(new kd(a,this.predicate,this.thisArg))};return c}(),kd=function(c){function a(b,a,e){b=c.call(this,b)||this;b.predicate=a;b.thisArg=e;b.count=0;return b}h(a,c);a.prototype._next=function(b){var a;try{a=this.predicate.call(this.thisArg,b,this.count++)}catch(e){this.destination.error(e);return}a&&this.destination.next(b)};return a}(m),kc=function(){function c(){}c.prototype.call=function(a, b){return b.subscribe(new ld(a))};return c}(),ld=function(c){function a(b){b=c.call(this,b)||this;b.hasFirst=!1;b.observables=[];b.subscriptions=[];return b}h(a,c);a.prototype._next=function(b){this.observables.push(b)};a.prototype._complete=function(){var b=this.observables,a=b.length;if(0===a)this.destination.complete();else{for(var c=0;c<a&&!this.hasFirst;c++){var f=G(this,b[c],void 0,c);this.subscriptions&&this.subscriptions.push(f);this.add(f)}this.observables=null}};a.prototype.notifyNext=function(b, a,c){if(!this.hasFirst){this.hasFirst=!0;for(b=0;b<this.subscriptions.length;b++)if(b!==c){var d=this.subscriptions[b];d.unsubscribe();this.remove(d)}this.subscriptions=null}this.destination.next(a)};return a}(Q),hb=function(){function c(a){this.resultSelector=a}c.prototype.call=function(a,b){return b.subscribe(new md(a,this.resultSelector))};return c}(),md=function(c){function a(b,a,e){void 0===e&&Object.create(null);b=c.call(this,b)||this;b.resultSelector=a;b.iterators=[];b.active=0;b.resultSelector= "function"===typeof a?a:void 0;return b}h(a,c);a.prototype._next=function(b){var a=this.iterators;y(b)?a.push(new nd(b)):"function"===typeof b[H]?a.push(new od(b[H]())):a.push(new pd(this.destination,this,b))};a.prototype._complete=function(){var b=this.iterators,a=b.length;this.unsubscribe();if(0===a)this.destination.complete();else{this.active=a;for(var c=0;c<a;c++){var f=b[c];f.stillUnsubscribed?this.destination.add(f.subscribe()):this.active--}}};a.prototype.notifyInactive=function(){this.active--; 0===this.active&&this.destination.complete()};a.prototype.checkIterators=function(){for(var b=this.iterators,a=b.length,c=this.destination,f=0;f<a;f++){var g=b[f];if("function"===typeof g.hasValue&&!g.hasValue())return}for(var l=!1,h=[],f=0;f<a;f++){var g=b[f],k=g.next();g.hasCompleted()&&(l=!0);if(k.done){c.complete();return}h.push(k.value)}this.resultSelector?this._tryresultSelector(h):c.next(h);l&&c.c