rxjs-rails 2.3.22 → 2.3.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rxjs/rails/version.rb +1 -1
  3. data/vendor/assets/javascripts/rx.aggregates.js +178 -146
  4. data/vendor/assets/javascripts/rx.aggregates.min.js +1 -1
  5. data/vendor/assets/javascripts/rx.all.compat.js +1706 -1156
  6. data/vendor/assets/javascripts/rx.all.compat.min.js +4 -4
  7. data/vendor/assets/javascripts/rx.all.js +1529 -1125
  8. data/vendor/assets/javascripts/rx.all.min.js +4 -3
  9. data/vendor/assets/javascripts/rx.async.compat.js +15 -79
  10. data/vendor/assets/javascripts/rx.async.compat.min.js +1 -1
  11. data/vendor/assets/javascripts/rx.async.js +15 -79
  12. data/vendor/assets/javascripts/rx.async.min.js +1 -1
  13. data/vendor/assets/javascripts/rx.backpressure.js +38 -15
  14. data/vendor/assets/javascripts/rx.backpressure.min.js +1 -1
  15. data/vendor/assets/javascripts/rx.binding.js +42 -54
  16. data/vendor/assets/javascripts/rx.binding.min.js +1 -1
  17. data/vendor/assets/javascripts/rx.coincidence.js +6 -6
  18. data/vendor/assets/javascripts/rx.coincidence.min.js +1 -1
  19. data/vendor/assets/javascripts/rx.compat.js +1234 -828
  20. data/vendor/assets/javascripts/rx.compat.min.js +2 -2
  21. data/vendor/assets/javascripts/rx.experimental.js +12 -6
  22. data/vendor/assets/javascripts/rx.experimental.min.js +1 -1
  23. data/vendor/assets/javascripts/rx.joinpatterns.js +15 -11
  24. data/vendor/assets/javascripts/rx.joinpatterns.min.js +1 -1
  25. data/vendor/assets/javascripts/rx.js +1159 -791
  26. data/vendor/assets/javascripts/rx.lite.compat.js +1264 -920
  27. data/vendor/assets/javascripts/rx.lite.compat.min.js +2 -2
  28. data/vendor/assets/javascripts/rx.lite.extras.js +99 -27
  29. data/vendor/assets/javascripts/rx.lite.extras.min.js +1 -1
  30. data/vendor/assets/javascripts/rx.lite.js +1192 -886
  31. data/vendor/assets/javascripts/rx.lite.min.js +2 -2
  32. data/vendor/assets/javascripts/rx.min.js +2 -2
  33. data/vendor/assets/javascripts/rx.testing.js +64 -63
  34. data/vendor/assets/javascripts/rx.testing.min.js +1 -1
  35. data/vendor/assets/javascripts/rx.time.js +32 -35
  36. data/vendor/assets/javascripts/rx.time.min.js +1 -1
  37. metadata +3 -3
