{"version":3,"sources":["node_modules/browser-pack/_prelude.js","app/scripts/main.js","app/scripts/utils/index.js","node_modules/rxjs/fetch/index.js","node_modules/rxjs/internal/AsyncSubject.js","node_modules/rxjs/internal/BehaviorSubject.js","node_modules/rxjs/internal/InnerSubscriber.js","node_modules/rxjs/internal/Notification.js","node_modules/rxjs/internal/Observable.js","node_modules/rxjs/internal/Observer.js","node_modules/rxjs/internal/OuterSubscriber.js","node_modules/rxjs/internal/ReplaySubject.js","node_modules/rxjs/internal/Scheduler.js","node_modules/rxjs/internal/Subject.js","node_modules/rxjs/internal/SubjectSubscription.js","node_modules/rxjs/internal/Subscriber.js","node_modules/rxjs/internal/Subscription.js","node_modules/rxjs/internal/config.js","node_modules/rxjs/internal/innerSubscribe.js","node_modules/rxjs/internal/observable/ConnectableObservable.js","node_modules/rxjs/internal/observable/SubscribeOnObservable.js","node_modules/rxjs/internal/observable/combineLatest.js","node_modules/rxjs/internal/observable/concat.js","node_modules/rxjs/internal/observable/defer.js","node_modules/rxjs/internal/observable/dom/fetch.js","node_modules/rxjs/internal/observable/empty.js","node_modules/rxjs/internal/observable/from.js","node_modules/rxjs/internal/observable/fromArray.js","node_modules/rxjs/internal/observable/merge.js","node_modules/rxjs/internal/observable/of.js","node_modules/rxjs/internal/observable/race.js","node_modules/rxjs/internal/observable/throwError.js","node_modules/rxjs/internal/observable/timer.js","node_modules/rxjs/internal/observable/zip.js","node_modules/rxjs/internal/operators/audit.js","node_modules/rxjs/internal/operators/auditTime.js","node_modules/rxjs/internal/operators/buffer.js","node_modules/rxjs/internal/operators/bufferCount.js","node_modules/rxjs/internal/operators/bufferTime.js","node_modules/rxjs/internal/operators/bufferToggle.js","node_modules/rxjs/internal/operators/bufferWhen.js","node_modules/rxjs/internal/operators/catchError.js","node_modules/rxjs/internal/operators/combineAll.js","node_modules/rxjs/internal/operators/combineLatest.js","node_modules/rxjs/internal/operators/concat.js","node_modules/rxjs/internal/operators/concatAll.js","node_modules/rxjs/internal/operators/concatMap.js","node_modules/rxjs/internal/operators/concatMapTo.js","node_modules/rxjs/internal/operators/count.js","node_modules/rxjs/internal/operators/debounce.js","node_modules/rxjs/internal/operators/debounceTime.js","node_modules/rxjs/internal/operators/defaultIfEmpty.js","node_modules/rxjs/internal/operators/delay.js","node_modules/rxjs/internal/operators/delayWhen.js","node_modules/rxjs/internal/operators/dematerialize.js","node_modules/rxjs/internal/operators/distinct.js","node_modules/rxjs/internal/operators/distinctUntilChanged.js","node_modules/rxjs/internal/operators/distinctUntilKeyChanged.js","node_modules/rxjs/internal/operators/elementAt.js","node_modules/rxjs/internal/operators/endWith.js","node_modules/rxjs/internal/operators/every.js","node_modules/rxjs/internal/operators/exhaust.js","node_modules/rxjs/internal/operators/exhaustMap.js","node_modules/rxjs/internal/operators/expand.js","node_modules/rxjs/internal/operators/filter.js","node_modules/rxjs/internal/operators/finalize.js","node_modules/rxjs/internal/operators/find.js","node_modules/rxjs/internal/operators/findIndex.js","node_modules/rxjs/internal/operators/first.js","node_modules/rxjs/internal/operators/groupBy.js","node_modules/rxjs/internal/operators/ignoreElements.js","node_modules/rxjs/internal/operators/isEmpty.js","node_modules/rxjs/internal/operators/last.js","node_modules/rxjs/internal/operators/map.js","node_modules/rxjs/internal/operators/mapTo.js","node_modules/rxjs/internal/operators/materialize.js","node_modules/rxjs/internal/operators/max.js","node_modules/rxjs/internal/operators/merge.js","node_modules/rxjs/internal/operators/mergeAll.js","node_modules/rxjs/internal/operators/mergeMap.js","node_modules/rxjs/internal/operators/mergeMapTo.js","node_modules/rxjs/internal/operators/mergeScan.js","node_modules/rxjs/internal/operators/min.js","node_modules/rxjs/internal/operators/multicast.js","node_modules/rxjs/internal/operators/observeOn.js","node_modules/rxjs/internal/operators/onErrorResumeNext.js","node_modules/rxjs/internal/operators/pairwise.js","node_modules/rxjs/internal/operators/partition.js","node_modules/rxjs/internal/operators/pluck.js","node_modules/rxjs/internal/operators/publish.js","node_modules/rxjs/internal/operators/publishBehavior.js","node_modules/rxjs/internal/operators/publishLast.js","node_modules/rxjs/internal/operators/publishReplay.js","node_modules/rxjs/internal/operators/race.js","node_modules/rxjs/internal/operators/reduce.js","node_modules/rxjs/internal/operators/refCount.js","node_modules/rxjs/internal/operators/repeat.js","node_modules/rxjs/internal/operators/repeatWhen.js","node_modules/rxjs/internal/operators/retry.js","node_modules/rxjs/internal/operators/retryWhen.js","node_modules/rxjs/internal/operators/sample.js","node_modules/rxjs/internal/operators/sampleTime.js","node_modules/rxjs/internal/operators/scan.js","node_modules/rxjs/internal/operators/sequenceEqual.js","node_modules/rxjs/internal/operators/share.js","node_modules/rxjs/internal/operators/shareReplay.js","node_modules/rxjs/internal/operators/single.js","node_modules/rxjs/internal/operators/skip.js","node_modules/rxjs/internal/operators/skipLast.js","node_modules/rxjs/internal/operators/skipUntil.js","node_modules/rxjs/internal/operators/skipWhile.js","node_modules/rxjs/internal/operators/startWith.js","node_modules/rxjs/internal/operators/subscribeOn.js","node_modules/rxjs/internal/operators/switchAll.js","node_modules/rxjs/internal/operators/switchMap.js","node_modules/rxjs/internal/operators/switchMapTo.js","node_modules/rxjs/internal/operators/take.js","node_modules/rxjs/internal/operators/takeLast.js","node_modules/rxjs/internal/operators/takeUntil.js","node_modules/rxjs/internal/operators/takeWhile.js","node_modules/rxjs/internal/operators/tap.js","node_modules/rxjs/internal/operators/throttle.js","node_modules/rxjs/internal/operators/throttleTime.js","node_modules/rxjs/internal/operators/throwIfEmpty.js","node_modules/rxjs/internal/operators/timeInterval.js","node_modules/rxjs/internal/operators/timeout.js","node_modules/rxjs/internal/operators/timeoutWith.js","node_modules/rxjs/internal/operators/timestamp.js","node_modules/rxjs/internal/operators/toArray.js","node_modules/rxjs/internal/operators/window.js","node_modules/rxjs/internal/operators/windowCount.js","node_modules/rxjs/internal/operators/windowTime.js","node_modules/rxjs/internal/operators/windowToggle.js","node_modules/rxjs/internal/operators/windowWhen.js","node_modules/rxjs/internal/operators/withLatestFrom.js","node_modules/rxjs/internal/operators/zip.js","node_modules/rxjs/internal/operators/zipAll.js","node_modules/rxjs/internal/scheduled/scheduleArray.js","node_modules/rxjs/internal/scheduled/scheduleIterable.js","node_modules/rxjs/internal/scheduled/scheduleObservable.js","node_modules/rxjs/internal/scheduled/schedulePromise.js","node_modules/rxjs/internal/scheduled/scheduled.js","node_modules/rxjs/internal/scheduler/Action.js","node_modules/rxjs/internal/scheduler/AsapAction.js","node_modules/rxjs/internal/scheduler/AsapScheduler.js","node_modules/rxjs/internal/scheduler/AsyncAction.js","node_modules/rxjs/internal/scheduler/AsyncScheduler.js","node_modules/rxjs/internal/scheduler/QueueAction.js","node_modules/rxjs/internal/scheduler/QueueScheduler.js","node_modules/rxjs/internal/scheduler/asap.js","node_modules/rxjs/internal/scheduler/async.js","node_modules/rxjs/internal/scheduler/queue.js","node_modules/rxjs/internal/symbol/iterator.js","node_modules/rxjs/internal/symbol/observable.js","node_modules/rxjs/internal/symbol/rxSubscriber.js","node_modules/rxjs/internal/util/ArgumentOutOfRangeError.js","node_modules/rxjs/internal/util/EmptyError.js","node_modules/rxjs/internal/util/Immediate.js","node_modules/rxjs/internal/util/ObjectUnsubscribedError.js","node_modules/rxjs/internal/util/TimeoutError.js","node_modules/rxjs/internal/util/UnsubscriptionError.js","node_modules/rxjs/internal/util/canReportError.js","node_modules/rxjs/internal/util/hostReportError.js","node_modules/rxjs/internal/util/identity.js","node_modules/rxjs/internal/util/isArray.js","node_modules/rxjs/internal/util/isArrayLike.js","node_modules/rxjs/internal/util/isDate.js","node_modules/rxjs/internal/util/isFunction.js","node_modules/rxjs/internal/util/isInteropObservable.js","node_modules/rxjs/internal/util/isIterable.js","node_modules/rxjs/internal/util/isNumeric.js","node_modules/rxjs/internal/util/isObject.js","node_modules/rxjs/internal/util/isPromise.js","node_modules/rxjs/internal/util/isScheduler.js","node_modules/rxjs/internal/util/noop.js","node_modules/rxjs/internal/util/not.js","node_modules/rxjs/internal/util/pipe.js","node_modules/rxjs/internal/util/subscribeTo.js","node_modules/rxjs/internal/util/subscribeToArray.js","node_modules/rxjs/internal/util/subscribeToIterable.js","node_modules/rxjs/internal/util/subscribeToObservable.js","node_modules/rxjs/internal/util/subscribeToPromise.js","node_modules/rxjs/internal/util/subscribeToResult.js","node_modules/rxjs/internal/util/toSubscriber.js","node_modules/rxjs/operators/index.js"],"names":[],"mappings":"AAAA;;;ACAA;;;;;;;;;;;;;;AAEA,IAAM,eAAe,GAAG,SAAlB,eAAkB,GAAM;AAC7B,EAAA,CAAC,CAAC,UAAD,CAAD,CAAc,IAAd,CAAmB,YAAY;AAC9B,QAAM,KAAK,GAAG,CAAC,CAAC,IAAD,CAAf;;AACA,QAAM,OAAO,GAAG,KAAK,CAAC,IAAN,CAAW,gBAAX,CAAhB;;AACA,IAAA,OAAO,CAAC,EAAR,CAAW,OAAX,EAAoB,UAAU,CAAV,EAAa;AAChC,MAAA,CAAC,CAAC,cAAF;;AACA,UAAM,GAAG,GAAG,OAAO,CAAC,IAAR,CAAa,UAAb,KAA4B,OAAO,CAAC,IAAR,CAAa,QAAb,CAAxC;;AACA,UAAM,MAAM,GACX,OAAO,CAAC,IAAR,CAAa,aAAb,KAA+B,OAAO,CAAC,IAAR,CAAa,QAAb,CADhC;;AAEA,UAAM,QAAQ,GAAG,IAAI,QAAJ,EAAjB;;AACA,MAAA,KAAK,CAAC,IAAN,CAAW,qBAAX,EAAkC,IAAlC,CAAuC,UAAU,EAAV,EAAc;AACpD,YAAM,MAAM,GAAG,CAAC,CAAC,IAAD,CAAhB;;AACA,YAAM,IAAI,GAAG,MAAM,CAAC,IAAP,CAAY,MAAZ,CAAb;;AACA,YAAM,GAAG,GAAG,MAAM,CAAC,GAAP,EAAZ;;AACA,QAAA,QAAQ,CAAC,MAAT,CAAgB,IAAhB,EAAsB,GAAtB;AACA,OALD;;AAMA,UAAI,KAAK,CAAC,KAAN,EAAJ,EAAmB;AAClB,QAAA,CAAC,CAAC,IAAF,CAAO;AACN,UAAA,GAAG,EAAE,GADC;AAEN,UAAA,IAAI,EA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AE,CAAC,WAAH,CAAe,iBAAf;AACA;AACD;AACD;;;2BAEM;AACN,WAAK,iBAAL;AACA,WAAK,cAAL;AACA,WAAK,aAAL;AACA;;;;;;;;;ACtLF;AACA;AACA;AACA;AACA;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"main.min.js","sourcesContent":["(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i {\r\n\t$('.js-form').each(function () {\r\n\t\tconst _form = $(this);\r\n\t\tconst _button = _form.find('.js-btn-submit');\r\n\t\t_button.on('click', function (e) {\r\n\t\t\te.preventDefault();\r\n\t\t\tconst url = _button.attr('data-url') || _button.attr('action');\r\n\t\t\tconst method =\r\n\t\t\t\t_button.attr('data-method') || _button.attr('method');\r\n\t\t\tconst formData = new FormData();\r\n\t\t\t_form.find('.form__group [name]').each(function (el) {\r\n\t\t\t\tconst _input = $(this);\r\n\t\t\t\tconst name = _input.attr('name');\r\n\t\t\t\tconst val = _input.val();\r\n\t\t\t\tformData.append(name, val);\r\n\t\t\t});\r\n\t\t\tif (_form.valid()) {\r\n\t\t\t\t$.ajax({\r\n\t\t\t\t\turl: url,\r\n\t\t\t\t\ttype: method,\r\n\t\t\t\t\tdata: formData,\r\n\t\t\t\t\tprocessData: false,\r\n\t\t\t\t\tcontentType: false,\r\n\t\t\t\t\tbeforeSend: function () {\r\n\t\t\t\t\t\t_button.attr('disabled', 'disabled');\r\n\t\t\t\t\t},\r\n\t\t\t\t\tsuccess: function (res) {\r\n\t\t\t\t\t\tif (res.Code == 200) {\r\n\t\t\t\t\t\t\talert(`${res.Message}`);\r\n\t\t\t\t\t\t\twindow.location.reload();\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\talert(res.Message);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n};\r\n\r\nconst switchLanguage = () => {\r\n\tconst currentLanguage =\r\n\t\tdocument.querySelector('html').getAttribute('lang') || 'vi';\r\n\tconst activeHtml = document.querySelector('.header__language-active');\r\n\tconst curLang = document.querySelector(\r\n\t\t`.language .item[data-language=\"${currentLanguage}\"]`,\r\n\t);\r\n\tif (activeHtml && curLang) {\r\n\t\tactiveHtml.innerHTML = curLang.innerHTML;\r\n\t\t$(activeHtml).find('.text').addClass('mx-1');\r\n\t\t$(activeHtml).append('');\r\n\r\n\t\t$(document).on('click', '.language .item', function (e) {\r\n\t\t\te.preventDefault();\r\n\t\t\tconst language = $(this).attr('data-language');\r\n\r\n\t\t\tvar originalUrl = window.location;\r\n\t\t\twindow.location =\r\n\t\t\t\t'/_common-settings/ChangeCulture?culture=' +\r\n\t\t\t\tlanguage +\r\n\t\t\t\t'&url=' +\r\n\t\t\t\toriginalUrl;\r\n\t\t});\r\n\r\n\t\t$(activeHtml)\r\n\t\t\t.parent()\r\n\t\t\t.clone()\r\n\t\t\t.appendTo($('.header__main-mobile .toggle__menu-wrap'));\r\n\t}\r\n};\r\n\r\nconst addClassBody = () => {\r\n\tconst className = $('#page-verify').attr('data-class');\r\n\t$('body').addClass(className);\r\n\t$('body').attr('id', className);\r\n};\r\n\r\nconst moveSomething2Somewhere = () => {\r\n\tif (window.innerWidth < 1025) {\r\n\t\tconst extraMenu = $('.header__main-menu .header__helper-extra-menu');\r\n\t\tconst mainMenuWrapper = extraMenu.siblings('.d-flex');\r\n\t\tconst items = extraMenu.find('li');\r\n\t\titems.appendTo(mainMenuWrapper);\r\n\t}\r\n};\r\n\r\nconst activeMegaMenuOnMobile = () => {\r\n\t$('body').on('click', '.has-mega>a', function (e) {\r\n\t\te.preventDefault();\r\n\t\t$(this).addClass('active');\r\n\t\t$(this).siblings('.mega__wrap').addClass('active');\r\n\t});\r\n\t$('body').on('click', '.mega__back-link', function (e) {\r\n\t\te.preventDefault();\r\n\t\t$(this).parents('.mega__wrap').removeClass('active');\r\n\t});\r\n};\r\n\r\nconst eventsFilter = () => {\r\n\tconst eventHeader = $('.about-event-header p');\r\n\tconst events = $('.events-group .event');\r\n\tconst total = events.length;\r\n\tconst text = eventHeader\r\n\t\t.text()\r\n\t\t.split(' ')\r\n\t\t.filter((i) => isNaN(i));\r\n\tconst string = [total, ...text];\r\n\teventHeader.html(`${string.join(' ')}`);\r\n\tconst dateFilterInput = document.querySelector('.js-event-date-picker');\r\n\tif (dateFilterInput) {\r\n\t\tconst datepicker = new Litepicker({\r\n\t\t\telement: dateFilterInput,\r\n\t\t\tformat: 'DD/MM/YYYY',\r\n\t\t\tstartDate: new Date().getTime(),\r\n\t\t\tonSelect: function (date) {\r\n\t\t\t\tlet totalReCalculate = 0;\r\n\t\t\t\tconst dateSelected = new Date(date).getTime();\r\n\t\t\t\tevents.each(function (index) {\r\n\t\t\t\t\tconst _this = $(this);\r\n\t\t\t\t\tconst dateString = _this.find('.time').attr('data-date');\r\n\t\t\t\t\tconst dateEvent = new Date(dateString).getTime();\r\n\t\t\t\t\tif (dateEvent < dateSelected) {\r\n\t\t\t\t\t\t_this.hide();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t_this.show();\r\n\t\t\t\t\t\ttotalReCalculate += 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\teventHeader.html(`${totalReCalculate} ${text}`);\r\n\t\t\t},\r\n\t\t});\r\n\t}\r\n};\r\n\r\ndocument.addEventListener('DOMContentLoaded', () => {\r\n\tmoveSomething2Somewhere();\r\n\taddClassBody();\r\n\tgetSvg();\r\n\tswitchLanguage();\r\n\tdropdownToggle();\r\n\tactiveMegaMenuOnMobile();\r\n\tajaxContactForm();\r\n\tif (document.querySelectorAll('.page-banner-1 .swiper-slide').length > 1) {\r\n\t\tconst bannerSlider = new Swiper('.page-banner-1 .swiper-container', {\r\n\t\t\tslidesPerView: 1,\r\n\t\t\tspeed: 1000,\r\n\t\t\tloop: true,\r\n\t\t\tautoplay: {\r\n\t\t\t\tdisableOnInteraction: false,\r\n\t\t\t\tdelay: 4000,\r\n\t\t\t},\r\n\t\t\tpagination: {\r\n\t\t\t\tel: '.page-banner-1 .swiper-pagination-custom',\r\n\t\t\t\tclickable: true,\r\n\t\t\t\ttype: 'bullets',\r\n\t\t\t\tdynamicMainBullets: true,\r\n\t\t\t},\r\n\t\t});\r\n\t}\r\n\teventsFilter();\r\n\tconst megaNewsSlide = new Swiper(\r\n\t\t'.header__1 .mega__newsSlide .swiper-container',\r\n\t\t{\r\n\t\t\tslidesPerView: 1,\r\n\t\t\tspeed: 1000,\r\n\t\t\tloop: true,\r\n\t\t\tspaceBetween: 30,\r\n\t\t\tobserver: true,\r\n\t\t\tobserveParents: true,\r\n\t\t\tautoplay: {\r\n\t\t\t\tdisableOnInteraction: false,\r\n\t\t\t\tdelay: 4000,\r\n\t\t\t},\r\n\t\t\tnavigation: {\r\n\t\t\t\tnextEl: '.header__1 .mega__newsSlide .swiper-next',\r\n\t\t\t},\r\n\t\t\tpagination: {\r\n\t\t\t\tel: '.header__1 .mega__newsSlide .swiper-pagination',\r\n\t\t\t\tclickable: true,\r\n\t\t\t\ttype: 'bullets',\r\n\t\t\t\tdynamicMainBullets: true,\r\n\t\t\t},\r\n\t\t},\r\n\t);\r\n\tconst partnershipSlider = new Swiper(\r\n\t\t'.partners__section-1 .swiper-container',\r\n\t\t{\r\n\t\t\tslidesPerView: 1,\r\n\t\t\tspaceBetween: 20,\r\n\t\t\tpagination: {\r\n\t\t\t\tel: '.partners__section-1 .swiper-pagination-custom',\r\n\t\t\t\tclickable: true,\r\n\t\t\t\ttype: 'bullets',\r\n\t\t\t\tdynamicMainBullets: true,\r\n\t\t\t},\r\n\t\t\tbreakpoints: {\r\n\t\t\t\t768: {\r\n\t\t\t\t\tslidesPerview: 2,\r\n\t\t\t\t},\r\n\t\t\t\t1025: {\r\n\t\t\t\t\tslidesPerView: 3,\r\n\t\t\t\t},\r\n\t\t\t},\r\n\t\t},\r\n\t);\r\n\tconst pciSlider = new Swiper('.partners__section-3 .swiper-container', {\r\n\t\tslidesPerView: 1,\r\n\t\tspaceBetween: 20,\r\n\t\tpagination: {\r\n\t\t\tel: '.partners__section-3 .swiper-pagination-custom',\r\n\t\t\tclickable: true,\r\n\t\t\ttype: 'bullets',\r\n\t\t\tdynamicMainBullets: true,\r\n\t\t},\r\n\t\tnavigation: {\r\n\t\t\tnextEl: '.partners__section-3 .swiper-next',\r\n\t\t\tprevEl: '.partners__section-3 .swiper-prev',\r\n\t\t},\r\n\t\tbreakpoints: {\r\n\t\t\t768: {\r\n\t\t\t\tslidesPerview: 2,\r\n\t\t\t},\r\n\t\t\t1025: {\r\n\t\t\t\tslidesPerView: 4,\r\n\t\t\t},\r\n\t\t},\r\n\t});\r\n\r\n\tconst footerHelpSlider = new Swiper('.footer__help .swiper-container', {\r\n\t\tslidesPerView: 2,\r\n\t\tspaceBetween: 30,\r\n\t\tpagination: {\r\n\t\t\tel: '.footer__help .swiper-pagination-custom',\r\n\t\t\tclickable: true,\r\n\t\t\ttype: 'bullets',\r\n\t\t\tdynamicMainBullets: true,\r\n\t\t},\r\n\t\tbreakpoints: {\r\n\t\t\t1025: {\r\n\t\t\t\tslidesPerView: 3,\r\n\t\t\t\tspaceBetween: 50,\r\n\t\t\t},\r\n\t\t},\r\n\t});\r\n\r\n\tconst index2Slider = new Swiper('.indexSection--2 .swiper-container', {\r\n\t\tslidesPerView: 1.1,\r\n\t\tspaceBetween: 10,\r\n\t\tpagination: {\r\n\t\t\tel: '.indexSection--2 .swiper-container .swiper-pagination-custom',\r\n\t\t\tclickable: true,\r\n\t\t\ttype: 'bullets',\r\n\t\t\tdynamicMainBullets: true,\r\n\t\t},\r\n\t\tbreakpoints: {\r\n\t\t\t576: {\r\n\t\t\t\tslidesPerView: 2.1,\r\n\t\t\t},\r\n\t\t\t768: {\r\n\t\t\t\tslidesPerView: 3.1,\r\n\t\t\t\tspaceBetween: 15,\r\n\t\t\t},\r\n\t\t\t1025: {\r\n\t\t\t\tslidesPerView: 4,\r\n\t\t\t\tspaceBetween: 20,\r\n\t\t\t},\r\n\t\t},\r\n\t});\r\n\r\n\tconst productCategoriesSlider = new Swiper(\r\n\t\t'.productCategories__slider .swiper-container',\r\n\t\t{\r\n\t\t\tslidesPerView: 2,\r\n\t\t\tloop: true,\r\n\t\t\tobserveParents: true,\r\n\t\t\tobserver: true,\r\n\t\t\tspaceBetween: 10,\r\n\t\t\tnavigation: {\r\n\t\t\t\tprevEl: '.productCategories__slider .swiper-prev--custom',\r\n\t\t\t\tnextEl: '.productCategories__slider .swiper-next--custom',\r\n\t\t\t},\r\n\t\t\tpagination: {\r\n\t\t\t\tel: '.productCategories__slider .swiper-pagination-custom',\r\n\t\t\t\tclickable: true,\r\n\t\t\t\ttype: 'bullets',\r\n\t\t\t\tdynamicMainBullets: true,\r\n\t\t\t},\r\n\t\t\tbreakpoints: {\r\n\t\t\t\t768: {\r\n\t\t\t\t\tslidesPerView: 3,\r\n\t\t\t\t\tspaceBetween: 15,\r\n\t\t\t\t},\r\n\t\t\t\t1024: {\r\n\t\t\t\t\tslidesPerView: 4,\r\n\t\t\t\t\tspaceBetween: 20,\r\n\t\t\t\t},\r\n\t\t\t},\r\n\t\t},\r\n\t);\r\n\r\n\tconst solution6Slider = new Swiper(\r\n\t\t'.solution-1--6__slider .swiper-container',\r\n\t\t{\r\n\t\t\tslidesPerView: 2,\r\n\t\t\tspaceBetween: 20,\r\n\t\t\tnavigation: {\r\n\t\t\t\tprevEl: '.solution-1--6__slider .swiper-prev--custom',\r\n\t\t\t\tnextEl: '.solution-1--6__slider .swiper-next--custom',\r\n\t\t\t},\r\n\t\t\tpagination: {\r\n\t\t\t\tel: '.solution-1--6__slider .swiper-pagination-custom',\r\n\t\t\t\tclickable: true,\r\n\t\t\t\ttype: 'bullets',\r\n\t\t\t\tdynamicMainBullets: true,\r\n\t\t\t},\r\n\t\t\tbreakpoints: {\r\n\t\t\t\t576: {\r\n\t\t\t\t\tslidesPerView: 3,\r\n\t\t\t\t},\r\n\t\t\t\t1025: {\r\n\t\t\t\t\tslidesPerView: 4,\r\n\t\t\t\t},\r\n\t\t\t},\r\n\t\t},\r\n\t);\r\n\r\n\tconst solution3_2Slider = new Swiper(\r\n\t\t'.solution-3--2__slider .swiper-container',\r\n\t\t{\r\n\t\t\tslidesPerView: 1,\r\n\t\t\tspaceBetween: 20,\r\n\t\t\tnavigation: {\r\n\t\t\t\tprevEl: '.solution-3--2__slider .swiper-prev--custom',\r\n\t\t\t\tnextEl: '.solution-3--2__slider .swiper-next--custom',\r\n\t\t\t},\r\n\t\t\tpagination: {\r\n\t\t\t\tel: '.solution-3--2__slider .swiper-pagination-custom',\r\n\t\t\t\tclickable: true,\r\n\t\t\t\ttype: 'bullets',\r\n\t\t\t\tdynamicMainBullets: true,\r\n\t\t\t},\r\n\t\t\tbreakpoints: {\r\n\t\t\t\t768: {\r\n\t\t\t\t\tslidesPerView: 2,\r\n\t\t\t\t},\r\n\t\t\t},\r\n\t\t},\r\n\t);\r\n\r\n\tconst supportResultTechnicalSlider = new Swiper(\r\n\t\t'.block__result--slider .swiper-container',\r\n\t\t{\r\n\t\t\tslidesPerView: 1,\r\n\t\t\tspaceBetween: 20,\r\n\t\t\t// pagination: {\r\n\t\t\t// \tel: '.solution-3--2__slider .swiper-pagination-custom',\r\n\t\t\t// \tclickable: true,\r\n\t\t\t// \ttype: 'bullets',\r\n\t\t\t// \tdynamicMainBullets: true,\r\n\t\t\t// },\r\n\t\t\tcenteredSlides: true,\r\n\t\t\tbreakpoints: {\r\n\t\t\t\t768: {\r\n\t\t\t\t\tslidesPerView: 4,\r\n\t\t\t\t},\r\n\t\t\t},\r\n\t\t},\r\n\t);\r\n\tconst productDetailCategoriesSlider = new Swiper(\r\n\t\t'.banner__img.banner__img--showSlider .swiper-container',\r\n\t\t{\r\n\t\t\tslidesPerView: 1,\r\n\t\t\tspaceBetween: 20,\r\n\t\t\t// pagination: {\r\n\t\t\t// \tel: '.solution-3--2__slider .swiper-pagination-custom',\r\n\t\t\t// \tclickable: true,\r\n\t\t\t// \ttype: 'bullets',\r\n\t\t\t// \tdynamicMainBullets: true,\r\n\t\t\t// },\r\n\t\t\tautoplay: {\r\n\t\t\t\tdisableOnInteraction: false,\r\n\t\t\t\tdelay: 4000,\r\n\t\t\t},\r\n\t\t\tloop: true,\r\n\t\t},\r\n\t);\r\n\r\n\tconst productDetailPopupThumb = new Swiper(\r\n\t\t'.indexBannerPopup .gallery-thumbs',\r\n\t\t{\r\n\t\t\tspaceBetween: 10,\r\n\t\t\tslidesPerView: 4,\r\n\t\t\tfreeMode: true,\r\n\t\t\twatchSlidesVisibility: true,\r\n\t\t\twatchSlidesProgress: true,\r\n\t\t\tobserver: true,\r\n\t\t\tobserveParents: true,\r\n\t\t},\r\n\t);\r\n\tconst productDetailPopupTop = new Swiper('.indexBannerPopup .gallery-top', {\r\n\t\tspaceBetween: 10,\r\n\t\tnavigation: {\r\n\t\t\tnextEl: '.indexBannerPopup .swiper-next',\r\n\t\t\tprevEl: '.indexBannerPopup .swiper-prev',\r\n\t\t},\r\n\t\tobserver: true,\r\n\t\tobserveParents: true,\r\n\t\tthumbs: {\r\n\t\t\tswiper: productDetailPopupThumb,\r\n\t\t},\r\n\t\tallowTouchMove: false,\r\n\t});\r\n\r\n\tconst contactTab = new Tab('.tab-container');\r\n\r\n\tif (document.querySelector('.date-picker')) {\r\n\t\tconst datepicker = new Litepicker({\r\n\t\t\telement: document.querySelector('.date-picker'),\r\n\t\t\tformat: 'DD/MM/YYYY',\r\n\t\t\tstartDate: new Date().getTime(),\r\n\t\t});\r\n\t}\r\n\t// Toggle Filter in Product page\r\n\t$('.productList__filterIcon').on('click', function () {\r\n\t\t$('.productList__filter').addClass('is-expanded');\r\n\t});\r\n\t$('.productList__filterClose').on('click', function () {\r\n\t\t$('.productList__filter').removeClass('is-expanded');\r\n\t});\r\n\t// Support Result Help\r\n\t$('.dropdown__heading').on('click', function () {\r\n\t\t$(this).toggleClass('hide');\r\n\t\t$(this).siblings().toggle();\r\n\t});\r\n\t// Header Search Toggle\r\n\t$('.header__1 .header__search .text').on('click', function () {\r\n\t\t$('header .header__search').addClass('active');\r\n\t\t$('header .header__backdrop').show();\r\n\t});\r\n\t$(\r\n\t\t'.header__1 .header__search .search-input-close, header .header__backdrop',\r\n\t).on('click', function () {\r\n\t\t$('header .header__search').removeClass('active');\r\n\t\t$('header .header__backdrop').hide();\r\n\t});\r\n\t// Header Main Toggle\r\n\t$('.header__1 .header__main-menu .toggle-mobile-btn').on(\r\n\t\t'click',\r\n\t\tfunction () {\r\n\t\t\t$(this).siblings().toggleClass('show');\r\n\t\t\t$(this).toggleClass('active');\r\n\t\t\t$('.header__main-menu .active').each(function () {\r\n\t\t\t\t$(this).removeClass('active');\r\n\t\t\t});\r\n\t\t},\r\n\t);\r\n\t$('.header__1 .header__main-menu .toggle__menu-wrap>ul>li.has__mega>a').on(\r\n\t\t'click',\r\n\t\tfunction (e) {\r\n\t\t\te.preventDefault();\r\n\t\t\t$(this).siblings().addClass('show');\r\n\t\t},\r\n\t);\r\n\t$('.header__1 .mega__wrap>.container>.mega__back-link').on(\r\n\t\t'click',\r\n\t\tfunction () {\r\n\t\t\t$(this).parents('.mega__wrap').removeClass('show');\r\n\t\t},\r\n\t);\r\n\t$('.mega__listProductWrapper>.mega__back-link').on('click', function () {\r\n\t\t$(this).parents('.mega__product').hide();\r\n\t\t$(this).parents('.mega__listProduct').hide();\r\n\t});\r\n\r\n\t// Header 2 search toggle\r\n\t$('.header__2 .header__search button').on('click', function () {\r\n\t\tif (!$(this).siblings().val()) {\r\n\t\t\t$(this).parent().toggleClass('active');\r\n\t\t} else {\r\n\t\t\tconsole.log('event');\r\n\t\t}\r\n\t});\r\n\t$('.header__2 .header__btn').on('click', function () {\r\n\t\tif ($(this).siblings('.header__main').is(':hidden')) {\r\n\t\t\t$(this).siblings('.header__main').slideDown();\r\n\t\t} else {\r\n\t\t\t$(this).siblings('.header__main').slideUp();\r\n\t\t}\r\n\t});\r\n\r\n\t$('.indexSection .indexSectionZoom').on('mousemove', (e) => {\r\n\t\tlet zoomer = e.currentTarget;\r\n\t\tlet offsetX;\r\n\t\tlet offsetY;\r\n\t\te.offsetX ? (offsetX = e.offsetX) : (offsetX = e.touches[0].pageX);\r\n\t\te.offsetY ? (offsetY = e.offsetY) : (offsetY = e.touches[0].pageX);\r\n\t\tlet x = (offsetX / zoomer.offsetWidth) * 100;\r\n\t\tlet y = (offsetY / zoomer.offsetHeight) * 100;\r\n\t\tzoomer.style.backgroundPosition = x + '% ' + y + '%';\r\n\t});\r\n\r\n\t$('.banner__img--showSlider, .banner__content-detail .btn').on(\r\n\t\t'click',\r\n\t\t(e) => {\r\n\t\t\te.preventDefault();\r\n\t\t\t$('.indexBanner').addClass('d-none');\r\n\t\t\t$('.indexBannerPopup').removeClass('d-none');\r\n\t\t},\r\n\t);\r\n\t$('.closePopup ').on('click', () => {\r\n\t\t$('.indexBanner').removeClass('d-none');\r\n\t\t$('.indexBannerPopup').addClass('d-none');\r\n\t});\r\n\r\n\t$('#result-help-and-download-page .form__search button').on(\r\n\t\t'click',\r\n\t\tfunction (e) {\r\n\t\t\te.preventDefault();\r\n\t\t\tvar value = $(this)\r\n\t\t\t\t.siblings()\r\n\t\t\t\t.find('input')\r\n\t\t\t\t.val()\r\n\t\t\t\t.trim()\r\n\t\t\t\t.toLowerCase();\r\n\t\t\t// if(value){\r\n\t\t\t$(this)\r\n\t\t\t\t.parents('.tab-content')\r\n\t\t\t\t.find('.dropdown__label')\r\n\t\t\t\t.each(function (e) {\r\n\t\t\t\t\t// console.log($(this).html().toLowerCase().indexOf(value) > -1 ? `show ${e}` : `hide ${e}`)\r\n\t\t\t\t\t$(this).html().toLowerCase().indexOf(value) > -1\r\n\t\t\t\t\t\t? $(this).show()\r\n\t\t\t\t\t\t: $(this).hide();\r\n\t\t\t\t});\r\n\t\t\t// }\r\n\t\t},\r\n\t);\r\n\t// Scroll Sticky\r\n\tif ($('#blog-page .blog__newsletter').length) {\r\n\t\tvar blogNewsLetterOffset = $('#blog-page .blog__newsletter').offset()\r\n\t\t\t.top;\r\n\t}\r\n\r\n\t// add mega-menu attribute\r\n\tif (document.querySelector('.header__1')) {\r\n\t\tlet flag = 0;\r\n\t\t$('.mega__extra-menu:first li a').each(function (i, e) {\r\n\t\t\tflag += 1;\r\n\t\t\te.setAttribute('mega-target', 'mega-' + flag);\r\n\t\t});\r\n\t\t$('.mega__extra-menu:eq(1) li a').each(function (i, e) {\r\n\t\t\tflag += 1;\r\n\t\t\te.setAttribute('mega-target', 'mega-' + flag);\r\n\t\t});\r\n\t\tdocument\r\n\t\t\t.querySelectorAll('.mega__listProduct')\r\n\t\t\t.forEach(function (e, i) {\r\n\t\t\t\te.setAttribute('mega-menu', 'mega-' + (i + 1));\r\n\t\t\t});\r\n\t\tdocument.querySelectorAll('.mega__wrap').forEach(function (e, i) {\r\n\t\t\te.classList.add('mega__' + (i + 1));\r\n\t\t});\r\n\t}\r\n\r\n\tif (window.innerWidth > 1025) {\r\n\t\t$('[mega-target]').each(function () {\r\n\t\t\tconst target = $(this).attr('mega-target');\r\n\t\t\tconst menuWrapper = $(`[mega-menu=\"${target}\"]`);\r\n\t\t\tconst _this = $(this);\r\n\t\t\t_this.on('mouseenter', function (e) {\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\t$(`[mega-target]`).each(function (index) {\r\n\t\t\t\t\t$(this).removeClass('active');\r\n\t\t\t\t});\r\n\t\t\t\t_this.addClass('active');\r\n\t\t\t\t$(`[mega-menu]`).each(function (index) {\r\n\t\t\t\t\t$(this).hide();\r\n\t\t\t\t});\r\n\t\t\t\tmenuWrapper.show();\r\n\t\t\t});\r\n\t\t\tmenuWrapper.on('mouseleave', function (e) {\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tmenuWrapper.hide();\r\n\t\t\t});\r\n\t\t});\r\n\t\t$('.has-mega .container').on('mouseleave', function (e) {\r\n\t\t\te.preventDefault();\r\n\t\t\t$(`[mega-menu]`).each(function () {\r\n\t\t\t\t$(this).hide();\r\n\t\t\t});\r\n\t\t\t$(`[mega-target]`).each(function (index) {\r\n\t\t\t\t$(this).removeClass('active');\r\n\t\t\t});\r\n\t\t});\r\n\t} else {\r\n\t\tconst allMenuProductWrapper = $('.mega__product');\r\n\t\t$('[mega-target]').each(function (index) {\r\n\t\t\tconst target = $(this).attr('mega-target');\r\n\t\t\tconst menuWrapper = $(`[mega-menu=\"${target}\"]`);\r\n\t\t\tconst _this = $(this);\r\n\t\t\t_this.on('click', function (e) {\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tmenuWrapper.show();\r\n\t\t\t\tallMenuProductWrapper.show();\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\tfunction scrollStiky() {\r\n\t\tvar scroll = $(window).scrollTop();\r\n\t\tif (scroll > blogNewsLetterOffset) {\r\n\t\t\t$('#blog-page .blog__newsletter').css({\r\n\t\t\t\tposition: 'fixed',\r\n\t\t\t\ttop: '78px',\r\n\t\t\t\tleft: 0,\r\n\t\t\t\twidth: '100%',\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\t$('#blog-page .blog__newsletter').css({\r\n\t\t\t\tposition: 'static',\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t$(window).on('scroll', function () {\r\n\t\tif ($('#blog-page').length) {\r\n\t\t\tscrollStiky();\r\n\t\t}\r\n\t});\r\n\t$(document).on('ready', function () {\r\n\t\tif ($('#blog-page').length) {\r\n\t\t\tscrollStiky();\r\n\t\t}\r\n\t});\r\n\t$('.productSubCategories .productList__sort select').on('change', function (\r\n\t\te,\r\n\t) {\r\n\t\te.preventDefault();\r\n\t\tvar value = $(this).val();\r\n\t\t// if(value){\r\n\t\t$.ajax({\r\n\t\t\turl: `?storage=${value}`,\r\n\t\t\t// data: { isajax: true },\r\n\t\t\tsuccess: function (data) {\r\n\t\t\t\tconsole.log('sucess');\r\n\t\t\t},\r\n\t\t});\r\n\t\t// }\r\n\t});\r\n\r\n\t// filter product by categories\r\n\tif (document.querySelector('.main-category')) {\r\n\t\tconst script = document.createElement('script');\r\n\t\tscript.type = 'text/javascript';\r\n\t\tscript.src = '/content/resources/js/filter.js';\r\n\t\tscript.async = true;\r\n\t\tscript.dataset.cfasync = false;\r\n\t\tdocument.body.appendChild(script);\r\n\t\tscript.addEventListener('load', () => {\r\n\t\t\t$('.main-category').trigger('change');\r\n\t\t});\r\n\t}\r\n\r\n\t// filter FAQ\r\n\tif (\r\n\t\tdocument.querySelector('#page-verify').getAttribute('data-class') ==\r\n\t\t'result-help-and-download-page'\r\n\t) {\r\n\t\tdocument.querySelectorAll('.tab-content').forEach(function (eTab, i) {\r\n\t\t\t$(eTab)\r\n\t\t\t\t.find('.section__dropdown')\r\n\t\t\t\t.each(function () {\r\n\t\t\t\t\t$(eTab)\r\n\t\t\t\t\t\t.find('select')\r\n\t\t\t\t\t\t.append(\r\n\t\t\t\t\t\t\t'',\r\n\t\t\t\t\t\t);\r\n\t\t\t\t});\r\n\t\t});\r\n\r\n\t\t$('.section__form select').on('change', function () {\r\n\t\t\tif ($(this).find('option:selected').index() != 0) {\r\n\t\t\t\tconst value = $(this).val();\r\n\t\t\t\t$(this)\r\n\t\t\t\t\t.parents('.row')\r\n\t\t\t\t\t.find('.section__dropdown')\r\n\t\t\t\t\t.each(function () {\r\n\t\t\t\t\t\tif (\r\n\t\t\t\t\t\t\tvalue == $(this).find('.dropdown__heading').text()\r\n\t\t\t\t\t\t) {\r\n\t\t\t\t\t\t\t$(this).show();\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$(this).hide();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\t$(this).parents('.row').find('.section__dropdown').show();\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tlet filterTimerout;\r\n\t\t$('.tab-content .form__search input').on('keyup', function (e) {\r\n\t\t\tif (filterTimerout) {\r\n\t\t\t\tclearTimeout(filterTimerout);\r\n\t\t\t}\r\n\t\t\tfilterTimerout = setTimeout(() => {\r\n\t\t\t\tconst valueLowercase = e.currentTarget.value.toLowerCase();\r\n\t\t\t\t$(this)\r\n\t\t\t\t\t.parents('.row')\r\n\t\t\t\t\t.find('.section__dropdown')\r\n\t\t\t\t\t.each(function () {\r\n\t\t\t\t\t\tconst text = $(this)\r\n\t\t\t\t\t\t\t.find('.dropdown__heading')\r\n\t\t\t\t\t\t\t.text()\r\n\t\t\t\t\t\t\t.toLowerCase();\r\n\t\t\t\t\t\tif (text.includes(valueLowercase)) {\r\n\t\t\t\t\t\t\t$(this).show();\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$(this).hide();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t}, 400);\r\n\t\t});\r\n\t}\r\n\r\n\t// filter and sort product\r\n\tif (\r\n\t\tdocument.querySelector('#page-verify').getAttribute('data-class') ==\r\n\t\t'product-sub-categories-page'\r\n\t) {\r\n\t\t$('input[name=Subcategory]').on('click', function () {\r\n\t\t\twindow.location.href = $(this).attr('value');\r\n\t\t});\r\n\r\n\t\t$('.productList__sort select').on('change', function () {\r\n\t\t\twindow.location.href =\r\n\t\t\t\twindow.location.pathname + '?sort=' + $(this).val();\r\n\t\t});\r\n\t}\r\n});\r\n","import { fromFetch } from 'rxjs/fetch';\r\nimport { catchError, switchMap } from 'rxjs/operators';\r\n\r\nconst getSvg = () => {\r\n\tconst svgs = Array.from(document.querySelectorAll('.isSVG'));\r\n\tsvgs.forEach((svgParent) => {\r\n\t\tconst img = svgParent.querySelector('.svg');\r\n\t\tconst url = img.getAttribute('src');\r\n\t\tfromFetch(url)\r\n\t\t\t.pipe(\r\n\t\t\t\tswitchMap((response) => {\r\n\t\t\t\t\tif (response.ok) {\r\n\t\t\t\t\t\t// OK return data\r\n\t\t\t\t\t\treturn response.text();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// Server is returning a status requiring the client to try something else.\r\n\t\t\t\t\t\treturn of({\r\n\t\t\t\t\t\t\terror: true,\r\n\t\t\t\t\t\t\tmessage: `Error ${response.status}`,\r\n\t\t\t\t\t\t\tstatus: response.status,\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}),\r\n\t\t\t\tcatchError((err) => {\r\n\t\t\t\t\t// Network or other error, handle appropriately\r\n\t\t\t\t\tconsole.error(err);\r\n\t\t\t\t\treturn of({\r\n\t\t\t\t\t\terror: true,\r\n\t\t\t\t\t\tmessage: err.message,\r\n\t\t\t\t\t\tstatus: err.status,\r\n\t\t\t\t\t});\r\n\t\t\t\t}),\r\n\t\t\t)\r\n\t\t\t.subscribe((res) => {\r\n\t\t\t\tsvgParent.innerHTML = res;\r\n\t\t\t});\r\n\t\t// const svgContent = HTTP.get(url).subscribe((response) => {\r\n\t\t// \tconsole.log(response);\r\n\t\t// });\r\n\t});\r\n};\r\n\r\nconst dropdownToggle = () => {\r\n\t$('.dropdown').each(function () {\r\n\t\tconst label = $(this).find('.dropdown__label');\r\n\t\tconst list = $(this).find('.dropdown__list');\r\n\t\tlabel.on('click', function () {\r\n\t\t\t$(this).toggleClass('is-expanded');\r\n\t\t\tlabel.toggleClass('active');\r\n\t\t\tlist.toggleClass('active');\r\n\t\t\tlist.slideToggle('fast');\r\n\t\t});\r\n\t});\r\n};\r\n\r\nclass Tab {\r\n\tconstructor(selector, obj) {\r\n\t\tthis.options = {};\r\n\t\tthis.selector = document.querySelector(selector);\r\n\t\tif (this.selector) {\r\n\t\t\tthis.navigationItems = Array.from(\r\n\t\t\t\tthis.selector.querySelectorAll('[toggle-for]'),\r\n\t\t\t);\r\n\t\t\tthis.contentList = Array.from(\r\n\t\t\t\tthis.selector.querySelectorAll('[tab-id]'),\r\n\t\t\t);\r\n\t\t\tthis.hideAllContent();\r\n\t\t\tthis.init();\r\n\t\t} else {\r\n\t\t\tconsole.log(\"Không có selector kìa\");\r\n\t\t}\r\n\t}\r\n\r\n\thideAllContent() {\r\n\t\tthis.contentList.forEach((content) => {\r\n\t\t\tcontent.style.display = 'none';\r\n\t\t});\r\n\t}\r\n\r\n\trunTabWhenClicked() {\r\n\t\tthis.navigationItems.forEach((element, index) => {\r\n\t\t\telement.addEventListener('click', (e) => {\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tconst tabTarget = element.attributes['toggle-for'].value;\r\n\t\t\t\tconst targetDOM = Array.from(\r\n\t\t\t\t\tthis.selector.querySelectorAll(`[tab-id='${tabTarget}']`),\r\n\t\t\t\t);\r\n\t\t\t\tArray.from(this.navigationItems).forEach(\r\n\t\t\t\t\t(eleClicked, eleClickedIndex) => {\r\n\t\t\t\t\t\tif (eleClickedIndex != index) {\r\n\t\t\t\t\t\t\teleClicked.classList.remove('active');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t);\r\n\t\t\t\tArray.from(this.contentList).forEach((tabContentElement) => {\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\ttabContentElement.attributes['tab-id'].value !=\r\n\t\t\t\t\t\ttabTarget\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\ttabContentElement.style.display = 'none';\r\n\t\t\t\t\t\ttabContentElement.classList.remove('show');\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\telement.classList.add('active');\r\n\t\t\t\ttargetDOM.forEach((item) => {\r\n\t\t\t\t\titem.style.display = 'block';\r\n\t\t\t\t});\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\ttargetDOM.forEach((item) => {\r\n\t\t\t\t\t\titem.classList.add('show');\r\n\t\t\t\t\t});\r\n\t\t\t\t}, 50);\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\r\n\tactiveFirstTab() {\r\n\t\tif (this.navigationItems.length > 0) {\r\n\t\t\tthis.navigationItems[0].click();\r\n\t\t}\r\n\t}\r\n\r\n\tselectHandler(select) {\r\n\t\tselect.addEventListener('change', (e) => {\r\n\t\t\tdocument\r\n\t\t\t\t.querySelector(`[toggle-for=${e.srcElement.value}]`)\r\n\t\t\t\t.click();\r\n\t\t});\r\n\t}\r\n\r\n\trunResponsive() {\r\n\t\tconst createSelectOption = (navigationItems) => {\r\n\t\t\tlet newTabSelect = document.createElement('select');\r\n\t\t\tnavigationItems.forEach((item) => {\r\n\t\t\t\tlet newTabSelectOptionItem = document.createElement('option');\r\n\t\t\t\tnewTabSelectOptionItem.setAttribute(\r\n\t\t\t\t\t'value',\r\n\t\t\t\t\titem.getAttribute('toggle-for'),\r\n\t\t\t\t);\r\n\t\t\t\tnewTabSelectOptionItem.innerHTML = item.innerHTML;\r\n\t\t\t\tnewTabSelect.appendChild(newTabSelectOptionItem);\r\n\t\t\t});\r\n\t\t\tthis.selectHandler(newTabSelect);\r\n\t\t\treturn newTabSelect;\r\n\t\t};\r\n\r\n\t\tconst addOrRemoveSelect = (bp) => {\r\n\t\t\tconst selectResponse = createSelectOption(this.navigationItems);\r\n\t\t\tif (bp.matches) {\r\n\t\t\t\tthis.navigationList.appendChild(selectResponse);\r\n\t\t\t\tthis.navigationItems.forEach((item) => {\r\n\t\t\t\t\titem.setAttribute('style', 'display: none!important');\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tif (this.navigationList.querySelector('select')) {\r\n\t\t\t\t\tthis.navigationList\r\n\t\t\t\t\t\t.querySelector('select')\r\n\t\t\t\t\t\t.parentNode.removeChild(\r\n\t\t\t\t\t\t\tthis.navigationList.querySelector('select'),\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\tthis.navigationItems.forEach((item) => {\r\n\t\t\t\t\t\titem.removeAttribute('style');\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tif (this.options) {\r\n\t\t\tif (this.isResponsive) {\r\n\t\t\t\tconst bp = window.matchMedia(\r\n\t\t\t\t\t`(max-width: ${this.breakpoint}px)`,\r\n\t\t\t\t);\r\n\t\t\t\taddOrRemoveSelect(bp);\r\n\t\t\t\tbp.addListener(addOrRemoveSelect);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.runTabWhenClicked();\r\n\t\tthis.activeFirstTab();\r\n\t\tthis.runResponsive();\r\n\t}\r\n}\r\nexport { getSvg, dropdownToggle, Tab };\r\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar fetch_1 = require(\"../internal/observable/dom/fetch\");\nexports.fromFetch = fetch_1.fromFetch;\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subject_1 = require(\"./Subject\");\nvar Subscription_1 = require(\"./Subscription\");\nvar AsyncSubject = (function (_super) {\n __extends(AsyncSubject, _super);\n function AsyncSubject() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.value = null;\n _this.hasNext = false;\n _this.hasCompleted = false;\n return _this;\n }\n AsyncSubject.prototype._subscribe = function (subscriber) {\n if (this.hasError) {\n subscriber.error(this.thrownError);\n return Subscription_1.Subscription.EMPTY;\n }\n else if (this.hasCompleted && this.hasNext) {\n subscriber.next(this.value);\n subscriber.complete();\n return Subscription_1.Subscription.EMPTY;\n }\n return _super.prototype._subscribe.call(this, subscriber);\n };\n AsyncSubject.prototype.next = function (value) {\n if (!this.hasCompleted) {\n this.value = value;\n this.hasNext = true;\n }\n };\n AsyncSubject.prototype.error = function (error) {\n if (!this.hasCompleted) {\n _super.prototype.error.call(this, error);\n }\n };\n AsyncSubject.prototype.complete = function () {\n this.hasCompleted = true;\n if (this.hasNext) {\n _super.prototype.next.call(this, this.value);\n }\n _super.prototype.complete.call(this);\n };\n return AsyncSubject;\n}(Subject_1.Subject));\nexports.AsyncSubject = AsyncSubject;\n//# sourceMappingURL=AsyncSubject.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subject_1 = require(\"./Subject\");\nvar ObjectUnsubscribedError_1 = require(\"./util/ObjectUnsubscribedError\");\nvar BehaviorSubject = (function (_super) {\n __extends(BehaviorSubject, _super);\n function BehaviorSubject(_value) {\n var _this = _super.call(this) || this;\n _this._value = _value;\n return _this;\n }\n Object.defineProperty(BehaviorSubject.prototype, \"value\", {\n get: function () {\n return this.getValue();\n },\n enumerable: true,\n configurable: true\n });\n BehaviorSubject.prototype._subscribe = function (subscriber) {\n var subscription = _super.prototype._subscribe.call(this, subscriber);\n if (subscription && !subscription.closed) {\n subscriber.next(this._value);\n }\n return subscription;\n };\n BehaviorSubject.prototype.getValue = function () {\n if (this.hasError) {\n throw this.thrownError;\n }\n else if (this.closed) {\n throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();\n }\n else {\n return this._value;\n }\n };\n BehaviorSubject.prototype.next = function (value) {\n _super.prototype.next.call(this, this._value = value);\n };\n return BehaviorSubject;\n}(Subject_1.Subject));\nexports.BehaviorSubject = BehaviorSubject;\n//# sourceMappingURL=BehaviorSubject.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"./Subscriber\");\nvar InnerSubscriber = (function (_super) {\n __extends(InnerSubscriber, _super);\n function InnerSubscriber(parent, outerValue, outerIndex) {\n var _this = _super.call(this) || this;\n _this.parent = parent;\n _this.outerValue = outerValue;\n _this.outerIndex = outerIndex;\n _this.index = 0;\n return _this;\n }\n InnerSubscriber.prototype._next = function (value) {\n this.parent.notifyNext(this.outerValue, value, this.outerIndex, this.index++, this);\n };\n InnerSubscriber.prototype._error = function (error) {\n this.parent.notifyError(error, this);\n this.unsubscribe();\n };\n InnerSubscriber.prototype._complete = function () {\n this.parent.notifyComplete(this);\n this.unsubscribe();\n };\n return InnerSubscriber;\n}(Subscriber_1.Subscriber));\nexports.InnerSubscriber = InnerSubscriber;\n//# sourceMappingURL=InnerSubscriber.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar empty_1 = require(\"./observable/empty\");\nvar of_1 = require(\"./observable/of\");\nvar throwError_1 = require(\"./observable/throwError\");\nvar NotificationKind;\n(function (NotificationKind) {\n NotificationKind[\"NEXT\"] = \"N\";\n NotificationKind[\"ERROR\"] = \"E\";\n NotificationKind[\"COMPLETE\"] = \"C\";\n})(NotificationKind = exports.NotificationKind || (exports.NotificationKind = {}));\nvar Notification = (function () {\n function Notification(kind, value, error) {\n this.kind = kind;\n this.value = value;\n this.error = error;\n this.hasValue = kind === 'N';\n }\n Notification.prototype.observe = function (observer) {\n switch (this.kind) {\n case 'N':\n return observer.next && observer.next(this.value);\n case 'E':\n return observer.error && observer.error(this.error);\n case 'C':\n return observer.complete && observer.complete();\n }\n };\n Notification.prototype.do = function (next, error, complete) {\n var kind = this.kind;\n switch (kind) {\n case 'N':\n return next && next(this.value);\n case 'E':\n return error && error(this.error);\n case 'C':\n return complete && complete();\n }\n };\n Notification.prototype.accept = function (nextOrObserver, error, complete) {\n if (nextOrObserver && typeof nextOrObserver.next === 'function') {\n return this.observe(nextOrObserver);\n }\n else {\n return this.do(nextOrObserver, error, complete);\n }\n };\n Notification.prototype.toObservable = function () {\n var kind = this.kind;\n switch (kind) {\n case 'N':\n return of_1.of(this.value);\n case 'E':\n return throwError_1.throwError(this.error);\n case 'C':\n return empty_1.empty();\n }\n throw new Error('unexpected notification kind value');\n };\n Notification.createNext = function (value) {\n if (typeof value !== 'undefined') {\n return new Notification('N', value);\n }\n return Notification.undefinedValueNotification;\n };\n Notification.createError = function (err) {\n return new Notification('E', undefined, err);\n };\n Notification.createComplete = function () {\n return Notification.completeNotification;\n };\n Notification.completeNotification = new Notification('C');\n Notification.undefinedValueNotification = new Notification('N', undefined);\n return Notification;\n}());\nexports.Notification = Notification;\n//# sourceMappingURL=Notification.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar canReportError_1 = require(\"./util/canReportError\");\nvar toSubscriber_1 = require(\"./util/toSubscriber\");\nvar observable_1 = require(\"./symbol/observable\");\nvar pipe_1 = require(\"./util/pipe\");\nvar config_1 = require(\"./config\");\nvar Observable = (function () {\n function Observable(subscribe) {\n this._isScalar = false;\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n Observable.prototype.lift = function (operator) {\n var observable = new Observable();\n observable.source = this;\n observable.operator = operator;\n return observable;\n };\n Observable.prototype.subscribe = function (observerOrNext, error, complete) {\n var operator = this.operator;\n var sink = toSubscriber_1.toSubscriber(observerOrNext, error, complete);\n if (operator) {\n sink.add(operator.call(sink, this.source));\n }\n else {\n sink.add(this.source || (config_1.config.useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ?\n this._subscribe(sink) :\n this._trySubscribe(sink));\n }\n if (config_1.config.useDeprecatedSynchronousErrorHandling) {\n if (sink.syncErrorThrowable) {\n sink.syncErrorThrowable = false;\n if (sink.syncErrorThrown) {\n throw sink.syncErrorValue;\n }\n }\n }\n return sink;\n };\n Observable.prototype._trySubscribe = function (sink) {\n try {\n return this._subscribe(sink);\n }\n catch (err) {\n if (config_1.config.useDeprecatedSynchronousErrorHandling) {\n sink.syncErrorThrown = true;\n sink.syncErrorValue = err;\n }\n if (canReportError_1.canReportError(sink)) {\n sink.error(err);\n }\n else {\n console.warn(err);\n }\n }\n };\n Observable.prototype.forEach = function (next, promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var subscription;\n subscription = _this.subscribe(function (value) {\n try {\n next(value);\n }\n catch (err) {\n reject(err);\n if (subscription) {\n subscription.unsubscribe();\n }\n }\n }, reject, resolve);\n });\n };\n Observable.prototype._subscribe = function (subscriber) {\n var source = this.source;\n return source && source.subscribe(subscriber);\n };\n Observable.prototype[observable_1.observable] = function () {\n return this;\n };\n Observable.prototype.pipe = function () {\n var operations = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n operations[_i] = arguments[_i];\n }\n if (operations.length === 0) {\n return this;\n }\n return pipe_1.pipeFromArray(operations)(this);\n };\n Observable.prototype.toPromise = function (promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var value;\n _this.subscribe(function (x) { return value = x; }, function (err) { return reject(err); }, function () { return resolve(value); });\n });\n };\n Observable.create = function (subscribe) {\n return new Observable(subscribe);\n };\n return Observable;\n}());\nexports.Observable = Observable;\nfunction getPromiseCtor(promiseCtor) {\n if (!promiseCtor) {\n promiseCtor = config_1.config.Promise || Promise;\n }\n if (!promiseCtor) {\n throw new Error('no Promise impl found');\n }\n return promiseCtor;\n}\n//# sourceMappingURL=Observable.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar config_1 = require(\"./config\");\nvar hostReportError_1 = require(\"./util/hostReportError\");\nexports.empty = {\n closed: true,\n next: function (value) { },\n error: function (err) {\n if (config_1.config.useDeprecatedSynchronousErrorHandling) {\n throw err;\n }\n else {\n hostReportError_1.hostReportError(err);\n }\n },\n complete: function () { }\n};\n//# sourceMappingURL=Observer.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"./Subscriber\");\nvar OuterSubscriber = (function (_super) {\n __extends(OuterSubscriber, _super);\n function OuterSubscriber() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n OuterSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n this.destination.next(innerValue);\n };\n OuterSubscriber.prototype.notifyError = function (error, innerSub) {\n this.destination.error(error);\n };\n OuterSubscriber.prototype.notifyComplete = function (innerSub) {\n this.destination.complete();\n };\n return OuterSubscriber;\n}(Subscriber_1.Subscriber));\nexports.OuterSubscriber = OuterSubscriber;\n//# sourceMappingURL=OuterSubscriber.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subject_1 = require(\"./Subject\");\nvar queue_1 = require(\"./scheduler/queue\");\nvar Subscription_1 = require(\"./Subscription\");\nvar observeOn_1 = require(\"./operators/observeOn\");\nvar ObjectUnsubscribedError_1 = require(\"./util/ObjectUnsubscribedError\");\nvar SubjectSubscription_1 = require(\"./SubjectSubscription\");\nvar ReplaySubject = (function (_super) {\n __extends(ReplaySubject, _super);\n function ReplaySubject(bufferSize, windowTime, scheduler) {\n if (bufferSize === void 0) { bufferSize = Number.POSITIVE_INFINITY; }\n if (windowTime === void 0) { windowTime = Number.POSITIVE_INFINITY; }\n var _this = _super.call(this) || this;\n _this.scheduler = scheduler;\n _this._events = [];\n _this._infiniteTimeWindow = false;\n _this._bufferSize = bufferSize < 1 ? 1 : bufferSize;\n _this._windowTime = windowTime < 1 ? 1 : windowTime;\n if (windowTime === Number.POSITIVE_INFINITY) {\n _this._infiniteTimeWindow = true;\n _this.next = _this.nextInfiniteTimeWindow;\n }\n else {\n _this.next = _this.nextTimeWindow;\n }\n return _this;\n }\n ReplaySubject.prototype.nextInfiniteTimeWindow = function (value) {\n if (!this.isStopped) {\n var _events = this._events;\n _events.push(value);\n if (_events.length > this._bufferSize) {\n _events.shift();\n }\n }\n _super.prototype.next.call(this, value);\n };\n ReplaySubject.prototype.nextTimeWindow = function (value) {\n if (!this.isStopped) {\n this._events.push(new ReplayEvent(this._getNow(), value));\n this._trimBufferThenGetEvents();\n }\n _super.prototype.next.call(this, value);\n };\n ReplaySubject.prototype._subscribe = function (subscriber) {\n var _infiniteTimeWindow = this._infiniteTimeWindow;\n var _events = _infiniteTimeWindow ? this._events : this._trimBufferThenGetEvents();\n var scheduler = this.scheduler;\n var len = _events.length;\n var subscription;\n if (this.closed) {\n throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();\n }\n else if (this.isStopped || this.hasError) {\n subscription = Subscription_1.Subscription.EMPTY;\n }\n else {\n this.observers.push(subscriber);\n subscription = new SubjectSubscription_1.SubjectSubscription(this, subscriber);\n }\n if (scheduler) {\n subscriber.add(subscriber = new observeOn_1.ObserveOnSubscriber(subscriber, scheduler));\n }\n if (_infiniteTimeWindow) {\n for (var i = 0; i < len && !subscriber.closed; i++) {\n subscriber.next(_events[i]);\n }\n }\n else {\n for (var i = 0; i < len && !subscriber.closed; i++) {\n subscriber.next(_events[i].value);\n }\n }\n if (this.hasError) {\n subscriber.error(this.thrownError);\n }\n else if (this.isStopped) {\n subscriber.complete();\n }\n return subscription;\n };\n ReplaySubject.prototype._getNow = function () {\n return (this.scheduler || queue_1.queue).now();\n };\n ReplaySubject.prototype._trimBufferThenGetEvents = function () {\n var now = this._getNow();\n var _bufferSize = this._bufferSize;\n var _windowTime = this._windowTime;\n var _events = this._events;\n var eventsCount = _events.length;\n var spliceCount = 0;\n while (spliceCount < eventsCount) {\n if ((now - _events[spliceCount].time) < _windowTime) {\n break;\n }\n spliceCount++;\n }\n if (eventsCount > _bufferSize) {\n spliceCount = Math.max(spliceCount, eventsCount - _bufferSize);\n }\n if (spliceCount > 0) {\n _events.splice(0, spliceCount);\n }\n return _events;\n };\n return ReplaySubject;\n}(Subject_1.Subject));\nexports.ReplaySubject = ReplaySubject;\nvar ReplayEvent = (function () {\n function ReplayEvent(time, value) {\n this.time = time;\n this.value = value;\n }\n return ReplayEvent;\n}());\n//# sourceMappingURL=ReplaySubject.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Scheduler = (function () {\n function Scheduler(SchedulerAction, now) {\n if (now === void 0) { now = Scheduler.now; }\n this.SchedulerAction = SchedulerAction;\n this.now = now;\n }\n Scheduler.prototype.schedule = function (work, delay, state) {\n if (delay === void 0) { delay = 0; }\n return new this.SchedulerAction(this, work).schedule(state, delay);\n };\n Scheduler.now = function () { return Date.now(); };\n return Scheduler;\n}());\nexports.Scheduler = Scheduler;\n//# sourceMappingURL=Scheduler.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Observable_1 = require(\"./Observable\");\nvar Subscriber_1 = require(\"./Subscriber\");\nvar Subscription_1 = require(\"./Subscription\");\nvar ObjectUnsubscribedError_1 = require(\"./util/ObjectUnsubscribedError\");\nvar SubjectSubscription_1 = require(\"./SubjectSubscription\");\nvar rxSubscriber_1 = require(\"../internal/symbol/rxSubscriber\");\nvar SubjectSubscriber = (function (_super) {\n __extends(SubjectSubscriber, _super);\n function SubjectSubscriber(destination) {\n var _this = _super.call(this, destination) || this;\n _this.destination = destination;\n return _this;\n }\n return SubjectSubscriber;\n}(Subscriber_1.Subscriber));\nexports.SubjectSubscriber = SubjectSubscriber;\nvar Subject = (function (_super) {\n __extends(Subject, _super);\n function Subject() {\n var _this = _super.call(this) || this;\n _this.observers = [];\n _this.closed = false;\n _this.isStopped = false;\n _this.hasError = false;\n _this.thrownError = null;\n return _this;\n }\n Subject.prototype[rxSubscriber_1.rxSubscriber] = function () {\n return new SubjectSubscriber(this);\n };\n Subject.prototype.lift = function (operator) {\n var subject = new AnonymousSubject(this, this);\n subject.operator = operator;\n return subject;\n };\n Subject.prototype.next = function (value) {\n if (this.closed) {\n throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();\n }\n if (!this.isStopped) {\n var observers = this.observers;\n var len = observers.length;\n var copy = observers.slice();\n for (var i = 0; i < len; i++) {\n copy[i].next(value);\n }\n }\n };\n Subject.prototype.error = function (err) {\n if (this.closed) {\n throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();\n }\n this.hasError = true;\n this.thrownError = err;\n this.isStopped = true;\n var observers = this.observers;\n var len = observers.length;\n var copy = observers.slice();\n for (var i = 0; i < len; i++) {\n copy[i].error(err);\n }\n this.observers.length = 0;\n };\n Subject.prototype.complete = function () {\n if (this.closed) {\n throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();\n }\n this.isStopped = true;\n var observers = this.observers;\n var len = observers.length;\n var copy = observers.slice();\n for (var i = 0; i < len; i++) {\n copy[i].complete();\n }\n this.observers.length = 0;\n };\n Subject.prototype.unsubscribe = function () {\n this.isStopped = true;\n this.closed = true;\n this.observers = null;\n };\n Subject.prototype._trySubscribe = function (subscriber) {\n if (this.closed) {\n throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();\n }\n else {\n return _super.prototype._trySubscribe.call(this, subscriber);\n }\n };\n Subject.prototype._subscribe = function (subscriber) {\n if (this.closed) {\n throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();\n }\n else if (this.hasError) {\n subscriber.error(this.thrownError);\n return Subscription_1.Subscription.EMPTY;\n }\n else if (this.isStopped) {\n subscriber.complete();\n return Subscription_1.Subscription.EMPTY;\n }\n else {\n this.observers.push(subscriber);\n return new SubjectSubscription_1.SubjectSubscription(this, subscriber);\n }\n };\n Subject.prototype.asObservable = function () {\n var observable = new Observable_1.Observable();\n observable.source = this;\n return observable;\n };\n Subject.create = function (destination, source) {\n return new AnonymousSubject(destination, source);\n };\n return Subject;\n}(Observable_1.Observable));\nexports.Subject = Subject;\nvar AnonymousSubject = (function (_super) {\n __extends(AnonymousSubject, _super);\n function AnonymousSubject(destination, source) {\n var _this = _super.call(this) || this;\n _this.destination = destination;\n _this.source = source;\n return _this;\n }\n AnonymousSubject.prototype.next = function (value) {\n var destination = this.destination;\n if (destination && destination.next) {\n destination.next(value);\n }\n };\n AnonymousSubject.prototype.error = function (err) {\n var destination = this.destination;\n if (destination && destination.error) {\n this.destination.error(err);\n }\n };\n AnonymousSubject.prototype.complete = function () {\n var destination = this.destination;\n if (destination && destination.complete) {\n this.destination.complete();\n }\n };\n AnonymousSubject.prototype._subscribe = function (subscriber) {\n var source = this.source;\n if (source) {\n return this.source.subscribe(subscriber);\n }\n else {\n return Subscription_1.Subscription.EMPTY;\n }\n };\n return AnonymousSubject;\n}(Subject));\nexports.AnonymousSubject = AnonymousSubject;\n//# sourceMappingURL=Subject.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscription_1 = require(\"./Subscription\");\nvar SubjectSubscription = (function (_super) {\n __extends(SubjectSubscription, _super);\n function SubjectSubscription(subject, subscriber) {\n var _this = _super.call(this) || this;\n _this.subject = subject;\n _this.subscriber = subscriber;\n _this.closed = false;\n return _this;\n }\n SubjectSubscription.prototype.unsubscribe = function () {\n if (this.closed) {\n return;\n }\n this.closed = true;\n var subject = this.subject;\n var observers = subject.observers;\n this.subject = null;\n if (!observers || observers.length === 0 || subject.isStopped || subject.closed) {\n return;\n }\n var subscriberIndex = observers.indexOf(this.subscriber);\n if (subscriberIndex !== -1) {\n observers.splice(subscriberIndex, 1);\n }\n };\n return SubjectSubscription;\n}(Subscription_1.Subscription));\nexports.SubjectSubscription = SubjectSubscription;\n//# sourceMappingURL=SubjectSubscription.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar isFunction_1 = require(\"./util/isFunction\");\nvar Observer_1 = require(\"./Observer\");\nvar Subscription_1 = require(\"./Subscription\");\nvar rxSubscriber_1 = require(\"../internal/symbol/rxSubscriber\");\nvar config_1 = require(\"./config\");\nvar hostReportError_1 = require(\"./util/hostReportError\");\nvar Subscriber = (function (_super) {\n __extends(Subscriber, _super);\n function Subscriber(destinationOrNext, error, complete) {\n var _this = _super.call(this) || this;\n _this.syncErrorValue = null;\n _this.syncErrorThrown = false;\n _this.syncErrorThrowable = false;\n _this.isStopped = false;\n switch (arguments.length) {\n case 0:\n _this.destination = Observer_1.empty;\n break;\n case 1:\n if (!destinationOrNext) {\n _this.destination = Observer_1.empty;\n break;\n }\n if (typeof destinationOrNext === 'object') {\n if (destinationOrNext instanceof Subscriber) {\n _this.syncErrorThrowable = destinationOrNext.syncErrorThrowable;\n _this.destination = destinationOrNext;\n destinationOrNext.add(_this);\n }\n else {\n _this.syncErrorThrowable = true;\n _this.destination = new SafeSubscriber(_this, destinationOrNext);\n }\n break;\n }\n default:\n _this.syncErrorThrowable = true;\n _this.destination = new SafeSubscriber(_this, destinationOrNext, error, complete);\n break;\n }\n return _this;\n }\n Subscriber.prototype[rxSubscriber_1.rxSubscriber] = function () { return this; };\n Subscriber.create = function (next, error, complete) {\n var subscriber = new Subscriber(next, error, complete);\n subscriber.syncErrorThrowable = false;\n return subscriber;\n };\n Subscriber.prototype.next = function (value) {\n if (!this.isStopped) {\n this._next(value);\n }\n };\n Subscriber.prototype.error = function (err) {\n if (!this.isStopped) {\n this.isStopped = true;\n this._error(err);\n }\n };\n Subscriber.prototype.complete = function () {\n if (!this.isStopped) {\n this.isStopped = true;\n this._complete();\n }\n };\n Subscriber.prototype.unsubscribe = function () {\n if (this.closed) {\n return;\n }\n this.isStopped = true;\n _super.prototype.unsubscribe.call(this);\n };\n Subscriber.prototype._next = function (value) {\n this.destination.next(value);\n };\n Subscriber.prototype._error = function (err) {\n this.destination.error(err);\n this.unsubscribe();\n };\n Subscriber.prototype._complete = function () {\n this.destination.complete();\n this.unsubscribe();\n };\n Subscriber.prototype._unsubscribeAndRecycle = function () {\n var _parentOrParents = this._parentOrParents;\n this._parentOrParents = null;\n this.unsubscribe();\n this.closed = false;\n this.isStopped = false;\n this._parentOrParents = _parentOrParents;\n return this;\n };\n return Subscriber;\n}(Subscription_1.Subscription));\nexports.Subscriber = Subscriber;\nvar SafeSubscriber = (function (_super) {\n __extends(SafeSubscriber, _super);\n function SafeSubscriber(_parentSubscriber, observerOrNext, error, complete) {\n var _this = _super.call(this) || this;\n _this._parentSubscriber = _parentSubscriber;\n var next;\n var context = _this;\n if (isFunction_1.isFunction(observerOrNext)) {\n next = observerOrNext;\n }\n else if (observerOrNext) {\n next = observerOrNext.next;\n error = observerOrNext.error;\n complete = observerOrNext.complete;\n if (observerOrNext !== Observer_1.empty) {\n context = Object.create(observerOrNext);\n if (isFunction_1.isFunction(context.unsubscribe)) {\n _this.add(context.unsubscribe.bind(context));\n }\n context.unsubscribe = _this.unsubscribe.bind(_this);\n }\n }\n _this._context = context;\n _this._next = next;\n _this._error = error;\n _this._complete = complete;\n return _this;\n }\n SafeSubscriber.prototype.next = function (value) {\n if (!this.isStopped && this._next) {\n var _parentSubscriber = this._parentSubscriber;\n if (!config_1.config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {\n this.__tryOrUnsub(this._next, value);\n }\n else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {\n this.unsubscribe();\n }\n }\n };\n SafeSubscriber.prototype.error = function (err) {\n if (!this.isStopped) {\n var _parentSubscriber = this._parentSubscriber;\n var useDeprecatedSynchronousErrorHandling = config_1.config.useDeprecatedSynchronousErrorHandling;\n if (this._error) {\n if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {\n this.__tryOrUnsub(this._error, err);\n this.unsubscribe();\n }\n else {\n this.__tryOrSetError(_parentSubscriber, this._error, err);\n this.unsubscribe();\n }\n }\n else if (!_parentSubscriber.syncErrorThrowable) {\n this.unsubscribe();\n if (useDeprecatedSynchronousErrorHandling) {\n throw err;\n }\n hostReportError_1.hostReportError(err);\n }\n else {\n if (useDeprecatedSynchronousErrorHandling) {\n _parentSubscriber.syncErrorValue = err;\n _parentSubscriber.syncErrorThrown = true;\n }\n else {\n hostReportError_1.hostReportError(err);\n }\n this.unsubscribe();\n }\n }\n };\n SafeSubscriber.prototype.complete = function () {\n var _this = this;\n if (!this.isStopped) {\n var _parentSubscriber = this._parentSubscriber;\n if (this._complete) {\n var wrappedComplete = function () { return _this._complete.call(_this._context); };\n if (!config_1.config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {\n this.__tryOrUnsub(wrappedComplete);\n this.unsubscribe();\n }\n else {\n this.__tryOrSetError(_parentSubscriber, wrappedComplete);\n this.unsubscribe();\n }\n }\n else {\n this.unsubscribe();\n }\n }\n };\n SafeSubscriber.prototype.__tryOrUnsub = function (fn, value) {\n try {\n fn.call(this._context, value);\n }\n catch (err) {\n this.unsubscribe();\n if (config_1.config.useDeprecatedSynchronousErrorHandling) {\n throw err;\n }\n else {\n hostReportError_1.hostReportError(err);\n }\n }\n };\n SafeSubscriber.prototype.__tryOrSetError = function (parent, fn, value) {\n if (!config_1.config.useDeprecatedSynchronousErrorHandling) {\n throw new Error('bad call');\n }\n try {\n fn.call(this._context, value);\n }\n catch (err) {\n if (config_1.config.useDeprecatedSynchronousErrorHandling) {\n parent.syncErrorValue = err;\n parent.syncErrorThrown = true;\n return true;\n }\n else {\n hostReportError_1.hostReportError(err);\n return true;\n }\n }\n return false;\n };\n SafeSubscriber.prototype._unsubscribe = function () {\n var _parentSubscriber = this._parentSubscriber;\n this._context = null;\n this._parentSubscriber = null;\n _parentSubscriber.unsubscribe();\n };\n return SafeSubscriber;\n}(Subscriber));\nexports.SafeSubscriber = SafeSubscriber;\n//# sourceMappingURL=Subscriber.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar isArray_1 = require(\"./util/isArray\");\nvar isObject_1 = require(\"./util/isObject\");\nvar isFunction_1 = require(\"./util/isFunction\");\nvar UnsubscriptionError_1 = require(\"./util/UnsubscriptionError\");\nvar Subscription = (function () {\n function Subscription(unsubscribe) {\n this.closed = false;\n this._parentOrParents = null;\n this._subscriptions = null;\n if (unsubscribe) {\n this._ctorUnsubscribe = true;\n this._unsubscribe = unsubscribe;\n }\n }\n Subscription.prototype.unsubscribe = function () {\n var errors;\n if (this.closed) {\n return;\n }\n var _a = this, _parentOrParents = _a._parentOrParents, _ctorUnsubscribe = _a._ctorUnsubscribe, _unsubscribe = _a._unsubscribe, _subscriptions = _a._subscriptions;\n this.closed = true;\n this._parentOrParents = null;\n this._subscriptions = null;\n if (_parentOrParents instanceof Subscription) {\n _parentOrParents.remove(this);\n }\n else if (_parentOrParents !== null) {\n for (var index = 0; index < _parentOrParents.length; ++index) {\n var parent_1 = _parentOrParents[index];\n parent_1.remove(this);\n }\n }\n if (isFunction_1.isFunction(_unsubscribe)) {\n if (_ctorUnsubscribe) {\n this._unsubscribe = undefined;\n }\n try {\n _unsubscribe.call(this);\n }\n catch (e) {\n errors = e instanceof UnsubscriptionError_1.UnsubscriptionError ? flattenUnsubscriptionErrors(e.errors) : [e];\n }\n }\n if (isArray_1.isArray(_subscriptions)) {\n var index = -1;\n var len = _subscriptions.length;\n while (++index < len) {\n var sub = _subscriptions[index];\n if (isObject_1.isObject(sub)) {\n try {\n sub.unsubscribe();\n }\n catch (e) {\n errors = errors || [];\n if (e instanceof UnsubscriptionError_1.UnsubscriptionError) {\n errors = errors.concat(flattenUnsubscriptionErrors(e.errors));\n }\n else {\n errors.push(e);\n }\n }\n }\n }\n }\n if (errors) {\n throw new UnsubscriptionError_1.UnsubscriptionError(errors);\n }\n };\n Subscription.prototype.add = function (teardown) {\n var subscription = teardown;\n if (!teardown) {\n return Subscription.EMPTY;\n }\n switch (typeof teardown) {\n case 'function':\n subscription = new Subscription(teardown);\n case 'object':\n if (subscription === this || subscription.closed || typeof subscription.unsubscribe !== 'function') {\n return subscription;\n }\n else if (this.closed) {\n subscription.unsubscribe();\n return subscription;\n }\n else if (!(subscription instanceof Subscription)) {\n var tmp = subscription;\n subscription = new Subscription();\n subscription._subscriptions = [tmp];\n }\n break;\n default: {\n throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.');\n }\n }\n var _parentOrParents = subscription._parentOrParents;\n if (_parentOrParents === null) {\n subscription._parentOrParents = this;\n }\n else if (_parentOrParents instanceof Subscription) {\n if (_parentOrParents === this) {\n return subscription;\n }\n subscription._parentOrParents = [_parentOrParents, this];\n }\n else if (_parentOrParents.indexOf(this) === -1) {\n _parentOrParents.push(this);\n }\n else {\n return subscription;\n }\n var subscriptions = this._subscriptions;\n if (subscriptions === null) {\n this._subscriptions = [subscription];\n }\n else {\n subscriptions.push(subscription);\n }\n return subscription;\n };\n Subscription.prototype.remove = function (subscription) {\n var subscriptions = this._subscriptions;\n if (subscriptions) {\n var subscriptionIndex = subscriptions.indexOf(subscription);\n if (subscriptionIndex !== -1) {\n subscriptions.splice(subscriptionIndex, 1);\n }\n }\n };\n Subscription.EMPTY = (function (empty) {\n empty.closed = true;\n return empty;\n }(new Subscription()));\n return Subscription;\n}());\nexports.Subscription = Subscription;\nfunction flattenUnsubscriptionErrors(errors) {\n return errors.reduce(function (errs, err) { return errs.concat((err instanceof UnsubscriptionError_1.UnsubscriptionError) ? err.errors : err); }, []);\n}\n//# sourceMappingURL=Subscription.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar _enable_super_gross_mode_that_will_cause_bad_things = false;\nexports.config = {\n Promise: undefined,\n set useDeprecatedSynchronousErrorHandling(value) {\n if (value) {\n var error = new Error();\n console.warn('DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \\n' + error.stack);\n }\n else if (_enable_super_gross_mode_that_will_cause_bad_things) {\n console.log('RxJS: Back to a better error behavior. Thank you. <3');\n }\n _enable_super_gross_mode_that_will_cause_bad_things = value;\n },\n get useDeprecatedSynchronousErrorHandling() {\n return _enable_super_gross_mode_that_will_cause_bad_things;\n },\n};\n//# sourceMappingURL=config.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"./Subscriber\");\nvar Observable_1 = require(\"./Observable\");\nvar subscribeTo_1 = require(\"./util/subscribeTo\");\nvar SimpleInnerSubscriber = (function (_super) {\n __extends(SimpleInnerSubscriber, _super);\n function SimpleInnerSubscriber(parent) {\n var _this = _super.call(this) || this;\n _this.parent = parent;\n return _this;\n }\n SimpleInnerSubscriber.prototype._next = function (value) {\n this.parent.notifyNext(value);\n };\n SimpleInnerSubscriber.prototype._error = function (error) {\n this.parent.notifyError(error);\n this.unsubscribe();\n };\n SimpleInnerSubscriber.prototype._complete = function () {\n this.parent.notifyComplete();\n this.unsubscribe();\n };\n return SimpleInnerSubscriber;\n}(Subscriber_1.Subscriber));\nexports.SimpleInnerSubscriber = SimpleInnerSubscriber;\nvar ComplexInnerSubscriber = (function (_super) {\n __extends(ComplexInnerSubscriber, _super);\n function ComplexInnerSubscriber(parent, outerValue, outerIndex) {\n var _this = _super.call(this) || this;\n _this.parent = parent;\n _this.outerValue = outerValue;\n _this.outerIndex = outerIndex;\n return _this;\n }\n ComplexInnerSubscriber.prototype._next = function (value) {\n this.parent.notifyNext(this.outerValue, value, this.outerIndex, this);\n };\n ComplexInnerSubscriber.prototype._error = function (error) {\n this.parent.notifyError(error);\n this.unsubscribe();\n };\n ComplexInnerSubscriber.prototype._complete = function () {\n this.parent.notifyComplete(this);\n this.unsubscribe();\n };\n return ComplexInnerSubscriber;\n}(Subscriber_1.Subscriber));\nexports.ComplexInnerSubscriber = ComplexInnerSubscriber;\nvar SimpleOuterSubscriber = (function (_super) {\n __extends(SimpleOuterSubscriber, _super);\n function SimpleOuterSubscriber() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SimpleOuterSubscriber.prototype.notifyNext = function (innerValue) {\n this.destination.next(innerValue);\n };\n SimpleOuterSubscriber.prototype.notifyError = function (err) {\n this.destination.error(err);\n };\n SimpleOuterSubscriber.prototype.notifyComplete = function () {\n this.destination.complete();\n };\n return SimpleOuterSubscriber;\n}(Subscriber_1.Subscriber));\nexports.SimpleOuterSubscriber = SimpleOuterSubscriber;\nvar ComplexOuterSubscriber = (function (_super) {\n __extends(ComplexOuterSubscriber, _super);\n function ComplexOuterSubscriber() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ComplexOuterSubscriber.prototype.notifyNext = function (_outerValue, innerValue, _outerIndex, _innerSub) {\n this.destination.next(innerValue);\n };\n ComplexOuterSubscriber.prototype.notifyError = function (error) {\n this.destination.error(error);\n };\n ComplexOuterSubscriber.prototype.notifyComplete = function (_innerSub) {\n this.destination.complete();\n };\n return ComplexOuterSubscriber;\n}(Subscriber_1.Subscriber));\nexports.ComplexOuterSubscriber = ComplexOuterSubscriber;\nfunction innerSubscribe(result, innerSubscriber) {\n if (innerSubscriber.closed) {\n return undefined;\n }\n if (result instanceof Observable_1.Observable) {\n return result.subscribe(innerSubscriber);\n }\n return subscribeTo_1.subscribeTo(result)(innerSubscriber);\n}\nexports.innerSubscribe = innerSubscribe;\n//# sourceMappingURL=innerSubscribe.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subject_1 = require(\"../Subject\");\nvar Observable_1 = require(\"../Observable\");\nvar Subscriber_1 = require(\"../Subscriber\");\nvar Subscription_1 = require(\"../Subscription\");\nvar refCount_1 = require(\"../operators/refCount\");\nvar ConnectableObservable = (function (_super) {\n __extends(ConnectableObservable, _super);\n function ConnectableObservable(source, subjectFactory) {\n var _this = _super.call(this) || this;\n _this.source = source;\n _this.subjectFactory = subjectFactory;\n _this._refCount = 0;\n _this._isComplete = false;\n return _this;\n }\n ConnectableObservable.prototype._subscribe = function (subscriber) {\n return this.getSubject().subscribe(subscriber);\n };\n ConnectableObservable.prototype.getSubject = function () {\n var subject = this._subject;\n if (!subject || subject.isStopped) {\n this._subject = this.subjectFactory();\n }\n return this._subject;\n };\n ConnectableObservable.prototype.connect = function () {\n var connection = this._connection;\n if (!connection) {\n this._isComplete = false;\n connection = this._connection = new Subscription_1.Subscription();\n connection.add(this.source\n .subscribe(new ConnectableSubscriber(this.getSubject(), this)));\n if (connection.closed) {\n this._connection = null;\n connection = Subscription_1.Subscription.EMPTY;\n }\n }\n return connection;\n };\n ConnectableObservable.prototype.refCount = function () {\n return refCount_1.refCount()(this);\n };\n return ConnectableObservable;\n}(Observable_1.Observable));\nexports.ConnectableObservable = ConnectableObservable;\nexports.connectableObservableDescriptor = (function () {\n var connectableProto = ConnectableObservable.prototype;\n return {\n operator: { value: null },\n _refCount: { value: 0, writable: true },\n _subject: { value: null, writable: true },\n _connection: { value: null, writable: true },\n _subscribe: { value: connectableProto._subscribe },\n _isComplete: { value: connectableProto._isComplete, writable: true },\n getSubject: { value: connectableProto.getSubject },\n connect: { value: connectableProto.connect },\n refCount: { value: connectableProto.refCount }\n };\n})();\nvar ConnectableSubscriber = (function (_super) {\n __extends(ConnectableSubscriber, _super);\n function ConnectableSubscriber(destination, connectable) {\n var _this = _super.call(this, destination) || this;\n _this.connectable = connectable;\n return _this;\n }\n ConnectableSubscriber.prototype._error = function (err) {\n this._unsubscribe();\n _super.prototype._error.call(this, err);\n };\n ConnectableSubscriber.prototype._complete = function () {\n this.connectable._isComplete = true;\n this._unsubscribe();\n _super.prototype._complete.call(this);\n };\n ConnectableSubscriber.prototype._unsubscribe = function () {\n var connectable = this.connectable;\n if (connectable) {\n this.connectable = null;\n var connection = connectable._connection;\n connectable._refCount = 0;\n connectable._subject = null;\n connectable._connection = null;\n if (connection) {\n connection.unsubscribe();\n }\n }\n };\n return ConnectableSubscriber;\n}(Subject_1.SubjectSubscriber));\nvar RefCountOperator = (function () {\n function RefCountOperator(connectable) {\n this.connectable = connectable;\n }\n RefCountOperator.prototype.call = function (subscriber, source) {\n var connectable = this.connectable;\n connectable._refCount++;\n var refCounter = new RefCountSubscriber(subscriber, connectable);\n var subscription = source.subscribe(refCounter);\n if (!refCounter.closed) {\n refCounter.connection = connectable.connect();\n }\n return subscription;\n };\n return RefCountOperator;\n}());\nvar RefCountSubscriber = (function (_super) {\n __extends(RefCountSubscriber, _super);\n function RefCountSubscriber(destination, connectable) {\n var _this = _super.call(this, destination) || this;\n _this.connectable = connectable;\n return _this;\n }\n RefCountSubscriber.prototype._unsubscribe = function () {\n var connectable = this.connectable;\n if (!connectable) {\n this.connection = null;\n return;\n }\n this.connectable = null;\n var refCount = connectable._refCount;\n if (refCount <= 0) {\n this.connection = null;\n return;\n }\n connectable._refCount = refCount - 1;\n if (refCount > 1) {\n this.connection = null;\n return;\n }\n var connection = this.connection;\n var sharedConnection = connectable._connection;\n this.connection = null;\n if (sharedConnection && (!connection || sharedConnection === connection)) {\n sharedConnection.unsubscribe();\n }\n };\n return RefCountSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=ConnectableObservable.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Observable_1 = require(\"../Observable\");\nvar asap_1 = require(\"../scheduler/asap\");\nvar isNumeric_1 = require(\"../util/isNumeric\");\nvar SubscribeOnObservable = (function (_super) {\n __extends(SubscribeOnObservable, _super);\n function SubscribeOnObservable(source, delayTime, scheduler) {\n if (delayTime === void 0) { delayTime = 0; }\n if (scheduler === void 0) { scheduler = asap_1.asap; }\n var _this = _super.call(this) || this;\n _this.source = source;\n _this.delayTime = delayTime;\n _this.scheduler = scheduler;\n if (!isNumeric_1.isNumeric(delayTime) || delayTime < 0) {\n _this.delayTime = 0;\n }\n if (!scheduler || typeof scheduler.schedule !== 'function') {\n _this.scheduler = asap_1.asap;\n }\n return _this;\n }\n SubscribeOnObservable.create = function (source, delay, scheduler) {\n if (delay === void 0) { delay = 0; }\n if (scheduler === void 0) { scheduler = asap_1.asap; }\n return new SubscribeOnObservable(source, delay, scheduler);\n };\n SubscribeOnObservable.dispatch = function (arg) {\n var source = arg.source, subscriber = arg.subscriber;\n return this.add(source.subscribe(subscriber));\n };\n SubscribeOnObservable.prototype._subscribe = function (subscriber) {\n var delay = this.delayTime;\n var source = this.source;\n var scheduler = this.scheduler;\n return scheduler.schedule(SubscribeOnObservable.dispatch, delay, {\n source: source, subscriber: subscriber\n });\n };\n return SubscribeOnObservable;\n}(Observable_1.Observable));\nexports.SubscribeOnObservable = SubscribeOnObservable;\n//# sourceMappingURL=SubscribeOnObservable.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar isScheduler_1 = require(\"../util/isScheduler\");\nvar isArray_1 = require(\"../util/isArray\");\nvar OuterSubscriber_1 = require(\"../OuterSubscriber\");\nvar subscribeToResult_1 = require(\"../util/subscribeToResult\");\nvar fromArray_1 = require(\"./fromArray\");\nvar NONE = {};\nfunction combineLatest() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i] = arguments[_i];\n }\n var resultSelector = undefined;\n var scheduler = undefined;\n if (isScheduler_1.isScheduler(observables[observables.length - 1])) {\n scheduler = observables.pop();\n }\n if (typeof observables[observables.length - 1] === 'function') {\n resultSelector = observables.pop();\n }\n if (observables.length === 1 && isArray_1.isArray(observables[0])) {\n observables = observables[0];\n }\n return fromArray_1.fromArray(observables, scheduler).lift(new CombineLatestOperator(resultSelector));\n}\nexports.combineLatest = combineLatest;\nvar CombineLatestOperator = (function () {\n function CombineLatestOperator(resultSelector) {\n this.resultSelector = resultSelector;\n }\n CombineLatestOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new CombineLatestSubscriber(subscriber, this.resultSelector));\n };\n return CombineLatestOperator;\n}());\nexports.CombineLatestOperator = CombineLatestOperator;\nvar CombineLatestSubscriber = (function (_super) {\n __extends(CombineLatestSubscriber, _super);\n function CombineLatestSubscriber(destination, resultSelector) {\n var _this = _super.call(this, destination) || this;\n _this.resultSelector = resultSelector;\n _this.active = 0;\n _this.values = [];\n _this.observables = [];\n return _this;\n }\n CombineLatestSubscriber.prototype._next = function (observable) {\n this.values.push(NONE);\n this.observables.push(observable);\n };\n CombineLatestSubscriber.prototype._complete = function () {\n var observables = this.observables;\n var len = observables.length;\n if (len === 0) {\n this.destination.complete();\n }\n else {\n this.active = len;\n this.toRespond = len;\n for (var i = 0; i < len; i++) {\n var observable = observables[i];\n this.add(subscribeToResult_1.subscribeToResult(this, observable, undefined, i));\n }\n }\n };\n CombineLatestSubscriber.prototype.notifyComplete = function (unused) {\n if ((this.active -= 1) === 0) {\n this.destination.complete();\n }\n };\n CombineLatestSubscriber.prototype.notifyNext = function (_outerValue, innerValue, outerIndex) {\n var values = this.values;\n var oldVal = values[outerIndex];\n var toRespond = !this.toRespond\n ? 0\n : oldVal === NONE ? --this.toRespond : this.toRespond;\n values[outerIndex] = innerValue;\n if (toRespond === 0) {\n if (this.resultSelector) {\n this._tryResultSelector(values);\n }\n else {\n this.destination.next(values.slice());\n }\n }\n };\n CombineLatestSubscriber.prototype._tryResultSelector = function (values) {\n var result;\n try {\n result = this.resultSelector.apply(this, values);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n };\n return CombineLatestSubscriber;\n}(OuterSubscriber_1.OuterSubscriber));\nexports.CombineLatestSubscriber = CombineLatestSubscriber;\n//# sourceMappingURL=combineLatest.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar of_1 = require(\"./of\");\nvar concatAll_1 = require(\"../operators/concatAll\");\nfunction concat() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i] = arguments[_i];\n }\n return concatAll_1.concatAll()(of_1.of.apply(void 0, observables));\n}\nexports.concat = concat;\n//# sourceMappingURL=concat.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Observable_1 = require(\"../Observable\");\nvar from_1 = require(\"./from\");\nvar empty_1 = require(\"./empty\");\nfunction defer(observableFactory) {\n return new Observable_1.Observable(function (subscriber) {\n var input;\n try {\n input = observableFactory();\n }\n catch (err) {\n subscriber.error(err);\n return undefined;\n }\n var source = input ? from_1.from(input) : empty_1.empty();\n return source.subscribe(subscriber);\n });\n}\nexports.defer = defer;\n//# sourceMappingURL=defer.js.map","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\n t[p[i]] = s[p[i]];\n return t;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Observable_1 = require(\"../../Observable\");\nvar Subscription_1 = require(\"../../Subscription\");\nvar from_1 = require(\"../../observable/from\");\nfunction fromFetch(input, initWithSelector) {\n if (initWithSelector === void 0) { initWithSelector = {}; }\n var selector = initWithSelector.selector, init = __rest(initWithSelector, [\"selector\"]);\n return new Observable_1.Observable(function (subscriber) {\n var controller = new AbortController();\n var signal = controller.signal;\n var abortable = true;\n var unsubscribed = false;\n var subscription = new Subscription_1.Subscription();\n subscription.add(function () {\n unsubscribed = true;\n if (abortable) {\n controller.abort();\n }\n });\n var perSubscriberInit;\n if (init) {\n if (init.signal) {\n if (init.signal.aborted) {\n controller.abort();\n }\n else {\n var outerSignal_1 = init.signal;\n var outerSignalHandler_1 = function () {\n if (!signal.aborted) {\n controller.abort();\n }\n };\n outerSignal_1.addEventListener('abort', outerSignalHandler_1);\n subscription.add(function () { return outerSignal_1.removeEventListener('abort', outerSignalHandler_1); });\n }\n }\n perSubscriberInit = __assign({}, init, { signal: signal });\n }\n else {\n perSubscriberInit = { signal: signal };\n }\n fetch(input, perSubscriberInit).then(function (response) {\n if (selector) {\n subscription.add(from_1.from(selector(response)).subscribe(function (value) { return subscriber.next(value); }, function (err) {\n abortable = false;\n if (!unsubscribed) {\n subscriber.error(err);\n }\n }, function () {\n abortable = false;\n subscriber.complete();\n }));\n }\n else {\n abortable = false;\n subscriber.next(response);\n subscriber.complete();\n }\n }).catch(function (err) {\n abortable = false;\n if (!unsubscribed) {\n subscriber.error(err);\n }\n });\n return subscription;\n });\n}\nexports.fromFetch = fromFetch;\n//# sourceMappingURL=fetch.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Observable_1 = require(\"../Observable\");\nexports.EMPTY = new Observable_1.Observable(function (subscriber) { return subscriber.complete(); });\nfunction empty(scheduler) {\n return scheduler ? emptyScheduled(scheduler) : exports.EMPTY;\n}\nexports.empty = empty;\nfunction emptyScheduled(scheduler) {\n return new Observable_1.Observable(function (subscriber) { return scheduler.schedule(function () { return subscriber.complete(); }); });\n}\n//# sourceMappingURL=empty.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Observable_1 = require(\"../Observable\");\nvar subscribeTo_1 = require(\"../util/subscribeTo\");\nvar scheduled_1 = require(\"../scheduled/scheduled\");\nfunction from(input, scheduler) {\n if (!scheduler) {\n if (input instanceof Observable_1.Observable) {\n return input;\n }\n return new Observable_1.Observable(subscribeTo_1.subscribeTo(input));\n }\n else {\n return scheduled_1.scheduled(input, scheduler);\n }\n}\nexports.from = from;\n//# sourceMappingURL=from.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Observable_1 = require(\"../Observable\");\nvar subscribeToArray_1 = require(\"../util/subscribeToArray\");\nvar scheduleArray_1 = require(\"../scheduled/scheduleArray\");\nfunction fromArray(input, scheduler) {\n if (!scheduler) {\n return new Observable_1.Observable(subscribeToArray_1.subscribeToArray(input));\n }\n else {\n return scheduleArray_1.scheduleArray(input, scheduler);\n }\n}\nexports.fromArray = fromArray;\n//# sourceMappingURL=fromArray.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Observable_1 = require(\"../Observable\");\nvar isScheduler_1 = require(\"../util/isScheduler\");\nvar mergeAll_1 = require(\"../operators/mergeAll\");\nvar fromArray_1 = require(\"./fromArray\");\nfunction merge() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i] = arguments[_i];\n }\n var concurrent = Number.POSITIVE_INFINITY;\n var scheduler = null;\n var last = observables[observables.length - 1];\n if (isScheduler_1.isScheduler(last)) {\n scheduler = observables.pop();\n if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') {\n concurrent = observables.pop();\n }\n }\n else if (typeof last === 'number') {\n concurrent = observables.pop();\n }\n if (scheduler === null && observables.length === 1 && observables[0] instanceof Observable_1.Observable) {\n return observables[0];\n }\n return mergeAll_1.mergeAll(concurrent)(fromArray_1.fromArray(observables, scheduler));\n}\nexports.merge = merge;\n//# sourceMappingURL=merge.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar isScheduler_1 = require(\"../util/isScheduler\");\nvar fromArray_1 = require(\"./fromArray\");\nvar scheduleArray_1 = require(\"../scheduled/scheduleArray\");\nfunction of() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var scheduler = args[args.length - 1];\n if (isScheduler_1.isScheduler(scheduler)) {\n args.pop();\n return scheduleArray_1.scheduleArray(args, scheduler);\n }\n else {\n return fromArray_1.fromArray(args);\n }\n}\nexports.of = of;\n//# sourceMappingURL=of.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar isArray_1 = require(\"../util/isArray\");\nvar fromArray_1 = require(\"./fromArray\");\nvar OuterSubscriber_1 = require(\"../OuterSubscriber\");\nvar subscribeToResult_1 = require(\"../util/subscribeToResult\");\nfunction race() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i] = arguments[_i];\n }\n if (observables.length === 1) {\n if (isArray_1.isArray(observables[0])) {\n observables = observables[0];\n }\n else {\n return observables[0];\n }\n }\n return fromArray_1.fromArray(observables, undefined).lift(new RaceOperator());\n}\nexports.race = race;\nvar RaceOperator = (function () {\n function RaceOperator() {\n }\n RaceOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new RaceSubscriber(subscriber));\n };\n return RaceOperator;\n}());\nexports.RaceOperator = RaceOperator;\nvar RaceSubscriber = (function (_super) {\n __extends(RaceSubscriber, _super);\n function RaceSubscriber(destination) {\n var _this = _super.call(this, destination) || this;\n _this.hasFirst = false;\n _this.observables = [];\n _this.subscriptions = [];\n return _this;\n }\n RaceSubscriber.prototype._next = function (observable) {\n this.observables.push(observable);\n };\n RaceSubscriber.prototype._complete = function () {\n var observables = this.observables;\n var len = observables.length;\n if (len === 0) {\n this.destination.complete();\n }\n else {\n for (var i = 0; i < len && !this.hasFirst; i++) {\n var observable = observables[i];\n var subscription = subscribeToResult_1.subscribeToResult(this, observable, undefined, i);\n if (this.subscriptions) {\n this.subscriptions.push(subscription);\n }\n this.add(subscription);\n }\n this.observables = null;\n }\n };\n RaceSubscriber.prototype.notifyNext = function (_outerValue, innerValue, outerIndex) {\n if (!this.hasFirst) {\n this.hasFirst = true;\n for (var i = 0; i < this.subscriptions.length; i++) {\n if (i !== outerIndex) {\n var subscription = this.subscriptions[i];\n subscription.unsubscribe();\n this.remove(subscription);\n }\n }\n this.subscriptions = null;\n }\n this.destination.next(innerValue);\n };\n return RaceSubscriber;\n}(OuterSubscriber_1.OuterSubscriber));\nexports.RaceSubscriber = RaceSubscriber;\n//# sourceMappingURL=race.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Observable_1 = require(\"../Observable\");\nfunction throwError(error, scheduler) {\n if (!scheduler) {\n return new Observable_1.Observable(function (subscriber) { return subscriber.error(error); });\n }\n else {\n return new Observable_1.Observable(function (subscriber) { return scheduler.schedule(dispatch, 0, { error: error, subscriber: subscriber }); });\n }\n}\nexports.throwError = throwError;\nfunction dispatch(_a) {\n var error = _a.error, subscriber = _a.subscriber;\n subscriber.error(error);\n}\n//# sourceMappingURL=throwError.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Observable_1 = require(\"../Observable\");\nvar async_1 = require(\"../scheduler/async\");\nvar isNumeric_1 = require(\"../util/isNumeric\");\nvar isScheduler_1 = require(\"../util/isScheduler\");\nfunction timer(dueTime, periodOrScheduler, scheduler) {\n if (dueTime === void 0) { dueTime = 0; }\n var period = -1;\n if (isNumeric_1.isNumeric(periodOrScheduler)) {\n period = Number(periodOrScheduler) < 1 && 1 || Number(periodOrScheduler);\n }\n else if (isScheduler_1.isScheduler(periodOrScheduler)) {\n scheduler = periodOrScheduler;\n }\n if (!isScheduler_1.isScheduler(scheduler)) {\n scheduler = async_1.async;\n }\n return new Observable_1.Observable(function (subscriber) {\n var due = isNumeric_1.isNumeric(dueTime)\n ? dueTime\n : (+dueTime - scheduler.now());\n return scheduler.schedule(dispatch, due, {\n index: 0, period: period, subscriber: subscriber\n });\n });\n}\nexports.timer = timer;\nfunction dispatch(state) {\n var index = state.index, period = state.period, subscriber = state.subscriber;\n subscriber.next(index);\n if (subscriber.closed) {\n return;\n }\n else if (period === -1) {\n return subscriber.complete();\n }\n state.index = index + 1;\n this.schedule(state, period);\n}\n//# sourceMappingURL=timer.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar fromArray_1 = require(\"./fromArray\");\nvar isArray_1 = require(\"../util/isArray\");\nvar Subscriber_1 = require(\"../Subscriber\");\nvar iterator_1 = require(\"../../internal/symbol/iterator\");\nvar innerSubscribe_1 = require(\"../innerSubscribe\");\nfunction zip() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i] = arguments[_i];\n }\n var resultSelector = observables[observables.length - 1];\n if (typeof resultSelector === 'function') {\n observables.pop();\n }\n return fromArray_1.fromArray(observables, undefined).lift(new ZipOperator(resultSelector));\n}\nexports.zip = zip;\nvar ZipOperator = (function () {\n function ZipOperator(resultSelector) {\n this.resultSelector = resultSelector;\n }\n ZipOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new ZipSubscriber(subscriber, this.resultSelector));\n };\n return ZipOperator;\n}());\nexports.ZipOperator = ZipOperator;\nvar ZipSubscriber = (function (_super) {\n __extends(ZipSubscriber, _super);\n function ZipSubscriber(destination, resultSelector, values) {\n if (values === void 0) { values = Object.create(null); }\n var _this = _super.call(this, destination) || this;\n _this.resultSelector = resultSelector;\n _this.iterators = [];\n _this.active = 0;\n _this.resultSelector = (typeof resultSelector === 'function') ? resultSelector : undefined;\n return _this;\n }\n ZipSubscriber.prototype._next = function (value) {\n var iterators = this.iterators;\n if (isArray_1.isArray(value)) {\n iterators.push(new StaticArrayIterator(value));\n }\n else if (typeof value[iterator_1.iterator] === 'function') {\n iterators.push(new StaticIterator(value[iterator_1.iterator]()));\n }\n else {\n iterators.push(new ZipBufferIterator(this.destination, this, value));\n }\n };\n ZipSubscriber.prototype._complete = function () {\n var iterators = this.iterators;\n var len = iterators.length;\n this.unsubscribe();\n if (len === 0) {\n this.destination.complete();\n return;\n }\n this.active = len;\n for (var i = 0; i < len; i++) {\n var iterator = iterators[i];\n if (iterator.stillUnsubscribed) {\n var destination = this.destination;\n destination.add(iterator.subscribe());\n }\n else {\n this.active--;\n }\n }\n };\n ZipSubscriber.prototype.notifyInactive = function () {\n this.active--;\n if (this.active === 0) {\n this.destination.complete();\n }\n };\n ZipSubscriber.prototype.checkIterators = function () {\n var iterators = this.iterators;\n var len = iterators.length;\n var destination = this.destination;\n for (var i = 0; i < len; i++) {\n var iterator = iterators[i];\n if (typeof iterator.hasValue === 'function' && !iterator.hasValue()) {\n return;\n }\n }\n var shouldComplete = false;\n var args = [];\n for (var i = 0; i < len; i++) {\n var iterator = iterators[i];\n var result = iterator.next();\n if (iterator.hasCompleted()) {\n shouldComplete = true;\n }\n if (result.done) {\n destination.complete();\n return;\n }\n args.push(result.value);\n }\n if (this.resultSelector) {\n this._tryresultSelector(args);\n }\n else {\n destination.next(args);\n }\n if (shouldComplete) {\n destination.complete();\n }\n };\n ZipSubscriber.prototype._tryresultSelector = function (args) {\n var result;\n try {\n result = this.resultSelector.apply(this, args);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n };\n return ZipSubscriber;\n}(Subscriber_1.Subscriber));\nexports.ZipSubscriber = ZipSubscriber;\nvar StaticIterator = (function () {\n function StaticIterator(iterator) {\n this.iterator = iterator;\n this.nextResult = iterator.next();\n }\n StaticIterator.prototype.hasValue = function () {\n return true;\n };\n StaticIterator.prototype.next = function () {\n var result = this.nextResult;\n this.nextResult = this.iterator.next();\n return result;\n };\n StaticIterator.prototype.hasCompleted = function () {\n var nextResult = this.nextResult;\n return Boolean(nextResult && nextResult.done);\n };\n return StaticIterator;\n}());\nvar StaticArrayIterator = (function () {\n function StaticArrayIterator(array) {\n this.array = array;\n this.index = 0;\n this.length = 0;\n this.length = array.length;\n }\n StaticArrayIterator.prototype[iterator_1.iterator] = function () {\n return this;\n };\n StaticArrayIterator.prototype.next = function (value) {\n var i = this.index++;\n var array = this.array;\n return i < this.length ? { value: array[i], done: false } : { value: null, done: true };\n };\n StaticArrayIterator.prototype.hasValue = function () {\n return this.array.length > this.index;\n };\n StaticArrayIterator.prototype.hasCompleted = function () {\n return this.array.length === this.index;\n };\n return StaticArrayIterator;\n}());\nvar ZipBufferIterator = (function (_super) {\n __extends(ZipBufferIterator, _super);\n function ZipBufferIterator(destination, parent, observable) {\n var _this = _super.call(this, destination) || this;\n _this.parent = parent;\n _this.observable = observable;\n _this.stillUnsubscribed = true;\n _this.buffer = [];\n _this.isComplete = false;\n return _this;\n }\n ZipBufferIterator.prototype[iterator_1.iterator] = function () {\n return this;\n };\n ZipBufferIterator.prototype.next = function () {\n var buffer = this.buffer;\n if (buffer.length === 0 && this.isComplete) {\n return { value: null, done: true };\n }\n else {\n return { value: buffer.shift(), done: false };\n }\n };\n ZipBufferIterator.prototype.hasValue = function () {\n return this.buffer.length > 0;\n };\n ZipBufferIterator.prototype.hasCompleted = function () {\n return this.buffer.length === 0 && this.isComplete;\n };\n ZipBufferIterator.prototype.notifyComplete = function () {\n if (this.buffer.length > 0) {\n this.isComplete = true;\n this.parent.notifyInactive();\n }\n else {\n this.destination.complete();\n }\n };\n ZipBufferIterator.prototype.notifyNext = function (innerValue) {\n this.buffer.push(innerValue);\n this.parent.checkIterators();\n };\n ZipBufferIterator.prototype.subscribe = function () {\n return innerSubscribe_1.innerSubscribe(this.observable, new innerSubscribe_1.SimpleInnerSubscriber(this));\n };\n return ZipBufferIterator;\n}(innerSubscribe_1.SimpleOuterSubscriber));\n//# sourceMappingURL=zip.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar innerSubscribe_1 = require(\"../innerSubscribe\");\nfunction audit(durationSelector) {\n return function auditOperatorFunction(source) {\n return source.lift(new AuditOperator(durationSelector));\n };\n}\nexports.audit = audit;\nvar AuditOperator = (function () {\n function AuditOperator(durationSelector) {\n this.durationSelector = durationSelector;\n }\n AuditOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new AuditSubscriber(subscriber, this.durationSelector));\n };\n return AuditOperator;\n}());\nvar AuditSubscriber = (function (_super) {\n __extends(AuditSubscriber, _super);\n function AuditSubscriber(destination, durationSelector) {\n var _this = _super.call(this, destination) || this;\n _this.durationSelector = durationSelector;\n _this.hasValue = false;\n return _this;\n }\n AuditSubscriber.prototype._next = function (value) {\n this.value = value;\n this.hasValue = true;\n if (!this.throttled) {\n var duration = void 0;\n try {\n var durationSelector = this.durationSelector;\n duration = durationSelector(value);\n }\n catch (err) {\n return this.destination.error(err);\n }\n var innerSubscription = innerSubscribe_1.innerSubscribe(duration, new innerSubscribe_1.SimpleInnerSubscriber(this));\n if (!innerSubscription || innerSubscription.closed) {\n this.clearThrottle();\n }\n else {\n this.add(this.throttled = innerSubscription);\n }\n }\n };\n AuditSubscriber.prototype.clearThrottle = function () {\n var _a = this, value = _a.value, hasValue = _a.hasValue, throttled = _a.throttled;\n if (throttled) {\n this.remove(throttled);\n this.throttled = undefined;\n throttled.unsubscribe();\n }\n if (hasValue) {\n this.value = undefined;\n this.hasValue = false;\n this.destination.next(value);\n }\n };\n AuditSubscriber.prototype.notifyNext = function () {\n this.clearThrottle();\n };\n AuditSubscriber.prototype.notifyComplete = function () {\n this.clearThrottle();\n };\n return AuditSubscriber;\n}(innerSubscribe_1.SimpleOuterSubscriber));\n//# sourceMappingURL=audit.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar async_1 = require(\"../scheduler/async\");\nvar audit_1 = require(\"./audit\");\nvar timer_1 = require(\"../observable/timer\");\nfunction auditTime(duration, scheduler) {\n if (scheduler === void 0) { scheduler = async_1.async; }\n return audit_1.audit(function () { return timer_1.timer(duration, scheduler); });\n}\nexports.auditTime = auditTime;\n//# sourceMappingURL=auditTime.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar innerSubscribe_1 = require(\"../innerSubscribe\");\nfunction buffer(closingNotifier) {\n return function bufferOperatorFunction(source) {\n return source.lift(new BufferOperator(closingNotifier));\n };\n}\nexports.buffer = buffer;\nvar BufferOperator = (function () {\n function BufferOperator(closingNotifier) {\n this.closingNotifier = closingNotifier;\n }\n BufferOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new BufferSubscriber(subscriber, this.closingNotifier));\n };\n return BufferOperator;\n}());\nvar BufferSubscriber = (function (_super) {\n __extends(BufferSubscriber, _super);\n function BufferSubscriber(destination, closingNotifier) {\n var _this = _super.call(this, destination) || this;\n _this.buffer = [];\n _this.add(innerSubscribe_1.innerSubscribe(closingNotifier, new innerSubscribe_1.SimpleInnerSubscriber(_this)));\n return _this;\n }\n BufferSubscriber.prototype._next = function (value) {\n this.buffer.push(value);\n };\n BufferSubscriber.prototype.notifyNext = function () {\n var buffer = this.buffer;\n this.buffer = [];\n this.destination.next(buffer);\n };\n return BufferSubscriber;\n}(innerSubscribe_1.SimpleOuterSubscriber));\n//# sourceMappingURL=buffer.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nfunction bufferCount(bufferSize, startBufferEvery) {\n if (startBufferEvery === void 0) { startBufferEvery = null; }\n return function bufferCountOperatorFunction(source) {\n return source.lift(new BufferCountOperator(bufferSize, startBufferEvery));\n };\n}\nexports.bufferCount = bufferCount;\nvar BufferCountOperator = (function () {\n function BufferCountOperator(bufferSize, startBufferEvery) {\n this.bufferSize = bufferSize;\n this.startBufferEvery = startBufferEvery;\n if (!startBufferEvery || bufferSize === startBufferEvery) {\n this.subscriberClass = BufferCountSubscriber;\n }\n else {\n this.subscriberClass = BufferSkipCountSubscriber;\n }\n }\n BufferCountOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new this.subscriberClass(subscriber, this.bufferSize, this.startBufferEvery));\n };\n return BufferCountOperator;\n}());\nvar BufferCountSubscriber = (function (_super) {\n __extends(BufferCountSubscriber, _super);\n function BufferCountSubscriber(destination, bufferSize) {\n var _this = _super.call(this, destination) || this;\n _this.bufferSize = bufferSize;\n _this.buffer = [];\n return _this;\n }\n BufferCountSubscriber.prototype._next = function (value) {\n var buffer = this.buffer;\n buffer.push(value);\n if (buffer.length == this.bufferSize) {\n this.destination.next(buffer);\n this.buffer = [];\n }\n };\n BufferCountSubscriber.prototype._complete = function () {\n var buffer = this.buffer;\n if (buffer.length > 0) {\n this.destination.next(buffer);\n }\n _super.prototype._complete.call(this);\n };\n return BufferCountSubscriber;\n}(Subscriber_1.Subscriber));\nvar BufferSkipCountSubscriber = (function (_super) {\n __extends(BufferSkipCountSubscriber, _super);\n function BufferSkipCountSubscriber(destination, bufferSize, startBufferEvery) {\n var _this = _super.call(this, destination) || this;\n _this.bufferSize = bufferSize;\n _this.startBufferEvery = startBufferEvery;\n _this.buffers = [];\n _this.count = 0;\n return _this;\n }\n BufferSkipCountSubscriber.prototype._next = function (value) {\n var _a = this, bufferSize = _a.bufferSize, startBufferEvery = _a.startBufferEvery, buffers = _a.buffers, count = _a.count;\n this.count++;\n if (count % startBufferEvery === 0) {\n buffers.push([]);\n }\n for (var i = buffers.length; i--;) {\n var buffer = buffers[i];\n buffer.push(value);\n if (buffer.length === bufferSize) {\n buffers.splice(i, 1);\n this.destination.next(buffer);\n }\n }\n };\n BufferSkipCountSubscriber.prototype._complete = function () {\n var _a = this, buffers = _a.buffers, destination = _a.destination;\n while (buffers.length > 0) {\n var buffer = buffers.shift();\n if (buffer.length > 0) {\n destination.next(buffer);\n }\n }\n _super.prototype._complete.call(this);\n };\n return BufferSkipCountSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=bufferCount.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar async_1 = require(\"../scheduler/async\");\nvar Subscriber_1 = require(\"../Subscriber\");\nvar isScheduler_1 = require(\"../util/isScheduler\");\nfunction bufferTime(bufferTimeSpan) {\n var length = arguments.length;\n var scheduler = async_1.async;\n if (isScheduler_1.isScheduler(arguments[arguments.length - 1])) {\n scheduler = arguments[arguments.length - 1];\n length--;\n }\n var bufferCreationInterval = null;\n if (length >= 2) {\n bufferCreationInterval = arguments[1];\n }\n var maxBufferSize = Number.POSITIVE_INFINITY;\n if (length >= 3) {\n maxBufferSize = arguments[2];\n }\n return function bufferTimeOperatorFunction(source) {\n return source.lift(new BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler));\n };\n}\nexports.bufferTime = bufferTime;\nvar BufferTimeOperator = (function () {\n function BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler) {\n this.bufferTimeSpan = bufferTimeSpan;\n this.bufferCreationInterval = bufferCreationInterval;\n this.maxBufferSize = maxBufferSize;\n this.scheduler = scheduler;\n }\n BufferTimeOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new BufferTimeSubscriber(subscriber, this.bufferTimeSpan, this.bufferCreationInterval, this.maxBufferSize, this.scheduler));\n };\n return BufferTimeOperator;\n}());\nvar Context = (function () {\n function Context() {\n this.buffer = [];\n }\n return Context;\n}());\nvar BufferTimeSubscriber = (function (_super) {\n __extends(BufferTimeSubscriber, _super);\n function BufferTimeSubscriber(destination, bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler) {\n var _this = _super.call(this, destination) || this;\n _this.bufferTimeSpan = bufferTimeSpan;\n _this.bufferCreationInterval = bufferCreationInterval;\n _this.maxBufferSize = maxBufferSize;\n _this.scheduler = scheduler;\n _this.contexts = [];\n var context = _this.openContext();\n _this.timespanOnly = bufferCreationInterval == null || bufferCreationInterval < 0;\n if (_this.timespanOnly) {\n var timeSpanOnlyState = { subscriber: _this, context: context, bufferTimeSpan: bufferTimeSpan };\n _this.add(context.closeAction = scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState));\n }\n else {\n var closeState = { subscriber: _this, context: context };\n var creationState = { bufferTimeSpan: bufferTimeSpan, bufferCreationInterval: bufferCreationInterval, subscriber: _this, scheduler: scheduler };\n _this.add(context.closeAction = scheduler.schedule(dispatchBufferClose, bufferTimeSpan, closeState));\n _this.add(scheduler.schedule(dispatchBufferCreation, bufferCreationInterval, creationState));\n }\n return _this;\n }\n BufferTimeSubscriber.prototype._next = function (value) {\n var contexts = this.contexts;\n var len = contexts.length;\n var filledBufferContext;\n for (var i = 0; i < len; i++) {\n var context_1 = contexts[i];\n var buffer = context_1.buffer;\n buffer.push(value);\n if (buffer.length == this.maxBufferSize) {\n filledBufferContext = context_1;\n }\n }\n if (filledBufferContext) {\n this.onBufferFull(filledBufferContext);\n }\n };\n BufferTimeSubscriber.prototype._error = function (err) {\n this.contexts.length = 0;\n _super.prototype._error.call(this, err);\n };\n BufferTimeSubscriber.prototype._complete = function () {\n var _a = this, contexts = _a.contexts, destination = _a.destination;\n while (contexts.length > 0) {\n var context_2 = contexts.shift();\n destination.next(context_2.buffer);\n }\n _super.prototype._complete.call(this);\n };\n BufferTimeSubscriber.prototype._unsubscribe = function () {\n this.contexts = null;\n };\n BufferTimeSubscriber.prototype.onBufferFull = function (context) {\n this.closeContext(context);\n var closeAction = context.closeAction;\n closeAction.unsubscribe();\n this.remove(closeAction);\n if (!this.closed && this.timespanOnly) {\n context = this.openContext();\n var bufferTimeSpan = this.bufferTimeSpan;\n var timeSpanOnlyState = { subscriber: this, context: context, bufferTimeSpan: bufferTimeSpan };\n this.add(context.closeAction = this.scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState));\n }\n };\n BufferTimeSubscriber.prototype.openContext = function () {\n var context = new Context();\n this.contexts.push(context);\n return context;\n };\n BufferTimeSubscriber.prototype.closeContext = function (context) {\n this.destination.next(context.buffer);\n var contexts = this.contexts;\n var spliceIndex = contexts ? contexts.indexOf(context) : -1;\n if (spliceIndex >= 0) {\n contexts.splice(contexts.indexOf(context), 1);\n }\n };\n return BufferTimeSubscriber;\n}(Subscriber_1.Subscriber));\nfunction dispatchBufferTimeSpanOnly(state) {\n var subscriber = state.subscriber;\n var prevContext = state.context;\n if (prevContext) {\n subscriber.closeContext(prevContext);\n }\n if (!subscriber.closed) {\n state.context = subscriber.openContext();\n state.context.closeAction = this.schedule(state, state.bufferTimeSpan);\n }\n}\nfunction dispatchBufferCreation(state) {\n var bufferCreationInterval = state.bufferCreationInterval, bufferTimeSpan = state.bufferTimeSpan, subscriber = state.subscriber, scheduler = state.scheduler;\n var context = subscriber.openContext();\n var action = this;\n if (!subscriber.closed) {\n subscriber.add(context.closeAction = scheduler.schedule(dispatchBufferClose, bufferTimeSpan, { subscriber: subscriber, context: context }));\n action.schedule(state, bufferCreationInterval);\n }\n}\nfunction dispatchBufferClose(arg) {\n var subscriber = arg.subscriber, context = arg.context;\n subscriber.closeContext(context);\n}\n//# sourceMappingURL=bufferTime.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscription_1 = require(\"../Subscription\");\nvar subscribeToResult_1 = require(\"../util/subscribeToResult\");\nvar OuterSubscriber_1 = require(\"../OuterSubscriber\");\nfunction bufferToggle(openings, closingSelector) {\n return function bufferToggleOperatorFunction(source) {\n return source.lift(new BufferToggleOperator(openings, closingSelector));\n };\n}\nexports.bufferToggle = bufferToggle;\nvar BufferToggleOperator = (function () {\n function BufferToggleOperator(openings, closingSelector) {\n this.openings = openings;\n this.closingSelector = closingSelector;\n }\n BufferToggleOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new BufferToggleSubscriber(subscriber, this.openings, this.closingSelector));\n };\n return BufferToggleOperator;\n}());\nvar BufferToggleSubscriber = (function (_super) {\n __extends(BufferToggleSubscriber, _super);\n function BufferToggleSubscriber(destination, openings, closingSelector) {\n var _this = _super.call(this, destination) || this;\n _this.closingSelector = closingSelector;\n _this.contexts = [];\n _this.add(subscribeToResult_1.subscribeToResult(_this, openings));\n return _this;\n }\n BufferToggleSubscriber.prototype._next = function (value) {\n var contexts = this.contexts;\n var len = contexts.length;\n for (var i = 0; i < len; i++) {\n contexts[i].buffer.push(value);\n }\n };\n BufferToggleSubscriber.prototype._error = function (err) {\n var contexts = this.contexts;\n while (contexts.length > 0) {\n var context_1 = contexts.shift();\n context_1.subscription.unsubscribe();\n context_1.buffer = null;\n context_1.subscription = null;\n }\n this.contexts = null;\n _super.prototype._error.call(this, err);\n };\n BufferToggleSubscriber.prototype._complete = function () {\n var contexts = this.contexts;\n while (contexts.length > 0) {\n var context_2 = contexts.shift();\n this.destination.next(context_2.buffer);\n context_2.subscription.unsubscribe();\n context_2.buffer = null;\n context_2.subscription = null;\n }\n this.contexts = null;\n _super.prototype._complete.call(this);\n };\n BufferToggleSubscriber.prototype.notifyNext = function (outerValue, innerValue) {\n outerValue ? this.closeBuffer(outerValue) : this.openBuffer(innerValue);\n };\n BufferToggleSubscriber.prototype.notifyComplete = function (innerSub) {\n this.closeBuffer(innerSub.context);\n };\n BufferToggleSubscriber.prototype.openBuffer = function (value) {\n try {\n var closingSelector = this.closingSelector;\n var closingNotifier = closingSelector.call(this, value);\n if (closingNotifier) {\n this.trySubscribe(closingNotifier);\n }\n }\n catch (err) {\n this._error(err);\n }\n };\n BufferToggleSubscriber.prototype.closeBuffer = function (context) {\n var contexts = this.contexts;\n if (contexts && context) {\n var buffer = context.buffer, subscription = context.subscription;\n this.destination.next(buffer);\n contexts.splice(contexts.indexOf(context), 1);\n this.remove(subscription);\n subscription.unsubscribe();\n }\n };\n BufferToggleSubscriber.prototype.trySubscribe = function (closingNotifier) {\n var contexts = this.contexts;\n var buffer = [];\n var subscription = new Subscription_1.Subscription();\n var context = { buffer: buffer, subscription: subscription };\n contexts.push(context);\n var innerSubscription = subscribeToResult_1.subscribeToResult(this, closingNotifier, context);\n if (!innerSubscription || innerSubscription.closed) {\n this.closeBuffer(context);\n }\n else {\n innerSubscription.context = context;\n this.add(innerSubscription);\n subscription.add(innerSubscription);\n }\n };\n return BufferToggleSubscriber;\n}(OuterSubscriber_1.OuterSubscriber));\n//# sourceMappingURL=bufferToggle.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscription_1 = require(\"../Subscription\");\nvar innerSubscribe_1 = require(\"../innerSubscribe\");\nfunction bufferWhen(closingSelector) {\n return function (source) {\n return source.lift(new BufferWhenOperator(closingSelector));\n };\n}\nexports.bufferWhen = bufferWhen;\nvar BufferWhenOperator = (function () {\n function BufferWhenOperator(closingSelector) {\n this.closingSelector = closingSelector;\n }\n BufferWhenOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new BufferWhenSubscriber(subscriber, this.closingSelector));\n };\n return BufferWhenOperator;\n}());\nvar BufferWhenSubscriber = (function (_super) {\n __extends(BufferWhenSubscriber, _super);\n function BufferWhenSubscriber(destination, closingSelector) {\n var _this = _super.call(this, destination) || this;\n _this.closingSelector = closingSelector;\n _this.subscribing = false;\n _this.openBuffer();\n return _this;\n }\n BufferWhenSubscriber.prototype._next = function (value) {\n this.buffer.push(value);\n };\n BufferWhenSubscriber.prototype._complete = function () {\n var buffer = this.buffer;\n if (buffer) {\n this.destination.next(buffer);\n }\n _super.prototype._complete.call(this);\n };\n BufferWhenSubscriber.prototype._unsubscribe = function () {\n this.buffer = undefined;\n this.subscribing = false;\n };\n BufferWhenSubscriber.prototype.notifyNext = function () {\n this.openBuffer();\n };\n BufferWhenSubscriber.prototype.notifyComplete = function () {\n if (this.subscribing) {\n this.complete();\n }\n else {\n this.openBuffer();\n }\n };\n BufferWhenSubscriber.prototype.openBuffer = function () {\n var closingSubscription = this.closingSubscription;\n if (closingSubscription) {\n this.remove(closingSubscription);\n closingSubscription.unsubscribe();\n }\n var buffer = this.buffer;\n if (this.buffer) {\n this.destination.next(buffer);\n }\n this.buffer = [];\n var closingNotifier;\n try {\n var closingSelector = this.closingSelector;\n closingNotifier = closingSelector();\n }\n catch (err) {\n return this.error(err);\n }\n closingSubscription = new Subscription_1.Subscription();\n this.closingSubscription = closingSubscription;\n this.add(closingSubscription);\n this.subscribing = true;\n closingSubscription.add(innerSubscribe_1.innerSubscribe(closingNotifier, new innerSubscribe_1.SimpleInnerSubscriber(this)));\n this.subscribing = false;\n };\n return BufferWhenSubscriber;\n}(innerSubscribe_1.SimpleOuterSubscriber));\n//# sourceMappingURL=bufferWhen.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar innerSubscribe_1 = require(\"../innerSubscribe\");\nfunction catchError(selector) {\n return function catchErrorOperatorFunction(source) {\n var operator = new CatchOperator(selector);\n var caught = source.lift(operator);\n return (operator.caught = caught);\n };\n}\nexports.catchError = catchError;\nvar CatchOperator = (function () {\n function CatchOperator(selector) {\n this.selector = selector;\n }\n CatchOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new CatchSubscriber(subscriber, this.selector, this.caught));\n };\n return CatchOperator;\n}());\nvar CatchSubscriber = (function (_super) {\n __extends(CatchSubscriber, _super);\n function CatchSubscriber(destination, selector, caught) {\n var _this = _super.call(this, destination) || this;\n _this.selector = selector;\n _this.caught = caught;\n return _this;\n }\n CatchSubscriber.prototype.error = function (err) {\n if (!this.isStopped) {\n var result = void 0;\n try {\n result = this.selector(err, this.caught);\n }\n catch (err2) {\n _super.prototype.error.call(this, err2);\n return;\n }\n this._unsubscribeAndRecycle();\n var innerSubscriber = new innerSubscribe_1.SimpleInnerSubscriber(this);\n this.add(innerSubscriber);\n var innerSubscription = innerSubscribe_1.innerSubscribe(result, innerSubscriber);\n if (innerSubscription !== innerSubscriber) {\n this.add(innerSubscription);\n }\n }\n };\n return CatchSubscriber;\n}(innerSubscribe_1.SimpleOuterSubscriber));\n//# sourceMappingURL=catchError.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar combineLatest_1 = require(\"../observable/combineLatest\");\nfunction combineAll(project) {\n return function (source) { return source.lift(new combineLatest_1.CombineLatestOperator(project)); };\n}\nexports.combineAll = combineAll;\n//# sourceMappingURL=combineAll.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar isArray_1 = require(\"../util/isArray\");\nvar combineLatest_1 = require(\"../observable/combineLatest\");\nvar from_1 = require(\"../observable/from\");\nvar none = {};\nfunction combineLatest() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i] = arguments[_i];\n }\n var project = null;\n if (typeof observables[observables.length - 1] === 'function') {\n project = observables.pop();\n }\n if (observables.length === 1 && isArray_1.isArray(observables[0])) {\n observables = observables[0].slice();\n }\n return function (source) { return source.lift.call(from_1.from([source].concat(observables)), new combineLatest_1.CombineLatestOperator(project)); };\n}\nexports.combineLatest = combineLatest;\n//# sourceMappingURL=combineLatest.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar concat_1 = require(\"../observable/concat\");\nfunction concat() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i] = arguments[_i];\n }\n return function (source) { return source.lift.call(concat_1.concat.apply(void 0, [source].concat(observables))); };\n}\nexports.concat = concat;\n//# sourceMappingURL=concat.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar mergeAll_1 = require(\"./mergeAll\");\nfunction concatAll() {\n return mergeAll_1.mergeAll(1);\n}\nexports.concatAll = concatAll;\n//# sourceMappingURL=concatAll.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar mergeMap_1 = require(\"./mergeMap\");\nfunction concatMap(project, resultSelector) {\n return mergeMap_1.mergeMap(project, resultSelector, 1);\n}\nexports.concatMap = concatMap;\n//# sourceMappingURL=concatMap.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar concatMap_1 = require(\"./concatMap\");\nfunction concatMapTo(innerObservable, resultSelector) {\n return concatMap_1.concatMap(function () { return innerObservable; }, resultSelector);\n}\nexports.concatMapTo = concatMapTo;\n//# sourceMappingURL=concatMapTo.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nfunction count(predicate) {\n return function (source) { return source.lift(new CountOperator(predicate, source)); };\n}\nexports.count = count;\nvar CountOperator = (function () {\n function CountOperator(predicate, source) {\n this.predicate = predicate;\n this.source = source;\n }\n CountOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new CountSubscriber(subscriber, this.predicate, this.source));\n };\n return CountOperator;\n}());\nvar CountSubscriber = (function (_super) {\n __extends(CountSubscriber, _super);\n function CountSubscriber(destination, predicate, source) {\n var _this = _super.call(this, destination) || this;\n _this.predicate = predicate;\n _this.source = source;\n _this.count = 0;\n _this.index = 0;\n return _this;\n }\n CountSubscriber.prototype._next = function (value) {\n if (this.predicate) {\n this._tryPredicate(value);\n }\n else {\n this.count++;\n }\n };\n CountSubscriber.prototype._tryPredicate = function (value) {\n var result;\n try {\n result = this.predicate(value, this.index++, this.source);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n if (result) {\n this.count++;\n }\n };\n CountSubscriber.prototype._complete = function () {\n this.destination.next(this.count);\n this.destination.complete();\n };\n return CountSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=count.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar innerSubscribe_1 = require(\"../innerSubscribe\");\nfunction debounce(durationSelector) {\n return function (source) { return source.lift(new DebounceOperator(durationSelector)); };\n}\nexports.debounce = debounce;\nvar DebounceOperator = (function () {\n function DebounceOperator(durationSelector) {\n this.durationSelector = durationSelector;\n }\n DebounceOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new DebounceSubscriber(subscriber, this.durationSelector));\n };\n return DebounceOperator;\n}());\nvar DebounceSubscriber = (function (_super) {\n __extends(DebounceSubscriber, _super);\n function DebounceSubscriber(destination, durationSelector) {\n var _this = _super.call(this, destination) || this;\n _this.durationSelector = durationSelector;\n _this.hasValue = false;\n return _this;\n }\n DebounceSubscriber.prototype._next = function (value) {\n try {\n var result = this.durationSelector.call(this, value);\n if (result) {\n this._tryNext(value, result);\n }\n }\n catch (err) {\n this.destination.error(err);\n }\n };\n DebounceSubscriber.prototype._complete = function () {\n this.emitValue();\n this.destination.complete();\n };\n DebounceSubscriber.prototype._tryNext = function (value, duration) {\n var subscription = this.durationSubscription;\n this.value = value;\n this.hasValue = true;\n if (subscription) {\n subscription.unsubscribe();\n this.remove(subscription);\n }\n subscription = innerSubscribe_1.innerSubscribe(duration, new innerSubscribe_1.SimpleInnerSubscriber(this));\n if (subscription && !subscription.closed) {\n this.add(this.durationSubscription = subscription);\n }\n };\n DebounceSubscriber.prototype.notifyNext = function () {\n this.emitValue();\n };\n DebounceSubscriber.prototype.notifyComplete = function () {\n this.emitValue();\n };\n DebounceSubscriber.prototype.emitValue = function () {\n if (this.hasValue) {\n var value = this.value;\n var subscription = this.durationSubscription;\n if (subscription) {\n this.durationSubscription = undefined;\n subscription.unsubscribe();\n this.remove(subscription);\n }\n this.value = undefined;\n this.hasValue = false;\n _super.prototype._next.call(this, value);\n }\n };\n return DebounceSubscriber;\n}(innerSubscribe_1.SimpleOuterSubscriber));\n//# sourceMappingURL=debounce.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nvar async_1 = require(\"../scheduler/async\");\nfunction debounceTime(dueTime, scheduler) {\n if (scheduler === void 0) { scheduler = async_1.async; }\n return function (source) { return source.lift(new DebounceTimeOperator(dueTime, scheduler)); };\n}\nexports.debounceTime = debounceTime;\nvar DebounceTimeOperator = (function () {\n function DebounceTimeOperator(dueTime, scheduler) {\n this.dueTime = dueTime;\n this.scheduler = scheduler;\n }\n DebounceTimeOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new DebounceTimeSubscriber(subscriber, this.dueTime, this.scheduler));\n };\n return DebounceTimeOperator;\n}());\nvar DebounceTimeSubscriber = (function (_super) {\n __extends(DebounceTimeSubscriber, _super);\n function DebounceTimeSubscriber(destination, dueTime, scheduler) {\n var _this = _super.call(this, destination) || this;\n _this.dueTime = dueTime;\n _this.scheduler = scheduler;\n _this.debouncedSubscription = null;\n _this.lastValue = null;\n _this.hasValue = false;\n return _this;\n }\n DebounceTimeSubscriber.prototype._next = function (value) {\n this.clearDebounce();\n this.lastValue = value;\n this.hasValue = true;\n this.add(this.debouncedSubscription = this.scheduler.schedule(dispatchNext, this.dueTime, this));\n };\n DebounceTimeSubscriber.prototype._complete = function () {\n this.debouncedNext();\n this.destination.complete();\n };\n DebounceTimeSubscriber.prototype.debouncedNext = function () {\n this.clearDebounce();\n if (this.hasValue) {\n var lastValue = this.lastValue;\n this.lastValue = null;\n this.hasValue = false;\n this.destination.next(lastValue);\n }\n };\n DebounceTimeSubscriber.prototype.clearDebounce = function () {\n var debouncedSubscription = this.debouncedSubscription;\n if (debouncedSubscription !== null) {\n this.remove(debouncedSubscription);\n debouncedSubscription.unsubscribe();\n this.debouncedSubscription = null;\n }\n };\n return DebounceTimeSubscriber;\n}(Subscriber_1.Subscriber));\nfunction dispatchNext(subscriber) {\n subscriber.debouncedNext();\n}\n//# sourceMappingURL=debounceTime.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nfunction defaultIfEmpty(defaultValue) {\n if (defaultValue === void 0) { defaultValue = null; }\n return function (source) { return source.lift(new DefaultIfEmptyOperator(defaultValue)); };\n}\nexports.defaultIfEmpty = defaultIfEmpty;\nvar DefaultIfEmptyOperator = (function () {\n function DefaultIfEmptyOperator(defaultValue) {\n this.defaultValue = defaultValue;\n }\n DefaultIfEmptyOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new DefaultIfEmptySubscriber(subscriber, this.defaultValue));\n };\n return DefaultIfEmptyOperator;\n}());\nvar DefaultIfEmptySubscriber = (function (_super) {\n __extends(DefaultIfEmptySubscriber, _super);\n function DefaultIfEmptySubscriber(destination, defaultValue) {\n var _this = _super.call(this, destination) || this;\n _this.defaultValue = defaultValue;\n _this.isEmpty = true;\n return _this;\n }\n DefaultIfEmptySubscriber.prototype._next = function (value) {\n this.isEmpty = false;\n this.destination.next(value);\n };\n DefaultIfEmptySubscriber.prototype._complete = function () {\n if (this.isEmpty) {\n this.destination.next(this.defaultValue);\n }\n this.destination.complete();\n };\n return DefaultIfEmptySubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=defaultIfEmpty.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar async_1 = require(\"../scheduler/async\");\nvar isDate_1 = require(\"../util/isDate\");\nvar Subscriber_1 = require(\"../Subscriber\");\nvar Notification_1 = require(\"../Notification\");\nfunction delay(delay, scheduler) {\n if (scheduler === void 0) { scheduler = async_1.async; }\n var absoluteDelay = isDate_1.isDate(delay);\n var delayFor = absoluteDelay ? (+delay - scheduler.now()) : Math.abs(delay);\n return function (source) { return source.lift(new DelayOperator(delayFor, scheduler)); };\n}\nexports.delay = delay;\nvar DelayOperator = (function () {\n function DelayOperator(delay, scheduler) {\n this.delay = delay;\n this.scheduler = scheduler;\n }\n DelayOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new DelaySubscriber(subscriber, this.delay, this.scheduler));\n };\n return DelayOperator;\n}());\nvar DelaySubscriber = (function (_super) {\n __extends(DelaySubscriber, _super);\n function DelaySubscriber(destination, delay, scheduler) {\n var _this = _super.call(this, destination) || this;\n _this.delay = delay;\n _this.scheduler = scheduler;\n _this.queue = [];\n _this.active = false;\n _this.errored = false;\n return _this;\n }\n DelaySubscriber.dispatch = function (state) {\n var source = state.source;\n var queue = source.queue;\n var scheduler = state.scheduler;\n var destination = state.destination;\n while (queue.length > 0 && (queue[0].time - scheduler.now()) <= 0) {\n queue.shift().notification.observe(destination);\n }\n if (queue.length > 0) {\n var delay_1 = Math.max(0, queue[0].time - scheduler.now());\n this.schedule(state, delay_1);\n }\n else {\n this.unsubscribe();\n source.active = false;\n }\n };\n DelaySubscriber.prototype._schedule = function (scheduler) {\n this.active = true;\n var destination = this.destination;\n destination.add(scheduler.schedule(DelaySubscriber.dispatch, this.delay, {\n source: this, destination: this.destination, scheduler: scheduler\n }));\n };\n DelaySubscriber.prototype.scheduleNotification = function (notification) {\n if (this.errored === true) {\n return;\n }\n var scheduler = this.scheduler;\n var message = new DelayMessage(scheduler.now() + this.delay, notification);\n this.queue.push(message);\n if (this.active === false) {\n this._schedule(scheduler);\n }\n };\n DelaySubscriber.prototype._next = function (value) {\n this.scheduleNotification(Notification_1.Notification.createNext(value));\n };\n DelaySubscriber.prototype._error = function (err) {\n this.errored = true;\n this.queue = [];\n this.destination.error(err);\n this.unsubscribe();\n };\n DelaySubscriber.prototype._complete = function () {\n this.scheduleNotification(Notification_1.Notification.createComplete());\n this.unsubscribe();\n };\n return DelaySubscriber;\n}(Subscriber_1.Subscriber));\nvar DelayMessage = (function () {\n function DelayMessage(time, notification) {\n this.time = time;\n this.notification = notification;\n }\n return DelayMessage;\n}());\n//# sourceMappingURL=delay.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nvar Observable_1 = require(\"../Observable\");\nvar OuterSubscriber_1 = require(\"../OuterSubscriber\");\nvar subscribeToResult_1 = require(\"../util/subscribeToResult\");\nfunction delayWhen(delayDurationSelector, subscriptionDelay) {\n if (subscriptionDelay) {\n return function (source) {\n return new SubscriptionDelayObservable(source, subscriptionDelay)\n .lift(new DelayWhenOperator(delayDurationSelector));\n };\n }\n return function (source) { return source.lift(new DelayWhenOperator(delayDurationSelector)); };\n}\nexports.delayWhen = delayWhen;\nvar DelayWhenOperator = (function () {\n function DelayWhenOperator(delayDurationSelector) {\n this.delayDurationSelector = delayDurationSelector;\n }\n DelayWhenOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new DelayWhenSubscriber(subscriber, this.delayDurationSelector));\n };\n return DelayWhenOperator;\n}());\nvar DelayWhenSubscriber = (function (_super) {\n __extends(DelayWhenSubscriber, _super);\n function DelayWhenSubscriber(destination, delayDurationSelector) {\n var _this = _super.call(this, destination) || this;\n _this.delayDurationSelector = delayDurationSelector;\n _this.completed = false;\n _this.delayNotifierSubscriptions = [];\n _this.index = 0;\n return _this;\n }\n DelayWhenSubscriber.prototype.notifyNext = function (outerValue, _innerValue, _outerIndex, _innerIndex, innerSub) {\n this.destination.next(outerValue);\n this.removeSubscription(innerSub);\n this.tryComplete();\n };\n DelayWhenSubscriber.prototype.notifyError = function (error, innerSub) {\n this._error(error);\n };\n DelayWhenSubscriber.prototype.notifyComplete = function (innerSub) {\n var value = this.removeSubscription(innerSub);\n if (value) {\n this.destination.next(value);\n }\n this.tryComplete();\n };\n DelayWhenSubscriber.prototype._next = function (value) {\n var index = this.index++;\n try {\n var delayNotifier = this.delayDurationSelector(value, index);\n if (delayNotifier) {\n this.tryDelay(delayNotifier, value);\n }\n }\n catch (err) {\n this.destination.error(err);\n }\n };\n DelayWhenSubscriber.prototype._complete = function () {\n this.completed = true;\n this.tryComplete();\n this.unsubscribe();\n };\n DelayWhenSubscriber.prototype.removeSubscription = function (subscription) {\n subscription.unsubscribe();\n var subscriptionIdx = this.delayNotifierSubscriptions.indexOf(subscription);\n if (subscriptionIdx !== -1) {\n this.delayNotifierSubscriptions.splice(subscriptionIdx, 1);\n }\n return subscription.outerValue;\n };\n DelayWhenSubscriber.prototype.tryDelay = function (delayNotifier, value) {\n var notifierSubscription = subscribeToResult_1.subscribeToResult(this, delayNotifier, value);\n if (notifierSubscription && !notifierSubscription.closed) {\n var destination = this.destination;\n destination.add(notifierSubscription);\n this.delayNotifierSubscriptions.push(notifierSubscription);\n }\n };\n DelayWhenSubscriber.prototype.tryComplete = function () {\n if (this.completed && this.delayNotifierSubscriptions.length === 0) {\n this.destination.complete();\n }\n };\n return DelayWhenSubscriber;\n}(OuterSubscriber_1.OuterSubscriber));\nvar SubscriptionDelayObservable = (function (_super) {\n __extends(SubscriptionDelayObservable, _super);\n function SubscriptionDelayObservable(source, subscriptionDelay) {\n var _this = _super.call(this) || this;\n _this.source = source;\n _this.subscriptionDelay = subscriptionDelay;\n return _this;\n }\n SubscriptionDelayObservable.prototype._subscribe = function (subscriber) {\n this.subscriptionDelay.subscribe(new SubscriptionDelaySubscriber(subscriber, this.source));\n };\n return SubscriptionDelayObservable;\n}(Observable_1.Observable));\nvar SubscriptionDelaySubscriber = (function (_super) {\n __extends(SubscriptionDelaySubscriber, _super);\n function SubscriptionDelaySubscriber(parent, source) {\n var _this = _super.call(this) || this;\n _this.parent = parent;\n _this.source = source;\n _this.sourceSubscribed = false;\n return _this;\n }\n SubscriptionDelaySubscriber.prototype._next = function (unused) {\n this.subscribeToSource();\n };\n SubscriptionDelaySubscriber.prototype._error = function (err) {\n this.unsubscribe();\n this.parent.error(err);\n };\n SubscriptionDelaySubscriber.prototype._complete = function () {\n this.unsubscribe();\n this.subscribeToSource();\n };\n SubscriptionDelaySubscriber.prototype.subscribeToSource = function () {\n if (!this.sourceSubscribed) {\n this.sourceSubscribed = true;\n this.unsubscribe();\n this.source.subscribe(this.parent);\n }\n };\n return SubscriptionDelaySubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=delayWhen.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nfunction dematerialize() {\n return function dematerializeOperatorFunction(source) {\n return source.lift(new DeMaterializeOperator());\n };\n}\nexports.dematerialize = dematerialize;\nvar DeMaterializeOperator = (function () {\n function DeMaterializeOperator() {\n }\n DeMaterializeOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new DeMaterializeSubscriber(subscriber));\n };\n return DeMaterializeOperator;\n}());\nvar DeMaterializeSubscriber = (function (_super) {\n __extends(DeMaterializeSubscriber, _super);\n function DeMaterializeSubscriber(destination) {\n return _super.call(this, destination) || this;\n }\n DeMaterializeSubscriber.prototype._next = function (value) {\n value.observe(this.destination);\n };\n return DeMaterializeSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=dematerialize.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar innerSubscribe_1 = require(\"../innerSubscribe\");\nfunction distinct(keySelector, flushes) {\n return function (source) { return source.lift(new DistinctOperator(keySelector, flushes)); };\n}\nexports.distinct = distinct;\nvar DistinctOperator = (function () {\n function DistinctOperator(keySelector, flushes) {\n this.keySelector = keySelector;\n this.flushes = flushes;\n }\n DistinctOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new DistinctSubscriber(subscriber, this.keySelector, this.flushes));\n };\n return DistinctOperator;\n}());\nvar DistinctSubscriber = (function (_super) {\n __extends(DistinctSubscriber, _super);\n function DistinctSubscriber(destination, keySelector, flushes) {\n var _this = _super.call(this, destination) || this;\n _this.keySelector = keySelector;\n _this.values = new Set();\n if (flushes) {\n _this.add(innerSubscribe_1.innerSubscribe(flushes, new innerSubscribe_1.SimpleInnerSubscriber(_this)));\n }\n return _this;\n }\n DistinctSubscriber.prototype.notifyNext = function () {\n this.values.clear();\n };\n DistinctSubscriber.prototype.notifyError = function (error) {\n this._error(error);\n };\n DistinctSubscriber.prototype._next = function (value) {\n if (this.keySelector) {\n this._useKeySelector(value);\n }\n else {\n this._finalizeNext(value, value);\n }\n };\n DistinctSubscriber.prototype._useKeySelector = function (value) {\n var key;\n var destination = this.destination;\n try {\n key = this.keySelector(value);\n }\n catch (err) {\n destination.error(err);\n return;\n }\n this._finalizeNext(key, value);\n };\n DistinctSubscriber.prototype._finalizeNext = function (key, value) {\n var values = this.values;\n if (!values.has(key)) {\n values.add(key);\n this.destination.next(value);\n }\n };\n return DistinctSubscriber;\n}(innerSubscribe_1.SimpleOuterSubscriber));\nexports.DistinctSubscriber = DistinctSubscriber;\n//# sourceMappingURL=distinct.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nfunction distinctUntilChanged(compare, keySelector) {\n return function (source) { return source.lift(new DistinctUntilChangedOperator(compare, keySelector)); };\n}\nexports.distinctUntilChanged = distinctUntilChanged;\nvar DistinctUntilChangedOperator = (function () {\n function DistinctUntilChangedOperator(compare, keySelector) {\n this.compare = compare;\n this.keySelector = keySelector;\n }\n DistinctUntilChangedOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new DistinctUntilChangedSubscriber(subscriber, this.compare, this.keySelector));\n };\n return DistinctUntilChangedOperator;\n}());\nvar DistinctUntilChangedSubscriber = (function (_super) {\n __extends(DistinctUntilChangedSubscriber, _super);\n function DistinctUntilChangedSubscriber(destination, compare, keySelector) {\n var _this = _super.call(this, destination) || this;\n _this.keySelector = keySelector;\n _this.hasKey = false;\n if (typeof compare === 'function') {\n _this.compare = compare;\n }\n return _this;\n }\n DistinctUntilChangedSubscriber.prototype.compare = function (x, y) {\n return x === y;\n };\n DistinctUntilChangedSubscriber.prototype._next = function (value) {\n var key;\n try {\n var keySelector = this.keySelector;\n key = keySelector ? keySelector(value) : value;\n }\n catch (err) {\n return this.destination.error(err);\n }\n var result = false;\n if (this.hasKey) {\n try {\n var compare = this.compare;\n result = compare(this.key, key);\n }\n catch (err) {\n return this.destination.error(err);\n }\n }\n else {\n this.hasKey = true;\n }\n if (!result) {\n this.key = key;\n this.destination.next(value);\n }\n };\n return DistinctUntilChangedSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=distinctUntilChanged.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar distinctUntilChanged_1 = require(\"./distinctUntilChanged\");\nfunction distinctUntilKeyChanged(key, compare) {\n return distinctUntilChanged_1.distinctUntilChanged(function (x, y) { return compare ? compare(x[key], y[key]) : x[key] === y[key]; });\n}\nexports.distinctUntilKeyChanged = distinctUntilKeyChanged;\n//# sourceMappingURL=distinctUntilKeyChanged.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ArgumentOutOfRangeError_1 = require(\"../util/ArgumentOutOfRangeError\");\nvar filter_1 = require(\"./filter\");\nvar throwIfEmpty_1 = require(\"./throwIfEmpty\");\nvar defaultIfEmpty_1 = require(\"./defaultIfEmpty\");\nvar take_1 = require(\"./take\");\nfunction elementAt(index, defaultValue) {\n if (index < 0) {\n throw new ArgumentOutOfRangeError_1.ArgumentOutOfRangeError();\n }\n var hasDefaultValue = arguments.length >= 2;\n return function (source) { return source.pipe(filter_1.filter(function (v, i) { return i === index; }), take_1.take(1), hasDefaultValue\n ? defaultIfEmpty_1.defaultIfEmpty(defaultValue)\n : throwIfEmpty_1.throwIfEmpty(function () { return new ArgumentOutOfRangeError_1.ArgumentOutOfRangeError(); })); };\n}\nexports.elementAt = elementAt;\n//# sourceMappingURL=elementAt.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar concat_1 = require(\"../observable/concat\");\nvar of_1 = require(\"../observable/of\");\nfunction endWith() {\n var array = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n array[_i] = arguments[_i];\n }\n return function (source) { return concat_1.concat(source, of_1.of.apply(void 0, array)); };\n}\nexports.endWith = endWith;\n//# sourceMappingURL=endWith.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nfunction every(predicate, thisArg) {\n return function (source) { return source.lift(new EveryOperator(predicate, thisArg, source)); };\n}\nexports.every = every;\nvar EveryOperator = (function () {\n function EveryOperator(predicate, thisArg, source) {\n this.predicate = predicate;\n this.thisArg = thisArg;\n this.source = source;\n }\n EveryOperator.prototype.call = function (observer, source) {\n return source.subscribe(new EverySubscriber(observer, this.predicate, this.thisArg, this.source));\n };\n return EveryOperator;\n}());\nvar EverySubscriber = (function (_super) {\n __extends(EverySubscriber, _super);\n function EverySubscriber(destination, predicate, thisArg, source) {\n var _this = _super.call(this, destination) || this;\n _this.predicate = predicate;\n _this.thisArg = thisArg;\n _this.source = source;\n _this.index = 0;\n _this.thisArg = thisArg || _this;\n return _this;\n }\n EverySubscriber.prototype.notifyComplete = function (everyValueMatch) {\n this.destination.next(everyValueMatch);\n this.destination.complete();\n };\n EverySubscriber.prototype._next = function (value) {\n var result = false;\n try {\n result = this.predicate.call(this.thisArg, value, this.index++, this.source);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n if (!result) {\n this.notifyComplete(false);\n }\n };\n EverySubscriber.prototype._complete = function () {\n this.notifyComplete(true);\n };\n return EverySubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=every.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar innerSubscribe_1 = require(\"../innerSubscribe\");\nfunction exhaust() {\n return function (source) { return source.lift(new SwitchFirstOperator()); };\n}\nexports.exhaust = exhaust;\nvar SwitchFirstOperator = (function () {\n function SwitchFirstOperator() {\n }\n SwitchFirstOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new SwitchFirstSubscriber(subscriber));\n };\n return SwitchFirstOperator;\n}());\nvar SwitchFirstSubscriber = (function (_super) {\n __extends(SwitchFirstSubscriber, _super);\n function SwitchFirstSubscriber(destination) {\n var _this = _super.call(this, destination) || this;\n _this.hasCompleted = false;\n _this.hasSubscription = false;\n return _this;\n }\n SwitchFirstSubscriber.prototype._next = function (value) {\n if (!this.hasSubscription) {\n this.hasSubscription = true;\n this.add(innerSubscribe_1.innerSubscribe(value, new innerSubscribe_1.SimpleInnerSubscriber(this)));\n }\n };\n SwitchFirstSubscriber.prototype._complete = function () {\n this.hasCompleted = true;\n if (!this.hasSubscription) {\n this.destination.complete();\n }\n };\n SwitchFirstSubscriber.prototype.notifyComplete = function () {\n this.hasSubscription = false;\n if (this.hasCompleted) {\n this.destination.complete();\n }\n };\n return SwitchFirstSubscriber;\n}(innerSubscribe_1.SimpleOuterSubscriber));\n//# sourceMappingURL=exhaust.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar map_1 = require(\"./map\");\nvar from_1 = require(\"../observable/from\");\nvar innerSubscribe_1 = require(\"../innerSubscribe\");\nfunction exhaustMap(project, resultSelector) {\n if (resultSelector) {\n return function (source) { return source.pipe(exhaustMap(function (a, i) { return from_1.from(project(a, i)).pipe(map_1.map(function (b, ii) { return resultSelector(a, b, i, ii); })); })); };\n }\n return function (source) {\n return source.lift(new ExhaustMapOperator(project));\n };\n}\nexports.exhaustMap = exhaustMap;\nvar ExhaustMapOperator = (function () {\n function ExhaustMapOperator(project) {\n this.project = project;\n }\n ExhaustMapOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new ExhaustMapSubscriber(subscriber, this.project));\n };\n return ExhaustMapOperator;\n}());\nvar ExhaustMapSubscriber = (function (_super) {\n __extends(ExhaustMapSubscriber, _super);\n function ExhaustMapSubscriber(destination, project) {\n var _this = _super.call(this, destination) || this;\n _this.project = project;\n _this.hasSubscription = false;\n _this.hasCompleted = false;\n _this.index = 0;\n return _this;\n }\n ExhaustMapSubscriber.prototype._next = function (value) {\n if (!this.hasSubscription) {\n this.tryNext(value);\n }\n };\n ExhaustMapSubscriber.prototype.tryNext = function (value) {\n var result;\n var index = this.index++;\n try {\n result = this.project(value, index);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.hasSubscription = true;\n this._innerSub(result);\n };\n ExhaustMapSubscriber.prototype._innerSub = function (result) {\n var innerSubscriber = new innerSubscribe_1.SimpleInnerSubscriber(this);\n var destination = this.destination;\n destination.add(innerSubscriber);\n var innerSubscription = innerSubscribe_1.innerSubscribe(result, innerSubscriber);\n if (innerSubscription !== innerSubscriber) {\n destination.add(innerSubscription);\n }\n };\n ExhaustMapSubscriber.prototype._complete = function () {\n this.hasCompleted = true;\n if (!this.hasSubscription) {\n this.destination.complete();\n }\n this.unsubscribe();\n };\n ExhaustMapSubscriber.prototype.notifyNext = function (innerValue) {\n this.destination.next(innerValue);\n };\n ExhaustMapSubscriber.prototype.notifyError = function (err) {\n this.destination.error(err);\n };\n ExhaustMapSubscriber.prototype.notifyComplete = function () {\n this.hasSubscription = false;\n if (this.hasCompleted) {\n this.destination.complete();\n }\n };\n return ExhaustMapSubscriber;\n}(innerSubscribe_1.SimpleOuterSubscriber));\n//# sourceMappingURL=exhaustMap.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar innerSubscribe_1 = require(\"../innerSubscribe\");\nfunction expand(project, concurrent, scheduler) {\n if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }\n concurrent = (concurrent || 0) < 1 ? Number.POSITIVE_INFINITY : concurrent;\n return function (source) { return source.lift(new ExpandOperator(project, concurrent, scheduler)); };\n}\nexports.expand = expand;\nvar ExpandOperator = (function () {\n function ExpandOperator(project, concurrent, scheduler) {\n this.project = project;\n this.concurrent = concurrent;\n this.scheduler = scheduler;\n }\n ExpandOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new ExpandSubscriber(subscriber, this.project, this.concurrent, this.scheduler));\n };\n return ExpandOperator;\n}());\nexports.ExpandOperator = ExpandOperator;\nvar ExpandSubscriber = (function (_super) {\n __extends(ExpandSubscriber, _super);\n function ExpandSubscriber(destination, project, concurrent, scheduler) {\n var _this = _super.call(this, destination) || this;\n _this.project = project;\n _this.concurrent = concurrent;\n _this.scheduler = scheduler;\n _this.index = 0;\n _this.active = 0;\n _this.hasCompleted = false;\n if (concurrent < Number.POSITIVE_INFINITY) {\n _this.buffer = [];\n }\n return _this;\n }\n ExpandSubscriber.dispatch = function (arg) {\n var subscriber = arg.subscriber, result = arg.result, value = arg.value, index = arg.index;\n subscriber.subscribeToProjection(result, value, index);\n };\n ExpandSubscriber.prototype._next = function (value) {\n var destination = this.destination;\n if (destination.closed) {\n this._complete();\n return;\n }\n var index = this.index++;\n if (this.active < this.concurrent) {\n destination.next(value);\n try {\n var project = this.project;\n var result = project(value, index);\n if (!this.scheduler) {\n this.subscribeToProjection(result, value, index);\n }\n else {\n var state = { subscriber: this, result: result, value: value, index: index };\n var destination_1 = this.destination;\n destination_1.add(this.scheduler.schedule(ExpandSubscriber.dispatch, 0, state));\n }\n }\n catch (e) {\n destination.error(e);\n }\n }\n else {\n this.buffer.push(value);\n }\n };\n ExpandSubscriber.prototype.subscribeToProjection = function (result, value, index) {\n this.active++;\n var destination = this.destination;\n destination.add(innerSubscribe_1.innerSubscribe(result, new innerSubscribe_1.SimpleInnerSubscriber(this)));\n };\n ExpandSubscriber.prototype._complete = function () {\n this.hasCompleted = true;\n if (this.hasCompleted && this.active === 0) {\n this.destination.complete();\n }\n this.unsubscribe();\n };\n ExpandSubscriber.prototype.notifyNext = function (innerValue) {\n this._next(innerValue);\n };\n ExpandSubscriber.prototype.notifyComplete = function () {\n var buffer = this.buffer;\n this.active--;\n if (buffer && buffer.length > 0) {\n this._next(buffer.shift());\n }\n if (this.hasCompleted && this.active === 0) {\n this.destination.complete();\n }\n };\n return ExpandSubscriber;\n}(innerSubscribe_1.SimpleOuterSubscriber));\nexports.ExpandSubscriber = ExpandSubscriber;\n//# sourceMappingURL=expand.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nfunction filter(predicate, thisArg) {\n return function filterOperatorFunction(source) {\n return source.lift(new FilterOperator(predicate, thisArg));\n };\n}\nexports.filter = filter;\nvar FilterOperator = (function () {\n function FilterOperator(predicate, thisArg) {\n this.predicate = predicate;\n this.thisArg = thisArg;\n }\n FilterOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new FilterSubscriber(subscriber, this.predicate, this.thisArg));\n };\n return FilterOperator;\n}());\nvar FilterSubscriber = (function (_super) {\n __extends(FilterSubscriber, _super);\n function FilterSubscriber(destination, predicate, thisArg) {\n var _this = _super.call(this, destination) || this;\n _this.predicate = predicate;\n _this.thisArg = thisArg;\n _this.count = 0;\n return _this;\n }\n FilterSubscriber.prototype._next = function (value) {\n var result;\n try {\n result = this.predicate.call(this.thisArg, value, this.count++);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n if (result) {\n this.destination.next(value);\n }\n };\n return FilterSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=filter.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nvar Subscription_1 = require(\"../Subscription\");\nfunction finalize(callback) {\n return function (source) { return source.lift(new FinallyOperator(callback)); };\n}\nexports.finalize = finalize;\nvar FinallyOperator = (function () {\n function FinallyOperator(callback) {\n this.callback = callback;\n }\n FinallyOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new FinallySubscriber(subscriber, this.callback));\n };\n return FinallyOperator;\n}());\nvar FinallySubscriber = (function (_super) {\n __extends(FinallySubscriber, _super);\n function FinallySubscriber(destination, callback) {\n var _this = _super.call(this, destination) || this;\n _this.add(new Subscription_1.Subscription(callback));\n return _this;\n }\n return FinallySubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=finalize.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nfunction find(predicate, thisArg) {\n if (typeof predicate !== 'function') {\n throw new TypeError('predicate is not a function');\n }\n return function (source) { return source.lift(new FindValueOperator(predicate, source, false, thisArg)); };\n}\nexports.find = find;\nvar FindValueOperator = (function () {\n function FindValueOperator(predicate, source, yieldIndex, thisArg) {\n this.predicate = predicate;\n this.source = source;\n this.yieldIndex = yieldIndex;\n this.thisArg = thisArg;\n }\n FindValueOperator.prototype.call = function (observer, source) {\n return source.subscribe(new FindValueSubscriber(observer, this.predicate, this.source, this.yieldIndex, this.thisArg));\n };\n return FindValueOperator;\n}());\nexports.FindValueOperator = FindValueOperator;\nvar FindValueSubscriber = (function (_super) {\n __extends(FindValueSubscriber, _super);\n function FindValueSubscriber(destination, predicate, source, yieldIndex, thisArg) {\n var _this = _super.call(this, destination) || this;\n _this.predicate = predicate;\n _this.source = source;\n _this.yieldIndex = yieldIndex;\n _this.thisArg = thisArg;\n _this.index = 0;\n return _this;\n }\n FindValueSubscriber.prototype.notifyComplete = function (value) {\n var destination = this.destination;\n destination.next(value);\n destination.complete();\n this.unsubscribe();\n };\n FindValueSubscriber.prototype._next = function (value) {\n var _a = this, predicate = _a.predicate, thisArg = _a.thisArg;\n var index = this.index++;\n try {\n var result = predicate.call(thisArg || this, value, index, this.source);\n if (result) {\n this.notifyComplete(this.yieldIndex ? index : value);\n }\n }\n catch (err) {\n this.destination.error(err);\n }\n };\n FindValueSubscriber.prototype._complete = function () {\n this.notifyComplete(this.yieldIndex ? -1 : undefined);\n };\n return FindValueSubscriber;\n}(Subscriber_1.Subscriber));\nexports.FindValueSubscriber = FindValueSubscriber;\n//# sourceMappingURL=find.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar find_1 = require(\"../operators/find\");\nfunction findIndex(predicate, thisArg) {\n return function (source) { return source.lift(new find_1.FindValueOperator(predicate, source, true, thisArg)); };\n}\nexports.findIndex = findIndex;\n//# sourceMappingURL=findIndex.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar EmptyError_1 = require(\"../util/EmptyError\");\nvar filter_1 = require(\"./filter\");\nvar take_1 = require(\"./take\");\nvar defaultIfEmpty_1 = require(\"./defaultIfEmpty\");\nvar throwIfEmpty_1 = require(\"./throwIfEmpty\");\nvar identity_1 = require(\"../util/identity\");\nfunction first(predicate, defaultValue) {\n var hasDefaultValue = arguments.length >= 2;\n return function (source) { return source.pipe(predicate ? filter_1.filter(function (v, i) { return predicate(v, i, source); }) : identity_1.identity, take_1.take(1), hasDefaultValue ? defaultIfEmpty_1.defaultIfEmpty(defaultValue) : throwIfEmpty_1.throwIfEmpty(function () { return new EmptyError_1.EmptyError(); })); };\n}\nexports.first = first;\n//# sourceMappingURL=first.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nvar Subscription_1 = require(\"../Subscription\");\nvar Observable_1 = require(\"../Observable\");\nvar Subject_1 = require(\"../Subject\");\nfunction groupBy(keySelector, elementSelector, durationSelector, subjectSelector) {\n return function (source) {\n return source.lift(new GroupByOperator(keySelector, elementSelector, durationSelector, subjectSelector));\n };\n}\nexports.groupBy = groupBy;\nvar GroupByOperator = (function () {\n function GroupByOperator(keySelector, elementSelector, durationSelector, subjectSelector) {\n this.keySelector = keySelector;\n this.elementSelector = elementSelector;\n this.durationSelector = durationSelector;\n this.subjectSelector = subjectSelector;\n }\n GroupByOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new GroupBySubscriber(subscriber, this.keySelector, this.elementSelector, this.durationSelector, this.subjectSelector));\n };\n return GroupByOperator;\n}());\nvar GroupBySubscriber = (function (_super) {\n __extends(GroupBySubscriber, _super);\n function GroupBySubscriber(destination, keySelector, elementSelector, durationSelector, subjectSelector) {\n var _this = _super.call(this, destination) || this;\n _this.keySelector = keySelector;\n _this.elementSelector = elementSelector;\n _this.durationSelector = durationSelector;\n _this.subjectSelector = subjectSelector;\n _this.groups = null;\n _this.attemptedToUnsubscribe = false;\n _this.count = 0;\n return _this;\n }\n GroupBySubscriber.prototype._next = function (value) {\n var key;\n try {\n key = this.keySelector(value);\n }\n catch (err) {\n this.error(err);\n return;\n }\n this._group(value, key);\n };\n GroupBySubscriber.prototype._group = function (value, key) {\n var groups = this.groups;\n if (!groups) {\n groups = this.groups = new Map();\n }\n var group = groups.get(key);\n var element;\n if (this.elementSelector) {\n try {\n element = this.elementSelector(value);\n }\n catch (err) {\n this.error(err);\n }\n }\n else {\n element = value;\n }\n if (!group) {\n group = (this.subjectSelector ? this.subjectSelector() : new Subject_1.Subject());\n groups.set(key, group);\n var groupedObservable = new GroupedObservable(key, group, this);\n this.destination.next(groupedObservable);\n if (this.durationSelector) {\n var duration = void 0;\n try {\n duration = this.durationSelector(new GroupedObservable(key, group));\n }\n catch (err) {\n this.error(err);\n return;\n }\n this.add(duration.subscribe(new GroupDurationSubscriber(key, group, this)));\n }\n }\n if (!group.closed) {\n group.next(element);\n }\n };\n GroupBySubscriber.prototype._error = function (err) {\n var groups = this.groups;\n if (groups) {\n groups.forEach(function (group, key) {\n group.error(err);\n });\n groups.clear();\n }\n this.destination.error(err);\n };\n GroupBySubscriber.prototype._complete = function () {\n var groups = this.groups;\n if (groups) {\n groups.forEach(function (group, key) {\n group.complete();\n });\n groups.clear();\n }\n this.destination.complete();\n };\n GroupBySubscriber.prototype.removeGroup = function (key) {\n this.groups.delete(key);\n };\n GroupBySubscriber.prototype.unsubscribe = function () {\n if (!this.closed) {\n this.attemptedToUnsubscribe = true;\n if (this.count === 0) {\n _super.prototype.unsubscribe.call(this);\n }\n }\n };\n return GroupBySubscriber;\n}(Subscriber_1.Subscriber));\nvar GroupDurationSubscriber = (function (_super) {\n __extends(GroupDurationSubscriber, _super);\n function GroupDurationSubscriber(key, group, parent) {\n var _this = _super.call(this, group) || this;\n _this.key = key;\n _this.group = group;\n _this.parent = parent;\n return _this;\n }\n GroupDurationSubscriber.prototype._next = function (value) {\n this.complete();\n };\n GroupDurationSubscriber.prototype._unsubscribe = function () {\n var _a = this, parent = _a.parent, key = _a.key;\n this.key = this.parent = null;\n if (parent) {\n parent.removeGroup(key);\n }\n };\n return GroupDurationSubscriber;\n}(Subscriber_1.Subscriber));\nvar GroupedObservable = (function (_super) {\n __extends(GroupedObservable, _super);\n function GroupedObservable(key, groupSubject, refCountSubscription) {\n var _this = _super.call(this) || this;\n _this.key = key;\n _this.groupSubject = groupSubject;\n _this.refCountSubscription = refCountSubscription;\n return _this;\n }\n GroupedObservable.prototype._subscribe = function (subscriber) {\n var subscription = new Subscription_1.Subscription();\n var _a = this, refCountSubscription = _a.refCountSubscription, groupSubject = _a.groupSubject;\n if (refCountSubscription && !refCountSubscription.closed) {\n subscription.add(new InnerRefCountSubscription(refCountSubscription));\n }\n subscription.add(groupSubject.subscribe(subscriber));\n return subscription;\n };\n return GroupedObservable;\n}(Observable_1.Observable));\nexports.GroupedObservable = GroupedObservable;\nvar InnerRefCountSubscription = (function (_super) {\n __extends(InnerRefCountSubscription, _super);\n function InnerRefCountSubscription(parent) {\n var _this = _super.call(this) || this;\n _this.parent = parent;\n parent.count++;\n return _this;\n }\n InnerRefCountSubscription.prototype.unsubscribe = function () {\n var parent = this.parent;\n if (!parent.closed && !this.closed) {\n _super.prototype.unsubscribe.call(this);\n parent.count -= 1;\n if (parent.count === 0 && parent.attemptedToUnsubscribe) {\n parent.unsubscribe();\n }\n }\n };\n return InnerRefCountSubscription;\n}(Subscription_1.Subscription));\n//# sourceMappingURL=groupBy.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nfunction ignoreElements() {\n return function ignoreElementsOperatorFunction(source) {\n return source.lift(new IgnoreElementsOperator());\n };\n}\nexports.ignoreElements = ignoreElements;\nvar IgnoreElementsOperator = (function () {\n function IgnoreElementsOperator() {\n }\n IgnoreElementsOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new IgnoreElementsSubscriber(subscriber));\n };\n return IgnoreElementsOperator;\n}());\nvar IgnoreElementsSubscriber = (function (_super) {\n __extends(IgnoreElementsSubscriber, _super);\n function IgnoreElementsSubscriber() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n IgnoreElementsSubscriber.prototype._next = function (unused) {\n };\n return IgnoreElementsSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=ignoreElements.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nfunction isEmpty() {\n return function (source) { return source.lift(new IsEmptyOperator()); };\n}\nexports.isEmpty = isEmpty;\nvar IsEmptyOperator = (function () {\n function IsEmptyOperator() {\n }\n IsEmptyOperator.prototype.call = function (observer, source) {\n return source.subscribe(new IsEmptySubscriber(observer));\n };\n return IsEmptyOperator;\n}());\nvar IsEmptySubscriber = (function (_super) {\n __extends(IsEmptySubscriber, _super);\n function IsEmptySubscriber(destination) {\n return _super.call(this, destination) || this;\n }\n IsEmptySubscriber.prototype.notifyComplete = function (isEmpty) {\n var destination = this.destination;\n destination.next(isEmpty);\n destination.complete();\n };\n IsEmptySubscriber.prototype._next = function (value) {\n this.notifyComplete(false);\n };\n IsEmptySubscriber.prototype._complete = function () {\n this.notifyComplete(true);\n };\n return IsEmptySubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=isEmpty.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar EmptyError_1 = require(\"../util/EmptyError\");\nvar filter_1 = require(\"./filter\");\nvar takeLast_1 = require(\"./takeLast\");\nvar throwIfEmpty_1 = require(\"./throwIfEmpty\");\nvar defaultIfEmpty_1 = require(\"./defaultIfEmpty\");\nvar identity_1 = require(\"../util/identity\");\nfunction last(predicate, defaultValue) {\n var hasDefaultValue = arguments.length >= 2;\n return function (source) { return source.pipe(predicate ? filter_1.filter(function (v, i) { return predicate(v, i, source); }) : identity_1.identity, takeLast_1.takeLast(1), hasDefaultValue ? defaultIfEmpty_1.defaultIfEmpty(defaultValue) : throwIfEmpty_1.throwIfEmpty(function () { return new EmptyError_1.EmptyError(); })); };\n}\nexports.last = last;\n//# sourceMappingURL=last.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nfunction map(project, thisArg) {\n return function mapOperation(source) {\n if (typeof project !== 'function') {\n throw new TypeError('argument is not a function. Are you looking for `mapTo()`?');\n }\n return source.lift(new MapOperator(project, thisArg));\n };\n}\nexports.map = map;\nvar MapOperator = (function () {\n function MapOperator(project, thisArg) {\n this.project = project;\n this.thisArg = thisArg;\n }\n MapOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new MapSubscriber(subscriber, this.project, this.thisArg));\n };\n return MapOperator;\n}());\nexports.MapOperator = MapOperator;\nvar MapSubscriber = (function (_super) {\n __extends(MapSubscriber, _super);\n function MapSubscriber(destination, project, thisArg) {\n var _this = _super.call(this, destination) || this;\n _this.project = project;\n _this.count = 0;\n _this.thisArg = thisArg || _this;\n return _this;\n }\n MapSubscriber.prototype._next = function (value) {\n var result;\n try {\n result = this.project.call(this.thisArg, value, this.count++);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n };\n return MapSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=map.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nfunction mapTo(value) {\n return function (source) { return source.lift(new MapToOperator(value)); };\n}\nexports.mapTo = mapTo;\nvar MapToOperator = (function () {\n function MapToOperator(value) {\n this.value = value;\n }\n MapToOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new MapToSubscriber(subscriber, this.value));\n };\n return MapToOperator;\n}());\nvar MapToSubscriber = (function (_super) {\n __extends(MapToSubscriber, _super);\n function MapToSubscriber(destination, value) {\n var _this = _super.call(this, destination) || this;\n _this.value = value;\n return _this;\n }\n MapToSubscriber.prototype._next = function (x) {\n this.destination.next(this.value);\n };\n return MapToSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=mapTo.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nvar Notification_1 = require(\"../Notification\");\nfunction materialize() {\n return function materializeOperatorFunction(source) {\n return source.lift(new MaterializeOperator());\n };\n}\nexports.materialize = materialize;\nvar MaterializeOperator = (function () {\n function MaterializeOperator() {\n }\n MaterializeOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new MaterializeSubscriber(subscriber));\n };\n return MaterializeOperator;\n}());\nvar MaterializeSubscriber = (function (_super) {\n __extends(MaterializeSubscriber, _super);\n function MaterializeSubscriber(destination) {\n return _super.call(this, destination) || this;\n }\n MaterializeSubscriber.prototype._next = function (value) {\n this.destination.next(Notification_1.Notification.createNext(value));\n };\n MaterializeSubscriber.prototype._error = function (err) {\n var destination = this.destination;\n destination.next(Notification_1.Notification.createError(err));\n destination.complete();\n };\n MaterializeSubscriber.prototype._complete = function () {\n var destination = this.destination;\n destination.next(Notification_1.Notification.createComplete());\n destination.complete();\n };\n return MaterializeSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=materialize.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar reduce_1 = require(\"./reduce\");\nfunction max(comparer) {\n var max = (typeof comparer === 'function')\n ? function (x, y) { return comparer(x, y) > 0 ? x : y; }\n : function (x, y) { return x > y ? x : y; };\n return reduce_1.reduce(max);\n}\nexports.max = max;\n//# sourceMappingURL=max.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar merge_1 = require(\"../observable/merge\");\nfunction merge() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i] = arguments[_i];\n }\n return function (source) { return source.lift.call(merge_1.merge.apply(void 0, [source].concat(observables))); };\n}\nexports.merge = merge;\n//# sourceMappingURL=merge.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar mergeMap_1 = require(\"./mergeMap\");\nvar identity_1 = require(\"../util/identity\");\nfunction mergeAll(concurrent) {\n if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }\n return mergeMap_1.mergeMap(identity_1.identity, concurrent);\n}\nexports.mergeAll = mergeAll;\n//# sourceMappingURL=mergeAll.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar map_1 = require(\"./map\");\nvar from_1 = require(\"../observable/from\");\nvar innerSubscribe_1 = require(\"../innerSubscribe\");\nfunction mergeMap(project, resultSelector, concurrent) {\n if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }\n if (typeof resultSelector === 'function') {\n return function (source) { return source.pipe(mergeMap(function (a, i) { return from_1.from(project(a, i)).pipe(map_1.map(function (b, ii) { return resultSelector(a, b, i, ii); })); }, concurrent)); };\n }\n else if (typeof resultSelector === 'number') {\n concurrent = resultSelector;\n }\n return function (source) { return source.lift(new MergeMapOperator(project, concurrent)); };\n}\nexports.mergeMap = mergeMap;\nvar MergeMapOperator = (function () {\n function MergeMapOperator(project, concurrent) {\n if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }\n this.project = project;\n this.concurrent = concurrent;\n }\n MergeMapOperator.prototype.call = function (observer, source) {\n return source.subscribe(new MergeMapSubscriber(observer, this.project, this.concurrent));\n };\n return MergeMapOperator;\n}());\nexports.MergeMapOperator = MergeMapOperator;\nvar MergeMapSubscriber = (function (_super) {\n __extends(MergeMapSubscriber, _super);\n function MergeMapSubscriber(destination, project, concurrent) {\n if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }\n var _this = _super.call(this, destination) || this;\n _this.project = project;\n _this.concurrent = concurrent;\n _this.hasCompleted = false;\n _this.buffer = [];\n _this.active = 0;\n _this.index = 0;\n return _this;\n }\n MergeMapSubscriber.prototype._next = function (value) {\n if (this.active < this.concurrent) {\n this._tryNext(value);\n }\n else {\n this.buffer.push(value);\n }\n };\n MergeMapSubscriber.prototype._tryNext = function (value) {\n var result;\n var index = this.index++;\n try {\n result = this.project(value, index);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.active++;\n this._innerSub(result);\n };\n MergeMapSubscriber.prototype._innerSub = function (ish) {\n var innerSubscriber = new innerSubscribe_1.SimpleInnerSubscriber(this);\n var destination = this.destination;\n destination.add(innerSubscriber);\n var innerSubscription = innerSubscribe_1.innerSubscribe(ish, innerSubscriber);\n if (innerSubscription !== innerSubscriber) {\n destination.add(innerSubscription);\n }\n };\n MergeMapSubscriber.prototype._complete = function () {\n this.hasCompleted = true;\n if (this.active === 0 && this.buffer.length === 0) {\n this.destination.complete();\n }\n this.unsubscribe();\n };\n MergeMapSubscriber.prototype.notifyNext = function (innerValue) {\n this.destination.next(innerValue);\n };\n MergeMapSubscriber.prototype.notifyComplete = function () {\n var buffer = this.buffer;\n this.active--;\n if (buffer.length > 0) {\n this._next(buffer.shift());\n }\n else if (this.active === 0 && this.hasCompleted) {\n this.destination.complete();\n }\n };\n return MergeMapSubscriber;\n}(innerSubscribe_1.SimpleOuterSubscriber));\nexports.MergeMapSubscriber = MergeMapSubscriber;\nexports.flatMap = mergeMap;\n//# sourceMappingURL=mergeMap.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar mergeMap_1 = require(\"./mergeMap\");\nfunction mergeMapTo(innerObservable, resultSelector, concurrent) {\n if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }\n if (typeof resultSelector === 'function') {\n return mergeMap_1.mergeMap(function () { return innerObservable; }, resultSelector, concurrent);\n }\n if (typeof resultSelector === 'number') {\n concurrent = resultSelector;\n }\n return mergeMap_1.mergeMap(function () { return innerObservable; }, concurrent);\n}\nexports.mergeMapTo = mergeMapTo;\n//# sourceMappingURL=mergeMapTo.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar innerSubscribe_1 = require(\"../innerSubscribe\");\nfunction mergeScan(accumulator, seed, concurrent) {\n if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }\n return function (source) { return source.lift(new MergeScanOperator(accumulator, seed, concurrent)); };\n}\nexports.mergeScan = mergeScan;\nvar MergeScanOperator = (function () {\n function MergeScanOperator(accumulator, seed, concurrent) {\n this.accumulator = accumulator;\n this.seed = seed;\n this.concurrent = concurrent;\n }\n MergeScanOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new MergeScanSubscriber(subscriber, this.accumulator, this.seed, this.concurrent));\n };\n return MergeScanOperator;\n}());\nexports.MergeScanOperator = MergeScanOperator;\nvar MergeScanSubscriber = (function (_super) {\n __extends(MergeScanSubscriber, _super);\n function MergeScanSubscriber(destination, accumulator, acc, concurrent) {\n var _this = _super.call(this, destination) || this;\n _this.accumulator = accumulator;\n _this.acc = acc;\n _this.concurrent = concurrent;\n _this.hasValue = false;\n _this.hasCompleted = false;\n _this.buffer = [];\n _this.active = 0;\n _this.index = 0;\n return _this;\n }\n MergeScanSubscriber.prototype._next = function (value) {\n if (this.active < this.concurrent) {\n var index = this.index++;\n var destination = this.destination;\n var ish = void 0;\n try {\n var accumulator = this.accumulator;\n ish = accumulator(this.acc, value, index);\n }\n catch (e) {\n return destination.error(e);\n }\n this.active++;\n this._innerSub(ish);\n }\n else {\n this.buffer.push(value);\n }\n };\n MergeScanSubscriber.prototype._innerSub = function (ish) {\n var innerSubscriber = new innerSubscribe_1.SimpleInnerSubscriber(this);\n var destination = this.destination;\n destination.add(innerSubscriber);\n var innerSubscription = innerSubscribe_1.innerSubscribe(ish, innerSubscriber);\n if (innerSubscription !== innerSubscriber) {\n destination.add(innerSubscription);\n }\n };\n MergeScanSubscriber.prototype._complete = function () {\n this.hasCompleted = true;\n if (this.active === 0 && this.buffer.length === 0) {\n if (this.hasValue === false) {\n this.destination.next(this.acc);\n }\n this.destination.complete();\n }\n this.unsubscribe();\n };\n MergeScanSubscriber.prototype.notifyNext = function (innerValue) {\n var destination = this.destination;\n this.acc = innerValue;\n this.hasValue = true;\n destination.next(innerValue);\n };\n MergeScanSubscriber.prototype.notifyComplete = function () {\n var buffer = this.buffer;\n this.active--;\n if (buffer.length > 0) {\n this._next(buffer.shift());\n }\n else if (this.active === 0 && this.hasCompleted) {\n if (this.hasValue === false) {\n this.destination.next(this.acc);\n }\n this.destination.complete();\n }\n };\n return MergeScanSubscriber;\n}(innerSubscribe_1.SimpleOuterSubscriber));\nexports.MergeScanSubscriber = MergeScanSubscriber;\n//# sourceMappingURL=mergeScan.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar reduce_1 = require(\"./reduce\");\nfunction min(comparer) {\n var min = (typeof comparer === 'function')\n ? function (x, y) { return comparer(x, y) < 0 ? x : y; }\n : function (x, y) { return x < y ? x : y; };\n return reduce_1.reduce(min);\n}\nexports.min = min;\n//# sourceMappingURL=min.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ConnectableObservable_1 = require(\"../observable/ConnectableObservable\");\nfunction multicast(subjectOrSubjectFactory, selector) {\n return function multicastOperatorFunction(source) {\n var subjectFactory;\n if (typeof subjectOrSubjectFactory === 'function') {\n subjectFactory = subjectOrSubjectFactory;\n }\n else {\n subjectFactory = function subjectFactory() {\n return subjectOrSubjectFactory;\n };\n }\n if (typeof selector === 'function') {\n return source.lift(new MulticastOperator(subjectFactory, selector));\n }\n var connectable = Object.create(source, ConnectableObservable_1.connectableObservableDescriptor);\n connectable.source = source;\n connectable.subjectFactory = subjectFactory;\n return connectable;\n };\n}\nexports.multicast = multicast;\nvar MulticastOperator = (function () {\n function MulticastOperator(subjectFactory, selector) {\n this.subjectFactory = subjectFactory;\n this.selector = selector;\n }\n MulticastOperator.prototype.call = function (subscriber, source) {\n var selector = this.selector;\n var subject = this.subjectFactory();\n var subscription = selector(subject).subscribe(subscriber);\n subscription.add(source.subscribe(subject));\n return subscription;\n };\n return MulticastOperator;\n}());\nexports.MulticastOperator = MulticastOperator;\n//# sourceMappingURL=multicast.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nvar Notification_1 = require(\"../Notification\");\nfunction observeOn(scheduler, delay) {\n if (delay === void 0) { delay = 0; }\n return function observeOnOperatorFunction(source) {\n return source.lift(new ObserveOnOperator(scheduler, delay));\n };\n}\nexports.observeOn = observeOn;\nvar ObserveOnOperator = (function () {\n function ObserveOnOperator(scheduler, delay) {\n if (delay === void 0) { delay = 0; }\n this.scheduler = scheduler;\n this.delay = delay;\n }\n ObserveOnOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new ObserveOnSubscriber(subscriber, this.scheduler, this.delay));\n };\n return ObserveOnOperator;\n}());\nexports.ObserveOnOperator = ObserveOnOperator;\nvar ObserveOnSubscriber = (function (_super) {\n __extends(ObserveOnSubscriber, _super);\n function ObserveOnSubscriber(destination, scheduler, delay) {\n if (delay === void 0) { delay = 0; }\n var _this = _super.call(this, destination) || this;\n _this.scheduler = scheduler;\n _this.delay = delay;\n return _this;\n }\n ObserveOnSubscriber.dispatch = function (arg) {\n var notification = arg.notification, destination = arg.destination;\n notification.observe(destination);\n this.unsubscribe();\n };\n ObserveOnSubscriber.prototype.scheduleMessage = function (notification) {\n var destination = this.destination;\n destination.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(notification, this.destination)));\n };\n ObserveOnSubscriber.prototype._next = function (value) {\n this.scheduleMessage(Notification_1.Notification.createNext(value));\n };\n ObserveOnSubscriber.prototype._error = function (err) {\n this.scheduleMessage(Notification_1.Notification.createError(err));\n this.unsubscribe();\n };\n ObserveOnSubscriber.prototype._complete = function () {\n this.scheduleMessage(Notification_1.Notification.createComplete());\n this.unsubscribe();\n };\n return ObserveOnSubscriber;\n}(Subscriber_1.Subscriber));\nexports.ObserveOnSubscriber = ObserveOnSubscriber;\nvar ObserveOnMessage = (function () {\n function ObserveOnMessage(notification, destination) {\n this.notification = notification;\n this.destination = destination;\n }\n return ObserveOnMessage;\n}());\nexports.ObserveOnMessage = ObserveOnMessage;\n//# sourceMappingURL=observeOn.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar from_1 = require(\"../observable/from\");\nvar isArray_1 = require(\"../util/isArray\");\nvar innerSubscribe_1 = require(\"../innerSubscribe\");\nfunction onErrorResumeNext() {\n var nextSources = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n nextSources[_i] = arguments[_i];\n }\n if (nextSources.length === 1 && isArray_1.isArray(nextSources[0])) {\n nextSources = nextSources[0];\n }\n return function (source) { return source.lift(new OnErrorResumeNextOperator(nextSources)); };\n}\nexports.onErrorResumeNext = onErrorResumeNext;\nfunction onErrorResumeNextStatic() {\n var nextSources = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n nextSources[_i] = arguments[_i];\n }\n var source = undefined;\n if (nextSources.length === 1 && isArray_1.isArray(nextSources[0])) {\n nextSources = nextSources[0];\n }\n source = nextSources.shift();\n return from_1.from(source).lift(new OnErrorResumeNextOperator(nextSources));\n}\nexports.onErrorResumeNextStatic = onErrorResumeNextStatic;\nvar OnErrorResumeNextOperator = (function () {\n function OnErrorResumeNextOperator(nextSources) {\n this.nextSources = nextSources;\n }\n OnErrorResumeNextOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new OnErrorResumeNextSubscriber(subscriber, this.nextSources));\n };\n return OnErrorResumeNextOperator;\n}());\nvar OnErrorResumeNextSubscriber = (function (_super) {\n __extends(OnErrorResumeNextSubscriber, _super);\n function OnErrorResumeNextSubscriber(destination, nextSources) {\n var _this = _super.call(this, destination) || this;\n _this.destination = destination;\n _this.nextSources = nextSources;\n return _this;\n }\n OnErrorResumeNextSubscriber.prototype.notifyError = function () {\n this.subscribeToNextSource();\n };\n OnErrorResumeNextSubscriber.prototype.notifyComplete = function () {\n this.subscribeToNextSource();\n };\n OnErrorResumeNextSubscriber.prototype._error = function (err) {\n this.subscribeToNextSource();\n this.unsubscribe();\n };\n OnErrorResumeNextSubscriber.prototype._complete = function () {\n this.subscribeToNextSource();\n this.unsubscribe();\n };\n OnErrorResumeNextSubscriber.prototype.subscribeToNextSource = function () {\n var next = this.nextSources.shift();\n if (!!next) {\n var innerSubscriber = new innerSubscribe_1.SimpleInnerSubscriber(this);\n var destination = this.destination;\n destination.add(innerSubscriber);\n var innerSubscription = innerSubscribe_1.innerSubscribe(next, innerSubscriber);\n if (innerSubscription !== innerSubscriber) {\n destination.add(innerSubscription);\n }\n }\n else {\n this.destination.complete();\n }\n };\n return OnErrorResumeNextSubscriber;\n}(innerSubscribe_1.SimpleOuterSubscriber));\n//# sourceMappingURL=onErrorResumeNext.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nfunction pairwise() {\n return function (source) { return source.lift(new PairwiseOperator()); };\n}\nexports.pairwise = pairwise;\nvar PairwiseOperator = (function () {\n function PairwiseOperator() {\n }\n PairwiseOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new PairwiseSubscriber(subscriber));\n };\n return PairwiseOperator;\n}());\nvar PairwiseSubscriber = (function (_super) {\n __extends(PairwiseSubscriber, _super);\n function PairwiseSubscriber(destination) {\n var _this = _super.call(this, destination) || this;\n _this.hasPrev = false;\n return _this;\n }\n PairwiseSubscriber.prototype._next = function (value) {\n var pair;\n if (this.hasPrev) {\n pair = [this.prev, value];\n }\n else {\n this.hasPrev = true;\n }\n this.prev = value;\n if (pair) {\n this.destination.next(pair);\n }\n };\n return PairwiseSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=pairwise.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar not_1 = require(\"../util/not\");\nvar filter_1 = require(\"./filter\");\nfunction partition(predicate, thisArg) {\n return function (source) { return [\n filter_1.filter(predicate, thisArg)(source),\n filter_1.filter(not_1.not(predicate, thisArg))(source)\n ]; };\n}\nexports.partition = partition;\n//# sourceMappingURL=partition.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar map_1 = require(\"./map\");\nfunction pluck() {\n var properties = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n properties[_i] = arguments[_i];\n }\n var length = properties.length;\n if (length === 0) {\n throw new Error('list of properties cannot be empty.');\n }\n return function (source) { return map_1.map(plucker(properties, length))(source); };\n}\nexports.pluck = pluck;\nfunction plucker(props, length) {\n var mapper = function (x) {\n var currentProp = x;\n for (var i = 0; i < length; i++) {\n var p = currentProp != null ? currentProp[props[i]] : undefined;\n if (p !== void 0) {\n currentProp = p;\n }\n else {\n return undefined;\n }\n }\n return currentProp;\n };\n return mapper;\n}\n//# sourceMappingURL=pluck.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subject_1 = require(\"../Subject\");\nvar multicast_1 = require(\"./multicast\");\nfunction publish(selector) {\n return selector ?\n multicast_1.multicast(function () { return new Subject_1.Subject(); }, selector) :\n multicast_1.multicast(new Subject_1.Subject());\n}\nexports.publish = publish;\n//# sourceMappingURL=publish.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar BehaviorSubject_1 = require(\"../BehaviorSubject\");\nvar multicast_1 = require(\"./multicast\");\nfunction publishBehavior(value) {\n return function (source) { return multicast_1.multicast(new BehaviorSubject_1.BehaviorSubject(value))(source); };\n}\nexports.publishBehavior = publishBehavior;\n//# sourceMappingURL=publishBehavior.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar AsyncSubject_1 = require(\"../AsyncSubject\");\nvar multicast_1 = require(\"./multicast\");\nfunction publishLast() {\n return function (source) { return multicast_1.multicast(new AsyncSubject_1.AsyncSubject())(source); };\n}\nexports.publishLast = publishLast;\n//# sourceMappingURL=publishLast.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ReplaySubject_1 = require(\"../ReplaySubject\");\nvar multicast_1 = require(\"./multicast\");\nfunction publishReplay(bufferSize, windowTime, selectorOrScheduler, scheduler) {\n if (selectorOrScheduler && typeof selectorOrScheduler !== 'function') {\n scheduler = selectorOrScheduler;\n }\n var selector = typeof selectorOrScheduler === 'function' ? selectorOrScheduler : undefined;\n var subject = new ReplaySubject_1.ReplaySubject(bufferSize, windowTime, scheduler);\n return function (source) { return multicast_1.multicast(function () { return subject; }, selector)(source); };\n}\nexports.publishReplay = publishReplay;\n//# sourceMappingURL=publishReplay.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar isArray_1 = require(\"../util/isArray\");\nvar race_1 = require(\"../observable/race\");\nfunction race() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i] = arguments[_i];\n }\n return function raceOperatorFunction(source) {\n if (observables.length === 1 && isArray_1.isArray(observables[0])) {\n observables = observables[0];\n }\n return source.lift.call(race_1.race.apply(void 0, [source].concat(observables)));\n };\n}\nexports.race = race;\n//# sourceMappingURL=race.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar scan_1 = require(\"./scan\");\nvar takeLast_1 = require(\"./takeLast\");\nvar defaultIfEmpty_1 = require(\"./defaultIfEmpty\");\nvar pipe_1 = require(\"../util/pipe\");\nfunction reduce(accumulator, seed) {\n if (arguments.length >= 2) {\n return function reduceOperatorFunctionWithSeed(source) {\n return pipe_1.pipe(scan_1.scan(accumulator, seed), takeLast_1.takeLast(1), defaultIfEmpty_1.defaultIfEmpty(seed))(source);\n };\n }\n return function reduceOperatorFunction(source) {\n return pipe_1.pipe(scan_1.scan(function (acc, value, index) { return accumulator(acc, value, index + 1); }), takeLast_1.takeLast(1))(source);\n };\n}\nexports.reduce = reduce;\n//# sourceMappingURL=reduce.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nfunction refCount() {\n return function refCountOperatorFunction(source) {\n return source.lift(new RefCountOperator(source));\n };\n}\nexports.refCount = refCount;\nvar RefCountOperator = (function () {\n function RefCountOperator(connectable) {\n this.connectable = connectable;\n }\n RefCountOperator.prototype.call = function (subscriber, source) {\n var connectable = this.connectable;\n connectable._refCount++;\n var refCounter = new RefCountSubscriber(subscriber, connectable);\n var subscription = source.subscribe(refCounter);\n if (!refCounter.closed) {\n refCounter.connection = connectable.connect();\n }\n return subscription;\n };\n return RefCountOperator;\n}());\nvar RefCountSubscriber = (function (_super) {\n __extends(RefCountSubscriber, _super);\n function RefCountSubscriber(destination, connectable) {\n var _this = _super.call(this, destination) || this;\n _this.connectable = connectable;\n return _this;\n }\n RefCountSubscriber.prototype._unsubscribe = function () {\n var connectable = this.connectable;\n if (!connectable) {\n this.connection = null;\n return;\n }\n this.connectable = null;\n var refCount = connectable._refCount;\n if (refCount <= 0) {\n this.connection = null;\n return;\n }\n connectable._refCount = refCount - 1;\n if (refCount > 1) {\n this.connection = null;\n return;\n }\n var connection = this.connection;\n var sharedConnection = connectable._connection;\n this.connection = null;\n if (sharedConnection && (!connection || sharedConnection === connection)) {\n sharedConnection.unsubscribe();\n }\n };\n return RefCountSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=refCount.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nvar empty_1 = require(\"../observable/empty\");\nfunction repeat(count) {\n if (count === void 0) { count = -1; }\n return function (source) {\n if (count === 0) {\n return empty_1.empty();\n }\n else if (count < 0) {\n return source.lift(new RepeatOperator(-1, source));\n }\n else {\n return source.lift(new RepeatOperator(count - 1, source));\n }\n };\n}\nexports.repeat = repeat;\nvar RepeatOperator = (function () {\n function RepeatOperator(count, source) {\n this.count = count;\n this.source = source;\n }\n RepeatOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new RepeatSubscriber(subscriber, this.count, this.source));\n };\n return RepeatOperator;\n}());\nvar RepeatSubscriber = (function (_super) {\n __extends(RepeatSubscriber, _super);\n function RepeatSubscriber(destination, count, source) {\n var _this = _super.call(this, destination) || this;\n _this.count = count;\n _this.source = source;\n return _this;\n }\n RepeatSubscriber.prototype.complete = function () {\n if (!this.isStopped) {\n var _a = this, source = _a.source, count = _a.count;\n if (count === 0) {\n return _super.prototype.complete.call(this);\n }\n else if (count > -1) {\n this.count = count - 1;\n }\n source.subscribe(this._unsubscribeAndRecycle());\n }\n };\n return RepeatSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=repeat.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subject_1 = require(\"../Subject\");\nvar innerSubscribe_1 = require(\"../innerSubscribe\");\nfunction repeatWhen(notifier) {\n return function (source) { return source.lift(new RepeatWhenOperator(notifier)); };\n}\nexports.repeatWhen = repeatWhen;\nvar RepeatWhenOperator = (function () {\n function RepeatWhenOperator(notifier) {\n this.notifier = notifier;\n }\n RepeatWhenOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new RepeatWhenSubscriber(subscriber, this.notifier, source));\n };\n return RepeatWhenOperator;\n}());\nvar RepeatWhenSubscriber = (function (_super) {\n __extends(RepeatWhenSubscriber, _super);\n function RepeatWhenSubscriber(destination, notifier, source) {\n var _this = _super.call(this, destination) || this;\n _this.notifier = notifier;\n _this.source = source;\n _this.sourceIsBeingSubscribedTo = true;\n return _this;\n }\n RepeatWhenSubscriber.prototype.notifyNext = function () {\n this.sourceIsBeingSubscribedTo = true;\n this.source.subscribe(this);\n };\n RepeatWhenSubscriber.prototype.notifyComplete = function () {\n if (this.sourceIsBeingSubscribedTo === false) {\n return _super.prototype.complete.call(this);\n }\n };\n RepeatWhenSubscriber.prototype.complete = function () {\n this.sourceIsBeingSubscribedTo = false;\n if (!this.isStopped) {\n if (!this.retries) {\n this.subscribeToRetries();\n }\n if (!this.retriesSubscription || this.retriesSubscription.closed) {\n return _super.prototype.complete.call(this);\n }\n this._unsubscribeAndRecycle();\n this.notifications.next(undefined);\n }\n };\n RepeatWhenSubscriber.prototype._unsubscribe = function () {\n var _a = this, notifications = _a.notifications, retriesSubscription = _a.retriesSubscription;\n if (notifications) {\n notifications.unsubscribe();\n this.notifications = undefined;\n }\n if (retriesSubscription) {\n retriesSubscription.unsubscribe();\n this.retriesSubscription = undefined;\n }\n this.retries = undefined;\n };\n RepeatWhenSubscriber.prototype._unsubscribeAndRecycle = function () {\n var _unsubscribe = this._unsubscribe;\n this._unsubscribe = null;\n _super.prototype._unsubscribeAndRecycle.call(this);\n this._unsubscribe = _unsubscribe;\n return this;\n };\n RepeatWhenSubscriber.prototype.subscribeToRetries = function () {\n this.notifications = new Subject_1.Subject();\n var retries;\n try {\n var notifier = this.notifier;\n retries = notifier(this.notifications);\n }\n catch (e) {\n return _super.prototype.complete.call(this);\n }\n this.retries = retries;\n this.retriesSubscription = innerSubscribe_1.innerSubscribe(retries, new innerSubscribe_1.SimpleInnerSubscriber(this));\n };\n return RepeatWhenSubscriber;\n}(innerSubscribe_1.SimpleOuterSubscriber));\n//# sourceMappingURL=repeatWhen.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nfunction retry(count) {\n if (count === void 0) { count = -1; }\n return function (source) { return source.lift(new RetryOperator(count, source)); };\n}\nexports.retry = retry;\nvar RetryOperator = (function () {\n function RetryOperator(count, source) {\n this.count = count;\n this.source = source;\n }\n RetryOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new RetrySubscriber(subscriber, this.count, this.source));\n };\n return RetryOperator;\n}());\nvar RetrySubscriber = (function (_super) {\n __extends(RetrySubscriber, _super);\n function RetrySubscriber(destination, count, source) {\n var _this = _super.call(this, destination) || this;\n _this.count = count;\n _this.source = source;\n return _this;\n }\n RetrySubscriber.prototype.error = function (err) {\n if (!this.isStopped) {\n var _a = this, source = _a.source, count = _a.count;\n if (count === 0) {\n return _super.prototype.error.call(this, err);\n }\n else if (count > -1) {\n this.count = count - 1;\n }\n source.subscribe(this._unsubscribeAndRecycle());\n }\n };\n return RetrySubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=retry.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subject_1 = require(\"../Subject\");\nvar innerSubscribe_1 = require(\"../innerSubscribe\");\nfunction retryWhen(notifier) {\n return function (source) { return source.lift(new RetryWhenOperator(notifier, source)); };\n}\nexports.retryWhen = retryWhen;\nvar RetryWhenOperator = (function () {\n function RetryWhenOperator(notifier, source) {\n this.notifier = notifier;\n this.source = source;\n }\n RetryWhenOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new RetryWhenSubscriber(subscriber, this.notifier, this.source));\n };\n return RetryWhenOperator;\n}());\nvar RetryWhenSubscriber = (function (_super) {\n __extends(RetryWhenSubscriber, _super);\n function RetryWhenSubscriber(destination, notifier, source) {\n var _this = _super.call(this, destination) || this;\n _this.notifier = notifier;\n _this.source = source;\n return _this;\n }\n RetryWhenSubscriber.prototype.error = function (err) {\n if (!this.isStopped) {\n var errors = this.errors;\n var retries = this.retries;\n var retriesSubscription = this.retriesSubscription;\n if (!retries) {\n errors = new Subject_1.Subject();\n try {\n var notifier = this.notifier;\n retries = notifier(errors);\n }\n catch (e) {\n return _super.prototype.error.call(this, e);\n }\n retriesSubscription = innerSubscribe_1.innerSubscribe(retries, new innerSubscribe_1.SimpleInnerSubscriber(this));\n }\n else {\n this.errors = undefined;\n this.retriesSubscription = undefined;\n }\n this._unsubscribeAndRecycle();\n this.errors = errors;\n this.retries = retries;\n this.retriesSubscription = retriesSubscription;\n errors.next(err);\n }\n };\n RetryWhenSubscriber.prototype._unsubscribe = function () {\n var _a = this, errors = _a.errors, retriesSubscription = _a.retriesSubscription;\n if (errors) {\n errors.unsubscribe();\n this.errors = undefined;\n }\n if (retriesSubscription) {\n retriesSubscription.unsubscribe();\n this.retriesSubscription = undefined;\n }\n this.retries = undefined;\n };\n RetryWhenSubscriber.prototype.notifyNext = function () {\n var _unsubscribe = this._unsubscribe;\n this._unsubscribe = null;\n this._unsubscribeAndRecycle();\n this._unsubscribe = _unsubscribe;\n this.source.subscribe(this);\n };\n return RetryWhenSubscriber;\n}(innerSubscribe_1.SimpleOuterSubscriber));\n//# sourceMappingURL=retryWhen.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar innerSubscribe_1 = require(\"../innerSubscribe\");\nfunction sample(notifier) {\n return function (source) { return source.lift(new SampleOperator(notifier)); };\n}\nexports.sample = sample;\nvar SampleOperator = (function () {\n function SampleOperator(notifier) {\n this.notifier = notifier;\n }\n SampleOperator.prototype.call = function (subscriber, source) {\n var sampleSubscriber = new SampleSubscriber(subscriber);\n var subscription = source.subscribe(sampleSubscriber);\n subscription.add(innerSubscribe_1.innerSubscribe(this.notifier, new innerSubscribe_1.SimpleInnerSubscriber(sampleSubscriber)));\n return subscription;\n };\n return SampleOperator;\n}());\nvar SampleSubscriber = (function (_super) {\n __extends(SampleSubscriber, _super);\n function SampleSubscriber() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.hasValue = false;\n return _this;\n }\n SampleSubscriber.prototype._next = function (value) {\n this.value = value;\n this.hasValue = true;\n };\n SampleSubscriber.prototype.notifyNext = function () {\n this.emitValue();\n };\n SampleSubscriber.prototype.notifyComplete = function () {\n this.emitValue();\n };\n SampleSubscriber.prototype.emitValue = function () {\n if (this.hasValue) {\n this.hasValue = false;\n this.destination.next(this.value);\n }\n };\n return SampleSubscriber;\n}(innerSubscribe_1.SimpleOuterSubscriber));\n//# sourceMappingURL=sample.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nvar async_1 = require(\"../scheduler/async\");\nfunction sampleTime(period, scheduler) {\n if (scheduler === void 0) { scheduler = async_1.async; }\n return function (source) { return source.lift(new SampleTimeOperator(period, scheduler)); };\n}\nexports.sampleTime = sampleTime;\nvar SampleTimeOperator = (function () {\n function SampleTimeOperator(period, scheduler) {\n this.period = period;\n this.scheduler = scheduler;\n }\n SampleTimeOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new SampleTimeSubscriber(subscriber, this.period, this.scheduler));\n };\n return SampleTimeOperator;\n}());\nvar SampleTimeSubscriber = (function (_super) {\n __extends(SampleTimeSubscriber, _super);\n function SampleTimeSubscriber(destination, period, scheduler) {\n var _this = _super.call(this, destination) || this;\n _this.period = period;\n _this.scheduler = scheduler;\n _this.hasValue = false;\n _this.add(scheduler.schedule(dispatchNotification, period, { subscriber: _this, period: period }));\n return _this;\n }\n SampleTimeSubscriber.prototype._next = function (value) {\n this.lastValue = value;\n this.hasValue = true;\n };\n SampleTimeSubscriber.prototype.notifyNext = function () {\n if (this.hasValue) {\n this.hasValue = false;\n this.destination.next(this.lastValue);\n }\n };\n return SampleTimeSubscriber;\n}(Subscriber_1.Subscriber));\nfunction dispatchNotification(state) {\n var subscriber = state.subscriber, period = state.period;\n subscriber.notifyNext();\n this.schedule(state, period);\n}\n//# sourceMappingURL=sampleTime.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nfunction scan(accumulator, seed) {\n var hasSeed = false;\n if (arguments.length >= 2) {\n hasSeed = true;\n }\n return function scanOperatorFunction(source) {\n return source.lift(new ScanOperator(accumulator, seed, hasSeed));\n };\n}\nexports.scan = scan;\nvar ScanOperator = (function () {\n function ScanOperator(accumulator, seed, hasSeed) {\n if (hasSeed === void 0) { hasSeed = false; }\n this.accumulator = accumulator;\n this.seed = seed;\n this.hasSeed = hasSeed;\n }\n ScanOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new ScanSubscriber(subscriber, this.accumulator, this.seed, this.hasSeed));\n };\n return ScanOperator;\n}());\nvar ScanSubscriber = (function (_super) {\n __extends(ScanSubscriber, _super);\n function ScanSubscriber(destination, accumulator, _seed, hasSeed) {\n var _this = _super.call(this, destination) || this;\n _this.accumulator = accumulator;\n _this._seed = _seed;\n _this.hasSeed = hasSeed;\n _this.index = 0;\n return _this;\n }\n Object.defineProperty(ScanSubscriber.prototype, \"seed\", {\n get: function () {\n return this._seed;\n },\n set: function (value) {\n this.hasSeed = true;\n this._seed = value;\n },\n enumerable: true,\n configurable: true\n });\n ScanSubscriber.prototype._next = function (value) {\n if (!this.hasSeed) {\n this.seed = value;\n this.destination.next(value);\n }\n else {\n return this._tryNext(value);\n }\n };\n ScanSubscriber.prototype._tryNext = function (value) {\n var index = this.index++;\n var result;\n try {\n result = this.accumulator(this.seed, value, index);\n }\n catch (err) {\n this.destination.error(err);\n }\n this.seed = result;\n this.destination.next(result);\n };\n return ScanSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=scan.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nfunction sequenceEqual(compareTo, comparator) {\n return function (source) { return source.lift(new SequenceEqualOperator(compareTo, comparator)); };\n}\nexports.sequenceEqual = sequenceEqual;\nvar SequenceEqualOperator = (function () {\n function SequenceEqualOperator(compareTo, comparator) {\n this.compareTo = compareTo;\n this.comparator = comparator;\n }\n SequenceEqualOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new SequenceEqualSubscriber(subscriber, this.compareTo, this.comparator));\n };\n return SequenceEqualOperator;\n}());\nexports.SequenceEqualOperator = SequenceEqualOperator;\nvar SequenceEqualSubscriber = (function (_super) {\n __extends(SequenceEqualSubscriber, _super);\n function SequenceEqualSubscriber(destination, compareTo, comparator) {\n var _this = _super.call(this, destination) || this;\n _this.compareTo = compareTo;\n _this.comparator = comparator;\n _this._a = [];\n _this._b = [];\n _this._oneComplete = false;\n _this.destination.add(compareTo.subscribe(new SequenceEqualCompareToSubscriber(destination, _this)));\n return _this;\n }\n SequenceEqualSubscriber.prototype._next = function (value) {\n if (this._oneComplete && this._b.length === 0) {\n this.emit(false);\n }\n else {\n this._a.push(value);\n this.checkValues();\n }\n };\n SequenceEqualSubscriber.prototype._complete = function () {\n if (this._oneComplete) {\n this.emit(this._a.length === 0 && this._b.length === 0);\n }\n else {\n this._oneComplete = true;\n }\n this.unsubscribe();\n };\n SequenceEqualSubscriber.prototype.checkValues = function () {\n var _c = this, _a = _c._a, _b = _c._b, comparator = _c.comparator;\n while (_a.length > 0 && _b.length > 0) {\n var a = _a.shift();\n var b = _b.shift();\n var areEqual = false;\n try {\n areEqual = comparator ? comparator(a, b) : a === b;\n }\n catch (e) {\n this.destination.error(e);\n }\n if (!areEqual) {\n this.emit(false);\n }\n }\n };\n SequenceEqualSubscriber.prototype.emit = function (value) {\n var destination = this.destination;\n destination.next(value);\n destination.complete();\n };\n SequenceEqualSubscriber.prototype.nextB = function (value) {\n if (this._oneComplete && this._a.length === 0) {\n this.emit(false);\n }\n else {\n this._b.push(value);\n this.checkValues();\n }\n };\n SequenceEqualSubscriber.prototype.completeB = function () {\n if (this._oneComplete) {\n this.emit(this._a.length === 0 && this._b.length === 0);\n }\n else {\n this._oneComplete = true;\n }\n };\n return SequenceEqualSubscriber;\n}(Subscriber_1.Subscriber));\nexports.SequenceEqualSubscriber = SequenceEqualSubscriber;\nvar SequenceEqualCompareToSubscriber = (function (_super) {\n __extends(SequenceEqualCompareToSubscriber, _super);\n function SequenceEqualCompareToSubscriber(destination, parent) {\n var _this = _super.call(this, destination) || this;\n _this.parent = parent;\n return _this;\n }\n SequenceEqualCompareToSubscriber.prototype._next = function (value) {\n this.parent.nextB(value);\n };\n SequenceEqualCompareToSubscriber.prototype._error = function (err) {\n this.parent.error(err);\n this.unsubscribe();\n };\n SequenceEqualCompareToSubscriber.prototype._complete = function () {\n this.parent.completeB();\n this.unsubscribe();\n };\n return SequenceEqualCompareToSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=sequenceEqual.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar multicast_1 = require(\"./multicast\");\nvar refCount_1 = require(\"./refCount\");\nvar Subject_1 = require(\"../Subject\");\nfunction shareSubjectFactory() {\n return new Subject_1.Subject();\n}\nfunction share() {\n return function (source) { return refCount_1.refCount()(multicast_1.multicast(shareSubjectFactory)(source)); };\n}\nexports.share = share;\n//# sourceMappingURL=share.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ReplaySubject_1 = require(\"../ReplaySubject\");\nfunction shareReplay(configOrBufferSize, windowTime, scheduler) {\n var config;\n if (configOrBufferSize && typeof configOrBufferSize === 'object') {\n config = configOrBufferSize;\n }\n else {\n config = {\n bufferSize: configOrBufferSize,\n windowTime: windowTime,\n refCount: false,\n scheduler: scheduler\n };\n }\n return function (source) { return source.lift(shareReplayOperator(config)); };\n}\nexports.shareReplay = shareReplay;\nfunction shareReplayOperator(_a) {\n var _b = _a.bufferSize, bufferSize = _b === void 0 ? Number.POSITIVE_INFINITY : _b, _c = _a.windowTime, windowTime = _c === void 0 ? Number.POSITIVE_INFINITY : _c, useRefCount = _a.refCount, scheduler = _a.scheduler;\n var subject;\n var refCount = 0;\n var subscription;\n var hasError = false;\n var isComplete = false;\n return function shareReplayOperation(source) {\n refCount++;\n var innerSub;\n if (!subject || hasError) {\n hasError = false;\n subject = new ReplaySubject_1.ReplaySubject(bufferSize, windowTime, scheduler);\n innerSub = subject.subscribe(this);\n subscription = source.subscribe({\n next: function (value) { subject.next(value); },\n error: function (err) {\n hasError = true;\n subject.error(err);\n },\n complete: function () {\n isComplete = true;\n subscription = undefined;\n subject.complete();\n },\n });\n }\n else {\n innerSub = subject.subscribe(this);\n }\n this.add(function () {\n refCount--;\n innerSub.unsubscribe();\n if (subscription && !isComplete && useRefCount && refCount === 0) {\n subscription.unsubscribe();\n subscription = undefined;\n subject = undefined;\n }\n });\n };\n}\n//# sourceMappingURL=shareReplay.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nvar EmptyError_1 = require(\"../util/EmptyError\");\nfunction single(predicate) {\n return function (source) { return source.lift(new SingleOperator(predicate, source)); };\n}\nexports.single = single;\nvar SingleOperator = (function () {\n function SingleOperator(predicate, source) {\n this.predicate = predicate;\n this.source = source;\n }\n SingleOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new SingleSubscriber(subscriber, this.predicate, this.source));\n };\n return SingleOperator;\n}());\nvar SingleSubscriber = (function (_super) {\n __extends(SingleSubscriber, _super);\n function SingleSubscriber(destination, predicate, source) {\n var _this = _super.call(this, destination) || this;\n _this.predicate = predicate;\n _this.source = source;\n _this.seenValue = false;\n _this.index = 0;\n return _this;\n }\n SingleSubscriber.prototype.applySingleValue = function (value) {\n if (this.seenValue) {\n this.destination.error('Sequence contains more than one element');\n }\n else {\n this.seenValue = true;\n this.singleValue = value;\n }\n };\n SingleSubscriber.prototype._next = function (value) {\n var index = this.index++;\n if (this.predicate) {\n this.tryNext(value, index);\n }\n else {\n this.applySingleValue(value);\n }\n };\n SingleSubscriber.prototype.tryNext = function (value, index) {\n try {\n if (this.predicate(value, index, this.source)) {\n this.applySingleValue(value);\n }\n }\n catch (err) {\n this.destination.error(err);\n }\n };\n SingleSubscriber.prototype._complete = function () {\n var destination = this.destination;\n if (this.index > 0) {\n destination.next(this.seenValue ? this.singleValue : undefined);\n destination.complete();\n }\n else {\n destination.error(new EmptyError_1.EmptyError);\n }\n };\n return SingleSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=single.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nfunction skip(count) {\n return function (source) { return source.lift(new SkipOperator(count)); };\n}\nexports.skip = skip;\nvar SkipOperator = (function () {\n function SkipOperator(total) {\n this.total = total;\n }\n SkipOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new SkipSubscriber(subscriber, this.total));\n };\n return SkipOperator;\n}());\nvar SkipSubscriber = (function (_super) {\n __extends(SkipSubscriber, _super);\n function SkipSubscriber(destination, total) {\n var _this = _super.call(this, destination) || this;\n _this.total = total;\n _this.count = 0;\n return _this;\n }\n SkipSubscriber.prototype._next = function (x) {\n if (++this.count > this.total) {\n this.destination.next(x);\n }\n };\n return SkipSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=skip.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nvar ArgumentOutOfRangeError_1 = require(\"../util/ArgumentOutOfRangeError\");\nfunction skipLast(count) {\n return function (source) { return source.lift(new SkipLastOperator(count)); };\n}\nexports.skipLast = skipLast;\nvar SkipLastOperator = (function () {\n function SkipLastOperator(_skipCount) {\n this._skipCount = _skipCount;\n if (this._skipCount < 0) {\n throw new ArgumentOutOfRangeError_1.ArgumentOutOfRangeError;\n }\n }\n SkipLastOperator.prototype.call = function (subscriber, source) {\n if (this._skipCount === 0) {\n return source.subscribe(new Subscriber_1.Subscriber(subscriber));\n }\n else {\n return source.subscribe(new SkipLastSubscriber(subscriber, this._skipCount));\n }\n };\n return SkipLastOperator;\n}());\nvar SkipLastSubscriber = (function (_super) {\n __extends(SkipLastSubscriber, _super);\n function SkipLastSubscriber(destination, _skipCount) {\n var _this = _super.call(this, destination) || this;\n _this._skipCount = _skipCount;\n _this._count = 0;\n _this._ring = new Array(_skipCount);\n return _this;\n }\n SkipLastSubscriber.prototype._next = function (value) {\n var skipCount = this._skipCount;\n var count = this._count++;\n if (count < skipCount) {\n this._ring[count] = value;\n }\n else {\n var currentIndex = count % skipCount;\n var ring = this._ring;\n var oldValue = ring[currentIndex];\n ring[currentIndex] = value;\n this.destination.next(oldValue);\n }\n };\n return SkipLastSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=skipLast.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar innerSubscribe_1 = require(\"../innerSubscribe\");\nfunction skipUntil(notifier) {\n return function (source) { return source.lift(new SkipUntilOperator(notifier)); };\n}\nexports.skipUntil = skipUntil;\nvar SkipUntilOperator = (function () {\n function SkipUntilOperator(notifier) {\n this.notifier = notifier;\n }\n SkipUntilOperator.prototype.call = function (destination, source) {\n return source.subscribe(new SkipUntilSubscriber(destination, this.notifier));\n };\n return SkipUntilOperator;\n}());\nvar SkipUntilSubscriber = (function (_super) {\n __extends(SkipUntilSubscriber, _super);\n function SkipUntilSubscriber(destination, notifier) {\n var _this = _super.call(this, destination) || this;\n _this.hasValue = false;\n var innerSubscriber = new innerSubscribe_1.SimpleInnerSubscriber(_this);\n _this.add(innerSubscriber);\n _this.innerSubscription = innerSubscriber;\n var innerSubscription = innerSubscribe_1.innerSubscribe(notifier, innerSubscriber);\n if (innerSubscription !== innerSubscriber) {\n _this.add(innerSubscription);\n _this.innerSubscription = innerSubscription;\n }\n return _this;\n }\n SkipUntilSubscriber.prototype._next = function (value) {\n if (this.hasValue) {\n _super.prototype._next.call(this, value);\n }\n };\n SkipUntilSubscriber.prototype.notifyNext = function () {\n this.hasValue = true;\n if (this.innerSubscription) {\n this.innerSubscription.unsubscribe();\n }\n };\n SkipUntilSubscriber.prototype.notifyComplete = function () {\n };\n return SkipUntilSubscriber;\n}(innerSubscribe_1.SimpleOuterSubscriber));\n//# sourceMappingURL=skipUntil.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nfunction skipWhile(predicate) {\n return function (source) { return source.lift(new SkipWhileOperator(predicate)); };\n}\nexports.skipWhile = skipWhile;\nvar SkipWhileOperator = (function () {\n function SkipWhileOperator(predicate) {\n this.predicate = predicate;\n }\n SkipWhileOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new SkipWhileSubscriber(subscriber, this.predicate));\n };\n return SkipWhileOperator;\n}());\nvar SkipWhileSubscriber = (function (_super) {\n __extends(SkipWhileSubscriber, _super);\n function SkipWhileSubscriber(destination, predicate) {\n var _this = _super.call(this, destination) || this;\n _this.predicate = predicate;\n _this.skipping = true;\n _this.index = 0;\n return _this;\n }\n SkipWhileSubscriber.prototype._next = function (value) {\n var destination = this.destination;\n if (this.skipping) {\n this.tryCallPredicate(value);\n }\n if (!this.skipping) {\n destination.next(value);\n }\n };\n SkipWhileSubscriber.prototype.tryCallPredicate = function (value) {\n try {\n var result = this.predicate(value, this.index++);\n this.skipping = Boolean(result);\n }\n catch (err) {\n this.destination.error(err);\n }\n };\n return SkipWhileSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=skipWhile.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar concat_1 = require(\"../observable/concat\");\nvar isScheduler_1 = require(\"../util/isScheduler\");\nfunction startWith() {\n var array = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n array[_i] = arguments[_i];\n }\n var scheduler = array[array.length - 1];\n if (isScheduler_1.isScheduler(scheduler)) {\n array.pop();\n return function (source) { return concat_1.concat(array, source, scheduler); };\n }\n else {\n return function (source) { return concat_1.concat(array, source); };\n }\n}\nexports.startWith = startWith;\n//# sourceMappingURL=startWith.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar SubscribeOnObservable_1 = require(\"../observable/SubscribeOnObservable\");\nfunction subscribeOn(scheduler, delay) {\n if (delay === void 0) { delay = 0; }\n return function subscribeOnOperatorFunction(source) {\n return source.lift(new SubscribeOnOperator(scheduler, delay));\n };\n}\nexports.subscribeOn = subscribeOn;\nvar SubscribeOnOperator = (function () {\n function SubscribeOnOperator(scheduler, delay) {\n this.scheduler = scheduler;\n this.delay = delay;\n }\n SubscribeOnOperator.prototype.call = function (subscriber, source) {\n return new SubscribeOnObservable_1.SubscribeOnObservable(source, this.delay, this.scheduler).subscribe(subscriber);\n };\n return SubscribeOnOperator;\n}());\n//# sourceMappingURL=subscribeOn.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar switchMap_1 = require(\"./switchMap\");\nvar identity_1 = require(\"../util/identity\");\nfunction switchAll() {\n return switchMap_1.switchMap(identity_1.identity);\n}\nexports.switchAll = switchAll;\n//# sourceMappingURL=switchAll.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar map_1 = require(\"./map\");\nvar from_1 = require(\"../observable/from\");\nvar innerSubscribe_1 = require(\"../innerSubscribe\");\nfunction switchMap(project, resultSelector) {\n if (typeof resultSelector === 'function') {\n return function (source) { return source.pipe(switchMap(function (a, i) { return from_1.from(project(a, i)).pipe(map_1.map(function (b, ii) { return resultSelector(a, b, i, ii); })); })); };\n }\n return function (source) { return source.lift(new SwitchMapOperator(project)); };\n}\nexports.switchMap = switchMap;\nvar SwitchMapOperator = (function () {\n function SwitchMapOperator(project) {\n this.project = project;\n }\n SwitchMapOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new SwitchMapSubscriber(subscriber, this.project));\n };\n return SwitchMapOperator;\n}());\nvar SwitchMapSubscriber = (function (_super) {\n __extends(SwitchMapSubscriber, _super);\n function SwitchMapSubscriber(destination, project) {\n var _this = _super.call(this, destination) || this;\n _this.project = project;\n _this.index = 0;\n return _this;\n }\n SwitchMapSubscriber.prototype._next = function (value) {\n var result;\n var index = this.index++;\n try {\n result = this.project(value, index);\n }\n catch (error) {\n this.destination.error(error);\n return;\n }\n this._innerSub(result);\n };\n SwitchMapSubscriber.prototype._innerSub = function (result) {\n var innerSubscription = this.innerSubscription;\n if (innerSubscription) {\n innerSubscription.unsubscribe();\n }\n var innerSubscriber = new innerSubscribe_1.SimpleInnerSubscriber(this);\n var destination = this.destination;\n destination.add(innerSubscriber);\n this.innerSubscription = innerSubscribe_1.innerSubscribe(result, innerSubscriber);\n if (this.innerSubscription !== innerSubscriber) {\n destination.add(this.innerSubscription);\n }\n };\n SwitchMapSubscriber.prototype._complete = function () {\n var innerSubscription = this.innerSubscription;\n if (!innerSubscription || innerSubscription.closed) {\n _super.prototype._complete.call(this);\n }\n this.unsubscribe();\n };\n SwitchMapSubscriber.prototype._unsubscribe = function () {\n this.innerSubscription = undefined;\n };\n SwitchMapSubscriber.prototype.notifyComplete = function () {\n this.innerSubscription = undefined;\n if (this.isStopped) {\n _super.prototype._complete.call(this);\n }\n };\n SwitchMapSubscriber.prototype.notifyNext = function (innerValue) {\n this.destination.next(innerValue);\n };\n return SwitchMapSubscriber;\n}(innerSubscribe_1.SimpleOuterSubscriber));\n//# sourceMappingURL=switchMap.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar switchMap_1 = require(\"./switchMap\");\nfunction switchMapTo(innerObservable, resultSelector) {\n return resultSelector ? switchMap_1.switchMap(function () { return innerObservable; }, resultSelector) : switchMap_1.switchMap(function () { return innerObservable; });\n}\nexports.switchMapTo = switchMapTo;\n//# sourceMappingURL=switchMapTo.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nvar ArgumentOutOfRangeError_1 = require(\"../util/ArgumentOutOfRangeError\");\nvar empty_1 = require(\"../observable/empty\");\nfunction take(count) {\n return function (source) {\n if (count === 0) {\n return empty_1.empty();\n }\n else {\n return source.lift(new TakeOperator(count));\n }\n };\n}\nexports.take = take;\nvar TakeOperator = (function () {\n function TakeOperator(total) {\n this.total = total;\n if (this.total < 0) {\n throw new ArgumentOutOfRangeError_1.ArgumentOutOfRangeError;\n }\n }\n TakeOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new TakeSubscriber(subscriber, this.total));\n };\n return TakeOperator;\n}());\nvar TakeSubscriber = (function (_super) {\n __extends(TakeSubscriber, _super);\n function TakeSubscriber(destination, total) {\n var _this = _super.call(this, destination) || this;\n _this.total = total;\n _this.count = 0;\n return _this;\n }\n TakeSubscriber.prototype._next = function (value) {\n var total = this.total;\n var count = ++this.count;\n if (count <= total) {\n this.destination.next(value);\n if (count === total) {\n this.destination.complete();\n this.unsubscribe();\n }\n }\n };\n return TakeSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=take.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nvar ArgumentOutOfRangeError_1 = require(\"../util/ArgumentOutOfRangeError\");\nvar empty_1 = require(\"../observable/empty\");\nfunction takeLast(count) {\n return function takeLastOperatorFunction(source) {\n if (count === 0) {\n return empty_1.empty();\n }\n else {\n return source.lift(new TakeLastOperator(count));\n }\n };\n}\nexports.takeLast = takeLast;\nvar TakeLastOperator = (function () {\n function TakeLastOperator(total) {\n this.total = total;\n if (this.total < 0) {\n throw new ArgumentOutOfRangeError_1.ArgumentOutOfRangeError;\n }\n }\n TakeLastOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new TakeLastSubscriber(subscriber, this.total));\n };\n return TakeLastOperator;\n}());\nvar TakeLastSubscriber = (function (_super) {\n __extends(TakeLastSubscriber, _super);\n function TakeLastSubscriber(destination, total) {\n var _this = _super.call(this, destination) || this;\n _this.total = total;\n _this.ring = new Array();\n _this.count = 0;\n return _this;\n }\n TakeLastSubscriber.prototype._next = function (value) {\n var ring = this.ring;\n var total = this.total;\n var count = this.count++;\n if (ring.length < total) {\n ring.push(value);\n }\n else {\n var index = count % total;\n ring[index] = value;\n }\n };\n TakeLastSubscriber.prototype._complete = function () {\n var destination = this.destination;\n var count = this.count;\n if (count > 0) {\n var total = this.count >= this.total ? this.total : this.count;\n var ring = this.ring;\n for (var i = 0; i < total; i++) {\n var idx = (count++) % total;\n destination.next(ring[idx]);\n }\n }\n destination.complete();\n };\n return TakeLastSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=takeLast.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar innerSubscribe_1 = require(\"../innerSubscribe\");\nfunction takeUntil(notifier) {\n return function (source) { return source.lift(new TakeUntilOperator(notifier)); };\n}\nexports.takeUntil = takeUntil;\nvar TakeUntilOperator = (function () {\n function TakeUntilOperator(notifier) {\n this.notifier = notifier;\n }\n TakeUntilOperator.prototype.call = function (subscriber, source) {\n var takeUntilSubscriber = new TakeUntilSubscriber(subscriber);\n var notifierSubscription = innerSubscribe_1.innerSubscribe(this.notifier, new innerSubscribe_1.SimpleInnerSubscriber(takeUntilSubscriber));\n if (notifierSubscription && !takeUntilSubscriber.seenValue) {\n takeUntilSubscriber.add(notifierSubscription);\n return source.subscribe(takeUntilSubscriber);\n }\n return takeUntilSubscriber;\n };\n return TakeUntilOperator;\n}());\nvar TakeUntilSubscriber = (function (_super) {\n __extends(TakeUntilSubscriber, _super);\n function TakeUntilSubscriber(destination) {\n var _this = _super.call(this, destination) || this;\n _this.seenValue = false;\n return _this;\n }\n TakeUntilSubscriber.prototype.notifyNext = function () {\n this.seenValue = true;\n this.complete();\n };\n TakeUntilSubscriber.prototype.notifyComplete = function () {\n };\n return TakeUntilSubscriber;\n}(innerSubscribe_1.SimpleOuterSubscriber));\n//# sourceMappingURL=takeUntil.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nfunction takeWhile(predicate, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n return function (source) {\n return source.lift(new TakeWhileOperator(predicate, inclusive));\n };\n}\nexports.takeWhile = takeWhile;\nvar TakeWhileOperator = (function () {\n function TakeWhileOperator(predicate, inclusive) {\n this.predicate = predicate;\n this.inclusive = inclusive;\n }\n TakeWhileOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new TakeWhileSubscriber(subscriber, this.predicate, this.inclusive));\n };\n return TakeWhileOperator;\n}());\nvar TakeWhileSubscriber = (function (_super) {\n __extends(TakeWhileSubscriber, _super);\n function TakeWhileSubscriber(destination, predicate, inclusive) {\n var _this = _super.call(this, destination) || this;\n _this.predicate = predicate;\n _this.inclusive = inclusive;\n _this.index = 0;\n return _this;\n }\n TakeWhileSubscriber.prototype._next = function (value) {\n var destination = this.destination;\n var result;\n try {\n result = this.predicate(value, this.index++);\n }\n catch (err) {\n destination.error(err);\n return;\n }\n this.nextOrComplete(value, result);\n };\n TakeWhileSubscriber.prototype.nextOrComplete = function (value, predicateResult) {\n var destination = this.destination;\n if (Boolean(predicateResult)) {\n destination.next(value);\n }\n else {\n if (this.inclusive) {\n destination.next(value);\n }\n destination.complete();\n }\n };\n return TakeWhileSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=takeWhile.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nvar noop_1 = require(\"../util/noop\");\nvar isFunction_1 = require(\"../util/isFunction\");\nfunction tap(nextOrObserver, error, complete) {\n return function tapOperatorFunction(source) {\n return source.lift(new DoOperator(nextOrObserver, error, complete));\n };\n}\nexports.tap = tap;\nvar DoOperator = (function () {\n function DoOperator(nextOrObserver, error, complete) {\n this.nextOrObserver = nextOrObserver;\n this.error = error;\n this.complete = complete;\n }\n DoOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new TapSubscriber(subscriber, this.nextOrObserver, this.error, this.complete));\n };\n return DoOperator;\n}());\nvar TapSubscriber = (function (_super) {\n __extends(TapSubscriber, _super);\n function TapSubscriber(destination, observerOrNext, error, complete) {\n var _this = _super.call(this, destination) || this;\n _this._tapNext = noop_1.noop;\n _this._tapError = noop_1.noop;\n _this._tapComplete = noop_1.noop;\n _this._tapError = error || noop_1.noop;\n _this._tapComplete = complete || noop_1.noop;\n if (isFunction_1.isFunction(observerOrNext)) {\n _this._context = _this;\n _this._tapNext = observerOrNext;\n }\n else if (observerOrNext) {\n _this._context = observerOrNext;\n _this._tapNext = observerOrNext.next || noop_1.noop;\n _this._tapError = observerOrNext.error || noop_1.noop;\n _this._tapComplete = observerOrNext.complete || noop_1.noop;\n }\n return _this;\n }\n TapSubscriber.prototype._next = function (value) {\n try {\n this._tapNext.call(this._context, value);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(value);\n };\n TapSubscriber.prototype._error = function (err) {\n try {\n this._tapError.call(this._context, err);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.error(err);\n };\n TapSubscriber.prototype._complete = function () {\n try {\n this._tapComplete.call(this._context);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n return this.destination.complete();\n };\n return TapSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=tap.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar innerSubscribe_1 = require(\"../innerSubscribe\");\nexports.defaultThrottleConfig = {\n leading: true,\n trailing: false\n};\nfunction throttle(durationSelector, config) {\n if (config === void 0) { config = exports.defaultThrottleConfig; }\n return function (source) { return source.lift(new ThrottleOperator(durationSelector, !!config.leading, !!config.trailing)); };\n}\nexports.throttle = throttle;\nvar ThrottleOperator = (function () {\n function ThrottleOperator(durationSelector, leading, trailing) {\n this.durationSelector = durationSelector;\n this.leading = leading;\n this.trailing = trailing;\n }\n ThrottleOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new ThrottleSubscriber(subscriber, this.durationSelector, this.leading, this.trailing));\n };\n return ThrottleOperator;\n}());\nvar ThrottleSubscriber = (function (_super) {\n __extends(ThrottleSubscriber, _super);\n function ThrottleSubscriber(destination, durationSelector, _leading, _trailing) {\n var _this = _super.call(this, destination) || this;\n _this.destination = destination;\n _this.durationSelector = durationSelector;\n _this._leading = _leading;\n _this._trailing = _trailing;\n _this._hasValue = false;\n return _this;\n }\n ThrottleSubscriber.prototype._next = function (value) {\n this._hasValue = true;\n this._sendValue = value;\n if (!this._throttled) {\n if (this._leading) {\n this.send();\n }\n else {\n this.throttle(value);\n }\n }\n };\n ThrottleSubscriber.prototype.send = function () {\n var _a = this, _hasValue = _a._hasValue, _sendValue = _a._sendValue;\n if (_hasValue) {\n this.destination.next(_sendValue);\n this.throttle(_sendValue);\n }\n this._hasValue = false;\n this._sendValue = undefined;\n };\n ThrottleSubscriber.prototype.throttle = function (value) {\n var duration = this.tryDurationSelector(value);\n if (!!duration) {\n this.add(this._throttled = innerSubscribe_1.innerSubscribe(duration, new innerSubscribe_1.SimpleInnerSubscriber(this)));\n }\n };\n ThrottleSubscriber.prototype.tryDurationSelector = function (value) {\n try {\n return this.durationSelector(value);\n }\n catch (err) {\n this.destination.error(err);\n return null;\n }\n };\n ThrottleSubscriber.prototype.throttlingDone = function () {\n var _a = this, _throttled = _a._throttled, _trailing = _a._trailing;\n if (_throttled) {\n _throttled.unsubscribe();\n }\n this._throttled = undefined;\n if (_trailing) {\n this.send();\n }\n };\n ThrottleSubscriber.prototype.notifyNext = function () {\n this.throttlingDone();\n };\n ThrottleSubscriber.prototype.notifyComplete = function () {\n this.throttlingDone();\n };\n return ThrottleSubscriber;\n}(innerSubscribe_1.SimpleOuterSubscriber));\n//# sourceMappingURL=throttle.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nvar async_1 = require(\"../scheduler/async\");\nvar throttle_1 = require(\"./throttle\");\nfunction throttleTime(duration, scheduler, config) {\n if (scheduler === void 0) { scheduler = async_1.async; }\n if (config === void 0) { config = throttle_1.defaultThrottleConfig; }\n return function (source) { return source.lift(new ThrottleTimeOperator(duration, scheduler, config.leading, config.trailing)); };\n}\nexports.throttleTime = throttleTime;\nvar ThrottleTimeOperator = (function () {\n function ThrottleTimeOperator(duration, scheduler, leading, trailing) {\n this.duration = duration;\n this.scheduler = scheduler;\n this.leading = leading;\n this.trailing = trailing;\n }\n ThrottleTimeOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new ThrottleTimeSubscriber(subscriber, this.duration, this.scheduler, this.leading, this.trailing));\n };\n return ThrottleTimeOperator;\n}());\nvar ThrottleTimeSubscriber = (function (_super) {\n __extends(ThrottleTimeSubscriber, _super);\n function ThrottleTimeSubscriber(destination, duration, scheduler, leading, trailing) {\n var _this = _super.call(this, destination) || this;\n _this.duration = duration;\n _this.scheduler = scheduler;\n _this.leading = leading;\n _this.trailing = trailing;\n _this._hasTrailingValue = false;\n _this._trailingValue = null;\n return _this;\n }\n ThrottleTimeSubscriber.prototype._next = function (value) {\n if (this.throttled) {\n if (this.trailing) {\n this._trailingValue = value;\n this._hasTrailingValue = true;\n }\n }\n else {\n this.add(this.throttled = this.scheduler.schedule(dispatchNext, this.duration, { subscriber: this }));\n if (this.leading) {\n this.destination.next(value);\n }\n else if (this.trailing) {\n this._trailingValue = value;\n this._hasTrailingValue = true;\n }\n }\n };\n ThrottleTimeSubscriber.prototype._complete = function () {\n if (this._hasTrailingValue) {\n this.destination.next(this._trailingValue);\n this.destination.complete();\n }\n else {\n this.destination.complete();\n }\n };\n ThrottleTimeSubscriber.prototype.clearThrottle = function () {\n var throttled = this.throttled;\n if (throttled) {\n if (this.trailing && this._hasTrailingValue) {\n this.destination.next(this._trailingValue);\n this._trailingValue = null;\n this._hasTrailingValue = false;\n }\n throttled.unsubscribe();\n this.remove(throttled);\n this.throttled = null;\n }\n };\n return ThrottleTimeSubscriber;\n}(Subscriber_1.Subscriber));\nfunction dispatchNext(arg) {\n var subscriber = arg.subscriber;\n subscriber.clearThrottle();\n}\n//# sourceMappingURL=throttleTime.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar EmptyError_1 = require(\"../util/EmptyError\");\nvar Subscriber_1 = require(\"../Subscriber\");\nfunction throwIfEmpty(errorFactory) {\n if (errorFactory === void 0) { errorFactory = defaultErrorFactory; }\n return function (source) {\n return source.lift(new ThrowIfEmptyOperator(errorFactory));\n };\n}\nexports.throwIfEmpty = throwIfEmpty;\nvar ThrowIfEmptyOperator = (function () {\n function ThrowIfEmptyOperator(errorFactory) {\n this.errorFactory = errorFactory;\n }\n ThrowIfEmptyOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new ThrowIfEmptySubscriber(subscriber, this.errorFactory));\n };\n return ThrowIfEmptyOperator;\n}());\nvar ThrowIfEmptySubscriber = (function (_super) {\n __extends(ThrowIfEmptySubscriber, _super);\n function ThrowIfEmptySubscriber(destination, errorFactory) {\n var _this = _super.call(this, destination) || this;\n _this.errorFactory = errorFactory;\n _this.hasValue = false;\n return _this;\n }\n ThrowIfEmptySubscriber.prototype._next = function (value) {\n this.hasValue = true;\n this.destination.next(value);\n };\n ThrowIfEmptySubscriber.prototype._complete = function () {\n if (!this.hasValue) {\n var err = void 0;\n try {\n err = this.errorFactory();\n }\n catch (e) {\n err = e;\n }\n this.destination.error(err);\n }\n else {\n return this.destination.complete();\n }\n };\n return ThrowIfEmptySubscriber;\n}(Subscriber_1.Subscriber));\nfunction defaultErrorFactory() {\n return new EmptyError_1.EmptyError();\n}\n//# sourceMappingURL=throwIfEmpty.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar async_1 = require(\"../scheduler/async\");\nvar scan_1 = require(\"./scan\");\nvar defer_1 = require(\"../observable/defer\");\nvar map_1 = require(\"./map\");\nfunction timeInterval(scheduler) {\n if (scheduler === void 0) { scheduler = async_1.async; }\n return function (source) { return defer_1.defer(function () {\n return source.pipe(scan_1.scan(function (_a, value) {\n var current = _a.current;\n return ({ value: value, current: scheduler.now(), last: current });\n }, { current: scheduler.now(), value: undefined, last: undefined }), map_1.map(function (_a) {\n var current = _a.current, last = _a.last, value = _a.value;\n return new TimeInterval(value, current - last);\n }));\n }); };\n}\nexports.timeInterval = timeInterval;\nvar TimeInterval = (function () {\n function TimeInterval(value, interval) {\n this.value = value;\n this.interval = interval;\n }\n return TimeInterval;\n}());\nexports.TimeInterval = TimeInterval;\n//# sourceMappingURL=timeInterval.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar async_1 = require(\"../scheduler/async\");\nvar TimeoutError_1 = require(\"../util/TimeoutError\");\nvar timeoutWith_1 = require(\"./timeoutWith\");\nvar throwError_1 = require(\"../observable/throwError\");\nfunction timeout(due, scheduler) {\n if (scheduler === void 0) { scheduler = async_1.async; }\n return timeoutWith_1.timeoutWith(due, throwError_1.throwError(new TimeoutError_1.TimeoutError()), scheduler);\n}\nexports.timeout = timeout;\n//# sourceMappingURL=timeout.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar async_1 = require(\"../scheduler/async\");\nvar isDate_1 = require(\"../util/isDate\");\nvar innerSubscribe_1 = require(\"../innerSubscribe\");\nfunction timeoutWith(due, withObservable, scheduler) {\n if (scheduler === void 0) { scheduler = async_1.async; }\n return function (source) {\n var absoluteTimeout = isDate_1.isDate(due);\n var waitFor = absoluteTimeout ? (+due - scheduler.now()) : Math.abs(due);\n return source.lift(new TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler));\n };\n}\nexports.timeoutWith = timeoutWith;\nvar TimeoutWithOperator = (function () {\n function TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler) {\n this.waitFor = waitFor;\n this.absoluteTimeout = absoluteTimeout;\n this.withObservable = withObservable;\n this.scheduler = scheduler;\n }\n TimeoutWithOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new TimeoutWithSubscriber(subscriber, this.absoluteTimeout, this.waitFor, this.withObservable, this.scheduler));\n };\n return TimeoutWithOperator;\n}());\nvar TimeoutWithSubscriber = (function (_super) {\n __extends(TimeoutWithSubscriber, _super);\n function TimeoutWithSubscriber(destination, absoluteTimeout, waitFor, withObservable, scheduler) {\n var _this = _super.call(this, destination) || this;\n _this.absoluteTimeout = absoluteTimeout;\n _this.waitFor = waitFor;\n _this.withObservable = withObservable;\n _this.scheduler = scheduler;\n _this.scheduleTimeout();\n return _this;\n }\n TimeoutWithSubscriber.dispatchTimeout = function (subscriber) {\n var withObservable = subscriber.withObservable;\n subscriber._unsubscribeAndRecycle();\n subscriber.add(innerSubscribe_1.innerSubscribe(withObservable, new innerSubscribe_1.SimpleInnerSubscriber(subscriber)));\n };\n TimeoutWithSubscriber.prototype.scheduleTimeout = function () {\n var action = this.action;\n if (action) {\n this.action = action.schedule(this, this.waitFor);\n }\n else {\n this.add(this.action = this.scheduler.schedule(TimeoutWithSubscriber.dispatchTimeout, this.waitFor, this));\n }\n };\n TimeoutWithSubscriber.prototype._next = function (value) {\n if (!this.absoluteTimeout) {\n this.scheduleTimeout();\n }\n _super.prototype._next.call(this, value);\n };\n TimeoutWithSubscriber.prototype._unsubscribe = function () {\n this.action = undefined;\n this.scheduler = null;\n this.withObservable = null;\n };\n return TimeoutWithSubscriber;\n}(innerSubscribe_1.SimpleOuterSubscriber));\n//# sourceMappingURL=timeoutWith.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar async_1 = require(\"../scheduler/async\");\nvar map_1 = require(\"./map\");\nfunction timestamp(scheduler) {\n if (scheduler === void 0) { scheduler = async_1.async; }\n return map_1.map(function (value) { return new Timestamp(value, scheduler.now()); });\n}\nexports.timestamp = timestamp;\nvar Timestamp = (function () {\n function Timestamp(value, timestamp) {\n this.value = value;\n this.timestamp = timestamp;\n }\n return Timestamp;\n}());\nexports.Timestamp = Timestamp;\n//# sourceMappingURL=timestamp.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar reduce_1 = require(\"./reduce\");\nfunction toArrayReducer(arr, item, index) {\n if (index === 0) {\n return [item];\n }\n arr.push(item);\n return arr;\n}\nfunction toArray() {\n return reduce_1.reduce(toArrayReducer, []);\n}\nexports.toArray = toArray;\n//# sourceMappingURL=toArray.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subject_1 = require(\"../Subject\");\nvar innerSubscribe_1 = require(\"../innerSubscribe\");\nfunction window(windowBoundaries) {\n return function windowOperatorFunction(source) {\n return source.lift(new WindowOperator(windowBoundaries));\n };\n}\nexports.window = window;\nvar WindowOperator = (function () {\n function WindowOperator(windowBoundaries) {\n this.windowBoundaries = windowBoundaries;\n }\n WindowOperator.prototype.call = function (subscriber, source) {\n var windowSubscriber = new WindowSubscriber(subscriber);\n var sourceSubscription = source.subscribe(windowSubscriber);\n if (!sourceSubscription.closed) {\n windowSubscriber.add(innerSubscribe_1.innerSubscribe(this.windowBoundaries, new innerSubscribe_1.SimpleInnerSubscriber(windowSubscriber)));\n }\n return sourceSubscription;\n };\n return WindowOperator;\n}());\nvar WindowSubscriber = (function (_super) {\n __extends(WindowSubscriber, _super);\n function WindowSubscriber(destination) {\n var _this = _super.call(this, destination) || this;\n _this.window = new Subject_1.Subject();\n destination.next(_this.window);\n return _this;\n }\n WindowSubscriber.prototype.notifyNext = function () {\n this.openWindow();\n };\n WindowSubscriber.prototype.notifyError = function (error) {\n this._error(error);\n };\n WindowSubscriber.prototype.notifyComplete = function () {\n this._complete();\n };\n WindowSubscriber.prototype._next = function (value) {\n this.window.next(value);\n };\n WindowSubscriber.prototype._error = function (err) {\n this.window.error(err);\n this.destination.error(err);\n };\n WindowSubscriber.prototype._complete = function () {\n this.window.complete();\n this.destination.complete();\n };\n WindowSubscriber.prototype._unsubscribe = function () {\n this.window = null;\n };\n WindowSubscriber.prototype.openWindow = function () {\n var prevWindow = this.window;\n if (prevWindow) {\n prevWindow.complete();\n }\n var destination = this.destination;\n var newWindow = this.window = new Subject_1.Subject();\n destination.next(newWindow);\n };\n return WindowSubscriber;\n}(innerSubscribe_1.SimpleOuterSubscriber));\n//# sourceMappingURL=window.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nvar Subject_1 = require(\"../Subject\");\nfunction windowCount(windowSize, startWindowEvery) {\n if (startWindowEvery === void 0) { startWindowEvery = 0; }\n return function windowCountOperatorFunction(source) {\n return source.lift(new WindowCountOperator(windowSize, startWindowEvery));\n };\n}\nexports.windowCount = windowCount;\nvar WindowCountOperator = (function () {\n function WindowCountOperator(windowSize, startWindowEvery) {\n this.windowSize = windowSize;\n this.startWindowEvery = startWindowEvery;\n }\n WindowCountOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new WindowCountSubscriber(subscriber, this.windowSize, this.startWindowEvery));\n };\n return WindowCountOperator;\n}());\nvar WindowCountSubscriber = (function (_super) {\n __extends(WindowCountSubscriber, _super);\n function WindowCountSubscriber(destination, windowSize, startWindowEvery) {\n var _this = _super.call(this, destination) || this;\n _this.destination = destination;\n _this.windowSize = windowSize;\n _this.startWindowEvery = startWindowEvery;\n _this.windows = [new Subject_1.Subject()];\n _this.count = 0;\n destination.next(_this.windows[0]);\n return _this;\n }\n WindowCountSubscriber.prototype._next = function (value) {\n var startWindowEvery = (this.startWindowEvery > 0) ? this.startWindowEvery : this.windowSize;\n var destination = this.destination;\n var windowSize = this.windowSize;\n var windows = this.windows;\n var len = windows.length;\n for (var i = 0; i < len && !this.closed; i++) {\n windows[i].next(value);\n }\n var c = this.count - windowSize + 1;\n if (c >= 0 && c % startWindowEvery === 0 && !this.closed) {\n windows.shift().complete();\n }\n if (++this.count % startWindowEvery === 0 && !this.closed) {\n var window_1 = new Subject_1.Subject();\n windows.push(window_1);\n destination.next(window_1);\n }\n };\n WindowCountSubscriber.prototype._error = function (err) {\n var windows = this.windows;\n if (windows) {\n while (windows.length > 0 && !this.closed) {\n windows.shift().error(err);\n }\n }\n this.destination.error(err);\n };\n WindowCountSubscriber.prototype._complete = function () {\n var windows = this.windows;\n if (windows) {\n while (windows.length > 0 && !this.closed) {\n windows.shift().complete();\n }\n }\n this.destination.complete();\n };\n WindowCountSubscriber.prototype._unsubscribe = function () {\n this.count = 0;\n this.windows = null;\n };\n return WindowCountSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=windowCount.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subject_1 = require(\"../Subject\");\nvar async_1 = require(\"../scheduler/async\");\nvar Subscriber_1 = require(\"../Subscriber\");\nvar isNumeric_1 = require(\"../util/isNumeric\");\nvar isScheduler_1 = require(\"../util/isScheduler\");\nfunction windowTime(windowTimeSpan) {\n var scheduler = async_1.async;\n var windowCreationInterval = null;\n var maxWindowSize = Number.POSITIVE_INFINITY;\n if (isScheduler_1.isScheduler(arguments[3])) {\n scheduler = arguments[3];\n }\n if (isScheduler_1.isScheduler(arguments[2])) {\n scheduler = arguments[2];\n }\n else if (isNumeric_1.isNumeric(arguments[2])) {\n maxWindowSize = Number(arguments[2]);\n }\n if (isScheduler_1.isScheduler(arguments[1])) {\n scheduler = arguments[1];\n }\n else if (isNumeric_1.isNumeric(arguments[1])) {\n windowCreationInterval = Number(arguments[1]);\n }\n return function windowTimeOperatorFunction(source) {\n return source.lift(new WindowTimeOperator(windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler));\n };\n}\nexports.windowTime = windowTime;\nvar WindowTimeOperator = (function () {\n function WindowTimeOperator(windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler) {\n this.windowTimeSpan = windowTimeSpan;\n this.windowCreationInterval = windowCreationInterval;\n this.maxWindowSize = maxWindowSize;\n this.scheduler = scheduler;\n }\n WindowTimeOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new WindowTimeSubscriber(subscriber, this.windowTimeSpan, this.windowCreationInterval, this.maxWindowSize, this.scheduler));\n };\n return WindowTimeOperator;\n}());\nvar CountedSubject = (function (_super) {\n __extends(CountedSubject, _super);\n function CountedSubject() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._numberOfNextedValues = 0;\n return _this;\n }\n CountedSubject.prototype.next = function (value) {\n this._numberOfNextedValues++;\n _super.prototype.next.call(this, value);\n };\n Object.defineProperty(CountedSubject.prototype, \"numberOfNextedValues\", {\n get: function () {\n return this._numberOfNextedValues;\n },\n enumerable: true,\n configurable: true\n });\n return CountedSubject;\n}(Subject_1.Subject));\nvar WindowTimeSubscriber = (function (_super) {\n __extends(WindowTimeSubscriber, _super);\n function WindowTimeSubscriber(destination, windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler) {\n var _this = _super.call(this, destination) || this;\n _this.destination = destination;\n _this.windowTimeSpan = windowTimeSpan;\n _this.windowCreationInterval = windowCreationInterval;\n _this.maxWindowSize = maxWindowSize;\n _this.scheduler = scheduler;\n _this.windows = [];\n var window = _this.openWindow();\n if (windowCreationInterval !== null && windowCreationInterval >= 0) {\n var closeState = { subscriber: _this, window: window, context: null };\n var creationState = { windowTimeSpan: windowTimeSpan, windowCreationInterval: windowCreationInterval, subscriber: _this, scheduler: scheduler };\n _this.add(scheduler.schedule(dispatchWindowClose, windowTimeSpan, closeState));\n _this.add(scheduler.schedule(dispatchWindowCreation, windowCreationInterval, creationState));\n }\n else {\n var timeSpanOnlyState = { subscriber: _this, window: window, windowTimeSpan: windowTimeSpan };\n _this.add(scheduler.schedule(dispatchWindowTimeSpanOnly, windowTimeSpan, timeSpanOnlyState));\n }\n return _this;\n }\n WindowTimeSubscriber.prototype._next = function (value) {\n var windows = this.windows;\n var len = windows.length;\n for (var i = 0; i < len; i++) {\n var window_1 = windows[i];\n if (!window_1.closed) {\n window_1.next(value);\n if (window_1.numberOfNextedValues >= this.maxWindowSize) {\n this.closeWindow(window_1);\n }\n }\n }\n };\n WindowTimeSubscriber.prototype._error = function (err) {\n var windows = this.windows;\n while (windows.length > 0) {\n windows.shift().error(err);\n }\n this.destination.error(err);\n };\n WindowTimeSubscriber.prototype._complete = function () {\n var windows = this.windows;\n while (windows.length > 0) {\n var window_2 = windows.shift();\n if (!window_2.closed) {\n window_2.complete();\n }\n }\n this.destination.complete();\n };\n WindowTimeSubscriber.prototype.openWindow = function () {\n var window = new CountedSubject();\n this.windows.push(window);\n var destination = this.destination;\n destination.next(window);\n return window;\n };\n WindowTimeSubscriber.prototype.closeWindow = function (window) {\n window.complete();\n var windows = this.windows;\n windows.splice(windows.indexOf(window), 1);\n };\n return WindowTimeSubscriber;\n}(Subscriber_1.Subscriber));\nfunction dispatchWindowTimeSpanOnly(state) {\n var subscriber = state.subscriber, windowTimeSpan = state.windowTimeSpan, window = state.window;\n if (window) {\n subscriber.closeWindow(window);\n }\n state.window = subscriber.openWindow();\n this.schedule(state, windowTimeSpan);\n}\nfunction dispatchWindowCreation(state) {\n var windowTimeSpan = state.windowTimeSpan, subscriber = state.subscriber, scheduler = state.scheduler, windowCreationInterval = state.windowCreationInterval;\n var window = subscriber.openWindow();\n var action = this;\n var context = { action: action, subscription: null };\n var timeSpanState = { subscriber: subscriber, window: window, context: context };\n context.subscription = scheduler.schedule(dispatchWindowClose, windowTimeSpan, timeSpanState);\n action.add(context.subscription);\n action.schedule(state, windowCreationInterval);\n}\nfunction dispatchWindowClose(state) {\n var subscriber = state.subscriber, window = state.window, context = state.context;\n if (context && context.action && context.subscription) {\n context.action.remove(context.subscription);\n }\n subscriber.closeWindow(window);\n}\n//# sourceMappingURL=windowTime.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subject_1 = require(\"../Subject\");\nvar Subscription_1 = require(\"../Subscription\");\nvar OuterSubscriber_1 = require(\"../OuterSubscriber\");\nvar subscribeToResult_1 = require(\"../util/subscribeToResult\");\nfunction windowToggle(openings, closingSelector) {\n return function (source) { return source.lift(new WindowToggleOperator(openings, closingSelector)); };\n}\nexports.windowToggle = windowToggle;\nvar WindowToggleOperator = (function () {\n function WindowToggleOperator(openings, closingSelector) {\n this.openings = openings;\n this.closingSelector = closingSelector;\n }\n WindowToggleOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new WindowToggleSubscriber(subscriber, this.openings, this.closingSelector));\n };\n return WindowToggleOperator;\n}());\nvar WindowToggleSubscriber = (function (_super) {\n __extends(WindowToggleSubscriber, _super);\n function WindowToggleSubscriber(destination, openings, closingSelector) {\n var _this = _super.call(this, destination) || this;\n _this.openings = openings;\n _this.closingSelector = closingSelector;\n _this.contexts = [];\n _this.add(_this.openSubscription = subscribeToResult_1.subscribeToResult(_this, openings, openings));\n return _this;\n }\n WindowToggleSubscriber.prototype._next = function (value) {\n var contexts = this.contexts;\n if (contexts) {\n var len = contexts.length;\n for (var i = 0; i < len; i++) {\n contexts[i].window.next(value);\n }\n }\n };\n WindowToggleSubscriber.prototype._error = function (err) {\n var contexts = this.contexts;\n this.contexts = null;\n if (contexts) {\n var len = contexts.length;\n var index = -1;\n while (++index < len) {\n var context_1 = contexts[index];\n context_1.window.error(err);\n context_1.subscription.unsubscribe();\n }\n }\n _super.prototype._error.call(this, err);\n };\n WindowToggleSubscriber.prototype._complete = function () {\n var contexts = this.contexts;\n this.contexts = null;\n if (contexts) {\n var len = contexts.length;\n var index = -1;\n while (++index < len) {\n var context_2 = contexts[index];\n context_2.window.complete();\n context_2.subscription.unsubscribe();\n }\n }\n _super.prototype._complete.call(this);\n };\n WindowToggleSubscriber.prototype._unsubscribe = function () {\n var contexts = this.contexts;\n this.contexts = null;\n if (contexts) {\n var len = contexts.length;\n var index = -1;\n while (++index < len) {\n var context_3 = contexts[index];\n context_3.window.unsubscribe();\n context_3.subscription.unsubscribe();\n }\n }\n };\n WindowToggleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n if (outerValue === this.openings) {\n var closingNotifier = void 0;\n try {\n var closingSelector = this.closingSelector;\n closingNotifier = closingSelector(innerValue);\n }\n catch (e) {\n return this.error(e);\n }\n var window_1 = new Subject_1.Subject();\n var subscription = new Subscription_1.Subscription();\n var context_4 = { window: window_1, subscription: subscription };\n this.contexts.push(context_4);\n var innerSubscription = subscribeToResult_1.subscribeToResult(this, closingNotifier, context_4);\n if (innerSubscription.closed) {\n this.closeWindow(this.contexts.length - 1);\n }\n else {\n innerSubscription.context = context_4;\n subscription.add(innerSubscription);\n }\n this.destination.next(window_1);\n }\n else {\n this.closeWindow(this.contexts.indexOf(outerValue));\n }\n };\n WindowToggleSubscriber.prototype.notifyError = function (err) {\n this.error(err);\n };\n WindowToggleSubscriber.prototype.notifyComplete = function (inner) {\n if (inner !== this.openSubscription) {\n this.closeWindow(this.contexts.indexOf(inner.context));\n }\n };\n WindowToggleSubscriber.prototype.closeWindow = function (index) {\n if (index === -1) {\n return;\n }\n var contexts = this.contexts;\n var context = contexts[index];\n var window = context.window, subscription = context.subscription;\n contexts.splice(index, 1);\n window.complete();\n subscription.unsubscribe();\n };\n return WindowToggleSubscriber;\n}(OuterSubscriber_1.OuterSubscriber));\n//# sourceMappingURL=windowToggle.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subject_1 = require(\"../Subject\");\nvar OuterSubscriber_1 = require(\"../OuterSubscriber\");\nvar subscribeToResult_1 = require(\"../util/subscribeToResult\");\nfunction windowWhen(closingSelector) {\n return function windowWhenOperatorFunction(source) {\n return source.lift(new WindowOperator(closingSelector));\n };\n}\nexports.windowWhen = windowWhen;\nvar WindowOperator = (function () {\n function WindowOperator(closingSelector) {\n this.closingSelector = closingSelector;\n }\n WindowOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new WindowSubscriber(subscriber, this.closingSelector));\n };\n return WindowOperator;\n}());\nvar WindowSubscriber = (function (_super) {\n __extends(WindowSubscriber, _super);\n function WindowSubscriber(destination, closingSelector) {\n var _this = _super.call(this, destination) || this;\n _this.destination = destination;\n _this.closingSelector = closingSelector;\n _this.openWindow();\n return _this;\n }\n WindowSubscriber.prototype.notifyNext = function (_outerValue, _innerValue, _outerIndex, _innerIndex, innerSub) {\n this.openWindow(innerSub);\n };\n WindowSubscriber.prototype.notifyError = function (error) {\n this._error(error);\n };\n WindowSubscriber.prototype.notifyComplete = function (innerSub) {\n this.openWindow(innerSub);\n };\n WindowSubscriber.prototype._next = function (value) {\n this.window.next(value);\n };\n WindowSubscriber.prototype._error = function (err) {\n this.window.error(err);\n this.destination.error(err);\n this.unsubscribeClosingNotification();\n };\n WindowSubscriber.prototype._complete = function () {\n this.window.complete();\n this.destination.complete();\n this.unsubscribeClosingNotification();\n };\n WindowSubscriber.prototype.unsubscribeClosingNotification = function () {\n if (this.closingNotification) {\n this.closingNotification.unsubscribe();\n }\n };\n WindowSubscriber.prototype.openWindow = function (innerSub) {\n if (innerSub === void 0) { innerSub = null; }\n if (innerSub) {\n this.remove(innerSub);\n innerSub.unsubscribe();\n }\n var prevWindow = this.window;\n if (prevWindow) {\n prevWindow.complete();\n }\n var window = this.window = new Subject_1.Subject();\n this.destination.next(window);\n var closingNotifier;\n try {\n var closingSelector = this.closingSelector;\n closingNotifier = closingSelector();\n }\n catch (e) {\n this.destination.error(e);\n this.window.error(e);\n return;\n }\n this.add(this.closingNotification = subscribeToResult_1.subscribeToResult(this, closingNotifier));\n };\n return WindowSubscriber;\n}(OuterSubscriber_1.OuterSubscriber));\n//# sourceMappingURL=windowWhen.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar OuterSubscriber_1 = require(\"../OuterSubscriber\");\nvar subscribeToResult_1 = require(\"../util/subscribeToResult\");\nfunction withLatestFrom() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return function (source) {\n var project;\n if (typeof args[args.length - 1] === 'function') {\n project = args.pop();\n }\n var observables = args;\n return source.lift(new WithLatestFromOperator(observables, project));\n };\n}\nexports.withLatestFrom = withLatestFrom;\nvar WithLatestFromOperator = (function () {\n function WithLatestFromOperator(observables, project) {\n this.observables = observables;\n this.project = project;\n }\n WithLatestFromOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new WithLatestFromSubscriber(subscriber, this.observables, this.project));\n };\n return WithLatestFromOperator;\n}());\nvar WithLatestFromSubscriber = (function (_super) {\n __extends(WithLatestFromSubscriber, _super);\n function WithLatestFromSubscriber(destination, observables, project) {\n var _this = _super.call(this, destination) || this;\n _this.observables = observables;\n _this.project = project;\n _this.toRespond = [];\n var len = observables.length;\n _this.values = new Array(len);\n for (var i = 0; i < len; i++) {\n _this.toRespond.push(i);\n }\n for (var i = 0; i < len; i++) {\n var observable = observables[i];\n _this.add(subscribeToResult_1.subscribeToResult(_this, observable, undefined, i));\n }\n return _this;\n }\n WithLatestFromSubscriber.prototype.notifyNext = function (_outerValue, innerValue, outerIndex) {\n this.values[outerIndex] = innerValue;\n var toRespond = this.toRespond;\n if (toRespond.length > 0) {\n var found = toRespond.indexOf(outerIndex);\n if (found !== -1) {\n toRespond.splice(found, 1);\n }\n }\n };\n WithLatestFromSubscriber.prototype.notifyComplete = function () {\n };\n WithLatestFromSubscriber.prototype._next = function (value) {\n if (this.toRespond.length === 0) {\n var args = [value].concat(this.values);\n if (this.project) {\n this._tryProject(args);\n }\n else {\n this.destination.next(args);\n }\n }\n };\n WithLatestFromSubscriber.prototype._tryProject = function (args) {\n var result;\n try {\n result = this.project.apply(this, args);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n };\n return WithLatestFromSubscriber;\n}(OuterSubscriber_1.OuterSubscriber));\n//# sourceMappingURL=withLatestFrom.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar zip_1 = require(\"../observable/zip\");\nfunction zip() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i] = arguments[_i];\n }\n return function zipOperatorFunction(source) {\n return source.lift.call(zip_1.zip.apply(void 0, [source].concat(observables)));\n };\n}\nexports.zip = zip;\n//# sourceMappingURL=zip.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar zip_1 = require(\"../observable/zip\");\nfunction zipAll(project) {\n return function (source) { return source.lift(new zip_1.ZipOperator(project)); };\n}\nexports.zipAll = zipAll;\n//# sourceMappingURL=zipAll.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Observable_1 = require(\"../Observable\");\nvar Subscription_1 = require(\"../Subscription\");\nfunction scheduleArray(input, scheduler) {\n return new Observable_1.Observable(function (subscriber) {\n var sub = new Subscription_1.Subscription();\n var i = 0;\n sub.add(scheduler.schedule(function () {\n if (i === input.length) {\n subscriber.complete();\n return;\n }\n subscriber.next(input[i++]);\n if (!subscriber.closed) {\n sub.add(this.schedule());\n }\n }));\n return sub;\n });\n}\nexports.scheduleArray = scheduleArray;\n//# sourceMappingURL=scheduleArray.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Observable_1 = require(\"../Observable\");\nvar Subscription_1 = require(\"../Subscription\");\nvar iterator_1 = require(\"../symbol/iterator\");\nfunction scheduleIterable(input, scheduler) {\n if (!input) {\n throw new Error('Iterable cannot be null');\n }\n return new Observable_1.Observable(function (subscriber) {\n var sub = new Subscription_1.Subscription();\n var iterator;\n sub.add(function () {\n if (iterator && typeof iterator.return === 'function') {\n iterator.return();\n }\n });\n sub.add(scheduler.schedule(function () {\n iterator = input[iterator_1.iterator]();\n sub.add(scheduler.schedule(function () {\n if (subscriber.closed) {\n return;\n }\n var value;\n var done;\n try {\n var result = iterator.next();\n value = result.value;\n done = result.done;\n }\n catch (err) {\n subscriber.error(err);\n return;\n }\n if (done) {\n subscriber.complete();\n }\n else {\n subscriber.next(value);\n this.schedule();\n }\n }));\n }));\n return sub;\n });\n}\nexports.scheduleIterable = scheduleIterable;\n//# sourceMappingURL=scheduleIterable.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Observable_1 = require(\"../Observable\");\nvar Subscription_1 = require(\"../Subscription\");\nvar observable_1 = require(\"../symbol/observable\");\nfunction scheduleObservable(input, scheduler) {\n return new Observable_1.Observable(function (subscriber) {\n var sub = new Subscription_1.Subscription();\n sub.add(scheduler.schedule(function () {\n var observable = input[observable_1.observable]();\n sub.add(observable.subscribe({\n next: function (value) { sub.add(scheduler.schedule(function () { return subscriber.next(value); })); },\n error: function (err) { sub.add(scheduler.schedule(function () { return subscriber.error(err); })); },\n complete: function () { sub.add(scheduler.schedule(function () { return subscriber.complete(); })); },\n }));\n }));\n return sub;\n });\n}\nexports.scheduleObservable = scheduleObservable;\n//# sourceMappingURL=scheduleObservable.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Observable_1 = require(\"../Observable\");\nvar Subscription_1 = require(\"../Subscription\");\nfunction schedulePromise(input, scheduler) {\n return new Observable_1.Observable(function (subscriber) {\n var sub = new Subscription_1.Subscription();\n sub.add(scheduler.schedule(function () { return input.then(function (value) {\n sub.add(scheduler.schedule(function () {\n subscriber.next(value);\n sub.add(scheduler.schedule(function () { return subscriber.complete(); }));\n }));\n }, function (err) {\n sub.add(scheduler.schedule(function () { return subscriber.error(err); }));\n }); }));\n return sub;\n });\n}\nexports.schedulePromise = schedulePromise;\n//# sourceMappingURL=schedulePromise.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar scheduleObservable_1 = require(\"./scheduleObservable\");\nvar schedulePromise_1 = require(\"./schedulePromise\");\nvar scheduleArray_1 = require(\"./scheduleArray\");\nvar scheduleIterable_1 = require(\"./scheduleIterable\");\nvar isInteropObservable_1 = require(\"../util/isInteropObservable\");\nvar isPromise_1 = require(\"../util/isPromise\");\nvar isArrayLike_1 = require(\"../util/isArrayLike\");\nvar isIterable_1 = require(\"../util/isIterable\");\nfunction scheduled(input, scheduler) {\n if (input != null) {\n if (isInteropObservable_1.isInteropObservable(input)) {\n return scheduleObservable_1.scheduleObservable(input, scheduler);\n }\n else if (isPromise_1.isPromise(input)) {\n return schedulePromise_1.schedulePromise(input, scheduler);\n }\n else if (isArrayLike_1.isArrayLike(input)) {\n return scheduleArray_1.scheduleArray(input, scheduler);\n }\n else if (isIterable_1.isIterable(input) || typeof input === 'string') {\n return scheduleIterable_1.scheduleIterable(input, scheduler);\n }\n }\n throw new TypeError((input !== null && typeof input || input) + ' is not observable');\n}\nexports.scheduled = scheduled;\n//# sourceMappingURL=scheduled.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscription_1 = require(\"../Subscription\");\nvar Action = (function (_super) {\n __extends(Action, _super);\n function Action(scheduler, work) {\n return _super.call(this) || this;\n }\n Action.prototype.schedule = function (state, delay) {\n if (delay === void 0) { delay = 0; }\n return this;\n };\n return Action;\n}(Subscription_1.Subscription));\nexports.Action = Action;\n//# sourceMappingURL=Action.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Immediate_1 = require(\"../util/Immediate\");\nvar AsyncAction_1 = require(\"./AsyncAction\");\nvar AsapAction = (function (_super) {\n __extends(AsapAction, _super);\n function AsapAction(scheduler, work) {\n var _this = _super.call(this, scheduler, work) || this;\n _this.scheduler = scheduler;\n _this.work = work;\n return _this;\n }\n AsapAction.prototype.requestAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) { delay = 0; }\n if (delay !== null && delay > 0) {\n return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);\n }\n scheduler.actions.push(this);\n return scheduler.scheduled || (scheduler.scheduled = Immediate_1.Immediate.setImmediate(scheduler.flush.bind(scheduler, null)));\n };\n AsapAction.prototype.recycleAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) { delay = 0; }\n if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {\n return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);\n }\n if (scheduler.actions.length === 0) {\n Immediate_1.Immediate.clearImmediate(id);\n scheduler.scheduled = undefined;\n }\n return undefined;\n };\n return AsapAction;\n}(AsyncAction_1.AsyncAction));\nexports.AsapAction = AsapAction;\n//# sourceMappingURL=AsapAction.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar AsyncScheduler_1 = require(\"./AsyncScheduler\");\nvar AsapScheduler = (function (_super) {\n __extends(AsapScheduler, _super);\n function AsapScheduler() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n AsapScheduler.prototype.flush = function (action) {\n this.active = true;\n this.scheduled = undefined;\n var actions = this.actions;\n var error;\n var index = -1;\n var count = actions.length;\n action = action || actions.shift();\n do {\n if (error = action.execute(action.state, action.delay)) {\n break;\n }\n } while (++index < count && (action = actions.shift()));\n this.active = false;\n if (error) {\n while (++index < count && (action = actions.shift())) {\n action.unsubscribe();\n }\n throw error;\n }\n };\n return AsapScheduler;\n}(AsyncScheduler_1.AsyncScheduler));\nexports.AsapScheduler = AsapScheduler;\n//# sourceMappingURL=AsapScheduler.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Action_1 = require(\"./Action\");\nvar AsyncAction = (function (_super) {\n __extends(AsyncAction, _super);\n function AsyncAction(scheduler, work) {\n var _this = _super.call(this, scheduler, work) || this;\n _this.scheduler = scheduler;\n _this.work = work;\n _this.pending = false;\n return _this;\n }\n AsyncAction.prototype.schedule = function (state, delay) {\n if (delay === void 0) { delay = 0; }\n if (this.closed) {\n return this;\n }\n this.state = state;\n var id = this.id;\n var scheduler = this.scheduler;\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, delay);\n }\n this.pending = true;\n this.delay = delay;\n this.id = this.id || this.requestAsyncId(scheduler, this.id, delay);\n return this;\n };\n AsyncAction.prototype.requestAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) { delay = 0; }\n return setInterval(scheduler.flush.bind(scheduler, this), delay);\n };\n AsyncAction.prototype.recycleAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) { delay = 0; }\n if (delay !== null && this.delay === delay && this.pending === false) {\n return id;\n }\n clearInterval(id);\n return undefined;\n };\n AsyncAction.prototype.execute = function (state, delay) {\n if (this.closed) {\n return new Error('executing a cancelled action');\n }\n this.pending = false;\n var error = this._execute(state, delay);\n if (error) {\n return error;\n }\n else if (this.pending === false && this.id != null) {\n this.id = this.recycleAsyncId(this.scheduler, this.id, null);\n }\n };\n AsyncAction.prototype._execute = function (state, delay) {\n var errored = false;\n var errorValue = undefined;\n try {\n this.work(state);\n }\n catch (e) {\n errored = true;\n errorValue = !!e && e || new Error(e);\n }\n if (errored) {\n this.unsubscribe();\n return errorValue;\n }\n };\n AsyncAction.prototype._unsubscribe = function () {\n var id = this.id;\n var scheduler = this.scheduler;\n var actions = scheduler.actions;\n var index = actions.indexOf(this);\n this.work = null;\n this.state = null;\n this.pending = false;\n this.scheduler = null;\n if (index !== -1) {\n actions.splice(index, 1);\n }\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, null);\n }\n this.delay = null;\n };\n return AsyncAction;\n}(Action_1.Action));\nexports.AsyncAction = AsyncAction;\n//# sourceMappingURL=AsyncAction.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Scheduler_1 = require(\"../Scheduler\");\nvar AsyncScheduler = (function (_super) {\n __extends(AsyncScheduler, _super);\n function AsyncScheduler(SchedulerAction, now) {\n if (now === void 0) { now = Scheduler_1.Scheduler.now; }\n var _this = _super.call(this, SchedulerAction, function () {\n if (AsyncScheduler.delegate && AsyncScheduler.delegate !== _this) {\n return AsyncScheduler.delegate.now();\n }\n else {\n return now();\n }\n }) || this;\n _this.actions = [];\n _this.active = false;\n _this.scheduled = undefined;\n return _this;\n }\n AsyncScheduler.prototype.schedule = function (work, delay, state) {\n if (delay === void 0) { delay = 0; }\n if (AsyncScheduler.delegate && AsyncScheduler.delegate !== this) {\n return AsyncScheduler.delegate.schedule(work, delay, state);\n }\n else {\n return _super.prototype.schedule.call(this, work, delay, state);\n }\n };\n AsyncScheduler.prototype.flush = function (action) {\n var actions = this.actions;\n if (this.active) {\n actions.push(action);\n return;\n }\n var error;\n this.active = true;\n do {\n if (error = action.execute(action.state, action.delay)) {\n break;\n }\n } while (action = actions.shift());\n this.active = false;\n if (error) {\n while (action = actions.shift()) {\n action.unsubscribe();\n }\n throw error;\n }\n };\n return AsyncScheduler;\n}(Scheduler_1.Scheduler));\nexports.AsyncScheduler = AsyncScheduler;\n//# sourceMappingURL=AsyncScheduler.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar AsyncAction_1 = require(\"./AsyncAction\");\nvar QueueAction = (function (_super) {\n __extends(QueueAction, _super);\n function QueueAction(scheduler, work) {\n var _this = _super.call(this, scheduler, work) || this;\n _this.scheduler = scheduler;\n _this.work = work;\n return _this;\n }\n QueueAction.prototype.schedule = function (state, delay) {\n if (delay === void 0) { delay = 0; }\n if (delay > 0) {\n return _super.prototype.schedule.call(this, state, delay);\n }\n this.delay = delay;\n this.state = state;\n this.scheduler.flush(this);\n return this;\n };\n QueueAction.prototype.execute = function (state, delay) {\n return (delay > 0 || this.closed) ?\n _super.prototype.execute.call(this, state, delay) :\n this._execute(state, delay);\n };\n QueueAction.prototype.requestAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) { delay = 0; }\n if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {\n return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);\n }\n return scheduler.flush(this);\n };\n return QueueAction;\n}(AsyncAction_1.AsyncAction));\nexports.QueueAction = QueueAction;\n//# sourceMappingURL=QueueAction.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar AsyncScheduler_1 = require(\"./AsyncScheduler\");\nvar QueueScheduler = (function (_super) {\n __extends(QueueScheduler, _super);\n function QueueScheduler() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return QueueScheduler;\n}(AsyncScheduler_1.AsyncScheduler));\nexports.QueueScheduler = QueueScheduler;\n//# sourceMappingURL=QueueScheduler.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar AsapAction_1 = require(\"./AsapAction\");\nvar AsapScheduler_1 = require(\"./AsapScheduler\");\nexports.asapScheduler = new AsapScheduler_1.AsapScheduler(AsapAction_1.AsapAction);\nexports.asap = exports.asapScheduler;\n//# sourceMappingURL=asap.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar AsyncAction_1 = require(\"./AsyncAction\");\nvar AsyncScheduler_1 = require(\"./AsyncScheduler\");\nexports.asyncScheduler = new AsyncScheduler_1.AsyncScheduler(AsyncAction_1.AsyncAction);\nexports.async = exports.asyncScheduler;\n//# sourceMappingURL=async.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar QueueAction_1 = require(\"./QueueAction\");\nvar QueueScheduler_1 = require(\"./QueueScheduler\");\nexports.queueScheduler = new QueueScheduler_1.QueueScheduler(QueueAction_1.QueueAction);\nexports.queue = exports.queueScheduler;\n//# sourceMappingURL=queue.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction getSymbolIterator() {\n if (typeof Symbol !== 'function' || !Symbol.iterator) {\n return '@@iterator';\n }\n return Symbol.iterator;\n}\nexports.getSymbolIterator = getSymbolIterator;\nexports.iterator = getSymbolIterator();\nexports.$$iterator = exports.iterator;\n//# sourceMappingURL=iterator.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.observable = (function () { return typeof Symbol === 'function' && Symbol.observable || '@@observable'; })();\n//# sourceMappingURL=observable.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.rxSubscriber = (function () {\n return typeof Symbol === 'function'\n ? Symbol('rxSubscriber')\n : '@@rxSubscriber_' + Math.random();\n})();\nexports.$$rxSubscriber = exports.rxSubscriber;\n//# sourceMappingURL=rxSubscriber.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ArgumentOutOfRangeErrorImpl = (function () {\n function ArgumentOutOfRangeErrorImpl() {\n Error.call(this);\n this.message = 'argument out of range';\n this.name = 'ArgumentOutOfRangeError';\n return this;\n }\n ArgumentOutOfRangeErrorImpl.prototype = Object.create(Error.prototype);\n return ArgumentOutOfRangeErrorImpl;\n})();\nexports.ArgumentOutOfRangeError = ArgumentOutOfRangeErrorImpl;\n//# sourceMappingURL=ArgumentOutOfRangeError.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar EmptyErrorImpl = (function () {\n function EmptyErrorImpl() {\n Error.call(this);\n this.message = 'no elements in sequence';\n this.name = 'EmptyError';\n return this;\n }\n EmptyErrorImpl.prototype = Object.create(Error.prototype);\n return EmptyErrorImpl;\n})();\nexports.EmptyError = EmptyErrorImpl;\n//# sourceMappingURL=EmptyError.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar nextHandle = 1;\nvar RESOLVED = (function () { return Promise.resolve(); })();\nvar activeHandles = {};\nfunction findAndClearHandle(handle) {\n if (handle in activeHandles) {\n delete activeHandles[handle];\n return true;\n }\n return false;\n}\nexports.Immediate = {\n setImmediate: function (cb) {\n var handle = nextHandle++;\n activeHandles[handle] = true;\n RESOLVED.then(function () { return findAndClearHandle(handle) && cb(); });\n return handle;\n },\n clearImmediate: function (handle) {\n findAndClearHandle(handle);\n },\n};\nexports.TestTools = {\n pending: function () {\n return Object.keys(activeHandles).length;\n }\n};\n//# sourceMappingURL=Immediate.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ObjectUnsubscribedErrorImpl = (function () {\n function ObjectUnsubscribedErrorImpl() {\n Error.call(this);\n this.message = 'object unsubscribed';\n this.name = 'ObjectUnsubscribedError';\n return this;\n }\n ObjectUnsubscribedErrorImpl.prototype = Object.create(Error.prototype);\n return ObjectUnsubscribedErrorImpl;\n})();\nexports.ObjectUnsubscribedError = ObjectUnsubscribedErrorImpl;\n//# sourceMappingURL=ObjectUnsubscribedError.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar TimeoutErrorImpl = (function () {\n function TimeoutErrorImpl() {\n Error.call(this);\n this.message = 'Timeout has occurred';\n this.name = 'TimeoutError';\n return this;\n }\n TimeoutErrorImpl.prototype = Object.create(Error.prototype);\n return TimeoutErrorImpl;\n})();\nexports.TimeoutError = TimeoutErrorImpl;\n//# sourceMappingURL=TimeoutError.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar UnsubscriptionErrorImpl = (function () {\n function UnsubscriptionErrorImpl(errors) {\n Error.call(this);\n this.message = errors ?\n errors.length + \" errors occurred during unsubscription:\\n\" + errors.map(function (err, i) { return i + 1 + \") \" + err.toString(); }).join('\\n ') : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n return this;\n }\n UnsubscriptionErrorImpl.prototype = Object.create(Error.prototype);\n return UnsubscriptionErrorImpl;\n})();\nexports.UnsubscriptionError = UnsubscriptionErrorImpl;\n//# sourceMappingURL=UnsubscriptionError.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nfunction canReportError(observer) {\n while (observer) {\n var _a = observer, closed_1 = _a.closed, destination = _a.destination, isStopped = _a.isStopped;\n if (closed_1 || isStopped) {\n return false;\n }\n else if (destination && destination instanceof Subscriber_1.Subscriber) {\n observer = destination;\n }\n else {\n observer = null;\n }\n }\n return true;\n}\nexports.canReportError = canReportError;\n//# sourceMappingURL=canReportError.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction hostReportError(err) {\n setTimeout(function () { throw err; }, 0);\n}\nexports.hostReportError = hostReportError;\n//# sourceMappingURL=hostReportError.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction identity(x) {\n return x;\n}\nexports.identity = identity;\n//# sourceMappingURL=identity.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isArray = (function () { return Array.isArray || (function (x) { return x && typeof x.length === 'number'; }); })();\n//# sourceMappingURL=isArray.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isArrayLike = (function (x) { return x && typeof x.length === 'number' && typeof x !== 'function'; });\n//# sourceMappingURL=isArrayLike.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction isDate(value) {\n return value instanceof Date && !isNaN(+value);\n}\nexports.isDate = isDate;\n//# sourceMappingURL=isDate.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction isFunction(x) {\n return typeof x === 'function';\n}\nexports.isFunction = isFunction;\n//# sourceMappingURL=isFunction.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar observable_1 = require(\"../symbol/observable\");\nfunction isInteropObservable(input) {\n return input && typeof input[observable_1.observable] === 'function';\n}\nexports.isInteropObservable = isInteropObservable;\n//# sourceMappingURL=isInteropObservable.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar iterator_1 = require(\"../symbol/iterator\");\nfunction isIterable(input) {\n return input && typeof input[iterator_1.iterator] === 'function';\n}\nexports.isIterable = isIterable;\n//# sourceMappingURL=isIterable.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar isArray_1 = require(\"./isArray\");\nfunction isNumeric(val) {\n return !isArray_1.isArray(val) && (val - parseFloat(val) + 1) >= 0;\n}\nexports.isNumeric = isNumeric;\n//# sourceMappingURL=isNumeric.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction isObject(x) {\n return x !== null && typeof x === 'object';\n}\nexports.isObject = isObject;\n//# sourceMappingURL=isObject.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction isPromise(value) {\n return !!value && typeof value.subscribe !== 'function' && typeof value.then === 'function';\n}\nexports.isPromise = isPromise;\n//# sourceMappingURL=isPromise.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction isScheduler(value) {\n return value && typeof value.schedule === 'function';\n}\nexports.isScheduler = isScheduler;\n//# sourceMappingURL=isScheduler.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction noop() { }\nexports.noop = noop;\n//# sourceMappingURL=noop.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction not(pred, thisArg) {\n function notPred() {\n return !(notPred.pred.apply(notPred.thisArg, arguments));\n }\n notPred.pred = pred;\n notPred.thisArg = thisArg;\n return notPred;\n}\nexports.not = not;\n//# sourceMappingURL=not.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar identity_1 = require(\"./identity\");\nfunction pipe() {\n var fns = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n fns[_i] = arguments[_i];\n }\n return pipeFromArray(fns);\n}\nexports.pipe = pipe;\nfunction pipeFromArray(fns) {\n if (fns.length === 0) {\n return identity_1.identity;\n }\n if (fns.length === 1) {\n return fns[0];\n }\n return function piped(input) {\n return fns.reduce(function (prev, fn) { return fn(prev); }, input);\n };\n}\nexports.pipeFromArray = pipeFromArray;\n//# sourceMappingURL=pipe.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar subscribeToArray_1 = require(\"./subscribeToArray\");\nvar subscribeToPromise_1 = require(\"./subscribeToPromise\");\nvar subscribeToIterable_1 = require(\"./subscribeToIterable\");\nvar subscribeToObservable_1 = require(\"./subscribeToObservable\");\nvar isArrayLike_1 = require(\"./isArrayLike\");\nvar isPromise_1 = require(\"./isPromise\");\nvar isObject_1 = require(\"./isObject\");\nvar iterator_1 = require(\"../symbol/iterator\");\nvar observable_1 = require(\"../symbol/observable\");\nexports.subscribeTo = function (result) {\n if (!!result && typeof result[observable_1.observable] === 'function') {\n return subscribeToObservable_1.subscribeToObservable(result);\n }\n else if (isArrayLike_1.isArrayLike(result)) {\n return subscribeToArray_1.subscribeToArray(result);\n }\n else if (isPromise_1.isPromise(result)) {\n return subscribeToPromise_1.subscribeToPromise(result);\n }\n else if (!!result && typeof result[iterator_1.iterator] === 'function') {\n return subscribeToIterable_1.subscribeToIterable(result);\n }\n else {\n var value = isObject_1.isObject(result) ? 'an invalid object' : \"'\" + result + \"'\";\n var msg = \"You provided \" + value + \" where a stream was expected.\"\n + ' You can provide an Observable, Promise, Array, or Iterable.';\n throw new TypeError(msg);\n }\n};\n//# sourceMappingURL=subscribeTo.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.subscribeToArray = function (array) { return function (subscriber) {\n for (var i = 0, len = array.length; i < len && !subscriber.closed; i++) {\n subscriber.next(array[i]);\n }\n subscriber.complete();\n}; };\n//# sourceMappingURL=subscribeToArray.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar iterator_1 = require(\"../symbol/iterator\");\nexports.subscribeToIterable = function (iterable) { return function (subscriber) {\n var iterator = iterable[iterator_1.iterator]();\n do {\n var item = void 0;\n try {\n item = iterator.next();\n }\n catch (err) {\n subscriber.error(err);\n return subscriber;\n }\n if (item.done) {\n subscriber.complete();\n break;\n }\n subscriber.next(item.value);\n if (subscriber.closed) {\n break;\n }\n } while (true);\n if (typeof iterator.return === 'function') {\n subscriber.add(function () {\n if (iterator.return) {\n iterator.return();\n }\n });\n }\n return subscriber;\n}; };\n//# sourceMappingURL=subscribeToIterable.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar observable_1 = require(\"../symbol/observable\");\nexports.subscribeToObservable = function (obj) { return function (subscriber) {\n var obs = obj[observable_1.observable]();\n if (typeof obs.subscribe !== 'function') {\n throw new TypeError('Provided object does not correctly implement Symbol.observable');\n }\n else {\n return obs.subscribe(subscriber);\n }\n}; };\n//# sourceMappingURL=subscribeToObservable.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar hostReportError_1 = require(\"./hostReportError\");\nexports.subscribeToPromise = function (promise) { return function (subscriber) {\n promise.then(function (value) {\n if (!subscriber.closed) {\n subscriber.next(value);\n subscriber.complete();\n }\n }, function (err) { return subscriber.error(err); })\n .then(null, hostReportError_1.hostReportError);\n return subscriber;\n}; };\n//# sourceMappingURL=subscribeToPromise.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar InnerSubscriber_1 = require(\"../InnerSubscriber\");\nvar subscribeTo_1 = require(\"./subscribeTo\");\nvar Observable_1 = require(\"../Observable\");\nfunction subscribeToResult(outerSubscriber, result, outerValue, outerIndex, innerSubscriber) {\n if (innerSubscriber === void 0) { innerSubscriber = new InnerSubscriber_1.InnerSubscriber(outerSubscriber, outerValue, outerIndex); }\n if (innerSubscriber.closed) {\n return undefined;\n }\n if (result instanceof Observable_1.Observable) {\n return result.subscribe(innerSubscriber);\n }\n return subscribeTo_1.subscribeTo(result)(innerSubscriber);\n}\nexports.subscribeToResult = subscribeToResult;\n//# sourceMappingURL=subscribeToResult.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Subscriber_1 = require(\"../Subscriber\");\nvar rxSubscriber_1 = require(\"../symbol/rxSubscriber\");\nvar Observer_1 = require(\"../Observer\");\nfunction toSubscriber(nextOrObserver, error, complete) {\n if (nextOrObserver) {\n if (nextOrObserver instanceof Subscriber_1.Subscriber) {\n return nextOrObserver;\n }\n if (nextOrObserver[rxSubscriber_1.rxSubscriber]) {\n return nextOrObserver[rxSubscriber_1.rxSubscriber]();\n }\n }\n if (!nextOrObserver && !error && !complete) {\n return new Subscriber_1.Subscriber(Observer_1.empty);\n }\n return new Subscriber_1.Subscriber(nextOrObserver, error, complete);\n}\nexports.toSubscriber = toSubscriber;\n//# sourceMappingURL=toSubscriber.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar audit_1 = require(\"../internal/operators/audit\");\nexports.audit = audit_1.audit;\nvar auditTime_1 = require(\"../internal/operators/auditTime\");\nexports.auditTime = auditTime_1.auditTime;\nvar buffer_1 = require(\"../internal/operators/buffer\");\nexports.buffer = buffer_1.buffer;\nvar bufferCount_1 = require(\"../internal/operators/bufferCount\");\nexports.bufferCount = bufferCount_1.bufferCount;\nvar bufferTime_1 = require(\"../internal/operators/bufferTime\");\nexports.bufferTime = bufferTime_1.bufferTime;\nvar bufferToggle_1 = require(\"../internal/operators/bufferToggle\");\nexports.bufferToggle = bufferToggle_1.bufferToggle;\nvar bufferWhen_1 = require(\"../internal/operators/bufferWhen\");\nexports.bufferWhen = bufferWhen_1.bufferWhen;\nvar catchError_1 = require(\"../internal/operators/catchError\");\nexports.catchError = catchError_1.catchError;\nvar combineAll_1 = require(\"../internal/operators/combineAll\");\nexports.combineAll = combineAll_1.combineAll;\nvar combineLatest_1 = require(\"../internal/operators/combineLatest\");\nexports.combineLatest = combineLatest_1.combineLatest;\nvar concat_1 = require(\"../internal/operators/concat\");\nexports.concat = concat_1.concat;\nvar concatAll_1 = require(\"../internal/operators/concatAll\");\nexports.concatAll = concatAll_1.concatAll;\nvar concatMap_1 = require(\"../internal/operators/concatMap\");\nexports.concatMap = concatMap_1.concatMap;\nvar concatMapTo_1 = require(\"../internal/operators/concatMapTo\");\nexports.concatMapTo = concatMapTo_1.concatMapTo;\nvar count_1 = require(\"../internal/operators/count\");\nexports.count = count_1.count;\nvar debounce_1 = require(\"../internal/operators/debounce\");\nexports.debounce = debounce_1.debounce;\nvar debounceTime_1 = require(\"../internal/operators/debounceTime\");\nexports.debounceTime = debounceTime_1.debounceTime;\nvar defaultIfEmpty_1 = require(\"../internal/operators/defaultIfEmpty\");\nexports.defaultIfEmpty = defaultIfEmpty_1.defaultIfEmpty;\nvar delay_1 = require(\"../internal/operators/delay\");\nexports.delay = delay_1.delay;\nvar delayWhen_1 = require(\"../internal/operators/delayWhen\");\nexports.delayWhen = delayWhen_1.delayWhen;\nvar dematerialize_1 = require(\"../internal/operators/dematerialize\");\nexports.dematerialize = dematerialize_1.dematerialize;\nvar distinct_1 = require(\"../internal/operators/distinct\");\nexports.distinct = distinct_1.distinct;\nvar distinctUntilChanged_1 = require(\"../internal/operators/distinctUntilChanged\");\nexports.distinctUntilChanged = distinctUntilChanged_1.distinctUntilChanged;\nvar distinctUntilKeyChanged_1 = require(\"../internal/operators/distinctUntilKeyChanged\");\nexports.distinctUntilKeyChanged = distinctUntilKeyChanged_1.distinctUntilKeyChanged;\nvar elementAt_1 = require(\"../internal/operators/elementAt\");\nexports.elementAt = elementAt_1.elementAt;\nvar endWith_1 = require(\"../internal/operators/endWith\");\nexports.endWith = endWith_1.endWith;\nvar every_1 = require(\"../internal/operators/every\");\nexports.every = every_1.every;\nvar exhaust_1 = require(\"../internal/operators/exhaust\");\nexports.exhaust = exhaust_1.exhaust;\nvar exhaustMap_1 = require(\"../internal/operators/exhaustMap\");\nexports.exhaustMap = exhaustMap_1.exhaustMap;\nvar expand_1 = require(\"../internal/operators/expand\");\nexports.expand = expand_1.expand;\nvar filter_1 = require(\"../internal/operators/filter\");\nexports.filter = filter_1.filter;\nvar finalize_1 = require(\"../internal/operators/finalize\");\nexports.finalize = finalize_1.finalize;\nvar find_1 = require(\"../internal/operators/find\");\nexports.find = find_1.find;\nvar findIndex_1 = require(\"../internal/operators/findIndex\");\nexports.findIndex = findIndex_1.findIndex;\nvar first_1 = require(\"../internal/operators/first\");\nexports.first = first_1.first;\nvar groupBy_1 = require(\"../internal/operators/groupBy\");\nexports.groupBy = groupBy_1.groupBy;\nvar ignoreElements_1 = require(\"../internal/operators/ignoreElements\");\nexports.ignoreElements = ignoreElements_1.ignoreElements;\nvar isEmpty_1 = require(\"../internal/operators/isEmpty\");\nexports.isEmpty = isEmpty_1.isEmpty;\nvar last_1 = require(\"../internal/operators/last\");\nexports.last = last_1.last;\nvar map_1 = require(\"../internal/operators/map\");\nexports.map = map_1.map;\nvar mapTo_1 = require(\"../internal/operators/mapTo\");\nexports.mapTo = mapTo_1.mapTo;\nvar materialize_1 = require(\"../internal/operators/materialize\");\nexports.materialize = materialize_1.materialize;\nvar max_1 = require(\"../internal/operators/max\");\nexports.max = max_1.max;\nvar merge_1 = require(\"../internal/operators/merge\");\nexports.merge = merge_1.merge;\nvar mergeAll_1 = require(\"../internal/operators/mergeAll\");\nexports.mergeAll = mergeAll_1.mergeAll;\nvar mergeMap_1 = require(\"../internal/operators/mergeMap\");\nexports.mergeMap = mergeMap_1.mergeMap;\nexports.flatMap = mergeMap_1.flatMap;\nvar mergeMapTo_1 = require(\"../internal/operators/mergeMapTo\");\nexports.mergeMapTo = mergeMapTo_1.mergeMapTo;\nvar mergeScan_1 = require(\"../internal/operators/mergeScan\");\nexports.mergeScan = mergeScan_1.mergeScan;\nvar min_1 = require(\"../internal/operators/min\");\nexports.min = min_1.min;\nvar multicast_1 = require(\"../internal/operators/multicast\");\nexports.multicast = multicast_1.multicast;\nvar observeOn_1 = require(\"../internal/operators/observeOn\");\nexports.observeOn = observeOn_1.observeOn;\nvar onErrorResumeNext_1 = require(\"../internal/operators/onErrorResumeNext\");\nexports.onErrorResumeNext = onErrorResumeNext_1.onErrorResumeNext;\nvar pairwise_1 = require(\"../internal/operators/pairwise\");\nexports.pairwise = pairwise_1.pairwise;\nvar partition_1 = require(\"../internal/operators/partition\");\nexports.partition = partition_1.partition;\nvar pluck_1 = require(\"../internal/operators/pluck\");\nexports.pluck = pluck_1.pluck;\nvar publish_1 = require(\"../internal/operators/publish\");\nexports.publish = publish_1.publish;\nvar publishBehavior_1 = require(\"../internal/operators/publishBehavior\");\nexports.publishBehavior = publishBehavior_1.publishBehavior;\nvar publishLast_1 = require(\"../internal/operators/publishLast\");\nexports.publishLast = publishLast_1.publishLast;\nvar publishReplay_1 = require(\"../internal/operators/publishReplay\");\nexports.publishReplay = publishReplay_1.publishReplay;\nvar race_1 = require(\"../internal/operators/race\");\nexports.race = race_1.race;\nvar reduce_1 = require(\"../internal/operators/reduce\");\nexports.reduce = reduce_1.reduce;\nvar repeat_1 = require(\"../internal/operators/repeat\");\nexports.repeat = repeat_1.repeat;\nvar repeatWhen_1 = require(\"../internal/operators/repeatWhen\");\nexports.repeatWhen = repeatWhen_1.repeatWhen;\nvar retry_1 = require(\"../internal/operators/retry\");\nexports.retry = retry_1.retry;\nvar retryWhen_1 = require(\"../internal/operators/retryWhen\");\nexports.retryWhen = retryWhen_1.retryWhen;\nvar refCount_1 = require(\"../internal/operators/refCount\");\nexports.refCount = refCount_1.refCount;\nvar sample_1 = require(\"../internal/operators/sample\");\nexports.sample = sample_1.sample;\nvar sampleTime_1 = require(\"../internal/operators/sampleTime\");\nexports.sampleTime = sampleTime_1.sampleTime;\nvar scan_1 = require(\"../internal/operators/scan\");\nexports.scan = scan_1.scan;\nvar sequenceEqual_1 = require(\"../internal/operators/sequenceEqual\");\nexports.sequenceEqual = sequenceEqual_1.sequenceEqual;\nvar share_1 = require(\"../internal/operators/share\");\nexports.share = share_1.share;\nvar shareReplay_1 = require(\"../internal/operators/shareReplay\");\nexports.shareReplay = shareReplay_1.shareReplay;\nvar single_1 = require(\"../internal/operators/single\");\nexports.single = single_1.single;\nvar skip_1 = require(\"../internal/operators/skip\");\nexports.skip = skip_1.skip;\nvar skipLast_1 = require(\"../internal/operators/skipLast\");\nexports.skipLast = skipLast_1.skipLast;\nvar skipUntil_1 = require(\"../internal/operators/skipUntil\");\nexports.skipUntil = skipUntil_1.skipUntil;\nvar skipWhile_1 = require(\"../internal/operators/skipWhile\");\nexports.skipWhile = skipWhile_1.skipWhile;\nvar startWith_1 = require(\"../internal/operators/startWith\");\nexports.startWith = startWith_1.startWith;\nvar subscribeOn_1 = require(\"../internal/operators/subscribeOn\");\nexports.subscribeOn = subscribeOn_1.subscribeOn;\nvar switchAll_1 = require(\"../internal/operators/switchAll\");\nexports.switchAll = switchAll_1.switchAll;\nvar switchMap_1 = require(\"../internal/operators/switchMap\");\nexports.switchMap = switchMap_1.switchMap;\nvar switchMapTo_1 = require(\"../internal/operators/switchMapTo\");\nexports.switchMapTo = switchMapTo_1.switchMapTo;\nvar take_1 = require(\"../internal/operators/take\");\nexports.take = take_1.take;\nvar takeLast_1 = require(\"../internal/operators/takeLast\");\nexports.takeLast = takeLast_1.takeLast;\nvar takeUntil_1 = require(\"../internal/operators/takeUntil\");\nexports.takeUntil = takeUntil_1.takeUntil;\nvar takeWhile_1 = require(\"../internal/operators/takeWhile\");\nexports.takeWhile = takeWhile_1.takeWhile;\nvar tap_1 = require(\"../internal/operators/tap\");\nexports.tap = tap_1.tap;\nvar throttle_1 = require(\"../internal/operators/throttle\");\nexports.throttle = throttle_1.throttle;\nvar throttleTime_1 = require(\"../internal/operators/throttleTime\");\nexports.throttleTime = throttleTime_1.throttleTime;\nvar throwIfEmpty_1 = require(\"../internal/operators/throwIfEmpty\");\nexports.throwIfEmpty = throwIfEmpty_1.throwIfEmpty;\nvar timeInterval_1 = require(\"../internal/operators/timeInterval\");\nexports.timeInterval = timeInterval_1.timeInterval;\nvar timeout_1 = require(\"../internal/operators/timeout\");\nexports.timeout = timeout_1.timeout;\nvar timeoutWith_1 = require(\"../internal/operators/timeoutWith\");\nexports.timeoutWith = timeoutWith_1.timeoutWith;\nvar timestamp_1 = require(\"../internal/operators/timestamp\");\nexports.timestamp = timestamp_1.timestamp;\nvar toArray_1 = require(\"../internal/operators/toArray\");\nexports.toArray = toArray_1.toArray;\nvar window_1 = require(\"../internal/operators/window\");\nexports.window = window_1.window;\nvar windowCount_1 = require(\"../internal/operators/windowCount\");\nexports.windowCount = windowCount_1.windowCount;\nvar windowTime_1 = require(\"../internal/operators/windowTime\");\nexports.windowTime = windowTime_1.windowTime;\nvar windowToggle_1 = require(\"../internal/operators/windowToggle\");\nexports.windowToggle = windowToggle_1.windowToggle;\nvar windowWhen_1 = require(\"../internal/operators/windowWhen\");\nexports.windowWhen = windowWhen_1.windowWhen;\nvar withLatestFrom_1 = require(\"../internal/operators/withLatestFrom\");\nexports.withLatestFrom = withLatestFrom_1.withLatestFrom;\nvar zip_1 = require(\"../internal/operators/zip\");\nexports.zip = zip_1.zip;\nvar zipAll_1 = require(\"../internal/operators/zipAll\");\nexports.zipAll = zipAll_1.zipAll;\n//# sourceMappingURL=index.js.map"],"preExistingComment":"//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY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1xuICAgICAgICB0aGlzLnZhbHVlID0gdmFsdWU7XG4gICAgICAgIHRoaXMuZXJyb3IgPSBlcnJvcjtcbiAgICAgICAgdGhpcy5oYXNWYWx1ZSA9IGtpbmQgPT09ICdOJztcbiAgICB9XG4gICAgTm90aWZpY2F0aW9uLnByb3RvdHlwZS5vYnNlcnZlID0gZnVuY3Rpb24gKG9ic2VydmVyKSB7XG4gICAgICAgIHN3aXRjaCAodGhpcy5raW5kKSB7XG4gICAgICAgICAgICBjYXNlICdOJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gb2JzZXJ2ZXIubmV4dCAmJiBvYnNlcnZlci5uZXh0KHRoaXMudmFsdWUpO1xuICAgICAgICAgICAgY2FzZSAnRSc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIG9ic2VydmVyLmVycm9yICYmIG9ic2VydmVyLmVycm9yKHRoaXMuZXJyb3IpO1xuICAgICAgICAgICAgY2FzZSAnQyc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIG9ic2VydmVyLmNvbXBsZXRlICYmIG9ic2VydmVyLmNvbXBsZXRlKCk7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIE5vdGlmaWNhdGlvbi5wcm90b3R5cGUuZG8gPSBmdW5jdGlvbiAobmV4dCwgZXJyb3IsIGNvbXBsZXRlKSB7XG4gICAgICAgIHZhciBraW5kID0gdGhpcy5raW5kO1xuICAgICAgICBzd2l0Y2ggKGtpbmQpIHtcbiAgICAgICAgICAgIGNhc2UgJ04nOlxuICAgICAgICAgICAgICAgIHJldHVybiBuZXh0ICYmIG5leHQodGhpcy52YWx1ZSk7XG4gICAgICAgICAgICBjYXNlICdFJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gZXJyb3IgJiYgZXJyb3IodGhpcy5lcnJvcik7XG4gICAgICAgICAgICBjYXNlICdDJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gY29tcGxldGUgJiYgY29tcGxldGUoKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgT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NpbmsuYWRkKHRoaXMuc291cmNlIHx8IChjb25maWdfMS5jb25maWcudXNlRGVwcmVjYXRlZFN5bmNocm9ub3VzRXJyb3JIYW5kbGluZyAmJiAhc2luay5zeW5jRXJyb3JUaHJvd2FibGUpID9cbiAgICAgICAgICAgICAgICB0aGlzLl9zdWJzY3JpYmUoc2luaykgOlxuICAgICAgICAgICAgICAgIHRoaXMuX3RyeVN1YnNjcmliZShzaW5rKSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGNvbmZpZ18xLmNvbmZpZy51c2VEZXByZWNhdGVkU3luY2hyb25vdXNFcnJvckhhbmRsaW5nKSB7XG4gICAgICAgICAgICBpZiAoc2luay5zeW5jRXJyb3JUaHJvd2FibGUpIHtcbiAgICAgICAgICAgICAgICBzaW5rLnN5bmNFcnJvclRocm93YWJsZSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIGlmIChzaW5rLnN5bmNFcnJvclRocm93bikge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBzaW5rLnN5bmNFcnJvclZhbHVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gc2luaztcbiAgICB9O1xuICAgIE9ic2VydmFibGUucHJvdG90eXBlLl90cnlTdWJzY3JpYmUgPSBmdW5jdGlvbiAoc2luaykge1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX3N1YnNjcmliZShzaW5rKTtcbiAgICAgICAgfVxuICAgICAgICBjYXRjaCAoZXJyKSB7XG4gICAgICAgICAgICBpZiAoY29uZmlnXzEuY29uZmlnLnVzZURlcHJlY2F0ZWRTeW5jaHJvbm91c0Vycm9ySGFuZGxpbmcpIHtcbiAgICAgICAgICAgICAgICBzaW5rLnN5bmNFcnJvclRocm93biA9IHRydWU7XG4gICAgICAgICAgICAgICAgc2luay5zeW5jRXJyb3JWYWx1ZSA9IGVycjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChjYW5SZXBvcnRFcnJvcl8xLmNhblJlcG9ydEVycm9yKHNpbmspKSB7XG4gICAgICAgICAgICAgICAgc2luay5lcnJvcihlcnIpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgY29uc29sZS53YXJuKGVycik7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xuICAgIE9ic2VydmFibGUucHJvdG90eXBlLmZvckVhY2ggPSBmdW5jdGlvbiAobmV4dCwgcHJvbWlzZUN0b3IpIHtcbiAgICAgICAgdmFyIF90aGlzID0gdGhpcztcbiAgICAgICAgcHJvbWlzZUN0b3IgPSBnZXRQcm9taXNlQ3Rvcihwcm9taXNlQ3Rvcik7XG4gICAgICAgIHJldHVybiBuZXcgcHJvbWlzZUN0b3IoZnVuY3Rpb24gKHJlc29sdmUsIHJlamVjdCkge1xuICAgICAgICAgICAgdmFyIHN1YnNjcmlwdGlvbjtcbiAgICAgICAgICAgIHN1YnNjcmlwdGlvbiA9IF90aGlzLnN1YnNjcmliZShmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICBuZXh0KHZhbHVlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY2F0Y2ggKGVycikge1xuICAgICAgICAgICAgICAgICAgICByZWplY3QoZXJyKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHN1YnNjcmlwdGlvbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgc3Vic2NyaXB0aW9uLnVuc3Vic2NyaWJlKCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LCByZWplY3QsIHJlc29sdmUpO1xuICAgICAgICB9KTtcbiAgICB9O1xuICAgIE9ic2VydmFibGUucHJvdG90eXBlLl9zdWJzY3JpYmUgPSBmdW5jdGlvbiAoc3Vic2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AgICAgIF90aGlzLl93aW5kb3dUaW1lID0gd2luZG93VGltZSA8IDEgPyAxIDogd2luZG93VGltZTtcbiAgICAgICAgaWYgKHdpbmRvd1RpbWUgPT09IE51bWJlci5QT1NJVElWRV9JTkZJTklUWSkge1xuICAgICAgICAgICAgX3RoaXMuX2luZmluaXRlVGltZVdpbmRvdyA9IHRydWU7XG4gICAgICAgICAgICBfdGhpcy5uZXh0ID0gX3RoaXMubmV4dEluZmluaXRlVGltZVdpbmRvdztcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIF90aGlzLm5leHQgPSBfdGhpcy5uZXh0VGltZVdpbmRvdztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gX3RoaXM7XG4gICAgfVxuICAgIFJlcGxheVN1YmplY3QucHJvdG90eXBlLm5leHRJbmZpbml0ZVRpbWVXaW5kb3cgPSBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgaWYgKCF0aGlzLmlzU3RvcHBlZCkge1xuICAgICAgICAgICAgdmFyIF9ldmVudHMgPSB0aGlzLl9ldmVudHM7XG4gICAgICAgICAgICBfZXZlbnRzLnB1c2godmFsdWUpO1xuICAgICAgICAgICAgaWYgKF9ldmVudHMubGVuZ3RoID4gdGhpcy5fYnVmZmVyU2l6ZSkge1xuICAgICAgICAgICAgICAgIF9ldmVudHMuc2hpZnQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBfc3VwZXIucHJvdG90eXBlLm5leHQuY2FsbCh0aGlzLCB2YWx1ZSk7XG4gICAgfTtcbiAgICBSZXBsYXlTdWJqZWN0LnByb3RvdHlwZS5uZXh0VGltZVdpbmRvdyA9IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICBpZiAoIXRoaXMuaXNTdG9wcGVkKSB7XG4gICAgICAgICAgICB0aGlzLl9ldmVudHMucHVzaChuZXcgUmVwbGF5RXZlbnQodGhpcy5fZ2V0Tm93KCksIHZhbHVlKSk7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ICAgICB9XG4gICAgICAgIGlmIChzY2hlZHVsZXIpIHtcbiAgICAgICAgICAgIHN1YnNjcmliZXIuYWRkKHN1YnNjcmliZXIgPSBuZXcgb2JzZXJ2ZU9uXzEuT2JzZXJ2ZU9uU3Vic2NyaWJlcihzdWJzY3JpYmVyLCBzY2hlZHVsZXIpKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoX2luZmluaXRlVGltZVdpbmRvdykge1xuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBsZW4gJiYgIXN1YnNjcmliZXIuY2xvc2VkOyBpKyspIHtcbiAgICAgICAgICAgICAgICBzdWJzY3JpYmVyLm5leHQoX2V2ZW50c1tpXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxlbiAmJiAhc3Vic2NyaWJlci5jbG9zZWQ7IGkrKykge1xuICAgICAgICAgICAgICAgIHN1YnNjcmliZXIubmV4dChfZXZlbnRzW2ldLnZhbHVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAodGhpcy5oYXNFcnJvcikge1xuICAgICAgICAgICAgc3Vic2NyaWJlci5lcnJvcih0aGlzLnRocm93bkVycm9yKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmICh0aGlzLmlzU3RvcHBlZCkge1xuICAgICAgICAgICAgc3Vic2NyaWJlci5jb21wbGV0ZSgpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBzdWJzY3JpcHRpb247XG4gICAgfTtcbiAgICBSZXBsYXlTdWJqZWN0LnByb3RvdHlwZS5fZ2V0Tm93ID0gZnVuY3Rpb24gKCkge1xuICAgICAgICByZXR1cm4gKHRoaXMuc2NoZWR1bGVyIHx8IHF1ZXVlXzEucXVldWUpLm5vdygpO1xuICAgIH07XG4gICAgUmVwbGF5U3ViamVjdC5wcm90b3R5cGUuX3RyaW1CdWZmZXJUaGVuR2V0RXZlbnRzID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgbm93ID0gdGhpcy5fZ2V0Tm93KCk7XG4gICAgICAgIHZhciBfYnVmZmVyU2l6ZSA9IHRoaXMuX2J1ZmZlclNpemU7XG4gICAgICAgIHZhciBfd2luZG93VGltZSA9IHRoaXMuX3dpbmRvd1RpbWU7XG4gICAgICAgIHZhciBfZXZlbnRzID0gdGhpcy5fZXZlbnRzO1xuICAgICAgICB2YXIgZXZlbnRzQ291bnQgPSBfZXZlbnRzLmxlbmd0aDtcbiAgICAgICAgdmFyIHNwbGljZUNvdW50ID0gMDtcbiAgICAgICAgd2hpbGUgKHNwbGljZUNvdW50IDwgZXZlbnRzQ291bnQpIHtcbiAgICAgICAgICAgIGlmICgobm93IC0gX2V2ZW50c1tzcGxpY2VDb3VudF0udGltZSkgPCBfd2luZG93VGltZSkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgc3BsaWNlQ291bnQrKztcbiAgICAgICAgfVxuICAgICAgICBpZiAoZXZlbnRzQ291bnQgPiBfYnVmZmVyU2l6ZSkge1xuICAgICAgICAgICAgc3BsaWNlQ291bnQgPSBNYXRoLm1heChzcGxpY2VDb3VudCwgZXZlbnRzQ291bnQgLSBfYnVmZmVyU2l6ZSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHNwbGljZUNvdW50ID4gMCkge1xuICAgICAgICAgICAgX2V2ZW50cy5zcGxpY2UoMCwgc3BsaWNlQ291bnQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBfZXZlbnRzO1xuICAgIH07XG4gICAgcmV0dXJuIFJlcGxheVN1YmplY3Q7XG59KFN1YmplY3RfMS5TdWJqZWN0KSk7XG5leHBvcnRzLlJlcGxheVN1YmplY3QgPSBSZXBsYXlTdWJqZWN0O1xudmFyIFJlcGxheUV2ZW50ID0gKGZ1bmN0aW9uICgpIHtcbiAgICBmdW5jdGlvb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Bbm9ueW1vdXNTdWJqZWN0KGRlc3RpbmF0aW9uLCBzb3VyY2UpIHtcbiAgICAgICAgdmFyIF90aGlzID0gX3N1cGVyLmNhbGwodGhpcykgfHwgdGhpcztcbiAgICAgICAgX3RoaXMuZGVzdGluYXRpb24gPSBkZXN0aW5hdGlvbjtcbiAgICAgICAgX3RoaXMuc291cmNlID0gc291cmNlO1xuICAgICAgICByZXR1cm4gX3RoaXM7XG4gICAgfVxuICAgIEFub255bW91c1N1YmplY3QucHJvdG90eXBlLm5leHQgPSBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgdmFyIGRlc3RpbmF0aW9uID0gdGhpcy5kZXN0aW5hdGlvbjtcbiAgICAgICAgaWYgKGRlc3RpbmF0aW9uICYmIGRlc3RpbmF0aW9uLm5leHQpIHtcbiAgICAgICAgICAgIGRlc3RpbmF0aW9uLm5leHQodmFsdWUpO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBBbm9ueW1vdXNTdWJqZWN0LnByb3RvdHlwZS5lcnJvciA9IGZ1bmN0aW9uIChlcnIpIHtcbiAgICAgICAgdmFyIGRlc3RpbmF0aW9uID0gdGhpcy5kZXN0aW5hdGlvbjtcbiAgICAgICAgaWYgKGRlc3RpbmF0aW9uICYmIGRlc3RpbmF0aW9uLmVycm9yKSB7XG4gICAgICAgICAgICB0aGlzLmRlc3RpbmF0aW9uLmVycm9yKGVycik7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIEFub255bW91c1N1YmplY3QucHJvdG90eXBlLmNvbXBsZXRlID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgZGVzdGluYXRpb24gPSB0aGlzLmRlc3RpbmF0aW9uO1xuICAgICAgICBpZiAoZGVzdGluYXRpb24gJiYgZGVzdGluYXRpb24uY29tcGxldGUpIHtcbiAgICAgICAgICAgIHRoaXMuZGVzdGluYXRpb24uY29tcGxldGUoKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgQW5vbnltb3VzU3ViamVjdC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0aW5hdGlvbk9yTmV4dCwgZXJyb3IsIGNvbXBsZXRlKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IF9zdXBlci5jYWxsKHRoaXMpIHx8IHRoaXM7XG4gICAgICAgIF90aGlzLnN5bmNFcnJvclZhbHVlID0gbnVsbDtcbiAgICAgICAgX3RoaXMuc3luY0Vycm9yVGhyb3duID0gZmFsc2U7XG4gICAgICAgIF90aGlzLnN5bmNFcnJvclRocm93YWJsZSA9IGZhbHNlO1xuICAgICAgICBfdGhpcy5pc1N0b3BwZWQgPSBmYWxzZTtcbiAgICAgICAgc3dpdGNoIChhcmd1bWVudHMubGVuZ3RoKSB7XG4gICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgX3RoaXMuZGVzdGluYXRpb24gPSBPYnNlcnZlcl8xLmVtcHR5O1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAxOlxuICAgICAgICAgICAgICAgIGlmICghZGVzdGluYXRpb25Pck5leHQpIHtcbiAgICAgICAgICAgICAgICAgICAgX3RoaXMuZGVzdGluYXRpb24gPSBPYnNlcnZlcl8xLmVtcHR5O1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBkZXN0aW5hdGlvbk9yTmV4dCA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGRlc3RpbmF0aW9uT3JOZXh0IGluc3RhbmNlb2YgU3Vic2NyaWJlcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuc3luY0Vycm9yVGhyb3dhYmxlID0gZGVzdGluYXRpb25Pck5leHQuc3luY0Vycm9yVGhyb3dhYmxlO1xuICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuZGVzdGluYXRpb24gPSBkZXN0aW5hdGlvbk9yTmV4dDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlc3RpbmF0aW9uT3JOZXh0LmFkZChfdGhpcyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5zeW5jRXJyb3JUaHJvd2FibGUgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuZGVzdGluYXRpb24gPSBuZXcgU2FmZVN1YnNjcmliZXIoX3RoaXMsIGRlc3RpbmF0aW9uT3JOZXh0KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIF90aGlzLnN5bmNFcnJvclRocm93YWJsZSA9IHRydWU7XG4gICAgICAgICAgICAgICAgX3RoaXMuZGVzdGluYXRpb24gPSBuZXcgU2FmZVN1YnNjcmliZXIoX3RoaXMsIGRlc3RpbmF0aW9uT3JOZXh0LCBlcnJvciwgY29tcGxldGUpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBfdGhpcztcbiAgICB9XG4gICAgU3Vic2NyaWJlci5wcm90b3R5cGVbcnhTdWJzY3JpYmVyXzEucnhTdWJzY3JpYmVyXSA9IGZ1bmN0aW9uICgpIHsgcmV0dXJuIHRoaXM7IH07XG4gICAgU3Vic2NyaWJlci5jcmVhdGUgPSBmdW5jdGlvbiAobmV4dCwgZXJyb3IsIGNvbXBsZXRlKSB7XG4gICAgICAgIHZhciBzdWJzY3JpYmVyID0gbmV3IFN1YnNjcmliZXIobmV4dCwgZXJyb3IsIGNvbXBsZXRlKTtcbiAgICAgICAgc3Vic2NyaWJlci5zeW5jRXJyb3JUaHJvd2FibGUgPSBmYWxzZTtcbiAgICAgICAgcmV0dXJuIHN1YnNjcmliZXI7XG4gICAgfTtcbiAgICBTdWJzY3JpYmVyLnByb3RvdHlwZS5uZXh0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RTdWJzY3JpYmVyID0gX3BhcmVudFN1YnNjcmliZXI7XG4gICAgICAgIHZhciBuZXh0O1xuICAgICAgICB2YXIgY29udGV4dCA9IF90aGlzO1xuICAgICAgICBpZiAoaXNGdW5jdGlvbl8xLmlzRnVuY3Rpb24ob2JzZXJ2ZXJPck5leHQpKSB7XG4gICAgICAgICAgICBuZXh0ID0gb2JzZXJ2ZXJPck5leHQ7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAob2JzZXJ2ZXJPck5leHQpIHtcbiAgICAgICAgICAgIG5leHQgPSBvYnNlcnZlck9yTmV4dC5uZXh0O1xuICAgICAgICAgICAgZXJyb3IgPSBvYnNlcnZlck9yTmV4dC5lcnJvcjtcbiAgICAgICAgICAgIGNvbXBsZXRlID0gb2JzZXJ2ZXJPck5leHQuY29tcGxldGU7XG4gICAgICAgICAgICBpZiAob2JzZXJ2ZXJPck5leHQgIT09IE9ic2VydmVyXzEuZW1wdHkpIHtcbiAgICAgICAgICAgICAgICBjb250ZXh0ID0gT2JqZWN0LmNyZWF0ZShvYnNlcnZlck9yTmV4dCk7XG4gICAgICAgICAgICAgICAgaWYgKGlzRnVuY3Rpb25fMS5pc0Z1bmN0aW9uKGNvbnRleHQudW5zdWJzY3JpYmUpKSB7XG4gICAgICAgICAgICAgICAgICAgIF90aGlzLmFkZChjb250ZXh0LnVuc3Vic2NyaWJlLmJpbmQoY29udGV4dCkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjb250ZXh0LnVuc3Vic2NyaWJlID0gX3RoaXMudW5zdWJzY3JpYmUuYmluZChfdGhpcyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgX3RoaXMuX2NvbnRleHQgPSBjb250ZXh0O1xuICAgICAgICBfdGhpcy5fbmV4dCA9IG5leHQ7XG4gICAgICAgIF90aGlzLl9lcnJvciA9IGVycm9yO1xuICAgICAgICBfdGhpcy5fY29tcGxldGUgPSBjb21wbGV0ZT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gICAgaWYgKCF1c2VEZXByZWNhdGVkU3luY2hyb25vdXNFcnJvckhhbmRsaW5nIHx8ICFfcGFyZW50U3Vic2NyaWJlci5zeW5jRXJyb3JUaHJvd2FibGUpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fX3RyeU9yVW5zdWIodGhpcy5fZXJyb3IsIGVycik7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMudW5zdWJzY3JpYmUoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX190cnlPclNldEVycm9yKF9wYXJlbnRTdWJzY3JpYmVyLCB0aGlzLl9lcnJvciwgZXJyKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy51bnN1YnNjcmliZSgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKCFfcGFyZW50U3Vic2NyaWJlci5zeW5jRXJyb3JUaHJvd2FibGUpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnVuc3Vic2NyaWJlKCk7XG4gICAgICAgICAgICAgICAgaWYgKHVzZURlcHJlY2F0ZWRTeW5jaHJvbm91c0Vycm9ySGFuZGxpbmcpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgZXJyO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBob3N0UmVwb3J0RXJyb3JfMS5ob3N0UmVwb3J0RXJyb3IoZXJyKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmICh1c2VEZXByZWNhdGVkU3luY2hyb25vdXNFcnJvckhhbmRsaW5nKSB7XG4gICAgICAgICAgICAgICAgICAgIF9wYXJlbnRTdWJzY3JpYmVyLnN5bmNFcnJvclZhbHVlID0gZXJyO1xuICAgICAgICAgICAgICAgICAgICBfcGFyZW50U3Vic2NyaWJlci5zeW5jRXJyb3JUaHJvd24gPSB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgaG9zdFJlcG9ydEVycm9yXzEuaG9zdFJlcG9ydEVycm9yKGVycik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRoaXMudW5zdWJzY3JpYmUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH07XG4gICAgU2FmZVN1YnNjcmliZXIucHJvdG90eXBlLmNvbXBsZXRlID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICBpZiAoIXRoaXMuaXNTdG9wcGVkKSB7XG4gICAgICAgICAgICB2YXIgX3BhcmVudFN1YnNjcmliZXIgPSB0aGlzLl9wYXJlbnRTdWJzY3JpYmVyO1xuICAgICAgICAgICAgaWYgKHRoaXMuX2NvbXBsZXRlKSB7XG4gICAgICAgICAgICAgICAgdmFyIHdyYXBwZWRDb21wbGV0ZSA9IGZ1bmN0aW9uICgpIHsgcmV0dXJuIF90aGlzLl9jb21wbGV0ZS5jYWxsKF90aGlzLl9jb250ZXh0KTsgfTtcbiAgICAgICAgICAgICAgICBpZiAoIWNvbmZpZ18xLmNvbmZpZy51c2VEZXByZWNhdGVkU3luY2hyb25vdXNFcnJvckhhbmRsaW5nIHx8ICFfcGFyZW50U3Vic2NyaWJlci5zeW5jRXJyb3JUaHJvd2FibGUpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fX3RyeU9yVW5zdWIod3JhcHBlZENvbXBsZXRlKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy51bnN1YnNjcmliZSgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fX3RyeU9yU2V0RXJyb3IoX3BhcmVudFN1YnNjcmliZXIsIHdyYXBwZWRDb21wbGV0ZSk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMudW5zdWJzY3JpYmUoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLnVuc3Vic2NyaWJlKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xuICAgIFNhZmVTdWJzY3JpYmVyLnByb3RvdHlwZS5fX3RyeU9yVW5zdWIgPSBmdW5jdGlvbiAoZm4sIHZhbHVlKSB7XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgICBmbi5jYWxsKHRoaXMuX2NvbnRleHQsIHZhbHVlKTtcbiAgICAgICAgfVxuICAgICAgICBjYXRjaCAoZXJyKSB7XG4gICAgICAgICAgICB0aGlzLnVuc3Vic2NyaWJlKCk7XG4gICAgICAgICAgICBpZiAoY29uZmlnXzEuY29uZmlnLnVzZURlcHJlY2F0ZWRTeW5jaHJvbm91c0Vycm9ySGFuZGxpbmcpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBlcnI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBob3N0UmVwb3J0RXJyb3JfMS5ob3N0UmVwb3J0RXJyb3IoZXJyKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH07XG4gICAgU2FmZVN1YnNjcmliZXIucHJvdG90eXBlLl9fdHJ5T3JTZXRFcnJvciA9IGZ1bmN0aW9uIChwYXJlbnQsIGZuLCB2YWx1ZSkge1xuICAgICAgICBpZiAoIWNvbmZpZ18xLmNvbmZpZy51c2VEZXByZWNhdGVkU3luY2hyb25vdXNFcnJvckhhbmRsaW5nKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ2JhZCBjYWxsJyk7XG4gICAgICAgIH1cbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIGZuLmNhbGwodGhpcy5fY29udGV4dCwgdmF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liZSwgX3N1YnNjcmlwdGlvbnMgPSBfYS5fc3Vic2NyaXB0aW9ucztcbiAgICAgICAgdGhpcy5jbG9zZWQgPSB0cnVlO1xuICAgICAgICB0aGlzLl9wYXJlbnRPclBhcmVudHMgPSBudWxsO1xuICAgICAgICB0aGlzLl9zdWJzY3JpcHRpb25zID0gbnVsbDtcbiAgICAgICAgaWYgKF9wYXJlbnRPclBhcmVudHMgaW5zdGFuY2VvZiBTdWJzY3JpcHRpb24pIHtcbiAgICAgICAgICAgIF9wYXJlbnRPclBhcmVudHMucmVtb3ZlKHRoaXMpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKF9wYXJlbnRPclBhcmVudHMgIT09IG51bGwpIHtcbiAgICAgICAgICAgIGZvciAodmFyIGluZGV4ID0gMDsgaW5kZXggPCBfcGFyZW50T3JQYXJlbnRzLmxlbmd0aDsgKytpbmRleCkge1xuICAgICAgICAgICAgICAgIHZhciBwYXJlbnRfMSA9IF9wYXJlbnRPclBhcmVudHNbaW5kZXhdO1xuICAgICAgICAgICAgICAgIHBhcmVudF8xLnJlbW92ZSh0aGlzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoaXNGdW5jdGlvbl8xLmlzRnVuY3Rpb24oX3Vuc3Vic2NyaWJlKSkge1xuICAgICAgICAgICAgaWYgKF9jdG9yVW5zdWJzY3JpYmUpIHtcbiAgICAgICAgICAgICAgICB0aGlzLl91bnN1YnNjcmliZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgX3Vuc3Vic2NyaWJlLmNhbGwodGhpcyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgIGVycm9ycyA9IGUgaW5zdGFuY2VvZiBVbnN1YnNjcmlwdGlvbkVycm9yXzEuVW5zdWJzY3JpcHRpb25FcnJvciA/IGZsYXR0ZW5VbnN1YnNjcmlwdGlvbkVycm9ycyhlLmVycm9ycykgOiBbZV07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGlzQXJyYXlfMS5pc0FycmF5KF9zdWJzY3JpcHRpb25zKSkge1xuICAgICAgICAgICAgdmFyIGluZGV4ID0gLTE7XG4gICAgICAgICAgICB2YXIgbGVuID0gX3N1YnNjcmlwdGlvbnMubGVuZ3RoO1xuICAgICAgICAgICAgd2hpbGUgKCsraW5kZXggPCBsZW4pIHtcbiAgICAgICAgICAgICAgICB2YXIgc3ViID0gX3N1YnNjcmlwdGlvbnNbaW5kZXhdO1xuICAgICAgICAgICAgICAgIGlmIChpc09iamVjdF8xLmlzT2JqZWN0KHN1YikpIHtcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHN1Yi51bnN1YnNjcmliZSgpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlcnJvcnMgPSBlcnJvcnMgfHwgW107XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZSBpbnN0YW5jZW9mIFVuc3Vic2NyaXB0aW9uRXJyb3JfMS5VbnN1YnNjcmlwdGlvbkVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3JzID0gZXJyb3JzLmNvbmNhdChmbGF0dGVuVW5zdWJzY3JpcHRpb25FcnJvcnMoZS5lcnJvcnMpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVycm9ycy5wdXNoKGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChlcnJvcnMpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBVbnN1YnNjcmlwdGlvbkVycm9yXzEuVW5zdWJzY3JpcHRpb25FcnJvcihlcnJvcnMpO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBTdWJzY3JpcHRpb24ucHJvdG90eXBlLmFkZCA9IGZ1bmN0aW9uICh0ZWFyZG93bikge1xuICAgICAgICB2YXIgc3Vic2NyaXB0aW9uID0gdGVhcmRvd247XG4gICAgICAgIGlmICghdGVhcmRvd24pIHtcbiAgICAgICAgICAgIHJldHVybiBTdWJzY3JpcHRpb24uRU1QVFk7XG4gICAgICAgIH1cbiAgICAgICAgc3dpdGNoICh0eXBlb2YgdGVhcmRvd24pIHtcbiAgICAgICAgICAgIGNhc2UgJ2Z1bmN0aW9uJzpcbiAgICAgICAgICAgICAgICBzdWJzY3JpcHRpb24gPSBuZXcgU3Vic2NyaXB0aW9uKHRlYXJkb3duKTtcbiAgICAgICAgICAgIGNhc2UgJ29iamVjdCc6XG4gICAgICAgICAgICAgICAgaWYgKHN1YnNjcmlwdGlvbiA9PT0gdGhpcyB8fCBzdWJzY3JpcHRpb24uY2xvc2VkIHx8IHR5cGVvZiBzdWJzY3JpcHRpb24udW5zdWJzY3JpYmUgIT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN1YnNjcmlwdGlvbjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAodGhpcy5jbG9zZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgc3Vic2NyaXB0aW9uLnVuc3Vic2NyaWJlKCk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzdWJzY3JpcHRpb247XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKCEoc3Vic2NyaXB0aW9uIGluc3RhbmNlb2YgU3Vic2NyaXB0aW9uKSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgdG1wID0gc3Vic2NyaXB0aW9uO1xuICAgICAgICAgICAgICAgICAgICBzdWJzY3JpcHRpb24gPSBuZXcgU3Vic2NyaXB0aW9uKCk7XG4gICAgICAgICAgICAgICAgICAgIHN1YnNjcmlwdGlvbi5fc3Vic2NyaXB0aW9ucyA9IFt0bXBdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGRlZmF1bHQ6IHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ3VucmVjb2duaXplZCB0ZWFyZG93biAnICsgdGVhcmRvd24gKyAnIGFkZGVkIHRvIFN1YnNjcmlwdGlvbi4nKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB2YXIgX3BhcmVudE9yUGFyZW50cyA9IHN1YnNjcmlwdGlvbi5fcGFyZW50T3JQYXJlbnRzO1xuICAgICAgICBpZiAoX3BhcmVudE9yUGFyZW50cyA9PT0gbnVsbCkge1xuICAgICAgICAgICAgc3Vic2NyaXB0aW9uLl9wYXJlbnRPclBhcmVudHMgPSB0aGlzO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKF9wYXJlbnRPclBhcmVudHMgaW5zdGFuY2VvZiBTdWJzY3JpcHRpb24pIHtcbiAgICAgICAgICAgIGlmIChfcGFyZW50T3JQYXJlbnRzID09PSB0aGlzKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHN1YnNjcmlwdGlvbjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHN1YnNjcmlwdGlvbi5fcGFyZW50T3JQYXJlbnRzID0gW19wYXJlbnRPclBhcmVudHMsIHRoaXNdO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKF9wYXJlbnRPclBhcmVudHMuaW5kZXhPZih0aGlzKSA9PT0gLTEpIHtcbiAgICAgICAgICAgIF9wYXJlbnRPclBhcmVudHMucHVzaCh0aGlzKTtcbiAgICAg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XG4gICAgZnVuY3Rpb24gUmVmQ291bnRPcGVyYXRvcihjb25uZWN0YWJsZSkge1xuICAgICAgICB0aGlzLmNvbm5lY3RhYmxlID0gY29ubmVjdGFibGU7XG4gICAgfVxuICAgIFJlZkNvdW50T3BlcmF0b3IucHJvdG90eXBlLmNhbGwgPSBmdW5jdGlvbiAoc3Vic2NyaWJlciwgc291cmNlKSB7XG4gICAgICAgIHZhciBjb25uZWN0YWJsZSA9IHRoaXMuY29ubmVjdGFibGU7XG4gICAgICAgIGNvbm5lY3RhYmxlLl9yZWZDb3VudCsrO1xuICAgICAgICB2YXIgcmVmQ291bnRlciA9IG5ldyBSZWZDb3VudFN1YnNjcmliZXIoc3Vic2NyaWJlciwgY29ubmVjdGFibGUpO1xuICAgICAgICB2YXIgc3Vic2NyaXB0aW9uID0gc291cmNlLnN1YnNjcmliZShyZWZDb3VudGVyKTtcbiAgICAgICAgaWYgKCFyZWZDb3VudGVyLmNsb3NlZCkge1xuICAgICAgICAgICAgcmVmQ291bnRlci5jb25uZWN0aW9uID0gY29ubmVjdGFibGUuY29ubmVjdCgpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBzdWJzY3JpcHRpb247XG4gICAgfTtcbiAgICByZXR1cm4gUmVmQ291bnRPcGVyYXRvcjtcbn0oKSk7XG52YXIgUmVmQ291bnRTdWJzY3JpYmVyID0gKGZ1bmN0aW9uIChfc3VwZXIpIHtcbiAgICBfX2V4dGVuZHMoUmVmQ291bnRTdWJzY3JpYmVyLCBfc3VwZXIpO1xuICAgIGZ1bmN0aW9uIFJlZkNvdW50U3Vic2NyaWJlcihkZXN0aW5hdGlvbiwgY29ubmVjdGFibGUpIHtcbiAgICAgICAgdmFyIF90aGlzID0gX3N1cGVyLmNhbGwodGhpcywgZGVzdGluYXRpb24pIHx8IHRoaXM7XG4gICAgICAgIF90aGlzLmNvbm5lY3RhYmxlID0gY29ubmVjdGFibGU7XG4gICAgICAgIHJldHVybiBfdGhpcztcbiAgICB9XG4gICAgUmVmQ291bnRTdWJzY3JpYmVyLnByb3RvdHlwZS5fdW5zdWJzY3JpYmUgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciBjb25uZWN0YWJsZSA9IHRoaXMuY29ubmVjdGFibGU7XG4gICAgICAgIGlmICghY29ubmVjdGFibGUpIHtcbiAgICAgICAgICAgIHRoaXMuY29ubmVjdGlvbiA9IG51bGw7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5jb25uZWN0YWJsZSA9IG51bGw7XG4gICAgICAgIHZhciByZWZDb3VudCA9IGNvbm5lY3RhYmxlLl9yZWZDb3VudDtcbiAgICAgICAgaWYgKHJlZkNvdW50IDw9IDApIHtcbiAgICAgICAgICAgIHRoaXMuY29ubmVjdGlvbiA9IG51bGw7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgY29ubmVjdGFibGUuX3JlZkNvdW50ID0gcmVmQ291bnQgLSAxO1xuICAgICAgICBpZiAocmVmQ291bnQgPiAxKSB7XG4gICAgICAgICAgICB0aGlzLmNvbm5lY3Rpb24gPSBudWxsO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIHZhciBjb25uZWN0aW9uID0gdGhpcy5jb25uZWN0aW9uO1xuICAgICAgICB2YXIgc2hhcmVkQ29ubmVjdGlvbiA9IGNvbm5lY3RhYmxlLl9jb25uZWN0aW9uO1xuICAgICAgICB0aGlzLmNvbm5lY3Rpb24gPSBudWxsO1xuICAgICAgICBpZiAoc2hhcmVkQ29ubmVjdGlvbiAmJiAoIWNvbm5lY3Rpb24gfHwgc2hhcmVkQ29ubmVjdGlvbiA9PT0gY29ubmVjdGlvbikpIHtcbiAgICAgICAgICAgIHNoYXJlZENvbm5lY3Rpb24udW5zdWJzY3JpYmUoKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgcmV0dXJuIFJlZkNvdW50U3Vic2NyaWJlcjtcbn0oU3V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AgICAgIGNvbnRyb2xsZXIuYWJvcnQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIHZhciBwZXJTdWJzY3JpYmVySW5pdDtcbiAgICAgICAgaWYgKGluaXQpIHtcbiAgICAgICAgICAgIGlmIChpbml0LnNpZ25hbCkge1xuICAgICAgICAgICAgICAgIGlmIChpbml0LnNpZ25hbC5hYm9ydGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRyb2xsZXIuYWJvcnQoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBvdXRlclNpZ25hbF8xID0gaW5pdC5zaWduYWw7XG4gICAgICAgICAgICAgICAgICAgIHZhciBvdXRlclNpZ25hbEhhbmRsZXJfMSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghc2lnbmFsLmFib3J0ZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250cm9sbGVyLmFib3J0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIG91dGVyU2lnbmFsXzEuYWRkRXZlbnRMaXN0ZW5lcignYWJvcnQnLCBvdXRlclNpZ25hbEhhbmRsZXJfMSk7XG4gICAgICAgICAgICAgICAgICAgIHN1YnNjcmlwdGlvbi5hZGQoZnVuY3Rpb24gKCkgeyByZXR1cm4gb3V0ZXJTaWduYWxfMS5yZW1vdmVFdmVudExpc3RlbmVyKCdhYm9ydCcsIG91dGVyU2lnbmFsSGFuZGxlcl8xKTsgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcGVyU3Vic2NyaWJlckluaXQgPSBfX2Fzc2lnbih7fSwgaW5pdCwgeyBzaWduYWw6IHNpZ25hbCB9KTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHBlclN1YnNjcmliZXJJbml0ID0geyBzaWduYWw6IHNpZ25hbCB9O1xuICAgICAgICB9XG4gICAgICAgIGZldGNoKGlucHV0LCBwZXJTdWJzY3JpYmVySW5pdCkudGhlbihmdW5jdGlvbiAocmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlmIChzZWxlY3Rvcikge1xuICAgICAgICAgICAgICAgIHN1YnNjcmlwdGlvbi5hZGQoZnJvbV8xLmZyb20oc2VsZWN0b3IocmVzcG9uc2UpKS5zdWJzY3JpYmUoZnVuY3Rpb24gKHZhbHVlKSB7IHJldHVybiBzdWJzY3JpYmVyLm5leHQodmFsdWUpOyB9LCBmdW5jdGlvbiAoZXJyKSB7XG4gICAgICAgICAgICAgICAgICAgIGFib3J0YWJsZSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXVuc3Vic2NyaWJlZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc3Vic2NyaWJlci5lcnJvcihlcnIpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSwgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICBhYm9ydGFibGUgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgc3Vic2NyaWJlci5jb21wbGV0ZSgpO1xuICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGFib3J0YWJsZSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIHN1YnNjcmliZXIubmV4dChyZXNwb25zZSk7XG4gICAgICAgICAgICAgICAgc3Vic2NyaWJlci5jb21wbGV0ZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KS5jYXRjaChmdW5jdGlvbiAoZXJyKSB7XG4gICAgICAgICAgICBhYm9ydGFibGUgPSBmYWxzZTtcbiAgICAgICAgICAgIGlmICghdW5zdWJzY3Jp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XRvcnMubGVuZ3RoO1xuICAgICAgICB2YXIgZGVzdGluYXRpb24gPSB0aGlzLmRlc3RpbmF0aW9uO1xuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxlbjsgaSsrKSB7XG4gICAgICAgICAgICB2YXIgaXRlcmF0b3IgPSBpdGVyYXRvcnNbaV07XG4gICAgICAgICAgICBpZiAodHlwZW9mIGl0ZXJhdG9yLmhhc1ZhbHVlID09PSAnZnVuY3Rpb24nICYmICFpdGVyYXRvci5oYXNWYWx1ZSgpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHZhciBzaG91bGRDb21wbGV0ZSA9IGZhbHNlO1xuICAgICAgICB2YXIgYXJncyA9IFtdO1xuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxlbjsgaSsrKSB7XG4gICAgICAgICAgICB2YXIgaXRlcmF0b3IgPSBpdGVyYXRvcnNbaV07XG4gICAgICAgICAgICB2YXIgcmVzdWx0ID0gaXRlcmF0b3IubmV4dCgpO1xuICAgICAgICAgICAgaWYgKGl0ZXJhdG9yLmhhc0NvbXBsZXRlZCgpKSB7XG4gICAgICAgICAgICAgICAgc2hvdWxkQ29tcGxldGUgPSB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHJlc3VsdC5kb25lKSB7XG4gICAgICAgICAgICAgICAgZGVzdGluYXRpb24uY29tcGxldGUoKTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBhcmdzLnB1c2gocmVzdWx0LnZhbHVlKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodGhpcy5yZXN1bHRTZWxlY3Rvcikge1xuICAgICAgICAgICAgdGhpcy5fdHJ5cmVzdWx0U2VsZWN0b3IoYXJncyk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBkZXN0aW5hdGlvbi5u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pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBfdGhpcztcbiAgICB9XG4gICAgQnVmZmVyVGltZVN1YnNjcmliZXIucHJvdG90eXBlLl9uZXh0ID0gZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgIHZhciBjb250ZXh0cyA9IHRoaXMuY29udGV4dHM7XG4gICAgICAgIHZhciBsZW4gPSBjb250ZXh0cy5sZW5ndGg7XG4gICAgICAgIHZhciBmaWxsZWRCdWZmZXJDb250ZXh0O1xuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxlbjsgaSsrKSB7XG4gICAgICAgICAgICB2YXIgY29udGV4dF8xID0gY29udGV4dHNbaV07XG4gICAgICAgICAgICB2YXIgYnVmZmVyID0gY29udGV4dF8xLmJ1ZmZlcjtcbiAgICAgICAgICAgIGJ1ZmZlci5wdXNoKHZhbHVlKTtcbiAgICAgICAgICAgIGlmIChidWZmZXIubGVuZ3RoID09IHRoaXMubWF4QnVmZmVyU2l6ZSkge1xuICAgICAgICAgICAgICAgIGZpbGxlZEJ1ZmZlckNvbnRleHQgPSBjb250ZXh0XzE7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGZpbGxlZEJ1ZmZlckNvbnRleHQpIHtcbiAgICAgICAgICAgIHRoaXMub25CdWZmZXJGdWxsKGZpbGxlZEJ1ZmZlckNvbnRleHQpO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBCdWZmZXJUaW1lU3Vic2NyaWJlci5wcm90b3R5cGUuX2Vycm9yID0gZnVuY3Rpb24gKGVycikge1xuICAgICAgICB0aGlzLmNvbnRleHRzLmxlbmd0aCA9IDA7XG4gICAgICAgIF9zdXBlci5wcm90b3R5cGUuX2Vycm9yLmNhbGwodGhpcywgZXJyKTtcbiAgICB9O1xuICAgIEJ1ZmZlclRpbWVTdWJzY3JpYmVyLnByb3RvdHlwZS5fY29tcGxldGUgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciBf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Vycikge1xuICAgICAgICB2YXIgY29udGV4dHMgPSB0aGlzLmNvbnRleHRzO1xuICAgICAgICB3aGlsZSAoY29udGV4dHMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgdmFyIGNvbnRleHRfMSA9IGNvbnRleHRzLnNoaWZ0KCk7XG4gICAgICAgICAgICBjb250ZXh0XzEuc3Vic2NyaXB0aW9uLnVuc3Vic2NyaWJlKCk7XG4gICAgICAgICAgICBjb250ZXh0XzEuYnVmZmVyID0gbnVsbDtcbiAgICAgICAgICAgIGNvbnRleHRfMS5zdWJzY3JpcHRpb24gPSBudWxsO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMuY29udGV4dHMgPSBudWxsO1xuICAgICAgICBfc3VwZXIucHJvdG90eXBlLl9lcnJvci5jYWxsKHRoaXMsIGVycik7XG4gICAgfTtcbiAgICBCdWZmZXJUb2dnbGVTdWJzY3JpYmVyLnByb3RvdHlwZS5fY29tcGxldGUgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciBjb250ZXh0cyA9IHRoaXMuY29udGV4dHM7XG4gICAgICAgIHdoaWxlIChjb250ZXh0cy5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICB2YXIgY29udGV4dF8yID0gY29udGV4dHMuc2hpZnQoKTtcbiAgICAgICAgICAgIHRoaXMuZGVzdGluYXRpb24ubmV4dChjb250ZXh0XzIuYnVmZmVyKTtcbiAgICAgICAgICAgIGNvbnRleHRfMi5zdWJzY3JpcHRpb24udW5zdWJzY3JpYmUoKTtcbiAgICAgICAgICAgIGNvbnRleHRfMi5idWZmZXIgPSBudWxsO1xuICAgICAgICAgICAgY29udGV4dF8yLnN1YnNjcmlwdGlvbiA9IG51bGw7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5jb250ZXh0cyA9IG51bGw7XG4gICAgICAgIF9zdXBlci5wcm90b3R5cGUuX2NvbXBsZXRlLmNhbGwodGhpcyk7XG4gICAgfTtcbiAgICBCdWZmZXJUb2dnbGVT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RoaXMuaW5kZXggPSAwO1xuICAgICAgICByZXR1cm4gX3RoaXM7XG4gICAgfVxuICAgIENvdW50U3Vic2NyaWJlci5wcm90b3R5cGUuX25leHQgPSBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgaWYgKHRoaXMucHJlZGljYXRlKSB7XG4gICAgICAgICAgICB0aGlzLl90cnlQcmVkaWNhdGUodmFsdWUpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jb3VudCsrO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBDb3VudFN1YnNjcmliZXIucHJvdG90eXBlLl90cnlQcmVkaWNhdGUgPSBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgdmFyIHJlc3VsdDtcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIHJlc3VsdCA9IHRoaXMucHJlZGljYXRlKHZhbHVlLCB0aGlzLmluZGV4KyssIHRoaXMuc291cmNlKTtcbiAgICAgICAgfVxuICAgICAgICBjYXRjaCAoZXJyKSB7XG4gICAgICAgICAgICB0aGlzLmRlc3RpbmF0aW9uLmVycm9yKGVycik7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHJlc3VsdCkge1xuICAgICAgICAgICAgdGhpcy5jb3VudCsrO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBDb3VudFN1YnNjcmliZXIucHJvdG90eXBlLl9jb21wbGV0ZSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdGhpcy5kZXN0aW5hdGlvbi5uZXh0KHRoaXMuY291bnQpO1xuICAgICAgICB0aGlzLmRlc3RpbmF0aW9uLmNvbXBsZXRlKCk7XG4gICAgfTtcbiAgICByZXR1cm4gQ291bnRTdWJzY3JpYmVyO1xufShTdWJzY3JpYmVyXzEuU3Vic2NyaWJlcikpO1xuLy8jIHNvdXJjZU1hcHBpbmdVUkw9Y291bnQuanMubWFwIiwiXCJ1c2Ugc3R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Byb3RvdHlwZS5jb21wYXJlID0gZnVuY3Rpb24gKHgsIHkpIHtcbiAgICAgICAgcmV0dXJuIHggPT09IHk7XG4gICAgfTtcbiAgICBEaXN0aW5jdFVudGlsQ2hhbmdlZFN1YnNjcmliZXIucHJvdG90eXBlLl9uZXh0ID0gZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgIHZhciBrZXk7XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgICB2YXIga2V5U2VsZWN0b3IgPSB0aGlzLmtleVNlbGVjdG9yO1xuICAgICAgICAgICAga2V5ID0ga2V5U2VsZWN0b3IgPyBrZXlTZWxlY3Rvcih2YWx1ZSkgOiB2YWx1ZTtcbiAgICAgICAgfVxuICAgICAgICBjYXRjaCAoZXJyKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5kZXN0aW5hdGlvbi5lcnJvcihlcnIpO1xuICAgICAgICB9XG4gICAgICAgIHZhciByZXN1bHQgPSBmYWxzZTtcbiAgICAgICAgaWYgKHRoaXMuaGFzS2V5KSB7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIHZhciBjb21wYXJlID0gdGhpcy5jb21wYXJlO1xuICAgICAgICAgICAgICAgIHJlc3VsdCA9IGNvbXBhcmUodGhpcy5rZXksIGtleSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjYXRjaCAoZXJyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuZGVzdGluYXRpb24uZXJyb3IoZXJyKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuaGFzS2V5ID0gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIXJlc3VsdCkge1xuICAgICAgICAgICAgdGhpcy5rZXkgPSBrZXk7XG4gICAgICAgICAgICB0aGlzLmRlc3RpbmF0aW9uLm5leHQodmFsdWUpO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBy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AgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgdmFyIHByb2plY3QgPSB0aGlzLnByb2plY3Q7XG4gICAgICAgICAgICAgICAgdmFyIHJlc3VsdCA9IHByb2plY3QodmFsdWUsIGluZGV4KTtcbiAgICAgICAgICAgICAgICBpZiAoIXRoaXMuc2NoZWR1bGVyKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc3Vic2NyaWJlVG9Qcm9qZWN0aW9uKHJlc3VsdCwgdmFsdWUsIGluZGV4KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBzdGF0ZSA9IHsgc3Vic2NyaWJlcjogdGhpcywgcmVzdWx0OiByZXN1bHQsIHZhbHVlOiB2YWx1ZSwgaW5kZXg6IGluZGV4IH07XG4gICAgICAgICAgICAgICAgICAgIHZhciBkZXN0aW5hdGlvbl8xID0gdGhpcy5kZXN0aW5hdGlvbjtcbiAgICAgICAgICAgICAgICAgICAgZGVzdGluYXRpb25fMS5hZGQodGhpcy5zY2hlZHVsZXIuc2NoZWR1bGUoRXhwYW5kU3Vic2NyaWJlci5kaXNwYXRjaCwgMCwgc3RhdGUpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgIGRlc3RpbmF0aW9uLmVycm9yKGUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5idWZmZXIucHVzaCh2YWx1ZSk7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIEV4cGFuZFN1YnNjcmliZXIucHJvdG90eXBlLnN1YnNjcmliZVRvUHJvamVjdGlvbiA9IGZ1bmN0aW9uIChyZXN1bHQsIHZhbHVlLCBpbmRleCkge1xuICAgICAgICB0aGlzLmFjdGl2ZSsrO1xuICAgICAgICB2YXIgZGVzdGluYXRp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TtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLl9ncm91cCh2YWx1ZSwga2V5KTtcbiAgICB9O1xuICAgIEdyb3VwQnlTdWJzY3JpYmVyLnByb3RvdHlwZS5fZ3JvdXAgPSBmdW5jdGlvbiAodmFsdWUsIGtleSkge1xuICAgICAgICB2YXIgZ3JvdXBzID0gdGhpcy5ncm91cHM7XG4gICAgICAgIGlmICghZ3JvdXBzKSB7XG4gICAgICAgICAgICBncm91cHMgPSB0aGlzLmdyb3VwcyA9IG5ldyBNYXAoKTtcbiAgICAgICAgfVxuICAgICAgICB2YXIgZ3JvdXAgPSBncm91cHMuZ2V0KGtleSk7XG4gICAgICAgIHZhciBlbGVtZW50O1xuICAgICAgICBpZiAodGhpcy5lbGVtZW50U2VsZWN0b3IpIHtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgZWxlbWVudCA9IHRoaXMuZWxlbWVudFNlbGVjdG9yKHZhbHVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNhdGNoIChlcnIpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmVycm9yKGVycik7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBlbGVtZW50ID0gdmFsdWU7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFncm91cCkge1xuICAgICAgICAgICAgZ3JvdXAgPSAodGhpcy5zdWJqZWN0U2VsZWN0b3IgPyB0aGlzLnN1YmplY3RTZWxlY3RvcigpIDogbmV3IFN1YmplY3RfMS5TdWJqZWN0KCkpO1xuICAgICAgICAgICAgZ3JvdXBzLnNldChrZXksIGdyb3VwKTtcbiAgICAgICAgICAgIHZhciBncm91cGVkT2JzZXJ2YWJsZSA9IG5ldyBHcm91cGVkT2JzZXJ2YWJsZShrZXksIGdyb3VwLCB0aGlzKTtcbiAgICAgICAgICAgIHRoaXMuZGVzdGluYXRpb24ubmV4dChncm91cGVkT2JzZXJ2YWJsZSk7XG4gICAgICAgICAgICBpZiAodGhpcy5kdXJhdGlvblNlbGVjdG9yKSB7XG4gICAgICAgICAgICAgICAgdmFyIGR1cmF0aW9uID0gdm9pZCAwO1xuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIGR1cmF0aW9uID0gdGhpcy5kdXJhdGlvblNlbGVjdG9yKG5ldyBHcm91cGVkT2JzZXJ2YWJsZShrZXksIGdyb3VwKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNhdGNoIChlcnIpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5lcnJvcihlcnIpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRoaXMuYWRkKGR1cmF0aW9uLnN1YnNjcmliZShuZXcgR3JvdXBEdXJhdGlvblN1YnNjcmliZXIoa2V5LCBncm91cCwgdGhpcykpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoIWdyb3VwLmNsb3NlZCkge1xuICAgICAgICAgICAgZ3JvdXAubmV4dChlbGVtZW50KTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgR3JvdXBCeVN1YnNjcmliZXIucHJvdG90eXBlLl9lcnJvciA9IGZ1bmN0aW9uIChlcnIpIHtcbiAgICAgICAgdmFyIGdyb3VwcyA9IHRoaXMuZ3JvdXBzO1xuICAgICAgICBpZiAoZ3JvdXBzKSB7XG4gICAgICAgICAgICBncm91cHMuZm9yRWFjaChmdW5jdGlvbiAoZ3JvdXAsIGtleSkge1xuICAgICAgICAgICAgICAgIGdyb3VwLmVycm9yKGVycik7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGdyb3Vwcy5jbGVhcigpO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMuZGVzdGluYXRpb24uZXJyb3IoZXJyKTtcbiAgICB9O1x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Y3RhYmxlO1xuICAgICAgICByZXR1cm4gX3RoaXM7XG4gICAgfVxuICAgIFJlZkNvdW50U3Vic2NyaWJlci5wcm90b3R5cGUuX3Vuc3Vic2NyaWJlID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgY29ubmVjdGFibGUgPSB0aGlzLmNvbm5lY3RhYmxlO1xuICAgICAgICBpZiAoIWNvbm5lY3RhYmxlKSB7XG4gICAgICAgICAgICB0aGlzLmNvbm5lY3Rpb24gPSBudWxsO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMuY29ubmVjdGFibGUgPSBudWxsO1xuICAgICAgICB2YXIgcmVmQ291bnQgPSBjb25uZWN0YWJsZS5fcmVmQ291bnQ7XG4gICAgICAgIGlmIChyZWZDb3VudCA8PSAwKSB7XG4gICAgICAgICAgICB0aGlzLmNvbm5lY3Rpb24gPSBudWxsO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGNvbm5lY3RhYmxlLl9yZWZDb3VudCA9IHJlZkNvdW50IC0gMTtcbiAgICAgICAgaWYgKHJlZkNvdW50ID4gMSkge1xuICAgICAgICAgICAgdGhpcy5jb25uZWN0aW9uID0gbnVsbDtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICB2YXIgY29ubmVjdGlvbiA9IHRoaXMuY29ubmVjdGlvbjtcbiAgICAgICAgdmFyIHNoYXJlZENvbm5lY3Rpb24gPSBjb25uZWN0YWJsZS5fY29ubmVjdGlvbjtcbiAgICAgICAgdGhpcy5jb25uZWN0aW9uID0gbnVsbDtcbiAgICAgICAgaWYgKHNoYXJlZENvbm5lY3Rpb24gJiYgKCFjb25uZWN0aW9uIHx8IHNoYXJlZENvbm5lY3Rpb24gPT09IGNvbm5lY3Rpb24pKSB7XG4gICAgICAgICAgICBzaGFyZWRDb25uZWN0aW9uLnVuc3Vic2NyaWJlKCk7XG4gICAgICAgIH1cbiAg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liZXIsIF9zdXBlcik7XG4gICAgZnVuY3Rpb24gUmV0cnlXaGVuU3Vic2NyaWJlcihkZXN0aW5hdGlvbiwgbm90aWZpZXIsIHNvdXJjZSkge1xuICAgICAgICB2YXIgX3RoaXMgPSBfc3VwZXIuY2FsbCh0aGlzLCBkZXN0aW5hdGlvbikgfHwgdGhpcztcbiAgICAgICAgX3RoaXMubm90aWZpZXIgPSBub3RpZmllcjtcbiAgICAgICAgX3RoaXMuc291cmNlID0gc291cmNlO1xuICAgICAgICByZXR1cm4gX3RoaXM7XG4gICAgfVxuICAgIFJldHJ5V2hlblN1YnNjcmliZXIucHJvdG90eXBlLmVycm9yID0gZnVuY3Rpb24gKGVycikge1xuICAgICAgICBpZiAoIXRoaXMuaXNTdG9wcGVkKSB7XG4gICAgICAgICAgICB2YXIgZXJyb3JzID0gdGhpcy5lcnJvcnM7XG4gICAgICAgICAgICB2YXIgcmV0cmllcyA9IHRoaXMucmV0cmllcztcbiAgICAgICAgICAgIHZhciByZXRyaWVzU3Vic2NyaXB0aW9uID0gdGhpcy5yZXRyaWVzU3Vic2NyaXB0aW9uO1xuICAgICAgICAgICAgaWYgKCFyZXRyaWVzKSB7XG4gICAgICAgICAgICAgICAgZXJyb3JzID0gbmV3IFN1YmplY3RfMS5TdWJqZWN0KCk7XG4gICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIG5vdGlmaWVyID0gdGhpcy5ub3RpZmllcjtcbiAgICAgICAgICAgICAgICAgICAgcmV0cmllcyA9IG5vdGlmaWVyKGVycm9ycyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBfc3VwZXIucHJvdG90eXBlLmVycm9yLmNhbGwodGhpcywgZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHJpZXNTdWJzY3JpcHRpb24gPSBpbm5lclN1YnNjcmliZV8xLmlubmVyU3Vic2NyaWJlKHJldHJpZXMsIG5ldyBpbm5lclN1YnNjcmliZV8xLlNpbXBsZUlubmVyU3Vic2NyaWJlcih0aGlzKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLmVycm9ycyA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICB0aGlzLnJldHJpZXNTdWJzY3JpcHRpb24gPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLl91bnN1YnNjcmliZUFuZFJlY3ljbGUoKTtcbiAgICAgICAgICAgIHRoaXMuZXJyb3JzID0gZXJyb3JzO1xuICAgICAgICAgICAgdGhpcy5yZXRyaWVzID0gcmV0cmllcztcbiAgICAgICAgICAgIHRoaXMucmV0cmllc1N1YnNjcmlwdGlvbiA9IHJldHJpZXNTdWJzY3JpcHRpb247XG4gICAgICAgICAgICBlcnJvcnMubmV4dChlcnIpO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBSZXRyeVdoZW5TdWJzY3JpYmVyLnByb3RvdHlwZS5fdW5zdWJzY3JpYmUgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciBfYSA9IHRoaXMsIGVycm9ycyA9IF9hLmVycm9ycywgcmV0cmllc1N1YnNjcmlwdGlvbiA9IF9hLnJldHJpZXNTdWJzY3JpcHRpb247XG4gICAgICAgIGlmIChlcnJvcnMpIHtcbiAgICAgICAgICAgIGVycm9ycy51bnN1YnNjcmliZSgpO1xuICAgICAgICAgICAgdGhpcy5lcnJvcnMgPSB1bmRlZmluZWQ7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHJldHJpZXNTdWJzY3JpcHRpb24pIHtcbiAgICAgICAgICAgIHJldHJpZXNTdWJzY3JpcHRpb24udW5zdWJzY3JpYmUoKTtcbiAgICAgICAgICAgIHRoaXMucmV0cmllc1N1YnNjcmlwdGlvbiA9IHVuZGVmaW5lZDtc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ICh2YWx1ZSkgeyBzdWJqZWN0Lm5leHQodmFsdWUpOyB9LFxuICAgICAgICAgICAgICAgIGVycm9yOiBmdW5jdGlvbiAoZXJyKSB7XG4gICAgICAgICAgICAgICAgICAgIGhhc0Vycm9yID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgc3ViamVjdC5lcnJvcihlcnIpO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgY29tcGxldGU6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgaXNDb21wbGV0ZSA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIHN1YnNjcmlwdGlvbiA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICAgICAgc3ViamVjdC5jb21wbGV0ZSgpO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGlubmVyU3ViID0gc3ViamVjdC5zdWJzY3JpYmUodGhpcyk7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5hZGQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmVmQ291bnQtLTtcbiAgICAgICAgICAgIGlubmVyU3ViLnVuc3Vic2NyaWJlKCk7XG4gICAgICAgICAgICBpZiAoc3Vic2NyaXB0aW9uICYmICFpc0NvbXBsZXRlICYmIHVzZVJlZkNvdW50ICYmIHJlZkNvdW50ID09PSAwKSB7XG4gICAgICAgICAgICAgICAgc3Vic2NyaXB0aW9uLnVuc3Vic2NyaWJlKCk7XG4gICAgICAgICAgICAgICAgc3Vic2NyaXB0aW9uID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgIHN1YmplY3QgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH07XG59XG4vLyMgc291cmNlTWFwcGluZ1VSTD1zaGFyZVJlcGxheS5qcy5tYXAiLCJcInVzZSBzdHJpY3R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SB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgQXJndW1lbnRPdXRPZlJhbmdlRXJyb3JfMS5Bcmd1bWVudE91dE9mUmFuZ2VFcnJvcjtcbiAgICAgICAgfVxuICAgIH1cbiAgICBTa2lwTGFzdE9wZXJhdG9yLnByb3RvdHlwZS5jYWxsID0gZnVuY3Rpb24gKHN1YnNjcmliZXIsIHNvdXJjZSkge1xuICAgICAgICBpZiAodGhpcy5fc2tpcENvdW50ID09PSAwKSB7XG4gICAgICAgICAgICByZXR1cm4gc291cmNlLnN1YnNjcmliZShuZXcgU3Vic2NyaWJlcl8xLlN1YnNjcmliZXIoc3Vic2NyaWJlcikpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHNvdXJjZS5zdWJzY3JpYmUobmV3IFNraXBMYXN0U3Vic2NyaWJlcihzdWJzY3JpYmVyLCB0aGlzLl9za2lwQ291bnQpKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgcmV0dXJuIFNraXBMYXN0T3BlcmF0b3I7XG59KCkpO1xudmFyIFNraXBMYXN0U3Vic2NyaWJlciA9IChmdW5jdGlvbiAoX3N1cGVyKSB7XG4gICAgX19leHRlbmRzKFNraXBMYXN0U3Vic2NyaWJlciwgX3N1cGVyKTtcbiAgICBmdW5jdGlvbiBTa2lwTGFzdFN1YnNjcmliZXIoZGVzdGluYXRpb24sIF9za2lwQ291bnQpIHtcbiAgICAgICAgdmFyIF90aGlzID0gX3N1cGVyLmNhbGwodGhpcywgZGVzdGluYXRpb24pIHx8IHRoaXM7XG4gICAgICAgIF90aGlzLl9za2lwQ291bnQgPSBfc2tpcENvdW50O1xuICAgICAgICBfdGhpcy5fY291bnQgPSAwO1xuICAgICAgICBfdGhpcy5fcmluZyA9IG5ldyBBcnJheShfc2tpcENvdW50KTtcbiAgICAgICAgcmV0dXJuIF90aGlzO1xuICAgIH1cbiAgICBTa2lwTGFzdFN1YnNjcmliZXIucHJvdG90eXBl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7XG4gICAgICAgIHZhciB0b3RhbCA9IHRoaXMudG90YWw7XG4gICAgICAgIHZhciBjb3VudCA9ICsrdGhpcy5jb3VudDtcbiAgICAgICAgaWYgKGNvdW50IDw9IHRvdGFsKSB7XG4gICAgICAgICAgICB0aGlzLmRlc3RpbmF0aW9uLm5leHQodmFsdWUpO1xuICAgICAgICAgICAgaWYgKGNvdW50ID09PSB0b3RhbCkge1xuICAgICAgICAgICAgICAgIHRoaXMuZGVzdGluYXRpb24uY29tcGxldGUoKTtcbiAgICAgICAgICAgICAgICB0aGlzLnVuc3Vic2NyaWJlKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xuICAgIHJldHVybiBUYWtlU3Vic2NyaWJlcjtcbn0oU3Vic2NyaWJlcl8xLlN1YnNjcmliZXIpKTtcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPXRha2UuanMubWFwIiwiXCJ1c2Ugc3RyaWN0XCI7XG52YXIgX19leHRlbmRzID0gKHRoaXMgJiYgdGhpcy5fX2V4dGVuZHMpIHx8IChmdW5jdGlvbiAoKSB7XG4gICAgdmFyIGV4dGVuZFN0YXRpY3MgPSBmdW5jdGlvbiAoZCwgYikge1xuICAgICAgICBleHRlbmRTdGF0aWNzID0gT2JqZWN0LnNldFByb3RvdHlwZU9mIHx8XG4gICAgICAgICAgICAoeyBfX3Byb3RvX186IFtdIH0gaW5zdGFuY2VvZiBBcnJheSAmJiBmdW5jdGlvbiAoZCwgYikgeyBkLl9fcHJvdG9fXyA9IGI7IH0pIHx8XG4gICAgICAgICAgICBmdW5jdGlvbiAoZCwgYikgeyBmb3IgKHZhciBwIGluIGIpIGlmIChiLmhhc093blByb3BlcnR5KHApKSBkW3BdID0gYltwXTsgfTtcbiAgICAgICAgcmV0dXJuIGV4dGVuZFN0YXRpY3MoZCwgYik7XG4gICAgfVxuICAgIHJldHVybiBmdW5jdGlvbiAoZCwgYikge1xuICAgICAgICBleHRlbmRTdGF0aWNzKGQsIGIpO1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wdXNoKHZhbHVlKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHZhciBpbmRleCA9IGNvdW50ICUgdG90YWw7XG4gICAgICAgICAgICByaW5nW2luZGV4XSA9IHZhbHVlO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBUYWtlTGFzdFN1YnNjcmliZXIucHJvdG90eXBlLl9jb21wbGV0ZSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIGRlc3RpbmF0aW9uID0gdGhpcy5kZXN0aW5hdGlvbjtcbiAgICAgICAgdmFyIGNvdW50ID0gdGhpcy5jb3VudDtcbiAgICAgICAgaWYgKGNvdW50ID4gMCkge1xuICAgICAgICAgICAgdmFyIHRvdGFsID0gdGhpcy5jb3VudCA+PSB0aGlzLnRvdGFsID8gdGhpcy50b3RhbCA6IHRoaXMuY291bnQ7XG4gICAgICAgICAgICB2YXIgcmluZyA9IHRoaXMucmluZztcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgdG90YWw7IGkrKykge1xuICAgICAgICAgICAgICAgIHZhciBpZHggPSAoY291bnQrKykgJSB0b3RhbDtcbiAgICAgICAgICAgICAgICBkZXN0aW5hdGlvbi5uZXh0KHJpbmdbaWR4XSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZGVzdGluYXRpb24uY29tcGxldGUoKTtcbiAgICB9O1xuICAgIHJldHVybiBUYWtlTGFzdFN1YnNjcmliZXI7XG59KFN1YnNjcmliZXJfMS5TdWJzY3JpYmVyKSk7XG4vLyMgc291cmNlTWFwcGluZ1VSTD10YWtlTGFzdC5qcy5tYXAiLCJcInVzZSBzdHJpY3RcIjtcbnZhciBfX2V4dGVuZHMgPSAodGhpcyAmJiB0aGlzLl9fZXh0ZW5kcykgfHwgKGZ1bmN0aW9uICgpIHtcbiAgICB2YXIgZXh0ZW5kU3RhdGljcyA9IGZ1bmN0aW9uIChkLCBiKSB7XG4gICAgICAgIGV4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SBmYWxzZTtcbiAgICAgICAgX3RoaXMuX3RyYWlsaW5nVmFsdWUgPSBudWxsO1xuICAgICAgICByZXR1cm4gX3RoaXM7XG4gICAgfVxuICAgIFRocm90dGxlVGltZVN1YnNjcmliZXIucHJvdG90eXBlLl9uZXh0ID0gZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgIGlmICh0aGlzLnRocm90dGxlZCkge1xuICAgICAgICAgICAgaWYgKHRoaXMudHJhaWxpbmcpIHtcbiAgICAgICAgICAgICAgICB0aGlzLl90cmFpbGluZ1ZhbHVlID0gdmFsdWU7XG4gICAgICAgICAgICAgICAgdGhpcy5faGFzVHJhaWxpbmdWYWx1ZSA9IHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmFkZCh0aGlzLnRocm90dGxlZCA9IHRoaXMuc2NoZWR1bGVyLnNjaGVkdWxlKGRpc3BhdGNoTmV4dCwgdGhpcy5kdXJhdGlvbiwgeyBzdWJzY3JpYmVyOiB0aGlzIH0pKTtcbiAgICAgICAgICAgIGlmICh0aGlzLmxlYWRpbmcpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmRlc3RpbmF0aW9uLm5leHQodmFsdWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAodGhpcy50cmFpbGluZykge1xuICAgICAgICAgICAgICAgIHRoaXMuX3RyYWlsaW5nVmFsdWUgPSB2YWx1ZTtcbiAgICAgICAgICAgICAgICB0aGlzLl9oYXNUcmFpbGluZ1ZhbHVlID0gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH07XG4gICAgVGhyb3R0bGVUaW1lU3Vic2NyaWJlci5wcm90b3R5cGUuX2NvbXBsZXRlID0gZnVuY3Rpb24gKCkge1xuICAgICAgICBpZiAodGhpcy5faGFzVHJhaWxpbmdWYWx1ZSkge1xuICAgICAgICAgICAgdGhpcy5kZXN0a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lci5wcm90b3R5cGUuX2Vycm9yID0gZnVuY3Rpb24gKGVycikge1xuICAgICAgICB2YXIgd2luZG93cyA9IHRoaXMud2luZG93cztcbiAgICAgICAgd2hpbGUgKHdpbmRvd3MubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgd2luZG93cy5zaGlmdCgpLmVycm9yKGVycik7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5kZXN0aW5hdGlvbi5lcnJvcihlcnIpO1xuICAgIH07XG4gICAgV2luZG93VGltZVN1YnNjcmliZXIucHJvdG90eXBlLl9jb21wbGV0ZSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIHdpbmRvd3MgPSB0aGlzLndpbmRvd3M7XG4gICAgICAgIHdoaWxlICh3aW5kb3dzLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgIHZhciB3aW5kb3dfMiA9IHdpbmRvd3Muc2hpZnQoKTtcbiAgICAgICAgICAgIGlmICghd2luZG93XzIuY2xvc2VkKSB7XG4gICAgICAgICAgICAgICAgd2luZG93XzIuY29tcGxldGUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB0aGlzLmRlc3RpbmF0aW9uLmNvbXBsZXRlKCk7XG4gICAgfTtcbiAgICBXaW5kb3dUaW1lU3Vic2NyaWJlci5wcm90b3R5cGUub3BlbldpbmRvdyA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIHdpbmRvdyA9IG5ldyBDb3VudGVkU3ViamVjdCgpO1xuICAgICAgICB0aGlzLndpbmRvd3MucHVzaCh3aW5kb3cpO1xuICAgICAgICB2YXIgZGVzdGluYXRpb24gPSB0aGlzLmRlc3RpbmF0aW9uO1xuICAgICAgICBkZXN0aW5hdGlvbi5uZXh0KHdpbmRvdyk7XG4gICAgICAgIHJldHVybiB3aW5kb3c7XG4gICAgfTtcbiAgICBXaW5kb3dUaW1lU3Vic2NyaWJlci5wcm90b3R5cGUuY2xvc2VXaW5kb3cgPSBmdW5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4gICAgICAgIF90aGlzLmNsb3NpbmdTZWxlY3RvciA9IGNsb3NpbmdTZWxlY3RvcjtcbiAgICAgICAgX3RoaXMuY29udGV4dHMgPSBbXTtcbiAgICAgICAgX3RoaXMuYWRkKF90aGlzLm9wZW5TdWJzY3JpcHRpb24gPSBzdWJzY3JpYmVUb1Jlc3VsdF8xLnN1YnNjcmliZVRvUmVzdWx0KF90aGlzLCBvcGVuaW5ncywgb3BlbmluZ3MpKTtcbiAgICAgICAgcmV0dXJuIF90aGlzO1xuICAgIH1cbiAgICBXaW5kb3dUb2dnbGVTdWJzY3JpYmVyLnByb3RvdHlwZS5fbmV4dCA9IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICB2YXIgY29udGV4dHMgPSB0aGlzLmNvbnRleHRzO1xuICAgICAgICBpZiAoY29udGV4dHMpIHtcbiAgICAgICAgICAgIHZhciBsZW4gPSBjb250ZXh0cy5sZW5ndGg7XG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxlbjsgaSsrKSB7XG4gICAgICAgICAgICAgICAgY29udGV4dHNbaV0ud2luZG93Lm5leHQodmFsdWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfTtcbiAgICBXaW5kb3dUb2dnbGVTdWJzY3JpYmVyLnByb3RvdHlwZS5fZXJyb3IgPSBmdW5jdGlvbiAoZXJyKSB7XG4gICAgICAgIHZhciBjb250ZXh0cyA9IHRoaXMuY29udGV4dHM7XG4gICAgICAgIHRoaXMuY29udGV4dHMgPSBudWxsO1xuICAgICAgICBpZiAoY29udGV4dHMpIHtcbiAgICAgICAgICAgIHZhciBsZW4gPSBjb250ZXh0cy5sZW5ndGg7XG4gICAgICAgICAgICB2YXIgaW5kZXggPSAtMTtcbiAgICAgICAgICAgIHdoaWxlICgrK2luZGV4IDwgbGVuKSB7XG4gICAgICAgICAgICAgICAgdmFyIGNvbnRleHRfMSA9IGNvbnRleHRzW2luZGV4XTtcbiAgICAgICAgICAgICAgICBjb250ZXh0XzEud2luZG93LmVycm9yKGVycik7XG4gICAgICAgICAgICAgICAgY29udGV4dF8xLnN1YnNjcmlwdGlvbi51bnN1YnNjcmliZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIF9zdXBlci5wcm90b3R5cGUuX2Vycm9yLmNhbGwodGhpcywgZXJyKTtcbiAgICB9O1xuICAgIFdpbmRvd1RvZ2dsZVN1YnNjcmliZXIucHJvdG90eXBlLl9jb21wbGV0ZSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIGNvbnRleHRzID0gdGhpcy5jb250ZXh0cztcbiAgICAgICAgdGhpcy5jb250ZXh0cyA9IG51bGw7XG4gICAgICAgIGlmIChjb250ZXh0cykge1xuICAgICAgICAgICAgdmFyIGxlbiA9IGNvbnRleHRzLmxlbmd0aDtcbiAgICAgICAgICAgIHZhciBpbmRleCA9IC0xO1xuICAgICAgICAgICAgd2hpbGUgKCsraW5kZXggPCBsZW4pIHtcbiAgICAgICAgICAgICAgICB2YXIgY29udGV4dF8yID0gY29udGV4dHNbaW5kZXhdO1xuICAgICAgICAgICAgICAgIGNvbnRleHRfMi53aW5kb3cuY29tcGxldGUoKTtcbiAgICAgICAgICAgICAgICBjb250ZXh0XzIuc3Vic2NyaXB0aW9uLnVuc3Vic2NyaWJlKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgX3N1cGVyLnByb3RvdHlwZS5fY29tcGxldGUuY2FsbCh0aGlzKTtcbiAgICB9O1xuICAgIFdpbmRvd1RvZ2dsZVN1YnNjcmliZXIucHJvdG90eXBlLl91bnN1YnNjcmliZSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIGNvbnRleHRzID0gdGhpcy5jb250ZXh0cztcbiAgICAgICAgdGhpcy5jb250ZXh0cyA9IG51bGw7XG4gICAgICAgIGlmIChjb250ZXh0cykge1xuICAgICAgICAgICAgdmFyIGxlbiA9IGNvbnRleHRzLmxlbmd0aDtcbiAgICAgICAgICAgIHZhciBpbmRleCA9IC0xO1xuICAgICAgICAgICAgd2hpbGUgKCsraW5kZXggPCBsZW4pIHtcbiAgICAgICAgICAgICAgICB2YXIgY29udGV4dF8zID0gY29udGV4dHNbaW5kZXhdO1xuICAgICAgICAgICAgICAgIGNvbnRleHRfMy53aW5kb3cudW5zdWJzY3JpYmUoKTtcbiAgICAgICAgICAgICAgICBjb250ZXh0XzMuc3Vic2NyaXB0aW9uLnVuc3Vic2NyaWJlKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xuICAgIFdpbmRvd1RvZ2dsZVN1YnNjcmliZXIucHJvdG90eXBlLm5vdGlmeU5leHQgPSBmdW5jdGlvbiAob3V0ZXJWYWx1ZSwgaW5uZXJWYWx1ZSwgb3V0ZXJJbmRleCwgaW5uZXJJbmRleCwgaW5uZXJTdWIpIHtcbiAgICAgICAgaWYgKG91dGVyVmFsdWUgPT09IHRoaXMub3BlbmluZ3MpIHtcbiAgICAgICAgICAgIHZhciBjbG9zaW5nTm90aWZpZXIgPSB2b2lkIDA7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIHZhciBjbG9zaW5nU2VsZWN0b3IgPSB0aGlzLmNsb3NpbmdTZWxlY3RvcjtcbiAgICAgICAgICAgICAgICBjbG9zaW5nTm90aWZpZXIgPSBjbG9zaW5nU2VsZWN0b3IoaW5uZXJWYWx1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmVycm9yKGUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIHdpbmRvd18xID0gbmV3IFN1YmplY3RfMS5TdWJqZWN0KCk7XG4gICAgICAgICAgICB2YXIgc3Vic2NyaXB0aW9uID0gbmV3IFN1YnNjcmlwdGlvbl8xLlN1YnNjcmlwdGlvbigpO1xuICAgICAgICAgICAgdmFyIGNvbnRleHRfNCA9IHsgd2luZG93OiB3aW5kb3dfMSwgc3Vic2NyaXB0aW9uOiBzdWJzY3JpcHRpb24gfTtcbiAgICAgICAgICAgIHRoaXMuY29udGV4dHMucHVzaChjb250ZXh0XzQpO1xuICAgICAgICAgICAgdmFyIGlubmVyU3Vic2NyaXB0aW9uID0gc3Vic2NyaWJlVG9SZXN1bHRfMS5zdWJzY3JpYmVUb1Jlc3VsdCh0aGlzLCBjbG9zaW5nTm90aWZpZXIsIGNvbnRleHRfNCk7XG4gICAgICAgICAgICBpZiAoaW5uZXJTdWJzY3JpcHRpb24uY2xvc2VkKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5jbG9zZVdpbmRvdyh0aGlzLmNvbnRleHRzLmxlbmd0aCAtIDEpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgaW5uZXJTdWJzY3JpcHRpb24uY29udGV4dCA9IGNvbnRleHRfNDtcbiAgICAgICAgICAgICAgICBzdWJzY3JpcHRpb24uYWRkKGlubmVyU3Vic2NyaXB0aW9uKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMuZGVzdGluYXRpb24ubmV4dCh3aW5kb3dfMSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNsb3NlV2luZG93KHRoaXMuY29udGV4dHMuaW5kZXhPZihvdXRlclZhbHVlKSk7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIFdpbmRvd1RvZ2dsZVN1YnNjcmliZXIucHJvdG90eXBlLm5vdGlmeUVycm9yID0gZnVuY3Rpb24gKGVycikge1xuICAgICAgICB0aGlzLmVycm9yKGVycik7XG4gICAgfTtcbiAgICBXaW5kb3dUb2dnbGVTdWJzY3JpYmVyLnByb3RvdHlwZS5ub3RpZnlDb21wbGV0ZSA9IGZ1bmN0aW9uIChpbm5lcikge1xuICAgICAgICBpZiAoaW5uZXIgIT09IHRoaXMub3BlblN1Y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ICBpZiAodGhpcy5jbG9zaW5nTm90aWZpY2F0aW9uKSB7XG4gICAgICAgICAgICB0aGlzLmNsb3NpbmdOb3RpZmljYXRpb24udW5zdWJzY3JpYmUoKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgV2luZG93U3Vic2NyaWJlci5wcm90b3R5cGUub3BlbldpbmRvdyA9IGZ1bmN0aW9uIChpbm5lclN1Yikge1xuICAgICAgICBpZiAoaW5uZXJTdWIgPT09IHZvaWQgMCkgeyBpbm5lclN1YiA9IG51bGw7IH1cbiAgICAgICAgaWYgKGlubmVyU3ViKSB7XG4gICAgICAgICAgICB0aGlzLnJlbW92ZShpbm5lclN1Yik7XG4gICAgICAgICAgICBpbm5lclN1Yi51bnN1YnNjcmliZSgpO1xuICAgICAgICB9XG4gICAgICAgIHZhciBwcmV2V2luZG93ID0gdGhpcy53aW5kb3c7XG4gICAgICAgIGlmIChwcmV2V2luZG93KSB7XG4gICAgICAgICAgICBwcmV2V2luZG93LmNvbXBsZXRlKCk7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIHdpbmRvdyA9IHRoaXMud2luZG93ID0gbmV3IFN1YmplY3RfMS5TdWJqZWN0KCk7XG4gICAgICAgIHRoaXMuZGVzdGluYXRpb24ubmV4dCh3aW5kb3cpO1xuICAgICAgICB2YXIgY2xvc2luZ05vdGlmaWVyO1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgdmFyIGNsb3NpbmdTZWxlY3RvciA9IHRoaXMuY2xvc2luZ1NlbGVjdG9yO1xuICAgICAgICAgICAgY2xvc2luZ05vdGlmaWVyID0gY2xvc2luZ1NlbGVjdG9yKCk7XG4gICAgICAgIH1cbiAgICAgICAgY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgIHRoaXMuZGVzdGluYXRpb24uZXJyb3IoZSk7XG4gICAgICAgICAgICB0aGlzLndpbmRvdy5lcnJvcihlKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLmF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B7XG4gICAgaWYgKCFpbnB1dCkge1xuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ0l0ZXJhYmxlIGNhbm5vdCBiZSBudWxsJyk7XG4gICAgfVxuICAgIHJldHVybiBuZXcgT2JzZXJ2YWJsZV8xLk9ic2VydmFibGUoZnVuY3Rpb24gKHN1YnNjcmliZXIpIHtcbiAgICAgICAgdmFyIHN1YiA9IG5ldyBTdWJzY3JpcHRpb25fMS5TdWJzY3JpcHRpb24oKTtcbiAgICAgICAgdmFyIGl0ZXJhdG9yO1xuICAgICAgICBzdWIuYWRkKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGlmIChpdGVyYXRvciAmJiB0eXBlb2YgaXRlcmF0b3IucmV0dXJuID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICAgICAgaXRlcmF0b3IucmV0dXJuKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICBzdWIuYWRkKHNjaGVkdWxlci5zY2hlZHVsZShmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBpdGVyYXRvciA9IGlucHV0W2l0ZXJhdG9yXzEuaXRlcmF0b3JdKCk7XG4gICAgICAgICAgICBzdWIuYWRkKHNjaGVkdWxlci5zY2hlZHVsZShmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgaWYgKHN1YnNjcmliZXIuY2xvc2VkKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdmFyIHZhbHVlO1xuICAgICAgICAgICAgICAgIHZhciBkb25lO1xuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciByZXN1bHQgPSBpdGVyYXRvci5uZXh0KCk7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlID0gcmVzdWx0LnZhbHVlO1xuICAgICAgICAgICAgICAgICAgICBkb25lID0gcmVzdWx0LmRvbmU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNhdGNoIChlcnIpIHtcbiAgICAgICAgICAgICAgICAgICAgc3Vic2NyaWJlci5lcnJvcihlcnIpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChkb25lKSB7XG4gICAgICAgICAgICAgICAgICAgIHN1YnNjcmliZXIuY29tcGxldGUoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHN1YnNjcmliZXIubmV4dCh2YWx1ZSk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2NoZWR1bGUoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KSk7XG4gICAgICAgIH0pKTtcbiAgICAgICAgcmV0dXJuIHN1YjtcbiAgICB9KTtcbn1cbmV4cG9ydHMuc2NoZWR1bGVJdGVyYWJsZSA9IHNjaGVkdWxlSXRlcmFibGU7XG4vLyMgc291cmNlTWFwcGluZ1VSTD1zY2hlZHVsZUl0ZXJhYmxlLmpzLm1hcCIsIlwidXNlIHN0cmljdFwiO1xuT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsIFwiX19lc01vZHVsZVwiLCB7IHZhbHVlOiB0cnVlIH0pO1xudmFyIE9ic2VydmFibGVfMSA9IHJlcXVpcmUoXCIuLi9PYnNlcnZhYmxlXCIpO1xudmFyIFN1YnNjcmlwdGlvbl8xID0gcmVxdWlyZShcIi4uL1N1YnNjcmlwdGlvblwiKTtcbnZhciBvYnNlcnZhYmxlXzEgPSByZXF1aXJlKFwiLi4vc3ltYm9sL29ic2VydmFibGVcIik7XG5mdW5jdGlvbiBzY2hlZHVsZU9ic2VydmFibGUoaW5wdXQsIHNjaGVkdWxlcikge1xuICAgIHJldHVybiBuZXcgT2JzZXJ2YWJsZV8xLk9ic2VydmFibGUoZnVuY3Rpb24gKHN1YnNj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XG4gICAgICAgIHZhciBlcnJvclZhbHVlID0gdW5kZWZpbmVkO1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgdGhpcy53b3JrKHN0YXRlKTtcbiAgICAgICAgfVxuICAgICAgICBjYXRjaCAoZSkge1xuICAgICAgICAgICAgZXJyb3JlZCA9IHRydWU7XG4gICAgICAgICAgICBlcnJvclZhbHVlID0gISFlICYmIGUgfHwgbmV3IEVycm9yKGUpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChlcnJvcmVkKSB7XG4gICAgICAgICAgICB0aGlzLnVuc3Vic2NyaWJlKCk7XG4gICAgICAgICAgICByZXR1cm4gZXJyb3JWYWx1ZTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgQXN5bmNBY3Rpb24ucHJvdG90eXBlLl91bnN1YnNjcmliZSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIGlkID0gdGhpcy5pZDtcbiAgICAgICAgdmFyIHNjaGVkdWxlciA9IHRoaXMuc2NoZWR1bGVyO1xuICAgICAgICB2YXIgYWN0aW9ucyA9IHNjaGVkdWxlci5hY3Rpb25zO1xuICAgICAgICB2YXIgaW5kZXggPSBhY3Rpb25zLmluZGV4T2YodGhpcyk7XG4gICAgICAgIHRoaXMud29yayA9IG51bGw7XG4gICAgICAgIHRoaXMuc3RhdGUgPSBudWxsO1xuICAgICAgICB0aGlzLnBlbmRpbmcgPSBmYWxzZTtcbiAgICAgICAgdGhpcy5zY2hlZHVsZXIgPSBudWxsO1xuICAgICAgICBpZiAoaW5kZXggIT09IC0xKSB7XG4gICAgICAgICAgICBhY3Rpb25zLnNwbGljZShpbmRleCwgMSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGlkICE9IG51bGwpIHtcbiAgICAgICAgICAgIHRoaXMuaWQgPSB0aGlzLnJlY3ljbGVBc3luY0lkKHNjaGVkdWxlciwgaWQsIG51bGwpO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMuZGVsYXkgPSBudWxsO1xuIC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