simulateagent
Version:
Simulated apis for web developers
118 lines (116 loc) • 126 kB
JavaScript
/**
@license
Apache License 2.0 https://github.com/ReactiveX/RxJS/blob/master/LICENSE.txt
**/
/**
@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}Ob(c,a);c.prototype=null===a?Object.create(a):(b.prototype=a.prototype,new b)}function T(c){return"function"===typeof c}function U(c){setTimeout(function(){throw c;})}function Ja(c){Error.call(this);this.message=c?c.length+" errors occurred during unsubscription:\n"+c.map(function(a,
b){return b+1+") "+a.toString()}).join("\n "):"";this.name="UnsubscriptionError";this.errors=c;return this}function Ka(c){return c.reduce(function(a,b){return a.concat(b instanceof aa?b.errors:b)},[])}function pa(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 E(){}function qa(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return La(c)}function La(c){return c?1===c.length?c[0]:function(a){return c.reduce(function(b,a){return a(b)},
a)}:E}function Ma(c){c||(c=D.Promise||Promise);if(!c)throw Error("no Promise impl found");return c}function F(){Error.call(this);this.message="object unsubscribed";this.name="ObjectUnsubscribedError";return this}function ra(){return function(c){return c.lift(new Pb(c))}}function G(c){return c?Qb(c):M}function Qb(c){return new n(function(a){return c.schedule(function(){return a.complete()})})}function z(c){return c&&"function"===typeof c.schedule}function H(c,a){return a?new n(function(b){var d=new t,
e=0;d.add(a.schedule(function(){e===c.length?b.complete():(b.next(c[e++]),b.closed||d.add(this.schedule()))}));return d}):new n(Na(c))}function sa(c){var a=new n(function(b){b.next(c);b.complete()});a._isScalar=!0;a.value=c;return a}function ta(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];a=c[c.length-1];z(a)?c.pop():a=void 0;switch(c.length){case 0:return G(a);case 1:return a?H(c,a):sa(c[0]);default:return H(c,a)}}function ua(c,a){return a?new n(function(b){return a.schedule(Rb,0,
{error:c,subscriber:b})}):new n(function(b){return b.error(c)})}function Rb(c){c.subscriber.error(c.error)}function N(c){return c}function O(){Error.call(this);this.message="argument out of range";this.name="ArgumentOutOfRangeError";return this}function Oa(){Error.call(this);this.message="no elements in sequence";this.name="EmptyError";return this}function va(){Error.call(this);this.message="Timeout has occurred";this.name="TimeoutError";return this}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 Sb(c,a))}}function Pa(c,a,b){if(a)if(z(a))b=a;else return function(){for(var d=[],e=0;e<arguments.length;e++)d[e]=arguments[e];return Pa(c,b).apply(void 0,d).pipe(C(function(b){return A(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(Tb,
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(x){pa(g)?g.error(x):console.warn(x)}}return g.subscribe(d)})}}function Tb(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(Ub,
0,{value:1>=b.length?b[0]:b,subject:l}))}]))}catch(v){l.error(v)}}this.add(l.subscribe(d))}function Ub(c){var a=c.subject;a.next(c.value);a.complete()}function Qa(c,a,b){if(a)if(z(a))b=a;else return function(){for(var d=[],e=0;e<arguments.length;e++)d[e]=arguments[e];return Qa(c,b).apply(void 0,d).pipe(C(function(b){return A(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(Vb,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(x){pa(g)?g.error(x):console.warn(x)}}return g.subscribe(d)})}}function Vb(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(Ra,0,{err:c,subject:l})):a.add(g.schedule(Wb,0,{value:1>=b.length?b[0]:b,subject:l}))}]))}catch(v){this.add(g.schedule(Ra,0,{err:v,subject:l}))}}this.add(l.subscribe(d))}function Wb(c){var a=c.subject;a.next(c.value);a.complete()}function Ra(c){c.subject.error(c.err)}function Sa(c){return!!c&&"function"!==typeof c.subscribe&&"function"===typeof c.then}function p(c,
a,b,d,e){void 0===e&&(e=new J(c,b,d));if(!e.closed)return Ta(a)(e)}function Xb(c,a){return a?new n(function(b){var d=new t;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}):new n(Ua(c))}function Yb(c,a){if(!c)throw Error("Iterable cannot be null");return a?new n(function(b){var d=new t,e;d.add(function(){e&&"function"===typeof e.return&&
e.return()});d.add(a.schedule(function(){e=c[I]();d.add(a.schedule(function(){if(!b.closed){var a,c;try{var d=e.next();a=d.value;c=d.done}catch(v){b.error(v);return}c?b.complete():(b.next(a),this.schedule())}}))}));return d}):new n(Va(c))}function Zb(c,a){return a?new n(function(b){var d=new t;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}):new n(Wa(c))}function K(c,a){if(!a)return c instanceof n?c:new n(Ta(c));if(null!=c){if(c&&"function"===typeof c[W])return Zb(c,a);if(Sa(c))return Xb(c,a);if(Xa(c))return H(c,a);if(c&&"function"===typeof c[I]||"string"===typeof c)return Yb(c,a)}throw new TypeError((null!==c&&typeof c||c)+" is not observable");}function P(c,a,b){void 0===b&&(b=Number.POSITIVE_INFINITY);if("function"===typeof a)return function(d){return d.pipe(P(function(b,d){return K(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 $b(c,b))}}function wa(c){void 0===c&&(c=Number.POSITIVE_INFINITY);return P(N,c)}function Ya(){return wa(1)}function L(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return Ya()(ta.apply(void 0,c))}function xa(c){return new n(function(a){var b;try{b=c()}catch(d){a.error(d);return}return(b?K(b):G()).subscribe(a)})}function Za(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];var b;"function"===typeof c[c.length-
1]&&(b=c.pop());1===c.length&&A(c[0])&&(c=c[0]);return 0===c.length?M:b?Za(c).pipe(C(function(a){return b.apply(void 0,a)})):new n(function(b){return new ac(b,c)})}function $a(c,a,b,d){T(b)&&(d=b,b=void 0);return d?$a(c,a,b).pipe(C(function(b){return A(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 A(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(T(a))return function(){return a(d,f)}})}function bc(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!A(c)&&0<=c-parseFloat(c)+1}function cc(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];z(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]:wa(a)(H(c,b))}function ya(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];if(0===c.length)return M;var b=c[0],d=c.slice(1);return 1===c.length&&A(b)?ya.apply(void 0,b):new n(function(a){var c=function(){return a.add(ya.apply(void 0,d).subscribe(a))};return K(b).subscribe({next:function(b){a.next(b)},error:c,complete:c})})}function dc(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(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];if(1===c.length)if(A(c[0]))c=c[0];else return c[0];return H(c,void 0).lift(new ec)}function fc(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 eb(c,a,b){void 0===c&&(c=0);var d=-1;X(a)?d=1>Number(a)&&1||Number(a):z(a)&&(b=
a);z(b)||(b=y);return new n(function(a){var e=X(c)?c:+c-b.now();return b.schedule(gc,e,{index:0,period:d,subscriber:a})})}function gc(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 fb(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];a=c[c.length-1];"function"===typeof a&&c.pop();return H(c,void 0).lift(new gb(a))}function hb(c){return function(a){return a.lift(new hc(c))}}function ib(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 ic(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(jb,b,{subscriber:d,context:f})),this.schedule(c,a))}function jb(c){c.subscriber.closeContext(c.context)}function kb(c,a){return P(c,a,1)}function jc(c){c.debouncedNext()}function ba(c){void 0===c&&(c=null);return function(a){return a.lift(new kc(c))}}
function lb(c,a){return function(b){return b.lift(new lc(c,a))}}function Y(c,a){return function(b){return b.lift(new mc(c,a))}}function mb(c,a,b){return function(d){return d.lift(new nc(c,a,b))}}function oc(){return new ca}function za(c){return function(a){return 0===c?G():a.lift(new pc(c))}}function nb(c,a){return a?function(b){return b.pipe(nb(function(b,e){return K(c(b,e)).pipe(C(function(c,d){return a(b,c,e,d)}))}))}:function(b){return b.lift(new qc(c))}}function ha(c){return function(a){return 0===
c?G():a.lift(new rc(c))}}function ia(c,a){var b=!1;2<=arguments.length&&(b=!0);return function(d){return d.lift(new sc(c,a,b))}}function ja(c,a){return 2<=arguments.length?function(b){return qa(ia(c,a),ha(1),ba(a))(b)}:function(b){return qa(ia(function(b,a,f){return c(b,a,f+1)}),ha(1))(b)}}function Q(c,a){return function(b){var d;d="function"===typeof c?c:function(){return c};if("function"===typeof a)return b.lift(new tc(d,a));var e=Object.create(b,uc);e.source=b;e.subjectFactory=d;return e}}function vc(c,
a){function b(){return!b.pred.apply(b.thisArg,arguments)}b.pred=c;b.thisArg=a;return b}function wc(c,a){return function(b){var d=b;for(b=0;b<a;b++)if(d=d[c[b]],"undefined"===typeof d)return;return d}}function xc(c){var a=c.period;c.subscriber.notifyNext();this.schedule(c,a)}function yc(){return new u}function zc(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,r=!1;return function(a){l++;if(!g||
k)k=!1,g=new Z(b,d,f),h=a.subscribe({next:function(b){g.next(b)},error:function(b){k=!0;g.error(b)},complete:function(){r=!0;g.complete()}});var c=g.subscribe(this);this.add(function(){l--;c.unsubscribe();h&&!r&&e&&0===l&&(h.unsubscribe(),g=h=void 0)})}}function da(c,a){return"function"===typeof a?function(b){return b.pipe(da(function(b,e){return K(c(b,e)).pipe(C(function(c,d){return a(b,c,e,d)}))}))}:function(b){return b.lift(new Cc(c))}}function Dc(c){c.subscriber.clearThrottle()}function ob(c,
a,b){void 0===b&&(b=y);return function(d){var e=c instanceof Date&&!isNaN(+c),f=e?+c-b.now():Math.abs(c);return d.lift(new Ec(f,e,a,b))}}function Fc(c,a,b){if(0===b)return[a];c.push(a);return c}function Gc(c){var a=c.subscriber,b=c.windowTimeSpan,d=c.window;d&&a.closeWindow(d);c.window=a.openWindow();this.schedule(c,b)}function Hc(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 Ic(c,a){void 0===a&&(a=null);return new R({method:"GET",url:c,headers:a})}function Jc(c,a,b){return new R({method:"POST",
url:c,body:a,headers:b})}function Kc(c,a){return new R({method:"DELETE",url:c,headers:a})}function Lc(c,a,b){return new R({method:"PUT",url:c,body:a,headers:b})}function Mc(c,a,b){return new R({method:"PATCH",url:c,body:a,headers:b})}function Nc(c,a){return Oc(new R({method:"GET",url:c,responseType:"json",headers:a}))}function rb(c,a,b){Error.call(this);this.message=c;this.name="AjaxError";this.xhr=a;this.request=b;this.status=a.status;this.responseType=a.responseType||b.responseType;this.response=
sb(this.responseType,a);return this}function sb(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 Ob=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])},Pc=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},Aa=!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):Aa&&console.log("RxJS: Back to a better error behavior. Thank you. \x3c3");Aa=c},get useDeprecatedSynchronousErrorHandling(){return Aa}},ka={closed:!0,next:function(c){},error:function(c){if(D.useDeprecatedSynchronousErrorHandling)throw c;
U(c)},complete:function(){}},A=Array.isArray||function(c){return c&&"number"===typeof c.length};Ja.prototype=Object.create(Error.prototype);var aa=Ja,t=function(){function c(a){this.closed=!1;this._subscriptions=this._parents=this._parent=null;a&&(this._unsubscribe=a)}c.prototype.unsubscribe=function(){var a=!1,b;if(!this.closed){var c=this._parent,e=this._parents,f=this._unsubscribe,g=this._subscriptions;this.closed=!0;this._subscriptions=this._parents=this._parent=null;for(var l=-1,h=e?e.length:
0;c;)c.remove(this),c=++l<h&&e[l]||null;if(T(f))try{f.call(this)}catch(x){a=!0,b=x instanceof aa?Ka(x.errors):[x]}if(A(g))for(l=-1,h=g.length;++l<h;)if(c=g[l],null!==c&&"object"===typeof c)try{c.unsubscribe()}catch(x){a=!0,b=b||[],x instanceof aa?b=b.concat(Ka(x.errors)):b.push(x)}if(a)throw new aa(b);}};c.prototype.add=function(a){var b=a;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:if(!a)return c.EMPTY;throw Error("unrecognized teardown "+a+" added to Subscription.");}b._addParent(this)&&((a=this._subscriptions)?a.push(b):this._subscriptions=[b]);return b};c.prototype.remove=function(a){var b=this._subscriptions;b&&(a=b.indexOf(a),-1!==a&&b.splice(a,1))};c.prototype._addParent=function(a){var b=this._parent,c=this._parents;if(b!==a)if(b){if(!c)return this._parents=[a],!0;if(-1===c.indexOf(a))return c.push(a),
!0}else return this._parent=a,!0;return!1};c.EMPTY=function(a){a.closed=!0;return a}(new c);return c}(),la="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=ka;break;case 1:if(!b){f.destination=ka;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[la]=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._parent,a=this._parents;this._parents=this._parent=null;this.unsubscribe();this.isStopped=this.closed=!1;this._parent=b;this._parents=
a;return this};return a}(t),tb=function(c){function a(b,a,e,f){var d=c.call(this)||this;d._parentSubscriber=b;var l;b=d;T(a)?l=a:a&&(l=a.next,e=a.error,f=a.complete,a!==ka&&(b=Object.create(a),T(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):U(b),this.unsubscribe();else{this.unsubscribe();if(c)throw b;U(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;U(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):U(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[la]){a=a[la]();break a}}a=a||b||c?new m(a,b,c):new m(ka)}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),pa(a)?a.error(b):console.warn(b)}};c.prototype.forEach=function(a,b){var c=this;b=Ma(b);return new b(function(b,d){var e;e=c.subscribe(function(b){try{a(b)}catch(v){d(v),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:La(a)(this)};c.prototype.toPromise=
function(a){var b=this;a=Ma(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}();F.prototype=Object.create(Error.prototype);var 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}(t),vb=function(c){function a(b){var a=c.call(this,b)||this;a.destination=b;return a}h(a,c);return a}(m),u=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[la]=function(){return new vb(this)};a.prototype.lift=function(b){var a=new Ba(this,this);a.operator=b;return a};a.prototype.next=function(b){if(this.closed)throw new F;
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 F;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 F;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 F;return c.prototype._trySubscribe.call(this,b)};a.prototype._subscribe=function(b){if(this.closed)throw new F;if(this.hasError)return b.error(this.thrownError),t.EMPTY;if(this.isStopped)return b.complete(),t.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 Ba(b,a)};
return a}(n),Ba=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):t.EMPTY};return a}(u),Pb=function(){function c(a){this.connectable=
a}c.prototype.call=function(a,b){var c=this.connectable;c._refCount++;a=new Qc(a,c);b=b.subscribe(a);a.closed||(a.connection=c.connect());return b};return c}(),Qc=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 t,b.add(this.source.subscribe(new Rc(this.getSubject(),
this))),b.closed?(this._connection=null,b=t.EMPTY):this._connection=b);return b};a.prototype.refCount=function(){return ra()(this)};return a}(n),ea=wb.prototype,uc={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:ea._subscribe},_isComplete:{value:ea._isComplete,writable:!0},getSubject:{value:ea.getSubject},connect:{value:ea.connect},refCount:{value:ea.refCount}},Rc=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 Tc=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 Sc(a,
this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))};return c}(),Sc=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 u,c.set(a,d),b=new Ca(a,d,this),this.destination.next(b),this.durationSelector)){b=void 0;try{b=this.durationSelector(new Ca(a,d))}catch(l){this.error(l);return}this.add(b.subscribe(new Uc(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),Uc=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),Ca=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 t,c=this.refCountSubscription,f=this.groupSubject;c&&!c.closed&&a.add(new Vc(c));a.add(f.subscribe(b));return a};return a}(n),Vc=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}(t),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 F;return this._value};a.prototype.next=function(b){c.prototype.next.call(this,this._value=b)};return a}(u),fa=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}(t)),Wc=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}(fa),Da=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}(),S=function(c){function a(b,d){void 0===d&&(d=Da.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}(Da),yb=new (function(c){function a(){return null!==c&&c.apply(this,arguments)||this}h(a,c);return a}(S))(Wc),M=new n(function(c){return c.complete()}),
Na=function(c){return function(a){for(var b=0,d=c.length;b<d&&!a.closed;b++)a.next(c[b]);a.closed||a.complete()}},zb;(function(c){c.NEXT="N";c.ERROR="E";c.COMPLETE="C"})(zb||(zb={}));var w=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 ta(this.value);case "E":return ua(this.error);case "C":return G()}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}(),Xc=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 Ab(a,this.scheduler,this.delay))};return c}(),Ab=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 Yc(b,this.destination)))};a.prototype._next=function(b){this.scheduleMessage(w.createNext(b))};a.prototype._error=function(b){this.scheduleMessage(w.createError(b));this.unsubscribe()};a.prototype._complete=function(){this.scheduleMessage(w.createComplete());this.unsubscribe()};return a}(m),Yc=function(){return function(c,a){this.notification=c;this.destination=a}}(),
Z=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){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._events.push(new Zc(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 F;this.isStopped||this.hasError?l=t.EMPTY:(this.observers.push(b),l=new ub(this,b));f&&b.add(b=new Ab(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||yb).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}(u),Zc=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),t.EMPTY):this.hasCompleted&&this.hasNext?(b.next(this.value),b.complete(),t.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}(u),$c=1,Ea={},Bb={setImmediate:function(c){var a=$c++;Ea[a]=c;Promise.resolve().then(function(){var b=Ea[a];b&&b()});return a},clearImmediate:function(c){delete Ea[c]}},ad=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=
Bb.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&&(Bb.clearImmediate(a),b.scheduled=void 0)};return a}(fa),ma=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}(S))(ad),y=new S(fa),bd=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}(fa),cd=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}(S))(bd),Cb=function(c){function a(b,a){void 0===b&&(b=Fa);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}(S),
Fa=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}(fa);O.prototype=Object.create(Error.prototype);Oa.prototype=Object.create(Error.prototype);var ca=Oa;va.prototype=Object.create(Error.prototype);var Sb=function(){function c(a,b){this.project=a;this.thisArg=b}c.prototype.call=function(a,
b){return b.subscribe(new dd(a,this.project,this.thisArg))};return c}(),dd=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),J=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),Ua=function(c){return function(a){c.then(function(b){a.closed||(a.next(b),a.complete())},function(b){return a.error(b)}).then(null,U);return a}},I;I="function"===typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";var Va=function(c){return function(a){var b=c[I]();do{var d=b.next();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}},Wa=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)}},Xa=function(c){return c&&"number"===typeof c.length&&"function"!==typeof c},Ta=function(c){if(c instanceof n)return function(a){if(c._isScalar)a.next(c.value),a.complete();else return c.subscribe(a)};if(c&&"function"===typeof c[W])return Wa(c);if(Xa(c))return Na(c);if(Sa(c))return Ua(c);if(c&&"function"===typeof c[I])return Va(c);throw new TypeError("You provided "+
(null!==c&&"object"===typeof c?"an invalid object":"'"+c+"'")+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.");},Db={},Ga=function(){function c(a){this.resultSelector=a}c.prototype.call=function(a,b){return b.subscribe(new ed(a,this.resultSelector))};return c}(),ed=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(Db);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++){var f=b[c];this.add(p(this,f,f,c))}}};a.prototype.notifyComplete=function(b){0===--this.active&&this.destination.complete()};a.prototype.notifyNext=function(b,a,c,f,g){b=this.values;f=b[c];f=this.toRespond?f===Db?--this.toRespond:this.toRespond:0;b[c]=a;0===f&&(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),$b=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 fd(a,this.project,this.concurrent))};return c}(),fd=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,b,c)};a.prototype._innerSub=function(b,a,c){var d=new J(this,void 0,void 0);this.destination.add(d);p(this,b,a,c,d)};a.prototype._complete=function(){this.hasCompleted=!0;0===this.active&&
0===this.buffer.length&&this.destination.complete();this.unsubscribe()};a.prototype.notifyNext=function(b,a,c,f,g){this.destination.next(a)};a.prototype.notifyComplete=function(b){var a=this.buffer;this.remove(b);this.active--;0<a.length?this._next(a.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()};return a}(q),ac=function(c){function a(b,a){b=c.call(this,b)||this;b.sources=a;b.completed=0;b.haveValues=0;var d=a.length;b.values=Array(d);for(var f=0;f<d;f++){var g=p(b,a[f],
null,f);g&&b.add(g)}return b}h(a,c);a.prototype.notifyNext=function(b,a,c,f,g){this.values[c]=a;g._hasValue||(g._hasValue=!0,this.haveValues++)};a.prototype.notifyComplete=function(b){var a=this.destination,c=this.haveValues,f=this.values,g=f.length;b._hasValue?(this.completed++,this.completed===g&&(c===g&&a.next(f),a.complete())):a.complete()};return a}(q),Eb=new n(E),ec=function(){function c(){}c.prototype.call=function(a,b){return b.subscribe(new gd(a))};return c}(),gd=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=b[c],f=p(this,f,f,c);this.subscriptions&&this.subscriptions.push(f);this.add(f)}this.observables=null}};a.prototype.notifyNext=function(b,a,c,f,g){if(!this.hasFirst){this.hasFirst=!0;for(b=0;b<this.subscriptions.length;b++)b!==
c&&(f=this.subscriptions[b],f.unsubscribe(),this.remove(f));this.subscriptions=null}this.destination.next(a)};return a}(q),gb=function(){function c(a){this.resultSelector=a}c.prototype.call=function(a,b){return b.subscribe(new hd(a,this.resultSelector))};return c}(),hd=function(c){function a(b,a,e){void 0===e&&(e=Object.create(null));b=c.call(this,b)||this;b.iterators=[];b.active=0;b.resultSelector="function"===typeof a?a:null;b.values=e;return b}h(a,c);a.prototype._next=function(b){var a=this.iterators;
A(b)?a.push(new id(b)):"function"===typeof b[I]?a.push(new jd(b[I]())):a.push(new kd(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(f,c)):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.complete()};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}(m),jd=function(){function c(a){this.iterator=
a;this.nextResult=a.next()}c.prototype.hasValue=function(){return!0};c.prototype.next=function(){var a=this.nextResult;this.nextResult=this.iterator.next();return a};c.prototype.hasCompleted=function(){var a=this.nextResult;return a&&a.done};return c}(),id=function(){function c(a){this.array=a;this.length=this.index=0;this.length=a.length}c.prototype[I]=function(){return this};c.prototype.next=function(a){a=this.index++;var b=this.array;return a<this.length?{value:b[a],done:!1}:{value:null,done:!0}};
c.prototype.hasValue=function(){return this.array.length>this.index};c.prototype.hasCompleted=function(){return this.array.length===this.index};return c}(),kd=function(c){function a(b,a,e){b=c.call(this,b)||this;b.parent=a;b.observable=e;b.stillUnsubscribed=!0;b.buffer=[];b.isComplete=!1;return b}h(a,c);a.prototype[I]=function(){return this};a.prototype.next=function(){var b=this.buffer;return 0===b.