@@ -1,4 +1,4 @@
1
1
  /* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
2
- (function(a){function b(){if(this.isDisposed)throw new Error(eb)}function c(a,b){if(fb&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(jb)){for(var c=[],e=b;e;e=e.source)e.stack&&c.unshift(e.stack);c.unshift(a.stack);var f=c.join("\n"+jb+"\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===hb&&d>=ib&&$c>=d}function f(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function g(){if(fb)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 hb=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=typeof a;return a&&("function"==b||"object"==b)||!1}function j(a){var b=[];if(!i(a))return b;Jb.nonEnumArgs&&a.length&&Kb(a)&&(a=Mb.call(a));var c=Jb.enumPrototypes&&"function"==typeof a,d=Jb.enumErrorProps&&(a===Db||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Jb.nonEnumShadows&&a!==Eb){var f=a.constructor,g=-1,h=Hb.length;if(a===(f&&f.prototype))var j=a===Fb?zb:a===Db?ub:Ab.call(a),k=Ib[j];for(;++g<h;)e=Hb[g],k&&k[e]||!Bb.call(a,e)||b.push(e)}return b}function k(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 l(a,b){return k(a,b,j)}function m(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function n(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=Ab.call(a),h=Ab.call(b);if(g==qb&&(g=xb),h==qb&&(h=xb),g!=h)return!1;switch(g){case sb:case tb:return+a==+b;case wb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case yb:case zb:return a==String(b)}var i=g==rb;if(!i){if(g!=xb||!Jb.nodeClass&&(m(a)||m(b)))return!1;var j=!Jb.argsObject&&Kb(a)?Object:a.constructor,k=!Jb.argsObject&&Kb(b)?Object:b.constructor;if(!(j==k||Bb.call(a,"constructor")&&Bb.call(b,"constructor")||cb(j)&&j instanceof j&&cb(k)&&k instanceof k||!("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=n(a[p],r,c,d)))break}}else l(b,function(b,e,f){return Bb.call(f,e)?(p++,q=Bb.call(a,e)&&n(a[e],b,c,d)):void 0}),q&&l(a,function(a,b,c){return Bb.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function o(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:Mb.call(a)}function p(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function q(a,b){this.id=a,this.value=b}function r(){this._s=s}function t(){this._s=s,this._l=s.length,this._i=0}function u(a){this._a=a}function v(a){this._a=a,this._l=z(a),this._i=0}function w(a){return"number"==typeof a&&Q.isFinite(a)}function x(b){var c,d=b[kb];if(!d&&"string"==typeof b)return c=new r(b),c[kb]();if(!d&&b.length!==a)return c=new u(b),c[kb]();if(!d)throw new TypeError("Object is not iterable");return b[kb]()}function y(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function z(a){var b=+a.length;return isNaN(b)?0:0!==b&&w(b)?(b=y(b)*Math.floor(Math.abs(b)),0>=b?0:b>yc?yc:b):b}function A(a,b){return X(a)||(a=bc),new Sc(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function B(a,b){return new Sc(function(c){var d=new Wb,e=new Xb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}bb(f)&&(f=Lc(f)),d=new Wb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e},a)}function C(a,b){var c=this;return new Sc(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 void d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))},c)}function D(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return bb(f)&&(f=Lc(f)),(nb(f)||mb(f))&&(f=zc(f)),f}).concatAll()}function E(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return bb(f)&&(f=Lc(f)),(nb(f)||mb(f))&&(f=zc(f)),f}).mergeAll()}function F(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),Ub(function(){a.removeEventListener(b,c,!1)});throw new Error("No listener found")}function G(a,b,c){var d=new Rb;if("[object NodeList]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(G(a.item(e),b,c));else a&&d.add(F(a,b,c));return d}function H(a,b){return new Sc(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function I(a,b,c){return new Sc(function(d){var e=0,f=a,g=$b(b);return c.scheduleRecursiveWithAbsolute(f,function(a){if(g>0){var b=c.now();f+=g,b>=f&&(f=b+g)}d.onNext(e++),a(f)})})}function J(a,b){return new Sc(function(c){return b.scheduleWithRelative($b(a),function(){c.onNext(0),c.onCompleted()})})}function K(a,b,c){return a===b?new Sc(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):wc(function(){return I(c.now()+a,b,c)})}function L(a,b,c){return new Sc(function(d){var e,f=!1,g=new Xb,h=null,i=[],j=!1;return e=a.materialize().timestamp(c).subscribe(function(a){var e,k;"E"===a.value.kind?(i=[],i.push(a),h=a.value.exception,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new Wb,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveWithRelative(b,function(a){var b,e,g,k;if(null===h){j=!0;do g=null,i.length>0&&i[0].timestamp-c.now()<=0&&(g=i.shift().value),null!==g&&g.accept(d);while(null!==g);k=!1,e=0,i.length>0?(k=!0,e=Math.max(0,i[0].timestamp-c.now())):f=!1,b=h,j=!1,null!==b?d.onError(b):k&&a(e)}}))))}),new Rb(e,g)},a)}function M(a,b,c){return wc(function(){return L(a,b-c.now(),c)})}function N(a,b){return new Sc(function(c){function d(){g&&(g=!1,c.onNext(f)),e&&c.onCompleted()}var e,f,g;return new Rb(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 O(a,b,c){return new Sc(function(d){function e(a,b){j[b]=a;var e;if(g[b]=!0,h||(h=g.every(Y))){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 Rb(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)},d.onError.bind(d),function(){i=!0,e(!0,1)}))},a)}var P={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},Q=P[typeof window]&&window||this,R=P[typeof exports]&&exports&&!exports.nodeType&&exports,S=P[typeof module]&&module&&!module.nodeType&&module,T=S&&S.exports===R&&R,U=P[typeof global]&&global;!U||U.global!==U&&U.window!==U||(Q=U);var V={internals:{},config:{Promise:Q.Promise},helpers:{}},W=V.helpers.noop=function(){},X=(V.helpers.notDefined=function(a){return"undefined"==typeof a},V.helpers.isScheduler=function(a){return a instanceof V.Scheduler}),Y=V.helpers.identity=function(a){return a},Z=(V.helpers.pluck=function(a){return function(b){return b[a]}},V.helpers.just=function(a){return function(){return a}},V.helpers.defaultNow=Date.now),$=V.helpers.defaultComparer=function(a,b){return Lb(a,b)},_=V.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},ab=(V.helpers.defaultKeySerializer=function(a){return a.toString()},V.helpers.defaultError=function(a){throw a}),bb=V.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},cb=(V.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},V.helpers.not=function(a){return!a},V.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==Ab.call(a)}),a}()),db="Argument out of range",eb="Object has been disposed";V.config.longStackSupport=!1;var fb=!1;try{throw new Error}catch(gb){fb=!!gb.stack}var hb,ib=g(),jb="From previous event:",kb="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";Q.Set&&"function"==typeof(new Q.Set)["@@iterator"]&&(kb="@@iterator");var lb=V.doneEnumerator={done:!0,value:a},mb=V.helpers.isIterable=function(b){return b[kb]!==a},nb=V.helpers.isArrayLike=function(b){return b&&b.length!==a};V.helpers.iterator=kb;var ob,pb=V.helpers.deprecate=function(){},qb="[object Arguments]",rb="[object Array]",sb="[object Boolean]",tb="[object Date]",ub="[object Error]",vb="[object Function]",wb="[object Number]",xb="[object Object]",yb="[object RegExp]",zb="[object String]",Ab=Object.prototype.toString,Bb=Object.prototype.hasOwnProperty,Cb=Ab.call(arguments)==qb,Db=Error.prototype,Eb=Object.prototype,Fb=String.prototype,Gb=Eb.propertyIsEnumerable;Gb||(Gb=Eb.propertyIsEnumerable=function(a){for(var b in this)if(b===a)return!0;return!1});try{ob=!(Ab.call(document)==xb&&!({toString:0}+""))}catch(gb){ob=!0}var Hb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ib={};Ib[rb]=Ib[tb]=Ib[wb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Ib[sb]=Ib[zb]={constructor:!0,toString:!0,valueOf:!0},Ib[ub]=Ib[vb]=Ib[yb]={constructor:!0,toString:!0},Ib[xb]={constructor:!0};var Jb={};!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);Jb.enumErrorProps=Gb.call(Db,"message")||Gb.call(Db,"name"),Jb.enumPrototypes=Gb.call(a,"prototype"),Jb.nonEnumArgs=0!=c,Jb.nonEnumShadows=!/valueOf/.test(b)}(1);var Kb=function(a){return a&&"object"==typeof a?Ab.call(a)==qb:!1};Cb||(Kb=function(a){return a&&"object"==typeof a?Bb.call(a,"callee"):!1});{var Lb=V.internals.isEqual=function(a,b){return n(a,b,[],[])},Mb=Array.prototype.slice,Nb=({}.hasOwnProperty,this.inherits=V.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),Ob=V.internals.addProperties=function(a){for(var b=Mb.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}};V.internals.addRef=function(a,b){return new Sc(function(c){return new Rb(b.getDisposable(),a.subscribe(c))})}}q.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Pb=V.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Qb=Pb.prototype;Qb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Qb.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)}}},Qb.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)}}},Qb.peek=function(){return this.items[0].value},Qb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},Qb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Qb.enqueue=function(a){var b=this.length++;this.items[b]=new q(Pb.count++,a),this.percolate(b)},Qb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Pb.count=0;var Rb=V.CompositeDisposable=function(){this.disposables=o(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Sb=Rb.prototype;Sb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Sb.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},Sb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},Sb.toArray=function(){return this.disposables.slice(0)};var Tb=V.Disposable=function(a){this.isDisposed=!1,this.action=a||W};Tb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Ub=Tb.create=function(a){return new Tb(a)},Vb=Tb.empty={dispose:W},Wb=V.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,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),Xb=V.SerialDisposable=Wb,Yb=(V.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?Vb:new a(this)},b}(),V.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||_,this.disposable=new Wb});Yb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Yb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Yb.prototype.isCancelled=function(){return this.disposable.isDisposed},Yb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Zb=V.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(),Vb}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=Z,a.normalize=function(a){return 0>a&&(a=0),a},a}(),$b=Zb.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Rb,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),Vb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Rb,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Vb});h||(f.add(i),e=!0)})};return g(d),f}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({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second: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({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Zb.prototype),function(){Zb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Zb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof Q.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=Q.setInterval(function(){d=c(d)},b);return Ub(function(){Q.clearInterval(e)})}}(Zb.prototype);var _b,ac=Zb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=$b(b);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Zb(Z,a,b,c)}(),bc=Zb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Zb.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+Zb.normalize(c),g=new Yb(this,b,d,f);if(e)e.enqueue(g);else{e=new Pb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new Zb(Z,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),cc=(V.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new Wb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),W),dc=function(){var a,b=W;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!Q.setTimeout)throw new Error("No concurrency detected!");a=Q.setTimeout,b=Q.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),ec=dc.setTimeout,fc=dc.clearTimeout;!function(){function a(){if(!Q.postMessage||Q.importScripts)return!1;var a=!1,b=Q.onmessage;return Q.onmessage=function(){a=!0},Q.postMessage("","*"),Q.onmessage=b,a}var b=RegExp("^"+String(Ab).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),c="function"==typeof(c=U&&T&&U.setImmediate)&&!b.test(c)&&c,d="function"==typeof(d=U&&T&&U.clearImmediate)&&!b.test(d)&&d;if("function"==typeof c)_b=c,cc=d;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))_b=process.nextTick;else if(a()){var e="ms.rx.schedule"+Math.random(),f={},g=0,h=function(a){if("string"==typeof a.data&&a.data.substring(0,e.length)===e){var b=a.data.substring(e.length),c=f[b];c(),delete f[b]}};Q.addEventListener?Q.addEventListener("message",h,!1):Q.attachEvent("onmessage",h,!1),_b=function(a){var b=g++;f[b]=a,Q.postMessage(e+b,"*")}}else if(Q.MessageChannel){var i=new Q.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},_b=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in Q&&"onreadystatechange"in Q.document.createElement("script")?_b=function(a){var b=Q.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},Q.document.documentElement.appendChild(b)}:(_b=function(a){return ec(a,0)},cc=fc)}();var gc=Zb.timeout=function(){function a(a,b){var c=this,d=new Wb,e=_b(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Rb(d,Ub(function(){cc(e)}))}function b(a,b,c){var d=this,e=Zb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Wb,g=ec(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Rb(f,Ub(function(){fc(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Zb(Z,a,b,c)}(),hc=V.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}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 X(a)||(a=ac),new Sc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),ic=hc.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){var e=new hc("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),jc=hc.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){var e=new hc("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),kc=hc.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new hc("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),lc=V.internals.Enumerator=function(a){this._next=a};lc.prototype.next=function(){return this._next()},lc.prototype[kb]=function(){return this};var mc=V.internals.Enumerable=function(a){this._iterator=a};mc.prototype[kb]=function(){return this._iterator()},mc.prototype.concat=function(){var a=this;return new Sc(function(b){var c;try{c=a[kb]()}catch(d){return void b.onError(d)}var e,f=new Xb,g=ac.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;bb(h)&&(h=Lc(h));var i=new Wb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Rb(f,g,Ub(function(){e=!0}))})},mc.prototype.catchError=function(){var a=this;return new Sc(function(b){var c;try{c=a[kb]()}catch(d){return void b.onError(d)}var e,f,g=new Xb,h=ac.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return void b.onError(h)}if(d.done)return void(f?b.onError(f):b.onCompleted());var i=d.value;bb(i)&&(i=Lc(i));var j=new Wb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new Rb(g,h,Ub(function(){e=!0}))})};var nc=mc.repeat=function(a,b){return null==b&&(b=-1),new mc(function(){var c=b;return new lc(function(){return 0===c?lb:(c>0&&c--,{done:!1,value:a})})})},oc=mc.of=function(a,b,c){return b||(b=Y),new mc(function(){var d=-1;return new lc(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:lb})})},pc=V.Observer=function(){};pc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},pc.prototype.asObserver=function(){return new tc(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))};var qc=pc.create=function(a,b,c){return a||(a=W),b||(b=ab),c||(c=W),new tc(a,b,c)};pc.fromNotifier=function(a,b){return new tc(function(c){return a.call(b,ic(c))},function(c){return a.call(b,jc(c))},function(){return a.call(b,kc())})};var rc,sc=V.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return Nb(b,a),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}(pc),tc=V.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Nb(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(sc),uc=V.Observable=function(){function a(a){if(V.config.longStackSupport&&fb){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(b)}}else this._subscribe=a}return rc=a.prototype,rc.subscribe=rc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:qc(a,b,c))},rc.subscribeOnNext=function(a,b){return this._subscribe(qc(2===arguments.length?function(c){a.call(b,c)}:a))},rc.subscribeOnError=function(a,b){return this._subscribe(qc(null,2===arguments.length?function(c){a.call(b,c)}:a))},rc.subscribeOnCompleted=function(a,b){return this._subscribe(qc(null,null,2===arguments.length?function(){a.call(b)}:a))},a}(),vc=V.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new Xb}return Nb(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}(sc);rc.toArray=function(){var a=this;return new Sc(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})},a)},uc.create=uc.createWithDisposable=function(a,b){return new Sc(a,b)};var wc=uc.defer=function(a){return new Sc(function(b){var c;try{c=a()}catch(d){return Cc(d).subscribe(b)}return bb(c)&&(c=Lc(c)),c.subscribe(b)})},xc=uc.empty=function(a){return X(a)||(a=ac),new Sc(function(b){return a.schedule(function(){b.onCompleted()})})},yc=Math.pow(2,53)-1;r.prototype[kb]=function(){return new t(this._s)},t.prototype[kb]=function(){return this},t.prototype.next=function(){if(this._i<this._l){var a=this._s.charAt(this._i++);return{done:!1,value:a}}return lb},u.prototype[kb]=function(){return new v(this._a)},v.prototype[kb]=function(){return this},v.prototype.next=function(){if(this._i<this._l){var a=this._a[this._i++];return{done:!1,value:a}}return lb};{var zc=uc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!cb(b))throw new Error("mapFn when provided must be a function");X(d)||(d=bc);var e=Object(a),f=x(e);return new Sc(function(a){var e=0;return d.scheduleRecursive(function(d){var g;try{g=f.next()}catch(h){return void a.onError(h)}if(g.done)return void a.onCompleted();var i=g.value;if(b&&cb(b))try{i=b.call(c,i,e)}catch(h){return void a.onError(h)}a.onNext(i),e++,d()})})},Ac=uc.fromArray=function(a,b){return pb("fromArray","from"),X(b)||(b=bc),new Sc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};uc.never=function(){return new Sc(function(){return Vb})}}uc.of=function(){return A(null,arguments)},uc.ofWithScheduler=function(a){return A(a,Mb.call(arguments,1))},uc.range=function(a,b,c){return X(c)||(c=bc),new Sc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},uc.repeat=function(a,b,c){return X(c)||(c=bc),Bc(a,c).repeat(null==b?-1:b)};var Bc=uc["return"]=uc.just=function(a,b){return X(b)||(b=ac),new Sc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};uc.returnValue=function(){return pb("returnValue","return or just"),Bc.apply(null,arguments)};var Cc=uc["throw"]=uc.throwException=uc.throwError=function(a,b){return X(b)||(b=ac),new Sc(function(c){return b.schedule(function(){c.onError(a)})})};rc["catch"]=rc.catchError=function(a){return"function"==typeof a?B(this,a):Dc([this,a])},rc.catchException=function(a){return pb("catchException","catch or catchError"),this.catchError(a)};var Dc=uc.catchError=uc["catch"]=function(){return oc(o(arguments,0)).catchError()};uc.catchException=function(){return pb("catchException","catch or catchError"),Dc.apply(null,arguments)},rc.combineLatest=function(){var a=Mb.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),Ec.apply(this,a)};var Ec=uc.combineLatest=function(){var a=Mb.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new Sc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(Y))){try{d=b.apply(null,k)}catch(e){return void c.onError(e)}c.onNext(d)}else j.filter(function(b,c){return c!==a}).every(Y)&&c.onCompleted()}function e(a){j[a]=!0,j.every(Y)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=p(g,f),i=!1,j=p(g,f),k=new Array(g),l=new Array(g),m=0;g>m;m++)!function(b){var f=a[b],g=new Wb;bb(f)&&(f=Lc(f)),g.setDisposable(f.subscribe(function(a){k[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),l[b]=g}(m);return new Rb(l)},this)};rc.concat=function(){var a=Mb.call(arguments,0);return a.unshift(this),Fc.apply(this,a)};var Fc=uc.concat=function(){return oc(o(arguments,0)).concat()};rc.concatAll=function(){return this.merge(1)},rc.concatObservable=function(){return pb("concatObservable","concatAll"),this.merge(1)},rc.merge=function(a){if("number"!=typeof a)return Gc(this,a);var b=this;return new Sc(function(c){function d(a){var b=new Wb;f.add(b),bb(a)&&(a=Lc(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Rb,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f},b)};var Gc=uc.merge=function(){var a,b;return arguments[0]?X(arguments[0])?(a=arguments[0],b=Mb.call(arguments,1)):(a=ac,b=Mb.call(arguments,0)):(a=ac,b=Mb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),A(a,b).mergeAll()};rc.mergeAll=function(){var a=this;return new Sc(function(b){var c=new Rb,d=!1,e=new Wb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Wb;c.add(e),bb(a)&&(a=Lc(a)),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c},a)},rc.mergeObservable=function(){return pb("mergeObservable","mergeAll"),this.mergeAll.apply(this,arguments)},rc.skipUntil=function(a){var b=this;return new Sc(function(c){var d=!1,e=new Rb(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));bb(a)&&(a=Lc(a));var f=new Wb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e},b)},rc["switch"]=rc.switchLatest=function(){var a=this;return new Sc(function(b){var c=!1,d=new Xb,e=!1,f=0,g=a.subscribe(function(a){var g=new Wb,h=++f;c=!0,d.setDisposable(g),bb(a)&&(a=Lc(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())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new Rb(g,d)},a)},rc.takeUntil=function(a){var b=this;return new Sc(function(c){return bb(a)&&(a=Lc(a)),new Rb(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),W))},b)},rc.zip=function(){if(Array.isArray(arguments[0]))return C.apply(this,arguments);var a=this,b=Mb.call(arguments),c=b.pop();return b.unshift(a),new Sc(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(Y)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=p(g,function(){return[]}),i=p(g,function(){return!1}),j=new Array(g),k=0;g>k;k++)!function(a){var c=b[a],g=new Wb;bb(c)&&(c=Lc(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)
3
- })),j[a]=g}(k);return new Rb(j)},a)},uc.zip=function(){var a=Mb.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},uc.zipArray=function(){var a=o(arguments,0);return new Sc(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(Y))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(Y)?void b.onCompleted():void 0}for(var e=a.length,f=p(e,function(){return[]}),g=p(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Wb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var j=new Rb(h);return j.add(Ub(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),j})},rc.asObservable=function(){return new Sc(this.subscribe.bind(this),this)},rc.dematerialize=function(){var a=this;return new Sc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))},this)},rc.distinctUntilChanged=function(a,b){var c=this;return a||(a=Y),b||(b=$),new Sc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))},this)},rc["do"]=rc.tap=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new Sc(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b)try{b(c)}catch(d){a.onError(d)}a.onError(c)},function(){if(c)try{c()}catch(b){a.onError(b)}a.onCompleted()})},this)},rc.doAction=function(){return pb("doAction","do or tap"),this.tap.apply(this,arguments)},rc.doOnNext=rc.tapOnNext=function(a,b){return this.tap(2===arguments.length?function(c){a.call(b,c)}:a)},rc.doOnError=rc.tapOnError=function(a,b){return this.tap(W,2===arguments.length?function(c){a.call(b,c)}:a)},rc.doOnCompleted=rc.tapOnCompleted=function(a,b){return this.tap(W,null,2===arguments.length?function(){a.call(b)}:a)},rc["finally"]=rc.ensure=function(a){var b=this;return new Sc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Ub(function(){try{d.dispose()}catch(b){throw b}finally{a()}})},this)},rc.finallyAction=function(a){return pb("finallyAction","finally or ensure"),this.ensure(a)},rc.ignoreElements=function(){var a=this;return new Sc(function(b){return a.subscribe(W,b.onError.bind(b),b.onCompleted.bind(b))},a)},rc.materialize=function(){var a=this;return new Sc(function(b){return a.subscribe(function(a){b.onNext(ic(a))},function(a){b.onNext(jc(a)),b.onCompleted()},function(){b.onNext(kc()),b.onCompleted()})},a)},rc.repeat=function(a){return nc(this,a).concat()},rc.retry=function(a){return nc(this,a).catchError()},rc.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 Sc(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)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})},d)},rc.skipLast=function(a){var b=this;return new Sc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))},b)},rc.startWith=function(){var a,b,c=0;return arguments.length&&X(arguments[0])?(b=arguments[0],c=1):b=ac,a=Mb.call(arguments,c),oc([Ac(a,b),this]).concat()},rc.takeLast=function(a){var b=this;return new Sc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})},b)},rc.selectConcat=rc.concatMap=function(a,b,c){return cb(a)&&cb(b)?this.concatMap(function(c,d){var e=a(c,d);return bb(e)&&(e=Lc(e)),(nb(e)||mb(e))&&(e=zc(e)),e.map(function(a,e){return b(c,a,d,e)})}):cb(a)?D(this,a,c):D(this,function(){return a})},rc.select=rc.map=function(a,b){var c=cb(a)?a:function(){return a},d=this;return new Sc(function(a){var e=0;return d.subscribe(function(f){var g;try{g=c.call(b,f,e++,d)}catch(h){return void a.onError(h)}a.onNext(g)},a.onError.bind(a),a.onCompleted.bind(a))},d)},rc.pluck=function(a){return this.map(function(b){return b[a]})},rc.selectMany=rc.flatMap=function(a,b,c){return cb(a)&&cb(b)?this.flatMap(function(c,d){var e=a(c,d);return bb(e)&&(e=Lc(e)),(nb(e)||mb(e))&&(e=zc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):cb(a)?E(this,a,c):E(this,function(){return a})},rc.selectSwitch=rc.flatMapLatest=rc.switchMap=function(a,b){return this.select(a,b).switchLatest()},rc.skip=function(a){if(0>a)throw new Error(db);var b=this;return new Sc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))},b)},rc.skipWhile=function(a,b){var c=this;return new Sc(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))},c)},rc.take=function(a,b){if(0>a)throw new RangeError(db);if(0===a)return xc(b);var c=this;return new Sc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))},c)},rc.takeWhile=function(a,b){var c=this;return new Sc(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))},c)},rc.where=rc.filter=function(a,b){var c=this;return new Sc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))},c)},uc.fromCallback=function(a,b,c){return function(){var d=Mb.call(arguments,0);return new Sc(function(e){function f(){var a=arguments;if(c){try{a=c(a)}catch(b){return void e.onError(b)}e.onNext(a)}else a.length<=1?e.onNext.apply(e,a):e.onNext(a);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},uc.fromNodeCallback=function(a,b,c){return function(){var d=Mb.call(arguments,0);return new Sc(function(e){function f(a){if(a)return void e.onError(a);var b=Mb.call(arguments,1);if(c){try{b=c(b)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},V.config.useNativeEvents=!1;var Hc=Q.angular&&angular.element?angular.element:Q.jQuery?Q.jQuery:Q.Zepto?Q.Zepto:null,Ic=!!Q.Ember&&"function"==typeof Q.Ember.addListener,Jc=!!Q.Backbone&&!!Q.Backbone.Marionette;uc.fromEvent=function(a,b,c){if(a.addListener)return Kc(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c);if(!V.config.useNativeEvents){if(Jc)return Kc(function(c){a.on(b,c)},function(c){a.off(b,c)},c);if(Ic)return Kc(function(c){Ember.addListener(a,b,c)},function(c){Ember.removeListener(a,b,c)},c);if(Hc){var d=Hc(a);return Kc(function(a){d.on(b,a)},function(a){d.off(b,a)},c)}}return new Sc(function(d){return G(a,b,function(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)})}).publish().refCount()};var Kc=uc.fromEventPattern=function(a,b,c){return new Sc(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)}var f=a(e);return Ub(function(){b&&b(e,f)})}).publish().refCount()},Lc=uc.fromPromise=function(a){return wc(function(){var b=new V.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};rc.toPromise=function(a){if(a||(a=V.config.Promise),!a)throw new TypeError("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)})})},uc.startAsync=function(a){var b;try{b=a()}catch(c){return Cc(c)}return Lc(b)},rc.multicast=function(a,b){var c=this;return"function"==typeof a?new Sc(function(d){var e=c.multicast(a());return new Rb(b(e).subscribe(d),e.connect())},c):new Mc(c,a)},rc.publish=function(a){return a&&cb(a)?this.multicast(function(){return new Vc},a):this.multicast(new Vc)},rc.share=function(){return this.publish().refCount()},rc.publishLast=function(a){return a&&cb(a)?this.multicast(function(){return new Wc},a):this.multicast(new Wc)},rc.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new Yc(b)},a):this.multicast(new Yc(a))},rc.shareValue=function(a){return this.publishValue(a).refCount()},rc.replay=function(a,b,c,d){return a&&cb(a)?this.multicast(function(){return new Zc(b,c,d)},a):this.multicast(new Zc(b,c,d))},rc.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};{var Mc=V.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new Rb(f.subscribe(c),Ub(function(){e=!1}))),d},a.call(this,c.subscribe.bind(c))}return Nb(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new Sc(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(uc),Nc=uc.interval=function(a,b){return K(a,a,X(b)?b:gc)};uc.timer=function(b,c,d){var e;return X(d)||(d=gc),c!==a&&"number"==typeof c?e=c:X(c)&&(d=c),b instanceof Date&&e===a?H(b.getTime(),d):b instanceof Date&&e!==a?(e=c,I(b.getTime(),e,d)):e===a?J(b,d):K(b,e,d)}}rc.delay=function(a,b){return X(b)||(b=gc),a instanceof Date?M(this,a.getTime(),b):L(this,a,b)},rc.debounce=rc.throttleWithTimeout=function(a,b){X(b)||(b=gc);var c=this;return new Sc(function(d){var e,f=new Xb,g=!1,h=0,i=c.subscribe(function(c){g=!0,e=c,h++;var i=h,j=new Wb;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 Rb(i,f)},this)},rc.throttle=function(a,b){return pb("throttle","debounce or throttleWithTimeout"),this.debounce(a,b)},rc.timestamp=function(a){return X(a)||(a=gc),this.map(function(b){return{value:b,timestamp:a.now()}})},rc.sample=rc.throttleLatest=function(a,b){return X(b)||(b=gc),"number"==typeof a?N(this,Nc(a,b)):N(this,a)},rc.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=Cc(new Error(b||"Timeout"))),X(c)||(c=gc);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Sc(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(bb(b)&&(b=Lc(b)),j.setDisposable(b.subscribe(f)))}))}var h=0,i=new Wb,j=new Xb,k=!1,l=new Xb;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 Rb(j,l)},d)},rc.throttleFirst=function(a,b){X(b)||(b=gc);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new Sc(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},a.onError.bind(a),a.onCompleted.bind(a))},d)};var Oc=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=Vb,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=Vb)});return new Rb(c,d,e)}function c(c,d){this.source=c,this.controller=new Vc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,a.call(this,b,c)}return Nb(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(uc);rc.pausable=function(a){return new Oc(this,a)};var Pc=function(b){function c(b){var c,d=[],e=O(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 Vc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,b.call(this,c,a)}return Nb(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(uc);rc.pausableBuffered=function(a){return new Pc(this,a)};var Qc=function(a){function b(a){return this.source.subscribe(a)}function c(c,d){a.call(this,b,c),this.subject=new Rc(d),this.source=c.multicast(this.subject).refCount()}return Nb(c,a),c.prototype.request=function(a){return null==a&&(a=-1),this.subject.request(a)},c}(uc),Rc=function(a){function b(a){return this.subject.subscribe(a)}function c(c){null==c&&(c=!0),a.call(this,b),this.subject=new Vc,this.enableQueue=c,this.queue=c?[]:null,this.requestedCount=0,this.requestedDisposable=Vb,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.controlledDisposable=Vb}return Nb(c,a),Ob(c.prototype,pc,{onCompleted:function(){this.hasCompleted=!0,(!this.enableQueue||0===this.queue.length)&&this.subject.onCompleted()},onError:function(a){this.hasFailed=!0,this.error=a,(!this.enableQueue||0===this.queue.length)&&this.subject.onError(a)},onNext:function(a){var b=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(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.subject.onNext(this.queue.shift()),a--;return 0!==this.queue.length?{numberOfItems:a,returnValue:!0}:{numberOfItems:a,returnValue:!1}}return this.hasFailed?(this.subject.onError(this.error),this.controlledDisposable.dispose(),this.controlledDisposable=Vb):this.hasCompleted&&(this.subject.onCompleted(),this.controlledDisposable.dispose(),this.controlledDisposable=Vb),{numberOfItems:a,returnValue:!1}},request:function(a){this.disposeCurrentRequest();var b=this,c=this._processRequest(a),a=c.numberOfItems;return c.returnValue?Vb:(this.requestedCount=a,this.requestedDisposable=Ub(function(){b.requestedCount=0}),this.requestedDisposable)},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=Vb}}),c}(uc);rc.controlled=function(a){return null==a&&(a=!0),new Qc(this,a)},rc.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 Sc(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 Sc=V.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Ub(a):Vb}function c(d,e){function f(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new Tc(a);return bc.scheduleRequired()?bc.schedule(c):c(),e}return this.source=e,this instanceof c?void a.call(this,f):new c(d)}return Nb(c,a),c}(uc),Tc=function(a){function b(b){a.call(this),this.observer=b,this.m=new Wb}Nb(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{!b&&this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(sc),Uc=function(a,b){this.subject=a,this.observer=b};Uc.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 Vc=V.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),Vb):(a.onCompleted(),Vb):(this.observers.push(a),new Uc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return Nb(d,a),Ob(d.prototype,pc,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Xc(a,b)},d}(uc),Wc=V.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new Uc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),Vb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return Nb(d,a),Ob(d.prototype,pc,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(uc),Xc=V.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return Nb(b,a),Ob(b.prototype,pc,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(uc),Yc=V.BehaviorSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),a.onNext(this.value),new Uc(this,a);var c=this.exception;return c?a.onError(c):a.onCompleted(),Vb}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.exception=null}return Nb(d,a),Ob(d.prototype,pc,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=this.observers.slice(0),d=c.length;d>a;a++)c[a].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.exception=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped){this.value=a;for(var c=0,d=this.observers.slice(0),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}(uc),Zc=V.ReplaySubject=function(a){function c(a,b){return Ub(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(a){var d=new vc(this.scheduler,a),e=c(this,d);b.call(this),this._trim(this.scheduler.now()),this.observers.push(d);for(var f=0,g=this.q.length;g>f;f++)d.onNext(this.q[f].value);return this.hasError?d.onError(this.error):this.isStopped&&d.onCompleted(),d.ensureActive(),e}function e(b,c,e){this.bufferSize=null==b?Number.MAX_VALUE:b,this.windowSize=null==c?Number.MAX_VALUE:c,this.scheduler=e||bc,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,d)}return Nb(e,a),Ob(e.prototype,pc,{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(b.call(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onNext(a),g.ensureActive()}}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onError(a),g.ensureActive()}this.observers=[]}},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++){var f=c[d];f.onCompleted(),f.ensureActive()}this.observers=[]}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(uc);"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Q.Rx=V,define(function(){return V})):R&&S?T?(S.exports=V).Rx=V:R.Rx=V:Q.Rx=V;var $c=g()}).call(this);
2
+ (function(a){function b(a){if(a.isDisposed)throw new Error(kb)}function c(a){for(var b=[],c=0,d=a.length;d>c;c++)b.push(a[c]);return b}function d(a,b){if(lb&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(pb)){for(var c=[],d=b;d;d=d.source)d.stack&&c.unshift(d.stack);c.unshift(a.stack);var f=c.join("\n"+pb+"\n");a.stack=e(f)}}function e(a){for(var b=a.split("\n"),c=[],d=0,e=b.length;e>d;d++){var h=b[d];f(h)||g(h)||!h||c.push(h)}return c.join("\n")}function f(a){var b=i(a);if(!b)return!1;var c=b[0],d=b[1];return c===nb&&d>=ob&&md>=d}function g(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function h(){if(lb)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=i(c);if(!d)return;return nb=d[0],d[1]}}function i(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 j(a){var b=[];if(!Rb(a))return b;Qb.nonEnumArgs&&a.length&&Sb(a)&&(a=Ub.call(a));var c=Qb.enumPrototypes&&"function"==typeof a,d=Qb.enumErrorProps&&(a===Lb||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Qb.nonEnumShadows&&a!==Mb){var f=a.constructor,g=-1,h=xb;if(a===(f&&f.prototype))var i=a===Nb?Hb:a===Lb?Cb:Ib.call(a),j=Pb[i];for(;++g<h;)e=wb[g],j&&j[e]||!Jb.call(a,e)||b.push(e)}return b}function k(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 l(a,b){return k(a,b,j)}function m(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function n(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=Ib.call(a),h=Ib.call(b);if(g==yb&&(g=Fb),h==yb&&(h=Fb),g!=h)return!1;switch(g){case Ab:case Bb:return+a==+b;case Eb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case Gb:case Hb:return a==String(b)}var i=g==zb;if(!i){if(g!=Fb||!Qb.nodeClass&&(m(a)||m(b)))return!1;var j=!Qb.argsObject&&Sb(a)?Object:a.constructor,k=!Qb.argsObject&&Sb(b)?Object:b.constructor;if(!(j==k||Jb.call(a,"constructor")&&Jb.call(b,"constructor")||ib(j)&&j instanceof j&&ib(k)&&k instanceof k||!("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=n(a[p],r,c,d)))break}}else l(b,function(b,e,f){return Jb.call(f,e)?(p++,q=Jb.call(a,e)&&n(a[e],b,c,d)):void 0}),q&&l(a,function(a,b,c){return Jb.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function o(a){throw a}function p(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function q(a,b){this.id=a,this.value=b}function r(a){this.observer=a,this.a=[],this.isStopped=!1}function t(){this._s=s}function u(){this._s=s,this._l=s.length,this._i=0}function v(a){this._a=a}function w(a){this._a=a,this._l=A(a),this._i=0}function x(a){return"number"==typeof a&&W.isFinite(a)}function y(b){var c,d=b[qb];if(!d&&"string"==typeof b)return c=new t(b),c[qb]();if(!d&&b.length!==a)return c=new v(b),c[qb]();if(!d)throw new TypeError("Object is not iterable");return b[qb]()}function z(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function A(a){var b=+a.length;return isNaN(b)?0:0!==b&&x(b)?(b=z(b)*Math.floor(Math.abs(b)),0>=b?0:b>Kc?Kc:b):b}function B(a,b){this.observer=a,this.parent=b}function C(a,b){return new Mc(b,a)}function D(a,b){return new ed(function(c){var d=new cc,e=new dc;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)}hb(d)&&(d=Zc(d));var g=new cc;e.setDisposable(g),g.setDisposable(d.subscribe(c))},function(a){c.onCompleted(a)})),e},a)}function E(a,b){var c=this;return new ed(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 F(){return!1}function G(){return[]}function H(a,b,c){var d=vb(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return hb(e)&&(e=Zc(e)),(tb(e)||sb(e))&&(e=Lc(e)),e}).concatAll()}function I(a,b,c){this.observer=a,this.selector=b,this.source=c,this.i=0,this.isStopped=!1}function J(a,b,c){var d=vb(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return hb(e)&&(e=Zc(e)),(tb(e)||sb(e))&&(e=Lc(e)),e}).mergeAll()}function K(a,b,c){this.observer=a,this.predicate=b,this.source=c,this.i=0,this.isStopped=!1}function L(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),ac(function(){a.removeEventListener(b,c,!1)});throw new Error("No listener found")}function M(a,b,c){var d=new Zb;if("[object NodeList]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(M(a.item(e),b,c));else a&&d.add(L(a,b,c));return d}function N(a,b){return new ed(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function O(a,b,c){return new ed(function(d){var e=a,f=gc(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 P(a,b){return new ed(function(c){return b.scheduleWithRelative(gc(a),function(){c.onNext(0),c.onCompleted()})})}function Q(a,b,c){return a===b?new ed(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):Gc(function(){return O(c.now()+a,b,c)})}function R(a,b,c){return new ed(function(d){var e,f=!1,g=new dc,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 cc,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 Zb(e,g)},a)}function S(a,b,c){return Gc(function(){return R(a,b-c.now(),c)})}function T(a,b){return new ed(function(c){function d(){g&&(g=!1,c.onNext(f)),e&&c.onCompleted()}var e,f,g;return new Zb(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 U(a,b,c){return new ed(function(d){function e(a,b){j[b]=a;var e;if(g[b]=!0,h||(h=g.every(cb))){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 Zb(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 V={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},W=V[typeof window]&&window||this,X=V[typeof exports]&&exports&&!exports.nodeType&&exports,Y=V[typeof module]&&module&&!module.nodeType&&module,Z=Y&&Y.exports===X&&X,$=V[typeof global]&&global;!$||$.global!==$&&$.window!==$||(W=$);var _={internals:{},config:{Promise:W.Promise},helpers:{}},ab=_.helpers.noop=function(){},bb=(_.helpers.notDefined=function(a){return"undefined"==typeof a},_.helpers.isScheduler=function(a){return a instanceof _.Scheduler}),cb=_.helpers.identity=function(a){return a},db=(_.helpers.pluck=function(a){return function(b){return b[a]}},_.helpers.just=function(a){return function(){return a}},_.helpers.defaultNow=Date.now),eb=_.helpers.defaultComparer=function(a,b){return Tb(a,b)},fb=_.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},gb=(_.helpers.defaultKeySerializer=function(a){return a.toString()},_.helpers.defaultError=function(a){throw a}),hb=_.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},ib=(_.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},_.helpers.not=function(a){return!a},_.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==Ib.call(a)}),a}()),jb="Argument out of range",kb="Object has been disposed";_.config.longStackSupport=!1;var lb=!1;try{throw new Error}catch(mb){lb=!!mb.stack}var nb,ob=h(),pb="From previous event:",qb="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";W.Set&&"function"==typeof(new W.Set)["@@iterator"]&&(qb="@@iterator");var rb=_.doneEnumerator={done:!0,value:a},sb=_.helpers.isIterable=function(b){return b[qb]!==a},tb=_.helpers.isArrayLike=function(b){return b&&b.length!==a};_.helpers.iterator=qb;var ub,vb=_.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)}},wb=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],xb=wb.length,yb="[object Arguments]",zb="[object Array]",Ab="[object Boolean]",Bb="[object Date]",Cb="[object Error]",Db="[object Function]",Eb="[object Number]",Fb="[object Object]",Gb="[object RegExp]",Hb="[object String]",Ib=Object.prototype.toString,Jb=Object.prototype.hasOwnProperty,Kb=Ib.call(arguments)==yb,Lb=Error.prototype,Mb=Object.prototype,Nb=String.prototype,Ob=Mb.propertyIsEnumerable;try{ub=!(Ib.call(document)==Fb&&!({toString:0}+""))}catch(mb){ub=!0}var Pb={};Pb[zb]=Pb[Bb]=Pb[Eb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Pb[Ab]=Pb[Hb]={constructor:!0,toString:!0,valueOf:!0},Pb[Cb]=Pb[Db]=Pb[Gb]={constructor:!0,toString:!0},Pb[Fb]={constructor:!0};var Qb={};!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);Qb.enumErrorProps=Ob.call(Lb,"message")||Ob.call(Lb,"name"),Qb.enumPrototypes=Ob.call(a,"prototype"),Qb.nonEnumArgs=0!=c,Qb.nonEnumShadows=!/valueOf/.test(b)}(1);var Rb=_.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},Sb=function(a){return a&&"object"==typeof a?Ib.call(a)==yb:!1};Kb||(Sb=function(a){return a&&"object"==typeof a?Jb.call(a,"callee"):!1});{var Tb=_.internals.isEqual=function(a,b){return n(a,b,[],[])},Ub=({}.hasOwnProperty,Array.prototype.slice),Vb=this.inherits=_.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},Wb=_.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]}};_.internals.addRef=function(a,b){return new ed(function(c){return new Zb(b.getDisposable(),a.subscribe(c))})}}q.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Xb=_.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Yb=Xb.prototype;Yb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Yb.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)}}},Yb.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)}}},Yb.peek=function(){return this.items[0].value},Yb.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},Yb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Yb.enqueue=function(a){var b=this.length++;this.items[b]=new q(Xb.count++,a),this.percolate(b)},Yb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Xb.count=0;var Zb=_.CompositeDisposable=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]}this.disposables=a,this.isDisposed=!1,this.length=a.length},$b=Zb.prototype;$b.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},$b.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},$b.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 _b=_.Disposable=function(a){this.isDisposed=!1,this.action=a||ab};_b.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var ac=_b.create=function(a){return new _b(a)},bc=_b.empty={dispose:ab},cc=_.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}(),dc=_.SerialDisposable=cc,ec=(_.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?bc:new a(this)},b}(),_.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||fb,this.disposable=new cc});ec.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},ec.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},ec.prototype.isCancelled=function(){return this.disposable.isDisposed},ec.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var fc=_.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(),bc}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=db,a.normalize=function(a){return 0>a&&(a=0),a},a}(),gc=fc.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Zb,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),bc});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Zb,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c](b,d,function(a,b){return e?f.remove(i):h=!0,g(b),bc});h||(f.add(i),e=!0)})};return g(d),f}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({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second: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({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(fc.prototype),function(){fc.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},fc.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof W.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=W.setInterval(function(){d=c(d)},b);return ac(function(){W.clearInterval(e)})}}(fc.prototype);var hc,ic=fc.immediate=function(){function a(a,b){return b(this,a)}function b(){throw new Error("Not supported")}return new fc(db,a,b,b)}(),jc=fc.currentThread=function(){function a(a){for(;a.length>0;){var b=a.dequeue();b.isCancelled()||!b.isCancelled()&&b.invoke()}}function b(b,c){var e=new ec(this,b,c,this.now());if(d)d.enqueue(e);else{d=new Xb(4),d.enqueue(e);try{a(d)}catch(f){throw f}finally{d=null}}return e.disposable}function c(){throw new Error("Not supported")}var d,e=new fc(db,b,c,c);return e.scheduleRequired=function(){return!d},e.ensureTrampoline=function(a){d?a():this.schedule(a)},e}(),kc=(_.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 cc;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),ab),lc=function(){var a,b=ab;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!W.setTimeout)throw new Error("No concurrency detected!");a=W.setTimeout,b=W.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),mc=lc.setTimeout,nc=lc.clearTimeout;!function(){function a(){if(!W.postMessage||W.importScripts)return!1;var a=!1,b=W.onmessage;return W.onmessage=function(){a=!0},W.postMessage("","*"),W.onmessage=b,a}var b=RegExp("^"+String(Ib).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),c="function"==typeof(c=$&&Z&&$.setImmediate)&&!b.test(c)&&c,d="function"==typeof(d=$&&Z&&$.clearImmediate)&&!b.test(d)&&d;if("function"==typeof c)hc=c,kc=d;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))hc=process.nextTick;else if(a()){var e="ms.rx.schedule"+Math.random(),f={},g=0,h=function(a){if("string"==typeof a.data&&a.data.substring(0,e.length)===e){var b=a.data.substring(e.length),c=f[b];c(),delete f[b]}};W.addEventListener?W.addEventListener("message",h,!1):W.attachEvent("onmessage",h,!1),hc=function(a){var b=g++;f[b]=a,W.postMessage(e+b,"*")}}else if(W.MessageChannel){var i=new W.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},hc=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in W&&"onreadystatechange"in W.document.createElement("script")?hc=function(a){var b=W.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},W.document.documentElement.appendChild(b)}:(hc=function(a){return mc(a,0)},kc=nc)}();var oc=fc.timeout=function(){function a(a,b){var c=this,d=new cc,e=hc(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Zb(d,ac(function(){kc(e)}))}function b(a,b,c){var d=this,e=fc.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new cc,g=mc(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Zb(f,ac(function(){nc(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new fc(db,a,b,c)}(),pc=_.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}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 bb(a)||(a=ic),new ed(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),qc=pc.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){var e=new pc("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),rc=pc.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){var e=new pc("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),sc=pc.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new pc("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),tc=_.internals.Enumerator=function(a){this._next=a};tc.prototype.next=function(){return this._next()},tc.prototype[qb]=function(){return this};var uc=_.internals.Enumerable=function(a){this._iterator=a};uc.prototype[qb]=function(){return this._iterator()},uc.prototype.concat=function(){var a=this;return new ed(function(b){var c,d=a[qb](),e=new dc,f=ic.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;hb(h)&&(h=Zc(h));var i=new cc;e.setDisposable(i),i.setDisposable(h.subscribe(function(a){b.onNext(a)},function(a){b.onError(a)},a))}});return new Zb(e,f,ac(function(){c=!0}))})},uc.prototype.catchError=function(){var a=this;return new ed(function(b){var c,d=a[qb](),e=new dc,f=ic.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;hb(i)&&(i=Zc(i));var j=new cc;e.setDisposable(j),j.setDisposable(i.subscribe(function(a){b.onNext(a)},f,function(){b.onCompleted()}))}});return new Zb(e,f,ac(function(){c=!0}))})},uc.prototype.catchErrorWhen=function(a){var b=this;return new ed(function(c){var d,e,f=new hd,g=new hd,h=a(f),i=h.subscribe(g),j=b[qb](),k=new dc,l=ic.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;hb(i)&&(i=Zc(i));var l=new cc,m=new cc;k.setDisposable(new Zb(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 Zb(i,k,l,ac(function(){d=!0}))})};var vc,wc=uc.repeat=function(a,b){return null==b&&(b=-1),new uc(function(){var c=b;return new tc(function(){return 0===c?rb:(c>0&&c--,{done:!1,value:a})})})},xc=uc.of=function(a,b,c){if(b)var d=vb(b,c,3);return new uc(function(){var c=-1;return new tc(function(){return++c<a.length?{done:!1,value:b?d(a[c],c,a):a[c]}:rb})})},yc=_.Observer=function(){},zc=yc.create=function(a,b,c){return a||(a=ab),b||(b=gb),c||(c=ab),new Bc(a,b,c)},Ac=_.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}function c(){throw new Error("Method not implemented")}return Vb(b,a),b.prototype.next=c,b.prototype.error=c,b.prototype.completed=c,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}(yc),Bc=_.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Vb(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}(Ac),Cc=_.Observable=function(){function a(a){if(_.config.longStackSupport&&lb){try{throw new Error}catch(b){this.stack=b.stack.substring(b.stack.indexOf("\n")+1)}var c=this;this._subscribe=function(b){var e=b.onError.bind(b);return b.onError=function(a){d(a,c),e(a)},a.call(c,b)}}else this._subscribe=a}return vc=a.prototype,vc.subscribe=vc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:zc(a,b,c))},vc.subscribeOnNext=function(a,b){return this._subscribe(zc("undefined"!=typeof b?function(c){a.call(b,c)}:a))},vc.subscribeOnError=function(a,b){return this._subscribe(zc(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},vc.subscribeOnCompleted=function(a,b){return this._subscribe(zc(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},a}(),Dc=_.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 dc}return Vb(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}(Ac),Ec=_.ObservableBase=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?ac(a):bc}function c(a,c){var d=c[0],e=c[1];try{d.setDisposable(b(e.subscribeCore(d)))}catch(f){if(!d.fail(f))throw f}}function d(a){var b=new fd(a),d=[b,this];return jc.scheduleRequired()?jc.scheduleWithState(d,c):c(null,d),b}function e(){a.call(this,d)}return Vb(e,a),e.prototype.subscribeCore=function(){throw new Error("Not implemeneted")},e}(Cc),Fc=function(a){function b(b){this.source=b,a.call(this)}return Vb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new r(a))},b}(Ec);r.prototype.onNext=function(a){this.isStopped||this.a.push(a)},r.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},r.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onNext(this.a),this.observer.onCompleted())},r.prototype.dispose=function(){this.isStopped=!0},r.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},vc.toArray=function(){return new Fc(this)},Cc.create=Cc.createWithDisposable=function(a,b){return new ed(a,b)};var Gc=Cc.defer=function(a){return new ed(function(b){var c;try{c=a()}catch(d){return Rc(d).subscribe(b)}return hb(c)&&(c=Zc(c)),c.subscribe(b)})},Hc=Cc.empty=function(a){return bb(a)||(a=ic),new ed(function(b){return a.schedule(function(){b.onCompleted()})})},Ic=function(a){function b(b,c,d){this.iterable=b,this.mapper=c,this.scheduler=d,a.call(this)}return Vb(b,a),b.prototype.subscribeCore=function(a){var b=new Jc(a,this);return b.run()},b}(Ec),Jc=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=y(b),d=this.observer,e=this.parent.mapper;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}(),Kc=Math.pow(2,53)-1;t.prototype[qb]=function(){return new u(this._s)},u.prototype[qb]=function(){return this},u.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:rb},v.prototype[qb]=function(){return new w(this._a)},w.prototype[qb]=function(){return this},w.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:rb};var Lc=Cc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!ib(b))throw new Error("mapFn when provided must be a function");if(b)var e=vb(b,c,2);return bb(d)||(d=jc),new Ic(a,e,d)},Mc=function(a){function b(b,c){this.args=b,this.scheduler=c||jc,a.call(this)}return Vb(b,a),b.prototype.subscribeCore=function(a){var b=new B(a,this);return b.run()},b}(Ec);B.prototype.run=function(){function a(a,e){d>a?(b.onNext(c[a]),e(a+1)):b.onCompleted()}var b=this.observer,c=this.parent.args,d=c.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)};{var Nc=Cc.fromArray=function(a,b){return new Mc(a,b)};Cc.never=function(){return new ed(function(){return bc})}}Cc.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new Mc(b)},Cc.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 Mc(c,a)},Cc.pairs=function(a,b){return b||(b=_.Scheduler.currentThread),new ed(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 Oc=function(a){function b(b,c,d){this.start=b,this.count=c,this.scheduler=d,a.call(this)}return Vb(b,a),b.prototype.subscribeCore=function(a){var b=new Pc(a,this);return b.run()},b}(Ec),Pc=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}();Cc.range=function(a,b,c){return bb(c)||(c=jc),new Oc(a,b,c)},Cc.repeat=function(a,b,c){return bb(c)||(c=jc),Qc(a,c).repeat(null==b?-1:b)};var Qc=Cc["return"]=Cc.just=function(a,b){return bb(b)||(b=ic),new ed(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};Cc.returnValue=function(){return Qc.apply(null,arguments)};var Rc=Cc["throw"]=Cc.throwError=function(a,b){return bb(b)||(b=ic),new ed(function(c){return b.schedule(function(){c.onError(a)})})};Cc.throwException=function(){return Cc.throwError.apply(null,arguments)},vc["catch"]=vc.catchError=vc.catchException=function(a){return"function"==typeof a?D(this,a):Sc([this,a])};var Sc=Cc.catchError=Cc["catch"]=Cc.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 xc(a).catchError()};vc.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),Tc.apply(this,b)};var Tc=Cc.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 a--,Array.isArray(b[0])&&(b=b[0]),new ed(function(c){function e(a){if(h[a]=!0,i||(i=h.every(cb))){try{var b=d.apply(null,k)}catch(e){return void c.onError(e)}c.onNext(b)}else j.filter(function(b,c){return c!==a}).every(cb)&&c.onCompleted()}function f(a){j[a]=!0,j.every(cb)&&c.onCompleted()}for(var g=function(){return!1},h=p(a,g),i=!1,j=p(a,g),k=new Array(a),l=new Array(a),m=0;a>m;m++)!function(a){var d=b[a],g=new cc;hb(d)&&(d=Zc(d)),g.setDisposable(d.subscribe(function(b){k[a]=b,e(a)},function(a){c.onError(a)},function(){f(a)})),l[a]=g}(m);return new Zb(l)},this)};vc.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);
3
+ return a.unshift(this),Uc.apply(null,a)};var Uc=Cc.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 xc(a).concat()};vc.concatAll=vc.concatObservable=function(){return this.merge(1)},vc.merge=function(a){if("number"!=typeof a)return Vc(this,a);var b=this;return new ed(function(c){function d(a){var b=new cc;f.add(b),hb(a)&&(a=Zc(a)),b.setDisposable(a.subscribe(function(a){c.onNext(a)},function(a){c.onError(a)},function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Zb,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},function(a){c.onError(a)},function(){g=!0,0===e&&c.onCompleted()})),f},b)};var Vc=Cc.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(bb(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=ic,b=0;d>b;b++)c.push(arguments[b]);else for(a=ic,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),C(a,c).mergeAll()};vc.mergeAll=vc.mergeObservable=function(){var a=this;return new ed(function(b){var c=new Zb,d=!1,e=new cc;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new cc;c.add(e),hb(a)&&(a=Zc(a)),e.setDisposable(a.subscribe(function(a){b.onNext(a)},function(a){b.onError(a)},function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},function(a){b.onError(a)},function(){d=!0,1===c.length&&b.onCompleted()})),c},a)},vc.skipUntil=function(a){var b=this;return new ed(function(c){var d=!1,e=new Zb(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));hb(a)&&(a=Zc(a));var f=new cc;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)},vc["switch"]=vc.switchLatest=function(){var a=this;return new ed(function(b){var c=!1,d=new dc,e=!1,f=0,g=a.subscribe(function(a){var g=new cc,h=++f;c=!0,d.setDisposable(g),hb(a)&&(a=Zc(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 Zb(g,d)},a)},vc.takeUntil=function(a){var b=this;return new ed(function(c){return hb(a)&&(a=Zc(a)),new Zb(b.subscribe(c),a.subscribe(function(){c.onCompleted()},function(a){c.onError(a)},ab))},b)},vc.withLatestFrom=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);var d=a.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(a[0])&&(a=a[0]),new ed(function(b){for(var c=function(){return!1},f=a.length,g=p(f,c),h=!1,i=new Array(f),j=new Array(f+1),k=0;f>k;k++)!function(c){var d=a[c],e=new cc;hb(d)&&(d=Zc(d)),e.setDisposable(d.subscribe(function(a){i[c]=a,g[c]=!0,h=g.every(cb)},b.onError.bind(b),function(){})),j[c]=e}(k);var l=new cc;return l.setDisposable(e.subscribe(function(a){var c,e=[a].concat(i);if(h){try{c=d.apply(null,e)}catch(f){return void b.onError(f)}b.onNext(c)}},b.onError.bind(b),function(){b.onCompleted()})),j[f]=l,new Zb(j)},this)},vc.zip=function(){if(Array.isArray(arguments[0]))return E.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 ed(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(cb)&&a.onCompleted()}function f(b){i[b]=!0,i.every(function(a){return a})&&a.onCompleted()}for(var g=b.length,h=p(g,G),i=p(g,F),j=new Array(g),k=0;g>k;k++)!function(d){var e=b[d],g=new cc;hb(e)&&(e=Zc(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 Zb(j)},d)},Cc.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)},Cc.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 ed(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(cb))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(cb)?void b.onCompleted():void 0}for(var e=a.length,f=p(e,function(){return[]}),g=p(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new cc,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 Zb(h)})},vc.asObservable=function(){var a=this;return new ed(function(b){return a.subscribe(b)},this)},vc.dematerialize=function(){var a=this;return new ed(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)},vc.distinctUntilChanged=function(a,b){var c=this;return b||(b=eb),new ed(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)},vc["do"]=vc.tap=vc.doAction=function(a,b,c){var d=this,e="function"==typeof a||"undefined"==typeof a?zc(a||ab,b||ab,c||ab):a;return new ed(function(a){return d.subscribe(function(b){try{e.onNext(b)}catch(c){a.onError(c)}a.onNext(b)},function(b){try{e.onError(b)}catch(c){a.onError(c)}a.onError(b)},function(){try{e.onCompleted()}catch(b){a.onError(b)}a.onCompleted()})},this)},vc.doOnNext=vc.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},vc.doOnError=vc.tapOnError=function(a,b){return this.tap(ab,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},vc.doOnCompleted=vc.tapOnCompleted=function(a,b){return this.tap(ab,null,"undefined"!=typeof b?function(){a.call(b)}:a)},vc["finally"]=vc.ensure=function(a){var b=this;return new ed(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return ac(function(){try{d.dispose()}catch(b){throw b}finally{a()}})},this)},vc.finallyAction=function(a){return this.ensure(a)},vc.ignoreElements=function(){var a=this;return new ed(function(b){return a.subscribe(ab,function(a){b.onError(a)},function(){b.onCompleted()})},a)},vc.materialize=function(){var a=this;return new ed(function(b){return a.subscribe(function(a){b.onNext(qc(a))},function(a){b.onNext(rc(a)),b.onCompleted()},function(){b.onNext(sc()),b.onCompleted()})},a)},vc.repeat=function(a){return wc(this,a).concat()},vc.retry=function(a){return wc(this,a).catchError()},vc.retryWhen=function(a){return wc(this).catchErrorWhen(a)},vc.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 ed(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)},vc.skipLast=function(a){var b=this;return new ed(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)},vc.startWith=function(){var a,b=0;arguments.length&&bb(arguments[0])?(a=arguments[0],b=1):a=ic;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return xc([Nc(c,a),this]).concat()},vc.takeLast=function(a){var b=this;return new ed(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)},vc.selectConcat=vc.concatMap=function(a,b,c){return ib(a)&&ib(b)?this.concatMap(function(c,d){var e=a(c,d);return hb(e)&&(e=Zc(e)),(tb(e)||sb(e))&&(e=Lc(e)),e.map(function(a,e){return b(c,a,d,e)})}):ib(a)?H(this,a,c):H(this,function(){return a})};var Wc=function(a){function b(b,c,d){this.source=b,this.selector=vb(c,d,3),a.call(this)}return Vb(b,a),b.prototype.internalMap=function(a,c){var d=this;return new b(this.source,function(b,c,e){return a(d.selector(b,c,e),c,e)},c)},b.prototype.subscribeCore=function(a){return this.source.subscribe(new I(a,this.selector,this))},b}(Ec);I.prototype.onNext=function(a){if(!this.isStopped){try{var b=this.selector(a,this.i++,this.source)}catch(c){return this.observer.onError(c)}this.observer.onNext(b)}},I.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},I.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onCompleted())},I.prototype.dispose=function(){this.isStopped=!0},I.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},vc.map=vc.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof Wc?this.internalMap(c,b):new Wc(this,c,b)},vc.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})},vc.selectMany=vc.flatMap=function(a,b,c){return ib(a)&&ib(b)?this.flatMap(function(c,d){var e=a(c,d);return hb(e)&&(e=Zc(e)),(tb(e)||sb(e))&&(e=Lc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):ib(a)?J(this,a,c):J(this,function(){return a})},vc.selectSwitch=vc.flatMapLatest=vc.switchMap=function(a,b){return this.select(a,b).switchLatest()},vc.skip=function(a){if(0>a)throw new Error(jb);var b=this;return new ed(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)},vc.skipWhile=function(a,b){var c=this,d=vb(a,b,3);return new ed(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)},vc.take=function(a,b){if(0>a)throw new RangeError(jb);if(0===a)return Hc(b);var c=this;return new ed(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)},vc.takeWhile=function(a,b){var c=this,d=vb(a,b,3);return new ed(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 Xc=function(a){function b(b,c,d){this.source=b,this.predicate=vb(c,d,3),a.call(this)}return Vb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new K(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(b,c,e)},c)},b}(Ec);K.prototype.onNext=function(a){if(!this.isStopped){try{var b=this.predicate(a,this.i++,this.source)}catch(c){return this.observer.onError(c)}b&&this.observer.onNext(a)}},K.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},K.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onCompleted())},K.prototype.dispose=function(){this.isStopped=!0},K.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},vc.filter=vc.where=function(a,b){return this instanceof Xc?this.internalFilter(a,b):new Xc(this,a,b)},Cc.fromCallback=function(a,b,c){return function(){for(var d=[],e=0,f=arguments.length;f>e;e++)d.push(arguments[e]);return new ed(function(e){function f(){var a=arguments;if(c){try{a=c(a)}catch(b){return e.onError(b)}e.onNext(a)}else a.length<=1?e.onNext.apply(e,a):e.onNext(a);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},Cc.fromNodeCallback=function(a,b,c){return function(){for(var d=[],e=0,f=arguments.length;f>e;e++)d.push(arguments[e]);return new ed(function(e){function f(a){if(a)return void e.onError(a);for(var b=[],d=1,f=arguments.length;f>d;d++)b.push(arguments[d]);if(c){try{b=c(b)}catch(g){return e.onError(g)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},_.config.useNativeEvents=!1,Cc.fromEvent=function(a,b,c){return a.addListener?Yc(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c):_.config.useNativeEvents||"function"!=typeof a.on||"function"!=typeof a.off?new ed(function(d){return M(a,b,function(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)})}).publish().refCount():Yc(function(c){a.on(b,c)},function(c){a.off(b,c)},c)};var Yc=Cc.fromEventPattern=function(a,b,c){return new ed(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)}var f=a(e);return ac(function(){b&&b(e,f)})}).publish().refCount()},Zc=Cc.fromPromise=function(a){return Gc(function(){var b=new _.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};vc.toPromise=function(a){if(a||(a=_.config.Promise),!a)throw new TypeError("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)})})},Cc.startAsync=function(a){var b;try{b=a()}catch(c){return Rc(c)}return Zc(b)},vc.multicast=function(a,b){var c=this;return"function"==typeof a?new ed(function(d){var e=c.multicast(a());return new Zb(b(e).subscribe(d),e.connect())},c):new $c(c,a)},vc.publish=function(a){return a&&ib(a)?this.multicast(function(){return new hd},a):this.multicast(new hd)},vc.share=function(){return this.publish().refCount()},vc.publishLast=function(a){return a&&ib(a)?this.multicast(function(){return new id},a):this.multicast(new id)},vc.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new kd(b)},a):this.multicast(new kd(a))},vc.shareValue=function(a){return this.publishValue(a).refCount()},vc.replay=function(a,b,c,d){return a&&ib(a)?this.multicast(function(){return new ld(b,c,d)},a):this.multicast(new ld(b,c,d))},vc.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};{var $c=_.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new Zb(f.subscribe(c),ac(function(){e=!1}))),d},a.call(this,function(a){return c.subscribe(a)})}return Vb(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new ed(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(Cc),_c=Cc.interval=function(a,b){return Q(a,a,bb(b)?b:oc)};Cc.timer=function(b,c,d){var e;return bb(d)||(d=oc),c!==a&&"number"==typeof c?e=c:bb(c)&&(d=c),b instanceof Date&&e===a?N(b.getTime(),d):b instanceof Date&&e!==a?(e=c,O(b.getTime(),e,d)):e===a?P(b,d):Q(b,e,d)}}vc.delay=function(a,b){return bb(b)||(b=oc),a instanceof Date?S(this,a.getTime(),b):R(this,a,b)},vc.debounce=vc.throttleWithTimeout=function(a,b){bb(b)||(b=oc);var c=this;return new ed(function(d){var e,f=new dc,g=!1,h=0,i=c.subscribe(function(c){g=!0,e=c,h++;var i=h,j=new cc;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 Zb(i,f)},this)},vc.throttle=function(a,b){return this.debounce(a,b)},vc.timestamp=function(a){return bb(a)||(a=oc),this.map(function(b){return{value:b,timestamp:a.now()}})},vc.sample=vc.throttleLatest=function(a,b){return bb(b)||(b=oc),"number"==typeof a?T(this,_c(a,b)):T(this,a)},vc.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=Rc(new Error(b||"Timeout"))),bb(c)||(c=oc);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new ed(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(hb(b)&&(b=Zc(b)),j.setDisposable(b.subscribe(f)))}))}var h=0,i=new cc,j=new dc,k=!1,l=new dc;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 Zb(j,l)},d)},vc.throttleFirst=function(a,b){bb(b)||(b=oc);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new ed(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 ad=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=bc,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=bc)});return new Zb(c,d,e)}function c(c,d){this.source=c,this.controller=new hd,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,a.call(this,b,c)}return Vb(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(Cc);vc.pausable=function(a){return new ad(this,a)};var bd=function(b){function c(b){var c,d=[],e=U(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 hd,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,b.call(this,c,a)}return Vb(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(Cc);vc.pausableBuffered=function(a){return new bd(this,a)};var cd=function(a){function b(a){return this.source.subscribe(a)}function c(c,d){a.call(this,b,c),this.subject=new dd(d),this.source=c.multicast(this.subject).refCount()}return Vb(c,a),c.prototype.request=function(a){return null==a&&(a=-1),this.subject.request(a)},c}(Cc),dd=function(a){function b(a){return this.subject.subscribe(a)}function c(c){null==c&&(c=!0),a.call(this,b),this.subject=new hd,this.enableQueue=c,this.queue=c?[]:null,this.requestedCount=0,this.requestedDisposable=bc,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.controlledDisposable=bc}return Vb(c,a),Wb(c.prototype,yc,{onCompleted:function(){this.hasCompleted=!0,(!this.enableQueue||0===this.queue.length)&&this.subject.onCompleted()},onError:function(a){this.hasFailed=!0,this.error=a,(!this.enableQueue||0===this.queue.length)&&this.subject.onError(a)},onNext:function(a){var b=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(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.subject.onNext(this.queue.shift()),a--;return 0!==this.queue.length?{numberOfItems:a,returnValue:!0}:{numberOfItems:a,returnValue:!1}}return this.hasFailed?(this.subject.onError(this.error),this.controlledDisposable.dispose(),this.controlledDisposable=bc):this.hasCompleted&&(this.subject.onCompleted(),this.controlledDisposable.dispose(),this.controlledDisposable=bc),{numberOfItems:a,returnValue:!1}},request:function(a){this.disposeCurrentRequest();var b=this,c=this._processRequest(a),a=c.numberOfItems;return c.returnValue?bc:(this.requestedCount=a,this.requestedDisposable=ac(function(){b.requestedCount=0}),this.requestedDisposable)},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=bc}}),c}(Cc);vc.controlled=function(a){return null==a&&(a=!0),new cd(this,a)},vc.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 ed(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 ed=_.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?ac(a):bc}function c(a,c){var d=c[0],e=c[1];try{d.setDisposable(b(e(d)))}catch(f){if(!d.fail(f))throw f}}function d(b,d){function e(a){var d=new fd(a),e=[d,b];return jc.scheduleRequired()?jc.scheduleWithState(e,c):c(null,e),d}this.source=d,a.call(this,e)}return Vb(d,a),d}(Cc),fd=function(a){function b(b){a.call(this),this.observer=b,this.m=new cc}Vb(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){return o(c)}finally{!b&&this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){return o(b)}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){return o(a)}finally{this.dispose()}},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}(Ac),gd=function(a,b){this.subject=a,this.observer=b};gd.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 hd=_.Subject=function(a){function d(a){return b(this),this.isStopped?this.hasError?(a.onError(this.error),bc):(a.onCompleted(),bc):(this.observers.push(a),new gd(this,a))}function e(){a.call(this,d),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return Vb(e,a),Wb(e.prototype,yc.prototype,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b(this),!this.isStopped){this.isStopped=!0;for(var a=0,d=c(this.observers),e=d.length;e>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(b(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var d=0,e=c(this.observers),f=e.length;f>d;d++)e[d].onError(a);this.observers.length=0}},onNext:function(a){if(b(this),!this.isStopped)for(var d=0,e=c(this.observers),f=e.length;f>d;d++)e[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),e.create=function(a,b){return new jd(a,b)},e}(Cc),id=_.AsyncSubject=function(a){function d(a){return b(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),bc):(this.observers.push(a),new gd(this,a))}function e(){a.call(this,d),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return Vb(e,a),Wb(e.prototype,yc,{hasObservers:function(){return b(this),this.observers.length>0},onCompleted:function(){var a,d;if(b(this),!this.isStopped){this.isStopped=!0;var e=c(this.observers),d=e.length;if(this.hasValue)for(a=0;d>a;a++){var f=e[a];f.onNext(this.value),f.onCompleted()}else for(a=0;d>a;a++)e[a].onCompleted();this.observers.length=0}},onError:function(a){if(b(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var d=0,e=c(this.observers),f=e.length;f>d;d++)e[d].onError(a);this.observers.length=0}},onNext:function(a){b(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),e}(Cc),jd=_.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 Vb(c,a),Wb(c.prototype,yc.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Cc),kd=_.BehaviorSubject=function(a){function d(a){return b(this),this.isStopped?(this.hasError?a.onError(this.error):a.onCompleted(),bc):(this.observers.push(a),a.onNext(this.value),new gd(this,a))}function e(b){a.call(this,d),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.hasError=!1}return Vb(e,a),Wb(e.prototype,yc,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b(this),!this.isStopped){this.isStopped=!0;for(var a=0,d=c(this.observers),e=d.length;e>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(b(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var d=0,e=c(this.observers),f=e.length;f>d;d++)e[d].onError(a);this.observers.length=0}},onNext:function(a){if(b(this),!this.isStopped){this.value=a;for(var d=0,e=c(this.observers),f=e.length;f>d;d++)e[d].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),e}(Cc),ld=_.ReplaySubject=function(a){function d(a,b){return ac(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function e(a){var c=new Dc(this.scheduler,a),e=d(this,c);b(this),this._trim(this.scheduler.now()),this.observers.push(c);for(var f=0,g=this.q.length;g>f;f++)c.onNext(this.q[f].value);return this.hasError?c.onError(this.error):this.isStopped&&c.onCompleted(),c.ensureActive(),e}function f(b,c,d){this.bufferSize=null==b?Number.MAX_VALUE:b,this.windowSize=null==c?Number.MAX_VALUE:c,this.scheduler=d||jc,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,e)}return Vb(f,a),Wb(f.prototype,yc.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(b(this),!this.isStopped){var d=this.scheduler.now();this.q.push({interval:d,value:a}),this._trim(d);for(var e=0,f=c(this.observers),g=f.length;g>e;e++){var h=f[e];h.onNext(a),h.ensureActive()}}},onError:function(a){if(b(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var d=this.scheduler.now();this._trim(d);for(var e=0,f=c(this.observers),g=f.length;g>e;e++){var h=f[e];h.onError(a),h.ensureActive()}this.observers.length=0}},onCompleted:function(){if(b(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var d=0,e=c(this.observers),f=e.length;f>d;d++){var g=e[d];g.onCompleted(),g.ensureActive()}this.observers.length=0}},dispose:function(){this.isDisposed=!0,this.observers=null}}),f}(Cc);_.Pauser=function(a){function b(){a.call(this)}return Vb(b,a),b.prototype.pause=function(){this.onNext(!1)},b.prototype.resume=function(){this.onNext(!0)},b}(hd),"function"==typeof define&&"object"==typeof define.amd&&define.amd?(W.Rx=_,define(function(){return _})):X&&Y?Z?(Y.exports=_).Rx=_:X.Rx=_:W.Rx=_;var md=h()}).call(this);
4
4
  //# sourceMappingURL=rx.lite.map
@@ -1,4 +1,4 @@
1
1
  /* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
2
- (function(a){function b(){if(this.isDisposed)throw new Error(Z)}function c(a,b){if($&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(cb)){for(var c=[],e=b;e;e=e.source)e.stack&&c.unshift(e.stack);c.unshift(a.stack);var f=c.join("\n"+cb+"\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===ab&&d>=bb&&Mc>=d}function f(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function g(){if($)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 ab=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=typeof a;return a&&("function"==b||"object"==b)||!1}function j(a){var b=[];if(!i(a))return b;Cb.nonEnumArgs&&a.length&&Db(a)&&(a=Fb.call(a));var c=Cb.enumPrototypes&&"function"==typeof a,d=Cb.enumErrorProps&&(a===wb||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Cb.nonEnumShadows&&a!==xb){var f=a.constructor,g=-1,h=Ab.length;if(a===(f&&f.prototype))var j=a===yb?sb:a===wb?nb:tb.call(a),k=Bb[j];for(;++g<h;)e=Ab[g],k&&k[e]||!ub.call(a,e)||b.push(e)}return b}function k(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 l(a,b){return k(a,b,j)}function m(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function n(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=tb.call(a),h=tb.call(b);if(g==jb&&(g=qb),h==jb&&(h=qb),g!=h)return!1;switch(g){case lb:case mb:return+a==+b;case pb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case rb:case sb:return a==String(b)}var i=g==kb;if(!i){if(g!=qb||!Cb.nodeClass&&(m(a)||m(b)))return!1;var j=!Cb.argsObject&&Db(a)?Object:a.constructor,k=!Cb.argsObject&&Db(b)?Object:b.constructor;if(!(j==k||ub.call(a,"constructor")&&ub.call(b,"constructor")||X(j)&&j instanceof j&&X(k)&&k instanceof k||!("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=n(a[p],r,c,d)))break}}else l(b,function(b,e,f){return ub.call(f,e)?(p++,q=ub.call(a,e)&&n(a[e],b,c,d)):void 0}),q&&l(a,function(a,b,c){return ub.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function o(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:Fb.call(a)}function p(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function q(a,b){this.id=a,this.value=b}function r(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function t(){this._s=s}function u(){this._s=s,this._l=s.length,this._i=0}function v(a){this._a=a}function w(a){this._a=a,this._l=A(a),this._i=0}function x(a){return"number"==typeof a&&J.isFinite(a)}function y(b){var c,d=b[db];if(!d&&"string"==typeof b)return c=new t(b),c[db]();if(!d&&b.length!==a)return c=new v(b),c[db]();if(!d)throw new TypeError("Object is not iterable");return b[db]()}function z(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function A(a){var b=+a.length;return isNaN(b)?0:0!==b&&x(b)?(b=z(b)*Math.floor(Math.abs(b)),0>=b?0:b>wc?wc:b):b}function B(a,b){return Q(a)||(a=Yb),new Hc(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function C(a,b){return new Hc(function(c){var d=new Qb,e=new Rb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}W(f)&&(f=tc(f)),d=new Qb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e},a)}function D(a,b){var c=this;return new Hc(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 void d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))},c)}function E(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return W(f)&&(f=tc(f)),(gb(f)||fb(f))&&(f=xc(f)),f}).concatAll()}function F(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function G(a){this.comparer=a,this.set=[]}function H(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return W(f)&&(f=tc(f)),(gb(f)||fb(f))&&(f=xc(f)),f}).mergeAll()}var I={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},J=I[typeof window]&&window||this,K=I[typeof exports]&&exports&&!exports.nodeType&&exports,L=I[typeof module]&&module&&!module.nodeType&&module,M=L&&L.exports===K&&K,N=I[typeof global]&&global;!N||N.global!==N&&N.window!==N||(J=N);var O={internals:{},config:{Promise:J.Promise},helpers:{}},P=O.helpers.noop=function(){},Q=(O.helpers.notDefined=function(a){return"undefined"==typeof a},O.helpers.isScheduler=function(a){return a instanceof O.Scheduler}),R=O.helpers.identity=function(a){return a},S=(O.helpers.pluck=function(a){return function(b){return b[a]}},O.helpers.just=function(a){return function(){return a}},O.helpers.defaultNow=Date.now),T=O.helpers.defaultComparer=function(a,b){return Eb(a,b)},U=O.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},V=(O.helpers.defaultKeySerializer=function(a){return a.toString()},O.helpers.defaultError=function(a){throw a}),W=O.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},X=(O.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},O.helpers.not=function(a){return!a},O.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==tb.call(a)}),a}()),Y="Argument out of range",Z="Object has been disposed";O.config.longStackSupport=!1;var $=!1;try{throw new Error}catch(_){$=!!_.stack}var ab,bb=g(),cb="From previous event:",db="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";J.Set&&"function"==typeof(new J.Set)["@@iterator"]&&(db="@@iterator");var eb=O.doneEnumerator={done:!0,value:a},fb=O.helpers.isIterable=function(b){return b[db]!==a},gb=O.helpers.isArrayLike=function(b){return b&&b.length!==a};O.helpers.iterator=db;var hb,ib=O.helpers.deprecate=function(){},jb="[object Arguments]",kb="[object Array]",lb="[object Boolean]",mb="[object Date]",nb="[object Error]",ob="[object Function]",pb="[object Number]",qb="[object Object]",rb="[object RegExp]",sb="[object String]",tb=Object.prototype.toString,ub=Object.prototype.hasOwnProperty,vb=tb.call(arguments)==jb,wb=Error.prototype,xb=Object.prototype,yb=String.prototype,zb=xb.propertyIsEnumerable;zb||(zb=xb.propertyIsEnumerable=function(a){for(var b in this)if(b===a)return!0;return!1});try{hb=!(tb.call(document)==qb&&!({toString:0}+""))}catch(_){hb=!0}var Ab=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Bb={};Bb[kb]=Bb[mb]=Bb[pb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Bb[lb]=Bb[sb]={constructor:!0,toString:!0,valueOf:!0},Bb[nb]=Bb[ob]=Bb[rb]={constructor:!0,toString:!0},Bb[qb]={constructor:!0};var Cb={};!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);Cb.enumErrorProps=zb.call(wb,"message")||zb.call(wb,"name"),Cb.enumPrototypes=zb.call(a,"prototype"),Cb.nonEnumArgs=0!=c,Cb.nonEnumShadows=!/valueOf/.test(b)}(1);var Db=function(a){return a&&"object"==typeof a?tb.call(a)==jb:!1};vb||(Db=function(a){return a&&"object"==typeof a?ub.call(a,"callee"):!1});var Eb=O.internals.isEqual=function(a,b){return n(a,b,[],[])},Fb=Array.prototype.slice,Gb=({}.hasOwnProperty,this.inherits=O.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),Hb=O.internals.addProperties=function(a){for(var b=Fb.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}},Ib=O.internals.addRef=function(a,b){return new Hc(function(c){return new Lb(b.getDisposable(),a.subscribe(c))})};q.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Jb=O.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Kb=Jb.prototype;Kb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Kb.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)}}},Kb.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)}}},Kb.peek=function(){return this.items[0].value},Kb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},Kb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Kb.enqueue=function(a){var b=this.length++;this.items[b]=new q(Jb.count++,a),this.percolate(b)},Kb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Jb.count=0;var Lb=O.CompositeDisposable=function(){this.disposables=o(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Mb=Lb.prototype;Mb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Mb.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},Mb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},Mb.toArray=function(){return this.disposables.slice(0)};var Nb=O.Disposable=function(a){this.isDisposed=!1,this.action=a||P};Nb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Ob=Nb.create=function(a){return new Nb(a)},Pb=Nb.empty={dispose:P},Qb=O.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,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),Rb=O.SerialDisposable=Qb,Sb=O.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?Pb:new a(this)},b}();r.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var Tb=O.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||U,this.disposable=new Qb};Tb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Tb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Tb.prototype.isCancelled=function(){return this.disposable.isDisposed},Tb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Ub=O.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(),Pb}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=S,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Vb=Ub.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Lb,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),Pb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Lb,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Pb});h||(f.add(i),e=!0)})};return g(d),f}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({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second: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({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Ub.prototype),function(){Ub.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Ub.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof J.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=J.setInterval(function(){d=c(d)},b);return Ob(function(){J.clearInterval(e)})}}(Ub.prototype),function(a){a.catchError=a["catch"]=function(a){return new bc(this,a)}}(Ub.prototype);var Wb,Xb=(O.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 Qb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),Ub.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=Vb(b);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Ub(S,a,b,c)}()),Yb=Ub.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Ub.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+Ub.normalize(c),g=new Tb(this,b,d,f);if(e)e.enqueue(g);else{e=new Jb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new Ub(S,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),Zb=P,$b=function(){var a,b=P;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!J.setTimeout)throw new Error("No concurrency detected!");a=J.setTimeout,b=J.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),_b=$b.setTimeout,ac=$b.clearTimeout;!function(){function a(){if(!J.postMessage||J.importScripts)return!1;var a=!1,b=J.onmessage;return J.onmessage=function(){a=!0},J.postMessage("","*"),J.onmessage=b,a}var b=RegExp("^"+String(tb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),c="function"==typeof(c=N&&M&&N.setImmediate)&&!b.test(c)&&c,d="function"==typeof(d=N&&M&&N.clearImmediate)&&!b.test(d)&&d;if("function"==typeof c)Wb=c,Zb=d;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Wb=process.nextTick;else if(a()){var e="ms.rx.schedule"+Math.random(),f={},g=0,h=function(a){if("string"==typeof a.data&&a.data.substring(0,e.length)===e){var b=a.data.substring(e.length),c=f[b];c(),delete f[b]}};J.addEventListener?J.addEventListener("message",h,!1):J.attachEvent("onmessage",h,!1),Wb=function(a){var b=g++;f[b]=a,J.postMessage(e+b,"*")}}else if(J.MessageChannel){var i=new J.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},Wb=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in J&&"onreadystatechange"in J.document.createElement("script")?Wb=function(a){var b=J.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},J.document.documentElement.appendChild(b)}:(Wb=function(a){return _b(a,0)},Zb=ac)}();var bc=(Ub.timeout=function(){function a(a,b){var c=this,d=new Qb,e=Wb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Lb(d,Ob(function(){Zb(e)}))}function b(a,b,c){var d=this,e=Ub.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Qb,g=_b(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Lb(f,Ob(function(){ac(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Ub(S,a,b,c)}(),function(a){function b(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function c(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function d(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function e(e,f){this._scheduler=e,this._handler=f,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,this._scheduler.now.bind(this._scheduler),b,c,d)}return Gb(e,a),e.prototype._clone=function(a){return new e(a,this._handler)},e.prototype._wrap=function(a){var b=this;return function(c,d){try{return a(b._getRecursiveWrapper(c),d)}catch(e){if(!b._handler(e))throw e;return Pb}}},e.prototype._getRecursiveWrapper=function(a){if(this._recursiveOriginal!==a){this._recursiveOriginal=a;var b=this._clone(a);b._recursiveOriginal=a,b._recursiveWrapper=b,this._recursiveWrapper=b}return this._recursiveWrapper},e.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new Qb;return f.setDisposable(this._scheduler.schedulePeriodicWithState(a,b,function(a){if(e)return null;try{return c(a)}catch(b){if(e=!0,!d._handler(b))throw b;return f.dispose(),null}})),f},e}(Ub)),cc=O.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}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 Q(a)||(a=Xb),new Hc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),dc=cc.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){var e=new cc("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),ec=cc.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){var e=new cc("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),fc=cc.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new cc("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),gc=O.internals.Enumerator=function(a){this._next=a};gc.prototype.next=function(){return this._next()},gc.prototype[db]=function(){return this};var hc=O.internals.Enumerable=function(a){this._iterator=a};hc.prototype[db]=function(){return this._iterator()},hc.prototype.concat=function(){var a=this;return new Hc(function(b){var c;try{c=a[db]()}catch(d){return void b.onError(d)}var e,f=new Rb,g=Xb.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;W(h)&&(h=tc(h));var i=new Qb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Lb(f,g,Ob(function(){e=!0}))})},hc.prototype.catchError=function(){var a=this;return new Hc(function(b){var c;try{c=a[db]()}catch(d){return void b.onError(d)}var e,f,g=new Rb,h=Xb.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return void b.onError(h)}if(d.done)return void(f?b.onError(f):b.onCompleted());var i=d.value;W(i)&&(i=tc(i));var j=new Qb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new Lb(g,h,Ob(function(){e=!0}))})};var ic=hc.repeat=function(a,b){return null==b&&(b=-1),new hc(function(){var c=b;return new gc(function(){return 0===c?eb:(c>0&&c--,{done:!1,value:a})})})},jc=hc.of=function(a,b,c){return b||(b=R),new hc(function(){var d=-1;return new gc(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:eb})})},kc=O.Observer=function(){};kc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},kc.prototype.asObserver=function(){return new oc(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},kc.prototype.checked=function(){return new pc(this)};var lc=kc.create=function(a,b,c){return a||(a=P),b||(b=V),c||(c=P),new oc(a,b,c)};kc.fromNotifier=function(a,b){return new oc(function(c){return a.call(b,dc(c))},function(c){return a.call(b,ec(c))},function(){return a.call(b,fc())})},kc.prototype.notifyOn=function(a){return new rc(a,this)};var mc,nc=O.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return Gb(b,a),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}(kc),oc=O.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Gb(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}(nc),pc=function(a){function b(b){a.call(this),this._observer=b,this._state=0}Gb(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();try{this._observer.onNext(a)}catch(b){throw b}finally{this._state=0}},c.onError=function(a){this.checkAccess();try{this._observer.onError(a)}catch(b){throw b}finally{this._state=2}},c.onCompleted=function(){this.checkAccess();try{this._observer.onCompleted()}catch(a){throw a}finally{this._state=2}},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(kc),qc=O.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 Rb}return Gb(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}(nc),rc=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return Gb(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b.prototype.dispose=function(){a.prototype.dispose.call(this),this._cancel&&this._cancel.dispose(),this._cancel=null},b}(qc),sc=O.Observable=function(){function a(a){if(O.config.longStackSupport&&$){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(b)}}else this._subscribe=a}return mc=a.prototype,mc.subscribe=mc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:lc(a,b,c))},mc.subscribeOnNext=function(a,b){return this._subscribe(lc(2===arguments.length?function(c){a.call(b,c)}:a))},mc.subscribeOnError=function(a,b){return this._subscribe(lc(null,2===arguments.length?function(c){a.call(b,c)}:a))},mc.subscribeOnCompleted=function(a,b){return this._subscribe(lc(null,null,2===arguments.length?function(){a.call(b)}:a))},a}();mc.observeOn=function(a){var b=this;return new Hc(function(c){return b.subscribe(new rc(a,c))},b)},mc.subscribeOn=function(a){var b=this;return new Hc(function(c){var d=new Qb,e=new Rb;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new r(a,b.subscribe(c)))})),e},b)};var tc=sc.fromPromise=function(a){return uc(function(){var b=new O.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};mc.toPromise=function(a){if(a||(a=O.config.Promise),!a)throw new TypeError("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)})})},mc.toArray=function(){var a=this;return new Hc(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})},a)},sc.create=sc.createWithDisposable=function(a,b){return new Hc(a,b)};var uc=sc.defer=function(a){return new Hc(function(b){var c;try{c=a()}catch(d){return Bc(d).subscribe(b)}return W(c)&&(c=tc(c)),c.subscribe(b)})},vc=sc.empty=function(a){return Q(a)||(a=Xb),new Hc(function(b){return a.schedule(function(){b.onCompleted()})})},wc=Math.pow(2,53)-1;t.prototype[db]=function(){return new u(this._s)},u.prototype[db]=function(){return this},u.prototype.next=function(){if(this._i<this._l){var a=this._s.charAt(this._i++);return{done:!1,value:a}}return eb},v.prototype[db]=function(){return new w(this._a)},w.prototype[db]=function(){return this},w.prototype.next=function(){if(this._i<this._l){var a=this._a[this._i++];return{done:!1,value:a}}return eb};var xc=sc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!X(b))throw new Error("mapFn when provided must be a function");Q(d)||(d=Yb);var e=Object(a),f=y(e);return new Hc(function(a){var e=0;return d.scheduleRecursive(function(d){var g;try{g=f.next()}catch(h){return void a.onError(h)}if(g.done)return void a.onCompleted();var i=g.value;if(b&&X(b))try{i=b.call(c,i,e)}catch(h){return void a.onError(h)}a.onNext(i),e++,d()})})},yc=sc.fromArray=function(a,b){return ib("fromArray","from"),Q(b)||(b=Yb),new Hc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};sc.generate=function(a,b,c,d,e){return Q(e)||(e=Yb),new Hc(function(f){var g=!0,h=a;return e.scheduleRecursive(function(a){var e,i;try{g?g=!1:h=c(h),e=b(h),e&&(i=d(h))}catch(j){return void f.onError(j)}e?(f.onNext(i),a()):f.onCompleted()})})};var zc=sc.never=function(){return new Hc(function(){return Pb})};sc.of=function(){return B(null,arguments)},sc.ofWithScheduler=function(a){return B(a,Fb.call(arguments,1))},sc.range=function(a,b,c){return Q(c)||(c=Yb),new Hc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},sc.repeat=function(a,b,c){return Q(c)||(c=Yb),Ac(a,c).repeat(null==b?-1:b)};var Ac=sc["return"]=sc.just=function(a,b){return Q(b)||(b=Xb),new Hc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};sc.returnValue=function(){return ib("returnValue","return or just"),Ac.apply(null,arguments)};var Bc=sc["throw"]=sc.throwException=sc.throwError=function(a,b){return Q(b)||(b=Xb),new Hc(function(c){return b.schedule(function(){c.onError(a)})})};sc.using=function(a,b){return new Hc(function(c){var d,e,f=Pb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new Lb(Bc(g).subscribe(c),f)}return new Lb(e.subscribe(c),f)})},mc.amb=function(a){var b=this;return new Hc(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new Qb,j=new Qb;return W(a)&&(a=tc(a)),i.setDisposable(b.subscribe(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()})),j.setDisposable(a.subscribe(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()})),new Lb(i,j)})},sc.amb=function(){function a(a,b){return a.amb(b)}for(var b=zc(),c=o(arguments,0),d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},mc["catch"]=mc.catchError=function(a){return"function"==typeof a?C(this,a):Cc([this,a])},mc.catchException=function(a){return ib("catchException","catch or catchError"),this.catchError(a)};var Cc=sc.catchError=sc["catch"]=function(){return jc(o(arguments,0)).catchError()};sc.catchException=function(){return ib("catchException","catch or catchError"),Cc.apply(null,arguments)},mc.combineLatest=function(){var a=Fb.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),Dc.apply(this,a)};var Dc=sc.combineLatest=function(){var a=Fb.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new Hc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(R))){try{d=b.apply(null,k)}catch(e){return void c.onError(e)}c.onNext(d)}else j.filter(function(b,c){return c!==a}).every(R)&&c.onCompleted()}function e(a){j[a]=!0,j.every(R)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=p(g,f),i=!1,j=p(g,f),k=new Array(g),l=new Array(g),m=0;g>m;m++)!function(b){var f=a[b],g=new Qb;W(f)&&(f=tc(f)),g.setDisposable(f.subscribe(function(a){k[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),l[b]=g}(m);return new Lb(l)},this)};mc.concat=function(){var a=Fb.call(arguments,0);return a.unshift(this),Ec.apply(this,a)};var Ec=sc.concat=function(){return jc(o(arguments,0)).concat()};mc.concatAll=function(){return this.merge(1)},mc.concatObservable=function(){return ib("concatObservable","concatAll"),this.merge(1)},mc.merge=function(a){if("number"!=typeof a)return Fc(this,a);var b=this;return new Hc(function(c){function d(a){var b=new Qb;f.add(b),W(a)&&(a=tc(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Lb,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f},b)};var Fc=sc.merge=function(){var a,b;return arguments[0]?Q(arguments[0])?(a=arguments[0],b=Fb.call(arguments,1)):(a=Xb,b=Fb.call(arguments,0)):(a=Xb,b=Fb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),B(a,b).mergeAll()
3
- };mc.mergeAll=function(){var a=this;return new Hc(function(b){var c=new Lb,d=!1,e=new Qb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Qb;c.add(e),W(a)&&(a=tc(a)),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c},a)},mc.mergeObservable=function(){return ib("mergeObservable","mergeAll"),this.mergeAll.apply(this,arguments)},mc.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return Gc([this,a])};var Gc=sc.onErrorResumeNext=function(){var a=o(arguments,0);return new Hc(function(b){var c=0,d=new Rb,e=Xb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],W(f)&&(f=tc(f)),g=new Qb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new Lb(d,e)})};mc.skipUntil=function(a){var b=this;return new Hc(function(c){var d=!1,e=new Lb(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));W(a)&&(a=tc(a));var f=new Qb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e},b)},mc["switch"]=mc.switchLatest=function(){var a=this;return new Hc(function(b){var c=!1,d=new Rb,e=!1,f=0,g=a.subscribe(function(a){var g=new Qb,h=++f;c=!0,d.setDisposable(g),W(a)&&(a=tc(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())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new Lb(g,d)},a)},mc.takeUntil=function(a){var b=this;return new Hc(function(c){return W(a)&&(a=tc(a)),new Lb(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),P))},b)},mc.zip=function(){if(Array.isArray(arguments[0]))return D.apply(this,arguments);var a=this,b=Fb.call(arguments),c=b.pop();return b.unshift(a),new Hc(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(R)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=p(g,function(){return[]}),i=p(g,function(){return!1}),j=new Array(g),k=0;g>k;k++)!function(a){var c=b[a],g=new Qb;W(c)&&(c=tc(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),j[a]=g}(k);return new Lb(j)},a)},sc.zip=function(){var a=Fb.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},sc.zipArray=function(){var a=o(arguments,0);return new Hc(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(R))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(R)?void b.onCompleted():void 0}for(var e=a.length,f=p(e,function(){return[]}),g=p(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Qb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var j=new Lb(h);return j.add(Ob(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),j})},mc.asObservable=function(){return new Hc(this.subscribe.bind(this),this)},mc.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},mc.dematerialize=function(){var a=this;return new Hc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))},this)},mc.distinctUntilChanged=function(a,b){var c=this;return a||(a=R),b||(b=T),new Hc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))},this)},mc["do"]=mc.tap=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new Hc(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b)try{b(c)}catch(d){a.onError(d)}a.onError(c)},function(){if(c)try{c()}catch(b){a.onError(b)}a.onCompleted()})},this)},mc.doAction=function(){return ib("doAction","do or tap"),this.tap.apply(this,arguments)},mc.doOnNext=mc.tapOnNext=function(a,b){return this.tap(2===arguments.length?function(c){a.call(b,c)}:a)},mc.doOnError=mc.tapOnError=function(a,b){return this.tap(P,2===arguments.length?function(c){a.call(b,c)}:a)},mc.doOnCompleted=mc.tapOnCompleted=function(a,b){return this.tap(P,null,2===arguments.length?function(){a.call(b)}:a)},mc["finally"]=mc.ensure=function(a){var b=this;return new Hc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Ob(function(){try{d.dispose()}catch(b){throw b}finally{a()}})},this)},mc.finallyAction=function(a){return ib("finallyAction","finally or ensure"),this.ensure(a)},mc.ignoreElements=function(){var a=this;return new Hc(function(b){return a.subscribe(P,b.onError.bind(b),b.onCompleted.bind(b))},a)},mc.materialize=function(){var a=this;return new Hc(function(b){return a.subscribe(function(a){b.onNext(dc(a))},function(a){b.onNext(ec(a)),b.onCompleted()},function(){b.onNext(fc()),b.onCompleted()})},a)},mc.repeat=function(a){return ic(this,a).concat()},mc.retry=function(a){return ic(this,a).catchError()},mc.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 Hc(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)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})},d)},mc.skipLast=function(a){var b=this;return new Hc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))},b)},mc.startWith=function(){var a,b,c=0;return arguments.length&&Q(arguments[0])?(b=arguments[0],c=1):b=Xb,a=Fb.call(arguments,c),jc([yc(a,b),this]).concat()},mc.takeLast=function(a){var b=this;return new Hc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})},b)},mc.takeLastBuffer=function(a){var b=this;return new Hc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){c.onNext(d),c.onCompleted()})},b)},mc.windowWithCount=function(a,b){var c=this;if(+a||(a=0),1/0===Math.abs(a)&&(a=0),0>=a)throw new Error(Y);if(null==b&&(b=a),+b||(b=0),1/0===Math.abs(b)&&(b=0),0>=b)throw new Error(Y);return new Hc(function(d){function e(){var a=new Kc;i.push(a),d.onNext(Ib(a,g))}var f=new Qb,g=new Sb(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g},c)},mc.selectConcat=mc.concatMap=function(a,b,c){return X(a)&&X(b)?this.concatMap(function(c,d){var e=a(c,d);return W(e)&&(e=tc(e)),(gb(e)||fb(e))&&(e=xc(e)),e.map(function(a,e){return b(c,a,d,e)})}):X(a)?E(this,a,c):E(this,function(){return a})},mc.concatMapObserver=mc.selectConcatObserver=function(a,b,c,d){var e=this;return new Hc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}W(c)&&(c=tc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}W(c)&&(c=tc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}W(a)&&(a=tc(a)),f.onNext(a),f.onCompleted()})},this).concatAll()},mc.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new Hc(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},a.onError.bind(a),function(){!d&&a.onNext(b),a.onCompleted()})},this)},G.prototype.push=function(a){var b=-1===F(this.set,a,this.comparer);return b&&this.set.push(a),b},mc.distinct=function(a,b){var c=this;return b||(b=T),new Hc(function(d){var e=new G(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},d.onError.bind(d),d.onCompleted.bind(d))},this)},mc.select=mc.map=function(a,b){var c=X(a)?a:function(){return a},d=this;return new Hc(function(a){var e=0;return d.subscribe(function(f){var g;try{g=c.call(b,f,e++,d)}catch(h){return void a.onError(h)}a.onNext(g)},a.onError.bind(a),a.onCompleted.bind(a))},d)},mc.pluck=function(a){return this.map(function(b){return b[a]})},mc.flatMapObserver=mc.selectManyObserver=function(a,b,c,d){var e=this;return new Hc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}W(c)&&(c=tc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}W(c)&&(c=tc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}W(a)&&(a=tc(a)),f.onNext(a),f.onCompleted()})},e).mergeAll()},mc.selectMany=mc.flatMap=function(a,b,c){return X(a)&&X(b)?this.flatMap(function(c,d){var e=a(c,d);return W(e)&&(e=tc(e)),(gb(e)||fb(e))&&(e=xc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):X(a)?H(this,a,c):H(this,function(){return a})},mc.selectSwitch=mc.flatMapLatest=mc.switchMap=function(a,b){return this.select(a,b).switchLatest()},mc.skip=function(a){if(0>a)throw new Error(Y);var b=this;return new Hc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))},b)},mc.skipWhile=function(a,b){var c=this;return new Hc(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))},c)},mc.take=function(a,b){if(0>a)throw new RangeError(Y);if(0===a)return vc(b);var c=this;return new Hc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))},c)},mc.takeWhile=function(a,b){var c=this;return new Hc(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))},c)},mc.where=mc.filter=function(a,b){var c=this;return new Hc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))},c)},mc.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 Hc(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 Hc=O.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Ob(a):Pb}function c(d,e){function f(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new Ic(a);return Yb.scheduleRequired()?Yb.schedule(c):c(),e}return this.source=e,this instanceof c?void a.call(this,f):new c(d)}return Gb(c,a),c}(sc),Ic=function(a){function b(b){a.call(this),this.observer=b,this.m=new Qb}Gb(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{!b&&this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},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}(nc),Jc=function(a,b){this.subject=a,this.observer=b};Jc.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 Kc=O.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),Pb):(a.onCompleted(),Pb):(this.observers.push(a),new Jc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return Gb(d,a),Hb(d.prototype,kc,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Lc(a,b)},d}(sc),Lc=(O.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new Jc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),Pb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return Gb(d,a),Hb(d.prototype,kc,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(sc),O.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return Gb(b,a),Hb(b.prototype,kc,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(sc));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(J.Rx=O,define(function(){return O})):K&&L?M?(L.exports=O).Rx=O:K.Rx=O:J.Rx=O;var Mc=g()}).call(this);
2
+ (function(a){function b(a){if(a.isDisposed)throw new Error(eb)}function c(a){for(var b=[],c=0,d=a.length;d>c;c++)b.push(a[c]);return b}function d(a,b){if(fb&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(jb)){for(var c=[],d=b;d;d=d.source)d.stack&&c.unshift(d.stack);c.unshift(a.stack);var f=c.join("\n"+jb+"\n");a.stack=e(f)}}function e(a){for(var b=a.split("\n"),c=[],d=0,e=b.length;e>d;d++){var h=b[d];f(h)||g(h)||!h||c.push(h)}return c.join("\n")}function f(a){var b=i(a);if(!b)return!1;var c=b[0],d=b[1];return c===hb&&d>=ib&&bd>=d}function g(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function h(){if(fb)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=i(c);if(!d)return;return hb=d[0],d[1]}}function i(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 j(a){var b=[];if(!Lb(a))return b;Kb.nonEnumArgs&&a.length&&Mb(a)&&(a=Ob.call(a));var c=Kb.enumPrototypes&&"function"==typeof a,d=Kb.enumErrorProps&&(a===Fb||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Kb.nonEnumShadows&&a!==Gb){var f=a.constructor,g=-1,h=rb;if(a===(f&&f.prototype))var i=a===Hb?Bb:a===Fb?wb:Cb.call(a),j=Jb[i];for(;++g<h;)e=qb[g],j&&j[e]||!Db.call(a,e)||b.push(e)}return b}function k(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 l(a,b){return k(a,b,j)}function m(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function n(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=Cb.call(a),h=Cb.call(b);if(g==sb&&(g=zb),h==sb&&(h=zb),g!=h)return!1;switch(g){case ub:case vb:return+a==+b;case yb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case Ab:case Bb:return a==String(b)}var i=g==tb;if(!i){if(g!=zb||!Kb.nodeClass&&(m(a)||m(b)))return!1;var j=!Kb.argsObject&&Mb(a)?Object:a.constructor,k=!Kb.argsObject&&Mb(b)?Object:b.constructor;if(!(j==k||Db.call(a,"constructor")&&Db.call(b,"constructor")||cb(j)&&j instanceof j&&cb(k)&&k instanceof k||!("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=n(a[p],r,c,d)))break}}else l(b,function(b,e,f){return Db.call(f,e)?(p++,q=Db.call(a,e)&&n(a[e],b,c,d)):void 0}),q&&l(a,function(a,b,c){return Db.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function o(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function p(a){throw a}function q(a,b){this.id=a,this.value=b}function r(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function t(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function u(a){this.observer=a,this.a=[],this.isStopped=!1}function v(){this._s=s}function w(){this._s=s,this._l=s.length,this._i=0}function x(a){this._a=a}function y(a){this._a=a,this._l=C(a),this._i=0}function z(a){return"number"==typeof a&&Q.isFinite(a)}function A(b){var c,d=b[kb];if(!d&&"string"==typeof b)return c=new v(b),c[kb]();if(!d&&b.length!==a)return c=new x(b),c[kb]();if(!d)throw new TypeError("Object is not iterable");return b[kb]()}function B(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function C(a){var b=+a.length;return isNaN(b)?0:0!==b&&z(b)?(b=B(b)*Math.floor(Math.abs(b)),0>=b?0:b>Ic?Ic:b):b}function D(a,b){this.observer=a,this.parent=b}function E(a,b){return new Kc(b,a)}function F(a,b){return new Yc(function(c){var d=new Zb,e=new $b;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)}bb(d)&&(d=Cc(d));var g=new Zb;e.setDisposable(g),g.setDisposable(d.subscribe(c))},function(a){c.onCompleted(a)})),e},a)}function G(a,b){var c=this;return new Yc(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 H(){return!1}function I(){return[]}function J(a,b,c){var d=pb(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return bb(e)&&(e=Cc(e)),(nb(e)||mb(e))&&(e=Jc(e)),e}).concatAll()}function K(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function L(a){this.comparer=a,this.set=[]}function M(a,b,c){this.observer=a,this.selector=b,this.source=c,this.i=0,this.isStopped=!1}function N(a,b,c){var d=pb(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return bb(e)&&(e=Cc(e)),(nb(e)||mb(e))&&(e=Jc(e)),e}).mergeAll()}function O(a,b,c){this.observer=a,this.predicate=b,this.source=c,this.i=0,this.isStopped=!1}var P={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},Q=P[typeof window]&&window||this,R=P[typeof exports]&&exports&&!exports.nodeType&&exports,S=P[typeof module]&&module&&!module.nodeType&&module,T=S&&S.exports===R&&R,U=P[typeof global]&&global;!U||U.global!==U&&U.window!==U||(Q=U);var V={internals:{},config:{Promise:Q.Promise},helpers:{}},W=V.helpers.noop=function(){},X=(V.helpers.notDefined=function(a){return"undefined"==typeof a},V.helpers.isScheduler=function(a){return a instanceof V.Scheduler}),Y=V.helpers.identity=function(a){return a},Z=(V.helpers.pluck=function(a){return function(b){return b[a]}},V.helpers.just=function(a){return function(){return a}},V.helpers.defaultNow=Date.now),$=V.helpers.defaultComparer=function(a,b){return Nb(a,b)},_=V.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},ab=(V.helpers.defaultKeySerializer=function(a){return a.toString()},V.helpers.defaultError=function(a){throw a}),bb=V.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},cb=(V.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},V.helpers.not=function(a){return!a},V.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==Cb.call(a)}),a}()),db="Argument out of range",eb="Object has been disposed";V.config.longStackSupport=!1;var fb=!1;try{throw new Error}catch(gb){fb=!!gb.stack}var hb,ib=h(),jb="From previous event:",kb="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";Q.Set&&"function"==typeof(new Q.Set)["@@iterator"]&&(kb="@@iterator");var lb=V.doneEnumerator={done:!0,value:a},mb=V.helpers.isIterable=function(b){return b[kb]!==a},nb=V.helpers.isArrayLike=function(b){return b&&b.length!==a};V.helpers.iterator=kb;var ob,pb=V.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)}},qb=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],rb=qb.length,sb="[object Arguments]",tb="[object Array]",ub="[object Boolean]",vb="[object Date]",wb="[object Error]",xb="[object Function]",yb="[object Number]",zb="[object Object]",Ab="[object RegExp]",Bb="[object String]",Cb=Object.prototype.toString,Db=Object.prototype.hasOwnProperty,Eb=Cb.call(arguments)==sb,Fb=Error.prototype,Gb=Object.prototype,Hb=String.prototype,Ib=Gb.propertyIsEnumerable;try{ob=!(Cb.call(document)==zb&&!({toString:0}+""))}catch(gb){ob=!0}var Jb={};Jb[tb]=Jb[vb]=Jb[yb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Jb[ub]=Jb[Bb]={constructor:!0,toString:!0,valueOf:!0},Jb[wb]=Jb[xb]=Jb[Ab]={constructor:!0,toString:!0},Jb[zb]={constructor:!0};var Kb={};!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);Kb.enumErrorProps=Ib.call(Fb,"message")||Ib.call(Fb,"name"),Kb.enumPrototypes=Ib.call(a,"prototype"),Kb.nonEnumArgs=0!=c,Kb.nonEnumShadows=!/valueOf/.test(b)}(1);var Lb=V.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},Mb=function(a){return a&&"object"==typeof a?Cb.call(a)==sb:!1};Eb||(Mb=function(a){return a&&"object"==typeof a?Db.call(a,"callee"):!1});var Nb=V.internals.isEqual=function(a,b){return n(a,b,[],[])},Ob=({}.hasOwnProperty,Array.prototype.slice),Pb=this.inherits=V.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},Qb=V.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]}},Rb=V.internals.addRef=function(a,b){return new Yc(function(c){return new Ub(b.getDisposable(),a.subscribe(c))})};q.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Sb=V.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Tb=Sb.prototype;Tb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Tb.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)}}},Tb.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)}}},Tb.peek=function(){return this.items[0].value},Tb.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},Tb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Tb.enqueue=function(a){var b=this.length++;this.items[b]=new q(Sb.count++,a),this.percolate(b)},Tb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Sb.count=0;var Ub=V.CompositeDisposable=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]}this.disposables=a,this.isDisposed=!1,this.length=a.length},Vb=Ub.prototype;Vb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Vb.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},Vb.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 Wb=V.Disposable=function(a){this.isDisposed=!1,this.action=a||W};Wb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Xb=Wb.create=function(a){return new Wb(a)},Yb=Wb.empty={dispose:W},Zb=V.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}(),$b=V.SerialDisposable=Zb,_b=V.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?Yb:new a(this)},b}();r.prototype.dispose=function(){this.scheduler.scheduleWithState(this,t)};var ac=V.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||_,this.disposable=new Zb};ac.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},ac.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},ac.prototype.isCancelled=function(){return this.disposable.isDisposed},ac.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};{var bc=V.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(),Yb}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=Z,a.normalize=function(a){return 0>a&&(a=0),a},a}();bc.normalize}!function(a){function b(a,b){var c=b.first,d=b.second,e=new Ub,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),Yb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Ub,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c](b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Yb});h||(f.add(i),e=!0)})};return g(d),f}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({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second: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({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(bc.prototype),function(){bc.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},bc.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof Q.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=Q.setInterval(function(){d=c(d)},b);return Xb(function(){Q.clearInterval(e)})}}(bc.prototype),function(a){a.catchError=a["catch"]=function(a){return new jc(this,a)}}(bc.prototype);var cc,dc=(V.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 Zb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),bc.immediate=function(){function a(a,b){return b(this,a)}function b(){throw new Error("Not supported")}return new bc(Z,a,b,b)}()),ec=bc.currentThread=function(){function a(a){for(;a.length>0;){var b=a.dequeue();b.isCancelled()||!b.isCancelled()&&b.invoke()}}function b(b,c){var e=new ac(this,b,c,this.now());if(d)d.enqueue(e);else{d=new Sb(4),d.enqueue(e);try{a(d)}catch(f){throw f}finally{d=null}}return e.disposable}function c(){throw new Error("Not supported")}var d,e=new bc(Z,b,c,c);return e.scheduleRequired=function(){return!d},e.ensureTrampoline=function(a){d?a():this.schedule(a)},e}(),fc=W,gc=function(){var a,b=W;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!Q.setTimeout)throw new Error("No concurrency detected!");a=Q.setTimeout,b=Q.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),hc=gc.setTimeout,ic=gc.clearTimeout;!function(){function a(){if(!Q.postMessage||Q.importScripts)return!1;var a=!1,b=Q.onmessage;return Q.onmessage=function(){a=!0},Q.postMessage("","*"),Q.onmessage=b,a}var b=RegExp("^"+String(Cb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),c="function"==typeof(c=U&&T&&U.setImmediate)&&!b.test(c)&&c,d="function"==typeof(d=U&&T&&U.clearImmediate)&&!b.test(d)&&d;if("function"==typeof c)cc=c,fc=d;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))cc=process.nextTick;else if(a()){var e="ms.rx.schedule"+Math.random(),f={},g=0,h=function(a){if("string"==typeof a.data&&a.data.substring(0,e.length)===e){var b=a.data.substring(e.length),c=f[b];c(),delete f[b]}};Q.addEventListener?Q.addEventListener("message",h,!1):Q.attachEvent("onmessage",h,!1),cc=function(a){var b=g++;f[b]=a,Q.postMessage(e+b,"*")}}else if(Q.MessageChannel){var i=new Q.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},cc=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in Q&&"onreadystatechange"in Q.document.createElement("script")?cc=function(a){var b=Q.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},Q.document.documentElement.appendChild(b)}:(cc=function(a){return hc(a,0)},fc=ic)}();var jc=(bc.timeout=function(){function a(a,b){var c=this,d=new Zb,e=cc(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Ub(d,Xb(function(){fc(e)}))}function b(a,b,c){var d=this,e=bc.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Zb,g=hc(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Ub(f,Xb(function(){ic(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new bc(Z,a,b,c)}(),function(a){function b(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function c(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function d(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function e(e,f){this._scheduler=e,this._handler=f,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,this._scheduler.now.bind(this._scheduler),b,c,d)}return Pb(e,a),e.prototype._clone=function(a){return new e(a,this._handler)},e.prototype._wrap=function(a){var b=this;return function(c,d){try{return a(b._getRecursiveWrapper(c),d)}catch(e){if(!b._handler(e))throw e;return Yb}}},e.prototype._getRecursiveWrapper=function(a){if(this._recursiveOriginal!==a){this._recursiveOriginal=a;var b=this._clone(a);b._recursiveOriginal=a,b._recursiveWrapper=b,this._recursiveWrapper=b}return this._recursiveWrapper},e.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new Zb;return f.setDisposable(this._scheduler.schedulePeriodicWithState(a,b,function(a){if(e)return null;try{return c(a)}catch(b){if(e=!0,!d._handler(b))throw b;return f.dispose(),null}})),f},e}(bc)),kc=V.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}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 X(a)||(a=dc),new Yc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),lc=kc.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){var e=new kc("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),mc=kc.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){var e=new kc("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),nc=kc.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new kc("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),oc=V.internals.Enumerator=function(a){this._next=a};oc.prototype.next=function(){return this._next()},oc.prototype[kb]=function(){return this};var pc=V.internals.Enumerable=function(a){this._iterator=a};pc.prototype[kb]=function(){return this._iterator()},pc.prototype.concat=function(){var a=this;return new Yc(function(b){var c,d=a[kb](),e=new $b,f=dc.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;bb(h)&&(h=Cc(h));var i=new Zb;e.setDisposable(i),i.setDisposable(h.subscribe(function(a){b.onNext(a)},function(a){b.onError(a)},a))}});return new Ub(e,f,Xb(function(){c=!0}))})},pc.prototype.catchError=function(){var a=this;return new Yc(function(b){var c,d=a[kb](),e=new $b,f=dc.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;bb(i)&&(i=Cc(i));var j=new Zb;e.setDisposable(j),j.setDisposable(i.subscribe(function(a){b.onNext(a)},f,function(){b.onCompleted()}))}});return new Ub(e,f,Xb(function(){c=!0}))})},pc.prototype.catchErrorWhen=function(a){var b=this;return new Yc(function(c){var d,e,f=new _c,g=new _c,h=a(f),i=h.subscribe(g),j=b[kb](),k=new $b,l=dc.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;bb(i)&&(i=Cc(i));var l=new Zb,m=new Zb;k.setDisposable(new Ub(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 Ub(i,k,l,Xb(function(){d=!0}))})};var qc=pc.repeat=function(a,b){return null==b&&(b=-1),new pc(function(){var c=b;return new oc(function(){return 0===c?lb:(c>0&&c--,{done:!1,value:a})})})},rc=pc.of=function(a,b,c){if(b)var d=pb(b,c,3);return new pc(function(){var c=-1;return new oc(function(){return++c<a.length?{done:!1,value:b?d(a[c],c,a):a[c]}:lb})})},sc=V.Observer=function(){};sc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},sc.prototype.asObserver=function(){return new wc(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},sc.prototype.checked=function(){return new xc(this)};var tc=sc.create=function(a,b,c){return a||(a=W),b||(b=ab),c||(c=W),new wc(a,b,c)};sc.fromNotifier=function(a,b){return new wc(function(c){return a.call(b,lc(c))},function(c){return a.call(b,mc(c))},function(){return a.call(b,nc())})},sc.prototype.notifyOn=function(a){return new zc(a,this)},sc.prototype.makeSafe=function(a){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,a)};var uc,vc=V.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}function c(){throw new Error("Method not implemented")}return Pb(b,a),b.prototype.next=c,b.prototype.error=c,b.prototype.completed=c,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}(sc),wc=V.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Pb(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}(vc),xc=function(a){function b(b){a.call(this),this._observer=b,this._state=0}Pb(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();try{this._observer.onNext(a)}catch(b){throw b}finally{this._state=0}},c.onError=function(a){this.checkAccess();try{this._observer.onError(a)}catch(b){throw b}finally{this._state=2}},c.onCompleted=function(){this.checkAccess();try{this._observer.onCompleted()}catch(a){throw a}finally{this._state=2}},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(sc),yc=V.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 $b}return Pb(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}(vc),zc=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return Pb(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b.prototype.dispose=function(){a.prototype.dispose.call(this),this._cancel&&this._cancel.dispose(),this._cancel=null},b}(yc),Ac=V.Observable=function(){function a(a){if(V.config.longStackSupport&&fb){try{throw new Error}catch(b){this.stack=b.stack.substring(b.stack.indexOf("\n")+1)}var c=this;this._subscribe=function(b){var e=b.onError.bind(b);return b.onError=function(a){d(a,c),e(a)},a.call(c,b)}}else this._subscribe=a}return uc=a.prototype,uc.subscribe=uc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:tc(a,b,c))},uc.subscribeOnNext=function(a,b){return this._subscribe(tc("undefined"!=typeof b?function(c){a.call(b,c)}:a))},uc.subscribeOnError=function(a,b){return this._subscribe(tc(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},uc.subscribeOnCompleted=function(a,b){return this._subscribe(tc(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},a}(),Bc=V.ObservableBase=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Xb(a):Yb}function c(a,c){var d=c[0],e=c[1];try{d.setDisposable(b(e.subscribeCore(d)))}catch(f){if(!d.fail(f))throw f}}function d(a){var b=new Zc(a),d=[b,this];return ec.scheduleRequired()?ec.scheduleWithState(d,c):c(null,d),b}function e(){a.call(this,d)}return Pb(e,a),e.prototype.subscribeCore=function(){throw new Error("Not implemeneted")},e}(Ac);uc.observeOn=function(a){var b=this;return new Yc(function(c){return b.subscribe(new zc(a,c))},b)},uc.subscribeOn=function(a){var b=this;return new Yc(function(c){var d=new Zb,e=new $b;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new r(a,b.subscribe(c)))})),e},b)};var Cc=Ac.fromPromise=function(a){return Ec(function(){var b=new V.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};uc.toPromise=function(a){if(a||(a=V.config.Promise),!a)throw new TypeError("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})};var Dc=function(a){function b(b){this.source=b,a.call(this)}return Pb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new u(a))},b}(Bc);u.prototype.onNext=function(a){this.isStopped||this.a.push(a)},u.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},u.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onNext(this.a),this.observer.onCompleted())},u.prototype.dispose=function(){this.isStopped=!0},u.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},uc.toArray=function(){return new Dc(this)},Ac.create=Ac.createWithDisposable=function(a,b){return new Yc(a,b)};var Ec=Ac.defer=function(a){return new Yc(function(b){var c;try{c=a()}catch(d){return Qc(d).subscribe(b)}return bb(c)&&(c=Cc(c)),c.subscribe(b)})},Fc=Ac.empty=function(a){return X(a)||(a=dc),new Yc(function(b){return a.schedule(function(){b.onCompleted()})})},Gc=function(a){function b(b,c,d){this.iterable=b,this.mapper=c,this.scheduler=d,a.call(this)}return Pb(b,a),b.prototype.subscribeCore=function(a){var b=new Hc(a,this);return b.run()},b}(Bc),Hc=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=A(b),d=this.observer,e=this.parent.mapper;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}(),Ic=Math.pow(2,53)-1;v.prototype[kb]=function(){return new w(this._s)},w.prototype[kb]=function(){return this},w.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:lb},x.prototype[kb]=function(){return new y(this._a)},y.prototype[kb]=function(){return this},y.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:lb};var Jc=Ac.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!cb(b))throw new Error("mapFn when provided must be a function");if(b)var e=pb(b,c,2);return X(d)||(d=ec),new Gc(a,e,d)},Kc=function(a){function b(b,c){this.args=b,this.scheduler=c||ec,a.call(this)}return Pb(b,a),b.prototype.subscribeCore=function(a){var b=new D(a,this);return b.run()},b}(Bc);D.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 Lc=Ac.fromArray=function(a,b){return new Kc(a,b)};Ac.generate=function(a,b,c,d,e){return X(e)||(e=ec),new Yc(function(f){var g=!0,h=a;return e.scheduleRecursive(function(a){var e,i;try{g?g=!1:h=c(h),e=b(h),e&&(i=d(h))}catch(j){return void f.onError(j)}e?(f.onNext(i),a()):f.onCompleted()})})};var Mc=Ac.never=function(){return new Yc(function(){return Yb})};Ac.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new Kc(b)},Ac.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 Kc(c,a)},Ac.pairs=function(a,b){return b||(b=V.Scheduler.currentThread),new Yc(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 Nc=function(a){function b(b,c,d){this.start=b,this.count=c,this.scheduler=d,a.call(this)}return Pb(b,a),b.prototype.subscribeCore=function(a){var b=new Oc(a,this);return b.run()},b}(Bc),Oc=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)
3
+ },a}();Ac.range=function(a,b,c){return X(c)||(c=ec),new Nc(a,b,c)},Ac.repeat=function(a,b,c){return X(c)||(c=ec),Pc(a,c).repeat(null==b?-1:b)};var Pc=Ac["return"]=Ac.just=function(a,b){return X(b)||(b=dc),new Yc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};Ac.returnValue=function(){return Pc.apply(null,arguments)};var Qc=Ac["throw"]=Ac.throwError=function(a,b){return X(b)||(b=dc),new Yc(function(c){return b.schedule(function(){c.onError(a)})})};Ac.throwException=function(){return Ac.throwError.apply(null,arguments)},Ac.using=function(a,b){return new Yc(function(c){var d,e,f=Yb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new Ub(Qc(g).subscribe(c),f)}return new Ub(e.subscribe(c),f)})},uc.amb=function(a){var b=this;return new Yc(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new Zb,j=new Zb;return bb(a)&&(a=Cc(a)),i.setDisposable(b.subscribe(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()})),j.setDisposable(a.subscribe(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()})),new Ub(i,j)})},Ac.amb=function(){function a(a,b){return a.amb(b)}var b=Mc(),c=[];if(Array.isArray(arguments[0]))c=arguments[0];else for(var d=0,e=arguments.length;e>d;d++)c.push(arguments[d]);for(var d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},uc["catch"]=uc.catchError=uc.catchException=function(a){return"function"==typeof a?F(this,a):Rc([this,a])};var Rc=Ac.catchError=Ac["catch"]=Ac.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 rc(a).catchError()};uc.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),Sc.apply(this,b)};var Sc=Ac.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 a--,Array.isArray(b[0])&&(b=b[0]),new Yc(function(c){function e(a){if(h[a]=!0,i||(i=h.every(Y))){try{var b=d.apply(null,k)}catch(e){return void c.onError(e)}c.onNext(b)}else j.filter(function(b,c){return c!==a}).every(Y)&&c.onCompleted()}function f(a){j[a]=!0,j.every(Y)&&c.onCompleted()}for(var g=function(){return!1},h=o(a,g),i=!1,j=o(a,g),k=new Array(a),l=new Array(a),m=0;a>m;m++)!function(a){var d=b[a],g=new Zb;bb(d)&&(d=Cc(d)),g.setDisposable(d.subscribe(function(b){k[a]=b,e(a)},function(a){c.onError(a)},function(){f(a)})),l[a]=g}(m);return new Ub(l)},this)};uc.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),Tc.apply(null,a)};var Tc=Ac.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 rc(a).concat()};uc.concatAll=uc.concatObservable=function(){return this.merge(1)},uc.merge=function(a){if("number"!=typeof a)return Uc(this,a);var b=this;return new Yc(function(c){function d(a){var b=new Zb;f.add(b),bb(a)&&(a=Cc(a)),b.setDisposable(a.subscribe(function(a){c.onNext(a)},function(a){c.onError(a)},function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Ub,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},function(a){c.onError(a)},function(){g=!0,0===e&&c.onCompleted()})),f},b)};var Uc=Ac.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(X(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=dc,b=0;d>b;b++)c.push(arguments[b]);else for(a=dc,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),E(a,c).mergeAll()};uc.mergeAll=uc.mergeObservable=function(){var a=this;return new Yc(function(b){var c=new Ub,d=!1,e=new Zb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Zb;c.add(e),bb(a)&&(a=Cc(a)),e.setDisposable(a.subscribe(function(a){b.onNext(a)},function(a){b.onError(a)},function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},function(a){b.onError(a)},function(){d=!0,1===c.length&&b.onCompleted()})),c},a)},uc.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return Vc([this,a])};var Vc=Ac.onErrorResumeNext=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new Yc(function(b){var c=0,d=new $b,e=dc.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],bb(f)&&(f=Cc(f)),g=new Zb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new Ub(d,e)})};uc.skipUntil=function(a){var b=this;return new Yc(function(c){var d=!1,e=new Ub(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));bb(a)&&(a=Cc(a));var f=new Zb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)},uc["switch"]=uc.switchLatest=function(){var a=this;return new Yc(function(b){var c=!1,d=new $b,e=!1,f=0,g=a.subscribe(function(a){var g=new Zb,h=++f;c=!0,d.setDisposable(g),bb(a)&&(a=Cc(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 Ub(g,d)},a)},uc.takeUntil=function(a){var b=this;return new Yc(function(c){return bb(a)&&(a=Cc(a)),new Ub(b.subscribe(c),a.subscribe(function(){c.onCompleted()},function(a){c.onError(a)},W))},b)},uc.withLatestFrom=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);var d=a.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(a[0])&&(a=a[0]),new Yc(function(b){for(var c=function(){return!1},f=a.length,g=o(f,c),h=!1,i=new Array(f),j=new Array(f+1),k=0;f>k;k++)!function(c){var d=a[c],e=new Zb;bb(d)&&(d=Cc(d)),e.setDisposable(d.subscribe(function(a){i[c]=a,g[c]=!0,h=g.every(Y)},b.onError.bind(b),function(){})),j[c]=e}(k);var l=new Zb;return l.setDisposable(e.subscribe(function(a){var c,e=[a].concat(i);if(h){try{c=d.apply(null,e)}catch(f){return void b.onError(f)}b.onNext(c)}},b.onError.bind(b),function(){b.onCompleted()})),j[f]=l,new Ub(j)},this)},uc.zip=function(){if(Array.isArray(arguments[0]))return G.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 Yc(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(Y)&&a.onCompleted()}function f(b){i[b]=!0,i.every(function(a){return a})&&a.onCompleted()}for(var g=b.length,h=o(g,I),i=o(g,H),j=new Array(g),k=0;g>k;k++)!function(d){var e=b[d],g=new Zb;bb(e)&&(e=Cc(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 Ub(j)},d)},Ac.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)},Ac.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 Yc(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(Y))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(Y)?void b.onCompleted():void 0}for(var e=a.length,f=o(e,function(){return[]}),g=o(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Zb,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 Ub(h)})},uc.asObservable=function(){var a=this;return new Yc(function(b){return a.subscribe(b)},this)},uc.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},uc.dematerialize=function(){var a=this;return new Yc(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)},uc.distinctUntilChanged=function(a,b){var c=this;return b||(b=$),new Yc(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)},uc["do"]=uc.tap=uc.doAction=function(a,b,c){var d=this,e="function"==typeof a||"undefined"==typeof a?tc(a||W,b||W,c||W):a;return new Yc(function(a){return d.subscribe(function(b){try{e.onNext(b)}catch(c){a.onError(c)}a.onNext(b)},function(b){try{e.onError(b)}catch(c){a.onError(c)}a.onError(b)},function(){try{e.onCompleted()}catch(b){a.onError(b)}a.onCompleted()})},this)},uc.doOnNext=uc.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},uc.doOnError=uc.tapOnError=function(a,b){return this.tap(W,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},uc.doOnCompleted=uc.tapOnCompleted=function(a,b){return this.tap(W,null,"undefined"!=typeof b?function(){a.call(b)}:a)},uc["finally"]=uc.ensure=function(a){var b=this;return new Yc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Xb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})},this)},uc.finallyAction=function(a){return this.ensure(a)},uc.ignoreElements=function(){var a=this;return new Yc(function(b){return a.subscribe(W,function(a){b.onError(a)},function(){b.onCompleted()})},a)},uc.materialize=function(){var a=this;return new Yc(function(b){return a.subscribe(function(a){b.onNext(lc(a))},function(a){b.onNext(mc(a)),b.onCompleted()},function(){b.onNext(nc()),b.onCompleted()})},a)},uc.repeat=function(a){return qc(this,a).concat()},uc.retry=function(a){return qc(this,a).catchError()},uc.retryWhen=function(a){return qc(this).catchErrorWhen(a)},uc.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 Yc(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)},uc.skipLast=function(a){var b=this;return new Yc(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)},uc.startWith=function(){var a,b=0;arguments.length&&X(arguments[0])?(a=arguments[0],b=1):a=dc;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return rc([Lc(c,a),this]).concat()},uc.takeLast=function(a){var b=this;return new Yc(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)},uc.takeLastBuffer=function(a){var b=this;return new Yc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){c.onNext(d),c.onCompleted()})},b)},uc.windowWithCount=function(a,b){var c=this;if(+a||(a=0),1/0===Math.abs(a)&&(a=0),0>=a)throw new Error(db);if(null==b&&(b=a),+b||(b=0),1/0===Math.abs(b)&&(b=0),0>=b)throw new Error(db);return new Yc(function(d){function e(){var a=new _c;i.push(a),d.onNext(Rb(a,g))}var f=new Zb,g=new _b(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g},c)},uc.selectConcat=uc.concatMap=function(a,b,c){return cb(a)&&cb(b)?this.concatMap(function(c,d){var e=a(c,d);return bb(e)&&(e=Cc(e)),(nb(e)||mb(e))&&(e=Jc(e)),e.map(function(a,e){return b(c,a,d,e)})}):cb(a)?J(this,a,c):J(this,function(){return a})},uc.concatMapObserver=uc.selectConcatObserver=function(a,b,c,d){var e=this,f=pb(a,d,2),g=pb(b,d,1),h=pb(c,d,0);return new Yc(function(a){var b=0;return e.subscribe(function(c){var d;try{d=f(c,b++)}catch(e){return void a.onError(e)}bb(d)&&(d=Cc(d)),a.onNext(d)},function(b){var c;try{c=g(b)}catch(d){return void a.onError(d)}bb(c)&&(c=Cc(c)),a.onNext(c),a.onCompleted()},function(){var b;try{b=h()}catch(c){return void a.onError(c)}bb(b)&&(b=Cc(b)),a.onNext(b),a.onCompleted()})},this).concatAll()},uc.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new Yc(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},function(b){a.onError(b)},function(){!d&&a.onNext(b),a.onCompleted()})},c)},L.prototype.push=function(a){var b=-1===K(this.set,a,this.comparer);return b&&this.set.push(a),b},uc.distinct=function(a,b){var c=this;return b||(b=$),new Yc(function(d){var e=new L(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},function(a){d.onError(a)},function(){d.onCompleted()})},this)};var Wc=function(a){function b(b,c,d){this.source=b,this.selector=pb(c,d,3),a.call(this)}return Pb(b,a),b.prototype.internalMap=function(a,c){var d=this;return new b(this.source,function(b,c,e){return a(d.selector(b,c,e),c,e)},c)},b.prototype.subscribeCore=function(a){return this.source.subscribe(new M(a,this.selector,this))},b}(Bc);M.prototype.onNext=function(a){if(!this.isStopped){try{var b=this.selector(a,this.i++,this.source)}catch(c){return this.observer.onError(c)}this.observer.onNext(b)}},M.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},M.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onCompleted())},M.prototype.dispose=function(){this.isStopped=!0},M.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},uc.map=uc.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof Wc?this.internalMap(c,b):new Wc(this,c,b)},uc.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})},uc.flatMapObserver=uc.selectManyObserver=function(a,b,c,d){var e=this;return new Yc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}bb(c)&&(c=Cc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}bb(c)&&(c=Cc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}bb(a)&&(a=Cc(a)),f.onNext(a),f.onCompleted()})},e).mergeAll()},uc.selectMany=uc.flatMap=function(a,b,c){return cb(a)&&cb(b)?this.flatMap(function(c,d){var e=a(c,d);return bb(e)&&(e=Cc(e)),(nb(e)||mb(e))&&(e=Jc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):cb(a)?N(this,a,c):N(this,function(){return a})},uc.selectSwitch=uc.flatMapLatest=uc.switchMap=function(a,b){return this.select(a,b).switchLatest()},uc.skip=function(a){if(0>a)throw new Error(db);var b=this;return new Yc(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)},uc.skipWhile=function(a,b){var c=this,d=pb(a,b,3);return new Yc(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)},uc.take=function(a,b){if(0>a)throw new RangeError(db);if(0===a)return Fc(b);var c=this;return new Yc(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)},uc.takeWhile=function(a,b){var c=this,d=pb(a,b,3);return new Yc(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 Xc=function(a){function b(b,c,d){this.source=b,this.predicate=pb(c,d,3),a.call(this)}return Pb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new O(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(b,c,e)},c)},b}(Bc);O.prototype.onNext=function(a){if(!this.isStopped){try{var b=this.predicate(a,this.i++,this.source)}catch(c){return this.observer.onError(c)}b&&this.observer.onNext(a)}},O.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},O.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onCompleted())},O.prototype.dispose=function(){this.isStopped=!0},O.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},uc.filter=uc.where=function(a,b){return this instanceof Xc?this.internalFilter(a,b):new Xc(this,a,b)},uc.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 Yc(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 Yc=V.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Xb(a):Yb}function c(a,c){var d=c[0],e=c[1];try{d.setDisposable(b(e(d)))}catch(f){if(!d.fail(f))throw f}}function d(b,d){function e(a){var d=new Zc(a),e=[d,b];return ec.scheduleRequired()?ec.scheduleWithState(e,c):c(null,e),d}this.source=d,a.call(this,e)}return Pb(d,a),d}(Ac),Zc=function(a){function b(b){a.call(this),this.observer=b,this.m=new Zb}Pb(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){return p(c)}finally{!b&&this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){return p(b)}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){return p(a)}finally{this.dispose()}},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}(vc),$c=function(a,b){this.subject=a,this.observer=b};$c.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 _c=V.Subject=function(a){function d(a){return b(this),this.isStopped?this.hasError?(a.onError(this.error),Yb):(a.onCompleted(),Yb):(this.observers.push(a),new $c(this,a))}function e(){a.call(this,d),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return Pb(e,a),Qb(e.prototype,sc.prototype,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b(this),!this.isStopped){this.isStopped=!0;for(var a=0,d=c(this.observers),e=d.length;e>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(b(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var d=0,e=c(this.observers),f=e.length;f>d;d++)e[d].onError(a);this.observers.length=0}},onNext:function(a){if(b(this),!this.isStopped)for(var d=0,e=c(this.observers),f=e.length;f>d;d++)e[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),e.create=function(a,b){return new ad(a,b)},e}(Ac),ad=(V.AsyncSubject=function(a){function d(a){return b(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),Yb):(this.observers.push(a),new $c(this,a))}function e(){a.call(this,d),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return Pb(e,a),Qb(e.prototype,sc,{hasObservers:function(){return b(this),this.observers.length>0},onCompleted:function(){var a,d;if(b(this),!this.isStopped){this.isStopped=!0;var e=c(this.observers),d=e.length;if(this.hasValue)for(a=0;d>a;a++){var f=e[a];f.onNext(this.value),f.onCompleted()}else for(a=0;d>a;a++)e[a].onCompleted();this.observers.length=0}},onError:function(a){if(b(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var d=0,e=c(this.observers),f=e.length;f>d;d++)e[d].onError(a);this.observers.length=0}},onNext:function(a){b(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),e}(Ac),V.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 Pb(c,a),Qb(c.prototype,sc.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Ac));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Q.Rx=V,define(function(){return V})):R&&S?T?(S.exports=V).Rx=V:R.Rx=V:Q.Rx=V;var bd=h()}).call(this);
4
4
  //# sourceMappingURL=rx.map
@@ -1,57 +1,51 @@
1
1
  // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
2
2
 
3
3
  ;(function (factory) {
4
- var objectTypes = {
5
- 'boolean': false,
6
- 'function': true,
7
- 'object': true,
8
- 'number': false,
9
- 'string': false,
10
- 'undefined': false
11
- };
4
+ var objectTypes = {
5
+ 'boolean': false,
6
+ 'function': true,
7
+ 'object': true,
8
+ 'number': false,
9
+ 'string': false,
10
+ 'undefined': false
11
+ };
12
12
 
13
- var root = (objectTypes[typeof window] && window) || this,
14
- freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
15
- freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
16
- moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
17
- freeGlobal = objectTypes[typeof global] && global;
13
+ var root = (objectTypes[typeof window] && window) || this,
14
+ freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
15
+ freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
16
+ moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
17
+ freeGlobal = objectTypes[typeof global] && global;
18
18
 
19
- if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
20
- root = freeGlobal;
21
- }
19
+ if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
20
+ root = freeGlobal;
21
+ }
22
22
 
23
- // Because of build optimizers
24
- if (typeof define === 'function' && define.amd) {
25
- define(['rx.virtualtime', 'exports'], function (Rx, exports) {
26
- root.Rx = factory(root, exports, Rx);
27
- return root.Rx;
28
- });
29
- } else if (typeof module === 'object' && module && module.exports === freeExports) {
30
- module.exports = factory(root, module.exports, require('./rx.all'));
31
- } else {
32
- root.Rx = factory(root, {}, root.Rx);
33
- }
23
+ // Because of build optimizers
24
+ if (typeof define === 'function' && define.amd) {
25
+ define(['rx.virtualtime', 'exports'], function (Rx, exports) {
26
+ root.Rx = factory(root, exports, Rx);
27
+ return root.Rx;
28
+ });
29
+ } else if (typeof module === 'object' && module && module.exports === freeExports) {
30
+ module.exports = factory(root, module.exports, require('./rx'));
31
+ } else {
32
+ root.Rx = factory(root, {}, root.Rx);
33
+ }
34
34
  }.call(this, function (root, exp, Rx, undefined) {
35
35
 
36
- // Defaults
37
- var Observer = Rx.Observer,
38
- Observable = Rx.Observable,
39
- Notification = Rx.Notification,
40
- VirtualTimeScheduler = Rx.VirtualTimeScheduler,
41
- Disposable = Rx.Disposable,
42
- disposableEmpty = Disposable.empty,
43
- disposableCreate = Disposable.create,
44
- CompositeDisposable = Rx.CompositeDisposable,
45
- SingleAssignmentDisposable = Rx.SingleAssignmentDisposable,
46
- slice = Array.prototype.slice,
47
- inherits = Rx.internals.inherits,
48
- defaultComparer = Rx.internals.isEqual;
49
-
50
- function argsOrArray(args, idx) {
51
- return args.length === 1 && Array.isArray(args[idx]) ?
52
- args[idx] :
53
- slice.call(args);
54
- }
36
+ // Defaults
37
+ var Observer = Rx.Observer,
38
+ Observable = Rx.Observable,
39
+ Notification = Rx.Notification,
40
+ VirtualTimeScheduler = Rx.VirtualTimeScheduler,
41
+ Disposable = Rx.Disposable,
42
+ disposableEmpty = Disposable.empty,
43
+ disposableCreate = Disposable.create,
44
+ CompositeDisposable = Rx.CompositeDisposable,
45
+ SingleAssignmentDisposable = Rx.SingleAssignmentDisposable,
46
+ slice = Array.prototype.slice,
47
+ inherits = Rx.internals.inherits,
48
+ defaultComparer = Rx.internals.isEqual;
55
49
 
56
50
  function OnNextPredicate(predicate) {
57
51
  this.predicate = predicate;
@@ -196,20 +190,15 @@ var ReactiveTest = Rx.ReactiveTest = {
196
190
  return '(' + this.subscribe + ', ' + (this.unsubscribe === Number.MAX_VALUE ? 'Infinite' : this.unsubscribe) + ')';
197
191
  };
198
192
 
199
- /** @private */
200
- var MockDisposable = Rx.MockDisposable = function (scheduler) {
201
- this.scheduler = scheduler;
202
- this.disposes = [];
203
- this.disposes.push(this.scheduler.clock);
204
- };
193
+ var MockDisposable = Rx.MockDisposable = function (scheduler) {
194
+ this.scheduler = scheduler;
195
+ this.disposes = [];
196
+ this.disposes.push(this.scheduler.clock);
197
+ };
205
198
 
