UNPKG

145 kBJavaScriptView Raw
1/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
2(function(a){function b(a){return a&&a.Object===Object?a:null}function c(a){for(var b=a.length,c=new Array(b),d=0;b>d;d++)c[d]=a[d];return c}function d(a){return function(){try{return a.apply(this,arguments)}catch(b){return Ya.e=b,Ya}}}function e(a){throw a}function f(a,b){if($a&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(cb)){for(var c=[],d=b;d;d=d.source)d.stack&&c.unshift(d.stack);c.unshift(a.stack);var e=c.join("\n"+cb+"\n");a.stack=g(e)}}function g(a){for(var b=a.split("\n"),c=[],d=0,e=b.length;e>d;d++){var f=b[d];h(f)||i(f)||!f||c.push(f)}return c.join("\n")}function h(a){var b=k(a);if(!b)return!1;var c=b[0],d=b[1];return c===ab&&d>=bb&&Eg>=d}function i(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function j(){if($a)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=k(c);if(!d)return;return ab=d[0],d[1]}}function k(a){var b=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(a);if(b)return[b[1],Number(b[2])];var c=/at ([^ ]+):(\d+):(?:\d+)$/.exec(a);if(c)return[c[1],Number(c[2])];var d=/.*@(.+):(\d+)$/.exec(a);return d?[d[1],Number(d[2])]:void 0}function l(b,c,d,e,f,g){var h=Vb(b),i=h.length,j=Vb(c),k=j.length;if(i!==k&&!e)return!1;for(var l,m=i;m--;)if(l=h[m],!(e?l in c:Sb.call(c,l)))return!1;for(var n=e;++m<i;){l=h[m];var o,p=b[l],q=c[l];if(!(o===a?d(p,q,e,f,g):o))return!1;n||(n="constructor"===l)}if(!n){var r=b.constructor,s=c.constructor;if(r!==s&&"constructor"in b&&"constructor"in c&&!("function"==typeof r&&r instanceof r&&"function"==typeof s&&s instanceof s))return!1}return!0}function m(a,b,c){switch(c){case vb:case wb:return+a===+b;case xb:return a.name===b.name&&a.message===b.message;case Ab:return a!==+a?b!==+b:a===+b;case Cb:case Eb:return a===b+""}return!1}function n(a){return!!a&&"object"==typeof a}function o(a){return"number"==typeof a&&a>-1&&a%1===0&&Ub>=a}function p(a){return n(a)&&o(a.length)&&!!Qb[Tb.call(a)]}function q(a,b){for(var c=-1,d=a.length;++c<d;)if(b(a[c],c,a))return!0;return!1}function r(b,c,d,e,f,g){var h=-1,i=b.length,j=c.length;if(i!==j&&!(e&&j>i))return!1;for(;++h<i;){var k,l=b[h],m=c[h];if(k!==a){if(k)continue;return!1}if(e){if(!q(c,function(a){return l===a||d(l,a,e,f,g)}))return!1}else if(l!==m&&!d(l,m,e,f,g))return!1}return!0}function s(a,b,c,d,e,f){var g=Xb(a),h=Xb(b),i=ub,j=ub;g||(i=Tb.call(a),i===tb?i=Bb:i!==Bb&&(g=p(a))),h||(j=Tb.call(b),j===tb&&(j=Bb));var k=i===Bb&&!Wb(a),n=j===Bb&&!Wb(b),o=i===j;if(o&&!g&&!k)return m(a,b,i);if(!d){var q=k&&Sb.call(a,"__wrapped__"),s=n&&Sb.call(b,"__wrapped__");if(q||s)return c(q?a.value():a,s?b.value():b,d,e,f)}if(!o)return!1;e||(e=[]),f||(f=[]);for(var t=e.length;t--;)if(e[t]===a)return f[t]===b;e.push(a),f.push(b);var u=(g?r:l)(a,b,c,d,e,f);return e.pop(),f.pop(),u}function t(a,b,c,d,e){return a===b?!0:null==a||null==b||!_(a)&&!n(b)?a!==a&&b!==b:s(a,b,t,c,d,e)}function u(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function v(a,b){this.id=a,this.value=b}function w(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function x(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function y(a){this._s=a,this.isDisposed=!1}function z(a){this._s=a}function A(a){this._s=a,this._l=a.length,this._i=0}function B(a){this._a=a}function C(a){this._a=a,this._l=G(a),this._i=0}function D(a){return"number"==typeof a&&Oa.isFinite(a)}function E(b){var c,d=b[mb];if(!d&&"string"==typeof b)return c=new z(b),c[mb]();if(!d&&b.length!==a)return c=new B(b),c[mb]();if(!d)throw new TypeError("Object is not iterable");return b[mb]()}function F(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function G(a){var b=+a.length;return isNaN(b)?0:0!==b&&D(b)?(b=F(b)*Math.floor(Math.abs(b)),0>=b?0:b>od?od:b):b}function H(a,b){return sc(a)||(a=zc),new qd(b,a)}function I(a,b){this.observer=a,this.parent=b}function J(a,b){return a.amb(b)}function K(){return!1}function L(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function K(){return!1}function L(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function K(){return!1}function M(){return[]}function K(){return!1}function M(){return[]}function L(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function N(a){return function(b){return a.subscribe(b)}}function O(a){return a.toArray()}function P(a){return a.length>0}function Q(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function R(a){this.comparer=a,this.set=[]}function S(b,c){return function(d){for(var e=d,f=0;c>f;f++){var g=e[b[f]];if("undefined"==typeof g)return a;e=g}return e}}function T(a){if(0===a.length)throw new gb;return a[0]}function U(a,b,c,d){var e=qb(b,c,3);return new vg(function(b){return a.subscribe(new hf(b,a,e,d))},a)}function V(a){return a?Vc.isObservable(a)?a:Wa(a)?Vc.fromPromise(a):$(a)||Z(a)?rf.call(this,a):Xa(a)?Y.call(this,a):pb(a)||ob(a)?W.call(this,a):_(a)?X.call(this,a):a:a}function W(a){return Vc.from(a).concatMap(function(a){return Vc.isObservable(a)||_(a)?V.call(null,a):Pa.Observable.just(a)}).toArray()}function X(b){function c(b,c){d[c]=a,f.push(b.map(function(a){d[c]=a}))}for(var d=new b.constructor,e=Object.keys(b),f=[],g=0,h=e.length;h>g;g++){var i=e[g],j=V.call(this,b[i]);j&&Vc.isObservable(j)?c(j,i):d[i]=b[i]}return Vc.forkJoin.apply(Vc,f).map(function(){return d})}function Y(a){var b=this;return new vg(function(c){a.call(b,function(){var a=arguments[0],b=arguments[1];if(a)return c.onError(a);if(arguments.length>2){for(var d=[],e=1,f=arguments.length;f>e;e++)d.push(arguments[e]);b=d}c.onNext(b),c.onCompleted()})})}function Z(a){return Xa(a.next)&&Xa(a["throw"])}function $(a){var b=a.constructor;return b?"GeneratorFunction"===b.name||"GeneratorFunction"===b.displayName?!0:Z(b.prototype):!1}function _(a){return Object==a.constructor}function aa(a,b,c,d){var e=new Ag;return d.push(ba(e,b,c)),a.apply(b,d),e.asObservable()}function ba(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];if(Xa(c)){if(e=Za(c).apply(b,e),e===Ya)return a.onError(e.e);a.onNext(e)}else e.length<=1?a.onNext(e[0]):a.onNext(e);a.onCompleted()}}function ca(a,b,c,d){var e=new Ag;return d.push(da(e,b,c)),a.apply(b,d),e.asObservable()}function da(a,b,c){return function(){var d=arguments[0];if(d)return a.onError(d);for(var e=arguments.length,f=[],g=1;e>g;g++)f[g-1]=arguments[g];if(Xa(c)){var f=Za(c).apply(b,f);if(f===Ya)return a.onError(f.e);a.onNext(f)}else f.length<=1?a.onNext(f[0]):a.onNext(f);a.onCompleted()}}function ea(a){return Oa.StaticNodeList?a instanceof Oa.StaticNodeList||a instanceof Oa.NodeList:"[object NodeList]"===Object.prototype.toString.call(a)}function fa(a,b,c){this._e=a,this._n=b,this._fn=c,this._e.addEventListener(this._n,this._fn,!1),this.isDisposed=!1}function ga(a,b,c){var d=new cc,e=Object.prototype.toString.call(a);if(ea(a)||"[object HTMLCollection]"===e)for(var f=0,g=a.length;g>f;f++)d.add(ga(a.item(f),b,c));else a&&d.add(new fa(a,b,c));return d}function ha(a,b,c){return new vg(function(d){function e(a,b){if(j[b]=a,g[b]=!0,h||(h=g.every(Ra))){if(f)return d.onError(f);var e=Za(c).apply(null,j);if(e===Ya)return d.onError(e.e);d.onNext(e)}i&&j[1]&&d.onCompleted()}var f,g=[!1,!1],h=!1,i=!1,j=new Array(2);return new mc(a.subscribe(function(a){e(a,0)},function(a){j[1]?d.onError(a):f=a},function(){i=!0,j[1]&&d.onCompleted()}),b.subscribe(function(a){e(a,1)},function(a){d.onError(a)},function(){i=!0,e(!0,1)}))},a)}function O(a){return a.toArray()}function ia(a,b){return a.groupJoin(this,b,md,function(a,b){return b})}function ja(a){var b=this;return new vg(function(c){var d=new zg,e=new cc,f=new oc(e);return c.onNext(_b(d,f)),e.add(b.subscribe(function(a){d.onNext(a)},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),Wa(a)&&(a=gd(a)),e.add(a.subscribe(function(a){d.onCompleted(),d=new zg,c.onNext(_b(d,f))},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),f},b)}function ka(a){var b=this;return new vg(function(c){function d(){var b;try{b=a()}catch(f){return void c.onError(f)}Wa(b)&&(b=gd(b));var i=new kc;e.setDisposable(i),i.setDisposable(b.take(1).subscribe(Qa,function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),h=new zg,c.onNext(_b(h,g)),d()}))}var e=new lc,f=new cc(e),g=new oc(f),h=new zg;return c.onNext(_b(h,g)),f.add(b.subscribe(function(a){h.onNext(a)},function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),c.onCompleted()})),d(),g},b)}function la(a,b){return new If(a,b)}function L(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function ma(a){this.patterns=a}function na(a,b){this.expression=a,this.selector=b}function oa(a){return function(b){a.onError(b)}}function pa(a,b){return function(){var c=Za(a.selector).apply(a,arguments);return c===Ya?b.onError(c.e):void b.onNext(c)}}function qa(a,b,c){var d=a.get(b);if(!d){var e=new Qf(b,c);return a.set(b,e),e}return d}function ra(a,b,c){this.joinObserverArray=a,this.onNext=b,this.onCompleted=c,this.joinObservers=new Pf;for(var d=0,e=this.joinObserverArray.length;e>d;d++){var f=this.joinObserverArray[d];this.joinObservers.set(f,f)}}function sa(a,b){return new Rf(a,b)}function ta(a,b,c){return new vg(function(d){var e=a,f=rc(b);return c.scheduleRecursiveFuture(0,e,function(a,b){if(f>0){var g=c.now();e=new Date(e.getTime()+f),e.getTime()<=g&&(e=new Date(g+f))}d.onNext(a),b(a+1,new Date(e))})})}function ua(a,b,c){return a===b?new vg(function(a){return c.schedulePeriodic(0,b,function(b){return a.onNext(b),b+1})}):jd(function(){return ta(new Date(c.now()+a),b,c)})}function va(a,b,c){return new vg(function(d){var e,f=!1,g=new lc,h=null,i=[],j=!1;return e=a.materialize().timestamp(c).subscribe(function(a){var e,k;"E"===a.value.kind?(i=[],i.push(a),h=a.value.error,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new kc,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveFuture(null,b,function(a,b){var e,g,k,l;if(null===h){j=!0;do k=null,i.length>0&&i[0].timestamp-c.now()<=0&&(k=i.shift().value),null!==k&&k.accept(d);while(null!==k);l=!1,g=0,i.length>0?(l=!0,g=Math.max(0,i[0].timestamp-c.now())):f=!1,e=h,j=!1,null!==e?d.onError(e):l&&b(null,g)}}))))}),new mc(e,g)},a)}function wa(a,b,c){return jd(function(){return va(a,b-c.now(),c)})}function xa(a,b,c){var d,e;return Xa(b)?e=b:(d=b,e=c),new vg(function(b){function c(){i.setDisposable(a.subscribe(function(a){var c=Za(e)(a);if(c===Ya)return b.onError(c.e);var d=new kc;g.add(d),d.setDisposable(c.subscribe(function(){b.onNext(a),g.remove(d),f()},function(a){b.onError(a)},function(){b.onNext(a),g.remove(d),f()}))},function(a){b.onError(a)},function(){h=!0,i.dispose(),f()}))}function f(){h&&0===g.length&&b.onCompleted()}var g=new cc,h=!1,i=new lc;return d?i.setDisposable(d.subscribe(c,function(a){b.onError(a)},c)):c(),new mc(i,g)},this)}function ya(a,b){return new vg(function(c){var d,e=!1,f=new lc,g=0,h=a.subscribe(function(a){var h=Za(b)(a);if(h===Ya)return c.onError(h.e);Wa(h)&&(h=gd(h)),e=!0,d=a,g++;var i=g,j=new kc;f.setDisposable(j),j.setDisposable(h.subscribe(function(){e&&g===i&&c.onNext(d),e=!1,j.dispose()},function(a){c.onError(a)},function(){e&&g===i&&c.onNext(d),e=!1,j.dispose()}))},function(a){f.dispose(),c.onError(a),e=!1,g++},function(){f.dispose(),e&&c.onNext(d),c.onCompleted(),e=!1,g++});return new mc(h,f)},a)}function O(a){return a.toArray()}function O(a){return a.toArray()}function za(a,b){return new vg(function(c){function d(){g&&(g=!1,c.onNext(e)),f&&c.onCompleted()}var e,f=!1,g=!1,h=new kc;return h.setDisposable(a.subscribe(function(a){g=!0,e=a},function(a){c.onError(a)},function(){f=!0,h.dispose()})),new mc(h,b.subscribe(d,function(a){c.onError(a)},d))},a)}function Aa(a,b,c,d){return Xa(b)&&(d=c,c=b,b=vd()),Vc.isObservable(d)||(d=Bd(new Zf)),new vg(function(e){function f(a){function b(){return l=c===k}var c=k,f=new kc;i.setDisposable(f),f.setDisposable(a.subscribe(function(){b()&&h.setDisposable(d.subscribe(e)),f.dispose()},function(a){b()&&e.onError(a)},function(){b()&&h.setDisposable(d.subscribe(e))}))}function g(){var a=!l;return a&&k++,a}var h=new lc,i=new lc,j=new kc;h.setDisposable(j);var k=0,l=!1;return f(b),j.setDisposable(a.subscribe(function(a){if(g()){e.onNext(a);var b=Za(c)(a);if(b===Ya)return e.onError(b.e);f(Wa(b)?gd(b):b)}},function(a){g()&&e.onError(a)},function(){g()&&e.onCompleted()})),new mc(h,i)},a)}function Ba(a,b,c,d){return sc(c)&&(d=c,c=Bd(new Zf)),c instanceof Error&&(c=Bd(c)),sc(d)||(d=Ec),Vc.isObservable(c)||(c=Bd(new Zf)),new vg(function(e){function f(){var a=g;k.setDisposable(d.scheduleFuture(null,b,function(){j=g===a,j&&(Wa(c)&&(c=gd(c)),i.setDisposable(c.subscribe(e)))}))}var g=0,h=new kc,i=new lc,j=!1,k=new lc;return i.setDisposable(h),f(),h.setDisposable(a.subscribe(function(a){j||(g++,e.onNext(a),f())},function(a){j||(g++,e.onError(a))},function(){j||(g++,e.onCompleted())})),new mc(i,k)},a)}function Ca(a){return{"@@transducer/init":function(){return a},"@@transducer/step":function(a,b){return a.onNext(b)},"@@transducer/result":function(a){return a.onCompleted()}}}function Da(a){this.predicate=a}function Ea(a){this.predicate=a}function Fa(a,b){var c=this;this.scheduler=a,this.messages=b,this.subscriptions=[],this.observers=[];for(var d=0,e=this.messages.length;e>d;d++){var f=this.messages[d],g=f.value;!function(b){a.scheduleAbsolute(null,f.time,function(){for(var a=c.observers.slice(0),d=0,e=a.length;e>d;d++)b.accept(a[d]);return gc})}(g)}}var Ga={"function":!0,object:!0},Ha=Ga[typeof exports]&&exports&&!exports.nodeType?exports:null,Ia=Ga[typeof module]&&module&&!module.nodeType?module:null,Ja=b(Ha&&Ia&&"object"==typeof global&&global),Ka=b(Ga[typeof self]&&self),La=b(Ga[typeof window]&&window),Ma=Ia&&Ia.exports===Ha?Ha:null,Na=b(Ga[typeof this]&&this),Oa=Ja||La!==(Na&&Na.window)&&La||Ka||Na||Function("return this")(),Pa={internals:{},config:{Promise:Oa.Promise},helpers:{}},Qa=Pa.helpers.noop=function(){},Ra=Pa.helpers.identity=function(a){return a},Sa=Pa.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}(),Ta=Pa.helpers.defaultComparer=function(a,b){return Yb(a,b)},Ua=Pa.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},Va=(Pa.helpers.defaultKeySerializer=function(a){return a.toString()},Pa.helpers.defaultError=function(a){throw a}),Wa=Pa.helpers.isPromise=function(a){return!!a&&"function"!=typeof a.subscribe&&"function"==typeof a.then},Xa=Pa.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==db.call(a)}),a}(),Ya={e:{}},Za=Pa.internals.tryCatch=function(a){if(!Xa(a))throw new TypeError("fn must be a function");return d(a)};Pa.config.longStackSupport=!1;var $a=!1,_a=Za(function(){throw new Error})();$a=!!_a.e&&!!_a.e.stack;var ab,bb=j(),cb="From previous event:",db=Object.prototype.toString;Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c,d;if(null==this)throw new TypeError(" this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=0;f>d;){var g;d in e&&(g=e[d],a.call(c,g,d,e)),d++}});var eb=Object("a"),fb="a"!==eb[0]||!(0 in eb);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=fb&&db.call(this)===stringClass?this.split(""):b,d=c.length>>>0,e=arguments[1];if(db.call(a)!==funcClass)throw new TypeError(a+" is not a function");for(var f=0;d>f;f++)if(f in c&&!a.call(e,c[f],f,b))return!1;return!0}),Array.prototype.map||(Array.prototype.map=function(a){var b=Object(this),c=fb&&db.call(this)===stringClass?this.split(""):b,d=c.length>>>0,e=new Array(d),f=arguments[1];if(db.call(a)!==funcClass)throw new TypeError(a+" is not a function");for(var g=0;d>g;g++)g in c&&(e[g]=a.call(f,c[g],g,b));return e}),Array.prototype.filter||(Array.prototype.filter=function(a){for(var b,c=[],d=new Object(this),e=0,f=d.length>>>0;f>e;e++)b=d[e],e in d&&a.call(arguments[1],b,e,d)&&c.push(b);return c}),Array.isArray||(Array.isArray=function(a){return db.call(a)===arrayClass}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!==d?d=0:0!==d&&d!==1/0&&d!==-(1/0)&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1}),Object.prototype.propertyIsEnumerable||(Object.prototype.propertyIsEnumerable=function(a){for(var b in this)if(b===a)return!0;return!1}),Object.keys||(Object.keys=function(){"use strict";var a=Object.prototype.hasOwnProperty,b=!{toString:null}.propertyIsEnumerable("toString");return function(c){if("object"!=typeof c&&("function"!=typeof c||null===c))throw new TypeError("Object.keys called on non-object");var d,e,f=[];for(d in c)a.call(c,d)&&f.push(d);if(b)for(e=0;sb>e;e++)a.call(c,rb[e])&&f.push(rb[e]);return f}}()),"function"!=typeof Object.create&&(Object.create=function(){function a(){}var b=Object.prototype.hasOwnProperty;return function(c){if("object"!=typeof c)throw new TypeError("Object prototype may only be an Object or null");a.prototype=c;var d=new a;if(a.prototype=null,arguments.length>1){var e=Object(arguments[1]);for(var f in e)b.call(e,f)&&(d[f]=e[f])}return d}}()),Oa.Element&&Oa.Element.prototype.attachEvent&&!Oa.Element.prototype.addEventListener&&function(){function a(a,b){Window.prototype[a]=HTMLDocument.prototype[a]=Element.prototype[a]=b}function b(){b.interval&&document.body&&(b.interval=clearInterval(b.interval),document.dispatchEvent(new CustomEvent("DOMContentLoaded")))}a("addEventListener",function(a,b){var c=this,d=c._c1_listeners=c._c1_listeners||{},e=d[a]=d[a]||[];c.attachEvent("on"+a,e.event=function(a){a||(a=Oa.event);var b=c.document&&c.document.documentElement||c.documentElement||{scrollLeft:0,scrollTop:0};switch(a.currentTarget=c,a.pageX=a.clientX+b.scrollLeft,a.pageY=a.clientY+b.scrollTop,a.preventDefault=function(){if(a.bubbledKeyCode=a.keyCode,a.ctrlKey)try{a.keyCode=0}catch(a){}a.defaultPrevented=!0,a.returnValue=!1,a.modified=!0,a.returnValue=!1},a.stopImmediatePropagation=function(){k=!1,a.cancelBubble=!0},a.stopPropagation=function(){a.cancelBubble=!0},a.relatedTarget=a.fromElement||null,a.target=a.srcElement||c,a.timeStamp=+new Date,a.type){case"keypress":var d="charCode"in a?a.charCode:a.keyCode;10===d?(d=0,a.keyCode=13):13===d||27===d?d=0:3===d&&(d=99),a.charCode=d,a.keyChar=a.charCode?String.fromCharCode(a.charCode):""}var f={};for(var g in a)f[g]=a[g];for(var h,i=0,j=[].concat(e),k=!0;k&&(h=j[i]);++i)for(var l,m=0;l=e[m];++m)if(l===h){l.call(c,f);break}}),e.push(b)}),a("removeEventListener",function(a,b){for(var c,d=this,e=d._c1_listeners=d._c1_listeners||{},f=e[a]=e[a]||[],g=f.length-1;c=f[g];--g)if(c===b){f.splice(g,1);break}!f.length&&f.event&&d.detachEvent("on"+a,f.event)}),a("dispatchEvent",function(a){var b=this,c=a.type,d=b._c1_listeners=b._c1_listeners||{},e=d[c]=d[c]||[];try{return b.fireEvent("on"+c,a)}catch(f){return e.event&&e.event(a)}}),b.interval=setInterval(b,1),Oa.addEventListener("load",b)}(),(!Oa.CustomEvent||"object"==typeof Oa.CustomEvent)&&function(){function b(b,c){var d;c=c||{bubbles:!1,cancelable:!1,detail:a};try{document.createEvent?(d=document.createEvent("CustomEvent"),d.initCustomEvent(b,c.bubbles,c.cancelable,c.detail)):document.createEventObject&&(d=document.createEventObject())}catch(e){d=document.createEvent("Event"),d.initEvent(b,c.bubbles,c.cancelable),d.detail=c.detail}return d}Oa.CustomEvent&&(b.prototype=Oa.CustomEvent.prototype),Oa.CustomEvent=b}();var gb=Pa.EmptyError=function(){this.message="Sequence contains no elements.",Error.call(this)};gb.prototype=Object.create(Error.prototype),gb.prototype.name="EmptyError";var hb=Pa.ObjectDisposedError=function(){this.message="Object has been disposed",Error.call(this)};hb.prototype=Object.create(Error.prototype),hb.prototype.name="ObjectDisposedError";var ib=Pa.ArgumentOutOfRangeError=function(){this.message="Argument out of range",Error.call(this)};ib.prototype=Object.create(Error.prototype),ib.prototype.name="ArgumentOutOfRangeError";var jb=Pa.NotSupportedError=function(a){this.message=a||"This operation is not supported",Error.call(this)};jb.prototype=Object.create(Error.prototype),jb.prototype.name="NotSupportedError";var kb=Pa.NotImplementedError=function(a){this.message=a||"This operation is not implemented",Error.call(this)};kb.prototype=Object.create(Error.prototype),kb.prototype.name="NotImplementedError";var lb=Pa.helpers.notImplemented=function(){throw new kb},mb=(Pa.helpers.notSupported=function(){throw new jb},"function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_");Oa.Set&&"function"==typeof(new Oa.Set)["@@iterator"]&&(mb="@@iterator");var nb=Pa.doneEnumerator={done:!0,value:a},ob=Pa.helpers.isIterable=function(b){return b&&b[mb]!==a},pb=Pa.helpers.isArrayLike=function(b){return b&&b.length!==a};Pa.helpers.iterator=mb;var qb=Pa.internals.bindCallback=function(a,b,c){if("undefined"==typeof b)return a;switch(c){case 0:return function(){return a.call(b)};case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}},rb=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],sb=rb.length,tb="[object Arguments]",ub="[object Array]",vb="[object Boolean]",wb="[object Date]",xb="[object Error]",yb="[object Function]",zb="[object Map]",Ab="[object Number]",Bb="[object Object]",Cb="[object RegExp]",Db="[object Set]",Eb="[object String]",Fb="[object WeakMap]",Gb="[object ArrayBuffer]",Hb="[object Float32Array]",Ib="[object Float64Array]",Jb="[object Int8Array]",Kb="[object Int16Array]",Lb="[object Int32Array]",Mb="[object Uint8Array]",Nb="[object Uint8ClampedArray]",Ob="[object Uint16Array]",Pb="[object Uint32Array]",Qb={};Qb[Hb]=Qb[Ib]=Qb[Jb]=Qb[Kb]=Qb[Lb]=Qb[Mb]=Qb[Nb]=Qb[Ob]=Qb[Pb]=!0,Qb[tb]=Qb[ub]=Qb[Gb]=Qb[vb]=Qb[wb]=Qb[xb]=Qb[yb]=Qb[zb]=Qb[Ab]=Qb[Bb]=Qb[Cb]=Qb[Db]=Qb[Eb]=Qb[Fb]=!1;var Rb=Object.prototype,Sb=Rb.hasOwnProperty,Tb=Rb.toString,Ub=Math.pow(2,53)-1,Vb=Object.keys||function(){var a=Object.prototype.hasOwnProperty,b=!{toString:null}.propertyIsEnumerable("toString"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],d=c.length;return function(e){if("object"!=typeof e&&("function"!=typeof e||null===e))throw new TypeError("Object.keys called on non-object");var f,g,h=[];for(f in e)a.call(e,f)&&h.push(f);if(b)for(g=0;d>g;g++)a.call(e,c[g])&&h.push(c[g]);return h}}(),_=Pa.internals.isObject=function(a){var b=typeof a;return!!a&&("object"===b||"function"===b)},Wb=function(){try{Object({toString:0}+"")}catch(a){return function(){return!1}}return function(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}}(),Xb=Array.isArray||function(a){return n(a)&&o(a.length)&&Tb.call(a)===ub},Yb=Pa.internals.isEqual=function(a,b){return t(a,b)},Zb=({}.hasOwnProperty,Array.prototype.slice,Pa.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),$b=Pa.internals.addProperties=function(a){for(var b=[],c=1,d=arguments.length;d>c;c++)b.push(arguments[c]);for(var e=0,f=b.length;f>e;e++){var g=b[e];for(var h in g)a[h]=g[h]}},_b=Pa.internals.addRef=function(a,b){return new vg(function(c){return new mc(b.getDisposable(),a.subscribe(c))})};v.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var ac=Pa.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},bc=ac.prototype;bc.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},bc.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},bc.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},bc.peek=function(){return this.items[0].value},bc.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},bc.dequeue=function(){var a=this.peek();return this.removeAt(0),a},bc.enqueue=function(a){var b=this.length++;this.items[b]=new v(ac.count++,a),this.percolate(b)},bc.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},ac.count=0;var cc=Pa.CompositeDisposable=function(){var a,b,c=[];if(Array.isArray(arguments[0]))c=arguments[0];else for(b=arguments.length,c=new Array(b),a=0;b>a;a++)c[a]=arguments[a];this.disposables=c,this.isDisposed=!1,this.length=c.length},dc=cc.prototype;dc.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},dc.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},dc.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var a=this.disposables.length,b=new Array(a),c=0;a>c;c++)b[c]=this.disposables[c];for(this.disposables=[],this.length=0,c=0;a>c;c++)b[c].dispose()}};var ec=Pa.Disposable=function(a){this.isDisposed=!1,this.action=a||Qa};ec.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var fc=ec.create=function(a){return new ec(a)},gc=ec.empty={dispose:Qa},hc=ec.isDisposable=function(a){return a&&Xa(a.dispose)},ic=ec.checkDisposed=function(a){if(a.isDisposed)throw new hb},jc=ec._fixup=function(a){return hc(a)?a:gc},kc=Pa.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null};kc.prototype.getDisposable=function(){return this.current},kc.prototype.setDisposable=function(a){if(this.current)throw new Error("Disposable has already been assigned");var b=this.isDisposed;!b&&(this.current=a),b&&a&&a.dispose()},kc.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null,a&&a.dispose()}};var lc=Pa.SerialDisposable=function(){this.isDisposed=!1,this.current=null};lc.prototype.getDisposable=function(){return this.current},lc.prototype.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},lc.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var mc=Pa.BinaryDisposable=function(a,b){this._first=a,this._second=b,this.isDisposed=!1};mc.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this._first;this._first=null,a&&a.dispose();var b=this._second;this._second=null,b&&b.dispose()}};var nc=Pa.NAryDisposable=function(a){this._disposables=a,this.isDisposed=!1};nc.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var a=0,b=this._disposables.length;b>a;a++)this._disposables[a].dispose();this._disposables.length=0}};var oc=Pa.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?gc:new a(this)},b}();w.prototype.dispose=function(){this.scheduler.schedule(this,x)};var pc=Pa.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||Ua,this.disposable=new kc};pc.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},pc.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},pc.prototype.isCancelled=function(){return this.disposable.isDisposed},pc.prototype.invokeCore=function(){return jc(this.action(this.scheduler,this.state))};var qc=Pa.Scheduler=function(){function a(){}a.isScheduler=function(b){return b instanceof a};var b=a.prototype;return b.schedule=function(a,b){throw new kb},b.scheduleFuture=function(b,c,d){var e=c;return e instanceof Date&&(e-=this.now()),e=a.normalize(e),0===e?this.schedule(b,d):this._scheduleFuture(b,e,d)},b._scheduleFuture=function(a,b,c){throw new kb},a.now=Sa,a.prototype.now=Sa,a.normalize=function(a){return 0>a&&(a=0),a},a}(),rc=qc.normalize,sc=qc.isScheduler;!function(a){function b(a,b){function c(b){function d(a,b){return g?f.remove(i):h=!0,e(b,c),gc}var g=!1,h=!1,i=a.schedule(b,d);h||(f.add(i),g=!0)}var d=b[0],e=b[1],f=new cc;return e(d,c),f}function c(a,b){function c(b,d){function g(a,b){return h?f.remove(j):i=!0,e(b,c),gc}var h=!1,i=!1,j=a.scheduleFuture(b,d,g);i||(f.add(j),h=!0)}var d=b[0],e=b[1],f=new cc;return e(d,c),f}a.scheduleRecursive=function(a,c){return this.schedule([a,c],b)},a.scheduleRecursiveFuture=function(a,b,d){return this.scheduleFuture([a,d],b,c)}}(qc.prototype),function(a){a.schedulePeriodic=function(a,b,c){if("undefined"==typeof Oa.setInterval)throw new jb;b=rc(b);var d=a,e=Oa.setInterval(function(){d=c(d)},b);return fc(function(){Oa.clearInterval(e)})}}(qc.prototype),function(a){a.catchError=a["catch"]=function(a){return new Fc(this,a)}}(qc.prototype);var tc,uc,vc=Pa.internals.SchedulePeriodicRecursive=function(){function a(a){return function(b,c){c(0,a._period);var d=Za(a._action)(a._state);d===Ya&&(a._cancel.dispose(),e(d.e)),a._state=d}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new kc;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveFuture(0,this._period,a(this))),b},b}(),wc=function(a){function b(){a.call(this)}return Zb(b,a),b.prototype.schedule=function(a,b){return jc(b(this,a))},b}(qc),xc=qc.immediate=new wc,yc=function(a){function b(){for(;d.length>0;){var a=d.dequeue();!a.isCancelled()&&a.invoke()}}function c(){a.call(this)}var d;return Zb(c,a),c.prototype.schedule=function(a,c){var f=new pc(this,a,c,this.now());if(d)d.enqueue(f);else{d=new ac(4),d.enqueue(f);var g=Za(b)();d=null,g===Ya&&e(g.e)}return f.disposable},c.prototype.scheduleRequired=function(){return!d},c}(qc),zc=qc.currentThread=new yc,Ac=function(){var a,b=Qa;if(Oa.setTimeout)a=Oa.setTimeout,b=Oa.clearTimeout;else{if(!Oa.WScript)throw new jb;a=function(a,b){Oa.WScript.Sleep(b),a()}}return{setTimeout:a,clearTimeout:b}}(),Bc=Ac.setTimeout,Cc=Ac.clearTimeout;!function(){function a(b){if(f)Bc(function(){a(b)},0);else{var c=d[b];if(c){f=!0;var g=Za(c)();uc(b),f=!1,g===Ya&&e(g.e)}}}function b(){if(!Oa.postMessage||Oa.importScripts)return!1;var a=!1,b=Oa.onmessage;return Oa.onmessage=function(){a=!0},Oa.postMessage("","*"),Oa.onmessage=b,a}var c=1,d={},f=!1;uc=function(a){delete d[a]};var g=new RegExp("^"+String(db).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),h="function"==typeof(h=Ja&&Ma&&Ja.setImmediate)&&!g.test(h)&&h;if(Xa(h))tc=function(b){var e=c++;return d[e]=b,h(function(){a(e)}),e};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))tc=function(b){var e=c++;return d[e]=b,process.nextTick(function(){a(e)}),e};else if(b()){var i="ms.rx.schedule"+Math.random(),j=function(b){"string"==typeof b.data&&b.data.substring(0,i.length)===i&&a(b.data.substring(i.length));
3};Oa.addEventListener("message",j,!1),tc=function(a){var b=c++;return d[b]=a,Oa.postMessage(i+currentId,"*"),b}}else if(Oa.MessageChannel){var k=new Oa.MessageChannel;k.port1.onmessage=function(b){a(b.data)},tc=function(a){var b=c++;return d[b]=a,k.port2.postMessage(b),b}}else tc="document"in Oa&&"onreadystatechange"in Oa.document.createElement("script")?function(b){var e=Oa.document.createElement("script"),f=c++;return d[f]=b,e.onreadystatechange=function(){a(f),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},Oa.document.documentElement.appendChild(e),f}:function(b){var e=c++;return d[e]=b,Bc(function(){a(e)},0),e}}();var Dc=function(a){function b(){a.call(this)}function c(a,b,c,d){return function(){a.setDisposable(ec._fixup(b(c,d)))}}function d(a){this._id=a,this.isDisposed=!1}function e(a){this._id=a,this.isDisposed=!1}return Zb(b,a),d.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,uc(this._id))},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,Cc(this._id))},b.prototype.schedule=function(a,b){var e=new kc,f=tc(c(e,b,this,a));return new mc(e,new d(f))},b.prototype._scheduleFuture=function(a,b,d){if(0===b)return this.schedule(a,d);var f=new kc,g=Bc(c(f,d,this,a),b);return new mc(f,new e(g))},b}(qc),Ec=qc["default"]=qc.async=new Dc,Fc=function(a){function b(b,c){this._scheduler=b,this._handler=c,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this)}return Zb(b,a),b.prototype.schedule=function(a,b){return this._scheduler.schedule(a,this._wrap(b))},b.prototype._scheduleFuture=function(a,b,c){return this._scheduler.schedule(a,b,this._wrap(c))},b.prototype.now=function(){return this._scheduler.now()},b.prototype._clone=function(a){return new b(a,this._handler)},b.prototype._wrap=function(a){var b=this;return function(c,d){var f=Za(a)(b._getRecursiveWrapper(c),d);return f===Ya?(b._handler(f.e)||e(f.e),gc):jc(f)}},b.prototype._getRecursiveWrapper=function(a){if(this._recursiveOriginal!==a){this._recursiveOriginal=a;var b=this._clone(a);b._recursiveOriginal=a,b._recursiveWrapper=b,this._recursiveWrapper=b}return this._recursiveWrapper},b.prototype.schedulePeriodic=function(a,b,c){var d=this,f=!1,g=new kc;return g.setDisposable(this._scheduler.schedulePeriodic(a,b,function(a){if(f)return null;var b=Za(c)(a);return b===Ya?(f=!0,d._handler(b.e)||e(b.e),g.dispose(),null):b})),g},b}(qc),Gc=Pa.Notification=function(){function a(){}return a.prototype._accept=function(a,b,c){throw new kb},a.prototype._acceptObserver=function(a,b,c){throw new kb},a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObserver(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return sc(a)||(a=xc),new vg(function(c){return a.schedule(b,function(a,b){b._acceptObserver(c),"N"===b.kind&&c.onCompleted()})})},a}(),Hc=function(a){function b(a){this.value=a,this.kind="N"}return Zb(b,a),b.prototype._accept=function(a){return a(this.value)},b.prototype._acceptObserver=function(a){return a.onNext(this.value)},b.prototype.toString=function(){return"OnNext("+this.value+")"},b}(Gc),Ic=function(a){function b(a){this.error=a,this.kind="E"}return Zb(b,a),b.prototype._accept=function(a,b){return b(this.error)},b.prototype._acceptObserver=function(a){return a.onError(this.error)},b.prototype.toString=function(){return"OnError("+this.error+")"},b}(Gc),Jc=function(a){function b(){this.kind="C"}return Zb(b,a),b.prototype._accept=function(a,b,c){return c()},b.prototype._acceptObserver=function(a){return a.onCompleted()},b.prototype.toString=function(){return"OnCompleted()"},b}(Gc),Kc=Gc.createOnNext=function(a){return new Hc(a)},Lc=Gc.createOnError=function(a){return new Ic(a)},Mc=Gc.createOnCompleted=function(){return new Jc},Nc=Pa.Observer=function(){};Nc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},Nc.prototype.asObserver=function(){var a=this;return new Rc(function(b){a.onNext(b)},function(b){a.onError(b)},function(){a.onCompleted()})},Nc.prototype.checked=function(){return new Sc(this)};var Oc=Nc.create=function(a,b,c){return a||(a=Qa),b||(b=Va),c||(c=Qa),new Rc(a,b,c)};Nc.fromNotifier=function(a,b){var c=qb(a,b,1);return new Rc(function(a){return c(Kc(a))},function(a){return c(Lc(a))},function(){return c(Mc())})},Nc.prototype.notifyOn=function(a){return new Uc(a,this)},Nc.prototype.makeSafe=function(a){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,a)};var Pc,Qc=Pa.internals.AbstractObserver=function(a){function b(){this.isStopped=!1}return Zb(b,a),b.prototype.next=lb,b.prototype.error=lb,b.prototype.completed=lb,b.prototype.onNext=function(a){!this.isStopped&&this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(Nc),Rc=Pa.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Zb(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(Qc),Sc=function(a){function b(b){a.call(this),this._observer=b,this._state=0}Zb(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();var b=Za(this._observer.onNext).call(this._observer,a);this._state=0,b===Ya&&e(b.e)},c.onError=function(a){this.checkAccess();var b=Za(this._observer.onError).call(this._observer,a);this._state=2,b===Ya&&e(b.e)},c.onCompleted=function(){this.checkAccess();var a=Za(this._observer.onCompleted).call(this._observer);this._state=2,a===Ya&&e(a.e)},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(Nc),Tc=Pa.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new lc}function c(a,b){return function(){a.onNext(b)}}function d(a,b){return function(){a.onError(b)}}function f(a){return function(){a.onCompleted()}}function g(a,b){var c;if(!(a.queue.length>0))return void(a.isAcquired=!1);c=a.queue.shift();var d=Za(c)();return d===Ya?(a.queue=[],a.hasFaulted=!0,e(d.e)):void b(a)}return Zb(b,a),b.prototype.next=function(a){this.queue.push(c(this.observer,a))},b.prototype.error=function(a){this.queue.push(d(this.observer,a))},b.prototype.completed=function(){this.queue.push(f(this.observer))},b.prototype.ensureActive=function(){var a=!1;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(this,g))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(Qc),Uc=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return Zb(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b.prototype.dispose=function(){a.prototype.dispose.call(this),this._cancel&&this._cancel.dispose(),this._cancel=null},b}(Tc),Vc=Pa.Observable=function(){function a(a,b){return function(c){var d=c.onError;return c.onError=function(b){f(b,a),d.call(c,b)},b.call(a,c)}}function b(){if(Pa.config.longStackSupport&&$a){var b=this._subscribe,c=Za(e)(new Error).e;this.stack=c.stack.substring(c.stack.indexOf("\n")+1),this._subscribe=a(this,b)}}return Pc=b.prototype,b.isObservable=function(a){return a&&Xa(a.subscribe)},Pc.subscribe=Pc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:Oc(a,b,c))},Pc.subscribeOnNext=function(a,b){return this._subscribe(Oc("undefined"!=typeof b?function(c){a.call(b,c)}:a))},Pc.subscribeOnError=function(a,b){return this._subscribe(Oc(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},Pc.subscribeOnCompleted=function(a,b){return this._subscribe(Oc(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},b}(),Wc=Pa.ObservableBase=function(a){function b(a){return a&&Xa(a.dispose)?a:Xa(a)?fc(a):gc}function c(a,c){var d=c[0],f=c[1],g=Za(f.subscribeCore).call(f,d);g!==Ya||d.fail(Ya.e)||e(Ya.e),d.setDisposable(b(g))}function d(){a.call(this)}return Zb(d,a),d.prototype._subscribe=function(a){var b=new wg(a),d=[b,this];return zc.scheduleRequired()?zc.schedule(d,c):c(null,d),b},d.prototype.subscribeCore=lb,d}(Vc),Xc=Pa.FlatMapObservable=function(a){function b(b,c,d,e){this.resultSelector=Xa(d)?d:null,this.selector=qb(Xa(c)?c:function(){return c},e,3),this.source=b,a.call(this)}function c(a,b,c,d){this.i=0,this.selector=b,this.resultSelector=c,this.source=d,this.o=a,Qc.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.selector,this.resultSelector,this))},Zb(c,Qc),c.prototype._wrapResult=function(a,b,c){return this.resultSelector?a.map(function(a,d){return this.resultSelector(b,a,c,d)},this):a},c.prototype.next=function(a){var b=this.i++,c=Za(this.selector)(a,b,this.source);return c===Ya?this.o.onError(c.e):(Wa(c)&&(c=gd(c)),(pb(c)||ob(c))&&(c=Vc.from(c)),void this.o.onNext(this._wrapResult(c,a,b)))},c.prototype.error=function(a){this.o.onError(a)},c.prototype.completed=function(){this.o.onCompleted()},b}(Wc),Yc=Pa.internals.Enumerable=function(){};y.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._s.isDisposed=!0)};var Zc=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){if(!a.isDisposed){var c=Za(a.e.next).call(a.e);if(c===Ya)return a.o.onError(c.e);if(c.done)return a.o.onCompleted();var e=c.value;Wa(e)&&(e=gd(e));var f=new kc;a.subscription.setDisposable(f),f.setDisposable(e.subscribe(new d(a,b)))}}function d(a,b){this._state=a,this._recurse=b,Qc.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){var b=new lc,d={isDisposed:!1,o:a,subscription:b,e:this.sources[mb]()},e=zc.scheduleRecursive(d,c);return new nc([b,e,new y(d)])},Zb(d,Qc),d.prototype.next=function(a){this._state.o.onNext(a)},d.prototype.error=function(a){this._state.o.onError(a)},d.prototype.completed=function(){this._recurse(this._state)},b}(Wc);Yc.prototype.concat=function(){return new Zc(this)};var $c=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){if(!a.isDisposed){var c=Za(a.e.next).call(a.e);if(c===Ya)return a.o.onError(c.e);if(c.done)return null!==a.lastError?a.o.onError(a.lastError):a.o.onCompleted();var e=c.value;Wa(e)&&(e=gd(e));var f=new kc;a.subscription.setDisposable(f),f.setDisposable(e.subscribe(new d(a,b)))}}function d(a,b){this._state=a,this._recurse=b,Qc.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){var b=new lc,d={isDisposed:!1,e:this.sources[mb](),subscription:b,lastError:null,o:a},e=zc.scheduleRecursive(d,c);return new nc([b,e,new y(d)])},Zb(d,Qc),d.prototype.next=function(a){this._state.o.onNext(a)},d.prototype.error=function(a){this._state.lastError=a,this._recurse(this._state)},d.prototype.completed=function(){this._state.o.onCompleted()},b}(Wc);Yc.prototype.catchError=function(){return new $c(this)},Yc.prototype.catchErrorWhen=function(a){var b=this;return new vg(function(c){var d,e=new zg,f=new zg,g=a(e),h=g.subscribe(f),i=b[mb](),j={isDisposed:!1},k=new lc,l=zc.scheduleRecursive(null,function(a,b){if(!j.isDisposed){var g=Za(i.next).call(i);if(g===Ya)return c.onError(g.e);if(g.done)return void(d?c.onError(d):c.onCompleted());var h=g.value;Wa(h)&&(h=gd(h));var l=new kc,m=new kc;k.setDisposable(new mc(m,l)),l.setDisposable(h.subscribe(function(a){c.onNext(a)},function(a){m.setDisposable(f.subscribe(b,function(a){c.onError(a)},function(){c.onCompleted()})),e.onNext(a)},function(){c.onCompleted()}))}});return new nc([h,k,l,new y(j)])})};var _c=function(a){function b(a,b){this.v=a,this.c=null==b?-1:b}function c(a){this.v=a.v,this.l=a.c}return Zb(b,a),b.prototype[mb]=function(){return new c(this)},c.prototype.next=function(){return 0===this.l?nb:(this.l>0&&this.l--,{done:!1,value:this.v})},b}(Yc),ad=Yc.repeat=function(a,b){return new _c(a,b)},bd=function(a){function b(a,b,c){this.s=a,this.fn=b?qb(b,c,3):null}function c(a){this.i=-1,this.s=a.s,this.l=this.s.length,this.fn=a.fn}return Zb(b,a),b.prototype[mb]=function(){return new c(this)},c.prototype.next=function(){return++this.i<this.l?{done:!1,value:this.fn?this.fn(this.s[this.i],this.i,this.s):this.s[this.i]}:nb},b}(Yc),cd=Yc.of=function(a,b,c){return new bd(a,b,c)},dd=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Uc(this._s,a))},b}(Wc);Pc.observeOn=function(a){return new dd(this,a)};var ed=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}function c(a,b){var c=b[0],d=b[1],e=b[2];d.setDisposable(new w(a,c.subscribe(e)))}return Zb(b,a),b.prototype.subscribeCore=function(a){var b=new kc,d=new lc;return d.setDisposable(b),b.setDisposable(this._s.schedule([this.source,d,a],c)),d},b}(Wc);Pc.subscribeOn=function(a){return new ed(this,a)};var fd=function(a){function b(b,c){this._p=b,this._s=c,a.call(this)}function c(a,b){var c=b[0],d=b[1];c.onNext(d),c.onCompleted()}function d(a,b){var c=b[0],d=b[1];c.onError(d)}return Zb(b,a),b.prototype.subscribeCore=function(a){var b=new kc,e=this;return this._p.then(function(d){b.setDisposable(e._s.schedule([a,d],c))},function(c){b.setDisposable(e._s.schedule([a,c],d))}),b},b}(Wc),gd=Vc.fromPromise=function(a,b){return b||(b=Ec),new fd(a,b)};Pc.toPromise=function(a){if(a||(a=Pa.config.Promise),!a)throw new jb("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d;b.subscribe(function(a){d=a},c,function(){a(d)})})};var hd=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.a=[],Qc.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},Zb(c,Qc),c.prototype.next=function(a){this.a.push(a)},c.prototype.error=function(a){this.o.onError(a)},c.prototype.completed=function(){this.o.onNext(this.a),this.o.onCompleted()},b}(Wc);Pc.toArray=function(){return new hd(this)},Vc.create=function(a,b){return new vg(a,b)};var id=function(a){function b(b){this._f=b,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){var b=Za(this._f)();return b===Ya?Bd(b.e).subscribe(a):(Wa(b)&&(b=gd(b)),b.subscribe(a))},b}(Wc),jd=Vc.defer=function(a){return new id(a)},kd=function(a){function b(b){this.scheduler=b,a.call(this)}function c(a,b){this.observer=a,this.scheduler=b}function d(a,b){return b.onCompleted(),gc}return Zb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this.scheduler);return b.run()},c.prototype.run=function(){var a=this.observer;return this.scheduler===xc?d(null,a):this.scheduler.schedule(a,d)},b}(Wc),ld=new kd(xc),md=Vc.empty=function(a){return sc(a)||(a=xc),a===xc?ld:new kd(a)},nd=function(a){function b(b,c,d){this._iterable=b,this._fn=c,this._scheduler=d,a.call(this)}function c(a,b,c){return function(d,e){var f=Za(b.next).call(b);if(f===Ya)return a.onError(f.e);if(f.done)return a.onCompleted();var g=f.value;return Xa(c)&&(g=Za(c)(g,d),g===Ya)?a.onError(g.e):(a.onNext(g),void e(d+1))}}return Zb(b,a),b.prototype.subscribeCore=function(a){var b=Object(this._iterable),d=E(b);return this._scheduler.scheduleRecursive(0,c(a,d,this._fn))},b}(Wc),od=Math.pow(2,53)-1;z.prototype[mb]=function(){return new A(this._s)},A.prototype[mb]=function(){return this},A.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:nb},B.prototype[mb]=function(){return new C(this._a)},C.prototype[mb]=function(){return this},C.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:nb};var pd=Vc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!Xa(b))throw new Error("mapFn when provided must be a function");if(b)var e=qb(b,c,2);return sc(d)||(d=zc),new nd(a,e,d)},qd=function(a){function b(b,c){this._args=b,this._scheduler=c,a.call(this)}function c(a,b){var c=b.length;return function(d,e){c>d?(a.onNext(b[d]),e(d+1)):a.onCompleted()}}return Zb(b,a),b.prototype.subscribeCore=function(a){return this._scheduler.scheduleRecursive(0,c(a,this._args))},b}(Wc),rd=Vc.fromArray=function(a,b){return sc(b)||(b=zc),new qd(a,b)},sd=function(a){function b(b,c,d,e,f){this._state=b,this._cndFn=c,this._itrFn=d,this._resFn=e,this._s=f,this._first=!0,a.call(this)}function c(a,b){if(a._first)a._first=!1;else if(a._state=Za(a._itrFn)(a._state),a._state===Ya)return a._o.onError(a._state.e);var c=Za(a._cndFn)(a._state);if(c===Ya)return a._o.onError(c.e);if(c){var d=Za(a._resFn)(a._state);if(d===Ya)return a._o.onError(d.e);a._o.onNext(d),b(a)}else a._o.onCompleted()}return Zb(b,a),b.prototype.subscribeCore=function(a){return this._o=a,this._s.scheduleRecursive(this,c)},b}(Wc);Vc.generate=function(a,b,c,d,e){return sc(e)||(e=zc),new sd(a,b,c,d,e)},Vc.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new qd(b,zc)},Vc.ofWithScheduler=function(a){for(var b=arguments.length,c=new Array(b-1),d=1;b>d;d++)c[d-1]=arguments[d];return new qd(c,a)};var td=function(a){function b(){a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return gc},b}(Wc),ud=new td,vd=Vc.never=function(){return ud},wd=function(a){function b(b,c){this._o=b,this._keys=Object.keys(b),this._scheduler=c,a.call(this)}function c(a,b,c){return function(d,e){if(d<c.length){var f=c[d];a.onNext([f,b[f]]),e(d+1)}else a.onCompleted()}}return Zb(b,a),b.prototype.subscribeCore=function(a){return this._scheduler.scheduleRecursive(0,c(a,this._o,this._keys))},b}(Wc);Vc.pairs=function(a,b){return b||(b=zc),new wd(a,b)};var xd=function(a){function b(b,c,d){this.start=b,this.rangeCount=c,this.scheduler=d,a.call(this)}function c(a,b,c){return function(d,e){b>d?(c.onNext(a+d),e(d+1)):c.onCompleted()}}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.scheduler.scheduleRecursive(0,c(this.start,this.rangeCount,a))},b}(Wc);Vc.range=function(a,b,c){return sc(c)||(c=zc),new xd(a,b,c)};var yd=function(a){function b(b,c,d){this.value=b,this.repeatCount=null==c?-1:c,this.scheduler=d,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){var b=new I(a,this);return b.run()},b}(Wc);I.prototype.run=function(){function a(a,d){return(-1===a||a>0)&&(b.onNext(c),a>0&&a--),0===a?b.onCompleted():void d(a)}var b=this.observer,c=this.parent.value;return this.parent.scheduler.scheduleRecursive(this.parent.repeatCount,a)},Vc.repeat=function(a,b,c){return sc(c)||(c=zc),new yd(a,b,c)};var zd=function(a){function b(b,c){this._value=b,this._scheduler=c,a.call(this)}function c(a,b){var c=b[0],d=b[1];return d.onNext(c),d.onCompleted(),gc}return Zb(b,a),b.prototype.subscribeCore=function(a){var b=[this._value,a];return this._scheduler===xc?c(null,b):this._scheduler.schedule(b,c)},b}(Wc),Ad=(Vc["return"]=Vc.just=function(a,b){return sc(b)||(b=xc),new zd(a,b)},function(a){function b(b,c){this._error=b,this._scheduler=c,a.call(this)}function c(a,b){var c=b[0],d=b[1];return d.onError(c),gc}return Zb(b,a),b.prototype.subscribeCore=function(a){var b=[this._error,a];return this._scheduler===xc?c(null,b):this._scheduler.schedule(b,c)},b}(Wc)),Bd=Vc["throw"]=function(a,b){return sc(b)||(b=xc),new Ad(a,b)},Cd=function(a){function b(b,c){this._resFn=b,this._obsFn=c,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){var b=gc,c=Za(this._resFn)();if(c===Ya)return new mc(Bd(c.e).subscribe(a),b);c&&(b=c);var d=Za(this._obsFn)(c);return d===Ya?new mc(Bd(d.e).subscribe(a),b):new mc(d.subscribe(a),b)},b}(Wc);Vc.using=function(a,b){return new Cd(a,b)},Pc.amb=function(a){var b=this;return new vg(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new kc,j=new kc;Wa(a)&&(a=gd(a));var k=Oc(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()}),l=Oc(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()});return i.setDisposable(b.subscribe(k)),j.setDisposable(a.subscribe(l)),new mc(i,j)})},Vc.amb=function(){var a,b=vd();if(Array.isArray(arguments[0]))a=arguments[0];else{var c=arguments.length;a=new Array(a);for(var d=0;c>d;d++)a[d]=arguments[d]}for(var d=0,c=a.length;c>d;d++)b=J(b,a[d]);return b};var Dd=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){var b=new kc,c=new lc;return c.setDisposable(b),b.setDisposable(this.source.subscribe(new Ed(a,c,this._fn))),c},b}(Wc),Ed=function(a){function b(b,c,d){this._o=b,this._s=c,this._fn=d,a.call(this)}return Zb(b,a),b.prototype.next=function(a){this._o.onNext(a)},b.prototype.completed=function(){return this._o.onCompleted()},b.prototype.error=function(a){var b=Za(this._fn)(a);if(b===Ya)return this._o.onError(b.e);Wa(b)&&(b=gd(b));var c=new kc;this._s.setDisposable(c),c.setDisposable(b.subscribe(this._o))},b}(Qc);Pc["catch"]=function(a){return Xa(a)?new Dd(this,a):Fd([this,a])};var Fd=Vc["catch"]=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return cd(a).catchError()};Pc.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return Array.isArray(b[0])?b[0].unshift(this):b.unshift(this),Id.apply(this,b)};var Gd=function(a){function b(b,c){this._params=b,this._cb=c,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){for(var b=this._params.length,c=new Array(b),d={hasValue:u(b,K),hasValueAll:!1,isDone:u(b,K),values:new Array(b)},e=0;b>e;e++){var f=this._params[e],g=new kc;c[e]=g,Wa(f)&&(f=gd(f)),g.setDisposable(f.subscribe(new Hd(a,e,this._cb,d)))}return new nc(c)},b}(Wc),Hd=function(a){function b(b,c,d,e){this._o=b,this._i=c,this._cb=d,this._state=e,a.call(this)}function c(a){return function(b,c){return c!==a}}return Zb(b,a),b.prototype.next=function(a){if(this._state.values[this._i]=a,this._state.hasValue[this._i]=!0,this._state.hasValueAll||(this._state.hasValueAll=this._state.hasValue.every(Ra))){var b=Za(this._cb).apply(null,this._state.values);if(b===Ya)return this._o.onError(b.e);this._o.onNext(b)}else this._state.isDone.filter(c(this._i)).every(Ra)&&this._o.onCompleted()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._state.isDone[this._i]=!0,this._state.isDone.every(Ra)&&this._o.onCompleted()},b}(Qc),Id=Vc.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=Xa(b[a-1])?b.pop():L;return Array.isArray(b[0])&&(b=b[0]),new Gd(b,d)};Pc.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),Ld.apply(null,a)};var Jd=function(a){function b(b,c){this._s=b,this._fn=c,a.call(this)}return Zb(b,a),b.prototype.next=function(a){this._s.o.onNext(a)},b.prototype.error=function(a){this._s.o.onError(a)},b.prototype.completed=function(){this._s.i++,this._fn(this._s)},b}(Qc),Kd=function(a){function b(b){this._sources=b,a.call(this)}function c(a,b){if(!a.disposable.isDisposed){if(a.i===a.sources.length)return a.o.onCompleted();var c=a.sources[a.i];Wa(c)&&(c=gd(c));var d=new kc;a.subscription.setDisposable(d),d.setDisposable(c.subscribe(new Jd(a,b)))}}return Zb(b,a),b.prototype.subscribeCore=function(a){var b=new lc,d=fc(Qa),e={o:a,i:0,subscription:b,disposable:d,sources:this._sources},f=xc.scheduleRecursive(e,c);return new nc([b,d,f])},b}(Wc),Ld=Vc.concat=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(arguments.length);for(var b=0,c=arguments.length;c>b;b++)a[b]=arguments[b]}return new Kd(a)};Pc.concatAll=function(){return this.merge(1)};var Md=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){var b=new cc;return b.add(this.source.subscribe(new Nd(a,this.maxConcurrent,b))),b},b}(Wc),Nd=function(a){function b(b,c,d){this.o=b,this.max=c,this.g=d,this.done=!1,this.q=[],this.activeCount=0,a.call(this)}function c(b,c){this.parent=b,this.sad=c,a.call(this)}return Zb(b,a),b.prototype.handleSubscribe=function(a){var b=new kc;this.g.add(b),Wa(a)&&(a=gd(a)),b.setDisposable(a.subscribe(new c(this,b)))},b.prototype.next=function(a){this.activeCount<this.max?(this.activeCount++,this.handleSubscribe(a)):this.q.push(a)},b.prototype.error=function(a){this.o.onError(a)},b.prototype.completed=function(){this.done=!0,0===this.activeCount&&this.o.onCompleted()},Zb(c,a),c.prototype.next=function(a){this.parent.o.onNext(a)},c.prototype.error=function(a){this.parent.o.onError(a)},c.prototype.completed=function(){this.parent.g.remove(this.sad),this.parent.q.length>0?this.parent.handleSubscribe(this.parent.q.shift()):(this.parent.activeCount--,this.parent.done&&0===this.parent.activeCount&&this.parent.o.onCompleted())},b}(Qc);Pc.merge=function(a){return"number"!=typeof a?Od(this,a):new Md(this,a)};var Od=Vc.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(sc(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=xc,b=0;d>b;b++)c.push(arguments[b]);else for(a=xc,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),H(a,c).mergeAll()},Pd=function(a){function b(b){this.source=b,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){var b=new cc,c=new kc;return b.add(c),c.setDisposable(this.source.subscribe(new Qd(a,b))),b},b}(Wc),Qd=function(a){function b(b,c){this.o=b,this.g=c,this.done=!1,a.call(this)}function c(b,c){this.parent=b,this.sad=c,a.call(this)}return Zb(b,a),b.prototype.next=function(a){var b=new kc;this.g.add(b),Wa(a)&&(a=gd(a)),b.setDisposable(a.subscribe(new c(this,b)))},b.prototype.error=function(a){this.o.onError(a)},b.prototype.completed=function(){this.done=!0,1===this.g.length&&this.o.onCompleted()},Zb(c,a),c.prototype.next=function(a){this.parent.o.onNext(a)},c.prototype.error=function(a){this.parent.o.onError(a)},c.prototype.completed=function(){this.parent.g.remove(this.sad),this.parent.done&&1===this.parent.g.length&&this.parent.o.onCompleted()},b}(Qc);Pc.mergeAll=function(){return new Pd(this)};var Rd=Pa.CompositeError=function(a){this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};Rd.prototype=Object.create(Error.prototype),Rd.prototype.name="CompositeError";var Sd=function(a){function b(b){this.source=b,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){var b=new cc,c=new kc,d={isStopped:!1,errors:[],o:a};return b.add(c),c.setDisposable(this.source.subscribe(new Td(b,d))),b},b}(Wc),Td=function(a){function b(b,c){this._group=b,this._state=c,a.call(this)}function c(a,b){0===b.length?a.onCompleted():1===b.length?a.onError(b[0]):a.onError(new Rd(b))}function d(b,c,d){this._inner=b,this._group=c,this._state=d,a.call(this)}return Zb(b,a),b.prototype.next=function(a){var b=new kc;this._group.add(b),Wa(a)&&(a=gd(a)),b.setDisposable(a.subscribe(new d(b,this._group,this._state)))},b.prototype.error=function(a){this._state.errors.push(a),this._state.isStopped=!0,1===this._group.length&&c(this._state.o,this._state.errors)},b.prototype.completed=function(){this._state.isStopped=!0,1===this._group.length&&c(this._state.o,this._state.errors)},Zb(d,a),d.prototype.next=function(a){this._state.o.onNext(a)},d.prototype.error=function(a){this._state.errors.push(a),this._group.remove(this._inner),this._state.isStopped&&1===this._group.length&&c(this._state.o,this._state.errors)},d.prototype.completed=function(){this._group.remove(this._inner),this._state.isStopped&&1===this._group.length&&c(this._state.o,this._state.errors)},b}(Qc);Vc.mergeDelayError=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}var d=H(null,a);return new Sd(d)},Pc.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return Wd([this,a])};var Ud=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){if(a.pos<a.sources.length){var c=a.sources[a.pos++];Wa(c)&&(c=gd(c));var d=new kc;a.subscription.setDisposable(d),d.setDisposable(c.subscribe(new Vd(a,b)))}else a.o.onCompleted()}return Zb(b,a),b.prototype.subscribeCore=function(a){var b=new lc,d={pos:0,subscription:b,o:a,sources:this.sources},e=xc.scheduleRecursive(d,c);return new mc(b,e)},b}(Wc),Vd=function(a){function b(b,c){this._state=b,this._recurse=c,a.call(this)}return Zb(b,a),b.prototype.next=function(a){this._state.o.onNext(a)},b.prototype.error=function(){this._recurse(this._state)},b.prototype.completed=function(){this._recurse(this._state)},b}(Qc),Wd=Vc.onErrorResumeNext=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new Ud(a)},Xd=function(a){function b(b,c){this._s=b,this._o=Wa(c)?gd(c):c,this._open=!1,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){var b=new kc;b.setDisposable(this._s.subscribe(new Yd(a,this))),Wa(this._o)&&(this._o=gd(this._o));var c=new kc;return c.setDisposable(this._o.subscribe(new Zd(a,this,c))),new mc(b,c)},b}(Wc),Yd=function(a){function b(b,c){this._o=b,this._p=c,a.call(this)}return Zb(b,a),b.prototype.next=function(a){this._p._open&&this._o.onNext(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.onCompleted=function(){this._p._open&&this._o.onCompleted()},b}(Qc),Zd=function(a){function b(b,c,d){this._o=b,this._p=c,this._r=d,a.call(this)}return Zb(b,a),b.prototype.next=function(){this._p._open=!0,this._r.dispose()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.onCompleted=function(){this._r.dispose()},b}(Qc);Pc.skipUntil=function(a){return new Xd(this,a)};var $d=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.inner=b,this.stopped=!1,this.latest=0,this.hasLatest=!1,Qc.call(this)}function d(a,b){this.parent=a,this.id=b,Qc.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){var b=new lc,d=this.source.subscribe(new c(a,b));return new mc(d,b)},Zb(c,Qc),c.prototype.next=function(a){var b=new kc,c=++this.latest;this.hasLatest=!0,this.inner.setDisposable(b),Wa(a)&&(a=gd(a)),b.setDisposable(a.subscribe(new d(this,c)))},c.prototype.error=function(a){this.o.onError(a)},c.prototype.completed=function(){this.stopped=!0,!this.hasLatest&&this.o.onCompleted()},Zb(d,Qc),d.prototype.next=function(a){this.parent.latest===this.id&&this.parent.o.onNext(a)},d.prototype.error=function(a){this.parent.latest===this.id&&this.parent.o.onError(a)},d.prototype.completed=function(){this.parent.latest===this.id&&(this.parent.hasLatest=!1,this.parent.stopped&&this.parent.o.onCompleted())},b}(Wc);Pc["switch"]=Pc.switchLatest=function(){return new $d(this)};var _d=function(a){function b(b,c){this.source=b,this.other=Wa(c)?gd(c):c,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return new mc(this.source.subscribe(a),this.other.subscribe(new ae(a)))},b}(Wc),ae=function(a){function b(b){this._o=b,a.call(this)}return Zb(b,a),b.prototype.next=function(){this._o.onCompleted()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.onCompleted=Qa,b}(Qc);Pc.takeUntil=function(a){return new _d(this,a)};var be=function(a){function b(b,c,d){this._s=b,this._ss=c,this._cb=d,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){for(var b=this._ss.length,c={hasValue:u(b,K),hasValueAll:!1,values:new Array(b)},d=this._ss.length,e=new Array(d+1),f=0;d>f;f++){var g=this._ss[f],h=new kc;Wa(g)&&(g=gd(g)),h.setDisposable(g.subscribe(new ce(a,f,c))),e[f]=h}var i=new kc;
4return i.setDisposable(this._s.subscribe(new de(a,this._cb,c))),e[d]=i,new nc(e)},b}(Wc),ce=function(a){function b(b,c,d){this._o=b,this._i=c,this._state=d,a.call(this)}return Zb(b,a),b.prototype.next=function(a){this._state.values[this._i]=a,this._state.hasValue[this._i]=!0,this._state.hasValueAll=this._state.hasValue.every(Ra)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=Qa,b}(Qc),de=function(a){function b(b,c,d){this._o=b,this._cb=c,this._state=d,a.call(this)}return Zb(b,a),b.prototype.next=function(a){var b=[a].concat(this._state.values);if(this._state.hasValueAll){var c=Za(this._cb).apply(null,b);return c===Ya?this._o.onError(c.e):void this._o.onNext(c)}},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Qc);Pc.withLatestFrom=function(){if(0===arguments.length)throw new Error("invalid arguments");for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=Xa(b[a-1])?b.pop():L;return Array.isArray(b[0])&&(b=b[0]),new be(this,b,d)};var ee=function(a){function b(b,c){this._s=b,this._cb=c,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){for(var b=this._s.length,c=new Array(b),d=u(b,K),e=u(b,M),f=0;b>f;f++){var g=this._s[f],h=new kc;c[f]=h,Wa(g)&&(g=gd(g)),h.setDisposable(g.subscribe(new fe(a,f,this,e,d)))}return new nc(c)},b}(Wc),fe=function(a){function b(b,c,d,e,f){this._o=b,this._i=c,this._p=d,this._q=e,this._d=f,a.call(this)}function c(a){return a.length>0}function d(a){return a.shift()}function e(a){return function(b,c){return c!==a}}return Zb(b,a),b.prototype.next=function(a){if(this._q[this._i].push(a),this._q.every(c)){var b=this._q.map(d),f=Za(this._p._cb).apply(null,b);if(f===Ya)return this._o.onError(f.e);this._o.onNext(f)}else this._d.filter(e(this._i)).every(Ra)&&this._o.onCompleted()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._d[this._i]=!0,this._d.every(Ra)&&this._o.onCompleted()},b}(Qc);Pc.zip=function(){if(0===arguments.length)throw new Error("invalid arguments");for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=Xa(b[a-1])?b.pop():L;Array.isArray(b[0])&&(b=b[0]);var e=this;return b.unshift(e),new ee(b,d)},Vc.zip=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];Array.isArray(b[0])&&(b=Xa(b[1])?b[0].concat(b[1]):b[0]);var d=b.shift();return d.zip.apply(d,b)};var ge=function(a){function b(b,c){this.sources=b,this._cb=c,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){for(var b=this.sources,c=b.length,d=new Array(c),e={q:u(c,M),done:u(c,K),cb:this._cb,o:a},f=0;c>f;f++)!function(a){var c=b[a],f=new kc;(pb(c)||ob(c))&&(c=pd(c)),d[a]=f,f.setDisposable(c.subscribe(new he(e,a)))}(f);return new nc(d)},b}(Wc),he=function(a){function b(b,c){this._s=b,this._i=c,a.call(this)}function c(a){return a.length>0}function d(a){return a.shift()}function e(a){return function(b,c){return c!==a}}return Zb(b,a),b.prototype.next=function(a){if(this._s.q[this._i].push(a),this._s.q.every(c)){var b=this._s.q.map(d),f=Za(this._s.cb).apply(null,b);if(f===Ya)return this._s.o.onError(f.e);this._s.o.onNext(f)}else this._s.done.filter(e(this._i)).every(Ra)&&this._s.o.onCompleted()},b.prototype.error=function(a){this._s.o.onError(a)},b.prototype.completed=function(){this._s.done[this._i]=!0,this._s.done.every(Ra)&&this._s.o.onCompleted()},b}(Qc);Pc.zipIterable=function(){if(0===arguments.length)throw new Error("invalid arguments");for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=Xa(b[a-1])?b.pop():L,e=this;return b.unshift(e),new ge(b,d)},Pc.asObservable=function(){return new vg(N(this),this)},Pc.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).flatMap(O).filter(P)};var ie=function(a){function b(b){this.source=b,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new je(a))},b}(Wc),je=function(a){function b(b){this._o=b,a.call(this)}return Zb(b,a),b.prototype.next=function(a){a.accept(this._o)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Qc);Pc.dematerialize=function(){return new ie(this)};var ke=function(a){function b(b,c,d){this.source=b,this.keyFn=c,this.comparer=d,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new le(a,this.keyFn,this.comparer))},b}(Wc),le=function(a){function b(b,c,d){this.o=b,this.keyFn=c,this.comparer=d,this.hasCurrentKey=!1,this.currentKey=null,a.call(this)}return Zb(b,a),b.prototype.next=function(a){var b,c=a;return Xa(this.keyFn)&&(c=Za(this.keyFn)(a),c===Ya)?this.o.onError(c.e):this.hasCurrentKey&&(b=Za(this.comparer)(this.currentKey,c),b===Ya)?this.o.onError(b.e):void(this.hasCurrentKey&&b||(this.hasCurrentKey=!0,this.currentKey=c,this.o.onNext(a)))},b.prototype.error=function(a){this.o.onError(a)},b.prototype.completed=function(){this.o.onCompleted()},b}(Qc);Pc.distinctUntilChanged=function(a,b){return b||(b=Ta),new ke(this,a,b)};var me=function(a){function b(b,c,d,e){this.source=b,this._oN=c,this._oE=d,this._oC=e,a.call(this)}function c(a,b){this.o=a,this.t=!b._oN||Xa(b._oN)?Oc(b._oN||Qa,b._oE||Qa,b._oC||Qa):b._oN,this.isStopped=!1,Qc.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this))},Zb(c,Qc),c.prototype.next=function(a){var b=Za(this.t.onNext).call(this.t,a);b===Ya&&this.o.onError(b.e),this.o.onNext(a)},c.prototype.error=function(a){var b=Za(this.t.onError).call(this.t,a);return b===Ya?this.o.onError(b.e):void this.o.onError(a)},c.prototype.completed=function(){var a=Za(this.t.onCompleted).call(this.t);return a===Ya?this.o.onError(a.e):void this.o.onCompleted()},b}(Wc);Pc["do"]=Pc.tap=Pc.doAction=function(a,b,c){return new me(this,a,b,c)},Pc.doOnNext=Pc.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},Pc.doOnError=Pc.tapOnError=function(a,b){return this.tap(Qa,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},Pc.doOnCompleted=Pc.tapOnCompleted=function(a,b){return this.tap(Qa,null,"undefined"!=typeof b?function(){a.call(b)}:a)};var ne=function(a){function b(b,c,d){this.source=b,this._fn=qb(c,d,0),a.call(this)}function c(a,b){this.isDisposed=!1,this._s=a,this._fn=b}return Zb(b,a),b.prototype.subscribeCore=function(a){var b=Za(this.source.subscribe).call(this.source,a);return b===Ya&&(this._fn(),e(b.e)),new c(b,this._fn)},c.prototype.dispose=function(){if(!this.isDisposed){var a=Za(this._s.dispose).call(this._s);this._fn(),a===Ya&&e(a.e)}},b}(Wc);Pc["finally"]=function(a,b){return new ne(this,a,b)};var oe=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype.onNext=Qa,c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},b}(Wc);Pc.ignoreElements=function(){return new oe(this)};var pe=function(a){function b(b,c){this.source=b,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new qe(a))},b}(Wc),qe=function(a){function b(b){this._o=b,a.call(this)}return Zb(b,a),b.prototype.next=function(a){this._o.onNext(Kc(a))},b.prototype.error=function(a){this._o.onNext(Lc(a)),this._o.onCompleted()},b.prototype.completed=function(){this._o.onNext(Mc()),this._o.onCompleted()},b}(Qc);Pc.materialize=function(){return new pe(this)},Pc.repeat=function(a){return ad(this,a).concat()},Pc.retry=function(a){return ad(this,a).catchError()},Pc.retryWhen=function(a){return ad(this).catchErrorWhen(a)};var re=function(a){function b(b,c,d,e){this.source=b,this.accumulator=c,this.hasSeed=d,this.seed=e,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new se(a,this))},b}(Wc),se=function(a){function b(b,c){this._o=b,this._p=c,this._fn=c.accumulator,this._hs=c.hasSeed,this._s=c.seed,this._ha=!1,this._a=null,this._hv=!1,this._i=0,a.call(this)}return Zb(b,a),b.prototype.next=function(a){return!this._hv&&(this._hv=!0),this._ha?this._a=Za(this._fn)(this._a,a,this._i,this._p):(this._a=this._hs?Za(this._fn)(this._s,a,this._i,this._p):a,this._ha=!0),this._a===Ya?this._o.onError(this._a.e):(this._o.onNext(this._a),void this._i++)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){!this._hv&&this._hs&&this._o.onNext(this._s),this._o.onCompleted()},b}(Qc);Pc.scan=function(){var a,b=!1,c=arguments[0];return 2===arguments.length&&(b=!0,a=arguments[1]),new re(this,c,b,a)};var te=function(a){function b(b,c){this.source=b,this._c=c,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new ue(a,this._c))},b}(Wc),ue=function(a){function b(b,c){this._o=b,this._c=c,this._q=[],a.call(this)}return Zb(b,a),b.prototype.next=function(a){this._q.push(a),this._q.length>this._c&&this._o.onNext(this._q.shift())},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Qc);Pc.skipLast=function(a){if(0>a)throw new ib;return new te(this,a)},Pc.startWith=function(){var a,b=0;arguments.length&&sc(arguments[0])?(a=arguments[0],b=1):a=xc;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return cd([rd(c,a),this]).concat()};var ve=function(a){function b(b,c){this._o=b,this._c=c,this._q=[],a.call(this)}return Zb(b,a),b.prototype.next=function(a){this._q.push(a),this._q.length>this._c&&this._q.shift()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){for(;this._q.length>0;)this._o.onNext(this._q.shift());this._o.onCompleted()},b}(Qc);Pc.takeLast=function(a){if(0>a)throw new ib;var b=this;return new vg(function(c){return b.subscribe(new ve(c,a))},b)};var we=function(a){function b(b,c){this._o=b,this._c=c,this._q=[],a.call(this)}return Zb(b,a),b.prototype.next=function(a){this._q.push(a),this._q.length>this._c&&this._q.shift()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._q),this._o.onCompleted()},b}(Qc);Pc.takeLastBuffer=function(a){if(0>a)throw new ib;var b=this;return new vg(function(c){return b.subscribe(new we(c,a))},b)},Pc.windowWithCount=function(a,b){var c=this;if(+a||(a=0),Math.abs(a)===1/0&&(a=0),0>=a)throw new ib;if(null==b&&(b=a),+b||(b=0),Math.abs(b)===1/0&&(b=0),0>=b)throw new ib;return new vg(function(d){function e(){var a=new zg;i.push(a),d.onNext(_b(a,g))}var f=new kc,g=new oc(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g},c)},Pc.flatMapConcat=Pc.concatMap=function(a,b,c){return new Xc(this,a,b,c).merge(1)},Pc.concatMapObserver=Pc.selectConcatObserver=function(a,b,c,d){var e=this,f=qb(a,d,2),g=qb(b,d,1),h=qb(c,d,0);return new vg(function(a){var b=0;return e.subscribe(function(c){var d;try{d=f(c,b++)}catch(e){return void a.onError(e)}Wa(d)&&(d=gd(d)),a.onNext(d)},function(b){var c;try{c=g(b)}catch(d){return void a.onError(d)}Wa(c)&&(c=gd(c)),a.onNext(c),a.onCompleted()},function(){var b;try{b=h()}catch(c){return void a.onError(c)}Wa(b)&&(b=gd(b)),a.onNext(b),a.onCompleted()})},this).concatAll()};var xe=function(a){function b(b,c){this._o=b,this._d=c,this._f=!1,a.call(this)}return Zb(b,a),b.prototype.next=function(a){this._f=!0,this._o.onNext(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){!this._f&&this._o.onNext(this._d),this._o.onCompleted()},b}(Qc);Pc.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new vg(function(a){return c.subscribe(new xe(a,b))},c)},R.prototype.push=function(a){var b=-1===Q(this.set,a,this.comparer);return b&&this.set.push(a),b};var ye=function(a){function b(b,c,d){this.source=b,this._keyFn=c,this._cmpFn=d,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new ze(a,this._keyFn,this._cmpFn))},b}(Wc),ze=function(a){function b(b,c,d){this._o=b,this._keyFn=c,this._h=new R(d),a.call(this)}return Zb(b,a),b.prototype.next=function(a){var b=a;return Xa(this._keyFn)&&(b=Za(this._keyFn)(a),b===Ya)?this._o.onError(b.e):void(this._h.push(b)&&this._o.onNext(a))},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Qc);Pc.distinct=function(a,b){return b||(b=Ta),new ye(this,a,b)},Pc.groupBy=function(a,b){return this.groupByUntil(a,b,vd)},Pc.groupByUntil=function(b,c,d){var e=this;return new vg(function(f){var g=new Pf,h=new cc,i=new oc(h),j=function(a){return function(b){b.onError(a)}};return h.add(e.subscribe(function(e){var k=Za(b)(e);if(k===Ya)return g.forEach(j(k.e)),f.onError(k.e);var l=!1,m=g.get(k);if(m===a&&(m=new zg,g.set(k,m),l=!0),l){var n=new yg(k,m,i),o=new yg(k,m),p=Za(d)(o);if(p===Ya)return g.forEach(j(p.e)),f.onError(p.e);f.onNext(n);var q=new kc;h.add(q),q.setDisposable(p.take(1).subscribe(Qa,function(a){g.forEach(j(a)),f.onError(a)},function(){g["delete"](k)&&m.onCompleted(),h.remove(q)}))}var r=e;return Xa(c)&&(r=Za(c)(e),r===Ya)?(g.forEach(j(r.e)),f.onError(r.e)):void m.onNext(r)},function(a){g.forEach(j(a)),f.onError(a)},function(){g.forEach(function(a){a.onCompleted()}),f.onCompleted()})),i},e)};var Ae=function(a){function b(b,c,d){this.source=b,this.selector=qb(c,d,3),a.call(this)}function c(a,b){return function(c,d,e){return a.call(this,b.selector(c,d,e),d,e)}}function d(a,b,c){this.o=a,this.selector=b,this.source=c,this.i=0,Qc.call(this)}return Zb(b,a),b.prototype.internalMap=function(a,d){return new b(this.source,c(a,this),d)},b.prototype.subscribeCore=function(a){return this.source.subscribe(new d(a,this.selector,this))},Zb(d,Qc),d.prototype.next=function(a){var b=Za(this.selector)(a,this.i++,this.source);return b===Ya?this.o.onError(b.e):void this.o.onNext(b)},d.prototype.error=function(a){this.o.onError(a)},d.prototype.completed=function(){this.o.onCompleted()},b}(Wc);Pc.map=Pc.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof Ae?this.internalMap(c,b):new Ae(this,c,b)},Pc.pluck=function(){var a=arguments.length,b=new Array(a);if(0===a)throw new Error("List of properties cannot be empty.");for(var c=0;a>c;c++)b[c]=arguments[c];return this.map(S(b,a))},Pc.flatMap=Pc.selectMany=function(a,b,c){return new Xc(this,a,b,c).mergeAll()},Pc.flatMapObserver=Pc.selectManyObserver=function(a,b,c,d){var e=this;return new vg(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}Wa(c)&&(c=gd(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}Wa(c)&&(c=gd(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}Wa(a)&&(a=gd(a)),f.onNext(a),f.onCompleted()})},e).mergeAll()},Pa.Observable.prototype.flatMapLatest=function(a,b,c){return new Xc(this,a,b,c).switchLatest()};var Be=function(a){function b(b,c){this.source=b,this._count=c,a.call(this)}function c(a,b){this._o=a,this._r=b,Qc.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this._count))},Zb(c,Qc),c.prototype.next=function(a){this._r<=0?this._o.onNext(a):this._r--},c.prototype.error=function(a){this._o.onError(a)},c.prototype.completed=function(){this._o.onCompleted()},b}(Wc);Pc.skip=function(a){if(0>a)throw new ib;return new Be(this,a)};var Ce=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new De(a,this))},b}(Wc),De=function(a){function b(b,c){this._o=b,this._p=c,this._i=0,this._r=!1,a.call(this)}return Zb(b,a),b.prototype.next=function(a){if(!this._r){var b=Za(this._p._fn)(a,this._i++,this._p);if(b===Ya)return this._o.onError(b.e);this._r=!b}this._r&&this._o.onNext(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Qc);Pc.skipWhile=function(a,b){var c=qb(a,b,3);return new Ce(this,c)};var Ee=function(a){function b(b,c){this.source=b,this._count=c,a.call(this)}function c(a,b){this._o=a,this._c=b,this._r=b,Qc.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this._count))},Zb(c,Qc),c.prototype.next=function(a){this._r-->0&&(this._o.onNext(a),this._r<=0&&this._o.onCompleted())},c.prototype.error=function(a){this._o.onError(a)},c.prototype.completed=function(){this._o.onCompleted()},b}(Wc);Pc.take=function(a,b){if(0>a)throw new ib;return 0===a?md(b):new Ee(this,a)};var Fe=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Ge(a,this))},b}(Wc),Ge=function(a){function b(b,c){this._o=b,this._p=c,this._i=0,this._r=!0,a.call(this)}return Zb(b,a),b.prototype.next=function(a){return this._r&&(this._r=Za(this._p._fn)(a,this._i++,this._p),this._r===Ya)?this._o.onError(this._r.e):void(this._r?this._o.onNext(a):this._o.onCompleted())},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Qc);Pc.takeWhile=function(a,b){var c=qb(a,b,3);return new Fe(this,c)};var He=function(a){function b(b,c,d){this.source=b,this.predicate=qb(c,d,3),a.call(this)}function c(a,b){return function(c,d,e){return b.predicate(c,d,e)&&a.call(this,c,d,e)}}function d(a,b,c){this.o=a,this.predicate=b,this.source=c,this.i=0,Qc.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new d(a,this.predicate,this))},b.prototype.internalFilter=function(a,d){return new b(this.source,c(a,this),d)},Zb(d,Qc),d.prototype.next=function(a){var b=Za(this.predicate)(a,this.i++,this.source);return b===Ya?this.o.onError(b.e):void(b&&this.o.onNext(a))},d.prototype.error=function(a){this.o.onError(a)},d.prototype.completed=function(){this.o.onCompleted()},b}(Wc);Pc.filter=Pc.where=function(a,b){return this instanceof He?this.internalFilter(a,b):new He(this,a,b)};var Ie=function(a){function b(b,c,d){this.source=b,this._k=c,this._c=d,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Je(a,this._k,this._c))},b}(Wc),Je=function(a){function b(b,c,d){this._o=b,this._k=c,this._c=d,this._v=null,this._hv=!1,this._l=[],a.call(this)}return Zb(b,a),b.prototype.next=function(a){var b=Za(this._k)(a);if(b===Ya)return this._o.onError(b.e);var c=0;if(this._hv){if(c=Za(this._c)(b,this._v),c===Ya)return this._o.onError(c.e)}else this._hv=!0,this._v=b;c>0&&(this._v=b,this._l=[]),c>=0&&this._l.push(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._l),this._o.onCompleted()},b}(Qc),Ke=function(a){function b(b,c,d,e){this.source=b,this.accumulator=c,this.hasSeed=d,this.seed=e,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Le(a,this))},b}(Wc),Le=function(a){function b(b,c){this._o=b,this._p=c,this._fn=c.accumulator,this._hs=c.hasSeed,this._s=c.seed,this._ha=!1,this._a=null,this._hv=!1,this._i=0,a.call(this)}return Zb(b,a),b.prototype.next=function(a){return!this._hv&&(this._hv=!0),this._ha?this._a=Za(this._fn)(this._a,a,this._i,this._p):(this._a=this._hs?Za(this._fn)(this._s,a,this._i,this._p):a,this._ha=!0),this._a===Ya?this._o.onError(this._a.e):void this._i++},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._hv&&this._o.onNext(this._a),!this._hv&&this._hs&&this._o.onNext(this._s),!this._hv&&!this._hs&&this._o.onError(new gb),this._o.onCompleted()},b}(Qc);Pc.reduce=function(){var a,b=!1,c=arguments[0];return 2===arguments.length&&(b=!0,a=arguments[1]),new Ke(this,c,b,a)};var Me=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Ne(a,this._fn,this.source))},b}(Wc),Ne=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._i=0,a.call(this)}return Zb(b,a),b.prototype.next=function(a){var b=Za(this._fn)(a,this._i++,this._s);return b===Ya?this._o.onError(b.e):void(Boolean(b)&&(this._o.onNext(!0),this._o.onCompleted()))},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(!1),this._o.onCompleted()},b}(Qc);Pc.some=function(a,b){var c=qb(a,b,3);return new Me(this,c)};var Oe=function(a){function b(b){this.source=b,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Pe(a))},b}(Wc),Pe=function(a){function b(b){this._o=b,a.call(this)}return Zb(b,a),b.prototype.next=function(){this._o.onNext(!1),this._o.onCompleted()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(!0),this._o.onCompleted()},b}(Qc);Pc.isEmpty=function(){return new Oe(this)};var Qe=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Re(a,this._fn,this.source))},b}(Wc),Re=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._i=0,a.call(this)}return Zb(b,a),b.prototype.next=function(a){var b=Za(this._fn)(a,this._i++,this._s);return b===Ya?this._o.onError(b.e):void(Boolean(b)||(this._o.onNext(!1),this._o.onCompleted()))},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(!0),this._o.onCompleted()},b}(Qc);Pc.every=function(a,b){var c=qb(a,b,3);return new Qe(this,c)};var Se=function(a){function b(b,c,d){var e=+d||0;Math.abs(e)===1/0&&(e=0),this.source=b,this._elem=c,this._n=e,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this._n<0?(a.onNext(!1),a.onCompleted(),gc):this.source.subscribe(new Te(a,this._elem,this._n))},b}(Wc),Te=function(a){function b(b,c,d){this._o=b,this._elem=c,this._n=d,this._i=0,a.call(this)}function c(a,b){return 0===a&&0===b||a===b||isNaN(a)&&isNaN(b)}return Zb(b,a),b.prototype.next=function(a){this._i++>=this._n&&c(a,this._elem)&&(this._o.onNext(!0),this._o.onCompleted())},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(!1),this._o.onCompleted()},b}(Qc);Pc.includes=function(a,b){return new Se(this,a,b)};var Ue=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Ve(a,this._fn,this.source))},b}(Wc),Ve=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._i=0,this._c=0,a.call(this)}return Zb(b,a),b.prototype.next=function(a){if(this._fn){var b=Za(this._fn)(a,this._i++,this._s);if(b===Ya)return this._o.onError(b.e);Boolean(b)&&this._c++}else this._c++},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._c),this._o.onCompleted()},b}(Qc);Pc.count=function(a,b){var c=qb(a,b,3);return new Ue(this,c)};var We=function(a){function b(b,c,d){this.source=b,this._e=c,this._n=d,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this._n<0?(a.onNext(-1),a.onCompleted(),gc):this.source.subscribe(new Xe(a,this._e,this._n))},b}(Wc),Xe=function(a){function b(b,c,d){this._o=b,this._e=c,this._n=d,this._i=0,a.call(this)}return Zb(b,a),b.prototype.next=function(a){this._i>=this._n&&a===this._e&&(this._o.onNext(this._i),this._o.onCompleted()),this._i++},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(-1),this._o.onCompleted()},b}(Qc);Pc.indexOf=function(a,b){var c=+b||0;return Math.abs(c)===1/0&&(c=0),new We(this,a,c)};var Ye=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Ze(a,this._fn,this.source))},b}(Wc),Ze=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._i=0,this._c=0,a.call(this)}return Zb(b,a),b.prototype.next=function(a){if(this._fn){var b=Za(this._fn)(a,this._i++,this._s);if(b===Ya)return this._o.onError(b.e);this._c+=b}else this._c+=a},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._c),this._o.onCompleted()},b}(Qc);Pc.sum=function(a,b){var c=qb(a,b,3);return new Ye(this,c)},Pc.minBy=function(a,b){return b||(b=Ua),new Ie(this,a,function(a,c){return-1*b(a,c)})},Pc.min=function(a){return this.minBy(Ra,a).map(function(a){return T(a)})},Pc.maxBy=function(a,b){return b||(b=Ua),new Ie(this,a,b)},Pc.max=function(a){return this.maxBy(Ra,a).map(function(a){return T(a)})};var $e=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new _e(a,this._fn,this.source))},b}(Wc),_e=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._c=0,this._t=0,a.call(this)}return Zb(b,a),b.prototype.next=function(a){if(this._fn){var b=Za(this._fn)(a,this._c++,this._s);if(b===Ya)return this._o.onError(b.e);this._t+=b}else this._c++,this._t+=a},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){return 0===this._c?this._o.onError(new gb):(this._o.onNext(this._t/this._c),void this._o.onCompleted())},b}(Qc);Pc.average=function(a,b){var c,d=this;return Xa(a)&&(c=qb(a,b,3)),new $e(d,c)},Pc.sequenceEqual=function(a,b){var c=this;return b||(b=Ta),new vg(function(d){var e=!1,f=!1,g=[],h=[],i=c.subscribe(function(a){if(h.length>0){var c=h.shift(),e=Za(b)(c,a);if(e===Ya)return d.onError(e.e);e||(d.onNext(!1),d.onCompleted())}else f?(d.onNext(!1),d.onCompleted()):g.push(a)},function(a){d.onError(a)},function(){e=!0,0===g.length&&(h.length>0?(d.onNext(!1),d.onCompleted()):f&&(d.onNext(!0),d.onCompleted()))});(pb(a)||ob(a))&&(a=pd(a)),Wa(a)&&(a=gd(a));var j=a.subscribe(function(a){if(g.length>0){var c=g.shift(),f=Za(b)(c,a);if(f===Ya)return d.onError(f.e);f||(d.onNext(!1),d.onCompleted())}else e?(d.onNext(!1),d.onCompleted()):h.push(a)},function(a){d.onError(a)},function(){f=!0,0===h.length&&(g.length>0?(d.onNext(!1),d.onCompleted()):e&&(d.onNext(!0),d.onCompleted()))});return new mc(i,j)},c)};var af=function(a){function b(b,c,d){this.source=b,this._i=c,this._d=d,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new bf(a,this._i,this._d))},b}(Wc),bf=function(b){function c(a,c,d){this._o=a,this._i=c,this._d=d,b.call(this)}return Zb(c,b),c.prototype.next=function(a){0===this._i--&&(this._o.onNext(a),this._o.onCompleted())},c.prototype.error=function(a){this._o.onError(a)},c.prototype.completed=function(){this._d===a?this._o.onError(new ib):(this._o.onNext(this._d),this._o.onCompleted())},c}(Qc);Pc.elementAt=function(a,b){if(0>a)throw new ib;return new af(this,a,b)};var cf=function(b){function c(a,c,d){this._o=a,this._obj=c,this._s=d,this._i=0,this._hv=!1,this._v=null,b.call(this)}return Zb(c,b),c.prototype.next=function(a){var b=!1;if(this._obj.predicate){var c=Za(this._obj.predicate)(a,this._i++,this._s);if(c===Ya)return this._o.onError(c.e);Boolean(c)&&(b=!0)}else this._obj.predicate||(b=!0);if(b){if(this._hv)return this._o.onError(new Error("Sequence contains more than one matching element"));this._hv=!0,this._v=a}},c.prototype.error=function(a){this._o.onError(a)},c.prototype.completed=function(){this._hv?(this._o.onNext(this._v),this._o.onCompleted()):this._obj.defaultValue===a?this._o.onError(new gb):(this._o.onNext(this._obj.defaultValue),this._o.onCompleted())},c}(Qc);Pc.single=function(a,b){var c={},d=this;if(c="object"==typeof arguments[0]?arguments[0]:{predicate:arguments[0],thisArg:arguments[1],defaultValue:arguments[2]},Xa(c.predicate)){var e=c.predicate;c.predicate=qb(e,c.thisArg,3)}return new vg(function(a){return d.subscribe(new cf(a,c,d))},d)};var df=function(a){function b(b,c){this.source=b,this._obj=c,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new ef(a,this._obj,this.source))},b}(Wc),ef=function(b){function c(a,c,d){this._o=a,this._obj=c,this._s=d,this._i=0,b.call(this)}return Zb(c,b),c.prototype.next=function(a){if(this._obj.predicate){var b=Za(this._obj.predicate)(a,this._i++,this._s);if(b===Ya)return this._o.onError(b.e);Boolean(b)&&(this._o.onNext(a),this._o.onCompleted())}else this._obj.predicate||(this._o.onNext(a),this._o.onCompleted())},c.prototype.error=function(a){this._o.onError(a)},c.prototype.completed=function(){this._obj.defaultValue===a?this._o.onError(new gb):(this._o.onNext(this._obj.defaultValue),this._o.onCompleted())},c}(Qc);Pc.first=function(){var a={};if(a="object"==typeof arguments[0]?arguments[0]:{predicate:arguments[0],thisArg:arguments[1],defaultValue:arguments[2]},Xa(a.predicate)){var b=a.predicate;a.predicate=qb(b,a.thisArg,3)}return new df(this,a)};var ff=function(a){function b(b,c){this.source=b,this._obj=c,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new gf(a,this._obj,this.source))},b}(Wc),gf=function(b){function c(a,c,d){this._o=a,this._obj=c,this._s=d,this._i=0,this._hv=!1,this._v=null,b.call(this)}return Zb(c,b),c.prototype.next=function(a){var b=!1;if(this._obj.predicate){var c=Za(this._obj.predicate)(a,this._i++,this._s);if(c===Ya)return this._o.onError(c.e);Boolean(c)&&(b=!0)}else this._obj.predicate||(b=!0);b&&(this._hv=!0,this._v=a)},c.prototype.error=function(a){this._o.onError(a)},c.prototype.completed=function(){this._hv?(this._o.onNext(this._v),this._o.onCompleted()):this._obj.defaultValue===a?this._o.onError(new gb):(this._o.onNext(this._obj.defaultValue),this._o.onCompleted())},c}(Qc);Pc.last=function(){var a={};if(a="object"==typeof arguments[0]?arguments[0]:{predicate:arguments[0],thisArg:arguments[1],defaultValue:arguments[2]},Xa(a.predicate)){var b=a.predicate;a.predicate=qb(b,a.thisArg,3)}return new ff(this,a)};var hf=function(a){function b(b,c,d,e){this._o=b,this._s=c,this._cb=d,this._y=e,this._i=0,a.call(this)}return Zb(b,a),b.prototype.next=function(a){var b=Za(this._cb)(a,this._i,this._s);return b===Ya?this._o.onError(b.e):void(b?(this._o.onNext(this._y?this._i:a),this._o.onCompleted()):this._i++)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._y&&this._o.onNext(-1),this._o.onCompleted()},b}(Qc);Pc.find=function(a,b){return U(this,a,b,!1)},Pc.findIndex=function(a,b){return U(this,a,b,!0)};var jf=function(a){function b(b){this.source=b,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new kf(a))},b}(Wc),kf=function(a){function b(b){this._o=b,this._s=new Oa.Set,a.call(this)}return Zb(b,a),b.prototype.next=function(a){this._s.add(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._s),this._o.onCompleted()},b}(Qc);Pc.toSet=function(){if("undefined"==typeof Oa.Set)throw new TypeError;return new jf(this)};var lf=function(a){function b(b,c,d){this.source=b,this._k=c,this._e=d,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new mf(a,this._k,this._e))},b}(Wc),mf=function(a){function b(b,c,d){this._o=b,this._k=c,this._e=d,this._m=new Oa.Map,a.call(this)}return Zb(b,a),b.prototype.next=function(a){var b=Za(this._k)(a);if(b===Ya)return this._o.onError(b.e);var c=a;return this._e&&(c=Za(this._e)(a),c===Ya)?this._o.onError(c.e):void this._m.set(b,c)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._m),this._o.onCompleted()},b}(Qc);Pc.toMap=function(a,b){
5if("undefined"==typeof Oa.Map)throw new TypeError;return new lf(this,a,b)};var nf=function(a){function b(b,c,d){this.source=b,this._b=c,this._e=d,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new of(a,this._b,this._e))},b}(Wc),of=function(a){function b(b,c,d){this._o=b,this._b=c,this._e=d,this._i=0,a.call(this)}return Zb(b,a),b.prototype.next=function(a){this._i>=this._b&&(this._e===this._i?this._o.onCompleted():this._o.onNext(a)),this._i++},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Qc);Pc.slice=function(a,b){var c=a||0;if(0>c)throw new Pa.ArgumentOutOfRangeError;if("number"==typeof b&&c>b)throw new Pa.ArgumentOutOfRangeError;return new nf(this,c,b)};var pf=function(a){function b(b,c,d){this.source=b,this._e=c,this._n=d,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this._n<0?(a.onNext(-1),a.onCompleted(),gc):this.source.subscribe(new qf(a,this._e,this._n))},b}(Wc),qf=function(a){function b(b,c,d){this._o=b,this._e=c,this._n=d,this._v=0,this._hv=!1,this._i=0,a.call(this)}return Zb(b,a),b.prototype.next=function(a){this._i>=this._n&&a===this._e&&(this._hv=!0,this._v=this._i),this._i++},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._hv?this._o.onNext(this._v):this._o.onNext(-1),this._o.onCompleted()},b}(Qc);Pc.lastIndexOf=function(a,b){var c=+b||0;return Math.abs(c)===1/0&&(c=0),new pf(this,a,c)},Vc.wrap=function(a){function b(){return Vc.spawn.call(this,a.apply(this,arguments))}return b.__generatorFunction__=a,b};var rf=Vc.spawn=function(){for(var a=arguments[0],b=this,c=[],d=1,e=arguments.length;e>d;d++)c.push(arguments[d]);return new vg(function(d){function e(b){var c=Za(a.next).call(a,b);return c===Ya?d.onError(c.e):void g(c)}function f(b){var c=Za(a.next).call(a,b);return c===Ya?d.onError(c.e):void g(c)}function g(a){if(a.done)return d.onNext(a.value),void d.onCompleted();var c=V.call(b,a.value),g=null,i=!1;Vc.isObservable(c)?h.add(c.subscribe(function(a){i=!0,g=a},f,function(){i&&e(g)})):f(new TypeError("type not supported"))}var h=new cc;return Xa(a)&&(a=a.apply(b,c)),a&&Xa(a.next)?(e(),h):(d.onNext(a),d.onCompleted())})};Vc.start=function(a,b,c){return sf(a,b,c)()};var sf=Vc.toAsync=function(a,b,c){return sc(c)||(c=Ec),function(){var d=arguments,e=new Ag;return c.schedule(null,function(){var c;try{c=a.apply(b,d)}catch(f){return void e.onError(f)}e.onNext(c),e.onCompleted()}),e.asObservable()}};Vc.fromCallback=function(a,b,c){return function(){"undefined"==typeof b&&(b=this);for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return aa(a,b,c,e)}},Vc.fromNodeCallback=function(a,b,c){return function(){"undefined"==typeof b&&(b=this);for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return ca(a,b,c,e)}},fa.prototype.dispose=function(){this.isDisposed||(this._e.removeEventListener(this._n,this._fn,!1),this.isDisposed=!0)},Pa.config.useNativeEvents=!1;var tf=function(a){function b(b,c,d){this._el=b,this._n=c,this._fn=d,a.call(this)}function c(a,b){return function(){var c=arguments[0];return Xa(b)&&(c=Za(b).apply(null,arguments),c===Ya)?a.onError(c.e):void a.onNext(c)}}return Zb(b,a),b.prototype.subscribeCore=function(a){return ga(this._el,this._n,c(a,this._fn))},b}(Wc);Vc.fromEvent=function(a,b,c){return a.addListener?vf(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c):Pa.config.useNativeEvents||"function"!=typeof a.on||"function"!=typeof a.off?new tf(a,b,c).publish().refCount():vf(function(c){a.on(b,c)},function(c){a.off(b,c)},c)};var uf=function(a){function b(b,c,d){this._add=b,this._del=c,this._fn=d,a.call(this)}function c(a,b){return function(){var c=arguments[0];return Xa(b)&&(c=Za(b).apply(null,arguments),c===Ya)?a.onError(c.e):void a.onNext(c)}}function d(a,b,c){this._del=a,this._fn=b,this._ret=c,this.isDisposed=!1}return Zb(b,a),b.prototype.subscribeCore=function(a){var b=c(a,this._fn),e=this._add(b);return new d(this._del,b,e)},d.prototype.dispose=function(){this.isDisposed||Xa(this._del)&&this._del(this._fn,this._ret)},b}(Wc),vf=Vc.fromEventPattern=function(a,b,c){return new uf(a,b,c).publish().refCount()};Vc.startAsync=function(a){var b=Za(a)();return b===Ya?Bd(b.e):gd(b)};var wf=function(a){function b(b,c){this.source=b,this.controller=new zg,c&&c.subscribe?this.pauser=this.controller.merge(c):this.pauser=this.controller,a.call(this)}return Zb(b,a),b.prototype._subscribe=function(a){var b=this.source.publish(),c=b.subscribe(a),d=gc,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=gc)});return new nc([c,d,e])},b.prototype.pause=function(){this.controller.onNext(!1)},b.prototype.resume=function(){this.controller.onNext(!0)},b}(Vc);Pc.pausable=function(a){return new wf(this,a)};var xf=function(b){function c(a,c){this.source=a,this.controller=new zg,c&&c.subscribe?this.pauser=this.controller.merge(c):this.pauser=this.controller,b.call(this)}return Zb(c,b),c.prototype._subscribe=function(b){function c(){for(;e.length>0;)b.onNext(e.shift())}var d,e=[],f=ha(this.source,this.pauser.startWith(!1).distinctUntilChanged(),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(f){d!==a&&f.shouldFire!==d?(d=f.shouldFire,f.shouldFire&&c()):(d=f.shouldFire,f.shouldFire?b.onNext(f.data):e.push(f.data))},function(a){c(),b.onError(a)},function(){c(),b.onCompleted()});return f},c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(Vc);Pc.pausableBuffered=function(a){return new xf(this,a)};var yf=function(a){function b(b,c,d){a.call(this),this.subject=new zf(c,d),this.source=b.multicast(this.subject).refCount()}return Zb(b,a),b.prototype._subscribe=function(a){return this.source.subscribe(a)},b.prototype.request=function(a){return this.subject.request(null==a?-1:a)},b}(Vc),zf=function(a){function b(b,c){null==b&&(b=!0),a.call(this),this.subject=new zg,this.enableQueue=b,this.queue=b?[]:null,this.requestedCount=0,this.requestedDisposable=null,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.scheduler=c||zc}return Zb(b,a),$b(b.prototype,Nc,{_subscribe:function(a){return this.subject.subscribe(a)},onCompleted:function(){this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length?this.queue.push(Gc.createOnCompleted()):(this.subject.onCompleted(),this.disposeCurrentRequest())},onError:function(a){this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length?this.queue.push(Gc.createOnError(a)):(this.subject.onError(a),this.disposeCurrentRequest())},onNext:function(a){this.requestedCount<=0?this.enableQueue&&this.queue.push(Gc.createOnNext(a)):(0===this.requestedCount--&&this.disposeCurrentRequest(),this.subject.onNext(a))},_processRequest:function(a){if(this.enableQueue)for(;this.queue.length>0&&(a>0||"N"!==this.queue[0].kind);){var b=this.queue.shift();b.accept(this.subject),"N"===b.kind?a--:(this.disposeCurrentRequest(),this.queue=[])}return a},request:function(a){this.disposeCurrentRequest();var b=this;return this.requestedDisposable=this.scheduler.schedule(a,function(a,c){var d=b._processRequest(c),e=b.hasCompleted||b.hasFailed;return!e&&d>0?(b.requestedCount=d,fc(function(){b.requestedCount=0})):void 0}),this.requestedDisposable},disposeCurrentRequest:function(){this.requestedDisposable&&(this.requestedDisposable.dispose(),this.requestedDisposable=null)}}),b}(Vc);Pc.controlled=function(a,b){return a&&sc(a)&&(b=a,a=!0),null==a&&(a=!0),new yf(this,a,b)};var Af=function(a){function b(b){a.call(this),this.source=b}function c(a,b){b.source.request(1)}Zb(b,a),b.prototype._subscribe=function(a){return this.subscription=this.source.subscribe(new d(a,this,this.subscription)),new mc(this.subscription,Ec.schedule(this,c))};var d=function(a){function c(b,c,d){a.call(this),this.observer=b,this.observable=c,this.cancel=d,this.scheduleDisposable=null}function d(a,b){b.observable.source.request(1)}return Zb(c,a),c.prototype.completed=function(){this.observer.onCompleted(),this.dispose()},c.prototype.error=function(a){this.observer.onError(a),this.dispose()},c.prototype.next=function(a){this.observer.onNext(a),this.scheduleDisposable=Ec.schedule(this,d)},b.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),this.scheduleDisposable&&(this.scheduleDisposable.dispose(),this.scheduleDisposable=null),a.prototype.dispose.call(this)},c}(Qc);return b}(Vc);yf.prototype.stopAndWait=function(){return new Af(this)};var Bf=function(a){function b(b,c){a.call(this),this.source=b,this.windowSize=c}function c(a,b){b.source.request(b.windowSize)}Zb(b,a),b.prototype._subscribe=function(a){return this.subscription=this.source.subscribe(new d(a,this,this.subscription)),new mc(this.subscription,Ec.schedule(this,c))};var d=function(a){function b(b,c,d){this.observer=b,this.observable=c,this.cancel=d,this.received=0,this.scheduleDisposable=null,a.call(this)}function c(a,b){b.observable.source.request(b.observable.windowSize)}return Zb(b,a),b.prototype.completed=function(){this.observer.onCompleted(),this.dispose()},b.prototype.error=function(a){this.observer.onError(a),this.dispose()},b.prototype.next=function(a){this.observer.onNext(a),this.received=++this.received%this.observable.windowSize,0===this.received&&(this.scheduleDisposable=Ec.schedule(this,c))},b.prototype.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),this.scheduleDisposable&&(this.scheduleDisposable.dispose(),this.scheduleDisposable=null),a.prototype.dispose.call(this)},b}(Qc);return b}(Vc);yf.prototype.windowed=function(a){return new Bf(this,a)},Pc.pipe=function(a){function b(){c.resume()}var c=this.pausableBuffered();return a.addListener("drain",b),c.subscribe(function(b){!a.write(String(b))&&c.pause()},function(b){a.emit("error",b)},function(){!a._isStdio&&a.end(),a.removeListener("drain",b)}),c.resume(),a};var Cf=function(a){function b(b,c,d){this.source=b,this._fn1=c,this._fn2=d,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){var b=this.source.multicast(this._fn1());return new mc(this._fn2(b).subscribe(a),b.connect())},b}(Wc);Pc.multicast=function(a,b){return Xa(a)?new Cf(this,a,b):new Ff(this,a)},Pc.publish=function(a){return a&&Xa(a)?this.multicast(function(){return new zg},a):this.multicast(new zg)},Pc.share=function(){return this.publish().refCount()},Pc.publishLast=function(a){return a&&Xa(a)?this.multicast(function(){return new Ag},a):this.multicast(new Ag)},Pc.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new Cg(b)},a):this.multicast(new Cg(a))},Pc.shareValue=function(a){return this.publishValue(a).refCount()},Pc.replay=function(a,b,c,d){return a&&Xa(a)?this.multicast(function(){return new Dg(b,c,d)},a):this.multicast(new Dg(b,c,d))},Pc.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};var Df=function(a,b){this._s=a,this._o=b};Df.prototype.dispose=function(){if(!this._s.isDisposed&&null!==this._o){var a=this._s.observers.indexOf(this._o);this._s.observers.splice(a,1),this._o=null}};var Ef=function(a){function b(b){this.source=b,this._count=0,this._connectableSubscription=null,a.call(this)}function c(a,b){this._p=a,this._s=b,this.isDisposed=!1}return Zb(b,a),b.prototype.subscribeCore=function(a){var b=this.source.subscribe(a);return 1===++this._count&&(this._connectableSubscription=this.source.connect()),new c(this,b)},c.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._s.dispose(),0===--this._p._count&&this._p._connectableSubscription.dispose())},b}(Wc),Ff=Pa.ConnectableObservable=function(a){function b(b,c){this.source=b,this._connection=null,this._source=b.asObservable(),this._subject=c,a.call(this)}function c(a,b){this._p=a,this._s=b}return Zb(b,a),c.prototype.dispose=function(){this._s&&(this._s.dispose(),this._s=null,this._p._connection=null)},b.prototype.connect=function(){if(!this._connection){var a=this._source.subscribe(this._subject);this._connection=new c(this,a)}return this._connection},b.prototype._subscribe=function(a){return this._subject.subscribe(a)},b.prototype.refCount=function(){return new Ef(this)},b}(Vc);Pc.singleInstance=function(){function a(){return d||(d=!0,b=c["finally"](function(){d=!1}).publish().refCount()),b}var b,c=this,d=!1;return new vg(function(b){return a().subscribe(b)})},Pc.join=function(a,b,c,d){var e=this;return new vg(function(f){var g=new cc,h=!1,i=!1,j=0,k=0,l=new Pf,m=new Pf,n=function(a){f.onError(a)};return g.add(e.subscribe(function(a){var c=j++,e=new kc;l.set(c,a),g.add(e);var i=Za(b)(a);return i===Ya?f.onError(i.e):(e.setDisposable(i.take(1).subscribe(Qa,n,function(){l["delete"](c)&&0===l.size&&h&&f.onCompleted(),g.remove(e)})),void m.forEach(function(b){var c=Za(d)(a,b);return c===Ya?f.onError(c.e):void f.onNext(c)}))},n,function(){h=!0,(i||0===l.size)&&f.onCompleted()})),g.add(a.subscribe(function(a){var b=k++,e=new kc;m.set(b,a),g.add(e);var h=Za(c)(a);return h===Ya?f.onError(h.e):(e.setDisposable(h.take(1).subscribe(Qa,n,function(){m["delete"](b)&&0===m.size&&i&&f.onCompleted(),g.remove(e)})),void l.forEach(function(b){var c=Za(d)(b,a);return c===Ya?f.onError(c.e):void f.onNext(c)}))},n,function(){i=!0,(h||0===m.size)&&f.onCompleted()})),g},e)},Pc.groupJoin=function(a,b,c,d){var e=this;return new vg(function(f){function g(a){}var h=new cc,i=new oc(h),j=new Pf,k=new Pf,l=0,m=0,g=function(a){return function(b){b.onError(a)}};return h.add(e.subscribe(function(a){var c=new zg,e=l++;j.set(e,c);var m=Za(d)(a,_b(c,i));if(m===Ya)return j.forEach(g(m.e)),f.onError(m.e);f.onNext(m),k.forEach(function(a){c.onNext(a)});var n=new kc;h.add(n);var o=Za(b)(a);return o===Ya?(j.forEach(g(o.e)),f.onError(o.e)):void n.setDisposable(o.take(1).subscribe(Qa,function(a){j.forEach(g(a)),f.onError(a)},function(){j["delete"](e)&&c.onCompleted(),h.remove(n)}))},function(a){j.forEach(g(a)),f.onError(a)},function(){f.onCompleted()})),h.add(a.subscribe(function(a){var b=m++;k.set(b,a);var d=new kc;h.add(d);var e=Za(c)(a);return e===Ya?(j.forEach(g(e.e)),f.onError(e.e)):(d.setDisposable(e.take(1).subscribe(Qa,function(a){j.forEach(g(a)),f.onError(a)},function(){k["delete"](b),h.remove(d)})),void j.forEach(function(b){b.onNext(a)}))},function(a){j.forEach(g(a)),f.onError(a)})),i},e)},Pc.buffer=function(){return this.window.apply(this,arguments).flatMap(O)},Pc.window=function(a,b){return 1===arguments.length&&"function"!=typeof arguments[0]?ja.call(this,a):"function"==typeof a?ka.call(this,a):ia.call(this,a,b)};var Gf=function(a){function b(b){this.source=b,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Hf(a))},b}(Wc),Hf=function(a){function b(a){this._o=a,this._p=null,this._hp=!1}return Zb(b,a),b.prototype.next=function(a){this._hp?this._o.onNext([this._p,a]):this._hp=!0,this._p=a},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Qc);Pc.pairwise=function(){return new Gf(this)},Pc.partition=function(a,b){var c=qb(a,b,3);return[this.filter(a,b),this.filter(function(a,b,d){return!c(a,b,d)})]};var If=function(a){function b(a,b){this.c=a,this.s=b}return Zb(b,a),b.prototype[mb]=function(){var a=this;return{next:function(){return a.c()?{done:!1,value:a.s}:{done:!0,value:void 0}}}},b}(Yc);Pc.letBind=Pc.let=function(a){return a(this)},Vc["if"]=function(a,b,c){return jd(function(){return c||(c=md()),Wa(b)&&(b=gd(b)),Wa(c)&&(c=gd(c)),"function"==typeof c.now&&(c=md(c)),a()?b:c})},Vc["for"]=Vc.forIn=function(a,b,c){return cd(a,b,c).concat()};var Jf=Vc["while"]=Vc.whileDo=function(a,b){return Wa(b)&&(b=gd(b)),la(a,b).concat()};Pc.doWhile=function(a){return Ld([this,Jf(a,this)])},Vc["case"]=function(a,b,c){return jd(function(){Wa(c)&&(c=gd(c)),c||(c=md()),sc(c)&&(c=md(c));var d=b[a()];return Wa(d)&&(d=gd(d)),d||c})};var Kf=function(a){function b(b,c,d){this.source=b,this._fn=c,this._scheduler=d,a.call(this)}function c(a,b){var c,d=a[0],e=a[1];if(!(d.q.length>0))return void(d.isAcquired=!1);c=d.q.shift();var f=new kc;d.d.add(f),f.setDisposable(c.subscribe(new Lf(d,e,f))),b([d,e])}return Zb(b,a),b.prototype._ensureActive=function(a){var b=!1;a.q.length>0&&(b=!a.isAcquired,a.isAcquired=!0),b&&a.m.setDisposable(this._scheduler.scheduleRecursive([a,this],c))},b.prototype.subscribeCore=function(a){var b=new lc,c=new cc(b),d={q:[],m:b,d:c,activeCount:0,isAcquired:!1,o:a};return d.q.push(this.source),d.activeCount++,this._ensureActive(d),c},b}(Wc),Lf=function(a){function b(b,c,d){this._s=b,this._p=c,this._m1=d,a.call(this)}return Zb(b,a),b.prototype.next=function(a){this._s.o.onNext(a);var b=Za(this._p._fn)(a);return b===Ya?this._s.o.onError(b.e):(this._s.q.push(b),this._s.activeCount++,void this._p._ensureActive(this._s))},b.prototype.error=function(a){this._s.o.onError(a)},b.prototype.completed=function(){this._s.d.remove(this._m1),this._s.activeCount--,0===this._s.activeCount&&this._s.o.onCompleted()},b}(Qc);Pc.expand=function(a,b){return sc(b)||(b=zc),new Kf(this,a,b)};var Mf=function(a){function b(b,c){this._sources=b,this._cb=c,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){if(0===this._sources.length)return a.onCompleted(),gc;for(var b=this._sources.length,c={finished:!1,hasResults:new Array(b),hasCompleted:new Array(b),results:new Array(b)},d=new cc,e=0,f=this._sources.length;f>e;e++){var g=this._sources[e];Wa(g)&&(g=gd(g)),d.add(g.subscribe(new Nf(a,c,e,this._cb,d)))}return d},b}(Wc),Nf=function(a){function b(b,c,d,e,f){this._o=b,this._s=c,this._i=d,this._cb=e,this._subs=f,a.call(this)}return Zb(b,a),b.prototype.next=function(a){this._s.finished||(this._s.hasResults[this._i]=!0,this._s.results[this._i]=a)},b.prototype.error=function(a){this._s.finished=!0,this._o.onError(a),this._subs.dispose()},b.prototype.completed=function(){if(!this._s.finished){if(!this._s.hasResults[this._i])return this._o.onCompleted();this._s.hasCompleted[this._i]=!0;for(var a=0;a<this._s.results.length;a++)if(!this._s.hasCompleted[a])return;this._s.finished=!0;var b=Za(this._cb).apply(null,this._s.results);if(b===Ya)return this._o.onError(b.e);this._o.onNext(b),this._o.onCompleted()}},b}(Qc);Vc.forkJoin=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=Xa(b[a-1])?b.pop():L;return Array.isArray(b[0])&&(b=b[0]),new Mf(b,d)},Pc.forkJoin=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return Array.isArray(b[0])?b[0].unshift(this):b.unshift(this),Vc.forkJoin.apply(null,b)},Pc.manySelect=Pc.extend=function(a,b){sc(b)||(b=Pa.Scheduler.immediate);var c=this;return jd(function(){var d;return c.map(function(a){var b=new Of(a);return d&&d.onNext(a),d=b,b}).tap(Qa,function(a){d&&d.onError(a)},function(){d&&d.onCompleted()}).observeOn(b).map(a)},c)};var Of=function(a){function b(b){a.call(this),this.head=b,this.tail=new Ag}return Zb(b,a),$b(b.prototype,Nc,{_subscribe:function(a){var b=new cc;return b.add(zc.schedule(this,function(c,d){a.onNext(d.head),b.add(d.tail.mergeAll().subscribe(a))})),b},onCompleted:function(){this.onNext(Vc.empty())},onError:function(a){this.onNext(Vc["throw"](a))},onNext:function(a){this.tail.onNext(a),this.tail.onCompleted()}}),b}(Vc),Pf=Oa.Map||function(){function b(){this.size=0,this._values=[],this._keys=[]}return b.prototype["delete"]=function(a){var b=this._keys.indexOf(a);return-1===b?!1:(this._values.splice(b,1),this._keys.splice(b,1),this.size--,!0)},b.prototype.get=function(b){var c=this._keys.indexOf(b);return-1===c?a:this._values[c]},b.prototype.set=function(a,b){var c=this._keys.indexOf(a);return-1===c?(this._keys.push(a),this._values.push(b),this.size++):this._values[c]=b,this},b.prototype.forEach=function(a,b){for(var c=0;c<this.size;c++)a.call(b,this._values[c],this._keys[c])},b}();ma.prototype.and=function(a){return new ma(this.patterns.concat(a))},ma.prototype.thenDo=function(a){return new na(this,a)},na.prototype.activate=function(a,b,c){for(var d=[],e=oa(b),f=0,g=this.expression.patterns.length;g>f;f++)d.push(qa(a,this.expression.patterns[f],e));var h=new ra(d,pa(this,b),function(){for(var a=0,b=d.length;b>a;a++)d[a].removeActivePlan(h);c(h)});for(f=0,g=d.length;g>f;f++)d[f].addActivePlan(h);return h},ra.prototype.dequeue=function(){this.joinObservers.forEach(function(a){a.queue.shift()})},ra.prototype.match=function(){var a,b,c=!0;for(a=0,b=this.joinObserverArray.length;b>a;a++)if(0===this.joinObserverArray[a].queue.length){c=!1;break}if(c){var d=[],e=!1;for(a=0,b=this.joinObserverArray.length;b>a;a++)d.push(this.joinObserverArray[a].queue[0]),"C"===this.joinObserverArray[a].queue[0].kind&&(e=!0);if(e)this.onCompleted();else{this.dequeue();var f=[];for(a=0,b=d.length;a<d.length;a++)f.push(d[a].value);this.onNext.apply(this,f)}}};var Qf=function(a){function b(b,c){a.call(this),this.source=b,this.onError=c,this.queue=[],this.activePlans=[],this.subscription=new kc,this.isDisposed=!1}Zb(b,a);var c=b.prototype;return c.next=function(a){if(!this.isDisposed){if("E"===a.kind)return this.onError(a.error);this.queue.push(a);for(var b=this.activePlans.slice(0),c=0,d=b.length;d>c;c++)b[c].match()}},c.error=Qa,c.completed=Qa,c.addActivePlan=function(a){this.activePlans.push(a)},c.subscribe=function(){this.subscription.setDisposable(this.source.materialize().subscribe(this))},c.removeActivePlan=function(a){this.activePlans.splice(this.activePlans.indexOf(a),1),0===this.activePlans.length&&this.dispose()},c.dispose=function(){a.prototype.dispose.call(this),this.isDisposed||(this.isDisposed=!0,this.subscription.dispose())},b}(Qc);Pc.and=function(a){return new ma([this,a])},Pc.thenDo=function(a){return new ma([this]).thenDo(a)},Vc.when=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new vg(function(b){var c=[],d=new Pf,e=Oc(function(a){b.onNext(a)},function(a){d.forEach(function(b){b.onError(a)}),b.onError(a)},function(a){b.onCompleted()});try{for(var f=0,g=a.length;g>f;f++)c.push(a[f].activate(d,e,function(a){var d=c.indexOf(a);c.splice(d,1),0===c.length&&b.onCompleted()}))}catch(h){Bd(h).subscribe(b)}var i=new cc;return d.forEach(function(a){a.subscribe(),i.add(a)}),i})};var Rf=function(a){function b(b,c){this._dt=b,this._s=c,a.call(this)}function c(a,b){b.onNext(0),b.onCompleted()}return Zb(b,a),b.prototype.subscribeCore=function(a){return this._s.scheduleFuture(a,this._dt,c)},b}(Wc),Sf=Vc.interval=function(a,b){return ua(a,a,sc(b)?b:Ec)};Vc.timer=function(b,c,d){var e;return sc(d)||(d=Ec),null!=c&&"number"==typeof c?e=c:sc(c)&&(d=c),(b instanceof Date||"number"==typeof b)&&e===a?sa(b,d):b instanceof Date&&e!==a?ta(b.getTime(),c,d):ua(b,e,d)};Pc.delay=function(){var a=arguments[0];if("number"==typeof a||a instanceof Date){var b=a,c=arguments[1];return sc(c)||(c=Ec),b instanceof Date?wa(this,b,c):va(this,b,c)}if(Vc.isObservable(a)||Xa(a))return xa(this,a,arguments[1]);throw new Error("Invalid arguments")};var Tf=function(a){function b(b,c,d){sc(d)||(d=Ec),this.source=b,this._dt=c,this._s=d,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){var b=new lc;return new mc(this.source.subscribe(new Uf(a,this.source,this._dt,this._s,b)),b)},b}(Wc),Uf=function(a){function b(b,c,d,e,f){this._o=b,this._s=c,this._d=d,this._scheduler=e,this._c=f,this._v=null,this._hv=!1,this._id=0,a.call(this)}return Zb(b,a),b.prototype.next=function(a){this._hv=!0,this._v=a;var b=++this._id,c=new kc;this._c.setDisposable(c),c.setDisposable(this._scheduler.scheduleFuture(this,this._d,function(c,d){d._hv&&d._id===b&&d._o.onNext(a),d._hv=!1}))},b.prototype.error=function(a){this._c.dispose(),this._o.onError(a),this._hv=!1,this._id++},b.prototype.completed=function(){this._c.dispose(),this._hv&&this._o.onNext(this._v),this._o.onCompleted(),this._hv=!1,this._id++},b}(Qc);Pc.debounce=function(){if(Xa(arguments[0]))return ya(this,arguments[0]);if("number"==typeof arguments[0])return new Tf(this,arguments[0],arguments[1]);throw new Error("Invalid arguments")},Pc.windowWithTime=function(a,b,c){var d,e=this;return null==b&&(d=a),sc(c)||(c=Ec),"number"==typeof b?d=b:sc(b)&&(d=a,c=b),new vg(function(b){function f(){var a=new kc,e=!1,g=!1;l.setDisposable(a),j===i?(e=!0,g=!0):i>j?e=!0:g=!0;var n=e?j:i,o=n-m;m=n,e&&(j+=d),g&&(i+=d),a.setDisposable(c.scheduleFuture(null,o,function(){if(g){var a=new zg;k.push(a),b.onNext(_b(a,h))}e&&k.shift().onCompleted(),f()}))}var g,h,i=d,j=a,k=[],l=new lc,m=0;return g=new cc(l),h=new oc(g),k.push(new zg),b.onNext(_b(k[0],h)),f(),g.add(e.subscribe(function(a){for(var b=0,c=k.length;c>b;b++)k[b].onNext(a)},function(a){for(var c=0,d=k.length;d>c;c++)k[c].onError(a);b.onError(a)},function(){for(var a=0,c=k.length;c>a;a++)k[a].onCompleted();b.onCompleted()})),h},e)},Pc.windowWithTimeOrCount=function(a,b,c){var d=this;return sc(c)||(c=Ec),new vg(function(e){function f(b){var d=new kc;g.setDisposable(d),d.setDisposable(c.scheduleFuture(null,a,function(){if(b===k){j=0;var a=++k;l.onCompleted(),l=new zg,e.onNext(_b(l,i)),f(a)}}))}var g=new lc,h=new cc(g),i=new oc(h),j=0,k=0,l=new zg;return e.onNext(_b(l,i)),f(0),h.add(d.subscribe(function(a){var c=0,d=!1;l.onNext(a),++j===b&&(d=!0,j=0,c=++k,l.onCompleted(),l=new zg,e.onNext(_b(l,i))),d&&f(c)},function(a){l.onError(a),e.onError(a)},function(){l.onCompleted(),e.onCompleted()})),i},d)},Pc.bufferWithTime=function(a,b,c){return this.windowWithTime(a,b,c).flatMap(O)},Pc.bufferWithTimeOrCount=function(a,b,c){return this.windowWithTimeOrCount(a,b,c).flatMap(O)};var Vf=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Wf(a,this._s))},b}(Wc),Wf=function(a){function b(b,c){this._o=b,this._s=c,this._l=c.now(),a.call(this)}return Zb(b,a),b.prototype.next=function(a){var b=this._s.now(),c=b-this._l;this._l=b,this._o.onNext({value:a,interval:c})},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Qc);Pc.timeInterval=function(a){return sc(a)||(a=Ec),new Vf(this,a)};var Xf=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Yf(a,this._s))},b}(Wc),Yf=function(a){function b(b,c){this._o=b,this._s=c,a.call(this)}return Zb(b,a),b.prototype.next=function(a){this._o.onNext({value:a,timestamp:this._s.now()})},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Qc);Pc.timestamp=function(a){return sc(a)||(a=Ec),new Xf(this,a)},Pc.sample=Pc.throttleLatest=function(a,b){return sc(b)||(b=Ec),"number"==typeof a?za(this,Sf(a,b)):za(this,a)};var Zf=Pa.TimeoutError=function(a){this.message=a||"Timeout has occurred",this.name="TimeoutError",Error.call(this)};Zf.prototype=Object.create(Error.prototype),Pc.timeout=function(){var a=arguments[0];if(a instanceof Date||"number"==typeof a)return Ba(this,a,arguments[1],arguments[2]);if(Vc.isObservable(a)||Xa(a))return Aa(this,a,arguments[1],arguments[2]);throw new Error("Invalid arguments")};var $f=function(a){function b(b,c,d,e,f,g){this._state=b,this._cndFn=c,this._itrFn=d,this._resFn=e,this._timeFn=f,this._s=g,this._first=!0,this._hasResult=!1,a.call(this)}function c(a,b){if(a._hasResult&&a._o.onNext(a._state),a._first)a._first=!1;else if(a._state=Za(a._itrFn)(a._state),a._state===Ya)return a._o.onError(a._state.e);if(a._hasResult=Za(a._cndFn)(a._state),a._hasResult===Ya)return a._o.onError(a._hasResult.e);if(a._hasResult){var c=Za(a._resFn)(a._state);if(c===Ya)return a._o.onError(c.e);var d=Za(a._timeFn)(a._state);if(d===Ya)return a._o.onError(d.e);b(a,d)}else a._o.onCompleted()}return Zb(b,a),b.prototype.subscribeCore=function(a){return this._o=a,this._s.scheduleRecursiveFuture(this,new Date(this._s.now()),c)},b}(Wc);Vc.generateWithAbsoluteTime=function(a,b,c,d,e,f){return sc(f)||(f=Ec),new $f(a,b,c,d,e,f)};var _f=function(a){function b(b,c,d,e,f,g){this._state=b,this._cndFn=c,this._itrFn=d,this._resFn=e,this._timeFn=f,this._s=g,this._first=!0,this._hasResult=!1,a.call(this)}function c(a,b){if(a._hasResult&&a._o.onNext(a._state),a._first)a._first=!1;else if(a._state=Za(a._itrFn)(a._state),a._state===Ya)return a._o.onError(a._state.e);if(a._hasResult=Za(a._cndFn)(a._state),a._hasResult===Ya)return a._o.onError(a._hasResult.e);if(a._hasResult){var c=Za(a._resFn)(a._state);if(c===Ya)return a._o.onError(c.e);var d=Za(a._timeFn)(a._state);if(d===Ya)return a._o.onError(d.e);b(a,d)}else a._o.onCompleted()}return Zb(b,a),b.prototype.subscribeCore=function(a){return this._o=a,this._s.scheduleRecursiveFuture(this,0,c)},b}(Wc);Vc.generateWithRelativeTime=function(a,b,c,d,e,f){return sc(f)||(f=Ec),new _f(a,b,c,d,e,f)};var ag=function(a){function b(b,c,d){this.source=b,this._dt=c,this._s=d,a.call(this)}function c(a,b){var c=b[0],d=b[1],e=b[2];e.setDisposable(c.subscribe(d))}return Zb(b,a),b.prototype.subscribeCore=function(a){var b=new lc;return b.setDisposable(this._s.scheduleFuture([this.source,a,b],this._dt,c)),b},b}(Wc);Pc.delaySubscription=function(a,b){return sc(b)||(b=Ec),new ag(this,a,b)};var bg=function(a){function b(b,c,d){this.source=b,this._d=c,this._s=d,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new cg(a,this))},b}(Wc),cg=function(a){function b(b,c){this._o=b,this._s=c._s,this._d=c._d,this._q=[],a.call(this)}return Zb(b,a),b.prototype.next=function(a){var b=this._s.now();for(this._q.push({interval:b,value:a});this._q.length>0&&b-this._q[0].interval>=this._d;)this._o.onNext(this._q.shift().value)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){for(var a=this._s.now();this._q.length>0&&a-this._q[0].interval>=this._d;)this._o.onNext(this._q.shift().value);this._o.onCompleted()},b}(Qc);Pc.skipLastWithTime=function(a,b){return sc(b)||(b=Ec),new bg(this,a,b)};var dg=function(a){function b(b,c,d){this.source=b,this._d=c,this._s=d,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new eg(a,this._d,this._s))},b}(Wc),eg=function(a){function b(b,c,d){this._o=b,this._d=c,this._s=d,this._q=[],a.call(this)}return Zb(b,a),b.prototype.next=function(a){var b=this._s.now();for(this._q.push({interval:b,value:a});this._q.length>0&&b-this._q[0].interval>=this._d;)this._q.shift()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){for(var a=this._s.now();this._q.length>0;){var b=this._q.shift();a-b.interval<=this._d&&this._o.onNext(b.value)}this._o.onCompleted()},b}(Qc);Pc.takeLastWithTime=function(a,b){return sc(b)||(b=Ec),new dg(this,a,b)},Pc.takeLastBufferWithTime=function(a,b){var c=this;return sc(b)||(b=Ec),new vg(function(d){var e=[];return c.subscribe(function(c){var d=b.now();for(e.push({interval:d,value:c});e.length>0&&d-e[0].interval>=a;)e.shift()},function(a){d.onError(a)},function(){for(var c=b.now(),f=[];e.length>0;){var g=e.shift();c-g.interval<=a&&f.push(g.value)}d.onNext(f),d.onCompleted()})},c)};var fg=function(a){function b(b,c,d){this.source=b,this._d=c,this._s=d,a.call(this)}function c(a,b){b.onCompleted()}return Zb(b,a),b.prototype.subscribeCore=function(a){return new mc(this._s.scheduleFuture(a,this._d,c),this.source.subscribe(a))},b}(Wc);Pc.takeWithTime=function(a,b){return sc(b)||(b=Ec),new fg(this,a,b)};var gg=function(a){function b(b,c,d){this.source=b,this._d=c,this._s=d,this._open=!1,a.call(this)}function c(a,b){b._open=!0}return Zb(b,a),b.prototype.subscribeCore=function(a){return new mc(this._s.scheduleFuture(this,this._d,c),this.source.subscribe(new hg(a,this)))},b}(Wc),hg=function(a){function b(b,c){this._o=b,this._p=c,a.call(this)}return Zb(b,a),b.prototype.next=function(a){this._p._open&&this._o.onNext(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Qc);Pc.skipWithTime=function(a,b){return sc(b)||(b=Ec),
6new gg(this,a,b)};var ig=function(a){function b(b,c,d){this.source=b,this._st=c,this._s=d,a.call(this)}function c(a,b){b._open=!0}return Zb(b,a),b.prototype.subscribeCore=function(a){return this._open=!1,new mc(this._s.scheduleFuture(this,this._st,c),this.source.subscribe(new jg(a,this)))},b}(Wc),jg=function(a){function b(b,c){this._o=b,this._p=c,a.call(this)}return Zb(b,a),b.prototype.next=function(a){this._p._open&&this._o.onNext(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Qc);Pc.skipUntilWithTime=function(a,b){return sc(b)||(b=Ec),new ig(this,a,b)},Pc.takeUntilWithTime=function(a,b){sc(b)||(b=Ec);var c=this;return new vg(function(d){return new mc(b.scheduleFuture(d,a,function(a,b){b.onCompleted()}),c.subscribe(d))},c)},Pc.throttle=function(a,b){sc(b)||(b=Ec);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new vg(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},function(b){a.onError(b)},function(){a.onCompleted()})},d)};var kg=function(a){function b(b){this.source=b,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){var b=new kc,c=new cc,d={hasCurrent:!1,isStopped:!1,o:a,g:c};return c.add(b),b.setDisposable(this.source.subscribe(new lg(d))),c},b}(Wc),lg=function(a){function b(b){this._s=b,a.call(this)}function c(b,c){this._s=b,this._i=c,a.call(this)}return Zb(b,a),b.prototype.next=function(a){if(!this._s.hasCurrent){this._s.hasCurrent=!0,Wa(a)&&(a=gd(a));var b=new kc;this._s.g.add(b),b.setDisposable(a.subscribe(new c(this._s,b)))}},b.prototype.error=function(a){this._s.o.onError(a)},b.prototype.completed=function(){this._s.isStopped=!0,!this._s.hasCurrent&&1===this._s.g.length&&this._s.o.onCompleted()},Zb(c,a),c.prototype.next=function(a){this._s.o.onNext(a)},c.prototype.error=function(a){this._s.o.onError(a)},c.prototype.completed=function(){this._s.g.remove(this._i),this._s.hasCurrent=!1,this._s.isStopped&&1===this._s.g.length&&this._s.o.onCompleted()},b}(Qc);Pc.switchFirst=function(){return new kg(this)},Pc.flatMapFirst=Pc.selectManyFirst=function(a,b,c){return new Xc(this,a,b,c).switchFirst()},Pa.Observable.prototype.flatMapWithMaxConcurrent=function(a,b,c,d){return new Xc(this,b,c,d).merge(a)};var mg=function(a){function b(b,c){this._o=b,this._xform=c,a.call(this)}return Zb(b,a),b.prototype.next=function(a){var b=Za(this._xform["@@transducer/step"]).call(this._xform,this._o,a);b===Ya&&this._o.onError(b.e)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._xform["@@transducer/result"](this._o)},b}(Qc);Pc.transduce=function(a){var b=this;return new vg(function(c){var d=a(Ca(c));return b.subscribe(new mg(c,d))},b)};var ng=Pa.VirtualTimeScheduler=function(a){function b(b,c){this.clock=b,this.comparer=c,this.isEnabled=!1,this.queue=new ac(1024),a.call(this)}Zb(b,a);var c=b.prototype;return c.now=function(){return this.toAbsoluteTime(this.clock)},c.schedule=function(a,b){return this.scheduleAbsolute(a,this.clock,b)},c.scheduleFuture=function(a,b,c){var d=b instanceof Date?this.toRelativeTime(b-this.now()):this.toRelativeTime(b);return this.scheduleRelative(a,d,c)},c.add=lb,c.toAbsoluteTime=lb,c.toRelativeTime=lb,c.schedulePeriodic=function(a,b,c){var d=new vc(this,a,b,c);return d.start()},c.scheduleRelative=function(a,b,c){var d=this.add(this.clock,b);return this.scheduleAbsolute(a,d,c)},c.start=function(){if(!this.isEnabled){this.isEnabled=!0;do{var a=this.getNext();null!==a?(this.comparer(a.dueTime,this.clock)>0&&(this.clock=a.dueTime),a.invoke()):this.isEnabled=!1}while(this.isEnabled)}},c.stop=function(){this.isEnabled=!1},c.advanceTo=function(a){var b=this.comparer(this.clock,a);if(this.comparer(this.clock,a)>0)throw new ib;if(0!==b&&!this.isEnabled){this.isEnabled=!0;do{var c=this.getNext();null!==c&&this.comparer(c.dueTime,a)<=0?(this.comparer(c.dueTime,this.clock)>0&&(this.clock=c.dueTime),c.invoke()):this.isEnabled=!1}while(this.isEnabled);this.clock=a}},c.advanceBy=function(a){var b=this.add(this.clock,a),c=this.comparer(this.clock,b);if(c>0)throw new ib;0!==c&&this.advanceTo(b)},c.sleep=function(a){var b=this.add(this.clock,a);if(this.comparer(this.clock,b)>=0)throw new ib;this.clock=b},c.getNext=function(){for(;this.queue.length>0;){var a=this.queue.peek();if(!a.isCancelled())return a;this.queue.dequeue()}return null},c.scheduleAbsolute=function(a,b,c){function d(a,b){return e.queue.remove(f),c(a,b)}var e=this,f=new pc(this,a,d,b,this.comparer);return this.queue.enqueue(f),f.disposable},b}(qc);Pa.HistoricalScheduler=function(a){function b(b,c){var d=null==b?0:b,e=c||Ua;a.call(this,d,e)}Zb(b,a);var c=b.prototype;return c.add=function(a,b){return a+b},c.toAbsoluteTime=function(a){return new Date(a).getTime()},c.toRelativeTime=function(a){return a},b}(Pa.VirtualTimeScheduler),Da.prototype.equals=function(a){return a===this?!0:null==a?!1:"N"!==a.kind?!1:this.predicate(a.value)},Ea.prototype.equals=function(a){return a===this?!0:null==a?!1:"E"!==a.kind?!1:this.predicate(a.error)};var og=Pa.ReactiveTest={created:100,subscribed:200,disposed:1e3,onNext:function(a,b){return"function"==typeof b?new pg(a,new Da(b)):new pg(a,Gc.createOnNext(b))},onError:function(a,b){return"function"==typeof b?new pg(a,new Ea(b)):new pg(a,Gc.createOnError(b))},onCompleted:function(a){return new pg(a,Gc.createOnCompleted())},subscribe:function(a,b){return new qg(a,b)}},pg=Pa.Recorded=function(a,b,c){this.time=a,this.value=b,this.comparer=c||Ta};pg.prototype.equals=function(a){return this.time===a.time&&this.comparer(this.value,a.value)},pg.prototype.toString=function(){return this.value.toString()+"@"+this.time};var qg=Pa.Subscription=function(a,b){this.subscribe=a,this.unsubscribe=b||Number.MAX_VALUE};qg.prototype.equals=function(a){return this.subscribe===a.subscribe&&this.unsubscribe===a.unsubscribe},qg.prototype.toString=function(){return"("+this.subscribe+", "+(this.unsubscribe===Number.MAX_VALUE?"Infinite":this.unsubscribe)+")"};var rg=Pa.MockDisposable=function(a){this.scheduler=a,this.disposes=[],this.disposes.push(this.scheduler.clock)};rg.prototype.dispose=function(){this.disposes.push(this.scheduler.clock)};var sg=function(a){function b(b){a.call(this),this.scheduler=b,this.messages=[]}Zb(b,a);var c=b.prototype;return c.onNext=function(a){this.messages.push(new pg(this.scheduler.clock,Gc.createOnNext(a)))},c.onError=function(a){this.messages.push(new pg(this.scheduler.clock,Gc.createOnError(a)))},c.onCompleted=function(){this.messages.push(new pg(this.scheduler.clock,Gc.createOnCompleted()))},b}(Nc);Fa.prototype.then=function(b,c){var d=this;this.subscriptions.push(new qg(this.scheduler.clock));var e,f=this.subscriptions.length-1,g=Pa.Observer.create(function(c){var h=b(c);if(h&&"function"==typeof h.then)e=h;else{var i=d.scheduler.clock;e=new Fa(d.scheduler,[Pa.ReactiveTest.onNext(i,a),Pa.ReactiveTest.onCompleted(i)])}var j=d.observers.indexOf(g);d.observers.splice(j,1),d.subscriptions[f]=new qg(d.subscriptions[f].subscribe,d.scheduler.clock)},function(a){c(a);var b=d.observers.indexOf(g);d.observers.splice(b,1),d.subscriptions[f]=new qg(d.subscriptions[f].subscribe,d.scheduler.clock)});return this.observers.push(g),e||new Fa(this.scheduler,this.messages)};var tg=function(a){function b(b,c){a.call(this);var d,e,f=this;this.scheduler=b,this.messages=c,this.subscriptions=[],this.observers=[];for(var g=0,h=this.messages.length;h>g;g++)d=this.messages[g],e=d.value,function(a){b.scheduleAbsolute(null,d.time,function(){for(var b=f.observers.slice(0),c=0,d=b.length;d>c;c++)a.accept(b[c]);return gc})}(e)}return Zb(b,a),b.prototype._subscribe=function(a){var b=this;this.observers.push(a),this.subscriptions.push(new qg(this.scheduler.clock));var c=this.subscriptions.length-1;return fc(function(){var d=b.observers.indexOf(a);b.observers.splice(d,1),b.subscriptions[c]=new qg(b.subscriptions[c].subscribe,b.scheduler.clock)})},b}(Vc),ug=function(a){function b(b,c){a.call(this),this.scheduler=b,this.messages=c,this.subscriptions=[]}return Zb(b,a),b.prototype._subscribe=function(a){var b,c,d=this;this.subscriptions.push(new qg(this.scheduler.clock));for(var e=this.subscriptions.length-1,f=new cc,g=0,h=this.messages.length;h>g;g++)b=this.messages[g],c=b.value,function(c){f.add(d.scheduler.scheduleRelative(null,b.time,function(){return c.accept(a),gc}))}(c);return fc(function(){d.subscriptions[e]=new qg(d.subscriptions[e].subscribe,d.scheduler.clock),f.dispose()})},b}(Vc);Pa.TestScheduler=function(a){function b(a,b){return a>b?1:b>a?-1:0}function c(){a.call(this,0,b)}return Zb(c,a),c.prototype.scheduleAbsolute=function(b,c,d){return c<=this.clock&&(c=this.clock+1),a.prototype.scheduleAbsolute.call(this,b,c,d)},c.prototype.add=function(a,b){return a+b},c.prototype.toAbsoluteTime=function(a){return new Date(a).getTime()},c.prototype.toRelativeTime=function(a){return a},c.prototype.startScheduler=function(a,b){b||(b={}),null==b.created&&(b.created=og.created),null==b.subscribed&&(b.subscribed=og.subscribed),null==b.disposed&&(b.disposed=og.disposed);var c,d,e=this.createObserver();return this.scheduleAbsolute(null,b.created,function(){return c=a(),gc}),this.scheduleAbsolute(null,b.subscribed,function(){return d=c.subscribe(e),gc}),this.scheduleAbsolute(null,b.disposed,function(){return d.dispose(),gc}),this.start(),e},c.prototype.createHotObservable=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new tg(this,a)},c.prototype.createColdObservable=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new ug(this,a)},c.prototype.createResolvedPromise=function(a,b){return new Fa(this,[Pa.ReactiveTest.onNext(a,b),Pa.ReactiveTest.onCompleted(a)])},c.prototype.createRejectedPromise=function(a,b){return new Fa(this,[Pa.ReactiveTest.onError(a,b)])},c.prototype.createObserver=function(){return new sg(this)},c}(ng);var vg=Pa.AnonymousObservable=function(a){function b(a){return a&&Xa(a.dispose)?a:Xa(a)?fc(a):gc}function c(a,c){var d=c[0],f=c[1],g=Za(f.__subscribe).call(f,d);g!==Ya||d.fail(Ya.e)||e(Ya.e),d.setDisposable(b(g))}function d(b,c){this.source=c,this.__subscribe=b,a.call(this)}return Zb(d,a),d.prototype._subscribe=function(a){var b=new wg(a),d=[b,this];return zc.scheduleRequired()?zc.schedule(d,c):c(null,d),b},d}(Vc),wg=function(a){function b(b){a.call(this),this.observer=b,this.m=new kc}Zb(b,a);var c=b.prototype;return c.next=function(a){var b=Za(this.observer.onNext).call(this.observer,a);b===Ya&&(this.dispose(),e(b.e))},c.error=function(a){var b=Za(this.observer.onError).call(this.observer,a);this.dispose(),b===Ya&&e(b.e)},c.completed=function(){var a=Za(this.observer.onCompleted).call(this.observer);this.dispose(),a===Ya&&e(a.e)},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(Qc),xg=function(a){function b(b,c){this._m=b,this._u=c,a.call(this)}return Zb(b,a),b.prototype.subscribeCore=function(a){return new mc(this._m.getDisposable(),this._u.subscribe(a))},b}(Wc),yg=function(a){function b(b,c,d){a.call(this),this.key=b,this.underlyingObservable=d?new xg(d,c):c}return Zb(b,a),b.prototype._subscribe=function(a){return this.underlyingObservable.subscribe(a)},b}(Vc),zg=Pa.Subject=function(a){function b(){a.call(this),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return Zb(b,a),$b(b.prototype,Nc.prototype,{_subscribe:function(a){return ic(this),this.isStopped?this.hasError?(a.onError(this.error),gc):(a.onCompleted(),gc):(this.observers.push(a),new Df(this,a))},hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(ic(this),!this.isStopped){this.isStopped=!0;for(var a=0,b=c(this.observers),d=b.length;d>a;a++)b[a].onCompleted();this.observers.length=0}},onError:function(a){if(ic(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var b=0,d=c(this.observers),e=d.length;e>b;b++)d[b].onError(a);this.observers.length=0}},onNext:function(a){if(ic(this),!this.isStopped)for(var b=0,d=c(this.observers),e=d.length;e>b;b++)d[b].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),b.create=function(a,b){return new Bg(a,b)},b}(Vc),Ag=Pa.AsyncSubject=function(a){function b(){a.call(this),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return Zb(b,a),$b(b.prototype,Nc.prototype,{_subscribe:function(a){return ic(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),gc):(this.observers.push(a),new Df(this,a))},hasObservers:function(){return ic(this),this.observers.length>0},onCompleted:function(){var a,b;if(ic(this),!this.isStopped){this.isStopped=!0;var d=c(this.observers),b=d.length;if(this.hasValue)for(a=0;b>a;a++){var e=d[a];e.onNext(this.value),e.onCompleted()}else for(a=0;b>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(ic(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var b=0,d=c(this.observers),e=d.length;e>b;b++)d[b].onError(a);this.observers.length=0}},onNext:function(a){ic(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.error=null,this.value=null}}),b}(Vc),Bg=Pa.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this)}return Zb(b,a),$b(b.prototype,Nc.prototype,{_subscribe:function(a){return this.observable.subscribe(a)},onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(Vc),Cg=Pa.BehaviorSubject=function(a){function b(b){a.call(this),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.hasError=!1}return Zb(b,a),$b(b.prototype,Nc.prototype,{_subscribe:function(a){return ic(this),this.isStopped?(this.hasError?a.onError(this.error):a.onCompleted(),gc):(this.observers.push(a),a.onNext(this.value),new Df(this,a))},getValue:function(){return ic(this),this.hasError&&e(this.error),this.value},hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(ic(this),!this.isStopped){this.isStopped=!0;for(var a=0,b=c(this.observers),d=b.length;d>a;a++)b[a].onCompleted();this.observers.length=0}},onError:function(a){if(ic(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var b=0,d=c(this.observers),e=d.length;e>b;b++)d[b].onError(a);this.observers.length=0}},onNext:function(a){if(ic(this),!this.isStopped){this.value=a;for(var b=0,d=c(this.observers),e=d.length;e>b;b++)d[b].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.error=null}}),b}(Vc),Dg=Pa.ReplaySubject=function(a){function b(a,b){return fc(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(b,c,d){this.bufferSize=null==b?e:b,this.windowSize=null==c?e:c,this.scheduler=d||zc,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this)}var e=Math.pow(2,53)-1;return Zb(d,a),$b(d.prototype,Nc.prototype,{_subscribe:function(a){ic(this);var c=new Tc(this.scheduler,a),d=b(this,c);this._trim(this.scheduler.now()),this.observers.push(c);for(var e=0,f=this.q.length;f>e;e++)c.onNext(this.q[e].value);return this.hasError?c.onError(this.error):this.isStopped&&c.onCompleted(),c.ensureActive(),d},hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){if(ic(this),!this.isStopped){var b=this.scheduler.now();this.q.push({interval:b,value:a}),this._trim(b);for(var d=0,e=c(this.observers),f=e.length;f>d;d++){var g=e[d];g.onNext(a),g.ensureActive()}}},onError:function(a){if(ic(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var b=this.scheduler.now();this._trim(b);for(var d=0,e=c(this.observers),f=e.length;f>d;d++){var g=e[d];g.onError(a),g.ensureActive()}this.observers.length=0}},onCompleted:function(){if(ic(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var b=0,d=c(this.observers),e=d.length;e>b;b++){var f=d[b];f.onCompleted(),f.ensureActive()}this.observers.length=0}},dispose:function(){this.isDisposed=!0,this.observers=null}}),d}(Vc);Pa.Pauser=function(a){function b(){a.call(this)}return Zb(b,a),b.prototype.pause=function(){this.onNext(!1)},b.prototype.resume=function(){this.onNext(!0)},b}(zg),"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Oa.Rx=Pa,define(function(){return Pa})):Ha&&Ia?Ma?(Ia.exports=Pa).Rx=Pa:Ha.Rx=Pa:Oa.Rx=Pa;var Eg=j()}).call(this);
7//# sourceMappingURL=rx.all.compat.map
\No newline at end of file