text: /* 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=a.length,c=new Array(b),d=0;b>d;d++)c[d]=a[d];return c}function c(a,b){if(la&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(pa)){for(var c=[],e=b;e;e=e.source)e.stack&&c.unshift(e.stack);c.unshift(a.stack);var f=c.join("\n"+pa+"\n");a.stack=d(f)}}function d(a){for(var b=a.split("\n"),c=[],d=0,g=b.length;g>d;d++){var h=b[d];e(h)||f(h)||!h||c.push(h)}return c.join("\n")}function e(a){var b=h(a);if(!b)return!1;var c=b[0],d=b[1];return c===na&&d>=oa&&Ec>=d}function f(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function g(){if(la)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=h(c);if(!d)return;return na=d[0],d[1]}}function h(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 i(a){var b=[];if(!Ya(a))return b;Xa.nonEnumArgs&&a.length&&Za(a)&&(a=bb.call(a));var c=Xa.enumPrototypes&&"function"==typeof a,d=Xa.enumErrorProps&&(a===Sa||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Xa.nonEnumShadows&&a!==Ta){var f=a.constructor,g=-1,h=Ea;if(a===(f&&f.prototype))var i=a===Ua?Oa:a===Sa?Ja:Pa.call(a),j=Wa[i];for(;++g<h;)e=Da[g],j&&j[e]||!Qa.call(a,e)||b.push(e)}return b}function j(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 k(a,b){return j(a,b,i)}function l(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function m(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=Pa.call(a),h=Pa.call(b);if(g==Fa&&(g=Ma),h==Fa&&(h=Ma),g!=h)return!1;switch(g){case Ha:case Ia:return+a==+b;case La:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case Na:case Oa:return a==String(b)}var i=g==Ga;if(!i){if(g!=Ma||!Xa.nodeClass&&(l(a)||l(b)))return!1;var j=!Xa.argsObject&&Za(a)?Object:a.constructor,n=!Xa.argsObject&&Za(b)?Object:b.constructor;if(!(j==n||Qa.call(a,"constructor")&&Qa.call(b,"constructor")||ka(j)&&j instanceof j&&ka(n)&&n instanceof n||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var o=c.length;o--;)if(c[o]==a)return d[o]==b;var p=0,q=!0;if(c.push(a),d.push(b),i){if(o=a.length,p=b.length,q=p==o)for(;p--;){var r=b[p];if(!(q=m(a[p],r,c,d)))break}}else k(b,function(b,e,f){return Qa.call(f,e)?(p++,q=Qa.call(a,e)&&m(a[e],b,c,d)):void 0}),q&&k(a,function(a,b,c){return Qa.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function n(){try{return $a.apply(this,arguments)}catch(a){return ab.e=a,ab}}function o(a){if(!ka(a))throw new TypeError("fn must be a function");return $a=a,n}function p(a){throw a}function q(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function r(a,b){this.id=a,this.value=b}function t(a){this.observer=a,this.a=[],this.isStopped=!1}function u(){this._s=s}function v(){this._s=s,this._l=s.length,this._i=0}function w(a){this._a=a}function x(a){this._a=a,this._l=B(a),this._i=0}function y(a){return"number"==typeof a&&Y.isFinite(a)}function z(b){var c,d=b[xa];if(!d&&"string"==typeof b)return c=new u(b),c[xa]();if(!d&&b.length!==a)return c=new w(b),c[xa]();if(!d)throw new TypeError("Object is not iterable");return b[xa]()}function A(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function B(a){var b=+a.length;return isNaN(b)?0:0!==b&&y(b)?(b=A(b)*Math.floor(Math.abs(b)),0>=b?0:b>Xb?Xb:b):b}function C(a,b){this.observer=a,this.parent=b}function D(a,b){return da(a)||(a=xb),new Zb(b,a)}function E(a,b){return new wc(function(c){var d=new pb,e=new qb;return e.setDisposable(d),d.setDisposable(a.subscribe(function(a){c.onNext(a)},function(a){try{var d=b(a)}catch(f){return c.onError(f)}ja(d)&&(d=pc(d));var g=new pb;e.setDisposable(g),g.setDisposable(d.subscribe(c))},function(a){c.onCompleted(a)})),e},a)}function F(a,b){var c=this;return new wc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return d.onError(i)}d.onNext(g)}else d.onCompleted()},function(a){d.onError(a)},function(){d.onCompleted()})},c)}function G(){return!1}function H(){return[]}function I(a,b,c){var d=Ca(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return ja(e)&&(e=pc(e)),(Aa(e)||za(e))&&(e=Yb(e)),e}).concatAll()}function J(a,b,c){this.observer=a,this.selector=b,this.source=c,this.i=0,this.isStopped=!1}function K(a,b,c){var d=Ca(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return ja(e)&&(e=pc(e)),(Aa(e)||za(e))&&(e=Yb(e)),e}).mergeAll()}function L(a,b,c){this.observer=a,this.predicate=b,this.source=c,this.i=0,this.isStopped=!1}function M(a){var b=function(){this.cancelBubble=!0},c=function(){if(this.bubbledKeyCode=this.keyCode,this.ctrlKey)try{this.keyCode=0}catch(a){}this.defaultPrevented=!0,this.returnValue=!1,this.modified=!0};if(a||(a=Y.event),!a.target)switch(a.target=a.target||a.srcElement,"mouseover"==a.type&&(a.relatedTarget=a.fromElement),"mouseout"==a.type&&(a.relatedTarget=a.toElement),a.stopPropagation||(a.stopPropagation=b,a.preventDefault=c),a.type){case"keypress":var d="charCode"in a?a.charCode:a.keyCode;10==d?(d=0,a.keyCode=13):13==d||27==d?d=0:3==d&&(d=99),a.charCode=d,a.keyChar=a.charCode?String.fromCharCode(a.charCode):""}return a}function N(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),lb(function(){a.removeEventListener(b,c,!1)});if(a.attachEvent){var d=function(a){c(M(a))};return a.attachEvent("on"+b,d),lb(function(){a.detachEvent("on"+b,d)})}return a["on"+b]=c,lb(function(){a["on"+b]=null})}function O(a,b,c){var d=new ib;if("[object NodeList]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(O(a.item(e),b,c));else a&&d.add(N(a,b,c));return d}function P(a,b){return new wc(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function Q(a,b,c){return new wc(function(d){var e=a,f=tb(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 R(a,b){return new wc(function(c){return b.scheduleWithRelative(tb(a),function(){c.onNext(0),c.onCompleted()})})}function S(a,b,c){return a===b?new wc(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):Tb(function(){return Q(c.now()+a,b,c)})}function T(a,b,c){return new wc(function(d){var e,f=!1,g=new qb,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 pb,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 ib(e,g)},a)}function U(a,b,c){return Tb(function(){return T(a,b-c.now(),c)})}function V(a,b){return new wc(function(c){function d(){g&&(g=!1,c.onNext(f)),e&&c.onCompleted()}var e,f,g;return new ib(a.subscribe(function(a){g=!0,f=a},c.onError.bind(c),function(){e=!0}),b.subscribe(d,c.onError.bind(c),d))},a)}function W(a,b,c){return new wc(function(d){function e(a,b){j[b]=a;var e;if(g[b]=!0,h||(h=g.every(ea))){if(f)return void d.onError(f);try{e=c.apply(null,j)}catch(k){return void d.onError(k)}d.onNext(e)}i&&j[1]&&d.onCompleted()}var f,g=[!1,!1],h=!1,i=!1,j=new Array(2);return new ib(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)}var X={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},Y=X[typeof window]&&window||this,Z=X[typeof exports]&&exports&&!exports.nodeType&&exports,$=X[typeof module]&&module&&!module.nodeType&&module,_=$&&$.exports===Z&&Z,aa=X[typeof global]&&global;!aa||aa.global!==aa&&aa.window!==aa||(Y=aa);var ba={internals:{},config:{Promise:Y.Promise},helpers:{}},ca=ba.helpers.noop=function(){},da=(ba.helpers.notDefined=function(a){return"undefined"==typeof a},ba.helpers.isScheduler=function(a){return a instanceof ba.Scheduler}),ea=ba.helpers.identity=function(a){return a},fa=(ba.helpers.pluck=function(a){return function(b){return b[a]}},ba.helpers.just=function(a){return function(){return a}},ba.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),ga=ba.helpers.defaultComparer=function(a,b){return _a(a,b)},ha=ba.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},ia=(ba.helpers.defaultKeySerializer=function(a){return a.toString()},ba.helpers.defaultError=function(a){throw a}),ja=ba.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},ka=(ba.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},ba.helpers.not=function(a){return!a},ba.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==Pa.call(a)}),a}());ba.config.longStackSupport=!1;var la=!1;try{throw new Error}catch(ma){la=!!ma.stack}var na,oa=g(),pa="From previous event:",qa=ba.EmptyError=function(){this.message="Sequence contains no elements.",Error.call(this)};qa.prototype=Error.prototype;var ra=ba.ObjectDisposedError=function(){this.message="Object has been disposed",Error.call(this)};ra.prototype=Error.prototype;var sa=ba.ArgumentOutOfRangeError=function(){this.message="Argument out of range",Error.call(this)};sa.prototype=Error.prototype;var ta=ba.NotSupportedError=function(a){this.message=a||"This operation is not supported",Error.call(this)};ta.prototype=Error.prototype;var ua=ba.NotImplementedError=function(a){this.message=a||"This operation is not implemented",Error.call(this)};ua.prototype=Error.prototype;var va=ba.helpers.notImplemented=function(){throw new ua},wa=ba.helpers.notSupported=function(){throw new ta},xa="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";Y.Set&&"function"==typeof(new Y.Set)["@@iterator"]&&(xa="@@iterator");var ya=ba.doneEnumerator={done:!0,value:a},za=ba.helpers.isIterable=function(b){return b[xa]!==a},Aa=ba.helpers.isArrayLike=function(b){return b&&b.length!==a};ba.helpers.iterator=xa;var Ba,Ca=ba.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)}},Da=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Ea=Da.length,Fa="[object Arguments]",Ga="[object Array]",Ha="[object Boolean]",Ia="[object Date]",Ja="[object Error]",Ka="[object Function]",La="[object Number]",Ma="[object Object]",Na="[object RegExp]",Oa="[object String]",Pa=Object.prototype.toString,Qa=Object.prototype.hasOwnProperty,Ra=Pa.call(arguments)==Fa,Sa=Error.prototype,Ta=Object.prototype,Ua=String.prototype,Va=Ta.propertyIsEnumerable;try{Ba=!(Pa.call(document)==Ma&&!({toString:0}+""))}catch(ma){Ba=!0}var Wa={};Wa[Ga]=Wa[Ia]=Wa[La]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Wa[Ha]=Wa[Oa]={constructor:!0,toString:!0,valueOf:!0},Wa[Ja]=Wa[Ka]=Wa[Na]={constructor:!0,toString:!0},Wa[Ma]={constructor:!0};var Xa={};!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);Xa.enumErrorProps=Va.call(Sa,"message")||Va.call(Sa,"name"),Xa.enumPrototypes=Va.call(a,"prototype"),Xa.nonEnumArgs=0!=c,Xa.nonEnumShadows=!/valueOf/.test(b)}(1);var Ya=ba.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},Za=function(a){return a&&"object"==typeof a?Pa.call(a)==Fa:!1};Ra||(Za=function(a){return a&&"object"==typeof a?Qa.call(a,"callee"):!1});{var $a,_a=ba.internals.isEqual=function(a,b){return m(a,b,[],[])},ab={e:{}},bb=({}.hasOwnProperty,Array.prototype.slice),cb=this.inherits=ba.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},db=ba.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]}};ba.internals.addRef=function(a,b){return new wc(function(c){return new ib(b.getDisposable(),a.subscribe(c))})}}Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=bb.call(arguments,1),d=function(){function e(){}if(this instanceof d){e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(bb.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(bb.call(arguments)))};return d}),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c,d;if(null==this)throw new TypeError(" this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=0;f>d;){var g;d in e&&(g=e[d],a.call(c,g,d,e)),d++}});var eb=Object("a"),fb="a"!=eb[0]||!(0 in eb);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=fb&&{}.toString.call(this)==Oa?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=Ka)throw new TypeError(a+" is not a function");for(var f=0;d>f;f++)if(f in c&&!a.call(e,c[f],f,b))return!1;return!0}),Array.prototype.map||(Array.prototype.map=function(a){var b=Object(this),c=fb&&{}.toString.call(this)==Oa?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=Ka)throw new TypeError(a+" is not a function");for(var g=0;d>g;g++)g in c&&(e[g]=a.call(f,c[g],g,b));return e}),Array.prototype.filter||(Array.prototype.filter=function(a){for(var b,c=[],d=new Object(this),e=0,f=d.length>>>0;f>e;e++)b=d[e],e in d&&a.call(arguments[1],b,e,d)&&c.push(b);return c}),Array.isArray||(Array.isArray=function(a){return{}.toString.call(a)==Ga}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!==d?d=0:0!==d&&d!=1/0&&d!==-(1/0)&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1}),Object.prototype.propertyIsEnumerable||(Object.prototype.propertyIsEnumerable=function(a){for(var b in this)if(b===a)return!0;return!1}),Object.keys||(Object.keys=function(){"use strict";var a=Object.prototype.hasOwnProperty,b=!{toString:null}.propertyIsEnumerable("toString");return function(c){if("object"!=typeof c&&("function"!=typeof c||null===c))throw new TypeError("Object.keys called on non-object");var d,e,f=[];for(d in c)a.call(c,d)&&f.push(d);if(b)for(e=0;Ea>e;e++)a.call(c,Da[e])&&f.push(Da[e]);return f}}()),r.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var gb=ba.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},hb=gb.prototype;hb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},hb.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)}}},hb.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)}}},hb.peek=function(){return this.items[0].value},hb.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},hb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},hb.enqueue=function(a){var b=this.length++;this.items[b]=new r(gb.count++,a),this.percolate(b)},hb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},gb.count=0;var ib=ba.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(!nb(c[a]))throw new TypeError("Not a disposable");this.disposables=c,this.isDisposed=!1,this.length=c.length},jb=ib.prototype;jb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},jb.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},jb.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 kb=ba.Disposable=function(a){this.isDisposed=!1,this.action=a||ca};kb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var lb=kb.create=function(a){return new kb(a)},mb=kb.empty={dispose:ca},nb=kb.isDisposable=function(a){return a&&ka(a.dispose)},ob=kb.checkDisposed=function(a){if(a.isDisposed)throw new ra},pb=ba.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},b.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()},a}(),qb=ba.SerialDisposable=pb,rb=(ba.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?mb:new a(this)},b}(),ba.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||ha,this.disposable=new pb});rb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},rb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},rb.prototype.isCancelled=function(){return this.disposable.isDisposed},rb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var sb=ba.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(),mb}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=fa,a.normalize=function(a){return 0>a&&(a=0),a},a}(),tb=sb.normalize;!function(a){function b(a,b){function c(b){e(b,function(b){var d=!1,e=!1,g=a.scheduleWithState(b,function(a,b){return d?f.remove(g):e=!0,c(b),mb});e||(f.add(g),d=!0)})}var d=b[0],e=b[1],f=new ib;return c(d),f}function c(a,b,c){function d(b){f(b,function(b,e){var f=!1,h=!1,i=a[c](b,e,function(a,b){return f?g.remove(i):h=!0,d(b),mb});h||(g.add(i),f=!0)})}var e=b[0],f=b[1],g=new ib;return d(e),g}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState([a,c],b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative([a,d],b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute([a,d],b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(sb.prototype),function(){sb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},sb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof Y.setInterval)throw new ta;b=tb(b);var d=a,e=Y.setInterval(function(){d=c(d)},b);return lb(function(){Y.clearInterval(e)})}}(sb.prototype);var ub,vb,wb=sb.immediate=function(){function a(a,b){return b(this,a)}return new sb(fa,a,wa,wa)}(),xb=sb.currentThread=function(){function a(){for(;c.length>0;){var a=c.dequeue();!a.isCancelled()&&a.invoke()}}function b(b,d){var e=new rb(this,b,d,this.now());if(c)c.enqueue(e);else{c=new gb(4),c.enqueue(e);var f=o(a)();if(c=null,f===ab)return p(f.e)}return e.disposable}var c,d=new sb(fa,b,wa,wa);return d.scheduleRequired=function(){return!c},d}(),yb=(ba.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 pb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),function(){var a,b=ca;if(Y.WScript)a=function(a,b){Y.WScript.Sleep(b),a()};else{if(!Y.setTimeout)throw new ta;a=Y.setTimeout,b=Y.clearTimeout}return{setTimeout:a,clearTimeout:b}}()),zb=yb.setTimeout,Ab=yb.clearTimeout;!function(){function a(b){if(f)zb(function(){a(b)},0);else{var c=e[b];if(c){f=!0;var d=o(c)();if(vb(b),f=!1,d===ab)return p(d.e)}}}function b(){if(!Y.postMessage||Y.importScripts)return!1;var a=!1,b=Y.onmessage;return Y.onmessage=function(){a=!0},Y.postMessage("","*"),Y.onmessage=b,a}function c(b){"string"==typeof b.data&&b.data.substring(0,i.length)===i&&a(b.data.substring(i.length))}var d=1,e={},f=!1;vb=function(a){delete e[a]};var g=RegExp("^"+String(Pa).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),h="function"==typeof(h=aa&&_&&aa.setImmediate)&&!g.test(h)&&h;if(ka(h))ub=function(b){var c=d++;return e[c]=b,h(function(){a(c)}),c};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))ub=function(b){var c=d++;return e[c]=b,process.nextTick(function(){a(c)}),c};else if(b()){var i="ms.rx.schedule"+Math.random();Y.addEventListener?Y.addEventListener("message",c,!1):Y.attachEvent("onmessage",c,!1),ub=function(a){var b=d++;return e[b]=a,Y.postMessage(i+currentId,"*"),b}}else if(Y.MessageChannel){var j=new Y.MessageChannel;j.port1.onmessage=function(b){a(b.data)},ub=function(a){var b=d++;return e[b]=a,j.port2.postMessage(b),b}}else ub="document"in Y&&"onreadystatechange"in Y.document.createElement("script")?function(b){var c=Y.document.createElement("script"),f=d++;return e[f]=b,c.onreadystatechange=function(){a(f),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},Y.document.documentElement.appendChild(c),f}:function(b){var c=d++;return e[c]=b,zb(function(){a(c)},0),c}}();var Bb=sb.timeout=sb["default"]=function(){function a(a,b){var c=this,d=new pb,e=ub(function(){d.isDisposed||d.setDisposable(b(c,a))});return new ib(d,lb(function(){vb(e)}))}function b(a,b,c){var d=this,e=sb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new pb,g=zb(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new ib(f,lb(function(){Ab(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new sb(fa,a,b,c)}(),Cb=ba.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 da(a)||(a=wb),new wc(function(c){return a.scheduleWithState(b,function(a,b){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Db=Cb.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 Cb("N",d,null,a,b,c)}}(),Eb=Cb.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 Cb("E",null,d,a,b,c)}}(),Fb=Cb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){return new Cb("C",null,null,a,b,c)}}(),Gb=ba.internals.Enumerator=function(a){this._next=a};Gb.prototype.next=function(){return this._next()},Gb.prototype[xa]=function(){return this};var Hb=ba.internals.Enumerable=function(a){this._iterator=a};Hb.prototype[xa]=function(){return this._iterator()},Hb.prototype.concat=function(){var a=this;return new wc(function(b){var c,d=a[xa](),e=new qb,f=wb.scheduleRecursive(function(a){if(!c){try{var f=d.next()}catch(g){return b.onError(g)}if(f.done)return b.onCompleted();var h=f.value;ja(h)&&(h=pc(h));var i=new pb;e.setDisposable(i),i.setDisposable(h.subscribe(function(a){b.onNext(a)},function(a){b.onError(a)},a))}});return new ib(e,f,lb(function(){c=!0}))})},Hb.prototype.catchError=function(){var a=this;return new wc(function(b){var c,d=a[xa](),e=new qb,f=wb.scheduleRecursiveWithState(null,function(a,f){if(!c){try{var g=d.next()}catch(h){return observer.onError(h)}if(g.done)return void(null!==a?b.onError(a):b.onCompleted());var i=g.value;ja(i)&&(i=pc(i));var j=new pb;e.setDisposable(j),j.setDisposable(i.subscribe(function(a){b.onNext(a)},f,function(){b.onCompleted()}))}});return new ib(e,f,lb(function(){c=!0}))})},Hb.prototype.catchErrorWhen=function(a){var b=this;return new wc(function(c){var d,e,f=new zc,g=new zc,h=a(f),i=h.subscribe(g),j=b[xa](),k=new qb,l=wb.scheduleRecursive(function(a){if(!d){try{var b=j.next()}catch(h){return c.onError(h)}if(b.done)return void(e?c.onError(e):c.onCompleted());var i=b.value;ja(i)&&(i=pc(i));var l=new pb,m=new pb;k.setDisposable(new ib(m,l)),l.setDisposable(i.subscribe(function(a){c.onNext(a)},function(b){m.setDisposable(g.subscribe(a,function(a){c.onError(a)},function(){c.onCompleted()})),f.onNext(b)},function(){c.onCompleted()}))}});return new ib(i,k,l,lb(function(){d=!0}))})};var Ib,Jb=Hb.repeat=function(a,b){return null==b&&(b=-1),new Hb(function(){var c=b;return new Gb(function(){return 0===c?ya:(c>0&&c--,{done:!1,value:a})})})},Kb=Hb.of=function(a,b,c){if(b)var d=Ca(b,c,3);return new Hb(function(){var c=-1;return new Gb(function(){return++c<a.length?{done:!1,value:b?d(a[c],c,a):a[c]}:ya})})},Lb=ba.Observer=function(){},Mb=Lb.create=function(a,b,c){return a||(a=ca),b||(b=ia),c||(c=ca),new Ob(a,b,c)},Nb=ba.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return cb(b,a),b.prototype.next=va,b.prototype.error=va,b.prototype.completed=va,b.prototype.onNext=function(a){this.isStopped||this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(Lb),Ob=ba.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return cb(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}(Nb),Pb=ba.Observable=function(){function a(a){if(ba.config.longStackSupport&&la){try{throw new Error}catch(b){this.stack=b.stack.substring(b.stack.indexOf("\n")+1)}var d=this;this._subscribe=function(b){var e=b.onError.bind(b);return b.onError=function(a){c(a,d),e(a)},a.call(d,b)}}else this._subscribe=a}return Ib=a.prototype,Ib.subscribe=Ib.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:Mb(a,b,c))},Ib.subscribeOnNext=function(a,b){return this._subscribe(Mb("undefined"!=typeof b?function(c){a.call(b,c)}:a))},Ib.subscribeOnError=function(a,b){return this._subscribe(Mb(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},Ib.subscribeOnCompleted=function(a,b){return this._subscribe(Mb(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},a}(),Qb=ba.ObservableBase=function(a){function b(a){return a&&ka(a.dispose)?a:ka(a)?lb(a):mb}function c(a,c){var d=c[0],e=c[1],f=o(e.subscribeCore).call(e,d);return f!==ab||d.fail(ab.e)?void d.setDisposable(b(f)):p(ab.e)}function d(a){var b=new xc(a),d=[b,this];return xb.scheduleRequired()?xb.scheduleWithState(d,c):c(null,d),b}function e(){a.call(this,d)}return cb(e,a),e.prototype.subscribeCore=va,e}(Pb),Rb=ba.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 qb}return cb(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,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(Nb),Sb=function(a){function b(b){this.source=b,a.call(this)}return cb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new t(a))},b}(Qb);t.prototype.onNext=function(a){this.isStopped||this.a.push(a)},t.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},t.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onNext(this.a),this.observer.onCompleted())},t.prototype.dispose=function(){this.isStopped=!0},t.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},Ib.toArray=function(){return new Sb(this)},Pb.create=Pb.createWithDisposable=function(a,b){return new wc(a,b)};var Tb=Pb.defer=function(a){return new wc(function(b){var c;try{c=a()}catch(d){return cc(d).subscribe(b)}return ja(c)&&(c=pc(c)),c.subscribe(b)})},Ub=Pb.empty=function(a){return da(a)||(a=wb),new wc(function(b){return a.scheduleWithState(null,function(){b.onCompleted()})})},Vb=function(a){function b(b,c,d){this.iterable=b,this.mapper=c,this.scheduler=d,a.call(this)}return cb(b,a),b.prototype.subscribeCore=function(a){var b=new Wb(a,this);return b.run()},b}(Qb),Wb=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,b){try{var f=c.next()}catch(g){return d.onError(g);
  
  }if(f.done)return d.onCompleted();var h=f.value;if(e)try{h=e(h,a)}catch(g){return d.onError(g)}d.onNext(h),b(a+1)}var b=Object(this.parent.iterable),c=z(b),d=this.observer,e=this.parent.mapper;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}(),Xb=Math.pow(2,53)-1;u.prototype[xa]=function(){return new v(this._s)},v.prototype[xa]=function(){return this},v.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:ya},w.prototype[xa]=function(){return new x(this._a)},x.prototype[xa]=function(){return this},x.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:ya};var Yb=Pb.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!ka(b))throw new Error("mapFn when provided must be a function");if(b)var e=Ca(b,c,2);return da(d)||(d=xb),new Vb(a,e,d)},Zb=function(a){function b(b,c){this.args=b,this.scheduler=c,a.call(this)}return cb(b,a),b.prototype.subscribeCore=function(a){var b=new C(a,this);return b.run()},b}(Qb);C.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 $b=Pb.fromArray=function(a,b){return da(b)||(b=xb),new Zb(a,b)};Pb.never=function(){return new wc(function(){return mb})}}Pb.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new Zb(b,xb)},Pb.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 Zb(c,a)},Pb.pairs=function(a,b){return b||(b=ba.Scheduler.currentThread),new wc(function(c){var d=Object.keys(a),e=d.length;return b.scheduleRecursiveWithState(0,function(b,f){if(e>b){var g=d[b];c.onNext([g,a[g]]),f(b+1)}else c.onCompleted()})})};var _b=function(a){function b(b,c,d){this.start=b,this.count=c,this.scheduler=d,a.call(this)}return cb(b,a),b.prototype.subscribeCore=function(a){var b=new ac(a,this);return b.run()},b}(Qb),ac=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.count,d=this.observer;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}();Pb.range=function(a,b,c){return da(c)||(c=xb),new _b(a,b,c)},Pb.repeat=function(a,b,c){return da(c)||(c=xb),bc(a,c).repeat(null==b?-1:b)};var bc=Pb["return"]=Pb.just=Pb.returnValue=function(a,b){return da(b)||(b=wb),new wc(function(c){return b.scheduleWithState(a,function(a,b){c.onNext(b),c.onCompleted()})})},cc=Pb["throw"]=Pb.throwError=function(a,b){return da(b)||(b=wb),new wc(function(c){return b.schedule(function(){c.onError(a)})})};Pb.throwException=function(){return Pb.throwError.apply(null,arguments)},Ib["catch"]=Ib.catchError=Ib.catchException=function(a){return"function"==typeof a?E(this,a):dc([this,a])};var dc=Pb.catchError=Pb["catch"]=Pb.catchException=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 Kb(a).catchError()};Ib.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),ec.apply(this,b)};var ec=Pb.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop();return Array.isArray(b[0])&&(b=b[0]),new wc(function(a){function c(b){if(h[b]=!0,i||(i=h.every(ea))){try{var c=d.apply(null,k)}catch(e){return a.onError(e)}a.onNext(c)}else j.filter(function(a,c){return c!==b}).every(ea)&&a.onCompleted()}function e(b){j[b]=!0,j.every(ea)&&a.onCompleted()}for(var f=b.length,g=function(){return!1},h=q(f,g),i=!1,j=q(f,g),k=new Array(f),l=new Array(f),m=0;f>m;m++)!function(d){var f=b[d],g=new pb;ja(f)&&(f=pc(f)),g.setDisposable(f.subscribe(function(a){k[d]=a,c(d)},function(b){a.onError(b)},function(){e(d)})),l[d]=g}(m);return new ib(l)},this)};Ib.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),fc.apply(null,a)};var fc=Pb.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 Kb(a).concat()};Ib.concatAll=Ib.concatObservable=function(){return this.merge(1)};var gc=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return cb(b,a),b.prototype.subscribeCore=function(a){var b=new ib;return b.add(this.source.subscribe(new hc(a,this.maxConcurrent,b))),b},b}(Qb),hc=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 pb;this.g.add(c),ja(a)&&(a=pc(a)),c.setDisposable(a.subscribe(new b(this,c)))},a.prototype.onNext=function(a){this.isStopped||(this.activeCount<this.max?(this.activeCount++,this.handleSubscribe(a)):this.q.push(a))},a.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},a.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,0===this.activeCount&&this.o.onCompleted())},a.prototype.dispose=function(){this.isStopped=!0},a.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},b.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var 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}();Ib.merge=function(a){return"number"!=typeof a?ic(this,a):new gc(this,a)};var ic=Pb.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(da(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=wb,b=0;d>b;b++)c.push(arguments[b]);else for(a=wb,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),D(a,c).mergeAll()},jc=function(a){function b(b){this.source=b,a.call(this)}return cb(b,a),b.prototype.subscribeCore=function(a){var b=new ib,c=new pb;return b.add(c),c.setDisposable(this.source.subscribe(new kc(a,b))),b},b}(Qb),kc=function(){function a(a,b){this.o=a,this.g=b,this.isStopped=!1,this.done=!1}function b(a,b,c){this.parent=a,this.g=b,this.sad=c,this.isStopped=!1}return a.prototype.onNext=function(a){if(!this.isStopped){var c=new pb;this.g.add(c),ja(a)&&(a=pc(a)),c.setDisposable(a.subscribe(new b(this,this.g,c)))}},a.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},a.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,1===this.g.length&&this.o.onCompleted())},a.prototype.dispose=function(){this.isStopped=!0},a.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},b.prototype.onCompleted=function(){if(!this.isStopped){var a=this.parent;this.isStopped=!0,a.g.remove(this.sad),a.done&&1===a.g.length&&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}();Ib.mergeAll=Ib.mergeObservable=function(){return new jc(this)};var lc=ba.CompositeError=function(a){this.name="NotImplementedError",this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};lc.prototype=Error.prototype,Pb.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=D(null,a);return new wc(function(a){function b(){0===g.length?a.onCompleted():a.onError(1===g.length?g[0]:new lc(g))}var c=new ib,e=new pb,f=!1,g=[];return c.add(e),e.setDisposable(d.subscribe(function(d){var e=new pb;c.add(e),ja(d)&&(d=pc(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})},Ib.skipUntil=function(a){var b=this;return new wc(function(c){var d=!1,e=new ib(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));ja(a)&&(a=pc(a));var f=new pb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)},Ib["switch"]=Ib.switchLatest=function(){var a=this;return new wc(function(b){var c=!1,d=new qb,e=!1,f=0,g=a.subscribe(function(a){var g=new pb,h=++f;c=!0,d.setDisposable(g),ja(a)&&(a=pc(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},function(a){b.onError(a)},function(){e=!0,!c&&b.onCompleted()});return new ib(g,d)},a)},Ib.takeUntil=function(a){var b=this;return new wc(function(c){return ja(a)&&(a=pc(a)),new ib(b.subscribe(c),a.subscribe(function(){c.onCompleted()},function(a){c.onError(a)},ca))},b)},Ib.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;if("undefined"==typeof e)throw new Error("Source observable not found for withLatestFrom().");if("function"!=typeof d)throw new Error("withLatestFrom() expects a resultSelector function.");return Array.isArray(b[0])&&(b=b[0]),new wc(function(a){for(var c=function(){return!1},f=b.length,g=q(f,c),h=!1,i=new Array(f),j=new Array(f+1),k=0;f>k;k++)!function(c){var d=b[c],e=new pb;ja(d)&&(d=pc(d)),e.setDisposable(d.subscribe(function(a){i[c]=a,g[c]=!0,h=g.every(ea)},a.onError.bind(a),function(){})),j[c]=e}(k);var l=new pb;return l.setDisposable(e.subscribe(function(b){var c,e=[b].concat(i);if(h){try{c=d.apply(null,e)}catch(f){return void a.onError(f)}a.onNext(c)}},a.onError.bind(a),function(){a.onCompleted()})),j[f]=l,new ib(j)},this)},Ib.zip=function(){if(Array.isArray(arguments[0]))return F.apply(this,arguments);for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=this,e=b.pop();return b.unshift(d),new wc(function(a){function c(b){var c,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),c=e.apply(d,f)}catch(g){return void a.onError(g)}a.onNext(c)}else i.filter(function(a,c){return c!==b}).every(ea)&&a.onCompleted()}function f(b){i[b]=!0,i.every(function(a){return a})&&a.onCompleted()}for(var g=b.length,h=q(g,H),i=q(g,G),j=new Array(g),k=0;g>k;k++)!function(d){var e=b[d],g=new pb;ja(e)&&(e=pc(e)),g.setDisposable(e.subscribe(function(a){h[d].push(a),c(d)},function(b){a.onError(b)},function(){f(d)})),j[d]=g}(k);return new ib(j)},d)},Pb.zip=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.shift();return d.zip.apply(d,b)},Pb.zipArray=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new wc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(ea))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(ea)?void b.onCompleted():void 0}for(var e=a.length,f=q(e,function(){return[]}),g=q(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new pb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},function(a){b.onError(a)},function(){d(e)}))}(i);return new ib(h)})},Ib.asObservable=function(){var a=this;return new wc(function(b){return a.subscribe(b)},this)},Ib.dematerialize=function(){var a=this;return new wc(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)},Ib.distinctUntilChanged=function(a,b){var c=this;return b||(b=ga),new wc(function(d){var e,f=!1;return c.subscribe(function(c){var g=c;if(a)try{g=a(c)}catch(h){return void d.onError(h)}if(f)try{var i=b(e,g)}catch(h){return void d.onError(h)}f&&i||(f=!0,e=g,d.onNext(c))},function(a){d.onError(a)},function(){d.onCompleted()})},this)},Ib["do"]=Ib.tap=Ib.doAction=function(a,b,c){var d=this;return new wc(function(e){var f=!a||ka(a)?Mb(a||ca,b||ca,c||ca):a;return d.subscribe(function(a){try{f.onNext(a)}catch(b){e.onError(b)}e.onNext(a)},function(a){try{f.onError(a)}catch(b){e.onError(b)}e.onError(a)},function(){try{f.onCompleted()}catch(a){e.onError(a)}e.onCompleted()})},this)},Ib.doOnNext=Ib.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},Ib.doOnError=Ib.tapOnError=function(a,b){return this.tap(ca,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},Ib.doOnCompleted=Ib.tapOnCompleted=function(a,b){return this.tap(ca,null,"undefined"!=typeof b?function(){a.call(b)}:a)},Ib["finally"]=Ib.ensure=function(a){var b=this;return new wc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return lb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})},this)},Ib.finallyAction=function(a){return this.ensure(a)},Ib.ignoreElements=function(){var a=this;return new wc(function(b){return a.subscribe(ca,function(a){b.onError(a)},function(){b.onCompleted()})},a)},Ib.materialize=function(){var a=this;return new wc(function(b){return a.subscribe(function(a){b.onNext(Db(a))},function(a){b.onNext(Eb(a)),b.onCompleted()},function(){b.onNext(Fb()),b.onCompleted()})},a)},Ib.repeat=function(a){return Jb(this,a).concat()},Ib.retry=function(a){return Jb(this,a).catchError()},Ib.retryWhen=function(a){return Jb(this).catchErrorWhen(a)},Ib.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new wc(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},function(a){e.onError(a)},function(){!h&&c&&e.onNext(a),e.onCompleted()})},d)},Ib.skipLast=function(a){if(0>a)throw new sa;var b=this;return new wc(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)},Ib.startWith=function(){var a,b=0;arguments.length&&da(arguments[0])?(a=arguments[0],b=1):a=wb;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return Kb([$b(c,a),this]).concat()},Ib.takeLast=function(a){if(0>a)throw new sa;var b=this;return new wc(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)},Ib.selectConcat=Ib.concatMap=function(a,b,c){return ka(a)&&ka(b)?this.concatMap(function(c,d){var e=a(c,d);return ja(e)&&(e=pc(e)),(Aa(e)||za(e))&&(e=Yb(e)),e.map(function(a,e){return b(c,a,d,e)})}):ka(a)?I(this,a,c):I(this,function(){return a})};var mc=function(a){function b(b,c,d){this.source=b,this.selector=Ca(c,d,3),a.call(this)}return cb(b,a),b.prototype.internalMap=function(a,c){var d=this;return new b(this.source,function(b,c,e){return a.call(this,d.selector(b,c,e),c,e)},c)},b.prototype.subscribeCore=function(a){return this.source.subscribe(new J(a,this.selector,this))},b}(Qb);J.prototype.onNext=function(a){if(!this.isStopped){var b=o(this.selector).call(this,a,this.i++,this.source);return b===ab?this.observer.onError(b.e):void this.observer.onNext(b)}},J.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},J.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onCompleted())},J.prototype.dispose=function(){this.isStopped=!0},J.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},Ib.map=Ib.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof mc?this.internalMap(c,b):new mc(this,c,b)},Ib.pluck=function(){var b=arguments,c=arguments.length;if(0===c)throw new Error("List of properties cannot be empty.");return this.map(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})},Ib.selectMany=Ib.flatMap=function(a,b,c){return ka(a)&&ka(b)?this.flatMap(function(c,d){var e=a(c,d);return ja(e)&&(e=pc(e)),(Aa(e)||za(e))&&(e=Yb(e)),e.map(function(a,e){return b(c,a,d,e)})},c):ka(a)?K(this,a,c):K(this,function(){return a})},Ib.selectSwitch=Ib.flatMapLatest=Ib.switchMap=function(a,b){return this.select(a,b).switchLatest()},Ib.skip=function(a){if(0>a)throw new sa;var b=this;return new wc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},function(a){c.onError(a)},function(){c.onCompleted()})},b)},Ib.skipWhile=function(a,b){var c=this,d=Ca(a,b,3);return new wc(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)},Ib.take=function(a,b){if(0>a)throw new sa;if(0===a)return Ub(b);var c=this;return new wc(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)},Ib.takeWhile=function(a,b){var c=this,d=Ca(a,b,3);return new wc(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 nc=function(a){function b(b,c,d){this.source=b,this.predicate=Ca(c,d,3),a.call(this)}return cb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new L(a,this.predicate,this))},b.prototype.internalFilter=function(a,c){var d=this;return new b(this.source,function(b,c,e){return d.predicate(b,c,e)&&a.call(this,b,c,e)},c)},b}(Qb);L.prototype.onNext=function(a){if(!this.isStopped){var b=o(this.predicate).call(this,a,this.i++,this.source);return b===ab?this.observer.onError(b.e):void(b&&this.observer.onNext(a))}},L.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},L.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onCompleted())},L.prototype.dispose=function(){this.isStopped=!0},L.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},Ib.filter=Ib.where=function(a,b){return this instanceof nc?this.internalFilter(a,b):new nc(this,a,b)},Pb.fromCallback=function(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return new wc(function(d){function f(){for(var a=arguments.length,e=new Array(a),f=0;a>f;f++)e[f]=arguments[f];if(c){try{e=c.apply(b,e)}catch(g){return d.onError(g)}d.onNext(e)}else e.length<=1?d.onNext.apply(d,e):d.onNext(e);d.onCompleted()}e.push(f),a.apply(b,e)}).publishLast().refCount()}},Pb.fromNodeCallback=function(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return new wc(function(d){function f(a){if(a)return void d.onError(a);for(var e=arguments.length,f=[],g=1;e>g;g++)f[g-1]=arguments[g];if(c){try{f=c.apply(b,f)}catch(h){return d.onError(h)}d.onNext(f)}else f.length<=1?d.onNext.apply(d,f):d.onNext(f);d.onCompleted()}e.push(f),a.apply(b,e)}).publishLast().refCount()}},ba.config.useNativeEvents=!1,Pb.fromEvent=function(a,b,c){return a.addListener?oc(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c):ba.config.useNativeEvents||"function"!=typeof a.on||"function"!=typeof a.off?new wc(function(d){return O(a,b,function(a){var b=a;if(c)try{b=c(arguments)}catch(e){return d.onError(e)}d.onNext(b)})}).publish().refCount():oc(function(c){a.on(b,c)},function(c){a.off(b,c)},c)};var oc=Pb.fromEventPattern=function(a,b,c){return new wc(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return d.onError(e)}d.onNext(b)}var f=a(e);return lb(function(){b&&b(e,f)})}).publish().refCount()},pc=Pb.fromPromise=function(a){return Tb(function(){var b=new ba.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};Ib.toPromise=function(a){if(a||(a=ba.config.Promise),!a)throw new ta("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)})})},Pb.startAsync=function(a){var b;try{b=a()}catch(c){return cc(c)}return pc(b)},Ib.multicast=function(a,b){var c=this;return"function"==typeof a?new wc(function(d){var e=c.multicast(a());return new ib(b(e).subscribe(d),e.connect())},c):new qc(c,a)},Ib.publish=function(a){return a&&ka(a)?this.multicast(function(){return new zc},a):this.multicast(new zc)},Ib.share=function(){return this.publish().refCount()},Ib.publishLast=function(a){return a&&ka(a)?this.multicast(function(){return new Ac},a):this.multicast(new Ac)},Ib.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new Cc(b)},a):this.multicast(new Cc(a))},Ib.shareValue=function(a){return this.publishValue(a).refCount()},Ib.replay=function(a,b,c,d){return a&&ka(a)?this.multicast(function(){return new Dc(b,c,d)},a):this.multicast(new Dc(b,c,d))},Ib.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};{var qc=ba.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new ib(f.subscribe(c),lb(function(){e=!1}))),d},a.call(this,function(a){return c.subscribe(a)})}return cb(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new wc(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(Pb),rc=Pb.interval=function(a,b){return S(a,a,da(b)?b:Bb)};Pb.timer=function(b,c,d){var e;return da(d)||(d=Bb),c!==a&&"number"==typeof c?e=c:da(c)&&(d=c),b instanceof Date&&e===a?P(b.getTime(),d):b instanceof Date&&e!==a?(e=c,Q(b.getTime(),e,d)):e===a?R(b,d):S(b,e,d)}}Ib.delay=function(a,b){return da(b)||(b=Bb),a instanceof Date?U(this,a.getTime(),b):T(this,a,b)},Ib.debounce=Ib.throttleWithTimeout=function(a,b){da(b)||(b=Bb);var c=this;return new wc(function(d){var e,f=new qb,g=!1,h=0,i=c.subscribe(function(c){g=!0,e=c,h++;var i=h,j=new pb;f.setDisposable(j),j.setDisposable(b.scheduleWithRelative(a,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 ib(i,f)},this)},Ib.throttle=function(a,b){return this.debounce(a,b)},Ib.timestamp=function(a){return da(a)||(a=Bb),this.map(function(b){return{value:b,timestamp:a.now()}})},Ib.sample=Ib.throttleLatest=function(a,b){return da(b)||(b=Bb),"number"==typeof a?V(this,rc(a,b)):V(this,a)},Ib.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=cc(new Error(b||"Timeout"))),da(c)||(c=Bb);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new wc(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(ja(b)&&(b=pc(b)),j.setDisposable(b.subscribe(f)))}))}var h=0,i=new pb,j=new qb,k=!1,l=new qb;return j.setDisposable(i),g(),i.setDisposable(d.subscribe(function(a){k||(h++,f.onNext(a),g())},function(a){k||(h++,f.onError(a))},function(){k||(h++,f.onCompleted())})),new ib(j,l)},d)},Ib.throttleFirst=function(a,b){da(b)||(b=Bb);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new wc(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},function(b){a.onError(b)},function(){a.onCompleted()})},d)};var sc=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=mb,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=mb)});return new ib(c,d,e)}function c(c,d){this.source=c,this.controller=new zc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,a.call(this,b,c)}return cb(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(Pb);Ib.pausable=function(a){return new sc(this,a)};var tc=function(b){function c(b){var c,d=[],e=W(this.source,this.pauser.distinctUntilChanged().startWith(!1),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(e){if(c!==a&&e.shouldFire!=c){if(c=e.shouldFire,e.shouldFire)for(;d.length>0;)b.onNext(d.shift())}else c=e.shouldFire,e.shouldFire?b.onNext(e.data):d.push(e.data)},function(a){for(;d.length>0;)b.onNext(d.shift());b.onError(a)},function(){for(;d.length>0;)b.onNext(d.shift());b.onCompleted()});return e}function d(a,d){this.source=a,this.controller=new zc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,b.call(this,c,a)}return cb(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(Pb);Ib.pausableBuffered=function(a){return new tc(this,a)};var uc=function(a){function b(a){return this.source.subscribe(a)}function c(c,d){a.call(this,b,c),this.subject=new vc(d),this.source=c.multicast(this.subject).refCount()}return cb(c,a),c.prototype.request=function(a){return null==a&&(a=-1),this.subject.request(a)},c}(Pb),vc=function(a){function b(a){return this.subject.subscribe(a)}function c(c){null==c&&(c=!0),a.call(this,b),this.subject=new zc,this.enableQueue=c,this.queue=c?[]:null,this.requestedCount=0,this.requestedDisposable=mb,this.error=null,this.hasFailed=!1,this.hasCompleted=!1}return cb(c,a),db(c.prototype,Lb,{onCompleted:function(){this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length?this.queue.push(ba.Notification.createOnCompleted()):this.subject.onCompleted()},onError:function(a){this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length?this.queue.push(ba.Notification.createOnError(a)):this.subject.onError(a)},onNext:function(a){var b=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(ba.Notification.createOnNext(a)):(-1!==this.requestedCount&&0===this.requestedCount--&&this.disposeCurrentRequest(),b=!0),b&&this.subject.onNext(a)},_processRequest:function(a){if(this.enableQueue){for(;this.queue.length>=a&&a>0||this.queue.length>0&&"N"!==this.queue[0].kind;){var b=this.queue.shift();b.accept(this.subject),"N"===b.kind?a--:(this.disposeCurrentRequest(),this.queue=[])}return{numberOfItems:a,returnValue:0!==this.queue.length}}return{numberOfItems:a,returnValue:!1}},request:function(a){this.disposeCurrentRequest();var b=this,c=this._processRequest(a),a=c.numberOfItems;return c.returnValue?mb:(this.requestedCount=a,this.requestedDisposable=lb(function(){b.requestedCount=0}),this.requestedDisposable)},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=mb}}),c}(Pb);Ib.controlled=function(a){return null==a&&(a=!0),new uc(this,a)},Ib.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},Ib.transduce=function(a){function b(a){return{init:function(){return a},step:function(a,b){return a.onNext(b)},result:function(a){return a.onCompleted()}}}var c=this;return new wc(function(d){var e=a(b(d));return c.subscribe(function(a){try{e.step(d,a)}catch(b){d.onError(b)}},d.onError.bind(d),function(){e.result(d)})},c)};var wc=ba.AnonymousObservable=function(a){function b(a){return a&&ka(a.dispose)?a:ka(a)?lb(a):mb}function c(a,c){var d=c[0],e=c[1],f=o(e)(d);return f!==ab||d.fail(ab.e)?void d.setDisposable(b(f)):p(ab.e)}function d(b,d){function e(a){var d=new xc(a),e=[d,b];return xb.scheduleRequired()?xb.scheduleWithState(e,c):c(null,e),d}this.source=d,a.call(this,e)}return cb(d,a),d}(Pb),xc=function(a){function b(b){a.call(this),this.observer=b,this.m=new pb}cb(b,a);var c=b.prototype;return c.next=function(a){var b=o(this.observer.onNext).call(this.observer,a);b===ab&&(this.dispose(),p(b.e))},c.error=function(a){var b=o(this.observer.onError).call(this.observer,a);this.dispose(),b===ab&&p(b.e)},c.completed=function(){var a=o(this.observer.onCompleted).call(this.observer);this.dispose(),a===ab&&p(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}(Nb),yc=function(a,b){this.subject=a,this.observer=b};yc.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 zc=ba.Subject=function(a){function c(a){return ob(this),this.isStopped?this.hasError?(a.onError(this.error),mb):(a.onCompleted(),mb):(this.observers.push(a),new yc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return cb(d,a),db(d.prototype,Lb.prototype,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(ob(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(ob(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(ob(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 Bc(a,b)},d}(Pb),Ac=ba.AsyncSubject=function(a){function c(a){return ob(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),mb):(this.observers.push(a),new yc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return cb(d,a),db(d.prototype,Lb,{hasObservers:function(){return ob(this),this.observers.length>0},onCompleted:function(){var a,c;if(ob(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(ob(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){ob(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(Pb),Bc=ba.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 cb(c,a),db(c.prototype,Lb.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Pb),Cc=ba.BehaviorSubject=function(a){function c(a){return ob(this),this.isStopped?(this.hasError?a.onError(this.error):a.onCompleted(),mb):(this.observers.push(a),a.onNext(this.value),new yc(this,a))}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.hasError=!1}return cb(d,a),db(d.prototype,Lb,{getValue:function(){if(ob(this),this.hasError)throw this.error;return this.value},hasObservers:function(){return this.observers.length>0},onCompleted:function(){
  if(ob(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(ob(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(ob(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}(Pb),Dc=ba.ReplaySubject=function(a){function c(a,b){return lb(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(a){var b=new Rb(this.scheduler,a),d=c(this,b);ob(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||xb,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 cb(e,a),db(e.prototype,Lb.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(ob(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(ob(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(ob(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}(Pb);ba.Pauser=function(a){function b(){a.call(this)}return cb(b,a),b.prototype.pause=function(){this.onNext(!1)},b.prototype.resume=function(){this.onNext(!0)},b}(zc),"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Y.Rx=ba,define(function(){return ba})):Z&&$?_?($.exports=ba).Rx=ba:Z.Rx=ba:Y.Rx=ba;var Ec=g()}).call(this);
  //# sourceMappingURL=rx.lite.compat.map