206
- /*
207
- * @memberOf MockDisposable#
208
- * @prviate
209
- */
210
- MockDisposable.prototype.dispose = function () {
211
- this.disposes.push(this.scheduler.clock);
212
- };
199
+ MockDisposable.prototype.dispose = function () {
200
+ this.disposes.push(this.scheduler.clock);
201
+ };
213
202
 
214
203
  var MockObserver = (function (__super__) {
215
204
  inherits(MockObserver, __super__);
@@ -481,8 +470,14 @@ var ReactiveTest = Rx.ReactiveTest = {
481
470
  * @return Hot observable sequence that can be used to assert the timing of subscriptions and notifications.
482
471
  */
483
472
  TestScheduler.prototype.createHotObservable = function () {
484
- var messages = argsOrArray(arguments, 0);
485
- return new HotObservable(this, messages);
473
+ var len = arguments.length, args;
474
+ if (Array.isArray(arguments[0])) {
475
+ args = arguments[0];
476
+ } else {
477
+ args = new Array(len);
478
+ for (var i = 0; i < len; i++) { args[i] = arguments[i]; }
479
+ }
480
+ return new HotObservable(this, args);
486
481
  };
487
482
 
488
483
  /**
@@ -491,8 +486,14 @@ var ReactiveTest = Rx.ReactiveTest = {
491
486
  * @return Cold observable sequence that can be used to assert the timing of subscriptions and notifications.
492
487
  */
493
488
  TestScheduler.prototype.createColdObservable = function () {
494
- var messages = argsOrArray(arguments, 0);
495
- return new ColdObservable(this, messages);
489
+ var len = arguments.length, args;
490
+ if (Array.isArray(arguments[0])) {
491
+ args = arguments[0];
492
+ } else {
493
+ args = new Array(len);
494
+ for (var i = 0; i < len; i++) { args[i] = arguments[i]; }
495
+ }
496
+ return new ColdObservable(this, args);
496
497
  };
497
498
 
498
499
  /**
@@ -1,3 +1,3 @@
1
1
  /* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
2
- (function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx.virtualtime","exports"],function(b,d){return c.Rx=a(c,d,b),c.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx.all")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:q.call(a)}function f(a){this.predicate=a}function g(a){this.predicate=a}function h(a,b){var c=this;this.scheduler=a,this.messages=b,this.subscriptions=[],this.observers=[];for(var d=0,e=this.messages.length;e>d;d++){var f=this.messages[d],g=f.value;!function(b){a.scheduleAbsoluteWithState(null,f.time,function(){for(var a=c.observers.slice(0),d=0,e=a.length;e>d;d++)b.accept(a[d]);return n})}(g)}}var i=c.Observer,j=c.Observable,k=c.Notification,l=c.VirtualTimeScheduler,m=c.Disposable,n=m.empty,o=m.create,p=c.CompositeDisposable,q=(c.SingleAssignmentDisposable,Array.prototype.slice),r=c.internals.inherits,s=c.internals.isEqual;f.prototype.equals=function(a){return a===this?!0:null==a?!1:"N"!==a.kind?!1:this.predicate(a.value)},g.prototype.equals=function(a){return a===this?!0:null==a?!1:"E"!==a.kind?!1:this.predicate(a.exception)};var t=c.ReactiveTest={created:100,subscribed:200,disposed:1e3,onNext:function(a,b){return"function"==typeof b?new u(a,new f(b)):new u(a,k.createOnNext(b))},onError:function(a,b){return"function"==typeof b?new u(a,new g(b)):new u(a,k.createOnError(b))},onCompleted:function(a){return new u(a,k.createOnCompleted())},subscribe:function(a,b){return new v(a,b)}},u=c.Recorded=function(a,b,c){this.time=a,this.value=b,this.comparer=c||s};u.prototype.equals=function(a){return this.time===a.time&&this.comparer(this.value,a.value)},u.prototype.toString=function(){return this.value.toString()+"@"+this.time};var v=c.Subscription=function(a,b){this.subscribe=a,this.unsubscribe=b||Number.MAX_VALUE};v.prototype.equals=function(a){return this.subscribe===a.subscribe&&this.unsubscribe===a.unsubscribe},v.prototype.toString=function(){return"("+this.subscribe+", "+(this.unsubscribe===Number.MAX_VALUE?"Infinite":this.unsubscribe)+")"};var w=c.MockDisposable=function(a){this.scheduler=a,this.disposes=[],this.disposes.push(this.scheduler.clock)};w.prototype.dispose=function(){this.disposes.push(this.scheduler.clock)};var x=function(a){function b(b){a.call(this),this.scheduler=b,this.messages=[]}r(b,a);var c=b.prototype;return c.onNext=function(a){this.messages.push(new u(this.scheduler.clock,k.createOnNext(a)))},c.onError=function(a){this.messages.push(new u(this.scheduler.clock,k.createOnError(a)))},c.onCompleted=function(){this.messages.push(new u(this.scheduler.clock,k.createOnCompleted()))},b}(i);h.prototype.then=function(a,b){var e=this;this.subscriptions.push(new v(this.scheduler.clock));var f,g=this.subscriptions.length-1,i=c.Observer.create(function(b){var j=a(b);if(j&&"function"==typeof j.then)f=j;else{var k=e.scheduler.clock;f=new h(e.scheduler,[c.ReactiveTest.onNext(k,d),c.ReactiveTest.onCompleted(k)])}var l=e.observers.indexOf(i);e.observers.splice(l,1),e.subscriptions[g]=new v(e.subscriptions[g].subscribe,e.scheduler.clock)},function(a){b(a);var c=e.observers.indexOf(i);e.observers.splice(c,1),e.subscriptions[g]=new v(e.subscriptions[g].subscribe,e.scheduler.clock)});return this.observers.push(i),f||new h(this.scheduler,this.messages)};var y=function(a){function b(a){var b=this;this.observers.push(a),this.subscriptions.push(new v(this.scheduler.clock));var c=this.subscriptions.length-1;return o(function(){var d=b.observers.indexOf(a);b.observers.splice(d,1),b.subscriptions[c]=new v(b.subscriptions[c].subscribe,b.scheduler.clock)})}function c(c,d){a.call(this,b);var e,f,g=this;this.scheduler=c,this.messages=d,this.subscriptions=[],this.observers=[];for(var h=0,i=this.messages.length;i>h;h++)e=this.messages[h],f=e.value,function(a){c.scheduleAbsoluteWithState(null,e.time,function(){for(var b=g.observers.slice(0),c=0,d=b.length;d>c;c++)a.accept(b[c]);return n})}(f)}return r(c,a),c}(j),z=function(a){function b(a){var b,c,d=this;this.subscriptions.push(new v(this.scheduler.clock));for(var e=this.subscriptions.length-1,f=new p,g=0,h=this.messages.length;h>g;g++)b=this.messages[g],c=b.value,function(c){f.add(d.scheduler.scheduleRelativeWithState(null,b.time,function(){return c.accept(a),n}))}(c);return o(function(){d.subscriptions[e]=new v(d.subscriptions[e].subscribe,d.scheduler.clock),f.dispose()})}function c(c,d){a.call(this,b),this.scheduler=c,this.messages=d,this.subscriptions=[]}return r(c,a),c}(j);return c.TestScheduler=function(a){function b(a,b){return a>b?1:b>a?-1:0}function d(){a.call(this,0,b)}return r(d,a),d.prototype.scheduleAbsoluteWithState=function(b,c,d){return c<=this.clock&&(c=this.clock+1),a.prototype.scheduleAbsoluteWithState.call(this,b,c,d)},d.prototype.add=function(a,b){return a+b},d.prototype.toDateTimeOffset=function(a){return new Date(a).getTime()},d.prototype.toRelative=function(a){return a},d.prototype.startWithTiming=function(a,b,c,d){var e,f,g=this.createObserver();return this.scheduleAbsoluteWithState(null,b,function(){return e=a(),n}),this.scheduleAbsoluteWithState(null,c,function(){return f=e.subscribe(g),n}),this.scheduleAbsoluteWithState(null,d,function(){return f.dispose(),n}),this.start(),g},d.prototype.startWithDispose=function(a,b){return this.startWithTiming(a,t.created,t.subscribed,b)},d.prototype.startWithCreate=function(a){return this.startWithTiming(a,t.created,t.subscribed,t.disposed)},d.prototype.createHotObservable=function(){var a=e(arguments,0);return new y(this,a)},d.prototype.createColdObservable=function(){var a=e(arguments,0);return new z(this,a)},d.prototype.createResolvedPromise=function(a,b){return new h(this,[c.ReactiveTest.onNext(a,b),c.ReactiveTest.onCompleted(a)])},d.prototype.createRejectedPromise=function(a,b){return new h(this,[c.ReactiveTest.onError(a,b)])},d.prototype.createObserver=function(){return new x(this)},d}(l),c});
2
+ (function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx.virtualtime","exports"],function(b,d){return c.Rx=a(c,d,b),c.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a){this.predicate=a}function f(a){this.predicate=a}function g(a,b){var c=this;this.scheduler=a,this.messages=b,this.subscriptions=[],this.observers=[];for(var d=0,e=this.messages.length;e>d;d++){var f=this.messages[d],g=f.value;!function(b){a.scheduleAbsoluteWithState(null,f.time,function(){for(var a=c.observers.slice(0),d=0,e=a.length;e>d;d++)b.accept(a[d]);return m})}(g)}}var h=c.Observer,i=c.Observable,j=c.Notification,k=c.VirtualTimeScheduler,l=c.Disposable,m=l.empty,n=l.create,o=c.CompositeDisposable,p=(c.SingleAssignmentDisposable,Array.prototype.slice,c.internals.inherits),q=c.internals.isEqual;e.prototype.equals=function(a){return a===this?!0:null==a?!1:"N"!==a.kind?!1:this.predicate(a.value)},f.prototype.equals=function(a){return a===this?!0:null==a?!1:"E"!==a.kind?!1:this.predicate(a.exception)};var r=c.ReactiveTest={created:100,subscribed:200,disposed:1e3,onNext:function(a,b){return"function"==typeof b?new s(a,new e(b)):new s(a,j.createOnNext(b))},onError:function(a,b){return"function"==typeof b?new s(a,new f(b)):new s(a,j.createOnError(b))},onCompleted:function(a){return new s(a,j.createOnCompleted())},subscribe:function(a,b){return new t(a,b)}},s=c.Recorded=function(a,b,c){this.time=a,this.value=b,this.comparer=c||q};s.prototype.equals=function(a){return this.time===a.time&&this.comparer(this.value,a.value)},s.prototype.toString=function(){return this.value.toString()+"@"+this.time};var t=c.Subscription=function(a,b){this.subscribe=a,this.unsubscribe=b||Number.MAX_VALUE};t.prototype.equals=function(a){return this.subscribe===a.subscribe&&this.unsubscribe===a.unsubscribe},t.prototype.toString=function(){return"("+this.subscribe+", "+(this.unsubscribe===Number.MAX_VALUE?"Infinite":this.unsubscribe)+")"};var u=c.MockDisposable=function(a){this.scheduler=a,this.disposes=[],this.disposes.push(this.scheduler.clock)};u.prototype.dispose=function(){this.disposes.push(this.scheduler.clock)};var v=function(a){function b(b){a.call(this),this.scheduler=b,this.messages=[]}p(b,a);var c=b.prototype;return c.onNext=function(a){this.messages.push(new s(this.scheduler.clock,j.createOnNext(a)))},c.onError=function(a){this.messages.push(new s(this.scheduler.clock,j.createOnError(a)))},c.onCompleted=function(){this.messages.push(new s(this.scheduler.clock,j.createOnCompleted()))},b}(h);g.prototype.then=function(a,b){var e=this;this.subscriptions.push(new t(this.scheduler.clock));var f,h=this.subscriptions.length-1,i=c.Observer.create(function(b){var j=a(b);if(j&&"function"==typeof j.then)f=j;else{var k=e.scheduler.clock;f=new g(e.scheduler,[c.ReactiveTest.onNext(k,d),c.ReactiveTest.onCompleted(k)])}var l=e.observers.indexOf(i);e.observers.splice(l,1),e.subscriptions[h]=new t(e.subscriptions[h].subscribe,e.scheduler.clock)},function(a){b(a);var c=e.observers.indexOf(i);e.observers.splice(c,1),e.subscriptions[h]=new t(e.subscriptions[h].subscribe,e.scheduler.clock)});return this.observers.push(i),f||new g(this.scheduler,this.messages)};var w=function(a){function b(a){var b=this;this.observers.push(a),this.subscriptions.push(new t(this.scheduler.clock));var c=this.subscriptions.length-1;return n(function(){var d=b.observers.indexOf(a);b.observers.splice(d,1),b.subscriptions[c]=new t(b.subscriptions[c].subscribe,b.scheduler.clock)})}function c(c,d){a.call(this,b);var e,f,g=this;this.scheduler=c,this.messages=d,this.subscriptions=[],this.observers=[];for(var h=0,i=this.messages.length;i>h;h++)e=this.messages[h],f=e.value,function(a){c.scheduleAbsoluteWithState(null,e.time,function(){for(var b=g.observers.slice(0),c=0,d=b.length;d>c;c++)a.accept(b[c]);return m})}(f)}return p(c,a),c}(i),x=function(a){function b(a){var b,c,d=this;this.subscriptions.push(new t(this.scheduler.clock));for(var e=this.subscriptions.length-1,f=new o,g=0,h=this.messages.length;h>g;g++)b=this.messages[g],c=b.value,function(c){f.add(d.scheduler.scheduleRelativeWithState(null,b.time,function(){return c.accept(a),m}))}(c);return n(function(){d.subscriptions[e]=new t(d.subscriptions[e].subscribe,d.scheduler.clock),f.dispose()})}function c(c,d){a.call(this,b),this.scheduler=c,this.messages=d,this.subscriptions=[]}return p(c,a),c}(i);return c.TestScheduler=function(a){function b(a,b){return a>b?1:b>a?-1:0}function d(){a.call(this,0,b)}return p(d,a),d.prototype.scheduleAbsoluteWithState=function(b,c,d){return c<=this.clock&&(c=this.clock+1),a.prototype.scheduleAbsoluteWithState.call(this,b,c,d)},d.prototype.add=function(a,b){return a+b},d.prototype.toDateTimeOffset=function(a){return new Date(a).getTime()},d.prototype.toRelative=function(a){return a},d.prototype.startWithTiming=function(a,b,c,d){var e,f,g=this.createObserver();return this.scheduleAbsoluteWithState(null,b,function(){return e=a(),m}),this.scheduleAbsoluteWithState(null,c,function(){return f=e.subscribe(g),m}),this.scheduleAbsoluteWithState(null,d,function(){return f.dispose(),m}),this.start(),g},d.prototype.startWithDispose=function(a,b){return this.startWithTiming(a,r.created,r.subscribed,b)},d.prototype.startWithCreate=function(a){return this.startWithTiming(a,r.created,r.subscribed,r.disposed)},d.prototype.createHotObservable=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new w(this,a)},d.prototype.createColdObservable=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new x(this,a)},d.prototype.createResolvedPromise=function(a,b){return new g(this,[c.ReactiveTest.onNext(a,b),c.ReactiveTest.onCompleted(a)])},d.prototype.createRejectedPromise=function(a,b){return new g(this,[c.ReactiveTest.onError(a,b)])},d.prototype.createObserver=function(){return new v(this)},d}(k),c});
3
3
  //# sourceMappingURL=rx.testing.map
@@ -66,15 +66,15 @@
66
66
 
67
67
  function observableTimerDateAndPeriod(dueTime, period, scheduler) {
68
68
  return new AnonymousObservable(function (observer) {
69
- var count = 0, d = dueTime, p = normalizeTime(period);
70
- return scheduler.scheduleRecursiveWithAbsolute(d, function (self) {
69
+ var d = dueTime, p = normalizeTime(period);
70
+ return scheduler.scheduleRecursiveWithAbsoluteAndState(0, d, function (count, self) {
71
71
  if (p > 0) {
72
72
  var now = scheduler.now();
73
73
  d = d + p;
74
74
  d <= now && (d = now + p);
75
75
  }
76
- observer.onNext(count++);
77
- self(d);
76
+ observer.onNext(count);
77
+ self(count + 1, d);
78
78
  });
79
79
  });
80
80
  }
@@ -279,7 +279,7 @@
279
279
  * @deprecated use #debounce or #throttleWithTimeout instead.
280
280
  */
281
281
  observableProto.throttle = function(dueTime, scheduler) {
282
- deprecate('throttle', 'debounce or throttleWithTimeout');
282
+ //deprecate('throttle', 'debounce or throttleWithTimeout');
283
283
  return this.debounce(dueTime, scheduler);
284
284
  };
285
285
 
@@ -783,7 +783,7 @@
783
783
  /**
784
784
  * Returns the source observable sequence, switching to the other observable sequence if a timeout is signaled.
785
785
  * @param {Observable} [firstTimeout] Observable sequence that represents the timeout for the first element. If not provided, this defaults to Observable.never().
786
- * @param {Function} [timeoutDurationSelector] Selector to retrieve an observable sequence that represents the timeout between the current element and the next element.
786
+ * @param {Function} timeoutDurationSelector Selector to retrieve an observable sequence that represents the timeout between the current element and the next element.
787
787
  * @param {Observable} [other] Sequence to return in case of a timeout. If not provided, this is set to Observable.throwException().
788
788
  * @returns {Observable} The source sequence switching to the other sequence in case of a timeout.
789
789
  */
@@ -900,7 +900,7 @@
900
900
  };
901
901
 
902
902
  observableProto.throttleWithSelector = function () {
903
- deprecate('throttleWithSelector', 'debounceWithSelector');
903
+ //deprecate('throttleWithSelector', 'debounceWithSelector');
904
904
  return this.debounceWithSelector.apply(this, arguments);
905
905
  };
906
906
 
@@ -921,20 +921,20 @@
921
921
  observableProto.skipLastWithTime = function (duration, scheduler) {
922
922
  isScheduler(scheduler) || (scheduler = timeoutScheduler);
923
923
  var source = this;
924
- return new AnonymousObservable(function (observer) {
924
+ return new AnonymousObservable(function (o) {
925
925
  var q = [];
926
926
  return source.subscribe(function (x) {
927
927
  var now = scheduler.now();
928
928
  q.push({ interval: now, value: x });
929
929
  while (q.length > 0 && now - q[0].interval >= duration) {
930
- observer.onNext(q.shift().value);
930
+ o.onNext(q.shift().value);
931
931
  }
932
- }, observer.onError.bind(observer), function () {
932
+ }, function (e) { o.onError(e); }, function () {
933
933
  var now = scheduler.now();
934
934
  while (q.length > 0 && now - q[0].interval >= duration) {
935
- observer.onNext(q.shift().value);
935
+ o.onNext(q.shift().value);
936
936
  }
937
- observer.onCompleted();
937
+ o.onCompleted();
938
938
  });
939
939
  }, source);
940
940
  };
@@ -952,7 +952,7 @@
952
952
  observableProto.takeLastWithTime = function (duration, scheduler) {
953
953
  var source = this;
954
954
  isScheduler(scheduler) || (scheduler = timeoutScheduler);
955
- return new AnonymousObservable(function (observer) {
955
+ return new AnonymousObservable(function (o) {
956
956
  var q = [];
957
957
  return source.subscribe(function (x) {
958
958
  var now = scheduler.now();
@@ -960,13 +960,13 @@
960
960
  while (q.length > 0 && now - q[0].interval >= duration) {
961
961
  q.shift();
962
962
  }
963
- }, observer.onError.bind(observer), function () {
963
+ }, function (e) { o.onError(e); }, function () {
964
964
  var now = scheduler.now();
965
965
  while (q.length > 0) {
966
966
  var next = q.shift();
967
- if (now - next.interval <= duration) { observer.onNext(next.value); }
967
+ if (now - next.interval <= duration) { o.onNext(next.value); }
968
968
  }
969
- observer.onCompleted();
969
+ o.onCompleted();
970
970
  });
971
971
  }, source);
972
972
  };
@@ -984,7 +984,7 @@
984
984
  observableProto.takeLastBufferWithTime = function (duration, scheduler) {
985
985
  var source = this;
986
986
  isScheduler(scheduler) || (scheduler = timeoutScheduler);
987
- return new AnonymousObservable(function (observer) {
987
+ return new AnonymousObservable(function (o) {
988
988
  var q = [];
989
989
  return source.subscribe(function (x) {
990
990
  var now = scheduler.now();
@@ -992,14 +992,14 @@
992
992
  while (q.length > 0 && now - q[0].interval >= duration) {
993
993
  q.shift();
994
994
  }
995
- }, observer.onError.bind(observer), function () {
995
+ }, function (e) { o.onError(e); }, function () {
996
996
  var now = scheduler.now(), res = [];
997
997
  while (q.length > 0) {
998
998
  var next = q.shift();
999
- if (now - next.interval <= duration) { res.push(next.value); }
999
+ now - next.interval <= duration && res.push(next.value);
1000
1000
  }
1001
- observer.onNext(res);
1002
- observer.onCompleted();
1001
+ o.onNext(res);
1002
+ o.onCompleted();
1003
1003
  });
1004
1004
  }, source);
1005
1005
  };
@@ -1020,8 +1020,8 @@
1020
1020
  observableProto.takeWithTime = function (duration, scheduler) {
1021
1021
  var source = this;
1022
1022
  isScheduler(scheduler) || (scheduler = timeoutScheduler);
1023
- return new AnonymousObservable(function (observer) {
1024
- return new CompositeDisposable(scheduler.scheduleWithRelative(duration, observer.onCompleted.bind(observer)), source.subscribe(observer));
1023
+ return new AnonymousObservable(function (o) {
1024
+ return new CompositeDisposable(scheduler.scheduleWithRelative(duration, function () { o.onCompleted(); }), source.subscribe(o));
1025
1025
  }, source);
1026
1026
  };
1027
1027
 
@@ -1068,15 +1068,14 @@
1068
1068
  var source = this, schedulerMethod = startTime instanceof Date ?
1069
1069
  'scheduleWithAbsolute' :
1070
1070
  'scheduleWithRelative';
1071
- return new AnonymousObservable(function (observer) {
1071
+ return new AnonymousObservable(function (o) {
1072
1072
  var open = false;
1073
1073
 
1074
1074
  return new CompositeDisposable(
1075
1075
  scheduler[schedulerMethod](startTime, function () { open = true; }),
1076
1076
  source.subscribe(
1077
- function (x) { open && observer.onNext(x); },
1078
- observer.onError.bind(observer),
1079
- observer.onCompleted.bind(observer)));
1077
+ function (x) { open && o.onNext(x); },
1078
+ function (e) { o.onError(e); }, function () { o.onCompleted(); }));
1080
1079
  }, source);
1081
1080
  };
1082
1081
 
@@ -1091,10 +1090,10 @@
1091
1090
  var source = this, schedulerMethod = endTime instanceof Date ?
1092
1091
  'scheduleWithAbsolute' :
1093
1092
  'scheduleWithRelative';
1094
- return new AnonymousObservable(function (observer) {
1093
+ return new AnonymousObservable(function (o) {
1095
1094
  return new CompositeDisposable(
1096
- scheduler[schedulerMethod](endTime, observer.onCompleted.bind(observer)),
1097
- source.subscribe(observer));
1095
+ scheduler[schedulerMethod](endTime, function () { o.onCompleted(); }),
1096
+ source.subscribe(o));
1098
1097
  }, source);
1099
1098
  };
1100
1099
 
@@ -1109,18 +1108,16 @@
1109
1108
  var duration = +windowDuration || 0;
1110
1109
  if (duration <= 0) { throw new RangeError('windowDuration cannot be less or equal zero.'); }
1111
1110
  var source = this;
1112
- return new AnonymousObservable(function (observer) {
1111
+ return new AnonymousObservable(function (o) {
1113
1112
  var lastOnNext = 0;
1114
1113
  return source.subscribe(
1115
1114
  function (x) {
1116
1115
  var now = scheduler.now();
1117
1116
  if (lastOnNext === 0 || now - lastOnNext >= duration) {
1118
1117
  lastOnNext = now;
1119
- observer.onNext(x);
1118
+ o.onNext(x);
1120
1119
  }
1121
- },
1122
- observer.onError.bind(observer),
1123
- observer.onCompleted.bind(observer)
1120
+ },function (e) { o.onError(e); }, function () { o.onCompleted(); }
1124
1121
  );
1125
1122
  }, source);
1126
1123
  };
@@ -1,3 +1,3 @@
1
1
  /* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
2
- (function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a,b){return new n(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function f(a,b,c){return new n(function(d){var e=0,f=a,g=z(b);return c.scheduleRecursiveWithAbsolute(f,function(a){if(g>0){var b=c.now();f+=g,b>=f&&(f=b+g)}d.onNext(e++),a(f)})})}function g(a,b){return new n(function(c){return b.scheduleWithRelative(z(a),function(){c.onNext(0),c.onCompleted()})})}function h(a,b,c){return a===b?new n(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):o(function(){return f(c.now()+a,b,c)})}function i(a,b,c){return new n(function(d){var e,f=!1,g=new u,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 t,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 v(e,g)},a)}function j(a,b,c){return o(function(){return i(a,b-c.now(),c)})}function k(a,b){return new n(function(c){function d(){g&&(g=!1,c.onNext(f)),e&&c.onCompleted()}var e,f,g;return new v(a.subscribe(function(a){g=!0,f=a},c.onError.bind(c),function(){e=!0}),b.subscribe(d,c.onError.bind(c),d))},a)}var l=c.Observable,m=l.prototype,n=c.AnonymousObservable,o=l.defer,p=l.empty,q=l.never,r=l.throwException,s=(l.fromArray,c.Scheduler.timeout),t=c.SingleAssignmentDisposable,u=c.SerialDisposable,v=c.CompositeDisposable,w=c.RefCountDisposable,x=c.Subject,y=c.internals.addRef,z=c.Scheduler.normalize,A=c.helpers,B=A.isPromise,C=A.isScheduler,D=l.fromPromise,E=A.deprecate,F=l.interval=function(a,b){return h(a,a,C(b)?b:s)},G=l.timer=function(a,b,c){var i;return C(c)||(c=s),b!==d&&"number"==typeof b?i=b:C(b)&&(c=b),a instanceof Date&&i===d?e(a.getTime(),c):a instanceof Date&&i!==d?(i=b,f(a.getTime(),i,c)):i===d?g(a,c):h(a,i,c)};return m.delay=function(a,b){return C(b)||(b=s),a instanceof Date?j(this,a.getTime(),b):i(this,a,b)},m.debounce=m.throttleWithTimeout=function(a,b){C(b)||(b=s);var c=this;return new n(function(d){var e,f=new u,g=!1,h=0,i=c.subscribe(function(c){g=!0,e=c,h++;var i=h,j=new t;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 v(i,f)},this)},m.throttle=function(a,b){return E("throttle","debounce or throttleWithTimeout"),this.debounce(a,b)},m.windowWithTime=function(a,b,c){var d,e=this;return null==b&&(d=a),C(c)||(c=s),"number"==typeof b?d=b:C(b)&&(d=a,c=b),new n(function(b){function f(){var a=new t,e=!1,g=!1;l.setDisposable(a),j===i?(e=!0,g=!0):i>j?e=!0:g=!0;var n=e?j:i,o=n-m;m=n,e&&(j+=d),g&&(i+=d),a.setDisposable(c.scheduleWithRelative(o,function(){if(g){var a=new x;k.push(a),b.onNext(y(a,h))}e&&k.shift().onCompleted(),f()}))}var g,h,i=d,j=a,k=[],l=new u,m=0;return g=new v(l),h=new w(g),k.push(new x),b.onNext(y(k[0],h)),f(),g.add(e.subscribe(function(a){for(var b=0,c=k.length;c>b;b++)k[b].onNext(a)},function(a){for(var c=0,d=k.length;d>c;c++)k[c].onError(a);b.onError(a)},function(){for(var a=0,c=k.length;c>a;a++)k[a].onCompleted();b.onCompleted()})),h},e)},m.windowWithTimeOrCount=function(a,b,c){var d=this;return C(c)||(c=s),new n(function(e){function f(b){var d=new t;g.setDisposable(d),d.setDisposable(c.scheduleWithRelative(a,function(){if(b===k){j=0;var a=++k;l.onCompleted(),l=new x,e.onNext(y(l,i)),f(a)}}))}var g=new u,h=new v(g),i=new w(h),j=0,k=0,l=new x;return e.onNext(y(l,i)),f(0),h.add(d.subscribe(function(a){var c=0,d=!1;l.onNext(a),++j===b&&(d=!0,j=0,c=++k,l.onCompleted(),l=new x,e.onNext(y(l,i))),d&&f(c)},function(a){l.onError(a),e.onError(a)},function(){l.onCompleted(),e.onCompleted()})),i},d)},m.bufferWithTime=function(){return this.windowWithTime.apply(this,arguments).selectMany(function(a){return a.toArray()})},m.bufferWithTimeOrCount=function(a,b,c){return this.windowWithTimeOrCount(a,b,c).selectMany(function(a){return a.toArray()})},m.timeInterval=function(a){var b=this;return C(a)||(a=s),o(function(){var c=a.now();return b.map(function(b){var d=a.now(),e=d-c;return c=d,{value:b,interval:e}})})},m.timestamp=function(a){return C(a)||(a=s),this.map(function(b){return{value:b,timestamp:a.now()}})},m.sample=m.throttleLatest=function(a,b){return C(b)||(b=s),"number"==typeof a?k(this,F(a,b)):k(this,a)},m.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=r(new Error(b||"Timeout"))),C(c)||(c=s);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new n(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(B(b)&&(b=D(b)),j.setDisposable(b.subscribe(f)))}))}var h=0,i=new t,j=new u,k=!1,l=new u;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 v(j,l)},d)},l.generateWithAbsoluteTime=function(a,b,c,d,e,f){return C(f)||(f=s),new n(function(g){var h,i,j=!0,k=!1,l=a;return f.scheduleRecursiveWithAbsolute(f.now(),function(a){k&&g.onNext(h);try{j?j=!1:l=c(l),k=b(l),k&&(h=d(l),i=e(l))}catch(f){return void g.onError(f)}k?a(i):g.onCompleted()})})},l.generateWithRelativeTime=function(a,b,c,d,e,f){return C(f)||(f=s),new n(function(g){var h,i,j=!0,k=!1,l=a;return f.scheduleRecursiveWithRelative(0,function(a){k&&g.onNext(h);try{j?j=!1:l=c(l),k=b(l),k&&(h=d(l),i=e(l))}catch(f){return void g.onError(f)}k?a(i):g.onCompleted()})})},m.delaySubscription=function(a,b){return this.delayWithSelector(G(a,C(b)?b:s),p)},m.delayWithSelector=function(a,b){var c,d,e=this;return"function"==typeof a?d=a:(c=a,d=b),new n(function(a){var b=new v,f=!1,g=function(){f&&0===b.length&&a.onCompleted()},h=new u,i=function(){h.setDisposable(e.subscribe(function(c){var e;try{e=d(c)}catch(f){return void a.onError(f)}var h=new t;b.add(h),h.setDisposable(e.subscribe(function(){a.onNext(c),b.remove(h),g()},a.onError.bind(a),function(){a.onNext(c),b.remove(h),g()}))},a.onError.bind(a),function(){f=!0,h.dispose(),g()}))};return c?h.setDisposable(c.subscribe(i,a.onError.bind(a),i)):i(),new v(h,b)},this)},m.timeoutWithSelector=function(a,b,c){1===arguments.length&&(b=a,a=q()),c||(c=r(new Error("Timeout")));var d=this;return new n(function(e){function f(a){function b(){return k===d}var d=k,f=new t;i.setDisposable(f),f.setDisposable(a.subscribe(function(){b()&&h.setDisposable(c.subscribe(e)),f.dispose()},function(a){b()&&e.onError(a)},function(){b()&&h.setDisposable(c.subscribe(e))}))}function g(){var a=!l;return a&&k++,a}var h=new u,i=new u,j=new t;h.setDisposable(j);var k=0,l=!1;return f(a),j.setDisposable(d.subscribe(function(a){if(g()){e.onNext(a);var c;try{c=b(a)}catch(d){return void e.onError(d)}f(B(c)?D(c):c)}},function(a){g()&&e.onError(a)},function(){g()&&e.onCompleted()})),new v(h,i)},d)},m.debounceWithSelector=function(a){var b=this;return new n(function(c){var d,e=!1,f=new u,g=0,h=b.subscribe(function(b){var h;try{h=a(b)}catch(i){return void c.onError(i)}B(h)&&(h=D(h)),e=!0,d=b,g++;var j=g,k=new t;f.setDisposable(k),k.setDisposable(h.subscribe(function(){e&&g===j&&c.onNext(d),e=!1,k.dispose()},c.onError.bind(c),function(){e&&g===j&&c.onNext(d),e=!1,k.dispose()}))},function(a){f.dispose(),c.onError(a),e=!1,g++},function(){f.dispose(),e&&c.onNext(d),c.onCompleted(),e=!1,g++});return new v(h,f)},b)},m.throttleWithSelector=function(){return E("throttleWithSelector","debounceWithSelector"),this.debounceWithSelector.apply(this,arguments)},m.skipLastWithTime=function(a,b){C(b)||(b=s);var c=this;return new n(function(d){var e=[];return c.subscribe(function(c){var f=b.now();for(e.push({interval:f,value:c});e.length>0&&f-e[0].interval>=a;)d.onNext(e.shift().value)},d.onError.bind(d),function(){for(var c=b.now();e.length>0&&c-e[0].interval>=a;)d.onNext(e.shift().value);d.onCompleted()})},c)},m.takeLastWithTime=function(a,b){var c=this;return C(b)||(b=s),new n(function(d){var e=[];return c.subscribe(function(c){var d=b.now();for(e.push({interval:d,value:c});e.length>0&&d-e[0].interval>=a;)e.shift()},d.onError.bind(d),function(){for(var c=b.now();e.length>0;){var f=e.shift();c-f.interval<=a&&d.onNext(f.value)}d.onCompleted()})},c)},m.takeLastBufferWithTime=function(a,b){var c=this;return C(b)||(b=s),new n(function(d){var e=[];return c.subscribe(function(c){var d=b.now();for(e.push({interval:d,value:c});e.length>0&&d-e[0].interval>=a;)e.shift()},d.onError.bind(d),function(){for(var c=b.now(),f=[];e.length>0;){var g=e.shift();c-g.interval<=a&&f.push(g.value)}d.onNext(f),d.onCompleted()})},c)},m.takeWithTime=function(a,b){var c=this;return C(b)||(b=s),new n(function(d){return new v(b.scheduleWithRelative(a,d.onCompleted.bind(d)),c.subscribe(d))},c)},m.skipWithTime=function(a,b){var c=this;return C(b)||(b=s),new n(function(d){var e=!1;return new v(b.scheduleWithRelative(a,function(){e=!0}),c.subscribe(function(a){e&&d.onNext(a)},d.onError.bind(d),d.onCompleted.bind(d)))},c)},m.skipUntilWithTime=function(a,b){C(b)||(b=s);var c=this,d=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new n(function(e){var f=!1;return new v(b[d](a,function(){f=!0}),c.subscribe(function(a){f&&e.onNext(a)},e.onError.bind(e),e.onCompleted.bind(e)))},c)},m.takeUntilWithTime=function(a,b){C(b)||(b=s);var c=this,d=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new n(function(e){return new v(b[d](a,e.onCompleted.bind(e)),c.subscribe(e))},c)},m.throttleFirst=function(a,b){C(b)||(b=s);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new n(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},a.onError.bind(a),a.onCompleted.bind(a))},d)},c});
2
+ (function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a,b){return new n(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function f(a,b,c){return new n(function(d){var e=a,f=z(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 g(a,b){return new n(function(c){return b.scheduleWithRelative(z(a),function(){c.onNext(0),c.onCompleted()})})}function h(a,b,c){return a===b?new n(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):o(function(){return f(c.now()+a,b,c)})}function i(a,b,c){return new n(function(d){var e,f=!1,g=new u,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 t,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 v(e,g)},a)}function j(a,b,c){return o(function(){return i(a,b-c.now(),c)})}function k(a,b){return new n(function(c){function d(){g&&(g=!1,c.onNext(f)),e&&c.onCompleted()}var e,f,g;return new v(a.subscribe(function(a){g=!0,f=a},c.onError.bind(c),function(){e=!0}),b.subscribe(d,c.onError.bind(c),d))},a)}var l=c.Observable,m=l.prototype,n=c.AnonymousObservable,o=l.defer,p=l.empty,q=l.never,r=l.throwException,s=(l.fromArray,c.Scheduler.timeout),t=c.SingleAssignmentDisposable,u=c.SerialDisposable,v=c.CompositeDisposable,w=c.RefCountDisposable,x=c.Subject,y=c.internals.addRef,z=c.Scheduler.normalize,A=c.helpers,B=A.isPromise,C=A.isScheduler,D=l.fromPromise,E=(A.deprecate,l.interval=function(a,b){return h(a,a,C(b)?b:s)}),F=l.timer=function(a,b,c){var i;return C(c)||(c=s),b!==d&&"number"==typeof b?i=b:C(b)&&(c=b),a instanceof Date&&i===d?e(a.getTime(),c):a instanceof Date&&i!==d?(i=b,f(a.getTime(),i,c)):i===d?g(a,c):h(a,i,c)};return m.delay=function(a,b){return C(b)||(b=s),a instanceof Date?j(this,a.getTime(),b):i(this,a,b)},m.debounce=m.throttleWithTimeout=function(a,b){C(b)||(b=s);var c=this;return new n(function(d){var e,f=new u,g=!1,h=0,i=c.subscribe(function(c){g=!0,e=c,h++;var i=h,j=new t;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 v(i,f)},this)},m.throttle=function(a,b){return this.debounce(a,b)},m.windowWithTime=function(a,b,c){var d,e=this;return null==b&&(d=a),C(c)||(c=s),"number"==typeof b?d=b:C(b)&&(d=a,c=b),new n(function(b){function f(){var a=new t,e=!1,g=!1;l.setDisposable(a),j===i?(e=!0,g=!0):i>j?e=!0:g=!0;var n=e?j:i,o=n-m;m=n,e&&(j+=d),g&&(i+=d),a.setDisposable(c.scheduleWithRelative(o,function(){if(g){var a=new x;k.push(a),b.onNext(y(a,h))}e&&k.shift().onCompleted(),f()}))}var g,h,i=d,j=a,k=[],l=new u,m=0;return g=new v(l),h=new w(g),k.push(new x),b.onNext(y(k[0],h)),f(),g.add(e.subscribe(function(a){for(var b=0,c=k.length;c>b;b++)k[b].onNext(a)},function(a){for(var c=0,d=k.length;d>c;c++)k[c].onError(a);b.onError(a)},function(){for(var a=0,c=k.length;c>a;a++)k[a].onCompleted();b.onCompleted()})),h},e)},m.windowWithTimeOrCount=function(a,b,c){var d=this;return C(c)||(c=s),new n(function(e){function f(b){var d=new t;g.setDisposable(d),d.setDisposable(c.scheduleWithRelative(a,function(){if(b===k){j=0;var a=++k;l.onCompleted(),l=new x,e.onNext(y(l,i)),f(a)}}))}var g=new u,h=new v(g),i=new w(h),j=0,k=0,l=new x;return e.onNext(y(l,i)),f(0),h.add(d.subscribe(function(a){var c=0,d=!1;l.onNext(a),++j===b&&(d=!0,j=0,c=++k,l.onCompleted(),l=new x,e.onNext(y(l,i))),d&&f(c)},function(a){l.onError(a),e.onError(a)},function(){l.onCompleted(),e.onCompleted()})),i},d)},m.bufferWithTime=function(){return this.windowWithTime.apply(this,arguments).selectMany(function(a){return a.toArray()})},m.bufferWithTimeOrCount=function(a,b,c){return this.windowWithTimeOrCount(a,b,c).selectMany(function(a){return a.toArray()})},m.timeInterval=function(a){var b=this;return C(a)||(a=s),o(function(){var c=a.now();return b.map(function(b){var d=a.now(),e=d-c;return c=d,{value:b,interval:e}})})},m.timestamp=function(a){return C(a)||(a=s),this.map(function(b){return{value:b,timestamp:a.now()}})},m.sample=m.throttleLatest=function(a,b){return C(b)||(b=s),"number"==typeof a?k(this,E(a,b)):k(this,a)},m.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=r(new Error(b||"Timeout"))),C(c)||(c=s);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new n(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(B(b)&&(b=D(b)),j.setDisposable(b.subscribe(f)))}))}var h=0,i=new t,j=new u,k=!1,l=new u;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 v(j,l)},d)},l.generateWithAbsoluteTime=function(a,b,c,d,e,f){return C(f)||(f=s),new n(function(g){var h,i,j=!0,k=!1,l=a;return f.scheduleRecursiveWithAbsolute(f.now(),function(a){k&&g.onNext(h);try{j?j=!1:l=c(l),k=b(l),k&&(h=d(l),i=e(l))}catch(f){return void g.onError(f)}k?a(i):g.onCompleted()})})},l.generateWithRelativeTime=function(a,b,c,d,e,f){return C(f)||(f=s),new n(function(g){var h,i,j=!0,k=!1,l=a;return f.scheduleRecursiveWithRelative(0,function(a){k&&g.onNext(h);try{j?j=!1:l=c(l),k=b(l),k&&(h=d(l),i=e(l))}catch(f){return void g.onError(f)}k?a(i):g.onCompleted()})})},m.delaySubscription=function(a,b){return this.delayWithSelector(F(a,C(b)?b:s),p)},m.delayWithSelector=function(a,b){var c,d,e=this;return"function"==typeof a?d=a:(c=a,d=b),new n(function(a){var b=new v,f=!1,g=function(){f&&0===b.length&&a.onCompleted()},h=new u,i=function(){h.setDisposable(e.subscribe(function(c){var e;try{e=d(c)}catch(f){return void a.onError(f)}var h=new t;b.add(h),h.setDisposable(e.subscribe(function(){a.onNext(c),b.remove(h),g()},a.onError.bind(a),function(){a.onNext(c),b.remove(h),g()}))},a.onError.bind(a),function(){f=!0,h.dispose(),g()}))};return c?h.setDisposable(c.subscribe(i,a.onError.bind(a),i)):i(),new v(h,b)},this)},m.timeoutWithSelector=function(a,b,c){1===arguments.length&&(b=a,a=q()),c||(c=r(new Error("Timeout")));var d=this;return new n(function(e){function f(a){function b(){return k===d}var d=k,f=new t;i.setDisposable(f),f.setDisposable(a.subscribe(function(){b()&&h.setDisposable(c.subscribe(e)),f.dispose()},function(a){b()&&e.onError(a)},function(){b()&&h.setDisposable(c.subscribe(e))}))}function g(){var a=!l;return a&&k++,a}var h=new u,i=new u,j=new t;h.setDisposable(j);var k=0,l=!1;return f(a),j.setDisposable(d.subscribe(function(a){if(g()){e.onNext(a);var c;try{c=b(a)}catch(d){return void e.onError(d)}f(B(c)?D(c):c)}},function(a){g()&&e.onError(a)},function(){g()&&e.onCompleted()})),new v(h,i)},d)},m.debounceWithSelector=function(a){var b=this;return new n(function(c){var d,e=!1,f=new u,g=0,h=b.subscribe(function(b){var h;try{h=a(b)}catch(i){return void c.onError(i)}B(h)&&(h=D(h)),e=!0,d=b,g++;var j=g,k=new t;f.setDisposable(k),k.setDisposable(h.subscribe(function(){e&&g===j&&c.onNext(d),e=!1,k.dispose()},c.onError.bind(c),function(){e&&g===j&&c.onNext(d),e=!1,k.dispose()}))},function(a){f.dispose(),c.onError(a),e=!1,g++},function(){f.dispose(),e&&c.onNext(d),c.onCompleted(),e=!1,g++});return new v(h,f)},b)},m.throttleWithSelector=function(){return this.debounceWithSelector.apply(this,arguments)},m.skipLastWithTime=function(a,b){C(b)||(b=s);var c=this;return new n(function(d){var e=[];return c.subscribe(function(c){var f=b.now();for(e.push({interval:f,value:c});e.length>0&&f-e[0].interval>=a;)d.onNext(e.shift().value)},function(a){d.onError(a)},function(){for(var c=b.now();e.length>0&&c-e[0].interval>=a;)d.onNext(e.shift().value);d.onCompleted()})},c)},m.takeLastWithTime=function(a,b){var c=this;return C(b)||(b=s),new n(function(d){var e=[];return c.subscribe(function(c){var d=b.now();for(e.push({interval:d,value:c});e.length>0&&d-e[0].interval>=a;)e.shift()},function(a){d.onError(a)},function(){for(var c=b.now();e.length>0;){var f=e.shift();c-f.interval<=a&&d.onNext(f.value)}d.onCompleted()})},c)},m.takeLastBufferWithTime=function(a,b){var c=this;return C(b)||(b=s),new n(function(d){var e=[];return c.subscribe(function(c){var d=b.now();for(e.push({interval:d,value:c});e.length>0&&d-e[0].interval>=a;)e.shift()},function(a){d.onError(a)},function(){for(var c=b.now(),f=[];e.length>0;){var g=e.shift();c-g.interval<=a&&f.push(g.value)}d.onNext(f),d.onCompleted()})},c)},m.takeWithTime=function(a,b){var c=this;return C(b)||(b=s),new n(function(d){return new v(b.scheduleWithRelative(a,function(){d.onCompleted()}),c.subscribe(d))},c)},m.skipWithTime=function(a,b){var c=this;return C(b)||(b=s),new n(function(d){var e=!1;return new v(b.scheduleWithRelative(a,function(){e=!0}),c.subscribe(function(a){e&&d.onNext(a)},d.onError.bind(d),d.onCompleted.bind(d)))},c)},m.skipUntilWithTime=function(a,b){C(b)||(b=s);var c=this,d=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new n(function(e){var f=!1;return new v(b[d](a,function(){f=!0}),c.subscribe(function(a){f&&e.onNext(a)},function(a){e.onError(a)},function(){e.onCompleted()}))},c)},m.takeUntilWithTime=function(a,b){C(b)||(b=s);var c=this,d=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new n(function(e){return new v(b[d](a,function(){e.onCompleted()}),c.subscribe(e))},c)},m.throttleFirst=function(a,b){C(b)||(b=s);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new n(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)},c});
3
3
  //# sourceMappingURL=rx.time.map
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rxjs-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.22
4
+ version: 2.3.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - jdeseno
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-11 00:00:00.000000000 Z
11
+ date: 2015-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  version: 1.3.6
109
109
  requirements: []
110
110
  rubyforge_project: rxjs-rails
111
- rubygems_version: 2.2.2
111
+ rubygems_version: 2.4.5
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: Use RxJS with rails