/** @license Apache License 2.0 https://github.com/ReactiveX/RxJS/blob/master/LICENSE.txt **/ /** @license Apache License 2.0 https://github.com/ReactiveX/RxJS/blob/master/LICENSE.txt **/ /* ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. *****************************************************************************/ var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(l,k,x){if(x.get||x.set)throw new TypeError("ES3 does not support getters and setters.");l!=Array.prototype&&l!=Object.prototype&&(l[k]=x.value)};$jscomp.getGlobal=function(l){return"undefined"!=typeof window&&window===l?l:"undefined"!=typeof global&&null!=global?global:l};$jscomp.global=$jscomp.getGlobal(this); $jscomp.polyfill=function(l,k,x,B){if(k){x=$jscomp.global;l=l.split(".");for(B=0;B=c.length?c[0]:c,subject:e}))};k.source=c;q(d).apply(b,f.concat(k))===n&&a.add(h.schedule(ma,0,{err:n.e,subject:g}))}a.add(g.subscribe(e))}function Da(b){var a=b.subject;a.next(b.value);a.complete()}function ma(b){b.subject.error(b.err)} function A(b){return b&&"function"===typeof b.schedule}function Ea(b){return b&&"function"!==typeof b.subscribe&&"function"===typeof b.then}function r(b,a,c,e){var d=new Fa(b,c,e);if(d.closed)return null;if(a instanceof g)if(a._isScalar)d.next(a.value),d.complete();else return d.syncErrorThrowable=!0,a.subscribe(d);else if(a&&"number"===typeof a.length){b=0;for(c=a.length;b(a||0)?Number.POSITIVE_INFINITY:a;return function(e){return e.lift(new Wd(b, a,c))}}function tb(b,a){return function(c){return c.lift(new Xd(b,a))}}function da(b,a){return function(c){return c.lift(new Yd(b,a))}}function ub(b){return function(a){return a.lift(new Zd(b))}}function vb(b){return ub(b)(this)}function wb(b,a){if("function"!==typeof b)throw new TypeError("predicate is not a function");return function(c){return c.lift(new xb(b,c,!1,a))}}function yb(b,a){return function(c){return c.lift(new xb(b,c,!0,a))}}function zb(b,a,c){return function(e){return e.lift(new $d(b, a,c,e))}}function Ab(b,a,c,e){return function(d){return d.lift(new ae(b,a,c,e))}}function Bb(){return function(b){return b.lift(new be)}}function Cb(){return function(b){return b.lift(new ce)}}function sa(b){return function(a){return a.lift(new de(b))}}function Db(b,a){void 0===a&&(a=u);return sa(function(){return Eb(b,a)})}function Fb(b,a,c){return function(e){return e.lift(new ee(b,a,c,e))}}function Gb(b){return b(this)}function Hb(b,a){return function(c){return c.lift(new fe(b,a,c))}}function Ib(b){return function(a){return a.lift(new ge(b))}} function Jb(){return function(b){return b.lift(new he)}}function W(b,a){var c=!1;2<=arguments.length&&(c=!0);return function(e){return e.lift(new ie(b,a,c))}}function ea(b){return function(a){return 0===b?new F:a.lift(new je(b))}}function Q(b,a){return 2<=arguments.length?function(c){return la(W(b,a),ea(1),qa(a))(c)}:function(c){return la(W(function(c,a,f){return b(c,a,f+1)}),ea(1))(c)}}function Kb(b){return Q("function"===typeof b?function(a,c){return 0c?a:c})} function Lb(){for(var b=[],a=0;ab(a,c)?a:c}:function(a,c){return ab?a.lift(new ac(-1,a)):a.lift(new ac(b- 1,a))}}function bc(b){return function(a){return a.lift(new se(b))}}function cc(b){void 0===b&&(b=-1);return function(a){return a.lift(new te(b,a))}}function dc(b){return function(a){return a.lift(new ue(b,a))}}function ec(b){return function(a){return a.lift(new ve(b))}}function fc(b,a){void 0===a&&(a=u);return function(c){return c.lift(new we(b,a))}}function xe(b){var a=b.period;b.subscriber.notifyNext();this.schedule(b,a)}function gc(b,a){return function(c){return c.lift(new ye(b,a))}}function ze(){return new w} function hc(){return function(b){return ta()(H(ze)(b))}}function ic(b,a,c){return function(e){return e.lift(Ae(b,a,c))}}function Ae(b,a,c){var e,d=0,f,h=!1,g=!1;return function(k){d++;if(!e||h)h=!1,e=new M(b,a,c),f=k.subscribe({next:function(c){e.next(c)},error:function(c){h=!0;e.error(c)},complete:function(){g=!0;e.complete()}});var z=e.subscribe(this);return function(){d--;z.unsubscribe();f&&0===d&&g&&f.unsubscribe()}}}function jc(b){return function(a){return a.lift(new Be(b,a))}}function kc(b){return function(a){return a.lift(new Ce(b))}} function lc(b){return function(a){return a.lift(new De(b))}}function mc(b){return function(a){return a.lift(new Ee(b))}}function nc(b){return function(a){return a.lift(new Fe(b))}}function oc(){for(var b=[],a=0;a=c.length?c[0]:c),b.complete())},f.source=this,q(b).apply(this.context,d.concat(f))===n&&h.error(n.e));return h.subscribe(c)};a.dispatch= function(c){var a=this,b=c.source,f=c.subscriber;c=c.context;var h=b.callbackFunc,g=b.args,k=b.scheduler,l=b.subject;if(!l){var l=b.subject=new P,m=function md(){for(var c=[],b=0;b=c.length?c[0]:c,subject:e}))};m.source=b;q(h).apply(c,g.concat(m))===n&&l.error(n.e)}a.add(l.subscribe(f))}; return a}(g).create;g.bindCallback=df;var ef=function(b){function a(c,a,d,f,h){b.call(this);this.callbackFunc=c;this.selector=a;this.args=d;this.context=f;this.scheduler=h}k(a,b);a.create=function(c,b,d){void 0===b&&(b=void 0);return function(){for(var e=[],h=0;h=c.length?c[0]:c),b.complete())},f.source=this,q(a).apply(this.context,b.concat(f))===n&&h.error(n.e));return h.subscribe(c)};return a}(g).create;g.bindNodeCallback=ef;var ua=function(b){function a(c,a){b.call(this);this.value=c;this.scheduler=a;this._isScalar= !0;a&&(this._isScalar=!1)}k(a,b);a.create=function(c,b){return new a(c,b)};a.dispatch=function(c){var a=c.value,b=c.subscriber;c.done?b.complete():(b.next(a),b.closed||(c.done=!0,this.schedule(c)))};a.prototype._subscribe=function(c){var b=this.value,d=this.scheduler;if(d)return d.schedule(a.dispatch,0,{done:!1,value:b,subscriber:c});c.next(b);c.closed||c.complete()};return a}(g),F=function(b){function a(c){b.call(this);this.scheduler=c}k(a,b);a.create=function(c){return new a(c)};a.dispatch=function(c){c.subscriber.complete()}; a.prototype._subscribe=function(c){var b=this.scheduler;if(b)return b.schedule(a.dispatch,0,{subscriber:c});c.complete()};return a}(g),G=function(b){function a(c,a){b.call(this);this.array=c;this.scheduler=a;a||1!==c.length||(this._isScalar=!0,this.value=c[0])}k(a,b);a.create=function(c,b){return new a(c,b)};a.of=function(){for(var c=[],b=0;b=c.count?f.complete():(f.next(a[b]),f.closed||(c.index=b+1,this.schedule(c)))};a.prototype._subscribe=function(c){var b=this.array,d=b.length,f=this.scheduler;if(f)return f.schedule(a.dispatch,0,{array:b,index:0,count:d,subscriber:c});for(f=0;fe?-1:1;b=e*Math.floor(Math.abs(b));b=0>=b?0:b>Sc?Sc:b}this.arr=a;this.idx=c;this.len=b}b.prototype[C]=function(){return this};b.prototype.next=function(){return this.idx=c.length?f.complete():(f.next(a[b]),c.index=b+1,this.schedule(c)))};a.prototype._subscribe=function(c){var b=this.arrayLike,d=this.scheduler,f=b.length;if(d)return d.schedule(a.dispatch,0,{arrayLike:b,index:0,length:f,subscriber:c});for(d= 0;dc)this.period=0;a&&"function"===typeof a.schedule||(this.scheduler=u)}k(a,b);a.create=function(c,b){void 0===c&&(c=0);void 0===b&&(b=u);return new a(c,b)};a.dispatch=function(c){var a=c.subscriber,b=c.period;a.next(c.index);a.closed||(c.index+=1,this.schedule(c,b))};a.prototype._subscribe=function(c){var b=this.period;c.add(this.scheduler.schedule(a.dispatch,b,{index:0,subscriber:c,period:b}))};return a}(g).create;g.interval= wf;g.merge=Ma;var qd=function(){function b(){}b.prototype.call=function(a,c){return c.subscribe(new xf(a))};return b}(),xf=function(b){function a(c){b.call(this,c);this.hasFirst=!1;this.observables=[];this.subscriptions=[]}k(a,b);a.prototype._next=function(c){this.observables.push(c)};a.prototype._complete=function(){var c=this.observables,a=c.length;if(0===a)this.destination.complete();else{for(var b=0;b=c.count?f.complete():(f.next(a),f.closed||(c.index=b+1,c.start=a+1,this.schedule(c)))};a.prototype._subscribe=function(c){var b= 0,d=this.start,f=this._count,h=this.scheduler;if(h)return h.schedule(a.dispatch,0,{index:b,count:f,start:d,subscriber:c});do{if(b++>=f){c.complete();break}c.next(d++);if(c.closed)break}while(1)};return a}(g).create;g.range=Bf;var Df=function(b){function a(c,a){b.call(this);this.resourceFactory=c;this.observableFactory=a}k(a,b);a.create=function(c,b){return new a(c,b)};a.prototype._subscribe=function(c){var a=this.resourceFactory,b=this.observableFactory,f;try{return f=a(),new Cf(c,f,b)}catch(h){c.error(h)}}; return a}(g),Cf=function(b){function a(c,a,d){b.call(this,c);this.resource=a;this.observableFactory=d;c.add(a);this.tryUse()}k(a,b);a.prototype.tryUse=function(){try{var c=this.observableFactory.call(this,this.resource);c&&this.add(r(this,c))}catch(e){this._error(e)}};return a}(t);g.using=Df.create;var Ef=function(b){function a(c,a){b.call(this);this.error=c;this.scheduler=a}k(a,b);a.create=function(c,b){return new a(c,b)};a.dispatch=function(c){c.subscriber.error(c.error)};a.prototype._subscribe= function(c){var b=this.error,d=this.scheduler;c.syncErrorThrowable=!0;if(d)return d.schedule(a.dispatch,0,{error:b,subscriber:c});c.error(b)};return a}(g).create;g.throw=Ef;var Eb=function(b){function a(c,a,d){void 0===c&&(c=0);b.call(this);this.period=-1;this.dueTime=0;K(a)?this.period=1>Number(a)&&1||Number(a):A(a)&&(d=a);A(d)||(d=u);this.scheduler=d;this.dueTime=ca(c)?+c-this.scheduler.now():c}k(a,b);a.create=function(c,b,d){void 0===c&&(c=0);return new a(c,b,d)};a.dispatch=function(c){var a=c.index, b=c.period,f=c.subscriber;f.next(a);if(!f.closed){if(-1===b)return f.complete();c.index=a+1;this.schedule(c,b)}};a.prototype._subscribe=function(c){return this.scheduler.schedule(a.dispatch,this.dueTime,{index:0,period:this.period,subscriber:c})};return a}(g).create;g.timer=Eb;var Sa=function(){function b(a){this.project=a}b.prototype.call=function(a,c){return c.subscribe(new Ff(a,this.project))};return b}(),Ff=function(b){function a(c,a,d){void 0===d&&(d=Object.create(null));b.call(this,c);this.iterators= [];this.active=0;this.project="function"===typeof a?a:null;this.values=d}k(a,b);a.prototype._next=function(c){var a=this.iterators;E(c)?a.push(new Gf(c)):"function"===typeof c[C]?a.push(new Hf(c[C]())):a.push(new If(this.destination,this,c))};a.prototype._complete=function(){var c=this.iterators,a=c.length;if(0===a)this.destination.complete();else{this.active=a;for(var b=0;bthis.index};b.prototype.hasCompleted=function(){return this.array.length===this.index};return b}(),If=function(b){function a(c,a,d){b.call(this,c);this.parent=a;this.observable=d;this.stillUnsubscribed=!0;this.buffer=[];this.isComplete=!1}k(a,b);a.prototype[C]=function(){return this};a.prototype.next=function(){var c=this.buffer;return 0===c.length&&this.isComplete? {value:null,done:!0}:{value:c.shift(),done:!1}};a.prototype.hasValue=function(){return 0e;e++)try{a=b[e];new p.ActiveXObject(a);break}catch(N){}c=new p.ActiveXObject(a)}catch(N){throw Error("XMLHttpRequest is not supported by your browser"); }}return c},crossDomain:!1,withCredentials:!1,headers:{},method:"GET",responseType:"json",timeout:0};if("string"===typeof c)a.url=c;else for(var d in c)c.hasOwnProperty(d)&&(a[d]=c[d]);this.request=a}k(a,b);a.prototype._subscribe=function(c){return new Kf(c,this.request)};a.create=function(){var c=function(c){return new a(c)};c.get=td;c.post=ud;c.delete=vd;c.put=wd;c.patch=xd;c.getJSON=yd;return c}();return a}(g),Kf=function(b){function a(c,a){b.call(this,c);this.request=a;this.done=!1;c=a.headers= a.headers||{};a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");"Content-Type"in c||p.FormData&&a.body instanceof p.FormData||"undefined"===typeof a.body||(c["Content-Type"]="application/x-www-form-urlencoded; charset\x3dUTF-8");a.body=this.serializeBody(a.body,a.headers["Content-Type"]);this.send()}k(a,b);a.prototype.next=function(c){this.done=!0;var a=this.destination;c=new Wc(c,this.xhr,this.request);a.next(c)};a.prototype.send=function(){var a=this.request,b=this.request, d=b.user,f=b.method,h=b.url,g=b.async,k=b.password,l=b.headers,b=b.body,m=q(a.createXHR).call(a);if(m===n)this.error(n.e);else{this.xhr=m;this.setupEvents(m,a);d=d?q(m.open).call(m,f,h,g,d,k):q(m.open).call(m,f,h,g);if(d===n)return this.error(n.e),null;g&&(m.timeout=a.timeout,m.responseType=a.responseType);"withCredentials"in m&&(m.withCredentials=!!a.withCredentials);this.setHeaders(m,l);d=b?q(m.send).call(m,b):q(m.send).call(m);if(d===n)return this.error(n.e),null}return m};a.prototype.serializeBody= function(a,b){if(!a||"string"===typeof a||p.FormData&&a instanceof p.FormData)return a;if(b){var c=b.indexOf(";");-1!==c&&(b=b.substring(0,c))}switch(b){case "application/x-www-form-urlencoded":return Object.keys(a).map(function(c){return encodeURIComponent(c)+"\x3d"+encodeURIComponent(a[c])}).join("\x26");case "application/json":return JSON.stringify(a);default:return a}};a.prototype.setHeaders=function(a,b){for(var c in b)b.hasOwnProperty(c)&&a.setRequestHeader(c,b[c])};a.prototype.setupEvents= function(a,b){function c(a){var b=c.subscriber,e=c.progressSubscriber,d=c.request;e&&e.error(a);b.error(new Xc(this,d))}function e(a){var c=e.subscriber,b=e.progressSubscriber,d=e.request;if(4===this.readyState){var f=1223===this.status?204:this.status,h="text"===this.responseType?this.response||this.responseText:this.response;0===f&&(f=h?200:0);200<=f&&300>f?(b&&b.complete(),c.next(a),c.complete()):(b&&b.error(a),c.error(new ia("ajax error "+f,this,d)))}}var h=b.progressSubscriber;a.ontimeout=c; c.request=b;c.subscriber=this;c.progressSubscriber=h;if(a.upload&&"withCredentials"in a){if(h){var g;g=function(a){g.progressSubscriber.next(a)};p.XDomainRequest?a.onprogress=g:a.upload.onprogress=g;g.progressSubscriber=h}var k;k=function(a){var c=k.progressSubscriber,b=k.subscriber,e=k.request;c&&c.error(a);b.error(new ia("ajax error",this,e))};a.onerror=k;k.request=b;k.subscriber=this;k.progressSubscriber=h}a.onreadystatechange=e;e.subscriber=this;e.progressSubscriber=h;e.request=b};a.prototype.unsubscribe= function(){var a=this.xhr;!this.done&&a&&4!==a.readyState&&"function"===typeof a.abort&&a.abort();b.prototype.unsubscribe.call(this)};return a}(m),Wc=function(){return function(b,a,c){this.originalEvent=b;this.xhr=a;this.request=c;this.status=a.status;this.responseType=a.responseType||c.responseType;this.response=Ta(this.responseType,a)}}(),ia=function(b){function a(a,e,d){b.call(this,a);this.message=a;this.xhr=e;this.request=d;this.status=e.status;this.responseType=e.responseType||d.responseType; this.response=Ta(this.responseType,e)}k(a,b);return a}(Error),Xc=function(b){function a(a,e){b.call(this,"ajax timeout",a,e)}k(a,b);return a}(ia);g.ajax=L.create;var Lf=function(b){function a(a,e){b.call(this,a,e);this.scheduler=a;this.work=e}k(a,b);a.prototype.schedule=function(a,e){void 0===e&&(e=0);if(0a?1:a;this._windowTime=1>e?1:e}k(a,b); a.prototype.next=function(a){var c=this._getNow();this._events.push(new Mf(c,a));this._trimBufferThenGetEvents();b.prototype.next.call(this,a)};a.prototype._subscribe=function(a){var c=this._trimBufferThenGetEvents(),b=this.scheduler,f;if(this.closed)throw new I;this.hasError?f=v.EMPTY:this.isStopped?f=v.EMPTY:(this.observers.push(a),f=new Oc(this,a));b&&a.add(a=new xa(a,b));for(var b=c.length,h=0;hb&&(g=Math.max(g,h-b));0d)?this.add(a.closeAction=h.schedule(Xa,e,{subscriber:this,context:a,bufferTimeSpan:e})):(f={bufferTimeSpan:e,bufferCreationInterval:d,subscriber:this,scheduler:h},this.add(a.closeAction=h.schedule(Ya,e,{subscriber:this,context:a})),this.add(h.schedule(Ed,d,f)))}k(a,b);a.prototype._next=function(a){for(var c=this.contexts,b=c.length,f,h=0;h=b[0].time-f.now();)b.shift().notification.observe(h);0(a||0)?Number.POSITIVE_INFINITY:a;return sb(b,a,c)(this)};var R=function(b){function a(){var a=b.call(this,"argument out of range");this.name=a.name="ArgumentOutOfRangeError";this.stack=a.stack;this.message=a.message}k(a,b);return a}(Error),Xd=function(){function b(a,c){this.index=a;this.defaultValue= c;if(0>a)throw new R;}b.prototype.call=function(a,c){return c.subscribe(new mg(a,this.index,this.defaultValue))};return b}(),mg=function(b){function a(a,e,d){b.call(this,a);this.index=e;this.defaultValue=d}k(a,b);a.prototype._next=function(a){0===this.index--&&(this.destination.next(a),this.destination.complete())};a.prototype._complete=function(){var a=this.destination;0<=this.index&&("undefined"!==typeof this.defaultValue?a.next(this.defaultValue):a.error(new R));a.complete()};return a}(m);g.prototype.elementAt= function(b,a){return tb(b,a)(this)};var Yd=function(){function b(a,c){this.predicate=a;this.thisArg=c}b.prototype.call=function(a,c){return c.subscribe(new ng(a,this.predicate,this.thisArg))};return b}(),ng=function(b){function a(a,e,d){b.call(this,a);this.predicate=e;this.thisArg=d;this.count=0}k(a,b);a.prototype._next=function(a){var c;try{c=this.predicate.call(this.thisArg,a,this.count++)}catch(d){this.destination.error(d);return}c&&this.destination.next(a)};return a}(m);g.prototype.filter=function(b, a){return da(b,a)(this)};var Zd=function(){function b(a){this.callback=a}b.prototype.call=function(a,c){return c.subscribe(new og(a,this.callback))};return b}(),og=function(b){function a(a,e){b.call(this,a);this.add(new v(e))}k(a,b);return a}(m);g.prototype.finally=vb;g.prototype._finally=vb;var xb=function(){function b(a,c,b,d){this.predicate=a;this.source=c;this.yieldIndex=b;this.thisArg=d}b.prototype.call=function(a,c){return c.subscribe(new pg(a,this.predicate,this.source,this.yieldIndex,this.thisArg))}; return b}(),pg=function(b){function a(a,e,d,f,h){b.call(this,a);this.predicate=e;this.source=d;this.yieldIndex=f;this.thisArg=h;this.index=0}k(a,b);a.prototype.notifyComplete=function(a){var c=this.destination;c.next(a);c.complete()};a.prototype._next=function(a){var c=this.predicate,b=this.thisArg,f=this.index++;try{c.call(b||this,a,f,this.source)&&this.notifyComplete(this.yieldIndex?f:a)}catch(h){this.destination.error(h)}};a.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1: void 0)};return a}(m);g.prototype.find=function(b,a){return wb(b,a)(this)};g.prototype.findIndex=function(b,a){return yb(b,a)(this)};var ja=function(b){function a(){var a=b.call(this,"no elements in sequence");this.name=a.name="EmptyError";this.stack=a.stack;this.message=a.message}k(a,b);return a}(Error),$d=function(){function b(a,c,b,d){this.predicate=a;this.resultSelector=c;this.defaultValue=b;this.source=d}b.prototype.call=function(a,c){return c.subscribe(new qg(a,this.predicate,this.resultSelector, this.defaultValue,this.source))};return b}(),qg=function(b){function a(a,e,d,f,h){b.call(this,a);this.predicate=e;this.resultSelector=d;this.defaultValue=f;this.source=h;this.index=0;this._emitted=this.hasCompleted=!1}k(a,b);a.prototype._next=function(a){var c=this.index++;this.predicate?this._tryPredicate(a,c):this._emit(a,c)};a.prototype._tryPredicate=function(a,b){var c;try{c=this.predicate(a,b,this.source)}catch(f){this.destination.error(f);return}c&&this._emit(a,b)};a.prototype._emit=function(a, b){this.resultSelector?this._tryResultSelector(a,b):this._emitFinal(a)};a.prototype._tryResultSelector=function(a,b){var c;try{c=this.resultSelector(a,b)}catch(f){this.destination.error(f);return}this._emitFinal(c)};a.prototype._emitFinal=function(a){var c=this.destination;this._emitted||(this._emitted=!0,c.next(a),c.complete(),this.hasCompleted=!0)};a.prototype._complete=function(){var a=this.destination;this.hasCompleted||"undefined"===typeof this.defaultValue?this.hasCompleted||a.error(new ja): (a.next(this.defaultValue),a.complete())};return a}(m);g.prototype.first=function(b,a,c){return zb(b,a,c)(this)};var rg=function(){function b(){this.size=0;this._values=[];this._keys=[]}b.prototype.get=function(a){a=this._keys.indexOf(a);return-1===a?void 0:this._values[a]};b.prototype.set=function(a,c){var b=this._keys.indexOf(a);-1===b?(this._keys.push(a),this._values.push(c),this.size++):this._values[b]=c;return this};b.prototype.delete=function(a){a=this._keys.indexOf(a);if(-1===a)return!1;this._values.splice(a, 1);this._keys.splice(a,1);this.size--;return!0};b.prototype.clear=function(){this._keys.length=0;this.size=this._values.length=0};b.prototype.forEach=function(a,c){for(var b=0;bthis.total)throw new R;}b.prototype.call=function(a,c){return c.subscribe(new Fg(a,this.total))};return b}(),Fg=function(b){function a(a,e){b.call(this,a);this.total=e;this.ring=[];this.count=0}k(a,b);a.prototype._next=function(a){var c=this.ring,b=this.total,f=this.count++;c.length=this.total?this.total:this.count,f=this.ring,h=0;h=b?this.connection=null:(a._refCount=b-1,1=b?this.connection=null:(a._refCount=b-1,1this.total&&this.destination.next(a)};return a}(m);g.prototype.skip=function(b){return kc(b)(this)};var De=function(){function b(a){this._skipCount=a;if(0>this._skipCount)throw new R;}b.prototype.call= function(a,b){return 0===this._skipCount?b.subscribe(new m(a)):b.subscribe(new Vg(a,this._skipCount))};return b}(),Vg=function(b){function a(a,e){b.call(this,a);this._skipCount=e;this._count=0;this._ring=Array(e)}k(a,b);a.prototype._next=function(a){var b=this._skipCount,c=this._count++;if(ce)this.delayTime=0;d&&"function"===typeof d.schedule||(this.scheduler=ka)}k(a,b);a.create=function(b,e,d){void 0===e&&(e=0);void 0===d&&(d= ka);return new a(b,e,d)};a.dispatch=function(a){return this.add(a.source.subscribe(a.subscriber))};a.prototype._subscribe=function(b){return this.scheduler.schedule(a.dispatch,this.delayTime,{source:this.source,subscriber:b})};return a}(g),He=function(){function b(a,b){this.scheduler=a;this.delay=b}b.prototype.call=function(a,b){return(new Zg(b,this.delay,this.scheduler)).subscribe(a)};return b}();g.prototype.subscribeOn=function(b,a){void 0===a&&(a=0);return Ge(b,a)(this)};var Ie=function(){function b(a, b){this.project=a;this.resultSelector=b}b.prototype.call=function(a,b){return b.subscribe(new $g(a,this.project,this.resultSelector))};return b}(),$g=function(b){function a(a,e,d){b.call(this,a);this.project=e;this.resultSelector=d;this.index=0}k(a,b);a.prototype._next=function(a){var b,c=this.index++;try{b=this.project(a,c)}catch(f){this.destination.error(f);return}this._innerSub(b,a,c)};a.prototype._innerSub=function(a,b,d){var c=this.innerSubscription;c&&c.unsubscribe();this.add(this.innerSubscription= r(this,a,b,d))};a.prototype._complete=function(){var a=this.innerSubscription;a&&!a.closed||b.prototype._complete.call(this)};a.prototype._unsubscribe=function(){this.innerSubscription=null};a.prototype.notifyComplete=function(a){this.remove(a);this.innerSubscription=null;this.isStopped&&b.prototype._complete.call(this)};a.prototype.notifyNext=function(a,b,d,f,h){this.resultSelector?this._tryNotifyNext(a,b,d,f):this.destination.next(b)};a.prototype._tryNotifyNext=function(a,b,d,f){var c;try{c=this.resultSelector(a, b,d,f)}catch(z){this.destination.error(z);return}this.destination.next(c)};return a}(t);g.prototype.switch=qc;g.prototype._switch=qc;g.prototype.switchMap=function(b,a){return va(b,a)(this)};var Je=function(){function b(a,b){this.observable=a;this.resultSelector=b}b.prototype.call=function(a,b){return b.subscribe(new ah(a,this.observable,this.resultSelector))};return b}(),ah=function(b){function a(a,e,d){b.call(this,a);this.inner=e;this.resultSelector=d;this.index=0}k(a,b);a.prototype._next=function(a){var b= this.innerSubscription;b&&b.unsubscribe();this.add(this.innerSubscription=r(this,this.inner,a,this.index++))};a.prototype._complete=function(){var a=this.innerSubscription;a&&!a.closed||b.prototype._complete.call(this)};a.prototype._unsubscribe=function(){this.innerSubscription=null};a.prototype.notifyComplete=function(a){this.remove(a);this.innerSubscription=null;this.isStopped&&b.prototype._complete.call(this)};a.prototype.notifyNext=function(a,b,d,f,h){h=this.destination;this.resultSelector?this.tryResultSelector(a, b,d,f):h.next(b)};a.prototype.tryResultSelector=function(a,b,d,f){var c=this.resultSelector,e=this.destination,g;try{g=c(a,b,d,f)}catch(N){e.error(N);return}e.next(g)};return a}(t);g.prototype.switchMapTo=function(b,a){return rc(b,a)(this)};var Ke=function(){function b(a){this.total=a;if(0>this.total)throw new R;}b.prototype.call=function(a,b){return b.subscribe(new bh(a,this.total))};return b}(),bh=function(b){function a(a,e){b.call(this,a);this.total=e;this.count=0}k(a,b);a.prototype._next=function(a){var b= this.total,c=++this.count;c<=b&&(this.destination.next(a),c===b&&(this.destination.complete(),this.unsubscribe()))};return a}(m);g.prototype.take=function(b){return sc(b)(this)};g.prototype.takeLast=function(b){return ea(b)(this)};var Le=function(){function b(a){this.notifier=a}b.prototype.call=function(a,b){return b.subscribe(new ch(a,this.notifier))};return b}(),ch=function(b){function a(a,e){b.call(this,a);this.notifier=e;this.add(r(this,e))}k(a,b);a.prototype.notifyNext=function(a,b,d,f,h){this.complete()}; a.prototype.notifyComplete=function(){};return a}(t);g.prototype.takeUntil=function(b){return tc(b)(this)};var Me=function(){function b(a){this.predicate=a}b.prototype.call=function(a,b){return b.subscribe(new dh(a,this.predicate))};return b}(),dh=function(b){function a(a,e){b.call(this,a);this.predicate=e;this.index=0}k(a,b);a.prototype._next=function(a){var b=this.destination,c;try{c=this.predicate(a,this.index++)}catch(f){b.error(f);return}this.nextOrComplete(a,c)};a.prototype.nextOrComplete=function(a, b){var c=this.destination;b?c.next(a):c.complete()};return a}(m);g.prototype.takeWhile=function(b){return uc(b)(this)};var fa={leading:!0,trailing:!1},Ne=function(){function b(a,b,e){this.durationSelector=a;this.leading=b;this.trailing=e}b.prototype.call=function(a,b){return b.subscribe(new eh(a,this.durationSelector,this.leading,this.trailing))};return b}(),eh=function(b){function a(a,e,d,f){b.call(this,a);this.destination=a;this.durationSelector=e;this._leading=d;this._trailing=f;this._hasTrailingValue= !1}k(a,b);a.prototype._next=function(a){if(this.throttled)this._trailing&&(this._hasTrailingValue=!0,this._trailingValue=a);else{var b=this.tryDurationSelector(a);b&&this.add(this.throttled=r(this,b));this._leading&&(this.destination.next(a),this._trailing&&(this._hasTrailingValue=!0,this._trailingValue=a))}};a.prototype.tryDurationSelector=function(a){try{return this.durationSelector(a)}catch(e){return this.destination.error(e),null}};a.prototype._unsubscribe=function(){var a=this.throttled;this._trailingValue= null;this._hasTrailingValue=!1;a&&(this.remove(a),this.throttled=null,a.unsubscribe())};a.prototype._sendTrailing=function(){var a=this.destination,b=this._trailing,d=this._trailingValue,f=this._hasTrailingValue;this.throttled&&b&&f&&(a.next(d),this._trailingValue=null,this._hasTrailingValue=!1)};a.prototype.notifyNext=function(a,b,d,f,h){this._sendTrailing();this._unsubscribe()};a.prototype.notifyComplete=function(){this._sendTrailing();this._unsubscribe()};return a}(t);g.prototype.throttle=function(b, a){void 0===a&&(a=fa);return vc(b,a)(this)};var Oe=function(){function b(a,b,e,d){this.duration=a;this.scheduler=b;this.leading=e;this.trailing=d}b.prototype.call=function(a,b){return b.subscribe(new fh(a,this.duration,this.scheduler,this.leading,this.trailing))};return b}(),fh=function(b){function a(a,e,d,f,h){b.call(this,a);this.duration=e;this.scheduler=d;this.leading=f;this.trailing=h;this._hasTrailingValue=!1;this._trailingValue=null}k(a,b);a.prototype._next=function(a){this.throttled?this.trailing&& (this._trailingValue=a,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(Pe,this.duration,{subscriber:this})),this.leading&&this.destination.next(a))};a.prototype.clearThrottle=function(){var a=this.throttled;a&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),a.unsubscribe(),this.remove(a),this.throttled=null)};return a}(m);g.prototype.throttleTime=function(b,a,c){void 0===a&&(a=u);void 0=== c&&(c=fa);return wc(b,a,c)(this)};var bd=function(){return function(b,a){this.value=b;this.interval=a}}(),Qe=function(){function b(a){this.scheduler=a}b.prototype.call=function(a,b){return b.subscribe(new gh(a,this.scheduler))};return b}(),gh=function(b){function a(a,e){b.call(this,a);this.scheduler=e;this.lastTime=0;this.lastTime=e.now()}k(a,b);a.prototype._next=function(a){var b=this.scheduler.now(),c=b-this.lastTime;this.lastTime=b;this.destination.next(new bd(a,c))};return a}(m);g.prototype.timeInterval= function(b){void 0===b&&(b=u);return xc(b)(this)};var zc=function(b){function a(){var a=b.call(this,"Timeout has occurred");this.name=a.name="TimeoutError";this.stack=a.stack;this.message=a.message}k(a,b);return a}(Error),Re=function(){function b(a,b,e,d){this.waitFor=a;this.absoluteTimeout=b;this.scheduler=e;this.errorInstance=d}b.prototype.call=function(a,b){return b.subscribe(new hh(a,this.absoluteTimeout,this.waitFor,this.scheduler,this.errorInstance))};return b}(),hh=function(b){function a(a, e,d,f,h){b.call(this,a);this.absoluteTimeout=e;this.waitFor=d;this.scheduler=f;this.errorInstance=h;this.action=null;this.scheduleTimeout()}k(a,b);a.dispatchTimeout=function(a){a.error(a.errorInstance)};a.prototype.scheduleTimeout=function(){var b=this.action;b?this.action=b.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(a.dispatchTimeout,this.waitFor,this))};a.prototype._next=function(a){this.absoluteTimeout||this.scheduleTimeout();b.prototype._next.call(this,a)};a.prototype._unsubscribe= function(){this.errorInstance=this.scheduler=this.action=null};return a}(m);g.prototype.timeout=function(b,a){void 0===a&&(a=u);return yc(b,a)(this)};var Se=function(){function b(a,b,e,d){this.waitFor=a;this.absoluteTimeout=b;this.withObservable=e;this.scheduler=d}b.prototype.call=function(a,b){return b.subscribe(new ih(a,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))};return b}(),ih=function(b){function a(a,e,d,f,h){b.call(this,a);this.absoluteTimeout=e;this.waitFor=d;this.withObservable= f;this.scheduler=h;this.action=null;this.scheduleTimeout()}k(a,b);a.dispatchTimeout=function(a){var b=a.withObservable;a._unsubscribeAndRecycle();a.add(r(a,b))};a.prototype.scheduleTimeout=function(){var b=this.action;b?this.action=b.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(a.dispatchTimeout,this.waitFor,this))};a.prototype._next=function(a){this.absoluteTimeout||this.scheduleTimeout();b.prototype._next.call(this,a)};a.prototype._unsubscribe=function(){this.withObservable= this.scheduler=this.action=null};return a}(t);g.prototype.timeoutWith=function(b,a,c){void 0===c&&(c=u);return Ac(b,a,c)(this)};var Cc=function(){return function(b,a){this.value=b;this.timestamp=a}}();g.prototype.timestamp=function(b){void 0===b&&(b=u);return Bc(b)(this)};g.prototype.toArray=function(){return Dc()(this)};var Ue=function(){function b(a){this.windowBoundaries=a}b.prototype.call=function(a,b){a=new jh(a);b=b.subscribe(a);b.closed||a.add(r(a,this.windowBoundaries));return b};return b}(), jh=function(b){function a(a){b.call(this,a);this.window=new w;a.next(this.window)}k(a,b);a.prototype.notifyNext=function(a,b,d,f,h){this.openWindow()};a.prototype.notifyError=function(a,b){this._error(a)};a.prototype.notifyComplete=function(a){this._complete()};a.prototype._next=function(a){this.window.next(a)};a.prototype._error=function(a){this.window.error(a);this.destination.error(a)};a.prototype._complete=function(){this.window.complete();this.destination.complete()};a.prototype._unsubscribe= function(){this.window=null};a.prototype.openWindow=function(){var a=this.window;a&&a.complete();var a=this.destination,b=this.window=new w;a.next(b)};return a}(t);g.prototype.window=function(b){return Ec(b)(this)};var Ve=function(){function b(a,b){this.windowSize=a;this.startWindowEvery=b}b.prototype.call=function(a,b){return b.subscribe(new kh(a,this.windowSize,this.startWindowEvery))};return b}(),kh=function(b){function a(a,e,d){b.call(this,a);this.destination=a;this.windowSize=e;this.startWindowEvery= d;this.windows=[new w];this.count=0;a.next(this.windows[0])}k(a,b);a.prototype._next=function(a){for(var b=0= this.maxWindowSize&&this.closeWindow(h))}};a.prototype._error=function(a){for(var b=this.windows;0b.index?1:-1:a.delay>b.delay?1:-1};return a}(X),qh=function(b){function a(a){b.call(this,ed,750);this.assertDeepEqual=a;this.hotObservables=[];this.coldObservables=[];this.flushTests=[]}k(a,b);a.prototype.createTime= function(b){b=b.indexOf("|");if(-1===b)throw Error('marble diagram for time should have a completion marker "|"');return b*a.frameTimeFactor};a.prototype.createColdObservable=function(b,e,d){if(-1!==b.indexOf("^"))throw Error('cold observable cannot have subscription offset "^"');if(-1!==b.indexOf("!"))throw Error('cold observable cannot have unsubscription marker "!"');b=a.parseMarbles(b,e,d);b=new ya(b,this);this.coldObservables.push(b);return b};a.prototype.createHotObservable=function(b,e,d){if(-1!== b.indexOf("!"))throw Error('hot observable cannot have unsubscription marker "!"');b=a.parseMarbles(b,e,d);b=new dd(b,this);this.hotObservables.push(b);return b};a.prototype.materializeInnerObservable=function(a,b){var c=this,e=[];a.subscribe(function(a){e.push({frame:c.frame-b,notification:y.createNext(a)})},function(a){e.push({frame:c.frame-b,notification:y.createError(a)})},function(){e.push({frame:c.frame-b,notification:y.createComplete()})});return e};a.prototype.expectObservable=function(b, e){var c=this;void 0===e&&(e=null);var f=[],h={actual:f,ready:!1};e=a.parseMarblesAsSubscriptions(e).unsubscribedFrame;var k;this.schedule(function(){k=b.subscribe(function(a){var b=a;a instanceof g&&(b=c.materializeInnerObservable(b,c.frame));f.push({frame:c.frame,notification:y.createNext(b)})},function(a){f.push({frame:c.frame,notification:y.createError(a)})},function(){f.push({frame:c.frame,notification:y.createComplete()})})},0);e!==Number.POSITIVE_INFINITY&&this.schedule(function(){return k.unsubscribe()}, e);this.flushTests.push(h);return{toBe:function(b,c,d){h.ready=!0;h.expected=a.parseMarbles(b,c,d,!0)}}};a.prototype.expectSubscriptions=function(b){var c={actual:b,ready:!1};this.flushTests.push(c);return{toBe:function(b){b="string"===typeof b?[b]:b;c.ready=!0;c.expected=b.map(function(b){return a.parseMarblesAsSubscriptions(b)})}}};a.prototype.flush=function(){for(var a=this.hotObservables;0g?new aa(f):new aa(f,g)};a.parseMarbles=function(a,b,d,f){void 0===f&&(f=!1);if(-1!==a.indexOf("!"))throw Error('conventional marble diagrams cannot have the unsubscription marker "!"');for(var c= a.length,e=[],g=a.indexOf("^"),g=-1===g?0:g*-this.frameTimeFactor,k="object"!==typeof b?function(a){return a}:function(a){return f&&b[a]instanceof ya?b[a].messages:b[a]},l=-1,m=0;m