Repository navigation
Expand file tree
/
Copy pathrx.all.min.js
More file actions
6 lines (6 loc) · 113 KB
/
Copy pathrx.all.min.js
File metadata and controls
6 lines (6 loc) · 113 KB
1
2
3
4
5
6
/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){function b(a){for(var b=[],c=0,d=a.length;d>c;c++)b.push(a[c]);return b}function c(a){return function(){try{return a.apply(this,arguments)}catch(b){return Sa.e=b,Sa}}}function d(a){throw a}function e(a,b){if(Ua&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(Ya)){for(var c=[],d=b;d;d=d.source)d.stack&&c.unshift(d.stack);c.unshift(a.stack);var e=c.join("\n"+Ya+"\n");a.stack=f(e)}}function f(a){for(var b=a.split("\n"),c=[],d=0,e=b.length;e>d;d++){var f=b[d];g(f)||h(f)||!f||c.push(f)}return c.join("\n")}function g(a){var b=j(a);if(!b)return!1;var c=b[0],d=b[1];return c===Wa&&d>=Xa&&be>=d}function h(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function i(){if(Ua)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=j(c);if(!d)return;return Wa=d[0],d[1]}}function j(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 k(a){var b=[];if(!Gb(a))return b;Fb.nonEnumArgs&&a.length&&Hb(a)&&(a=Jb.call(a));var c=Fb.enumPrototypes&&"function"==typeof a,d=Fb.enumErrorProps&&(a===zb||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Fb.nonEnumShadows&&a!==Ab){var f=a.constructor,g=-1,h=lb;if(a===(f&&f.prototype))var i=a===Bb?vb:a===zb?qb:wb.call(a),j=Eb[i];for(;++g<h;)e=kb[g],j&&j[e]||!xb.call(a,e)||b.push(e)}return b}function l(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function m(a,b){return l(a,b,k)}function n(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function o(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,f=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=f&&"object"!=f))return!1;var g=wb.call(a),h=wb.call(b);if(g==mb&&(g=tb),h==mb&&(h=tb),g!=h)return!1;switch(g){case ob:case pb:return+a==+b;case sb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case ub:case vb:return a==String(b)}var i=g==nb;if(!i){if(g!=tb||!Fb.nodeClass&&(n(a)||n(b)))return!1;var j=!Fb.argsObject&&Hb(a)?Object:a.constructor,k=!Fb.argsObject&&Hb(b)?Object:b.constructor;if(!(j==k||xb.call(a,"constructor")&&xb.call(b,"constructor")||Ra(j)&&j instanceof j&&Ra(k)&&k instanceof k||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var l=c.length;l--;)if(c[l]==a)return d[l]==b;var p=0,q=!0;if(c.push(a),d.push(b),i){if(l=a.length,p=b.length,q=p==l)for(;p--;){var r=b[p];if(!(q=o(a[p],r,c,d)))break}}else m(b,function(b,e,f){return xb.call(f,e)?(p++,q=xb.call(a,e)&&o(a[e],b,c,d)):void 0}),q&&m(a,function(a,b,c){return xb.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function p(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function q(a,b){this.id=a,this.value=b}function r(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function s(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function t(a){this._s=a}function u(a){this._s=a,this._l=a.length,this._i=0}function v(a){this._a=a}function w(a){this._a=a,this._l=A(a),this._i=0}function x(a){return"number"==typeof a&&Ia.isFinite(a)}function y(b){var c,d=b[eb];if(!d&&"string"==typeof b)return c=new t(b),c[eb]();if(!d&&b.length!==a)return c=new v(b),c[eb]();if(!d)throw new TypeError("Object is not iterable");return b[eb]()}function z(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function A(a){var b=+a.length;return isNaN(b)?0:0!==b&&x(b)?(b=z(b)*Math.floor(Math.abs(b)),0>=b?0:b>Qc?Qc:b):b}function B(a,b){this.observer=a,this.parent=b}function C(a,b){return ac(a)||(a=fc),new Sc(b,a)}function D(a,b){this.observer=a,this.parent=b}function E(a,b){this.observer=a,this.parent=b}function F(a,b){return a.amb(b)}function G(a,b){return new Xd(function(c){var d=new Wb,e=new Xb;return e.setDisposable(d),d.setDisposable(a.subscribe(new cd(c,e,b))),e},a)}function H(){return!1}function I(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function H(){return!1}function H(){return!1}function J(){return[]}function I(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function H(){return!1}function J(){return[]}function I(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function K(a){return function(b){return a.subscribe(b)}}function L(a){return a.toArray()}function M(a){return a.length>0}function N(a,b){this.o=a,this.accumulator=b.accumulator,this.hasSeed=b.hasSeed,this.seed=b.seed,this.hasAccumulation=!1,this.accumulation=null,this.hasValue=!1,this.isStopped=!1}function O(a,b,c){var d=jb(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return Qa(e)&&(e=Ic(e)),(hb(e)||gb(e))&&(e=Rc(e)),e}).concatAll()}function P(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function Q(a){this.comparer=a,this.set=[]}function R(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 S(a,b,c){return new Xd(function(d){var e=!1,f=null,g=[];return a.subscribe(function(a){var h,i;try{i=b(a)}catch(j){return void d.onError(j)}if(h=0,e)try{h=c(i,f)}catch(k){return void d.onError(k)}else e=!0,f=i;h>0&&(f=i,g=[]),h>=0&&g.push(a)},function(a){d.onError(a)},function(){d.onNext(g),d.onCompleted()})},a)}function T(a){if(0===a.length)throw new Za;return a[0]}function U(b,c,d,e){var f=jb(c,d,3);return new Xd(function(c){var d=0;return b.subscribe(function(a){var g;try{g=f(a,d,b)}catch(h){return void c.onError(h)}g?(c.onNext(e?d:a),c.onCompleted()):d++},function(a){c.onError(a)},function(){c.onNext(e?-1:a),c.onCompleted()})},b)}function V(a){return a?xc.isObservable(a)?a:Qa(a)?xc.fromPromise(a):$(a)||Z(a)?Dd.call(this,a):Ra(a)?Y.call(this,a):hb(a)||gb(a)?W.call(this,a):Gb(a)?X.call(this,a):a:a}function W(a){return xc.from(a).flatMap(V).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&&xc.isObservable(j)?c(j,i):d[i]=b[i]}return xc.forkJoin.apply(xc,f).map(function(){return d})}function Y(a){var b=this;return new Xd(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 Ra(a.next)&&Ra(a["throw"])}function $(a){var b=a.constructor;return b?"GeneratorFunction"===b.name||"GeneratorFunction"===b.displayName?!0:Z(b.prototype):!1}function _(a,b,c,d){var e=new _d;return d.push(aa(e,b,c)),a.apply(b,d),e.asObservable()}function aa(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];if(Ra(c)){if(e=Ta(c).apply(b,e),e===Sa)return a.onError(e.e);a.onNext(e)}else e.length<=1?a.onNext(e[0]):a.onNext(e);a.onCompleted()}}function ba(a,b,c,d){var e=new _d;return d.push(ca(e,b,c)),a.apply(b,d),e.asObservable()}function ca(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(Ra(c)){var f=Ta(c).apply(b,f);if(f===Sa)return a.onError(f.e);a.onNext(f)}else f.length<=1?a.onNext(f[0]):a.onNext(f);a.onCompleted()}}function da(a,b,c){this._e=a,this._n=b,this._fn=c,this._e.addEventListener(this._n,this._fn,!1),this.isDisposed=!1}function ea(a,b,c){var d=new Pb,e=Object.prototype.toString.call(a);if("[object NodeList]"===e||"[object HTMLCollection]"===e)for(var f=0,g=a.length;g>f;f++)d.add(ea(a.item(f),b,c));else a&&d.add(new da(a,b,c));return d}function fa(a,b){return function(){var c=arguments[0];return Ra(b)&&(c=Ta(b).apply(null,arguments),c===Sa)?a.onError(c.e):void a.onNext(c)}}function ga(a,b,c){return new Xd(function(d){function e(a,b){if(j[b]=a,g[b]=!0,h||(h=g.every(La))){if(f)return d.onError(f);var e=Ta(c).apply(null,j);if(e===Sa)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 Pb(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 L(a){return a.toArray()}function ha(a,b){return a.groupJoin(this,b,Nc,function(a,b){return b})}function ia(a){var b=this;return new Xd(function(c){var d=new $d,e=new Pb,f=new Yb(e);return c.onNext(Mb(d,f)),e.add(b.subscribe(function(a){d.onNext(a)},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),Qa(a)&&(a=Ic(a)),e.add(a.subscribe(function(a){d.onCompleted(),d=new $d,c.onNext(Mb(d,f))},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),f},b)}function ja(a){var b=this;return new Xd(function(c){function d(){var b;try{b=a()}catch(f){return void c.onError(f)}Qa(b)&&(b=Ic(b));var i=new Wb;e.setDisposable(i),i.setDisposable(b.take(1).subscribe(Ka,function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),h=new $d,c.onNext(Mb(h,g)),d()}))}var e=new Xb,f=new Pb(e),g=new Yb(f),h
8000
=new $d;return c.onNext(Mb(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 ka(a,b){return new Qd(a,b)}function la(a){this.patterns=a}function ma(a,b){this.expression=a,this.selector=b}function na(a,b,c){var d=a.get(b);if(!d){var e=new Ud(b,c);return a.set(b,e),e}return d}function oa(a,b,c){this.joinObserverArray=a,this. Td;for(var d=0,e=this.joinObserverArray.length;e>d;d++){var f=this.joinObserverArray[d];this.joinObservers.set(f,f)}}function pa(a,b){return new Xd(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function qa(a,b,c){return new Xd(function(d){var e=a,f=_b(b);return c.scheduleRecursiveWithAbsoluteAndState(0,e,function(a,b){if(f>0){var g=c.now();e+=f,g>=e&&(e=g+f)}d.onNext(a),b(a+1,e)})})}function ra(a,b){return new Xd(function(c){return b.scheduleWithRelative(_b(a),function(){c.onNext(0),c.onCompleted()})})}function sa(a,b,c){return a===b?new Xd(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):Kc(function(){return qa(c.now()+a,b,c)})}function ta(a,b,c){return new Xd(function(d){var e,f=!1,g=new Xb,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.exception,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new Wb,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveWithRelative(b,function(a){var b,e,g,k;if(null===h){j=!0;do g=null,i.length>0&&i[0].timestamp-c.now()<=0&&(g=i.shift().value),null!==g&&g.accept(d);while(null!==g);k=!1,e=0,i.length>0?(k=!0,e=Math.max(0,i[0].timestamp-c.now())):f=!1,b=h,j=!1,null!==b?d.onError(b):k&&a(e)}}))))}),new Pb(e,g)},a)}function ua(a,b,c){return Kc(function(){return ta(a,b-c.now(),c)})}function va(a,b,c){var d,e;return Ra(b)?e=b:(d=b,e=c),new Xd(function(b){function c(){i.setDisposable(a.subscribe(function(a){var c=Ta(e)(a);if(c===Sa)return b.onError(c.e);var d=new Wb;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 Pb,h=!1,i=new Xb;return d?i.setDisposable(d.subscribe(c,function(a){b.onError(a)},c)):c(),new Pb(i,g)},this)}function wa(a,b,c){return ac(c)||(c=jc),new Xd(function(d){var e,f=new Xb,g=!1,h=0,i=a.subscribe(function(a){g=!0,e=a,h++;var i=h,j=new Wb;f.setDisposable(j),j.setDisposable(c.scheduleWithRelative(b,function(){g&&h===i&&d.onNext(e),g=!1}))},function(a){f.dispose(),d.onError(a),g=!1,h++},function(){f.dispose(),g&&d.onNext(e),d.onCompleted(),g=!1,h++});return new Pb(i,f)},this)}function xa(a,b){return new Xd(function(c){var d,e=!1,f=new Xb,g=0,h=a.subscribe(function(a){var h=Ta(b)(a);if(h===Sa)return c.onError(h.e);Qa(h)&&(h=Ic(h)),e=!0,d=a,g++;var i=g,j=new Wb;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 Pb(h,f)},a)}function L(a){return a.toArray()}function L(a){return a.toArray()}function ya(a,b){return new Xd(function(c){function d(){g&&(g=!1,c.onNext(e)),f&&c.onCompleted()}var e,f=!1,g=!1,h=new Wb;return h.setDisposable(a.subscribe(function(a){g=!0,e=a},function(a){c.onError(a)},function(){f=!0,h.dispose()})),new Pb(h,b.subscribe(d,function(a){c.onError(a)},d))},a)}function za(a,b,c,d){return Ra(b)&&(d=c,c=b,b=Wc()),d||(d=bd(new Wd)),new Xd(function(e){function f(a){var b=k,c=new Wb;i.setDisposable(c),c.setDisposable(a.subscribe(function(){k===b&&h.setDisposable(d.subscribe(e)),c.dispose()},function(a){k===b&&e.onError(a)},function(){k===b&&h.setDisposable(d.subscribe(e))}))}function g(){var a=!l;return a&&k++,a}var h=new Xb,i=new Xb,j=new Wb;h.setDisposable(j);var k=0,l=!1;return f(b),j.setDisposable(a.subscribe(function(a){if(g()){e.onNext(a);var b=Ta(c)(a);if(b===Sa)return e.onError(b.e);f(Qa(b)?Ic(b):b)}},function(a){g()&&e.onError(a)},function(){g()&&e.onCompleted()})),new Pb(h,i)},a)}function Aa(a,b,c,d){if(null==c)throw new Error("other or scheduler must be specified");ac(c)&&(d=c,c=bd(new Wd)),c instanceof Error&&(c=bd(c)),ac(d)||(d=jc);var e=b instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Xd(function(f){function g(){var a=h;l.setDisposable(d[e](b,function(){h===a&&(Qa(c)&&(c=Ic(c)),j.setDisposable(c.subscribe(f)))}))}var h=0,i=new Wb,j=new Xb,k=!1,l=new Xb;return j.setDisposable(i),g(),i.setDisposable(a.subscribe(function(a){k||(h++,f.onNext(a),g())},function(a){k||(h++,f.onError(a))},function(){k||(h++,f.onCompleted())})),new Pb(j,l)},a)}var Ba={"function":!0,object:!0},Ca=Ba[typeof exports]&&exports&&!exports.nodeType&&exports,Da=Ba[typeof self]&&self.Object&&self,Ea=Ba[typeof window]&&window&&window.Object&&window,Fa=Ba[typeof module]&&module&&!module.nodeType&&module,Ga=Fa&&Fa.exports===Ca&&Ca,Ha=Ca&&Fa&&"object"==typeof global&&global&&global.Object&&global,Ia=Ia=Ha||Ea!==(this&&this.window)&&Ea||Da||this,Ja={internals:{},config:{Promise:Ia.Promise},helpers:{}},Ka=Ja.helpers.noop=function(){},La=Ja.helpers.identity=function(a){return a},Ma=Ja.helpers.defaultNow=Date.now,Na=Ja.helpers.defaultComparer=function(a,b){return Ib(a,b)},Oa=Ja.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},Pa=(Ja.helpers.defaultKeySerializer=function(a){return a.toString()},Ja.helpers.defaultError=function(a){throw a}),Qa=Ja.helpers.isPromise=function(a){return!!a&&"function"!=typeof a.subscribe&&"function"==typeof a.then},Ra=Ja.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==wb.call(a)}),a}(),Sa={e:{}},Ta=Ja.internals.tryCatch=function(a){if(!Ra(a))throw new TypeError("fn must be a function");return c(a)};Ja.config.longStackSupport=!1;var Ua=!1,Va=Ta(function(){throw new Error})();Ua=!!Va.e&&!!Va.e.stack;var Wa,Xa=i(),Ya="From previous event:",Za=Ja.EmptyError=function(){this.message="Sequence contains no elements.",this.name="EmptyError",Error.call(this)};Za.prototype=Object.create(Error.prototype);var $a=Ja.ObjectDisposedError=function(){this.message="Object has been disposed",this.name="ObjectDisposedError",Error.call(this)};$a.prototype=Object.create(Error.prototype);var _a=Ja.ArgumentOutOfRangeError=function(){this.message="Argument out of range",this.name="ArgumentOutOfRangeError",Error.call(this)};_a.prototype=Object.create(Error.prototype);var ab=Ja.NotSupportedError=function(a){this.message=a||"This operation is not supported",this.name="NotSupportedError",Error.call(this)};ab.prototype=Object.create(Error.prototype);var bb=Ja.NotImplementedError=function(a){this.message=a||"This operation is not implemented",this.name="NotImplementedError",Error.call(this)};bb.prototype=Object.create(Error.prototype);var cb=Ja.helpers.notImplemented=function(){throw new bb},db=Ja.helpers.notSupported=function(){throw new ab},eb="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";Ia.Set&&"function"==typeof(new Ia.Set)["@@iterator"]&&(eb="@@iterator");var fb=Ja.doneEnumerator={done:!0,value:a},gb=Ja.helpers.isIterable=function(b){return b[eb]!==a},hb=Ja.helpers.isArrayLike=function(b){return b&&b.length!==a};Ja.helpers.iterator=eb;var ib,jb=Ja.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)}},kb=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],lb=kb.length,mb="[object Arguments]",nb="[object Array]",ob="[object Boolean]",pb="[object Date]",qb="[object Error]",rb="[object Function]",sb="[object Number]",tb="[object Object]",ub="[object RegExp]",vb="[object String]",wb=Object.prototype.toString,xb=Object.prototype.hasOwnProperty,yb=wb.call(arguments)==mb,zb=Error.prototype,Ab=Object.prototype,Bb=String.prototype,Cb=Ab.propertyIsEnumerable;try{ib=!(wb.call(document)==tb&&!({toString:0}+""))}catch(Db){ib=!0}var Eb={};Eb[nb]=Eb[pb]=Eb[sb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Eb[ob]=Eb[vb]={constructor:!0,toString:!0,valueOf:!0},Eb[qb]=Eb[rb]=Eb[ub]={constructor:!0,toString:!0},Eb[tb]={constructor:!0};var Fb={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);Fb.enumErrorProps=Cb.call(zb,"message")||Cb.call(zb,"name"),Fb.enumPrototypes=Cb.call(a,"prototype"),Fb.nonEnumArgs=0!=c,Fb.nonEnumShadows=!/valueOf/.test(b)}(1);var Gb=Ja.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},Hb=function(a){return a&&"object"==typeof a?wb.call(a)==mb:!1};yb||(Hb=function(a){return a&&"object"==typeof a?xb.call(a,"callee"):!1});var Ib=Ja.internals.isEqual=function(a,b){return o(a,b,[],[])},Jb=({}.hasOwnProperty,Array.prototype.slice),Kb=Ja.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},Lb=Ja.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]}},Mb=Ja.internals.addRef=function(a,b){return new Xd(function(c){return new Pb(b.getDisposable(),a.subscribe(c))})};q.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Nb=Ja.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Ob=Nb.prototype;Ob.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Ob.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)}}},Ob.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)}}},Ob.peek=function(){return this.items[0].value},Ob.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},Ob.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Ob.enqueue=function(a){var b=this.length++;this.items[b]=new q(Nb.count++,a),this.percolate(b)},Ob.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Nb.count=0;var Pb=Ja.CompositeDisposable=function(){var a,b,c=[];if(Array.isArray(arguments[0]))c=arguments[0],b=c.length;else for(b=arguments.length,c=new Array(b),a=0;b>a;a++)c[a]=arguments[a];for(a=0;b>a;a++)if(!Ub(c[a]))throw new TypeError("Not a disposable");this.disposables=c,this.isDisposed=!1,this.length=c.length},Qb=Pb.prototype;Qb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Qb.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},Qb.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 Rb=Ja.Disposable=function(a){this.isDisposed=!1,this.action=a||Ka};Rb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Sb=Rb.create=function(a){return new Rb(a)},Tb=Rb.empty={dispose:Ka},Ub=Rb.isDisposable=function(a){return a&&Ra(a.dispose)},Vb=Rb.checkDisposed=function(a){if(a.isDisposed)throw new $a},Wb=Ja.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null};Wb.prototype.getDisposable=function(){return this.current},Wb.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()},Wb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var Xb=Ja.SerialDisposable=function(){this.isDisposed=!1,this.current=null};Xb.prototype.getDisposable=function(){return this.current},Xb.prototype.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},Xb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var Yb=Ja.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?Tb:new a(this)},b}();r.prototype.dispose=function(){this.scheduler.scheduleWithState(this,s)};var Zb=Ja.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||Oa,this.disposable=new Wb};Zb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Zb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Zb.prototype.isCancelled=function(){return this.disposable.isDisposed},Zb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var $b=Ja.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Tb}a.isScheduler=function(b){return b instanceof a};var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=Ma,a.normalize=function(a){return 0>a&&(a=0),a},a}(),_b=$b.normalize,ac=$b.isScheduler;!function(a){function b(a,b){function c(b){function d(a,b){return g?f.remove(i):h=!0,e(b,c),Tb}var g=!1,h=!1,i=a.scheduleWithState(b,d);h||(f.add(i),g=!0)}var d=b[0],e=b[1],f=new Pb;return e(d,c),f}function c(a,b,c){function d(b,e){function h(a,b){return i?g.remove(k):j=!0,f(b,d),Tb}var i=!1,j=!1,k=a[c](b,e,h);j||(g.add(k),i=!0)}var e=b[0],f=b[1],g=new Pb;return f(e,d),g}function d(a,b){return c(a,b,"scheduleWithRelativeAndState")}function e(a,b){return c(a,b,"scheduleWithAbsoluteAndState")}function f(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,f)},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState([a,c],b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,f)},a.scheduleRecursiveWithRelativeAndState=function(a,b,c){return this._scheduleRelative([a,c],b,d)},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,f)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute([a,c],b,e)}}($b.prototype),function(a){$b.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},$b.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof Ia.setInterval)throw new ab;b=_b(b);var d=a,e=Ia.setInterval(function(){d=c(d)},b);return Sb(function(){Ia.clearInterval(e)})}}($b.prototype),function(a){a.catchError=a["catch"]=function(a){return new kc(this,a)}}($b.prototype);var bc,cc,dc=Ja.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}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 Wb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),ec=$b.immediate=function(){function a(a,b){return b(this,a)}return new $b(Ma,a,db,db)}(),fc=$b.currentThread=function(){function a(){for(;c.length>0;){var a=c.shift();!a.isCancelled()&&a.invoke()}}function b(b,e){var f=new Zb(this,b,e,this.now());if(c)c.push(f);else{c=[f];var g=Ta(a)();if(c=null,g===Sa)return d(g.e)}return f.disposable}var c,e=new $b(Ma,b,db,db);return e.scheduleRequired=function(){return!c},e}(),gc=function(){var a,b=Ka;if(Ia.setTimeout)a=Ia.setTimeout,b=Ia.clearTimeout;else{if(!Ia.WScript)throw new ab;a=function(a,b){Ia.WScript.Sleep(b),a()}}return{setTimeout:a,clearTimeout:b}}(),hc=gc.setTimeout,ic=gc.clearTimeout;!function(){function a(b){if(g)hc(function(){a(b)},0);else{var c=f[b];if(c){g=!0;var e=Ta(c)();if(cc(b),g=!1,e===Sa)return d(e.e)}}}function b(){if(!Ia.postMessage||Ia.importScripts)return!1;var a=!1,b=Ia.onmessage;return Ia. c(b){"string"==typeof b.data&&b.data.substring(0,j.length)===j&&a(b.data.substring(j.length))}var e=1,f={},g=!1;cc=function(a){delete f[a]};var h=RegExp("^"+String(wb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),i="function"==typeof(i=Ha&&Ga&&Ha.setImmediate)&&!h.test(i)&&i;if(Ra(i))bc=function(b){var c=e++;return f[c]=b,i(function(){a(c)}),c};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))bc=function(b){var c=e++;return f[c]=b,process.nextTick(function(){a(c)}),c};else if(b()){var j="ms.rx.schedule"+Math.random();Ia.addEventListener?Ia.addEventListener("message",c,!1):Ia.attachEvent?Ia.attachEvent("onmessage",c):Ia. b=e++;return f[b]=a,Ia.postMessage(j+currentId,"*"),b}}else if(Ia.MessageChannel){var k=new Ia.MessageChannel;k.port1. b=e++;return f[b]=a,k.port2.postMessage(b),b}}else bc="document"in Ia&&"onreadystatechange"in Ia.document.createElement("script")?function(b){var c=Ia.document.createElement("script"),d=e++;return f[d]=b,c. c=e++;return f[c]=b,hc(function(){a(c)},0),c}}();var jc=$b.timeout=$b["default"]=function(){function a(a,b){var c=this,d=new Wb,e=bc(function(){!d.isDisposed&&d.setDisposable(b(c,a))});return new Pb(d,Sb(function(){cc(e)}))}function b(a,b,c){var d=this,e=$b.normalize(b),f=new Wb;if(0===e)return d.scheduleWithState(a,c);var g=hc(function(){!f.isDisposed&&f.setDisposable(c(d,a))},e);return new Pb(f,Sb(function(){ic(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new $b(Ma,a,b,c)}(),kc=function(a){function b(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function c(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function d(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function e(e,f){this._scheduler=e,this._handler=f,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,this._scheduler.now.bind(this._scheduler),b,c,d)}return Kb(e,a),e.prototype._clone=function(a){return new e(a,this._handler)},e.prototype._wrap=function(a){var b=this;return function(c,d){try{return a(b._getRecursiveWrapper(c),d)}catch(e){if(!b._handler(e))throw e;return Tb}}},e.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},e.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new Wb;return f.setDisposable(this._scheduler.schedulePeriodicWithState(a,b,function(a){if(e)return null;try{return c(a)}catch(b){if(e=!0,!d._handler(b))throw b;return f.dispose(),null}})),f},e}($b),lc=Ja.Notification=function(){function a(a,b,c,d,e,f){this.kind=a,this.value=b,this.exception=c,this._accept=d,this._acceptObservable=e,this.toString=f}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return ac(a)||(a=ec),new Xd(function(c){return a.scheduleWithState(b,function(a,b){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),mc=lc.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){return new lc("N",d,null,a,b,c)}}(),nc=lc.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){return new lc("E",null,d,a,b,c)}}(),oc=lc.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){return new lc("C",null,null,a,b,c)}}(),pc=Ja.Observer=function(){};pc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},pc.prototype.asObserver=function(){var a=this;return new tc(function(b){a.onNext(b)},function(b){a.onError(b)},function(){a.onCompleted()})},pc.prototype.checked=function(){return new uc(this)};var qc=pc.create=function(a,b,c){return a||(a=Ka),b||(b=Pa),c||(c=Ka),new tc(a,b,c)};pc.fromNotifier=function(a,b){var c=jb(a,b,1);return new tc(function(a){return c(mc(a))},function(a){return c(nc(a))},function(){return c(oc())})},pc.prototype.notifyOn=function(a){return new wc(a,this)},pc.prototype.makeSafe=function(a){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,a)};var rc,sc=Ja.internals.AbstractObserver=function(a){function b(){this.isStopped=!1}return Kb(b,a),b.prototype.next=cb,b.prototype.error=cb,b.prototype.completed=cb,
b.prototype. this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(pc),tc=Ja.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Kb(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}(sc),uc=function(a){function b(b){a.call(this),this._observer=b,this._state=0}Kb(b,a);var c=b.prototype;return c. b=Ta(this._observer.onNext).call(this._observer,a);this._state=0,b===Sa&&d(b.e)},c. b=Ta(this._observer.onError).call(this._observer,a);this._state=2,b===Sa&&d(b.e)},c. a=Ta(this._observer.onCompleted).call(this._observer);this._state=2,a===Sa&&d(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}(pc),vc=Ja.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 Xb}return Kb(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},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.scheduleRecursiveWithState(this,function(a,b){var c;if(!(a.queue.length>0))return void(a.isAcquired=!1);c=a.queue.shift();var e=Ta(c)();return e===Sa?(a.queue=[],a.hasFaulted=!0,d(e.e)):void b(a)}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(sc),wc=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return Kb(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}(vc),xc=Ja.Observable=function(){function a(a,b){return function(c){var d=c.onError;return c. b(b){if(Ja.config.longStackSupport&&Ua){var c=Ta(d)(new Error).e;this.stack=c.stack.substring(c.stack.indexOf("\n")+1),this._subscribe=a(this,b)}else this._subscribe=b}return rc=b.prototype,b.isObservable=function(a){return a&&Ra(a.subscribe)},rc.subscribe=rc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:qc(a,b,c))},rc.subscribeOnNext=function(a,b){return this._subscribe(qc("undefined"!=typeof b?function(c){a.call(b,c)}:a))},rc.subscribeOnError=function(a,b){return this._subscribe(qc(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},rc.subscribeOnCompleted=function(a,b){return this._subscribe(qc(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},b}(),yc=Ja.ObservableBase=function(a){function b(a){return a&&Ra(a.dispose)?a:Ra(a)?Sb(a):Tb}function c(a,c){var e=c[0],f=c[1],g=Ta(f.subscribeCore).call(f,e);return g!==Sa||e.fail(Sa.e)?void e.setDisposable(b(g)):d(Sa.e)}function e(a){var b=new Yd(a),d=[b,this];return fc.scheduleRequired()?fc.scheduleWithState(d,c):c(null,d),b}function f(){a.call(this,e)}return Kb(f,a),f.prototype.subscribeCore=cb,f}(xc),zc=function(a){function b(b,c,d,e){this.resultSelector=Ja.helpers.isFunction(d)?d:null,this.selector=Ja.internals.bindCallback(Ja.helpers.isFunction(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.isStopped=!1,this.o=a}return Kb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.selector,this.resultSelector,this))},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. b=this.i++,c=Ta(this.selector)(a,b,this.source);if(c===Sa)return this.o.onError(c.e);Ja.helpers.isPromise(c)&&(c=Ja.Observable.fromPromise(c)),(Ja.helpers.isArrayLike(c)||Ja.helpers.isIterable(c))&&(c=Ja.Observable.from(c)),this.o.onNext(this._wrapResult(c,a,b))}},c.prototype. b(b){this.sources=b,a.call(this)}function c(a,b,c){this.o=a,this.s=b,this.e=c,this.isStopped=!1}return Kb(b,a),b.prototype.subscribeCore=function(a){var b,d=new Xb,e=ec.scheduleRecursiveWithState(this.sources[eb](),function(e,f){if(!b){var g=Ta(e.next).call(e);if(g===Sa)return a.onError(g.e);if(g.done)return a.onCompleted();var h=g.value;Qa(h)&&(h=Ic(h));var i=new Wb;d.setDisposable(i),i.setDisposable(h.subscribe(new c(a,f,e)))}});return new Pb(d,e,Sb(function(){b=!0}))},c.prototype. this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(yc);Ac.prototype.concat=function(){return new Bc(this)};var Cc=function(a){function b(b){this.sources=b,a.call(this)}return Kb(b,a),b.prototype.subscribeCore=function(a){var b,c=this.sources[eb](),d=new Xb,e=ec.scheduleRecursiveWithState(null,function(e,f){if(!b){var g=Ta(c.next).call(c);if(g===Sa)return a.onError(g.e);if(g.done)return null!==e?a.onError(e):a.onCompleted();var h=g.value;Qa(h)&&(h=Ic(h));var i=new Wb;d.setDisposable(i),i.setDisposable(h.subscribe(function(b){a.onNext(b)},f,function(){a.onCompleted()}))}});return new Pb(d,e,Sb(function(){b=!0}))},b}(yc);Ac.prototype.catchError=function(){return new Cc(this)},Ac.prototype.catchErrorWhen=function(a){var b=this;return new Xd(function(c){var d,e,f=new $d,g=new $d,h=a(f),i=h.subscribe(g),j=b[eb](),k=new Xb,l=ec.scheduleRecursive(function(a){if(!d){var b=Ta(j.next).call(j);if(b===Sa)return c.onError(b.e);if(b.done)return void(e?c.onError(e):c.onCompleted());var h=b.value;Qa(h)&&(h=Ic(h));var i=new Wb,l=new Wb;k.setDisposable(new Pb(l,i)),i.setDisposable(h.subscribe(function(a){c.onNext(a)},function(b){l.setDisposable(g.subscribe(a,function(a){c.onError(a)},function(){c.onCompleted()})),f.onNext(b)},function(){c.onCompleted()}))}});return new Pb(i,k,l,Sb(function(){d=!0}))})};var Dc=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 Kb(b,a),b.prototype[eb]=function(){return new c(this)},c.prototype.next=function(){return 0===this.l?fb:(this.l>0&&this.l--,{done:!1,value:this.v})},b}(Ac),Ec=Ac.repeat=function(a,b){return new Dc(a,b)},Fc=function(a){function b(a,b,c){this.s=a,this.fn=b?jb(b,c,3):null}function c(a){this.i=-1,this.s=a.s,this.l=this.s.length,this.fn=a.fn}return Kb(b,a),
8000
b.prototype[eb]=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]}:fb},b}(Ac),Gc=Ac.of=function(a,b,c){return new Fc(a,b,c)};rc.observeOn=function(a){var b=this;return new Xd(function(c){return b.subscribe(new wc(a,c))},b)},rc.subscribeOn=function(a){var b=this;return new Xd(function(c){var d=new Wb,e=new Xb;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new r(a,b.subscribe(c)))})),e},b)};var Hc=function(a){function b(b){this.p=b,a.call(this)}return Kb(b,a),b.prototype.subscribeCore=function(a){return this.p.then(function(b){a.onNext(b),a.onCompleted()},function(b){a.onError(b)}),Tb},b}(yc),Ic=xc.fromPromise=function(a){return new Hc(a)};rc.toPromise=function(a){if(a||(a=Ja.config.Promise),!a)throw new ab("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})};var Jc=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.a=[],this.isStopped=!1}return Kb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype. this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(yc);rc.toArray=function(){return new Jc(this)},xc.create=function(a,b){return new Xd(a,b)};var Kc=xc.defer=function(a){return new Xd(function(b){var c;try{c=a()}catch(d){return bd(d).subscribe(b)}return Qa(c)&&(c=Ic(c)),c.subscribe(b)})},Lc=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(),Tb}return Kb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this.scheduler);return b.run()},c.prototype.run=function(){return this.scheduler.scheduleWithState(this.observer,d)},b}(yc),Mc=new Lc(ec),Nc=xc.empty=function(a){return ac(a)||(a=ec),a===ec?Mc:new Lc(a)},Oc=function(a){function b(b,c,d){this.iterable=b,this.mapper=c,this.scheduler=d,a.call(this)}return Kb(b,a),b.prototype.subscribeCore=function(a){var b=new Pc(a,this);return b.run()},b}(yc),Pc=function(){function a(a,b){this.o=a,this.parent=b}return a.prototype.run=function(){function a(a,b){var f=Ta(c.next).call(c);if(f===Sa)return d.onError(f.e);if(f.done)return d.onCompleted();var g=f.value;return Ra(e)&&(g=Ta(e)(g,a),g===Sa)?d.onError(g.e):(d.onNext(g),void b(a+1))}var b=Object(this.parent.iterable),c=y(b),d=this.o,e=this.parent.mapper;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}(),Qc=Math.pow(2,53)-1;t.prototype[eb]=function(){return new u(this._s)},u.prototype[eb]=function(){return this},u.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:fb},v.prototype[eb]=function(){return new w(this._a)},w.prototype[eb]=function(){return this},w.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:fb};var Rc=xc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!Ra(b))throw new Error("mapFn when provided must be a function");if(b)var e=jb(b,c,2);return ac(d)||(d=fc),new Oc(a,e,d)},Sc=function(a){function b(b,c){this.args=b,this.scheduler=c,a.call(this)}return Kb(b,a),b.prototype.subscribeCore=function(a){var b=new B(a,this);return b.run()},b}(yc);B.prototype.run=function(){function a(a,e){d>a?(b.onNext(c[a]),e(a+1)):b.onCompleted()}var b=this.observer,c=this.parent.args,d=c.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)};var Tc=xc.fromArray=function(a,b){return ac(b)||(b=fc),new Sc(a,b)};xc.generate=function(a,b,c,d,e){return ac(e)||(e=fc),new Xd(function(f){var g=!0;return e.scheduleRecursiveWithState(a,function(a,e){var h,i;try{g?g=!1:a=c(a),h=b(a),h&&(i=d(a))}catch(j){return f.onError(j)}h?(f.onNext(i),e(a)):f.onCompleted()})})},xc.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new Sc(b,fc)},xc.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 Sc(c,a)},xc.ofArrayChanges=function(a){if(!Array.isArray(a))throw new TypeError("Array.observe only accepts arrays.");if("function"!=typeof Array.observe&&"function"!=typeof Array.unobserve)throw new TypeError("Array.observe is not supported on your platform");return new Xd(function(b){function c(a){for(var c=0,d=a.length;d>c;c++)b.onNext(a[c])}return Array.observe(a,c),function(){Array.unobserve(a,c)}})},xc.ofObjectChanges=function(a){if(null==a)throw new TypeError("object must not be null or undefined.");if("function"!=typeof Object.observe&&"function"!=typeof Object.unobserve)throw new TypeError("Object.observe is not supported on your platform");return new Xd(function(b){function c(a){for(var c=0,d=a.length;d>c;c++)b.onNext(a[c])}return Object.observe(a,c),function(){Object.unobserve(a,c)}})};var Uc=function(a){function b(){a.call(this)}return Kb(b,a),b.prototype.subscribeCore=function(a){return Tb},b}(yc),Vc=new Uc,Wc=xc.never=function(){return Vc},Xc=function(a){function b(b,c){this.obj=b,this.keys=Object.keys(b),this.scheduler=c,a.call(this)}return Kb(b,a),b.prototype.subscribeCore=function(a){var b=new D(a,this);return b.run()},b}(yc);D.prototype.run=function(){function a(a,f){if(e>a){var g=d[a];b.onNext([g,c[g]]),f(a+1)}else b.onCompleted()}var b=this.observer,c=this.parent.obj,d=this.parent.keys,e=d.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},xc.pairs=function(a,b){return b||(b=fc),new Xc(a,b)};var Yc=function(a){function b(b,c,d){this.start=b,this.rangeCount=c,this.scheduler=d,a.call(this)}return Kb(b,a),b.prototype.subscribeCore=function(a){var b=new Zc(a,this);return b.run()},b}(yc),Zc=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,e){c>a?(d.onNext(b+a),e(a+1)):d.onCompleted()}var b=this.parent.start,c=this.parent.rangeCount,d=this.observer;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}();xc.range=function(a,b,c){return ac(c)||(c=fc),new Yc(a,b,c)};var $c=function(a){function b(b,c,d){this.value=b,this.repeatCount=null==c?-1:c,this.scheduler=d,a.call(this)}return Kb(b,a),b.prototype.subscribeCore=function(a){var b=new E(a,this);return b.run()},b}(yc);E.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.scheduleRecursiveWithState(this.parent.repeatCount,a)},xc.repeat=function(a,b,c){return ac(c)||(c=fc),new $c(a,b,c)};var _c=function(a){function b(b,c){this.value=b,this.scheduler=c,a.call(this)}function c(a,b,c){this.observer=a,this.value=b,this.scheduler=c}function d(a,b){var c=b[0],d=b[1];return d.onNext(c),d.onCompleted(),Tb}return Kb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this.value,this.scheduler);return b.run()},c.prototype.run=function(){var a=[this.value,this.observer];return this.scheduler===ec?d(null,a):this.scheduler.scheduleWithState(a,d)},b}(yc),ad=(xc["return"]=xc.just=function(a,b){return ac(b)||(b=ec),new _c(a,b)},function(a){function b(b,c){this.error=b,this.scheduler=c,a.call(this)}function c(a,b){this.o=a,this.p=b}function d(a,b){var c=b[0],d=b[1];d.onError(c)}return Kb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.p.scheduler.scheduleWithState([this.p.error,this.o],d)},b}(yc)),bd=xc["throw"]=function(a,b){return ac(b)||(b=ec),new ad(a,b)};xc.using=function(a,b){return new Xd(function(c){var d=Tb,e=Ta(a)();if(e===Sa)return new Pb(bd(e.e).subscribe(c),d);e&&(d=e);var f=Ta(b)(e);return f===Sa?new Pb(bd(f.e).subscribe(c),d):new Pb(f.subscribe(c),d)})},rc.amb=function(a){var b=this;return new Xd(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new Wb,j=new Wb;Qa(a)&&(a=Ic(a));var k=qc(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()}),l=qc(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 Pb(i,j)})},xc.amb=function(){var a,b=Wc();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=F(b,a[d]);return b};var cd=function(a){function b(b,c,d){this._o=b,this._s=c,this._fn=d,a.call(this)}return Kb(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=Ta(this._fn)(a);if(b===Sa)return this._o.onError(b.e);Qa(b)&&(b=Ic(b));var c=new Wb;this._s.setDisposable(c),c.setDisposable(b.subscribe(this._o))},b}(sc);rc["catch"]=function(a){return Ra(a)?G(this,a):dd([this,a])};var dd=xc["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 Gc(a).catchError()};rc.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),ed.apply(this,b)};var ed=xc.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=Ra(b[a-1])?b.pop():I;return Array.isArray(b[0])&&(b=b[0]),new Xd(function(a){function c(b){if(g[b]=!0,h||(h=g.every(La))){try{var c=d.apply(null,j)}catch(e){return a.onError(e)}a.onNext(c)}else i.filter(function(a,c){return c!==b}).every(La)&&a.onCompleted()}function e(b){i[b]=!0,i.every(La)&&a.onCompleted()}for(var f=b.length,g=p(f,H),h=!1,i=p(f,H),j=new Array(f),k=new Array(f),l=0;f>l;l++)!function(d){var f=b[d],g=new Wb;Qa(f)&&(f=Ic(f)),g.setDisposable(f.subscribe(function(a){j[d]=a,c(d)},function(b){a.onError(b)},function(){e(d)})),k[d]=g}(l);return new Pb(k)},this)};rc.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),gd.apply(null,a)};var fd=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){this.sources=a,this.o=b}return Kb(b,a),b.prototype.subscribeCore=function(a){var b=new c(this.sources,a);return b.run()},c.prototype.run=function(){var a,b=new Xb,c=this.sources,d=c.length,e=this.o,f=ec.scheduleRecursiveWithState(0,function(f,g){if(!a){if(f===d)return e.onCompleted();var h=c[f];Qa(h)&&(h=Ic(h));var i=new Wb;b.setDisposable(i),i.setDisposable(h.subscribe(function(a){e.onNext(a)},function(a){e.onError(a)},function(){g(f+1)}))}});return new Pb(b,f,Sb(function(){a=!0}))},b}(yc),gd=xc.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 fd(a)};rc.concatAll=function(){return this.merge(1)};var hd=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return Kb(b,a),b.prototype.subscribeCore=function(a){var b=new Pb;return b.add(this.source.subscribe(new id(a,this.maxConcurrent,b))),b},b}(yc),id=function(){function a(a,b,c){this.o=a,this.max=b,this.g=c,this.done=!1,this.q=[],this.activeCount=0,this.isStopped=!1}function b(a,b){this.parent=a,this.sad=b,this.isStopped=!1}return a.prototype.handleSubscribe=function(a){var c=new Wb;this.g.add(c),Qa(a)&&(a=Ic(a)),c.setDisposable(a.subscribe(new b(this,c)))},a.prototype. this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype. a=this.parent;a.g.remove(this.sad),a.q.length>0?a.handleSubscribe(a.q.shift()):(a.activeCount--,a.done&&0===a.activeCount&&a.o.onCompleted())}},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},a}();rc.merge=function(a){return"number"!=typeof a?jd(this,a):new hd(this,a)};var jd=xc.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(ac(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=ec,b=0;d>b;b++)c.push(arguments[b]);else for(a=ec,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),C(a,c).mergeAll()},kd=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.g=b,this.isStopped=!1,this.done=!1}function d(a,b){this.parent=a,this.sad=b,this.isStopped=!1}return Kb(b,a),b.prototype.subscribeCore=function(a){var b=new Pb,d=new Wb;return b.add(d),d.setDisposable(this.source.subscribe(new c(a,b))),b},c.prototype. b=new Wb;this.g.add(b),Qa(a)&&(a=Ic(a)),b.setDisposable(a.subscribe(new d(this,b)))}},c.prototype. this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},d.prototype. a=this.parent;this.isStopped=!0,a.g.remove(this.sad),a.done&&1===a.g.length&&a.o.onCompleted()}},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},b}(yc);rc.mergeAll=function(){return new kd(this)};var ld=Ja.CompositeError=function(a){this.name="NotImplementedError",this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};ld.prototype=Error.prototype,xc.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=C(null,a);return new Xd(function(a){function b(){0===g.length?a.onCompleted():1===g.length?a.onError(g[0]):a.onError(new ld(g))}var c=new Pb,e=new Wb,f=!1,g=[];return c.add(e),e.setDisposable(d.subscribe(function(d){var e=new Wb;c.add(e),Qa(d)&&(d=Ic(d)),e.setDisposable(d.subscribe(function(b){a.onNext(b)},function(a){g.push(a),c.remove(e),f&&1===c.length&&b()},function(){c.remove(e),f&&1===c.length&&b()}))},function(a){g.push(a),f=!0,1===c.length&&b()},function(){f=!0,1===c.length&&b()})),c})},rc. new Error("Second observable is required");return md([this,a])};var md=xc. a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new Xd(function(b){var c=0,d=new Xb,e=ec.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],Qa(f)&&(f=Ic(f)),g=new Wb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new Pb(d,e)})};rc.skipUntil=function(a){var b=this;return new Xd(function(c){var d=!1,e=new Pb(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));Qa(a)&&(a=Ic(a));var f=new Wb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)};var nd=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,this.isStopped=!1}function d(a,b){this.parent=a,this.id=b,this.isStopped=!1}return Kb(b,a),b.prototype.subscribeCore=function(a){var b=new Xb,d=this.source.subscribe(new c(a,b));return new Pb(d,b)},c.prototype. b=new Wb,c=++this.latest;this.hasLatest=!0,this.inner.setDisposable(b),Qa(a)&&(a=Ic(a)),b.setDisposable(a.subscribe(new d(this,c)))}},c.prototype. this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},d.prototype. this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},b}(yc);rc["switch"]=rc.switchLatest=function(){return new nd(this)};var od=function(a){function b(b,c){this.source=b,this.other=Qa(c)?Ic(c):c,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return Kb(b,a),b.prototype.subscribeCore=function(a){return new Pb(this.source.subscribe(a),this.other.subscribe(new c(a)))},c.prototype. this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(yc);rc.takeUntil=function(a){return new od(this,a)},rc.withLatestFrom=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop(),e=this;return Array.isArray(b[0])&&(b=b[0]),new Xd(function(a){for(var c=b.length,f=p(c,H),g=!1,h=new Array(c),i=new Array(c+1),j=0;c>j;j++)!function(c){var d=b[c],e=new Wb;Qa(d)&&(d=Ic(d)),e.setDisposable(d.subscribe(function(a){h[c]=a,f[c]=!0,g=f.every(La)},function(b){a.onError(b)},Ka)),i[c]=e}(j);var k=new Wb;return k.setDisposable(e.subscribe(function(b){var c=[b].concat(h);if(g){var e=Ta(d).apply(null,c);return e===Sa?a.onError(e.e):void a.onNext(e)}},function(b){a.onError(b)},function(){a.onCompleted()})),i[c]=k,new Pb(i)},this)},rc.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=Ra(b[a-1])?b.pop():I;Array.isArray(b[0])&&(b=b[0]);var e=this;return b.unshift(e),new Xd(function(a){for(var c=b.length,f=p(c,J),g=p(c,H),h=new Array(c),i=0;c>i;i++)!function(c){var i=b[c],j=new Wb;Qa(i)&&(i=Ic(i)),j.setDisposable(i.subscribe(function(b){if(f[c].push(b),f.every(function(a){return a.length>0})){var h=f.map(function(a){return a.shift()}),i=Ta(d).apply(e,h);if(i===Sa)return a.onError(i.e);a.onNext(i)}else g.filter(function(a,b){return b!==c}).every(La)&&a.onCompleted()},function(b){a.onError(b)},function(){g[c]=!0,g.every(La)&&a.onCompleted()})),h[c]=j}(i);return new Pb(h)},e)},xc.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=Ra(b[1])?b[0].concat(b[1]):b[0]);var d=b.shift();return d.zip.apply(d,b)},rc.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=Ra(b[a-1])?b.pop():I,e=this;return b.unshift(e),new Xd(function(a){for(var c=b.length,f=p(c,J),g=p(c,H),h=new Array(c),i=0;c>i;i++)!function(c){var i=b[c],j=new Wb;(hb(i)||gb(i))&&(i=Rc(i)),j.setDisposable(i.subscribe(function(b){if(f[c].push(b),f.every(function(a){return a.length>0})){var h=f.map(function(a){return a.shift()}),i=Ta(d).apply(e,h);if(i===Sa)return a.onError(i.e);a.onNext(i)}else g.filter(function(a,b){return b!==c}).every(La)&&a.onCompleted()},function(b){a.onError(b)},function(){g[c]=!0,g.every(La)&&a.onCompleted()})),h[c]=j}(i);return new Pb(h)},e)},rc.asObservable=function(){return new Xd(K(this),this)},rc.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).flatMap(L).filter(M)},rc.dematerialize=function(){var a=this;return new Xd(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)};var pd=function(a){function b(b,c,d){this.source=b,this.keyFn=c,this.comparer=d,a.call(this)}return Kb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new qd(a,this.keyFn,this.comparer))},b}(yc),qd=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 Kb(b,a),b.prototype.next=function(a){var b,c=a;return Ra(this.keyFn)&&(c=Ta(this.keyFn)(a),c===Sa)?this.o.onError(c.e):this.hasCurrentKey&&(b=Ta(this.comparer)(this.currentKey,c),b===Sa)?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}(sc);rc.distinctUntilChanged=function(a,b){return b||(b=Na),new pd(this,a,b)};var rd=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||Ra(b._oN)?qc(b._oN||Ka,b._oE||Ka,b._oC||Ka):b._oN,this.isStopped=!1}return Kb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this))},c.prototype. b=Ta(this.t.onNext).call(this.t,a);b===Sa&&this.o.onError(b.e),this.o.onNext(a)}},c.prototype. b=Ta(this.t.onError).call(this.t,a);if(b===Sa)return this.o.onError(b.e);this.o.onError(a)}},c.prototype. a=Ta(this.t.onCompleted).call(this.t);if(a===Sa)return this.o.onError(a.e);this.o.onCompleted()}},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(yc);rc["do"]=rc.tap=rc.doAction=function(a,b,c){return new rd(this,a,b,c)},rc.doOnNext=rc.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},rc.doOnError=rc.tapOnError=function(a,b){return this.tap(Ka,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},rc.doOnCompleted=rc.tapOnCompleted=function(a,b){return this.tap(Ka,null,"undefined"!=typeof b?function(){a.call(b)}:a)},rc["finally"]=function(a){var b=this;return new Xd(function(c){var e=Ta(b.subscribe).call(b,c);return e===Sa?(a(),d(e.e)):Sb(function(){var b=Ta(e.dispose).call(e);a(),b===Sa&&d(b.e)})},this)};var sd=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return Kb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype. this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},b}(yc);rc.ignoreElements=function(){return new sd(this)},rc.materialize=function(){var a=this;return new Xd(function(b){return a.subscribe(function(a){b.onNext(mc(a))},function(a){
b.onNext(nc(a)),b.onCompleted()},function(){b.onNext(oc()),b.onCompleted()})},a)},rc.repeat=function(a){return Ec(this,a).concat()},rc.retry=function(a){return Ec(this,a).catchError()},rc.retryWhen=function(a){return Ec(this).catchErrorWhen(a)};var td=function(a){function b(b,c,d,e){this.source=b,this.accumulator=c,this.hasSeed=d,this.seed=e,a.call(this)}return Kb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new N(a,this))},b}(yc);N.prototype={onNext:function(a){return this.isStopped?void 0:(!this.hasValue&&(this.hasValue=!0),this.hasAccumulation?this.accumulation=Ta(this.accumulator)(this.accumulation,a):(this.accumulation=this.hasSeed?Ta(this.accumulator)(this.seed,a):a,this.hasAccumulation=!0),this.accumulation===Sa?this.o.onError(this.accumulation.e):void this.o.onNext(this.accumulation))},onError:function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},onCompleted:function(){this.isStopped||(this.isStopped=!0,!this.hasValue&&this.hasSeed&&this.o.onNext(this.seed),this.o.onCompleted())},dispose:function(){this.isStopped=!0},fail:function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)}},rc.scan=function(){var a,b=!1,c=arguments[0];return 2===arguments.length&&(b=!0,a=arguments[1]),new td(this,c,b,a)},rc.skipLast=function(a){if(0>a)throw new _a;var b=this;return new Xd(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},function(a){c.onError(a)},function(){c.onCompleted()})},b)},rc.startWith=function(){var a,b=0;arguments.length&&ac(arguments[0])?(a=arguments[0],b=1):a=ec;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return Gc([Tc(c,a),this]).concat()},rc.takeLast=function(a){if(0>a)throw new _a;var b=this;return new Xd(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})},b)},rc.takeLastBuffer=function(a){var b=this;return new Xd(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){c.onNext(d),c.onCompleted()})},b)},rc.windowWithCount=function(a,b){var c=this;if(+a||(a=0),Math.abs(a)===1/0&&(a=0),0>=a)throw new _a;if(null==b&&(b=a),+b||(b=0),Math.abs(b)===1/0&&(b=0),0>=b)throw new _a;return new Xd(function(d){function e(){var a=new $d;i.push(a),d.onNext(Mb(a,g))}var f=new Wb,g=new Yb(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)},rc.selectConcat=rc.concatMap=function(a,b,c){return Ra(a)&&Ra(b)?this.concatMap(function(c,d){var e=a(c,d);return Qa(e)&&(e=Ic(e)),(hb(e)||gb(e))&&(e=Rc(e)),e.map(function(a,e){return b(c,a,d,e)})}):Ra(a)?O(this,a,c):O(this,function(){return a})},rc.concatMapObserver=rc.selectConcatObserver=function(a,b,c,d){var e=this,f=jb(a,d,2),g=jb(b,d,1),h=jb(c,d,0);return new Xd(function(a){var b=0;return e.subscribe(function(c){var d;try{d=f(c,b++)}catch(e){return void a.onError(e)}Qa(d)&&(d=Ic(d)),a.onNext(d)},function(b){var c;try{c=g(b)}catch(d){return void a.onError(d)}Qa(c)&&(c=Ic(c)),a.onNext(c),a.onCompleted()},function(){var b;try{b=h()}catch(c){return void a.onError(c)}Qa(b)&&(b=Ic(b)),a.onNext(b),a.onCompleted()})},this).concatAll()},rc.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new Xd(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},function(b){a.onError(b)},function(){!d&&a.onNext(b),a.onCompleted()})},c)},Q.prototype.push=function(a){var b=-1===P(this.set,a,this.comparer);return b&&this.set.push(a),b},rc.distinct=function(a,b){var c=this;return b||(b=Na),new Xd(function(d){var e=new Q(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},function(a){d.onError(a)},function(){d.onCompleted()})},this)},rc.groupBy=function(a,b){return this.groupByUntil(a,b,Wc)},rc.groupByUntil=function(b,c,d){var e=this;return new Xd(function(f){var g=new Td,h=new Pb,i=new Yb(h),j=function(a){return function(b){b.onError(a)}};return h.add(e.subscribe(function(e){var k=Ta(b)(e);if(k===Sa)return g.forEach(j(k.e)),f.onError(k.e);var l=!1,m=g.get(k);if(m===a&&(m=new $d,g.set(k,m),l=!0),l){var n=new Zd(k,m,i),o=new Zd(k,m),p=Ta(d)(o);if(p===Sa)return g.forEach(j(p.e)),f.onError(p.e);f.onNext(n);var q=new Wb;h.add(q),q.setDisposable(p.take(1).subscribe(Ka,function(a){g.forEach(j(a)),f.onError(a)},function(){g["delete"](k)&&m.onCompleted(),h.remove(q)}))}var r=e;return Ra(c)&&(r=Ta(c)(e),r===Sa)?(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 ud=function(a){function b(b,c,d){this.source=b,this.selector=jb(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,this.isStopped=!1}return Kb(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))},d.prototype. b=Ta(this.selector)(a,this.i++,this.source);return b===Sa?this.o.onError(b.e):void this.o.onNext(b)}},d.prototype. this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(yc);rc.map=rc.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof ud?this.internalMap(c,b):new ud(this,c,b)},rc.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(R(b,a))},rc.flatMap=rc.selectMany=function(a,b,c){return new zc(this,a,b,c).mergeAll()},rc.flatMapObserver=rc.selectManyObserver=function(a,b,c,d){var e=this;return new Xd(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)}Qa(c)&&(c=Ic(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}Qa(c)&&(c=Ic(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}Qa(a)&&(a=Ic(a)),f.onNext(a),f.onCompleted()})},e).mergeAll()},Ja.Observable.prototype.flatMapLatest=function(a,b,c){return new zc(this,a,b,c).switchLatest()};var vd=function(a){function b(b,c){this.source=b,this.skipCount=c,a.call(this)}function c(a,b){this.c=b,this.r=b,this.o=a,this.isStopped=!1}return Kb(b,a),b.prototype.subscrib
8000
eCore=function(a){return this.source.subscribe(new c(a,this.skipCount))},c.prototype. this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(yc);rc.skip=function(a){if(0>a)throw new _a;return new vd(this,a)},rc.skipWhile=function(a,b){var c=this,d=jb(a,b,3);return new Xd(function(a){var b=0,e=!1;return c.subscribe(function(f){if(!e)try{e=!d(f,b++,c)}catch(g){return void a.onError(g)}e&&a.onNext(f)},function(b){a.onError(b)},function(){a.onCompleted()})},c)},rc.take=function(a,b){if(0>a)throw new _a;if(0===a)return Nc(b);var c=this;return new Xd(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0>=d&&b.onCompleted())},function(a){b.onError(a)},function(){b.onCompleted()})},c)},rc.takeWhile=function(a,b){var c=this,d=jb(a,b,3);return new Xd(function(a){var b=0,e=!0;return c.subscribe(function(f){if(e){try{e=d(f,b++,c)}catch(g){return void a.onError(g)}e?a.onNext(f):a.onCompleted()}},function(b){a.onError(b)},function(){a.onCompleted()})},c)};var wd=function(a){function b(b,c,d){this.source=b,this.predicate=jb(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,this.isStopped=!1}return Kb(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)},d.prototype. b=Ta(this.predicate)(a,this.i++,this.source);return b===Sa?this.o.onError(b.e):void(b&&this.o.onNext(a))}},d.prototype. this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(yc);rc.filter=rc.where=function(a,b){return this instanceof wd?this.internalFilter(a,b):new wd(this,a,b)};var xd=function(a){function b(b,c,d,e){this.source=b,this.acc=c,this.hasSeed=d,this.seed=e,a.call(this)}function c(a,b){this.o=a,this.acc=b.acc,this.hasSeed=b.hasSeed,this.seed=b.seed,this.hasAccumulation=!1,this.result=null,this.hasValue=!1,this.isStopped=!1}return Kb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this))},c.prototype. Za),this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(yc);rc.reduce=function(a){var b=!1;if(2===arguments.length){b=!0;var c=arguments[1]}return new xd(this,a,b,c)};var yd=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._i=0,a.call(this)}return Kb(b,a),b.prototype.next=function(a){var b=Ta(this._fn)(a,this._i++,this._s);return b===Sa?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}(sc);rc.some=function(a,b){var c=this,d=jb(a,b,3);return new Xd(function(a){return c.subscribe(new yd(a,d,c))})};var zd=function(a){function b(b){this._o=b,a.call(this)}return Kb(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}(sc);rc.isEmpty=function(){var a=this;return new Xd(function(b){return a.subscribe(new zd(b))},a)};var Ad=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._i=0,a.call(this)}return Kb(b,a),b.prototype.next=function(a){var b=Ta(this._fn)(a,this._i++,this._s);return b===Sa?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}(sc);rc.every=function(a,b){var c=this,d=jb(a,b,3);return new Xd(function(a){return c.subscribe(new Ad(a,d,c))},this)},rc.includes=function(a,b){function c(a,b){return 0===a&&0===b||a===b||isNaN(a)&&isNaN(b)}var d=this;return new Xd(function(e){var f=0,g=+b||0;return Math.abs(g)===1/0&&(g=0),0>g?(e.onNext(!1),e.onCompleted(),Tb):d.subscribe(function(b){f++>=g&&c(b,a)&&(e.onNext(!0),e.onCompleted())},function(a){e.onError(a)},function(){e.onNext(!1),e.onCompleted()})},this)},rc.contains=function(a,b){rc.includes(a,b)},rc.count=function(a,b){return a?this.filter(a,b).count():this.reduce(function(a){return a+1},0)},rc.indexOf=function(a,b){var c=this;return new Xd(function(d){var e=0,f=+b||0;return Math.abs(f)===1/0&&(f=0),0>f?(d.onNext(-1),d.onCompleted(),Tb):c.subscribe(function(b){e>=f&&b===a&&(d.onNext(e),d.onCompleted()),e++},function(a){d.onError(a)},function(){d.onNext(-1),d.onCompleted()})},c)},rc.sum=function(a,b){return a&&Ra(a)?this.map(a,b).sum():this.reduce(function(a,b){return a+b},0)},rc.minBy=function(a,b){return b||(b=Oa),S(this,a,function(a,c){return-1*b(a,c)})},rc.min=function(a){return this.minBy(La,a).map(function(a){return T(a)})},rc.maxBy=function(a,b){return b||(b=Oa),S(this,a,b)},rc.max=function(a){return this.maxBy(La,a).map(function(a){return T(a)})};var Bd=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 Kb(b,a),b.prototype.next=function(a){if(this._fn){var b=Ta(this._fn)(a,this._c++,this._s);if(b===Sa)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 Za):(this._o.onNext(this._t/this._c),void this._o.onCompleted())},b}(sc);rc.average=function(a,b){var c,d=this;return Ra(a)&&(c=jb(a,b,3)),new Xd(function(a){return d.subscribe(new Bd(a,c,d))},d)},rc.sequenceEqual=function(a,b){var c=this;return b||(b=Na),new Xd(function(d){var e=!1,f=!1,g=[],h=[],i=c.subscribe(function(a){var c,e;if(h.length>0){e=h.shift();try{c=b(e,a)}catch(i){return void d.onError(i)}c||(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()))});(hb(a)||gb(a))&&(a=Rc(a)),Qa(a)&&(a=Ic(a));var j=a.subscribe(function(a){var c;if(g.length>0){var f=g.shift();try{c=b(f,a)}catch(i){return void d.onError(i)}c||(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 Pb(i,j)},c)},rc.elementAt=function(b,c){if(0>b)throw new _a;var d=this;return new Xd(function(e){var f=b;return d.subscribe(function(a){0===f--&&(e.onNext(a),e.onCompleted())},function(a){e.onError(a)},function(){c===a?e.onError(new _a):(e.onNext(c),e.onCompleted())})},d)},rc.single=function(a,b){if(Ra(a))return this.filter(a,b).single();var c=this;return new Xd(function(a){var b,d=!1;return c.subscribe(function(c){d?a.onError(new Error("Sequence contains more than one element")):(b=c,d=!0)},function(b){a.onError(b)},function(){a.onNext(b),a.onCompleted()})},c)};var Cd=function(b){function c(a,c,d){this._o=a,this._obj=c,this._s=d,this._i=0,b.call(this)}return Kb(c,b),c.prototype.next=function(a){if(this._obj.predicate){var b=Ta(this._obj.predicate)(a,this._i++,this._s);if(b===Sa)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 Za):(this._o.onNext(this._obj.defaultValue),this._o.onCompleted())},c}(sc);rc.first=function(){var a={},b=this;if(a="object"==typeof arguments[0]?arguments[0]:{predicate:arguments[0],thisArg:arguments[1],defaultValue:arguments[2]},Ra(a.predicate)){var c=a.predicate;a.predicate=jb(c,a.thisArg,3)}return new Xd(function(c){return b.subscribe(new Cd(c,a,b))},b)},rc.last=function(){var b={},c=this;if(b="object"==typeof arguments[0]?arguments[0]:{predicate:arguments[0],thisArg:arguments[1],defaultValue:arguments[2]},Ra(b.predicate)){var d=b.predicate;b.predicate=jb(d,b.thisArg,3)}return new Xd(function(d){var e,f=!1,g=0;return c.subscribe(function(a){if(b.predicate){var h=Ta(b.predicate)(a,g++,c);if(h===Sa)return d.onError(h.e);h&&(f=!0,e=a)}else b.predicate||(f=!0,e=a)},function(a){d.onError(a)},function(){f?(d.onNext(e),d.onCompleted()):b.defaultValue===a?d.onError(new Za):(d.onNext(b.defaultValue),d.onCompleted())})},c)},rc.find=function(a,b){return U(this,a,b,!1)},rc.findIndex=function(a,b){return U(this,a,b,!0)},rc.toSet=function(){if("undefined"==typeof Ia.Set)throw new TypeError;var a=this;return new Xd(function(b){var c=new Ia.Set;return a.subscribe(function(a){c.add(a)},function(a){b.onError(a)},function(){b.onNext(c),b.onCompleted()})},a)},rc.toMap=function(a,b){if("undefined"==typeof Ia.Map)throw new TypeError;var c=this;return new Xd(function(d){var e=new Ia.Map;return c.subscribe(function(c){var f;try{f=a(c)}catch(g){return void d.onError(g)}var h=c;if(b)try{h=b(c)}catch(g){return void d.onError(g)}e.set(f,h)},function(a){d.onError(a)},function(){d.onNext(e),d.onCompleted()})},c)},xc.wrap=function(a){function b(){return xc.spawn.call(this,a.apply(this,arguments))}return b.__generatorFunction__=a,b};var Dd=xc.spawn=function(){for(var a=arguments[0],b=this,c=[],d=1,e=arguments.length;e>d;d++)c.push(arguments[d]);return new Xd(function(d){function e(b){var c=Ta(a.next).call(a,b);return c===Sa?d.onError(c.e):void g(c)}function f(b){var c=Ta(a.next).call(a,b);return c===Sa?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);xc.isObservable(c)?h.add(c.subscribe(e,f)):f(new TypeError("type not supported"))}var h=new Pb;return Ra(a)&&(a=a.apply(b,c)),a&&Ra(a.next)?(e(),h):(d.onNext(a),d.onCompleted())})};xc.start=function(a,b,c){return Ed(a,b,c)()};var Ed=xc.toAsync=function(a,b,c){return ac(c)||(c=jc),function(){var d=arguments,e=new _d;return c.schedule(function(){var c;try{c=a.apply(b,d)}catch(f){return void e.onError(f)}e.onNext(c),e.onCompleted()}),e.asObservable()}};xc.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 _(a,b,c,e)}},xc.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 ba(a,b,c,e)}},da.prototype.dispose=function(){this.isDisposed||(this._e.removeEventListener(this._n,this._fn,!1),this.isDisposed=!0)},Ja.config.useNativeEvents=!1,xc.fromEvent=function(a,b,c){return a.addListener?Fd(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c):Ja.config.useNativeEvents||"function"!=typeof a.on||"function"!=typeof a.off?new Xd(function(d){return ea(a,b,fa(d,c))}).publish().refCount():Fd(function(c){a.on(b,c)},function(c){a.off(b,c)},c)};var Fd=xc.fromEventPattern=function(a,b,c,d){return ac(d)||(d=ec),new Xd(function(d){function e(){var a=arguments[0];return Ra(c)&&(a=Ta(c).apply(null,arguments),a===Sa)?d.onError(a.e):void d.onNext(a)}var f=a(e);return Sb(function(){Ra(b)&&b(e,f)})}).publish().refCount()};xc.startAsync=function(a){var b;try{b=a()}catch(c){return bd(c)}return Ic(b)};var Gd=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=Tb,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=Tb)});return new Pb(c,d,e)}function c(c,d){this.source=c,this.controller=new $d,d&&d.subscribe?this.pauser=this.controller.merge(d):this.pauser=this.controller,a.call(this,b,c)}return Kb(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(xc);rc.pausable=function(a){return new Gd(this,a)};var Hd=function(b){function c(b){function c(){for(;e.length>0;)b.onNext(e.shift())}var d,e=[],f=ga(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}function d(a,d){this.source=a,this.controller=new $d,d&&d.subscribe?this.pauser=this.controller.merge(d):this.pauser=this.controller,b.call(this,c,a)}return Kb(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(xc);rc.pausableBuffered=function(a){return new Hd(this,a)};var Id=function(a){function b(a){return this.source.subscribe(a)}function c(c,d,e){a.call(this,b,c),this.subject=new Jd(d,e),this.source=c.multicast(this.subject).refCount()}return Kb(c,a),c.prototype.request=function(a){return this.subject.request(null==a?-1:a)},c}(xc),Jd=function(a){function b(a){return this.subject.subscribe(a)}function c(c,d){null==c&&(c=!0),a.call(this,b),this.subject=new $d,this.enableQueue=c,this.queue=c?[]:null,this.requestedCount=0,this.requestedDisposable=null,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.scheduler=d||fc}return Kb(c,a),Lb(c.prototype,pc,{onCompleted:function(){this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length?this.queue.push(lc.createOnCompleted()):(this.subject.onCompleted(),this.disposeCurrentRequest())},onError:function(a){this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length?this.queue.push(lc.createOnError(a)):(this.subject.onError(a),this.disposeCurrentRequest())},onNext:function(a){this.requestedCount<=0?this.enableQueue&&this.queue.push(lc.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.scheduleWithState(a,function(a,c){var d=b._processRequest(c),e=b.hasCompleted||b.hasFailed;return!e&&d>0?(b.requestedCount=d,Sb(function(){b.requestedCount=0})):void 0}),this.requestedDisposable},disposeCurrentRequest:function(){this.requestedDisposable&&(this.requestedDisposable.dispose(),this.requestedDisposable=null)}}),c}(xc);rc.controlled=function(a,b){return a&&ac(a)&&(b=a,a=!0),null==a&&(a=!0),new Id(this,a,b)};var Kd=function(a){function b(a){this.subscription=this.source.subscribe(new d(a,this,this.subscription));var b=this;return jc.schedule(function(){b.source.request(1)}),this.subscription}function c(c){a.call(this,b,c),this.source=c}Kb(c,a);var d=function(a){function b(b,c,d){a.call(this),this.observer=b,this.observable=c,this.cancel=d}Kb(b,a);var c=b.prototype;return c.completed=function(){this.observer.onCompleted(),this.dispose()},c.error=function(a){this.observer.onError(a),this.dispose()},c.next=function(a){this.observer.onNext(a);var b=this;jc.schedule(function(){b.observable.source.request(1)})},c.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),a.prototype.dispose.call(this)},b}(sc);return c}(xc);Id.prototype.stopAndWait=function(){return new Kd(this)};var Ld=function(a){function b(a){this.subscription=this.source.subscribe(new d(a,this,this.subscription));var b=this;return jc.schedule(function(){b.source.request(b.windowSize)}),this.subscription}function c(c,d){a.call(this,b,c),this.source=c,this.windowSize=d}Kb(c,a);var d=function(a){function b(a,b,c){this.observer=a,this.observable=b,this.cancel=c,this.received=0}Kb(b,a);var c=b.prototype;return c.completed=function(){this.observer.onCompleted(),this.dispose()},c.error=function(a){this.observer.onError(a),this.dispose()},c.next=function(a){if(this.observer.onNext(a),this.received=++this.received%this.observable.windowSize,0===this.received){var b=this;jc.schedule(function(){b.observable.source.request(b.observable.windowSize)})}},c.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),a.prototype.dispose.call(this)},b}(sc);return c}(xc);Id.prototype.windowed=function(a){return new Ld(this,a)},rc.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},rc.multicast=function(a,b){var c=this;return"function"==typeof a?new Xd(function(d){var e=c.multicast(a());return new Pb(b(e).subscribe(d),e.connect())},c):new Pd(c,a)},rc.publish=function(a){return a&&Ra(a)?this.multicast(function(){return new $d},a):this.multicast(new $d)},rc.share=function(){return this.publish().refCount()},rc.publishLast=function(a){return a&&Ra(a)?this.multicast(function(){return new _d},a):this.multicast(new _d)},rc.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new Nd(b)},a):this.multicast(new Nd(a))},rc.shareValue=function(a){return this.publishValue(a).refCount()},rc.replay=function(a,b,c,d){return a&&Ra(a)?this.multicast(function(){return new Od(b,c,d)},a):this.multicast(new Od(b,c,d))},rc.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};var Md=function(a,b){this.subject=a,this.observer=b};Md.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Nd=Ja.BehaviorSubject=function(a){function c(a){return Vb(this),this.isStopped?(this.hasError?a.onError(this.error):a.onCompleted(),Tb):(this.observers.push(a),a.onNext(this.value),new Md(this,a))}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.hasError=!1}return Kb(d,a),Lb(d.prototype,pc,{getValue:function(){if(Vb(this),this.hasError)throw this.error;return this.value},hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(Vb(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(Vb(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(Vb(this),!this.isStopped){this.value=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),d}(xc),Od=Ja.ReplaySubject=function(a){function c(a,b){return Sb(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(a){var b=new vc(this.scheduler,a),d=c(this,b);Vb(this),this._trim(this.scheduler.now()),this.observers.push(b);for(var e=0,f=this.q.length;f>e;e++)b.onNext(this.q[e].value);return this.hasError?b.onError(this.error):this.isStopped&&b.onCompleted(),b.ensureActive(),d}function e(b,c,e){this.bufferSize=null==b?f:b,this.windowSize=null==c?f:c,this.scheduler=e||fc,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,d)}var f=Math.pow(2,53)-1;return Kb(e,a),Lb(e.prototype,pc.prototype,{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(Vb(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var d=0,e=b(this.observers),f=e.length;f>d;d++){var g=e[d];g.onNext(a),g.ensureActive()}}},onError:function(a){if(Vb(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var d=0,e=b(this.observers),f=e.length;f>d;d++){var g=e[d];g.onError(a),g.ensureActive()}this.observers.length=0}},onCompleted:function(){if(Vb(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var c=0,d=b(this.observers),e=d.length;e>c;c++){var f=d[c];f.onCompleted(),f.ensureActive()}this.observers.length=0}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(xc),Pd=Ja.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new Pb(f.subscribe(c),Sb(function(){e=!1}))),d},a.call(this,function(a){return c.subscribe(a)})}return Kb(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new Xd(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(xc);rc.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 Xd(function(b){return a().subscribe(b)})},rc.join=function(a,b,c,d){var e=this;return new Xd(function(f){var g=new Pb,h=!1,i=!1,j=0,k=0,l=new Td,m=new Td,n=function(a){f.onError(a)};return g.add(e.subscribe(function(a){var c=j++,e=new Wb;l.set(c,a),g.add(e);var i=Ta(b)(a);return i===Sa?f.onError(i.e):(e.setDisposable(i.take(1).subscribe(Ka,n,function(){l["delete"](c)&&0===l.size&&h&&f.onCompleted(),g.remove(e)})),void m.forEach(function(b){var c=Ta(d)(a,b);return c===Sa?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 Wb;m.set(b,a),g.add(e);var h=Ta(c)(a);return h===Sa?f.onError(h.e):(e.setDisposable(h.take(1).subscribe(Ka,n,function(){m["delete"](b)&&0===m.size&&i&&f.onCompleted(),g.remove(e)})),void l.forEach(function(b){var c=Ta(d)(b,a);return c===Sa?f.onError(c.e):void f.onNext(c)}))},n,function(){i=!0,(h||0===m.size)&&f.onCompleted()})),g},e)},rc.groupJoin=function(a,b,c,d){var e=this;return new Xd(function(f){function g(a){}var h=new Pb,i=new Yb(h),j=new Td,k=new Td,l=0,m=0,g=function(a){return function(b){b.onError(a)}};return h.add(e.subscribe(function(a){var c=new $d,e=l++;j.set(e,c);var m=Ta(d)(a,Mb(c,i));if(m===Sa)return j.forEach(g(m.e)),f.onError(m.e);f.onNext(m),k.forEach(function(a){c.onNext(a)});var n=new Wb;h.add(n);var o=Ta(b)(a);return o===Sa?(j.forEach(g(o.e)),f.onError(o.e)):void n.setDisposable(o.take(1).subscribe(Ka,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 Wb;h.add(d);var e=Ta(c)(a);return e===Sa?(j.forEach(g(e.e)),f.onError(e.e)):(d.setDisposable(e.take(1).subscribe(Ka,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)},rc.buffer=function(){return this.window.apply(this,arguments).flatMap(L)},rc.window=function(a,b){return 1===arguments.length&&"function"!=typeof arguments[0]?ia.call(this,a):"function"==typeof a?ja.call(this,a):ha.call(this,a,b)},rc.pairwise=function(){var a=this;return new Xd(function(b){var c,d=!1;return a.subscribe(function(a){d?b.onNext([c,a]):d=!0,c=a},b.onError.bind(b),b.onCompleted.bind(b))},a)},rc.partition=function(a,b){return[this.filter(a,b),this.filter(function(c,d,e){return!a.call(b,c,d,e)})]};var Qd=function(a){function b(a,b){this.c=a,this.s=b}return Kb(b,a),b.prototype[eb]=function(){var a=this;return{next:function(){return a.c()?{done:!1,value:a.s}:{done:!0,value:void 0}}}},b}(Ac);rc.letBind=rc.let=function(a){return a(this)},xc["if"]=function(a,b,c){return Kc(function(){return c||(c=Nc()),Qa(b)&&(b=Ic(b)),Qa(c)&&(c=Ic(c)),"function"==typeof c.now&&(c=Nc(c)),a()?b:c})},xc["for"]=xc.forIn=function(a,b,c){return Gc(a,b,c).concat()};var Rd=xc["while"]=xc.whileDo=function(a,b){
return Qa(b)&&(b=Ic(b)),ka(a,b).concat()};rc.doWhile=function(a){return gd([this,Rd(a,this)])},xc["case"]=function(a,b,c){return Kc(function(){Qa(c)&&(c=Ic(c)),c||(c=Nc()),ac(c)&&(c=Nc(c));var d=b[a()];return Qa(d)&&(d=Ic(d)),d||c})},rc.expand=function(a,b){ac(b)||(b=ec);var c=this;return new Xd(function(d){var e=[],f=new Xb,g=new Pb(f),h=0,i=!1,j=function(){var c=!1;e.length>0&&(c=!i,i=!0),c&&f.setDisposable(b.scheduleRecursive(function(b){var c;if(!(e.length>0))return void(i=!1);c=e.shift();var f=new Wb;g.add(f),f.setDisposable(c.subscribe(function(b){d.onNext(b);var c=null;try{c=a(b)}catch(f){d.onError(f)}e.push(c),h++,j()},d.onError.bind(d),function(){g.remove(f),h--,0===h&&d.onCompleted()})),b()}))};return e.push(c),h++,j(),g},this)},xc.forkJoin=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new Xd(function(b){var c=a.length;if(0===c)return b.onCompleted(),Tb;for(var d=new Pb,e=!1,f=new Array(c),g=new Array(c),h=new Array(c),i=0;c>i;i++)!function(i){var j=a[i];Qa(j)&&(j=Ic(j)),d.add(j.subscribe(function(a){e||(f[i]=!0,h[i]=a)},function(a){e=!0,b.onError(a),d.dispose()},function(){if(!e){if(!f[i])return void b.onCompleted();g[i]=!0;for(var a=0;c>a;a++)if(!g[a])return;e=!0,b.onNext(h),b.onCompleted()}}))}(i);return d})},rc.forkJoin=function(a,b){var c=this;return new Xd(function(d){var e,f,g=!1,h=!1,i=!1,j=!1,k=new Wb,l=new Wb;return Qa(a)&&(a=Ic(a)),k.setDisposable(c.subscribe(function(a){i=!0,e=a},function(a){l.dispose(),d.onError(a)},function(){if(g=!0,h)if(i)if(j){var a;try{a=b(e,f)}catch(c){return void d.onError(c)}d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),l.setDisposable(a.subscribe(function(a){j=!0,f=a},function(a){k.dispose(),d.onError(a)},function(){if(h=!0,g)if(i)if(j){var a;try{a=b(e,f)}catch(c){return void d.onError(c)}d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),new Pb(k,l)},c)},rc.manySelect=rc.extend=function(a,b){ac(b)||(b=ec);var c=this;return Kc(function(){var d;return c.map(function(a){var b=new Sd(a);return d&&d.onNext(a),d=b,b}).tap(Ka,function(a){d&&d.onError(a)},function(){d&&d.onCompleted()}).observeOn(b).map(a)},c)};var Sd=function(a){function b(a){var b=this,c=new Pb;return c.add(fc.schedule(function(){a.onNext(b.head),c.add(b.tail.mergeAll().subscribe(a))})),c}function c(c){a.call(this,b),this.head=c,this.tail=new _d}return Kb(c,a),Lb(c.prototype,pc,{onCompleted:function(){this.onNext(xc.empty())},onError:function(a){this.onNext(xc["throw"](a))},onNext:function(a){this.tail.onNext(a),this.tail.onCompleted()}}),c}(xc),Td=Ia.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}();la.prototype.and=function(a){return new la(this.patterns.concat(a))},la.prototype.thenDo=function(a){return new ma(this,a)},ma.prototype.activate=function(a,b,c){for(var d=this,e=[],f=0,g=this.expression.patterns.length;g>f;f++)e.push(na(a,this.expression.patterns[f],b.onError.bind(b)));var h=new oa(e,function(){var a;try{a=d.selector.apply(d,arguments)}catch(c){return void b.onError(c)}b.onNext(a)},function(){for(var a=0,b=e.length;b>a;a++)e[a].removeActivePlan(h);c(h)});for(f=0,g=e.length;g>f;f++)e[f].addActivePlan(h);return h},oa.prototype.dequeue=function(){this.joinObservers.forEach(function(a){a.queue.shift()})},oa.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 Ud=function(a){function b(b,c){a.call(this),this.source=b,this. Wb,this.isDisposed=!1}Kb(b,a);var c=b.prototype;return c.next=function(a){if(!this.isDisposed){if("E"===a.kind)return this.onError(a.exception);this.queue.push(a);for(var b=this.activePlans.slice(0),c=0,d=b.length;d>c;c++)b[c].match()}},c.error=Ka,c.completed=Ka,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}(sc);rc.and=function(a){return new la([this,a])},rc.thenDo=function(a){return new la([this]).thenDo(a)},xc.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 Xd(function(b){var c=[],d=new Td,e=qc(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 Pb;return d.forEach(function(a){a.subscribe(),i.add(a)}),i})};var Vd=xc.interval=function(a,b){return sa(a,a,ac(b)?b:jc)};xc.timer=function(b,c,d){var e;return ac(d)||(d=jc),null!=c&&"number"==typeof c?e=c:ac(c)&&(d=c),b instanceof Date&&e===a?pa(b.getTime(),d):b instanceof Date&&e!==a?qa(b.getTime(),c,d):e===a?ra(b,d):sa(b,e,d)};rc.delay=function(){if("number"==typeof arguments[0]||arguments[0]instanceof Date){var a=arguments[0],b=arguments[1];return ac(b)||(b=jc),a instanceof Date?ua(this,a,b):ta(this,a,b)}if(Ra(arguments[0]))return va(this,arguments[0],arguments[1]);t
6453
hrow new Error("Invalid arguments")},rc.debounce=function(){if(Ra(arguments[0]))return xa(this,arguments[0]);if("number"==typeof arguments[0])return wa(this,arguments[0],arguments[1]);throw new Error("Invalid arguments")},rc.windowWithTime=function(a,b,c){var d,e=this;return null==b&&(d=a),ac(c)||(c=jc),"number"==typeof b?d=b:ac(b)&&(d=a,c=b),new Xd(function(b){function f(){var a=new Wb,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.scheduleWithRelative(o,function(){if(g){var a=new $d;k.push(a),b.onNext(Mb(a,h))}e&&k.shift().onCompleted(),f()}))}var g,h,i=d,j=a,k=[],l=new Xb,m=0;return g=new Pb(l),h=new Yb(g),k.push(new $d),b.onNext(Mb(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)},rc.windowWithTimeOrCount=function(a,b,c){var d=this;return ac(c)||(c=jc),new Xd(function(e){function f(b){var d=new Wb;g.setDisposable(d),d.setDisposable(c.scheduleWithRelative(a,function(){if(b===k){j=0;var a=++k;l.onCompleted(),l=new $d,e.onNext(Mb(l,i)),f(a)}}))}var g=new Xb,h=new Pb(g),i=new Yb(h),j=0,k=0,l=new $d;return e.onNext(Mb(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 $d,e.onNext(Mb(l,i))),d&&f(c)},function(a){l.onError(a),e.onError(a)},function(){l.onCompleted(),e.onCompleted()})),i},d)},rc.bufferWithTime=function(a,b,c){return this.windowWithTime(a,b,c).flatMap(L)},rc.bufferWithTimeOrCount=function(a,b,c){return this.windowWithTimeOrCount(a,b,c).flatMap(L)},rc.timeInterval=function(a){var b=this;return ac(a)||(a=jc),Kc(function(){var c=a.now();return b.map(function(b){var d=a.now(),e=d-c;return c=d,{value:b,interval:e}})})},rc.timestamp=function(a){return ac(a)||(a=jc),this.map(function(b){return{value:b,timestamp:a.now()}})},rc.sample=rc.throttleLatest=function(a,b){return ac(b)||(b=jc),"number"==typeof a?ya(this,Vd(a,b)):ya(this,a)};var Wd=Ja.TimeoutError=function(a){this.message=a||"Timeout has occurred",this.name="TimeoutError",Error.call(this)};Wd.prototype=Object.create(Error.prototype),rc.timeout=function(){var a=arguments[0];if(a instanceof Date||"number"==typeof a)return Aa(this,a,arguments[1],arguments[2]);if(xc.isObservable(a)||Ra(a))return za(this,a,arguments[1],arguments[2]);throw new Error("Invalid arguments")},xc.generateWithAbsoluteTime=function(a,b,c,d,e,f){return ac(f)||(f=jc),new Xd(function(g){var h=!0,i=!1;return f.scheduleRecursiveWithAbsoluteAndState(a,f.now(),function(a,f){i&&g.onNext(a);try{if(h?h=!1:a=c(a),i=b(a))var j=d(a),k=e(a)}catch(l){return void g.onError(l)}i?f(j,k):g.onCompleted()})})},xc.generateWithRelativeTime=function(a,b,c,d,e,f){return ac(f)||(f=jc),new Xd(function(g){var h=!0,i=!1;return f.scheduleRecursiveWithRelativeAndState(a,0,function(a,f){i&&g.onNext(a);try{if(h?h=!1:a=c(a),i=b(a))var j=d(a),k=e(a)}catch(l){return void g.onError(l)}i?f(j,k):g.onCompleted()})})},rc.delaySubscription=function(a,b){var c=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative",d=this;return ac(b)||(b=jc),new Xd(function(e){var f=new Xb;return f.setDisposable(b[c](a,function(){f.setDisposable(d.subscribe(e))})),f},this)},rc.skipLastWithTime=function(a,b){ac(b)||(b=jc);var c=this;return new Xd(function(d){var e=[];return c.subscribe(function(c){var f=b.now();for(e.push({interval:f,value:c});e.length>0&&f-e[0].interval>=a;)d.onNext(e.shift().value)},function(a){d.onError(a)},function(){for(var c=b.now();e.length>0&&c-e[0].interval>=a;)d.onNext(e.shift().value);d.onCompleted()})},c)},rc.takeLastWithTime=function(a,b){var c=this;return ac(b)||(b=jc),new Xd(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();e.length>0;){var f=e.shift();c-f.interval<=a&&d.onNext(f.value)}d.onCompleted()})},c)},rc.takeLastBufferWithTime=function(a,b){var c=this;return ac(b)||(b=jc),new Xd(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)},rc.takeWithTime=function(a,b){var c=this;return ac(b)||(b=jc),new Xd(function(d){return new Pb(b.scheduleWithRelative(a,function(){d.onCompleted()}),c.subscribe(d))},c)},rc.skipWithTime=function(a,b){var c=this;return ac(b)||(b=jc),new Xd(function(d){var e=!1;return new Pb(b.scheduleWithRelative(a,function(){e=!0}),c.subscribe(function(a){e&&d.onNext(a)},d.onError.bind(d),d.onCompleted.bind(d)))},c)},rc.skipUntilWithTime=function(a,b){ac(b)||(b=jc);var c=this,d=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Xd(function(e){var f=!1;return new Pb(b[d](a,function(){f=!0}),c.subscribe(function(a){f&&e.onNext(a)},function(a){e.onError(a)},function(){e.onCompleted()}))},c)},rc.takeUntilWithTime=function(a,b){ac(b)||(b=jc);var c=this,d=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Xd(function(e){return new Pb(b[d](a,function(){e.onCompleted()}),c.subscribe(e))},c)},rc.throttle=function(a,b){ac(b)||(b=jc);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new Xd(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)},rc.transduce=function(a){function b(a){return{"@@transducer/init":function(){return a},"@@transducer/step":function(a,b){return a.onNext(b)},"@@transducer/result":function(a){return a.onCompleted()}}}var c=this;return new Xd(function(d){var e=a(b(d));return c.subscribe(function(a){var b=Ta(e["@@transducer/step"]).call(e,d,a);b===Sa&&d.onError(b.e)},function(a){d.onError(a)},function(){e["@@transducer/result"](d)})},c)},rc.switchFirst=function(){var a=this;return new Xd(function(b){var c=!1,d=!1,e=new Wb,f=new Pb;return f.add(e),e.setDisposable(a.subscribe(function(a){if(!c){c=!0,Qa(a)&&(a=Ic(a));var e=new Wb;f.add(e),e.setDisposable(a.subscribe(function(a){b.onNext(a)},function(a){b.onError(a)},function(){f.remove(e),c=!1,d&&1===f.length&&b.onCompleted()}))}},function(a){b.onError(a)},function(){d=!0,!c&&1===f.length&&b.onCompleted()})),f},this)},rc.flatMapFirst=rc.selectManyFirst=function(a,b,c){return new zc(this,a,b,c).switchFirst()},Ja.Observable.prototype.flatMapWithMaxConcurrent=function(a,b,c,d){return new zc(this,b,c,d).merge(a)};Ja.VirtualTimeScheduler=function(a){function b(){return this.toDateTimeOffset(this.clock)}function c(a,b){return this.scheduleAbsoluteWithState(a,this.clock,b)}function d(a,b,c){return this.scheduleRelativeWithState(a,this.toRelative(b),c)}function e(a,b,c){return this.scheduleRelativeWithState(a,this.toRelative(b-this.now()),c)}function f(a,b){return b(),Tb}function g(f,g){this.clock=f,this.comparer=g,this.isEnabled=!1,this.queue=new Nb(1024),a.call(this,b,c,d,e)}Kb(g,a);var h=g.prototype;return h.add=cb,h.toDateTimeOffset=cb,h.toRelative=cb,h.schedulePeriodicWithState=function(a,b,c){var d=new dc(this,a,b,c);return d.start()},h.scheduleRelativeWithState=function(a,b,c){var d=this.add(this.clock,b);return this.scheduleAbsoluteWithState(a,d,c)},h.scheduleRelative=function(a,b){return this.scheduleRelativeWithState(b,a,f)},h.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)}},h.stop=function(){this.isEnabled=!1},h.advanceTo=function(a){var b=this.comparer(this.clock,a);if(this.comparer(this.clock,a)>0)throw new _a;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}},h.advanceBy=function(a){var b=this.add(this.clock,a),c=this.comparer(this.clock,b);if(c>0)throw new _a;0!==c&&this.advanceTo(b)},h.sleep=function(a){var b=this.add(this.clock,a);if(this.comparer(this.clock,b)>=0)throw new _a;this.clock=b},h.getNext=function(){for(;this.queue.length>0;){var a=this.queue.peek();if(!a.isCancelled())return a;this.queue.dequeue()}return null},h.scheduleAbsolute=function(a,b){return this.scheduleAbsoluteWithState(b,a,f)},h.scheduleAbsoluteWithState=function(a,b,c){function d(a,b){return e.queue.remove(f),c(a,b)}var e=this,f=new Zb(this,a,d,b,this.comparer);return this.queue.enqueue(f),f.disposable},g}($b);Ja.HistoricalScheduler=function(a){function b(b,c){var d=null==b?0:b,e=c||Oa;a.call(this,d,e)}Kb(b,a);var c=b.prototype;return c.add=function(a,b){return a+b},c.toDateTimeOffset=function(a){return new Date(a).getTime()},c.toRelative=function(a){return a},b}(Ja.VirtualTimeScheduler);var Xd=Ja.AnonymousObservable=function(a){function b(a){return a&&Ra(a.dispose)?a:Ra(a)?Sb(a):Tb}function c(a,c){var e=c[0],f=c[1],g=Ta(f.__subscribe).call(f,e);return g!==Sa||e.fail(Sa.e)?void e.setDisposable(b(g)):d(Sa.e)}function e(a){var b=new Yd(a),d=[b,this];return fc.scheduleRequired()?fc.scheduleWithState(d,c):c(null,d),b}function f(b,c){this.source=c,this.__subscribe=b,a.call(this,e)}return Kb(f,a),f}(xc),Yd=function(a){function b(b){a.call(this),this.observer=b,this.m=new Wb}Kb(b,a);var c=b.prototype;return c.next=function(a){var b=Ta(this.observer.onNext).call(this.observer,a);b===Sa&&(this.dispose(),d(b.e))},c.error=function(a){var b=Ta(this.observer.onError).call(this.observer,a);this.dispose(),b===Sa&&d(b.e)},c.completed=function(){var a=Ta(this.observer.onCompleted).call(this.observer);this.dispose(),a===Sa&&d(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}(sc),Zd=function(a){function b(a){return this.underlyingObservable.subscribe(a)}function c(c,d,e){a.call(this,b),this.key=c,this.underlyingObservable=e?new Xd(function(a){return new Pb(e.getDisposable(),d.subscribe(a))}):d}return Kb(c,a),c}(xc),$d=Ja.Subject=function(a){function c(a){return Vb(this),this.isStopped?this.hasError?(a.onError(this.error),Tb):(a.onCompleted(),Tb):(this.observers.push(a),new Md(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return Kb(d,a),Lb(d.prototype,pc.prototype,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(Vb(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(Vb(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(Vb(this),!this.isStopped)for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new ae(a,b)},d}(xc),_d=Ja.AsyncSubject=function(a){function c(a){return Vb(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),Tb):(this.observers.push(a),new Md(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return Kb(d,a),Lb(d.prototype,pc,{hasObservers:function(){return Vb(this),this.observers.length>0},onCompleted:function(){var a,c;if(Vb(this),!this.isStopped){this.isStopped=!0;var d=b(this.observers),c=d.length;if(this.hasValue)for(a=0;c>a;a++){var e=d[a];e.onNext(this.value),e.onCompleted()}else for(a=0;c>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(Vb(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){Vb(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(xc),ae=Ja.AnonymousSubject=function(a){function b(a){return this.observable.subscribe(a)}function c(c,d){this.observer=c,this.observable=d,a.call(this,b)}return Kb(c,a),Lb(c.prototype,pc.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(xc);Ja.Pauser=function(a){function b(){a.call(this)}return Kb(b,a),b.prototype.pause=function(){this.onNext(!1)},b.prototype.resume=function(){this.onNext(!0)},b}($d),"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Ia.Rx=Ja,define(function(){return Ja})):Ca&&Fa?Ga?(Fa.exports=Ja).Rx=Ja:Ca.Rx=Ja:Ia.Rx=Ja;var be=i()}).call(this);
//# sourceMappingURL=rx.all.map