text: /* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
  (function(a){var b={"function":!0,object:!0},c=b[typeof exports]&&exports&&!exports.nodeType&&exports,d=b[typeof self]&&self.Object&&self,e=b[typeof window]&&window&&window.Object&&window,f=b[typeof module]&&module&&!module.nodeType&&module,g=(f&&f.exports===c&&c,c&&f&&"object"==typeof global&&global&&global.Object&&global),h=h=g||e!==(this&&this.window)&&e||d||this;"function"==typeof define&&define.amd?define(["rx-lite-compat"],function(b,c){return a(h,c,b)}):"object"==typeof module&&module&&module.exports===c?module.exports=a(h,module.exports,require("rx-lite-compat")):h.Rx=a(h,{},h.Rx)}).call(this,function(a,b,c,d){function e(a,b){this.id=a,this.value=b}e.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var f=c.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},g=f.prototype;g.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},g.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)}}},g.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)}}},g.peek=function(){return this.items[0].value},g.removeAt=function(a){this.items[a]=this.items[--this.length],this.items[this.length]=d,this.heapify()},g.dequeue=function(){var a=this.peek();return this.removeAt(0),a},g.enqueue=function(a){var b=this.length++;this.items[b]=new e(f.count++,a),this.percolate(b)},g.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},f.count=0;var h=c.Scheduler,f=c.internals.PriorityQueue,i=c.internals.ScheduledItem,j=c.internals.SchedulePeriodicRecursive,k=c.Disposable.empty,l=c.internals.inherits,m=c.helpers.defaultSubComparer,n=c.helpers.notImplemented;return c.VirtualTimeScheduler=function(a){function b(){return this.toDateTimeOffset(this.clock)}function c(a,b){return this.scheduleAbsoluteWithState(a,this.clock,b)}function d(a,b,c){return this.scheduleRelativeWithState(a,this.toRelative(b),c)}function e(a,b,c){return this.scheduleRelativeWithState(a,this.toRelative(b-this.now()),c)}function g(a,b){return b(),k}function h(g,h){this.clock=g,this.comparer=h,this.isEnabled=!1,this.queue=new f(1024),a.call(this,b,c,d,e)}l(h,a);var m=h.prototype;return m.add=n,m.toDateTimeOffset=n,m.toRelative=n,m.schedulePeriodicWithState=function(a,b,c){var d=new j(this,a,b,c);return d.start()},m.scheduleRelativeWithState=function(a,b,c){var d=this.add(this.clock,b);return this.scheduleAbsoluteWithState(a,d,c)},m.scheduleRelative=function(a,b){return this.scheduleRelativeWithState(b,a,g)},m.start=function(){if(!this.isEnabled){this.isEnabled=!0;do{var a=this.getNext();null!==a?(this.comparer(a.dueTime,this.clock)>0&&(this.clock=a.dueTime),a.invoke()):this.isEnabled=!1}while(this.isEnabled)}},m.stop=function(){this.isEnabled=!1},m.advanceTo=function(a){var b=this.comparer(this.clock,a);if(this.comparer(this.clock,a)>0)throw new ArgumentOutOfRangeError;if(0!==b&&!this.isEnabled){this.isEnabled=!0;do{var c=this.getNext();null!==c&&this.comparer(c.dueTime,a)<=0?(this.comparer(c.dueTime,this.clock)>0&&(this.clock=c.dueTime),c.invoke()):this.isEnabled=!1}while(this.isEnabled);this.clock=a}},m.advanceBy=function(a){var b=this.add(this.clock,a),c=this.comparer(this.clock,b);if(c>0)throw new ArgumentOutOfRangeError;0!==c&&this.advanceTo(b)},m.sleep=function(a){var b=this.add(this.clock,a);if(this.comparer(this.clock,b)>=0)throw new ArgumentOutOfRangeError;this.clock=b},m.getNext=function(){for(;this.queue.length>0;){var a=this.queue.peek();if(!a.isCancelled())return a;this.queue.dequeue()}return null},m.scheduleAbsolute=function(a,b){return this.scheduleAbsoluteWithState(b,a,g)},m.scheduleAbsoluteWithState=function(a,b,c){function d(a,b){return e.queue.remove(f),c(a,b)}var e=this,f=new i(this,a,d,b,this.comparer);return this.queue.enqueue(f),f.disposable},h}(h),c.HistoricalScheduler=function(a){function b(b,c){var d=null==b?0:b,e=c||m;a.call(this,d,e)}l(b,a);var c=b.prototype;return c.add=function(a,b){return a+b},c.toDateTimeOffset=function(a){return new Date(a).getTime()},c.toRelative=function(a){return a},b}(c.VirtualTimeScheduler),c});
  //# sourceMappingURL=rx.lite.virtualtime.compat.map