rxjs-rails 2.4.1 → 2.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rxjs/rails/version.rb +1 -1
  3. data/vendor/assets/javascripts/rx.aggregates.js +15 -19
  4. data/vendor/assets/javascripts/rx.aggregates.map +1 -1
  5. data/vendor/assets/javascripts/rx.aggregates.min.js +1 -1
  6. data/vendor/assets/javascripts/rx.all.compat.js +1014 -566
  7. data/vendor/assets/javascripts/rx.all.compat.map +1 -1
  8. data/vendor/assets/javascripts/rx.all.compat.min.js +4 -4
  9. data/vendor/assets/javascripts/rx.all.js +1009 -563
  10. data/vendor/assets/javascripts/rx.all.map +1 -1
  11. data/vendor/assets/javascripts/rx.all.min.js +4 -4
  12. data/vendor/assets/javascripts/rx.async.compat.js +17 -15
  13. data/vendor/assets/javascripts/rx.async.compat.map +1 -1
  14. data/vendor/assets/javascripts/rx.async.compat.min.js +1 -1
  15. data/vendor/assets/javascripts/rx.async.js +17 -15
  16. data/vendor/assets/javascripts/rx.async.map +1 -1
  17. data/vendor/assets/javascripts/rx.async.min.js +1 -1
  18. data/vendor/assets/javascripts/rx.backpressure.js +53 -43
  19. data/vendor/assets/javascripts/rx.backpressure.map +1 -1
  20. data/vendor/assets/javascripts/rx.backpressure.min.js +1 -1
  21. data/vendor/assets/javascripts/rx.binding.js +31 -12
  22. data/vendor/assets/javascripts/rx.binding.map +1 -1
  23. data/vendor/assets/javascripts/rx.binding.min.js +1 -1
  24. data/vendor/assets/javascripts/rx.coincidence.js +3 -2
  25. data/vendor/assets/javascripts/rx.coincidence.map +1 -1
  26. data/vendor/assets/javascripts/rx.coincidence.min.js +1 -1
  27. data/vendor/assets/javascripts/rx.compat.js +821 -444
  28. data/vendor/assets/javascripts/rx.compat.map +1 -1
  29. data/vendor/assets/javascripts/rx.compat.min.js +2 -2
  30. data/vendor/assets/javascripts/rx.experimental.js +2 -9
  31. data/vendor/assets/javascripts/rx.experimental.map +1 -1
  32. data/vendor/assets/javascripts/rx.experimental.min.js +1 -1
  33. data/vendor/assets/javascripts/rx.joinpatterns.js +14 -22
  34. data/vendor/assets/javascripts/rx.joinpatterns.map +1 -1
  35. data/vendor/assets/javascripts/rx.joinpatterns.min.js +1 -1
  36. data/vendor/assets/javascripts/rx.js +817 -442
  37. data/vendor/assets/javascripts/rx.lite.compat.js +897 -443
  38. data/vendor/assets/javascripts/rx.lite.compat.map +1 -1
  39. data/vendor/assets/javascripts/rx.lite.compat.min.js +3 -2
  40. data/vendor/assets/javascripts/rx.lite.extras.compat.js +621 -0
  41. data/vendor/assets/javascripts/rx.lite.extras.compat.map +1 -0
  42. data/vendor/assets/javascripts/rx.lite.extras.compat.min.js +3 -0
  43. data/vendor/assets/javascripts/rx.lite.extras.js +53 -76
  44. data/vendor/assets/javascripts/rx.lite.extras.map +1 -1
  45. data/vendor/assets/javascripts/rx.lite.extras.min.js +1 -1
  46. data/vendor/assets/javascripts/rx.lite.js +898 -444
  47. data/vendor/assets/javascripts/rx.lite.map +1 -1
  48. data/vendor/assets/javascripts/rx.lite.min.js +3 -2
  49. data/vendor/assets/javascripts/rx.map +1 -1
  50. data/vendor/assets/javascripts/rx.min.js +2 -2
  51. data/vendor/assets/javascripts/rx.testing.js +10 -11
  52. data/vendor/assets/javascripts/rx.testing.map +1 -1
  53. data/vendor/assets/javascripts/rx.testing.min.js +1 -1
  54. data/vendor/assets/javascripts/rx.time.js +80 -40
  55. data/vendor/assets/javascripts/rx.time.map +1 -1
  56. data/vendor/assets/javascripts/rx.time.min.js +1 -1
  57. data/vendor/assets/javascripts/rx.virtualtime.js +6 -13
  58. data/vendor/assets/javascripts/rx.virtualtime.map +1 -1
  59. data/vendor/assets/javascripts/rx.virtualtime.min.js +1 -1
  60. metadata +6 -3
@@ -1 +1 @@
1
- {"version":3,"file":"rx.all.compat.min.js","sources":["rx.all.compat.js"],"names":["undefined","checkDisposed","self","isDisposed","Error","objectDisposed","cloneArray","arr","a","i","len","length","push","makeStackTraceLong","error","observable","hasStacks","stack","indexOf","STACK_JUMP_SEPARATOR","stacks","o","source","unshift","concatedStacks","join","filterStackString","stackString","lines","split","desiredLines","line","isInternalFrame","isNodeFrame","stackLine","fileNameAndLineNumber","getFileNameAndLineNumber","fileName","lineNumber","rFileName","rStartingLine","rEndingLine","captureLine","e","firstLine","attempt1","exec","Number","attempt2","attempt3","keysIn","object","result","isObject","support","nonEnumArgs","isArguments","slice","call","skipProto","enumPrototypes","skipErrorProps","enumErrorProps","errorProto","key","nonEnumShadows","objectProto","ctor","constructor","index","dontEnumsLength","prototype","className","stringProto","stringClass","errorClass","toString","nonEnum","nonEnumProps","dontEnums","hasOwnProperty","internalFor","callback","keysFunc","props","internalForIn","isNode","value","deepEquals","b","stackA","stackB","type","otherType","otherClass","argsClass","objectClass","boolClass","dateClass","numberClass","regexpClass","String","isArr","arrayClass","nodeClass","ctorA","argsObject","Object","ctorB","isFunction","size","pop","arrayInitialize","count","factory","Array","thrower","IndexedItem","id","this","ScheduledDisposable","scheduler","disposable","scheduleItem","s","dispose","ToArrayObserver","observer","isStopped","StringIterable","_s","StringIterator","_l","_i","ArrayIterable","_a","ArrayIterator","toLength","numberIsFinite","root","isFinite","getIterable","it","$iterator$","TypeError","sign","number","isNaN","Math","floor","abs","maxSafeInteger","FromArraySink","parent","observableOf","array","FromArrayObservable","observableCatchHandler","handler","AnonymousObservable","d1","SingleAssignmentDisposable","subscription","SerialDisposable","setDisposable","subscribe","x","onNext","ex","onError","isPromise","observableFromPromise","d","onCompleted","zipArray","second","resultSelector","first","left","right","falseFactory","emptyArrayFactory","concatMap","selector","thisArg","selectorFunc","bindCallback","map","isArrayLike","isIterable","observableFrom","concatAll","arrayIndexOfComparer","item","comparer","HashSet","set","MapObserver","flatMap","mergeAll","FilterObserver","predicate","extremaBy","keySelector","hasValue","lastKey","list","comparison","ex1","firstOnly","sequenceContainsNoElements","elementAtOrDefault","hasDefault","defaultValue","argumentOutOfRange","singleOrDefaultAsync","seenValue","firstOrDefaultAsync","lastOrDefaultAsync","findValue","yieldIndex","shouldRun","toThunk","obj","ctx","isArray","objectToThunk","isGeneratorFunction","observableSpawn","isGenerator","isObservable","observableToThunk","promiseToThunk","fnString","done","run","fn","finished","results","pending","err","res","keys","timeoutScheduler","schedule","v","promise","then","name","next","throwString","handleError","fixEvent","event","stopPropagation","cancelBubble","preventDefault","bubbledKeyCode","keyCode","ctrlKey","defaultPrevented","returnValue","modified","target","srcElement","relatedTarget","fromElement","toElement","c","charCode","keyChar","fromCharCode","createListener","element","addEventListener","disposableCreate","removeEventListener","attachEvent","innerHandler","detachEvent","createEventListener","el","eventName","disposables","CompositeDisposable","add","combineLatestSource","subject","values","hasValueAll","every","identity","apply","isDone","observableWindowWithOpenings","windowOpenings","windowClosingSelector","groupJoin","observableEmpty","_","win","observableWindowWithBoundaries","windowBoundaries","Subject","r","RefCountDisposable","addRef","observableWindowWithClosingSelector","createWindowClose","windowClose","m1","m","take","noop","enumerableWhile","condition","Enumerable","Enumerator","Pattern","patterns","Plan","expression","planCreateObserver","externalSubscriptions","entry","get","JoinObserver","ActivePlan","joinObserverArray","joinObservers","Map","joinObserver","observableTimerDate","dueTime","scheduleWithAbsolute","observableTimerDateAndPeriod","period","p","normalizeTime","scheduleRecursiveWithAbsoluteAndState","now","observableTimerTimeSpan","scheduleWithRelative","observableTimerTimeSpanAndPeriod","schedulePeriodicWithState","observableDefer","observableDelayTimeSpan","active","cancelable","exception","q","running","materialize","timestamp","notification","kind","scheduleRecursiveWithRelative","recurseDueTime","shouldRecurse","shift","accept","max","observableDelayDate","sampleObservable","sampler","sampleSubscribe","atEnd","newValue","bind","objectTypes","boolean","function","string","window","freeExports","exports","nodeType","freeModule","module","moduleExports","freeGlobal","global","Rx","internals","config","Promise","helpers","isScheduler","notDefined","Scheduler","defaultNow","pluck","property","just","Date","defaultComparer","y","isEqual","defaultSubComparer","defaultError","defaultKeySerializer","not","asArray","arguments","isFn","longStackSupport","Symbol","iterator","Set","doneEnumerator","supportNodeClass","func","argCount","arg","collection","funcClass","supportsArgsClass","propertyIsEnumerable","document","toLocaleString","valueOf","test","inherits","child","__","addProperties","sources","idx","ln","prop","xs","getDisposable","Function","that","args","bound","F","concat","forEach","T","k","O","kValue","boxedString","splitString","fun","thisp","filter","t","searchElement","n","Infinity","hasDontEnumBug","compareTo","other","PriorityQueue","capacity","items","priorityProto","isHigherPriority","percolate","temp","heapify","peek","removeAt","dequeue","enqueue","remove","CompositeDisposablePrototype","shouldDispose","splice","currentDisposables","Disposable","action","create","disposableEmpty","empty","BooleanDisposable","current","booleanDisposablePrototype","old","InnerDisposable","isInnerDisposed","underlyingDisposable","isPrimaryDisposed","scheduleWithState","ScheduledItem","state","invoke","invokeCore","isCancelled","scheduleRelative","scheduleAbsolute","_schedule","_scheduleRelative","_scheduleAbsolute","invokeAction","schedulerProto","scheduleWithRelativeAndState","scheduleWithAbsoluteAndState","normalize","timeSpan","invokeRecImmediate","pair","group","recursiveAction","state1","state2","isAdded","scheduler1","state3","invokeRecDate","method","dueTime1","scheduleInnerRecursive","dt","scheduleRecursive","scheduleRecursiveWithState","_action","scheduleRecursiveWithRelativeAndState","scheduleRecursiveWithAbsolute","schedulePeriodic","setInterval","clearInterval","catchError","CatchScheduler","scheduleMethod","SchedulePeriodicRecursive","tick","command","recurse","_period","_state","_cancel","_scheduler","start","immediateScheduler","immediate","scheduleNow","notSupported","currentThreadScheduler","currentThread","runTrampoline","si","queue","currentScheduler","scheduleRequired","ensureTrampoline","clearMethod","localTimer","localSetTimeout","localClearTimeout","time","WScript","Sleep","setTimeout","clearTimeout","postMessageSupported","postMessage","importScripts","isAsync","oldHandler","onmessage","reNative","RegExp","replace","setImmediate","clearImmediate","process","nextTick","MSG_PREFIX","random","tasks","taskId","onGlobalPostMessage","data","substring","handleId","currentId","MessageChannel","channel","channelTasks","channelTaskId","port1","port2","createElement","scriptElement","onreadystatechange","parentNode","removeChild","documentElement","appendChild","timeout","__super__","_wrap","_handler","_recursiveOriginal","_recursiveWrapper","_clone","_getRecursiveWrapper","wrapper","failed","Notification","observerOrOnNext","_acceptObservable","_accept","toObservable","notificationCreateOnNext","createOnNext","notificationCreateOnError","createOnError","notificationCreateOnCompleted","createOnCompleted","_next","_iterator","currentItem","currentValue","lastException","catchErrorWhen","notificationHandler","exceptions","notifier","handled","notificationDisposable","outer","inner","exn","enumerableRepeat","repeat","repeatCount","enumerableOf","of","selectorFn","Observer","toNotifier","asObserver","AnonymousObserver","checked","CheckedObserver","observerCreate","fromNotifier","notifyOn","ObserveOnObserver","makeSafe","AnonymousSafeObserver","_onNext","_onError","_onCompleted","observableProto","AbstractObserver","notImplemented","completed","fail","_super","_observer","CheckedObserverPrototype","checkAccess","ScheduledObserver","isAcquired","hasFaulted","ensureActive","isOwner","work","cancel","Observable","_subscribe","oldOnError","subscribeOnNext","subscribeOnError","subscribeOnCompleted","ObservableBase","fixSubscriber","subscriber","ado","subscribeCore","AutoDetachObserver","observeOn","subscribeOn","fromPromise","AsyncSubject","toPromise","promiseCtor","resolve","reject","ToArrayObservable","toArray","createWithDisposable","defer","observableFactory","observableThrow","FromObservable","iterable","mapper","sink","FromSink","loopRecursive","pow","charAt","from","mapFn","observableFromArray","fromArray","generate","initialState","iterate","hasResult","ofWithScheduler","observableNever","never","pairs","RangeObservable","RangeSink","range","observableReturn","throwError","throwException","using","resourceFactory","resource","amb","rightSource","leftSource","choiceL","choice","leftChoice","rightSubscription","choiceR","rightChoice","leftSubscription","previous","acc","catchException","handlerOrSecond","observableCatch","combineLatest","j","subscriptions","sad","observableConcat","concatObservable","merge","maxConcurrentOrOther","observableMerge","activeCount","innerSource","mergeObservable","innerSubscription","onErrorResumeNext","pos","skipUntil","isOpen","switchLatest","hasLatest","latest","takeUntil","withLatestFrom","allValues","zip","queuedValues","queues","asObservable","bufferWithCount","skip","windowWithCount","selectMany","where","dematerialize","distinctUntilChanged","currentKey","hasCurrentKey","comparerEquals","tap","doAction","tapObserver","doOnNext","tapOnNext","doOnError","tapOnError","doOnCompleted","tapOnCompleted","ensure","finallyAction","ignoreElements","retry","retryCount","retryWhen","scan","seed","accumulator","hasSeed","hasAccumulation","accumulation","skipLast","startWith","takeLast","takeLastBuffer","createWindow","refCountDisposable","selectConcat","selectorResult","i2","concatMapObserver","selectConcatObserver","onNextFunc","onErrorFunc","onCompletedFunc","defaultIfEmpty","found","retValue","distinct","hashSet","groupBy","elementSelector","groupByUntil","durationSelector","Dictionary","groupDisposable","getValues","fireNewMapEntry","writer","tryGetValue","GroupedObservable","durationGroup","duration","md","expire","MapObservable","internalMap","select","currentProp","flatMapObserver","selectManyObserver","selectSwitch","flatMapLatest","switchMap","remaining","skipWhile","RangeError","takeWhile","FilterObservable","internalFilter","shouldYield","aggregate","reduce","some","any","isEmpty","all","includes","fromIndex","contains","sum","prev","curr","minBy","min","maxBy","average","cur","sequenceEqual","donel","doner","ql","qr","subscription1","equal","subscription2","elementAt","single","singleOrDefault","firstOrDefault","last","lastOrDefault","find","findIndex","toSet","toMap","spawn","isGenFun","exit","ret","gen","called","hasCallback","context","observableToAsync","toAsync","fromCallback","publishLast","refCount","fromNodeCallback","useNativeEvents","fromEvent","addListener","fromEventPattern","h","removeListener","on","off","publish","addHandler","removeHandler","startAsync","functionAsync","PausableObservable","conn","connection","pausable","pauser","connect","controller","pause","resume","PausableBufferedObservable","previousShouldFire","shouldFire","pausableBuffered","ControlledObservable","enableQueue","ControlledSubject","multicast","request","numberOfItems","requestedCount","requestedDisposable","hasFailed","hasCompleted","controlledDisposable","hasRequested","disposeCurrentRequest","_processRequest","controlled","StopAndWaitObservable","StopAndWaitObserver","__sub__","stopAndWaitObserverProto","stopAndWait","WindowedObservable","WindowedObserver","windowSize","received","windowedObserverPrototype","windowed","subjectOrSubjectSelector","connectable","ConnectableObservable","share","publishValue","initialValueOrSelector","initialValue","BehaviorSubject","shareValue","replay","bufferSize","ReplaySubject","shareReplay","InnerSubscription","observers","hasError","hasObservers","os","createRemovableDisposable","so","_trim","MAX_VALUE","interval","hasSubscription","sourceObservable","connectableSubscription","shouldConnect","isPrime","candidate","num1","sqrt","num2","getPrime","num","primes","stringHashFn","str","hash","character","charCodeAt","numberHashFn","c2","newEntry","hashCode","_initialize","freeCount","freeList","noSuchkey","duplicatekey","getHashCode","uniqueIdCounter","dictionaryProto","prime","buckets","entries","_insert","index3","index1","index2","_resize","numArray","entryArray","clear","_findEntry","containskey","leftDurationSelector","rightDurationSelector","leftDone","rightDone","leftId","rightId","leftMap","rightMap","buffer","windowOpeningsOrClosingSelector","pairwise","hasPrevious","partition","letBind","ifThen","thenSource","elseSourceOrScheduler","forIn","observableWhileDo","whileDo","doWhile","switchCase","defaultSourceOrScheduler","expand","forkJoin","allSources","hasResults","ix","lastLeft","lastRight","leftStopped","rightStopped","hasLeft","hasRight","manySelect","chain","ChainObservable","g","head","tail","_keys","_values","and","thenDo","activate","deactivate","activePlan","jlen","removeActivePlan","addActivePlan","match","hasValues","firstValues","isCompleted","activePlans","JoinObserverPrototype","when","plans","outObserver","observableinterval","observableTimer","timer","periodOrScheduler","getTime","delay","debounce","throttleWithTimeout","hasvalue","throttle","windowWithTime","timeShiftOrScheduler","timeShift","createTimer","isSpan","isShift","timerD","nextSpan","nextShift","newTotalTime","ts","totalTime","windowWithTimeOrCount","windowId","newId","newWindow","bufferWithTime","bufferWithTimeOrCount","timeInterval","span","sample","throttleLatest","intervalOrSampler","schedulerMethod","myId","original","switched","generateWithAbsoluteTime","timeSelector","generateWithRelativeTime","delaySubscription","delayWithSelector","subscriptionDelay","delayDurationSelector","subDelay","delays","timeoutWithSelector","firstTimeout","timeoutdurationSelector","setTimer","timerWins","observerWins","debounceWithSelector","currentid","throttleWithSelector","skipLastWithTime","takeLastWithTime","takeLastBufferWithTime","takeWithTime","skipWithTime","open","skipUntilWithTime","startTime","takeUntilWithTime","endTime","throttleFirst","windowDuration","lastOnNext","exclusive","hasCurrent","exclusiveMap","transduce","transducer","transformForObserver","init","step","obs","input","xform","VirtualTimeScheduler","localNow","toDateTimeOffset","clock","scheduleAbsoluteWithState","scheduleRelativeWithState","toRelative","initialClock","isEnabled","VirtualTimeSchedulerPrototype","runAt","getNext","stop","advanceTo","dueToClock","advanceBy","sleep","HistoricalScheduler","cmp","HistoricalSchedulerProto","absolute","relative","AutoDetachObserverPrototype","noError","underlyingObservable","mergedDisposable","AnonymousSubject","Pauser","define","amd"],"mappings":";CAEE,SAAUA,GAgEV,QAASC,GAAcC,GAAQ,GAAIA,EAAKC,WAAc,KAAM,IAAIC,OAAMC,IACtE,QAASC,GAAWC,GAAO,IAAI,GAAIC,MAAQC,EAAI,EAAGC,EAAMH,EAAII,OAAYD,EAAJD,EAASA,IAAOD,EAAEI,KAAKL,EAAIE,GAAO,OAAOD,GAe7G,QAASK,GAAmBC,EAAOC,GAG/B,GAAIC,IACAD,EAAWE,OACM,gBAAVH,IACG,OAAVA,GACAA,EAAMG,OACwC,KAA9CH,EAAMG,MAAMC,QAAQC,IACtB,CAEA,IAAK,GADDC,MACKC,EAAIN,EAAcM,EAAGA,EAAIA,EAAEC,OAC9BD,EAAEJ,OACJG,EAAOG,QAAQF,EAAEJ,MAGrBG,GAAOG,QAAQT,EAAMG,MAErB,IAAIO,GAAiBJ,EAAOK,KAAK,KAAON,GAAuB,KAC/DL,GAAMG,MAAQS,EAAkBF,IAItC,QAASE,GAAkBC,GAGzB,IAAK,GAFDC,GAAQD,EAAYE,MAAM,MAC1BC,KACKrB,EAAI,EAAGC,EAAMkB,EAAMjB,OAAYD,EAAJD,EAASA,IAAK,CAChD,GAAIsB,GAAOH,EAAMnB,EAEZuB,GAAgBD,IAAUE,EAAYF,KAASA,GAClDD,EAAalB,KAAKmB,GAGtB,MAAOD,GAAaL,KAAK,MAG3B,QAASO,GAAgBE,GACvB,GAAIC,GAAwBC,EAAyBF,EACrD,KAAKC,EACH,OAAO,CAET,IAAIE,GAAWF,EAAsB,GAAIG,EAAaH,EAAsB,EAE5E,OAAOE,KAAaE,IAClBD,GAAcE,IACAC,IAAdH,EAGJ,QAASL,GA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AAS,WAAczxB,KAAKgD,QAAO,IAE7C8+B,GACPt2B,IAEmB,kBAAVu2B,SAA6C,gBAAdA,QAAOC,KAAmBD,OAAOC,KACzE5gC,GAAKmP,GAAKA,GAEVwxB,OAAO,WACL,MAAOxxB,OAEAR,IAAeG,GAEpBE,IACDF,GAAWF,QAAUO,IAAIA,GAAKA,GAE/BR,GAAYQ,GAAKA,GAInBnP,GAAKmP,GAAKA,EAIZ,IAAIrV,IAAcC,MAElBgB,KAAK6D"}
1
+ {"version":3,"file":"rx.all.compat.min.js","sources":["rx.all.compat.js"],"names":["undefined","cloneArray","arr","len","length","a","Array","i","makeStackTraceLong","error","observable","hasStacks","stack","indexOf","STACK_JUMP_SEPARATOR","stacks","o","source","unshift","concatedStacks","join","filterStackString","stackString","lines","split","desiredLines","line","isInternalFrame","isNodeFrame","push","stackLine","fileNameAndLineNumber","getFileNameAndLineNumber","fileName","lineNumber","rFileName","rStartingLine","rEndingLine","captureLine","Error","e","firstLine","attempt1","exec","Number","attempt2","attempt3","keysIn","object","result","isObject","support","nonEnumArgs","isArguments","slice","call","skipProto","enumPrototypes","skipErrorProps","enumErrorProps","errorProto","key","nonEnumShadows","objectProto","ctor","constructor","index","dontEnumsLength","prototype","className","stringProto","stringClass","errorClass","toString","nonEnum","nonEnumProps","dontEnums","hasOwnProperty","internalFor","callback","keysFunc","props","internalForIn","isNode","value","deepEquals","b","stackA","stackB","type","otherType","otherClass","argsClass","objectClass","boolClass","dateClass","numberClass","regexpClass","String","isArr","arrayClass","nodeClass","ctorA","argsObject","Object","ctorB","isFunction","size","pop","arrayInitialize","count","factory","tryCatcher","tryCatchTarget","apply","this","arguments","errorObj","tryCatch","fn","TypeError","thrower","IndexedItem","id","ScheduledDisposable","scheduler","disposable","isDisposed","scheduleItem","s","self","dispose","ToArrayObserver","observer","isStopped","StringIterable","_s","StringIterator","_l","_i","ArrayIterable","_a","ArrayIterator","toLength","numberIsFinite","root","isFinite","getIterable","it","$iterator$","sign","number","isNaN","Math","floor","abs","maxSafeInteger","FromArraySink","parent","observableOf","array","isScheduler","currentThreadScheduler","FromArrayObservable","PairsSink","RepeatSink","observableCatchHandler","handler","AnonymousObservable","d1","SingleAssignmentDisposable","subscription","SerialDisposable","setDisposable","subscribe","x","onNext","ex","onError","isPromise","observableFromPromise","d","onCompleted","zipArray","second","resultSelector","first","left","right","falseFactory","emptyArrayFactory","concatMap","selector","thisArg","selectorFunc","bindCallback","map","isArrayLike","isIterable","observableFrom","concatAll","arrayIndexOfComparer","item","comparer","HashSet","set","MapObserver","flatMap","mergeAll","FilterObserver","predicate","extremaBy","keySelector","hasValue","lastKey","list","comparison","ex1","firstOnly","EmptyError","elementAtOrDefault","hasDefault","defaultValue","ArgumentOutOfRangeError","singleOrDefaultAsync","seenValue","firstOrDefaultAsync","lastOrDefaultAsync","findValue","yieldIndex","shouldRun","toThunk","obj","ctx","isArray","objectToThunk","isGeneratorFunction","observableSpawn","isGenerator","isObservable","observableToThunk","promiseToThunk","fnString","done","run","finished","results","pending","err","res","keys","timeoutScheduler","schedule","v","promise","then","name","next","throwString","handleError","fixEvent","event","stopPropagation","cancelBubble","preventDefault","bubbledKeyCode","keyCode","ctrlKey","defaultPrevented","returnValue","modified","target","srcElement","relatedTarget","fromElement","toElement","c","charCode","keyChar","fromCharCode","createListener","element","addEventListener","disposableCreate","removeEventListener","attachEvent","innerHandler","detachEvent","createEventListener","el","eventName","disposables","CompositeDisposable","add","combineLatestSource","subject","values","hasValueAll","every","identity","isDone","observableWindowWithOpenings","windowOpenings","windowClosingSelector","groupJoin","observableEmpty","_","win","observableWindowWithBoundaries","windowBoundaries","Subject","r","RefCountDisposable","addRef","observableWindowWithClosingSelector","createWindowClose","windowClose","m1","m","take","noop","enumerableWhile","condition","Enumerable","Enumerator","Pattern","patterns","Plan","expression","planCreateObserver","externalSubscriptions","entry","get","JoinObserver","ActivePlan","joinObserverArray","joinObservers","Map","joinObserver","observableTimerDate","dueTime","scheduleWithAbsolute","observableTimerDateAndPeriod","period","p","normalizeTime","scheduleRecursiveWithAbsoluteAndState","now","observableTimerTimeSpan","scheduleWithRelative","observableTimerTimeSpanAndPeriod","schedulePeriodicWithState","observableDefer","observableDelayTimeSpan","active","cancelable","exception","q","running","materialize","timestamp","notification","kind","scheduleRecursiveWithRelative","recurseDueTime","shouldRecurse","shift","accept","max","observableDelayDate","sampleObservable","sampler","sampleSubscribe","atEnd","newValue","bind","objectTypes","boolean","function","string","window","freeExports","exports","nodeType","freeModule","module","moduleExports","freeGlobal","global","Rx","internals","config","Promise","helpers","notDefined","defaultNow","pluck","property","just","Date","defaultComparer","y","isEqual","defaultSubComparer","defaultError","defaultKeySerializer","not","asArray","isFn","longStackSupport","message","ObjectDisposedError","NotSupportedError","NotImplementedError","notImplemented","notSupported","Symbol","iterator","Set","doneEnumerator","supportNodeClass","func","argCount","arg","collection","funcClass","supportsArgsClass","propertyIsEnumerable","document","toLocaleString","valueOf","test","inherits","child","__","addProperties","sources","idx","ln","prop","xs","getDisposable","Function","that","args","bound","F","concat","forEach","T","k","O","kValue","boxedString","splitString","fun","thisp","filter","t","searchElement","n","Infinity","hasDontEnumBug","compareTo","other","PriorityQueue","capacity","items","priorityProto","isHigherPriority","percolate","temp","heapify","peek","removeAt","dequeue","enqueue","remove","isDisposable","CompositeDisposablePrototype","shouldDispose","splice","currentDisposables","Disposable","action","create","disposableEmpty","empty","checkDisposed","current","old","InnerDisposable","isInnerDisposed","underlyingDisposable","isPrimaryDisposed","scheduleWithState","ScheduledItem","state","invoke","invokeCore","isCancelled","Scheduler","scheduleRelative","scheduleAbsolute","_schedule","_scheduleRelative","_scheduleAbsolute","invokeAction","schedulerProto","scheduleWithRelativeAndState","scheduleWithAbsoluteAndState","normalize","timeSpan","invokeRecImmediate","pair","recursiveAction","state1","state2","isAdded","scheduler1","state3","group","invokeRecDate","method","dueTime1","scheduleInnerRecursive","dt","scheduleRecursive","scheduleRecursiveWithState","_action","scheduleRecursiveWithRelativeAndState","scheduleRecursiveWithAbsolute","schedulePeriodic","setInterval","clearInterval","catchError","CatchScheduler","scheduleMethod","clearMethod","SchedulePeriodicRecursive","tick","command","recurse","_period","_state","_cancel","_scheduler","start","immediateScheduler","immediate","scheduleNow","currentThread","runTrampoline","queue","si","currentScheduler","scheduleRequired","localTimer","localSetTimeout","localClearTimeout","setTimeout","clearTimeout","WScript","time","Sleep","runTask","handle","currentlyRunning","task","tasksByHandle","postMessageSupported","postMessage","importScripts","isAsync","oldHandler","onmessage","onGlobalPostMessage","data","substring","MSG_PREFIX","nextHandle","reNative","RegExp","replace","setImmediate","process","nextTick","random","currentId","MessageChannel","channel","port1","port2","createElement","scriptElement","onreadystatechange","parentNode","removeChild","documentElement","appendChild","timeout","__super__","_wrap","_handler","_recursiveOriginal","_recursiveWrapper","_clone","_getRecursiveWrapper","wrapper","failed","Notification","acceptObservable","_accept","_acceptObservable","observerOrOnNext","toObservable","notificationCreateOnNext","createOnNext","notificationCreateOnError","createOnError","notificationCreateOnCompleted","createOnCompleted","_next","_iterator","currentItem","currentValue","lastException","catchErrorWhen","notificationHandler","exceptions","notifier","handled","notificationDisposable","outer","inner","exn","enumerableRepeat","repeat","repeatCount","enumerableOf","of","selectorFn","Observer","toNotifier","asObserver","AnonymousObserver","checked","CheckedObserver","observerCreate","fromNotifier","notifyOn","ObserveOnObserver","makeSafe","AnonymousSafeObserver","_onNext","_onError","_onCompleted","observableProto","AbstractObserver","completed","fail","_observer","CheckedObserverPrototype","checkAccess","ScheduledObserver","isAcquired","hasFaulted","ensureActive","isOwner","work","cancel","Observable","_subscribe","oldOnError","subscribeOnNext","subscribeOnError","subscribeOnCompleted","ObservableBase","fixSubscriber","subscriber","ado","sub","subscribeCore","AutoDetachObserver","observeOn","subscribeOn","fromPromise","AsyncSubject","toPromise","promiseCtor","resolve","reject","ToArrayObservable","toArray","createWithDisposable","defer","observableFactory","observableThrow","EmptyObservable","EmptySink","sink","FromObservable","iterable","mapper","FromSink","loopRecursive","pow","charAt","from","mapFn","observableFromArray","fromArray","generate","initialState","iterate","hasResult","ofWithScheduler","NeverObservable","observableNever","never","PairsObservable","pairs","RangeObservable","RangeSink","range","RepeatObservable","JustObservable","JustSink","ThrowObservable","ThrowSink","throwError","throwException","using","resourceFactory","resource","amb","rightSource","leftSource","choiceL","choice","leftChoice","rightSubscription","choiceR","rightChoice","leftSubscription","previous","acc","catchException","handlerOrSecond","observableCatch","combineLatest","j","subscriptions","sad","observableConcat","concatObservable","merge","MergeObservable","maxConcurrent","g","MergeObserver","activeCount","InnerObserver","handleSubscribe","innerSource","maxConcurrentOrOther","observableMerge","MergeAllObservable","MergeAllObserver","mergeObservable","CompositeError","errors","innerErrors","mergeDelayError","setCompletion","innerSubscription","onErrorResumeNext","pos","skipUntil","isOpen","switchLatest","hasLatest","latest","takeUntil","withLatestFrom","allValues","zip","queuedValues","queues","asObservable","bufferWithCount","skip","windowWithCount","selectMany","where","dematerialize","distinctUntilChanged","currentKey","hasCurrentKey","comparerEquals","tap","doAction","tapObserver","doOnNext","tapOnNext","doOnError","tapOnError","doOnCompleted","tapOnCompleted","ensure","finallyAction","ignoreElements","retry","retryCount","retryWhen","scan","seed","accumulator","hasSeed","hasAccumulation","accumulation","skipLast","startWith","takeLast","takeLastBuffer","createWindow","refCountDisposable","selectConcat","selectorResult","i2","concatMapObserver","selectConcatObserver","onNextFunc","onErrorFunc","onCompletedFunc","defaultIfEmpty","found","retValue","distinct","hashSet","groupBy","elementSelector","groupByUntil","durationSelector","Dictionary","groupDisposable","getValues","fireNewMapEntry","writer","tryGetValue","GroupedObservable","durationGroup","duration","md","expire","MapObservable","internalMap","select","currentProp","flatMapObserver","selectManyObserver","selectSwitch","flatMapLatest","switchMap","remaining","skipWhile","takeWhile","FilterObservable","internalFilter","shouldYield","aggregate","reduce","some","any","isEmpty","all","includes","fromIndex","contains","sum","prev","curr","minBy","min","maxBy","average","cur","sequenceEqual","donel","doner","ql","qr","subscription1","equal","subscription2","elementAt","single","singleOrDefault","firstOrDefault","last","lastOrDefault","find","findIndex","toSet","toMap","spawn","isGenFun","exit","ret","gen","called","hasCallback","context","observableToAsync","toAsync","fromCallback","publishLast","refCount","fromNodeCallback","useNativeEvents","fromEvent","addListener","fromEventPattern","h","removeListener","on","off","publish","addHandler","removeHandler","startAsync","functionAsync","PausableObservable","conn","connection","pausable","pauser","connect","controller","pause","resume","PausableBufferedObservable","previousShouldFire","shouldFire","pausableBuffered","ControlledObservable","enableQueue","ControlledSubject","multicast","request","numberOfItems","requestedCount","requestedDisposable","hasFailed","hasCompleted","hasRequested","disposeCurrentRequest","_processRequest","controlled","StopAndWaitObservable","StopAndWaitObserver","__sub__","stopAndWaitObserverProto","stopAndWait","WindowedObservable","WindowedObserver","windowSize","received","windowedObserverPrototype","windowed","pipe","dest","onDrain","write","emit","_isStdio","end","subjectOrSubjectSelector","connectable","ConnectableObservable","share","publishValue","initialValueOrSelector","initialValue","BehaviorSubject","shareValue","replay","bufferSize","ReplaySubject","shareReplay","InnerSubscription","observers","hasError","getValue","hasObservers","os","createRemovableDisposable","so","_trim","interval","hasSubscription","sourceObservable","connectableSubscription","shouldConnect","isPrime","candidate","num1","sqrt","num2","getPrime","num","primes","stringHashFn","str","hash","character","charCodeAt","numberHashFn","c2","newEntry","hashCode","_initialize","freeCount","freeList","noSuchkey","duplicatekey","getHashCode","uniqueIdCounter","dictionaryProto","prime","buckets","entries","_insert","index3","index1","index2","_resize","numArray","entryArray","clear","_findEntry","containskey","leftDurationSelector","rightDurationSelector","leftDone","rightDone","leftId","rightId","leftMap","rightMap","buffer","windowOpeningsOrClosingSelector","pairwise","hasPrevious","partition","letBind","ifThen","thenSource","elseSourceOrScheduler","forIn","observableWhileDo","whileDo","doWhile","switchCase","defaultSourceOrScheduler","expand","forkJoin","allSources","hasResults","ix","lastLeft","lastRight","leftStopped","rightStopped","hasLeft","hasRight","manySelect","chain","ChainObservable","head","tail","_keys","_values","and","thenDo","activate","deactivate","activePlan","jlen","removeActivePlan","addActivePlan","match","hasValues","firstValues","isCompleted","activePlans","JoinObserverPrototype","when","plans","outObserver","observableinterval","timer","periodOrScheduler","getTime","delay","debounce","throttleWithTimeout","hasvalue","throttle","windowWithTime","timeShiftOrScheduler","timeShift","createTimer","isSpan","isShift","timerD","nextSpan","nextShift","newTotalTime","ts","totalTime","windowWithTimeOrCount","windowId","newId","newWindow","bufferWithTime","bufferWithTimeOrCount","timeInterval","span","sample","throttleLatest","intervalOrSampler","schedulerMethod","myId","original","switched","generateWithAbsoluteTime","timeSelector","generateWithRelativeTime","delaySubscription","delayWithSelector","subscriptionDelay","delayDurationSelector","subDelay","delays","timeoutWithSelector","firstTimeout","timeoutdurationSelector","setTimer","timerWins","observerWins","debounceWithSelector","currentid","throttleWithSelector","skipLastWithTime","takeLastWithTime","takeLastBufferWithTime","takeWithTime","skipWithTime","open","skipUntilWithTime","startTime","takeUntilWithTime","endTime","throttleFirst","windowDuration","RangeError","lastOnNext","exclusive","hasCurrent","exclusiveMap","transduce","transducer","transformForObserver","@@transducer/init","@@transducer/step","obs","input","@@transducer/result","xform","VirtualTimeScheduler","localNow","toDateTimeOffset","clock","scheduleAbsoluteWithState","scheduleRelativeWithState","toRelative","initialClock","isEnabled","VirtualTimeSchedulerPrototype","runAt","getNext","stop","advanceTo","dueToClock","advanceBy","sleep","HistoricalScheduler","cmp","HistoricalSchedulerProto","absolute","relative","AutoDetachObserverPrototype","underlyingObservable","mergedDisposable","AnonymousSubject","Pauser","define","amd"],"mappings":";CAEE,SAAUA,GAyDR,QAASC,GAAWC,GAElB,IAAI,GADAC,GAAMD,EAAIE,OAAQC,EAAI,GAAIC,OAAMH,GAC5BI,EAAI,EAAOJ,EAAJI,EAASA,IAAOF,EAAEE,GAAKL,EAAIK,EAC1C,OAAOF,GAgBX,QAASG,GAAmBC,EAAOC,GAG/B,GAAIC,IACAD,EAAWE,OACM,gBAAVH,IACG,OAAVA,GACAA,EAAMG,OACwC,KAA9CH,EAAMG,MAAMC,QAAQC,IACtB,CAEA,IAAK,GADDC,MACK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AE7CsgC,GACPh4B,IAEmB,kBAAVi4B,SAA6C,gBAAdA,QAAOC,KAAmBD,OAAOC,KACzEviC,GAAKoP,GAAKA,GAEVkzB,OAAO,WACL,MAAOlzB,OAEAR,IAAeG,GAEpBE,IACDF,GAAWF,QAAUO,IAAIA,GAAKA,GAE/BR,GAAYQ,GAAKA,GAInBpP,GAAKoP,GAAKA,EAIZ,IAAIhW,IAAcC,MAElBiB,KAAK4D"}
@@ -1,6 +1,6 @@
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(a){if(a.isDisposed)throw new Error(Ob)}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(Pb&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(Tb)){for(var c=[],d=b;d;d=d.source)d.stack&&c.unshift(d.stack);c.unshift(a.stack);var f=c.join("\n"+Tb+"\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===Rb&&d>=Sb&&le>=d}function g(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function h(){if(Pb)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 Rb=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(!tc(a))return b;sc.nonEnumArgs&&a.length&&uc(a)&&(a=wc.call(a));var c=sc.enumPrototypes&&"function"==typeof a,d=sc.enumErrorProps&&(a===nc||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(sc.nonEnumShadows&&a!==oc){var f=a.constructor,g=-1,h=_b;if(a===(f&&f.prototype))var i=a===pc?jc:a===nc?ec:kc.call(a),j=rc[i];for(;++g<h;)e=$b[g],j&&j[e]||!lc.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=kc.call(a),h=kc.call(b);if(g==ac&&(g=hc),h==ac&&(h=hc),g!=h)return!1;switch(g){case cc:case dc:return+a==+b;case gc:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case ic:case jc:return a==String(b)}var i=g==bc;if(!i){if(g!=hc||!sc.nodeClass&&(m(a)||m(b)))return!1;var j=!sc.argsObject&&uc(a)?Object:a.constructor,k=!sc.argsObject&&uc(b)?Object:b.constructor;if(!(j==k||lc.call(a,"constructor")&&lc.call(b,"constructor")||Lb(j)&&j instanceof j&&Lb(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 lc.call(f,e)?(p++,q=lc.call(a,e)&&n(a[e],b,c,d)):void 0}),q&&l(a,function(a,b,c){return lc.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&&wb.isFinite(a)}function A(b){var c,d=b[Ub];if(!d&&"string"==typeof b)return c=new v(b),c[Ub]();if(!d&&b.length!==a)return c=new x(b),c[Ub]();if(!d)throw new TypeError("Object is not iterable");return b[Ub]()}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>vd?vd:b):b}function D(a,b){this.observer=a,this.parent=b}function E(a,b){return new xd(b,a)}function F(a,b){return new fe(function(c){var d=new Jc,e=new Kc;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)}Jb(d)&&(d=pd(d));var g=new Jc;e.setDisposable(g),g.setDisposable(d.subscribe(c))},function(a){c.onCompleted(a)})),e},a)}function G(a,b){var c=this;return new fe(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=Zb(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return Jb(e)&&(e=pd(e)),(Xb(e)||Wb(e))&&(e=wd(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=Zb(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return Jb(e)&&(e=pd(e)),(Xb(e)||Wb(e))&&(e=wd(e)),e}).mergeAll()}function O(a,b,c){this.observer=a,this.predicate=b,this.source=c,this.i=0,this.isStopped=!1}function P(a,b,c){return new fe(function(d){var e=!1,f=null,g=[];return a.subscribe(function(a){var h,i;try{i=b(a)}catch(j){return void d.onError(j)}if(h=0,e)try{h=c(i,f)}catch(k){return void d.onError(k)}else e=!0,f=i;h>0&&(f=i,g=[]),h>=0&&g.push(a)},function(a){d.onError(a)},function(){d.onNext(g),d.onCompleted()})},a)}function Q(a){if(0===a.length)throw new Error(Mb);return a[0]}function R(a,b,c,d){if(0>b)throw new Error(Nb);return new fe(function(e){var f=b;return a.subscribe(function(a){0===f--&&(e.onNext(a),e.onCompleted())},function(a){e.onError(a)},function(){c?(e.onNext(d),e.onCompleted()):e.onError(new Error(Nb))})},a)}function S(a,b,c){return new fe(function(d){var e=c,f=!1;return a.subscribe(function(a){f?d.onError(new Error("Sequence contains more than one element")):(e=a,f=!0)},function(a){d.onError(a)},function(){f||b?(d.onNext(e),d.onCompleted()):d.onError(new Error(Mb))})},a)}function T(a,b,c){return new fe(function(d){return a.subscribe(function(a){d.onNext(a),d.onCompleted()},function(a){d.onError(a)},function(){b?(d.onNext(c),d.onCompleted()):d.onError(new Error(Mb))})},a)}function U(a,b,c){return new fe(function(d){var e=c,f=!1;return a.subscribe(function(a){e=a,f=!0},function(a){d.onError(a)},function(){f||b?(d.onNext(e),d.onCompleted()):d.onError(new Error(Mb))})},a)}function V(b,c,d,e){var f=Zb(c,d,3);return new fe(function(c){var d=0;return b.subscribe(function(a){var g;try{g=f(a,d,b)}catch(h){return void c.onError(h)}g?(c.onNext(e?d:a),c.onCompleted()):d++},function(a){c.onError(a)},function(){c.onNext(e?-1:a),c.onCompleted()})},b)}function W(a,b){return Array.isArray(a)?X.call(b,a):_(a)?Nd(a.call(b)):ab(a)?Nd(a):$(a)?Y(a):Jb(a)?Z(a):typeof a===Ld?a:tc(a)||Array.isArray(a)?X.call(b,a):a}function X(a){var b=this;return function(c){function d(a,d){if(!e)try{if(a=W(a,b),typeof a!==Ld)return h[d]=a,--g||c(null,h);a.call(b,function(a,b){if(!e){if(a)return e=!0,c(a);h[d]=b,--g||c(null,h)}})}catch(f){e=!0,c(f)}}var e,f=Object.keys(a),g=f.length,h=new a.constructor;if(!g)return void Xc.schedule(function(){c(null,h)});for(var i=0,j=f.length;j>i;i++)d(a[f[i]],f[i])}}function Y(a){return function(b){var c,d=!1;a.subscribe(function(a){c=a,d=!0},b,function(){d&&b(null,c)})}}function Z(a){return function(b){a.then(function(a){b(null,a)},b)}}function $(a){return a&&typeof a.subscribe===Ld}function _(a){return a&&a.constructor&&"GeneratorFunction"===a.constructor.name}function ab(a){return a&&typeof a.next===Ld&&typeof a[Md]===Ld}function bb(a){a&&Xc.schedule(function(){throw a})}function cb(a){var b=function(){this.cancelBubble=!0},c=function(){if(this.bubbledKeyCode=this.keyCode,this.ctrlKey)try{this.keyCode=0}catch(a){}this.defaultPrevented=!0,this.returnValue=!1,this.modified=!0};if(a||(a=wb.event),!a.target)switch(a.target=a.target||a.srcElement,"mouseover"==a.type&&(a.relatedTarget=a.fromElement),"mouseout"==a.type&&(a.relatedTarget=a.toElement),a.stopPropagation||(a.stopPropagation=b,a.preventDefault=c),a.type){case"keypress":var d="charCode"in a?a.charCode:a.keyCode;10==d?(d=0,a.keyCode=13):13==d||27==d?d=0:3==d&&(d=99),a.charCode=d,a.keyChar=a.charCode?String.fromCharCode(a.charCode):""}return a}function db(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),Hc(function(){a.removeEventListener(b,c,!1)});if(a.attachEvent){var d=function(a){c(cb(a))};return a.attachEvent("on"+b,d),Hc(function(){a.detachEvent("on"+b,d)})}return a["on"+b]=c,Hc(function(){a["on"+b]=null})}function eb(a,b,c){var d=new Ec;if("[object NodeList]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(eb(a.item(e),b,c));else a&&d.add(db(a,b,c));return d}function fb(a,b,c){return new fe(function(d){function e(a,b){j[b]=a;var e;if(g[b]=!0,h||(h=g.every(Eb))){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 Ec(a.subscribe(function(a){e(a,0)},function(a){j[1]?d.onError(a):f=a},function(){i=!0,j[1]&&d.onCompleted()}),b.subscribe(function(a){e(a,1)},function(a){d.onError(a)},function(){i=!0,e(!0,1)}))},a)}function gb(a,b){return a.groupJoin(this,b,sd,function(a,b){return b})}function hb(a){var b=this;return new fe(function(c){var d=new ie,e=new Ec,f=new Lc(e);return c.onNext(zc(d,f)),e.add(b.subscribe(function(a){d.onNext(a)},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),Jb(a)&&(a=pd(a)),e.add(a.subscribe(function(){d.onCompleted(),d=new ie,c.onNext(zc(d,f))},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),f},b)}function ib(a){var b=this;return new fe(function(c){function d(){var b;try{b=a()}catch(f){return void c.onError(f)}Jb(b)&&(b=pd(b));var i=new Jc;e.setDisposable(i),i.setDisposable(b.take(1).subscribe(Cb,function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),h=new ie,c.onNext(zc(h,g)),d()}))}var e=new Kc,f=new Ec(e),g=new Lc(f),h=new ie;return c.onNext(zc(h,g)),f.add(b.subscribe(function(a){h.onNext(a)},function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),c.onCompleted()})),d(),g},b)}function jb(b,c){return new cd(function(){return new bd(function(){return b()?{done:!1,value:c}:{done:!0,value:a}})})}function kb(a){this.patterns=a}function lb(a,b){this.expression=a,this.selector=b}function mb(a,b,c){var d=a.get(b);if(!d){var e=new ce(b,c);return a.set(b,e),e}return d}function nb(a,b,c){this.joinObserverArray=a,this.onNext=b,this.onCompleted=c,this.joinObservers=new be;for(var d=0,e=this.joinObserverArray.length;e>d;d++){var f=this.joinObserverArray[d];this.joinObservers.set(f,f)}}function ob(a,b){return new fe(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function pb(a,b,c){return new fe(function(d){var e=a,f=Oc(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 qb(a,b){return new fe(function(c){return b.scheduleWithRelative(Oc(a),function(){c.onNext(0),c.onCompleted()})})}function rb(a,b,c){return a===b?new fe(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):rd(function(){return pb(c.now()+a,b,c)})}function sb(a,b,c){return new fe(function(d){var e,f=!1,g=new Kc,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 Jc,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 Ec(e,g)},a)}function tb(a,b,c){return rd(function(){return sb(a,b-c.now(),c)})}function ub(a,b){return new fe(function(c){function d(){g&&(g=!1,c.onNext(f)),e&&c.onCompleted()}var e,f,g;return new Ec(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 vb={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},wb=vb[typeof window]&&window||this,xb=vb[typeof exports]&&exports&&!exports.nodeType&&exports,yb=vb[typeof module]&&module&&!module.nodeType&&module,zb=yb&&yb.exports===xb&&xb,Ab=vb[typeof global]&&global;!Ab||Ab.global!==Ab&&Ab.window!==Ab||(wb=Ab);var Bb={internals:{},config:{Promise:wb.Promise},helpers:{}},Cb=Bb.helpers.noop=function(){},Db=(Bb.helpers.notDefined=function(a){return"undefined"==typeof a},Bb.helpers.isScheduler=function(a){return a instanceof Bb.Scheduler}),Eb=Bb.helpers.identity=function(a){return a},Fb=(Bb.helpers.pluck=function(a){return function(b){return b[a]}},Bb.helpers.just=function(a){return function(){return a}},Bb.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),Gb=Bb.helpers.defaultComparer=function(a,b){return vc(a,b)},Hb=Bb.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},Ib=(Bb.helpers.defaultKeySerializer=function(a){return a.toString()},Bb.helpers.defaultError=function(a){throw a}),Jb=Bb.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},Kb=(Bb.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},Bb.helpers.not=function(a){return!a}),Lb=Bb.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==kc.call(a)}),a}(),Mb="Sequence contains no elements.",Nb="Argument out of range",Ob="Object has been disposed";Bb.config.longStackSupport=!1;var Pb=!1;try{throw new Error}catch(Qb){Pb=!!Qb.stack}var Rb,Sb=h(),Tb="From previous event:",Ub="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";wb.Set&&"function"==typeof(new wb.Set)["@@iterator"]&&(Ub="@@iterator");var Vb=Bb.doneEnumerator={done:!0,value:a},Wb=Bb.helpers.isIterable=function(b){return b[Ub]!==a},Xb=Bb.helpers.isArrayLike=function(b){return b&&b.length!==a};Bb.helpers.iterator=Ub;var Yb,Zb=Bb.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)}},$b=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],_b=$b.length,ac="[object Arguments]",bc="[object Array]",cc="[object Boolean]",dc="[object Date]",ec="[object Error]",fc="[object Function]",gc="[object Number]",hc="[object Object]",ic="[object RegExp]",jc="[object String]",kc=Object.prototype.toString,lc=Object.prototype.hasOwnProperty,mc=kc.call(arguments)==ac,nc=Error.prototype,oc=Object.prototype,pc=String.prototype,qc=oc.propertyIsEnumerable;try{Yb=!(kc.call(document)==hc&&!({toString:0}+""))}catch(Qb){Yb=!0}var rc={};rc[bc]=rc[dc]=rc[gc]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},rc[cc]=rc[jc]={constructor:!0,toString:!0,valueOf:!0},rc[ec]=rc[fc]=rc[ic]={constructor:!0,toString:!0},rc[hc]={constructor:!0};var sc={};!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);sc.enumErrorProps=qc.call(nc,"message")||qc.call(nc,"name"),sc.enumPrototypes=qc.call(a,"prototype"),sc.nonEnumArgs=0!=c,sc.nonEnumShadows=!/valueOf/.test(b)}(1);var tc=Bb.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},uc=function(a){return a&&"object"==typeof a?kc.call(a)==ac:!1};mc||(uc=function(a){return a&&"object"==typeof a?lc.call(a,"callee"):!1});var vc=Bb.internals.isEqual=function(a,b){return n(a,b,[],[])},wc=({}.hasOwnProperty,Array.prototype.slice),xc=this.inherits=Bb.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},yc=Bb.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]}},zc=Bb.internals.addRef=function(a,b){return new fe(function(c){return new Ec(b.getDisposable(),a.subscribe(c))})};Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=wc.call(arguments,1),d=function(){function e(){}if(this instanceof d){e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(wc.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(wc.call(arguments)))};return d}),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c,d;if(null==this)throw new TypeError(" this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=0;f>d;){var g;d in e&&(g=e[d],a.call(c,g,d,e)),d++}});var Ac=Object("a"),Bc="a"!=Ac[0]||!(0 in Ac);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=Bc&&{}.toString.call(this)==jc?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=fc)throw new TypeError(a+" is not a function");for(var f=0;d>f;f++)if(f in c&&!a.call(e,c[f],f,b))return!1;return!0}),Array.prototype.map||(Array.prototype.map=function(a){var b=Object(this),c=Bc&&{}.toString.call(this)==jc?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=fc)throw new TypeError(a+" is not a function");for(var g=0;d>g;g++)g in c&&(e[g]=a.call(f,c[g],g,b));return e}),Array.prototype.filter||(Array.prototype.filter=function(a){for(var b,c=[],d=new Object(this),e=0,f=d.length>>>0;f>e;e++)b=d[e],e in d&&a.call(arguments[1],b,e,d)&&c.push(b);return c}),Array.isArray||(Array.isArray=function(a){return{}.toString.call(a)==bc}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!==d?d=0:0!==d&&1/0!=d&&d!==-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1}),Object.prototype.propertyIsEnumerable||(Object.prototype.propertyIsEnumerable=function(a){for(var b in this)if(b===a)return!0;return!1}),Object.keys||(Object.keys=function(){"use strict";var a=Object.prototype.hasOwnProperty,b=!{toString:null}.propertyIsEnumerable("toString");return function(c){if("object"!=typeof c&&("function"!=typeof c||null===c))throw new TypeError("Object.keys called on non-object");var d,e,f=[];for(d in c)a.call(c,d)&&f.push(d);if(b)for(e=0;_b>e;e++)a.call(c,$b[e])&&f.push($b[e]);return f}}()),q.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Cc=Bb.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Dc=Cc.prototype;Dc.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Dc.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)}}},Dc.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)}}},Dc.peek=function(){return this.items[0].value},Dc.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},Dc.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Dc.enqueue=function(a){var b=this.length++;this.items[b]=new q(Cc.count++,a),this.percolate(b)},Dc.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Cc.count=0;var Ec=Bb.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},Fc=Ec.prototype;Fc.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Fc.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},Fc.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 Gc=Bb.Disposable=function(a){this.isDisposed=!1,this.action=a||Cb};Gc.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Hc=Gc.create=function(a){return new Gc(a)},Ic=Gc.empty={dispose:Cb},Jc=Bb.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}(),Kc=Bb.SerialDisposable=Jc,Lc=Bb.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?Ic:new a(this)},b}();r.prototype.dispose=function(){this.scheduler.scheduleWithState(this,t)};var Mc=Bb.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||Hb,this.disposable=new Jc};Mc.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Mc.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Mc.prototype.isCancelled=function(){return this.disposable.isDisposed},Mc.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Nc=Bb.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(),Ic}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=Fb,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Oc=Nc.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Ec,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),Ic});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Ec,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),Ic});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")})}}(Nc.prototype),function(){Nc.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Nc.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof wb.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=wb.setInterval(function(){d=c(d)},b);return Hc(function(){wb.clearInterval(e)})}}(Nc.prototype),function(a){a.catchError=a["catch"]=function(a){return new Yc(this,a)}}(Nc.prototype);var Pc,Qc=Bb.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 Jc;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),Rc=Nc.immediate=function(){function a(a,b){return b(this,a)}function b(){throw new Error("Not supported")}return new Nc(Fb,a,b,b)}(),Sc=Nc.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 Mc(this,b,c,this.now());if(d)d.enqueue(e);else{d=new Cc(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 Nc(Fb,b,c,c);return e.scheduleRequired=function(){return!d},e.ensureTrampoline=function(a){d?a():this.schedule(a)},e}(),Tc=Cb,Uc=function(){var a,b=Cb;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!wb.setTimeout)throw new Error("No concurrency detected!");a=wb.setTimeout,b=wb.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),Vc=Uc.setTimeout,Wc=Uc.clearTimeout;!function(){function a(){if(!wb.postMessage||wb.importScripts)return!1;var a=!1,b=wb.onmessage;return wb.onmessage=function(){a=!0},wb.postMessage("","*"),wb.onmessage=b,a}var b=RegExp("^"+String(kc).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),c="function"==typeof(c=Ab&&zb&&Ab.setImmediate)&&!b.test(c)&&c,d="function"==typeof(d=Ab&&zb&&Ab.clearImmediate)&&!b.test(d)&&d;if("function"==typeof c)Pc=c,Tc=d;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Pc=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]}};wb.addEventListener?wb.addEventListener("message",h,!1):wb.attachEvent("onmessage",h,!1),Pc=function(a){var b=g++;f[b]=a,wb.postMessage(e+b,"*")}}else if(wb.MessageChannel){var i=new wb.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},Pc=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in wb&&"onreadystatechange"in wb.document.createElement("script")?Pc=function(a){var b=wb.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},wb.document.documentElement.appendChild(b)}:(Pc=function(a){return Vc(a,0)},Tc=Wc)}();var Xc=Nc.timeout=function(){function a(a,b){var c=this,d=new Jc,e=Pc(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Ec(d,Hc(function(){Tc(e)}))}function b(a,b,c){var d=this,e=Nc.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Jc,g=Vc(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Ec(f,Hc(function(){Wc(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Nc(Fb,a,b,c)}(),Yc=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 xc(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 Ic}}},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 Jc;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}(Nc),Zc=Bb.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 Db(a)||(a=Rc),new fe(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),$c=Zc.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 Zc("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),_c=Zc.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 Zc("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),ad=Zc.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new Zc("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),bd=Bb.internals.Enumerator=function(a){this._next=a};bd.prototype.next=function(){return this._next()},bd.prototype[Ub]=function(){return this};var cd=Bb.internals.Enumerable=function(a){this._iterator=a};cd.prototype[Ub]=function(){return this._iterator()},cd.prototype.concat=function(){var a=this;return new fe(function(b){var c,d=a[Ub](),e=new Kc,f=Rc.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;Jb(h)&&(h=pd(h));var i=new Jc;e.setDisposable(i),i.setDisposable(h.subscribe(function(a){b.onNext(a)},function(a){b.onError(a)},a))}});return new Ec(e,f,Hc(function(){c=!0}))})},cd.prototype.catchError=function(){var a=this;return new fe(function(b){var c,d=a[Ub](),e=new Kc,f=Rc.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;Jb(i)&&(i=pd(i));var j=new Jc;e.setDisposable(j),j.setDisposable(i.subscribe(function(a){b.onNext(a)},f,function(){b.onCompleted()}))}});return new Ec(e,f,Hc(function(){c=!0}))})},cd.prototype.catchErrorWhen=function(a){var b=this;return new fe(function(c){var d,e,f=new ie,g=new ie,h=a(f),i=h.subscribe(g),j=b[Ub](),k=new Kc,l=Rc.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;Jb(i)&&(i=pd(i));var l=new Jc,m=new Jc;k.setDisposable(new Ec(m,l)),l.setDisposable(i.subscribe(function(a){c.onNext(a)},function(b){m.setDisposable(g.subscribe(a,function(a){c.onError(a)
3
- },function(){c.onCompleted()})),f.onNext(b)},function(){c.onCompleted()}))}});return new Ec(i,k,l,Hc(function(){d=!0}))})};var dd=cd.repeat=function(a,b){return null==b&&(b=-1),new cd(function(){var c=b;return new bd(function(){return 0===c?Vb:(c>0&&c--,{done:!1,value:a})})})},ed=cd.of=function(a,b,c){if(b)var d=Zb(b,c,3);return new cd(function(){var c=-1;return new bd(function(){return++c<a.length?{done:!1,value:b?d(a[c],c,a):a[c]}:Vb})})},fd=Bb.Observer=function(){};fd.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},fd.prototype.asObserver=function(){return new jd(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},fd.prototype.checked=function(){return new kd(this)};var gd=fd.create=function(a,b,c){return a||(a=Cb),b||(b=Ib),c||(c=Cb),new jd(a,b,c)};fd.fromNotifier=function(a,b){return new jd(function(c){return a.call(b,$c(c))},function(c){return a.call(b,_c(c))},function(){return a.call(b,ad())})},fd.prototype.notifyOn=function(a){return new md(a,this)},fd.prototype.makeSafe=function(a){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,a)};var hd,id=Bb.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}function c(){throw new Error("Method not implemented")}return xc(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}(fd),jd=Bb.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return xc(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}(id),kd=function(a){function b(b){a.call(this),this._observer=b,this._state=0}xc(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}(fd),ld=Bb.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 Kc}return xc(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}(id),md=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return xc(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}(ld),nd=Bb.Observable=function(){function a(a){if(Bb.config.longStackSupport&&Pb){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 hd=a.prototype,hd.subscribe=hd.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:gd(a,b,c))},hd.subscribeOnNext=function(a,b){return this._subscribe(gd("undefined"!=typeof b?function(c){a.call(b,c)}:a))},hd.subscribeOnError=function(a,b){return this._subscribe(gd(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},hd.subscribeOnCompleted=function(a,b){return this._subscribe(gd(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},a}(),od=Bb.ObservableBase=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Hc(a):Ic}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 ge(a),d=[b,this];return Sc.scheduleRequired()?Sc.scheduleWithState(d,c):c(null,d),b}function e(){a.call(this,d)}return xc(e,a),e.prototype.subscribeCore=function(){throw new Error("Not implemeneted")},e}(nd);hd.observeOn=function(a){var b=this;return new fe(function(c){return b.subscribe(new md(a,c))},b)},hd.subscribeOn=function(a){var b=this;return new fe(function(c){var d=new Jc,e=new Kc;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new r(a,b.subscribe(c)))})),e},b)};var pd=nd.fromPromise=function(a){return rd(function(){var b=new Bb.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};hd.toPromise=function(a){if(a||(a=Bb.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 qd=function(a){function b(b){this.source=b,a.call(this)}return xc(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new u(a))},b}(od);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)},hd.toArray=function(){return new qd(this)},nd.create=nd.createWithDisposable=function(a,b){return new fe(a,b)};var rd=nd.defer=function(a){return new fe(function(b){var c;try{c=a()}catch(d){return Dd(d).subscribe(b)}return Jb(c)&&(c=pd(c)),c.subscribe(b)})},sd=nd.empty=function(a){return Db(a)||(a=Rc),new fe(function(b){return a.schedule(function(){b.onCompleted()})})},td=function(a){function b(b,c,d){this.iterable=b,this.mapper=c,this.scheduler=d,a.call(this)}return xc(b,a),b.prototype.subscribeCore=function(a){var b=new ud(a,this);return b.run()},b}(od),ud=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}(),vd=Math.pow(2,53)-1;v.prototype[Ub]=function(){return new w(this._s)},w.prototype[Ub]=function(){return this},w.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:Vb},x.prototype[Ub]=function(){return new y(this._a)},y.prototype[Ub]=function(){return this},y.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:Vb};var wd=nd.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!Lb(b))throw new Error("mapFn when provided must be a function");if(b)var e=Zb(b,c,2);return Db(d)||(d=Sc),new td(a,e,d)},xd=function(a){function b(b,c){this.args=b,this.scheduler=c||Sc,a.call(this)}return xc(b,a),b.prototype.subscribeCore=function(a){var b=new D(a,this);return b.run()},b}(od);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 yd=nd.fromArray=function(a,b){return new xd(a,b)};nd.generate=function(a,b,c,d,e){return Db(e)||(e=Sc),new fe(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()})})},nd.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new xd(b)},nd.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 xd(c,a)};var zd=nd.never=function(){return new fe(function(){return Ic})};nd.pairs=function(a,b){return b||(b=Bb.Scheduler.currentThread),new fe(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 Ad=function(a){function b(b,c,d){this.start=b,this.count=c,this.scheduler=d,a.call(this)}return xc(b,a),b.prototype.subscribeCore=function(a){var b=new Bd(a,this);return b.run()},b}(od),Bd=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}();nd.range=function(a,b,c){return Db(c)||(c=Sc),new Ad(a,b,c)},nd.repeat=function(a,b,c){return Db(c)||(c=Sc),Cd(a,c).repeat(null==b?-1:b)};var Cd=nd["return"]=nd.just=function(a,b){return Db(b)||(b=Rc),new fe(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};nd.returnValue=function(){return Cd.apply(null,arguments)};var Dd=nd["throw"]=nd.throwError=function(a,b){return Db(b)||(b=Rc),new fe(function(c){return b.schedule(function(){c.onError(a)})})};nd.throwException=function(){return nd.throwError.apply(null,arguments)},nd.using=function(a,b){return new fe(function(c){var d,e,f=Ic;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new Ec(Dd(g).subscribe(c),f)}return new Ec(e.subscribe(c),f)})},hd.amb=function(a){var b=this;return new fe(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new Jc,j=new Jc;return Jb(a)&&(a=pd(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 Ec(i,j)})},nd.amb=function(){function a(a,b){return a.amb(b)}var b=zd(),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},hd["catch"]=hd.catchError=hd.catchException=function(a){return"function"==typeof a?F(this,a):Ed([this,a])};var Ed=nd.catchError=nd["catch"]=nd.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 ed(a).catchError()};hd.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),Fd.apply(this,b)};var Fd=nd.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 fe(function(c){function e(a){if(h[a]=!0,i||(i=h.every(Eb))){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(Eb)&&c.onCompleted()}function f(a){j[a]=!0,j.every(Eb)&&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 Jc;Jb(d)&&(d=pd(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 Ec(l)},this)};hd.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),Gd.apply(null,a)};var Gd=nd.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 ed(a).concat()};hd.concatAll=hd.concatObservable=function(){return this.merge(1)},hd.merge=function(a){if("number"!=typeof a)return Hd(this,a);var b=this;return new fe(function(c){function d(a){var b=new Jc;f.add(b),Jb(a)&&(a=pd(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 Ec,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 Hd=nd.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(Db(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=Rc,b=0;d>b;b++)c.push(arguments[b]);else for(a=Rc,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),E(a,c).mergeAll()};hd.mergeAll=hd.mergeObservable=function(){var a=this;return new fe(function(b){var c=new Ec,d=!1,e=new Jc;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Jc;c.add(e),Jb(a)&&(a=pd(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)},hd.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return Id([this,a])};var Id=nd.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 fe(function(b){var c=0,d=new Kc,e=Rc.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],Jb(f)&&(f=pd(f)),g=new Jc,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new Ec(d,e)})};hd.skipUntil=function(a){var b=this;return new fe(function(c){var d=!1,e=new Ec(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));Jb(a)&&(a=pd(a));var f=new Jc;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)},hd["switch"]=hd.switchLatest=function(){var a=this;return new fe(function(b){var c=!1,d=new Kc,e=!1,f=0,g=a.subscribe(function(a){var g=new Jc,h=++f;c=!0,d.setDisposable(g),Jb(a)&&(a=pd(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 Ec(g,d)},a)},hd.takeUntil=function(a){var b=this;return new fe(function(c){return Jb(a)&&(a=pd(a)),new Ec(b.subscribe(c),a.subscribe(function(){c.onCompleted()},function(a){c.onError(a)},Cb))},b)},hd.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 fe(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 Jc;Jb(d)&&(d=pd(d)),e.setDisposable(d.subscribe(function(a){i[c]=a,g[c]=!0,h=g.every(Eb)},b.onError.bind(b),function(){})),j[c]=e}(k);var l=new Jc;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 Ec(j)},this)},hd.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 fe(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(Eb)&&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 Jc;Jb(e)&&(e=pd(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 Ec(j)},d)},nd.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)},nd.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 fe(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(Eb))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(Eb)?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 Jc,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 Ec(h)})},hd.asObservable=function(){var a=this;return new fe(function(b){return a.subscribe(b)},this)},hd.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})},hd.dematerialize=function(){var a=this;return new fe(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)},hd.distinctUntilChanged=function(a,b){var c=this;return b||(b=Gb),new fe(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)},hd["do"]=hd.tap=hd.doAction=function(a,b,c){var d=this,e="function"==typeof a||"undefined"==typeof a?gd(a||Cb,b||Cb,c||Cb):a;return new fe(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)},hd.doOnNext=hd.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},hd.doOnError=hd.tapOnError=function(a,b){return this.tap(Cb,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},hd.doOnCompleted=hd.tapOnCompleted=function(a,b){return this.tap(Cb,null,"undefined"!=typeof b?function(){a.call(b)}:a)},hd["finally"]=hd.ensure=function(a){var b=this;return new fe(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Hc(function(){try{d.dispose()}catch(b){throw b}finally{a()}})},this)},hd.finallyAction=function(a){return this.ensure(a)},hd.ignoreElements=function(){var a=this;return new fe(function(b){return a.subscribe(Cb,function(a){b.onError(a)},function(){b.onCompleted()})},a)},hd.materialize=function(){var a=this;return new fe(function(b){return a.subscribe(function(a){b.onNext($c(a))},function(a){b.onNext(_c(a)),b.onCompleted()},function(){b.onNext(ad()),b.onCompleted()})},a)},hd.repeat=function(a){return dd(this,a).concat()},hd.retry=function(a){return dd(this,a).catchError()},hd.retryWhen=function(a){return dd(this).catchErrorWhen(a)},hd.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 fe(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)},hd.skipLast=function(a){var b=this;return new fe(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)},hd.startWith=function(){var a,b=0;arguments.length&&Db(arguments[0])?(a=arguments[0],b=1):a=Rc;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return ed([yd(c,a),this]).concat()},hd.takeLast=function(a){var b=this;return new fe(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)},hd.takeLastBuffer=function(a){var b=this;return new fe(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)},hd.windowWithCount=function(a,b){var c=this;if(+a||(a=0),1/0===Math.abs(a)&&(a=0),0>=a)throw new Error(Nb);if(null==b&&(b=a),+b||(b=0),1/0===Math.abs(b)&&(b=0),0>=b)throw new Error(Nb);return new fe(function(d){function e(){var a=new ie;i.push(a),d.onNext(zc(a,g))}var f=new Jc,g=new Lc(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)},hd.selectConcat=hd.concatMap=function(a,b,c){return Lb(a)&&Lb(b)?this.concatMap(function(c,d){var e=a(c,d);return Jb(e)&&(e=pd(e)),(Xb(e)||Wb(e))&&(e=wd(e)),e.map(function(a,e){return b(c,a,d,e)})}):Lb(a)?J(this,a,c):J(this,function(){return a})},hd.concatMapObserver=hd.selectConcatObserver=function(a,b,c,d){var e=this,f=Zb(a,d,2),g=Zb(b,d,1),h=Zb(c,d,0);return new fe(function(a){var b=0;return e.subscribe(function(c){var d;try{d=f(c,b++)}catch(e){return void a.onError(e)}Jb(d)&&(d=pd(d)),a.onNext(d)},function(b){var c;try{c=g(b)}catch(d){return void a.onError(d)}Jb(c)&&(c=pd(c)),a.onNext(c),a.onCompleted()},function(){var b;try{b=h()}catch(c){return void a.onError(c)}Jb(b)&&(b=pd(b)),a.onNext(b),a.onCompleted()})},this).concatAll()},hd.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new fe(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},hd.distinct=function(a,b){var c=this;return b||(b=Gb),new fe(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)},hd.groupBy=function(a,b,c){return this.groupByUntil(a,b,zd,c)},hd.groupByUntil=function(a,b,c,d){var e=this;return b||(b=Eb),d||(d=Gb),new fe(function(f){function g(a){return function(b){b.onError(a)}}var h=new $d(0,d),i=new Ec,j=new Lc(i);return i.add(e.subscribe(function(d){var e;try{e=a(d)}catch(k){return h.getValues().forEach(g(k)),void f.onError(k)}var l=!1,m=h.tryGetValue(e);if(m||(m=new ie,h.set(e,m),l=!0),l){var n=new he(e,m,j),o=new he(e,m);try{duration=c(o)}catch(k){return h.getValues().forEach(g(k)),void f.onError(k)}f.onNext(n);var p=new Jc;i.add(p);var q=function(){h.remove(e)&&m.onCompleted(),i.remove(p)};p.setDisposable(duration.take(1).subscribe(Cb,function(a){h.getValues().forEach(g(a)),f.onError(a)},q))}var r;try{r=b(d)}catch(k){return h.getValues().forEach(g(k)),void f.onError(k)}m.onNext(r)},function(a){h.getValues().forEach(g(a)),f.onError(a)},function(){h.getValues().forEach(function(a){a.onCompleted()}),f.onCompleted()})),j},e)};var Jd=function(a){function b(b,c,d){this.source=b,this.selector=Zb(c,d,3),a.call(this)}return xc(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}(od);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)},hd.map=hd.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof Jd?this.internalMap(c,b):new Jd(this,c,b)},hd.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})},hd.selectMany=hd.flatMap=function(a,b,c){return Lb(a)&&Lb(b)?this.flatMap(function(c,d){var e=a(c,d);return Jb(e)&&(e=pd(e)),(Xb(e)||Wb(e))&&(e=wd(e)),e.map(function(a,e){return b(c,a,d,e)})},c):Lb(a)?N(this,a,c):N(this,function(){return a})},hd.flatMapObserver=hd.selectManyObserver=function(a,b,c,d){var e=this;return new fe(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)}Jb(c)&&(c=pd(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}Jb(c)&&(c=pd(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}Jb(a)&&(a=pd(a)),f.onNext(a),f.onCompleted()})},e).mergeAll()},hd.selectSwitch=hd.flatMapLatest=hd.switchMap=function(a,b){return this.select(a,b).switchLatest()},hd.skip=function(a){if(0>a)throw new Error(Nb);var b=this;return new fe(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)},hd.skipWhile=function(a,b){var c=this,d=Zb(a,b,3);return new fe(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)},hd.take=function(a,b){if(0>a)throw new RangeError(Nb);if(0===a)return sd(b);var c=this;return new fe(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)},hd.takeWhile=function(a,b){var c=this,d=Zb(a,b,3);return new fe(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 Kd=function(a){function b(b,c,d){this.source=b,this.predicate=Zb(c,d,3),a.call(this)}return xc(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}(od);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)},hd.filter=hd.where=function(a,b){return this instanceof Kd?this.internalFilter(a,b):new Kd(this,a,b)},hd.aggregate=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,b=arguments[0],a=arguments[1]):a=arguments[0],new fe(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=a(g,d):(g=c?a(b,d):d,f=!0)}catch(i){return void e.onError(i)}},function(a){e.onError(a)},function(){h&&e.onNext(g),!h&&c&&e.onNext(b),!h&&!c&&e.onError(new Error(Mb)),e.onCompleted()})},d)},hd.reduce=function(a){var b,c=!1,d=this;return 2===arguments.length&&(c=!0,b=arguments[1]),new fe(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=a(g,d):(g=c?a(b,d):d,f=!0)}catch(i){return void e.onError(i)}},function(a){e.onError(a)},function(){h&&e.onNext(g),!h&&c&&e.onNext(b),!h&&!c&&e.onError(new Error(Mb)),e.onCompleted()})},d)},hd.some=function(a,b){var c=this;return a?c.filter(a,b).some():new fe(function(a){return c.subscribe(function(){a.onNext(!0),a.onCompleted()},function(b){a.onError(b)},function(){a.onNext(!1),a.onCompleted()})},c)},hd.any=function(){return this.some.apply(this,arguments)},hd.isEmpty=function(){return this.any().map(Kb)},hd.every=function(a,b){return this.filter(function(b){return!a(b)},b).some().map(Kb)},hd.all=function(){return this.every.apply(this,arguments)},hd.includes=function(a,b){function c(a,b){return 0===a&&0===b||a===b||isNaN(a)&&isNaN(b)}var d=this;return new fe(function(e){var f=0,g=+b||0;return 1/0===Math.abs(g)&&(g=0),0>g?(e.onNext(!1),e.onCompleted(),Ic):d.subscribe(function(b){f++>=g&&c(b,a)&&(e.onNext(!0),e.onCompleted())},function(a){e.onError(a)},function(){e.onNext(!1),e.onCompleted()})},this)},hd.contains=function(a,b){hd.includes(a,b)},hd.count=function(a,b){return a?this.filter(a,b).count():this.reduce(function(a){return a+1},0)},hd.indexOf=function(a,b){var c=this;return new fe(function(d){var e=0,f=+b||0;return 1/0===Math.abs(f)&&(f=0),0>f?(d.onNext(-1),d.onCompleted(),Ic):c.subscribe(function(b){e>=f&&b===a&&(d.onNext(e),d.onCompleted()),e++},function(a){d.onError(a)},function(){d.onNext(-1),d.onCompleted()})},c)},hd.sum=function(a,b){return a&&Lb(a)?this.map(a,b).sum():this.reduce(function(a,b){return a+b},0)},hd.minBy=function(a,b){return b||(b=Hb),P(this,a,function(a,c){return-1*b(a,c)})},hd.min=function(a){return this.minBy(Eb,a).map(function(a){return Q(a)})},hd.maxBy=function(a,b){return b||(b=Hb),P(this,a,b)},hd.max=function(a){return this.maxBy(Eb,a).map(function(a){return Q(a)})},hd.average=function(a,b){return a&&Lb(a)?this.map(a,b).average():this.reduce(function(a,b){return{sum:a.sum+b,count:a.count+1}},{sum:0,count:0}).map(function(a){if(0===a.count)throw new Error(Mb);return a.sum/a.count})},hd.sequenceEqual=function(a,b){var c=this;return b||(b=Gb),new fe(function(d){var e=!1,f=!1,g=[],h=[],i=c.subscribe(function(a){var c,e;if(h.length>0){e=h.shift();try{c=b(e,a)}catch(i){return void d.onError(i)}c||(d.onNext(!1),d.onCompleted())}else f?(d.onNext(!1),d.onCompleted()):g.push(a)},function(a){d.onError(a)},function(){e=!0,0===g.length&&(h.length>0?(d.onNext(!1),d.onCompleted()):f&&(d.onNext(!0),d.onCompleted()))});(Xb(a)||Wb(a))&&(a=wd(a)),Jb(a)&&(a=pd(a));var j=a.subscribe(function(a){var c;if(g.length>0){var f=g.shift();try{c=b(f,a)}catch(i){return void d.onError(i)}c||(d.onNext(!1),d.onCompleted())}else e?(d.onNext(!1),d.onCompleted()):h.push(a)},function(a){d.onError(a)},function(){f=!0,0===h.length&&(g.length>0?(d.onNext(!1),d.onCompleted()):e&&(d.onNext(!0),d.onCompleted()))});return new Ec(i,j)},c)},hd.elementAt=function(a){return R(this,a,!1)},hd.elementAtOrDefault=function(a,b){return R(this,a,!0,b)},hd.single=function(a,b){return a&&Lb(a)?this.where(a,b).single():S(this,!1)},hd.singleOrDefault=function(a,b,c){return a&&Lb(a)?this.filter(a,c).singleOrDefault(null,b):S(this,!0,b)
4
- },hd.first=function(a,b){return a?this.where(a,b).first():T(this,!1)},hd.firstOrDefault=function(a,b){return a?this.where(a).firstOrDefault(null,b):T(this,!0,b)},hd.last=function(a,b){return a?this.where(a,b).last():U(this,!1)},hd.lastOrDefault=function(a,b,c){return a?this.where(a,c).lastOrDefault(null,b):U(this,!0,b)},hd.find=function(a,b){return V(this,a,b,!1)},hd.findIndex=function(a,b){return V(this,a,b,!0)},hd.toSet=function(){if("undefined"==typeof wb.Set)throw new TypeError;var a=this;return new fe(function(b){var c=new wb.Set;return a.subscribe(function(a){c.add(a)},function(a){b.onError(a)},function(){b.onNext(c),b.onCompleted()})},a)},hd.toMap=function(a,b){if("undefined"==typeof wb.Map)throw new TypeError;var c=this;return new fe(function(d){var e=new wb.Map;return c.subscribe(function(c){var f;try{f=a(c)}catch(g){return void d.onError(g)}var h=c;if(b)try{h=b(c)}catch(g){return void d.onError(g)}e.set(f,h)},function(a){d.onError(a)},function(){d.onNext(e),d.onCompleted()})},c)};var Ld="function",Md="throw",tc=Bb.internals.isObject,Nd=Bb.spawn=function(a){var b=_(a);return function(c){function d(a,b){Xc.schedule(c.bind(f,a,b))}function e(a,b){var c;if(arguments.length>2)for(var b=[],h=1,i=arguments.length;i>h;h++)b.push(arguments[h]);if(a)try{c=g[Md](a)}catch(j){return d(j)}if(!a)try{c=g.next(b)}catch(j){return d(j)}if(c.done)return d(null,c.value);if(c.value=W(c.value,f),typeof c.value!==Ld)e(new TypeError("Rx.spawn only supports a function, Promise, Observable, Object or Array."));else{var k=!1;try{c.value.call(f,function(){k||(k=!0,e.apply(f,arguments))})}catch(j){Xc.schedule(function(){k||(k=!0,e.call(f,j))})}}}var f=this,g=a;if(b){for(var h=[],i=0,j=arguments.length;j>i;i++)h.push(arguments[i]);var j=h.length,k=j&&typeof h[j-1]===Ld;c=k?h.pop():bb,g=a.apply(this,h)}else c=c||bb;e()}};nd.start=function(a,b,c){return Od(a,b,c)()};var Od=nd.toAsync=function(a,b,c){return Db(c)||(c=Xc),function(){var d=arguments,e=new je;return c.schedule(function(){var c;try{c=a.apply(b,d)}catch(f){return void e.onError(f)}e.onNext(c),e.onCompleted()}),e.asObservable()}};nd.fromCallback=function(a,b,c){return function(){for(var d=[],e=0,f=arguments.length;f>e;e++)d.push(arguments[e]);return new fe(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()}},nd.fromNodeCallback=function(a,b,c){return function(){for(var d=[],e=0,f=arguments.length;f>e;e++)d.push(arguments[e]);return new fe(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()}},Bb.config.useNativeEvents=!1,nd.fromEvent=function(a,b,c){return a.addListener?Pd(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c):Bb.config.useNativeEvents||"function"!=typeof a.on||"function"!=typeof a.off?new fe(function(d){return eb(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():Pd(function(c){a.on(b,c)},function(c){a.off(b,c)},c)};var Pd=nd.fromEventPattern=function(a,b,c){return new fe(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 Hc(function(){b&&b(e,f)})}).publish().refCount()};nd.startAsync=function(a){var b;try{b=a()}catch(c){return Dd(c)}return pd(b)};var Qd=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=Ic,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=Ic)});return new Ec(c,d,e)}function c(c,d){this.source=c,this.controller=new ie,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,a.call(this,b,c)}return xc(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(nd);hd.pausable=function(a){return new Qd(this,a)};var Rd=function(b){function c(b){var c,d=[],e=fb(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 ie,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,b.call(this,c,a)}return xc(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(nd);hd.pausableBuffered=function(a){return new Rd(this,a)};var Sd=function(a){function b(a){return this.source.subscribe(a)}function c(c,d){a.call(this,b,c),this.subject=new Td(d),this.source=c.multicast(this.subject).refCount()}return xc(c,a),c.prototype.request=function(a){return null==a&&(a=-1),this.subject.request(a)},c}(nd),Td=function(a){function b(a){return this.subject.subscribe(a)}function c(c){null==c&&(c=!0),a.call(this,b),this.subject=new ie,this.enableQueue=c,this.queue=c?[]:null,this.requestedCount=0,this.requestedDisposable=Ic,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.controlledDisposable=Ic}return xc(c,a),yc(c.prototype,fd,{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=Ic):this.hasCompleted&&(this.subject.onCompleted(),this.controlledDisposable.dispose(),this.controlledDisposable=Ic),{numberOfItems:a,returnValue:!1}},request:function(a){this.disposeCurrentRequest();var b=this,c=this._processRequest(a),a=c.numberOfItems;return c.returnValue?Ic:(this.requestedCount=a,this.requestedDisposable=Hc(function(){b.requestedCount=0}),this.requestedDisposable)},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=Ic}}),c}(nd);hd.controlled=function(a){return null==a&&(a=!0),new Sd(this,a)};var Ud=function(a){function b(a){this.subscription=this.source.subscribe(new d(a,this,this.subscription));var b=this;return Xc.schedule(function(){b.source.request(1)}),this.subscription}function c(c){a.call(this,b,c),this.source=c}xc(c,a);var d=function(a){function b(b,c,d){a.call(this),this.observer=b,this.observable=c,this.cancel=d}xc(b,a);var c=b.prototype;return c.completed=function(){this.observer.onCompleted(),this.dispose()},c.error=function(a){this.observer.onError(a),this.dispose()},c.next=function(a){this.observer.onNext(a);var b=this;Xc.schedule(function(){b.observable.source.request(1)})},c.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),a.prototype.dispose.call(this)},b}(id);return c}(nd);Sd.prototype.stopAndWait=function(){return new Ud(this)};var Vd=function(a){function b(a){this.subscription=this.source.subscribe(new d(a,this,this.subscription));var b=this;return Xc.schedule(function(){b.source.request(b.windowSize)}),this.subscription}function c(c,d){a.call(this,b,c),this.source=c,this.windowSize=d}xc(c,a);var d=function(a){function b(a,b,c){this.observer=a,this.observable=b,this.cancel=c,this.received=0}xc(b,a);var c=b.prototype;return c.completed=function(){this.observer.onCompleted(),this.dispose()},c.error=function(a){this.observer.onError(a),this.dispose()},c.next=function(a){if(this.observer.onNext(a),this.received=++this.received%this.observable.windowSize,0===this.received){var b=this;Xc.schedule(function(){b.observable.source.request(b.observable.windowSize)})}},c.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),a.prototype.dispose.call(this)},b}(id);return c}(nd);Sd.prototype.windowed=function(a){return new Vd(this,a)},hd.multicast=function(a,b){var c=this;return"function"==typeof a?new fe(function(d){var e=c.multicast(a());return new Ec(b(e).subscribe(d),e.connect())},c):new Zd(c,a)},hd.publish=function(a){return a&&Lb(a)?this.multicast(function(){return new ie},a):this.multicast(new ie)},hd.share=function(){return this.publish().refCount()},hd.publishLast=function(a){return a&&Lb(a)?this.multicast(function(){return new je},a):this.multicast(new je)},hd.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new Xd(b)},a):this.multicast(new Xd(a))},hd.shareValue=function(a){return this.publishValue(a).refCount()},hd.replay=function(a,b,c,d){return a&&Lb(a)?this.multicast(function(){return new Yd(b,c,d)},a):this.multicast(new Yd(b,c,d))},hd.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};var Wd=function(a,b){this.subject=a,this.observer=b};Wd.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 Xd=Bb.BehaviorSubject=function(a){function d(a){return b(this),this.isStopped?(this.hasError?a.onError(this.error):a.onCompleted(),Ic):(this.observers.push(a),a.onNext(this.value),new Wd(this,a))}function e(b){a.call(this,d),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.hasError=!1}return xc(e,a),yc(e.prototype,fd,{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}(nd),Yd=Bb.ReplaySubject=function(a){function d(a,b){return Hc(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function e(a){var c=new ld(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||Sc,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,e)}return xc(f,a),yc(f.prototype,fd.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}(nd),Zd=Bb.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new Ec(f.subscribe(c),Hc(function(){e=!1}))),d},a.call(this,function(a){return c.subscribe(a)})}return xc(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new fe(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(nd),$d=function(){function b(a){if(0===(1&a))return 2===a;for(var b=Math.sqrt(a),c=3;b>=c;){if(a%c===0)return!1;c+=2}return!0}function c(a){var c,d,e;for(c=0;c<h.length;++c)if(d=h[c],d>=a)return d;for(e=1|a;e<h[h.length-1];){if(b(e))return e;e+=2}return a}function d(a){var b=757602046;if(!a.length)return b;for(var c=0,d=a.length;d>c;c++){var e=a.charCodeAt(c);b=(b<<5)-b+e,b&=b}return b}function e(a){var b=668265261;return a=61^a^a>>>16,a+=a<<3,a^=a>>>4,a*=b,a^=a>>>15}function f(){return{key:null,value:null,next:0,hashCode:0}}function g(a,b){if(0>a)throw new Error("out of range");a>0&&this._initialize(a),this.comparer=b||Gb,this.freeCount=0,this.size=0,this.freeList=-1}var h=[1,3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143,4194301,8388593,16777213,33554393,67108859,134217689,268435399,536870909,1073741789,2147483647],i="no such key",j="duplicate key",k=function(){var a=0;return function(b){if(null==b)throw new Error(i);if("string"==typeof b)return d(b);if("number"==typeof b)return e(b);if("boolean"==typeof b)return b===!0?1:0;if(b instanceof Date)return e(b.valueOf());if(b instanceof RegExp)return d(b.toString());if("function"==typeof b.valueOf){var c=b.valueOf();if("number"==typeof c)return e(c);if("string"==typeof c)return d(c)}if(b.hashCode)return b.hashCode();var f=17*a++;return b.hashCode=function(){return f},f}}(),l=g.prototype;return l._initialize=function(a){var b,d=c(a);for(this.buckets=new Array(d),this.entries=new Array(d),b=0;d>b;b++)this.buckets[b]=-1,this.entries[b]=f();this.freeList=-1},l.add=function(a,b){this._insert(a,b,!0)},l._insert=function(a,b,c){this.buckets||this._initialize(0);for(var d,e=2147483647&k(a),f=e%this.buckets.length,g=this.buckets[f];g>=0;g=this.entries[g].next)if(this.entries[g].hashCode===e&&this.comparer(this.entries[g].key,a)){if(c)throw new Error(j);return void(this.entries[g].value=b)}this.freeCount>0?(d=this.freeList,this.freeList=this.entries[d].next,--this.freeCount):(this.size===this.entries.length&&(this._resize(),f=e%this.buckets.length),d=this.size,++this.size),this.entries[d].hashCode=e,this.entries[d].next=this.buckets[f],this.entries[d].key=a,this.entries[d].value=b,this.buckets[f]=d},l._resize=function(){var a=c(2*this.size),b=new Array(a);for(e=0;e<b.length;++e)b[e]=-1;var d=new Array(a);for(e=0;e<this.size;++e)d[e]=this.entries[e];for(var e=this.size;a>e;++e)d[e]=f();for(var g=0;g<this.size;++g){var h=d[g].hashCode%a;d[g].next=b[h],b[h]=g}this.buckets=b,this.entries=d},l.remove=function(a){if(this.buckets)for(var b=2147483647&k(a),c=b%this.buckets.length,d=-1,e=this.buckets[c];e>=0;e=this.entries[e].next){if(this.entries[e].hashCode===b&&this.comparer(this.entries[e].key,a))return 0>d?this.buckets[c]=this.entries[e].next:this.entries[d].next=this.entries[e].next,this.entries[e].hashCode=-1,this.entries[e].next=this.freeList,this.entries[e].key=null,this.entries[e].value=null,this.freeList=e,++this.freeCount,!0;d=e}return!1},l.clear=function(){var a,b;if(!(this.size<=0)){for(a=0,b=this.buckets.length;b>a;++a)this.buckets[a]=-1;for(a=0;a<this.size;++a)this.entries[a]=f();this.freeList=-1,this.size=0}},l._findEntry=function(a){if(this.buckets)for(var b=2147483647&k(a),c=this.buckets[b%this.buckets.length];c>=0;c=this.entries[c].next)if(this.entries[c].hashCode===b&&this.comparer(this.entries[c].key,a))return c;return-1},l.count=function(){return this.size-this.freeCount},l.tryGetValue=function(b){var c=this._findEntry(b);return c>=0?this.entries[c].value:a},l.getValues=function(){var a=0,b=[];if(this.entries)for(var c=0;c<this.size;c++)this.entries[c].hashCode>=0&&(b[a++]=this.entries[c].value);return b},l.get=function(a){var b=this._findEntry(a);if(b>=0)return this.entries[b].value;throw new Error(i)},l.set=function(a,b){this._insert(a,b,!1)},l.containskey=function(a){return this._findEntry(a)>=0},g}();hd.join=function(a,b,c,d){var e=this;return new fe(function(f){var g=new Ec,h=!1,i=!1,j=0,k=0,l=new $d,m=new $d;return g.add(e.subscribe(function(a){var c=j++,e=new Jc;l.add(c,a),g.add(e);var i,k=function(){l.remove(c)&&0===l.count()&&h&&f.onCompleted(),g.remove(e)};try{i=b(a)}catch(n){return void f.onError(n)}e.setDisposable(i.take(1).subscribe(Cb,f.onError.bind(f),k)),m.getValues().forEach(function(b){var c;try{c=d(a,b)}catch(e){return void f.onError(e)}f.onNext(c)})},f.onError.bind(f),function(){h=!0,(i||0===l.count())&&f.onCompleted()})),g.add(a.subscribe(function(a){var b=k++,e=new Jc;m.add(b,a),g.add(e);var h,j=function(){m.remove(b)&&0===m.count()&&i&&f.onCompleted(),g.remove(e)};try{h=c(a)}catch(n){return void f.onError(n)}e.setDisposable(h.take(1).subscribe(Cb,f.onError.bind(f),j)),l.getValues().forEach(function(b){var c;try{c=d(b,a)}catch(e){return void f.onError(e)}f.onNext(c)})},f.onError.bind(f),function(){i=!0,(h||0===m.count())&&f.onCompleted()})),g},e)},hd.groupJoin=function(a,b,c,d){var e=this;return new fe(function(f){function g(a){return function(b){b.onError(a)}}var h=new Ec,i=new Lc(h),j=new $d,k=new $d,l=0,m=0;return h.add(e.subscribe(function(a){var c=new ie,e=l++;j.add(e,c);var m;try{m=d(a,zc(c,i))}catch(n){return j.getValues().forEach(g(n)),void f.onError(n)}f.onNext(m),k.getValues().forEach(function(a){c.onNext(a)});var o=new Jc;h.add(o);var p,q=function(){j.remove(e)&&c.onCompleted(),h.remove(o)};try{p=b(a)}catch(n){return j.getValues().forEach(g(n)),void f.onError(n)}o.setDisposable(p.take(1).subscribe(Cb,function(a){j.getValues().forEach(g(a)),f.onError(a)},q))},function(a){j.getValues().forEach(g(a)),f.onError(a)},f.onCompleted.bind(f))),h.add(a.subscribe(function(a){var b=m++;k.add(b,a);var d=new Jc;h.add(d);var e,i=function(){k.remove(b),h.remove(d)};try{e=c(a)}catch(l){return j.getValues().forEach(g(l)),void f.onError(l)}d.setDisposable(e.take(1).subscribe(Cb,function(a){j.getValues().forEach(g(a)),f.onError(a)},i)),j.getValues().forEach(function(b){b.onNext(a)})},function(a){j.getValues().forEach(g(a)),f.onError(a)})),i},e)},hd.buffer=function(){return this.window.apply(this,arguments).selectMany(function(a){return a.toArray()})},hd.window=function(a,b){return 1===arguments.length&&"function"!=typeof arguments[0]?hb.call(this,a):"function"==typeof a?ib.call(this,a):gb.call(this,a,b)},hd.pairwise=function(){var a=this;return new fe(function(b){var c,d=!1;return a.subscribe(function(a){d?b.onNext([c,a]):d=!0,c=a},b.onError.bind(b),b.onCompleted.bind(b))},a)},hd.partition=function(a,b){return[this.filter(a,b),this.filter(function(c,d,e){return!a.call(b,c,d,e)})]},hd.letBind=hd.let=function(a){return a(this)},nd["if"]=nd.ifThen=function(a,b,c){return rd(function(){return c||(c=sd()),Jb(b)&&(b=pd(b)),Jb(c)&&(c=pd(c)),"function"==typeof c.now&&(c=sd(c)),a()?b:c})},nd["for"]=nd.forIn=function(a,b,c){return ed(a,b,c).concat()};var _d=nd["while"]=nd.whileDo=function(a,b){return Jb(b)&&(b=pd(b)),jb(a,b).concat()};hd.doWhile=function(a){return Gd([this,_d(a,this)])},nd["case"]=nd.switchCase=function(a,b,c){return rd(function(){Jb(c)&&(c=pd(c)),c||(c=sd()),"function"==typeof c.now&&(c=sd(c));var d=b[a()];return Jb(d)&&(d=pd(d)),d||c})},hd.expand=function(a,b){Db(b)||(b=Rc);var c=this;return new fe(function(d){var e=[],f=new Kc,g=new Ec(f),h=0,i=!1,j=function(){var c=!1;e.length>0&&(c=!i,i=!0),c&&f.setDisposable(b.scheduleRecursive(function(b){var c;if(!(e.length>0))return void(i=!1);c=e.shift();var f=new Jc;g.add(f),f.setDisposable(c.subscribe(function(b){d.onNext(b);var c=null;try{c=a(b)}catch(f){d.onError(f)}e.push(c),h++,j()},d.onError.bind(d),function(){g.remove(f),h--,0===h&&d.onCompleted()})),b()}))};return e.push(c),h++,j(),g},this)},nd.forkJoin=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new fe(function(b){var c=a.length;if(0===c)return b.onCompleted(),Ic;for(var d=new Ec,e=!1,f=new Array(c),g=new Array(c),h=new Array(c),i=0;c>i;i++)!function(i){var j=a[i];Jb(j)&&(j=pd(j)),d.add(j.subscribe(function(a){e||(f[i]=!0,h[i]=a)},function(a){e=!0,b.onError(a),d.dispose()},function(){if(!e){if(!f[i])return void b.onCompleted();g[i]=!0;for(var a=0;c>a;a++)if(!g[a])return;e=!0,b.onNext(h),b.onCompleted()}}))}(i);return d})},hd.forkJoin=function(a,b){var c=this;return new fe(function(d){var e,f,g=!1,h=!1,i=!1,j=!1,k=new Jc,l=new Jc;return Jb(a)&&(a=pd(a)),k.setDisposable(c.subscribe(function(a){i=!0,e=a},function(a){l.dispose(),d.onError(a)},function(){if(g=!0,h)if(i)if(j){var a;try{a=b(e,f)}catch(c){return void d.onError(c)}d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),l.setDisposable(a.subscribe(function(a){j=!0,f=a},function(a){k.dispose(),d.onError(a)},function(){if(h=!0,g)if(i)if(j){var a;try{a=b(e,f)}catch(c){return void d.onError(c)}d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),new Ec(k,l)},c)},hd.manySelect=function(a,b){Db(b)||(b=Rc);var c=this;return rd(function(){var d;return c.map(function(a){var b=new ae(a);return d&&d.onNext(a),d=b,b}).tap(Cb,function(a){d&&d.onError(a)},function(){d&&d.onCompleted()}).observeOn(b).map(a)},c)};var ae=function(a){function b(a){var b=this,c=new Ec;return c.add(Sc.schedule(function(){a.onNext(b.head),c.add(b.tail.mergeAll().subscribe(a))})),c}function c(c){a.call(this,b),this.head=c,this.tail=new je}return xc(c,a),yc(c.prototype,fd,{onCompleted:function(){this.onNext(nd.empty())},onError:function(a){this.onNext(nd.throwException(a))},onNext:function(a){this.tail.onNext(a),this.tail.onCompleted()}}),c}(nd),be=wb.Map||function(){function b(){this._keys=[],this._values=[]}return b.prototype.get=function(b){var c=this._keys.indexOf(b);return-1!==c?this._values[c]:a},b.prototype.set=function(a,b){var c=this._keys.indexOf(a);-1!==c&&(this._values[c]=b),this._values[this._keys.push(a)-1]=b},b.prototype.forEach=function(a,b){for(var c=0,d=this._keys.length;d>c;c++)a.call(b,this._values[c],this._keys[c])},b}();kb.prototype.and=function(a){return new kb(this.patterns.concat(a))},kb.prototype.thenDo=function(a){return new lb(this,a)},lb.prototype.activate=function(a,b,c){for(var d=this,e=[],f=0,g=this.expression.patterns.length;g>f;f++)e.push(mb(a,this.expression.patterns[f],b.onError.bind(b)));var h=new nb(e,function(){var a;try{a=d.selector.apply(d,arguments)}catch(c){return void b.onError(c)}b.onNext(a)},function(){for(var a=0,b=e.length;b>a;a++)e[a].removeActivePlan(h);c(h)});for(f=0,g=e.length;g>f;f++)e[f].addActivePlan(h);return h},nb.prototype.dequeue=function(){this.joinObservers.forEach(function(a){a.queue.shift()})},nb.prototype.match=function(){var a,b,c=!0;for(a=0,b=this.joinObserverArray.length;b>a;a++)if(0===this.joinObserverArray[a].queue.length){c=!1;break}if(c){var d=[],e=!1;for(a=0,b=this.joinObserverArray.length;b>a;a++)d.push(this.joinObserverArray[a].queue[0]),"C"===this.joinObserverArray[a].queue[0].kind&&(e=!0);if(e)this.onCompleted();else{this.dequeue();var f=[];for(a=0,b=d.length;a<d.length;a++)f.push(d[a].value);this.onNext.apply(this,f)}}};var ce=function(a){function b(b,c){a.call(this),this.source=b,this.onError=c,this.queue=[],this.activePlans=[],this.subscription=new Jc,this.isDisposed=!1}xc(b,a);var c=b.prototype;return c.next=function(a){if(!this.isDisposed){if("E"===a.kind)return this.onError(a.exception);this.queue.push(a);for(var b=this.activePlans.slice(0),c=0,d=b.length;d>c;c++)b[c].match()}},c.error=Cb,c.completed=Cb,c.addActivePlan=function(a){this.activePlans.push(a)},c.subscribe=function(){this.subscription.setDisposable(this.source.materialize().subscribe(this))},c.removeActivePlan=function(a){this.activePlans.splice(this.activePlans.indexOf(a),1),0===this.activePlans.length&&this.dispose()},c.dispose=function(){a.prototype.dispose.call(this),this.isDisposed||(this.isDisposed=!0,this.subscription.dispose())},b}(id);hd.and=function(a){return new kb([this,a])},hd.thenDo=function(a){return new kb([this]).thenDo(a)},nd.when=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new fe(function(b){var c=[],d=new be,e=gd(function(a){b.onNext(a)},function(a){d.forEach(function(b){b.onError(a)}),b.onError(a)},function(){b.onCompleted()});try{for(var f=0,g=a.length;g>f;f++)c.push(a[f].activate(d,e,function(a){var d=c.indexOf(a);c.splice(d,1),0===c.length&&b.onCompleted()}))}catch(h){Dd(h).subscribe(b)}var i=new Ec;return d.forEach(function(a){a.subscribe(),i.add(a)}),i})};var de=nd.interval=function(a,b){return rb(a,a,Db(b)?b:Xc)},ee=nd.timer=function(b,c,d){var e;return Db(d)||(d=Xc),c!==a&&"number"==typeof c?e=c:Db(c)&&(d=c),b instanceof Date&&e===a?ob(b.getTime(),d):b instanceof Date&&e!==a?(e=c,pb(b.getTime(),e,d)):e===a?qb(b,d):rb(b,e,d)};hd.delay=function(a,b){return Db(b)||(b=Xc),a instanceof Date?tb(this,a.getTime(),b):sb(this,a,b)},hd.debounce=hd.throttleWithTimeout=function(a,b){Db(b)||(b=Xc);var c=this;return new fe(function(d){var e,f=new Kc,g=!1,h=0,i=c.subscribe(function(c){g=!0,e=c,h++;var i=h,j=new Jc;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 Ec(i,f)},this)},hd.throttle=function(a,b){return this.debounce(a,b)},hd.windowWithTime=function(a,b,c){var d,e=this;return null==b&&(d=a),Db(c)||(c=Xc),"number"==typeof b?d=b:Db(b)&&(d=a,c=b),new fe(function(b){function f(){var a=new Jc,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 ie;k.push(a),b.onNext(zc(a,h))}e&&k.shift().onCompleted(),f()}))}var g,h,i=d,j=a,k=[],l=new Kc,m=0;return g=new Ec(l),h=new Lc(g),k.push(new ie),b.onNext(zc(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)},hd.windowWithTimeOrCount=function(a,b,c){var d=this;return Db(c)||(c=Xc),new fe(function(e){function f(b){var d=new Jc;g.setDisposable(d),d.setDisposable(c.scheduleWithRelative(a,function(){if(b===k){j=0;var a=++k;l.onCompleted(),l=new ie,e.onNext(zc(l,i)),f(a)}}))}var g=new Kc,h=new Ec(g),i=new Lc(h),j=0,k=0,l=new ie;return e.onNext(zc(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 ie,e.onNext(zc(l,i))),d&&f(c)},function(a){l.onError(a),e.onError(a)},function(){l.onCompleted(),e.onCompleted()})),i},d)},hd.bufferWithTime=function(){return this.windowWithTime.apply(this,arguments).selectMany(function(a){return a.toArray()})},hd.bufferWithTimeOrCount=function(a,b,c){return this.windowWithTimeOrCount(a,b,c).selectMany(function(a){return a.toArray()})},hd.timeInterval=function(a){var b=this;return Db(a)||(a=Xc),rd(function(){var c=a.now();return b.map(function(b){var d=a.now(),e=d-c;return c=d,{value:b,interval:e}})})},hd.timestamp=function(a){return Db(a)||(a=Xc),this.map(function(b){return{value:b,timestamp:a.now()}})},hd.sample=hd.throttleLatest=function(a,b){return Db(b)||(b=Xc),"number"==typeof a?ub(this,de(a,b)):ub(this,a)},hd.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=Dd(new Error(b||"Timeout"))),Db(c)||(c=Xc);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new fe(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(Jb(b)&&(b=pd(b)),j.setDisposable(b.subscribe(f)))}))}var h=0,i=new Jc,j=new Kc,k=!1,l=new Kc;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 Ec(j,l)},d)},nd.generateWithAbsoluteTime=function(a,b,c,d,e,f){return Db(f)||(f=Xc),new fe(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()})})},nd.generateWithRelativeTime=function(a,b,c,d,e,f){return Db(f)||(f=Xc),new fe(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()})})},hd.delaySubscription=function(a,b){return this.delayWithSelector(ee(a,Db(b)?b:Xc),sd)},hd.delayWithSelector=function(a,b){var c,d,e=this;return"function"==typeof a?d=a:(c=a,d=b),new fe(function(a){var b=new Ec,f=!1,g=function(){f&&0===b.length&&a.onCompleted()},h=new Kc,i=function(){h.setDisposable(e.subscribe(function(c){var e;try{e=d(c)}catch(f){return void a.onError(f)}var h=new Jc;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 Ec(h,b)},this)},hd.timeoutWithSelector=function(a,b,c){1===arguments.length&&(b=a,a=zd()),c||(c=Dd(new Error("Timeout")));var d=this;return new fe(function(e){function f(a){function b(){return k===d}var d=k,f=new Jc;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 Kc,i=new Kc,j=new Jc;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(Jb(c)?pd(c):c)}},function(a){g()&&e.onError(a)},function(){g()&&e.onCompleted()})),new Ec(h,i)},d)},hd.debounceWithSelector=function(a){var b=this;return new fe(function(c){var d,e=!1,f=new Kc,g=0,h=b.subscribe(function(b){var h;try{h=a(b)}catch(i){return void c.onError(i)}Jb(h)&&(h=pd(h)),e=!0,d=b,g++;var j=g,k=new Jc;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 Ec(h,f)},b)},hd.throttleWithSelector=function(){return this.debounceWithSelector.apply(this,arguments)},hd.skipLastWithTime=function(a,b){Db(b)||(b=Xc);var c=this;return new fe(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)},hd.takeLastWithTime=function(a,b){var c=this;return Db(b)||(b=Xc),new fe(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)},hd.takeLastBufferWithTime=function(a,b){var c=this;return Db(b)||(b=Xc),new fe(function(d){var e=[];
5
- 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)},hd.takeWithTime=function(a,b){var c=this;return Db(b)||(b=Xc),new fe(function(d){return new Ec(b.scheduleWithRelative(a,function(){d.onCompleted()}),c.subscribe(d))},c)},hd.skipWithTime=function(a,b){var c=this;return Db(b)||(b=Xc),new fe(function(d){var e=!1;return new Ec(b.scheduleWithRelative(a,function(){e=!0}),c.subscribe(function(a){e&&d.onNext(a)},d.onError.bind(d),d.onCompleted.bind(d)))},c)},hd.skipUntilWithTime=function(a,b){Db(b)||(b=Xc);var c=this,d=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new fe(function(e){var f=!1;return new Ec(b[d](a,function(){f=!0}),c.subscribe(function(a){f&&e.onNext(a)},function(a){e.onError(a)},function(){e.onCompleted()}))},c)},hd.takeUntilWithTime=function(a,b){Db(b)||(b=Xc);var c=this,d=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new fe(function(e){return new Ec(b[d](a,function(){e.onCompleted()}),c.subscribe(e))},c)},hd.throttleFirst=function(a,b){Db(b)||(b=Xc);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new fe(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)},hd.exclusive=function(){var a=this;return new fe(function(b){var c=!1,d=!1,e=new Jc,f=new Ec;return f.add(e),e.setDisposable(a.subscribe(function(a){if(!c){c=!0,Jb(a)&&(a=pd(a));var e=new Jc;f.add(e),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){f.remove(e),c=!1,d&&1===f.length&&b.onCompleted()}))}},b.onError.bind(b),function(){d=!0,c||1!==f.length||b.onCompleted()})),f},this)},hd.exclusiveMap=function(a,b){var c=this,d=Zb(a,b,3);return new fe(function(a){var b=0,e=!1,f=!0,g=new Jc,h=new Ec;return h.add(g),g.setDisposable(c.subscribe(function(c){e||(e=!0,innerSubscription=new Jc,h.add(innerSubscription),Jb(c)&&(c=pd(c)),innerSubscription.setDisposable(c.subscribe(function(e){var f;try{f=d(e,b++,c)}catch(g){return void a.onError(g)}a.onNext(f)},function(b){a.onError(b)},function(){h.remove(innerSubscription),e=!1,f&&1===h.length&&a.onCompleted()})))},function(b){a.onError(b)},function(){f=!0,1!==h.length||e||a.onCompleted()})),h},this)},hd.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 fe(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)},Bb.VirtualTimeScheduler=function(a){function b(){throw new Error("Not implemented")}function c(){return this.toDateTimeOffset(this.clock)}function d(a,b){return this.scheduleAbsoluteWithState(a,this.clock,b)}function e(a,b,c){return this.scheduleRelativeWithState(a,this.toRelative(b),c)}function f(a,b,c){return this.scheduleRelativeWithState(a,this.toRelative(b-this.now()),c)}function g(a,b){return b(),Ic}function h(b,g){this.clock=b,this.comparer=g,this.isEnabled=!1,this.queue=new Cc(1024),a.call(this,c,d,e,f)}xc(h,a);var i=h.prototype;return i.add=b,i.toDateTimeOffset=b,i.toRelative=b,i.schedulePeriodicWithState=function(a,b,c){var d=new Qc(this,a,b,c);return d.start()},i.scheduleRelativeWithState=function(a,b,c){var d=this.add(this.clock,b);return this.scheduleAbsoluteWithState(a,d,c)},i.scheduleRelative=function(a,b){return this.scheduleRelativeWithState(b,a,g)},i.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)}},i.stop=function(){this.isEnabled=!1},i.advanceTo=function(a){var b=this.comparer(this.clock,a);if(this.comparer(this.clock,a)>0)throw new Error(Nb);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}},i.advanceBy=function(a){var b=this.add(this.clock,a),c=this.comparer(this.clock,b);if(c>0)throw new Error(Nb);0!==c&&this.advanceTo(b)},i.sleep=function(a){var b=this.add(this.clock,a);if(this.comparer(this.clock,b)>=0)throw new Error(Nb);this.clock=b},i.getNext=function(){for(;this.queue.length>0;){var a=this.queue.peek();if(!a.isCancelled())return a;this.queue.dequeue()}return null},i.scheduleAbsolute=function(a,b){return this.scheduleAbsoluteWithState(b,a,g)},i.scheduleAbsoluteWithState=function(a,b,c){function d(a,b){return e.queue.remove(f),c(a,b)}var e=this,f=new Mc(this,a,d,b,this.comparer);return this.queue.enqueue(f),f.disposable},h}(Nc),Bb.HistoricalScheduler=function(a){function b(b,c){var d=null==b?0:b,e=c||Hb;a.call(this,d,e)}xc(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}(Bb.VirtualTimeScheduler);var fe=Bb.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Hc(a):Ic}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 ge(a),e=[d,b];return Sc.scheduleRequired()?Sc.scheduleWithState(e,c):c(null,e),d}this.source=d,a.call(this,e)}return xc(d,a),d}(nd),ge=function(a){function b(b){a.call(this),this.observer=b,this.m=new Jc}xc(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}(id),he=function(a){function b(a){return this.underlyingObservable.subscribe(a)}function c(c,d,e){a.call(this,b),this.key=c,this.underlyingObservable=e?new fe(function(a){return new Ec(e.getDisposable(),d.subscribe(a))}):d}return xc(c,a),c}(nd),ie=Bb.Subject=function(a){function d(a){return b(this),this.isStopped?this.hasError?(a.onError(this.error),Ic):(a.onCompleted(),Ic):(this.observers.push(a),new Wd(this,a))}function e(){a.call(this,d),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return xc(e,a),yc(e.prototype,fd.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 ke(a,b)},e}(nd),je=Bb.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(),Ic):(this.observers.push(a),new Wd(this,a))}function e(){a.call(this,d),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return xc(e,a),yc(e.prototype,fd,{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}(nd),ke=Bb.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 xc(c,a),yc(c.prototype,fd.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(nd);Bb.Pauser=function(a){function b(){a.call(this)}return xc(b,a),b.prototype.pause=function(){this.onNext(!1)},b.prototype.resume=function(){this.onNext(!0)},b}(ie),"function"==typeof define&&"object"==typeof define.amd&&define.amd?(wb.Rx=Bb,define(function(){return Bb})):xb&&yb?zb?(yb.exports=Bb).Rx=Bb:xb.Rx=Bb:wb.Rx=Bb;var le=h()}).call(this);
2
+ (function(a){function b(a){for(var b=a.length,c=new Array(b),d=0;b>d;d++)c[d]=a[d];return c}function c(a,b){if(Ob&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(Sb)){for(var c=[],e=b;e;e=e.source)e.stack&&c.unshift(e.stack);c.unshift(a.stack);var f=c.join("\n"+Sb+"\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===Qb&&d>=Rb&&Fe>=d}function f(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function g(){if(Ob)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 Qb=d[0],d[1]}}function h(a){var b=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(a);if(b)return[b[1],Number(b[2])];var c=/at ([^ ]+):(\d+):(?:\d+)$/.exec(a);if(c)return[c[1],Number(c[2])];var d=/.*@(.+):(\d+)$/.exec(a);return d?[d[1],Number(d[2])]:void 0}function i(a){var b=[];if(!zc(a))return b;yc.nonEnumArgs&&a.length&&Ac(a)&&(a=Dc.call(a));var c=yc.enumPrototypes&&"function"==typeof a,d=yc.enumErrorProps&&(a===tc||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(yc.nonEnumShadows&&a!==uc){var f=a.constructor,g=-1,h=fc;if(a===(f&&f.prototype))var i=a===vc?pc:a===tc?kc:qc.call(a),j=xc[i];for(;++g<h;)e=ec[g],j&&j[e]||!rc.call(a,e)||b.push(e)}return b}function j(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function k(a,b){return j(a,b,i)}function l(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function m(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,f=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=f&&"object"!=f))return!1;var g=qc.call(a),h=qc.call(b);if(g==gc&&(g=nc),h==gc&&(h=nc),g!=h)return!1;switch(g){case ic:case jc:return+a==+b;case mc:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case oc:case pc:return a==String(b)}var i=g==hc;if(!i){if(g!=nc||!yc.nodeClass&&(l(a)||l(b)))return!1;var j=!yc.argsObject&&Ac(a)?Object:a.constructor,n=!yc.argsObject&&Ac(b)?Object:b.constructor;if(!(j==n||rc.call(a,"constructor")&&rc.call(b,"constructor")||Nb(j)&&j instanceof j&&Nb(n)&&n instanceof n||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var o=c.length;o--;)if(c[o]==a)return d[o]==b;var p=0,q=!0;if(c.push(a),d.push(b),i){if(o=a.length,p=b.length,q=p==o)for(;p--;){var r=b[p];if(!(q=m(a[p],r,c,d)))break}}else k(b,function(b,e,f){return rc.call(f,e)?(p++,q=rc.call(a,e)&&m(a[e],b,c,d)):void 0}),q&&k(a,function(a,b,c){return rc.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function n(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function o(){try{return Bc.apply(this,arguments)}catch(a){return Hc.e=a,Hc}}function p(a){if(!Nb(a))throw new TypeError("fn must be a function");return Bc=a,o}function q(a){throw a}function r(a,b){this.id=a,this.value=b}function t(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function u(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function v(a){this.observer=a,this.a=[],this.isStopped=!1}function w(){this._s=s}function x(){this._s=s,this._l=s.length,this._i=0}function y(a){this._a=a}function z(a){this._a=a,this._l=D(a),this._i=0}function A(a){return"number"==typeof a&&zb.isFinite(a)}function B(b){var c,d=b[$b];if(!d&&"string"==typeof b)return c=new w(b),c[$b]();if(!d&&b.length!==a)return c=new y(b),c[$b]();if(!d)throw new TypeError("Object is not iterable");return b[$b]()}function C(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function D(a){var b=+a.length;return isNaN(b)?0:0!==b&&A(b)?(b=C(b)*Math.floor(Math.abs(b)),0>=b?0:b>Hd?Hd:b):b}function E(a,b){this.observer=a,this.parent=b}function F(a,b){return Zc(a)||(a=cd),new Jd(b,a)}function G(a,b){this.observer=a,this.parent=b}function H(a,b){this.observer=a,this.parent=b}function I(a,b){return new ze(function(c){var d=new Tc,e=new Uc;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)}Lb(d)&&(d=Ad(d));var g=new Tc;e.setDisposable(g),g.setDisposable(d.subscribe(c))},function(a){c.onCompleted(a)})),e},a)}function J(a,b){var c=this;return new ze(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 K(){return!1}function L(){return[]}function M(a,b,c){var d=dc(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return Lb(e)&&(e=Ad(e)),(bc(e)||ac(e))&&(e=Id(e)),e}).concatAll()}function N(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function O(a){this.comparer=a,this.set=[]}function P(a,b,c){this.observer=a,this.selector=b,this.source=c,this.i=0,this.isStopped=!1}function Q(a,b,c){var d=dc(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return Lb(e)&&(e=Ad(e)),(bc(e)||ac(e))&&(e=Id(e)),e}).mergeAll()}function R(a,b,c){this.observer=a,this.predicate=b,this.source=c,this.i=0,this.isStopped=!1}function S(a,b,c){return new ze(function(d){var e=!1,f=null,g=[];return a.subscribe(function(a){var h,i;try{i=b(a)}catch(j){return void d.onError(j)}if(h=0,e)try{h=c(i,f)}catch(k){return void d.onError(k)}else e=!0,f=i;h>0&&(f=i,g=[]),h>=0&&g.push(a)},function(a){d.onError(a)},function(){d.onNext(g),d.onCompleted()})},a)}function T(a){if(0===a.length)throw new Tb;return a[0]}function U(a,b,c,d){if(0>b)throw new Vb;return new ze(function(e){var f=b;return a.subscribe(function(a){0===f--&&(e.onNext(a),e.onCompleted())},function(a){e.onError(a)},function(){c?(e.onNext(d),e.onCompleted()):e.onError(new Vb)})},a)}function V(a,b,c){return new ze(function(d){var e=c,f=!1;return a.subscribe(function(a){f?d.onError(new Error("Sequence contains more than one element")):(e=a,f=!0)},function(a){d.onError(a)},function(){f||b?(d.onNext(e),d.onCompleted()):d.onError(new Tb)})},a)}function W(a,b,c){return new ze(function(d){return a.subscribe(function(a){d.onNext(a),d.onCompleted()},function(a){d.onError(a)},function(){b?(d.onNext(c),d.onCompleted()):d.onError(new Tb)})},a)}function X(a,b,c){return new ze(function(d){var e=c,f=!1;return a.subscribe(function(a){e=a,f=!0},function(a){d.onError(a)},function(){f||b?(d.onNext(e),d.onCompleted()):d.onError(new Tb)})},a)}function Y(b,c,d,e){var f=dc(c,d,3);return new ze(function(c){var d=0;return b.subscribe(function(a){var g;try{g=f(a,d,b)}catch(h){return void c.onError(h)}g?(c.onNext(e?d:a),c.onCompleted()):d++},function(a){c.onError(a)},function(){c.onNext(e?-1:a),c.onCompleted()})},b)}function Z(a,b){return Array.isArray(a)?$.call(b,a):cb(a)?ge(a.call(b)):db(a)?ge(a):bb(a)?_(a):Lb(a)?ab(a):typeof a===ee?a:zc(a)||Array.isArray(a)?$.call(b,a):a}function $(a){var b=this;return function(c){function d(a,d){if(!e)try{if(a=Z(a,b),typeof a!==ee)return h[d]=a,--g||c(null,h);a.call(b,function(a,b){if(!e){if(a)return e=!0,c(a);h[d]=b,--g||c(null,h)}})}catch(f){e=!0,c(f)}}var e,f=Object.keys(a),g=f.length,h=new a.constructor;if(!g)return void gd.schedule(function(){c(null,h)});for(var i=0,j=f.length;j>i;i++)d(a[f[i]],f[i])}}function _(a){return function(b){var c,d=!1;a.subscribe(function(a){c=a,d=!0},b,function(){d&&b(null,c)})}}function ab(a){return function(b){a.then(function(a){b(null,a)},b)}}function bb(a){return a&&typeof a.subscribe===ee}function cb(a){return a&&a.constructor&&"GeneratorFunction"===a.constructor.name}function db(a){return a&&typeof a.next===ee&&typeof a[fe]===ee}function eb(a){a&&gd.schedule(function(){throw a})}function fb(a){var b=function(){this.cancelBubble=!0},c=function(){if(this.bubbledKeyCode=this.keyCode,this.ctrlKey)try{this.keyCode=0}catch(a){}this.defaultPrevented=!0,this.returnValue=!1,this.modified=!0};if(a||(a=zb.event),!a.target)switch(a.target=a.target||a.srcElement,"mouseover"==a.type&&(a.relatedTarget=a.fromElement),"mouseout"==a.type&&(a.relatedTarget=a.toElement),a.stopPropagation||(a.stopPropagation=b,a.preventDefault=c),a.type){case"keypress":var d="charCode"in a?a.charCode:a.keyCode;10==d?(d=0,a.keyCode=13):13==d||27==d?d=0:3==d&&(d=99),a.charCode=d,a.keyChar=a.charCode?String.fromCharCode(a.charCode):""}return a}function gb(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),Pc(function(){a.removeEventListener(b,c,!1)});if(a.attachEvent){var d=function(a){c(fb(a))};return a.attachEvent("on"+b,d),Pc(function(){a.detachEvent("on"+b,d)})}return a["on"+b]=c,Pc(function(){a["on"+b]=null})}function hb(a,b,c){var d=new Mc;if("[object NodeList]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(hb(a.item(e),b,c));else a&&d.add(gb(a,b,c));return d}function ib(a,b,c){return new ze(function(d){function e(a,b){j[b]=a;var e;if(g[b]=!0,h||(h=g.every(Gb))){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 Mc(a.subscribe(function(a){e(a,0)},function(a){j[1]?d.onError(a):f=a},function(){i=!0,j[1]&&d.onCompleted()}),b.subscribe(function(a){e(a,1)},function(a){d.onError(a)},function(){i=!0,e(!0,1)}))},a)}function jb(a,b){return a.groupJoin(this,b,Ed,function(a,b){return b})}function kb(a){var b=this;return new ze(function(c){var d=new Ce,e=new Mc,f=new Vc(e);return c.onNext(Gc(d,f)),e.add(b.subscribe(function(a){d.onNext(a)},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),Lb(a)&&(a=Ad(a)),e.add(a.subscribe(function(){d.onCompleted(),d=new Ce,c.onNext(Gc(d,f))},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),f},b)}function lb(a){var b=this;return new ze(function(c){function d(){var b;try{b=a()}catch(f){return void c.onError(f)}Lb(b)&&(b=Ad(b));var i=new Tc;e.setDisposable(i),i.setDisposable(b.take(1).subscribe(Fb,function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),h=new Ce,c.onNext(Gc(h,g)),d()}))}var e=new Uc,f=new Mc(e),g=new Vc(f),h=new Ce;return c.onNext(Gc(h,g)),f.add(b.subscribe(function(a){h.onNext(a)},function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),c.onCompleted()})),d(),g},b)}function mb(b,c){return new nd(function(){return new md(function(){return b()?{done:!1,value:c}:{done:!0,value:a}})})}function nb(a){this.patterns=a}function ob(a,b){this.expression=a,this.selector=b}function pb(a,b,c){var d=a.get(b);if(!d){var e=new xe(b,c);return a.set(b,e),e}return d}function qb(a,b,c){this.joinObserverArray=a,this.onNext=b,this.onCompleted=c,this.joinObservers=new we;for(var d=0,e=this.joinObserverArray.length;e>d;d++){var f=this.joinObserverArray[d];this.joinObservers.set(f,f)}}function rb(a,b){return new ze(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function sb(a,b,c){return new ze(function(d){var e=a,f=Yc(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 tb(a,b){return new ze(function(c){return b.scheduleWithRelative(Yc(a),function(){c.onNext(0),c.onCompleted()})})}function ub(a,b,c){return a===b?new ze(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):Cd(function(){return sb(c.now()+a,b,c)})}function vb(a,b,c){return new ze(function(d){var e,f=!1,g=new Uc,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 Tc,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 Mc(e,g)},a)}function wb(a,b,c){return Cd(function(){return vb(a,b-c.now(),c)})}function xb(a,b){return new ze(function(c){function d(){g&&(g=!1,c.onNext(f)),e&&c.onCompleted()}var e,f,g;return new Mc(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 yb={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},zb=yb[typeof window]&&window||this,Ab=yb[typeof exports]&&exports&&!exports.nodeType&&exports,Bb=yb[typeof module]&&module&&!module.nodeType&&module,Cb=Bb&&Bb.exports===Ab&&Ab,Db=yb[typeof global]&&global;!Db||Db.global!==Db&&Db.window!==Db||(zb=Db);var Eb={internals:{},config:{Promise:zb.Promise},helpers:{}},Fb=Eb.helpers.noop=function(){},Gb=(Eb.helpers.notDefined=function(a){return"undefined"==typeof a},Eb.helpers.identity=function(a){return a}),Hb=(Eb.helpers.pluck=function(a){return function(b){return b[a]}},Eb.helpers.just=function(a){return function(){return a}},Eb.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),Ib=Eb.helpers.defaultComparer=function(a,b){return Cc(a,b)},Jb=Eb.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},Kb=(Eb.helpers.defaultKeySerializer=function(a){return a.toString()},Eb.helpers.defaultError=function(a){throw a}),Lb=Eb.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},Mb=(Eb.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},Eb.helpers.not=function(a){return!a}),Nb=Eb.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==qc.call(a)}),a}();Eb.config.longStackSupport=!1;var Ob=!1;try{throw new Error}catch(Pb){Ob=!!Pb.stack}var Qb,Rb=g(),Sb="From previous event:",Tb=Eb.EmptyError=function(){this.message="Sequence contains no elements.",Error.call(this)};Tb.prototype=Error.prototype;var Ub=Eb.ObjectDisposedError=function(){this.message="Object has been disposed",Error.call(this)};Ub.prototype=Error.prototype;var Vb=Eb.ArgumentOutOfRangeError=function(){this.message="Argument out of range",Error.call(this)};Vb.prototype=Error.prototype;var Wb=Eb.NotSupportedError=function(a){this.message=a||"This operation is not supported",Error.call(this)};Wb.prototype=Error.prototype;var Xb=Eb.NotImplementedError=function(a){this.message=a||"This operation is not implemented",Error.call(this)};Xb.prototype=Error.prototype;var Yb=Eb.helpers.notImplemented=function(){throw new Xb},Zb=Eb.helpers.notSupported=function(){throw new Wb},$b="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";zb.Set&&"function"==typeof(new zb.Set)["@@iterator"]&&($b="@@iterator");var _b=Eb.doneEnumerator={done:!0,value:a},ac=Eb.helpers.isIterable=function(b){return b[$b]!==a},bc=Eb.helpers.isArrayLike=function(b){return b&&b.length!==a};Eb.helpers.iterator=$b;var cc,dc=Eb.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)}},ec=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],fc=ec.length,gc="[object Arguments]",hc="[object Array]",ic="[object Boolean]",jc="[object Date]",kc="[object Error]",lc="[object Function]",mc="[object Number]",nc="[object Object]",oc="[object RegExp]",pc="[object String]",qc=Object.prototype.toString,rc=Object.prototype.hasOwnProperty,sc=qc.call(arguments)==gc,tc=Error.prototype,uc=Object.prototype,vc=String.prototype,wc=uc.propertyIsEnumerable;try{cc=!(qc.call(document)==nc&&!({toString:0}+""))}catch(Pb){cc=!0}var xc={};xc[hc]=xc[jc]=xc[mc]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},xc[ic]=xc[pc]={constructor:!0,toString:!0,valueOf:!0},xc[kc]=xc[lc]=xc[oc]={constructor:!0,toString:!0},xc[nc]={constructor:!0};var yc={};!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);yc.enumErrorProps=wc.call(tc,"message")||wc.call(tc,"name"),yc.enumPrototypes=wc.call(a,"prototype"),yc.nonEnumArgs=0!=c,yc.nonEnumShadows=!/valueOf/.test(b)}(1);var zc=Eb.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},Ac=function(a){return a&&"object"==typeof a?qc.call(a)==gc:!1};sc||(Ac=function(a){return a&&"object"==typeof a?rc.call(a,"callee"):!1});var Bc,Cc=Eb.internals.isEqual=function(a,b){return m(a,b,[],[])},Dc=({}.hasOwnProperty,Array.prototype.slice),Ec=this.inherits=Eb.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},Fc=Eb.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]}},Gc=Eb.internals.addRef=function(a,b){return new ze(function(c){return new Mc(b.getDisposable(),a.subscribe(c))})},Hc={e:{}};Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=Dc.call(arguments,1),d=function(){function e(){}if(this instanceof d){e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(Dc.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(Dc.call(arguments)))};return d}),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c,d;if(null==this)throw new TypeError(" this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=0;f>d;){var g;d in e&&(g=e[d],a.call(c,g,d,e)),d++}});var Ic=Object("a"),Jc="a"!=Ic[0]||!(0 in Ic);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=Jc&&{}.toString.call(this)==pc?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=lc)throw new TypeError(a+" is not a function");for(var f=0;d>f;f++)if(f in c&&!a.call(e,c[f],f,b))return!1;return!0}),Array.prototype.map||(Array.prototype.map=function(a){var b=Object(this),c=Jc&&{}.toString.call(this)==pc?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=lc)throw new TypeError(a+" is not a function");for(var g=0;d>g;g++)g in c&&(e[g]=a.call(f,c[g],g,b));return e}),Array.prototype.filter||(Array.prototype.filter=function(a){for(var b,c=[],d=new Object(this),e=0,f=d.length>>>0;f>e;e++)b=d[e],e in d&&a.call(arguments[1],b,e,d)&&c.push(b);return c}),Array.isArray||(Array.isArray=function(a){return{}.toString.call(a)==hc}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!==d?d=0:0!==d&&1/0!=d&&d!==-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1}),Object.prototype.propertyIsEnumerable||(Object.prototype.propertyIsEnumerable=function(a){for(var b in this)if(b===a)return!0;return!1}),Object.keys||(Object.keys=function(){"use strict";var a=Object.prototype.hasOwnProperty,b=!{toString:null}.propertyIsEnumerable("toString");return function(c){if("object"!=typeof c&&("function"!=typeof c||null===c))throw new TypeError("Object.keys called on non-object");var d,e,f=[];for(d in c)a.call(c,d)&&f.push(d);if(b)for(e=0;fc>e;e++)a.call(c,ec[e])&&f.push(ec[e]);return f}}()),r.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Kc=Eb.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Lc=Kc.prototype;Lc.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Lc.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)}}},Lc.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)}}},Lc.peek=function(){return this.items[0].value},Lc.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},Lc.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Lc.enqueue=function(a){var b=this.length++;this.items[b]=new r(Kc.count++,a),this.percolate(b)},Lc.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Kc.count=0;var Mc=Eb.CompositeDisposable=function(){var a,b,c=[];if(Array.isArray(arguments[0]))c=arguments[0],b=c.length;else for(b=arguments.length,c=new Array(b),a=0;b>a;a++)c[a]=arguments[a];for(a=0;b>a;a++)if(!Rc(c[a]))throw new TypeError("Not a disposable");this.disposables=c,this.isDisposed=!1,this.length=c.length},Nc=Mc.prototype;Nc.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Nc.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},Nc.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 Oc=Eb.Disposable=function(a){this.isDisposed=!1,this.action=a||Fb};Oc.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Pc=Oc.create=function(a){return new Oc(a)},Qc=Oc.empty={dispose:Fb},Rc=Oc.isDisposable=function(a){return a&&Nb(a.dispose)},Sc=Oc.checkDisposed=function(a){if(a.isDisposed)throw new Ub},Tc=Eb.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null};Tc.prototype.getDisposable=function(){return this.current},Tc.prototype.setDisposable=function(a){if(this.current)throw new Error("Disposable has already been assigned");var b=this.isDisposed;!b&&(this.current=a),b&&a&&a.dispose()},Tc.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var Uc=Eb.SerialDisposable=function(){this.isDisposed=!1,this.current=null};Uc.prototype.getDisposable=function(){return this.current},Uc.prototype.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},Uc.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var Vc=Eb.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?Qc:new a(this)},b}();t.prototype.dispose=function(){this.scheduler.scheduleWithState(this,u)};var Wc=Eb.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||Jb,this.disposable=new Tc};Wc.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Wc.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Wc.prototype.isCancelled=function(){return this.disposable.isDisposed},Wc.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Xc=Eb.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(),Qc}a.isScheduler=function(b){return b instanceof a};var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=Hb,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Yc=Xc.normalize,Zc=Xc.isScheduler;!function(a){function b(a,b){function c(b){e(b,function(b){var d=!1,e=!1,g=a.scheduleWithState(b,function(a,b){return d?f.remove(g):e=!0,c(b),Qc});e||(f.add(g),d=!0)})}var d=b[0],e=b[1],f=new Mc;return c(d),f}function c(a,b,c){function d(b){f(b,function(b,e){var f=!1,h=!1,i=a[c](b,e,function(a,b){return f?g.remove(i):h=!0,d(b),Qc});h||(g.add(i),f=!0)})}var e=b[0],f=b[1],g=new Mc;return d(e),g}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState([a,c],b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative([a,d],b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute([a,d],b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Xc.prototype),function(){Xc.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Xc.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof zb.setInterval)throw new Wb;b=Yc(b);var d=a,e=zb.setInterval(function(){d=c(d)},b);return Pc(function(){zb.clearInterval(e)})}}(Xc.prototype),function(a){a.catchError=a["catch"]=function(a){return new hd(this,a)}}(Xc.prototype);var $c,_c,ad=Eb.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 Tc;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),bd=Xc.immediate=function(){function a(a,b){return b(this,a)}return new Xc(Hb,a,Zb,Zb)}(),cd=Xc.currentThread=function(){function a(){for(;c.length>0;){var a=c.dequeue();!a.isCancelled()&&a.invoke()}}function b(b,d){var e=new Wc(this,b,d,this.now());if(c)c.enqueue(e);else{c=new Kc(4),c.enqueue(e);var f=p(a)();if(c=null,f===Hc)return q(f.e)}return e.disposable}var c,d=new Xc(Hb,b,Zb,Zb);return d.scheduleRequired=function(){return!c},d}(),dd=function(){var a,b=Fb;if(zb.setTimeout)a=zb.setTimeout,b=zb.clearTimeout;else{if(!zb.WScript)throw new Wb;a=function(a,b){zb.WScript.Sleep(b),a()}}return{setTimeout:a,clearTimeout:b}}(),ed=dd.setTimeout,fd=dd.clearTimeout;!function(){function a(b){if(f)ed(function(){a(b)},0);else{var c=e[b];if(c){f=!0;var d=p(c)();if(_c(b),f=!1,d===Hc)return q(d.e)}}}function b(){if(!zb.postMessage||zb.importScripts)return!1;var a=!1,b=zb.onmessage;return zb.onmessage=function(){a=!0},zb.postMessage("","*"),zb.onmessage=b,a}function c(b){"string"==typeof b.data&&b.data.substring(0,i.length)===i&&a(b.data.substring(i.length))}var d=1,e={},f=!1;_c=function(a){delete e[a]};var g=RegExp("^"+String(qc).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),h="function"==typeof(h=Db&&Cb&&Db.setImmediate)&&!g.test(h)&&h;if(Nb(h))$c=function(b){var c=d++;return e[c]=b,h(function(){a(c)}),c};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))$c=function(b){var c=d++;return e[c]=b,process.nextTick(function(){a(c)}),c};else if(b()){var i="ms.rx.schedule"+Math.random();zb.addEventListener?zb.addEventListener("message",c,!1):zb.attachEvent?zb.attachEvent("onmessage",c):zb.onmessage=c,$c=function(a){var b=d++;return e[b]=a,zb.postMessage(i+currentId,"*"),b}}else if(zb.MessageChannel){var j=new zb.MessageChannel;j.port1.onmessage=function(b){a(b.data)},$c=function(a){var b=d++;return e[b]=a,j.port2.postMessage(b),b}}else $c="document"in zb&&"onreadystatechange"in zb.document.createElement("script")?function(b){var c=zb.document.createElement("script"),f=d++;return e[f]=b,c.onreadystatechange=function(){a(f),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},zb.document.documentElement.appendChild(c),f}:function(b){var c=d++;return e[c]=b,ed(function(){a(c)},0),c}}();var gd=Xc.timeout=Xc["default"]=function(){function a(a,b){var c=this,d=new Tc,e=$c(function(){!d.isDisposed&&d.setDisposable(b(c,a))});return new Mc(d,Pc(function(){_c(e)}))}function b(a,b,c){var d=this,e=Xc.normalize(b),f=new Tc;if(0===e)return d.scheduleWithState(a,c);var g=ed(function(){!f.isDisposed&&f.setDisposable(c(d,a))},e);return new Mc(f,Pc(function(){fd(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Xc(Hb,a,b,c)}(),hd=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 Ec(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 Qc}}},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 Tc;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}(Xc),id=Eb.Notification=function(){function a(a,b,c,d,e,f){this.kind=a,this.value=b,this.exception=c,this._accept=d,this._acceptObservable=e,this.toString=f}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return Zc(a)||(a=bd),new ze(function(c){return a.scheduleWithState(b,function(a,b){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),jd=id.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){return new id("N",d,null,a,b,c)}}(),kd=id.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){return new id("E",null,d,a,b,c)}}(),ld=id.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){return new id("C",null,null,a,b,c)}}(),md=Eb.internals.Enumerator=function(a){this._next=a};md.prototype.next=function(){return this._next()},md.prototype[$b]=function(){return this};var nd=Eb.internals.Enumerable=function(a){this._iterator=a};nd.prototype[$b]=function(){return this._iterator()},nd.prototype.concat=function(){var a=this;
3
+ return new ze(function(b){var c,d=a[$b](),e=new Uc,f=bd.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;Lb(h)&&(h=Ad(h));var i=new Tc;e.setDisposable(i),i.setDisposable(h.subscribe(function(a){b.onNext(a)},function(a){b.onError(a)},a))}});return new Mc(e,f,Pc(function(){c=!0}))})},nd.prototype.catchError=function(){var a=this;return new ze(function(b){var c,d=a[$b](),e=new Uc,f=bd.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;Lb(i)&&(i=Ad(i));var j=new Tc;e.setDisposable(j),j.setDisposable(i.subscribe(function(a){b.onNext(a)},f,function(){b.onCompleted()}))}});return new Mc(e,f,Pc(function(){c=!0}))})},nd.prototype.catchErrorWhen=function(a){var b=this;return new ze(function(c){var d,e,f=new Ce,g=new Ce,h=a(f),i=h.subscribe(g),j=b[$b](),k=new Uc,l=bd.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;Lb(i)&&(i=Ad(i));var l=new Tc,m=new Tc;k.setDisposable(new Mc(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 Mc(i,k,l,Pc(function(){d=!0}))})};var od=nd.repeat=function(a,b){return null==b&&(b=-1),new nd(function(){var c=b;return new md(function(){return 0===c?_b:(c>0&&c--,{done:!1,value:a})})})},pd=nd.of=function(a,b,c){if(b)var d=dc(b,c,3);return new nd(function(){var c=-1;return new md(function(){return++c<a.length?{done:!1,value:b?d(a[c],c,a):a[c]}:_b})})},qd=Eb.Observer=function(){};qd.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},qd.prototype.asObserver=function(){return new ud(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},qd.prototype.checked=function(){return new vd(this)};var rd=qd.create=function(a,b,c){return a||(a=Fb),b||(b=Kb),c||(c=Fb),new ud(a,b,c)};qd.fromNotifier=function(a,b){return new ud(function(c){return a.call(b,jd(c))},function(c){return a.call(b,kd(c))},function(){return a.call(b,ld())})},qd.prototype.notifyOn=function(a){return new xd(a,this)},qd.prototype.makeSafe=function(a){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,a)};var sd,td=Eb.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return Ec(b,a),b.prototype.next=Yb,b.prototype.error=Yb,b.prototype.completed=Yb,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}(qd),ud=Eb.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Ec(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}(td),vd=function(a){function b(b){a.call(this),this._observer=b,this._state=0}Ec(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();var b=p(this._observer.onNext).call(this._observer,a);this._state=0,b===Hc&&q(b.e)},c.onError=function(a){this.checkAccess();var b=p(this._observer.onError).call(this._observer,a);this._state=2,b===Hc&&q(b.e)},c.onCompleted=function(){this.checkAccess();var a=p(this._observer.onCompleted).call(this._observer);this._state=2,a===Hc&&q(a.e)},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(qd),wd=Eb.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 Uc}return Ec(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}(td),xd=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return Ec(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}(wd),yd=Eb.Observable=function(){function a(a){if(Eb.config.longStackSupport&&Ob){try{throw new Error}catch(b){this.stack=b.stack.substring(b.stack.indexOf("\n")+1)}var d=this;this._subscribe=function(b){var e=b.onError.bind(b);return b.onError=function(a){c(a,d),e(a)},a.call(d,b)}}else this._subscribe=a}return sd=a.prototype,sd.subscribe=sd.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:rd(a,b,c))},sd.subscribeOnNext=function(a,b){return this._subscribe(rd("undefined"!=typeof b?function(c){a.call(b,c)}:a))},sd.subscribeOnError=function(a,b){return this._subscribe(rd(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},sd.subscribeOnCompleted=function(a,b){return this._subscribe(rd(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},a}(),zd=Eb.ObservableBase=function(a){function b(a){return a&&Nb(a.dispose)?a:Nb(a)?Pc(a):Qc}function c(a,c){var d=c[0],e=c[1],f=p(e.subscribeCore).call(e,d);return f!==Hc||d.fail(Hc.e)?void d.setDisposable(b(f)):q(Hc.e)}function d(a){var b=new Ae(a),d=[b,this];return cd.scheduleRequired()?cd.scheduleWithState(d,c):c(null,d),b}function e(){a.call(this,d)}return Ec(e,a),e.prototype.subscribeCore=Yb,e}(yd);sd.observeOn=function(a){var b=this;return new ze(function(c){return b.subscribe(new xd(a,c))},b)},sd.subscribeOn=function(a){var b=this;return new ze(function(c){var d=new Tc,e=new Uc;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new t(a,b.subscribe(c)))})),e},b)};var Ad=yd.fromPromise=function(a){return Cd(function(){var b=new Eb.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};sd.toPromise=function(a){if(a||(a=Eb.config.Promise),!a)throw new Wb("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 Bd=function(a){function b(b){this.source=b,a.call(this)}return Ec(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new v(a))},b}(zd);v.prototype.onNext=function(a){this.isStopped||this.a.push(a)},v.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},v.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onNext(this.a),this.observer.onCompleted())},v.prototype.dispose=function(){this.isStopped=!0},v.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},sd.toArray=function(){return new Bd(this)},yd.create=yd.createWithDisposable=function(a,b){return new ze(a,b)};var Cd=yd.defer=function(a){return new ze(function(b){var c;try{c=a()}catch(d){return Td(d).subscribe(b)}return Lb(c)&&(c=Ad(c)),c.subscribe(b)})},Dd=function(a){function b(b){this.scheduler=b,a.call(this)}function c(a,b){this.observer=a,this.parent=b}function d(a,b){b.onCompleted()}return Ec(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.parent.scheduler.scheduleWithState(this.observer,d)},b}(zd),Ed=yd.empty=function(a){return Zc(a)||(a=bd),new Dd(a)},Fd=function(a){function b(b,c,d){this.iterable=b,this.mapper=c,this.scheduler=d,a.call(this)}return Ec(b,a),b.prototype.subscribeCore=function(a){var b=new Gd(a,this);return b.run()},b}(zd),Gd=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=B(b),d=this.observer,e=this.parent.mapper;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}(),Hd=Math.pow(2,53)-1;w.prototype[$b]=function(){return new x(this._s)},x.prototype[$b]=function(){return this},x.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:_b},y.prototype[$b]=function(){return new z(this._a)},z.prototype[$b]=function(){return this},z.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:_b};var Id=yd.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!Nb(b))throw new Error("mapFn when provided must be a function");if(b)var e=dc(b,c,2);return Zc(d)||(d=cd),new Fd(a,e,d)},Jd=function(a){function b(b,c){this.args=b,this.scheduler=c,a.call(this)}return Ec(b,a),b.prototype.subscribeCore=function(a){var b=new E(a,this);return b.run()},b}(zd);E.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 Kd=yd.fromArray=function(a,b){return Zc(b)||(b=cd),new Jd(a,b)};yd.generate=function(a,b,c,d,e){return Zc(e)||(e=cd),new ze(function(f){var g=!0;return e.scheduleRecursiveWithState(a,function(a,e){var h,i;try{g?g=!1:a=c(a),h=b(a),h&&(i=d(a))}catch(j){return f.onError(j)}h?(f.onNext(i),e(a)):f.onCompleted()})})},yd.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new Jd(b,cd)},yd.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 Jd(c,a)};var Ld=function(a){function b(){a.call(this)}return Ec(b,a),b.prototype.subscribeCore=function(){return Qc},b}(zd),Md=yd.never=function(){return new Ld},Nd=function(a){function b(b,c){this.obj=b,this.keys=Object.keys(b),this.scheduler=c,a.call(this)}return Ec(b,a),b.prototype.subscribeCore=function(a){var b=new G(a,this);return b.run()},b}(zd);G.prototype.run=function(){function a(a,f){if(e>a){var g=d[a];b.onNext([g,c[g]]),f(a+1)}else b.onCompleted()}var b=this.observer,c=this.parent.obj,d=this.parent.keys,e=d.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},yd.pairs=function(a,b){return b||(b=cd),new Nd(a,b)};var Od=function(a){function b(b,c,d){this.start=b,this.count=c,this.scheduler=d,a.call(this)}return Ec(b,a),b.prototype.subscribeCore=function(a){var b=new Pd(a,this);return b.run()},b}(zd),Pd=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}();yd.range=function(a,b,c){return Zc(c)||(c=cd),new Od(a,b,c)};var Qd=function(a){function b(b,c,d){this.value=b,this.repeatCount=null==c?-1:c,this.scheduler=d,a.call(this)}return Ec(b,a),b.prototype.subscribeCore=function(a){var b=new H(a,this);return b.run()},b}(zd);H.prototype.run=function(){function a(a,d){return(-1===a||a>0)&&(b.onNext(c),a>0&&a--),0===a?b.onCompleted():void d(a)}var b=this.observer,c=this.parent.value;return this.parent.scheduler.scheduleRecursiveWithState(this.parent.repeatCount,a)},yd.repeat=function(a,b,c){return Zc(c)||(c=cd),new Qd(a,b,c)};var Rd=function(a){function b(b,c){this.value=b,this.scheduler=c,a.call(this)}function c(a,b){this.observer=a,this.parent=b}function d(a,b){var c=b[0],d=b[1];d.onNext(c),d.onCompleted()}return Ec(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.parent.scheduler.scheduleWithState([this.parent.value,this.observer],d)},b}(zd),Sd=(yd["return"]=yd.just=yd.returnValue=function(a,b){return Zc(b)||(b=bd),new Rd(a,b)},function(a){function b(b,c){this.error=b,this.scheduler=c,a.call(this)}function c(a,b){this.observer=a,this.parent=b}function d(a,b){var c=b[0],d=b[1];d.onError(c)}return Ec(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.parent.scheduler.scheduleWithState([this.parent.error,this.observer],d)},b}(zd)),Td=yd["throw"]=yd.throwError=yd.throwException=function(a,b){return Zc(b)||(b=bd),new Sd(a,b)};yd.using=function(a,b){return new ze(function(c){var d,e,f=Qc;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new Mc(Td(g).subscribe(c),f)}return new Mc(e.subscribe(c),f)})},sd.amb=function(a){var b=this;return new ze(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new Tc,j=new Tc;return Lb(a)&&(a=Ad(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 Mc(i,j)})},yd.amb=function(){function a(a,b){return a.amb(b)}var b=Md(),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},sd["catch"]=sd.catchError=sd.catchException=function(a){return"function"==typeof a?I(this,a):Ud([this,a])};var Ud=yd.catchError=yd["catch"]=yd.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 pd(a).catchError()};sd.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),Vd.apply(this,b)};var Vd=yd.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop();return Array.isArray(b[0])&&(b=b[0]),new ze(function(a){function c(b){if(h[b]=!0,i||(i=h.every(Gb))){try{var c=d.apply(null,k)}catch(e){return a.onError(e)}a.onNext(c)}else j.filter(function(a,c){return c!==b}).every(Gb)&&a.onCompleted()}function e(b){j[b]=!0,j.every(Gb)&&a.onCompleted()}for(var f=b.length,g=function(){return!1},h=n(f,g),i=!1,j=n(f,g),k=new Array(f),l=new Array(f),m=0;f>m;m++)!function(d){var f=b[d],g=new Tc;Lb(f)&&(f=Ad(f)),g.setDisposable(f.subscribe(function(a){k[d]=a,c(d)},function(b){a.onError(b)},function(){e(d)})),l[d]=g}(m);return new Mc(l)},this)};sd.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),Wd.apply(null,a)};var Wd=yd.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 pd(a).concat()};sd.concatAll=sd.concatObservable=function(){return this.merge(1)};var Xd=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return Ec(b,a),b.prototype.subscribeCore=function(a){var b=new Mc;return b.add(this.source.subscribe(new Yd(a,this.maxConcurrent,b))),b},b}(zd),Yd=function(){function a(a,b,c){this.o=a,this.max=b,this.g=c,this.done=!1,this.q=[],this.activeCount=0,this.isStopped=!1}function b(a,b){this.parent=a,this.sad=b,this.isStopped=!1}return a.prototype.handleSubscribe=function(a){var c=new Tc;this.g.add(c),Lb(a)&&(a=Ad(a)),c.setDisposable(a.subscribe(new b(this,c)))},a.prototype.onNext=function(a){this.isStopped||(this.activeCount<this.max?(this.activeCount++,this.handleSubscribe(a)):this.q.push(a))},a.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},a.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,0===this.activeCount&&this.o.onCompleted())},a.prototype.dispose=function(){this.isStopped=!0},a.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},b.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var a=this.parent;a.g.remove(this.sad),a.q.length>0?a.handleSubscribe(a.q.shift()):(a.activeCount--,a.done&&0===a.activeCount&&a.o.onCompleted())}},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},a}();sd.merge=function(a){return"number"!=typeof a?Zd(this,a):new Xd(this,a)};var Zd=yd.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(Zc(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=bd,b=0;d>b;b++)c.push(arguments[b]);else for(a=bd,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),F(a,c).mergeAll()},$d=function(a){function b(b){this.source=b,a.call(this)}return Ec(b,a),b.prototype.subscribeCore=function(a){var b=new Mc,c=new Tc;return b.add(c),c.setDisposable(this.source.subscribe(new _d(a,b))),b},b}(zd),_d=function(){function a(a,b){this.o=a,this.g=b,this.isStopped=!1,this.done=!1}function b(a,b,c){this.parent=a,this.g=b,this.sad=c,this.isStopped=!1}return a.prototype.onNext=function(a){if(!this.isStopped){var c=new Tc;this.g.add(c),Lb(a)&&(a=Ad(a)),c.setDisposable(a.subscribe(new b(this,this.g,c)))}},a.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},a.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,1===this.g.length&&this.o.onCompleted())},a.prototype.dispose=function(){this.isStopped=!0},a.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},b.prototype.onCompleted=function(){if(!this.isStopped){var a=this.parent;this.isStopped=!0,a.g.remove(this.sad),a.done&&1===a.g.length&&a.o.onCompleted()}},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},a}();sd.mergeAll=sd.mergeObservable=function(){return new $d(this)};var ae=Eb.CompositeError=function(a){this.name="NotImplementedError",this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};ae.prototype=Error.prototype,yd.mergeDelayError=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}var d=F(null,a);return new ze(function(a){function b(){0===g.length?a.onCompleted():a.onError(1===g.length?g[0]:new ae(g))}var c=new Mc,e=new Tc,f=!1,g=[];return c.add(e),e.setDisposable(d.subscribe(function(d){var e=new Tc;c.add(e),Lb(d)&&(d=Ad(d)),e.setDisposable(d.subscribe(function(b){a.onNext(b)},function(a){g.push(a),c.remove(e),f&&1===c.length&&b()},function(){c.remove(e),f&&1===c.length&&b()}))},function(a){g.push(a),f=!0,1===c.length&&b()},function(){f=!0,1===c.length&&b()})),c})},sd.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return be([this,a])};var be=yd.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 ze(function(b){var c=0,d=new Uc,e=bd.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],Lb(f)&&(f=Ad(f)),g=new Tc,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new Mc(d,e)})};sd.skipUntil=function(a){var b=this;return new ze(function(c){var d=!1,e=new Mc(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));Lb(a)&&(a=Ad(a));var f=new Tc;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)},sd["switch"]=sd.switchLatest=function(){var a=this;return new ze(function(b){var c=!1,d=new Uc,e=!1,f=0,g=a.subscribe(function(a){var g=new Tc,h=++f;c=!0,d.setDisposable(g),Lb(a)&&(a=Ad(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 Mc(g,d)},a)},sd.takeUntil=function(a){var b=this;return new ze(function(c){return Lb(a)&&(a=Ad(a)),new Mc(b.subscribe(c),a.subscribe(function(){c.onCompleted()},function(a){c.onError(a)},Fb))},b)},sd.withLatestFrom=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop(),e=this;if("undefined"==typeof e)throw new Error("Source observable not found for withLatestFrom().");if("function"!=typeof d)throw new Error("withLatestFrom() expects a resultSelector function.");return Array.isArray(b[0])&&(b=b[0]),new ze(function(a){for(var c=function(){return!1},f=b.length,g=n(f,c),h=!1,i=new Array(f),j=new Array(f+1),k=0;f>k;k++)!function(c){var d=b[c],e=new Tc;Lb(d)&&(d=Ad(d)),e.setDisposable(d.subscribe(function(a){i[c]=a,g[c]=!0,h=g.every(Gb)},a.onError.bind(a),function(){})),j[c]=e}(k);var l=new Tc;return l.setDisposable(e.subscribe(function(b){var c,e=[b].concat(i);if(h){try{c=d.apply(null,e)}catch(f){return void a.onError(f)}a.onNext(c)}},a.onError.bind(a),function(){a.onCompleted()})),j[f]=l,new Mc(j)},this)},sd.zip=function(){if(Array.isArray(arguments[0]))return J.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 ze(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(Gb)&&a.onCompleted()}function f(b){i[b]=!0,i.every(function(a){return a})&&a.onCompleted()}for(var g=b.length,h=n(g,L),i=n(g,K),j=new Array(g),k=0;g>k;k++)!function(d){var e=b[d],g=new Tc;Lb(e)&&(e=Ad(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 Mc(j)},d)},yd.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)},yd.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 ze(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(Gb))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(Gb)?void b.onCompleted():void 0}for(var e=a.length,f=n(e,function(){return[]}),g=n(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Tc,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 Mc(h)})},sd.asObservable=function(){var a=this;return new ze(function(b){return a.subscribe(b)},this)},sd.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})},sd.dematerialize=function(){var a=this;return new ze(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)},sd.distinctUntilChanged=function(a,b){var c=this;return b||(b=Ib),new ze(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)},sd["do"]=sd.tap=sd.doAction=function(a,b,c){var d=this;return new ze(function(e){var f=!a||Nb(a)?rd(a||Fb,b||Fb,c||Fb):a;return d.subscribe(function(a){try{f.onNext(a)}catch(b){e.onError(b)}e.onNext(a)},function(a){try{f.onError(a)}catch(b){e.onError(b)}e.onError(a)},function(){try{f.onCompleted()}catch(a){e.onError(a)}e.onCompleted()})},this)},sd.doOnNext=sd.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},sd.doOnError=sd.tapOnError=function(a,b){return this.tap(Fb,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},sd.doOnCompleted=sd.tapOnCompleted=function(a,b){return this.tap(Fb,null,"undefined"!=typeof b?function(){a.call(b)}:a)},sd["finally"]=sd.ensure=function(a){var b=this;return new ze(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Pc(function(){try{d.dispose()}catch(b){throw b}finally{a()}})},this)},sd.finallyAction=function(a){return this.ensure(a)},sd.ignoreElements=function(){var a=this;return new ze(function(b){return a.subscribe(Fb,function(a){b.onError(a)},function(){b.onCompleted()})},a)},sd.materialize=function(){var a=this;return new ze(function(b){return a.subscribe(function(a){b.onNext(jd(a))},function(a){b.onNext(kd(a)),b.onCompleted()},function(){b.onNext(ld()),b.onCompleted()})},a)},sd.repeat=function(a){return od(this,a).concat()},sd.retry=function(a){return od(this,a).catchError()},sd.retryWhen=function(a){return od(this).catchErrorWhen(a)},sd.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 ze(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)},sd.skipLast=function(a){if(0>a)throw new Vb;var b=this;return new ze(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)},sd.startWith=function(){var a,b=0;arguments.length&&Zc(arguments[0])?(a=arguments[0],b=1):a=bd;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return pd([Kd(c,a),this]).concat()},sd.takeLast=function(a){if(0>a)throw new Vb;var b=this;return new ze(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)},sd.takeLastBuffer=function(a){var b=this;return new ze(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)},sd.windowWithCount=function(a,b){var c=this;if(+a||(a=0),1/0===Math.abs(a)&&(a=0),0>=a)throw new Vb;if(null==b&&(b=a),+b||(b=0),1/0===Math.abs(b)&&(b=0),0>=b)throw new Vb;return new ze(function(d){function e(){var a=new Ce;i.push(a),d.onNext(Gc(a,g))}var f=new Tc,g=new Vc(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)},sd.selectConcat=sd.concatMap=function(a,b,c){return Nb(a)&&Nb(b)?this.concatMap(function(c,d){var e=a(c,d);return Lb(e)&&(e=Ad(e)),(bc(e)||ac(e))&&(e=Id(e)),e.map(function(a,e){return b(c,a,d,e)})}):Nb(a)?M(this,a,c):M(this,function(){return a})},sd.concatMapObserver=sd.selectConcatObserver=function(a,b,c,d){var e=this,f=dc(a,d,2),g=dc(b,d,1),h=dc(c,d,0);return new ze(function(a){var b=0;return e.subscribe(function(c){var d;try{d=f(c,b++)}catch(e){return void a.onError(e)}Lb(d)&&(d=Ad(d)),a.onNext(d)},function(b){var c;try{c=g(b)}catch(d){return void a.onError(d)}Lb(c)&&(c=Ad(c)),a.onNext(c),a.onCompleted()},function(){var b;try{b=h()}catch(c){return void a.onError(c)}Lb(b)&&(b=Ad(b)),a.onNext(b),a.onCompleted()})},this).concatAll()},sd.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new ze(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)},O.prototype.push=function(a){var b=-1===N(this.set,a,this.comparer);return b&&this.set.push(a),b},sd.distinct=function(a,b){var c=this;return b||(b=Ib),new ze(function(d){var e=new O(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)},sd.groupBy=function(a,b,c){return this.groupByUntil(a,b,Md,c)},sd.groupByUntil=function(a,b,c,d){var e=this;return b||(b=Gb),d||(d=Ib),new ze(function(f){function g(a){return function(b){b.onError(a)}}var h=new te(0,d),i=new Mc,j=new Vc(i);return i.add(e.subscribe(function(d){var e;try{e=a(d)}catch(k){return h.getValues().forEach(g(k)),void f.onError(k)}var l=!1,m=h.tryGetValue(e);if(m||(m=new Ce,h.set(e,m),l=!0),l){var n=new Be(e,m,j),o=new Be(e,m);try{duration=c(o)}catch(k){return h.getValues().forEach(g(k)),void f.onError(k)}f.onNext(n);var p=new Tc;i.add(p);var q=function(){h.remove(e)&&m.onCompleted(),i.remove(p)};p.setDisposable(duration.take(1).subscribe(Fb,function(a){h.getValues().forEach(g(a)),f.onError(a)},q))}var r;try{r=b(d)}catch(k){return h.getValues().forEach(g(k)),void f.onError(k)}m.onNext(r)},function(a){h.getValues().forEach(g(a)),f.onError(a)},function(){h.getValues().forEach(function(a){a.onCompleted()}),f.onCompleted()})),j},e)};var ce=function(a){function b(b,c,d){this.source=b,this.selector=dc(c,d,3),a.call(this)}return Ec(b,a),b.prototype.internalMap=function(a,c){var d=this;return new b(this.source,function(b,c,e){return a.call(this,d.selector(b,c,e),c,e)},c)},b.prototype.subscribeCore=function(a){return this.source.subscribe(new P(a,this.selector,this))},b}(zd);P.prototype.onNext=function(a){if(!this.isStopped){var b=p(this.selector).call(this,a,this.i++,this.source);return b===Hc?this.observer.onError(b.e):void this.observer.onNext(b)}},P.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},P.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onCompleted())},P.prototype.dispose=function(){this.isStopped=!0},P.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},sd.map=sd.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof ce?this.internalMap(c,b):new ce(this,c,b)},sd.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})},sd.selectMany=sd.flatMap=function(a,b,c){return Nb(a)&&Nb(b)?this.flatMap(function(c,d){var e=a(c,d);return Lb(e)&&(e=Ad(e)),(bc(e)||ac(e))&&(e=Id(e)),e.map(function(a,e){return b(c,a,d,e)})},c):Nb(a)?Q(this,a,c):Q(this,function(){return a})},sd.flatMapObserver=sd.selectManyObserver=function(a,b,c,d){var e=this;return new ze(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)}Lb(c)&&(c=Ad(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}Lb(c)&&(c=Ad(c)),f.onNext(c),f.onCompleted()
4
+ },function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}Lb(a)&&(a=Ad(a)),f.onNext(a),f.onCompleted()})},e).mergeAll()},sd.selectSwitch=sd.flatMapLatest=sd.switchMap=function(a,b){return this.select(a,b).switchLatest()},sd.skip=function(a){if(0>a)throw new Vb;var b=this;return new ze(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)},sd.skipWhile=function(a,b){var c=this,d=dc(a,b,3);return new ze(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)},sd.take=function(a,b){if(0>a)throw new Vb;if(0===a)return Ed(b);var c=this;return new ze(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)},sd.takeWhile=function(a,b){var c=this,d=dc(a,b,3);return new ze(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 de=function(a){function b(b,c,d){this.source=b,this.predicate=dc(c,d,3),a.call(this)}return Ec(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new R(a,this.predicate,this))},b.prototype.internalFilter=function(a,c){var d=this;return new b(this.source,function(b,c,e){return d.predicate(b,c,e)&&a.call(this,b,c,e)},c)},b}(zd);R.prototype.onNext=function(a){if(!this.isStopped){var b=p(this.predicate).call(this,a,this.i++,this.source);return b===Hc?this.observer.onError(b.e):void(b&&this.observer.onNext(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.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)},sd.filter=sd.where=function(a,b){return this instanceof de?this.internalFilter(a,b):new de(this,a,b)},sd.aggregate=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,b=arguments[0],a=arguments[1]):a=arguments[0],new ze(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=a(g,d):(g=c?a(b,d):d,f=!0)}catch(i){return e.onError(i)}},function(a){e.onError(a)},function(){h&&e.onNext(g),!h&&c&&e.onNext(b),!h&&!c&&e.onError(new Tb),e.onCompleted()})},d)},sd.reduce=function(a){var b,c=!1,d=this;return 2===arguments.length&&(c=!0,b=arguments[1]),new ze(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=a(g,d):(g=c?a(b,d):d,f=!0)}catch(i){return e.onError(i)}},function(a){e.onError(a)},function(){h&&e.onNext(g),!h&&c&&e.onNext(b),!h&&!c&&e.onError(new Tb),e.onCompleted()})},d)},sd.some=function(a,b){var c=this;return a?c.filter(a,b).some():new ze(function(a){return c.subscribe(function(){a.onNext(!0),a.onCompleted()},function(b){a.onError(b)},function(){a.onNext(!1),a.onCompleted()})},c)},sd.any=function(){return this.some.apply(this,arguments)},sd.isEmpty=function(){return this.any().map(Mb)},sd.every=function(a,b){return this.filter(function(b){return!a(b)},b).some().map(Mb)},sd.all=function(){return this.every.apply(this,arguments)},sd.includes=function(a,b){function c(a,b){return 0===a&&0===b||a===b||isNaN(a)&&isNaN(b)}var d=this;return new ze(function(e){var f=0,g=+b||0;return 1/0===Math.abs(g)&&(g=0),0>g?(e.onNext(!1),e.onCompleted(),Qc):d.subscribe(function(b){f++>=g&&c(b,a)&&(e.onNext(!0),e.onCompleted())},function(a){e.onError(a)},function(){e.onNext(!1),e.onCompleted()})},this)},sd.contains=function(a,b){sd.includes(a,b)},sd.count=function(a,b){return a?this.filter(a,b).count():this.reduce(function(a){return a+1},0)},sd.indexOf=function(a,b){var c=this;return new ze(function(d){var e=0,f=+b||0;return 1/0===Math.abs(f)&&(f=0),0>f?(d.onNext(-1),d.onCompleted(),Qc):c.subscribe(function(b){e>=f&&b===a&&(d.onNext(e),d.onCompleted()),e++},function(a){d.onError(a)},function(){d.onNext(-1),d.onCompleted()})},c)},sd.sum=function(a,b){return a&&Nb(a)?this.map(a,b).sum():this.reduce(function(a,b){return a+b},0)},sd.minBy=function(a,b){return b||(b=Jb),S(this,a,function(a,c){return-1*b(a,c)})},sd.min=function(a){return this.minBy(Gb,a).map(function(a){return T(a)})},sd.maxBy=function(a,b){return b||(b=Jb),S(this,a,b)},sd.max=function(a){return this.maxBy(Gb,a).map(function(a){return T(a)})},sd.average=function(a,b){return a&&Nb(a)?this.map(a,b).average():this.reduce(function(a,b){return{sum:a.sum+b,count:a.count+1}},{sum:0,count:0}).map(function(a){if(0===a.count)throw new Tb;return a.sum/a.count})},sd.sequenceEqual=function(a,b){var c=this;return b||(b=Ib),new ze(function(d){var e=!1,f=!1,g=[],h=[],i=c.subscribe(function(a){var c,e;if(h.length>0){e=h.shift();try{c=b(e,a)}catch(i){return void d.onError(i)}c||(d.onNext(!1),d.onCompleted())}else f?(d.onNext(!1),d.onCompleted()):g.push(a)},function(a){d.onError(a)},function(){e=!0,0===g.length&&(h.length>0?(d.onNext(!1),d.onCompleted()):f&&(d.onNext(!0),d.onCompleted()))});(bc(a)||ac(a))&&(a=Id(a)),Lb(a)&&(a=Ad(a));var j=a.subscribe(function(a){var c;if(g.length>0){var f=g.shift();try{c=b(f,a)}catch(i){return void d.onError(i)}c||(d.onNext(!1),d.onCompleted())}else e?(d.onNext(!1),d.onCompleted()):h.push(a)},function(a){d.onError(a)},function(){f=!0,0===h.length&&(g.length>0?(d.onNext(!1),d.onCompleted()):e&&(d.onNext(!0),d.onCompleted()))});return new Mc(i,j)},c)},sd.elementAt=function(a){return U(this,a,!1)},sd.elementAtOrDefault=function(a,b){return U(this,a,!0,b)},sd.single=function(a,b){return a&&Nb(a)?this.where(a,b).single():V(this,!1)},sd.singleOrDefault=function(a,b,c){return a&&Nb(a)?this.filter(a,c).singleOrDefault(null,b):V(this,!0,b)},sd.first=function(a,b){return a?this.where(a,b).first():W(this,!1)},sd.firstOrDefault=function(a,b){return a?this.where(a).firstOrDefault(null,b):W(this,!0,b)},sd.last=function(a,b){return a?this.where(a,b).last():X(this,!1)},sd.lastOrDefault=function(a,b,c){return a?this.where(a,c).lastOrDefault(null,b):X(this,!0,b)},sd.find=function(a,b){return Y(this,a,b,!1)},sd.findIndex=function(a,b){return Y(this,a,b,!0)},sd.toSet=function(){if("undefined"==typeof zb.Set)throw new TypeError;var a=this;return new ze(function(b){var c=new zb.Set;return a.subscribe(function(a){c.add(a)},function(a){b.onError(a)},function(){b.onNext(c),b.onCompleted()})},a)},sd.toMap=function(a,b){if("undefined"==typeof zb.Map)throw new TypeError;var c=this;return new ze(function(d){var e=new zb.Map;return c.subscribe(function(c){var f;try{f=a(c)}catch(g){return void d.onError(g)}var h=c;if(b)try{h=b(c)}catch(g){return void d.onError(g)}e.set(f,h)},function(a){d.onError(a)},function(){d.onNext(e),d.onCompleted()})},c)};var ee="function",fe="throw",zc=Eb.internals.isObject,ge=Eb.spawn=function(a){var b=cb(a);return function(c){function d(a,b){gd.schedule(c.bind(f,a,b))}function e(a,b){var c;if(arguments.length>2)for(var b=[],h=1,i=arguments.length;i>h;h++)b.push(arguments[h]);if(a)try{c=g[fe](a)}catch(j){return d(j)}if(!a)try{c=g.next(b)}catch(j){return d(j)}if(c.done)return d(null,c.value);if(c.value=Z(c.value,f),typeof c.value!==ee)e(new TypeError("Rx.spawn only supports a function, Promise, Observable, Object or Array."));else{var k=!1;try{c.value.call(f,function(){k||(k=!0,e.apply(f,arguments))})}catch(j){gd.schedule(function(){k||(k=!0,e.call(f,j))})}}}var f=this,g=a;if(b){for(var h=[],i=0,j=arguments.length;j>i;i++)h.push(arguments[i]);var j=h.length,k=j&&typeof h[j-1]===ee;c=k?h.pop():eb,g=a.apply(this,h)}else c=c||eb;e()}};yd.start=function(a,b,c){return he(a,b,c)()};var he=yd.toAsync=function(a,b,c){return Zc(c)||(c=gd),function(){var d=arguments,e=new De;return c.schedule(function(){var c;try{c=a.apply(b,d)}catch(f){return void e.onError(f)}e.onNext(c),e.onCompleted()}),e.asObservable()}};yd.fromCallback=function(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return new ze(function(d){function f(){for(var a=arguments.length,e=new Array(a),f=0;a>f;f++)e[f]=arguments[f];if(c){try{e=c.apply(b,e)}catch(g){return d.onError(g)}d.onNext(e)}else e.length<=1?d.onNext.apply(d,e):d.onNext(e);d.onCompleted()}e.push(f),a.apply(b,e)}).publishLast().refCount()}},yd.fromNodeCallback=function(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return new ze(function(d){function f(a){if(a)return void d.onError(a);for(var e=arguments.length,f=[],g=1;e>g;g++)f[g-1]=arguments[g];if(c){try{f=c.apply(b,f)}catch(h){return d.onError(h)}d.onNext(f)}else f.length<=1?d.onNext.apply(d,f):d.onNext(f);d.onCompleted()}e.push(f),a.apply(b,e)}).publishLast().refCount()}},Eb.config.useNativeEvents=!1,yd.fromEvent=function(a,b,c){return a.addListener?ie(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c):Eb.config.useNativeEvents||"function"!=typeof a.on||"function"!=typeof a.off?new ze(function(d){return hb(a,b,function(a){var b=a;if(c)try{b=c(arguments)}catch(e){return d.onError(e)}d.onNext(b)})}).publish().refCount():ie(function(c){a.on(b,c)},function(c){a.off(b,c)},c)};var ie=yd.fromEventPattern=function(a,b,c){return new ze(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return d.onError(e)}d.onNext(b)}var f=a(e);return Pc(function(){b&&b(e,f)})}).publish().refCount()};yd.startAsync=function(a){var b;try{b=a()}catch(c){return Td(c)}return Ad(b)};var je=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=Qc,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=Qc)});return new Mc(c,d,e)}function c(c,d){this.source=c,this.controller=new Ce,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,a.call(this,b,c)}return Ec(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(yd);sd.pausable=function(a){return new je(this,a)};var ke=function(b){function c(b){var c,d=[],e=ib(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 Ce,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,b.call(this,c,a)}return Ec(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(yd);sd.pausableBuffered=function(a){return new ke(this,a)};var le=function(a){function b(a){return this.source.subscribe(a)}function c(c,d,e){a.call(this,b,c),this.subject=new me(d,e),this.source=c.multicast(this.subject).refCount()}return Ec(c,a),c.prototype.request=function(a){return this.subject.request(null==a?-1:a)},c}(yd),me=function(a){function b(a){return this.subject.subscribe(a)}function c(c,d){null==c&&(c=!0),a.call(this,b),this.subject=new Ce,this.enableQueue=c,this.queue=c?[]:null,this.requestedCount=0,this.requestedDisposable=Qc,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.scheduler=d||cd}return Ec(c,a),Fc(c.prototype,qd,{onCompleted:function(){this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length?this.queue.push(id.createOnCompleted()):this.subject.onCompleted()},onError:function(a){this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length?this.queue.push(id.createOnError(a)):this.subject.onError(a)},onNext:function(a){var b=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(id.createOnNext(a)):(-1!==this.requestedCount&&0===this.requestedCount--&&this.disposeCurrentRequest(),b=!0),b&&this.subject.onNext(a)},_processRequest:function(a){if(this.enableQueue){for(;this.queue.length>=a&&a>0||this.queue.length>0&&"N"!==this.queue[0].kind;){var b=this.queue.shift();b.accept(this.subject),"N"===b.kind?a--:(this.disposeCurrentRequest(),this.queue=[])}return{numberOfItems:a,returnValue:0!==this.queue.length}}return{numberOfItems:a,returnValue:!1}},request:function(a){this.disposeCurrentRequest();var b=this;return this.requestedDisposable=this.scheduler.scheduleWithState(a,function(a,c){var d=b._processRequest(c),e=d.numberOfItems;d.returnValue||(b.requestedCount=e,b.requestedDisposable=Pc(function(){b.requestedCount=0}))}),this.requestedDisposable},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=Qc}}),c}(yd);sd.controlled=function(a,b){return a&&Zc(a)&&(b=a,a=!0),null==a&&(a=!0),new le(this,a,b)};var ne=function(a){function b(a){this.subscription=this.source.subscribe(new d(a,this,this.subscription));var b=this;return gd.schedule(function(){b.source.request(1)}),this.subscription}function c(c){a.call(this,b,c),this.source=c}Ec(c,a);var d=function(a){function b(b,c,d){a.call(this),this.observer=b,this.observable=c,this.cancel=d}Ec(b,a);var c=b.prototype;return c.completed=function(){this.observer.onCompleted(),this.dispose()},c.error=function(a){this.observer.onError(a),this.dispose()},c.next=function(a){this.observer.onNext(a);var b=this;gd.schedule(function(){b.observable.source.request(1)})},c.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),a.prototype.dispose.call(this)},b}(td);return c}(yd);le.prototype.stopAndWait=function(){return new ne(this)};var oe=function(a){function b(a){this.subscription=this.source.subscribe(new d(a,this,this.subscription));var b=this;return gd.schedule(function(){b.source.request(b.windowSize)}),this.subscription}function c(c,d){a.call(this,b,c),this.source=c,this.windowSize=d}Ec(c,a);var d=function(a){function b(a,b,c){this.observer=a,this.observable=b,this.cancel=c,this.received=0}Ec(b,a);var c=b.prototype;return c.completed=function(){this.observer.onCompleted(),this.dispose()},c.error=function(a){this.observer.onError(a),this.dispose()},c.next=function(a){if(this.observer.onNext(a),this.received=++this.received%this.observable.windowSize,0===this.received){var b=this;gd.schedule(function(){b.observable.source.request(b.observable.windowSize)})}},c.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),a.prototype.dispose.call(this)},b}(td);return c}(yd);le.prototype.windowed=function(a){return new oe(this,a)},sd.pipe=function(a){function b(){c.resume()}var c=this.pausableBuffered();return a.addListener("drain",b),c.subscribe(function(b){!a.write(String(b))&&c.pause()},function(b){a.emit("error",b)},function(){!a._isStdio&&a.end(),a.removeListener("drain",b)}),c.resume(),a},sd.multicast=function(a,b){var c=this;return"function"==typeof a?new ze(function(d){var e=c.multicast(a());return new Mc(b(e).subscribe(d),e.connect())},c):new se(c,a)},sd.publish=function(a){return a&&Nb(a)?this.multicast(function(){return new Ce},a):this.multicast(new Ce)},sd.share=function(){return this.publish().refCount()},sd.publishLast=function(a){return a&&Nb(a)?this.multicast(function(){return new De},a):this.multicast(new De)},sd.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new qe(b)},a):this.multicast(new qe(a))},sd.shareValue=function(a){return this.publishValue(a).refCount()},sd.replay=function(a,b,c,d){return a&&Nb(a)?this.multicast(function(){return new re(b,c,d)},a):this.multicast(new re(b,c,d))},sd.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};var pe=function(a,b){this.subject=a,this.observer=b};pe.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 qe=Eb.BehaviorSubject=function(a){function c(a){return Sc(this),this.isStopped?(this.hasError?a.onError(this.error):a.onCompleted(),Qc):(this.observers.push(a),a.onNext(this.value),new pe(this,a))}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.hasError=!1}return Ec(d,a),Fc(d.prototype,qd,{getValue:function(){if(Sc(this),this.hasError)throw this.error;return this.value},hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(Sc(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(Sc(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(Sc(this),!this.isStopped){this.value=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),d}(yd),re=Eb.ReplaySubject=function(a){function c(a,b){return Pc(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(a){var b=new wd(this.scheduler,a),d=c(this,b);Sc(this),this._trim(this.scheduler.now()),this.observers.push(b);for(var e=0,f=this.q.length;f>e;e++)b.onNext(this.q[e].value);return this.hasError?b.onError(this.error):this.isStopped&&b.onCompleted(),b.ensureActive(),d}function e(b,c,e){this.bufferSize=null==b?f:b,this.windowSize=null==c?f:c,this.scheduler=e||cd,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,d)}var f=Math.pow(2,53)-1;return Ec(e,a),Fc(e.prototype,qd.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(Sc(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var d=0,e=b(this.observers),f=e.length;f>d;d++){var g=e[d];g.onNext(a),g.ensureActive()}}},onError:function(a){if(Sc(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var d=0,e=b(this.observers),f=e.length;f>d;d++){var g=e[d];g.onError(a),g.ensureActive()}this.observers.length=0}},onCompleted:function(){if(Sc(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var c=0,d=b(this.observers),e=d.length;e>c;c++){var f=d[c];f.onCompleted(),f.ensureActive()}this.observers.length=0}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(yd),se=Eb.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new Mc(f.subscribe(c),Pc(function(){e=!1}))),d},a.call(this,function(a){return c.subscribe(a)})}return Ec(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new ze(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(yd),te=function(){function b(a){if(0===(1&a))return 2===a;for(var b=Math.sqrt(a),c=3;b>=c;){if(a%c===0)return!1;c+=2}return!0}function c(a){var c,d,e;for(c=0;c<h.length;++c)if(d=h[c],d>=a)return d;for(e=1|a;e<h[h.length-1];){if(b(e))return e;e+=2}return a}function d(a){var b=757602046;if(!a.length)return b;for(var c=0,d=a.length;d>c;c++){var e=a.charCodeAt(c);b=(b<<5)-b+e,b&=b}return b}function e(a){var b=668265261;return a=61^a^a>>>16,a+=a<<3,a^=a>>>4,a*=b,a^=a>>>15}function f(){return{key:null,value:null,next:0,hashCode:0}}function g(a,b){if(0>a)throw new Vb;a>0&&this._initialize(a),this.comparer=b||Ib,this.freeCount=0,this.size=0,this.freeList=-1}var h=[1,3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143,4194301,8388593,16777213,33554393,67108859,134217689,268435399,536870909,1073741789,2147483647],i="no such key",j="duplicate key",k=function(){var a=0;return function(b){if(null==b)throw new Error(i);if("string"==typeof b)return d(b);if("number"==typeof b)return e(b);if("boolean"==typeof b)return b===!0?1:0;if(b instanceof Date)return e(b.valueOf());if(b instanceof RegExp)return d(b.toString());if("function"==typeof b.valueOf){var c=b.valueOf();if("number"==typeof c)return e(c);if("string"==typeof c)return d(c)}if(b.hashCode)return b.hashCode();var f=17*a++;return b.hashCode=function(){return f},f}}(),l=g.prototype;return l._initialize=function(a){var b,d=c(a);for(this.buckets=new Array(d),this.entries=new Array(d),b=0;d>b;b++)this.buckets[b]=-1,this.entries[b]=f();this.freeList=-1},l.add=function(a,b){this._insert(a,b,!0)},l._insert=function(a,b,c){this.buckets||this._initialize(0);for(var d,e=2147483647&k(a),f=e%this.buckets.length,g=this.buckets[f];g>=0;g=this.entries[g].next)if(this.entries[g].hashCode===e&&this.comparer(this.entries[g].key,a)){if(c)throw new Error(j);return void(this.entries[g].value=b)}this.freeCount>0?(d=this.freeList,this.freeList=this.entries[d].next,--this.freeCount):(this.size===this.entries.length&&(this._resize(),f=e%this.buckets.length),d=this.size,++this.size),this.entries[d].hashCode=e,this.entries[d].next=this.buckets[f],this.entries[d].key=a,this.entries[d].value=b,this.buckets[f]=d},l._resize=function(){var a=c(2*this.size),b=new Array(a);for(e=0;e<b.length;++e)b[e]=-1;var d=new Array(a);for(e=0;e<this.size;++e)d[e]=this.entries[e];for(var e=this.size;a>e;++e)d[e]=f();for(var g=0;g<this.size;++g){var h=d[g].hashCode%a;d[g].next=b[h],b[h]=g}this.buckets=b,this.entries=d},l.remove=function(a){if(this.buckets)for(var b=2147483647&k(a),c=b%this.buckets.length,d=-1,e=this.buckets[c];e>=0;e=this.entries[e].next){if(this.entries[e].hashCode===b&&this.comparer(this.entries[e].key,a))return 0>d?this.buckets[c]=this.entries[e].next:this.entries[d].next=this.entries[e].next,this.entries[e].hashCode=-1,this.entries[e].next=this.freeList,this.entries[e].key=null,this.entries[e].value=null,this.freeList=e,++this.freeCount,!0;d=e}return!1},l.clear=function(){var a,b;if(!(this.size<=0)){for(a=0,b=this.buckets.length;b>a;++a)this.buckets[a]=-1;for(a=0;a<this.size;++a)this.entries[a]=f();this.freeList=-1,this.size=0}},l._findEntry=function(a){if(this.buckets)for(var b=2147483647&k(a),c=this.buckets[b%this.buckets.length];c>=0;c=this.entries[c].next)if(this.entries[c].hashCode===b&&this.comparer(this.entries[c].key,a))return c;return-1},l.count=function(){return this.size-this.freeCount},l.tryGetValue=function(b){var c=this._findEntry(b);return c>=0?this.entries[c].value:a},l.getValues=function(){var a=0,b=[];if(this.entries)for(var c=0;c<this.size;c++)this.entries[c].hashCode>=0&&(b[a++]=this.entries[c].value);return b},l.get=function(a){var b=this._findEntry(a);if(b>=0)return this.entries[b].value;throw new Error(i)},l.set=function(a,b){this._insert(a,b,!1)},l.containskey=function(a){return this._findEntry(a)>=0},g}();sd.join=function(a,b,c,d){var e=this;return new ze(function(f){var g=new Mc,h=!1,i=!1,j=0,k=0,l=new te,m=new te;return g.add(e.subscribe(function(a){var c=j++,e=new Tc;l.add(c,a),g.add(e);var i,k=function(){l.remove(c)&&0===l.count()&&h&&f.onCompleted(),g.remove(e)};try{i=b(a)}catch(n){return void f.onError(n)}e.setDisposable(i.take(1).subscribe(Fb,f.onError.bind(f),k)),m.getValues().forEach(function(b){var c;try{c=d(a,b)}catch(e){return void f.onError(e)}f.onNext(c)})},f.onError.bind(f),function(){h=!0,(i||0===l.count())&&f.onCompleted()})),g.add(a.subscribe(function(a){var b=k++,e=new Tc;m.add(b,a),g.add(e);var h,j=function(){m.remove(b)&&0===m.count()&&i&&f.onCompleted(),g.remove(e)};try{h=c(a)}catch(n){return void f.onError(n)}e.setDisposable(h.take(1).subscribe(Fb,f.onError.bind(f),j)),l.getValues().forEach(function(b){var c;try{c=d(b,a)}catch(e){return void f.onError(e)}f.onNext(c)})},f.onError.bind(f),function(){i=!0,(h||0===m.count())&&f.onCompleted()})),g},e)},sd.groupJoin=function(a,b,c,d){var e=this;return new ze(function(f){function g(a){return function(b){b.onError(a)}}var h=new Mc,i=new Vc(h),j=new te,k=new te,l=0,m=0;return h.add(e.subscribe(function(a){var c=new Ce,e=l++;j.add(e,c);var m;try{m=d(a,Gc(c,i))}catch(n){return j.getValues().forEach(g(n)),void f.onError(n)}f.onNext(m),k.getValues().forEach(function(a){c.onNext(a)});var o=new Tc;h.add(o);var p,q=function(){j.remove(e)&&c.onCompleted(),h.remove(o)};try{p=b(a)}catch(n){return j.getValues().forEach(g(n)),void f.onError(n)}o.setDisposable(p.take(1).subscribe(Fb,function(a){j.getValues().forEach(g(a)),f.onError(a)},q))},function(a){j.getValues().forEach(g(a)),f.onError(a)},f.onCompleted.bind(f))),h.add(a.subscribe(function(a){var b=m++;k.add(b,a);var d=new Tc;h.add(d);var e,i=function(){k.remove(b),h.remove(d)};try{e=c(a)}catch(l){return j.getValues().forEach(g(l)),void f.onError(l)}d.setDisposable(e.take(1).subscribe(Fb,function(a){j.getValues().forEach(g(a)),f.onError(a)},i)),j.getValues().forEach(function(b){b.onNext(a)})},function(a){j.getValues().forEach(g(a)),f.onError(a)})),i},e)},sd.buffer=function(){return this.window.apply(this,arguments).selectMany(function(a){return a.toArray()})},sd.window=function(a,b){return 1===arguments.length&&"function"!=typeof arguments[0]?kb.call(this,a):"function"==typeof a?lb.call(this,a):jb.call(this,a,b)},sd.pairwise=function(){var a=this;return new ze(function(b){var c,d=!1;return a.subscribe(function(a){d?b.onNext([c,a]):d=!0,c=a},b.onError.bind(b),b.onCompleted.bind(b))},a)},sd.partition=function(a,b){return[this.filter(a,b),this.filter(function(c,d,e){return!a.call(b,c,d,e)})]},sd.letBind=sd.let=function(a){return a(this)},yd["if"]=yd.ifThen=function(a,b,c){return Cd(function(){return c||(c=Ed()),Lb(b)&&(b=Ad(b)),Lb(c)&&(c=Ad(c)),"function"==typeof c.now&&(c=Ed(c)),a()?b:c})},yd["for"]=yd.forIn=function(a,b,c){return pd(a,b,c).concat()};var ue=yd["while"]=yd.whileDo=function(a,b){return Lb(b)&&(b=Ad(b)),mb(a,b).concat()};sd.doWhile=function(a){return Wd([this,ue(a,this)])},yd["case"]=yd.switchCase=function(a,b,c){return Cd(function(){Lb(c)&&(c=Ad(c)),c||(c=Ed()),"function"==typeof c.now&&(c=Ed(c));var d=b[a()];return Lb(d)&&(d=Ad(d)),d||c})},sd.expand=function(a,b){Zc(b)||(b=bd);var c=this;return new ze(function(d){var e=[],f=new Uc,g=new Mc(f),h=0,i=!1,j=function(){var c=!1;e.length>0&&(c=!i,i=!0),c&&f.setDisposable(b.scheduleRecursive(function(b){var c;if(!(e.length>0))return void(i=!1);c=e.shift();var f=new Tc;g.add(f),f.setDisposable(c.subscribe(function(b){d.onNext(b);var c=null;try{c=a(b)}catch(f){d.onError(f)}e.push(c),h++,j()},d.onError.bind(d),function(){g.remove(f),h--,0===h&&d.onCompleted()})),b()}))};return e.push(c),h++,j(),g},this)},yd.forkJoin=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new ze(function(b){var c=a.length;if(0===c)return b.onCompleted(),Qc;for(var d=new Mc,e=!1,f=new Array(c),g=new Array(c),h=new Array(c),i=0;c>i;i++)!function(i){var j=a[i];Lb(j)&&(j=Ad(j)),d.add(j.subscribe(function(a){e||(f[i]=!0,h[i]=a)},function(a){e=!0,b.onError(a),d.dispose()},function(){if(!e){if(!f[i])return void b.onCompleted();g[i]=!0;for(var a=0;c>a;a++)if(!g[a])return;e=!0,b.onNext(h),b.onCompleted()}}))}(i);return d})},sd.forkJoin=function(a,b){var c=this;return new ze(function(d){var e,f,g=!1,h=!1,i=!1,j=!1,k=new Tc,l=new Tc;return Lb(a)&&(a=Ad(a)),k.setDisposable(c.subscribe(function(a){i=!0,e=a},function(a){l.dispose(),d.onError(a)},function(){if(g=!0,h)if(i)if(j){var a;try{a=b(e,f)}catch(c){return void d.onError(c)}d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),l.setDisposable(a.subscribe(function(a){j=!0,f=a},function(a){k.dispose(),d.onError(a)},function(){if(h=!0,g)if(i)if(j){var a;try{a=b(e,f)}catch(c){return void d.onError(c)}d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),new Mc(k,l)},c)},sd.manySelect=function(a,b){Zc(b)||(b=bd);var c=this;return Cd(function(){var d;return c.map(function(a){var b=new ve(a);return d&&d.onNext(a),d=b,b}).tap(Fb,function(a){d&&d.onError(a)},function(){d&&d.onCompleted()}).observeOn(b).map(a)},c)};var ve=function(a){function b(a){var b=this,c=new Mc;return c.add(cd.schedule(function(){a.onNext(b.head),c.add(b.tail.mergeAll().subscribe(a))})),c}function c(c){a.call(this,b),this.head=c,this.tail=new De}return Ec(c,a),Fc(c.prototype,qd,{onCompleted:function(){this.onNext(yd.empty())},onError:function(a){this.onNext(yd.throwError(a))},onNext:function(a){this.tail.onNext(a),this.tail.onCompleted()}}),c}(yd),we=zb.Map||function(){function b(){this._keys=[],this._values=[]}return b.prototype.get=function(b){var c=this._keys.indexOf(b);return-1!==c?this._values[c]:a},b.prototype.set=function(a,b){var c=this._keys.indexOf(a);-1!==c&&(this._values[c]=b),this._values[this._keys.push(a)-1]=b},b.prototype.forEach=function(a,b){for(var c=0,d=this._keys.length;d>c;c++)a.call(b,this._values[c],this._keys[c])},b}();nb.prototype.and=function(a){return new nb(this.patterns.concat(a))},nb.prototype.thenDo=function(a){return new ob(this,a)},ob.prototype.activate=function(a,b,c){for(var d=this,e=[],f=0,g=this.expression.patterns.length;g>f;f++)e.push(pb(a,this.expression.patterns[f],b.onError.bind(b)));var h=new qb(e,function(){var a;try{a=d.selector.apply(d,arguments)}catch(c){return void b.onError(c)}b.onNext(a)},function(){for(var a=0,b=e.length;b>a;a++)e[a].removeActivePlan(h);c(h)});for(f=0,g=e.length;g>f;f++)e[f].addActivePlan(h);return h},qb.prototype.dequeue=function(){this.joinObservers.forEach(function(a){a.queue.shift()})},qb.prototype.match=function(){var a,b,c=!0;for(a=0,b=this.joinObserverArray.length;b>a;a++)if(0===this.joinObserverArray[a].queue.length){c=!1;break}if(c){var d=[],e=!1;for(a=0,b=this.joinObserverArray.length;b>a;a++)d.push(this.joinObserverArray[a].queue[0]),"C"===this.joinObserverArray[a].queue[0].kind&&(e=!0);if(e)this.onCompleted();else{this.dequeue();var f=[];for(a=0,b=d.length;a<d.length;a++)f.push(d[a].value);this.onNext.apply(this,f)}}};var xe=function(a){function b(b,c){a.call(this),this.source=b,this.onError=c,this.queue=[],this.activePlans=[],this.subscription=new Tc,this.isDisposed=!1}Ec(b,a);var c=b.prototype;return c.next=function(a){if(!this.isDisposed){if("E"===a.kind)return this.onError(a.exception);this.queue.push(a);for(var b=this.activePlans.slice(0),c=0,d=b.length;d>c;c++)b[c].match()}},c.error=Fb,c.completed=Fb,c.addActivePlan=function(a){this.activePlans.push(a)},c.subscribe=function(){this.subscription.setDisposable(this.source.materialize().subscribe(this))},c.removeActivePlan=function(a){this.activePlans.splice(this.activePlans.indexOf(a),1),0===this.activePlans.length&&this.dispose()},c.dispose=function(){a.prototype.dispose.call(this),this.isDisposed||(this.isDisposed=!0,this.subscription.dispose())},b}(td);sd.and=function(a){return new nb([this,a])},sd.thenDo=function(a){return new nb([this]).thenDo(a)},yd.when=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new ze(function(b){var c=[],d=new we,e=rd(function(a){b.onNext(a)},function(a){d.forEach(function(b){b.onError(a)}),b.onError(a)},function(){b.onCompleted()});try{for(var f=0,g=a.length;g>f;f++)c.push(a[f].activate(d,e,function(a){var d=c.indexOf(a);c.splice(d,1),0===c.length&&b.onCompleted()}))}catch(h){Td(h).subscribe(b)}var i=new Mc;return d.forEach(function(a){a.subscribe(),i.add(a)}),i})};{var ye=yd.interval=function(a,b){return ub(a,a,Zc(b)?b:gd)};yd.timer=function(b,c,d){var e;return Zc(d)||(d=gd),c!==a&&"number"==typeof c?e=c:Zc(c)&&(d=c),b instanceof Date&&e===a?rb(b.getTime(),d):b instanceof Date&&e!==a?(e=c,sb(b.getTime(),e,d)):e===a?tb(b,d):ub(b,e,d)}}sd.delay=function(a,b){return Zc(b)||(b=gd),a instanceof Date?wb(this,a.getTime(),b):vb(this,a,b)},sd.debounce=sd.throttleWithTimeout=function(a,b){Zc(b)||(b=gd);
5
+ var c=this;return new ze(function(d){var e,f=new Uc,g=!1,h=0,i=c.subscribe(function(c){g=!0,e=c,h++;var i=h,j=new Tc;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 Mc(i,f)},this)},sd.throttle=function(a,b){return this.debounce(a,b)},sd.windowWithTime=function(a,b,c){var d,e=this;return null==b&&(d=a),Zc(c)||(c=gd),"number"==typeof b?d=b:Zc(b)&&(d=a,c=b),new ze(function(b){function f(){var a=new Tc,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 Ce;k.push(a),b.onNext(Gc(a,h))}e&&k.shift().onCompleted(),f()}))}var g,h,i=d,j=a,k=[],l=new Uc,m=0;return g=new Mc(l),h=new Vc(g),k.push(new Ce),b.onNext(Gc(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)},sd.windowWithTimeOrCount=function(a,b,c){var d=this;return Zc(c)||(c=gd),new ze(function(e){function f(b){var d=new Tc;g.setDisposable(d),d.setDisposable(c.scheduleWithRelative(a,function(){if(b===k){j=0;var a=++k;l.onCompleted(),l=new Ce,e.onNext(Gc(l,i)),f(a)}}))}var g=new Uc,h=new Mc(g),i=new Vc(h),j=0,k=0,l=new Ce;return e.onNext(Gc(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 Ce,e.onNext(Gc(l,i))),d&&f(c)},function(a){l.onError(a),e.onError(a)},function(){l.onCompleted(),e.onCompleted()})),i},d)},sd.bufferWithTime=function(){return this.windowWithTime.apply(this,arguments).selectMany(function(a){return a.toArray()})},sd.bufferWithTimeOrCount=function(a,b,c){return this.windowWithTimeOrCount(a,b,c).selectMany(function(a){return a.toArray()})},sd.timeInterval=function(a){var b=this;return Zc(a)||(a=gd),Cd(function(){var c=a.now();return b.map(function(b){var d=a.now(),e=d-c;return c=d,{value:b,interval:e}})})},sd.timestamp=function(a){return Zc(a)||(a=gd),this.map(function(b){return{value:b,timestamp:a.now()}})},sd.sample=sd.throttleLatest=function(a,b){return Zc(b)||(b=gd),"number"==typeof a?xb(this,ye(a,b)):xb(this,a)},sd.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=Td(new Error(b||"Timeout"))),Zc(c)||(c=gd);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new ze(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(Lb(b)&&(b=Ad(b)),j.setDisposable(b.subscribe(f)))}))}var h=0,i=new Tc,j=new Uc,k=!1,l=new Uc;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 Mc(j,l)},d)},yd.generateWithAbsoluteTime=function(a,b,c,d,e,f){return Zc(f)||(f=gd),new ze(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()})})},yd.generateWithRelativeTime=function(a,b,c,d,e,f){return Zc(f)||(f=gd),new ze(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()})})},sd.delaySubscription=function(a,b){var c=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative",d=this;return Zc(b)||(b=gd),new ze(function(e){var f=new Uc;return f.setDisposable(b[c](a,function(){f.setDisposable(d.subscribe(e))})),f},this)},sd.delayWithSelector=function(a,b){var c,d,e=this;return Nb(a)?d=a:(c=a,d=b),new ze(function(a){function b(){i.setDisposable(e.subscribe(function(b){var c=p(d)(b);if(c===Hc)return a.onError(c.e);var e=new Tc;g.add(e),e.setDisposable(c.subscribe(function(){a.onNext(b),g.remove(e),f()},function(b){a.onError(b)},function(){a.onNext(b),g.remove(e),f()}))},function(b){a.onError(b)},function(){h=!0,i.dispose(),f()}))}function f(){h&&0===g.length&&a.onCompleted()}var g=new Mc,h=!1,i=new Uc;return c?i.setDisposable(c.subscribe(b,function(b){a.onError(b)},b)):b(),new Mc(i,g)},this)},sd.timeoutWithSelector=function(a,b,c){1===arguments.length&&(b=a,a=Md()),c||(c=Td(new Error("Timeout")));var d=this;return new ze(function(e){function f(a){function b(){return k===d}var d=k,f=new Tc;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 Uc,i=new Uc,j=new Tc;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(Lb(c)?Ad(c):c)}},function(a){g()&&e.onError(a)},function(){g()&&e.onCompleted()})),new Mc(h,i)},d)},sd.debounceWithSelector=function(a){var b=this;return new ze(function(c){var d,e=!1,f=new Uc,g=0,h=b.subscribe(function(b){var h;try{h=a(b)}catch(i){return void c.onError(i)}Lb(h)&&(h=Ad(h)),e=!0,d=b,g++;var j=g,k=new Tc;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 Mc(h,f)},b)},sd.throttleWithSelector=function(a){return this.debounceWithSelector(a)},sd.skipLastWithTime=function(a,b){Zc(b)||(b=gd);var c=this;return new ze(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)},sd.takeLastWithTime=function(a,b){var c=this;return Zc(b)||(b=gd),new ze(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)},sd.takeLastBufferWithTime=function(a,b){var c=this;return Zc(b)||(b=gd),new ze(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)},sd.takeWithTime=function(a,b){var c=this;return Zc(b)||(b=gd),new ze(function(d){return new Mc(b.scheduleWithRelative(a,function(){d.onCompleted()}),c.subscribe(d))},c)},sd.skipWithTime=function(a,b){var c=this;return Zc(b)||(b=gd),new ze(function(d){var e=!1;return new Mc(b.scheduleWithRelative(a,function(){e=!0}),c.subscribe(function(a){e&&d.onNext(a)},d.onError.bind(d),d.onCompleted.bind(d)))},c)},sd.skipUntilWithTime=function(a,b){Zc(b)||(b=gd);var c=this,d=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new ze(function(e){var f=!1;return new Mc(b[d](a,function(){f=!0}),c.subscribe(function(a){f&&e.onNext(a)},function(a){e.onError(a)},function(){e.onCompleted()}))},c)},sd.takeUntilWithTime=function(a,b){Zc(b)||(b=gd);var c=this,d=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new ze(function(e){return new Mc(b[d](a,function(){e.onCompleted()}),c.subscribe(e))},c)},sd.throttleFirst=function(a,b){Zc(b)||(b=gd);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new ze(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)},sd.exclusive=function(){var a=this;return new ze(function(b){var c=!1,d=!1,e=new Tc,f=new Mc;return f.add(e),e.setDisposable(a.subscribe(function(a){if(!c){c=!0,Lb(a)&&(a=Ad(a));var e=new Tc;f.add(e),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){f.remove(e),c=!1,d&&1===f.length&&b.onCompleted()}))}},b.onError.bind(b),function(){d=!0,c||1!==f.length||b.onCompleted()})),f},this)},sd.exclusiveMap=function(a,b){var c=this,d=dc(a,b,3);return new ze(function(a){var b=0,e=!1,f=!0,g=new Tc,h=new Mc;return h.add(g),g.setDisposable(c.subscribe(function(c){e||(e=!0,innerSubscription=new Tc,h.add(innerSubscription),Lb(c)&&(c=Ad(c)),innerSubscription.setDisposable(c.subscribe(function(e){var f;try{f=d(e,b++,c)}catch(g){return void a.onError(g)}a.onNext(f)},function(b){a.onError(b)},function(){h.remove(innerSubscription),e=!1,f&&1===h.length&&a.onCompleted()})))},function(b){a.onError(b)},function(){f=!0,1!==h.length||e||a.onCompleted()})),h},this)},sd.transduce=function(a){function b(a){return{"@@transducer/init":function(){return a},"@@transducer/step":function(a,b){return a.onNext(b)},"@@transducer/result":function(a){return a.onCompleted()}}}var c=this;return new ze(function(d){var e=a(b(d));return c.subscribe(function(a){try{e["@@transducer/step"](d,a)}catch(b){d.onError(b)}},function(a){d.onError(a)},function(){e["@@transducer/result"](d)})},c)},Eb.VirtualTimeScheduler=function(a){function b(){return this.toDateTimeOffset(this.clock)}function c(a,b){return this.scheduleAbsoluteWithState(a,this.clock,b)}function d(a,b,c){return this.scheduleRelativeWithState(a,this.toRelative(b),c)}function e(a,b,c){return this.scheduleRelativeWithState(a,this.toRelative(b-this.now()),c)}function f(a,b){return b(),Qc}function g(f,g){this.clock=f,this.comparer=g,this.isEnabled=!1,this.queue=new Kc(1024),a.call(this,b,c,d,e)}Ec(g,a);var h=g.prototype;return h.add=Yb,h.toDateTimeOffset=Yb,h.toRelative=Yb,h.schedulePeriodicWithState=function(a,b,c){var d=new ad(this,a,b,c);return d.start()},h.scheduleRelativeWithState=function(a,b,c){var d=this.add(this.clock,b);return this.scheduleAbsoluteWithState(a,d,c)},h.scheduleRelative=function(a,b){return this.scheduleRelativeWithState(b,a,f)},h.start=function(){if(!this.isEnabled){this.isEnabled=!0;do{var a=this.getNext();null!==a?(this.comparer(a.dueTime,this.clock)>0&&(this.clock=a.dueTime),a.invoke()):this.isEnabled=!1}while(this.isEnabled)}},h.stop=function(){this.isEnabled=!1},h.advanceTo=function(a){var b=this.comparer(this.clock,a);if(this.comparer(this.clock,a)>0)throw new Vb;if(0!==b&&!this.isEnabled){this.isEnabled=!0;do{var c=this.getNext();null!==c&&this.comparer(c.dueTime,a)<=0?(this.comparer(c.dueTime,this.clock)>0&&(this.clock=c.dueTime),c.invoke()):this.isEnabled=!1}while(this.isEnabled);this.clock=a}},h.advanceBy=function(a){var b=this.add(this.clock,a),c=this.comparer(this.clock,b);if(c>0)throw new Vb;0!==c&&this.advanceTo(b)},h.sleep=function(a){var b=this.add(this.clock,a);if(this.comparer(this.clock,b)>=0)throw new Vb;this.clock=b},h.getNext=function(){for(;this.queue.length>0;){var a=this.queue.peek();if(!a.isCancelled())return a;this.queue.dequeue()}return null},h.scheduleAbsolute=function(a,b){return this.scheduleAbsoluteWithState(b,a,f)},h.scheduleAbsoluteWithState=function(a,b,c){function d(a,b){return e.queue.remove(f),c(a,b)}var e=this,f=new Wc(this,a,d,b,this.comparer);return this.queue.enqueue(f),f.disposable},g}(Xc),Eb.HistoricalScheduler=function(a){function b(b,c){var d=null==b?0:b,e=c||Jb;a.call(this,d,e)}Ec(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}(Eb.VirtualTimeScheduler);var ze=Eb.AnonymousObservable=function(a){function b(a){return a&&Nb(a.dispose)?a:Nb(a)?Pc(a):Qc}function c(a,c){var d=c[0],e=c[1],f=p(e)(d);return f!==Hc||d.fail(Hc.e)?void d.setDisposable(b(f)):q(Hc.e)}function d(b,d){function e(a){var d=new Ae(a),e=[d,b];return cd.scheduleRequired()?cd.scheduleWithState(e,c):c(null,e),d}this.source=d,a.call(this,e)}return Ec(d,a),d}(yd),Ae=function(a){function b(b){a.call(this),this.observer=b,this.m=new Tc}Ec(b,a);var c=b.prototype;return c.next=function(a){var b=p(this.observer.onNext).call(this.observer,a);b===Hc&&(this.dispose(),q(b.e))},c.error=function(a){var b=p(this.observer.onError).call(this.observer,a);this.dispose(),b===Hc&&q(b.e)},c.completed=function(){var a=p(this.observer.onCompleted).call(this.observer);this.dispose(),a===Hc&&q(a.e)},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(td),Be=function(a){function b(a){return this.underlyingObservable.subscribe(a)}function c(c,d,e){a.call(this,b),this.key=c,this.underlyingObservable=e?new ze(function(a){return new Mc(e.getDisposable(),d.subscribe(a))}):d}return Ec(c,a),c}(yd),Ce=Eb.Subject=function(a){function c(a){return Sc(this),this.isStopped?this.hasError?(a.onError(this.error),Qc):(a.onCompleted(),Qc):(this.observers.push(a),new pe(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return Ec(d,a),Fc(d.prototype,qd.prototype,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(Sc(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(Sc(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(Sc(this),!this.isStopped)for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Ee(a,b)},d}(yd),De=Eb.AsyncSubject=function(a){function c(a){return Sc(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),Qc):(this.observers.push(a),new pe(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return Ec(d,a),Fc(d.prototype,qd,{hasObservers:function(){return Sc(this),this.observers.length>0},onCompleted:function(){var a,c;if(Sc(this),!this.isStopped){this.isStopped=!0;var d=b(this.observers),c=d.length;if(this.hasValue)for(a=0;c>a;a++){var e=d[a];e.onNext(this.value),e.onCompleted()}else for(a=0;c>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(Sc(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){Sc(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(yd),Ee=Eb.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 Ec(c,a),Fc(c.prototype,qd.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(yd);Eb.Pauser=function(a){function b(){a.call(this)}return Ec(b,a),b.prototype.pause=function(){this.onNext(!1)},b.prototype.resume=function(){this.onNext(!0)},b}(Ce),"function"==typeof define&&"object"==typeof define.amd&&define.amd?(zb.Rx=Eb,define(function(){return Eb})):Ab&&Bb?Cb?(Bb.exports=Eb).Rx=Eb:Ab.Rx=Eb:zb.Rx=Eb;var Fe=g()}).call(this);
6
6
  //# sourceMappingURL=rx.all.compat.map
@@ -32,7 +32,6 @@
32
32
  // Defaults
33
33
  var noop = Rx.helpers.noop = function () { },
34
34
  notDefined = Rx.helpers.notDefined = function (x) { return typeof x === 'undefined'; },
35
- isScheduler = Rx.helpers.isScheduler = function (x) { return x instanceof Rx.Scheduler; },
36
35
  identity = Rx.helpers.identity = function (x) { return x; },
37
36
  pluck = Rx.helpers.pluck = function (property) { return function (x) { return x[property]; }; },
38
37
  just = Rx.helpers.just = function (value) { return function () { return value; }; },
@@ -60,11 +59,6 @@
60
59
  return isFn;
61
60
  }());
62
61
 
63
- // Errors
64
- var sequenceContainsNoElements = 'Sequence contains no elements.';
65
- var argumentOutOfRange = 'Argument out of range';
66
- var objectDisposed = 'Object has been disposed';
67
- function checkDisposed(self) { if (self.isDisposed) { throw new Error(objectDisposed); } }
68
62
  function cloneArray(arr) { for(var a = [], i = 0, len = arr.length; i < len; i++) { a.push(arr[i]); } return a;}
69
63
 
70
64
  Rx.config.longStackSupport = false;
@@ -163,6 +157,44 @@
163
157
  if (attempt3) { return [attempt3[1], Number(attempt3[2])]; }
164
158
  }
165
159
 
160
+ var EmptyError = Rx.EmptyError = function() {
161
+ this.message = 'Sequence contains no elements.';
162
+ Error.call(this);
163
+ };
164
+ EmptyError.prototype = Error.prototype;
165
+
166
+ var ObjectDisposedError = Rx.ObjectDisposedError = function() {
167
+ this.message = 'Object has been disposed';
168
+ Error.call(this);
169
+ };
170
+ ObjectDisposedError.prototype = Error.prototype;
171
+
172
+ var ArgumentOutOfRangeError = Rx.ArgumentOutOfRangeError = function () {
173
+ this.message = 'Argument out of range';
174
+ Error.call(this);
175
+ };
176
+ ArgumentOutOfRangeError.prototype = Error.prototype;
177
+
178
+ var NotSupportedError = Rx.NotSupportedError = function (message) {
179
+ this.message = message || 'This operation is not supported';
180
+ Error.call(this);
181
+ };
182
+ NotSupportedError.prototype = Error.prototype;
183
+
184
+ var NotImplementedError = Rx.NotImplementedError = function (message) {
185
+ this.message = message || 'This operation is not implemented';
186
+ Error.call(this);
187
+ };
188
+ NotImplementedError.prototype = Error.prototype;
189
+
190
+ var notImplemented = Rx.helpers.notImplemented = function () {
191
+ throw new NotImplementedError();
192
+ };
193
+
194
+ var notSupported = Rx.helpers.notSupported = function () {
195
+ throw new NotSupportedError();
196
+ };
197
+
166
198
  // Shim in iterator support
167
199
  var $iterator$ = (typeof Symbol === 'function' && Symbol.iterator) ||
168
200
  '_es6shim_iterator_';
@@ -638,13 +670,17 @@
638
670
  * @constructor
639
671
  */
640
672
  var CompositeDisposable = Rx.CompositeDisposable = function () {
641
- var args = [];
673
+ var args = [], i, len;
642
674
  if (Array.isArray(arguments[0])) {
643
675
  args = arguments[0];
676
+ len = args.length;
644
677
  } else {
645
- var len = arguments.length;
678
+ len = arguments.length;
646
679
  args = new Array(len);
647
- for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
680
+ for(i = 0; i < len; i++) { args[i] = arguments[i]; }
681
+ }
682
+ for(i = 0; i < len; i++) {
683
+ if (!isDisposable(args[i])) { throw new TypeError('Not a disposable'); }
648
684
  }
649
685
  this.disposables = args;
650
686
  this.isDisposed = false;
@@ -731,51 +767,67 @@
731
767
  */
732
768
  var disposableEmpty = Disposable.empty = { dispose: noop };
733
769
 
734
- var SingleAssignmentDisposable = Rx.SingleAssignmentDisposable = (function () {
735
- function BooleanDisposable () {
736
- this.isDisposed = false;
737
- this.current = null;
738
- }
739
-
740
- var booleanDisposablePrototype = BooleanDisposable.prototype;
741
-
742
- /**
743
- * Gets the underlying disposable.
744
- * @return The underlying disposable.
745
- */
746
- booleanDisposablePrototype.getDisposable = function () {
747
- return this.current;
748
- };
770
+ /**
771
+ * Validates whether the given object is a disposable
772
+ * @param {Object} Object to test whether it has a dispose method
773
+ * @returns {Boolean} true if a disposable object, else false.
774
+ */
775
+ var isDisposable = Disposable.isDisposable = function (d) {
776
+ return d && isFunction(d.dispose);
777
+ };
749
778
 
750
- /**
751
- * Sets the underlying disposable.
752
- * @param {Disposable} value The new underlying disposable.
753
- */
754
- booleanDisposablePrototype.setDisposable = function (value) {
755
- var shouldDispose = this.isDisposed;
756
- if (!shouldDispose) {
757
- var old = this.current;
758
- this.current = value;
759
- }
760
- old && old.dispose();
761
- shouldDispose && value && value.dispose();
762
- };
779
+ var checkDisposed = Disposable.checkDisposed = function (disposable) {
780
+ if (disposable.isDisposed) { throw new ObjectDisposedError(); }
781
+ };
763
782
 
764
- /**
765
- * Disposes the underlying disposable as well as all future replacements.
766
- */
767
- booleanDisposablePrototype.dispose = function () {
768
- if (!this.isDisposed) {
769
- this.isDisposed = true;
770
- var old = this.current;
771
- this.current = null;
772
- }
773
- old && old.dispose();
774
- };
783
+ // Single assignment
784
+ var SingleAssignmentDisposable = Rx.SingleAssignmentDisposable = function () {
785
+ this.isDisposed = false;
786
+ this.current = null;
787
+ };
788
+ SingleAssignmentDisposable.prototype.getDisposable = function () {
789
+ return this.current;
790
+ };
791
+ SingleAssignmentDisposable.prototype.setDisposable = function (value) {
792
+ if (this.current) { throw new Error('Disposable has already been assigned'); }
793
+ var shouldDispose = this.isDisposed;
794
+ !shouldDispose && (this.current = value);
795
+ shouldDispose && value && value.dispose();
796
+ };
797
+ SingleAssignmentDisposable.prototype.dispose = function () {
798
+ if (!this.isDisposed) {
799
+ this.isDisposed = true;
800
+ var old = this.current;
801
+ this.current = null;
802
+ }
803
+ old && old.dispose();
804
+ };
775
805
 
776
- return BooleanDisposable;
777
- }());
778
- var SerialDisposable = Rx.SerialDisposable = SingleAssignmentDisposable;
806
+ // Multiple assignment disposable
807
+ var SerialDisposable = Rx.SerialDisposable = function () {
808
+ this.isDisposed = false;
809
+ this.current = null;
810
+ };
811
+ SerialDisposable.prototype.getDisposable = function () {
812
+ return this.current;
813
+ };
814
+ SerialDisposable.prototype.setDisposable = function (value) {
815
+ var shouldDispose = this.isDisposed;
816
+ if (!shouldDispose) {
817
+ var old = this.current;
818
+ this.current = value;
819
+ }
820
+ old && old.dispose();
821
+ shouldDispose && value && value.dispose();
822
+ };
823
+ SerialDisposable.prototype.dispose = function () {
824
+ if (!this.isDisposed) {
825
+ this.isDisposed = true;
826
+ var old = this.current;
827
+ this.current = null;
828
+ }
829
+ old && old.dispose();
830
+ };
779
831
 
780
832
  /**
781
833
  * Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed.
@@ -887,6 +939,11 @@
887
939
  this._scheduleAbsolute = scheduleAbsolute;
888
940
  }
889
941
 
942
+ /** Determines whether the given object is a scheduler */
943
+ Scheduler.isScheduler = function (s) {
944
+ return s instanceof Scheduler;
945
+ }
946
+
890
947
  function invokeAction(scheduler, action) {
891
948
  action();
892
949
  return disposableEmpty;
@@ -971,12 +1028,14 @@
971
1028
  return Scheduler;
972
1029
  }());
973
1030
 
974
- var normalizeTime = Scheduler.normalize;
1031
+ var normalizeTime = Scheduler.normalize, isScheduler = Scheduler.isScheduler;
975
1032
 
976
1033
  (function (schedulerProto) {
1034
+
977
1035
  function invokeRecImmediate(scheduler, pair) {
978
- var state = pair.first, action = pair.second, group = new CompositeDisposable(),
979
- recursiveAction = function (state1) {
1036
+ var state = pair[0], action = pair[1], group = new CompositeDisposable();
1037
+
1038
+ function recursiveAction(state1) {
980
1039
  action(state1, function (state2) {
981
1040
  var isAdded = false, isDone = false,
982
1041
  d = scheduler.scheduleWithState(state2, function (scheduler1, state3) {
@@ -993,14 +1052,15 @@
993
1052
  isAdded = true;
994
1053
  }
995
1054
  });
996
- };
1055
+ }
1056
+
997
1057
  recursiveAction(state);
998
1058
  return group;
999
1059
  }
1000
1060
 
1001
1061
  function invokeRecDate(scheduler, pair, method) {
1002
- var state = pair.first, action = pair.second, group = new CompositeDisposable(),
1003
- recursiveAction = function (state1) {
1062
+ var state = pair[0], action = pair[1], group = new CompositeDisposable();
1063
+ function recursiveAction(state1) {
1004
1064
  action(state1, function (state2, dueTime1) {
1005
1065
  var isAdded = false, isDone = false,
1006
1066
  d = scheduler[method](state2, dueTime1, function (scheduler1, state3) {
@@ -1043,7 +1103,7 @@
1043
1103
  * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
1044
1104
  */
1045
1105
  schedulerProto.scheduleRecursiveWithState = function (state, action) {
1046
- return this.scheduleWithState({ first: state, second: action }, invokeRecImmediate);
1106
+ return this.scheduleWithState([state, action], invokeRecImmediate);
1047
1107
  };
1048
1108
 
1049
1109
  /**
@@ -1064,7 +1124,7 @@
1064
1124
  * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
1065
1125
  */
1066
1126
  schedulerProto.scheduleRecursiveWithRelativeAndState = function (state, dueTime, action) {
1067
- return this._scheduleRelative({ first: state, second: action }, dueTime, function (s, p) {
1127
+ return this._scheduleRelative([state, action], dueTime, function (s, p) {
1068
1128
  return invokeRecDate(s, p, 'scheduleWithRelativeAndState');
1069
1129
  });
1070
1130
  };
@@ -1087,7 +1147,7 @@
1087
1147
  * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
1088
1148
  */
1089
1149
  schedulerProto.scheduleRecursiveWithAbsoluteAndState = function (state, dueTime, action) {
1090
- return this._scheduleAbsolute({ first: state, second: action }, dueTime, function (s, p) {
1150
+ return this._scheduleAbsolute([state, action], dueTime, function (s, p) {
1091
1151
  return invokeRecDate(s, p, 'scheduleWithAbsoluteAndState');
1092
1152
  });
1093
1153
  };
@@ -1113,16 +1173,10 @@
1113
1173
  * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort).
1114
1174
  */
1115
1175
  Scheduler.prototype.schedulePeriodicWithState = function(state, period, action) {
1116
- if (typeof root.setInterval === 'undefined') { throw new Error('Periodic scheduling not supported.'); }
1117
- var s = state;
1118
-
1119
- var id = root.setInterval(function () {
1120
- s = action(s);
1121
- }, period);
1122
-
1123
- return disposableCreate(function () {
1124
- root.clearInterval(id);
1125
- });
1176
+ if (typeof root.setInterval === 'undefined') { throw new NotSupportedError(); }
1177
+ period = normalizeTime(period);
1178
+ var s = state, id = root.setInterval(function () { s = action(s); }, period);
1179
+ return disposableCreate(function () { root.clearInterval(id); });
1126
1180
  };
1127
1181
 
1128
1182
  }(Scheduler.prototype));
@@ -1169,10 +1223,7 @@
1169
1223
 
1170
1224
  /** Gets a scheduler that schedules work immediately on the current thread. */
1171
1225
  var immediateScheduler = Scheduler.immediate = (function () {
1172
-
1173
1226
  function scheduleNow(state, action) { return action(this, state); }
1174
- function notSupported() { throw new Error('Not supported'); }
1175
-
1176
1227
  return new Scheduler(defaultNow, scheduleNow, notSupported, notSupported);
1177
1228
  }());
1178
1229
 
@@ -1182,12 +1233,10 @@
1182
1233
  var currentThreadScheduler = Scheduler.currentThread = (function () {
1183
1234
  var queue;
1184
1235
 
1185
- function runTrampoline (q) {
1186
- while (q.length > 0) {
1187
- var item = q.dequeue();
1188
- if (!item.isCancelled()) {
1189
- !item.isCancelled() && item.invoke();
1190
- }
1236
+ function runTrampoline () {
1237
+ while (queue.length > 0) {
1238
+ var item = queue.dequeue();
1239
+ !item.isCancelled() && item.invoke();
1191
1240
  }
1192
1241
  }
1193
1242
 
@@ -1197,44 +1246,36 @@
1197
1246
  if (!queue) {
1198
1247
  queue = new PriorityQueue(4);
1199
1248
  queue.enqueue(si);
1200
- try {
1201
- runTrampoline(queue);
1202
- } catch (e) {
1203
- throw e;
1204
- } finally {
1205
- queue = null;
1206
- }
1249
+
1250
+ var result = tryCatch(runTrampoline)();
1251
+ queue = null;
1252
+ if (result === errorObj) { return thrower(result.e); }
1207
1253
  } else {
1208
1254
  queue.enqueue(si);
1209
1255
  }
1210
1256
  return si.disposable;
1211
1257
  }
1212
1258
 
1213
- function notSupported() { throw new Error('Not supported'); }
1214
-
1215
1259
  var currentScheduler = new Scheduler(defaultNow, scheduleNow, notSupported, notSupported);
1216
-
1217
1260
  currentScheduler.scheduleRequired = function () { return !queue; };
1218
- currentScheduler.ensureTrampoline = function (action) {
1219
- if (!queue) { this.schedule(action); } else { action(); }
1220
- };
1221
1261
 
1222
1262
  return currentScheduler;
1223
1263
  }());
1224
1264
 
1225
- var scheduleMethod, clearMethod = noop;
1265
+ var scheduleMethod, clearMethod;
1266
+
1226
1267
  var localTimer = (function () {
1227
1268
  var localSetTimeout, localClearTimeout = noop;
1228
- if ('WScript' in this) {
1269
+ if (!!root.setTimeout) {
1270
+ localSetTimeout = root.setTimeout;
1271
+ localClearTimeout = root.clearTimeout;
1272
+ } else if (!!root.WScript) {
1229
1273
  localSetTimeout = function (fn, time) {
1230
- WScript.Sleep(time);
1274
+ root.WScript.Sleep(time);
1231
1275
  fn();
1232
1276
  };
1233
- } else if (!!root.setTimeout) {
1234
- localSetTimeout = root.setTimeout;
1235
- localClearTimeout = root.clearTimeout;
1236
1277
  } else {
1237
- throw new Error('No concurrency detected!');
1278
+ throw new NotSupportedError();
1238
1279
  }
1239
1280
 
1240
1281
  return {
@@ -1247,6 +1288,27 @@
1247
1288
 
1248
1289
  (function () {
1249
1290
 
1291
+ var nextHandle = 1, tasksByHandle = {}, currentlyRunning = false;
1292
+
1293
+ clearMethod = function (handle) {
1294
+ delete tasksByHandle[handle];
1295
+ };
1296
+
1297
+ function runTask(handle) {
1298
+ if (currentlyRunning) {
1299
+ localSetTimeout(function () { runTask(handle) }, 0);
1300
+ } else {
1301
+ var task = tasksByHandle[handle];
1302
+ if (task) {
1303
+ currentlyRunning = true;
1304
+ var result = tryCatch(task)();
1305
+ clearMethod(handle);
1306
+ currentlyRunning = false;
1307
+ if (result === errorObj) { return thrower(result.e); }
1308
+ }
1309
+ }
1310
+ }
1311
+
1250
1312
  var reNative = RegExp('^' +
1251
1313
  String(toString)
1252
1314
  .replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
@@ -1254,15 +1316,12 @@
1254
1316
  );
1255
1317
 
1256
1318
  var setImmediate = typeof (setImmediate = freeGlobal && moduleExports && freeGlobal.setImmediate) == 'function' &&
1257
- !reNative.test(setImmediate) && setImmediate,
1258
- clearImmediate = typeof (clearImmediate = freeGlobal && moduleExports && freeGlobal.clearImmediate) == 'function' &&
1259
- !reNative.test(clearImmediate) && clearImmediate;
1319
+ !reNative.test(setImmediate) && setImmediate;
1260
1320
 
1261
1321
  function postMessageSupported () {
1262
1322
  // Ensure not in a worker
1263
1323
  if (!root.postMessage || root.importScripts) { return false; }
1264
- var isAsync = false,
1265
- oldHandler = root.onmessage;
1324
+ var isAsync = false, oldHandler = root.onmessage;
1266
1325
  // Test for async
1267
1326
  root.onmessage = function () { isAsync = true; };
1268
1327
  root.postMessage('', '*');
@@ -1272,85 +1331,96 @@
1272
1331
  }
1273
1332
 
1274
1333
  // Use in order, setImmediate, nextTick, postMessage, MessageChannel, script readystatechanged, setTimeout
1275
- if (typeof setImmediate === 'function') {
1276
- scheduleMethod = setImmediate;
1277
- clearMethod = clearImmediate;
1334
+ if (isFunction(setImmediate)) {
1335
+ scheduleMethod = function (action) {
1336
+ var id = nextHandle++;
1337
+ tasksByHandle[id] = action;
1338
+ setImmediate(function () { runTask(id); });
1339
+
1340
+ return id;
1341
+ };
1278
1342
  } else if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') {
1279
- scheduleMethod = process.nextTick;
1343
+ scheduleMethod = function (action) {
1344
+ var id = nextHandle++;
1345
+ tasksByHandle[id] = action;
1346
+ process.nextTick(function () { runTask(id); });
1347
+
1348
+ return id;
1349
+ };
1280
1350
  } else if (postMessageSupported()) {
1281
- var MSG_PREFIX = 'ms.rx.schedule' + Math.random(),
1282
- tasks = {},
1283
- taskId = 0;
1351
+ var MSG_PREFIX = 'ms.rx.schedule' + Math.random();
1284
1352
 
1285
- var onGlobalPostMessage = function (event) {
1353
+ function onGlobalPostMessage(event) {
1286
1354
  // Only if we're a match to avoid any other global events
1287
1355
  if (typeof event.data === 'string' && event.data.substring(0, MSG_PREFIX.length) === MSG_PREFIX) {
1288
- var handleId = event.data.substring(MSG_PREFIX.length),
1289
- action = tasks[handleId];
1290
- action();
1291
- delete tasks[handleId];
1356
+ runTask(event.data.substring(MSG_PREFIX.length));
1292
1357
  }
1293
1358
  }
1294
1359
 
1295
1360
  if (root.addEventListener) {
1296
1361
  root.addEventListener('message', onGlobalPostMessage, false);
1362
+ } else if (root.attachEvent) {
1363
+ root.attachEvent('onmessage', onGlobalPostMessage);
1297
1364
  } else {
1298
- root.attachEvent('onmessage', onGlobalPostMessage, false);
1365
+ root.onmessage = onGlobalPostMessage;
1299
1366
  }
1300
1367
 
1301
1368
  scheduleMethod = function (action) {
1302
- var currentId = taskId++;
1303
- tasks[currentId] = action;
1369
+ var id = nextHandle++;
1370
+ tasksByHandle[id] = action;
1304
1371
  root.postMessage(MSG_PREFIX + currentId, '*');
1372
+ return id;
1305
1373
  };
1306
1374
  } else if (!!root.MessageChannel) {
1307
- var channel = new root.MessageChannel(),
1308
- channelTasks = {},
1309
- channelTaskId = 0;
1375
+ var channel = new root.MessageChannel();
1310
1376
 
1311
- channel.port1.onmessage = function (event) {
1312
- var id = event.data,
1313
- action = channelTasks[id];
1314
- action();
1315
- delete channelTasks[id];
1316
- };
1377
+ channel.port1.onmessage = function (e) { runTask(e.data); };
1317
1378
 
1318
1379
  scheduleMethod = function (action) {
1319
- var id = channelTaskId++;
1320
- channelTasks[id] = action;
1380
+ var id = nextHandle++;
1381
+ tasksByHandle[id] = action;
1321
1382
  channel.port2.postMessage(id);
1383
+ return id;
1322
1384
  };
1323
1385
  } else if ('document' in root && 'onreadystatechange' in root.document.createElement('script')) {
1324
1386
 
1325
1387
  scheduleMethod = function (action) {
1326
1388
  var scriptElement = root.document.createElement('script');
1389
+ var id = nextHandle++;
1390
+ tasksByHandle[id] = action;
1391
+
1327
1392
  scriptElement.onreadystatechange = function () {
1328
- action();
1393
+ runTask(id);
1329
1394
  scriptElement.onreadystatechange = null;
1330
1395
  scriptElement.parentNode.removeChild(scriptElement);
1331
1396
  scriptElement = null;
1332
1397
  };
1333
1398
  root.document.documentElement.appendChild(scriptElement);
1399
+ return id;
1334
1400
  };
1335
1401
 
1336
1402
  } else {
1337
- scheduleMethod = function (action) { return localSetTimeout(action, 0); };
1338
- clearMethod = localClearTimeout;
1403
+ scheduleMethod = function (action) {
1404
+ var id = nextHandle++;
1405
+ tasksByHandle[id] = action;
1406
+ localSetTimeout(function () {
1407
+ runTask(id);
1408
+ }, 0);
1409
+
1410
+ return id;
1411
+ };
1339
1412
  }
1340
1413
  }());
1341
1414
 
1342
1415
  /**
1343
1416
  * Gets a scheduler that schedules work via a timed callback based upon platform.
1344
1417
  */
1345
- var timeoutScheduler = Scheduler.timeout = (function () {
1418
+ var timeoutScheduler = Scheduler.timeout = Scheduler['default'] = (function () {
1346
1419
 
1347
1420
  function scheduleNow(state, action) {
1348
- var scheduler = this,
1349
- disposable = new SingleAssignmentDisposable();
1421
+ var scheduler = this, disposable = new SingleAssignmentDisposable();
1350
1422
  var id = scheduleMethod(function () {
1351
- if (!disposable.isDisposed) {
1352
- disposable.setDisposable(action(scheduler, state));
1353
- }
1423
+ !disposable.isDisposed && disposable.setDisposable(action(scheduler, state));
1354
1424
  });
1355
1425
  return new CompositeDisposable(disposable, disposableCreate(function () {
1356
1426
  clearMethod(id);
@@ -1358,16 +1428,10 @@
1358
1428
  }
1359
1429
 
1360
1430
  function scheduleRelative(state, dueTime, action) {
1361
- var scheduler = this,
1362
- dt = Scheduler.normalize(dueTime);
1363
- if (dt === 0) {
1364
- return scheduler.scheduleWithState(state, action);
1365
- }
1366
- var disposable = new SingleAssignmentDisposable();
1431
+ var scheduler = this, dt = Scheduler.normalize(dueTime), disposable = new SingleAssignmentDisposable();
1432
+ if (dt === 0) { return scheduler.scheduleWithState(state, action); }
1367
1433
  var id = localSetTimeout(function () {
1368
- if (!disposable.isDisposed) {
1369
- disposable.setDisposable(action(scheduler, state));
1370
- }
1434
+ !disposable.isDisposed && disposable.setDisposable(action(scheduler, state));
1371
1435
  }, dt);
1372
1436
  return new CompositeDisposable(disposable, disposableCreate(function () {
1373
1437
  localClearTimeout(id);
@@ -1457,9 +1521,13 @@
1457
1521
  * Represents a notification to an observer.
1458
1522
  */
1459
1523
  var Notification = Rx.Notification = (function () {
1460
- function Notification(kind, hasValue) {
1461
- this.hasValue = hasValue == null ? false : hasValue;
1524
+ function Notification(kind, value, exception, accept, acceptObservable, toString) {
1462
1525
  this.kind = kind;
1526
+ this.value = value;
1527
+ this.exception = exception;
1528
+ this._accept = accept;
1529
+ this._acceptObservable = acceptObservable;
1530
+ this.toString = toString;
1463
1531
  }
1464
1532
 
1465
1533
  /**
@@ -1485,10 +1553,10 @@
1485
1553
  * @returns {Observable} The observable sequence that surfaces the behavior of the notification upon subscription.
1486
1554
  */
1487
1555
  Notification.prototype.toObservable = function (scheduler) {
1488
- var notification = this;
1556
+ var self = this;
1489
1557
  isScheduler(scheduler) || (scheduler = immediateScheduler);
1490
1558
  return new AnonymousObservable(function (observer) {
1491
- return scheduler.schedule(function () {
1559
+ return scheduler.scheduleWithState(self, function (_, notification) {
1492
1560
  notification._acceptObservable(observer);
1493
1561
  notification.kind === 'N' && observer.onCompleted();
1494
1562
  });
@@ -1504,18 +1572,12 @@
1504
1572
  * @returns {Notification} The OnNext notification containing the value.
1505
1573
  */
1506
1574
  var notificationCreateOnNext = Notification.createOnNext = (function () {
1507
-
1508
- function _accept (onNext) { return onNext(this.value); }
1575
+ function _accept(onNext) { return onNext(this.value); }
1509
1576
  function _acceptObservable(observer) { return observer.onNext(this.value); }
1510
- function toString () { return 'OnNext(' + this.value + ')'; }
1577
+ function toString() { return 'OnNext(' + this.value + ')'; }
1511
1578
 
1512
1579
  return function (value) {
1513
- var notification = new Notification('N', true);
1514
- notification.value = value;
1515
- notification._accept = _accept;
1516
- notification._acceptObservable = _acceptObservable;
1517
- notification.toString = toString;
1518
- return notification;
1580
+ return new Notification('N', value, null, _accept, _acceptObservable, toString);
1519
1581
  };
1520
1582
  }());
1521
1583
 
@@ -1525,18 +1587,12 @@
1525
1587
  * @returns {Notification} The OnError notification containing the exception.
1526
1588
  */
1527
1589
  var notificationCreateOnError = Notification.createOnError = (function () {
1528
-
1529
1590
  function _accept (onNext, onError) { return onError(this.exception); }
1530
1591
  function _acceptObservable(observer) { return observer.onError(this.exception); }
1531
1592
  function toString () { return 'OnError(' + this.exception + ')'; }
1532
1593
 
1533
1594
  return function (e) {
1534
- var notification = new Notification('E');
1535
- notification.exception = e;
1536
- notification._accept = _accept;
1537
- notification._acceptObservable = _acceptObservable;
1538
- notification.toString = toString;
1539
- return notification;
1595
+ return new Notification('E', null, e, _accept, _acceptObservable, toString);
1540
1596
  };
1541
1597
  }());
1542
1598
 
@@ -1545,17 +1601,12 @@
1545
1601
  * @returns {Notification} The OnCompleted notification.
1546
1602
  */
1547
1603
  var notificationCreateOnCompleted = Notification.createOnCompleted = (function () {
1548
-
1549
1604
  function _accept (onNext, onError, onCompleted) { return onCompleted(); }
1550
1605
  function _acceptObservable(observer) { return observer.onCompleted(); }
1551
1606
  function toString () { return 'OnCompleted()'; }
1552
1607
 
1553
1608
  return function () {
1554
- var notification = new Notification('C');
1555
- notification._accept = _accept;
1556
- notification._acceptObservable = _acceptObservable;
1557
- notification.toString = toString;
1558
- return notification;
1609
+ return new Notification('C', null, null, _accept, _acceptObservable, toString);
1559
1610
  };
1560
1611
  }());
1561
1612
 
@@ -1830,10 +1881,6 @@
1830
1881
  __super__.call(this);
1831
1882
  }
1832
1883
 
1833
- function notImplemented() {
1834
- throw new Error('Method not implemented');
1835
- }
1836
-
1837
1884
  // Must be implemented by other observers
1838
1885
  AbstractObserver.prototype.next = notImplemented;
1839
1886
  AbstractObserver.prototype.error = notImplemented;
@@ -1933,58 +1980,46 @@
1933
1980
  return AnonymousObserver;
1934
1981
  }(AbstractObserver));
1935
1982
 
1936
- var CheckedObserver = (function (_super) {
1937
- inherits(CheckedObserver, _super);
1983
+ var CheckedObserver = (function (__super__) {
1984
+ inherits(CheckedObserver, __super__);
1938
1985
 
1939
- function CheckedObserver(observer) {
1940
- _super.call(this);
1941
- this._observer = observer;
1942
- this._state = 0; // 0 - idle, 1 - busy, 2 - done
1943
- }
1986
+ function CheckedObserver(observer) {
1987
+ __super__.call(this);
1988
+ this._observer = observer;
1989
+ this._state = 0; // 0 - idle, 1 - busy, 2 - done
1990
+ }
1944
1991
 
1945
- var CheckedObserverPrototype = CheckedObserver.prototype;
1992
+ var CheckedObserverPrototype = CheckedObserver.prototype;
1946
1993
 
1947
- CheckedObserverPrototype.onNext = function (value) {
1948
- this.checkAccess();
1949
- try {
1950
- this._observer.onNext(value);
1951
- } catch (e) {
1952
- throw e;
1953
- } finally {
1954
- this._state = 0;
1955
- }
1956
- };
1994
+ CheckedObserverPrototype.onNext = function (value) {
1995
+ this.checkAccess();
1996
+ var res = tryCatch(this._observer.onNext).call(this._observer, value);
1997
+ this._state = 0;
1998
+ res === errorObj && thrower(res.e);
1999
+ };
1957
2000
 
1958
- CheckedObserverPrototype.onError = function (err) {
1959
- this.checkAccess();
1960
- try {
1961
- this._observer.onError(err);
1962
- } catch (e) {
1963
- throw e;
1964
- } finally {
1965
- this._state = 2;
1966
- }
1967
- };
2001
+ CheckedObserverPrototype.onError = function (err) {
2002
+ this.checkAccess();
2003
+ var res = tryCatch(this._observer.onError).call(this._observer, err);
2004
+ this._state = 2;
2005
+ res === errorObj && thrower(res.e);
2006
+ };
1968
2007
 
1969
- CheckedObserverPrototype.onCompleted = function () {
1970
- this.checkAccess();
1971
- try {
1972
- this._observer.onCompleted();
1973
- } catch (e) {
1974
- throw e;
1975
- } finally {
1976
- this._state = 2;
1977
- }
1978
- };
2008
+ CheckedObserverPrototype.onCompleted = function () {
2009
+ this.checkAccess();
2010
+ var res = tryCatch(this._observer.onCompleted).call(this._observer);
2011
+ this._state = 2;
2012
+ res === errorObj && thrower(res.e);
2013
+ };
1979
2014
 
1980
- CheckedObserverPrototype.checkAccess = function () {
1981
- if (this._state === 1) { throw new Error('Re-entrancy detected'); }
1982
- if (this._state === 2) { throw new Error('Observer completed'); }
1983
- if (this._state === 0) { this._state = 1; }
1984
- };
2015
+ CheckedObserverPrototype.checkAccess = function () {
2016
+ if (this._state === 1) { throw new Error('Re-entrancy detected'); }
2017
+ if (this._state === 2) { throw new Error('Observer completed'); }
2018
+ if (this._state === 0) { this._state = 1; }
2019
+ };
1985
2020
 
1986
- return CheckedObserver;
1987
- }(Observer));
2021
+ return CheckedObserver;
2022
+ }(Observer));
1988
2023
 
1989
2024
  var ScheduledObserver = Rx.internals.ScheduledObserver = (function (__super__) {
1990
2025
  inherits(ScheduledObserver, __super__);
@@ -2161,25 +2196,21 @@
2161
2196
  })();
2162
2197
 
2163
2198
  var ObservableBase = Rx.ObservableBase = (function (__super__) {
2199
+ inherits(ObservableBase, __super__);
2164
2200
 
2165
- inherits(ObservableBase, __super__);
2166
-
2167
- // Fix subscriber to check for undefined or function returned to decorate as Disposable
2168
- function fixSubscriber(subscriber) {
2169
- if (subscriber && typeof subscriber.dispose === 'function') { return subscriber; }
2170
-
2171
- return typeof subscriber === 'function' ?
2172
- disposableCreate(subscriber) :
2173
- disposableEmpty;
2201
+ function fixSubscriber(subscriber) {
2202
+ return subscriber && isFunction(subscriber.dispose) ? subscriber :
2203
+ isFunction(subscriber) ? disposableCreate(subscriber) : disposableEmpty;
2174
2204
  }
2175
2205
 
2176
2206
  function setDisposable(s, state) {
2177
2207
  var ado = state[0], self = state[1];
2178
- try {
2179
- ado.setDisposable(fixSubscriber(self.subscribeCore(ado)));
2180
- } catch (e) {
2181
- if (!ado.fail(e)) { throw e; }
2208
+ var sub = tryCatch(self.subscribeCore).call(self, ado);
2209
+
2210
+ if (sub === errorObj) {
2211
+ if(!ado.fail(errorObj.e)) { return thrower(errorObj.e); }
2182
2212
  }
2213
+ ado.setDisposable(fixSubscriber(sub));
2183
2214
  }
2184
2215
 
2185
2216
  function subscribe(observer) {
@@ -2190,7 +2221,6 @@
2190
2221
  } else {
2191
2222
  setDisposable(null, state);
2192
2223
  }
2193
-
2194
2224
  return ado;
2195
2225
  }
2196
2226
 
@@ -2198,12 +2228,9 @@
2198
2228
  __super__.call(this, subscribe);
2199
2229
  }
2200
2230
 
2201
- ObservableBase.prototype.subscribeCore = function(observer) {
2202
- throw new Error('Not implemeneted');
2203
- }
2231
+ ObservableBase.prototype.subscribeCore = notImplemented;
2204
2232
 
2205
2233
  return ObservableBase;
2206
-
2207
2234
  }(Observable));
2208
2235
 
2209
2236
  /**
@@ -2277,7 +2304,7 @@
2277
2304
  */
2278
2305
  observableProto.toPromise = function (promiseCtor) {
2279
2306
  promiseCtor || (promiseCtor = Rx.config.Promise);
2280
- if (!promiseCtor) { throw new TypeError('Promise type not provided nor in Rx.config.Promise'); }
2307
+ if (!promiseCtor) { throw new NotSupportedError('Promise type not provided nor in Rx.config.Promise'); }
2281
2308
  var source = this;
2282
2309
  return new promiseCtor(function (resolve, reject) {
2283
2310
  // No cancellation can be done
@@ -2377,6 +2404,34 @@
2377
2404
  });
2378
2405
  };
2379
2406
 
2407
+ var EmptyObservable = (function(__super__) {
2408
+ inherits(EmptyObservable, __super__);
2409
+ function EmptyObservable(scheduler) {
2410
+ this.scheduler = scheduler;
2411
+ __super__.call(this);
2412
+ }
2413
+
2414
+ EmptyObservable.prototype.subscribeCore = function (observer) {
2415
+ var sink = new EmptySink(observer, this);
2416
+ return sink.run();
2417
+ };
2418
+
2419
+ function EmptySink(observer, parent) {
2420
+ this.observer = observer;
2421
+ this.parent = parent;
2422
+ }
2423
+
2424
+ function scheduleItem(s, state) {
2425
+ state.onCompleted();
2426
+ }
2427
+
2428
+ EmptySink.prototype.run = function () {
2429
+ return this.parent.scheduler.scheduleWithState(this.observer, scheduleItem);
2430
+ };
2431
+
2432
+ return EmptyObservable;
2433
+ }(ObservableBase));
2434
+
2380
2435
  /**
2381
2436
  * Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message.
2382
2437
  *
@@ -2388,11 +2443,7 @@
2388
2443
  */
2389
2444
  var observableEmpty = Observable.empty = function (scheduler) {
2390
2445
  isScheduler(scheduler) || (scheduler = immediateScheduler);
2391
- return new AnonymousObservable(function (observer) {
2392
- return scheduler.schedule(function () {
2393
- observer.onCompleted();
2394
- });
2395
- });
2446
+ return new EmptyObservable(scheduler);
2396
2447
  };
2397
2448
 
2398
2449
  var FromObservable = (function(__super__) {
@@ -2564,7 +2615,7 @@
2564
2615
  inherits(FromArrayObservable, __super__);
2565
2616
  function FromArrayObservable(args, scheduler) {
2566
2617
  this.args = args;
2567
- this.scheduler = scheduler || currentThreadScheduler;
2618
+ this.scheduler = scheduler;
2568
2619
  __super__.call(this);
2569
2620
  }
2570
2621
 
@@ -2602,6 +2653,7 @@
2602
2653
  * @returns {Observable} The observable sequence whose elements are pulled from the given enumerable sequence.
2603
2654
  */
2604
2655
  var observableFromArray = Observable.fromArray = function (array, scheduler) {
2656
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
2605
2657
  return new FromArrayObservable(array, scheduler)
2606
2658
  };
2607
2659
 
@@ -2620,9 +2672,9 @@
2620
2672
  */
2621
2673
  Observable.generate = function (initialState, condition, iterate, resultSelector, scheduler) {
2622
2674
  isScheduler(scheduler) || (scheduler = currentThreadScheduler);
2623
- return new AnonymousObservable(function (observer) {
2624
- var first = true, state = initialState;
2625
- return scheduler.scheduleRecursive(function (self) {
2675
+ return new AnonymousObservable(function (o) {
2676
+ var first = true;
2677
+ return scheduler.scheduleRecursiveWithState(initialState, function (state, self) {
2626
2678
  var hasResult, result;
2627
2679
  try {
2628
2680
  if (first) {
@@ -2631,24 +2683,22 @@
2631
2683
  state = iterate(state);
2632
2684
  }
2633
2685
  hasResult = condition(state);
2634
- if (hasResult) {
2635
- result = resultSelector(state);
2636
- }
2637
- } catch (exception) {
2638
- observer.onError(exception);
2639
- return;
2686
+ hasResult && (result = resultSelector(state));
2687
+ } catch (e) {
2688
+ return o.onError(e);
2640
2689
  }
2641
2690
  if (hasResult) {
2642
- observer.onNext(result);
2643
- self();
2691
+ o.onNext(result);
2692
+ self(state);
2644
2693
  } else {
2645
- observer.onCompleted();
2694
+ o.onCompleted();
2646
2695
  }
2647
2696
  });
2648
2697
  });
2649
2698
  };
2650
2699
 
2651
2700
  function observableOf (scheduler, array) {
2701
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
2652
2702
  return new FromArrayObservable(array, scheduler);
2653
2703
  }
2654
2704
 
@@ -2659,7 +2709,7 @@
2659
2709
  Observable.of = function () {
2660
2710
  var len = arguments.length, args = new Array(len);
2661
2711
  for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
2662
- return new FromArrayObservable(args);
2712
+ return new FromArrayObservable(args, currentThreadScheduler);
2663
2713
  };
2664
2714
 
2665
2715
  /**
@@ -2719,14 +2769,62 @@
2719
2769
  });
2720
2770
  };
2721
2771
 
2772
+ var NeverObservable = (function(__super__) {
2773
+ inherits(NeverObservable, __super__);
2774
+ function NeverObservable() {
2775
+ __super__.call(this);
2776
+ }
2777
+
2778
+ NeverObservable.prototype.subscribeCore = function (observer) {
2779
+ return disposableEmpty;
2780
+ };
2781
+
2782
+ return NeverObservable;
2783
+ }(ObservableBase));
2784
+
2722
2785
  /**
2723
- * Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins).
2786
+ * Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins).
2724
2787
  * @returns {Observable} An observable sequence whose observers will never get called.
2725
2788
  */
2726
2789
  var observableNever = Observable.never = function () {
2727
- return new AnonymousObservable(function () {
2728
- return disposableEmpty;
2729
- });
2790
+ return new NeverObservable();
2791
+ };
2792
+
2793
+ var PairsObservable = (function(__super__) {
2794
+ inherits(PairsObservable, __super__);
2795
+ function PairsObservable(obj, scheduler) {
2796
+ this.obj = obj;
2797
+ this.keys = Object.keys(obj);
2798
+ this.scheduler = scheduler;
2799
+ __super__.call(this);
2800
+ }
2801
+
2802
+ PairsObservable.prototype.subscribeCore = function (observer) {
2803
+ var sink = new PairsSink(observer, this);
2804
+ return sink.run();
2805
+ };
2806
+
2807
+ return PairsObservable;
2808
+ }(ObservableBase));
2809
+
2810
+ function PairsSink(observer, parent) {
2811
+ this.observer = observer;
2812
+ this.parent = parent;
2813
+ }
2814
+
2815
+ PairsSink.prototype.run = function () {
2816
+ var observer = this.observer, obj = this.parent.obj, keys = this.parent.keys, len = keys.length;
2817
+ function loopRecursive(i, recurse) {
2818
+ if (i < len) {
2819
+ var key = keys[i];
2820
+ observer.onNext([key, obj[key]]);
2821
+ recurse(i + 1);
2822
+ } else {
2823
+ observer.onCompleted();
2824
+ }
2825
+ }
2826
+
2827
+ return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
2730
2828
  };
2731
2829
 
2732
2830
  /**
@@ -2736,19 +2834,8 @@
2736
2834
  * @returns {Observable} An observable sequence of [key, value] pairs from the object.
2737
2835
  */
2738
2836
  Observable.pairs = function (obj, scheduler) {
2739
- scheduler || (scheduler = Rx.Scheduler.currentThread);
2740
- return new AnonymousObservable(function (observer) {
2741
- var keys = Object.keys(obj), len = keys.length;
2742
- return scheduler.scheduleRecursiveWithState(0, function (idx, self) {
2743
- if (idx < len) {
2744
- var key = keys[idx];
2745
- observer.onNext([key, obj[key]]);
2746
- self(idx + 1);
2747
- } else {
2748
- observer.onCompleted();
2749
- }
2750
- });
2751
- });
2837
+ scheduler || (scheduler = currentThreadScheduler);
2838
+ return new PairsObservable(obj, scheduler);
2752
2839
  };
2753
2840
 
2754
2841
  var RangeObservable = (function(__super__) {
@@ -2803,14 +2890,44 @@
2803
2890
  return new RangeObservable(start, count, scheduler);
2804
2891
  };
2805
2892
 
2893
+ var RepeatObservable = (function(__super__) {
2894
+ inherits(RepeatObservable, __super__);
2895
+ function RepeatObservable(value, repeatCount, scheduler) {
2896
+ this.value = value;
2897
+ this.repeatCount = repeatCount == null ? -1 : repeatCount;
2898
+ this.scheduler = scheduler;
2899
+ __super__.call(this);
2900
+ }
2901
+
2902
+ RepeatObservable.prototype.subscribeCore = function (observer) {
2903
+ var sink = new RepeatSink(observer, this);
2904
+ return sink.run();
2905
+ };
2906
+
2907
+ return RepeatObservable;
2908
+ }(ObservableBase));
2909
+
2910
+ function RepeatSink(observer, parent) {
2911
+ this.observer = observer;
2912
+ this.parent = parent;
2913
+ }
2914
+
2915
+ RepeatSink.prototype.run = function () {
2916
+ var observer = this.observer, value = this.parent.value;
2917
+ function loopRecursive(i, recurse) {
2918
+ if (i === -1 || i > 0) {
2919
+ observer.onNext(value);
2920
+ i > 0 && i--;
2921
+ }
2922
+ if (i === 0) { return observer.onCompleted(); }
2923
+ recurse(i);
2924
+ }
2925
+
2926
+ return this.parent.scheduler.scheduleRecursiveWithState(this.parent.repeatCount, loopRecursive);
2927
+ };
2928
+
2806
2929
  /**
2807
2930
  * Generates an observable sequence that repeats the given element the specified number of times, using the specified scheduler to send out observer messages.
2808
- *
2809
- * @example
2810
- * var res = Rx.Observable.repeat(42);
2811
- * var res = Rx.Observable.repeat(42, 4);
2812
- * 3 - res = Rx.Observable.repeat(42, 4, Rx.Scheduler.timeout);
2813
- * 4 - res = Rx.Observable.repeat(42, null, Rx.Scheduler.timeout);
2814
2931
  * @param {Mixed} value Element to repeat.
2815
2932
  * @param {Number} repeatCount [Optiona] Number of times to repeat the element. If not specified, repeats indefinitely.
2816
2933
  * @param {Scheduler} scheduler Scheduler to run the producer loop on. If not specified, defaults to Scheduler.immediate.
@@ -2818,31 +2935,81 @@
2818
2935
  */
2819
2936
  Observable.repeat = function (value, repeatCount, scheduler) {
2820
2937
  isScheduler(scheduler) || (scheduler = currentThreadScheduler);
2821
- return observableReturn(value, scheduler).repeat(repeatCount == null ? -1 : repeatCount);
2938
+ return new RepeatObservable(value, repeatCount, scheduler);
2822
2939
  };
2823
2940
 
2941
+ var JustObservable = (function(__super__) {
2942
+ inherits(JustObservable, __super__);
2943
+ function JustObservable(value, scheduler) {
2944
+ this.value = value;
2945
+ this.scheduler = scheduler;
2946
+ __super__.call(this);
2947
+ }
2948
+
2949
+ JustObservable.prototype.subscribeCore = function (observer) {
2950
+ var sink = new JustSink(observer, this);
2951
+ return sink.run();
2952
+ };
2953
+
2954
+ function JustSink(observer, parent) {
2955
+ this.observer = observer;
2956
+ this.parent = parent;
2957
+ }
2958
+
2959
+ function scheduleItem(s, state) {
2960
+ var value = state[0], observer = state[1];
2961
+ observer.onNext(value);
2962
+ observer.onCompleted();
2963
+ }
2964
+
2965
+ JustSink.prototype.run = function () {
2966
+ return this.parent.scheduler.scheduleWithState([this.parent.value, this.observer], scheduleItem);
2967
+ };
2968
+
2969
+ return JustObservable;
2970
+ }(ObservableBase));
2971
+
2824
2972
  /**
2825
2973
  * Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages.
2826
- * There is an alias called 'just', and 'returnValue' for browsers <IE9.
2974
+ * There is an alias called 'just' or browsers <IE9.
2827
2975
  * @param {Mixed} value Single element in the resulting observable sequence.
2828
2976
  * @param {Scheduler} scheduler Scheduler to send the single element on. If not specified, defaults to Scheduler.immediate.
2829
2977
  * @returns {Observable} An observable sequence containing the single specified element.
2830
2978
  */
2831
- var observableReturn = Observable['return'] = Observable.just = function (value, scheduler) {
2979
+ var observableReturn = Observable['return'] = Observable.just = Observable.returnValue = function (value, scheduler) {
2832
2980
  isScheduler(scheduler) || (scheduler = immediateScheduler);
2833
- return new AnonymousObservable(function (observer) {
2834
- return scheduler.schedule(function () {
2835
- observer.onNext(value);
2836
- observer.onCompleted();
2837
- });
2838
- });
2981
+ return new JustObservable(value, scheduler);
2839
2982
  };
2840
2983
 
2841
- /** @deprecated use return or just */
2842
- Observable.returnValue = function () {
2843
- //deprecate('returnValue', 'return or just');
2844
- return observableReturn.apply(null, arguments);
2845
- };
2984
+ var ThrowObservable = (function(__super__) {
2985
+ inherits(ThrowObservable, __super__);
2986
+ function ThrowObservable(error, scheduler) {
2987
+ this.error = error;
2988
+ this.scheduler = scheduler;
2989
+ __super__.call(this);
2990
+ }
2991
+
2992
+ ThrowObservable.prototype.subscribeCore = function (observer) {
2993
+ var sink = new ThrowSink(observer, this);
2994
+ return sink.run();
2995
+ };
2996
+
2997
+ function ThrowSink(observer, parent) {
2998
+ this.observer = observer;
2999
+ this.parent = parent;
3000
+ }
3001
+
3002
+ function scheduleItem(s, state) {
3003
+ var error = state[0], observer = state[1];
3004
+ observer.onError(error);
3005
+ }
3006
+
3007
+ ThrowSink.prototype.run = function () {
3008
+ return this.parent.scheduler.scheduleWithState([this.parent.error, this.observer], scheduleItem);
3009
+ };
3010
+
3011
+ return ThrowObservable;
3012
+ }(ObservableBase));
2846
3013
 
2847
3014
  /**
2848
3015
  * Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single onError message.
@@ -2851,19 +3018,9 @@
2851
3018
  * @param {Scheduler} scheduler Scheduler to send the exceptional termination call on. If not specified, defaults to Scheduler.immediate.
2852
3019
  * @returns {Observable} The observable sequence that terminates exceptionally with the specified exception object.
2853
3020
  */
2854
- var observableThrow = Observable['throw'] = Observable.throwError = function (error, scheduler) {
3021
+ var observableThrow = Observable['throw'] = Observable.throwError = Observable.throwException = function (error, scheduler) {
2855
3022
  isScheduler(scheduler) || (scheduler = immediateScheduler);
2856
- return new AnonymousObservable(function (observer) {
2857
- return scheduler.schedule(function () {
2858
- observer.onError(error);
2859
- });
2860
- });
2861
- };
2862
-
2863
- /** @deprecated use #some instead */
2864
- Observable.throwException = function () {
2865
- //deprecate('throwException', 'throwError');
2866
- return Observable.throwError.apply(null, arguments);
3023
+ return new ThrowObservable(error, scheduler);
2867
3024
  };
2868
3025
 
2869
3026
  /**
@@ -3059,24 +3216,23 @@
3059
3216
  var len = arguments.length, args = new Array(len);
3060
3217
  for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
3061
3218
  var resultSelector = args.pop();
3062
- len--;
3063
3219
  Array.isArray(args[0]) && (args = args[0]);
3064
3220
 
3065
3221
  return new AnonymousObservable(function (o) {
3066
- var falseFactory = function () { return false; },
3067
- hasValue = arrayInitialize(len, falseFactory),
3222
+ var n = args.length,
3223
+ falseFactory = function () { return false; },
3224
+ hasValue = arrayInitialize(n, falseFactory),
3068
3225
  hasValueAll = false,
3069
- isDone = arrayInitialize(len, falseFactory),
3070
- values = new Array(len);
3226
+ isDone = arrayInitialize(n, falseFactory),
3227
+ values = new Array(n);
3071
3228
 
3072
3229
  function next(i) {
3073
3230
  hasValue[i] = true;
3074
3231
  if (hasValueAll || (hasValueAll = hasValue.every(identity))) {
3075
3232
  try {
3076
3233
  var res = resultSelector.apply(null, values);
3077
- } catch (ex) {
3078
- o.onError(ex);
3079
- return;
3234
+ } catch (e) {
3235
+ return o.onError(e);
3080
3236
  }
3081
3237
  o.onNext(res);
3082
3238
  } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
@@ -3089,8 +3245,8 @@
3089
3245
  isDone.every(identity) && o.onCompleted();
3090
3246
  }
3091
3247
 
3092
- var subscriptions = new Array(len);
3093
- for (var idx = 0; idx < len; idx++) {
3248
+ var subscriptions = new Array(n);
3249
+ for (var idx = 0; idx < n; idx++) {
3094
3250
  (function (i) {
3095
3251
  var source = args[i], sad = new SingleAssignmentDisposable();
3096
3252
  isPromise(source) && (source = observableFromPromise(source));
@@ -3143,52 +3299,131 @@
3143
3299
  return this.merge(1);
3144
3300
  };
3145
3301
 
3146
- /**
3147
- * Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences.
3148
- * Or merges two observable sequences into a single observable sequence.
3149
- *
3150
- * @example
3151
- * 1 - merged = sources.merge(1);
3152
- * 2 - merged = source.merge(otherSource);
3153
- * @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence.
3154
- * @returns {Observable} The observable sequence that merges the elements of the inner sequences.
3155
- */
3156
- observableProto.merge = function (maxConcurrentOrOther) {
3157
- if (typeof maxConcurrentOrOther !== 'number') { return observableMerge(this, maxConcurrentOrOther); }
3158
- var sources = this;
3159
- return new AnonymousObservable(function (o) {
3160
- var activeCount = 0, group = new CompositeDisposable(), isStopped = false, q = [];
3302
+ var MergeObservable = (function (__super__) {
3303
+ inherits(MergeObservable, __super__);
3304
+
3305
+ function MergeObservable(source, maxConcurrent) {
3306
+ this.source = source;
3307
+ this.maxConcurrent = maxConcurrent;
3308
+ __super__.call(this);
3309
+ }
3161
3310
 
3162
- function subscribe(xs) {
3163
- var subscription = new SingleAssignmentDisposable();
3164
- group.add(subscription);
3311
+ MergeObservable.prototype.subscribeCore = function(observer) {
3312
+ var g = new CompositeDisposable();
3313
+ g.add(this.source.subscribe(new MergeObserver(observer, this.maxConcurrent, g)));
3314
+ return g;
3315
+ };
3316
+
3317
+ return MergeObservable;
3318
+
3319
+ }(ObservableBase));
3320
+
3321
+ var MergeObserver = (function () {
3322
+ function MergeObserver(o, max, g) {
3323
+ this.o = o;
3324
+ this.max = max;
3325
+ this.g = g;
3326
+ this.done = false;
3327
+ this.q = [];
3328
+ this.activeCount = 0;
3329
+ this.isStopped = false;
3330
+ }
3331
+ MergeObserver.prototype.handleSubscribe = function (xs) {
3332
+ var sad = new SingleAssignmentDisposable();
3333
+ this.g.add(sad);
3334
+ isPromise(xs) && (xs = observableFromPromise(xs));
3335
+ sad.setDisposable(xs.subscribe(new InnerObserver(this, sad)));
3336
+ };
3337
+ MergeObserver.prototype.onNext = function (innerSource) {
3338
+ if (this.isStopped) { return; }
3339
+ if(this.activeCount < this.max) {
3340
+ this.activeCount++;
3341
+ this.handleSubscribe(innerSource);
3342
+ } else {
3343
+ this.q.push(innerSource);
3344
+ }
3345
+ };
3346
+ MergeObserver.prototype.onError = function (e) {
3347
+ if (!this.isStopped) {
3348
+ this.isStopped = true;
3349
+ this.o.onError(e);
3350
+ }
3351
+ };
3352
+ MergeObserver.prototype.onCompleted = function () {
3353
+ if (!this.isStopped) {
3354
+ this.isStopped = true;
3355
+ this.done = true;
3356
+ this.activeCount === 0 && this.o.onCompleted();
3357
+ }
3358
+ };
3359
+ MergeObserver.prototype.dispose = function() { this.isStopped = true; };
3360
+ MergeObserver.prototype.fail = function (e) {
3361
+ if (!this.isStopped) {
3362
+ this.isStopped = true;
3363
+ this.o.onError(e);
3364
+ return true;
3365
+ }
3165
3366
 
3166
- // Check for promises support
3167
- isPromise(xs) && (xs = observableFromPromise(xs));
3367
+ return false;
3368
+ };
3168
3369
 
3169
- subscription.setDisposable(xs.subscribe(function (x) { o.onNext(x); }, function (e) { o.onError(e); }, function () {
3170
- group.remove(subscription);
3171
- if (q.length > 0) {
3172
- subscribe(q.shift());
3370
+ function InnerObserver(parent, sad) {
3371
+ this.parent = parent;
3372
+ this.sad = sad;
3373
+ this.isStopped = false;
3374
+ }
3375
+ InnerObserver.prototype.onNext = function (x) { if(!this.isStopped) { this.parent.o.onNext(x); } };
3376
+ InnerObserver.prototype.onError = function (e) {
3377
+ if (!this.isStopped) {
3378
+ this.isStopped = true;
3379
+ this.parent.o.onError(e);
3380
+ }
3381
+ };
3382
+ InnerObserver.prototype.onCompleted = function () {
3383
+ if(!this.isStopped) {
3384
+ this.isStopped = true;
3385
+ var parent = this.parent;
3386
+ parent.g.remove(this.sad);
3387
+ if (parent.q.length > 0) {
3388
+ parent.handleSubscribe(parent.q.shift());
3173
3389
  } else {
3174
- activeCount--;
3175
- isStopped && activeCount === 0 && o.onCompleted();
3390
+ parent.activeCount--;
3391
+ parent.done && parent.activeCount === 0 && parent.o.onCompleted();
3176
3392
  }
3177
- }));
3178
- }
3179
- group.add(sources.subscribe(function (innerSource) {
3180
- if (activeCount < maxConcurrentOrOther) {
3181
- activeCount++;
3182
- subscribe(innerSource);
3183
- } else {
3184
- q.push(innerSource);
3185
3393
  }
3186
- }, function (e) { o.onError(e); }, function () {
3187
- isStopped = true;
3188
- activeCount === 0 && o.onCompleted();
3189
- }));
3190
- return group;
3191
- }, sources);
3394
+ };
3395
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
3396
+ InnerObserver.prototype.fail = function (e) {
3397
+ if (!this.isStopped) {
3398
+ this.isStopped = true;
3399
+ this.parent.o.onError(e);
3400
+ return true;
3401
+ }
3402
+
3403
+ return false;
3404
+ };
3405
+
3406
+ return MergeObserver;
3407
+ }());
3408
+
3409
+
3410
+
3411
+
3412
+
3413
+ /**
3414
+ * Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences.
3415
+ * Or merges two observable sequences into a single observable sequence.
3416
+ *
3417
+ * @example
3418
+ * 1 - merged = sources.merge(1);
3419
+ * 2 - merged = source.merge(otherSource);
3420
+ * @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence.
3421
+ * @returns {Observable} The observable sequence that merges the elements of the inner sequences.
3422
+ */
3423
+ observableProto.merge = function (maxConcurrentOrOther) {
3424
+ return typeof maxConcurrentOrOther !== 'number' ?
3425
+ observableMerge(this, maxConcurrentOrOther) :
3426
+ new MergeObservable(this, maxConcurrentOrOther);
3192
3427
  };
3193
3428
 
3194
3429
  /**
@@ -3214,35 +3449,188 @@
3214
3449
  return observableOf(scheduler, sources).mergeAll();
3215
3450
  };
3216
3451
 
3452
+ var MergeAllObservable = (function (__super__) {
3453
+ inherits(MergeAllObservable, __super__);
3454
+
3455
+ function MergeAllObservable(source) {
3456
+ this.source = source;
3457
+ __super__.call(this);
3458
+ }
3459
+
3460
+ MergeAllObservable.prototype.subscribeCore = function (observer) {
3461
+ var g = new CompositeDisposable(), m = new SingleAssignmentDisposable();
3462
+ g.add(m);
3463
+ m.setDisposable(this.source.subscribe(new MergeAllObserver(observer, g)));
3464
+ return g;
3465
+ };
3466
+
3467
+ return MergeAllObservable;
3468
+ }(ObservableBase));
3469
+
3470
+ var MergeAllObserver = (function() {
3471
+
3472
+ function MergeAllObserver(o, g) {
3473
+ this.o = o;
3474
+ this.g = g;
3475
+ this.isStopped = false;
3476
+ this.done = false;
3477
+ }
3478
+ MergeAllObserver.prototype.onNext = function(innerSource) {
3479
+ if(this.isStopped) { return; }
3480
+ var sad = new SingleAssignmentDisposable();
3481
+ this.g.add(sad);
3482
+
3483
+ isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
3484
+
3485
+ sad.setDisposable(innerSource.subscribe(new InnerObserver(this, this.g, sad)));
3486
+ };
3487
+ MergeAllObserver.prototype.onError = function (e) {
3488
+ if(!this.isStopped) {
3489
+ this.isStopped = true;
3490
+ this.o.onError(e);
3491
+ }
3492
+ };
3493
+ MergeAllObserver.prototype.onCompleted = function () {
3494
+ if(!this.isStopped) {
3495
+ this.isStopped = true;
3496
+ this.done = true;
3497
+ this.g.length === 1 && this.o.onCompleted();
3498
+ }
3499
+ };
3500
+ MergeAllObserver.prototype.dispose = function() { this.isStopped = true; };
3501
+ MergeAllObserver.prototype.fail = function (e) {
3502
+ if (!this.isStopped) {
3503
+ this.isStopped = true;
3504
+ this.o.onError(e);
3505
+ return true;
3506
+ }
3507
+
3508
+ return false;
3509
+ };
3510
+
3511
+ function InnerObserver(parent, g, sad) {
3512
+ this.parent = parent;
3513
+ this.g = g;
3514
+ this.sad = sad;
3515
+ this.isStopped = false;
3516
+ }
3517
+ InnerObserver.prototype.onNext = function (x) { if (!this.isStopped) { this.parent.o.onNext(x); } };
3518
+ InnerObserver.prototype.onError = function (e) {
3519
+ if(!this.isStopped) {
3520
+ this.isStopped = true;
3521
+ this.parent.o.onError(e);
3522
+ }
3523
+ };
3524
+ InnerObserver.prototype.onCompleted = function () {
3525
+ if(!this.isStopped) {
3526
+ var parent = this.parent;
3527
+ this.isStopped = true;
3528
+ parent.g.remove(this.sad);
3529
+ parent.done && parent.g.length === 1 && parent.o.onCompleted();
3530
+ }
3531
+ };
3532
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
3533
+ InnerObserver.prototype.fail = function (e) {
3534
+ if (!this.isStopped) {
3535
+ this.isStopped = true;
3536
+ this.parent.o.onError(e);
3537
+ return true;
3538
+ }
3539
+
3540
+ return false;
3541
+ };
3542
+
3543
+ return MergeAllObserver;
3544
+
3545
+ }());
3546
+
3217
3547
  /**
3218
- * Merges an observable sequence of observable sequences into an observable sequence.
3219
- * @returns {Observable} The observable sequence that merges the elements of the inner sequences.
3220
- */
3548
+ * Merges an observable sequence of observable sequences into an observable sequence.
3549
+ * @returns {Observable} The observable sequence that merges the elements of the inner sequences.
3550
+ */
3221
3551
  observableProto.mergeAll = observableProto.mergeObservable = function () {
3222
- var sources = this;
3552
+ return new MergeAllObservable(this);
3553
+ };
3554
+
3555
+ var CompositeError = Rx.CompositeError = function(errors) {
3556
+ this.name = "NotImplementedError";
3557
+ this.innerErrors = errors;
3558
+ this.message = 'This contains multiple errors. Check the innerErrors';
3559
+ Error.call(this);
3560
+ }
3561
+ CompositeError.prototype = Error.prototype;
3562
+
3563
+ /**
3564
+ * Flattens an Observable that emits Observables into one Observable, in a way that allows an Observer to
3565
+ * receive all successfully emitted items from all of the source Observables without being interrupted by
3566
+ * an error notification from one of them.
3567
+ *
3568
+ * This behaves like Observable.prototype.mergeAll except that if any of the merged Observables notify of an
3569
+ * error via the Observer's onError, mergeDelayError will refrain from propagating that
3570
+ * error notification until all of the merged Observables have finished emitting items.
3571
+ * @param {Array | Arguments} args Arguments or an array to merge.
3572
+ * @returns {Observable} an Observable that emits all of the items emitted by the Observables emitted by the Observable
3573
+ */
3574
+ Observable.mergeDelayError = function() {
3575
+ var args;
3576
+ if (Array.isArray(arguments[0])) {
3577
+ args = arguments[0];
3578
+ } else {
3579
+ var len = arguments.length;
3580
+ args = new Array(len);
3581
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
3582
+ }
3583
+ var source = observableOf(null, args);
3584
+
3223
3585
  return new AnonymousObservable(function (o) {
3224
3586
  var group = new CompositeDisposable(),
3587
+ m = new SingleAssignmentDisposable(),
3225
3588
  isStopped = false,
3226
- m = new SingleAssignmentDisposable();
3589
+ errors = [];
3590
+
3591
+ function setCompletion() {
3592
+ if (errors.length === 0) {
3593
+ o.onCompleted();
3594
+ } else if (errors.length === 1) {
3595
+ o.onError(errors[0]);
3596
+ } else {
3597
+ o.onError(new CompositeError(errors));
3598
+ }
3599
+ }
3227
3600
 
3228
3601
  group.add(m);
3229
- m.setDisposable(sources.subscribe(function (innerSource) {
3230
- var innerSubscription = new SingleAssignmentDisposable();
3231
- group.add(innerSubscription);
3232
3602
 
3233
- // Check for promises support
3234
- isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
3603
+ m.setDisposable(source.subscribe(
3604
+ function (innerSource) {
3605
+ var innerSubscription = new SingleAssignmentDisposable();
3606
+ group.add(innerSubscription);
3607
+
3608
+ // Check for promises support
3609
+ isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
3235
3610
 
3236
- innerSubscription.setDisposable(innerSource.subscribe(function (x) { o.onNext(x); }, function (e) { o.onError(e); }, function () {
3237
- group.remove(innerSubscription);
3238
- isStopped && group.length === 1 && o.onCompleted();
3611
+ innerSubscription.setDisposable(innerSource.subscribe(
3612
+ function (x) { o.onNext(x); },
3613
+ function (e) {
3614
+ errors.push(e);
3615
+ group.remove(innerSubscription);
3616
+ isStopped && group.length === 1 && setCompletion();
3617
+ },
3618
+ function () {
3619
+ group.remove(innerSubscription);
3620
+ isStopped && group.length === 1 && setCompletion();
3621
+ }));
3622
+ },
3623
+ function (e) {
3624
+ errors.push(e);
3625
+ isStopped = true;
3626
+ group.length === 1 && setCompletion();
3627
+ },
3628
+ function () {
3629
+ isStopped = true;
3630
+ group.length === 1 && setCompletion();
3239
3631
  }));
3240
- }, function (e) { o.onError(e); }, function () {
3241
- isStopped = true;
3242
- group.length === 1 && o.onCompleted();
3243
- }));
3244
3632
  return group;
3245
- }, sources);
3633
+ });
3246
3634
  };
3247
3635
 
3248
3636
  /**
@@ -3382,7 +3770,8 @@
3382
3770
  * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
3383
3771
  */
3384
3772
  observableProto.withLatestFrom = function () {
3385
- for(var args = [], i = 0, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
3773
+ var len = arguments.length, args = new Array(len)
3774
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
3386
3775
  var resultSelector = args.pop(), source = this;
3387
3776
 
3388
3777
  if (typeof source === 'undefined') {
@@ -3683,10 +4072,12 @@
3683
4072
  * @returns {Observable} The source sequence with the side-effecting behavior applied.
3684
4073
  */
3685
4074
  observableProto['do'] = observableProto.tap = observableProto.doAction = function (observerOrOnNext, onError, onCompleted) {
3686
- var source = this, tapObserver = typeof observerOrOnNext === 'function' || typeof observerOrOnNext === 'undefined'?
3687
- observerCreate(observerOrOnNext || noop, onError || noop, onCompleted || noop) :
3688
- observerOrOnNext;
4075
+ var source = this;
3689
4076
  return new AnonymousObservable(function (observer) {
4077
+ var tapObserver = !observerOrOnNext || isFunction(observerOrOnNext) ?
4078
+ observerCreate(observerOrOnNext || noop, onError || noop, onCompleted || noop) :
4079
+ observerOrOnNext;
4080
+
3690
4081
  return source.subscribe(function (x) {
3691
4082
  try {
3692
4083
  tapObserver.onNext(x);
@@ -3902,6 +4293,7 @@
3902
4293
  * @returns {Observable} An observable sequence containing the source sequence elements except for the bypassed ones at the end.
3903
4294
  */
3904
4295
  observableProto.skipLast = function (count) {
4296
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
3905
4297
  var source = this;
3906
4298
  return new AnonymousObservable(function (o) {
3907
4299
  var q = [];
@@ -3941,6 +4333,7 @@
3941
4333
  * @returns {Observable} An observable sequence containing the specified number of elements from the end of the source sequence.
3942
4334
  */
3943
4335
  observableProto.takeLast = function (count) {
4336
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
3944
4337
  var source = this;
3945
4338
  return new AnonymousObservable(function (o) {
3946
4339
  var q = [];
@@ -3990,12 +4383,12 @@
3990
4383
  var source = this;
3991
4384
  +count || (count = 0);
3992
4385
  Math.abs(count) === Infinity && (count = 0);
3993
- if (count <= 0) { throw new Error(argumentOutOfRange); }
4386
+ if (count <= 0) { throw new ArgumentOutOfRangeError(); }
3994
4387
  skip == null && (skip = count);
3995
4388
  +skip || (skip = 0);
3996
4389
  Math.abs(skip) === Infinity && (skip = 0);
3997
4390
 
3998
- if (skip <= 0) { throw new Error(argumentOutOfRange); }
4391
+ if (skip <= 0) { throw new ArgumentOutOfRangeError(); }
3999
4392
  return new AnonymousObservable(function (observer) {
4000
4393
  var m = new SingleAssignmentDisposable(),
4001
4394
  refCountDisposable = new RefCountDisposable(m),
@@ -4334,7 +4727,7 @@
4334
4727
 
4335
4728
  MapObservable.prototype.internalMap = function (selector, thisArg) {
4336
4729
  var self = this;
4337
- return new MapObservable(this.source, function (x, i, o) { return selector(self.selector(x, i, o), i, o); }, thisArg)
4730
+ return new MapObservable(this.source, function (x, i, o) { return selector.call(this, self.selector(x, i, o), i, o); }, thisArg)
4338
4731
  };
4339
4732
 
4340
4733
  MapObservable.prototype.subscribeCore = function (observer) {
@@ -4355,10 +4748,9 @@
4355
4748
 
4356
4749
  MapObserver.prototype.onNext = function(x) {
4357
4750
  if (this.isStopped) { return; }
4358
- try {
4359
- var result = this.selector(x, this.i++, this.source);
4360
- } catch (e) {
4361
- return this.observer.onError(e);
4751
+ var result = tryCatch(this.selector).call(this, x, this.i++, this.source);
4752
+ if (result === errorObj) {
4753
+ return this.observer.onError(result.e);
4362
4754
  }
4363
4755
  this.observer.onNext(result);
4364
4756
  };
@@ -4531,7 +4923,7 @@
4531
4923
  * @returns {Observable} An observable sequence that contains the elements that occur after the specified index in the input sequence.
4532
4924
  */
4533
4925
  observableProto.skip = function (count) {
4534
- if (count < 0) { throw new Error(argumentOutOfRange); }
4926
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
4535
4927
  var source = this;
4536
4928
  return new AnonymousObservable(function (o) {
4537
4929
  var remaining = count;
@@ -4584,7 +4976,7 @@
4584
4976
  * @returns {Observable} An observable sequence that contains the specified number of elements from the start of the input sequence.
4585
4977
  */
4586
4978
  observableProto.take = function (count, scheduler) {
4587
- if (count < 0) { throw new RangeError(argumentOutOfRange); }
4979
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
4588
4980
  if (count === 0) { return observableEmpty(scheduler); }
4589
4981
  var source = this;
4590
4982
  return new AnonymousObservable(function (o) {
@@ -4643,7 +5035,7 @@
4643
5035
 
4644
5036
  FilterObservable.prototype.internalFilter = function(predicate, thisArg) {
4645
5037
  var self = this;
4646
- return new FilterObservable(this.source, function(x, i, o) { return self.predicate(x, i, o) && predicate(x, i, o); }, thisArg);
5038
+ return new FilterObservable(this.source, function(x, i, o) { return self.predicate(x, i, o) && predicate.call(this, x, i, o); }, thisArg);
4647
5039
  };
4648
5040
 
4649
5041
  return FilterObservable;
@@ -4660,10 +5052,9 @@
4660
5052
 
4661
5053
  FilterObserver.prototype.onNext = function(x) {
4662
5054
  if (this.isStopped) { return; }
4663
- try {
4664
- var shouldYield = this.predicate(x, this.i++, this.source);
4665
- } catch (e) {
4666
- return this.observer.onError(e);
5055
+ var shouldYield = tryCatch(this.predicate).call(this, x, this.i++, this.source);
5056
+ if (shouldYield === errorObj) {
5057
+ return this.observer.onError(shouldYield.e);
4667
5058
  }
4668
5059
  shouldYield && this.observer.onNext(x);
4669
5060
  };
@@ -4730,7 +5121,7 @@
4730
5121
  }
4731
5122
 
4732
5123
  function firstOnly(x) {
4733
- if (x.length === 0) { throw new Error(sequenceContainsNoElements); }
5124
+ if (x.length === 0) { throw new EmptyError(); }
4734
5125
  return x[0];
4735
5126
  }
4736
5127
 
@@ -4743,7 +5134,6 @@
4743
5134
  * @returns {Observable} An observable sequence containing a single element with the final accumulator value.
4744
5135
  */
4745
5136
  observableProto.aggregate = function () {
4746
- //deprecate('aggregate', 'reduce');
4747
5137
  var hasSeed = false, accumulator, seed, source = this;
4748
5138
  if (arguments.length === 2) {
4749
5139
  hasSeed = true;
@@ -4765,15 +5155,14 @@
4765
5155
  hasAccumulation = true;
4766
5156
  }
4767
5157
  } catch (e) {
4768
- o.onError(e);
4769
- return;
5158
+ return o.onError(e);
4770
5159
  }
4771
5160
  },
4772
5161
  function (e) { o.onError(e); },
4773
5162
  function () {
4774
5163
  hasValue && o.onNext(accumulation);
4775
5164
  !hasValue && hasSeed && o.onNext(seed);
4776
- !hasValue && !hasSeed && o.onError(new Error(sequenceContainsNoElements));
5165
+ !hasValue && !hasSeed && o.onError(new EmptyError());
4777
5166
  o.onCompleted();
4778
5167
  }
4779
5168
  );
@@ -4806,15 +5195,14 @@
4806
5195
  hasAccumulation = true;
4807
5196
  }
4808
5197
  } catch (e) {
4809
- o.onError(e);
4810
- return;
5198
+ return o.onError(e);
4811
5199
  }
4812
5200
  },
4813
5201
  function (e) { o.onError(e); },
4814
5202
  function () {
4815
5203
  hasValue && o.onNext(accumulation);
4816
5204
  !hasValue && hasSeed && o.onNext(seed);
4817
- !hasValue && !hasSeed && o.onError(new Error(sequenceContainsNoElements));
5205
+ !hasValue && !hasSeed && o.onError(new EmptyError());
4818
5206
  o.onCompleted();
4819
5207
  }
4820
5208
  );
@@ -4912,6 +5300,7 @@
4912
5300
  //deprecate('contains', 'includes');
4913
5301
  observableProto.includes(searchElement, fromIndex);
4914
5302
  };
5303
+
4915
5304
  /**
4916
5305
  * Returns an observable sequence containing a value that represents how many elements in the specified observable sequence satisfy a condition if provided, else the count of items.
4917
5306
  * @example
@@ -5038,7 +5427,7 @@
5038
5427
  count: prev.count + 1
5039
5428
  };
5040
5429
  }, {sum: 0, count: 0 }).map(function (s) {
5041
- if (s.count === 0) { throw new Error(sequenceContainsNoElements); }
5430
+ if (s.count === 0) { throw new EmptyError(); }
5042
5431
  return s.sum / s.count;
5043
5432
  });
5044
5433
  };
@@ -5132,7 +5521,7 @@
5132
5521
  };
5133
5522
 
5134
5523
  function elementAtOrDefault(source, index, hasDefault, defaultValue) {
5135
- if (index < 0) { throw new Error(argumentOutOfRange); }
5524
+ if (index < 0) { throw new ArgumentOutOfRangeError(); }
5136
5525
  return new AnonymousObservable(function (o) {
5137
5526
  var i = index;
5138
5527
  return source.subscribe(function (x) {
@@ -5142,7 +5531,7 @@
5142
5531
  }
5143
5532
  }, function (e) { o.onError(e); }, function () {
5144
5533
  if (!hasDefault) {
5145
- o.onError(new Error(argumentOutOfRange));
5534
+ o.onError(new ArgumentOutOfRangeError());
5146
5535
  } else {
5147
5536
  o.onNext(defaultValue);
5148
5537
  o.onCompleted();
@@ -5187,7 +5576,7 @@
5187
5576
  }
5188
5577
  }, function (e) { o.onError(e); }, function () {
5189
5578
  if (!seenValue && !hasDefault) {
5190
- o.onError(new Error(sequenceContainsNoElements));
5579
+ o.onError(new EmptyError());
5191
5580
  } else {
5192
5581
  o.onNext(value);
5193
5582
  o.onCompleted();
@@ -5234,7 +5623,7 @@
5234
5623
  o.onCompleted();
5235
5624
  }, function (e) { o.onError(e); }, function () {
5236
5625
  if (!hasDefault) {
5237
- o.onError(new Error(sequenceContainsNoElements));
5626
+ o.onError(new EmptyError());
5238
5627
  } else {
5239
5628
  o.onNext(defaultValue);
5240
5629
  o.onCompleted();
@@ -5279,7 +5668,7 @@
5279
5668
  seenValue = true;
5280
5669
  }, function (e) { o.onError(e); }, function () {
5281
5670
  if (!seenValue && !hasDefault) {
5282
- o.onError(new Error(sequenceContainsNoElements));
5671
+ o.onError(new EmptyError());
5283
5672
  } else {
5284
5673
  o.onNext(value);
5285
5674
  o.onCompleted();
@@ -5672,17 +6061,19 @@
5672
6061
  */
5673
6062
  Observable.fromCallback = function (func, context, selector) {
5674
6063
  return function () {
5675
- for(var args = [], i = 0, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
6064
+ var len = arguments.length, args = new Array(len)
6065
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
5676
6066
 
5677
6067
  return new AnonymousObservable(function (observer) {
5678
6068
  function handler() {
5679
- var results = arguments;
6069
+ var len = arguments.length, results = new Array(len);
6070
+ for(var i = 0; i < len; i++) { results[i] = arguments[i]; }
5680
6071
 
5681
6072
  if (selector) {
5682
6073
  try {
5683
- results = selector(results);
5684
- } catch (err) {
5685
- return observer.onError(err);
6074
+ results = selector.apply(context, results);
6075
+ } catch (e) {
6076
+ return observer.onError(e);
5686
6077
  }
5687
6078
 
5688
6079
  observer.onNext(results);
@@ -5712,7 +6103,8 @@
5712
6103
  */
5713
6104
  Observable.fromNodeCallback = function (func, context, selector) {
5714
6105
  return function () {
5715
- for(var args = [], i = 0, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
6106
+ var len = arguments.length, args = new Array(len);
6107
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
5716
6108
 
5717
6109
  return new AnonymousObservable(function (observer) {
5718
6110
  function handler(err) {
@@ -5721,11 +6113,12 @@
5721
6113
  return;
5722
6114
  }
5723
6115
 
5724
- for(var results = [], i = 1, len = arguments.length; i < len; i++) { results.push(arguments[i]); }
6116
+ var len = arguments.length, results = [];
6117
+ for(var i = 1; i < len; i++) { results[i - 1] = arguments[i]; }
5725
6118
 
5726
6119
  if (selector) {
5727
6120
  try {
5728
- results = selector(results);
6121
+ results = selector.apply(context, results);
5729
6122
  } catch (e) {
5730
6123
  return observer.onError(e);
5731
6124
  }
@@ -5818,8 +6211,7 @@
5818
6211
  try {
5819
6212
  results = selector(arguments);
5820
6213
  } catch (err) {
5821
- observer.onError(err);
5822
- return
6214
+ return observer.onError(err);
5823
6215
  }
5824
6216
  }
5825
6217
 
@@ -5843,8 +6235,7 @@
5843
6235
  try {
5844
6236
  result = selector(arguments);
5845
6237
  } catch (err) {
5846
- observer.onError(err);
5847
- return;
6238
+ return observer.onError(err);
5848
6239
  }
5849
6240
  }
5850
6241
  observer.onNext(result);
@@ -6090,15 +6481,14 @@
6090
6481
  return this.source.subscribe(observer);
6091
6482
  }
6092
6483
 
6093
- function ControlledObservable (source, enableQueue) {
6484
+ function ControlledObservable (source, enableQueue, scheduler) {
6094
6485
  __super__.call(this, subscribe, source);
6095
- this.subject = new ControlledSubject(enableQueue);
6486
+ this.subject = new ControlledSubject(enableQueue, scheduler);
6096
6487
  this.source = source.multicast(this.subject).refCount();
6097
6488
  }
6098
6489
 
6099
6490
  ControlledObservable.prototype.request = function (numberOfItems) {
6100
- if (numberOfItems == null) { numberOfItems = -1; }
6101
- return this.subject.request(numberOfItems);
6491
+ return this.subject.request(numberOfItems == null ? -1 : numberOfItems);
6102
6492
  };
6103
6493
 
6104
6494
  return ControlledObservable;
@@ -6113,7 +6503,7 @@
6113
6503
 
6114
6504
  inherits(ControlledSubject, __super__);
6115
6505
 
6116
- function ControlledSubject(enableQueue) {
6506
+ function ControlledSubject(enableQueue, scheduler) {
6117
6507
  enableQueue == null && (enableQueue = true);
6118
6508
 
6119
6509
  __super__.call(this, subscribe);
@@ -6125,24 +6515,32 @@
6125
6515
  this.error = null;
6126
6516
  this.hasFailed = false;
6127
6517
  this.hasCompleted = false;
6128
- this.controlledDisposable = disposableEmpty;
6518
+ this.scheduler = scheduler || currentThreadScheduler;
6129
6519
  }
6130
6520
 
6131
6521
  addProperties(ControlledSubject.prototype, Observer, {
6132
6522
  onCompleted: function () {
6133
6523
  this.hasCompleted = true;
6134
- (!this.enableQueue || this.queue.length === 0) && this.subject.onCompleted();
6524
+ if (!this.enableQueue || this.queue.length === 0) {
6525
+ this.subject.onCompleted();
6526
+ } else {
6527
+ this.queue.push(Notification.createOnCompleted());
6528
+ }
6135
6529
  },
6136
6530
  onError: function (error) {
6137
6531
  this.hasFailed = true;
6138
6532
  this.error = error;
6139
- (!this.enableQueue || this.queue.length === 0) && this.subject.onError(error);
6533
+ if (!this.enableQueue || this.queue.length === 0) {
6534
+ this.subject.onError(error);
6535
+ } else {
6536
+ this.queue.push(Notification.createOnError(error));
6537
+ }
6140
6538
  },
6141
6539
  onNext: function (value) {
6142
6540
  var hasRequested = false;
6143
6541
 
6144
6542
  if (this.requestedCount === 0) {
6145
- this.enableQueue && this.queue.push(value);
6543
+ this.enableQueue && this.queue.push(Notification.createOnNext(value));
6146
6544
  } else {
6147
6545
  (this.requestedCount !== -1 && this.requestedCount-- === 0) && this.disposeCurrentRequest();
6148
6546
  hasRequested = true;
@@ -6151,43 +6549,39 @@
6151
6549
  },
6152
6550
  _processRequest: function (numberOfItems) {
6153
6551
  if (this.enableQueue) {
6154
- while (this.queue.length >= numberOfItems && numberOfItems > 0) {
6155
- this.subject.onNext(this.queue.shift());
6156
- numberOfItems--;
6552
+ while ((this.queue.length >= numberOfItems && numberOfItems > 0) ||
6553
+ (this.queue.length > 0 && this.queue[0].kind !== 'N')) {
6554
+ var first = this.queue.shift();
6555
+ first.accept(this.subject);
6556
+ if (first.kind === 'N') {
6557
+ numberOfItems--;
6558
+ } else {
6559
+ this.disposeCurrentRequest();
6560
+ this.queue = [];
6561
+ }
6157
6562
  }
6158
6563
 
6159
- return this.queue.length !== 0 ?
6160
- { numberOfItems: numberOfItems, returnValue: true } :
6161
- { numberOfItems: numberOfItems, returnValue: false };
6162
- }
6163
-
6164
- if (this.hasFailed) {
6165
- this.subject.onError(this.error);
6166
- this.controlledDisposable.dispose();
6167
- this.controlledDisposable = disposableEmpty;
6168
- } else if (this.hasCompleted) {
6169
- this.subject.onCompleted();
6170
- this.controlledDisposable.dispose();
6171
- this.controlledDisposable = disposableEmpty;
6564
+ return { numberOfItems : numberOfItems, returnValue: this.queue.length !== 0};
6172
6565
  }
6173
6566
 
6174
6567
  return { numberOfItems: numberOfItems, returnValue: false };
6175
6568
  },
6176
6569
  request: function (number) {
6177
6570
  this.disposeCurrentRequest();
6178
- var self = this, r = this._processRequest(number);
6571
+ var self = this;
6179
6572
 
6180
- var number = r.numberOfItems;
6181
- if (!r.returnValue) {
6182
- this.requestedCount = number;
6183
- this.requestedDisposable = disposableCreate(function () {
6184
- self.requestedCount = 0;
6185
- });
6573
+ this.requestedDisposable = this.scheduler.scheduleWithState(number,
6574
+ function(s, i) {
6575
+ var r = self._processRequest(i), remaining = r.numberOfItems;
6576
+ if (!r.returnValue) {
6577
+ self.requestedCount = remaining;
6578
+ self.requestedDisposable = disposableCreate(function () {
6579
+ self.requestedCount = 0;
6580
+ });
6581
+ }
6582
+ });
6186
6583
 
6187
- return this.requestedDisposable
6188
- } else {
6189
- return disposableEmpty;
6190
- }
6584
+ return this.requestedDisposable;
6191
6585
  },
6192
6586
  disposeCurrentRequest: function () {
6193
6587
  this.requestedDisposable.dispose();
@@ -6203,12 +6597,19 @@
6203
6597
  * @example
6204
6598
  * var source = Rx.Observable.interval(100).controlled();
6205
6599
  * source.request(3); // Reads 3 values
6206
- * @param {Observable} pauser The observable sequence used to pause the underlying sequence.
6600
+ * @param {bool} enableQueue truthy value to determine if values should be queued pending the next request
6601
+ * @param {Scheduler} scheduler determines how the requests will be scheduled
6207
6602
  * @returns {Observable} The observable sequence which is paused based upon the pauser.
6208
6603
  */
6209
- observableProto.controlled = function (enableQueue) {
6604
+ observableProto.controlled = function (enableQueue, scheduler) {
6605
+
6606
+ if (enableQueue && isScheduler(enableQueue)) {
6607
+ scheduler = enableQueue;
6608
+ enableQueue = true;
6609
+ }
6610
+
6210
6611
  if (enableQueue == null) { enableQueue = true; }
6211
- return new ControlledObservable(this, enableQueue);
6612
+ return new ControlledObservable(this, enableQueue, scheduler);
6212
6613
  };
6213
6614
 
6214
6615
  var StopAndWaitObservable = (function (__super__) {
@@ -6365,6 +6766,38 @@
6365
6766
  return new WindowedObservable(this, windowSize);
6366
6767
  };
6367
6768
 
6769
+ /**
6770
+ * Pipes the existing Observable sequence into a Node.js Stream.
6771
+ * @param {Stream} dest The destination Node.js stream.
6772
+ * @returns {Stream} The destination stream.
6773
+ */
6774
+ observableProto.pipe = function (dest) {
6775
+ var source = this.pausableBuffered();
6776
+
6777
+ function onDrain() {
6778
+ source.resume();
6779
+ }
6780
+
6781
+ dest.addListener('drain', onDrain);
6782
+
6783
+ source.subscribe(
6784
+ function (x) {
6785
+ !dest.write(String(x)) && source.pause();
6786
+ },
6787
+ function (err) {
6788
+ dest.emit('error', err);
6789
+ },
6790
+ function () {
6791
+ // Hack check because STDIO is not closable
6792
+ !dest._isStdio && dest.end();
6793
+ dest.removeListener('drain', onDrain);
6794
+ });
6795
+
6796
+ source.resume();
6797
+
6798
+ return dest;
6799
+ };
6800
+
6368
6801
  /**
6369
6802
  * Multicasts the source sequence notifications through an instantiated subject into all uses of the sequence within a selector function. Each
6370
6803
  * subscription to the resulting sequence causes a separate multicast invocation, exposing the sequence resulting from the selector function's
@@ -6477,14 +6910,14 @@
6477
6910
  *
6478
6911
  * @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source subject to the specified replay buffer trimming policy.
6479
6912
  * @param bufferSize [Optional] Maximum element count of the replay buffer.
6480
- * @param window [Optional] Maximum time length of the replay buffer.
6913
+ * @param windowSize [Optional] Maximum time length of the replay buffer.
6481
6914
  * @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on.
6482
6915
  * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
6483
6916
  */
6484
- observableProto.replay = function (selector, bufferSize, window, scheduler) {
6917
+ observableProto.replay = function (selector, bufferSize, windowSize, scheduler) {
6485
6918
  return selector && isFunction(selector) ?
6486
- this.multicast(function () { return new ReplaySubject(bufferSize, window, scheduler); }, selector) :
6487
- this.multicast(new ReplaySubject(bufferSize, window, scheduler));
6919
+ this.multicast(function () { return new ReplaySubject(bufferSize, windowSize, scheduler); }, selector) :
6920
+ this.multicast(new ReplaySubject(bufferSize, windowSize, scheduler));
6488
6921
  };
6489
6922
 
6490
6923
  /**
@@ -6502,8 +6935,8 @@
6502
6935
  * @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on.
6503
6936
  * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
6504
6937
  */
6505
- observableProto.shareReplay = function (bufferSize, window, scheduler) {
6506
- return this.replay(null, bufferSize, window, scheduler).refCount();
6938
+ observableProto.shareReplay = function (bufferSize, windowSize, scheduler) {
6939
+ return this.replay(null, bufferSize, windowSize, scheduler).refCount();
6507
6940
  };
6508
6941
 
6509
6942
  var InnerSubscription = function (subject, observer) {
@@ -6555,6 +6988,20 @@
6555
6988
  }
6556
6989
 
6557
6990
  addProperties(BehaviorSubject.prototype, Observer, {
6991
+ /**
6992
+ * Gets the current value or throws an exception.
6993
+ * Value is frozen after onCompleted is called.
6994
+ * After onError is called always throws the specified exception.
6995
+ * An exception is always thrown after dispose is called.
6996
+ * @returns {Mixed} The initial value passed to the constructor until onNext is called; after which, the last value passed to onNext.
6997
+ */
6998
+ getValue: function () {
6999
+ checkDisposed(this);
7000
+ if (this.hasError) {
7001
+ throw this.error;
7002
+ }
7003
+ return this.value;
7004
+ },
6558
7005
  /**
6559
7006
  * Indicates whether the subject has observers subscribed to it.
6560
7007
  * @returns {Boolean} Indicates whether the subject has observers subscribed to it.
@@ -6622,6 +7069,8 @@
6622
7069
  */
6623
7070
  var ReplaySubject = Rx.ReplaySubject = (function (__super__) {
6624
7071
 
7072
+ var maxSafeInteger = Math.pow(2, 53) - 1;
7073
+
6625
7074
  function createRemovableDisposable(subject, observer) {
6626
7075
  return disposableCreate(function () {
6627
7076
  observer.dispose();
@@ -6659,8 +7108,8 @@
6659
7108
  * @param {Scheduler} [scheduler] Scheduler the observers are invoked on.
6660
7109
  */
6661
7110
  function ReplaySubject(bufferSize, windowSize, scheduler) {
6662
- this.bufferSize = bufferSize == null ? Number.MAX_VALUE : bufferSize;
6663
- this.windowSize = windowSize == null ? Number.MAX_VALUE : windowSize;
7111
+ this.bufferSize = bufferSize == null ? maxSafeInteger : bufferSize;
7112
+ this.windowSize = windowSize == null ? maxSafeInteger : windowSize;
6664
7113
  this.scheduler = scheduler || currentThreadScheduler;
6665
7114
  this.q = [];
6666
7115
  this.observers = [];
@@ -6871,7 +7320,7 @@
6871
7320
  }
6872
7321
 
6873
7322
  function Dictionary(capacity, comparer) {
6874
- if (capacity < 0) { throw new Error('out of range'); }
7323
+ if (capacity < 0) { throw new ArgumentOutOfRangeError(); }
6875
7324
  if (capacity > 0) { this._initialize(capacity); }
6876
7325
 
6877
7326
  this.comparer = comparer || defaultComparer;
@@ -7788,7 +8237,7 @@
7788
8237
  this.onNext(Observable.empty());
7789
8238
  },
7790
8239
  onError: function (e) {
7791
- this.onNext(Observable.throwException(e));
8240
+ this.onNext(Observable.throwError(e));
7792
8241
  },
7793
8242
  onNext: function (v) {
7794
8243
  this.tail.onNext(v);
@@ -8491,9 +8940,9 @@
8491
8940
  *
8492
8941
  * @example
8493
8942
  * 1 - res = source.timestamp(); // produces { value: x, timestamp: ts }
8494
- * 2 - res = source.timestamp(Rx.Scheduler.timeout);
8943
+ * 2 - res = source.timestamp(Rx.Scheduler.default);
8495
8944
  *
8496
- * @param {Scheduler} [scheduler] Scheduler used to compute timestamps. If not specified, the timeout scheduler is used.
8945
+ * @param {Scheduler} [scheduler] Scheduler used to compute timestamps. If not specified, the default scheduler is used.
8497
8946
  * @returns {Observable} An observable sequence with timestamp information on values.
8498
8947
  */
8499
8948
  observableProto.timestamp = function (scheduler) {
@@ -8712,18 +9161,29 @@
8712
9161
  };
8713
9162
 
8714
9163
  /**
8715
- * Time shifts the observable sequence by delaying the subscription.
9164
+ * Time shifts the observable sequence by delaying the subscription with the specified relative time duration, using the specified scheduler to run timers.
8716
9165
  *
8717
9166
  * @example
8718
9167
  * 1 - res = source.delaySubscription(5000); // 5s
8719
- * 2 - res = source.delaySubscription(5000, Rx.Scheduler.timeout); // 5 seconds
9168
+ * 2 - res = source.delaySubscription(5000, Rx.Scheduler.default); // 5 seconds
8720
9169
  *
8721
- * @param {Number} dueTime Absolute or relative time to perform the subscription at.
9170
+ * @param {Number} dueTime Relative or absolute time shift of the subscription.
8722
9171
  * @param {Scheduler} [scheduler] Scheduler to run the subscription delay timer on. If not specified, the timeout scheduler is used.
8723
9172
  * @returns {Observable} Time-shifted sequence.
8724
9173
  */
8725
9174
  observableProto.delaySubscription = function (dueTime, scheduler) {
8726
- return this.delayWithSelector(observableTimer(dueTime, isScheduler(scheduler) ? scheduler : timeoutScheduler), observableEmpty);
9175
+ var scheduleMethod = dueTime instanceof Date ? 'scheduleWithAbsolute' : 'scheduleWithRelative';
9176
+ var source = this;
9177
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
9178
+ return new AnonymousObservable(function (o) {
9179
+ var d = new SerialDisposable();
9180
+
9181
+ d.setDisposable(scheduler[scheduleMethod](dueTime, function() {
9182
+ d.setDisposable(source.subscribe(o));
9183
+ }));
9184
+
9185
+ return d;
9186
+ }, this);
8727
9187
  };
8728
9188
 
8729
9189
  /**
@@ -8738,47 +9198,54 @@
8738
9198
  * @returns {Observable} Time-shifted sequence.
8739
9199
  */
8740
9200
  observableProto.delayWithSelector = function (subscriptionDelay, delayDurationSelector) {
8741
- var source = this, subDelay, selector;
8742
- if (typeof subscriptionDelay === 'function') {
8743
- selector = subscriptionDelay;
8744
- } else {
8745
- subDelay = subscriptionDelay;
8746
- selector = delayDurationSelector;
8747
- }
8748
- return new AnonymousObservable(function (observer) {
8749
- var delays = new CompositeDisposable(), atEnd = false, done = function () {
8750
- if (atEnd && delays.length === 0) { observer.onCompleted(); }
8751
- }, subscription = new SerialDisposable(), start = function () {
8752
- subscription.setDisposable(source.subscribe(function (x) {
8753
- var delay;
8754
- try {
8755
- delay = selector(x);
8756
- } catch (error) {
8757
- observer.onError(error);
8758
- return;
8759
- }
8760
- var d = new SingleAssignmentDisposable();
8761
- delays.add(d);
8762
- d.setDisposable(delay.subscribe(function () {
9201
+ var source = this, subDelay, selector;
9202
+ if (isFunction(subscriptionDelay)) {
9203
+ selector = subscriptionDelay;
9204
+ } else {
9205
+ subDelay = subscriptionDelay;
9206
+ selector = delayDurationSelector;
9207
+ }
9208
+ return new AnonymousObservable(function (observer) {
9209
+ var delays = new CompositeDisposable(), atEnd = false, subscription = new SerialDisposable();
9210
+
9211
+ function start() {
9212
+ subscription.setDisposable(source.subscribe(
9213
+ function (x) {
9214
+ var delay = tryCatch(selector)(x);
9215
+ if (delay === errorObj) { return observer.onError(delay.e); }
9216
+ var d = new SingleAssignmentDisposable();
9217
+ delays.add(d);
9218
+ d.setDisposable(delay.subscribe(
9219
+ function () {
8763
9220
  observer.onNext(x);
8764
9221
  delays.remove(d);
8765
9222
  done();
8766
- }, observer.onError.bind(observer), function () {
9223
+ },
9224
+ function (e) { observer.onError(e); },
9225
+ function () {
8767
9226
  observer.onNext(x);
8768
9227
  delays.remove(d);
8769
9228
  done();
8770
- }));
8771
- }, observer.onError.bind(observer), function () {
9229
+ }
9230
+ ))
9231
+ },
9232
+ function (e) { observer.onError(e); },
9233
+ function () {
8772
9234
  atEnd = true;
8773
9235
  subscription.dispose();
8774
9236
  done();
8775
- }));
8776
- };
9237
+ }
9238
+ ))
9239
+ }
9240
+
9241
+ function done () {
9242
+ atEnd && delays.length === 0 && observer.onCompleted();
9243
+ }
8777
9244
 
8778
9245
  if (!subDelay) {
8779
9246
  start();
8780
9247
  } else {
8781
- subscription.setDisposable(subDelay.subscribe(start, observer.onError.bind(observer), start));
9248
+ subscription.setDisposable(subDelay.subscribe(start, function (e) { observer.onError(e); }, start));
8782
9249
  }
8783
9250
 
8784
9251
  return new CompositeDisposable(subscription, delays);
@@ -8904,9 +9371,12 @@
8904
9371
  }, source);
8905
9372
  };
8906
9373
 
8907
- observableProto.throttleWithSelector = function () {
9374
+ /**
9375
+ * @deprecated use #debounceWithSelector instead.
9376
+ */
9377
+ observableProto.throttleWithSelector = function (durationSelector) {
8908
9378
  //deprecate('throttleWithSelector', 'debounceWithSelector');
8909
- return this.debounceWithSelector.apply(this, arguments);
9379
+ return this.debounceWithSelector(durationSelector);
8910
9380
  };
8911
9381
 
8912
9382
  /**
@@ -9135,32 +9605,32 @@
9135
9605
  observableProto.transduce = function(transducer) {
9136
9606
  var source = this;
9137
9607
 
9138
- function transformForObserver(observer) {
9608
+ function transformForObserver(o) {
9139
9609
  return {
9140
- init: function() {
9141
- return observer;
9610
+ '@@transducer/init': function() {
9611
+ return o;
9142
9612
  },
9143
- step: function(obs, input) {
9613
+ '@@transducer/step': function(obs, input) {
9144
9614
  return obs.onNext(input);
9145
9615
  },
9146
- result: function(obs) {
9616
+ '@@transducer/result': function(obs) {
9147
9617
  return obs.onCompleted();
9148
9618
  }
9149
9619
  };
9150
9620
  }
9151
9621
 
9152
- return new AnonymousObservable(function(observer) {
9153
- var xform = transducer(transformForObserver(observer));
9622
+ return new AnonymousObservable(function(o) {
9623
+ var xform = transducer(transformForObserver(o));
9154
9624
  return source.subscribe(
9155
9625
  function(v) {
9156
9626
  try {
9157
- xform.step(observer, v);
9627
+ xform['@@transducer/step'](o, v);
9158
9628
  } catch (e) {
9159
- observer.onError(e);
9629
+ o.onError(e);
9160
9630
  }
9161
9631
  },
9162
- observer.onError.bind(observer),
9163
- function() { xform.result(observer); }
9632
+ function (e) { o.onError(e); },
9633
+ function() { xform['@@transducer/result'](o); }
9164
9634
  );
9165
9635
  }, source);
9166
9636
  };
@@ -9281,10 +9751,6 @@
9281
9751
  /** Provides a set of extension methods for virtual time scheduling. */
9282
9752
  Rx.VirtualTimeScheduler = (function (__super__) {
9283
9753
 
9284
- function notImplemented() {
9285
- throw new Error('Not implemented');
9286
- }
9287
-
9288
9754
  function localNow() {
9289
9755
  return this.toDateTimeOffset(this.clock);
9290
9756
  }
@@ -9412,12 +9878,8 @@
9412
9878
  */
9413
9879
  VirtualTimeSchedulerPrototype.advanceTo = function (time) {
9414
9880
  var dueToClock = this.comparer(this.clock, time);
9415
- if (this.comparer(this.clock, time) > 0) {
9416
- throw new Error(argumentOutOfRange);
9417
- }
9418
- if (dueToClock === 0) {
9419
- return;
9420
- }
9881
+ if (this.comparer(this.clock, time) > 0) { throw new ArgumentOutOfRangeError(); }
9882
+ if (dueToClock === 0) { return; }
9421
9883
  if (!this.isEnabled) {
9422
9884
  this.isEnabled = true;
9423
9885
  do {
@@ -9440,7 +9902,7 @@
9440
9902
  VirtualTimeSchedulerPrototype.advanceBy = function (time) {
9441
9903
  var dt = this.add(this.clock, time),
9442
9904
  dueToClock = this.comparer(this.clock, dt);
9443
- if (dueToClock > 0) { throw new Error(argumentOutOfRange); }
9905
+ if (dueToClock > 0) { throw new ArgumentOutOfRangeError(); }
9444
9906
  if (dueToClock === 0) { return; }
9445
9907
 
9446
9908
  this.advanceTo(dt);
@@ -9452,7 +9914,7 @@
9452
9914
  */
9453
9915
  VirtualTimeSchedulerPrototype.sleep = function (time) {
9454
9916
  var dt = this.add(this.clock, time);
9455
- if (this.comparer(this.clock, dt) >= 0) { throw new Error(argumentOutOfRange); }
9917
+ if (this.comparer(this.clock, dt) >= 0) { throw new ArgumentOutOfRangeError(); }
9456
9918
 
9457
9919
  this.clock = dt;
9458
9920
  };
@@ -9558,27 +10020,24 @@
9558
10020
 
9559
10021
  // Fix subscriber to check for undefined or function returned to decorate as Disposable
9560
10022
  function fixSubscriber(subscriber) {
9561
- if (subscriber && typeof subscriber.dispose === 'function') { return subscriber; }
9562
-
9563
- return typeof subscriber === 'function' ?
9564
- disposableCreate(subscriber) :
9565
- disposableEmpty;
10023
+ return subscriber && isFunction(subscriber.dispose) ? subscriber :
10024
+ isFunction(subscriber) ? disposableCreate(subscriber) : disposableEmpty;
9566
10025
  }
9567
10026
 
9568
10027
  function setDisposable(s, state) {
9569
10028
  var ado = state[0], subscribe = state[1];
9570
- try {
9571
- ado.setDisposable(fixSubscriber(subscribe(ado)));
9572
- } catch (e) {
9573
- if (!ado.fail(e)) { throw e; }
10029
+ var sub = tryCatch(subscribe)(ado);
10030
+
10031
+ if (sub === errorObj) {
10032
+ if(!ado.fail(errorObj.e)) { return thrower(errorObj.e); }
9574
10033
  }
10034
+ ado.setDisposable(fixSubscriber(sub));
9575
10035
  }
9576
10036
 
9577
10037
  function AnonymousObservable(subscribe, parent) {
9578
10038
  this.source = parent;
9579
10039
 
9580
10040
  function s(observer) {
9581
-
9582
10041
  var ado = new AutoDetachObserver(observer), state = [ado, subscribe];
9583
10042
 
9584
10043
  if (currentThreadScheduler.scheduleRequired()) {
@@ -9586,7 +10045,6 @@
9586
10045
  } else {
9587
10046
  setDisposable(null, state);
9588
10047
  }
9589
-
9590
10048
  return ado;
9591
10049
  }
9592
10050
 
@@ -9609,35 +10067,23 @@
9609
10067
  var AutoDetachObserverPrototype = AutoDetachObserver.prototype;
9610
10068
 
9611
10069
  AutoDetachObserverPrototype.next = function (value) {
9612
- var noError = false;
9613
- try {
9614
- this.observer.onNext(value);
9615
- noError = true;
9616
- } catch (e) {
9617
- return thrower(e);
9618
- } finally {
9619
- !noError && this.dispose();
10070
+ var result = tryCatch(this.observer.onNext).call(this.observer, value);
10071
+ if (result === errorObj) {
10072
+ this.dispose();
10073
+ thrower(result.e);
9620
10074
  }
9621
10075
  };
9622
10076
 
9623
10077
  AutoDetachObserverPrototype.error = function (err) {
9624
- try {
9625
- this.observer.onError(err);
9626
- } catch (e) {
9627
- return thrower(e);
9628
- } finally {
9629
- this.dispose();
9630
- }
10078
+ var result = tryCatch(this.observer.onError).call(this.observer, err);
10079
+ this.dispose();
10080
+ result === errorObj && thrower(result.e);
9631
10081
  };
9632
10082
 
9633
10083
  AutoDetachObserverPrototype.completed = function () {
9634
- try {
9635
- this.observer.onCompleted();
9636
- } catch (e) {
9637
- return thrower(e);
9638
- } finally {
9639
- this.dispose();
9640
- }
10084
+ var result = tryCatch(this.observer.onCompleted).call(this.observer);
10085
+ this.dispose();
10086
+ result === errorObj && thrower(result.e);
9641
10087
  };
9642
10088
 
9643
10089
  AutoDetachObserverPrototype.setDisposable = function (value) { this.m.setDisposable(value); };