webdetector/dist/test.8d1fc802.map
2018-12-19 17:17:25 +01:00

1 line
1.4 MiB
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"version":3,"sources":["../node_modules/util/support/isBufferBrowser.js","../node_modules/inherits/inherits_browser.js","../node_modules/process/browser.js","../node_modules/util/util.js","../ts/index.ts","../node_modules/tslib/tslib.es6.js","../../../src/internal/util/isFunction.ts","../../src/internal/config.ts","../../../src/internal/util/hostReportError.ts","../../src/internal/Observer.ts","../../../src/internal/util/isArray.ts","../../../src/internal/util/isObject.ts","../../../src/internal/util/errorObject.ts","../../../src/internal/util/tryCatch.ts","../../../src/internal/util/UnsubscriptionError.ts","../../src/internal/Subscription.ts","../../../src/internal/symbol/rxSubscriber.ts","../../src/internal/Subscriber.ts","../../../src/internal/util/canReportError.ts","../../../src/internal/util/toSubscriber.ts","../../../src/internal/symbol/observable.ts","../../../src/internal/util/noop.ts","../../../src/internal/util/pipe.ts","../../src/internal/Observable.ts","../../../src/internal/util/ObjectUnsubscribedError.ts","../../src/internal/SubjectSubscription.ts","../../src/internal/Subject.ts","../../../src/internal/operators/refCount.ts","../../../src/internal/observable/ConnectableObservable.ts","../../../src/internal/operators/groupBy.ts","../../src/internal/BehaviorSubject.ts","../../../src/internal/scheduler/Action.ts","../../../src/internal/scheduler/AsyncAction.ts","../../../src/internal/scheduler/QueueAction.ts","../../src/internal/Scheduler.ts","../../../src/internal/scheduler/AsyncScheduler.ts","../../../src/internal/scheduler/QueueScheduler.ts","../../../src/internal/scheduler/queue.ts","../../../src/internal/observable/empty.ts","../../../src/internal/util/isScheduler.ts","../../../src/internal/util/subscribeToArray.ts","../../../src/internal/observable/fromArray.ts","../../../src/internal/observable/scalar.ts","../../../src/internal/observable/of.ts","../../../src/internal/observable/throwError.ts","../../src/internal/Notification.ts","../../../src/internal/operators/observeOn.ts","../../src/internal/ReplaySubject.ts","../../src/internal/AsyncSubject.ts","../../../src/internal/util/Immediate.ts","../../../src/internal/scheduler/AsapAction.ts","../../../src/internal/scheduler/AsapScheduler.ts","../../../src/internal/scheduler/asap.ts","../../../src/internal/scheduler/async.ts","../../../src/internal/scheduler/AnimationFrameAction.ts","../../../src/internal/scheduler/AnimationFrameScheduler.ts","../../../src/internal/scheduler/animationFrame.ts","../../../src/internal/scheduler/VirtualTimeScheduler.ts","../../../src/internal/util/identity.ts","../../../src/internal/util/isObservable.ts","../../../src/internal/util/ArgumentOutOfRangeError.ts","../../../src/internal/util/EmptyError.ts","../../../src/internal/util/TimeoutError.ts","../../../src/internal/operators/map.ts","../../../src/internal/observable/bindCallback.ts","../../../src/internal/observable/bindNodeCallback.ts","../../src/internal/OuterSubscriber.ts","../../src/internal/InnerSubscriber.ts","../../../src/internal/util/subscribeToPromise.ts","../../../src/internal/symbol/iterator.ts","../../../src/internal/util/subscribeToIterable.ts","../../../src/internal/util/subscribeToObservable.ts","../../../src/internal/util/isArrayLike.ts","../../../src/internal/util/isPromise.ts","../../../src/internal/util/subscribeTo.ts","../../../src/internal/util/subscribeToResult.ts","../../../src/internal/observable/combineLatest.ts","../../../src/internal/util/isInteropObservable.ts","../../../src/internal/util/isIterable.ts","../../../src/internal/observable/fromPromise.ts","../../../src/internal/observable/fromIterable.ts","../../../src/internal/observable/fromObservable.ts","../../../src/internal/observable/from.ts","../../../src/internal/operators/mergeMap.ts","../../../src/internal/operators/mergeAll.ts","../../../src/internal/operators/concatAll.ts","../../../src/internal/observable/concat.ts","../../../src/internal/observable/defer.ts","../../../src/internal/observable/forkJoin.ts","../../../src/internal/observable/fromEvent.ts","../../../src/internal/observable/fromEventPattern.ts","../../../src/internal/observable/generate.ts","../../../src/internal/observable/iif.ts","../../../src/internal/util/isNumeric.ts","../../../src/internal/observable/interval.ts","../../../src/internal/observable/merge.ts","../../../src/internal/observable/never.ts","../../../src/internal/observable/onErrorResumeNext.ts","../../../src/internal/observable/pairs.ts","../../../src/internal/observable/race.ts","../../../src/internal/observable/range.ts","../../../src/internal/observable/timer.ts","../../../src/internal/observable/using.ts","../../../src/internal/observable/zip.ts","../src/index.ts","../node_modules/events/events.js","../../src/impl/util.js","../../src/impl/formats.js","../../src/impl/english.js","../../src/errors.js","../../src/zone.js","../../src/zones/localZone.js","../../src/zones/IANAZone.js","../../src/zones/fixedOffsetZone.js","../../src/zones/invalidZone.js","../../src/impl/zoneUtil.js","../../src/settings.js","../../src/impl/formatter.js","../../src/impl/locale.js","../../src/impl/regexParser.js","../../src/impl/invalid.js","../../src/duration.js","../../src/interval.js","../../src/info.js","../../src/impl/diff.js","../../src/impl/tokenParser.js","../../src/impl/conversions.js","../../src/datetime.js","../ts/smarttime.plugins.ts","../ts/smarttime.classes.date.ts","../ts/smarttime.classes.hrtmeasurement.ts","../ts/smarttime.classes.timestamp.ts","../ts/smarttime.classes.timer.ts","../ts/smarttime.units.ts","../node_modules/path-browserify/index.js","../node_modules/concat-map/index.js","../node_modules/balanced-match/index.js","../node_modules/brace-expansion/index.js","../node_modules/minimatch/minimatch.js","../node_modules/symbol-tree/lib/SymbolTreeNode.js","../node_modules/symbol-tree/lib/TreePosition.js","../node_modules/symbol-tree/lib/TreeIterator.js","../node_modules/symbol-tree/lib/SymbolTree.js","../ts/lik.plugins.ts","../ts/lik.objectmap.ts","../ts/lik.interestmap.interest.ts","../ts/lik.interestmap.ts","../ts/lik.limitedarray.ts","../ts/lik.looptracker.ts","../ts/lik.stringmap.ts","../ts/lik.tree.ts","../ts/smartrx.classes.observablemap.ts","../ts/smartevent.plugins.ts","../ts/smartrx.plugins.ts","../ts/smartrx.classes.observableintake.ts","../ts/webdetector.plugins.ts","../../../src/internal/operators/audit.ts","../../../src/internal/operators/auditTime.ts","../../../src/internal/operators/buffer.ts","../../../src/internal/operators/bufferCount.ts","../../../src/internal/operators/bufferTime.ts","../../../src/internal/operators/bufferToggle.ts","../../../src/internal/operators/bufferWhen.ts","../../../src/internal/operators/catchError.ts","../../../src/internal/operators/combineAll.ts","../../../src/internal/operators/combineLatest.ts","../../../src/internal/operators/concat.ts","../../../src/internal/operators/concatMap.ts","../../../src/internal/operators/concatMapTo.ts","../../../src/internal/operators/count.ts","../../../src/internal/operators/debounce.ts","../../../src/internal/operators/debounceTime.ts","../../../src/internal/operators/defaultIfEmpty.ts","../../../src/internal/util/isDate.ts","../../../src/internal/operators/delay.ts","../../../src/internal/operators/delayWhen.ts","../../../src/internal/operators/dematerialize.ts","../../../src/internal/operators/distinct.ts","../../../src/internal/operators/distinctUntilChanged.ts","../../../src/internal/operators/distinctUntilKeyChanged.ts","../../../src/internal/operators/filter.ts","../../../src/internal/operators/tap.ts","../../../src/internal/operators/throwIfEmpty.ts","../../../src/internal/operators/take.ts","../../../src/internal/operators/elementAt.ts","../../../src/internal/operators/endWith.ts","../../../src/internal/operators/every.ts","../../../src/internal/operators/exhaust.ts","../../../src/internal/operators/exhaustMap.ts","../../../src/internal/operators/expand.ts","../../../src/internal/operators/finalize.ts","../../../src/internal/operators/find.ts","../../../src/internal/operators/findIndex.ts","../../../src/internal/operators/first.ts","../../../src/internal/operators/ignoreElements.ts","../../../src/internal/operators/isEmpty.ts","../../../src/internal/operators/takeLast.ts","../../../src/internal/operators/last.ts","../../../src/internal/operators/mapTo.ts","../../../src/internal/operators/materialize.ts","../../../src/internal/operators/scan.ts","../../../src/internal/operators/reduce.ts","../../../src/internal/operators/max.ts","../../../src/internal/operators/merge.ts","../../../src/internal/operators/mergeMapTo.ts","../../../src/internal/operators/mergeScan.ts","../../../src/internal/operators/min.ts","../../../src/internal/operators/multicast.ts","../../../src/internal/operators/onErrorResumeNext.ts","../../../src/internal/operators/pairwise.ts","../../../src/internal/util/not.ts","../../../src/internal/operators/partition.ts","../../../src/internal/operators/pluck.ts","../../../src/internal/operators/publish.ts","../../../src/internal/operators/publishBehavior.ts","../../../src/internal/operators/publishLast.ts","../../../src/internal/operators/publishReplay.ts","../../../src/internal/operators/race.ts","../../../src/internal/operators/repeat.ts","../../../src/internal/operators/repeatWhen.ts","../../../src/internal/operators/retry.ts","../../../src/internal/operators/retryWhen.ts","../../../src/internal/operators/sample.ts","../../../src/internal/operators/sampleTime.ts","../../../src/internal/operators/sequenceEqual.ts","../../../src/internal/operators/share.ts","../../../src/internal/operators/shareReplay.ts","../../../src/internal/operators/single.ts","../../../src/internal/operators/skip.ts","../../../src/internal/operators/skipLast.ts","../../../src/internal/operators/skipUntil.ts","../../../src/internal/operators/skipWhile.ts","../../../src/internal/operators/startWith.ts","../../../src/internal/observable/SubscribeOnObservable.ts","../../../src/internal/operators/subscribeOn.ts","../../../src/internal/operators/switchMap.ts","../../../src/internal/operators/switchAll.ts","../../../src/internal/operators/switchMapTo.ts","../../../src/internal/operators/takeUntil.ts","../../../src/internal/operators/takeWhile.ts","../../../src/internal/operators/throttle.ts","../../../src/internal/operators/throttleTime.ts","../../../src/internal/operators/timeInterval.ts","../../../src/internal/operators/timeoutWith.ts","../../../src/internal/operators/timeout.ts","../../../src/internal/operators/timestamp.ts","../../../src/internal/operators/toArray.ts","../../../src/internal/operators/window.ts","../../../src/internal/operators/windowCount.ts","../../../src/internal/operators/windowTime.ts","../../../src/internal/operators/windowToggle.ts","../../../src/internal/operators/windowWhen.ts","../../../src/internal/operators/withLatestFrom.ts","../../../src/internal/operators/zip.ts","../../../src/internal/operators/zipAll.ts","../../src/operators/index.ts","test.ts"],"names":["process","module","exports","cachedSetTimeout","cachedClearTimeout","defaultSetTimout","Error","defaultClearTimeout","setTimeout","e","clearTimeout","runTimeout","fun","call","runClearTimeout","marker","queue","draining","currentQueue","queueIndex","cleanUpNextTick","length","concat","drainQueue","timeout","len","run","nextTick","args","Array","arguments","i","push","Item","array","prototype","apply","title","browser","env","argv","version","versions","noop","on","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","name","binding","cwd","chdir","dir","umask","formatRegExp","format","f","isString","objects","inspect","join","str","String","replace","x","Number","JSON","stringify","_","isNull","isObject","deprecate","fn","msg","isUndefined","global","noDeprecation","warned","deprecated","throwDeprecation","traceDeprecation","console","trace","error","debugs","debugEnviron","debuglog","set","toUpperCase","RegExp","test","pid","obj","opts","ctx","seen","stylize","stylizeNoColor","depth","colors","isBoolean","showHidden","_extend","customInspect","stylizeWithColor","formatValue","styles","styleType","style","arrayToHash","hash","forEach","val","idx","value","recurseTimes","isFunction","constructor","ret","primitive","formatPrimitive","keys","Object","visibleKeys","getOwnPropertyNames","isError","indexOf","formatError","isRegExp","toString","isDate","Date","base","braces","isArray","n","toUTCString","output","formatArray","map","key","formatProperty","pop","reduceToSingleString","simple","isNumber","l","hasOwnProperty","match","desc","getOwnPropertyDescriptor","get","split","line","substr","numLinesEst","reduce","prev","cur","ar","arg","isNullOrUndefined","isSymbol","re","objectToString","d","isPrimitive","isBuffer","require","o","pad","months","timestamp","time","getHours","getMinutes","getSeconds","getDate","getMonth","log","inherits","origin","add","prop","extendStatics","b","setPrototypeOf","__proto__","p","__extends","__","create","__assign","assign","t","s","__rest","getOwnPropertySymbols","__decorate","decorators","target","c","r","Reflect","decorate","defineProperty","__param","paramIndex","decorator","__metadata","metadataKey","metadataValue","metadata","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","step","next","rejected","result","done","then","__generator","body","label","sent","trys","ops","y","g","verb","Symbol","iterator","v","op","TypeError","__exportStar","m","__values","__read","__spread","__await","__asyncGenerator","asyncIterator","q","a","resume","settle","fulfill","shift","__asyncDelegator","__asyncValues","__makeTemplateObject","cooked","raw","__importStar","mod","__esModule","k","default","__importDefault","EventEmitter","_events","_maxListeners","undefined","defaultMaxListeners","setMaxListeners","isNaN","type","er","handler","err","context","slice","listener","newListener","fired","list","position","splice","listenerCount","evlistener","emitter","hasIntl","Intl","DateTimeFormat","hasFormatToParts","formatToParts","maybeArray","thing","bestBy","arr","by","compare","best","pair","pick","numberBetween","bottom","top","floorMod","Math","floor","padStart","input","repeat","parseMillis","fraction","NaN","parseFloat","roundTo","number","digits","factor","round","isLeapYear","year","daysInYear","daysInMonth","month","modMonth","modYear","weeksInWeekYear","weekYear","p1","last","p2","untruncateYear","parseZoneInfo","ts","offsetFormat","locale","timeZone","date","intlOpts","hour12","day","hour","minute","modified","timeZoneName","intl","parsed","find","toLowerCase","without","included","diffed","substring","trimmed","signedOffset","offHourStr","offMinuteStr","offHour","parseInt","offMin","offMinSigned","normalizeObject","normalizer","ignoreUnknown","normalized","u","mapped","timeObject","d2","DATE_SHORT","DATE_MED","DATE_FULL","DATE_HUGE","weekday","TIME_SIMPLE","TIME_WITH_SECONDS","second","TIME_WITH_SHORT_OFFSET","TIME_WITH_LONG_OFFSET","TIME_24_SIMPLE","TIME_24_WITH_SECONDS","TIME_24_WITH_SHORT_OFFSET","TIME_24_WITH_LONG_OFFSET","DATETIME_SHORT","DATETIME_SHORT_WITH_SECONDS","DATETIME_MED","DATETIME_MED_WITH_SECONDS","DATETIME_FULL","DATETIME_FULL_WITH_SECONDS","DATETIME_HUGE","DATETIME_HUGE_WITH_SECONDS","sort","monthsLong","monthsShort","monthsNarrow","weekdaysLong","weekdaysShort","weekdaysNarrow","weekdays","meridiems","erasLong","erasShort","erasNarrow","eras","meridiemForDateTime","dt","weekdayForDateTime","monthForDateTime","eraForDateTime","formatString","knownFormat","filtered","dateTimeHuge","Formats","LuxonError","InvalidDateTimeError","reason","toMessage","InvalidIntervalError","InvalidDurationError","ConflictingSpecificationError","InvalidUnitError","unit","InvalidArgumentError","ZoneIsAbstractError","Zone","offsetName","offset","equals","otherZone","singleton","LocalZone","getTimezoneOffset","resolvedOptions","dtfCache","makeDTF","zone","typeToPos","hackyOffset","dtf","formatted","exec","fMonth","fDay","fYear","fHour","fMinute","fSecond","partsOffset","filled","pos","IANAZone","isValidSpecifier","isValidZone","parseGMTOffset","specifier","zoneName","valid","asUTC","UTC","asTS","valueOf","hoursMinutesOffset","z","hours","trunc","fixed","minutes","abs","sign","FixedOffsetZone","instance","utcInstance","parseSpecifier","InvalidZone","normalizeZone","defaultZone","lowered","now","defaultLocale","defaultNumberingSystem","defaultOutputCalendar","throwOnInvalid","Settings","resetCaches","Locale","resetCache","numberingSystem","outputCalendar","stringifyTokens","splits","tokenToString","token","literal","tokenToObject","D","DD","DDD","DDDD","tt","ttt","tttt","T","TT","TTT","TTTT","ff","fff","ffff","F","FF","FFF","FFFF","Formatter","parseFormat","fmt","current","currentFull","bracketed","charAt","formatOpts","loc","systemLoc","formatWithSystemDefault","redefaultToSystem","df","dtFormatter","formatDateTime","formatDateTimeParts","num","forceSimple","padTo","numberFormatter","formatDateTimeFromString","knownEnglish","listingMode","string","extract","formatOffset","isOffsetFixed","allowZ","RangeError","meridiem","English","standalone","maybeMacro","macro","era","outputCal","millisecond","offsetNameShort","offsetNameLong","weekNumber","ordinal","quarter","formatDurationFromString","dur","tokenToField","lildur","tokens","realTokens","found","collapsed","shiftTo","filter","intlDTCache","getCachedDTF","locString","intlNumCache","getCachendINF","inf","NumberFormat","sysLocaleCache","systemLocale","computedSys","parseLocaleString","localeStr","uIndex","options","smaller","calendar","intlConfigString","mapMonths","ms","DateTime","utc","mapWeekdays","listStuff","defaultOK","englishFn","intlFn","mode","supportsFastNumbers","startsWith","SimpleNumberFormatter","IntlNumberFormatter","useGrouping","minimumIntegerDigits","PolyDateFormatter","universal","fromMillis","toJSDate","tokenFormat","fromOpts","defaultToEN","specifiedLocale","localeR","numberingSystemR","outputCalendarR","fromObject","numbering","parsedLocale","parsedNumberingSystem","parsedOutputCalendar","weekdaysCache","monthsCache","meridiemCache","eraCache","fastNumbersCached","hasFTP","isActuallyEn","hasNoWeirdness","clone","alts","redefaultToEN","formatStr","field","results","matching","fastNumbers","other","combineRegexes","regexes","full","source","combineExtractors","extractors","ex","mergedVals","mergedZone","cursor","parse","patterns","regex","extractor","simpleParse","offsetRegex","isoTimeBaseRegex","isoTimeRegex","isoTimeExtensionRegex","isoYmdRegex","isoWeekRegex","isoOrdinalRegex","extractISOWeekData","extractISOOrdinalData","sqlYmdRegex","sqlTimeRegex","sqlTimeExtensionRegex","extractISOYmd","item","extractISOTime","extractISOOffset","local","fullOffset","extractIANAZone","isoDuration","extractISODuration","yearStr","monthStr","dayStr","hourStr","minuteStr","secondStr","millisecondsStr","weekStr","years","weeks","days","seconds","milliseconds","obsOffsets","GMT","EDT","EST","CDT","CST","MDT","MST","PDT","PST","fromStrings","weekdayStr","rfc2822","extractRFC2822","obsOffset","milOffset","preprocessRFC2822","trim","rfc1123","rfc850","ascii","extractRFC1123Or850","extractASCII","parseISODate","parseRFC2822Date","parseHTTPDate","parseISODuration","parseSQL","Invalid","explanation","INVALID","lowOrderMatrix","casualMatrix","quarters","daysInYearAccurate","daysInMonthAccurate","accurateMatrix","orderedUnits","reverseUnits","reverse","clear","conf","values","conversionAccuracy","Duration","antiTrunc","ceil","convert","matrix","fromMap","fromUnit","toMap","toUnit","conv","sameSign","added","normalizeValues","vals","previous","config","accurate","invalid","isLuxonDuration","count","normalizeUnit","fromISO","text","week","isDuration","toFormat","fmtOpts","isValid","toObject","includeConfig","toISO","toJSON","as","plus","duration","friendlyDuration","minus","negate","mixed","reconfigure","normalize","units","built","accumulated","lastUnit","own","ak","down","negated","durationish","validateStartEnd","start","end","Interval","isLuxonInterval","fromDateTimes","builtStart","friendlyDateTime","builtEnd","after","before","isInterval","toDuration","startOf","diff","hasSame","isEmpty","isAfter","dateTime","isBefore","contains","splitAt","dateTimes","sorted","splitBy","divideEqually","numberOfParts","overlaps","abutsStart","abutsEnd","engulfs","intersection","union","merge","intervals","sofar","final","xor","currentCount","ends","flattened","difference","dateFormat","separator","invalidReason","Info","hasDST","proto","setZone","isValidIANAZone","monthsFormat","weekdaysFormat","features","intlTokens","zones","dayDiff","earlier","later","utcDayStart","toUTC","keepLocalTime","highOrderDiffs","differs","lowestOrder","highWater","differ","delta","remainingMillis","lowerOrderUnits","MISSING_FTP","intUnit","post","deser","fixListRegex","stripInsensitivities","oneOf","strings","startIndex","findIndex","groups","h","unitForToken","one","two","three","four","oneOrTwo","oneToThree","twoToFour","unitate","buildRegex","handlers","matches","all","matchIndex","dateTimeFromMatches","toField","Z","G","S","explainFromTokens","disqualifyingUnit","regexString","rawMatches","parseFromTokens","nonLeapLadder","leapLadder","unitOutOfRange","dayOfWeek","js","getUTCDay","computeOrdinal","uncomputeOrdinal","table","month0","gregorianToWeek","gregObj","weekToGregorian","weekData","weekdayOfJan4","yearInDays","gregorianToOrdinal","gregData","ordinalToGregorian","ordinalData","hasInvalidWeekData","validYear","validWeek","validWeekday","hasInvalidOrdinalData","validOrdinal","hasInvalidGregorianData","validMonth","validDay","hasInvalidTimeData","validHour","validMinute","validSecond","validMillisecond","secon","unsupportedZone","possiblyCachedWeekData","inst","old","fixOffset","localTS","tz","utcGuess","o2","o3","min","max","tsToObj","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","objToLocalTS","setUTCFullYear","objToTS","adjustTime","oPre","millisToAdd","parseDataToDateTime","parsedZone","interpretationZone","toTechFormat","toTechTimeFormat","suppressSeconds","suppressMilliseconds","includeOffset","includeZone","spaceZone","defaultUnitValues","defaultWeekUnitValues","defaultOrdinalUnitValues","orderedWeekUnits","orderedOrdinalUnits","weeknumber","weeksnumber","weeknumbers","weekyear","weekyears","quickDT","tsNow","offsetProvis","unchanged","isLuxonDateTime","fromJSDate","fromSeconds","zoneToUse","containsOrdinal","containsGregorYear","containsGregorMD","containsGregor","definiteWeekDef","useWeekData","defaultValues","objNow","foundFirst","higherOrderInvalid","gregorian","tsFinal","offsetFinal","fromRFC2822","fromHTTP","fromFormat","localeToUse","fromString","fromSQL","isDateTime","resolvedLocaleOpts","toLocal","keepCalendarTime","newTS","setLocale","settingWeekStuff","normalizedUnit","endOf","toLocaleString","toLocaleParts","toISODate","toISOTime","toISOWeekDate","toRFC2822","toHTTP","toSQLDate","toSQLTime","toSQL","toMillis","toSeconds","toBSON","otherDateTime","otherIsLater","diffNow","until","inputMs","fromFormatExplain","fromStringExplain","dateTimeish"],"mappings":";;;;;;;;;;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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChOA;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;;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC35BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtDA;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;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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A5B,CAAlB;AAGsB,iBAAA,CAAA;AAAA;AAAA,YAAM,eAAe,CAAC,QAAhB,EAAN,CAAA;;;AAAtB,UAAA,mBAAmB,GAAG,EAAA,CAAA,IAAA,EAAtB;AACN,UAAA,OAAO,CAAC,GAAR,CAAY,oBAAZ;AACA,UAAA,OAAO,CAAC,GAAR,CAAY,mBAAZ;AACA,UAAA,eAAe,CAAC,mBAAhB;AACA,UAAA,eAAe,CAAC,gBAAhB,CAAiC,SAAjC,CAA2C,UAAC,KAAD,EAAM;AAC/C,YAAA,OAAO,CAAC,GAAR,CAAY,KAAZ;AACD,WAFD;;;;;;GARU,CAAA;AAWX,CAXD;;AAYA,GAAG","file":"test.8d1fc802.map","sourceRoot":"../test","sourcesContent":["module.exports = function isBuffer(arg) {\n return arg && typeof arg === 'object'\n && typeof arg.copy === 'function'\n && typeof arg.fill === 'function'\n && typeof arg.readUInt8 === 'function';\n}","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar formatRegExp = /%[sdj%]/g;\nexports.format = function(f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0; i < arguments.length; i++) {\n objects.push(inspect(arguments[i]));\n }\n return objects.join(' ');\n }\n\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace(formatRegExp, function(x) {\n if (x === '%%') return '%';\n if (i >= len) return x;\n switch (x) {\n case '%s': return String(args[i++]);\n case '%d': return Number(args[i++]);\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n default:\n return x;\n }\n });\n for (var x = args[i]; i < len; x = args[++i]) {\n if (isNull(x) || !isObject(x)) {\n str += ' ' + x;\n } else {\n str += ' ' + inspect(x);\n }\n }\n return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexports.deprecate = function(fn, msg) {\n // Allow for deprecating things in the process of starting up.\n if (isUndefined(global.process)) {\n return function() {\n return exports.deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n if (process.noDeprecation === true) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n throw new Error(msg);\n } else if (process.traceDeprecation) {\n console.trace(msg);\n } else {\n console.error(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnviron;\nexports.debuglog = function(set) {\n if (isUndefined(debugEnviron))\n debugEnviron = process.env.NODE_DEBUG || '';\n set = set.toUpperCase();\n if (!debugs[set]) {\n if (new RegExp('\\\\b' + set + '\\\\b', 'i').test(debugEnviron)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = exports.format.apply(exports, arguments);\n console.error('%s %d: %s', set, pid, msg);\n };\n } else {\n debugs[set] = function() {};\n }\n }\n return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nfunction inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if (isBoolean(opts)) {\n // legacy...\n ctx.showHidden = opts;\n } else if (opts) {\n // got an \"options\" object\n exports._extend(ctx, opts);\n }\n // set default options\n if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if (isUndefined(ctx.depth)) ctx.depth = 2;\n if (isUndefined(ctx.colors)) ctx.colors = false;\n if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}\nexports.inspect = inspect;\n\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n 'bold' : [1, 22],\n 'italic' : [3, 23],\n 'underline' : [4, 24],\n 'inverse' : [7, 27],\n 'white' : [37, 39],\n 'grey' : [90, 39],\n 'black' : [30, 39],\n 'blue' : [34, 39],\n 'cyan' : [36, 39],\n 'green' : [32, 39],\n 'magenta' : [35, 39],\n 'red' : [31, 39],\n 'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n 'special': 'cyan',\n 'number': 'yellow',\n 'boolean': 'yellow',\n 'undefined': 'grey',\n 'null': 'bold',\n 'string': 'green',\n 'date': 'magenta',\n // \"name\": intentionally not styling\n 'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n var style = inspect.styles[styleType];\n\n if (style) {\n return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n '\\u001b[' + inspect.colors[style][1] + 'm';\n } else {\n return str;\n }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n return str;\n}\n\n\nfunction arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect &&\n value &&\n isFunction(value.inspect) &&\n // Filter out the util module, it's inspect function is special\n value.inspect !== exports.inspect &&\n // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret)) {\n ret = formatValue(ctx, ret, recurseTimes);\n }\n return ret;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n if (ctx.showHidden) {\n keys = Object.getOwnPropertyNames(value);\n }\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (isError(value)\n && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '', array = false, braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') + '\\'';\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value))\n return ctx.stylize('' + value, 'number');\n if (isBoolean(value))\n return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value))\n return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n String(i), true));\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n key, true));\n }\n });\n return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n').substr(2);\n } else {\n str = '\\n' + str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.substr(1, name.length - 2);\n name = ctx.stylize(name, 'name');\n } else {\n name = name.replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1];\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nfunction isArray(ar) {\n return Array.isArray(ar);\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = require('./support/isBuffer');\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n 'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n var d = new Date();\n var time = [pad(d.getHours()),\n pad(d.getMinutes()),\n pad(d.getSeconds())].join(':');\n return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexports.log = function() {\n console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nexports.inherits = require('inherits');\n\nexports._extend = function(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !isObject(add)) return origin;\n\n var keys = Object.keys(add);\n var i = keys.length;\n while (i--) {\n origin[keys[i]] = add[keys[i]];\n }\n return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n","import * as util from 'util';\n\nexport interface IResolve<T> {\n (value?: T | Promise<T>): void;\n}\n\nexport interface IReject {\n (reason?: any): void;\n}\n\nexport type TDeferredStatus = 'pending' | 'fulfilled' | 'rejected';\n\nexport class Deferred<T> {\n promise: Promise<T>;\n resolve: IResolve<T>;\n reject: IReject;\n status: TDeferredStatus;\n constructor() {\n this.promise = new Promise<T>((resolve, reject) => {\n this.resolve = resolve;\n this.reject = reject;\n this.status = 'pending';\n });\n }\n}\n\nexport let defer = <T>() => {\n return new Deferred<T>();\n};\n\n/**\n * Creates a new resolved promise for the provided value.\n */\nexport let resolvedPromise = <T>(value?: T): Promise<T> => {\n return Promise.resolve(value);\n};\n\n/**\n * Creates a new rejected promise for the provided reason.\n */\nexport let rejectedPromise = err => {\n return Promise.reject(err);\n};\n\nexport let promisify = util.promisify;\n\nexport let map = async <T>(inputArg: T[], functionArg) => {\n let promisifedFunction = promisify(functionArg);\n let promiseArray: Promise<any>[] = [];\n let resultArray = [];\n for (let item of inputArg) {\n let promise: Promise<any> = promisifedFunction(item);\n promiseArray.push(promise);\n promise.then(x => {\n resultArray.push(x);\n });\n }\n await Promise.all(promiseArray);\n return resultArray;\n};\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","export function isFunction(x: any): x is Function {\n return typeof x === 'function';\n}\n","let _enable_super_gross_mode_that_will_cause_bad_things = false;\n\n/**\n * The global configuration object for RxJS, used to configure things\n * like what Promise contructor should used to create Promises\n */\nexport const config = {\n /**\n * The promise constructor used by default for methods such as\n * {@link toPromise} and {@link forEach}\n */\n Promise: undefined as PromiseConstructorLike,\n\n /**\n * If true, turns on synchronous error rethrowing, which is a deprecated behavior\n * in v6 and higher. This behavior enables bad patterns like wrapping a subscribe\n * call in a try/catch block. It also enables producer interference, a nasty bug\n * where a multicast can be broken for all observers by a downstream consumer with\n * an unhandled error. DO NOT USE THIS FLAG UNLESS IT'S NEEDED TO BY TIME\n * FOR MIGRATION REASONS.\n */\n set useDeprecatedSynchronousErrorHandling(value: boolean) {\n if (value) {\n const error = new Error();\n console.warn('DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \\n' + error.stack);\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\n get useDeprecatedSynchronousErrorHandling() {\n return _enable_super_gross_mode_that_will_cause_bad_things;\n },\n};\n","/**\n * Throws an error on another job so that it's picked up by the runtime's\n * uncaught error handling mechanism.\n * @param err the error to throw\n */\nexport function hostReportError(err: any) {\n setTimeout(() => { throw err; });\n}","import { Observer } from './types';\nimport { config } from './config';\nimport { hostReportError } from './util/hostReportError';\n\nexport const empty: Observer<any> = {\n closed: true,\n next(value: any): void { /* noop */},\n error(err: any): void {\n if (config.useDeprecatedSynchronousErrorHandling) {\n throw err;\n } else {\n hostReportError(err);\n }\n },\n complete(): void { /*noop*/ }\n};\n","export const isArray = Array.isArray || (<T>(x: any): x is T[] => x && typeof x.length === 'number');\n","export function isObject(x: any): x is Object {\n return x != null && typeof x === 'object';\n}\n","// typeof any so that it we don't have to cast when comparing a result to the error object\nexport const errorObject: any = { e: {} };","import { errorObject } from './errorObject';\n\nlet tryCatchTarget: Function;\n\nfunction tryCatcher(this: any): any {\n try {\n return tryCatchTarget.apply(this, arguments);\n } catch (e) {\n errorObject.e = e;\n return errorObject;\n }\n}\n\nexport function tryCatch<T extends Function>(fn: T): T {\n tryCatchTarget = fn;\n return <any>tryCatcher;\n}\n","export interface UnsubscriptionError extends Error {\n readonly errors: any[];\n}\n\nexport interface UnsubscriptionErrorCtor {\n new(errors: any[]): UnsubscriptionError;\n}\n\nfunction UnsubscriptionErrorImpl(this: any, errors: any[]) {\n Error.call(this);\n this.message = errors ?\n `${errors.length} errors occurred during unsubscription:\n${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\\n ')}` : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n return this;\n}\n\nUnsubscriptionErrorImpl.prototype = Object.create(Error.prototype);\n\n/**\n * An error thrown when one or more errors have occurred during the\n * `unsubscribe` of a {@link Subscription}.\n */\nexport const UnsubscriptionError: UnsubscriptionErrorCtor = UnsubscriptionErrorImpl as any;","import { isArray } from './util/isArray';\nimport { isObject } from './util/isObject';\nimport { isFunction } from './util/isFunction';\nimport { tryCatch } from './util/tryCatch';\nimport { errorObject } from './util/errorObject';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { SubscriptionLike, TeardownLogic } from './types';\n\n/**\n * Represents a disposable resource, such as the execution of an Observable. A\n * Subscription has one important method, `unsubscribe`, that takes no argument\n * and just disposes the resource held by the subscription.\n *\n * Additionally, subscriptions may be grouped together through the `add()`\n * method, which will attach a child Subscription to the current Subscription.\n * When a Subscription is unsubscribed, all its children (and its grandchildren)\n * will be unsubscribed as well.\n *\n * @class Subscription\n */\nexport class Subscription implements SubscriptionLike {\n /** @nocollapse */\n public static EMPTY: Subscription = (function(empty: any) {\n empty.closed = true;\n return empty;\n }(new Subscription()));\n\n /**\n * A flag to indicate whether this Subscription has already been unsubscribed.\n * @type {boolean}\n */\n public closed: boolean = false;\n\n /** @internal */\n protected _parent: Subscription = null;\n /** @internal */\n protected _parents: Subscription[] = null;\n /** @internal */\n private _subscriptions: SubscriptionLike[] = null;\n\n /**\n * @param {function(): void} [unsubscribe] A function describing how to\n * perform the disposal of resources when the `unsubscribe` method is called.\n */\n constructor(unsubscribe?: () => void) {\n if (unsubscribe) {\n (<any> this)._unsubscribe = unsubscribe;\n }\n }\n\n /**\n * Disposes the resources held by the subscription. May, for instance, cancel\n * an ongoing Observable execution or cancel any other type of work that\n * started when the Subscription was created.\n * @return {void}\n */\n unsubscribe(): void {\n let hasErrors = false;\n let errors: any[];\n\n if (this.closed) {\n return;\n }\n\n let { _parent, _parents, _unsubscribe, _subscriptions } = (<any> this);\n\n this.closed = true;\n this._parent = null;\n this._parents = null;\n // null out _subscriptions first so any child subscriptions that attempt\n // to remove themselves from this subscription will noop\n this._subscriptions = null;\n\n let index = -1;\n let len = _parents ? _parents.length : 0;\n\n // if this._parent is null, then so is this._parents, and we\n // don't have to remove ourselves from any parent subscriptions.\n while (_parent) {\n _parent.remove(this);\n // if this._parents is null or index >= len,\n // then _parent is set to null, and the loop exits\n _parent = ++index < len && _parents[index] || null;\n }\n\n if (isFunction(_unsubscribe)) {\n let trial = tryCatch(_unsubscribe).call(this);\n if (trial === errorObject) {\n hasErrors = true;\n errors = errors || (\n errorObject.e instanceof UnsubscriptionError ?\n flattenUnsubscriptionErrors(errorObject.e.errors) : [errorObject.e]\n );\n }\n }\n\n if (isArray(_subscriptions)) {\n\n index = -1;\n len = _subscriptions.length;\n\n while (++index < len) {\n const sub = _subscriptions[index];\n if (isObject(sub)) {\n let trial = tryCatch(sub.unsubscribe).call(sub);\n if (trial === errorObject) {\n hasErrors = true;\n errors = errors || [];\n let err = errorObject.e;\n if (err instanceof UnsubscriptionError) {\n errors = errors.concat(flattenUnsubscriptionErrors(err.errors));\n } else {\n errors.push(err);\n }\n }\n }\n }\n }\n\n if (hasErrors) {\n throw new UnsubscriptionError(errors);\n }\n }\n\n /**\n * Adds a tear down to be called during the unsubscribe() of this\n * Subscription.\n *\n * If the tear down being added is a subscription that is already\n * unsubscribed, is the same reference `add` is being called on, or is\n * `Subscription.EMPTY`, it will not be added.\n *\n * If this subscription is already in an `closed` state, the passed\n * tear down logic will be executed immediately.\n *\n * @param {TeardownLogic} teardown The additional logic to execute on\n * teardown.\n * @return {Subscription} Returns the Subscription used or created to be\n * added to the inner subscriptions list. This Subscription can be used with\n * `remove()` to remove the passed teardown logic from the inner subscriptions\n * list.\n */\n add(teardown: TeardownLogic): Subscription {\n if (!teardown || (teardown === Subscription.EMPTY)) {\n return Subscription.EMPTY;\n }\n\n if (teardown === this) {\n return this;\n }\n\n let subscription = (<Subscription> teardown);\n\n switch (typeof teardown) {\n case 'function':\n subscription = new Subscription(<(() => void) > teardown);\n case 'object':\n if (subscription.closed || typeof subscription.unsubscribe !== 'function') {\n return subscription;\n } else if (this.closed) {\n subscription.unsubscribe();\n return subscription;\n } else if (typeof subscription._addParent !== 'function' /* quack quack */) {\n const 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 const subscriptions = this._subscriptions || (this._subscriptions = []);\n\n subscriptions.push(subscription);\n subscription._addParent(this);\n\n return subscription;\n }\n\n /**\n * Removes a Subscription from the internal list of subscriptions that will\n * unsubscribe during the unsubscribe process of this Subscription.\n * @param {Subscription} subscription The subscription to remove.\n * @return {void}\n */\n remove(subscription: Subscription): void {\n const subscriptions = this._subscriptions;\n if (subscriptions) {\n const subscriptionIndex = subscriptions.indexOf(subscription);\n if (subscriptionIndex !== -1) {\n subscriptions.splice(subscriptionIndex, 1);\n }\n }\n }\n\n /** @internal */\n private _addParent(parent: Subscription) {\n let { _parent, _parents } = this;\n if (!_parent || _parent === parent) {\n // If we don't have a parent, or the new parent is the same as the\n // current parent, then set this._parent to the new parent.\n this._parent = parent;\n } else if (!_parents) {\n // If there's already one parent, but not multiple, allocate an Array to\n // store the rest of the parent Subscriptions.\n this._parents = [parent];\n } else if (_parents.indexOf(parent) === -1) {\n // Only add the new parent to the _parents list if it's not already there.\n _parents.push(parent);\n }\n }\n}\n\nfunction flattenUnsubscriptionErrors(errors: any[]) {\n return errors.reduce((errs, err) => errs.concat((err instanceof UnsubscriptionError) ? err.errors : err), []);\n}\n","/** @deprecated do not use, this is no longer checked by RxJS internals */\nexport const rxSubscriber =\n typeof Symbol === 'function'\n ? Symbol('rxSubscriber')\n : '@@rxSubscriber_' + Math.random();\n\n/**\n * @deprecated use rxSubscriber instead\n */\nexport const $$rxSubscriber = rxSubscriber;\n","import { isFunction } from './util/isFunction';\nimport { empty as emptyObserver } from './Observer';\nimport { Observer, PartialObserver, TeardownLogic } from './types';\nimport { Subscription } from './Subscription';\nimport { rxSubscriber as rxSubscriberSymbol } from '../internal/symbol/rxSubscriber';\nimport { config } from './config';\nimport { hostReportError } from './util/hostReportError';\n\n/**\n * Implements the {@link Observer} interface and extends the\n * {@link Subscription} class. While the {@link Observer} is the public API for\n * consuming the values of an {@link Observable}, all Observers get converted to\n * a Subscriber, in order to provide Subscription-like capabilities such as\n * `unsubscribe`. Subscriber is a common type in RxJS, and crucial for\n * implementing operators, but it is rarely used as a public API.\n *\n * @class Subscriber<T>\n */\nexport class Subscriber<T> extends Subscription implements Observer<T> {\n\n [rxSubscriberSymbol]() { return this; }\n\n /**\n * A static factory for a Subscriber, given a (potentially partial) definition\n * of an Observer.\n * @param {function(x: ?T): void} [next] The `next` callback of an Observer.\n * @param {function(e: ?any): void} [error] The `error` callback of an\n * Observer.\n * @param {function(): void} [complete] The `complete` callback of an\n * Observer.\n * @return {Subscriber<T>} A Subscriber wrapping the (partially defined)\n * Observer represented by the given arguments.\n * @nocollapse\n */\n static create<T>(next?: (x?: T) => void,\n error?: (e?: any) => void,\n complete?: () => void): Subscriber<T> {\n const subscriber = new Subscriber(next, error, complete);\n subscriber.syncErrorThrowable = false;\n return subscriber;\n }\n\n /** @internal */ syncErrorValue: any = null;\n /** @internal */ syncErrorThrown: boolean = false;\n /** @internal */ syncErrorThrowable: boolean = false;\n\n protected isStopped: boolean = false;\n protected destination: PartialObserver<any> | Subscriber<any>; // this `any` is the escape hatch to erase extra type param (e.g. R)\n\n private _parentSubscription: Subscription | null = null;\n\n /**\n * @param {Observer|function(value: T): void} [destinationOrNext] A partially\n * defined Observer or a `next` callback function.\n * @param {function(e: ?any): void} [error] The `error` callback of an\n * Observer.\n * @param {function(): void} [complete] The `complete` callback of an\n * Observer.\n */\n constructor(destinationOrNext?: PartialObserver<any> | ((value: T) => void),\n error?: (e?: any) => void,\n complete?: () => void) {\n super();\n\n switch (arguments.length) {\n case 0:\n this.destination = emptyObserver;\n break;\n case 1:\n if (!destinationOrNext) {\n this.destination = emptyObserver;\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 } else {\n this.syncErrorThrowable = true;\n this.destination = new SafeSubscriber<T>(this, <PartialObserver<any>> destinationOrNext);\n }\n break;\n }\n default:\n this.syncErrorThrowable = true;\n this.destination = new SafeSubscriber<T>(this, <((value: T) => void)> destinationOrNext, error, complete);\n break;\n }\n }\n\n /**\n * The {@link Observer} callback to receive notifications of type `next` from\n * the Observable, with a value. The Observable may call this method 0 or more\n * times.\n * @param {T} [value] The `next` value.\n * @return {void}\n */\n next(value?: T): void {\n if (!this.isStopped) {\n this._next(value);\n }\n }\n\n /**\n * The {@link Observer} callback to receive notifications of type `error` from\n * the Observable, with an attached `Error`. Notifies the Observer that\n * the Observable has experienced an error condition.\n * @param {any} [err] The `error` exception.\n * @return {void}\n */\n error(err?: any): void {\n if (!this.isStopped) {\n this.isStopped = true;\n this._error(err);\n }\n }\n\n /**\n * The {@link Observer} callback to receive a valueless notification of type\n * `complete` from the Observable. Notifies the Observer that the Observable\n * has finished sending push-based notifications.\n * @return {void}\n */\n complete(): void {\n if (!this.isStopped) {\n this.isStopped = true;\n this._complete();\n }\n }\n\n unsubscribe(): void {\n if (this.closed) {\n return;\n }\n this.isStopped = true;\n super.unsubscribe();\n }\n\n protected _next(value: T): void {\n this.destination.next(value);\n }\n\n protected _error(err: any): void {\n this.destination.error(err);\n this.unsubscribe();\n }\n\n protected _complete(): void {\n this.destination.complete();\n this.unsubscribe();\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _unsubscribeAndRecycle(): Subscriber<T> {\n const { _parent, _parents } = this;\n this._parent = null;\n this._parents = null;\n this.unsubscribe();\n this.closed = false;\n this.isStopped = false;\n this._parent = _parent;\n this._parents = _parents;\n this._parentSubscription = null;\n return this;\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class SafeSubscriber<T> extends Subscriber<T> {\n\n private _context: any;\n\n constructor(private _parentSubscriber: Subscriber<T>,\n observerOrNext?: PartialObserver<T> | ((value: T) => void),\n error?: (e?: any) => void,\n complete?: () => void) {\n super();\n\n let next: ((value: T) => void);\n let context: any = this;\n\n if (isFunction(observerOrNext)) {\n next = (<((value: T) => void)> observerOrNext);\n } else if (observerOrNext) {\n next = (<PartialObserver<T>> observerOrNext).next;\n error = (<PartialObserver<T>> observerOrNext).error;\n complete = (<PartialObserver<T>> observerOrNext).complete;\n if (observerOrNext !== emptyObserver) {\n context = Object.create(observerOrNext);\n if (isFunction(context.unsubscribe)) {\n this.add(<() => void> context.unsubscribe.bind(context));\n }\n context.unsubscribe = this.unsubscribe.bind(this);\n }\n }\n\n this._context = context;\n this._next = next;\n this._error = error;\n this._complete = complete;\n }\n\n next(value?: T): void {\n if (!this.isStopped && this._next) {\n const { _parentSubscriber } = this;\n if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {\n this.__tryOrUnsub(this._next, value);\n } else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {\n this.unsubscribe();\n }\n }\n }\n\n error(err?: any): void {\n if (!this.isStopped) {\n const { _parentSubscriber } = this;\n const { useDeprecatedSynchronousErrorHandling } = config;\n if (this._error) {\n if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {\n this.__tryOrUnsub(this._error, err);\n this.unsubscribe();\n } else {\n this.__tryOrSetError(_parentSubscriber, this._error, err);\n this.unsubscribe();\n }\n } else if (!_parentSubscriber.syncErrorThrowable) {\n this.unsubscribe();\n if (useDeprecatedSynchronousErrorHandling) {\n throw err;\n }\n hostReportError(err);\n } else {\n if (useDeprecatedSynchronousErrorHandling) {\n _parentSubscriber.syncErrorValue = err;\n _parentSubscriber.syncErrorThrown = true;\n } else {\n hostReportError(err);\n }\n this.unsubscribe();\n }\n }\n }\n\n complete(): void {\n if (!this.isStopped) {\n const { _parentSubscriber } = this;\n if (this._complete) {\n const wrappedComplete = () => this._complete.call(this._context);\n\n if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {\n this.__tryOrUnsub(wrappedComplete);\n this.unsubscribe();\n } else {\n this.__tryOrSetError(_parentSubscriber, wrappedComplete);\n this.unsubscribe();\n }\n } else {\n this.unsubscribe();\n }\n }\n }\n\n private __tryOrUnsub(fn: Function, value?: any): void {\n try {\n fn.call(this._context, value);\n } catch (err) {\n this.unsubscribe();\n if (config.useDeprecatedSynchronousErrorHandling) {\n throw err;\n } else {\n hostReportError(err);\n }\n }\n }\n\n private __tryOrSetError(parent: Subscriber<T>, fn: Function, value?: any): boolean {\n if (!config.useDeprecatedSynchronousErrorHandling) {\n throw new Error('bad call');\n }\n try {\n fn.call(this._context, value);\n } catch (err) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n parent.syncErrorValue = err;\n parent.syncErrorThrown = true;\n return true;\n } else {\n hostReportError(err);\n return true;\n }\n }\n return false;\n }\n\n /** @internal This is an internal implementation detail, do not use. */\n _unsubscribe(): void {\n const { _parentSubscriber } = this;\n this._context = null;\n this._parentSubscriber = null;\n _parentSubscriber.unsubscribe();\n }\n}\n","import { Subscriber } from '../Subscriber';\nimport { Subject } from '../Subject';\n\n/**\n * Determines whether the ErrorObserver is closed or stopped or has a\n * destination that is closed or stopped - in which case errors will\n * need to be reported via a different mechanism.\n * @param observer the observer\n */\nexport function canReportError(observer: Subscriber<any> | Subject<any>): boolean {\n while (observer) {\n const { closed, destination, isStopped } = observer as any;\n if (closed || isStopped) {\n return false;\n } else if (destination && destination instanceof Subscriber) {\n observer = destination;\n } else {\n observer = null;\n }\n }\n return true;\n}\n","import { Subscriber } from '../Subscriber';\nimport { rxSubscriber as rxSubscriberSymbol } from '../symbol/rxSubscriber';\nimport { empty as emptyObserver } from '../Observer';\nimport { PartialObserver } from '../types';\n\nexport function toSubscriber<T>(\n nextOrObserver?: PartialObserver<T> | ((value: T) => void),\n error?: (error: any) => void,\n complete?: () => void): Subscriber<T> {\n\n if (nextOrObserver) {\n if (nextOrObserver instanceof Subscriber) {\n return (<Subscriber<T>> nextOrObserver);\n }\n\n if (nextOrObserver[rxSubscriberSymbol]) {\n return nextOrObserver[rxSubscriberSymbol]();\n }\n }\n\n if (!nextOrObserver && !error && !complete) {\n return new Subscriber(emptyObserver);\n }\n\n return new Subscriber(nextOrObserver, error, complete);\n}\n","import { root } from '../util/root';\n\n/** Symbol.observable addition */\n/* Note: This will add Symbol.observable globally for all TypeScript users,\n however, we are no longer polyfilling Symbol.observable */\ndeclare global {\n interface SymbolConstructor {\n readonly observable: symbol;\n }\n}\n\n/** Symbol.observable or a string \"@@observable\". Used for interop */\nexport const observable = typeof Symbol === 'function' && Symbol.observable || '@@observable';\n","/* tslint:disable:no-empty */\nexport function noop() { }\n","import { noop } from './noop';\nimport { UnaryFunction } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function pipe<T>(): UnaryFunction<T, T>;\nexport function pipe<T, A>(fn1: UnaryFunction<T, A>): UnaryFunction<T, A>;\nexport function pipe<T, A, B>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>): UnaryFunction<T, B>;\nexport function pipe<T, A, B, C>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>): UnaryFunction<T, C>;\nexport function pipe<T, A, B, C, D>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>, fn4: UnaryFunction<C, D>): UnaryFunction<T, D>;\nexport function pipe<T, A, B, C, D, E>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>, fn4: UnaryFunction<C, D>, fn5: UnaryFunction<D, E>): UnaryFunction<T, E>;\nexport function pipe<T, A, B, C, D, E, F>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>, fn4: UnaryFunction<C, D>, fn5: UnaryFunction<D, E>, fn6: UnaryFunction<E, F>): UnaryFunction<T, F>;\nexport function pipe<T, A, B, C, D, E, F, G>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>, fn4: UnaryFunction<C, D>, fn5: UnaryFunction<D, E>, fn6: UnaryFunction<E, F>, fn7: UnaryFunction<F, G>): UnaryFunction<T, G>;\nexport function pipe<T, A, B, C, D, E, F, G, H>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>, fn4: UnaryFunction<C, D>, fn5: UnaryFunction<D, E>, fn6: UnaryFunction<E, F>, fn7: UnaryFunction<F, G>, fn8: UnaryFunction<G, H>): UnaryFunction<T, H>;\nexport function pipe<T, A, B, C, D, E, F, G, H, I>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>, fn4: UnaryFunction<C, D>, fn5: UnaryFunction<D, E>, fn6: UnaryFunction<E, F>, fn7: UnaryFunction<F, G>, fn8: UnaryFunction<G, H>, fn9: UnaryFunction<H, I>): UnaryFunction<T, I>;\nexport function pipe<T, A, B, C, D, E, F, G, H, I>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>, fn4: UnaryFunction<C, D>, fn5: UnaryFunction<D, E>, fn6: UnaryFunction<E, F>, fn7: UnaryFunction<F, G>, fn8: UnaryFunction<G, H>, fn9: UnaryFunction<H, I>, ...fns: UnaryFunction<any, any>[]): UnaryFunction<T, {}>;\n/* tslint:enable:max-line-length */\n\nexport function pipe(...fns: Array<UnaryFunction<any, any>>): UnaryFunction<any, any> {\n return pipeFromArray(fns);\n}\n\n/** @internal */\nexport function pipeFromArray<T, R>(fns: Array<UnaryFunction<T, R>>): UnaryFunction<T, R> {\n if (!fns) {\n return noop as UnaryFunction<any, any>;\n }\n\n if (fns.length === 1) {\n return fns[0];\n }\n\n return function piped(input: T): R {\n return fns.reduce((prev: any, fn: UnaryFunction<T, R>) => fn(prev), input as any);\n };\n}\n","import { Operator } from './Operator';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\nimport { TeardownLogic, OperatorFunction, PartialObserver, Subscribable } from './types';\nimport { canReportError } from './util/canReportError';\nimport { toSubscriber } from './util/toSubscriber';\nimport { iif } from './observable/iif';\nimport { throwError } from './observable/throwError';\nimport { observable as Symbol_observable } from '../internal/symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\n\n/**\n * A representation of any set of values over any amount of time. This is the most basic building block\n * of RxJS.\n *\n * @class Observable<T>\n */\nexport class Observable<T> implements Subscribable<T> {\n\n /** Internal implementation detail, do not use directly. */\n public _isScalar: boolean = false;\n\n /** @deprecated This is an internal implementation detail, do not use. */\n source: Observable<any>;\n\n /** @deprecated This is an internal implementation detail, do not use. */\n operator: Operator<any, T>;\n\n /**\n * @constructor\n * @param {Function} subscribe the function that is called when the Observable is\n * initially subscribed to. This function is given a Subscriber, to which new values\n * can be `next`ed, or an `error` method can be called to raise an error, or\n * `complete` can be called to notify of a successful completion.\n */\n constructor(subscribe?: (this: Observable<T>, subscriber: Subscriber<T>) => TeardownLogic) {\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n\n // HACK: Since TypeScript inherits static properties too, we have to\n // fight against TypeScript here so Subject can have a different static create signature\n /**\n * Creates a new cold Observable by calling the Observable constructor\n * @static true\n * @owner Observable\n * @method create\n * @param {Function} subscribe? the subscriber function to be passed to the Observable constructor\n * @return {Observable} a new cold observable\n * @nocollapse\n */\n static create: Function = <T>(subscribe?: (subscriber: Subscriber<T>) => TeardownLogic) => {\n return new Observable<T>(subscribe);\n }\n\n /**\n * Creates a new Observable, with this Observable as the source, and the passed\n * operator defined as the new observable's operator.\n * @method lift\n * @param {Operator} operator the operator defining the operation to take on the observable\n * @return {Observable} a new observable with the Operator applied\n */\n lift<R>(operator: Operator<T, R>): Observable<R> {\n const observable = new Observable<R>();\n observable.source = this;\n observable.operator = operator;\n return observable;\n }\n\n subscribe(observer?: PartialObserver<T>): Subscription;\n subscribe(next?: (value: T) => void, error?: (error: any) => void, complete?: () => void): Subscription;\n /**\n * Invokes an execution of an Observable and registers Observer handlers for notifications it will emit.\n *\n * <span class=\"informal\">Use it when you have all these Observables, but still nothing is happening.</span>\n *\n * `subscribe` is not a regular operator, but a method that calls Observable's internal `subscribe` function. It\n * might be for example a function that you passed to Observable's constructor, but most of the time it is\n * a library implementation, which defines what will be emitted by an Observable, and when it be will emitted. This means\n * that calling `subscribe` is actually the moment when Observable starts its work, not when it is created, as it is often\n * the thought.\n *\n * Apart from starting the execution of an Observable, this method allows you to listen for values\n * that an Observable emits, as well as for when it completes or errors. You can achieve this in two\n * of the following ways.\n *\n * The first way is creating an object that implements {@link Observer} interface. It should have methods\n * defined by that interface, but note that it should be just a regular JavaScript object, which you can create\n * yourself in any way you want (ES6 class, classic function constructor, object literal etc.). In particular do\n * not attempt to use any RxJS implementation details to create Observers - you don't need them. Remember also\n * that your object does not have to implement all methods. If you find yourself creating a method that doesn't\n * do anything, you can simply omit it. Note however, if the `error` method is not provided, all errors will\n * be left uncaught.\n *\n * The second way is to give up on Observer object altogether and simply provide callback functions in place of its methods.\n * This means you can provide three functions as arguments to `subscribe`, where the first function is equivalent\n * of a `next` method, the second of an `error` method and the third of a `complete` method. Just as in case of Observer,\n * if you do not need to listen for something, you can omit a function, preferably by passing `undefined` or `null`,\n * since `subscribe` recognizes these functions by where they were placed in function call. When it comes\n * to `error` function, just as before, if not provided, errors emitted by an Observable will be thrown.\n *\n * Whichever style of calling `subscribe` you use, in both cases it returns a Subscription object.\n * This object allows you to call `unsubscribe` on it, which in turn will stop the work that an Observable does and will clean\n * up all resources that an Observable used. Note that cancelling a subscription will not call `complete` callback\n * provided to `subscribe` function, which is reserved for a regular completion signal that comes from an Observable.\n *\n * Remember that callbacks provided to `subscribe` are not guaranteed to be called asynchronously.\n * It is an Observable itself that decides when these functions will be called. For example {@link of}\n * by default emits all its values synchronously. Always check documentation for how given Observable\n * will behave when subscribed and if its default behavior can be modified with a `scheduler`.\n *\n * ## Example\n * ### Subscribe with an Observer\n * ```javascript\n * const sumObserver = {\n * sum: 0,\n * next(value) {\n * console.log('Adding: ' + value);\n * this.sum = this.sum + value;\n * },\n * error() { // We actually could just remove this method,\n * }, // since we do not really care about errors right now.\n * complete() {\n * console.log('Sum equals: ' + this.sum);\n * }\n * };\n *\n * Rx.Observable.of(1, 2, 3) // Synchronously emits 1, 2, 3 and then completes.\n * .subscribe(sumObserver);\n *\n * // Logs:\n * // \"Adding: 1\"\n * // \"Adding: 2\"\n * // \"Adding: 3\"\n * // \"Sum equals: 6\"\n * ```\n *\n * ### Subscribe with functions\n * ```javascript\n * let sum = 0;\n *\n * Rx.Observable.of(1, 2, 3)\n * .subscribe(\n * function(value) {\n * console.log('Adding: ' + value);\n * sum = sum + value;\n * },\n * undefined,\n * function() {\n * console.log('Sum equals: ' + sum);\n * }\n * );\n *\n * // Logs:\n * // \"Adding: 1\"\n * // \"Adding: 2\"\n * // \"Adding: 3\"\n * // \"Sum equals: 6\"\n * ```\n *\n * ### Cancel a subscription\n * ```javascript\n * const subscription = Rx.Observable.interval(1000).subscribe(\n * num => console.log(num),\n * undefined,\n * () => console.log('completed!') // Will not be called, even\n * ); // when cancelling subscription\n *\n *\n * setTimeout(() => {\n * subscription.unsubscribe();\n * console.log('unsubscribed!');\n * }, 2500);\n *\n * // Logs:\n * // 0 after 1s\n * // 1 after 2s\n * // \"unsubscribed!\" after 2.5s\n * ```\n *\n * @param {Observer|Function} observerOrNext (optional) Either an observer with methods to be called,\n * or the first of three possible handlers, which is the handler for each value emitted from the subscribed\n * Observable.\n * @param {Function} error (optional) A handler for a terminal event resulting from an error. If no error handler is provided,\n * the error will be thrown as unhandled.\n * @param {Function} complete (optional) A handler for a terminal event resulting from successful completion.\n * @return {ISubscription} a subscription reference to the registered handlers\n * @method subscribe\n */\n subscribe(observerOrNext?: PartialObserver<T> | ((value: T) => void),\n error?: (error: any) => void,\n complete?: () => void): Subscription {\n\n const { operator } = this;\n const sink = toSubscriber(observerOrNext, error, complete);\n\n if (operator) {\n operator.call(sink, this.source);\n } else {\n sink.add(\n this.source || (config.useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ?\n this._subscribe(sink) :\n this._trySubscribe(sink)\n );\n }\n\n if (config.useDeprecatedSynchronousErrorHandling) {\n if (sink.syncErrorThrowable) {\n sink.syncErrorThrowable = false;\n if (sink.syncErrorThrown) {\n throw sink.syncErrorValue;\n }\n }\n }\n\n return sink;\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _trySubscribe(sink: Subscriber<T>): TeardownLogic {\n try {\n return this._subscribe(sink);\n } catch (err) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n sink.syncErrorThrown = true;\n sink.syncErrorValue = err;\n }\n if (canReportError(sink)) {\n sink.error(err);\n } else {\n console.warn(err);\n }\n }\n }\n\n /**\n * @method forEach\n * @param {Function} next a handler for each value emitted by the observable\n * @param {PromiseConstructor} [promiseCtor] a constructor function used to instantiate the Promise\n * @return {Promise} a promise that either resolves on observable completion or\n * rejects with the handled error\n */\n forEach(next: (value: T) => void, promiseCtor?: PromiseConstructorLike): Promise<void> {\n promiseCtor = getPromiseCtor(promiseCtor);\n\n return new promiseCtor<void>((resolve, reject) => {\n // Must be declared in a separate statement to avoid a RefernceError when\n // accessing subscription below in the closure due to Temporal Dead Zone.\n let subscription: Subscription;\n subscription = this.subscribe((value) => {\n try {\n next(value);\n } catch (err) {\n reject(err);\n if (subscription) {\n subscription.unsubscribe();\n }\n }\n }, reject, resolve);\n }) as Promise<void>;\n }\n\n /** @internal This is an internal implementation detail, do not use. */\n _subscribe(subscriber: Subscriber<any>): TeardownLogic {\n const { source } = this;\n return source && source.subscribe(subscriber);\n }\n\n // `if` and `throw` are special snow flakes, the compiler sees them as reserved words. Deprecated in\n // favor of iif and throwError functions.\n /**\n * @nocollapse\n * @deprecated In favor of iif creation function: import { iif } from 'rxjs';\n */\n static if: typeof iif;\n /**\n * @nocollapse\n * @deprecated In favor of throwError creation function: import { throwError } from 'rxjs';\n */\n static throw: typeof throwError;\n\n /**\n * An interop point defined by the es7-observable spec https://github.com/zenparsing/es-observable\n * @method Symbol.observable\n * @return {Observable} this instance of the observable\n */\n [Symbol_observable]() {\n return this;\n }\n\n /* tslint:disable:max-line-length */\n pipe(): Observable<T>;\n pipe<A>(op1: OperatorFunction<T, A>): Observable<A>;\n pipe<A, B>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>): Observable<B>;\n pipe<A, B, C>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>): Observable<C>;\n pipe<A, B, C, D>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>): Observable<D>;\n pipe<A, B, C, D, E>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>): Observable<E>;\n pipe<A, B, C, D, E, F>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>): Observable<F>;\n pipe<A, B, C, D, E, F, G>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>): Observable<G>;\n pipe<A, B, C, D, E, F, G, H>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>, op8: OperatorFunction<G, H>): Observable<H>;\n pipe<A, B, C, D, E, F, G, H, I>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>, op8: OperatorFunction<G, H>, op9: OperatorFunction<H, I>): Observable<I>;\n pipe<A, B, C, D, E, F, G, H, I>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>, op8: OperatorFunction<G, H>, op9: OperatorFunction<H, I>, ...operations: OperatorFunction<any, any>[]): Observable<{}>;\n /* tslint:enable:max-line-length */\n\n /**\n * Used to stitch together functional operators into a chain.\n * @method pipe\n * @return {Observable} the Observable result of all of the operators having\n * been called in the order they were passed in.\n *\n * ### Example\n * ```javascript\n * import { map, filter, scan } from 'rxjs/operators';\n *\n * Rx.Observable.interval(1000)\n * .pipe(\n * filter(x => x % 2 === 0),\n * map(x => x + x),\n * scan((acc, x) => acc + x)\n * )\n * .subscribe(x => console.log(x))\n * ```\n */\n pipe(...operations: OperatorFunction<any, any>[]): Observable<any> {\n if (operations.length === 0) {\n return this as any;\n }\n\n return pipeFromArray(operations)(this);\n }\n\n /* tslint:disable:max-line-length */\n toPromise<T>(this: Observable<T>): Promise<T>;\n toPromise<T>(this: Observable<T>, PromiseCtor: typeof Promise): Promise<T>;\n toPromise<T>(this: Observable<T>, PromiseCtor: PromiseConstructorLike): Promise<T>;\n /* tslint:enable:max-line-length */\n\n toPromise(promiseCtor?: PromiseConstructorLike): Promise<T> {\n promiseCtor = getPromiseCtor(promiseCtor);\n\n return new promiseCtor((resolve, reject) => {\n let value: any;\n this.subscribe((x: T) => value = x, (err: any) => reject(err), () => resolve(value));\n }) as Promise<T>;\n }\n}\n\n/**\n * Decides between a passed promise constructor from consuming code,\n * A default configured promise constructor, and the native promise\n * constructor and returns it. If nothing can be found, it will throw\n * an error.\n * @param promiseCtor The optional promise constructor to passed by consuming code\n */\nfunction getPromiseCtor(promiseCtor: PromiseConstructorLike | undefined) {\n if (!promiseCtor) {\n promiseCtor = config.Promise || Promise;\n }\n\n if (!promiseCtor) {\n throw new Error('no Promise impl found');\n }\n\n return promiseCtor;\n}\n","export interface ObjectUnsubscribedError extends Error {\n}\n\nexport interface ObjectUnsubscribedErrorCtor {\n new(): ObjectUnsubscribedError;\n}\n\nfunction ObjectUnsubscribedErrorImpl(this: any) {\n Error.call(this);\n this.message = 'object unsubscribed';\n this.name = 'ObjectUnsubscribedError';\n return this;\n}\n\nObjectUnsubscribedErrorImpl.prototype = Object.create(Error.prototype);\n\n/**\n * An error thrown when an action is invalid because the object has been\n * unsubscribed.\n *\n * @see {@link Subject}\n * @see {@link BehaviorSubject}\n *\n * @class ObjectUnsubscribedError\n */\nexport const ObjectUnsubscribedError: ObjectUnsubscribedErrorCtor = ObjectUnsubscribedErrorImpl as any;","import { Subject } from './Subject';\nimport { Observer } from './types';\nimport { Subscription } from './Subscription';\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class SubjectSubscription<T> extends Subscription {\n closed: boolean = false;\n\n constructor(public subject: Subject<T>, public subscriber: Observer<T>) {\n super();\n }\n\n unsubscribe() {\n if (this.closed) {\n return;\n }\n\n this.closed = true;\n\n const subject = this.subject;\n const observers = subject.observers;\n\n this.subject = null;\n\n if (!observers || observers.length === 0 || subject.isStopped || subject.closed) {\n return;\n }\n\n const subscriberIndex = observers.indexOf(this.subscriber);\n\n if (subscriberIndex !== -1) {\n observers.splice(subscriberIndex, 1);\n }\n }\n}\n","import { Operator } from './Operator';\nimport { Observable } from './Observable';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\nimport { Observer, SubscriptionLike, TeardownLogic } from './types';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { SubjectSubscription } from './SubjectSubscription';\nimport { rxSubscriber as rxSubscriberSymbol } from '../internal/symbol/rxSubscriber';\n\n/**\n * @class SubjectSubscriber<T>\n */\nexport class SubjectSubscriber<T> extends Subscriber<T> {\n constructor(protected destination: Subject<T>) {\n super(destination);\n }\n}\n\n/**\n * A Subject is a special type of Observable that allows values to be\n * multicasted to many Observables. Subjects are like EventEmitters.\n *\n * Every Subject is an Observable and an Observer. You can subscribe to a\n * Subject, and you can call next to feed values as well as error and complete.\n *\n * @class Subject<T>\n */\nexport class Subject<T> extends Observable<T> implements SubscriptionLike {\n\n [rxSubscriberSymbol]() {\n return new SubjectSubscriber(this);\n }\n\n observers: Observer<T>[] = [];\n\n closed = false;\n\n isStopped = false;\n\n hasError = false;\n\n thrownError: any = null;\n\n constructor() {\n super();\n }\n\n /**@nocollapse */\n static create: Function = <T>(destination: Observer<T>, source: Observable<T>): AnonymousSubject<T> => {\n return new AnonymousSubject<T>(destination, source);\n }\n\n lift<R>(operator: Operator<T, R>): Observable<R> {\n const subject = new AnonymousSubject(this, this);\n subject.operator = <any>operator;\n return <any>subject;\n }\n\n next(value?: T) {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n if (!this.isStopped) {\n const { observers } = this;\n const len = observers.length;\n const copy = observers.slice();\n for (let i = 0; i < len; i++) {\n copy[i].next(value);\n }\n }\n }\n\n error(err: any) {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n this.hasError = true;\n this.thrownError = err;\n this.isStopped = true;\n const { observers } = this;\n const len = observers.length;\n const copy = observers.slice();\n for (let i = 0; i < len; i++) {\n copy[i].error(err);\n }\n this.observers.length = 0;\n }\n\n complete() {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n this.isStopped = true;\n const { observers } = this;\n const len = observers.length;\n const copy = observers.slice();\n for (let i = 0; i < len; i++) {\n copy[i].complete();\n }\n this.observers.length = 0;\n }\n\n unsubscribe() {\n this.isStopped = true;\n this.closed = true;\n this.observers = null;\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _trySubscribe(subscriber: Subscriber<T>): TeardownLogic {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n } else {\n return super._trySubscribe(subscriber);\n }\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _subscribe(subscriber: Subscriber<T>): Subscription {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n } else if (this.hasError) {\n subscriber.error(this.thrownError);\n return Subscription.EMPTY;\n } else if (this.isStopped) {\n subscriber.complete();\n return Subscription.EMPTY;\n } else {\n this.observers.push(subscriber);\n return new SubjectSubscription(this, subscriber);\n }\n }\n\n /**\n * Creates a new Observable with this Subject as the source. You can do this\n * to create customize Observer-side logic of the Subject and conceal it from\n * code that uses the Observable.\n * @return {Observable} Observable that the Subject casts to\n */\n asObservable(): Observable<T> {\n const observable = new Observable<T>();\n (<any>observable).source = this;\n return observable;\n }\n}\n\n/**\n * @class AnonymousSubject<T>\n */\nexport class AnonymousSubject<T> extends Subject<T> {\n constructor(protected destination?: Observer<T>, source?: Observable<T>) {\n super();\n this.source = source;\n }\n\n next(value: T) {\n const { destination } = this;\n if (destination && destination.next) {\n destination.next(value);\n }\n }\n\n error(err: any) {\n const { destination } = this;\n if (destination && destination.error) {\n this.destination.error(err);\n }\n }\n\n complete() {\n const { destination } = this;\n if (destination && destination.complete) {\n this.destination.complete();\n }\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _subscribe(subscriber: Subscriber<T>): Subscription {\n const { source } = this;\n if (source) {\n return this.source.subscribe(subscriber);\n } else {\n return Subscription.EMPTY;\n }\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\nimport { ConnectableObservable } from '../observable/ConnectableObservable';\nimport { Observable } from '../Observable';\n\nexport function refCount<T>(): MonoTypeOperatorFunction<T> {\n return function refCountOperatorFunction(source: ConnectableObservable<T>): Observable<T> {\n return source.lift(new RefCountOperator(source));\n } as MonoTypeOperatorFunction<T>;\n}\n\nclass RefCountOperator<T> implements Operator<T, T> {\n constructor(private connectable: ConnectableObservable<T>) {\n }\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n\n const { connectable } = this;\n (<any> connectable)._refCount++;\n\n const refCounter = new RefCountSubscriber(subscriber, connectable);\n const subscription = source.subscribe(refCounter);\n\n if (!refCounter.closed) {\n (<any> refCounter).connection = connectable.connect();\n }\n\n return subscription;\n }\n}\n\nclass RefCountSubscriber<T> extends Subscriber<T> {\n\n private connection: Subscription;\n\n constructor(destination: Subscriber<T>,\n private connectable: ConnectableObservable<T>) {\n super(destination);\n }\n\n protected _unsubscribe() {\n\n const { connectable } = this;\n if (!connectable) {\n this.connection = null;\n return;\n }\n\n this.connectable = null;\n const refCount = (<any> connectable)._refCount;\n if (refCount <= 0) {\n this.connection = null;\n return;\n }\n\n (<any> connectable)._refCount = refCount - 1;\n if (refCount > 1) {\n this.connection = null;\n return;\n }\n\n ///\n // Compare the local RefCountSubscriber's connection Subscription to the\n // connection Subscription on the shared ConnectableObservable. In cases\n // where the ConnectableObservable source synchronously emits values, and\n // the RefCountSubscriber's downstream Observers synchronously unsubscribe,\n // execution continues to here before the RefCountOperator has a chance to\n // supply the RefCountSubscriber with the shared connection Subscription.\n // For example:\n // ```\n // range(0, 10).pipe(\n // publish(),\n // refCount(),\n // take(5),\n // )\n // .subscribe();\n // ```\n // In order to account for this case, RefCountSubscriber should only dispose\n // the ConnectableObservable's shared connection Subscription if the\n // connection Subscription exists, *and* either:\n // a. RefCountSubscriber doesn't have a reference to the shared connection\n // Subscription yet, or,\n // b. RefCountSubscriber's connection Subscription reference is identical\n // to the shared connection Subscription\n ///\n const { connection } = this;\n const sharedConnection = (<any> connectable)._connection;\n this.connection = null;\n\n if (sharedConnection && (!connection || sharedConnection === connection)) {\n sharedConnection.unsubscribe();\n }\n }\n}\n","import { Subject, SubjectSubscriber } from '../Subject';\nimport { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { TeardownLogic } from '../types';\nimport { refCount as higherOrderRefCount } from '../operators/refCount';\n\n/**\n * @class ConnectableObservable<T>\n */\nexport class ConnectableObservable<T> extends Observable<T> {\n\n protected _subject: Subject<T>;\n protected _refCount: number = 0;\n protected _connection: Subscription;\n /** @internal */\n _isComplete = false;\n\n constructor(public source: Observable<T>,\n protected subjectFactory: () => Subject<T>) {\n super();\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _subscribe(subscriber: Subscriber<T>) {\n return this.getSubject().subscribe(subscriber);\n }\n\n protected getSubject(): Subject<T> {\n const subject = this._subject;\n if (!subject || subject.isStopped) {\n this._subject = this.subjectFactory();\n }\n return this._subject;\n }\n\n connect(): Subscription {\n let connection = this._connection;\n if (!connection) {\n this._isComplete = false;\n connection = this._connection = new Subscription();\n connection.add(this.source\n .subscribe(new ConnectableSubscriber(this.getSubject(), this)));\n if (connection.closed) {\n this._connection = null;\n connection = Subscription.EMPTY;\n } else {\n this._connection = connection;\n }\n }\n return connection;\n }\n\n refCount(): Observable<T> {\n return higherOrderRefCount()(this) as Observable<T>;\n }\n}\n\nconst connectableProto = <any>ConnectableObservable.prototype;\n\nexport const connectableObservableDescriptor: PropertyDescriptorMap = {\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\nclass ConnectableSubscriber<T> extends SubjectSubscriber<T> {\n constructor(destination: Subject<T>,\n private connectable: ConnectableObservable<T>) {\n super(destination);\n }\n protected _error(err: any): void {\n this._unsubscribe();\n super._error(err);\n }\n protected _complete(): void {\n this.connectable._isComplete = true;\n this._unsubscribe();\n super._complete();\n }\n protected _unsubscribe() {\n const connectable = <any>this.connectable;\n if (connectable) {\n this.connectable = null;\n const 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}\n\nclass RefCountOperator<T> implements Operator<T, T> {\n constructor(private connectable: ConnectableObservable<T>) {\n }\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n\n const { connectable } = this;\n (<any> connectable)._refCount++;\n\n const refCounter = new RefCountSubscriber(subscriber, connectable);\n const subscription = source.subscribe(refCounter);\n\n if (!refCounter.closed) {\n (<any> refCounter).connection = connectable.connect();\n }\n\n return subscription;\n }\n}\n\nclass RefCountSubscriber<T> extends Subscriber<T> {\n\n private connection: Subscription;\n\n constructor(destination: Subscriber<T>,\n private connectable: ConnectableObservable<T>) {\n super(destination);\n }\n\n protected _unsubscribe() {\n\n const { connectable } = this;\n if (!connectable) {\n this.connection = null;\n return;\n }\n\n this.connectable = null;\n const refCount = (<any> connectable)._refCount;\n if (refCount <= 0) {\n this.connection = null;\n return;\n }\n\n (<any> connectable)._refCount = refCount - 1;\n if (refCount > 1) {\n this.connection = null;\n return;\n }\n\n ///\n // Compare the local RefCountSubscriber's connection Subscription to the\n // connection Subscription on the shared ConnectableObservable. In cases\n // where the ConnectableObservable source synchronously emits values, and\n // the RefCountSubscriber's downstream Observers synchronously unsubscribe,\n // execution continues to here before the RefCountOperator has a chance to\n // supply the RefCountSubscriber with the shared connection Subscription.\n // For example:\n // ```\n // range(0, 10).pipe(\n // publish(),\n // refCount(),\n // take(5),\n // ).subscribe();\n // ```\n // In order to account for this case, RefCountSubscriber should only dispose\n // the ConnectableObservable's shared connection Subscription if the\n // connection Subscription exists, *and* either:\n // a. RefCountSubscriber doesn't have a reference to the shared connection\n // Subscription yet, or,\n // b. RefCountSubscriber's connection Subscription reference is identical\n // to the shared connection Subscription\n ///\n const { connection } = this;\n const sharedConnection = (<any> connectable)._connection;\n this.connection = null;\n\n if (sharedConnection && (!connection || sharedConnection === connection)) {\n sharedConnection.unsubscribe();\n }\n }\n}\n","import { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { Observable } from '../Observable';\nimport { Operator } from '../Operator';\nimport { Subject } from '../Subject';\nimport { OperatorFunction } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function groupBy<T, K>(keySelector: (value: T) => K): OperatorFunction<T, GroupedObservable<K, T>>;\nexport function groupBy<T, K>(keySelector: (value: T) => K, elementSelector: void, durationSelector: (grouped: GroupedObservable<K, T>) => Observable<any>): OperatorFunction<T, GroupedObservable<K, T>>;\nexport function groupBy<T, K, R>(keySelector: (value: T) => K, elementSelector?: (value: T) => R, durationSelector?: (grouped: GroupedObservable<K, R>) => Observable<any>): OperatorFunction<T, GroupedObservable<K, R>>;\nexport function groupBy<T, K, R>(keySelector: (value: T) => K, elementSelector?: (value: T) => R, durationSelector?: (grouped: GroupedObservable<K, R>) => Observable<any>, subjectSelector?: () => Subject<R>): OperatorFunction<T, GroupedObservable<K, R>>;\n/* tslint:enable:max-line-length */\n\n/**\n * Groups the items emitted by an Observable according to a specified criterion,\n * and emits these grouped items as `GroupedObservables`, one\n * {@link GroupedObservable} per group.\n *\n * ![](groupBy.png)\n *\n * When the Observable emits an item, a key is computed for this item with the keySelector function.\n *\n * If a {@link GroupedObservable} for this key exists, this {@link GroupedObservable} emits. Elsewhere, a new\n * {@link GroupedObservable} for this key is created and emits.\n *\n * A {@link GroupedObservable} represents values belonging to the same group represented by a common key. The common\n * key is available as the key field of a {@link GroupedObservable} instance.\n *\n * The elements emitted by {@link GroupedObservable}s are by default the items emitted by the Observable, or elements\n * returned by the elementSelector function.\n *\n * ## Examples\n * ### Group objects by id and return as array\n * ```javascript\n * import { mergeMap, groupBy } from 'rxjs/operators';\n * import { of } from 'rxjs/observable/of';\n *\n * interface Obj {\n * id: number,\n * name: string,\n * }\n *\n * of<Obj>(\n * {id: 1, name: 'javascript'},\n * {id: 2, name: 'parcel'},\n * {id: 2, name: 'webpack'},\n * {id: 1, name: 'typescript'},\n * {id: 3, name: 'tslint'}\n * ).pipe(\n * groupBy(p => p.id),\n * mergeMap((group$) => group$.pipe(reduce((acc, cur) => [...acc, cur], []))),\n * )\n * .subscribe(p => console.log(p));\n *\n * // displays:\n * // [ { id: 1, name: 'javascript'},\n * // { id: 1, name: 'typescript'} ]\n * //\n * // [ { id: 2, name: 'parcel'},\n * // { id: 2, name: 'webpack'} ]\n * //\n * // [ { id: 3, name: 'tslint'} ]\n * ```\n *\n * ### Pivot data on the id field\n * ```javascript\n * import { mergeMap, groupBy, map } from 'rxjs/operators';\n * import { of } from 'rxjs/observable/of';\n *\n * of<Obj>(\n * {id: 1, name: 'javascript'},\n * {id: 2, name: 'parcel'},\n * {id: 2, name: 'webpack'},\n * {id: 1, name: 'typescript'}\n * {id: 3, name: 'tslint'}\n * ).pipe(\n * groupBy(p => p.id, p => p.name),\n * mergeMap( (group$) => group$.pipe(reduce((acc, cur) => [...acc, cur], [\"\" + group$.key]))),\n * map(arr => ({'id': parseInt(arr[0]), 'values': arr.slice(1)})),\n * )\n * .subscribe(p => console.log(p));\n *\n * // displays:\n * // { id: 1, values: [ 'javascript', 'typescript' ] }\n * // { id: 2, values: [ 'parcel', 'webpack' ] }\n * // { id: 3, values: [ 'tslint' ] }\n * ```\n *\n * @param {function(value: T): K} keySelector A function that extracts the key\n * for each item.\n * @param {function(value: T): R} [elementSelector] A function that extracts the\n * return element for each item.\n * @param {function(grouped: GroupedObservable<K,R>): Observable<any>} [durationSelector]\n * A function that returns an Observable to determine how long each group should\n * exist.\n * @return {Observable<GroupedObservable<K,R>>} An Observable that emits\n * GroupedObservables, each of which corresponds to a unique key value and each\n * of which emits those items from the source Observable that share that key\n * value.\n * @method groupBy\n * @owner Observable\n */\nexport function groupBy<T, K, R>(keySelector: (value: T) => K,\n elementSelector?: ((value: T) => R) | void,\n durationSelector?: (grouped: GroupedObservable<K, R>) => Observable<any>,\n subjectSelector?: () => Subject<R>): OperatorFunction<T, GroupedObservable<K, R>> {\n return (source: Observable<T>) =>\n source.lift(new GroupByOperator(keySelector, elementSelector, durationSelector, subjectSelector));\n}\n\nexport interface RefCountSubscription {\n count: number;\n unsubscribe: () => void;\n closed: boolean;\n attemptedToUnsubscribe: boolean;\n}\n\nclass GroupByOperator<T, K, R> implements Operator<T, GroupedObservable<K, R>> {\n constructor(private keySelector: (value: T) => K,\n private elementSelector?: ((value: T) => R) | void,\n private durationSelector?: (grouped: GroupedObservable<K, R>) => Observable<any>,\n private subjectSelector?: () => Subject<R>) {\n }\n\n call(subscriber: Subscriber<GroupedObservable<K, R>>, source: any): any {\n return source.subscribe(new GroupBySubscriber(\n subscriber, this.keySelector, this.elementSelector, this.durationSelector, this.subjectSelector\n ));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass GroupBySubscriber<T, K, R> extends Subscriber<T> implements RefCountSubscription {\n private groups: Map<K, Subject<T | R>> = null;\n public attemptedToUnsubscribe: boolean = false;\n public count: number = 0;\n\n constructor(destination: Subscriber<GroupedObservable<K, R>>,\n private keySelector: (value: T) => K,\n private elementSelector?: ((value: T) => R) | void,\n private durationSelector?: (grouped: GroupedObservable<K, R>) => Observable<any>,\n private subjectSelector?: () => Subject<R>) {\n super(destination);\n }\n\n protected _next(value: T): void {\n let key: K;\n try {\n key = this.keySelector(value);\n } catch (err) {\n this.error(err);\n return;\n }\n\n this._group(value, key);\n }\n\n private _group(value: T, key: K) {\n let groups = this.groups;\n\n if (!groups) {\n groups = this.groups = new Map<K, Subject<T | R>>();\n }\n\n let group = groups.get(key);\n\n let element: R;\n if (this.elementSelector) {\n try {\n element = this.elementSelector(value);\n } catch (err) {\n this.error(err);\n }\n } else {\n element = <any>value;\n }\n\n if (!group) {\n group = (this.subjectSelector ? this.subjectSelector() : new Subject<R>()) as Subject<T | R>;\n groups.set(key, group);\n const groupedObservable = new GroupedObservable(key, group, this);\n this.destination.next(groupedObservable);\n if (this.durationSelector) {\n let duration: any;\n try {\n duration = this.durationSelector(new GroupedObservable<K, R>(key, <Subject<R>>group));\n } catch (err) {\n this.error(err);\n return;\n }\n this.add(duration.subscribe(new GroupDurationSubscriber(key, group, this)));\n }\n }\n\n if (!group.closed) {\n group.next(element);\n }\n }\n\n protected _error(err: any): void {\n const groups = this.groups;\n if (groups) {\n groups.forEach((group, key) => {\n group.error(err);\n });\n\n groups.clear();\n }\n this.destination.error(err);\n }\n\n protected _complete(): void {\n const groups = this.groups;\n if (groups) {\n groups.forEach((group, key) => {\n group.complete();\n });\n\n groups.clear();\n }\n this.destination.complete();\n }\n\n removeGroup(key: K): void {\n this.groups.delete(key);\n }\n\n unsubscribe() {\n if (!this.closed) {\n this.attemptedToUnsubscribe = true;\n if (this.count === 0) {\n super.unsubscribe();\n }\n }\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass GroupDurationSubscriber<K, T> extends Subscriber<T> {\n constructor(private key: K,\n private group: Subject<T>,\n private parent: GroupBySubscriber<any, K, T | any>) {\n super(group);\n }\n\n protected _next(value: T): void {\n this.complete();\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _unsubscribe() {\n const { parent, key } = this;\n this.key = this.parent = null;\n if (parent) {\n parent.removeGroup(key);\n }\n }\n}\n\n/**\n * An Observable representing values belonging to the same group represented by\n * a common key. The values emitted by a GroupedObservable come from the source\n * Observable. The common key is available as the field `key` on a\n * GroupedObservable instance.\n *\n * @class GroupedObservable<K, T>\n */\nexport class GroupedObservable<K, T> extends Observable<T> {\n /** @deprecated Do not construct this type. Internal use only */\n constructor(public key: K,\n private groupSubject: Subject<T>,\n private refCountSubscription?: RefCountSubscription) {\n super();\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _subscribe(subscriber: Subscriber<T>) {\n const subscription = new Subscription();\n const { refCountSubscription, groupSubject } = this;\n if (refCountSubscription && !refCountSubscription.closed) {\n subscription.add(new InnerRefCountSubscription(refCountSubscription));\n }\n subscription.add(groupSubject.subscribe(subscriber));\n return subscription;\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass InnerRefCountSubscription extends Subscription {\n constructor(private parent: RefCountSubscription) {\n super();\n parent.count++;\n }\n\n unsubscribe() {\n const parent = this.parent;\n if (!parent.closed && !this.closed) {\n super.unsubscribe();\n parent.count -= 1;\n if (parent.count === 0 && parent.attemptedToUnsubscribe) {\n parent.unsubscribe();\n }\n }\n }\n}\n","import { Subject } from './Subject';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\nimport { SubscriptionLike } from './types';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\n\n/**\n * A variant of Subject that requires an initial value and emits its current\n * value whenever it is subscribed to.\n *\n * @class BehaviorSubject<T>\n */\nexport class BehaviorSubject<T> extends Subject<T> {\n\n constructor(private _value: T) {\n super();\n }\n\n get value(): T {\n return this.getValue();\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _subscribe(subscriber: Subscriber<T>): Subscription {\n const subscription = super._subscribe(subscriber);\n if (subscription && !(<SubscriptionLike>subscription).closed) {\n subscriber.next(this._value);\n }\n return subscription;\n }\n\n getValue(): T {\n if (this.hasError) {\n throw this.thrownError;\n } else if (this.closed) {\n throw new ObjectUnsubscribedError();\n } else {\n return this._value;\n }\n }\n\n next(value: T): void {\n super.next(this._value = value);\n }\n}\n","import { Scheduler } from '../Scheduler';\nimport { Subscription } from '../Subscription';\nimport { SchedulerAction } from '../types';\n\n/**\n * A unit of work to be executed in a `scheduler`. An action is typically\n * created from within a {@link SchedulerLike} and an RxJS user does not need to concern\n * themselves about creating and manipulating an Action.\n *\n * ```ts\n * class Action<T> extends Subscription {\n * new (scheduler: Scheduler, work: (state?: T) => void);\n * schedule(state?: T, delay: number = 0): Subscription;\n * }\n * ```\n *\n * @class Action<T>\n */\nexport class Action<T> extends Subscription {\n constructor(scheduler: Scheduler, work: (this: SchedulerAction<T>, state?: T) => void) {\n super();\n }\n /**\n * Schedules this action on its parent {@link SchedulerLike} for execution. May be passed\n * some context object, `state`. May happen at some point in the future,\n * according to the `delay` parameter, if specified.\n * @param {T} [state] Some contextual data that the `work` function uses when\n * called by the Scheduler.\n * @param {number} [delay] Time to wait before executing the work, where the\n * time unit is implicit and defined by the Scheduler.\n * @return {void}\n */\n public schedule(state?: T, delay: number = 0): Subscription {\n return this;\n }\n}\n","import { Action } from './Action';\nimport { SchedulerAction } from '../types';\nimport { Subscription } from '../Subscription';\nimport { AsyncScheduler } from './AsyncScheduler';\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class AsyncAction<T> extends Action<T> {\n\n public id: any;\n public state: T;\n public delay: number;\n protected pending: boolean = false;\n\n constructor(protected scheduler: AsyncScheduler,\n protected work: (this: SchedulerAction<T>, state?: T) => void) {\n super(scheduler, work);\n }\n\n public schedule(state?: T, delay: number = 0): Subscription {\n\n if (this.closed) {\n return this;\n }\n\n // Always replace the current state with the new state.\n this.state = state;\n\n const id = this.id;\n const scheduler = this.scheduler;\n\n //\n // Important implementation note:\n //\n // Actions only execute once by default, unless rescheduled from within the\n // scheduled callback. This allows us to implement single and repeat\n // actions via the same code path, without adding API surface area, as well\n // as mimic traditional recursion but across asynchronous boundaries.\n //\n // However, JS runtimes and timers distinguish between intervals achieved by\n // serial `setTimeout` calls vs. a single `setInterval` call. An interval of\n // serial `setTimeout` calls can be individually delayed, which delays\n // scheduling the next `setTimeout`, and so on. `setInterval` attempts to\n // guarantee the interval callback will be invoked more precisely to the\n // interval period, regardless of load.\n //\n // Therefore, we use `setInterval` to schedule single and repeat actions.\n // If the action reschedules itself with the same delay, the interval is not\n // canceled. If the action doesn't reschedule, or reschedules with a\n // different delay, the interval will be canceled after scheduled callback\n // execution.\n //\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, delay);\n }\n\n // Set the pending flag indicating that this action has been scheduled, or\n // has recursively rescheduled itself.\n this.pending = true;\n\n this.delay = delay;\n // If this action has already an async Id, don't request a new one.\n this.id = this.id || this.requestAsyncId(scheduler, this.id, delay);\n\n return this;\n }\n\n protected requestAsyncId(scheduler: AsyncScheduler, id?: any, delay: number = 0): any {\n return setInterval(scheduler.flush.bind(scheduler, this), delay);\n }\n\n protected recycleAsyncId(scheduler: AsyncScheduler, id: any, delay: number = 0): any {\n // If this action is rescheduled with the same delay time, don't clear the interval id.\n if (delay !== null && this.delay === delay && this.pending === false) {\n return id;\n }\n // Otherwise, if the action's delay time is different from the current delay,\n // or the action has been rescheduled before it's executed, clear the interval id\n clearInterval(id);\n }\n\n /**\n * Immediately executes this action and the `work` it contains.\n * @return {any}\n */\n public execute(state: T, delay: number): any {\n\n if (this.closed) {\n return new Error('executing a cancelled action');\n }\n\n this.pending = false;\n const error = this._execute(state, delay);\n if (error) {\n return error;\n } else if (this.pending === false && this.id != null) {\n // Dequeue if the action didn't reschedule itself. Don't call\n // unsubscribe(), because the action could reschedule later.\n // For example:\n // ```\n // scheduler.schedule(function doWork(counter) {\n // /* ... I'm a busy worker bee ... */\n // var originalAction = this;\n // /* wait 100ms before rescheduling the action */\n // setTimeout(function () {\n // originalAction.schedule(counter + 1);\n // }, 100);\n // }, 1000);\n // ```\n this.id = this.recycleAsyncId(this.scheduler, this.id, null);\n }\n }\n\n protected _execute(state: T, delay: number): any {\n let errored: boolean = false;\n let errorValue: any = undefined;\n try {\n this.work(state);\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\n /** @deprecated This is an internal implementation detail, do not use. */\n _unsubscribe() {\n\n const id = this.id;\n const scheduler = this.scheduler;\n const actions = scheduler.actions;\n const index = actions.indexOf(this);\n\n this.work = null;\n this.state = null;\n this.pending = false;\n this.scheduler = null;\n\n if (index !== -1) {\n actions.splice(index, 1);\n }\n\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, null);\n }\n\n this.delay = null;\n }\n}\n","import { AsyncAction } from './AsyncAction';\nimport { Subscription } from '../Subscription';\nimport { QueueScheduler } from './QueueScheduler';\nimport { SchedulerAction } from '../types';\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class QueueAction<T> extends AsyncAction<T> {\n\n constructor(protected scheduler: QueueScheduler,\n protected work: (this: SchedulerAction<T>, state?: T) => void) {\n super(scheduler, work);\n }\n\n public schedule(state?: T, delay: number = 0): Subscription {\n if (delay > 0) {\n return super.schedule(state, delay);\n }\n this.delay = delay;\n this.state = state;\n this.scheduler.flush(this);\n return this;\n }\n\n public execute(state: T, delay: number): any {\n return (delay > 0 || this.closed) ?\n super.execute(state, delay) :\n this._execute(state, delay) ;\n }\n\n protected requestAsyncId(scheduler: QueueScheduler, id?: any, delay: number = 0): any {\n // If delay exists and is greater than 0, or if the delay is null (the\n // action wasn't rescheduled) but was originally scheduled as an async\n // action, then recycle as an async action.\n if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {\n return super.requestAsyncId(scheduler, id, delay);\n }\n // Otherwise flush the scheduler starting with this action.\n return scheduler.flush(this);\n }\n}\n","import { Action } from './scheduler/Action';\nimport { Subscription } from './Subscription';\nimport { SchedulerLike, SchedulerAction } from './types';\n\n/**\n * An execution context and a data structure to order tasks and schedule their\n * execution. Provides a notion of (potentially virtual) time, through the\n * `now()` getter method.\n *\n * Each unit of work in a Scheduler is called an `Action`.\n *\n * ```ts\n * class Scheduler {\n * now(): number;\n * schedule(work, delay?, state?): Subscription;\n * }\n * ```\n *\n * @class Scheduler\n * @deprecated Scheduler is an internal implementation detail of RxJS, and\n * should not be used directly. Rather, create your own class and implement\n * {@link SchedulerLike}\n */\nexport class Scheduler implements SchedulerLike {\n\n /**\n * Note: the extra arrow function wrapper is to make testing by overriding\n * Date.now easier.\n * @nocollapse\n */\n public static now: () => number = () => Date.now();\n\n constructor(private SchedulerAction: typeof Action,\n now: () => number = Scheduler.now) {\n this.now = now;\n }\n\n /**\n * A getter method that returns a number representing the current time\n * (at the time this function was called) according to the scheduler's own\n * internal clock.\n * @return {number} A number that represents the current time. May or may not\n * have a relation to wall-clock time. May or may not refer to a time unit\n * (e.g. milliseconds).\n */\n public now: () => number;\n\n /**\n * Schedules a function, `work`, for execution. May happen at some point in\n * the future, according to the `delay` parameter, if specified. May be passed\n * some context object, `state`, which will be passed to the `work` function.\n *\n * The given arguments will be processed an stored as an Action object in a\n * queue of actions.\n *\n * @param {function(state: ?T): ?Subscription} work A function representing a\n * task, or some unit of work to be executed by the Scheduler.\n * @param {number} [delay] Time to wait before executing the work, where the\n * time unit is implicit and defined by the Scheduler itself.\n * @param {T} [state] Some contextual data that the `work` function uses when\n * called by the Scheduler.\n * @return {Subscription} A subscription in order to be able to unsubscribe\n * the scheduled work.\n */\n public schedule<T>(work: (this: SchedulerAction<T>, state?: T) => void, delay: number = 0, state?: T): Subscription {\n return new this.SchedulerAction<T>(this, work).schedule(state, delay);\n }\n}\n","import { Scheduler } from '../Scheduler';\nimport { Action } from './Action';\nimport { AsyncAction } from './AsyncAction';\nimport { SchedulerAction } from '../types';\nimport { Subscription } from '../Subscription';\n\nexport class AsyncScheduler extends Scheduler {\n public static delegate?: Scheduler;\n public actions: Array<AsyncAction<any>> = [];\n /**\n * A flag to indicate whether the Scheduler is currently executing a batch of\n * queued actions.\n * @type {boolean}\n * @deprecated internal use only\n */\n public active: boolean = false;\n /**\n * An internal ID used to track the latest asynchronous task such as those\n * coming from `setTimeout`, `setInterval`, `requestAnimationFrame`, and\n * others.\n * @type {any}\n * @deprecated internal use only\n */\n public scheduled: any = undefined;\n\n constructor(SchedulerAction: typeof Action,\n now: () => number = Scheduler.now) {\n super(SchedulerAction, () => {\n if (AsyncScheduler.delegate && AsyncScheduler.delegate !== this) {\n return AsyncScheduler.delegate.now();\n } else {\n return now();\n }\n });\n }\n\n public schedule<T>(work: (this: SchedulerAction<T>, state?: T) => void, delay: number = 0, state?: T): Subscription {\n if (AsyncScheduler.delegate && AsyncScheduler.delegate !== this) {\n return AsyncScheduler.delegate.schedule(work, delay, state);\n } else {\n return super.schedule(work, delay, state);\n }\n }\n\n public flush(action: AsyncAction<any>): void {\n\n const {actions} = this;\n\n if (this.active) {\n actions.push(action);\n return;\n }\n\n let error: any;\n this.active = true;\n\n do {\n if (error = action.execute(action.state, action.delay)) {\n break;\n }\n } while (action = actions.shift()); // exhaust the scheduler queue\n\n this.active = false;\n\n if (error) {\n while (action = actions.shift()) {\n action.unsubscribe();\n }\n throw error;\n }\n }\n}\n","import { AsyncScheduler } from './AsyncScheduler';\n\nexport class QueueScheduler extends AsyncScheduler {\n}\n","import { QueueAction } from './QueueAction';\nimport { QueueScheduler } from './QueueScheduler';\n\n/**\n *\n * Queue Scheduler\n *\n * <span class=\"informal\">Put every next task on a queue, instead of executing it immediately</span>\n *\n * `queue` scheduler, when used with delay, behaves the same as {@link asyncScheduler} scheduler.\n *\n * When used without delay, it schedules given task synchronously - executes it right when\n * it is scheduled. However when called recursively, that is when inside the scheduled task,\n * another task is scheduled with queue scheduler, instead of executing immediately as well,\n * that task will be put on a queue and wait for current one to finish.\n *\n * This means that when you execute task with `queue` scheduler, you are sure it will end\n * before any other task scheduled with that scheduler will start.\n *\n * ## Examples\n * Schedule recursively first, then do something\n * ```javascript\n * Rx.Scheduler.queue.schedule(() => {\n * Rx.Scheduler.queue.schedule(() => console.log('second')); // will not happen now, but will be put on a queue\n *\n * console.log('first');\n * });\n *\n * // Logs:\n * // \"first\"\n * // \"second\"\n * ```\n *\n * Reschedule itself recursively\n * ```javascript\n * Rx.Scheduler.queue.schedule(function(state) {\n * if (state !== 0) {\n * console.log('before', state);\n * this.schedule(state - 1); // `this` references currently executing Action,\n * // which we reschedule with new state\n * console.log('after', state);\n * }\n * }, 0, 3);\n *\n * // In scheduler that runs recursively, you would expect:\n * // \"before\", 3\n * // \"before\", 2\n * // \"before\", 1\n * // \"after\", 1\n * // \"after\", 2\n * // \"after\", 3\n *\n * // But with queue it logs:\n * // \"before\", 3\n * // \"after\", 3\n * // \"before\", 2\n * // \"after\", 2\n * // \"before\", 1\n * // \"after\", 1\n * ```\n *\n * @static true\n * @name queue\n * @owner Scheduler\n */\n\nexport const queue = new QueueScheduler(QueueAction);\n","import { Observable } from '../Observable';\nimport { SchedulerLike } from '../types';\n\n/**\n * The same Observable instance returned by any call to {@link empty} without a\n * `scheduler`. It is preferrable to use this over `empty()`.\n */\nexport const EMPTY = new Observable<never>(subscriber => subscriber.complete());\n\n/**\n * Creates an Observable that emits no items to the Observer and immediately\n * emits a complete notification.\n *\n * <span class=\"informal\">Just emits 'complete', and nothing else.\n * </span>\n *\n * ![](empty.png)\n *\n * This static operator is useful for creating a simple Observable that only\n * emits the complete notification. It can be used for composing with other\n * Observables, such as in a {@link mergeMap}.\n *\n * ## Examples\n * ### Emit the number 7, then complete\n * ```javascript\n * const result = empty().pipe(startWith(7));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * ### Map and flatten only odd numbers to the sequence 'a', 'b', 'c'\n * ```javascript\n * const interval$ = interval(1000);\n * result = interval$.pipe(\n * mergeMap(x => x % 2 === 1 ? of('a', 'b', 'c') : empty()),\n * );\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following to the console:\n * // x is equal to the count on the interval eg(0,1,2,3,...)\n * // x will occur every 1000ms\n * // if x % 2 is equal to 1 print abc\n * // if x % 2 is not equal to 1 nothing will be output\n * ```\n *\n * @see {@link Observable}\n * @see {@link never}\n * @see {@link of}\n * @see {@link throwError}\n *\n * @param {SchedulerLike} [scheduler] A {@link SchedulerLike} to use for scheduling\n * the emission of the complete notification.\n * @return {Observable} An \"empty\" Observable: emits only the complete\n * notification.\n * @static true\n * @name empty\n * @owner Observable\n * @deprecated Deprecated in favor of using {@link index/EMPTY} constant.\n */\nexport function empty(scheduler?: SchedulerLike) {\n return scheduler ? emptyScheduled(scheduler) : EMPTY;\n}\n\nexport function emptyScheduled(scheduler: SchedulerLike) {\n return new Observable<never>(subscriber => scheduler.schedule(() => subscriber.complete()));\n}\n","import { SchedulerLike } from '../types';\n\nexport function isScheduler(value: any): value is SchedulerLike {\n return value && typeof (<any>value).schedule === 'function';\n}\n","import { Subscriber } from '../Subscriber';\n\n/**\n * Subscribes to an ArrayLike with a subscriber\n * @param array The array or array-like to subscribe to\n */\nexport const subscribeToArray = <T>(array: ArrayLike<T>) => (subscriber: Subscriber<T>) => {\n for (let i = 0, len = array.length; i < len && !subscriber.closed; i++) {\n subscriber.next(array[i]);\n }\n if (!subscriber.closed) {\n subscriber.complete();\n }\n};\n","import { Observable } from '../Observable';\nimport { SchedulerLike } from '../types';\nimport { Subscription } from '../Subscription';\nimport { subscribeToArray } from '../util/subscribeToArray';\n\nexport function fromArray<T>(input: ArrayLike<T>, scheduler?: SchedulerLike) {\n if (!scheduler) {\n return new Observable<T>(subscribeToArray(input));\n } else {\n return new Observable<T>(subscriber => {\n const sub = new Subscription();\n let 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 }\n}\n","import { Observable } from '../Observable';\n\nexport function scalar<T>(value: T) {\n const result = new Observable<T>(subscriber => {\n subscriber.next(value);\n subscriber.complete();\n });\n result._isScalar = true;\n (result as any).value = value;\n return result;\n}\n","import { SchedulerLike } from '../types';\nimport { isScheduler } from '../util/isScheduler';\nimport { fromArray } from './fromArray';\nimport { empty } from './empty';\nimport { scalar } from './scalar';\nimport { Observable } from '../Observable';\n\n/* tslint:disable:max-line-length */\nexport function of<T>(a: T, scheduler?: SchedulerLike): Observable<T>;\nexport function of<T, T2>(a: T, b: T2, scheduler?: SchedulerLike): Observable<T | T2>;\nexport function of<T, T2, T3>(a: T, b: T2, c: T3, scheduler?: SchedulerLike): Observable<T | T2 | T3>;\nexport function of<T, T2, T3, T4>(a: T, b: T2, c: T3, d: T4, scheduler?: SchedulerLike): Observable<T | T2 | T3 | T4>;\nexport function of<T, T2, T3, T4, T5>(a: T, b: T2, c: T3, d: T4, e: T5, scheduler?: SchedulerLike): Observable<T | T2 | T3 | T4 | T5>;\nexport function of<T, T2, T3, T4, T5, T6>(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, scheduler?: SchedulerLike): Observable<T | T2 | T3 | T4 | T5 | T6>;\nexport function of<T, T2, T3, T4, T5, T6, T7>(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, g: T7, scheduler?: SchedulerLike):\n Observable<T | T2 | T3 | T4 | T5 | T6 | T7>;\nexport function of<T, T2, T3, T4, T5, T6, T7, T8>(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, g: T7, h: T8, scheduler?: SchedulerLike):\n Observable<T | T2 | T3 | T4 | T5 | T6 | T7 | T8>;\nexport function of<T, T2, T3, T4, T5, T6, T7, T8, T9>(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, g: T7, h: T8, i: T9, scheduler?: SchedulerLike):\n Observable<T | T2 | T3 | T4 | T5 | T6 | T7 | T8 | T9>;\nexport function of<T>(...args: Array<T | SchedulerLike>): Observable<T>;\n/* tslint:enable:max-line-length */\n\n/**\n * Converts the arguments to an observable sequence.\n *\n * <span class=\"informal\">Each argument becomes a `next` notification.</span>\n *\n * ![](of.png)\n *\n * Unlike {@link from}, it does not do any flattening and emits each argument in whole\n * as a separate `next` notification.\n *\n * ## Examples\n *\n * Emit the values `10, 20, 30`\n *\n * ```javascript\n * of(10, 20, 30)\n * .subscribe(\n * next => console.log('next:', next),\n * err => console.log('error:', err),\n * () => console.log('the end'),\n * );\n * // result:\n * // 'next: 10'\n * // 'next: 20'\n * // 'next: 30'\n *\n * ```\n *\n * Emit the array `[1,2,3]`\n *\n * ```javascript\n * of([1,2,3])\n * .subscribe(\n * next => console.log('next:', next),\n * err => console.log('error:', err),\n * () => console.log('the end'),\n * );\n * // result:\n * // 'next: [1,2,3]'\n * ```\n *\n * @see {@link from}\n * @see {@link range}\n *\n * @param {...T} values A comma separated list of arguments you want to be emitted\n * @return {Observable} An Observable that emits the arguments\n * described above and then completes.\n * @method of\n * @owner Observable\n */\n\nexport function of<T>(...args: Array<T | SchedulerLike>): Observable<T> {\n let scheduler = args[args.length - 1] as SchedulerLike;\n if (isScheduler(scheduler)) {\n args.pop();\n } else {\n scheduler = undefined;\n }\n switch (args.length) {\n case 0:\n return empty(scheduler);\n case 1:\n return scheduler ? fromArray(args as T[], scheduler) : scalar(args[0] as T);\n default:\n return fromArray(args as T[], scheduler);\n }\n}\n","import { Observable } from '../Observable';\nimport { SchedulerLike } from '../types';\nimport { Subscriber } from '../Subscriber';\n\n/**\n * Creates an Observable that emits no items to the Observer and immediately\n * emits an error notification.\n *\n * <span class=\"informal\">Just emits 'error', and nothing else.\n * </span>\n *\n * ![](throw.png)\n *\n * This static operator is useful for creating a simple Observable that only\n * emits the error notification. It can be used for composing with other\n * Observables, such as in a {@link mergeMap}.\n *\n * ## Examples\n * ### Emit the number 7, then emit an error\n * ```javascript\n * import { throwError, concat, of } from 'rxjs';\n *\n * const result = concat(of(7), throwError(new Error('oops!')));\n * result.subscribe(x => console.log(x), e => console.error(e));\n *\n * // Logs:\n * // 7\n * // Error: oops!\n * ```\n *\n * ---\n *\n * ### Map and flatten numbers to the sequence 'a', 'b', 'c', but throw an error for 13\n * ```javascript\n * import { throwError, interval, of } from 'rxjs';\n * import { mergeMap } from 'rxjs/operators';\n *\n * interval(1000).pipe(\n * mergeMap(x => x === 2\n * ? throwError('Twos are bad')\n * : of('a', 'b', 'c')\n * ),\n * ).subscribe(x => console.log(x), e => console.error(e));\n *\n * // Logs:\n * // a\n * // b\n * // c\n * // a\n * // b\n * // c\n * // Twos are bad\n * ```\n *\n * @see {@link Observable}\n * @see {@link empty}\n * @see {@link never}\n * @see {@link of}\n *\n * @param {any} error The particular Error to pass to the error notification.\n * @param {SchedulerLike} [scheduler] A {@link SchedulerLike} to use for scheduling\n * the emission of the error notification.\n * @return {Observable} An error Observable: emits only the error notification\n * using the given error argument.\n * @static true\n * @name throwError\n * @owner Observable\n */\nexport function throwError(error: any, scheduler?: SchedulerLike): Observable<never> {\n if (!scheduler) {\n return new Observable(subscriber => subscriber.error(error));\n } else {\n return new Observable(subscriber => scheduler.schedule(dispatch, 0, { error, subscriber }));\n }\n}\n\ninterface DispatchArg {\n error: any;\n subscriber: Subscriber<any>;\n}\n\nfunction dispatch({ error, subscriber }: DispatchArg) {\n subscriber.error(error);\n}\n","import { PartialObserver } from './types';\nimport { Observable } from './Observable';\nimport { empty } from './observable/empty';\nimport { of } from './observable/of';\nimport { throwError } from './observable/throwError';\n\n/**\n * Represents a push-based event or value that an {@link Observable} can emit.\n * This class is particularly useful for operators that manage notifications,\n * like {@link materialize}, {@link dematerialize}, {@link observeOn}, and\n * others. Besides wrapping the actual delivered value, it also annotates it\n * with metadata of, for instance, what type of push message it is (`next`,\n * `error`, or `complete`).\n *\n * @see {@link materialize}\n * @see {@link dematerialize}\n * @see {@link observeOn}\n *\n * @class Notification<T>\n */\nexport class Notification<T> {\n hasValue: boolean;\n\n constructor(public kind: string, public value?: T, public error?: any) {\n this.hasValue = kind === 'N';\n }\n\n /**\n * Delivers to the given `observer` the value wrapped by this Notification.\n * @param {Observer} observer\n * @return\n */\n observe(observer: PartialObserver<T>): any {\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\n /**\n * Given some {@link Observer} callbacks, deliver the value represented by the\n * current Notification to the correctly corresponding callback.\n * @param {function(value: T): void} next An Observer `next` callback.\n * @param {function(err: any): void} [error] An Observer `error` callback.\n * @param {function(): void} [complete] An Observer `complete` callback.\n * @return {any}\n */\n do(next: (value: T) => void, error?: (err: any) => void, complete?: () => void): any {\n const 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\n /**\n * Takes an Observer or its individual callback functions, and calls `observe`\n * or `do` methods accordingly.\n * @param {Observer|function(value: T): void} nextOrObserver An Observer or\n * the `next` callback.\n * @param {function(err: any): void} [error] An Observer `error` callback.\n * @param {function(): void} [complete] An Observer `complete` callback.\n * @return {any}\n */\n accept(nextOrObserver: PartialObserver<T> | ((value: T) => void), error?: (err: any) => void, complete?: () => void) {\n if (nextOrObserver && typeof (<PartialObserver<T>>nextOrObserver).next === 'function') {\n return this.observe(<PartialObserver<T>>nextOrObserver);\n } else {\n return this.do(<(value: T) => void>nextOrObserver, error, complete);\n }\n }\n\n /**\n * Returns a simple Observable that just delivers the notification represented\n * by this Notification instance.\n * @return {any}\n */\n toObservable(): Observable<T> {\n const kind = this.kind;\n switch (kind) {\n case 'N':\n return of(this.value);\n case 'E':\n return throwError(this.error);\n case 'C':\n return empty();\n }\n throw new Error('unexpected notification kind value');\n }\n\n private static completeNotification: Notification<any> = new Notification('C');\n private static undefinedValueNotification: Notification<any> = new Notification('N', undefined);\n\n /**\n * A shortcut to create a Notification instance of the type `next` from a\n * given value.\n * @param {T} value The `next` value.\n * @return {Notification<T>} The \"next\" Notification representing the\n * argument.\n * @nocollapse\n */\n static createNext<T>(value: T): Notification<T> {\n if (typeof value !== 'undefined') {\n return new Notification('N', value);\n }\n return Notification.undefinedValueNotification;\n }\n\n /**\n * A shortcut to create a Notification instance of the type `error` from a\n * given error.\n * @param {any} [err] The `error` error.\n * @return {Notification<T>} The \"error\" Notification representing the\n * argument.\n * @nocollapse\n */\n static createError<T>(err?: any): Notification<T> {\n return new Notification('E', undefined, err);\n }\n\n /**\n * A shortcut to create a Notification instance of the type `complete`.\n * @return {Notification<any>} The valueless \"complete\" Notification.\n * @nocollapse\n */\n static createComplete(): Notification<any> {\n return Notification.completeNotification;\n }\n}\n","import { Observable } from '../Observable';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { Notification } from '../Notification';\nimport { MonoTypeOperatorFunction, PartialObserver, SchedulerAction, SchedulerLike, TeardownLogic } from '../types';\n\n/**\n *\n * Re-emits all notifications from source Observable with specified scheduler.\n *\n * <span class=\"informal\">Ensure a specific scheduler is used, from outside of an Observable.</span>\n *\n * `observeOn` is an operator that accepts a scheduler as a first parameter, which will be used to reschedule\n * notifications emitted by the source Observable. It might be useful, if you do not have control over\n * internal scheduler of a given Observable, but want to control when its values are emitted nevertheless.\n *\n * Returned Observable emits the same notifications (nexted values, complete and error events) as the source Observable,\n * but rescheduled with provided scheduler. Note that this doesn't mean that source Observables internal\n * scheduler will be replaced in any way. Original scheduler still will be used, but when the source Observable emits\n * notification, it will be immediately scheduled again - this time with scheduler passed to `observeOn`.\n * An anti-pattern would be calling `observeOn` on Observable that emits lots of values synchronously, to split\n * that emissions into asynchronous chunks. For this to happen, scheduler would have to be passed into the source\n * Observable directly (usually into the operator that creates it). `observeOn` simply delays notifications a\n * little bit more, to ensure that they are emitted at expected moments.\n *\n * As a matter of fact, `observeOn` accepts second parameter, which specifies in milliseconds with what delay notifications\n * will be emitted. The main difference between {@link delay} operator and `observeOn` is that `observeOn`\n * will delay all notifications - including error notifications - while `delay` will pass through error\n * from source Observable immediately when it is emitted. In general it is highly recommended to use `delay` operator\n * for any kind of delaying of values in the stream, while using `observeOn` to specify which scheduler should be used\n * for notification emissions in general.\n *\n * ## Example\n * Ensure values in subscribe are called just before browser repaint.\n * ```javascript\n * const intervals = interval(10); // Intervals are scheduled\n * // with async scheduler by default...\n * intervals.pipe(\n * observeOn(animationFrameScheduler), // ...but we will observe on animationFrame\n * ) // scheduler to ensure smooth animation.\n * .subscribe(val => {\n * someDiv.style.height = val + 'px';\n * });\n * ```\n *\n * @see {@link delay}\n *\n * @param {SchedulerLike} scheduler Scheduler that will be used to reschedule notifications from source Observable.\n * @param {number} [delay] Number of milliseconds that states with what delay every notification should be rescheduled.\n * @return {Observable<T>} Observable that emits the same notifications as the source Observable,\n * but with provided scheduler.\n *\n * @method observeOn\n * @owner Observable\n */\nexport function observeOn<T>(scheduler: SchedulerLike, delay: number = 0): MonoTypeOperatorFunction<T> {\n return function observeOnOperatorFunction(source: Observable<T>): Observable<T> {\n return source.lift(new ObserveOnOperator(scheduler, delay));\n };\n}\n\nexport class ObserveOnOperator<T> implements Operator<T, T> {\n constructor(private scheduler: SchedulerLike, private delay: number = 0) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new ObserveOnSubscriber(subscriber, this.scheduler, this.delay));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class ObserveOnSubscriber<T> extends Subscriber<T> {\n /** @nocollapse */\n static dispatch(this: SchedulerAction<ObserveOnMessage>, arg: ObserveOnMessage) {\n const { notification, destination } = arg;\n notification.observe(destination);\n this.unsubscribe();\n }\n\n constructor(destination: Subscriber<T>,\n private scheduler: SchedulerLike,\n private delay: number = 0) {\n super(destination);\n }\n\n private scheduleMessage(notification: Notification<any>): void {\n const destination = this.destination as Subscription;\n destination.add(this.scheduler.schedule(\n ObserveOnSubscriber.dispatch,\n this.delay,\n new ObserveOnMessage(notification, this.destination)\n ));\n }\n\n protected _next(value: T): void {\n this.scheduleMessage(Notification.createNext(value));\n }\n\n protected _error(err: any): void {\n this.scheduleMessage(Notification.createError(err));\n this.unsubscribe();\n }\n\n protected _complete(): void {\n this.scheduleMessage(Notification.createComplete());\n this.unsubscribe();\n }\n}\n\nexport class ObserveOnMessage {\n constructor(public notification: Notification<any>,\n public destination: PartialObserver<any>) {\n }\n}\n","import { Subject } from './Subject';\nimport { SchedulerLike } from './types';\nimport { queue } from './scheduler/queue';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\nimport { ObserveOnSubscriber } from './operators/observeOn';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { SubjectSubscription } from './SubjectSubscription';\n/**\n * A variant of Subject that \"replays\" or emits old values to new subscribers.\n * It buffers a set number of values and will emit those values immediately to\n * any new subscribers in addition to emitting new values to existing subscribers.\n *\n * @class ReplaySubject<T>\n */\nexport class ReplaySubject<T> extends Subject<T> {\n private _events: (ReplayEvent<T> | T)[] = [];\n private _bufferSize: number;\n private _windowTime: number;\n private _infiniteTimeWindow: boolean = false;\n\n constructor(bufferSize: number = Number.POSITIVE_INFINITY,\n windowTime: number = Number.POSITIVE_INFINITY,\n private scheduler?: SchedulerLike) {\n super();\n this._bufferSize = bufferSize < 1 ? 1 : bufferSize;\n this._windowTime = windowTime < 1 ? 1 : windowTime;\n\n if (windowTime === Number.POSITIVE_INFINITY) {\n this._infiniteTimeWindow = true;\n this.next = this.nextInfiniteTimeWindow;\n } else {\n this.next = this.nextTimeWindow;\n }\n }\n\n private nextInfiniteTimeWindow(value: T): void {\n const _events = this._events;\n _events.push(value);\n // Since this method is invoked in every next() call than the buffer\n // can overgrow the max size only by one item\n if (_events.length > this._bufferSize) {\n _events.shift();\n }\n\n super.next(value);\n }\n\n private nextTimeWindow(value: T): void {\n this._events.push(new ReplayEvent(this._getNow(), value));\n this._trimBufferThenGetEvents();\n\n super.next(value);\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _subscribe(subscriber: Subscriber<T>): Subscription {\n // When `_infiniteTimeWindow === true` then the buffer is already trimmed\n const _infiniteTimeWindow = this._infiniteTimeWindow;\n const _events = _infiniteTimeWindow ? this._events : this._trimBufferThenGetEvents();\n const scheduler = this.scheduler;\n const len = _events.length;\n let subscription: Subscription;\n\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n } else if (this.isStopped || this.hasError) {\n subscription = Subscription.EMPTY;\n } else {\n this.observers.push(subscriber);\n subscription = new SubjectSubscription(this, subscriber);\n }\n\n if (scheduler) {\n subscriber.add(subscriber = new ObserveOnSubscriber<T>(subscriber, scheduler));\n }\n\n if (_infiniteTimeWindow) {\n for (let i = 0; i < len && !subscriber.closed; i++) {\n subscriber.next(<T>_events[i]);\n }\n } else {\n for (let i = 0; i < len && !subscriber.closed; i++) {\n subscriber.next((<ReplayEvent<T>>_events[i]).value);\n }\n }\n\n if (this.hasError) {\n subscriber.error(this.thrownError);\n } else if (this.isStopped) {\n subscriber.complete();\n }\n\n return subscription;\n }\n\n _getNow(): number {\n return (this.scheduler || queue).now();\n }\n\n private _trimBufferThenGetEvents(): ReplayEvent<T>[] {\n const now = this._getNow();\n const _bufferSize = this._bufferSize;\n const _windowTime = this._windowTime;\n const _events = <ReplayEvent<T>[]>this._events;\n\n const eventsCount = _events.length;\n let spliceCount = 0;\n\n // Trim events that fall out of the time window.\n // Start at the front of the list. Break early once\n // we encounter an event that falls within the window.\n while (spliceCount < eventsCount) {\n if ((now - _events[spliceCount].time) < _windowTime) {\n break;\n }\n spliceCount++;\n }\n\n if (eventsCount > _bufferSize) {\n spliceCount = Math.max(spliceCount, eventsCount - _bufferSize);\n }\n\n if (spliceCount > 0) {\n _events.splice(0, spliceCount);\n }\n\n return _events;\n }\n\n}\n\nclass ReplayEvent<T> {\n constructor(public time: number, public value: T) {\n }\n}\n","import { Subject } from './Subject';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\n\n/**\n * A variant of Subject that only emits a value when it completes. It will emit\n * its latest value to all its observers on completion.\n *\n * @class AsyncSubject<T>\n */\nexport class AsyncSubject<T> extends Subject<T> {\n private value: T = null;\n private hasNext: boolean = false;\n private hasCompleted: boolean = false;\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _subscribe(subscriber: Subscriber<any>): Subscription {\n if (this.hasError) {\n subscriber.error(this.thrownError);\n return Subscription.EMPTY;\n } else if (this.hasCompleted && this.hasNext) {\n subscriber.next(this.value);\n subscriber.complete();\n return Subscription.EMPTY;\n }\n return super._subscribe(subscriber);\n }\n\n next(value: T): void {\n if (!this.hasCompleted) {\n this.value = value;\n this.hasNext = true;\n }\n }\n\n error(error: any): void {\n if (!this.hasCompleted) {\n super.error(error);\n }\n }\n\n complete(): void {\n this.hasCompleted = true;\n if (this.hasNext) {\n super.next(this.value);\n }\n super.complete();\n }\n}\n","let nextHandle = 1;\n\nconst tasksByHandle: { [handle: string]: () => void } = {};\n\nfunction runIfPresent(handle: number) {\n const cb = tasksByHandle[handle];\n if (cb) {\n cb();\n }\n}\n\nexport const Immediate = {\n setImmediate(cb: () => void): number {\n const handle = nextHandle++;\n tasksByHandle[handle] = cb;\n Promise.resolve().then(() => runIfPresent(handle));\n return handle;\n },\n\n clearImmediate(handle: number): void {\n delete tasksByHandle[handle];\n },\n};\n","import { Immediate } from '../util/Immediate';\nimport { AsyncAction } from './AsyncAction';\nimport { AsapScheduler } from './AsapScheduler';\nimport { SchedulerAction } from '../types';\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class AsapAction<T> extends AsyncAction<T> {\n\n constructor(protected scheduler: AsapScheduler,\n protected work: (this: SchedulerAction<T>, state?: T) => void) {\n super(scheduler, work);\n }\n\n protected requestAsyncId(scheduler: AsapScheduler, id?: any, delay: number = 0): any {\n // If delay is greater than 0, request as an async action.\n if (delay !== null && delay > 0) {\n return super.requestAsyncId(scheduler, id, delay);\n }\n // Push the action to the end of the scheduler queue.\n scheduler.actions.push(this);\n // If a microtask has already been scheduled, don't schedule another\n // one. If a microtask hasn't been scheduled yet, schedule one now. Return\n // the current scheduled microtask id.\n return scheduler.scheduled || (scheduler.scheduled = Immediate.setImmediate(\n scheduler.flush.bind(scheduler, null)\n ));\n }\n protected recycleAsyncId(scheduler: AsapScheduler, id?: any, delay: number = 0): any {\n // If delay exists and is greater than 0, or if the delay is null (the\n // action wasn't rescheduled) but was originally scheduled as an async\n // action, then recycle as an async action.\n if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {\n return super.recycleAsyncId(scheduler, id, delay);\n }\n // If the scheduler queue is empty, cancel the requested microtask and\n // set the scheduled flag to undefined so the next AsapAction will schedule\n // its own.\n if (scheduler.actions.length === 0) {\n Immediate.clearImmediate(id);\n scheduler.scheduled = undefined;\n }\n // Return undefined so the action knows to request a new async id if it's rescheduled.\n return undefined;\n }\n}\n","import { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\n\nexport class AsapScheduler extends AsyncScheduler {\n public flush(action?: AsyncAction<any>): void {\n\n this.active = true;\n this.scheduled = undefined;\n\n const {actions} = this;\n let error: any;\n let index: number = -1;\n let count: number = actions.length;\n action = action || actions.shift();\n\n do {\n if (error = action.execute(action.state, action.delay)) {\n break;\n }\n } while (++index < count && (action = actions.shift()));\n\n this.active = false;\n\n if (error) {\n while (++index < count && (action = actions.shift())) {\n action.unsubscribe();\n }\n throw error;\n }\n }\n}\n","import { AsapAction } from './AsapAction';\nimport { AsapScheduler } from './AsapScheduler';\n\n/**\n *\n * Asap Scheduler\n *\n * <span class=\"informal\">Perform task as fast as it can be performed asynchronously</span>\n *\n * `asap` scheduler behaves the same as {@link asyncScheduler} scheduler when you use it to delay task\n * in time. If however you set delay to `0`, `asap` will wait for current synchronously executing\n * code to end and then it will try to execute given task as fast as possible.\n *\n * `asap` scheduler will do its best to minimize time between end of currently executing code\n * and start of scheduled task. This makes it best candidate for performing so called \"deferring\".\n * Traditionally this was achieved by calling `setTimeout(deferredTask, 0)`, but that technique involves\n * some (although minimal) unwanted delay.\n *\n * Note that using `asap` scheduler does not necessarily mean that your task will be first to process\n * after currently executing code. In particular, if some task was also scheduled with `asap` before,\n * that task will execute first. That being said, if you need to schedule task asynchronously, but\n * as soon as possible, `asap` scheduler is your best bet.\n *\n * ## Example\n * Compare async and asap scheduler<\n * ```javascript\n * Rx.Scheduler.async.schedule(() => console.log('async')); // scheduling 'async' first...\n * Rx.Scheduler.asap.schedule(() => console.log('asap'));\n *\n * // Logs:\n * // \"asap\"\n * // \"async\"\n * // ... but 'asap' goes first!\n * ```\n * @static true\n * @name asap\n * @owner Scheduler\n */\n\nexport const asap = new AsapScheduler(AsapAction);\n","import { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\n\n/**\n *\n * Async Scheduler\n *\n * <span class=\"informal\">Schedule task as if you used setTimeout(task, duration)</span>\n *\n * `async` scheduler schedules tasks asynchronously, by putting them on the JavaScript\n * event loop queue. It is best used to delay tasks in time or to schedule tasks repeating\n * in intervals.\n *\n * If you just want to \"defer\" task, that is to perform it right after currently\n * executing synchronous code ends (commonly achieved by `setTimeout(deferredTask, 0)`),\n * better choice will be the {@link asapScheduler} scheduler.\n *\n * ## Examples\n * Use async scheduler to delay task\n * ```javascript\n * const task = () => console.log('it works!');\n *\n * Rx.Scheduler.async.schedule(task, 2000);\n *\n * // After 2 seconds logs:\n * // \"it works!\"\n * ```\n *\n * Use async scheduler to repeat task in intervals\n * ```javascript\n * function task(state) {\n * console.log(state);\n * this.schedule(state + 1, 1000); // `this` references currently executing Action,\n * // which we reschedule with new state and delay\n * }\n *\n * Rx.Scheduler.async.schedule(task, 3000, 0);\n *\n * // Logs:\n * // 0 after 3s\n * // 1 after 4s\n * // 2 after 5s\n * // 3 after 6s\n * ```\n *\n * @static true\n * @name async\n * @owner Scheduler\n */\n\nexport const async = new AsyncScheduler(AsyncAction);\n","import { AsyncAction } from './AsyncAction';\nimport { AnimationFrameScheduler } from './AnimationFrameScheduler';\nimport { SchedulerAction } from '../types';\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class AnimationFrameAction<T> extends AsyncAction<T> {\n\n constructor(protected scheduler: AnimationFrameScheduler,\n protected work: (this: SchedulerAction<T>, state?: T) => void) {\n super(scheduler, work);\n }\n\n protected requestAsyncId(scheduler: AnimationFrameScheduler, id?: any, delay: number = 0): any {\n // If delay is greater than 0, request as an async action.\n if (delay !== null && delay > 0) {\n return super.requestAsyncId(scheduler, id, delay);\n }\n // Push the action to the end of the scheduler queue.\n scheduler.actions.push(this);\n // If an animation frame has already been requested, don't request another\n // one. If an animation frame hasn't been requested yet, request one. Return\n // the current animation frame request id.\n return scheduler.scheduled || (scheduler.scheduled = requestAnimationFrame(\n () => scheduler.flush(null)));\n }\n protected recycleAsyncId(scheduler: AnimationFrameScheduler, id?: any, delay: number = 0): any {\n // If delay exists and is greater than 0, or if the delay is null (the\n // action wasn't rescheduled) but was originally scheduled as an async\n // action, then recycle as an async action.\n if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {\n return super.recycleAsyncId(scheduler, id, delay);\n }\n // If the scheduler queue is empty, cancel the requested animation frame and\n // set the scheduled flag to undefined so the next AnimationFrameAction will\n // request its own.\n if (scheduler.actions.length === 0) {\n cancelAnimationFrame(id);\n scheduler.scheduled = undefined;\n }\n // Return undefined so the action knows to request a new async id if it's rescheduled.\n return undefined;\n }\n}\n","import { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\n\nexport class AnimationFrameScheduler extends AsyncScheduler {\n public flush(action?: AsyncAction<any>): void {\n\n this.active = true;\n this.scheduled = undefined;\n\n const {actions} = this;\n let error: any;\n let index: number = -1;\n let count: number = actions.length;\n action = action || actions.shift();\n\n do {\n if (error = action.execute(action.state, action.delay)) {\n break;\n }\n } while (++index < count && (action = actions.shift()));\n\n this.active = false;\n\n if (error) {\n while (++index < count && (action = actions.shift())) {\n action.unsubscribe();\n }\n throw error;\n }\n }\n}\n","import { AnimationFrameAction } from './AnimationFrameAction';\nimport { AnimationFrameScheduler } from './AnimationFrameScheduler';\n\n/**\n *\n * Animation Frame Scheduler\n *\n * <span class=\"informal\">Perform task when `window.requestAnimationFrame` would fire</span>\n *\n * When `animationFrame` scheduler is used with delay, it will fall back to {@link asyncScheduler} scheduler\n * behaviour.\n *\n * Without delay, `animationFrame` scheduler can be used to create smooth browser animations.\n * It makes sure scheduled task will happen just before next browser content repaint,\n * thus performing animations as efficiently as possible.\n *\n * ## Example\n * Schedule div height animation\n * ```javascript\n * const div = document.querySelector('.some-div');\n *\n * Rx.Scheduler.animationFrame.schedule(function(height) {\n * div.style.height = height + \"px\";\n *\n * this.schedule(height + 1); // `this` references currently executing Action,\n * // which we reschedule with new state\n * }, 0, 0);\n *\n * // You will see .some-div element growing in height\n * ```\n *\n * @static true\n * @name animationFrame\n * @owner Scheduler\n */\n\nexport const animationFrame = new AnimationFrameScheduler(AnimationFrameAction);\n","import { AsyncAction } from './AsyncAction';\nimport { Subscription } from '../Subscription';\nimport { AsyncScheduler } from './AsyncScheduler';\nimport { SchedulerAction } from '../types';\n\nexport class VirtualTimeScheduler extends AsyncScheduler {\n\n protected static frameTimeFactor: number = 10;\n\n public frame: number = 0;\n public index: number = -1;\n\n constructor(SchedulerAction: typeof AsyncAction = VirtualAction as any,\n public maxFrames: number = Number.POSITIVE_INFINITY) {\n super(SchedulerAction, () => this.frame);\n }\n\n /**\n * Prompt the Scheduler to execute all of its queued actions, therefore\n * clearing its queue.\n * @return {void}\n */\n public flush(): void {\n\n const {actions, maxFrames} = this;\n let error: any, action: AsyncAction<any>;\n\n while ((action = actions.shift()) && (this.frame = action.delay) <= maxFrames) {\n if (error = action.execute(action.state, action.delay)) {\n break;\n }\n }\n\n if (error) {\n while (action = actions.shift()) {\n action.unsubscribe();\n }\n throw error;\n }\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @nodoc\n */\nexport class VirtualAction<T> extends AsyncAction<T> {\n\n protected active: boolean = true;\n\n constructor(protected scheduler: VirtualTimeScheduler,\n protected work: (this: SchedulerAction<T>, state?: T) => void,\n protected index: number = scheduler.index += 1) {\n super(scheduler, work);\n this.index = scheduler.index = index;\n }\n\n public schedule(state?: T, delay: number = 0): Subscription {\n if (!this.id) {\n return super.schedule(state, delay);\n }\n this.active = false;\n // If an action is rescheduled, we save allocations by mutating its state,\n // pushing it to the end of the scheduler queue, and recycling the action.\n // But since the VirtualTimeScheduler is used for testing, VirtualActions\n // must be immutable so they can be inspected later.\n const action = new VirtualAction(this.scheduler, this.work);\n this.add(action);\n return action.schedule(state, delay);\n }\n\n protected requestAsyncId(scheduler: VirtualTimeScheduler, id?: any, delay: number = 0): any {\n this.delay = scheduler.frame + delay;\n const {actions} = scheduler;\n actions.push(this);\n (actions as Array<VirtualAction<T>>).sort(VirtualAction.sortActions);\n return true;\n }\n\n protected recycleAsyncId(scheduler: VirtualTimeScheduler, id?: any, delay: number = 0): any {\n return undefined;\n }\n\n protected _execute(state: T, delay: number): any {\n if (this.active === true) {\n return super._execute(state, delay);\n }\n }\n\n public static sortActions<T>(a: VirtualAction<T>, b: VirtualAction<T>) {\n if (a.delay === b.delay) {\n if (a.index === b.index) {\n return 0;\n } else if (a.index > b.index) {\n return 1;\n } else {\n return -1;\n }\n } else if (a.delay > b.delay) {\n return 1;\n } else {\n return -1;\n }\n }\n}\n","export function identity<T>(x: T): T {\n return x;\n}\n","import { Observable } from '../Observable';\nimport { ObservableInput } from '../types';\n\n/**\n * Tests to see if the object is an RxJS {@link Observable}\n * @param obj the object to test\n */\nexport function isObservable<T>(obj: any): obj is Observable<T> {\n return !!obj && (obj instanceof Observable || (typeof obj.lift === 'function' && typeof obj.subscribe === 'function'));\n}\n","export interface ArgumentOutOfRangeError extends Error {\n}\n\nexport interface ArgumentOutOfRangeErrorCtor {\n new(): ArgumentOutOfRangeError;\n}\n\nfunction ArgumentOutOfRangeErrorImpl(this: any) {\n Error.call(this);\n this.message = 'argument out of range';\n this.name = 'ArgumentOutOfRangeError';\n return this;\n}\n\nArgumentOutOfRangeErrorImpl.prototype = Object.create(Error.prototype);\n\n/**\n * An error thrown when an element was queried at a certain index of an\n * Observable, but no such index or position exists in that sequence.\n *\n * @see {@link elementAt}\n * @see {@link take}\n * @see {@link takeLast}\n *\n * @class ArgumentOutOfRangeError\n */\nexport const ArgumentOutOfRangeError: ArgumentOutOfRangeErrorCtor = ArgumentOutOfRangeErrorImpl as any;","export interface EmptyError extends Error {\n}\n\nexport interface EmptyErrorCtor {\n new(): EmptyError;\n}\n\nfunction EmptyErrorImpl(this: any) {\n Error.call(this);\n this.message = 'no elements in sequence';\n this.name = 'EmptyError';\n return this;\n}\n\nEmptyErrorImpl.prototype = Object.create(Error.prototype);\n\n/**\n * An error thrown when an Observable or a sequence was queried but has no\n * elements.\n *\n * @see {@link first}\n * @see {@link last}\n * @see {@link single}\n *\n * @class EmptyError\n */\nexport const EmptyError: EmptyErrorCtor = EmptyErrorImpl as any;","export interface TimeoutError extends Error {\r\n}\r\n\r\nexport interface TimeoutErrorCtor {\r\n new(): TimeoutError;\r\n}\r\n\r\nfunction TimeoutErrorImpl(this: any) {\r\n Error.call(this);\r\n this.message = 'Timeout has occurred';\r\n this.name = 'TimeoutError';\r\n return this;\r\n}\r\n\r\nTimeoutErrorImpl.prototype = Object.create(Error.prototype);\r\n\r\n/**\r\n * An error thrown when duetime elapses.\r\n *\r\n * @see {@link timeout}\r\n *\r\n * @class TimeoutError\r\n */\r\nexport const TimeoutError: TimeoutErrorCtor = TimeoutErrorImpl as any;\r\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { OperatorFunction } from '../types';\n\n/**\n * Applies a given `project` function to each value emitted by the source\n * Observable, and emits the resulting values as an Observable.\n *\n * <span class=\"informal\">Like [Array.prototype.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map),\n * it passes each source value through a transformation function to get\n * corresponding output values.</span>\n *\n * ![](map.png)\n *\n * Similar to the well known `Array.prototype.map` function, this operator\n * applies a projection to each value and emits that projection in the output\n * Observable.\n *\n * ## Example\n * Map every click to the clientX position of that click\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const positions = clicks.pipe(map(ev => ev.clientX));\n * positions.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link mapTo}\n * @see {@link pluck}\n *\n * @param {function(value: T, index: number): R} project The function to apply\n * to each `value` emitted by the source Observable. The `index` parameter is\n * the number `i` for the i-th emission that has happened since the\n * subscription, starting from the number `0`.\n * @param {any} [thisArg] An optional argument to define what `this` is in the\n * `project` function.\n * @return {Observable<R>} An Observable that emits the values from the source\n * Observable transformed by the given `project` function.\n * @method map\n * @owner Observable\n */\nexport function map<T, R>(project: (value: T, index: number) => R, thisArg?: any): OperatorFunction<T, R> {\n return function mapOperation(source: Observable<T>): Observable<R> {\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}\n\nexport class MapOperator<T, R> implements Operator<T, R> {\n constructor(private project: (value: T, index: number) => R, private thisArg: any) {\n }\n\n call(subscriber: Subscriber<R>, source: any): any {\n return source.subscribe(new MapSubscriber(subscriber, this.project, this.thisArg));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass MapSubscriber<T, R> extends Subscriber<T> {\n count: number = 0;\n private thisArg: any;\n\n constructor(destination: Subscriber<R>,\n private project: (value: T, index: number) => R,\n thisArg: any) {\n super(destination);\n this.thisArg = thisArg || this;\n }\n\n // NOTE: This looks unoptimized, but it's actually purposefully NOT\n // using try/catch optimizations.\n protected _next(value: T) {\n let result: any;\n try {\n result = this.project.call(this.thisArg, value, this.count++);\n } catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n }\n}\n","import { SchedulerLike, SchedulerAction } from '../types';\nimport { Observable } from '../Observable';\nimport { AsyncSubject } from '../AsyncSubject';\nimport { Subscriber } from '../Subscriber';\nimport { map } from '../operators/map';\nimport { canReportError } from '../util/canReportError';\nimport { isArray } from '../util/isArray';\nimport { isScheduler } from '../util/isScheduler';\n\n// tslint:disable:max-line-length\n/** @deprecated resultSelector is no longer supported, use a mapping function. */\nexport function bindCallback(callbackFunc: Function, resultSelector: Function, scheduler?: SchedulerLike): (...args: any[]) => Observable<any>;\n\nexport function bindCallback<R1, R2, R3, R4>(callbackFunc: (callback: (res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): () => Observable<any[]>;\nexport function bindCallback<R1, R2, R3>(callbackFunc: (callback: (res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): () => Observable<[R1, R2, R3]>;\nexport function bindCallback<R1, R2>(callbackFunc: (callback: (res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): () => Observable<[R1, R2]>;\nexport function bindCallback<R1>(callbackFunc: (callback: (res1: R1) => any) => any, scheduler?: SchedulerLike): () => Observable<R1>;\nexport function bindCallback(callbackFunc: (callback: () => any) => any, scheduler?: SchedulerLike): () => Observable<void>;\n\nexport function bindCallback<A1, R1, R2, R3, R4>(callbackFunc: (arg1: A1, callback: (res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (arg1: A1) => Observable<any[]>;\nexport function bindCallback<A1, R1, R2, R3>(callbackFunc: (arg1: A1, callback: (res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): (arg1: A1) => Observable<[R1, R2, R3]>;\nexport function bindCallback<A1, R1, R2>(callbackFunc: (arg1: A1, callback: (res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): (arg1: A1) => Observable<[R1, R2]>;\nexport function bindCallback<A1, R1>(callbackFunc: (arg1: A1, callback: (res1: R1) => any) => any, scheduler?: SchedulerLike): (arg1: A1) => Observable<R1>;\nexport function bindCallback<A1>(callbackFunc: (arg1: A1, callback: () => any) => any, scheduler?: SchedulerLike): (arg1: A1) => Observable<void>;\n\nexport function bindCallback<A1, A2, R1, R2, R3, R4>(callbackFunc: (arg1: A1, arg2: A2, callback: (res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2) => Observable<any[]>;\nexport function bindCallback<A1, A2, R1, R2, R3>(callbackFunc: (arg1: A1, arg2: A2, callback: (res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2) => Observable<[R1, R2, R3]>;\nexport function bindCallback<A1, A2, R1, R2>(callbackFunc: (arg1: A1, arg2: A2, callback: (res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2) => Observable<[R1, R2]>;\nexport function bindCallback<A1, A2, R1>(callbackFunc: (arg1: A1, arg2: A2, callback: (res1: R1) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2) => Observable<R1>;\nexport function bindCallback<A1, A2>(callbackFunc: (arg1: A1, arg2: A2, callback: () => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2) => Observable<void>;\n\nexport function bindCallback<A1, A2, A3, R1, R2, R3, R4>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, callback: (res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3) => Observable<any[]>;\nexport function bindCallback<A1, A2, A3, R1, R2, R3>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, callback: (res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3) => Observable<[R1, R2, R3]>;\nexport function bindCallback<A1, A2, A3, R1, R2>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, callback: (res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3) => Observable<[R1, R2]>;\nexport function bindCallback<A1, A2, A3, R1>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, callback: (res1: R1) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3) => Observable<R1>;\nexport function bindCallback<A1, A2, A3>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, callback: () => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3) => Observable<void>;\n\nexport function bindCallback<A1, A2, A3, A4, R1, R2, R3, R4>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Observable<any[]>;\nexport function bindCallback<A1, A2, A3, A4, R1, R2, R3>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Observable<[R1, R2, R3]>;\nexport function bindCallback<A1, A2, A3, A4, R1, R2>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Observable<[R1, R2]>;\nexport function bindCallback<A1, A2, A3, A4, R1>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (res1: R1) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Observable<R1>;\nexport function bindCallback<A1, A2, A3, A4>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: () => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Observable<void>;\n\nexport function bindCallback<A1, A2, A3, A4, A5, R1, R2, R3, R4>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Observable<any[]>;\nexport function bindCallback<A1, A2, A3, A4, A5, R1, R2, R3>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Observable<[R1, R2, R3]>;\nexport function bindCallback<A1, A2, A3, A4, A5, R1, R2>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Observable<[R1, R2]>;\nexport function bindCallback<A1, A2, A3, A4, A5, R1>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (res1: R1) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Observable<R1>;\nexport function bindCallback<A1, A2, A3, A4, A5>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: () => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Observable<void>;\n\nexport function bindCallback<A, R>(callbackFunc: (...args: Array<A | ((result: R) => any)>) => any, scheduler?: SchedulerLike): (...args: A[]) => Observable<R>;\nexport function bindCallback<A, R>(callbackFunc: (...args: Array<A | ((...results: R[]) => any)>) => any, scheduler?: SchedulerLike): (...args: A[]) => Observable<R[]>;\n\nexport function bindCallback(callbackFunc: Function, scheduler?: SchedulerLike): (...args: any[]) => Observable<any>;\n\n// tslint:enable:max-line-length\n\n/**\n * Converts a callback API to a function that returns an Observable.\n *\n * <span class=\"informal\">Give it a function `f` of type `f(x, callback)` and\n * it will return a function `g` that when called as `g(x)` will output an\n * Observable.</span>\n *\n * `bindCallback` is not an operator because its input and output are not\n * Observables. The input is a function `func` with some parameters. The\n * last parameter must be a callback function that `func` calls when it is\n * done.\n *\n * The output of `bindCallback` is a function that takes the same parameters\n * as `func`, except the last one (the callback). When the output function\n * is called with arguments it will return an Observable. If function `func`\n * calls its callback with one argument, the Observable will emit that value.\n * If on the other hand the callback is called with multiple values the resulting\n * Observable will emit an array with said values as arguments.\n *\n * It is **very important** to remember that input function `func` is not called\n * when the output function is, but rather when the Observable returned by the output\n * function is subscribed. This means if `func` makes an AJAX request, that request\n * will be made every time someone subscribes to the resulting Observable, but not before.\n *\n * The last optional parameter - `scheduler` - can be used to control when the call\n * to `func` happens after someone subscribes to Observable, as well as when results\n * passed to callback will be emitted. By default, the subscription to an Observable calls `func`\n * synchronously, but using {@link asyncScheduler} as the last parameter will defer the call to `func`,\n * just like wrapping the call in `setTimeout` with a timeout of `0` would. If you were to use the async Scheduler\n * and call `subscribe` on the output Observable, all function calls that are currently executing\n * will end before `func` is invoked.\n *\n * By default, results passed to the callback are emitted immediately after `func` invokes the callback.\n * In particular, if the callback is called synchronously, then the subscription of the resulting Observable\n * will call the `next` function synchronously as well. If you want to defer that call,\n * you may use {@link asyncScheduler} just as before. This means that by using `Scheduler.async` you can\n * ensure that `func` always calls its callback asynchronously, thus avoiding terrifying Zalgo.\n *\n * Note that the Observable created by the output function will always emit a single value\n * and then complete immediately. If `func` calls the callback multiple times, values from subsequent\n * calls will not appear in the stream. If you need to listen for multiple calls,\n * you probably want to use {@link fromEvent} or {@link fromEventPattern} instead.\n *\n * If `func` depends on some context (`this` property) and is not already bound, the context of `func`\n * will be the context that the output function has at call time. In particular, if `func`\n * is called as a method of some objec and if `func` is not already bound, in order to preserve the context\n * it is recommended that the context of the output function is set to that object as well.\n *\n * If the input function calls its callback in the \"node style\" (i.e. first argument to callback is\n * optional error parameter signaling whether the call failed or not), {@link bindNodeCallback}\n * provides convenient error handling and probably is a better choice.\n * `bindCallback` will treat such functions the same as any other and error parameters\n * (whether passed or not) will always be interpreted as regular callback argument.\n *\n * ## Examples\n *\n * ### Convert jQuery's getJSON to an Observable API\n * ```javascript\n * // Suppose we have jQuery.getJSON('/my/url', callback)\n * const getJSONAsObservable = bindCallback(jQuery.getJSON);\n * const result = getJSONAsObservable('/my/url');\n * result.subscribe(x => console.log(x), e => console.error(e));\n * ```\n *\n * ### Receive an array of arguments passed to a callback\n * ```javascript\n * someFunction((a, b, c) => {\n * console.log(a); // 5\n * console.log(b); // 'some string'\n * console.log(c); // {someProperty: 'someValue'}\n * });\n *\n * const boundSomeFunction = bindCallback(someFunction);\n * boundSomeFunction().subscribe(values => {\n * console.log(values) // [5, 'some string', {someProperty: 'someValue'}]\n * });\n * ```\n *\n * ### Compare behaviour with and without async Scheduler\n * ```javascript\n * function iCallMyCallbackSynchronously(cb) {\n * cb();\n * }\n *\n * const boundSyncFn = bindCallback(iCallMyCallbackSynchronously);\n * const boundAsyncFn = bindCallback(iCallMyCallbackSynchronously, null, Rx.Scheduler.async);\n *\n * boundSyncFn().subscribe(() => console.log('I was sync!'));\n * boundAsyncFn().subscribe(() => console.log('I was async!'));\n * console.log('This happened...');\n *\n * // Logs:\n * // I was sync!\n * // This happened...\n * // I was async!\n * ```\n *\n * ### Use bindCallback on an object method\n * ```javascript\n * const boundMethod = bindCallback(someObject.methodWithCallback);\n * boundMethod.call(someObject) // make sure methodWithCallback has access to someObject\n * .subscribe(subscriber);\n * ```\n *\n * @see {@link bindNodeCallback}\n * @see {@link from}\n *\n * @param {function} func A function with a callback as the last parameter.\n * @param {SchedulerLike} [scheduler] The scheduler on which to schedule the\n * callbacks.\n * @return {function(...params: *): Observable} A function which returns the\n * Observable that delivers the same values the callback would deliver.\n * @name bindCallback\n */\nexport function bindCallback<T>(\n callbackFunc: Function,\n resultSelector?: Function|SchedulerLike,\n scheduler?: SchedulerLike\n): (...args: any[]) => Observable<T> {\n if (resultSelector) {\n if (isScheduler(resultSelector)) {\n scheduler = resultSelector;\n } else {\n // DEPRECATED PATH\n return (...args: any[]) => bindCallback(callbackFunc, scheduler)(...args).pipe(\n map((args) => isArray(args) ? resultSelector(...args) : resultSelector(args)),\n );\n }\n }\n\n return function (this: any, ...args: any[]): Observable<T> {\n const context = this;\n let subject: AsyncSubject<T>;\n const params = {\n context,\n subject,\n callbackFunc,\n scheduler,\n };\n return new Observable<T>(subscriber => {\n if (!scheduler) {\n if (!subject) {\n subject = new AsyncSubject<T>();\n const handler = (...innerArgs: any[]) => {\n subject.next(innerArgs.length <= 1 ? innerArgs[0] : innerArgs);\n subject.complete();\n };\n\n try {\n callbackFunc.apply(context, [...args, handler]);\n } catch (err) {\n if (canReportError(subject)) {\n subject.error(err);\n } else {\n console.warn(err);\n }\n }\n }\n return subject.subscribe(subscriber);\n } else {\n const state: DispatchState<T> = {\n args, subscriber, params,\n };\n return scheduler.schedule<DispatchState<T>>(dispatch, 0, state);\n }\n });\n };\n}\n\ninterface DispatchState<T> {\n args: any[];\n subscriber: Subscriber<T>;\n params: ParamsContext<T>;\n}\n\ninterface ParamsContext<T> {\n callbackFunc: Function;\n scheduler: SchedulerLike;\n context: any;\n subject: AsyncSubject<T>;\n}\n\nfunction dispatch<T>(this: SchedulerAction<DispatchState<T>>, state: DispatchState<T>) {\n const self = this;\n const { args, subscriber, params } = state;\n const { callbackFunc, context, scheduler } = params;\n let { subject } = params;\n if (!subject) {\n subject = params.subject = new AsyncSubject<T>();\n\n const handler = (...innerArgs: any[]) => {\n const value = innerArgs.length <= 1 ? innerArgs[0] : innerArgs;\n this.add(scheduler.schedule<NextState<T>>(dispatchNext, 0, { value, subject }));\n };\n\n try {\n callbackFunc.apply(context, [...args, handler]);\n } catch (err) {\n subject.error(err);\n }\n }\n\n this.add(subject.subscribe(subscriber));\n}\n\ninterface NextState<T> {\n subject: AsyncSubject<T>;\n value: T;\n}\n\nfunction dispatchNext<T>(this: SchedulerAction<NextState<T>>, state: NextState<T>) {\n const { value, subject } = state;\n subject.next(value);\n subject.complete();\n}\n\ninterface ErrorState<T> {\n subject: AsyncSubject<T>;\n err: any;\n}\n\nfunction dispatchError<T>(this: SchedulerAction<ErrorState<T>>, state: ErrorState<T>) {\n const { err, subject } = state;\n subject.error(err);\n}\n","import { Observable } from '../Observable';\nimport { AsyncSubject } from '../AsyncSubject';\nimport { Subscriber } from '../Subscriber';\nimport { SchedulerAction, SchedulerLike } from '../types';\nimport { map } from '../operators/map';\nimport { canReportError } from '../util/canReportError';\nimport { isScheduler } from '../util/isScheduler';\nimport { isArray } from '../util/isArray';\n\n/* tslint:disable:max-line-length */\n/** @deprecated resultSelector is deprecated, pipe to map instead */\nexport function bindNodeCallback(callbackFunc: Function, resultSelector: Function, scheduler?: SchedulerLike): (...args: any[]) => Observable<any>;\n\nexport function bindNodeCallback<R1, R2, R3, R4>(callbackFunc: (callback: (err: any, res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (...args: any[]) => Observable<any[]>;\nexport function bindNodeCallback<R1, R2, R3>(callbackFunc: (callback: (err: any, res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): () => Observable<[R1, R2, R3]>;\nexport function bindNodeCallback<R1, R2>(callbackFunc: (callback: (err: any, res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): () => Observable<[R1, R2]>;\nexport function bindNodeCallback<R1>(callbackFunc: (callback: (err: any, res1: R1) => any) => any, scheduler?: SchedulerLike): () => Observable<R1>;\nexport function bindNodeCallback(callbackFunc: (callback: (err: any) => any) => any, scheduler?: SchedulerLike): () => Observable<void>;\n\nexport function bindNodeCallback<A1, R1, R2, R3, R4>(callbackFunc: (arg1: A1, callback: (err: any, res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (...args: any[]) => Observable<any[]>;\nexport function bindNodeCallback<A1, R1, R2, R3>(callbackFunc: (arg1: A1, callback: (err: any, res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): (arg1: A1) => Observable<[R1, R2, R3]>;\nexport function bindNodeCallback<A1, R1, R2>(callbackFunc: (arg1: A1, callback: (err: any, res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): (arg1: A1) => Observable<[R1, R2]>;\nexport function bindNodeCallback<A1, R1>(callbackFunc: (arg1: A1, callback: (err: any, res1: R1) => any) => any, scheduler?: SchedulerLike): (arg1: A1) => Observable<R1>;\nexport function bindNodeCallback<A1>(callbackFunc: (arg1: A1, callback: (err: any) => any) => any, scheduler?: SchedulerLike): (arg1: A1) => Observable<void>;\n\nexport function bindNodeCallback<A1, A2, R1, R2, R3, R4>(callbackFunc: (arg1: A1, arg2: A2, callback: (err: any, res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (...args: any[]) => Observable<any[]>;\nexport function bindNodeCallback<A1, A2, R1, R2, R3>(callbackFunc: (arg1: A1, arg2: A2, callback: (err: any, res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2) => Observable<[R1, R2, R3]>;\nexport function bindNodeCallback<A1, A2, R1, R2>(callbackFunc: (arg1: A1, arg2: A2, callback: (err: any, res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2) => Observable<[R1, R2]>;\nexport function bindNodeCallback<A1, A2, R1>(callbackFunc: (arg1: A1, arg2: A2, callback: (err: any, res1: R1) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2) => Observable<R1>;\nexport function bindNodeCallback<A1, A2>(callbackFunc: (arg1: A1, arg2: A2, callback: (err: any) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2) => Observable<void>;\n\nexport function bindNodeCallback<A1, A2, A3, R1, R2, R3, R4>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, callback: (err: any, res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (...args: any[]) => Observable<any[]>;\nexport function bindNodeCallback<A1, A2, A3, R1, R2, R3>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, callback: (err: any, res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3) => Observable<[R1, R2, R3]>;\nexport function bindNodeCallback<A1, A2, A3, R1, R2>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, callback: (err: any, res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3) => Observable<[R1, R2]>;\nexport function bindNodeCallback<A1, A2, A3, R1>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, callback: (err: any, res1: R1) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3) => Observable<R1>;\nexport function bindNodeCallback<A1, A2, A3>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, callback: (err: any) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3) => Observable<void>;\n\nexport function bindNodeCallback<A1, A2, A3, A4, R1, R2, R3, R4>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (err: any, res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (...args: any[]) => Observable<any[]>;\nexport function bindNodeCallback<A1, A2, A3, A4, R1, R2, R3>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (err: any, res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Observable<[R1, R2, R3]>;\nexport function bindNodeCallback<A1, A2, A3, A4, R1, R2>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (err: any, res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Observable<[R1, R2]>;\nexport function bindNodeCallback<A1, A2, A3, A4, R1>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (err: any, res1: R1) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Observable<R1>;\nexport function bindNodeCallback<A1, A2, A3, A4>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (err: any) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Observable<void>;\n\nexport function bindNodeCallback<A1, A2, A3, A4, A5, R1, R2, R3, R4>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (err: any, res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (...args: any[]) => Observable<any[]>;\nexport function bindNodeCallback<A1, A2, A3, A4, A5, R1, R2, R3>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (err: any, res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Observable<[R1, R2, R3]>;\nexport function bindNodeCallback<A1, A2, A3, A4, A5, R1, R2>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (err: any, res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Observable<[R1, R2]>;\nexport function bindNodeCallback<A1, A2, A3, A4, A5, R1>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (err: any, res1: R1) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Observable<R1>;\nexport function bindNodeCallback<A1, A2, A3, A4, A5>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (err: any) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Observable<void>; /* tslint:enable:max-line-length */\n\nexport function bindNodeCallback(callbackFunc: Function, scheduler?: SchedulerLike): (...args: any[]) => Observable<any[]>;\n/**\n * Converts a Node.js-style callback API to a function that returns an\n * Observable.\n *\n * <span class=\"informal\">It's just like {@link bindCallback}, but the\n * callback is expected to be of type `callback(error, result)`.</span>\n *\n * `bindNodeCallback` is not an operator because its input and output are not\n * Observables. The input is a function `func` with some parameters, but the\n * last parameter must be a callback function that `func` calls when it is\n * done. The callback function is expected to follow Node.js conventions,\n * where the first argument to the callback is an error object, signaling\n * whether call was successful. If that object is passed to callback, it means\n * something went wrong.\n *\n * The output of `bindNodeCallback` is a function that takes the same\n * parameters as `func`, except the last one (the callback). When the output\n * function is called with arguments, it will return an Observable.\n * If `func` calls its callback with error parameter present, Observable will\n * error with that value as well. If error parameter is not passed, Observable will emit\n * second parameter. If there are more parameters (third and so on),\n * Observable will emit an array with all arguments, except first error argument.\n *\n * Note that `func` will not be called at the same time output function is,\n * but rather whenever resulting Observable is subscribed. By default call to\n * `func` will happen synchronously after subscription, but that can be changed\n * with proper `scheduler` provided as optional third parameter. {@link SchedulerLike}\n * can also control when values from callback will be emitted by Observable.\n * To find out more, check out documentation for {@link bindCallback}, where\n * {@link SchedulerLike} works exactly the same.\n *\n * As in {@link bindCallback}, context (`this` property) of input function will be set to context\n * of returned function, when it is called.\n *\n * After Observable emits value, it will complete immediately. This means\n * even if `func` calls callback again, values from second and consecutive\n * calls will never appear on the stream. If you need to handle functions\n * that call callbacks multiple times, check out {@link fromEvent} or\n * {@link fromEventPattern} instead.\n *\n * Note that `bindNodeCallback` can be used in non-Node.js environments as well.\n * \"Node.js-style\" callbacks are just a convention, so if you write for\n * browsers or any other environment and API you use implements that callback style,\n * `bindNodeCallback` can be safely used on that API functions as well.\n *\n * Remember that Error object passed to callback does not have to be an instance\n * of JavaScript built-in `Error` object. In fact, it does not even have to an object.\n * Error parameter of callback function is interpreted as \"present\", when value\n * of that parameter is truthy. It could be, for example, non-zero number, non-empty\n * string or boolean `true`. In all of these cases resulting Observable would error\n * with that value. This means usually regular style callbacks will fail very often when\n * `bindNodeCallback` is used. If your Observable errors much more often then you\n * would expect, check if callback really is called in Node.js-style and, if not,\n * switch to {@link bindCallback} instead.\n *\n * Note that even if error parameter is technically present in callback, but its value\n * is falsy, it still won't appear in array emitted by Observable.\n *\n * ## Examples\n * ### Read a file from the filesystem and get the data as an Observable\n * ```javascript\n * import * as fs from 'fs';\n * const readFileAsObservable = bindNodeCallback(fs.readFile);\n * const result = readFileAsObservable('./roadNames.txt', 'utf8');\n * result.subscribe(x => console.log(x), e => console.error(e));\n * ```\n *\n * ### Use on function calling callback with multiple arguments\n * ```javascript\n * someFunction((err, a, b) => {\n * console.log(err); // null\n * console.log(a); // 5\n * console.log(b); // \"some string\"\n * });\n * const boundSomeFunction = bindNodeCallback(someFunction);\n * boundSomeFunction()\n * .subscribe(value => {\n * console.log(value); // [5, \"some string\"]\n * });\n * ```\n *\n * ### Use on function calling callback in regular style\n * ```javascript\n * someFunction(a => {\n * console.log(a); // 5\n * });\n * const boundSomeFunction = bindNodeCallback(someFunction);\n * boundSomeFunction()\n * .subscribe(\n * value => {} // never gets called\n * err => console.log(err) // 5\n * );\n * ```\n *\n * @see {@link bindCallback}\n * @see {@link from}\n *\n * @param {function} func Function with a Node.js-style callback as the last parameter.\n * @param {SchedulerLike} [scheduler] The scheduler on which to schedule the\n * callbacks.\n * @return {function(...params: *): Observable} A function which returns the\n * Observable that delivers the same values the Node.js callback would\n * deliver.\n * @name bindNodeCallback\n */\nexport function bindNodeCallback<T>(\n callbackFunc: Function,\n resultSelector: Function|SchedulerLike,\n scheduler?: SchedulerLike\n): (...args: any[]) => Observable<T> {\n\n if (resultSelector) {\n if (isScheduler(resultSelector)) {\n scheduler = resultSelector;\n } else {\n // DEPRECATED PATH\n return (...args: any[]) => bindNodeCallback(callbackFunc, scheduler)(...args).pipe(\n map(args => isArray(args) ? resultSelector(...args) : resultSelector(args))\n );\n }\n }\n\n return function(this: any, ...args: any[]): Observable<T> {\n const params: ParamsState<T> = {\n subject: undefined,\n args,\n callbackFunc,\n scheduler,\n context: this,\n };\n return new Observable<T>(subscriber => {\n const { context } = params;\n let { subject } = params;\n if (!scheduler) {\n if (!subject) {\n subject = params.subject = new AsyncSubject<T>();\n const handler = (...innerArgs: any[]) => {\n const err = innerArgs.shift();\n\n if (err) {\n subject.error(err);\n return;\n }\n\n subject.next(innerArgs.length <= 1 ? innerArgs[0] : innerArgs);\n subject.complete();\n };\n\n try {\n callbackFunc.apply(context, [...args, handler]);\n } catch (err) {\n if (canReportError(subject)) {\n subject.error(err);\n } else {\n console.warn(err);\n }\n }\n }\n return subject.subscribe(subscriber);\n } else {\n return scheduler.schedule<DispatchState<T>>(dispatch, 0, { params, subscriber, context });\n }\n });\n };\n}\n\ninterface DispatchState<T> {\n subscriber: Subscriber<T>;\n context: any;\n params: ParamsState<T>;\n}\n\ninterface ParamsState<T> {\n callbackFunc: Function;\n args: any[];\n scheduler: SchedulerLike;\n subject: AsyncSubject<T>;\n context: any;\n}\n\nfunction dispatch<T>(this: SchedulerAction<DispatchState<T>>, state: DispatchState<T>) {\n const { params, subscriber, context } = state;\n const { callbackFunc, args, scheduler } = params;\n let subject = params.subject;\n\n if (!subject) {\n subject = params.subject = new AsyncSubject<T>();\n\n const handler = (...innerArgs: any[]) => {\n const err = innerArgs.shift();\n if (err) {\n this.add(scheduler.schedule<DispatchErrorArg<T>>(dispatchError, 0, { err, subject }));\n } else {\n const value = innerArgs.length <= 1 ? innerArgs[0] : innerArgs;\n this.add(scheduler.schedule<DispatchNextArg<T>>(dispatchNext, 0, { value, subject }));\n }\n };\n\n try {\n callbackFunc.apply(context, [...args, handler]);\n } catch (err) {\n this.add(scheduler.schedule<DispatchErrorArg<T>>(dispatchError, 0, { err, subject }));\n }\n }\n\n this.add(subject.subscribe(subscriber));\n}\n\ninterface DispatchNextArg<T> {\n subject: AsyncSubject<T>;\n value: T;\n}\n\nfunction dispatchNext<T>(arg: DispatchNextArg<T>) {\n const { value, subject } = arg;\n subject.next(value);\n subject.complete();\n}\n\ninterface DispatchErrorArg<T> {\n subject: AsyncSubject<T>;\n err: any;\n}\n\nfunction dispatchError<T>(arg: DispatchErrorArg<T>) {\n const { err, subject } = arg;\n subject.error(err);\n}\n","import { Subscriber } from './Subscriber';\nimport { InnerSubscriber } from './InnerSubscriber';\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class OuterSubscriber<T, R> extends Subscriber<T> {\n notifyNext(outerValue: T, innerValue: R,\n outerIndex: number, innerIndex: number,\n innerSub: InnerSubscriber<T, R>): void {\n this.destination.next(innerValue);\n }\n\n notifyError(error: any, innerSub: InnerSubscriber<T, R>): void {\n this.destination.error(error);\n }\n\n notifyComplete(innerSub: InnerSubscriber<T, R>): void {\n this.destination.complete();\n }\n}\n","import { Subscriber } from './Subscriber';\nimport { OuterSubscriber } from './OuterSubscriber';\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class InnerSubscriber<T, R> extends Subscriber<R> {\n private index = 0;\n\n constructor(private parent: OuterSubscriber<T, R>, public outerValue: T, public outerIndex: number) {\n super();\n }\n\n protected _next(value: R): void {\n this.parent.notifyNext(this.outerValue, value, this.outerIndex, this.index++, this);\n }\n\n protected _error(error: any): void {\n this.parent.notifyError(error, this);\n this.unsubscribe();\n }\n\n protected _complete(): void {\n this.parent.notifyComplete(this);\n this.unsubscribe();\n }\n}\n","import { Subscriber } from '../Subscriber';\nimport { hostReportError } from './hostReportError';\n\nexport const subscribeToPromise = <T>(promise: PromiseLike<T>) => (subscriber: Subscriber<T>) => {\n promise.then(\n (value) => {\n if (!subscriber.closed) {\n subscriber.next(value);\n subscriber.complete();\n }\n },\n (err: any) => subscriber.error(err)\n )\n .then(null, hostReportError);\n return subscriber;\n};\n","export function getSymbolIterator(): symbol {\n if (typeof Symbol !== 'function' || !Symbol.iterator) {\n return '@@iterator' as any;\n }\n\n return Symbol.iterator;\n}\n\nexport const iterator = getSymbolIterator();\n\n/**\n * @deprecated use {@link iterator} instead\n */\nexport const $$iterator = iterator;\n","import { Subscriber } from '../Subscriber';\nimport { iterator as Symbol_iterator } from '../symbol/iterator';\n\nexport const subscribeToIterable = <T>(iterable: Iterable<T>) => (subscriber: Subscriber<T>) => {\n const iterator = iterable[Symbol_iterator]();\n do {\n const item = iterator.next();\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\n // Finalize the iterator if it happens to be a Generator\n if (typeof iterator.return === 'function') {\n subscriber.add(() => {\n if (iterator.return) {\n iterator.return();\n }\n });\n }\n\n return subscriber;\n};\n","import { Subscriber } from '../Subscriber';\nimport { observable as Symbol_observable } from '../symbol/observable';\n\n/**\n * Subscribes to an object that implements Symbol.observable with the given\n * Subscriber.\n * @param obj An object that implements Symbol.observable\n */\nexport const subscribeToObservable = <T>(obj: any) => (subscriber: Subscriber<T>) => {\n const obs = obj[Symbol_observable]();\n if (typeof obs.subscribe !== 'function') {\n // Should be caught by observable subscribe function error handling.\n throw new TypeError('Provided object does not correctly implement Symbol.observable');\n } else {\n return obs.subscribe(subscriber);\n }\n};\n","export const isArrayLike = (<T>(x: any): x is ArrayLike<T> => x && typeof x.length === 'number' && typeof x !== 'function');","export function isPromise(value: any): value is PromiseLike<any> {\n return value && typeof (<any>value).subscribe !== 'function' && typeof (value as any).then === 'function';\n}\n","import { Observable } from '../Observable';\nimport { ObservableInput } from '../types';\nimport { subscribeToArray } from './subscribeToArray';\nimport { subscribeToPromise } from './subscribeToPromise';\nimport { subscribeToIterable } from './subscribeToIterable';\nimport { subscribeToObservable } from './subscribeToObservable';\nimport { isArrayLike } from './isArrayLike';\nimport { isPromise } from './isPromise';\nimport { isObject } from './isObject';\nimport { iterator as Symbol_iterator } from '../symbol/iterator';\nimport { observable as Symbol_observable } from '../symbol/observable';\nimport { Subscriber } from '../Subscriber';\n\nexport const subscribeTo = <T>(result: ObservableInput<T>) => {\n if (result instanceof Observable) {\n return (subscriber: Subscriber<T>) => {\n if (result._isScalar) {\n subscriber.next((result as any).value);\n subscriber.complete();\n return undefined;\n } else {\n return result.subscribe(subscriber);\n }\n };\n } else if (result && typeof result[Symbol_observable] === 'function') {\n return subscribeToObservable(result as any);\n } else if (isArrayLike(result)) {\n return subscribeToArray(result);\n } else if (isPromise(result)) {\n return subscribeToPromise(result as Promise<any>);\n } else if (result && typeof result[Symbol_iterator] === 'function') {\n return subscribeToIterable(result as any);\n } else {\n const value = isObject(result) ? 'an invalid object' : `'${result}'`;\n const 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","import { ObservableInput } from '../types';\nimport { Subscription } from '../Subscription';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { Subscriber } from '../Subscriber';\nimport { subscribeTo } from './subscribeTo';\n\nexport function subscribeToResult<T, R>(\n outerSubscriber: OuterSubscriber<T, R>,\n result: any,\n outerValue?: T,\n outerIndex?: number,\n destination?: Subscriber<any>\n): Subscription;\nexport function subscribeToResult<T, R>(\n outerSubscriber: OuterSubscriber<T, R>,\n result: any,\n outerValue?: T,\n outerIndex?: number,\n destination: Subscriber<any> = new InnerSubscriber(outerSubscriber, outerValue, outerIndex)\n): Subscription | void {\n if (destination.closed) {\n return;\n }\n return subscribeTo(result)(destination);\n}\n","import { Observable } from '../Observable';\nimport { ObservableInput, SchedulerLike } from '../types';\nimport { isScheduler } from '../util/isScheduler';\nimport { isArray } from '../util/isArray';\nimport { Subscriber } from '../Subscriber';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { Operator } from '../Operator';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { fromArray } from './fromArray';\n\nconst NONE = {};\n\n/* tslint:disable:max-line-length */\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest<T, R>(v1: ObservableInput<T>, resultSelector: (v1: T) => R, scheduler?: SchedulerLike): Observable<R>;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest<T, T2, R>(v1: ObservableInput<T>, v2: ObservableInput<T2>, resultSelector: (v1: T, v2: T2) => R, scheduler?: SchedulerLike): Observable<R>;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest<T, T2, T3, R>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => R, scheduler?: SchedulerLike): Observable<R>;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest<T, T2, T3, T4, R>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => R, scheduler?: SchedulerLike): Observable<R>;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest<T, T2, T3, T4, T5, R>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => R, scheduler?: SchedulerLike): Observable<R>;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest<T, T2, T3, T4, T5, T6, R>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6) => R, scheduler?: SchedulerLike): Observable<R>;\n\nexport function combineLatest<T, T2>(v1: ObservableInput<T>, v2: ObservableInput<T2>, scheduler?: SchedulerLike): Observable<[T, T2]>;\nexport function combineLatest<T, T2, T3>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, scheduler?: SchedulerLike): Observable<[T, T2, T3]>;\nexport function combineLatest<T, T2, T3, T4>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, scheduler?: SchedulerLike): Observable<[T, T2, T3, T4]>;\nexport function combineLatest<T, T2, T3, T4, T5>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, scheduler?: SchedulerLike): Observable<[T, T2, T3, T4, T5]>;\nexport function combineLatest<T, T2, T3, T4, T5, T6>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>, scheduler?: SchedulerLike): Observable<[T, T2, T3, T4, T5, T6]>;\n\nexport function combineLatest<T>(array: ObservableInput<T>[], scheduler?: SchedulerLike): Observable<T[]>;\nexport function combineLatest<R>(array: ObservableInput<any>[], scheduler?: SchedulerLike): Observable<R>;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest<T, R>(array: ObservableInput<T>[], resultSelector: (...values: Array<T>) => R, scheduler?: SchedulerLike): Observable<R>;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest<R>(array: ObservableInput<any>[], resultSelector: (...values: Array<any>) => R, scheduler?: SchedulerLike): Observable<R>;\nexport function combineLatest<T>(...observables: Array<ObservableInput<T> | SchedulerLike>): Observable<T[]>;\nexport function combineLatest<T, R>(...observables: Array<ObservableInput<T> | ((...values: Array<T>) => R) | SchedulerLike>): Observable<R>;\nexport function combineLatest<R>(...observables: Array<ObservableInput<any> | ((...values: Array<any>) => R) | SchedulerLike>): Observable<R>;\n/* tslint:enable:max-line-length */\n\n/**\n * Combines multiple Observables to create an Observable whose values are\n * calculated from the latest values of each of its input Observables.\n *\n * <span class=\"informal\">Whenever any input Observable emits a value, it\n * computes a formula using the latest values from all the inputs, then emits\n * the output of that formula.</span>\n *\n * ![](combineLatest.png)\n *\n * `combineLatest` combines the values from all the Observables passed as\n * arguments. This is done by subscribing to each Observable in order and,\n * whenever any Observable emits, collecting an array of the most recent\n * values from each Observable. So if you pass `n` Observables to operator,\n * returned Observable will always emit an array of `n` values, in order\n * corresponding to order of passed Observables (value from the first Observable\n * on the first place and so on).\n *\n * Static version of `combineLatest` accepts either an array of Observables\n * or each Observable can be put directly as an argument. Note that array of\n * Observables is good choice, if you don't know beforehand how many Observables\n * you will combine. Passing empty array will result in Observable that\n * completes immediately.\n *\n * To ensure output array has always the same length, `combineLatest` will\n * actually wait for all input Observables to emit at least once,\n * before it starts emitting results. This means if some Observable emits\n * values before other Observables started emitting, all these values but the last\n * will be lost. On the other hand, if some Observable does not emit a value but\n * completes, resulting Observable will complete at the same moment without\n * emitting anything, since it will be now impossible to include value from\n * completed Observable in resulting array. Also, if some input Observable does\n * not emit any value and never completes, `combineLatest` will also never emit\n * and never complete, since, again, it will wait for all streams to emit some\n * value.\n *\n * If at least one Observable was passed to `combineLatest` and all passed Observables\n * emitted something, resulting Observable will complete when all combined\n * streams complete. So even if some Observable completes, result of\n * `combineLatest` will still emit values when other Observables do. In case\n * of completed Observable, its value from now on will always be the last\n * emitted value. On the other hand, if any Observable errors, `combineLatest`\n * will error immediately as well, and all other Observables will be unsubscribed.\n *\n * `combineLatest` accepts as optional parameter `project` function, which takes\n * as arguments all values that would normally be emitted by resulting Observable.\n * `project` can return any kind of value, which will be then emitted by Observable\n * instead of default array. Note that `project` does not take as argument that array\n * of values, but values themselves. That means default `project` can be imagined\n * as function that takes all its arguments and puts them into an array.\n *\n * ## Examples\n * ### Combine two timer Observables\n * ```javascript\n * const firstTimer = timer(0, 1000); // emit 0, 1, 2... after every second, starting from now\n * const secondTimer = timer(500, 1000); // emit 0, 1, 2... after every second, starting 0,5s from now\n * const combinedTimers = combineLatest(firstTimer, secondTimer);\n * combinedTimers.subscribe(value => console.log(value));\n * // Logs\n * // [0, 0] after 0.5s\n * // [1, 0] after 1s\n * // [1, 1] after 1.5s\n * // [2, 1] after 2s\n * ```\n *\n * ### Combine an array of Observables\n * ```javascript\n * const observables = [1, 5, 10].map(\n * n => of(n).pipe(\n * delay(n * 1000), // emit 0 and then emit n after n seconds\n * startWith(0),\n * )\n * );\n * const combined = combineLatest(observables);\n * combined.subscribe(value => console.log(value));\n * // Logs\n * // [0, 0, 0] immediately\n * // [1, 0, 0] after 1s\n * // [1, 5, 0] after 5s\n * // [1, 5, 10] after 10s\n * ```\n *\n *\n * ### Use project function to dynamically calculate the Body-Mass Index\n * ```javascript\n * * const weight = of(70, 72, 76, 79, 75);\n * const height = of(1.76, 1.77, 1.78);\n * const bmi = combineLatest(weight, height).pipe(\n * map(([w, h]) => w / (h * h)),\n * );\n * bmi.subscribe(x => console.log('BMI is ' + x));\n *\n * // With output to console:\n * // BMI is 24.212293388429753\n * // BMI is 23.93948099205209\n * // BMI is 23.671253629592222\n * ```\n *\n * @see {@link combineAll}\n * @see {@link merge}\n * @see {@link withLatestFrom}\n *\n * @param {ObservableInput} observable1 An input Observable to combine with other Observables.\n * @param {ObservableInput} observable2 An input Observable to combine with other Observables.\n * More than one input Observables may be given as arguments\n * or an array of Observables may be given as the first argument.\n * @param {function} [project] An optional function to project the values from\n * the combined latest values into a new value on the output Observable.\n * @param {SchedulerLike} [scheduler=null] The {@link SchedulerLike} to use for subscribing to\n * each input Observable.\n * @return {Observable} An Observable of projected values from the most recent\n * values from each input Observable, or an array of the most recent values from\n * each input Observable.\n */\nexport function combineLatest<T, R>(...observables: Array<any | ObservableInput<any> |\n Array<ObservableInput<any>> |\n (((...values: Array<any>) => R)) |\n SchedulerLike>): Observable<R> {\n let resultSelector: (...values: Array<any>) => R = null;\n let scheduler: SchedulerLike = null;\n\n if (isScheduler(observables[observables.length - 1])) {\n scheduler = <SchedulerLike>observables.pop();\n }\n\n if (typeof observables[observables.length - 1] === 'function') {\n resultSelector = <(...values: Array<any>) => R>observables.pop();\n }\n\n // if the first and only other argument besides the resultSelector is an array\n // assume it's been called with `combineLatest([obs1, obs2, obs3], resultSelector)`\n if (observables.length === 1 && isArray(observables[0])) {\n observables = <Array<Observable<any>>>observables[0];\n }\n\n return fromArray(observables, scheduler).lift(new CombineLatestOperator<T, R>(resultSelector));\n}\n\nexport class CombineLatestOperator<T, R> implements Operator<T, R> {\n constructor(private resultSelector?: (...values: Array<any>) => R) {\n }\n\n call(subscriber: Subscriber<R>, source: any): any {\n return source.subscribe(new CombineLatestSubscriber(subscriber, this.resultSelector));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class CombineLatestSubscriber<T, R> extends OuterSubscriber<T, R> {\n private active: number = 0;\n private values: any[] = [];\n private observables: any[] = [];\n private toRespond: number;\n\n constructor(destination: Subscriber<R>, private resultSelector?: (...values: Array<any>) => R) {\n super(destination);\n }\n\n protected _next(observable: any) {\n this.values.push(NONE);\n this.observables.push(observable);\n }\n\n protected _complete() {\n const observables = this.observables;\n const len = observables.length;\n if (len === 0) {\n this.destination.complete();\n } else {\n this.active = len;\n this.toRespond = len;\n for (let i = 0; i < len; i++) {\n const observable = observables[i];\n this.add(subscribeToResult(this, observable, observable, i));\n }\n }\n }\n\n notifyComplete(unused: Subscriber<R>): void {\n if ((this.active -= 1) === 0) {\n this.destination.complete();\n }\n }\n\n notifyNext(outerValue: T, innerValue: R,\n outerIndex: number, innerIndex: number,\n innerSub: InnerSubscriber<T, R>): void {\n const values = this.values;\n const oldVal = values[outerIndex];\n const toRespond = !this.toRespond\n ? 0\n : oldVal === NONE ? --this.toRespond : this.toRespond;\n values[outerIndex] = innerValue;\n\n if (toRespond === 0) {\n if (this.resultSelector) {\n this._tryResultSelector(values);\n } else {\n this.destination.next(values.slice());\n }\n }\n }\n\n private _tryResultSelector(values: any[]) {\n let result: any;\n try {\n result = this.resultSelector.apply(this, values);\n } catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n }\n}\n","import { InteropObservable } from '../types';\nimport { observable as Symbol_observable } from '../symbol/observable';\n\n/** Identifies an input as being Observable (but not necessary an Rx Observable) */\nexport function isInteropObservable(input: any): input is InteropObservable<any> {\n return input && typeof input[Symbol_observable] === 'function';\n}\n","import { iterator as Symbol_iterator } from '../symbol/iterator';\n\n/** Identifies an input as being an Iterable */\nexport function isIterable(input: any): input is Iterable<any> {\n return input && typeof input[Symbol_iterator] === 'function';\n}\n","import { Observable } from '../Observable';\nimport { SchedulerLike } from '../types';\nimport { Subscription } from '../Subscription';\nimport { subscribeToPromise } from '../util/subscribeToPromise';\n\nexport function fromPromise<T>(input: PromiseLike<T>, scheduler?: SchedulerLike) {\n if (!scheduler) {\n return new Observable<T>(subscribeToPromise(input));\n } else {\n return new Observable<T>(subscriber => {\n const sub = new Subscription();\n sub.add(scheduler.schedule(() => input.then(\n value => {\n sub.add(scheduler.schedule(() => {\n subscriber.next(value);\n sub.add(scheduler.schedule(() => subscriber.complete()));\n }));\n },\n err => {\n sub.add(scheduler.schedule(() => subscriber.error(err)));\n }\n )));\n return sub;\n });\n }\n}\n","import { Observable } from '../Observable';\nimport { SchedulerLike } from '../types';\nimport { Subscription } from '../Subscription';\nimport { iterator as Symbol_iterator } from '../symbol/iterator';\nimport { subscribeToIterable } from '../util/subscribeToIterable';\n\nexport function fromIterable<T>(input: Iterable<T>, scheduler: SchedulerLike) {\n if (!input) {\n throw new Error('Iterable cannot be null');\n }\n if (!scheduler) {\n return new Observable<T>(subscribeToIterable(input));\n } else {\n return new Observable<T>(subscriber => {\n const sub = new Subscription();\n let iterator: Iterator<T>;\n sub.add(() => {\n // Finalize generators\n if (iterator && typeof iterator.return === 'function') {\n iterator.return();\n }\n });\n sub.add(scheduler.schedule(() => {\n iterator = input[Symbol_iterator]();\n sub.add(scheduler.schedule(function () {\n if (subscriber.closed) {\n return;\n }\n let value: T;\n let done: boolean;\n try {\n const result = iterator.next();\n value = result.value;\n done = result.done;\n } catch (err) {\n subscriber.error(err);\n return;\n }\n if (done) {\n subscriber.complete();\n } else {\n subscriber.next(value);\n this.schedule();\n }\n }));\n }));\n return sub;\n });\n }\n}\n","import { Observable } from '../Observable';\nimport { Subscription } from '../Subscription';\nimport { observable as Symbol_observable } from '../symbol/observable';\nimport { subscribeToObservable } from '../util/subscribeToObservable';\nimport { InteropObservable, SchedulerLike, Subscribable } from '../types';\n\nexport function fromObservable<T>(input: InteropObservable<T>, scheduler: SchedulerLike) {\n if (!scheduler) {\n return new Observable<T>(subscribeToObservable(input));\n } else {\n return new Observable<T>(subscriber => {\n const sub = new Subscription();\n sub.add(scheduler.schedule(() => {\n const observable: Subscribable<T> = input[Symbol_observable]();\n sub.add(observable.subscribe({\n next(value) { sub.add(scheduler.schedule(() => subscriber.next(value))); },\n error(err) { sub.add(scheduler.schedule(() => subscriber.error(err))); },\n complete() { sub.add(scheduler.schedule(() => subscriber.complete())); },\n }));\n }));\n return sub;\n });\n }\n}\n","import { Observable } from '../Observable';\nimport { isPromise } from '../util/isPromise';\nimport { isArrayLike } from '../util/isArrayLike';\nimport { isInteropObservable } from '../util/isInteropObservable';\nimport { isIterable } from '../util/isIterable';\nimport { fromArray } from './fromArray';\nimport { fromPromise } from './fromPromise';\nimport { fromIterable } from './fromIterable';\nimport { fromObservable } from './fromObservable';\nimport { subscribeTo } from '../util/subscribeTo';\nimport { ObservableInput, SchedulerLike } from '../types';\n\nexport function from<T>(input: ObservableInput<T>, scheduler?: SchedulerLike): Observable<T>;\nexport function from<T>(input: ObservableInput<ObservableInput<T>>, scheduler?: SchedulerLike): Observable<Observable<T>>;\n\n/**\n * Creates an Observable from an Array, an array-like object, a Promise, an iterable object, or an Observable-like object.\n *\n * <span class=\"informal\">Converts almost anything to an Observable.</span>\n *\n * ![](from.png)\n *\n * `from` converts various other objects and data types into Observables. It also converts a Promise, an array-like, or an\n * <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterable\" target=\"_blank\">iterable</a>\n * object into an Observable that emits the items in that promise, array, or iterable. A String, in this context, is treated\n * as an array of characters. Observable-like objects (contains a function named with the ES2015 Symbol for Observable) can also be\n * converted through this operator.\n *\n * ## Examples\n * ### Converts an array to an Observable\n * ```javascript\n * import { from } from 'rxjs/observable/from';\n *\n * const array = [10, 20, 30];\n * const result = from(array);\n *\n * result.subscribe(x => console.log(x));\n *\n * // Logs:\n * // 10 20 30\n * ```\n *\n * ---\n *\n * ### Convert an infinite iterable (from a generator) to an Observable\n * ```javascript\n * import { take } from 'rxjs/operators';\n * import { from } from 'rxjs/observable/from';\n *\n * function* generateDoubles(seed) {\n * let i = seed;\n * while (true) {\n * yield i;\n * i = 2 * i; // double it\n * }\n * }\n *\n * const iterator = generateDoubles(3);\n * const result = from(iterator).pipe(take(10));\n *\n * result.subscribe(x => console.log(x));\n *\n * // Logs:\n * // 3 6 12 24 48 96 192 384 768 1536\n * ```\n *\n * ---\n *\n * ### with async scheduler\n * ```javascript\n * import { from } from 'rxjs/observable/from';\n * import { async } from 'rxjs/scheduler/async';\n *\n * console.log('start');\n *\n * const array = [10, 20, 30];\n * const result = from(array, async);\n *\n * result.subscribe(x => console.log(x));\n *\n * console.log('end');\n *\n * // Logs:\n * // start end 10 20 30\n * ```\n *\n * @see {@link fromEvent}\n * @see {@link fromEventPattern}\n * @see {@link fromPromise}\n *\n * @param {ObservableInput<T>} A subscription object, a Promise, an Observable-like,\n * an Array, an iterable, or an array-like object to be converted.\n * @param {SchedulerLike} An optional {@link SchedulerLike} on which to schedule the emission of values.\n * @return {Observable<T>}\n * @name from\n * @owner Observable\n */\n\nexport function from<T>(input: ObservableInput<T>, scheduler?: SchedulerLike): Observable<T> {\n if (!scheduler) {\n if (input instanceof Observable) {\n return input;\n }\n return new Observable<T>(subscribeTo(input));\n }\n\n if (input != null) {\n if (isInteropObservable(input)) {\n return fromObservable(input, scheduler);\n } else if (isPromise(input)) {\n return fromPromise(input, scheduler);\n } else if (isArrayLike(input)) {\n return fromArray(input, scheduler);\n } else if (isIterable(input) || typeof input === 'string') {\n return fromIterable(input, scheduler);\n }\n }\n\n throw new TypeError((input !== null && typeof input || input) + ' is not observable');\n}\n","import { Observable } from '../Observable';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { ObservableInput, OperatorFunction } from '../types';\nimport { map } from './map';\nimport { from } from '../observable/from';\n\n/* tslint:disable:max-line-length */\nexport function mergeMap<T, R>(project: (value: T, index: number) => ObservableInput<R>, concurrent?: number): OperatorFunction<T, R>;\n/** @deprecated resultSelector no longer supported, use inner map instead */\nexport function mergeMap<T, R>(project: (value: T, index: number) => ObservableInput<R>, resultSelector: undefined, concurrent?: number): OperatorFunction<T, R>;\n/** @deprecated resultSelector no longer supported, use inner map instead */\nexport function mergeMap<T, I, R>(project: (value: T, index: number) => ObservableInput<I>, resultSelector: (outerValue: T, innerValue: I, outerIndex: number, innerIndex: number) => R, concurrent?: number): OperatorFunction<T, R>;\n/* tslint:enable:max-line-length */\n\n/**\n * Projects each source value to an Observable which is merged in the output\n * Observable.\n *\n * <span class=\"informal\">Maps each value to an Observable, then flattens all of\n * these inner Observables using {@link mergeAll}.</span>\n *\n * ![](mergeMap.png)\n *\n * Returns an Observable that emits items based on applying a function that you\n * supply to each item emitted by the source Observable, where that function\n * returns an Observable, and then merging those resulting Observables and\n * emitting the results of this merger.\n *\n * ## Example\n * Map and flatten each letter to an Observable ticking every 1 second\n * ```javascript\n * const letters = of('a', 'b', 'c');\n * const result = letters.pipe(\n * mergeMap(x => interval(1000).pipe(map(i => x+i))),\n * );\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // a0\n * // b0\n * // c0\n * // a1\n * // b1\n * // c1\n * // continues to list a,b,c with respective ascending integers\n * ```\n *\n * @see {@link concatMap}\n * @see {@link exhaustMap}\n * @see {@link merge}\n * @see {@link mergeAll}\n * @see {@link mergeMapTo}\n * @see {@link mergeScan}\n * @see {@link switchMap}\n *\n * @param {function(value: T, ?index: number): ObservableInput} project A function\n * that, when applied to an item emitted by the source Observable, returns an\n * Observable.\n * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of input\n * Observables being subscribed to concurrently.\n * @return {Observable} An Observable that emits the result of applying the\n * projection function (and the optional deprecated `resultSelector`) to each item\n * emitted by the source Observable and merging the results of the Observables\n * obtained from this transformation.\n * @method mergeMap\n * @owner Observable\n */\nexport function mergeMap<T, I, R>(\n project: (value: T, index: number) => ObservableInput<I>,\n resultSelector?: ((outerValue: T, innerValue: I, outerIndex: number, innerIndex: number) => R) | number,\n concurrent: number = Number.POSITIVE_INFINITY\n): OperatorFunction<T, I|R> {\n if (typeof resultSelector === 'function') {\n // DEPRECATED PATH\n return (source: Observable<T>) => source.pipe(\n mergeMap((a, i) => from(project(a, i)).pipe(\n map((b, ii) => resultSelector(a, b, i, ii)),\n ), concurrent)\n );\n } else if (typeof resultSelector === 'number') {\n concurrent = resultSelector;\n }\n return (source: Observable<T>) => source.lift(new MergeMapOperator(project, concurrent));\n}\n\nexport class MergeMapOperator<T, R> implements Operator<T, R> {\n constructor(private project: (value: T, index: number) => ObservableInput<R>,\n private concurrent: number = Number.POSITIVE_INFINITY) {\n }\n\n call(observer: Subscriber<R>, source: any): any {\n return source.subscribe(new MergeMapSubscriber(\n observer, this.project, this.concurrent\n ));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class MergeMapSubscriber<T, R> extends OuterSubscriber<T, R> {\n private hasCompleted: boolean = false;\n private buffer: T[] = [];\n private active: number = 0;\n protected index: number = 0;\n\n constructor(destination: Subscriber<R>,\n private project: (value: T, index: number) => ObservableInput<R>,\n private concurrent: number = Number.POSITIVE_INFINITY) {\n super(destination);\n }\n\n protected _next(value: T): void {\n if (this.active < this.concurrent) {\n this._tryNext(value);\n } else {\n this.buffer.push(value);\n }\n }\n\n protected _tryNext(value: T) {\n let result: ObservableInput<R>;\n const index = this.index++;\n try {\n result = this.project(value, index);\n } catch (err) {\n this.destination.error(err);\n return;\n }\n this.active++;\n this._innerSub(result, value, index);\n }\n\n private _innerSub(ish: ObservableInput<R>, value: T, index: number): void {\n const innerSubscriber = new InnerSubscriber(this, undefined, undefined);\n const destination = this.destination as Subscription;\n destination.add(innerSubscriber);\n subscribeToResult<T, R>(this, ish, value, index, innerSubscriber);\n }\n\n protected _complete(): void {\n this.hasCompleted = true;\n if (this.active === 0 && this.buffer.length === 0) {\n this.destination.complete();\n }\n this.unsubscribe();\n }\n\n notifyNext(outerValue: T, innerValue: R,\n outerIndex: number, innerIndex: number,\n innerSub: InnerSubscriber<T, R>): void {\n this.destination.next(innerValue);\n }\n\n notifyComplete(innerSub: Subscription): void {\n const buffer = this.buffer;\n this.remove(innerSub);\n this.active--;\n if (buffer.length > 0) {\n this._next(buffer.shift());\n } else if (this.active === 0 && this.hasCompleted) {\n this.destination.complete();\n }\n }\n}\n","\nimport { mergeMap } from './mergeMap';\nimport { identity } from '../util/identity';\nimport { MonoTypeOperatorFunction, OperatorFunction, ObservableInput } from '../types';\n\nexport function mergeAll<T>(concurrent?: number): OperatorFunction<ObservableInput<T>, T>;\n\n/**\n * Converts a higher-order Observable into a first-order Observable which\n * concurrently delivers all values that are emitted on the inner Observables.\n *\n * <span class=\"informal\">Flattens an Observable-of-Observables.</span>\n *\n * ![](mergeAll.png)\n *\n * `mergeAll` subscribes to an Observable that emits Observables, also known as\n * a higher-order Observable. Each time it observes one of these emitted inner\n * Observables, it subscribes to that and delivers all the values from the\n * inner Observable on the output Observable. The output Observable only\n * completes once all inner Observables have completed. Any error delivered by\n * a inner Observable will be immediately emitted on the output Observable.\n *\n * ## Examples\n * Spawn a new interval Observable for each click event, and blend their outputs as one Observable\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const higherOrder = clicks.pipe(map((ev) => interval(1000)));\n * const firstOrder = higherOrder.pipe(mergeAll());\n * firstOrder.subscribe(x => console.log(x));\n * ```\n *\n * Count from 0 to 9 every second for each click, but only allow 2 concurrent timers\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const higherOrder = clicks.pipe(\n * map((ev) => interval(1000).pipe(take(10))),\n * );\n * const firstOrder = higherOrder.pipe(mergeAll(2));\n * firstOrder.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link combineAll}\n * @see {@link concatAll}\n * @see {@link exhaust}\n * @see {@link merge}\n * @see {@link mergeMap}\n * @see {@link mergeMapTo}\n * @see {@link mergeScan}\n * @see {@link switchAll}\n * @see {@link switchMap}\n * @see {@link zipAll}\n *\n * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of inner\n * Observables being subscribed to concurrently.\n * @return {Observable} An Observable that emits values coming from all the\n * inner Observables emitted by the source Observable.\n * @method mergeAll\n * @owner Observable\n */\nexport function mergeAll<T>(concurrent: number = Number.POSITIVE_INFINITY): MonoTypeOperatorFunction<T> {\n return mergeMap<T, T>(identity as (value: T, index: number) => ObservableInput<T>, concurrent);\n}\n","\nimport { mergeAll } from './mergeAll';\nimport { OperatorFunction, ObservableInput } from '../types';\n\nexport function concatAll<T>(): OperatorFunction<ObservableInput<T>, T>;\nexport function concatAll<R>(): OperatorFunction<any, R>;\n\n/**\n * Converts a higher-order Observable into a first-order Observable by\n * concatenating the inner Observables in order.\n *\n * <span class=\"informal\">Flattens an Observable-of-Observables by putting one\n * inner Observable after the other.</span>\n *\n * ![](concatAll.png)\n *\n * Joins every Observable emitted by the source (a higher-order Observable), in\n * a serial fashion. It subscribes to each inner Observable only after the\n * previous inner Observable has completed, and merges all of their values into\n * the returned observable.\n *\n * __Warning:__ If the source Observable emits Observables quickly and\n * endlessly, and the inner Observables it emits generally complete slower than\n * the source emits, you can run into memory issues as the incoming Observables\n * collect in an unbounded buffer.\n *\n * Note: `concatAll` is equivalent to `mergeAll` with concurrency parameter set\n * to `1`.\n *\n * ## Example\n *\n * For each click event, tick every second from 0 to 3, with no concurrency\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const higherOrder = clicks.pipe(\n * map(ev => interval(1000).pipe(take(4))),\n * );\n * const firstOrder = higherOrder.pipe(concatAll());\n * firstOrder.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // (results are not concurrent)\n * // For every click on the \"document\" it will emit values 0 to 3 spaced\n * // on a 1000ms interval\n * // one click = 1000ms-> 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3\n * ```\n *\n * @see {@link combineAll}\n * @see {@link concat}\n * @see {@link concatMap}\n * @see {@link concatMapTo}\n * @see {@link exhaust}\n * @see {@link mergeAll}\n * @see {@link switchAll}\n * @see {@link switchMap}\n * @see {@link zipAll}\n *\n * @return {Observable} An Observable emitting values from all the inner\n * Observables concatenated.\n * @method concatAll\n * @owner Observable\n */\nexport function concatAll<T>(): OperatorFunction<ObservableInput<T>, T> {\n return mergeAll<T>(1);\n}\n","import { Observable } from '../Observable';\nimport { ObservableInput, SchedulerLike } from '../types';\nimport { isScheduler } from '../util/isScheduler';\nimport { of } from './of';\nimport { from } from './from';\nimport { concatAll } from '../operators/concatAll';\n\n/* tslint:disable:max-line-length */\nexport function concat<T>(v1: ObservableInput<T>, scheduler?: SchedulerLike): Observable<T>;\nexport function concat<T, T2>(v1: ObservableInput<T>, v2: ObservableInput<T2>, scheduler?: SchedulerLike): Observable<T | T2>;\nexport function concat<T, T2, T3>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, scheduler?: SchedulerLike): Observable<T | T2 | T3>;\nexport function concat<T, T2, T3, T4>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, scheduler?: SchedulerLike): Observable<T | T2 | T3 | T4>;\nexport function concat<T, T2, T3, T4, T5>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, scheduler?: SchedulerLike): Observable<T | T2 | T3 | T4 | T5>;\nexport function concat<T, T2, T3, T4, T5, T6>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>, scheduler?: SchedulerLike): Observable<T | T2 | T3 | T4 | T5 | T6>;\nexport function concat<T>(...observables: (ObservableInput<T> | SchedulerLike)[]): Observable<T>;\nexport function concat<T, R>(...observables: (ObservableInput<any> | SchedulerLike)[]): Observable<R>;\n/* tslint:enable:max-line-length */\n/**\n * Creates an output Observable which sequentially emits all values from given\n * Observable and then moves on to the next.\n *\n * <span class=\"informal\">Concatenates multiple Observables together by\n * sequentially emitting their values, one Observable after the other.</span>\n *\n * ![](concat.png)\n *\n * `concat` joins multiple Observables together, by subscribing to them one at a time and\n * merging their results into the output Observable. You can pass either an array of\n * Observables, or put them directly as arguments. Passing an empty array will result\n * in Observable that completes immediately.\n *\n * `concat` will subscribe to first input Observable and emit all its values, without\n * changing or affecting them in any way. When that Observable completes, it will\n * subscribe to then next Observable passed and, again, emit its values. This will be\n * repeated, until the operator runs out of Observables. When last input Observable completes,\n * `concat` will complete as well. At any given moment only one Observable passed to operator\n * emits values. If you would like to emit values from passed Observables concurrently, check out\n * {@link merge} instead, especially with optional `concurrent` parameter. As a matter of fact,\n * `concat` is an equivalent of `merge` operator with `concurrent` parameter set to `1`.\n *\n * Note that if some input Observable never completes, `concat` will also never complete\n * and Observables following the one that did not complete will never be subscribed. On the other\n * hand, if some Observable simply completes immediately after it is subscribed, it will be\n * invisible for `concat`, which will just move on to the next Observable.\n *\n * If any Observable in chain errors, instead of passing control to the next Observable,\n * `concat` will error immediately as well. Observables that would be subscribed after\n * the one that emitted error, never will.\n *\n * If you pass to `concat` the same Observable many times, its stream of values\n * will be \"replayed\" on every subscription, which means you can repeat given Observable\n * as many times as you like. If passing the same Observable to `concat` 1000 times becomes tedious,\n * you can always use {@link repeat}.\n *\n * ## Examples\n * ### Concatenate a timer counting from 0 to 3 with a synchronous sequence from 1 to 10\n * ```javascript\n * const timer = interval(1000).pipe(take(4));\n * const sequence = range(1, 10);\n * const result = concat(timer, sequence);\n * result.subscribe(x => console.log(x));\n *\n * // results in:\n * // 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3 -immediate-> 1 ... 10\n * ```\n *\n * ### Concatenate an array of 3 Observables\n * ```javascript\n * const timer1 = interval(1000).pipe(take(10));\n * const timer2 = interval(2000).pipe(take(6));\n * const timer3 = interval(500).pipe(take(10));\n * const result = concat([timer1, timer2, timer3]); // note that array is passed\n * result.subscribe(x => console.log(x));\n *\n * // results in the following:\n * // (Prints to console sequentially)\n * // -1000ms-> 0 -1000ms-> 1 -1000ms-> ... 9\n * // -2000ms-> 0 -2000ms-> 1 -2000ms-> ... 5\n * // -500ms-> 0 -500ms-> 1 -500ms-> ... 9\n * ```\n *\n * ### Concatenate the same Observable to repeat it\n * ```javascript\n * const timer = interval(1000).pipe(take(2));\n * *\n * concat(timer, timer) // concatenating the same Observable!\n * .subscribe(\n * value => console.log(value),\n * err => {},\n * () => console.log('...and it is done!')\n * );\n *\n * // Logs:\n * // 0 after 1s\n * // 1 after 2s\n * // 0 after 3s\n * // 1 after 4s\n * // \"...and it is done!\" also after 4s\n * ```\n *\n * @see {@link concatAll}\n * @see {@link concatMap}\n * @see {@link concatMapTo}\n *\n * @param {ObservableInput} input1 An input Observable to concatenate with others.\n * @param {ObservableInput} input2 An input Observable to concatenate with others.\n * More than one input Observables may be given as argument.\n * @param {SchedulerLike} [scheduler=null] An optional {@link SchedulerLike} to schedule each\n * Observable subscription on.\n * @return {Observable} All values of each passed Observable merged into a\n * single Observable, in order, in serial fashion.\n * @static true\n * @name concat\n * @owner Observable\n */\nexport function concat<T, R>(...observables: Array<ObservableInput<any> | SchedulerLike>): Observable<R> {\n if (observables.length === 1 || (observables.length === 2 && isScheduler(observables[1]))) {\n return from(<any>observables[0]);\n }\n return concatAll<R>()(of(...observables));\n}\n","import { Observable } from '../Observable';\nimport { SubscribableOrPromise } from '../types';\nimport { from } from './from'; // lol\nimport { empty } from './empty';\n\n/**\n * Creates an Observable that, on subscribe, calls an Observable factory to\n * make an Observable for each new Observer.\n *\n * <span class=\"informal\">Creates the Observable lazily, that is, only when it\n * is subscribed.\n * </span>\n *\n * ![](defer.png)\n *\n * `defer` allows you to create the Observable only when the Observer\n * subscribes, and create a fresh Observable for each Observer. It waits until\n * an Observer subscribes to it, and then it generates an Observable,\n * typically with an Observable factory function. It does this afresh for each\n * subscriber, so although each subscriber may think it is subscribing to the\n * same Observable, in fact each subscriber gets its own individual\n * Observable.\n *\n * ## Example\n * ### Subscribe to either an Observable of clicks or an Observable of interval, at random\n * ```javascript\n * const clicksOrInterval = defer(function () {\n * return Math.random() > 0.5\n * ? fromEvent(document, 'click')\n * : interval(1000);\n * });\n * clicksOrInterval.subscribe(x => console.log(x));\n *\n * // Results in the following behavior:\n * // If the result of Math.random() is greater than 0.5 it will listen\n * // for clicks anywhere on the \"document\"; when document is clicked it\n * // will log a MouseEvent object to the console. If the result is less\n * // than 0.5 it will emit ascending numbers, one every second(1000ms).\n * ```\n *\n * @see {@link Observable}\n *\n * @param {function(): SubscribableOrPromise} observableFactory The Observable\n * factory function to invoke for each Observer that subscribes to the output\n * Observable. May also return a Promise, which will be converted on the fly\n * to an Observable.\n * @return {Observable} An Observable whose Observers' subscriptions trigger\n * an invocation of the given Observable factory function.\n * @static true\n * @name defer\n * @owner Observable\n */\nexport function defer<T>(observableFactory: () => SubscribableOrPromise<T> | void): Observable<T> {\n return new Observable(subscriber => {\n let input: SubscribableOrPromise<T> | void;\n try {\n input = observableFactory();\n } catch (err) {\n subscriber.error(err);\n return undefined;\n }\n const source = input ? from(input) : empty();\n return source.subscribe(subscriber);\n });\n}","import { Observable } from '../Observable';\nimport { ObservableInput } from '../types';\nimport { isArray } from '../util/isArray';\nimport { EMPTY } from './empty';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { Subscriber } from '../Subscriber';\nimport { map } from '../operators/map';\n\n/* tslint:disable:max-line-length */\n// forkJoin([a$, b$, c$]);\nexport function forkJoin<T>(sources: [ObservableInput<T>]): Observable<T[]>;\nexport function forkJoin<T, T2>(sources: [ObservableInput<T>, ObservableInput<T2>]): Observable<[T, T2]>;\nexport function forkJoin<T, T2, T3>(sources: [ObservableInput<T>, ObservableInput<T2>, ObservableInput<T3>]): Observable<[T, T2, T3]>;\nexport function forkJoin<T, T2, T3, T4>(sources: [ObservableInput<T>, ObservableInput<T2>, ObservableInput<T3>, ObservableInput<T4>]): Observable<[T, T2, T3, T4]>;\nexport function forkJoin<T, T2, T3, T4, T5>(sources: [ObservableInput<T>, ObservableInput<T2>, ObservableInput<T3>, ObservableInput<T4>, ObservableInput<T5>]): Observable<[T, T2, T3, T4, T5]>;\nexport function forkJoin<T, T2, T3, T4, T5, T6>(sources: [ObservableInput<T>, ObservableInput<T2>, ObservableInput<T3>, ObservableInput<T4>, ObservableInput<T5>, ObservableInput<T6>]): Observable<[T, T2, T3, T4, T5, T6]>;\nexport function forkJoin<T>(sources: Array<ObservableInput<T>>): Observable<T[]>;\n\n// forkJoin(a$, b$, c$)\nexport function forkJoin<T>(v1: ObservableInput<T>): Observable<T[]>;\nexport function forkJoin<T, T2>(v1: ObservableInput<T>, v2: ObservableInput<T2>): Observable<[T, T2]>;\nexport function forkJoin<T, T2, T3>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>): Observable<[T, T2, T3]>;\nexport function forkJoin<T, T2, T3, T4>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>): Observable<[T, T2, T3, T4]>;\nexport function forkJoin<T, T2, T3, T4, T5>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>): Observable<[T, T2, T3, T4, T5]>;\nexport function forkJoin<T, T2, T3, T4, T5, T6>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>): Observable<[T, T2, T3, T4, T5, T6]>;\n\n/** @deprecated resultSelector is deprecated, pipe to map instead */\nexport function forkJoin(...args: Array<ObservableInput<any>|Function>): Observable<any>;\nexport function forkJoin<T>(...sources: ObservableInput<T>[]): Observable<T[]>;\n/* tslint:enable:max-line-length */\n\n/**\n * Joins last values emitted by passed Observables.\n *\n * <span class=\"informal\">Wait for Observables to complete and then combine last values they emitted.</span>\n *\n * ![](forkJoin.png)\n *\n * `forkJoin` is an operator that takes any number of Observables which can be passed either as an array\n * or directly as arguments. If no input Observables are provided, resulting stream will complete\n * immediately.\n *\n * `forkJoin` will wait for all passed Observables to complete and then it will emit an array with last\n * values from corresponding Observables. So if you pass `n` Observables to the operator, resulting\n * array will have `n` values, where first value is the last thing emitted by the first Observable,\n * second value is the last thing emitted by the second Observable and so on. That means `forkJoin` will\n * not emit more than once and it will complete after that. If you need to emit combined values not only\n * at the end of lifecycle of passed Observables, but also throughout it, try out {@link combineLatest}\n * or {@link zip} instead.\n *\n * In order for resulting array to have the same length as the number of input Observables, whenever any of\n * that Observables completes without emitting any value, `forkJoin` will complete at that moment as well\n * and it will not emit anything either, even if it already has some last values from other Observables.\n * Conversely, if there is an Observable that never completes, `forkJoin` will never complete as well,\n * unless at any point some other Observable completes without emitting value, which brings us back to\n * the previous case. Overall, in order for `forkJoin` to emit a value, all Observables passed as arguments\n * have to emit something at least once and complete.\n *\n * If any input Observable errors at some point, `forkJoin` will error as well and all other Observables\n * will be immediately unsubscribed.\n *\n * Optionally `forkJoin` accepts project function, that will be called with values which normally\n * would land in emitted array. Whatever is returned by project function, will appear in output\n * Observable instead. This means that default project can be thought of as a function that takes\n * all its arguments and puts them into an array. Note that project function will be called only\n * when output Observable is supposed to emit a result.\n *\n * ## Examples\n * ### Use forkJoin with operator emitting immediately\n * ```javascript\n * import { forkJoin, of } from 'rxjs';\n *\n * const observable = forkJoin(\n * of(1, 2, 3, 4),\n * of(5, 6, 7, 8),\n * );\n * observable.subscribe(\n * value => console.log(value),\n * err => {},\n * () => console.log('This is how it ends!'),\n * );\n *\n * // Logs:\n * // [4, 8]\n * // \"This is how it ends!\"\n * ```\n *\n * ### Use forkJoin with operator emitting after some time\n * ```javascript\n * import { forkJoin, interval } from 'rxjs';\n * import { take } from 'rxjs/operators';\n *\n * const observable = forkJoin(\n * interval(1000).pipe(take(3)), // emit 0, 1, 2 every second and complete\n * interval(500).pipe(take(4)), // emit 0, 1, 2, 3 every half a second and complete\n * );\n * observable.subscribe(\n * value => console.log(value),\n * err => {},\n * () => console.log('This is how it ends!'),\n * );\n *\n * // Logs:\n * // [2, 3] after 3 seconds\n * // \"This is how it ends!\" immediately after\n * ```\n *\n * ### Use forkJoin with project function\n * ```javascript\n * import { forkJoin, interval } from 'rxjs';\n * import { take } from 'rxjs/operators';\n *\n * const observable = forkJoin(\n * interval(1000).pipe(take(3)), // emit 0, 1, 2 every second and complete\n * interval(500).pipe(take(4)), // emit 0, 1, 2, 3 every half a second and complete\n * ).pipe(\n * map(([n, m]) => n + m),\n * );\n * observable.subscribe(\n * value => console.log(value),\n * err => {},\n * () => console.log('This is how it ends!'),\n * );\n *\n * // Logs:\n * // 5 after 3 seconds\n * // \"This is how it ends!\" immediately after\n * ```\n *\n * @see {@link combineLatest}\n * @see {@link zip}\n *\n * @param {...ObservableInput} sources Any number of Observables provided either as an array or as an arguments\n * passed directly to the operator.\n * @param {function} [project] Function that takes values emitted by input Observables and returns value\n * that will appear in resulting Observable instead of default array.\n * @return {Observable} Observable emitting either an array of last values emitted by passed Observables\n * or value from project function.\n */\nexport function forkJoin<T>(\n ...sources: Array<ObservableInput<T> | ObservableInput<T>[] | Function>\n): Observable<T[]> {\n\n let resultSelector: Function;\n if (typeof sources[sources.length - 1] === 'function') {\n // DEPRECATED PATH\n resultSelector = sources.pop() as Function;\n }\n\n // if the first and only other argument is an array\n // assume it's been called with `forkJoin([obs1, obs2, obs3])`\n if (sources.length === 1 && isArray(sources[0])) {\n sources = sources[0] as Array<ObservableInput<T>>;\n }\n\n if (sources.length === 0) {\n return EMPTY;\n }\n\n if (resultSelector) {\n // DEPRECATED PATH\n return forkJoin(sources).pipe(\n map(args => resultSelector(...args))\n );\n }\n\n return new Observable(subscriber => {\n return new ForkJoinSubscriber(subscriber, sources as Array<ObservableInput<T>>);\n });\n}\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass ForkJoinSubscriber<T, R> extends OuterSubscriber<T, T> {\n private completed = 0;\n private values: T[];\n private haveValues = 0;\n\n constructor(destination: Subscriber<R>,\n private sources: Array<ObservableInput<T>>) {\n super(destination);\n\n const len = sources.length;\n this.values = new Array(len);\n\n for (let i = 0; i < len; i++) {\n const source = sources[i];\n const innerSubscription = subscribeToResult(this, source, null, i);\n\n if (innerSubscription) {\n this.add(innerSubscription);\n }\n }\n }\n\n notifyNext(outerValue: any, innerValue: T,\n outerIndex: number, innerIndex: number,\n innerSub: InnerSubscriber<T, T>): void {\n this.values[outerIndex] = innerValue;\n if (!(innerSub as any)._hasValue) {\n (innerSub as any)._hasValue = true;\n this.haveValues++;\n }\n }\n\n notifyComplete(innerSub: InnerSubscriber<T, T>): void {\n const { destination, haveValues, values } = this;\n const len = values.length;\n\n if (!(innerSub as any)._hasValue) {\n destination.complete();\n return;\n }\n\n this.completed++;\n\n if (this.completed !== len) {\n return;\n }\n\n if (haveValues === len) {\n destination.next(values);\n }\n\n destination.complete();\n }\n}\n","import { Observable } from '../Observable';\nimport { isArray } from '../util/isArray';\nimport { isFunction } from '../util/isFunction';\nimport { Subscriber } from '../Subscriber';\nimport { map } from '../operators/map';\n\nconst toString: Function = Object.prototype.toString;\n\nexport interface NodeStyleEventEmitter {\n addListener: (eventName: string | symbol, handler: NodeEventHandler) => this;\n removeListener: (eventName: string | symbol, handler: NodeEventHandler) => this;\n}\n\nexport type NodeEventHandler = (...args: any[]) => void;\n\n// For APIs that implement `addListener` and `removeListener` methods that may\n// not use the same arguments or return EventEmitter values\n// such as React Native\nexport interface NodeCompatibleEventEmitter {\n addListener: (eventName: string, handler: NodeEventHandler) => void | {};\n removeListener: (eventName: string, handler: NodeEventHandler) => void | {};\n}\n\nexport interface JQueryStyleEventEmitter {\n on: (eventName: string, handler: Function) => void;\n off: (eventName: string, handler: Function) => void;\n}\n\nexport interface HasEventTargetAddRemove<E> {\n addEventListener(type: string, listener: ((evt: E) => void) | null, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: string, listener?: ((evt: E) => void) | null, options?: EventListenerOptions | boolean): void;\n}\n\nexport type EventTargetLike<T> = HasEventTargetAddRemove<T> | NodeStyleEventEmitter | NodeCompatibleEventEmitter | JQueryStyleEventEmitter;\n\nexport type FromEventTarget<T> = EventTargetLike<T> | ArrayLike<EventTargetLike<T>>;\n\nexport interface EventListenerOptions {\n capture?: boolean;\n passive?: boolean;\n once?: boolean;\n}\n\nexport interface AddEventListenerOptions extends EventListenerOptions {\n once?: boolean;\n passive?: boolean;\n}\n\n/* tslint:disable:max-line-length */\nexport function fromEvent<T>(target: FromEventTarget<T>, eventName: string): Observable<T>;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function fromEvent<T>(target: FromEventTarget<T>, eventName: string, resultSelector: (...args: any[]) => T): Observable<T>;\nexport function fromEvent<T>(target: FromEventTarget<T>, eventName: string, options: EventListenerOptions): Observable<T>;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function fromEvent<T>(target: FromEventTarget<T>, eventName: string, options: EventListenerOptions, resultSelector: (...args: any[]) => T): Observable<T>;\n/* tslint:enable:max-line-length */\n\n/**\n * Creates an Observable that emits events of a specific type coming from the\n * given event target.\n *\n * <span class=\"informal\">Creates an Observable from DOM events, or Node.js\n * EventEmitter events or others.</span>\n *\n * ![](fromEvent.png)\n *\n * `fromEvent` accepts as a first argument event target, which is an object with methods\n * for registering event handler functions. As a second argument it takes string that indicates\n * type of event we want to listen for. `fromEvent` supports selected types of event targets,\n * which are described in detail below. If your event target does not match any of the ones listed,\n * you should use {@link fromEventPattern}, which can be used on arbitrary APIs.\n * When it comes to APIs supported by `fromEvent`, their methods for adding and removing event\n * handler functions have different names, but they all accept a string describing event type\n * and function itself, which will be called whenever said event happens.\n *\n * Every time resulting Observable is subscribed, event handler function will be registered\n * to event target on given event type. When that event fires, value\n * passed as a first argument to registered function will be emitted by output Observable.\n * When Observable is unsubscribed, function will be unregistered from event target.\n *\n * Note that if event target calls registered function with more than one argument, second\n * and following arguments will not appear in resulting stream. In order to get access to them,\n * you can pass to `fromEvent` optional project function, which will be called with all arguments\n * passed to event handler. Output Observable will then emit value returned by project function,\n * instead of the usual value.\n *\n * Remember that event targets listed below are checked via duck typing. It means that\n * no matter what kind of object you have and no matter what environment you work in,\n * you can safely use `fromEvent` on that object if it exposes described methods (provided\n * of course they behave as was described above). So for example if Node.js library exposes\n * event target which has the same method names as DOM EventTarget, `fromEvent` is still\n * a good choice.\n *\n * If the API you use is more callback then event handler oriented (subscribed\n * callback function fires only once and thus there is no need to manually\n * unregister it), you should use {@link bindCallback} or {@link bindNodeCallback}\n * instead.\n *\n * `fromEvent` supports following types of event targets:\n *\n * **DOM EventTarget**\n *\n * This is an object with `addEventListener` and `removeEventListener` methods.\n *\n * In the browser, `addEventListener` accepts - apart from event type string and event\n * handler function arguments - optional third parameter, which is either an object or boolean,\n * both used for additional configuration how and when passed function will be called. When\n * `fromEvent` is used with event target of that type, you can provide this values\n * as third parameter as well.\n *\n * **Node.js EventEmitter**\n *\n * An object with `addListener` and `removeListener` methods.\n *\n * **JQuery-style event target**\n *\n * An object with `on` and `off` methods\n *\n * **DOM NodeList**\n *\n * List of DOM Nodes, returned for example by `document.querySelectorAll` or `Node.childNodes`.\n *\n * Although this collection is not event target in itself, `fromEvent` will iterate over all Nodes\n * it contains and install event handler function in every of them. When returned Observable\n * is unsubscribed, function will be removed from all Nodes.\n *\n * **DOM HtmlCollection**\n *\n * Just as in case of NodeList it is a collection of DOM nodes. Here as well event handler function is\n * installed and removed in each of elements.\n *\n *\n * ## Examples\n * ### Emits clicks happening on the DOM document\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * clicks.subscribe(x => console.log(x));\n *\n * // Results in:\n * // MouseEvent object logged to console every time a click\n * // occurs on the document.\n * ```\n *\n * ### Use addEventListener with capture option\n * ```javascript\n * const clicksInDocument = fromEvent(document, 'click', true); // note optional configuration parameter\n * // which will be passed to addEventListener\n * const clicksInDiv = fromEvent(someDivInDocument, 'click');\n *\n * clicksInDocument.subscribe(() => console.log('document'));\n * clicksInDiv.subscribe(() => console.log('div'));\n *\n * // By default events bubble UP in DOM tree, so normally\n * // when we would click on div in document\n * // \"div\" would be logged first and then \"document\".\n * // Since we specified optional `capture` option, document\n * // will catch event when it goes DOWN DOM tree, so console\n * // will log \"document\" and then \"div\".\n * ```\n *\n * @see {@link bindCallback}\n * @see {@link bindNodeCallback}\n * @see {@link fromEventPattern}\n *\n * @param {FromEventTarget<T>} target The DOM EventTarget, Node.js\n * EventEmitter, JQuery-like event target, NodeList or HTMLCollection to attach the event handler to.\n * @param {string} eventName The event name of interest, being emitted by the\n * `target`.\n * @param {EventListenerOptions} [options] Options to pass through to addEventListener\n * @return {Observable<T>}\n * @name fromEvent\n */\nexport function fromEvent<T>(\n target: FromEventTarget<T>,\n eventName: string,\n options?: EventListenerOptions | ((...args: any[]) => T),\n resultSelector?: ((...args: any[]) => T)\n): Observable<T> {\n\n if (isFunction(options)) {\n // DEPRECATED PATH\n resultSelector = options;\n options = undefined;\n }\n if (resultSelector) {\n // DEPRECATED PATH\n return fromEvent<T>(target, eventName, <EventListenerOptions | undefined>options).pipe(\n map(args => isArray(args) ? resultSelector(...args) : resultSelector(args))\n );\n }\n\n return new Observable<T>(subscriber => {\n function handler(e: T) {\n if (arguments.length > 1) {\n subscriber.next(Array.prototype.slice.call(arguments));\n } else {\n subscriber.next(e);\n }\n }\n setupSubscription(target, eventName, handler, subscriber, options as EventListenerOptions);\n });\n}\n\nfunction setupSubscription<T>(sourceObj: FromEventTarget<T>, eventName: string,\n handler: (...args: any[]) => void, subscriber: Subscriber<T>,\n options?: EventListenerOptions) {\n let unsubscribe: () => void;\n if (isEventTarget(sourceObj)) {\n const source = sourceObj;\n sourceObj.addEventListener(eventName, handler, options);\n unsubscribe = () => source.removeEventListener(eventName, handler, options);\n } else if (isJQueryStyleEventEmitter(sourceObj)) {\n const source = sourceObj;\n sourceObj.on(eventName, handler);\n unsubscribe = () => source.off(eventName, handler);\n } else if (isNodeStyleEventEmitter(sourceObj)) {\n const source = sourceObj;\n sourceObj.addListener(eventName, handler as NodeEventHandler);\n unsubscribe = () => source.removeListener(eventName, handler as NodeEventHandler);\n } else if (sourceObj && (sourceObj as any).length) {\n for (let i = 0, len = (sourceObj as any).length; i < len; i++) {\n setupSubscription(sourceObj[i], eventName, handler, subscriber, options);\n }\n } else {\n throw new TypeError('Invalid event target');\n }\n\n subscriber.add(unsubscribe);\n}\n\nfunction isNodeStyleEventEmitter(sourceObj: any): sourceObj is NodeStyleEventEmitter {\n return sourceObj && typeof sourceObj.addListener === 'function' && typeof sourceObj.removeListener === 'function';\n}\n\nfunction isJQueryStyleEventEmitter(sourceObj: any): sourceObj is JQueryStyleEventEmitter {\n return sourceObj && typeof sourceObj.on === 'function' && typeof sourceObj.off === 'function';\n}\n\nfunction isEventTarget(sourceObj: any): sourceObj is HasEventTargetAddRemove<any> {\n return sourceObj && typeof sourceObj.addEventListener === 'function' && typeof sourceObj.removeEventListener === 'function';\n}\n","import { Observable } from '../Observable';\nimport { isArray } from '../util/isArray';\nimport { isFunction } from '../util/isFunction';\nimport { fromEvent } from './fromEvent';\nimport { map } from '../operators/map';\n\n/* tslint:disable:max-line-length */\nexport function fromEventPattern<T>(addHandler: (handler: Function) => any, removeHandler?: (handler: Function, signal?: any) => void): Observable<T>;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function fromEventPattern<T>(addHandler: (handler: Function) => any, removeHandler?: (handler: Function, signal?: any) => void, resultSelector?: (...args: any[]) => T): Observable<T>;\n/* tslint:enable:max-line-length */\n\n/**\n * Creates an Observable from an arbitrary API for registering event handlers.\n *\n * <span class=\"informal\">When that method for adding event handler was something {@link fromEvent}\n * was not prepared for.</span>\n *\n * ![](fromEventPattern.png)\n *\n * `fromEventPattern` allows you to convert into an Observable any API that supports registering handler functions\n * for events. It is similar to {@link fromEvent}, but far\n * more flexible. In fact, all use cases of {@link fromEvent} could be easily handled by\n * `fromEventPattern` (although in slightly more verbose way).\n *\n * This operator accepts as a first argument an `addHandler` function, which will be injected with\n * handler parameter. That handler is actually an event handler function that you now can pass\n * to API expecting it. `addHandler` will be called whenever Observable\n * returned by the operator is subscribed, so registering handler in API will not\n * necessarily happen when `fromEventPattern` is called.\n *\n * After registration, every time an event that we listen to happens,\n * Observable returned by `fromEventPattern` will emit value that event handler\n * function was called with. Note that if event handler was called with more\n * then one argument, second and following arguments will not appear in the Observable.\n *\n * If API you are using allows to unregister event handlers as well, you can pass to `fromEventPattern`\n * another function - `removeHandler` - as a second parameter. It will be injected\n * with the same handler function as before, which now you can use to unregister\n * it from the API. `removeHandler` will be called when consumer of resulting Observable\n * unsubscribes from it.\n *\n * In some APIs unregistering is actually handled differently. Method registering an event handler\n * returns some kind of token, which is later used to identify which function should\n * be unregistered or it itself has method that unregisters event handler.\n * If that is the case with your API, make sure token returned\n * by registering method is returned by `addHandler`. Then it will be passed\n * as a second argument to `removeHandler`, where you will be able to use it.\n *\n * If you need access to all event handler parameters (not only the first one),\n * or you need to transform them in any way, you can call `fromEventPattern` with optional\n * third parameter - project function which will accept all arguments passed to\n * event handler when it is called. Whatever is returned from project function will appear on\n * resulting stream instead of usual event handlers first argument. This means\n * that default project can be thought of as function that takes its first parameter\n * and ignores the rest.\n *\n * ## Example\n * ### Emits clicks happening on the DOM document\n *\n * ```javascript\n * function addClickHandler(handler) {\n * document.addEventListener('click', handler);\n * }\n *\n * function removeClickHandler(handler) {\n * document.removeEventListener('click', handler);\n * }\n *\n * const clicks = fromEventPattern(\n * addClickHandler,\n * removeClickHandler\n * );\n * clicks.subscribe(x => console.log(x));\n *\n * // Whenever you click anywhere in the browser, DOM MouseEvent\n * // object will be logged.\n * ```\n *\n * ## Example\n * ### Use with API that returns cancellation token\n *\n * ```javascript\n * const token = someAPI.registerEventHandler(function() {});\n * someAPI.unregisterEventHandler(token); // this APIs cancellation method accepts\n * // not handler itself, but special token.\n *\n * const someAPIObservable = fromEventPattern(\n * function(handler) { return someAPI.registerEventHandler(handler); }, // Note that we return the token here...\n * function(handler, token) { someAPI.unregisterEventHandler(token); } // ...to then use it here.\n * );\n * ```\n *\n * ## Example\n * ### Use with project function\n *\n * ```javascript\n * someAPI.registerEventHandler((eventType, eventMessage) => {\n * console.log(eventType, eventMessage); // Logs \"EVENT_TYPE\" \"EVENT_MESSAGE\" to console.\n * });\n *\n * const someAPIObservable = fromEventPattern(\n * handler => someAPI.registerEventHandler(handler),\n * handler => someAPI.unregisterEventHandler(handler)\n * (eventType, eventMessage) => eventType + \" --- \" + eventMessage // without that function only \"EVENT_TYPE\"\n * ); // would be emitted by the Observable\n *\n * someAPIObservable.subscribe(value => console.log(value));\n *\n * // Logs:\n * // \"EVENT_TYPE --- EVENT_MESSAGE\"\n * ```\n *\n * @see {@link fromEvent}\n * @see {@link bindCallback}\n * @see {@link bindNodeCallback}\n *\n * @param {function(handler: Function): any} addHandler A function that takes\n * a `handler` function as argument and attaches it somehow to the actual\n * source of events.\n * @param {function(handler: Function, token?: any): void} [removeHandler] A function that\n * takes a `handler` function as an argument and removes it from the event source. If `addHandler`\n * returns some kind of token, `removeHandler` function will have it as a second parameter.\n * @param {function(...args: any): T} [project] A function to\n * transform results. It takes the arguments from the event handler and\n * should return a single value.\n * @return {Observable<T>} Observable which, when an event happens, emits first parameter\n * passed to registered event handler. Alternatively it emits whatever project function returns\n * at that moment.\n * @static true\n * @name fromEventPattern\n * @owner Observable\n */\n\nexport function fromEventPattern<T>(addHandler: (handler: Function) => any,\n removeHandler?: (handler: Function, signal?: any) => void,\n resultSelector?: (...args: any[]) => T): Observable<T | T[]> {\n\n if (resultSelector) {\n // DEPRECATED PATH\n return fromEventPattern<T>(addHandler, removeHandler).pipe(\n map(args => isArray(args) ? resultSelector(...args) : resultSelector(args))\n );\n }\n\n return new Observable<T | T[]>(subscriber => {\n const handler = (...e: T[]) => subscriber.next(e.length === 1 ? e[0] : e);\n\n let retValue: any;\n try {\n retValue = addHandler(handler);\n } catch (err) {\n subscriber.error(err);\n return undefined;\n }\n\n if (!isFunction(removeHandler)) {\n return undefined;\n }\n\n return () => removeHandler(handler, retValue) ;\n });\n}\n","import { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { identity } from '../util/identity';\nimport { SchedulerAction, SchedulerLike } from '../types';\nimport { isScheduler } from '../util/isScheduler';\n\nexport type ConditionFunc<S> = (state: S) => boolean;\nexport type IterateFunc<S> = (state: S) => S;\nexport type ResultFunc<S, T> = (state: S) => T;\n\ninterface SchedulerState<T, S> {\n needIterate?: boolean;\n state: S;\n subscriber: Subscriber<T>;\n condition?: ConditionFunc<S>;\n iterate: IterateFunc<S>;\n resultSelector: ResultFunc<S, T>;\n}\n\nexport interface GenerateBaseOptions<S> {\n /**\n * Initial state.\n */\n initialState: S;\n /**\n * Condition function that accepts state and returns boolean.\n * When it returns false, the generator stops.\n * If not specified, a generator never stops.\n */\n condition?: ConditionFunc<S>;\n /**\n * Iterate function that accepts state and returns new state.\n */\n iterate: IterateFunc<S>;\n /**\n * SchedulerLike to use for generation process.\n * By default, a generator starts immediately.\n */\n scheduler?: SchedulerLike;\n}\n\nexport interface GenerateOptions<T, S> extends GenerateBaseOptions<S> {\n /**\n * Result selection function that accepts state and returns a value to emit.\n */\n resultSelector: ResultFunc<S, T>;\n}\n\n/**\n * Generates an observable sequence by running a state-driven loop\n * producing the sequence's elements, using the specified scheduler\n * to send out observer messages.\n *\n * ![](generate.png)\n *\n * @example <caption>Produces sequence of 0, 1, 2, ... 9, then completes.</caption>\n * const res = generate(0, x => x < 10, x => x + 1, x => x);\n *\n * @example <caption>Using asap scheduler, produces sequence of 2, 3, 5, then completes.</caption>\n * const res = generate(1, x => x < 5, x => * 2, x => x + 1, asap);\n *\n * @see {@link from}\n * @see {@link Observable}\n *\n * @param {S} initialState Initial state.\n * @param {function (state: S): boolean} condition Condition to terminate generation (upon returning false).\n * @param {function (state: S): S} iterate Iteration step function.\n * @param {function (state: S): T} resultSelector Selector function for results produced in the sequence. (deprecated)\n * @param {SchedulerLike} [scheduler] A {@link SchedulerLike} on which to run the generator loop. If not provided, defaults to emit immediately.\n * @returns {Observable<T>} The generated sequence.\n */\n export function generate<T, S>(initialState: S,\n condition: ConditionFunc<S>,\n iterate: IterateFunc<S>,\n resultSelector: ResultFunc<S, T>,\n scheduler?: SchedulerLike): Observable<T>;\n\n/**\n * Generates an Observable by running a state-driven loop\n * that emits an element on each iteration.\n *\n * <span class=\"informal\">Use it instead of nexting values in a for loop.</span>\n *\n * <img src=\"./img/generate.png\" width=\"100%\">\n *\n * `generate` allows you to create stream of values generated with a loop very similar to\n * traditional for loop. First argument of `generate` is a beginning value. Second argument\n * is a function that accepts this value and tests if some condition still holds. If it does,\n * loop continues, if not, it stops. Third value is a function which takes previously defined\n * value and modifies it in some way on each iteration. Note how these three parameters\n * are direct equivalents of three expressions in regular for loop: first expression\n * initializes some state (for example numeric index), second tests if loop can make next\n * iteration (for example if index is lower than 10) and third states how defined value\n * will be modified on every step (index will be incremented by one).\n *\n * Return value of a `generate` operator is an Observable that on each loop iteration\n * emits a value. First, condition function is ran. If it returned true, Observable\n * emits currently stored value (initial value at the first iteration) and then updates\n * that value with iterate function. If at some point condition returned false, Observable\n * completes at that moment.\n *\n * Optionally you can pass fourth parameter to `generate` - a result selector function which allows you\n * to immediately map value that would normally be emitted by an Observable.\n *\n * If you find three anonymous functions in `generate` call hard to read, you can provide\n * single object to the operator instead. That object has properties: `initialState`,\n * `condition`, `iterate` and `resultSelector`, which should have respective values that you\n * would normally pass to `generate`. `resultSelector` is still optional, but that form\n * of calling `generate` allows you to omit `condition` as well. If you omit it, that means\n * condition always holds, so output Observable will never complete.\n *\n * Both forms of `generate` can optionally accept a scheduler. In case of multi-parameter call,\n * scheduler simply comes as a last argument (no matter if there is resultSelector\n * function or not). In case of single-parameter call, you can provide it as a\n * `scheduler` property on object passed to the operator. In both cases scheduler decides when\n * next iteration of the loop will happen and therefore when next value will be emitted\n * by the Observable. For example to ensure that each value is pushed to the observer\n * on separate task in event loop, you could use `async` scheduler. Note that\n * by default (when no scheduler is passed) values are simply emitted synchronously.\n *\n *\n * @example <caption>Use with condition and iterate functions.</caption>\n * const generated = generate(0, x => x < 3, x => x + 1);\n *\n * generated.subscribe(\n * value => console.log(value),\n * err => {},\n * () => console.log('Yo!')\n * );\n *\n * // Logs:\n * // 0\n * // 1\n * // 2\n * // \"Yo!\"\n *\n *\n * @example <caption>Use with condition, iterate and resultSelector functions.</caption>\n * const generated = generate(0, x => x < 3, x => x + 1, x => x * 1000);\n *\n * generated.subscribe(\n * value => console.log(value),\n * err => {},\n * () => console.log('Yo!')\n * );\n *\n * // Logs:\n * // 0\n * // 1000\n * // 2000\n * // \"Yo!\"\n *\n *\n * @example <caption>Use with options object.</caption>\n * const generated = generate({\n * initialState: 0,\n * condition(value) { return value < 3; },\n * iterate(value) { return value + 1; },\n * resultSelector(value) { return value * 1000; }\n * });\n *\n * generated.subscribe(\n * value => console.log(value),\n * err => {},\n * () => console.log('Yo!')\n * );\n *\n * // Logs:\n * // 0\n * // 1000\n * // 2000\n * // \"Yo!\"\n *\n * @example <caption>Use options object without condition function.</caption>\n * const generated = generate({\n * initialState: 0,\n * iterate(value) { return value + 1; },\n * resultSelector(value) { return value * 1000; }\n * });\n *\n * generated.subscribe(\n * value => console.log(value),\n * err => {},\n * () => console.log('Yo!') // This will never run.\n * );\n *\n * // Logs:\n * // 0\n * // 1000\n * // 2000\n * // 3000\n * // ...and never stops.\n *\n *\n * @see {@link from}\n * @see {@link create}\n *\n * @param {S} initialState Initial state.\n * @param {function (state: S): boolean} condition Condition to terminate generation (upon returning false).\n * @param {function (state: S): S} iterate Iteration step function.\n * @param {function (state: S): T} [resultSelector] Selector function for results produced in the sequence.\n * @param {Scheduler} [scheduler] A {@link Scheduler} on which to run the generator loop. If not provided, defaults to emitting immediately.\n * @return {Observable<T>} The generated sequence.\n */\nexport function generate<S>(initialState: S,\n condition: ConditionFunc<S>,\n iterate: IterateFunc<S>,\n scheduler?: SchedulerLike): Observable<S>;\n\n/**\n * Generates an observable sequence by running a state-driven loop\n * producing the sequence's elements, using the specified scheduler\n * to send out observer messages.\n * The overload accepts options object that might contain initial state, iterate,\n * condition and scheduler.\n *\n * ![](generate.png)\n *\n * @example <caption>Produces sequence of 0, 1, 2, ... 9, then completes.</caption>\n * const res = generate({\n * initialState: 0,\n * condition: x => x < 10,\n * iterate: x => x + 1,\n * });\n *\n * @see {@link from}\n * @see {@link Observable}\n *\n * @param {GenerateBaseOptions<S>} options Object that must contain initialState, iterate and might contain condition and scheduler.\n * @returns {Observable<S>} The generated sequence.\n */\nexport function generate<S>(options: GenerateBaseOptions<S>): Observable<S>;\n\n/**\n * Generates an observable sequence by running a state-driven loop\n * producing the sequence's elements, using the specified scheduler\n * to send out observer messages.\n * The overload accepts options object that might contain initial state, iterate,\n * condition, result selector and scheduler.\n *\n * ![](generate.png)\n *\n * @example <caption>Produces sequence of 0, 1, 2, ... 9, then completes.</caption>\n * const res = generate({\n * initialState: 0,\n * condition: x => x < 10,\n * iterate: x => x + 1,\n * resultSelector: x => x,\n * });\n *\n * @see {@link from}\n * @see {@link Observable}\n *\n * @param {GenerateOptions<T, S>} options Object that must contain initialState, iterate, resultSelector and might contain condition and scheduler.\n * @returns {Observable<T>} The generated sequence.\n */\nexport function generate<T, S>(options: GenerateOptions<T, S>): Observable<T>;\n\nexport function generate<T, S>(initialStateOrOptions: S | GenerateOptions<T, S>,\n condition?: ConditionFunc<S>,\n iterate?: IterateFunc<S>,\n resultSelectorOrObservable?: (ResultFunc<S, T>) | SchedulerLike,\n scheduler?: SchedulerLike): Observable<T> {\n\n let resultSelector: ResultFunc<S, T>;\n let initialState: S;\n\n if (arguments.length == 1) {\n const options = initialStateOrOptions as GenerateOptions<T, S>;\n initialState = options.initialState;\n condition = options.condition;\n iterate = options.iterate;\n resultSelector = options.resultSelector || identity as ResultFunc<S, T>;\n scheduler = options.scheduler;\n } else if (resultSelectorOrObservable === undefined || isScheduler(resultSelectorOrObservable)) {\n initialState = initialStateOrOptions as S;\n resultSelector = identity as ResultFunc<S, T>;\n scheduler = resultSelectorOrObservable as SchedulerLike;\n } else {\n initialState = initialStateOrOptions as S;\n resultSelector = resultSelectorOrObservable as ResultFunc<S, T>;\n }\n\n return new Observable<T>(subscriber => {\n let state = initialState;\n if (scheduler) {\n return scheduler.schedule<SchedulerState<T, S>>(dispatch, 0, {\n subscriber,\n iterate,\n condition,\n resultSelector,\n state\n });\n }\n\n do {\n if (condition) {\n let conditionResult: boolean;\n try {\n conditionResult = condition(state);\n } catch (err) {\n subscriber.error(err);\n return undefined;\n }\n if (!conditionResult) {\n subscriber.complete();\n break;\n }\n }\n let value: T;\n try {\n value = resultSelector(state);\n } catch (err) {\n subscriber.error(err);\n return undefined;\n }\n subscriber.next(value);\n if (subscriber.closed) {\n break;\n }\n try {\n state = iterate(state);\n } catch (err) {\n subscriber.error(err);\n return undefined;\n }\n } while (true);\n\n return undefined;\n });\n}\n\nfunction dispatch<T, S>(this: SchedulerAction<SchedulerState<T, S>>, state: SchedulerState<T, S>) {\n const { subscriber, condition } = state;\n if (subscriber.closed) {\n return undefined;\n }\n if (state.needIterate) {\n try {\n state.state = state.iterate(state.state);\n } catch (err) {\n subscriber.error(err);\n return undefined;\n }\n } else {\n state.needIterate = true;\n }\n if (condition) {\n let conditionResult: boolean;\n try {\n conditionResult = condition(state.state);\n } catch (err) {\n subscriber.error(err);\n return undefined;\n }\n if (!conditionResult) {\n subscriber.complete();\n return undefined;\n }\n if (subscriber.closed) {\n return undefined;\n }\n }\n let value: T;\n try {\n value = state.resultSelector(state.state);\n } catch (err) {\n subscriber.error(err);\n return undefined;\n }\n if (subscriber.closed) {\n return undefined;\n }\n subscriber.next(value);\n if (subscriber.closed) {\n return undefined;\n }\n return this.schedule(state);\n}\n","import { Observable } from '../Observable';\nimport { defer } from './defer';\nimport { EMPTY } from './empty';\nimport { SubscribableOrPromise } from '../types';\n\n/**\n * Decides at subscription time which Observable will actually be subscribed.\n *\n * <span class=\"informal\">`If` statement for Observables.</span>\n *\n * `iif` accepts a condition function and two Observables. When\n * an Observable returned by the operator is subscribed, condition function will be called.\n * Based on what boolean it returns at that moment, consumer will subscribe either to\n * the first Observable (if condition was true) or to the second (if condition was false). Condition\n * function may also not return anything - in that case condition will be evaluated as false and\n * second Observable will be subscribed.\n *\n * Note that Observables for both cases (true and false) are optional. If condition points to an Observable that\n * was left undefined, resulting stream will simply complete immediately. That allows you to, rather\n * then controlling which Observable will be subscribed, decide at runtime if consumer should have access\n * to given Observable or not.\n *\n * If you have more complex logic that requires decision between more than two Observables, {@link defer}\n * will probably be a better choice. Actually `iif` can be easily implemented with {@link defer}\n * and exists only for convenience and readability reasons.\n *\n *\n * ## Examples\n * ### Change at runtime which Observable will be subscribed\n * ```javascript\n * let subscribeToFirst;\n * const firstOrSecond = iif(\n * () => subscribeToFirst,\n * of('first'),\n * of('second'),\n * );\n *\n * subscribeToFirst = true;\n * firstOrSecond.subscribe(value => console.log(value));\n *\n * // Logs:\n * // \"first\"\n *\n * subscribeToFirst = false;\n * firstOrSecond.subscribe(value => console.log(value));\n *\n * // Logs:\n * // \"second\"\n *\n * ```\n *\n * ### Control an access to an Observable\n * ```javascript\n * let accessGranted;\n * const observableIfYouHaveAccess = iif(\n * () => accessGranted,\n * of('It seems you have an access...'), // Note that only one Observable is passed to the operator.\n * );\n *\n * accessGranted = true;\n * observableIfYouHaveAccess.subscribe(\n * value => console.log(value),\n * err => {},\n * () => console.log('The end'),\n * );\n *\n * // Logs:\n * // \"It seems you have an access...\"\n * // \"The end\"\n *\n * accessGranted = false;\n * observableIfYouHaveAccess.subscribe(\n * value => console.log(value),\n * err => {},\n * () => console.log('The end'),\n * );\n *\n * // Logs:\n * // \"The end\"\n * ```\n *\n * @see {@link defer}\n *\n * @param {function(): boolean} condition Condition which Observable should be chosen.\n * @param {Observable} [trueObservable] An Observable that will be subscribed if condition is true.\n * @param {Observable} [falseObservable] An Observable that will be subscribed if condition is false.\n * @return {Observable} Either first or second Observable, depending on condition.\n * @static true\n * @name iif\n * @owner Observable\n */\nexport function iif<T, F>(\n condition: () => boolean,\n trueResult: SubscribableOrPromise<T> = EMPTY,\n falseResult: SubscribableOrPromise<F> = EMPTY\n): Observable<T|F> {\n return defer<T|F>(() => condition() ? trueResult : falseResult);\n}\n","import { isArray } from './isArray';\n\nexport function isNumeric(val: any): val is number | string {\n // parseFloat NaNs numeric-cast false positives (null|true|false|\"\")\n // ...but misinterprets leading-number strings, particularly hex literals (\"0x...\")\n // subtraction forces infinities to NaN\n // adding 1 corrects loss of precision from parseFloat (#15100)\n return !isArray(val) && (val - parseFloat(val) + 1) >= 0;\n}\n","import { Observable } from '../Observable';\nimport { async } from '../scheduler/async';\nimport { SchedulerAction, SchedulerLike } from '../types';\nimport { isNumeric } from '../util/isNumeric';\nimport { Subscriber } from '../Subscriber';\n\n/**\n * Creates an Observable that emits sequential numbers every specified\n * interval of time, on a specified {@link SchedulerLike}.\n *\n * <span class=\"informal\">Emits incremental numbers periodically in time.\n * </span>\n *\n * ![](interval.png)\n *\n * `interval` returns an Observable that emits an infinite sequence of\n * ascending integers, with a constant interval of time of your choosing\n * between those emissions. The first emission is not sent immediately, but\n * only after the first period has passed. By default, this operator uses the\n * `async` {@link SchedulerLike} to provide a notion of time, but you may pass any\n * {@link SchedulerLike} to it.\n *\n * ## Example\n * Emits ascending numbers, one every second (1000ms) up to the number 3\n * ```javascript\n * import { interval } from 'rxjs';\n * import { take } from 'rxjs/operators';\n *\n * const numbers = interval(1000);\n *\n * const takeFourNumbers = numbers.pipe(take(4));\n *\n * takeFourNumbers.subscribe(x => console.log('Next: ', x));\n *\n * // Logs:\n * // Next: 0\n * // Next: 1\n * // Next: 2\n * // Next: 3\n * ```\n *\n * @see {@link timer}\n * @see {@link delay}\n *\n * @param {number} [period=0] The interval size in milliseconds (by default)\n * or the time unit determined by the scheduler's clock.\n * @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for scheduling\n * the emission of values, and providing a notion of \"time\".\n * @return {Observable} An Observable that emits a sequential number each time\n * interval.\n * @static true\n * @name interval\n * @owner Observable\n */\nexport function interval(period = 0,\n scheduler: SchedulerLike = async): Observable<number> {\n if (!isNumeric(period) || period < 0) {\n period = 0;\n }\n\n if (!scheduler || typeof scheduler.schedule !== 'function') {\n scheduler = async;\n }\n\n return new Observable<number>(subscriber => {\n subscriber.add(\n scheduler.schedule(dispatch, period, { subscriber, counter: 0, period })\n );\n return subscriber;\n });\n}\n\nfunction dispatch(this: SchedulerAction<IntervalState>, state: IntervalState) {\n const { subscriber, counter, period } = state;\n subscriber.next(counter);\n this.schedule({ subscriber, counter: counter + 1, period }, period);\n}\n\ninterface IntervalState {\n subscriber: Subscriber<number>;\n counter: number;\n period: number;\n}\n","import { Observable } from '../Observable';\nimport { ObservableInput, SchedulerLike} from '../types';\nimport { isScheduler } from '../util/isScheduler';\nimport { mergeAll } from '../operators/mergeAll';\nimport { fromArray } from './fromArray';\n\n/* tslint:disable:max-line-length */\nexport function merge<T>(v1: ObservableInput<T>, scheduler?: SchedulerLike): Observable<T>;\nexport function merge<T>(v1: ObservableInput<T>, concurrent?: number, scheduler?: SchedulerLike): Observable<T>;\nexport function merge<T, T2>(v1: ObservableInput<T>, v2: ObservableInput<T2>, scheduler?: SchedulerLike): Observable<T | T2>;\nexport function merge<T, T2>(v1: ObservableInput<T>, v2: ObservableInput<T2>, concurrent?: number, scheduler?: SchedulerLike): Observable<T | T2>;\nexport function merge<T, T2, T3>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, scheduler?: SchedulerLike): Observable<T | T2 | T3>;\nexport function merge<T, T2, T3>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, concurrent?: number, scheduler?: SchedulerLike): Observable<T | T2 | T3>;\nexport function merge<T, T2, T3, T4>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, scheduler?: SchedulerLike): Observable<T | T2 | T3 | T4>;\nexport function merge<T, T2, T3, T4>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, concurrent?: number, scheduler?: SchedulerLike): Observable<T | T2 | T3 | T4>;\nexport function merge<T, T2, T3, T4, T5>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, scheduler?: SchedulerLike): Observable<T | T2 | T3 | T4 | T5>;\nexport function merge<T, T2, T3, T4, T5>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, concurrent?: number, scheduler?: SchedulerLike): Observable<T | T2 | T3 | T4 | T5>;\nexport function merge<T, T2, T3, T4, T5, T6>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>, scheduler?: SchedulerLike): Observable<T | T2 | T3 | T4 | T5 | T6>;\nexport function merge<T, T2, T3, T4, T5, T6>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>, concurrent?: number, scheduler?: SchedulerLike): Observable<T | T2 | T3 | T4 | T5 | T6>;\nexport function merge<T>(...observables: (ObservableInput<T> | SchedulerLike | number)[]): Observable<T>;\nexport function merge<T, R>(...observables: (ObservableInput<any> | SchedulerLike | number)[]): Observable<R>;\n/* tslint:enable:max-line-length */\n/**\n * Creates an output Observable which concurrently emits all values from every\n * given input Observable.\n *\n * <span class=\"informal\">Flattens multiple Observables together by blending\n * their values into one Observable.</span>\n *\n * ![](merge.png)\n *\n * `merge` subscribes to each given input Observable (as arguments), and simply\n * forwards (without doing any transformation) all the values from all the input\n * Observables to the output Observable. The output Observable only completes\n * once all input Observables have completed. Any error delivered by an input\n * Observable will be immediately emitted on the output Observable.\n *\n * ## Examples\n * ### Merge together two Observables: 1s interval and clicks\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const timer = interval(1000);\n * const clicksOrTimer = merge(clicks, timer);\n * clicksOrTimer.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // timer will emit ascending values, one every second(1000ms) to console\n * // clicks logs MouseEvents to console everytime the \"document\" is clicked\n * // Since the two streams are merged you see these happening\n * // as they occur.\n * ```\n *\n * ### Merge together 3 Observables, but only 2 run concurrently\n * ```javascript\n * const timer1 = interval(1000).pipe(take(10));\n * const timer2 = interval(2000).pipe(take(6));\n * const timer3 = interval(500).pipe(take(10));\n * const concurrent = 2; // the argument\n * const merged = merge(timer1, timer2, timer3, concurrent);\n * merged.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // - First timer1 and timer2 will run concurrently\n * // - timer1 will emit a value every 1000ms for 10 iterations\n * // - timer2 will emit a value every 2000ms for 6 iterations\n * // - after timer1 hits it's max iteration, timer2 will\n * // continue, and timer3 will start to run concurrently with timer2\n * // - when timer2 hits it's max iteration it terminates, and\n * // timer3 will continue to emit a value every 500ms until it is complete\n * ```\n *\n * @see {@link mergeAll}\n * @see {@link mergeMap}\n * @see {@link mergeMapTo}\n * @see {@link mergeScan}\n *\n * @param {...ObservableInput} observables Input Observables to merge together.\n * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of input\n * Observables being subscribed to concurrently.\n * @param {SchedulerLike} [scheduler=null] The {@link SchedulerLike} to use for managing\n * concurrency of input Observables.\n * @return {Observable} an Observable that emits items that are the result of\n * every input Observable.\n * @static true\n * @name merge\n * @owner Observable\n */\nexport function merge<T, R>(...observables: Array<ObservableInput<any> | SchedulerLike | number>): Observable<R> {\n let concurrent = Number.POSITIVE_INFINITY;\n let scheduler: SchedulerLike = null;\n let last: any = observables[observables.length - 1];\n if (isScheduler(last)) {\n scheduler = <SchedulerLike>observables.pop();\n if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') {\n concurrent = <number>observables.pop();\n }\n } else if (typeof last === 'number') {\n concurrent = <number>observables.pop();\n }\n\n if (scheduler === null && observables.length === 1 && observables[0] instanceof Observable) {\n return <Observable<R>>observables[0];\n }\n\n return mergeAll<R>(concurrent)(fromArray<any>(observables, scheduler));\n}\n","import { Observable } from '../Observable';\nimport { noop } from '../util/noop';\n\n/**\n * An Observable that emits no items to the Observer and never completes.\n *\n * ![](never.png)\n *\n * A simple Observable that emits neither values nor errors nor the completion\n * notification. It can be used for testing purposes or for composing with other\n * Observables. Please note that by never emitting a complete notification, this\n * Observable keeps the subscription from being disposed automatically.\n * Subscriptions need to be manually disposed.\n *\n * ## Example\n * ### Emit the number 7, then never emit anything else (not even complete)\n * ```javascript\n * function info() {\n * console.log('Will not be called');\n * }\n * const result = NEVER.pipe(startWith(7));\n * result.subscribe(x => console.log(x), info, info);\n *\n * ```\n *\n * @see {@link Observable}\n * @see {@link index/EMPTY}\n * @see {@link of}\n * @see {@link throwError}\n */\nexport const NEVER = new Observable<never>(noop);\n\n/**\n * @deprecated Deprecated in favor of using {@link NEVER} constant.\n */\nexport function never () {\n return NEVER;\n}\n","import { Observable } from '../Observable';\nimport { ObservableInput } from '../types';\nimport { from } from './from';\nimport { isArray } from '../util/isArray';\nimport { EMPTY } from './empty';\n\n/* tslint:disable:max-line-length */\nexport function onErrorResumeNext<R>(v: ObservableInput<R>): Observable<R>;\nexport function onErrorResumeNext<T2, T3, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>): Observable<R>;\nexport function onErrorResumeNext<T2, T3, T4, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>): Observable<R>;\nexport function onErrorResumeNext<T2, T3, T4, T5, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>): Observable<R>;\nexport function onErrorResumeNext<T2, T3, T4, T5, T6, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>): Observable<R>;\n\nexport function onErrorResumeNext<R>(...observables: Array<ObservableInput<any> | ((...values: Array<any>) => R)>): Observable<R>;\nexport function onErrorResumeNext<R>(array: ObservableInput<any>[]): Observable<R>;\n/* tslint:enable:max-line-length */\n\n/**\n * When any of the provided Observable emits an complete or error notification, it immediately subscribes to the next one\n * that was passed.\n *\n * <span class=\"informal\">Execute series of Observables no matter what, even if it means swallowing errors.</span>\n *\n * ![](onErrorResumeNext.png)\n *\n * `onErrorResumeNext` Will subscribe to each observable source it is provided, in order.\n * If the source it's subscribed to emits an error or completes, it will move to the next source\n * without error.\n *\n * If `onErrorResumeNext` is provided no arguments, or a single, empty array, it will return {@link index/EMPTY}.\n *\n * `onErrorResumeNext` is basically {@link concat}, only it will continue, even if one of its\n * sources emits an error.\n *\n * Note that there is no way to handle any errors thrown by sources via the resuult of\n * `onErrorResumeNext`. If you want to handle errors thrown in any given source, you can\n * always use the {@link catchError} operator on them before passing them into `onErrorResumeNext`.\n *\n * ## Example\n * Subscribe to the next Observable after map fails</caption>\n * ```javascript\n * import { onErrorResumeNext, of } from 'rxjs';\n * import { map } from 'rxjs/operators';\n *\n * onErrorResumeNext(\n * of(1, 2, 3, 0).pipe(\n * map(x => {\n * if (x === 0) throw Error();\n * return 10 / x;\n * })\n * ),\n * of(1, 2, 3),\n * )\n * .subscribe(\n * val => console.log(val),\n * err => console.log(err), // Will never be called.\n * () => console.log('done'),\n * );\n *\n * // Logs:\n * // 10\n * // 5\n * // 3.3333333333333335\n * // 1\n * // 2\n * // 3\n * // \"done\"\n * ```\n *\n * @see {@link concat}\n * @see {@link catchError}\n *\n * @param {...ObservableInput} sources Observables (or anything that *is* observable) passed either directly or as an array.\n * @return {Observable} An Observable that concatenates all sources, one after the other,\n * ignoring all errors, such that any error causes it to move on to the next source.\n */\nexport function onErrorResumeNext<T, R>(...sources: Array<ObservableInput<any> |\n Array<ObservableInput<any>> |\n ((...values: Array<any>) => R)>): Observable<R> {\n\n if (sources.length === 0) {\n return EMPTY;\n }\n\n const [ first, ...remainder ] = sources;\n\n if (sources.length === 1 && isArray(first)) {\n return onErrorResumeNext(...first);\n }\n\n return new Observable(subscriber => {\n const subNext = () => subscriber.add(\n onErrorResumeNext(...remainder).subscribe(subscriber)\n );\n\n return from(first).subscribe({\n next(value) { subscriber.next(value); },\n error: subNext,\n complete: subNext,\n });\n });\n}\n","import { Observable } from '../Observable';\nimport { SchedulerAction, SchedulerLike } from '../types';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\n\n/**\n * Convert an object into an Observable of `[key, value]` pairs.\n *\n * <span class=\"informal\">Turn entries of an object into a stream.</span>\n *\n * <img src=\"./img/pairs.png\" width=\"100%\">\n *\n * `pairs` takes an arbitrary object and returns an Observable that emits arrays. Each\n * emitted array has exactly two elements - the first is a key from the object\n * and the second is a value corresponding to that key. Keys are extracted from\n * an object via `Object.keys` function, which means that they will be only\n * enumerable keys that are present on an object directly - not ones inherited\n * via prototype chain.\n *\n * By default these arrays are emitted synchronously. To change that you can\n * pass a {@link SchedulerLike} as a second argument to `pairs`.\n *\n * @example <caption>Converts a javascript object to an Observable</caption>\n * ```javascript\n * const obj = {\n * foo: 42,\n * bar: 56,\n * baz: 78\n * };\n *\n * pairs(obj)\n * .subscribe(\n * value => console.log(value),\n * err => {},\n * () => console.log('the end!')\n * );\n *\n * // Logs:\n * // [\"foo\": 42],\n * // [\"bar\": 56],\n * // [\"baz\": 78],\n * // \"the end!\"\n * ```\n *\n * @param {Object} obj The object to inspect and turn into an\n * Observable sequence.\n * @param {Scheduler} [scheduler] An optional IScheduler to schedule\n * when resulting Observable will emit values.\n * @returns {(Observable<Array<string|T>>)} An observable sequence of\n * [key, value] pairs from the object.\n */\nexport function pairs<T>(obj: Object, scheduler?: SchedulerLike): Observable<[string, T]> {\n if (!scheduler) {\n return new Observable<[string, T]>(subscriber => {\n const keys = Object.keys(obj);\n for (let i = 0; i < keys.length && !subscriber.closed; i++) {\n const key = keys[i];\n if (obj.hasOwnProperty(key)) {\n subscriber.next([key, obj[key]]);\n }\n }\n subscriber.complete();\n });\n } else {\n return new Observable<[string, T]>(subscriber => {\n const keys = Object.keys(obj);\n const subscription = new Subscription();\n subscription.add(\n scheduler.schedule<{ keys: string[], index: number, subscriber: Subscriber<[string, T]>, subscription: Subscription, obj: Object }>\n (dispatch, 0, { keys, index: 0, subscriber, subscription, obj }));\n return subscription;\n });\n }\n}\n\n/** @internal */\nexport function dispatch<T>(this: SchedulerAction<any>,\n state: { keys: string[], index: number, subscriber: Subscriber<[string, T]>, subscription: Subscription, obj: Object }) {\n const { keys, index, subscriber, subscription, obj } = state;\n if (!subscriber.closed) {\n if (index < keys.length) {\n const key = keys[index];\n subscriber.next([key, obj[key]]);\n subscription.add(this.schedule({ keys, index: index + 1, subscriber, subscription, obj }));\n } else {\n subscriber.complete();\n }\n }\n}\n","import { Observable } from '../Observable';\nimport { isArray } from '../util/isArray';\nimport { fromArray } from './fromArray';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { TeardownLogic } from '../types';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\n\n/**\n * Returns an Observable that mirrors the first source Observable to emit an item.\n *\n * ## Example\n * ### Subscribes to the observable that was the first to start emitting.\n *\n * ```javascript\n * const obs1 = interval(1000).pipe(mapTo('fast one'));\n * const obs2 = interval(3000).pipe(mapTo('medium one'));\n * const obs3 = interval(5000).pipe(mapTo('slow one'));\n *\n * race(obs3, obs1, obs2)\n * .subscribe(\n * winner => console.log(winner)\n * );\n *\n * // result:\n * // a series of 'fast one'\n * ```\n *\n * @param {...Observables} ...observables sources used to race for which Observable emits first.\n * @return {Observable} an Observable that mirrors the output of the first Observable to emit an item.\n * @static true\n * @name race\n * @owner Observable\n */\nexport function race<T>(observables: Array<Observable<T>>): Observable<T>;\nexport function race<T>(observables: Array<Observable<any>>): Observable<T>;\nexport function race<T>(...observables: Array<Observable<T> | Array<Observable<T>>>): Observable<T>;\nexport function race<T>(...observables: Array<Observable<any> | Array<Observable<any>>>): Observable<T> {\n // if the only argument is an array, it was most likely called with\n // `race([obs1, obs2, ...])`\n if (observables.length === 1) {\n if (isArray(observables[0])) {\n observables = <Array<Observable<any>>>observables[0];\n } else {\n return <Observable<any>>observables[0];\n }\n }\n\n return fromArray(observables, undefined).lift(new RaceOperator<T>());\n}\n\nexport class RaceOperator<T> implements Operator<T, T> {\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new RaceSubscriber(subscriber));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class RaceSubscriber<T> extends OuterSubscriber<T, T> {\n private hasFirst: boolean = false;\n private observables: Observable<any>[] = [];\n private subscriptions: Subscription[] = [];\n\n constructor(destination: Subscriber<T>) {\n super(destination);\n }\n\n protected _next(observable: any): void {\n this.observables.push(observable);\n }\n\n protected _complete() {\n const observables = this.observables;\n const len = observables.length;\n\n if (len === 0) {\n this.destination.complete();\n } else {\n for (let i = 0; i < len && !this.hasFirst; i++) {\n let observable = observables[i];\n let subscription = subscribeToResult(this, observable, observable as any, i);\n\n if (this.subscriptions) {\n this.subscriptions.push(subscription);\n }\n this.add(subscription);\n }\n this.observables = null;\n }\n }\n\n notifyNext(outerValue: T, innerValue: T,\n outerIndex: number, innerIndex: number,\n innerSub: InnerSubscriber<T, T>): void {\n if (!this.hasFirst) {\n this.hasFirst = true;\n\n for (let i = 0; i < this.subscriptions.length; i++) {\n if (i !== outerIndex) {\n let subscription = this.subscriptions[i];\n\n subscription.unsubscribe();\n this.remove(subscription);\n }\n }\n\n this.subscriptions = null;\n }\n\n this.destination.next(innerValue);\n }\n}\n","import { SchedulerAction, SchedulerLike } from '../types';\nimport { Observable } from '../Observable';\n\n/**\n * Creates an Observable that emits a sequence of numbers within a specified\n * range.\n *\n * <span class=\"informal\">Emits a sequence of numbers in a range.</span>\n *\n * ![](range.png)\n *\n * `range` operator emits a range of sequential integers, in order, where you\n * select the `start` of the range and its `length`. By default, uses no\n * {@link SchedulerLike} and just delivers the notifications synchronously, but may use\n * an optional {@link SchedulerLike} to regulate those deliveries.\n *\n * ## Example\n * Emits the numbers 1 to 10</caption>\n * ```javascript\n * const numbers = range(1, 10);\n * numbers.subscribe(x => console.log(x));\n * ```\n * @see {@link timer}\n * @see {@link index/interval}\n *\n * @param {number} [start=0] The value of the first integer in the sequence.\n * @param {number} [count=0] The number of sequential integers to generate.\n * @param {SchedulerLike} [scheduler] A {@link SchedulerLike} to use for scheduling\n * the emissions of the notifications.\n * @return {Observable} An Observable of numbers that emits a finite range of\n * sequential integers.\n * @static true\n * @name range\n * @owner Observable\n */\nexport function range(start: number = 0,\n count: number = 0,\n scheduler?: SchedulerLike): Observable<number> {\n return new Observable<number>(subscriber => {\n let index = 0;\n let current = start;\n\n if (scheduler) {\n return scheduler.schedule(dispatch, 0, {\n index, count, start, subscriber\n });\n } else {\n do {\n if (index++ >= count) {\n subscriber.complete();\n break;\n }\n subscriber.next(current++);\n if (subscriber.closed) {\n break;\n }\n } while (true);\n }\n\n return undefined;\n });\n}\n\n/** @internal */\nexport function dispatch(this: SchedulerAction<any>, state: any) {\n const { start, index, count, subscriber } = state;\n\n if (index >= count) {\n subscriber.complete();\n return;\n }\n\n subscriber.next(start);\n\n if (subscriber.closed) {\n return;\n }\n\n state.index = index + 1;\n state.start = start + 1;\n\n this.schedule(state);\n}\n","import { Observable } from '../Observable';\nimport { SchedulerAction, SchedulerLike } from '../types';\nimport { async } from '../scheduler/async';\nimport { isNumeric } from '../util/isNumeric';\nimport { isScheduler } from '../util/isScheduler';\nimport { Subscriber } from '../Subscriber';\n\n/**\n * Creates an Observable that starts emitting after an `dueTime` and\n * emits ever increasing numbers after each `period` of time thereafter.\n *\n * <span class=\"informal\">Its like {@link index/interval}, but you can specify when\n * should the emissions start.</span>\n *\n * ![](timer.png)\n *\n * `timer` returns an Observable that emits an infinite sequence of ascending\n * integers, with a constant interval of time, `period` of your choosing\n * between those emissions. The first emission happens after the specified\n * `dueTime`. The initial delay may be a `Date`. By default, this\n * operator uses the {@link asyncScheduler} {@link SchedulerLike} to provide a notion of time, but you\n * may pass any {@link SchedulerLike} to it. If `period` is not specified, the output\n * Observable emits only one value, `0`. Otherwise, it emits an infinite\n * sequence.\n *\n * ## Examples\n * ### Emits ascending numbers, one every second (1000ms), starting after 3 seconds\n * ```javascript\n * const numbers = timer(3000, 1000);\n * numbers.subscribe(x => console.log(x));\n * ```\n *\n * ### Emits one number after five seconds\n * ```javascript\n * const numbers = timer(5000);\n * numbers.subscribe(x => console.log(x));\n * ```\n * @see {@link index/interval}\n * @see {@link delay}\n *\n * @param {number|Date} [dueTime] The initial delay time specified as a Date object or as an integer denoting\n * milliseconds to wait before emitting the first value of 0`.\n * @param {number|SchedulerLike} [periodOrScheduler] The period of time between emissions of the\n * subsequent numbers.\n * @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for scheduling\n * the emission of values, and providing a notion of \"time\".\n * @return {Observable} An Observable that emits a `0` after the\n * `dueTime` and ever increasing numbers after each `period` of time\n * thereafter.\n * @static true\n * @name timer\n * @owner Observable\n */\nexport function timer(dueTime: number | Date = 0,\n periodOrScheduler?: number | SchedulerLike,\n scheduler?: SchedulerLike): Observable<number> {\n let period = -1;\n if (isNumeric(periodOrScheduler)) {\n period = Number(periodOrScheduler) < 1 && 1 || Number(periodOrScheduler);\n } else if (isScheduler(periodOrScheduler)) {\n scheduler = periodOrScheduler as any;\n }\n\n if (!isScheduler(scheduler)) {\n scheduler = async;\n }\n\n return new Observable(subscriber => {\n const due = isNumeric(dueTime)\n ? (dueTime as number)\n : (+dueTime - scheduler.now());\n\n return scheduler.schedule(dispatch, due, {\n index: 0, period, subscriber\n });\n });\n}\n\ninterface TimerState {\n index: number;\n period: number;\n subscriber: Subscriber<number>;\n}\n\nfunction dispatch(this: SchedulerAction<TimerState>, state: TimerState) {\n const { index, period, subscriber } = state;\n subscriber.next(index);\n\n if (subscriber.closed) {\n return;\n } else if (period === -1) {\n return subscriber.complete();\n }\n\n state.index = index + 1;\n this.schedule(state, period);\n}\n","import { Observable } from '../Observable';\nimport { Unsubscribable, ObservableInput } from '../types';\nimport { from } from './from'; // from from from! LAWL\nimport { EMPTY } from './empty';\n\n/**\n * Creates an Observable that uses a resource which will be disposed at the same time as the Observable.\n *\n * <span class=\"informal\">Use it when you catch yourself cleaning up after an Observable.</span>\n *\n * `using` is a factory operator, which accepts two functions. First function returns a disposable resource.\n * It can be an arbitrary object that implements `unsubscribe` method. Second function will be injected with\n * that object and should return an Observable. That Observable can use resource object during its execution.\n * Both functions passed to `using` will be called every time someone subscribes - neither an Observable nor\n * resource object will be shared in any way between subscriptions.\n *\n * When Observable returned by `using` is subscribed, Observable returned from the second function will be subscribed\n * as well. All its notifications (nexted values, completion and error events) will be emitted unchanged by the output\n * Observable. If however someone unsubscribes from the Observable or source Observable completes or errors by itself,\n * the `unsubscribe` method on resource object will be called. This can be used to do any necessary clean up, which\n * otherwise would have to be handled by hand. Note that complete or error notifications are not emitted when someone\n * cancels subscription to an Observable via `unsubscribe`, so `using` can be used as a hook, allowing you to make\n * sure that all resources which need to exist during an Observable execution will be disposed at appropriate time.\n *\n * @see {@link defer}\n *\n * @param {function(): ISubscription} resourceFactory A function which creates any resource object\n * that implements `unsubscribe` method.\n * @param {function(resource: ISubscription): Observable<T>} observableFactory A function which\n * creates an Observable, that can use injected resource object.\n * @return {Observable<T>} An Observable that behaves the same as Observable returned by `observableFactory`, but\n * which - when completed, errored or unsubscribed - will also call `unsubscribe` on created resource object.\n */\nexport function using<T>(resourceFactory: () => Unsubscribable | void,\n observableFactory: (resource: Unsubscribable | void) => ObservableInput<T> | void): Observable<T> {\n return new Observable<T>(subscriber => {\n let resource: Unsubscribable | void;\n\n try {\n resource = resourceFactory();\n } catch (err) {\n subscriber.error(err);\n return undefined;\n }\n\n let result: ObservableInput<T> | void;\n try {\n result = observableFactory(resource);\n } catch (err) {\n subscriber.error(err);\n return undefined;\n }\n\n const source = result ? from(result) : EMPTY;\n const subscription = source.subscribe(subscriber);\n return () => {\n subscription.unsubscribe();\n if (resource) {\n resource.unsubscribe();\n }\n };\n });\n}\n","import { Observable } from '../Observable';\nimport { fromArray } from './fromArray';\nimport { isArray } from '../util/isArray';\nimport { Operator } from '../Operator';\nimport { ObservableInput, PartialObserver } from '../types';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { iterator as Symbol_iterator } from '../../internal/symbol/iterator';\n\n/* tslint:disable:max-line-length */\n/** @deprecated resultSelector is no longer supported, pipe to map instead */\nexport function zip<T, R>(v1: ObservableInput<T>, resultSelector: (v1: T) => R): Observable<R>;\n/** @deprecated resultSelector is no longer supported, pipe to map instead */\nexport function zip<T, T2, R>(v1: ObservableInput<T>, v2: ObservableInput<T2>, resultSelector: (v1: T, v2: T2) => R): Observable<R>;\n/** @deprecated resultSelector is no longer supported, pipe to map instead */\nexport function zip<T, T2, T3, R>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => R): Observable<R>;\n/** @deprecated resultSelector is no longer supported, pipe to map instead */\nexport function zip<T, T2, T3, T4, R>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => R): Observable<R>;\n/** @deprecated resultSelector is no longer supported, pipe to map instead */\nexport function zip<T, T2, T3, T4, T5, R>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => R): Observable<R>;\n/** @deprecated resultSelector is no longer supported, pipe to map instead */\nexport function zip<T, T2, T3, T4, T5, T6, R>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6) => R): Observable<R>;\n\nexport function zip<T, T2>(v1: ObservableInput<T>, v2: ObservableInput<T2>): Observable<[T, T2]>;\nexport function zip<T, T2, T3>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>): Observable<[T, T2, T3]>;\nexport function zip<T, T2, T3, T4>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>): Observable<[T, T2, T3, T4]>;\nexport function zip<T, T2, T3, T4, T5>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>): Observable<[T, T2, T3, T4, T5]>;\nexport function zip<T, T2, T3, T4, T5, T6>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>): Observable<[T, T2, T3, T4, T5, T6]>;\n\nexport function zip<T>(array: ObservableInput<T>[]): Observable<T[]>;\nexport function zip<R>(array: ObservableInput<any>[]): Observable<R>;\n/** @deprecated resultSelector is no longer supported, pipe to map instead */\nexport function zip<T, R>(array: ObservableInput<T>[], resultSelector: (...values: Array<T>) => R): Observable<R>;\n/** @deprecated resultSelector is no longer supported, pipe to map instead */\nexport function zip<R>(array: ObservableInput<any>[], resultSelector: (...values: Array<any>) => R): Observable<R>;\n\nexport function zip<T>(...observables: Array<ObservableInput<T>>): Observable<T[]>;\nexport function zip<T, R>(...observables: Array<ObservableInput<T> | ((...values: Array<T>) => R)>): Observable<R>;\nexport function zip<R>(...observables: Array<ObservableInput<any> | ((...values: Array<any>) => R)>): Observable<R>;\n/* tslint:enable:max-line-length */\n\n/**\n * Combines multiple Observables to create an Observable whose values are calculated from the values, in order, of each\n * of its input Observables.\n *\n * If the latest parameter is a function, this function is used to compute the created value from the input values.\n * Otherwise, an array of the input values is returned.\n *\n * ## Example\n * Combine age and name from different sources\n * ```javascript\n * let age$ = of<number>(27, 25, 29);\n * let name$ = of<string>('Foo', 'Bar', 'Beer');\n * let isDev$ = of<boolean>(true, true, false);\n *\n * zip(age$, name$, isDev$).pipe(\n * map((age: number, name: string, isDev: boolean) => ({ age, name, isDev })),\n * )\n * .subscribe(x => console.log(x));\n *\n * // outputs\n * // { age: 27, name: 'Foo', isDev: true }\n * // { age: 25, name: 'Bar', isDev: true }\n * // { age: 29, name: 'Beer', isDev: false }\n * ```\n * @param observables\n * @return {Observable<R>}\n * @static true\n * @name zip\n * @owner Observable\n */\nexport function zip<T, R>(...observables: Array<ObservableInput<any> | ((...values: Array<any>) => R)>): Observable<R> {\n const resultSelector = <((...ys: Array<any>) => R)> observables[observables.length - 1];\n if (typeof resultSelector === 'function') {\n observables.pop();\n }\n return fromArray(observables, undefined).lift(new ZipOperator(resultSelector));\n}\n\nexport class ZipOperator<T, R> implements Operator<T, R> {\n\n resultSelector: (...values: Array<any>) => R;\n\n constructor(resultSelector?: (...values: Array<any>) => R) {\n this.resultSelector = resultSelector;\n }\n\n call(subscriber: Subscriber<R>, source: any): any {\n return source.subscribe(new ZipSubscriber(subscriber, this.resultSelector));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class ZipSubscriber<T, R> extends Subscriber<T> {\n private values: any;\n private resultSelector: (...values: Array<any>) => R;\n private iterators: LookAheadIterator<any>[] = [];\n private active = 0;\n\n constructor(destination: Subscriber<R>,\n resultSelector?: (...values: Array<any>) => R,\n values: any = Object.create(null)) {\n super(destination);\n this.resultSelector = (typeof resultSelector === 'function') ? resultSelector : null;\n this.values = values;\n }\n\n protected _next(value: any) {\n const iterators = this.iterators;\n if (isArray(value)) {\n iterators.push(new StaticArrayIterator(value));\n } else if (typeof value[Symbol_iterator] === 'function') {\n iterators.push(new StaticIterator(value[Symbol_iterator]()));\n } else {\n iterators.push(new ZipBufferIterator(this.destination, this, value));\n }\n }\n\n protected _complete() {\n const iterators = this.iterators;\n const len = iterators.length;\n\n this.unsubscribe();\n\n if (len === 0) {\n this.destination.complete();\n return;\n }\n\n this.active = len;\n for (let i = 0; i < len; i++) {\n let iterator: ZipBufferIterator<any, any> = <any>iterators[i];\n if (iterator.stillUnsubscribed) {\n const destination = this.destination as Subscription;\n destination.add(iterator.subscribe(iterator, i));\n } else {\n this.active--; // not an observable\n }\n }\n }\n\n notifyInactive() {\n this.active--;\n if (this.active === 0) {\n this.destination.complete();\n }\n }\n\n checkIterators() {\n const iterators = this.iterators;\n const len = iterators.length;\n const destination = this.destination;\n\n // abort if not all of them have values\n for (let i = 0; i < len; i++) {\n let iterator = iterators[i];\n if (typeof iterator.hasValue === 'function' && !iterator.hasValue()) {\n return;\n }\n }\n\n let shouldComplete = false;\n const args: any[] = [];\n for (let i = 0; i < len; i++) {\n let iterator = iterators[i];\n let result = iterator.next();\n\n // check to see if it's completed now that you've gotten\n // the next value.\n if (iterator.hasCompleted()) {\n shouldComplete = true;\n }\n\n if (result.done) {\n destination.complete();\n return;\n }\n\n args.push(result.value);\n }\n\n if (this.resultSelector) {\n this._tryresultSelector(args);\n } else {\n destination.next(args);\n }\n\n if (shouldComplete) {\n destination.complete();\n }\n }\n\n protected _tryresultSelector(args: any[]) {\n let result: any;\n try {\n result = this.resultSelector.apply(this, args);\n } catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n }\n}\n\ninterface LookAheadIterator<T> extends Iterator<T> {\n hasValue(): boolean;\n hasCompleted(): boolean;\n}\n\nclass StaticIterator<T> implements LookAheadIterator<T> {\n private nextResult: IteratorResult<T>;\n\n constructor(private iterator: Iterator<T>) {\n this.nextResult = iterator.next();\n }\n\n hasValue() {\n return true;\n }\n\n next(): IteratorResult<T> {\n const result = this.nextResult;\n this.nextResult = this.iterator.next();\n return result;\n }\n\n hasCompleted() {\n const nextResult = this.nextResult;\n return nextResult && nextResult.done;\n }\n}\n\nclass StaticArrayIterator<T> implements LookAheadIterator<T> {\n private index = 0;\n private length = 0;\n\n constructor(private array: T[]) {\n this.length = array.length;\n }\n\n [Symbol_iterator]() {\n return this;\n }\n\n next(value?: any): IteratorResult<T> {\n const i = this.index++;\n const array = this.array;\n return i < this.length ? { value: array[i], done: false } : { value: null, done: true };\n }\n\n hasValue() {\n return this.array.length > this.index;\n }\n\n hasCompleted() {\n return this.array.length === this.index;\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass ZipBufferIterator<T, R> extends OuterSubscriber<T, R> implements LookAheadIterator<T> {\n stillUnsubscribed = true;\n buffer: T[] = [];\n isComplete = false;\n\n constructor(destination: PartialObserver<T>,\n private parent: ZipSubscriber<T, R>,\n private observable: Observable<T>) {\n super(destination);\n }\n\n [Symbol_iterator]() {\n return this;\n }\n\n // NOTE: there is actually a name collision here with Subscriber.next and Iterator.next\n // this is legit because `next()` will never be called by a subscription in this case.\n next(): IteratorResult<T> {\n const buffer = this.buffer;\n if (buffer.length === 0 && this.isComplete) {\n return { value: null, done: true };\n } else {\n return { value: buffer.shift(), done: false };\n }\n }\n\n hasValue() {\n return this.buffer.length > 0;\n }\n\n hasCompleted() {\n return this.buffer.length === 0 && this.isComplete;\n }\n\n notifyComplete() {\n if (this.buffer.length > 0) {\n this.isComplete = true;\n this.parent.notifyInactive();\n } else {\n this.destination.complete();\n }\n }\n\n notifyNext(outerValue: T, innerValue: any,\n outerIndex: number, innerIndex: number,\n innerSub: InnerSubscriber<T, R>): void {\n this.buffer.push(innerValue);\n this.parent.checkIterators();\n }\n\n subscribe(value: any, index: number) {\n return subscribeToResult<any, any>(this, this.observable, this, index);\n }\n}\n","/* Observable */\nexport { Observable } from './internal/Observable';\nexport { ConnectableObservable } from './internal/observable/ConnectableObservable';\nexport { GroupedObservable } from './internal/operators/groupBy';\nexport { Operator } from './internal/Operator';\nexport { observable } from './internal/symbol/observable';\n\n/* Subjects */\nexport { Subject } from './internal/Subject';\nexport { BehaviorSubject } from './internal/BehaviorSubject';\nexport { ReplaySubject } from './internal/ReplaySubject';\nexport { AsyncSubject } from './internal/AsyncSubject';\n\n/* Schedulers */\nexport { asap as asapScheduler } from './internal/scheduler/asap';\nexport { async as asyncScheduler } from './internal/scheduler/async';\nexport { queue as queueScheduler } from './internal/scheduler/queue';\nexport { animationFrame as animationFrameScheduler } from './internal/scheduler/animationFrame';\nexport { VirtualTimeScheduler, VirtualAction } from './internal/scheduler/VirtualTimeScheduler';\nexport { Scheduler } from './internal/Scheduler';\n\n/* Subscription */\nexport { Subscription } from './internal/Subscription';\nexport { Subscriber } from './internal/Subscriber';\n\n/* Notification */\nexport { Notification } from './internal/Notification';\n\n/* Utils */\nexport { pipe } from './internal/util/pipe';\nexport { noop } from './internal/util/noop';\nexport { identity } from './internal/util/identity';\nexport { isObservable } from './internal/util/isObservable';\n\n/* Error types */\nexport { ArgumentOutOfRangeError } from './internal/util/ArgumentOutOfRangeError';\nexport { EmptyError } from './internal/util/EmptyError';\nexport { ObjectUnsubscribedError } from './internal/util/ObjectUnsubscribedError';\nexport { UnsubscriptionError } from './internal/util/UnsubscriptionError';\nexport { TimeoutError } from './internal/util/TimeoutError';\n\n/* Static observable creation exports */\nexport { bindCallback } from './internal/observable/bindCallback';\nexport { bindNodeCallback } from './internal/observable/bindNodeCallback';\nexport { combineLatest } from './internal/observable/combineLatest';\nexport { concat } from './internal/observable/concat';\nexport { defer } from './internal/observable/defer';\nexport { empty } from './internal/observable/empty';\nexport { forkJoin } from './internal/observable/forkJoin';\nexport { from } from './internal/observable/from';\nexport { fromEvent } from './internal/observable/fromEvent';\nexport { fromEventPattern } from './internal/observable/fromEventPattern';\nexport { generate } from './internal/observable/generate';\nexport { iif } from './internal/observable/iif';\nexport { interval } from './internal/observable/interval';\nexport { merge } from './internal/observable/merge';\nexport { never } from './internal/observable/never';\nexport { of } from './internal/observable/of';\nexport { onErrorResumeNext } from './internal/observable/onErrorResumeNext';\nexport { pairs } from './internal/observable/pairs';\nexport { race } from './internal/observable/race';\nexport { range } from './internal/observable/range';\nexport { throwError } from './internal/observable/throwError';\nexport { timer } from './internal/observable/timer';\nexport { using } from './internal/observable/using';\nexport { zip } from './internal/observable/zip';\n\n/* Constants */\nexport { EMPTY } from './internal/observable/empty';\nexport { NEVER } from './internal/observable/never';\n\n/* Types */\nexport * from './internal/types';\n\n/* Config */\nexport { config } from './internal/config';\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nfunction EventEmitter() {\n this._events = this._events || {};\n this._maxListeners = this._maxListeners || undefined;\n}\nmodule.exports = EventEmitter;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nEventEmitter.defaultMaxListeners = 10;\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function(n) {\n if (!isNumber(n) || n < 0 || isNaN(n))\n throw TypeError('n must be a positive number');\n this._maxListeners = n;\n return this;\n};\n\nEventEmitter.prototype.emit = function(type) {\n var er, handler, len, args, i, listeners;\n\n if (!this._events)\n this._events = {};\n\n // If there is no 'error' event listener then throw.\n if (type === 'error') {\n if (!this._events.error ||\n (isObject(this._events.error) && !this._events.error.length)) {\n er = arguments[1];\n if (er instanceof Error) {\n throw er; // Unhandled 'error' event\n } else {\n // At least give some kind of context to the user\n var err = new Error('Uncaught, unspecified \"error\" event. (' + er + ')');\n err.context = er;\n throw err;\n }\n }\n }\n\n handler = this._events[type];\n\n if (isUndefined(handler))\n return false;\n\n if (isFunction(handler)) {\n switch (arguments.length) {\n // fast cases\n case 1:\n handler.call(this);\n break;\n case 2:\n handler.call(this, arguments[1]);\n break;\n case 3:\n handler.call(this, arguments[1], arguments[2]);\n break;\n // slower\n default:\n args = Array.prototype.slice.call(arguments, 1);\n handler.apply(this, args);\n }\n } else if (isObject(handler)) {\n args = Array.prototype.slice.call(arguments, 1);\n listeners = handler.slice();\n len = listeners.length;\n for (i = 0; i < len; i++)\n listeners[i].apply(this, args);\n }\n\n return true;\n};\n\nEventEmitter.prototype.addListener = function(type, listener) {\n var m;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events)\n this._events = {};\n\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (this._events.newListener)\n this.emit('newListener', type,\n isFunction(listener.listener) ?\n listener.listener : listener);\n\n if (!this._events[type])\n // Optimize the case of one listener. Don't need the extra array object.\n this._events[type] = listener;\n else if (isObject(this._events[type]))\n // If we've already got an array, just append.\n this._events[type].push(listener);\n else\n // Adding the second element, need to change to array.\n this._events[type] = [this._events[type], listener];\n\n // Check for listener leak\n if (isObject(this._events[type]) && !this._events[type].warned) {\n if (!isUndefined(this._maxListeners)) {\n m = this._maxListeners;\n } else {\n m = EventEmitter.defaultMaxListeners;\n }\n\n if (m && m > 0 && this._events[type].length > m) {\n this._events[type].warned = true;\n console.error('(node) warning: possible EventEmitter memory ' +\n 'leak detected. %d listeners added. ' +\n 'Use emitter.setMaxListeners() to increase limit.',\n this._events[type].length);\n if (typeof console.trace === 'function') {\n // not supported in IE 10\n console.trace();\n }\n }\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n var fired = false;\n\n function g() {\n this.removeListener(type, g);\n\n if (!fired) {\n fired = true;\n listener.apply(this, arguments);\n }\n }\n\n g.listener = listener;\n this.on(type, g);\n\n return this;\n};\n\n// emits a 'removeListener' event iff the listener was removed\nEventEmitter.prototype.removeListener = function(type, listener) {\n var list, position, length, i;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events || !this._events[type])\n return this;\n\n list = this._events[type];\n length = list.length;\n position = -1;\n\n if (list === listener ||\n (isFunction(list.listener) && list.listener === listener)) {\n delete this._events[type];\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n\n } else if (isObject(list)) {\n for (i = length; i-- > 0;) {\n if (list[i] === listener ||\n (list[i].listener && list[i].listener === listener)) {\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (list.length === 1) {\n list.length = 0;\n delete this._events[type];\n } else {\n list.splice(position, 1);\n }\n\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n var key, listeners;\n\n if (!this._events)\n return this;\n\n // not listening for removeListener, no need to emit\n if (!this._events.removeListener) {\n if (arguments.length === 0)\n this._events = {};\n else if (this._events[type])\n delete this._events[type];\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n for (key in this._events) {\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = {};\n return this;\n }\n\n listeners = this._events[type];\n\n if (isFunction(listeners)) {\n this.removeListener(type, listeners);\n } else if (listeners) {\n // LIFO order\n while (listeners.length)\n this.removeListener(type, listeners[listeners.length - 1]);\n }\n delete this._events[type];\n\n return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n var ret;\n if (!this._events || !this._events[type])\n ret = [];\n else if (isFunction(this._events[type]))\n ret = [this._events[type]];\n else\n ret = this._events[type].slice();\n return ret;\n};\n\nEventEmitter.prototype.listenerCount = function(type) {\n if (this._events) {\n var evlistener = this._events[type];\n\n if (isFunction(evlistener))\n return 1;\n else if (evlistener)\n return evlistener.length;\n }\n return 0;\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n};\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\n","/*\r\n This is just a junk drawer, containing anything used across multiple classes.\r\n Because Luxon is small(ish), this should stay small and we won't worry about splitting\r\n it up into, say, parsingUtil.js and basicUtil.js and so on. But they are divided up by feature area.\r\n*/\r\n\r\n/**\r\n * @private\r\n */\r\n\r\n// TYPES\r\n\r\nexport function isUndefined(o) {\r\n return typeof o === \"undefined\";\r\n}\r\n\r\nexport function isNumber(o) {\r\n return typeof o === \"number\";\r\n}\r\n\r\nexport function isString(o) {\r\n return typeof o === \"string\";\r\n}\r\n\r\nexport function isDate(o) {\r\n return Object.prototype.toString.call(o) === \"[object Date]\";\r\n}\r\n\r\n// CAPABILITIES\r\n\r\nexport function hasIntl() {\r\n return typeof Intl !== \"undefined\" && Intl.DateTimeFormat;\r\n}\r\n\r\nexport function hasFormatToParts() {\r\n return !isUndefined(Intl.DateTimeFormat.prototype.formatToParts);\r\n}\r\n\r\n// OBJECTS AND ARRAYS\r\n\r\nexport function maybeArray(thing) {\r\n return Array.isArray(thing) ? thing : [thing];\r\n}\r\n\r\nexport function bestBy(arr, by, compare) {\r\n if (arr.length === 0) {\r\n return undefined;\r\n }\r\n return arr.reduce((best, next) => {\r\n const pair = [by(next), next];\r\n if (!best) {\r\n return pair;\r\n } else if (compare(best[0], pair[0]) === best[0]) {\r\n return best;\r\n } else {\r\n return pair;\r\n }\r\n }, null)[1];\r\n}\r\n\r\nexport function pick(obj, keys) {\r\n return keys.reduce((a, k) => {\r\n a[k] = obj[k];\r\n return a;\r\n }, {});\r\n}\r\n\r\n// NUMBERS AND STRINGS\r\n\r\nexport function numberBetween(thing, bottom, top) {\r\n return isNumber(thing) && thing >= bottom && thing <= top;\r\n}\r\n\r\n// x % n but takes the sign of n instead of x\r\nexport function floorMod(x, n) {\r\n return x - n * Math.floor(x / n);\r\n}\r\n\r\nexport function padStart(input, n = 2) {\r\n if (input.toString().length < n) {\r\n return (\"0\".repeat(n) + input).slice(-n);\r\n } else {\r\n return input.toString();\r\n }\r\n}\r\n\r\nexport function parseMillis(fraction) {\r\n if (isUndefined(fraction)) {\r\n return NaN;\r\n } else {\r\n const f = parseFloat(\"0.\" + fraction) * 1000;\r\n return Math.floor(f);\r\n }\r\n}\r\n\r\nexport function roundTo(number, digits) {\r\n const factor = 10 ** digits;\r\n return Math.round(number * factor) / factor;\r\n}\r\n\r\n// DATE BASICS\r\n\r\nexport function isLeapYear(year) {\r\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\r\n}\r\n\r\nexport function daysInYear(year) {\r\n return isLeapYear(year) ? 366 : 365;\r\n}\r\n\r\nexport function daysInMonth(year, month) {\r\n const modMonth = floorMod(month - 1, 12) + 1,\r\n modYear = year + (month - modMonth) / 12;\r\n\r\n if (modMonth === 2) {\r\n return isLeapYear(modYear) ? 29 : 28;\r\n } else {\r\n return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1];\r\n }\r\n}\r\n\r\nexport function weeksInWeekYear(weekYear) {\r\n const p1 =\r\n (weekYear +\r\n Math.floor(weekYear / 4) -\r\n Math.floor(weekYear / 100) +\r\n Math.floor(weekYear / 400)) %\r\n 7,\r\n last = weekYear - 1,\r\n p2 = (last + Math.floor(last / 4) - Math.floor(last / 100) + Math.floor(last / 400)) % 7;\r\n return p1 === 4 || p2 === 3 ? 53 : 52;\r\n}\r\n\r\nexport function untruncateYear(year) {\r\n if (year > 99) {\r\n return year;\r\n } else return year > 60 ? 1900 + year : 2000 + year;\r\n}\r\n\r\n// PARSING\r\n\r\nexport function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) {\r\n const date = new Date(ts),\r\n intlOpts = {\r\n hour12: false,\r\n year: \"numeric\",\r\n month: \"2-digit\",\r\n day: \"2-digit\",\r\n hour: \"2-digit\",\r\n minute: \"2-digit\"\r\n };\r\n\r\n if (timeZone) {\r\n intlOpts.timeZone = timeZone;\r\n }\r\n\r\n const modified = Object.assign({ timeZoneName: offsetFormat }, intlOpts),\r\n intl = hasIntl();\r\n\r\n if (intl && hasFormatToParts()) {\r\n const parsed = new Intl.DateTimeFormat(locale, modified)\r\n .formatToParts(date)\r\n .find(m => m.type.toLowerCase() === \"timezonename\");\r\n return parsed ? parsed.value : null;\r\n } else if (intl) {\r\n // this probably doesn't work for all locales\r\n const without = new Intl.DateTimeFormat(locale, intlOpts).format(date),\r\n included = new Intl.DateTimeFormat(locale, modified).format(date),\r\n diffed = included.substring(without.length),\r\n trimmed = diffed.replace(/^[, \\u200e]+/, \"\");\r\n return trimmed;\r\n } else {\r\n return null;\r\n }\r\n}\r\n\r\n// signedOffset('-5', '30') -> -330\r\nexport function signedOffset(offHourStr, offMinuteStr) {\r\n const offHour = parseInt(offHourStr, 10) || 0,\r\n offMin = parseInt(offMinuteStr, 10) || 0,\r\n offMinSigned = offHour < 0 ? -offMin : offMin;\r\n return offHour * 60 + offMinSigned;\r\n}\r\n\r\n// COERCION\r\n\r\nexport function normalizeObject(obj, normalizer, ignoreUnknown = false) {\r\n const normalized = {};\r\n for (const u in obj) {\r\n if (obj.hasOwnProperty(u)) {\r\n const v = obj[u];\r\n if (v !== null && !isUndefined(v) && !Number.isNaN(v)) {\r\n const mapped = normalizer(u, ignoreUnknown);\r\n if (mapped) {\r\n normalized[mapped] = v;\r\n }\r\n }\r\n }\r\n }\r\n return normalized;\r\n}\r\n\r\nexport function timeObject(obj) {\r\n return pick(obj, [\"hour\", \"minute\", \"second\", \"millisecond\"]);\r\n}\r\n","/**\n * @private\n */\n\nconst n = \"numeric\",\n s = \"short\",\n l = \"long\",\n d2 = \"2-digit\";\n\nexport const DATE_SHORT = {\n year: n,\n month: n,\n day: n\n};\n\nexport const DATE_MED = {\n year: n,\n month: s,\n day: n\n};\n\nexport const DATE_FULL = {\n year: n,\n month: l,\n day: n\n};\n\nexport const DATE_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l\n};\n\nexport const TIME_SIMPLE = {\n hour: n,\n minute: d2\n};\n\nexport const TIME_WITH_SECONDS = {\n hour: n,\n minute: d2,\n second: d2\n};\n\nexport const TIME_WITH_SHORT_OFFSET = {\n hour: n,\n minute: d2,\n second: d2,\n timeZoneName: s\n};\n\nexport const TIME_WITH_LONG_OFFSET = {\n hour: n,\n minute: d2,\n second: d2,\n timeZoneName: l\n};\n\nexport const TIME_24_SIMPLE = {\n hour: n,\n minute: d2,\n hour12: false\n};\n\n/**\n * {@link toLocaleString}; format like '09:30:23', always 24-hour.\n */\nexport const TIME_24_WITH_SECONDS = {\n hour: n,\n minute: d2,\n second: d2,\n hour12: false\n};\n\n/**\n * {@link toLocaleString}; format like '09:30:23 EDT', always 24-hour.\n */\nexport const TIME_24_WITH_SHORT_OFFSET = {\n hour: n,\n minute: d2,\n second: d2,\n hour12: false,\n timeZoneName: s\n};\n\n/**\n * {@link toLocaleString}; format like '09:30:23 Eastern Daylight Time', always 24-hour.\n */\nexport const TIME_24_WITH_LONG_OFFSET = {\n hour: n,\n minute: d2,\n second: d2,\n hour12: false,\n timeZoneName: l\n};\n\n/**\n * {@link toLocaleString}; format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.\n */\nexport const DATETIME_SHORT = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: d2\n};\n\n/**\n * {@link toLocaleString}; format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.\n */\nexport const DATETIME_SHORT_WITH_SECONDS = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: d2,\n second: d2\n};\n\nexport const DATETIME_MED = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: d2\n};\n\nexport const DATETIME_MED_WITH_SECONDS = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: d2,\n second: d2\n};\n\nexport const DATETIME_FULL = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: d2,\n timeZoneName: s\n};\n\nexport const DATETIME_FULL_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: d2,\n second: d2,\n timeZoneName: s\n};\n\nexport const DATETIME_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: d2,\n timeZoneName: l\n};\n\nexport const DATETIME_HUGE_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: d2,\n second: d2,\n timeZoneName: l\n};\n","import * as Formats from \"./formats\";\nimport { pick } from \"./util\";\n\nfunction stringify(obj) {\n return JSON.stringify(obj, Object.keys(obj).sort());\n}\n\n/**\n * @private\n */\n\nexport const monthsLong = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\"\n];\n\nexport const monthsShort = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\"\n];\n\nexport const monthsNarrow = [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"];\n\nexport function months(length) {\n switch (length) {\n case \"narrow\":\n return monthsNarrow;\n case \"short\":\n return monthsShort;\n case \"long\":\n return monthsLong;\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\"];\n case \"2-digit\":\n return [\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\"];\n default:\n return null;\n }\n}\n\nexport const weekdaysLong = [\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n \"Sunday\"\n];\n\nexport const weekdaysShort = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"];\n\nexport const weekdaysNarrow = [\"M\", \"T\", \"W\", \"T\", \"F\", \"S\", \"S\"];\n\nexport function weekdays(length) {\n switch (length) {\n case \"narrow\":\n return weekdaysNarrow;\n case \"short\":\n return weekdaysShort;\n case \"long\":\n return weekdaysLong;\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\"];\n default:\n return null;\n }\n}\n\nexport const meridiems = [\"AM\", \"PM\"];\n\nexport const erasLong = [\"Before Christ\", \"Anno Domini\"];\n\nexport const erasShort = [\"BC\", \"AD\"];\n\nexport const erasNarrow = [\"B\", \"A\"];\n\nexport function eras(length) {\n switch (length) {\n case \"narrow\":\n return erasNarrow;\n case \"short\":\n return erasShort;\n case \"long\":\n return erasLong;\n default:\n return null;\n }\n}\n\nexport function meridiemForDateTime(dt) {\n return meridiems[dt.hour < 12 ? 0 : 1];\n}\n\nexport function weekdayForDateTime(dt, length) {\n return weekdays(length)[dt.weekday - 1];\n}\n\nexport function monthForDateTime(dt, length) {\n return months(length)[dt.month - 1];\n}\n\nexport function eraForDateTime(dt, length) {\n return eras(length)[dt.year < 0 ? 0 : 1];\n}\n\nexport function formatString(knownFormat) {\n // these all have the offsets removed because we don't have access to them\n // without all the intl stuff this is backfilling\n const filtered = pick(knownFormat, [\n \"weekday\",\n \"era\",\n \"year\",\n \"month\",\n \"day\",\n \"hour\",\n \"minute\",\n \"second\",\n \"timeZoneName\",\n \"hour12\"\n ]),\n key = stringify(filtered),\n dateTimeHuge = \"EEEE, LLLL d, yyyy, h:mm a\";\n switch (key) {\n case stringify(Formats.DATE_SHORT):\n return \"M/d/yyyy\";\n case stringify(Formats.DATE_MED):\n return \"LLL d, yyyy\";\n case stringify(Formats.DATE_FULL):\n return \"LLLL d, yyyy\";\n case stringify(Formats.DATE_HUGE):\n return \"EEEE, LLLL d, yyyy\";\n case stringify(Formats.TIME_SIMPLE):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_SECONDS):\n return \"h:mm:ss a\";\n case stringify(Formats.TIME_WITH_SHORT_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_LONG_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_24_SIMPLE):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_SECONDS):\n return \"HH:mm:ss\";\n case stringify(Formats.TIME_24_WITH_SHORT_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_LONG_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.DATETIME_SHORT):\n return \"M/d/yyyy, h:mm a\";\n case stringify(Formats.DATETIME_MED):\n return \"LLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL):\n return \"LLLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_HUGE):\n return dateTimeHuge;\n case stringify(Formats.DATETIME_SHORT_WITH_SECONDS):\n return \"M/d/yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_SECONDS):\n return \"LLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_FULL_WITH_SECONDS):\n return \"LLLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_HUGE_WITH_SECONDS):\n return \"EEEE, LLLL d, yyyy, h:mm:ss a\";\n default:\n return dateTimeHuge;\n }\n}\n","// these aren't really private, but nor are they really useful to document\r\n\r\n/**\r\n * @private\r\n */\r\nclass LuxonError extends Error {}\r\n\r\n/**\r\n * @private\r\n */\r\nexport class InvalidDateTimeError extends LuxonError {\r\n constructor(reason) {\r\n super(`Invalid DateTime: ${reason.toMessage()}`);\r\n }\r\n}\r\n\r\n/**\r\n * @private\r\n */\r\nexport class InvalidIntervalError extends LuxonError {\r\n constructor(reason) {\r\n super(`Invalid Interval: ${reason.toMessage()}`);\r\n }\r\n}\r\n\r\n/**\r\n * @private\r\n */\r\nexport class InvalidDurationError extends LuxonError {\r\n constructor(reason) {\r\n super(`Invalid Duration: ${reason.toMessage()}`);\r\n }\r\n}\r\n\r\n/**\r\n * @private\r\n */\r\nexport class ConflictingSpecificationError extends LuxonError {}\r\n\r\n/**\r\n * @private\r\n */\r\nexport class InvalidUnitError extends LuxonError {\r\n constructor(unit) {\r\n super(`Invalid unit ${unit}`);\r\n }\r\n}\r\n\r\n/**\r\n * @private\r\n */\r\nexport class InvalidArgumentError extends LuxonError {}\r\n\r\n/**\r\n * @private\r\n */\r\nexport class ZoneIsAbstractError extends LuxonError {\r\n constructor() {\r\n super(\"Zone is an abstract class\");\r\n }\r\n}\r\n","/* eslint no-unused-vars: \"off\" */\r\nimport { ZoneIsAbstractError } from \"./errors\";\r\n\r\n/**\r\n * @interface\r\n */\r\nexport default class Zone {\r\n /**\r\n * The type of zone\r\n * @abstract\r\n * @type {string}\r\n */\r\n get type() {\r\n throw new ZoneIsAbstractError();\r\n }\r\n\r\n /**\r\n * The name of this zone.\r\n * @abstract\r\n * @type {string}\r\n */\r\n get name() {\r\n throw new ZoneIsAbstractError();\r\n }\r\n\r\n /**\r\n * Returns whether the offset is known to be fixed for the whole year.\r\n * @abstract\r\n * @type {boolean}\r\n */\r\n get universal() {\r\n throw new ZoneIsAbstractError();\r\n }\r\n\r\n /**\r\n * Returns the offset's common name (such as EST) at the specified timestamp\r\n * @abstract\r\n * @param {number} ts - Epoch milliseconds for which to get the name\r\n * @param {Object} opts - Options to affect the format\r\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\r\n * @param {string} opts.locale - What locale to return the offset name in.\r\n * @return {string}\r\n */\r\n offsetName(ts, opts) {\r\n throw new ZoneIsAbstractError();\r\n }\r\n\r\n /**\r\n * Return the offset in minutes for this zone at the specified timestamp.\r\n * @abstract\r\n * @param {number} ts - Epoch milliseconds for which to compute the offset\r\n * @return {number}\r\n */\r\n offset(ts) {\r\n throw new ZoneIsAbstractError();\r\n }\r\n\r\n /**\r\n * Return whether this Zone is equal to another zoner\r\n * @abstract\r\n * @param {Zone} otherZone - the zone to compare\r\n * @return {boolean}\r\n */\r\n equals(otherZone) {\r\n throw new ZoneIsAbstractError();\r\n }\r\n\r\n /**\r\n * Return whether this Zone is valid.\r\n * @abstract\r\n * @type {boolean}\r\n */\r\n get isValid() {\r\n throw new ZoneIsAbstractError();\r\n }\r\n}\r\n","import { parseZoneInfo, hasIntl } from \"../impl/util\";\r\nimport Zone from \"../zone\";\r\n\r\nlet singleton = null;\r\n\r\nexport default class LocalZone extends Zone {\r\n static get instance() {\r\n if (singleton === null) {\r\n singleton = new LocalZone();\r\n }\r\n return singleton;\r\n }\r\n\r\n get type() {\r\n return \"local\";\r\n }\r\n\r\n get name() {\r\n if (hasIntl()) {\r\n return new Intl.DateTimeFormat().resolvedOptions().timeZone;\r\n } else return \"local\";\r\n }\r\n\r\n get universal() {\r\n return false;\r\n }\r\n\r\n offsetName(ts, { format, locale }) {\r\n return parseZoneInfo(ts, format, locale);\r\n }\r\n\r\n offset(ts) {\r\n return -new Date(ts).getTimezoneOffset();\r\n }\r\n\r\n equals(otherZone) {\r\n return otherZone.type === \"local\";\r\n }\r\n\r\n get isValid() {\r\n return true;\r\n }\r\n}\r\n","import { parseZoneInfo, isUndefined } from \"../impl/util\";\r\nimport Zone from \"../zone\";\r\n\r\nconst dtfCache = {};\r\nfunction makeDTF(zone) {\r\n if (!dtfCache[zone]) {\r\n dtfCache[zone] = new Intl.DateTimeFormat(\"en-US\", {\r\n hour12: false,\r\n timeZone: zone,\r\n year: \"numeric\",\r\n month: \"2-digit\",\r\n day: \"2-digit\",\r\n hour: \"2-digit\",\r\n minute: \"2-digit\",\r\n second: \"2-digit\"\r\n });\r\n }\r\n return dtfCache[zone];\r\n}\r\n\r\nconst typeToPos = {\r\n year: 0,\r\n month: 1,\r\n day: 2,\r\n hour: 3,\r\n minute: 4,\r\n second: 5\r\n};\r\n\r\nfunction hackyOffset(dtf, date) {\r\n const formatted = dtf.format(date).replace(/\\u200E/g, \"\"),\r\n parsed = /(\\d+)\\/(\\d+)\\/(\\d+),? (\\d+):(\\d+):(\\d+)/.exec(formatted),\r\n [, fMonth, fDay, fYear, fHour, fMinute, fSecond] = parsed;\r\n return [fYear, fMonth, fDay, fHour, fMinute, fSecond];\r\n}\r\n\r\nfunction partsOffset(dtf, date) {\r\n const formatted = dtf.formatToParts(date),\r\n filled = [];\r\n for (let i = 0; i < formatted.length; i++) {\r\n const { type, value } = formatted[i],\r\n pos = typeToPos[type];\r\n\r\n if (!isUndefined(pos)) {\r\n filled[pos] = parseInt(value, 10);\r\n }\r\n }\r\n return filled;\r\n}\r\n\r\nexport default class IANAZone extends Zone {\r\n static isValidSpecifier(s) {\r\n return s && s.match(/^[a-z_+-]{1,256}(\\/[a-z_+-]{1,256}(\\/[a-z_+-]{1,256})?)?$/i);\r\n }\r\n\r\n static isValidZone(zone) {\r\n try {\r\n new Intl.DateTimeFormat(\"en-US\", { timeZone: zone }).format();\r\n return true;\r\n } catch (e) {\r\n return false;\r\n }\r\n }\r\n\r\n // Etc/GMT+8 -> -480\r\n static parseGMTOffset(specifier) {\r\n if (specifier) {\r\n const match = specifier.match(/^Etc\\/GMT([+-]\\d{1,2})$/i);\r\n if (match) {\r\n return -60 * parseInt(match[1]);\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n constructor(name) {\r\n super();\r\n this.zoneName = name;\r\n this.valid = IANAZone.isValidZone(name);\r\n }\r\n\r\n get type() {\r\n return \"iana\";\r\n }\r\n\r\n get name() {\r\n return this.zoneName;\r\n }\r\n\r\n get universal() {\r\n return false;\r\n }\r\n\r\n offsetName(ts, { format, locale }) {\r\n return parseZoneInfo(ts, format, locale, this.zoneName);\r\n }\r\n\r\n offset(ts) {\r\n const date = new Date(ts),\r\n dtf = makeDTF(this.zoneName),\r\n [fYear, fMonth, fDay, fHour, fMinute, fSecond] = dtf.formatToParts\r\n ? partsOffset(dtf, date)\r\n : hackyOffset(dtf, date),\r\n asUTC = Date.UTC(fYear, fMonth - 1, fDay, fHour, fMinute, fSecond);\r\n let asTS = date.valueOf();\r\n asTS -= asTS % 1000;\r\n return (asUTC - asTS) / (60 * 1000);\r\n }\r\n\r\n equals(otherZone) {\r\n return otherZone.type === \"iana\" && otherZone.zoneName === this.zoneName;\r\n }\r\n\r\n get isValid() {\r\n return this.valid;\r\n }\r\n}\r\n","import { padStart, signedOffset } from \"../impl/util\";\r\nimport Zone from \"../zone\";\r\n\r\nlet singleton = null;\r\n\r\nfunction hoursMinutesOffset(z) {\r\n const hours = Math.trunc(z.fixed / 60),\r\n minutes = Math.abs(z.fixed % 60),\r\n sign = hours > 0 ? \"+\" : \"-\",\r\n base = sign + Math.abs(hours);\r\n return minutes > 0 ? `${base}:${padStart(minutes, 2)}` : base;\r\n}\r\n\r\nexport default class FixedOffsetZone extends Zone {\r\n static get utcInstance() {\r\n if (singleton === null) {\r\n singleton = new FixedOffsetZone(0);\r\n }\r\n return singleton;\r\n }\r\n\r\n static instance(offset) {\r\n return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset);\r\n }\r\n\r\n static parseSpecifier(s) {\r\n if (s) {\r\n const r = s.match(/^utc(?:([+-]\\d{1,2})(?::(\\d{2}))?)?$/i);\r\n if (r) {\r\n return new FixedOffsetZone(signedOffset(r[1], r[2]));\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n constructor(offset) {\r\n super();\r\n this.fixed = offset;\r\n }\r\n\r\n get type() {\r\n return \"fixed\";\r\n }\r\n\r\n get name() {\r\n return this.fixed === 0 ? \"UTC\" : `UTC${hoursMinutesOffset(this)}`;\r\n }\r\n\r\n offsetName() {\r\n return this.name;\r\n }\r\n\r\n get universal() {\r\n return true;\r\n }\r\n\r\n offset() {\r\n return this.fixed;\r\n }\r\n\r\n equals(otherZone) {\r\n return otherZone.type === \"fixed\" && otherZone.fixed === this.fixed;\r\n }\r\n\r\n get isValid() {\r\n return true;\r\n }\r\n}\r\n","import Zone from \"../zone\";\r\n\r\nexport default class InvalidZone extends Zone {\r\n constructor(zoneName) {\r\n super();\r\n this.zoneName = zoneName;\r\n }\r\n\r\n get type() {\r\n return \"invalid\";\r\n }\r\n\r\n get name() {\r\n return this.zoneName;\r\n }\r\n\r\n get universal() {\r\n return false;\r\n }\r\n\r\n offsetName() {\r\n return null;\r\n }\r\n\r\n offset() {\r\n return NaN;\r\n }\r\n\r\n equals() {\r\n return false;\r\n }\r\n\r\n get isValid() {\r\n return false;\r\n }\r\n}\r\n","/**\r\n * @private\r\n */\r\n\r\nimport Zone from \"../zone\";\r\nimport LocalZone from \"../zones/localZone\";\r\nimport IANAZone from \"../zones/IANAZone\";\r\nimport FixedOffsetZone from \"../zones/fixedOffsetZone\";\r\nimport InvalidZone from \"../zones/invalidZone\";\r\n\r\nimport { isUndefined, isString, isNumber } from \"./util\";\r\n\r\nexport function normalizeZone(input, defaultZone) {\r\n let offset;\r\n if (isUndefined(input) || input === null) {\r\n return defaultZone;\r\n } else if (input instanceof Zone) {\r\n return input;\r\n } else if (isString(input)) {\r\n const lowered = input.toLowerCase();\r\n if (lowered === \"local\") return LocalZone.instance;\r\n else if (lowered === \"utc\" || lowered === \"gmt\") return FixedOffsetZone.utcInstance;\r\n else if ((offset = IANAZone.parseGMTOffset(input)) != null) {\r\n // handle Etc/GMT-4, which V8 chokes on\r\n return FixedOffsetZone.instance(offset);\r\n } else if (IANAZone.isValidSpecifier(lowered)) return new IANAZone(input);\r\n else return FixedOffsetZone.parseSpecifier(lowered) || new InvalidZone(input);\r\n } else if (isNumber(input)) {\r\n return FixedOffsetZone.instance(input);\r\n } else if (typeof input === \"object\" && input.offset && typeof input.offset === \"number\") {\r\n // This is dumb, but the instanceof check above doesn't seem to really work\r\n // so we're duck checking it\r\n return input;\r\n } else {\r\n return new InvalidZone(input);\r\n }\r\n}\r\n","import LocalZone from \"./zones/localZone\";\r\nimport Locale from \"./impl/locale\";\r\n\r\nimport { normalizeZone } from \"./impl/zoneUtil\";\r\n\r\nlet now = () => Date.now(),\r\n defaultZone = null, // not setting this directly to LocalZone.instance bc loading order issues\r\n defaultLocale = null,\r\n defaultNumberingSystem = null,\r\n defaultOutputCalendar = null,\r\n throwOnInvalid = false;\r\n\r\n/**\r\n * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here.\r\n */\r\nexport default class Settings {\r\n /**\r\n * Get the callback for returning the current timestamp.\r\n * @type {function}\r\n */\r\n static get now() {\r\n return now;\r\n }\r\n\r\n /**\r\n * Set the callback for returning the current timestamp.\r\n * The function should return a number, which will be interpreted as an Epoch millisecond count\r\n * @type {function}\r\n * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future\r\n * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time\r\n */\r\n static set now(n) {\r\n now = n;\r\n }\r\n\r\n /**\r\n * Get the default time zone to create DateTimes in.\r\n * @type {string}\r\n */\r\n static get defaultZoneName() {\r\n return (defaultZone || LocalZone.instance).name;\r\n }\r\n\r\n /**\r\n * Set the default time zone to create DateTimes in. Does not affect existing instances.\r\n * @type {string}\r\n */\r\n static set defaultZoneName(z) {\r\n if (!z) {\r\n defaultZone = null;\r\n } else {\r\n defaultZone = normalizeZone(z);\r\n }\r\n }\r\n\r\n /**\r\n * Get the default time zone object to create DateTimes in. Does not affect existing instances.\r\n * @type {Zone}\r\n */\r\n static get defaultZone() {\r\n return defaultZone || LocalZone.instance;\r\n }\r\n\r\n /**\r\n * Get the default locale to create DateTimes with. Does not affect existing instances.\r\n * @type {string}\r\n */\r\n static get defaultLocale() {\r\n return defaultLocale;\r\n }\r\n\r\n /**\r\n * Set the default locale to create DateTimes with. Does not affect existing instances.\r\n * @type {string}\r\n */\r\n static set defaultLocale(locale) {\r\n defaultLocale = locale;\r\n }\r\n\r\n /**\r\n * Get the default numbering system to create DateTimes with. Does not affect existing instances.\r\n * @type {string}\r\n */\r\n static get defaultNumberingSystem() {\r\n return defaultNumberingSystem;\r\n }\r\n\r\n /**\r\n * Set the default numbering system to create DateTimes with. Does not affect existing instances.\r\n * @type {string}\r\n */\r\n static set defaultNumberingSystem(numberingSystem) {\r\n defaultNumberingSystem = numberingSystem;\r\n }\r\n\r\n /**\r\n * Get the default output calendar to create DateTimes with. Does not affect existing instances.\r\n * @type {string}\r\n */\r\n static get defaultOutputCalendar() {\r\n return defaultOutputCalendar;\r\n }\r\n\r\n /**\r\n * Set the default output calendar to create DateTimes with. Does not affect existing instances.\r\n * @type {string}\r\n */\r\n static set defaultOutputCalendar(outputCalendar) {\r\n defaultOutputCalendar = outputCalendar;\r\n }\r\n\r\n /**\r\n * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\r\n * @type {boolean}\r\n */\r\n static get throwOnInvalid() {\r\n return throwOnInvalid;\r\n }\r\n\r\n /**\r\n * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\r\n * @type {boolean}\r\n */\r\n static set throwOnInvalid(t) {\r\n throwOnInvalid = t;\r\n }\r\n\r\n /**\r\n * Reset Luxon's global caches. Should only be necessary in testing scenarios.\r\n * @return {void}\r\n */\r\n static resetCaches() {\r\n Locale.resetCache();\r\n }\r\n}\r\n","import * as English from \"./english\";\r\nimport * as Formats from \"./formats\";\r\nimport { padStart } from \"./util\";\r\n\r\nfunction stringifyTokens(splits, tokenToString) {\r\n let s = \"\";\r\n for (const token of splits) {\r\n if (token.literal) {\r\n s += token.val;\r\n } else {\r\n s += tokenToString(token.val);\r\n }\r\n }\r\n return s;\r\n}\r\n\r\nconst tokenToObject = {\r\n D: Formats.DATE_SHORT,\r\n DD: Formats.DATE_MED,\r\n DDD: Formats.DATE_FULL,\r\n DDDD: Formats.DATE_HUGE,\r\n t: Formats.TIME_SIMPLE,\r\n tt: Formats.TIME_WITH_SECONDS,\r\n ttt: Formats.TIME_WITH_SHORT_OFFSET,\r\n tttt: Formats.TIME_WITH_LONG_OFFSET,\r\n T: Formats.TIME_24_SIMPLE,\r\n TT: Formats.TIME_24_WITH_SECONDS,\r\n TTT: Formats.TIME_24_WITH_SHORT_OFFSET,\r\n TTTT: Formats.TIME_24_WITH_LONG_OFFSET,\r\n f: Formats.DATETIME_SHORT,\r\n ff: Formats.DATETIME_MED,\r\n fff: Formats.DATETIME_FULL,\r\n ffff: Formats.DATETIME_HUGE,\r\n F: Formats.DATETIME_SHORT_WITH_SECONDS,\r\n FF: Formats.DATETIME_MED_WITH_SECONDS,\r\n FFF: Formats.DATETIME_FULL_WITH_SECONDS,\r\n FFFF: Formats.DATETIME_HUGE_WITH_SECONDS\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\n\r\nexport default class Formatter {\r\n static create(locale, opts = {}) {\r\n return new Formatter(locale, opts);\r\n }\r\n\r\n static parseFormat(fmt) {\r\n let current = null,\r\n currentFull = \"\",\r\n bracketed = false;\r\n const splits = [];\r\n for (let i = 0; i < fmt.length; i++) {\r\n const c = fmt.charAt(i);\r\n if (c === \"'\") {\r\n if (currentFull.length > 0) {\r\n splits.push({ literal: bracketed, val: currentFull });\r\n }\r\n current = null;\r\n currentFull = \"\";\r\n bracketed = !bracketed;\r\n } else if (bracketed) {\r\n currentFull += c;\r\n } else if (c === current) {\r\n currentFull += c;\r\n } else {\r\n if (currentFull.length > 0) {\r\n splits.push({ literal: false, val: currentFull });\r\n }\r\n currentFull = c;\r\n current = c;\r\n }\r\n }\r\n\r\n if (currentFull.length > 0) {\r\n splits.push({ literal: bracketed, val: currentFull });\r\n }\r\n\r\n return splits;\r\n }\r\n\r\n constructor(locale, formatOpts) {\r\n this.opts = formatOpts;\r\n this.loc = locale;\r\n this.systemLoc = null;\r\n }\r\n\r\n formatWithSystemDefault(dt, opts) {\r\n if (this.systemLoc === null) {\r\n this.systemLoc = this.loc.redefaultToSystem();\r\n }\r\n const df = this.systemLoc.dtFormatter(dt, Object.assign({}, this.opts, opts));\r\n return df.format();\r\n }\r\n\r\n formatDateTime(dt, opts = {}) {\r\n const df = this.loc.dtFormatter(dt, Object.assign({}, this.opts, opts));\r\n return df.format();\r\n }\r\n\r\n formatDateTimeParts(dt, opts = {}) {\r\n const df = this.loc.dtFormatter(dt, Object.assign({}, this.opts, opts));\r\n return df.formatToParts();\r\n }\r\n\r\n resolvedOptions(dt, opts = {}) {\r\n const df = this.loc.dtFormatter(dt, Object.assign({}, this.opts, opts));\r\n return df.resolvedOptions();\r\n }\r\n\r\n num(n, p = 0) {\r\n // we get some perf out of doing this here, annoyingly\r\n if (this.opts.forceSimple) {\r\n return padStart(n, p);\r\n }\r\n\r\n const opts = Object.assign({}, this.opts);\r\n\r\n if (p > 0) {\r\n opts.padTo = p;\r\n }\r\n\r\n return this.loc.numberFormatter(opts).format(n);\r\n }\r\n\r\n formatDateTimeFromString(dt, fmt) {\r\n const knownEnglish = this.loc.listingMode() === \"en\";\r\n const string = (opts, extract) => this.loc.extract(dt, opts, extract),\r\n formatOffset = opts => {\r\n if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) {\r\n return \"Z\";\r\n }\r\n\r\n const hours = Math.trunc(dt.offset / 60),\r\n minutes = Math.abs(dt.offset % 60),\r\n sign = hours >= 0 ? \"+\" : \"-\",\r\n base = `${sign}${Math.abs(hours)}`;\r\n\r\n switch (opts.format) {\r\n case \"short\":\r\n return `${sign}${this.num(Math.abs(hours), 2)}:${this.num(minutes, 2)}`;\r\n case \"narrow\":\r\n return minutes > 0 ? `${base}:${minutes}` : base;\r\n case \"techie\":\r\n return `${sign}${this.num(Math.abs(hours), 2)}${this.num(minutes, 2)}`;\r\n default:\r\n throw new RangeError(`Value format ${opts.format} is out of range for property format`);\r\n }\r\n },\r\n meridiem = () =>\r\n knownEnglish\r\n ? English.meridiemForDateTime(dt)\r\n : string({ hour: \"numeric\", hour12: true }, \"dayperiod\"),\r\n month = (length, standalone) =>\r\n knownEnglish\r\n ? English.monthForDateTime(dt, length)\r\n : string(standalone ? { month: length } : { month: length, day: \"numeric\" }, \"month\"),\r\n weekday = (length, standalone) =>\r\n knownEnglish\r\n ? English.weekdayForDateTime(dt, length)\r\n : string(\r\n standalone ? { weekday: length } : { weekday: length, month: \"long\", day: \"numeric\" },\r\n \"weekday\"\r\n ),\r\n maybeMacro = token => {\r\n const macro = tokenToObject[token];\r\n if (macro) {\r\n return this.formatWithSystemDefault(dt, macro);\r\n } else {\r\n return token;\r\n }\r\n },\r\n era = length =>\r\n knownEnglish ? English.eraForDateTime(dt, length) : string({ era: length }, \"era\"),\r\n tokenToString = token => {\r\n const outputCal = this.loc.outputCalendar;\r\n\r\n // Where possible: http://cldr.unicode.org/translation/date-time#TOC-Stand-Alone-vs.-Format-Styles\r\n switch (token) {\r\n // ms\r\n case \"S\":\r\n return this.num(dt.millisecond);\r\n case \"u\":\r\n // falls through\r\n case \"SSS\":\r\n return this.num(dt.millisecond, 3);\r\n // seconds\r\n case \"s\":\r\n return this.num(dt.second);\r\n case \"ss\":\r\n return this.num(dt.second, 2);\r\n // minutes\r\n case \"m\":\r\n return this.num(dt.minute);\r\n case \"mm\":\r\n return this.num(dt.minute, 2);\r\n // hours\r\n case \"h\":\r\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12);\r\n case \"hh\":\r\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2);\r\n case \"H\":\r\n return this.num(dt.hour);\r\n case \"HH\":\r\n return this.num(dt.hour, 2);\r\n // offset\r\n case \"Z\":\r\n // like +6\r\n return formatOffset({ format: \"narrow\", allowZ: this.opts.allowZ });\r\n case \"ZZ\":\r\n // like +06:00\r\n return formatOffset({ format: \"short\", allowZ: this.opts.allowZ });\r\n case \"ZZZ\":\r\n // like +0600\r\n return formatOffset({ format: \"techie\", allowZ: false });\r\n case \"ZZZZ\":\r\n // like EST\r\n return dt.offsetNameShort;\r\n case \"ZZZZZ\":\r\n // like Eastern Standard Time\r\n return dt.offsetNameLong;\r\n // zone\r\n case \"z\":\r\n // like America/New_York\r\n return dt.zoneName;\r\n // meridiems\r\n case \"a\":\r\n return meridiem();\r\n // dates\r\n case \"d\":\r\n return outputCal ? string({ day: \"numeric\" }, \"day\") : this.num(dt.day);\r\n case \"dd\":\r\n return outputCal ? string({ day: \"2-digit\" }, \"day\") : this.num(dt.day, 2);\r\n // weekdays - standalone\r\n case \"c\":\r\n // like 1\r\n return this.num(dt.weekday);\r\n case \"ccc\":\r\n // like 'Tues'\r\n return weekday(\"short\", true);\r\n case \"cccc\":\r\n // like 'Tuesday'\r\n return weekday(\"long\", true);\r\n case \"ccccc\":\r\n // like 'T'\r\n return weekday(\"narrow\", true);\r\n // weekdays - format\r\n case \"E\":\r\n // like 1\r\n return this.num(dt.weekday);\r\n case \"EEE\":\r\n // like 'Tues'\r\n return weekday(\"short\", false);\r\n case \"EEEE\":\r\n // like 'Tuesday'\r\n return weekday(\"long\", false);\r\n case \"EEEEE\":\r\n // like 'T'\r\n return weekday(\"narrow\", false);\r\n // months - standalone\r\n case \"L\":\r\n // like 1\r\n return outputCal\r\n ? string({ month: \"numeric\", day: \"numeric\" }, \"month\")\r\n : this.num(dt.month);\r\n case \"LL\":\r\n // like 01, doesn't seem to work\r\n return outputCal\r\n ? string({ month: \"2-digit\", day: \"numeric\" }, \"month\")\r\n : this.num(dt.month, 2);\r\n case \"LLL\":\r\n // like Jan\r\n return month(\"short\", true);\r\n case \"LLLL\":\r\n // like January\r\n return month(\"long\", true);\r\n case \"LLLLL\":\r\n // like J\r\n return month(\"narrow\", true);\r\n // months - format\r\n case \"M\":\r\n // like 1\r\n return outputCal ? string({ month: \"numeric\" }, \"month\") : this.num(dt.month);\r\n case \"MM\":\r\n // like 01\r\n return outputCal ? string({ month: \"2-digit\" }, \"month\") : this.num(dt.month, 2);\r\n case \"MMM\":\r\n // like Jan\r\n return month(\"short\", false);\r\n case \"MMMM\":\r\n // like January\r\n return month(\"long\", false);\r\n case \"MMMMM\":\r\n // like J\r\n return month(\"narrow\", false);\r\n // years\r\n case \"y\":\r\n // like 2014\r\n return outputCal ? string({ year: \"numeric\" }, \"year\") : this.num(dt.year);\r\n case \"yy\":\r\n // like 14\r\n return outputCal\r\n ? string({ year: \"2-digit\" }, \"year\")\r\n : this.num(dt.year.toString().slice(-2), 2);\r\n case \"yyyy\":\r\n // like 0012\r\n return outputCal ? string({ year: \"numeric\" }, \"year\") : this.num(dt.year, 4);\r\n case \"yyyyyy\":\r\n // like 000012\r\n return outputCal ? string({ year: \"numeric\" }, \"year\") : this.num(dt.year, 6);\r\n // eras\r\n case \"G\":\r\n // like AD\r\n return era(\"short\");\r\n case \"GG\":\r\n // like Anno Domini\r\n return era(\"long\");\r\n case \"GGGGG\":\r\n return era(\"narrow\");\r\n case \"kk\":\r\n return this.num(dt.weekYear.toString().slice(-2), 2);\r\n case \"kkkk\":\r\n return this.num(dt.weekYear, 4);\r\n case \"W\":\r\n return this.num(dt.weekNumber);\r\n case \"WW\":\r\n return this.num(dt.weekNumber, 2);\r\n case \"o\":\r\n return this.num(dt.ordinal);\r\n case \"ooo\":\r\n return this.num(dt.ordinal, 3);\r\n case \"q\":\r\n // like 1\r\n return this.num(dt.quarter);\r\n case \"qq\":\r\n // like 01\r\n return this.num(dt.quarter, 2);\r\n case \"X\":\r\n return this.num(Math.floor(dt.ts / 1000));\r\n case \"x\":\r\n return this.num(dt.ts);\r\n default:\r\n return maybeMacro(token);\r\n }\r\n };\r\n\r\n return stringifyTokens(Formatter.parseFormat(fmt), tokenToString);\r\n }\r\n\r\n formatDurationFromString(dur, fmt) {\r\n const tokenToField = token => {\r\n switch (token[0]) {\r\n case \"S\":\r\n return \"millisecond\";\r\n case \"s\":\r\n return \"second\";\r\n case \"m\":\r\n return \"minute\";\r\n case \"h\":\r\n return \"hour\";\r\n case \"d\":\r\n return \"day\";\r\n case \"M\":\r\n return \"month\";\r\n case \"y\":\r\n return \"year\";\r\n default:\r\n return null;\r\n }\r\n },\r\n tokenToString = lildur => token => {\r\n const mapped = tokenToField(token);\r\n if (mapped) {\r\n return this.num(lildur.get(mapped), token.length);\r\n } else {\r\n return token;\r\n }\r\n },\r\n tokens = Formatter.parseFormat(fmt),\r\n realTokens = tokens.reduce(\r\n (found, { literal, val }) => (literal ? found : found.concat(val)),\r\n []\r\n ),\r\n collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter(t => t));\r\n return stringifyTokens(tokens, tokenToString(collapsed));\r\n }\r\n}\r\n","import { hasFormatToParts, hasIntl, padStart, roundTo } from \"./util\";\r\nimport * as English from \"./english\";\r\nimport Settings from \"../settings\";\r\nimport DateTime from \"../datetime\";\r\nimport Formatter from \"./formatter\";\r\n\r\nlet intlDTCache = {};\r\nfunction getCachedDTF(locString, opts = {}) {\r\n const key = JSON.stringify([locString, opts]);\r\n let dtf = intlDTCache[key];\r\n if (!dtf) {\r\n dtf = new Intl.DateTimeFormat(locString, opts);\r\n intlDTCache[key] = dtf;\r\n }\r\n return dtf;\r\n}\r\n\r\nlet intlNumCache = {};\r\nfunction getCachendINF(locString, opts = {}) {\r\n const key = JSON.stringify([locString, opts]);\r\n let inf = intlNumCache[key];\r\n if (!inf) {\r\n inf = new Intl.NumberFormat(locString, opts);\r\n intlNumCache[key] = inf;\r\n }\r\n return inf;\r\n}\r\n\r\nlet sysLocaleCache = null;\r\nfunction systemLocale() {\r\n if (sysLocaleCache) {\r\n return sysLocaleCache;\r\n } else if (hasIntl()) {\r\n const computedSys = new Intl.DateTimeFormat().resolvedOptions().locale;\r\n // node sometimes defaults to \"und\". Override that because that is dumb\r\n sysLocaleCache = computedSys === \"und\" ? \"en-US\" : computedSys;\r\n return sysLocaleCache;\r\n } else {\r\n sysLocaleCache = \"en-US\";\r\n return sysLocaleCache;\r\n }\r\n}\r\n\r\nfunction parseLocaleString(localeStr) {\r\n // I really want to avoid writing a BCP 47 parser\r\n // see, e.g. https://github.com/wooorm/bcp-47\r\n // Intead, we'll do this:\r\n\r\n // a) if the string has no -u extensions, just leave it alone\r\n // b) if it does, use Intl to resolve everything\r\n // c) if Intl fails, try again without the -u\r\n\r\n const uIndex = localeStr.indexOf(\"-u-\");\r\n if (uIndex === -1) {\r\n return [localeStr];\r\n } else {\r\n let options;\r\n const smaller = localeStr.substring(0, uIndex);\r\n try {\r\n options = getCachedDTF(localeStr).resolvedOptions();\r\n } catch (e) {\r\n options = getCachedDTF(smaller).resolvedOptions();\r\n }\r\n\r\n const { numberingSystem, calendar } = options;\r\n // return the smaller one so that we can append the calendar and numbering overrides to it\r\n return [smaller, numberingSystem, calendar];\r\n }\r\n}\r\n\r\nfunction intlConfigString(localeStr, numberingSystem, outputCalendar) {\r\n if (hasIntl()) {\r\n if (outputCalendar || numberingSystem) {\r\n localeStr += \"-u\";\r\n\r\n if (outputCalendar) {\r\n localeStr += `-ca-${outputCalendar}`;\r\n }\r\n\r\n if (numberingSystem) {\r\n localeStr += `-nu-${numberingSystem}`;\r\n }\r\n return localeStr;\r\n } else {\r\n return localeStr;\r\n }\r\n } else {\r\n return [];\r\n }\r\n}\r\n\r\nfunction mapMonths(f) {\r\n const ms = [];\r\n for (let i = 1; i <= 12; i++) {\r\n const dt = DateTime.utc(2016, i, 1);\r\n ms.push(f(dt));\r\n }\r\n return ms;\r\n}\r\n\r\nfunction mapWeekdays(f) {\r\n const ms = [];\r\n for (let i = 1; i <= 7; i++) {\r\n const dt = DateTime.utc(2016, 11, 13 + i);\r\n ms.push(f(dt));\r\n }\r\n return ms;\r\n}\r\n\r\nfunction listStuff(loc, length, defaultOK, englishFn, intlFn) {\r\n const mode = loc.listingMode(defaultOK);\r\n\r\n if (mode === \"error\") {\r\n return null;\r\n } else if (mode === \"en\") {\r\n return englishFn(length);\r\n } else {\r\n return intlFn(length);\r\n }\r\n}\r\n\r\nfunction supportsFastNumbers(loc) {\r\n if (loc.numberingSystem && loc.numberingSystem !== \"latn\") {\r\n return false;\r\n } else {\r\n return (\r\n loc.numberingSystem === \"latn\" ||\r\n !loc.locale ||\r\n loc.locale.startsWith(\"en\") ||\r\n (hasIntl() && Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem === \"latn\")\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * @private\r\n */\r\n\r\nclass SimpleNumberFormatter {\r\n constructor(opts) {\r\n this.padTo = opts.padTo || 0;\r\n this.floor = opts.floor || false;\r\n }\r\n\r\n format(i) {\r\n // to match the browser's numberformatter defaults\r\n const fixed = this.floor ? Math.floor(i) : roundTo(i, 3);\r\n return padStart(fixed, this.padTo);\r\n }\r\n}\r\n\r\nclass IntlNumberFormatter {\r\n constructor(intl, opts) {\r\n const intlOpts = { useGrouping: false };\r\n\r\n if (opts.padTo > 0) {\r\n intlOpts.minimumIntegerDigits = opts.padTo;\r\n }\r\n\r\n this.floor = opts.floor;\r\n this.inf = getCachendINF(intl, intlOpts);\r\n }\r\n\r\n format(i) {\r\n const fixed = this.floor ? Math.floor(i) : i;\r\n return this.inf.format(fixed);\r\n }\r\n}\r\n\r\n/**\r\n * @private\r\n */\r\n\r\nclass PolyDateFormatter {\r\n constructor(dt, intl, opts) {\r\n this.opts = opts;\r\n this.hasIntl = hasIntl();\r\n\r\n let z;\r\n if (dt.zone.universal && this.hasIntl) {\r\n // Chromium doesn't support fixed-offset zones like Etc/GMT+8 in its formatter,\r\n // See https://bugs.chromium.org/p/chromium/issues/detail?id=364374.\r\n // So we have to make do. Two cases:\r\n // 1. The format options tell us to show the zone. We can't do that, so the best\r\n // we can do is format the date in UTC.\r\n // 2. The format options don't tell us to show the zone. Then we can adjust them\r\n // the time and tell the formatter to show it to us in UTC, so that the time is right\r\n // and the bad zone doesn't show up.\r\n // We can clean all this up when Chrome fixes this.\r\n z = \"UTC\";\r\n if (opts.timeZoneName) {\r\n this.dt = dt;\r\n } else {\r\n this.dt = dt.offset === 0 ? dt : DateTime.fromMillis(dt.ts + dt.offset * 60 * 1000);\r\n }\r\n } else if (dt.zone.type === \"local\") {\r\n this.dt = dt;\r\n } else {\r\n this.dt = dt;\r\n z = dt.zone.name;\r\n }\r\n\r\n if (this.hasIntl) {\r\n const intlOpts = Object.assign({}, this.opts);\r\n if (z) {\r\n intlOpts.timeZone = z;\r\n }\r\n this.dtf = getCachedDTF(intl, intlOpts);\r\n }\r\n }\r\n\r\n format() {\r\n if (this.hasIntl) {\r\n return this.dtf.format(this.dt.toJSDate());\r\n } else {\r\n const tokenFormat = English.formatString(this.opts),\r\n loc = Locale.create(\"en-US\");\r\n return Formatter.create(loc).formatDateTimeFromString(this.dt, tokenFormat);\r\n }\r\n }\r\n\r\n formatToParts() {\r\n if (this.hasIntl && hasFormatToParts()) {\r\n return this.dtf.formatToParts(this.dt.toJSDate());\r\n } else {\r\n // This is kind of a cop out. We actually could do this for English. However, we couldn't do it for intl strings\r\n // and IMO it's too weird to have an uncanny valley like that\r\n return [];\r\n }\r\n }\r\n\r\n resolvedOptions() {\r\n if (this.hasIntl) {\r\n return this.dtf.resolvedOptions();\r\n } else {\r\n return {\r\n locale: \"en-US\",\r\n numberingSystem: \"latn\",\r\n outputCalendar: \"gregory\"\r\n };\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * @private\r\n */\r\n\r\nexport default class Locale {\r\n static fromOpts(opts) {\r\n return Locale.create(opts.locale, opts.numberingSystem, opts.outputCalendar, opts.defaultToEN);\r\n }\r\n\r\n static create(locale, numberingSystem, outputCalendar, defaultToEN = false) {\r\n const specifiedLocale = locale || Settings.defaultLocale,\r\n // the system locale is useful for human readable strings but annoying for parsing/formatting known formats\r\n localeR = specifiedLocale || (defaultToEN ? \"en-US\" : systemLocale()),\r\n numberingSystemR = numberingSystem || Settings.defaultNumberingSystem,\r\n outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;\r\n\r\n return new Locale(localeR, numberingSystemR, outputCalendarR, specifiedLocale);\r\n }\r\n\r\n static resetCache() {\r\n sysLocaleCache = null;\r\n intlDTCache = {};\r\n intlNumCache = {};\r\n }\r\n\r\n static fromObject({ locale, numberingSystem, outputCalendar } = {}) {\r\n return Locale.create(locale, numberingSystem, outputCalendar);\r\n }\r\n\r\n constructor(locale, numbering, outputCalendar, specifiedLocale) {\r\n let [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale);\r\n\r\n this.locale = parsedLocale;\r\n this.numberingSystem = numbering || parsedNumberingSystem || null;\r\n this.outputCalendar = outputCalendar || parsedOutputCalendar || null;\r\n this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);\r\n\r\n this.weekdaysCache = { format: {}, standalone: {} };\r\n this.monthsCache = { format: {}, standalone: {} };\r\n this.meridiemCache = null;\r\n this.eraCache = {};\r\n\r\n this.specifiedLocale = specifiedLocale;\r\n this.fastNumbersCached = null;\r\n }\r\n\r\n get fastNumbers() {\r\n if (this.fastNumbersCached == null) {\r\n this.fastNumbersCached = supportsFastNumbers(this);\r\n }\r\n\r\n return this.fastNumbersCached;\r\n }\r\n\r\n listingMode(defaultOK = true) {\r\n const intl = hasIntl(),\r\n hasFTP = intl && hasFormatToParts(),\r\n isActuallyEn =\r\n this.locale === \"en\" ||\r\n this.locale.toLowerCase() === \"en-us\" ||\r\n (intl &&\r\n Intl.DateTimeFormat(this.intl)\r\n .resolvedOptions()\r\n .locale.startsWith(\"en-us\")),\r\n hasNoWeirdness =\r\n (this.numberingSystem === null || this.numberingSystem === \"latn\") &&\r\n (this.outputCalendar === null || this.outputCalendar === \"gregory\");\r\n\r\n if (!hasFTP && !(isActuallyEn && hasNoWeirdness) && !defaultOK) {\r\n return \"error\";\r\n } else if (!hasFTP || (isActuallyEn && hasNoWeirdness)) {\r\n return \"en\";\r\n } else {\r\n return \"intl\";\r\n }\r\n }\r\n\r\n clone(alts) {\r\n if (!alts || Object.getOwnPropertyNames(alts).length === 0) {\r\n return this;\r\n } else {\r\n return Locale.create(\r\n alts.locale || this.specifiedLocale,\r\n alts.numberingSystem || this.numberingSystem,\r\n alts.outputCalendar || this.outputCalendar,\r\n alts.defaultToEN || false\r\n );\r\n }\r\n }\r\n\r\n redefaultToEN(alts = {}) {\r\n return this.clone(Object.assign({}, alts, { defaultToEN: true }));\r\n }\r\n\r\n redefaultToSystem(alts = {}) {\r\n return this.clone(Object.assign({}, alts, { defaultToEN: false }));\r\n }\r\n\r\n months(length, format = false, defaultOK = true) {\r\n return listStuff(this, length, defaultOK, English.months, () => {\r\n const intl = format ? { month: length, day: \"numeric\" } : { month: length },\r\n formatStr = format ? \"format\" : \"standalone\";\r\n if (!this.monthsCache[formatStr][length]) {\r\n this.monthsCache[formatStr][length] = mapMonths(dt => this.extract(dt, intl, \"month\"));\r\n }\r\n return this.monthsCache[formatStr][length];\r\n });\r\n }\r\n\r\n weekdays(length, format = false, defaultOK = true) {\r\n return listStuff(this, length, defaultOK, English.weekdays, () => {\r\n const intl = format\r\n ? { weekday: length, year: \"numeric\", month: \"long\", day: \"numeric\" }\r\n : { weekday: length },\r\n formatStr = format ? \"format\" : \"standalone\";\r\n if (!this.weekdaysCache[formatStr][length]) {\r\n this.weekdaysCache[formatStr][length] = mapWeekdays(dt =>\r\n this.extract(dt, intl, \"weekday\")\r\n );\r\n }\r\n return this.weekdaysCache[formatStr][length];\r\n });\r\n }\r\n\r\n meridiems(defaultOK = true) {\r\n return listStuff(\r\n this,\r\n undefined,\r\n defaultOK,\r\n () => English.meridiems,\r\n () => {\r\n // In theory there could be aribitrary day periods. We're gonna assume there are exactly two\r\n // for AM and PM. This is probably wrong, but it's makes parsing way easier.\r\n if (!this.meridiemCache) {\r\n const intl = { hour: \"numeric\", hour12: true };\r\n this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(\r\n dt => this.extract(dt, intl, \"dayperiod\")\r\n );\r\n }\r\n\r\n return this.meridiemCache;\r\n }\r\n );\r\n }\r\n\r\n eras(length, defaultOK = true) {\r\n return listStuff(this, length, defaultOK, English.eras, () => {\r\n const intl = { era: length };\r\n\r\n // This is utter bullshit. Different calendars are going to define eras totally differently. What I need is the minimum set of dates\r\n // to definitely enumerate them.\r\n if (!this.eraCache[length]) {\r\n this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map(dt =>\r\n this.extract(dt, intl, \"era\")\r\n );\r\n }\r\n\r\n return this.eraCache[length];\r\n });\r\n }\r\n\r\n extract(dt, intlOpts, field) {\r\n const df = this.dtFormatter(dt, intlOpts),\r\n results = df.formatToParts(),\r\n matching = results.find(m => m.type.toLowerCase() === field);\r\n\r\n return matching ? matching.value : null;\r\n }\r\n\r\n numberFormatter(opts = {}) {\r\n // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave)\r\n // (in contrast, the rest of the condition is used heavily)\r\n if (opts.forceSimple || this.fastNumbers || !hasIntl()) {\r\n return new SimpleNumberFormatter(opts);\r\n } else {\r\n return new IntlNumberFormatter(this.intl, opts);\r\n }\r\n }\r\n\r\n dtFormatter(dt, intlOpts = {}) {\r\n return new PolyDateFormatter(dt, this.intl, intlOpts);\r\n }\r\n\r\n equals(other) {\r\n return (\r\n this.locale === other.locale &&\r\n this.numberingSystem === other.numberingSystem &&\r\n this.outputCalendar === other.outputCalendar\r\n );\r\n }\r\n}\r\n","import { untruncateYear, signedOffset, parseMillis } from \"./util\";\r\nimport * as English from \"./english\";\r\nimport FixedOffsetZone from \"../zones/fixedOffsetZone\";\r\nimport IANAZone from \"../zones/IANAZone\";\r\n\r\n/*\r\n * This file handles parsing for well-specified formats. Here's how it works:\r\n * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match.\r\n * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object\r\n * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence.\r\n * Extractors can take a \"cursor\" representing the offset in the match to look at. This makes it easy to combine extractors.\r\n * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions.\r\n * Some extractions are super dumb and simpleParse and fromStrings help DRY them.\r\n */\r\n\r\nfunction combineRegexes(...regexes) {\r\n const full = regexes.reduce((f, r) => f + r.source, \"\");\r\n return RegExp(`^${full}$`);\r\n}\r\n\r\nfunction combineExtractors(...extractors) {\r\n return m =>\r\n extractors\r\n .reduce(\r\n ([mergedVals, mergedZone, cursor], ex) => {\r\n const [val, zone, next] = ex(m, cursor);\r\n return [Object.assign(mergedVals, val), mergedZone || zone, next];\r\n },\r\n [{}, null, 1]\r\n )\r\n .slice(0, 2);\r\n}\r\n\r\nfunction parse(s, ...patterns) {\r\n if (s == null) {\r\n return [null, null];\r\n }\r\n\r\n for (const [regex, extractor] of patterns) {\r\n const m = regex.exec(s);\r\n if (m) {\r\n return extractor(m);\r\n }\r\n }\r\n return [null, null];\r\n}\r\n\r\nfunction simpleParse(...keys) {\r\n return (match, cursor) => {\r\n const ret = {};\r\n let i;\r\n\r\n for (i = 0; i < keys.length; i++) {\r\n ret[keys[i]] = parseInt(match[cursor + i]);\r\n }\r\n return [ret, null, cursor + i];\r\n };\r\n}\r\n\r\n// ISO and SQL parsing\r\nconst offsetRegex = /(?:(Z)|([+-]\\d\\d)(?::?(\\d\\d))?)/,\r\n isoTimeBaseRegex = /(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:[.,](\\d{1,9}))?)?)?/,\r\n isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${offsetRegex.source}?`),\r\n isoTimeExtensionRegex = RegExp(`(?:T${isoTimeRegex.source})?`),\r\n isoYmdRegex = /([+-]\\d{6}|\\d{4})(?:-?(\\d\\d)(?:-?(\\d\\d))?)?/,\r\n isoWeekRegex = /(\\d{4})-?W(\\d\\d)(?:-?(\\d))?/,\r\n isoOrdinalRegex = /(\\d{4})-?(\\d{3})/,\r\n extractISOWeekData = simpleParse(\"weekYear\", \"weekNumber\", \"weekDay\"),\r\n extractISOOrdinalData = simpleParse(\"year\", \"ordinal\"),\r\n sqlYmdRegex = /(\\d{4})-(\\d\\d)-(\\d\\d)/, // dumbed-down version of the ISO one\r\n sqlTimeRegex = RegExp(\r\n `${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|([a-zA-Z_]{1,256}/[a-zA-Z_]{1,256}))?`\r\n ),\r\n sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`);\r\n\r\nfunction extractISOYmd(match, cursor) {\r\n const item = {\r\n year: parseInt(match[cursor]),\r\n month: parseInt(match[cursor + 1]) || 1,\r\n day: parseInt(match[cursor + 2]) || 1\r\n };\r\n\r\n return [item, null, cursor + 3];\r\n}\r\n\r\nfunction extractISOTime(match, cursor) {\r\n const item = {\r\n hour: parseInt(match[cursor]) || 0,\r\n minute: parseInt(match[cursor + 1]) || 0,\r\n second: parseInt(match[cursor + 2]) || 0,\r\n millisecond: parseMillis(match[cursor + 3])\r\n };\r\n\r\n return [item, null, cursor + 4];\r\n}\r\n\r\nfunction extractISOOffset(match, cursor) {\r\n const local = !match[cursor] && !match[cursor + 1],\r\n fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]),\r\n zone = local ? null : FixedOffsetZone.instance(fullOffset);\r\n return [{}, zone, cursor + 3];\r\n}\r\n\r\nfunction extractIANAZone(match, cursor) {\r\n const zone = match[cursor] ? new IANAZone(match[cursor]) : null;\r\n return [{}, zone, cursor + 1];\r\n}\r\n\r\n// ISO duration parsing\r\n\r\nconst isoDuration = /^P(?:(?:(-?\\d{1,9})Y)?(?:(-?\\d{1,9})M)?(?:(-?\\d{1,9})D)?(?:T(?:(-?\\d{1,9})H)?(?:(-?\\d{1,9})M)?(?:(-?\\d{1,9})(?:[.,](-?\\d{1,9}))?S)?)?|(-?\\d{1,9})W)$/;\r\n\r\nfunction extractISODuration(match) {\r\n const [\r\n ,\r\n yearStr,\r\n monthStr,\r\n dayStr,\r\n hourStr,\r\n minuteStr,\r\n secondStr,\r\n millisecondsStr,\r\n weekStr\r\n ] = match;\r\n\r\n return [\r\n {\r\n years: parseInt(yearStr),\r\n months: parseInt(monthStr),\r\n weeks: parseInt(weekStr),\r\n days: parseInt(dayStr),\r\n hours: parseInt(hourStr),\r\n minutes: parseInt(minuteStr),\r\n seconds: parseInt(secondStr),\r\n milliseconds: parseMillis(millisecondsStr)\r\n }\r\n ];\r\n}\r\n\r\n// These are a little braindead. EDT *should* tell us that we're in, say, America/New_York\r\n// and not just that we're in -240 *right now*. But since I don't think these are used that often\r\n// I'm just going to ignore that\r\nconst obsOffsets = {\r\n GMT: 0,\r\n EDT: -4 * 60,\r\n EST: -5 * 60,\r\n CDT: -5 * 60,\r\n CST: -6 * 60,\r\n MDT: -6 * 60,\r\n MST: -7 * 60,\r\n PDT: -7 * 60,\r\n PST: -8 * 60\r\n};\r\n\r\nfunction fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {\r\n const result = {\r\n year: yearStr.length === 2 ? untruncateYear(parseInt(yearStr)) : parseInt(yearStr),\r\n month:\r\n monthStr.length === 2 ? parseInt(monthStr, 10) : English.monthsShort.indexOf(monthStr) + 1,\r\n day: parseInt(dayStr),\r\n hour: parseInt(hourStr),\r\n minute: parseInt(minuteStr)\r\n };\r\n\r\n if (secondStr) result.second = parseInt(secondStr);\r\n if (weekdayStr) {\r\n result.weekday =\r\n weekdayStr.length > 3\r\n ? English.weekdaysLong.indexOf(weekdayStr) + 1\r\n : English.weekdaysShort.indexOf(weekdayStr) + 1;\r\n }\r\n\r\n return result;\r\n}\r\n\r\n// RFC 2822/5322\r\nconst rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\\d\\d)(\\d\\d)))$/;\r\n\r\nfunction extractRFC2822(match) {\r\n const [\r\n ,\r\n weekdayStr,\r\n dayStr,\r\n monthStr,\r\n yearStr,\r\n hourStr,\r\n minuteStr,\r\n secondStr,\r\n obsOffset,\r\n milOffset,\r\n offHourStr,\r\n offMinuteStr\r\n ] = match,\r\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\r\n\r\n let offset;\r\n if (obsOffset) {\r\n offset = obsOffsets[obsOffset];\r\n } else if (milOffset) {\r\n offset = 0;\r\n } else {\r\n offset = signedOffset(offHourStr, offMinuteStr);\r\n }\r\n\r\n return [result, new FixedOffsetZone(offset)];\r\n}\r\n\r\nfunction preprocessRFC2822(s) {\r\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\r\n return s\r\n .replace(/\\([^)]*\\)|[\\n\\t]/g, \" \")\r\n .replace(/(\\s\\s+)/g, \" \")\r\n .trim();\r\n}\r\n\r\n// http date\r\n\r\nconst rfc1123 = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\\d\\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\\d{4}) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\r\n rfc850 = /^(Monday|Tuesday|Wedsday|Thursday|Friday|Saturday|Sunday), (\\d\\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\r\n ascii = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \\d|\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) (\\d{4})$/;\r\n\r\nfunction extractRFC1123Or850(match) {\r\n const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match,\r\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\r\n return [result, FixedOffsetZone.utcInstance];\r\n}\r\n\r\nfunction extractASCII(match) {\r\n const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match,\r\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\r\n return [result, FixedOffsetZone.utcInstance];\r\n}\r\n\r\n/**\r\n * @private\r\n */\r\n\r\nexport function parseISODate(s) {\r\n return parse(\r\n s,\r\n [\r\n combineRegexes(isoYmdRegex, isoTimeExtensionRegex),\r\n combineExtractors(extractISOYmd, extractISOTime, extractISOOffset)\r\n ],\r\n [\r\n combineRegexes(isoWeekRegex, isoTimeExtensionRegex),\r\n combineExtractors(extractISOWeekData, extractISOTime, extractISOOffset)\r\n ],\r\n [\r\n combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex),\r\n combineExtractors(extractISOOrdinalData, extractISOTime)\r\n ],\r\n [combineRegexes(isoTimeRegex), combineExtractors(extractISOTime, extractISOOffset)]\r\n );\r\n}\r\n\r\nexport function parseRFC2822Date(s) {\r\n return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]);\r\n}\r\n\r\nexport function parseHTTPDate(s) {\r\n return parse(\r\n s,\r\n [rfc1123, extractRFC1123Or850],\r\n [rfc850, extractRFC1123Or850],\r\n [ascii, extractASCII]\r\n );\r\n}\r\n\r\nexport function parseISODuration(s) {\r\n return parse(s, [isoDuration, extractISODuration]);\r\n}\r\n\r\nexport function parseSQL(s) {\r\n return parse(\r\n s,\r\n [\r\n combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex),\r\n combineExtractors(extractISOYmd, extractISOTime, extractISOOffset, extractIANAZone)\r\n ],\r\n [\r\n combineRegexes(sqlTimeRegex),\r\n combineExtractors(extractISOTime, extractISOOffset, extractIANAZone)\r\n ]\r\n );\r\n}\r\n","export default class Invalid {\r\n constructor(reason, explanation) {\r\n this.reason = reason;\r\n this.explanation = explanation;\r\n }\r\n\r\n toMessage() {\r\n if (this.explanation) {\r\n return `${this.reason}: ${this.explanation}`;\r\n } else {\r\n return this.reason;\r\n }\r\n }\r\n}\r\n","import { isUndefined, isNumber, normalizeObject } from \"./impl/util\";\r\nimport Locale from \"./impl/locale\";\r\nimport Formatter from \"./impl/formatter\";\r\nimport { parseISODuration } from \"./impl/regexParser\";\r\nimport Settings from \"./settings\";\r\nimport { InvalidArgumentError, InvalidDurationError, InvalidUnitError } from \"./errors\";\r\nimport Invalid from \"./impl/invalid\";\r\n\r\nconst INVALID = \"Invalid Duration\";\r\n\r\n// unit conversion constants\r\nconst lowOrderMatrix = {\r\n weeks: {\r\n days: 7,\r\n hours: 7 * 24,\r\n minutes: 7 * 24 * 60,\r\n seconds: 7 * 24 * 60 * 60,\r\n milliseconds: 7 * 24 * 60 * 60 * 1000\r\n },\r\n days: {\r\n hours: 24,\r\n minutes: 24 * 60,\r\n seconds: 24 * 60 * 60,\r\n milliseconds: 24 * 60 * 60 * 1000\r\n },\r\n hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1000 },\r\n minutes: { seconds: 60, milliseconds: 60 * 1000 },\r\n seconds: { milliseconds: 1000 }\r\n },\r\n casualMatrix = Object.assign(\r\n {\r\n years: {\r\n months: 12,\r\n weeks: 52,\r\n days: 365,\r\n hours: 365 * 24,\r\n minutes: 365 * 24 * 60,\r\n seconds: 365 * 24 * 60 * 60,\r\n milliseconds: 365 * 24 * 60 * 60 * 1000\r\n },\r\n quarters: {\r\n months: 3,\r\n weeks: 13,\r\n days: 91,\r\n hours: 91 * 24,\r\n minutes: 91 * 24 * 60,\r\n milliseconds: 91 * 24 * 60 * 60 * 1000\r\n },\r\n months: {\r\n weeks: 4,\r\n days: 30,\r\n hours: 30 * 24,\r\n minutes: 30 * 24 * 60,\r\n seconds: 30 * 24 * 60 * 60,\r\n milliseconds: 30 * 24 * 60 * 60 * 1000\r\n }\r\n },\r\n lowOrderMatrix\r\n ),\r\n daysInYearAccurate = 146097.0 / 400,\r\n daysInMonthAccurate = 146097.0 / 4800,\r\n accurateMatrix = Object.assign(\r\n {\r\n years: {\r\n months: 12,\r\n weeks: daysInYearAccurate / 7,\r\n days: daysInYearAccurate,\r\n hours: daysInYearAccurate * 24,\r\n minutes: daysInYearAccurate * 24 * 60,\r\n seconds: daysInYearAccurate * 24 * 60 * 60,\r\n milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000\r\n },\r\n quarters: {\r\n months: 3,\r\n weeks: daysInYearAccurate / 28,\r\n days: daysInYearAccurate / 4,\r\n hours: (daysInYearAccurate * 24) / 4,\r\n minutes: (daysInYearAccurate * 24 * 60) / 4,\r\n seconds: (daysInYearAccurate * 24 * 60 * 60) / 4,\r\n milliseconds: (daysInYearAccurate * 24 * 60 * 60 * 1000) / 4\r\n },\r\n months: {\r\n weeks: daysInMonthAccurate / 7,\r\n days: daysInMonthAccurate,\r\n hours: daysInMonthAccurate * 24,\r\n minutes: daysInMonthAccurate * 24 * 60,\r\n seconds: daysInMonthAccurate * 24 * 60 * 60,\r\n milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000\r\n }\r\n },\r\n lowOrderMatrix\r\n );\r\n\r\n// units ordered by size\r\nconst orderedUnits = [\r\n \"years\",\r\n \"quarters\",\r\n \"months\",\r\n \"weeks\",\r\n \"days\",\r\n \"hours\",\r\n \"minutes\",\r\n \"seconds\",\r\n \"milliseconds\"\r\n];\r\n\r\nconst reverseUnits = orderedUnits.slice(0).reverse();\r\n\r\n// clone really means \"create another instance just like this one, but with these changes\"\r\nfunction clone(dur, alts, clear = false) {\r\n // deep merge for vals\r\n const conf = {\r\n values: clear ? alts.values : Object.assign({}, dur.values, alts.values || {}),\r\n loc: dur.loc.clone(alts.loc),\r\n conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy\r\n };\r\n return new Duration(conf);\r\n}\r\n\r\nfunction antiTrunc(n) {\r\n return n < 0 ? Math.floor(n) : Math.ceil(n);\r\n}\r\n\r\n// NB: mutates parameters\r\nfunction convert(matrix, fromMap, fromUnit, toMap, toUnit) {\r\n const conv = matrix[toUnit][fromUnit],\r\n raw = fromMap[fromUnit] / conv,\r\n sameSign = Math.sign(raw) === Math.sign(toMap[toUnit]),\r\n // ok, so this is wild, but see the matrix in the tests\r\n added =\r\n !sameSign && toMap[toUnit] !== 0 && Math.abs(raw) <= 1 ? antiTrunc(raw) : Math.trunc(raw);\r\n toMap[toUnit] += added;\r\n fromMap[fromUnit] -= added * conv;\r\n}\r\n\r\n// NB: mutates parameters\r\nfunction normalizeValues(matrix, vals) {\r\n reverseUnits.reduce((previous, current) => {\r\n if (!isUndefined(vals[current])) {\r\n if (previous) {\r\n convert(matrix, vals, previous, vals, current);\r\n }\r\n return current;\r\n } else {\r\n return previous;\r\n }\r\n }, null);\r\n}\r\n\r\n/**\r\n * A Duration object represents a period of time, like \"2 months\" or \"1 day, 1 hour\". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime.plus} to add a Duration object to a DateTime, producing another DateTime.\r\n *\r\n * Here is a brief overview of commonly used methods and getters in Duration:\r\n *\r\n * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}.\r\n * * **Unit values** See the {@link Duration.years}, {@link Duration.months}, {@link Duration.weeks}, {@link Duration.days}, {@link Duration.hours}, {@link Duration.minutes}, {@link Duration.seconds}, {@link Duration.milliseconds} accessors.\r\n * * **Configuration** See {@link Duration.locale} and {@link Duration.numberingSystem} accessors.\r\n * * **Transformation** To create new Durations out of old ones use {@link Duration.plus}, {@link Duration.minus}, {@link Duration.normalize}, {@link Duration.set}, {@link Duration.reconfigure}, {@link Duration.shiftTo}, and {@link Duration.negate}.\r\n * * **Output** To convert the Duration into other representations, see {@link Duration.as}, {@link Duration.toISO}, {@link Duration.toFormat}, and {@link Duration.toJSON}\r\n *\r\n * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation.\r\n */\r\nexport default class Duration {\r\n /**\r\n * @private\r\n */\r\n constructor(config) {\r\n const accurate = config.conversionAccuracy === \"longterm\" || false;\r\n /**\r\n * @access private\r\n */\r\n this.values = config.values;\r\n /**\r\n * @access private\r\n */\r\n this.loc = config.loc || Locale.create();\r\n /**\r\n * @access private\r\n */\r\n this.conversionAccuracy = accurate ? \"longterm\" : \"casual\";\r\n /**\r\n * @access private\r\n */\r\n this.invalid = config.invalid || null;\r\n /**\r\n * @access private\r\n */\r\n this.matrix = accurate ? accurateMatrix : casualMatrix;\r\n /**\r\n * @access private\r\n */\r\n this.isLuxonDuration = true;\r\n }\r\n\r\n /**\r\n * Create Duration from a number of milliseconds.\r\n * @param {number} count of milliseconds\r\n * @param {Object} opts - options for parsing\r\n * @param {string} [opts.locale='en-US'] - the locale to use\r\n * @param {string} opts.numberingSystem - the numbering system to use\r\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\r\n * @return {Duration}\r\n */\r\n static fromMillis(count, opts) {\r\n return Duration.fromObject(Object.assign({ milliseconds: count }, opts));\r\n }\r\n\r\n /**\r\n * Create a Duration from a Javascript object with keys like 'years' and 'hours.\r\n * If this object is empty then zero milliseconds duration is returned.\r\n * @param {Object} obj - the object to create the DateTime from\r\n * @param {number} obj.years\r\n * @param {number} obj.quarters\r\n * @param {number} obj.months\r\n * @param {number} obj.weeks\r\n * @param {number} obj.days\r\n * @param {number} obj.hours\r\n * @param {number} obj.minutes\r\n * @param {number} obj.seconds\r\n * @param {number} obj.milliseconds\r\n * @param {string} [obj.locale='en-US'] - the locale to use\r\n * @param {string} obj.numberingSystem - the numbering system to use\r\n * @param {string} [obj.conversionAccuracy='casual'] - the conversion system to use\r\n * @return {Duration}\r\n */\r\n static fromObject(obj) {\r\n if (obj == null || typeof obj !== \"object\") {\r\n throw new InvalidArgumentError(\r\n `Duration.fromObject: argument expected to be an object, got ${typeof obj}`\r\n );\r\n }\r\n return new Duration({\r\n values: normalizeObject(obj, Duration.normalizeUnit, true),\r\n loc: Locale.fromObject(obj),\r\n conversionAccuracy: obj.conversionAccuracy\r\n });\r\n }\r\n\r\n /**\r\n * Create a Duration from an ISO 8601 duration string.\r\n * @param {string} text - text to parse\r\n * @param {Object} opts - options for parsing\r\n * @param {string} [opts.locale='en-US'] - the locale to use\r\n * @param {string} opts.numberingSystem - the numbering system to use\r\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\r\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\r\n * @example Duration.fromISO('P3Y6M4DT12H30M5S').toObject() //=> { years: 3, months: 6, day: 4, hours: 12, minutes: 30, seconds: 5 }\r\n * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 }\r\n * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 }\r\n * @return {Duration}\r\n */\r\n static fromISO(text, opts) {\r\n const [parsed] = parseISODuration(text);\r\n if (parsed) {\r\n const obj = Object.assign(parsed, opts);\r\n return Duration.fromObject(obj);\r\n } else {\r\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\r\n }\r\n }\r\n\r\n /**\r\n * Create an invalid Duration.\r\n * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent\r\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\r\n * @return {Duration}\r\n */\r\n static invalid(reason, explanation = null) {\r\n if (!reason) {\r\n throw new InvalidArgumentError(\"need to specify a reason the Duration is invalid\");\r\n }\r\n\r\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\r\n\r\n if (Settings.throwOnInvalid) {\r\n throw new InvalidDurationError(invalid);\r\n } else {\r\n return new Duration({ invalid });\r\n }\r\n }\r\n\r\n /**\r\n * @private\r\n */\r\n static normalizeUnit(unit, ignoreUnknown = false) {\r\n const normalized = {\r\n year: \"years\",\r\n years: \"years\",\r\n quarter: \"quarters\",\r\n quarters: \"quarters\",\r\n month: \"months\",\r\n months: \"months\",\r\n week: \"weeks\",\r\n weeks: \"weeks\",\r\n day: \"days\",\r\n days: \"days\",\r\n hour: \"hours\",\r\n hours: \"hours\",\r\n minute: \"minutes\",\r\n minutes: \"minutes\",\r\n second: \"seconds\",\r\n seconds: \"seconds\",\r\n millisecond: \"milliseconds\",\r\n milliseconds: \"milliseconds\"\r\n }[unit ? unit.toLowerCase() : unit];\r\n\r\n if (!ignoreUnknown && !normalized) throw new InvalidUnitError(unit);\r\n\r\n return normalized;\r\n }\r\n\r\n /**\r\n * Check if an object is a Duration. Works across context boundaries\r\n * @param {object} o\r\n * @return {boolean}\r\n */\r\n static isDuration(o) {\r\n return o.isLuxonDuration;\r\n }\r\n\r\n /**\r\n * Get the locale of a Duration, such 'en-GB'\r\n * @type {string}\r\n */\r\n get locale() {\r\n return this.isValid ? this.loc.locale : null;\r\n }\r\n\r\n /**\r\n * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration\r\n *\r\n * @type {string}\r\n */\r\n get numberingSystem() {\r\n return this.isValid ? this.loc.numberingSystem : null;\r\n }\r\n\r\n /**\r\n * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens:\r\n * * `S` for milliseconds\r\n * * `s` for seconds\r\n * * `m` for minutes\r\n * * `h` for hours\r\n * * `d` for days\r\n * * `M` for months\r\n * * `y` for years\r\n * Notes:\r\n * * Add padding by repeating the token, e.g. \"yy\" pads the years to two digits, \"hhhh\" pads the hours out to four digits\r\n * * The duration will be converted to the set of units in the format string using {@link Duration.shiftTo} and the Durations's conversion accuracy setting.\r\n * @param {string} fmt - the format string\r\n * @param {Object} opts - options\r\n * @param {boolean} [opts.floor=true] - floor numerical values\r\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"y d s\") //=> \"1 6 2\"\r\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"yy dd sss\") //=> \"01 06 002\"\r\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"M S\") //=> \"12 518402000\"\r\n * @return {string}\r\n */\r\n toFormat(fmt, opts = {}) {\r\n // reverse-compat since 1.2; we always round down now, never up, and we do it by default\r\n const fmtOpts = Object.assign({}, opts, {\r\n floor: opts.round !== false && opts.floor !== false\r\n });\r\n return this.isValid\r\n ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt)\r\n : INVALID;\r\n }\r\n\r\n /**\r\n * Returns a Javascript object with this Duration's values.\r\n * @param opts - options for generating the object\r\n * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output\r\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 }\r\n * @return {Object}\r\n */\r\n toObject(opts = {}) {\r\n if (!this.isValid) return {};\r\n\r\n const base = Object.assign({}, this.values);\r\n\r\n if (opts.includeConfig) {\r\n base.conversionAccuracy = this.conversionAccuracy;\r\n base.numberingSystem = this.loc.numberingSystem;\r\n base.locale = this.loc.locale;\r\n }\r\n return base;\r\n }\r\n\r\n /**\r\n * Returns an ISO 8601-compliant string representation of this Duration.\r\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\r\n * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S'\r\n * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S'\r\n * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M'\r\n * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M'\r\n * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S'\r\n * @return {string}\r\n */\r\n toISO() {\r\n // we could use the formatter, but this is an easier way to get the minimum string\r\n if (!this.isValid) return null;\r\n\r\n let s = \"P\";\r\n if (this.years !== 0) s += this.years + \"Y\";\r\n if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + \"M\";\r\n if (this.days !== 0 || this.weeks !== 0) s += this.days + this.weeks * 7 + \"D\";\r\n if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0)\r\n s += \"T\";\r\n if (this.hours !== 0) s += this.hours + \"H\";\r\n if (this.minutes !== 0) s += this.minutes + \"M\";\r\n if (this.seconds !== 0 || this.milliseconds !== 0)\r\n s += this.seconds + this.milliseconds / 1000 + \"S\";\r\n return s;\r\n }\r\n\r\n /**\r\n * Returns an ISO 8601 representation of this Duration appropriate for use in JSON.\r\n * @return {string}\r\n */\r\n toJSON() {\r\n return this.toISO();\r\n }\r\n\r\n /**\r\n * Returns an ISO 8601 representation of this Duration appropriate for use in debugging.\r\n * @return {string}\r\n */\r\n toString() {\r\n return this.toISO();\r\n }\r\n\r\n /**\r\n * Returns an milliseconds value of this Duration.\r\n * @return {number}\r\n */\r\n valueOf() {\r\n return this.as(\"milliseconds\");\r\n }\r\n\r\n /**\r\n * Make this Duration longer by the specified amount. Return a newly-constructed Duration.\r\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\r\n * @return {Duration}\r\n */\r\n plus(duration) {\r\n if (!this.isValid) return this;\r\n\r\n const dur = friendlyDuration(duration),\r\n result = {};\r\n\r\n for (const k of orderedUnits) {\r\n if (dur.values.hasOwnProperty(k) || this.values.hasOwnProperty(k)) {\r\n result[k] = dur.get(k) + this.get(k);\r\n }\r\n }\r\n\r\n return clone(this, { values: result }, true);\r\n }\r\n\r\n /**\r\n * Make this Duration shorter by the specified amount. Return a newly-constructed Duration.\r\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\r\n * @return {Duration}\r\n */\r\n minus(duration) {\r\n if (!this.isValid) return this;\r\n\r\n const dur = friendlyDuration(duration);\r\n return this.plus(dur.negate());\r\n }\r\n\r\n /**\r\n * Get the value of unit.\r\n * @param {string} unit - a unit such as 'minute' or 'day'\r\n * @example Duration.fromObject({years: 2, days: 3}).years //=> 2\r\n * @example Duration.fromObject({years: 2, days: 3}).months //=> 0\r\n * @example Duration.fromObject({years: 2, days: 3}).days //=> 3\r\n * @return {number}\r\n */\r\n get(unit) {\r\n return this[Duration.normalizeUnit(unit)];\r\n }\r\n\r\n /**\r\n * \"Set\" the values of specified units. Return a newly-constructed Duration.\r\n * @param {Object} values - a mapping of units to numbers\r\n * @example dur.set({ years: 2017 })\r\n * @example dur.set({ hours: 8, minutes: 30 })\r\n * @return {Duration}\r\n */\r\n set(values) {\r\n const mixed = Object.assign(this.values, normalizeObject(values, Duration.normalizeUnit));\r\n return clone(this, { values: mixed });\r\n }\r\n\r\n /**\r\n * \"Set\" the locale and/or numberingSystem. Returns a newly-constructed Duration.\r\n * @example dur.reconfigure({ locale: 'en-GB' })\r\n * @return {Duration}\r\n */\r\n reconfigure({ locale, numberingSystem, conversionAccuracy } = {}) {\r\n const loc = this.loc.clone({ locale, numberingSystem }),\r\n opts = { loc };\r\n\r\n if (conversionAccuracy) {\r\n opts.conversionAccuracy = conversionAccuracy;\r\n }\r\n\r\n return clone(this, opts);\r\n }\r\n\r\n /**\r\n * Return the length of the duration in the specified unit.\r\n * @param {string} unit - a unit such as 'minutes' or 'days'\r\n * @example Duration.fromObject({years: 1}).as('days') //=> 365\r\n * @example Duration.fromObject({years: 1}).as('months') //=> 12\r\n * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5\r\n * @return {number}\r\n */\r\n as(unit) {\r\n return this.isValid ? this.shiftTo(unit).get(unit) : NaN;\r\n }\r\n\r\n /**\r\n * Reduce this Duration to its canonical representation in its current units.\r\n * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 }\r\n * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 }\r\n * @return {Duration}\r\n */\r\n normalize() {\r\n if (!this.isValid) return this;\r\n const vals = this.toObject();\r\n normalizeValues(this.matrix, vals);\r\n return Duration.fromObject(vals);\r\n }\r\n\r\n /**\r\n * Convert this Duration into its representation in a different set of units.\r\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 }\r\n * @return {Duration}\r\n */\r\n shiftTo(...units) {\r\n if (!this.isValid) return this;\r\n\r\n if (units.length === 0) {\r\n return this;\r\n }\r\n\r\n units = units.map(u => Duration.normalizeUnit(u));\r\n\r\n const built = {},\r\n accumulated = {},\r\n vals = this.toObject();\r\n let lastUnit;\r\n\r\n normalizeValues(this.matrix, vals);\r\n\r\n for (const k of orderedUnits) {\r\n if (units.indexOf(k) >= 0) {\r\n lastUnit = k;\r\n\r\n let own = 0;\r\n\r\n // anything we haven't boiled down yet should get boiled to this unit\r\n for (const ak in accumulated) {\r\n if (accumulated.hasOwnProperty(ak)) {\r\n own += this.matrix[ak][k] * accumulated[ak];\r\n accumulated[ak] = 0;\r\n }\r\n }\r\n\r\n // plus anything that's already in this unit\r\n if (isNumber(vals[k])) {\r\n own += vals[k];\r\n }\r\n\r\n const i = Math.trunc(own);\r\n built[k] = i;\r\n accumulated[k] = own - i; // we'd like to absorb these fractions in another unit\r\n\r\n // plus anything further down the chain that should be rolled up in to this\r\n for (const down in vals) {\r\n if (orderedUnits.indexOf(down) > orderedUnits.indexOf(k)) {\r\n convert(this.matrix, vals, down, built, k);\r\n }\r\n }\r\n // otherwise, keep it in the wings to boil it later\r\n } else if (isNumber(vals[k])) {\r\n accumulated[k] = vals[k];\r\n }\r\n }\r\n\r\n // anything leftover becomes the decimal for the last unit\r\n if (lastUnit) {\r\n for (const key in accumulated) {\r\n if (accumulated.hasOwnProperty(key)) {\r\n if (accumulated[key] !== 0) {\r\n built[lastUnit] +=\r\n key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key];\r\n }\r\n }\r\n }\r\n }\r\n\r\n return clone(this, { values: built }, true);\r\n }\r\n\r\n /**\r\n * Return the negative of this Duration.\r\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 }\r\n * @return {Duration}\r\n */\r\n negate() {\r\n if (!this.isValid) return this;\r\n const negated = {};\r\n for (const k of Object.keys(this.values)) {\r\n negated[k] = -this.values[k];\r\n }\r\n return clone(this, { values: negated }, true);\r\n }\r\n\r\n /**\r\n * Get the years.\r\n * @type {number}\r\n */\r\n get years() {\r\n return this.isValid ? this.values.years || 0 : NaN;\r\n }\r\n\r\n /**\r\n * Get the quarters.\r\n * @type {number}\r\n */\r\n get quarters() {\r\n return this.isValid ? this.values.quarters || 0 : NaN;\r\n }\r\n\r\n /**\r\n * Get the months.\r\n * @type {number}\r\n */\r\n get months() {\r\n return this.isValid ? this.values.months || 0 : NaN;\r\n }\r\n\r\n /**\r\n * Get the weeks\r\n * @type {number}\r\n */\r\n get weeks() {\r\n return this.isValid ? this.values.weeks || 0 : NaN;\r\n }\r\n\r\n /**\r\n * Get the days.\r\n * @type {number}\r\n */\r\n get days() {\r\n return this.isValid ? this.values.days || 0 : NaN;\r\n }\r\n\r\n /**\r\n * Get the hours.\r\n * @type {number}\r\n */\r\n get hours() {\r\n return this.isValid ? this.values.hours || 0 : NaN;\r\n }\r\n\r\n /**\r\n * Get the minutes.\r\n * @type {number}\r\n */\r\n get minutes() {\r\n return this.isValid ? this.values.minutes || 0 : NaN;\r\n }\r\n\r\n /**\r\n * Get the seconds.\r\n * @return {number}\r\n */\r\n get seconds() {\r\n return this.isValid ? this.values.seconds || 0 : NaN;\r\n }\r\n\r\n /**\r\n * Get the milliseconds.\r\n * @return {number}\r\n */\r\n get milliseconds() {\r\n return this.isValid ? this.values.milliseconds || 0 : NaN;\r\n }\r\n\r\n /**\r\n * Returns whether the Duration is invalid. Invalid durations are returned by diff operations\r\n * on invalid DateTimes or Intervals.\r\n * @return {boolean}\r\n */\r\n get isValid() {\r\n return this.invalid === null;\r\n }\r\n\r\n /**\r\n * Returns an error code if this Duration became invalid, or null if the Duration is valid\r\n * @return {string}\r\n */\r\n get invalidReason() {\r\n return this.invalid ? this.invalid.reason : null;\r\n }\r\n\r\n /**\r\n * Returns an explanation of why this Duration became invalid, or null if the Duration is valid\r\n * @type {string}\r\n */\r\n get invalidExplanation() {\r\n return this.invalid ? this.invalid.explanation : null;\r\n }\r\n\r\n /**\r\n * Equality check\r\n * Two Durations are equal iff they have the same units and the same values for each unit.\r\n * @param {Duration} other\r\n * @return {boolean}\r\n */\r\n equals(other) {\r\n if (!this.isValid || !other.isValid) {\r\n return false;\r\n }\r\n\r\n if (!this.loc.equals(other.loc)) {\r\n return false;\r\n }\r\n\r\n for (const u of orderedUnits) {\r\n if (this.values[u] !== other.values[u]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n}\r\n\r\n/**\r\n * @private\r\n */\r\nexport function friendlyDuration(durationish) {\r\n if (isNumber(durationish)) {\r\n return Duration.fromMillis(durationish);\r\n } else if (Duration.isDuration(durationish)) {\r\n return durationish;\r\n } else if (typeof durationish === \"object\") {\r\n return Duration.fromObject(durationish);\r\n } else {\r\n throw new InvalidArgumentError(\r\n `Unknown duration argument ${durationish} of type ${typeof durationish}`\r\n );\r\n }\r\n}\r\n","import DateTime, { friendlyDateTime } from \"./datetime\";\r\nimport Duration, { friendlyDuration } from \"./duration\";\r\nimport Settings from \"./settings\";\r\nimport { InvalidArgumentError, InvalidIntervalError } from \"./errors\";\r\nimport Invalid from \"./impl/invalid\";\r\n\r\nconst INVALID = \"Invalid Interval\";\r\n\r\n// checks if the start is equal to or before the end\r\nfunction validateStartEnd(start, end) {\r\n if (!start || !start.isValid) {\r\n return new Invalid(\"missing or invalid start\");\r\n } else if (!end || !end.isValid) {\r\n return new Invalid(\"missing or invalid end\");\r\n } else if (end < start) {\r\n return new Invalid(\r\n \"end before start\",\r\n `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`\r\n );\r\n } else {\r\n return null;\r\n }\r\n}\r\n\r\n/**\r\n * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them.\r\n *\r\n * Here is a brief overview of the most commonly used methods and getters in Interval:\r\n *\r\n * * **Creation** To create an Interval, use {@link fromDateTimes}, {@link after}, {@link before}, or {@link fromISO}.\r\n * * **Accessors** Use {@link start} and {@link end} to get the start and end.\r\n * * **Interrogation** To analyze the Interval, use {@link count}, {@link length}, {@link hasSame}, {@link contains}, {@link isAfter}, or {@link isBefore}.\r\n * * **Transformation** To create other Intervals out of this one, use {@link set}, {@link splitAt}, {@link splitBy}, {@link divideEqually}, {@link merge}, {@link xor}, {@link union}, {@link intersection}, or {@link difference}.\r\n * * **Comparison** To compare this Interval to another one, use {@link equals}, {@link overlaps}, {@link abutsStart}, {@link abutsEnd}, {@link engulfs}\r\n * * **Output*** To convert the Interval into other representations, see {@link toString}, {@link toISO}, {@link toFormat}, and {@link toDuration}.\r\n */\r\nexport default class Interval {\r\n /**\r\n * @private\r\n */\r\n constructor(config) {\r\n /**\r\n * @access private\r\n */\r\n this.s = config.start;\r\n /**\r\n * @access private\r\n */\r\n this.e = config.end;\r\n /**\r\n * @access private\r\n */\r\n this.invalid = config.invalid || null;\r\n /**\r\n * @access private\r\n */\r\n this.isLuxonInterval = true;\r\n }\r\n\r\n /**\r\n * Create an invalid Interval.\r\n * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent\r\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\r\n * @return {Interval}\r\n */\r\n static invalid(reason, explanation = null) {\r\n if (!reason) {\r\n throw new InvalidArgumentError(\"need to specify a reason the Interval is invalid\");\r\n }\r\n\r\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\r\n\r\n if (Settings.throwOnInvalid) {\r\n throw new InvalidIntervalError(invalid);\r\n } else {\r\n return new Interval({ invalid });\r\n }\r\n }\r\n\r\n /**\r\n * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.\r\n * @param {DateTime|Date|Object} start\r\n * @param {DateTime|Date|Object} end\r\n * @return {Interval}\r\n */\r\n static fromDateTimes(start, end) {\r\n const builtStart = friendlyDateTime(start),\r\n builtEnd = friendlyDateTime(end);\r\n\r\n return new Interval({\r\n start: builtStart,\r\n end: builtEnd,\r\n invalid: validateStartEnd(builtStart, builtEnd)\r\n });\r\n }\r\n\r\n /**\r\n * Create an Interval from a start DateTime and a Duration to extend to.\r\n * @param {DateTime|Date|Object} start\r\n * @param {Duration|Object|number} duration - the length of the Interval.\r\n * @return {Interval}\r\n */\r\n static after(start, duration) {\r\n const dur = friendlyDuration(duration),\r\n dt = friendlyDateTime(start);\r\n return Interval.fromDateTimes(dt, dt.plus(dur));\r\n }\r\n\r\n /**\r\n * Create an Interval from an end DateTime and a Duration to extend backwards to.\r\n * @param {DateTime|Date|Object} end\r\n * @param {Duration|Object|number} duration - the length of the Interval.\r\n * @return {Interval}\r\n */\r\n static before(end, duration) {\r\n const dur = friendlyDuration(duration),\r\n dt = friendlyDateTime(end);\r\n return Interval.fromDateTimes(dt.minus(dur), dt);\r\n }\r\n\r\n /**\r\n * Create an Interval from an ISO 8601 string.\r\n * Accepts `<start>/<end>`, `<start>/<duration>`, and `<duration>/<end>` formats.\r\n * @param {string} text - the ISO string to parse\r\n * @param {Object} [opts] - options to pass {@link DateTime.fromISO} and optionally {@link Duration.fromISO}\r\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\r\n * @return {Interval}\r\n */\r\n static fromISO(text, opts) {\r\n const [s, e] = (text || \"\").split(\"/\", 2);\r\n if (s && e) {\r\n const start = DateTime.fromISO(s, opts),\r\n end = DateTime.fromISO(e, opts);\r\n\r\n if (start.isValid && end.isValid) {\r\n return Interval.fromDateTimes(start, end);\r\n }\r\n\r\n if (start.isValid) {\r\n const dur = Duration.fromISO(e, opts);\r\n if (dur.isValid) {\r\n return Interval.after(start, dur);\r\n }\r\n } else if (end.isValid) {\r\n const dur = Duration.fromISO(s, opts);\r\n if (dur.isValid) {\r\n return Interval.before(end, dur);\r\n }\r\n }\r\n }\r\n return Interval.invalid(\"unparsable\", `the input \"${text}\" can't be parsed asISO 8601`);\r\n }\r\n\r\n /**\r\n * Check if an object is an Interval. Works across context boundaries\r\n * @param {object} o\r\n * @return {boolean}\r\n */\r\n static isInterval(o) {\r\n return o instanceof Interval || o.isLuxonInterval;\r\n }\r\n\r\n /**\r\n * Returns the start of the Interval\r\n * @type {DateTime}\r\n */\r\n get start() {\r\n return this.isValid ? this.s : null;\r\n }\r\n\r\n /**\r\n * Returns the end of the Interval\r\n * @type {DateTime}\r\n */\r\n get end() {\r\n return this.isValid ? this.e : null;\r\n }\r\n\r\n /**\r\n * Returns whether this Interval's end is at least its start, i.e. that the Interval isn't 'backwards'.\r\n * @type {boolean}\r\n */\r\n get isValid() {\r\n return this.invalidReason === null;\r\n }\r\n\r\n /**\r\n * Returns an error code if this Interval is invalid, or null if the Interval is valid\r\n * @type {string}\r\n */\r\n get invalidReason() {\r\n return this.invalid ? this.invalid.reason : null;\r\n }\r\n\r\n /**\r\n * Returns an explanation of why this Interval became invalid, or null if the Interval is valid\r\n * @type {string}\r\n */\r\n get invalidExplanation() {\r\n return this.invalid ? this.invalid.explanation : null;\r\n }\r\n\r\n /**\r\n * Returns the length of the Interval in the specified unit.\r\n * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in.\r\n * @return {number}\r\n */\r\n length(unit = \"milliseconds\") {\r\n return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN;\r\n }\r\n\r\n /**\r\n * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part.\r\n * Unlike {@link length} this counts sections of the calendar, not periods of time, e.g. specifying 'day'\r\n * asks 'what dates are included in this interval?', not 'how many days long is this interval?'\r\n * @param {string} [unit='milliseconds'] - the unit of time to count.\r\n * @return {number}\r\n */\r\n count(unit = \"milliseconds\") {\r\n if (!this.isValid) return NaN;\r\n const start = this.start.startOf(unit),\r\n end = this.end.startOf(unit);\r\n return Math.floor(end.diff(start, unit).get(unit)) + 1;\r\n }\r\n\r\n /**\r\n * Returns whether this Interval's start and end are both in the same unit of time\r\n * @param {string} unit - the unit of time to check sameness on\r\n * @return {boolean}\r\n */\r\n hasSame(unit) {\r\n return this.isValid ? this.e.minus(1).hasSame(this.s, unit) : false;\r\n }\r\n\r\n /**\r\n * Return whether this Interval has the same start and end DateTimes.\r\n * @return {boolean}\r\n */\r\n isEmpty() {\r\n return this.s.valueOf() === this.e.valueOf();\r\n }\r\n\r\n /**\r\n * Return whether this Interval's start is after the specified DateTime.\r\n * @param {DateTime} dateTime\r\n * @return {boolean}\r\n */\r\n isAfter(dateTime) {\r\n if (!this.isValid) return false;\r\n return this.s > dateTime;\r\n }\r\n\r\n /**\r\n * Return whether this Interval's end is before the specified DateTime.\r\n * @param {DateTime} dateTime\r\n * @return {boolean}\r\n */\r\n isBefore(dateTime) {\r\n if (!this.isValid) return false;\r\n return this.e <= dateTime;\r\n }\r\n\r\n /**\r\n * Return whether this Interval contains the specified DateTime.\r\n * @param {DateTime} dateTime\r\n * @return {boolean}\r\n */\r\n contains(dateTime) {\r\n if (!this.isValid) return false;\r\n return this.s <= dateTime && this.e > dateTime;\r\n }\r\n\r\n /**\r\n * \"Sets\" the start and/or end dates. Returns a newly-constructed Interval.\r\n * @param {Object} values - the values to set\r\n * @param {DateTime} values.start - the starting DateTime\r\n * @param {DateTime} values.end - the ending DateTime\r\n * @return {Interval}\r\n */\r\n set({ start, end } = {}) {\r\n if (!this.isValid) return this;\r\n return Interval.fromDateTimes(start || this.s, end || this.e);\r\n }\r\n\r\n /**\r\n * Split this Interval at each of the specified DateTimes\r\n * @param {...[DateTime]} dateTimes - the unit of time to count.\r\n * @return {[Interval]}\r\n */\r\n splitAt(...dateTimes) {\r\n if (!this.isValid) return [];\r\n const sorted = dateTimes.map(friendlyDateTime).sort(),\r\n results = [];\r\n let { s } = this,\r\n i = 0;\r\n\r\n while (s < this.e) {\r\n const added = sorted[i] || this.e,\r\n next = +added > +this.e ? this.e : added;\r\n results.push(Interval.fromDateTimes(s, next));\r\n s = next;\r\n i += 1;\r\n }\r\n\r\n return results;\r\n }\r\n\r\n /**\r\n * Split this Interval into smaller Intervals, each of the specified length.\r\n * Left over time is grouped into a smaller interval\r\n * @param {Duration|Object|number} duration - The length of each resulting interval.\r\n * @return {[Interval]}\r\n */\r\n splitBy(duration) {\r\n const dur = friendlyDuration(duration);\r\n\r\n if (!this.isValid || !dur.isValid || dur.as(\"milliseconds\") === 0) {\r\n return [];\r\n }\r\n\r\n let { s } = this,\r\n added,\r\n next;\r\n\r\n const results = [];\r\n while (s < this.e) {\r\n added = s.plus(dur);\r\n next = +added > +this.e ? this.e : added;\r\n results.push(Interval.fromDateTimes(s, next));\r\n s = next;\r\n }\r\n\r\n return results;\r\n }\r\n\r\n /**\r\n * Split this Interval into the specified number of smaller intervals.\r\n * @param {number} numberOfParts - The number of Intervals to divide the Interval into.\r\n * @return {[Interval]}\r\n */\r\n divideEqually(numberOfParts) {\r\n if (!this.isValid) return [];\r\n return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);\r\n }\r\n\r\n /**\r\n * Return whether this Interval overlaps with the specified Interval\r\n * @param {Interval} other\r\n * @return {boolean}\r\n */\r\n overlaps(other) {\r\n return this.e > other.s && this.s < other.e;\r\n }\r\n\r\n /**\r\n * Return whether this Interval's end is adjacent to the specified Interval's start.\r\n * @param {Interval} other\r\n * @return {boolean}\r\n */\r\n abutsStart(other) {\r\n if (!this.isValid) return false;\r\n return +this.e === +other.s;\r\n }\r\n\r\n /**\r\n * Return whether this Interval's start is adjacent to the specified Interval's end.\r\n * @param {Interval} other\r\n * @return {boolean}\r\n */\r\n abutsEnd(other) {\r\n if (!this.isValid) return false;\r\n return +other.e === +this.s;\r\n }\r\n\r\n /**\r\n * Return whether this Interval engulfs the start and end of the specified Interval.\r\n * @param {Interval} other\r\n * @return {boolean}\r\n */\r\n engulfs(other) {\r\n if (!this.isValid) return false;\r\n return this.s <= other.s && this.e >= other.e;\r\n }\r\n\r\n /**\r\n * Return whether this Interval has the same start and end as the specified Interval.\r\n * @param {Interval} other\r\n * @return {boolean}\r\n */\r\n equals(other) {\r\n if (!this.isValid || !other.isValid) {\r\n return false;\r\n }\r\n\r\n return this.s.equals(other.s) && this.e.equals(other.e);\r\n }\r\n\r\n /**\r\n * Return an Interval representing the intersection of this Interval and the specified Interval.\r\n * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals.\r\n * Returns null if the intersection is empty, i.e., the intervals don't intersect.\r\n * @param {Interval} other\r\n * @return {Interval}\r\n */\r\n intersection(other) {\r\n if (!this.isValid) return this;\r\n const s = this.s > other.s ? this.s : other.s,\r\n e = this.e < other.e ? this.e : other.e;\r\n\r\n if (s > e) {\r\n return null;\r\n } else {\r\n return Interval.fromDateTimes(s, e);\r\n }\r\n }\r\n\r\n /**\r\n * Return an Interval representing the union of this Interval and the specified Interval.\r\n * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals.\r\n * @param {Interval} other\r\n * @return {Interval}\r\n */\r\n union(other) {\r\n if (!this.isValid) return this;\r\n const s = this.s < other.s ? this.s : other.s,\r\n e = this.e > other.e ? this.e : other.e;\r\n return Interval.fromDateTimes(s, e);\r\n }\r\n\r\n /**\r\n * Merge an array of Intervals into a equivalent minimal set of Intervals.\r\n * Combines overlapping and adjacent Intervals.\r\n * @param {[Interval]} intervals\r\n * @return {[Interval]}\r\n */\r\n static merge(intervals) {\r\n const [found, final] = intervals.sort((a, b) => a.s - b.s).reduce(\r\n ([sofar, current], item) => {\r\n if (!current) {\r\n return [sofar, item];\r\n } else if (current.overlaps(item) || current.abutsStart(item)) {\r\n return [sofar, current.union(item)];\r\n } else {\r\n return [sofar.concat([current]), item];\r\n }\r\n },\r\n [[], null]\r\n );\r\n if (final) {\r\n found.push(final);\r\n }\r\n return found;\r\n }\r\n\r\n /**\r\n * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals.\r\n * @param {[Interval]} intervals\r\n * @return {[Interval]}\r\n */\r\n static xor(intervals) {\r\n let start = null,\r\n currentCount = 0;\r\n const results = [],\r\n ends = intervals.map(i => [{ time: i.s, type: \"s\" }, { time: i.e, type: \"e\" }]),\r\n flattened = Array.prototype.concat(...ends),\r\n arr = flattened.sort((a, b) => a.time - b.time);\r\n\r\n for (const i of arr) {\r\n currentCount += i.type === \"s\" ? 1 : -1;\r\n\r\n if (currentCount === 1) {\r\n start = i.time;\r\n } else {\r\n if (start && +start !== +i.time) {\r\n results.push(Interval.fromDateTimes(start, i.time));\r\n }\r\n\r\n start = null;\r\n }\r\n }\r\n\r\n return Interval.merge(results);\r\n }\r\n\r\n /**\r\n * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals.\r\n * @param {...Interval} intervals\r\n * @return {[Interval]}\r\n */\r\n difference(...intervals) {\r\n return Interval.xor([this].concat(intervals))\r\n .map(i => this.intersection(i))\r\n .filter(i => i && !i.isEmpty());\r\n }\r\n\r\n /**\r\n * Returns a string representation of this Interval appropriate for debugging.\r\n * @return {string}\r\n */\r\n toString() {\r\n if (!this.isValid) return INVALID;\r\n return `[${this.s.toISO()} ${this.e.toISO()})`;\r\n }\r\n\r\n /**\r\n * Returns an ISO 8601-compliant string representation of this Interval.\r\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\r\n * @param {Object} opts - The same options as {@link DateTime.toISO}\r\n * @return {string}\r\n */\r\n toISO(opts) {\r\n if (!this.isValid) return INVALID;\r\n return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;\r\n }\r\n\r\n /**\r\n * Returns a string representation of this Interval formatted according to the specified format string.\r\n * @param {string} dateFormat - the format string. This string formats the start and end time. See {@link DateTime.toFormat} for details.\r\n * @param {Object} opts - options\r\n * @param {string} [opts.separator = ' '] - a separator to place between the start and end representations\r\n * @return {string}\r\n */\r\n toFormat(dateFormat, { separator = \" \" } = {}) {\r\n if (!this.isValid) return INVALID;\r\n return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;\r\n }\r\n\r\n /**\r\n * Return a Duration representing the time spanned by this interval.\r\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration.\r\n * @param {Object} opts - options that affect the creation of the Duration\r\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\r\n * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 }\r\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 }\r\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 }\r\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 }\r\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 }\r\n * @return {Duration}\r\n */\r\n toDuration(unit, opts) {\r\n if (!this.isValid) {\r\n return Duration.invalid(this.invalidReason);\r\n }\r\n return this.e.diff(this.s, unit, opts);\r\n }\r\n}\r\n","import DateTime from \"./datetime\";\r\nimport Settings from \"./settings\";\r\nimport Locale from \"./impl/locale\";\r\nimport IANAZone from \"./zones/IANAZone\";\r\n\r\nimport { hasFormatToParts, hasIntl } from \"./impl/util\";\r\n\r\n/**\r\n * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment.\r\n */\r\nexport default class Info {\r\n /**\r\n * Return whether the specified zone contains a DST.\r\n * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone.\r\n * @return {boolean}\r\n */\r\n static hasDST(zone = Settings.defaultZone) {\r\n const proto = DateTime.local()\r\n .setZone(zone)\r\n .set({ month: 12 });\r\n\r\n return !zone.universal && proto.offset !== proto.set({ month: 6 }).offset;\r\n }\r\n\r\n /**\r\n * Return whether the specified zone is a valid IANA specifier.\r\n * @param {string} zone - Zone to check\r\n * @return {boolean}\r\n */\r\n static isValidIANAZone(zone) {\r\n return !!IANAZone.isValidSpecifier(zone) && IANAZone.isValidZone(zone);\r\n }\r\n\r\n /**\r\n * Return an array of standalone month names.\r\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\r\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\r\n * @param {Object} opts - options\r\n * @param {string} [opts.locale] - the locale code\r\n * @param {string} [opts.numberingSystem=null] - the numbering system\r\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\r\n * @example Info.months()[0] //=> 'January'\r\n * @example Info.months('short')[0] //=> 'Jan'\r\n * @example Info.months('numeric')[0] //=> '1'\r\n * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.'\r\n * @example Info.months('numeric', { locale: 'ar' })[0] //=> '١'\r\n * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I'\r\n * @return {[string]}\r\n */\r\n static months(\r\n length = \"long\",\r\n { locale = null, numberingSystem = null, outputCalendar = \"gregory\" } = {}\r\n ) {\r\n return Locale.create(locale, numberingSystem, outputCalendar).months(length);\r\n }\r\n\r\n /**\r\n * Return an array of format month names.\r\n * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that\r\n * changes the string.\r\n * See {@link months}\r\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\r\n * @param {Object} opts - options\r\n * @param {string} [opts.locale] - the locale code\r\n * @param {string} [opts.numberingSystem=null] - the numbering system\r\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\r\n * @return {[string]}\r\n */\r\n static monthsFormat(\r\n length = \"long\",\r\n { locale = null, numberingSystem = null, outputCalendar = \"gregory\" } = {}\r\n ) {\r\n return Locale.create(locale, numberingSystem, outputCalendar).months(length, true);\r\n }\r\n\r\n /**\r\n * Return an array of standalone week names.\r\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\r\n * @param {string} [length='long'] - the length of the month representation, such as \"narrow\", \"short\", \"long\".\r\n * @param {Object} opts - options\r\n * @param {string} [opts.locale] - the locale code\r\n * @param {string} [opts.numberingSystem=null] - the numbering system\r\n * @example Info.weekdays()[0] //=> 'Monday'\r\n * @example Info.weekdays('short')[0] //=> 'Mon'\r\n * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.'\r\n * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين'\r\n * @return {[string]}\r\n */\r\n static weekdays(length = \"long\", { locale = null, numberingSystem = null } = {}) {\r\n return Locale.create(locale, numberingSystem, null).weekdays(length);\r\n }\r\n\r\n /**\r\n * Return an array of format week names.\r\n * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that\r\n * changes the string.\r\n * See {@link weekdays}\r\n * @param {string} [length='long'] - the length of the month representation, such as \"narrow\", \"short\", \"long\".\r\n * @param {Object} opts - options\r\n * @param {string} [opts.locale=null] - the locale code\r\n * @param {string} [opts.numberingSystem=null] - the numbering system\r\n * @return {[string]}\r\n */\r\n static weekdaysFormat(length = \"long\", { locale = null, numberingSystem = null } = {}) {\r\n return Locale.create(locale, numberingSystem, null).weekdays(length, true);\r\n }\r\n\r\n /**\r\n * Return an array of meridiems.\r\n * @param {Object} opts - options\r\n * @param {string} [opts.locale] - the locale code\r\n * @example Info.meridiems() //=> [ 'AM', 'PM' ]\r\n * @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ]\r\n * @return {[string]}\r\n */\r\n static meridiems({ locale = null } = {}) {\r\n return Locale.create(locale).meridiems();\r\n }\r\n\r\n /**\r\n * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian.\r\n * @param {string} [length='short'] - the length of the era representation, such as \"short\" or \"long\".\r\n * @param {Object} opts - options\r\n * @param {string} [opts.locale] - the locale code\r\n * @example Info.eras() //=> [ 'BC', 'AD' ]\r\n * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ]\r\n * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ]\r\n * @return {[string]}\r\n */\r\n static eras(length = \"short\", { locale = null } = {}) {\r\n return Locale.create(locale, null, \"gregory\").eras(length);\r\n }\r\n\r\n /**\r\n * Return the set of available features in this environment.\r\n * Some features of Luxon are not available in all environments. For example, on older browsers, timezone support is not available. Use this function to figure out if that's the case.\r\n * Keys:\r\n * * `zones`: whether this environment supports IANA timezones\r\n * * `intlTokens`: whether this environment supports internationalized token-based formatting/parsing\r\n * * `intl`: whether this environment supports general internationalization\r\n * @example Info.features() //=> { intl: true, intlTokens: false, zones: true }\r\n * @return {Object}\r\n */\r\n static features() {\r\n let intl = false,\r\n intlTokens = false,\r\n zones = false;\r\n\r\n if (hasIntl()) {\r\n intl = true;\r\n intlTokens = hasFormatToParts();\r\n\r\n try {\r\n zones =\r\n new Intl.DateTimeFormat(\"en\", { timeZone: \"America/New_York\" }).resolvedOptions()\r\n .timeZone === \"America/New_York\";\r\n } catch (e) {\r\n zones = false;\r\n }\r\n }\r\n\r\n return { intl, intlTokens, zones };\r\n }\r\n}\r\n","import Duration from \"../duration\";\r\n\r\nfunction dayDiff(earlier, later) {\r\n const utcDayStart = dt =>\r\n dt\r\n .toUTC(0, { keepLocalTime: true })\r\n .startOf(\"day\")\r\n .valueOf(),\r\n ms = utcDayStart(later) - utcDayStart(earlier);\r\n return Math.floor(Duration.fromMillis(ms).as(\"days\"));\r\n}\r\n\r\nfunction highOrderDiffs(cursor, later, units) {\r\n const differs = [\r\n [\"years\", (a, b) => b.year - a.year],\r\n [\"months\", (a, b) => b.month - a.month + (b.year - a.year) * 12],\r\n [\r\n \"weeks\",\r\n (a, b) => {\r\n const days = dayDiff(a, b);\r\n return (days - (days % 7)) / 7;\r\n }\r\n ],\r\n [\"days\", dayDiff]\r\n ];\r\n\r\n const results = {};\r\n let lowestOrder, highWater;\r\n\r\n for (const [unit, differ] of differs) {\r\n if (units.indexOf(unit) >= 0) {\r\n lowestOrder = unit;\r\n\r\n let delta = differ(cursor, later);\r\n\r\n highWater = cursor.plus({ [unit]: delta });\r\n\r\n if (highWater > later) {\r\n cursor = highWater.minus({ [unit]: 1 });\r\n delta -= 1;\r\n } else {\r\n cursor = highWater;\r\n }\r\n\r\n results[unit] = delta;\r\n }\r\n }\r\n\r\n return [cursor, results, highWater, lowestOrder];\r\n}\r\n\r\nexport default function(earlier, later, units, opts) {\r\n let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units);\r\n\r\n const remainingMillis = later - cursor;\r\n\r\n const lowerOrderUnits = units.filter(\r\n u => [\"hours\", \"minutes\", \"seconds\", \"milliseconds\"].indexOf(u) >= 0\r\n );\r\n\r\n if (lowerOrderUnits.length === 0) {\r\n if (highWater < later) {\r\n highWater = cursor.plus({ [lowestOrder]: 1 });\r\n }\r\n\r\n if (highWater !== cursor) {\r\n results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);\r\n }\r\n }\r\n\r\n const duration = Duration.fromObject(Object.assign(results, opts));\r\n\r\n if (lowerOrderUnits.length > 0) {\r\n return Duration.fromMillis(remainingMillis, opts)\r\n .shiftTo(...lowerOrderUnits)\r\n .plus(duration);\r\n } else {\r\n return duration;\r\n }\r\n}\r\n","import { parseMillis, isUndefined, untruncateYear, signedOffset } from \"./util\";\r\nimport Formatter from \"./formatter\";\r\nimport FixedOffsetZone from \"../zones/fixedOffsetZone\";\r\nimport IANAZone from \"../zones/IANAZone\";\r\n\r\nconst MISSING_FTP = \"missing Intl.DateTimeFormat.formatToParts support\";\r\n\r\nfunction intUnit(regex, post = i => i) {\r\n return { regex, deser: ([s]) => post(parseInt(s)) };\r\n}\r\n\r\nfunction fixListRegex(s) {\r\n // make dots optional and also make them literal\r\n return s.replace(/\\./, \"\\\\.?\");\r\n}\r\n\r\nfunction stripInsensitivities(s) {\r\n return s.replace(/\\./, \"\").toLowerCase();\r\n}\r\n\r\nfunction oneOf(strings, startIndex) {\r\n if (strings === null) {\r\n return null;\r\n } else {\r\n return {\r\n regex: RegExp(strings.map(fixListRegex).join(\"|\")),\r\n deser: ([s]) =>\r\n strings.findIndex(i => stripInsensitivities(s) === stripInsensitivities(i)) + startIndex\r\n };\r\n }\r\n}\r\n\r\nfunction offset(regex, groups) {\r\n return { regex, deser: ([, h, m]) => signedOffset(h, m), groups };\r\n}\r\n\r\nfunction simple(regex) {\r\n return { regex, deser: ([s]) => s };\r\n}\r\n\r\nfunction unitForToken(token, loc) {\r\n const one = /\\d/,\r\n two = /\\d{2}/,\r\n three = /\\d{3}/,\r\n four = /\\d{4}/,\r\n oneOrTwo = /\\d{1,2}/,\r\n oneToThree = /\\d{1,3}/,\r\n twoToFour = /\\d{2,4}/,\r\n literal = t => ({ regex: RegExp(t.val), deser: ([s]) => s, literal: true }),\r\n unitate = t => {\r\n if (token.literal) {\r\n return literal(t);\r\n }\r\n switch (t.val) {\r\n // era\r\n case \"G\":\r\n return oneOf(loc.eras(\"short\", false), 0);\r\n case \"GG\":\r\n return oneOf(loc.eras(\"long\", false), 0);\r\n // years\r\n case \"y\":\r\n return intUnit(/\\d{1,6}/);\r\n case \"yy\":\r\n return intUnit(twoToFour, untruncateYear);\r\n case \"yyyy\":\r\n return intUnit(four);\r\n case \"yyyyy\":\r\n return intUnit(/\\d{4,6}/);\r\n case \"yyyyyy\":\r\n return intUnit(/\\d{6}/);\r\n // months\r\n case \"M\":\r\n return intUnit(oneOrTwo);\r\n case \"MM\":\r\n return intUnit(two);\r\n case \"MMM\":\r\n return oneOf(loc.months(\"short\", false, false), 1);\r\n case \"MMMM\":\r\n return oneOf(loc.months(\"long\", false, false), 1);\r\n case \"L\":\r\n return intUnit(oneOrTwo);\r\n case \"LL\":\r\n return intUnit(two);\r\n case \"LLL\":\r\n return oneOf(loc.months(\"short\", true, false), 1);\r\n case \"LLLL\":\r\n return oneOf(loc.months(\"long\", true, false), 1);\r\n // dates\r\n case \"d\":\r\n return intUnit(oneOrTwo);\r\n case \"dd\":\r\n return intUnit(two);\r\n // ordinals\r\n case \"o\":\r\n return intUnit(oneToThree);\r\n case \"ooo\":\r\n return intUnit(three);\r\n // time\r\n case \"HH\":\r\n return intUnit(two);\r\n case \"H\":\r\n return intUnit(oneOrTwo);\r\n case \"hh\":\r\n return intUnit(two);\r\n case \"h\":\r\n return intUnit(oneOrTwo);\r\n case \"mm\":\r\n return intUnit(two);\r\n case \"m\":\r\n return intUnit(oneOrTwo);\r\n case \"s\":\r\n return intUnit(oneOrTwo);\r\n case \"ss\":\r\n return intUnit(two);\r\n case \"S\":\r\n return intUnit(oneToThree);\r\n case \"SSS\":\r\n return intUnit(three);\r\n case \"u\":\r\n return simple(/\\d{1,9}/);\r\n // meridiem\r\n case \"a\":\r\n return oneOf(loc.meridiems(), 0);\r\n // weekYear (k)\r\n case \"kkkk\":\r\n return intUnit(four);\r\n case \"kk\":\r\n return intUnit(twoToFour, untruncateYear);\r\n // weekNumber (W)\r\n case \"W\":\r\n return intUnit(oneOrTwo);\r\n case \"WW\":\r\n return intUnit(two);\r\n // weekdays\r\n case \"E\":\r\n case \"c\":\r\n return intUnit(one);\r\n case \"EEE\":\r\n return oneOf(loc.weekdays(\"short\", false, false), 1);\r\n case \"EEEE\":\r\n return oneOf(loc.weekdays(\"long\", false, false), 1);\r\n case \"ccc\":\r\n return oneOf(loc.weekdays(\"short\", true, false), 1);\r\n case \"cccc\":\r\n return oneOf(loc.weekdays(\"long\", true, false), 1);\r\n // offset/zone\r\n case \"Z\":\r\n case \"ZZ\":\r\n return offset(/([+-]\\d{1,2})(?::(\\d{2}))?/, 2);\r\n case \"ZZZ\":\r\n return offset(/([+-]\\d{1,2})(\\d{2})?/, 2);\r\n // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing\r\n // because we don't have any way to figure out what they are\r\n case \"z\":\r\n return simple(/[a-z_+-]{1,256}(\\/[a-z_+-]{1,256}(\\/[a-z_+-]{1,256})?)?/i);\r\n default:\r\n return literal(t);\r\n }\r\n };\r\n\r\n const unit = unitate(token) || {\r\n invalidReason: MISSING_FTP\r\n };\r\n\r\n unit.token = token;\r\n\r\n return unit;\r\n}\r\n\r\nfunction buildRegex(units) {\r\n const re = units.map(u => u.regex).reduce((f, r) => `${f}(${r.source})`, \"\");\r\n return [`^${re}$`, units];\r\n}\r\n\r\nfunction match(input, regex, handlers) {\r\n const matches = input.match(regex);\r\n\r\n if (matches) {\r\n const all = {};\r\n let matchIndex = 1;\r\n for (const i in handlers) {\r\n if (handlers.hasOwnProperty(i)) {\r\n const h = handlers[i],\r\n groups = h.groups ? h.groups + 1 : 1;\r\n if (!h.literal && h.token) {\r\n all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups));\r\n }\r\n matchIndex += groups;\r\n }\r\n }\r\n return [matches, all];\r\n } else {\r\n return [matches, {}];\r\n }\r\n}\r\n\r\nfunction dateTimeFromMatches(matches) {\r\n const toField = token => {\r\n switch (token) {\r\n case \"S\":\r\n return \"millisecond\";\r\n case \"s\":\r\n return \"second\";\r\n case \"m\":\r\n return \"minute\";\r\n case \"h\":\r\n case \"H\":\r\n return \"hour\";\r\n case \"d\":\r\n return \"day\";\r\n case \"o\":\r\n return \"ordinal\";\r\n case \"L\":\r\n case \"M\":\r\n return \"month\";\r\n case \"y\":\r\n return \"year\";\r\n case \"E\":\r\n case \"c\":\r\n return \"weekday\";\r\n case \"W\":\r\n return \"weekNumber\";\r\n case \"k\":\r\n return \"weekYear\";\r\n default:\r\n return null;\r\n }\r\n };\r\n\r\n let zone;\r\n if (!isUndefined(matches.Z)) {\r\n zone = new FixedOffsetZone(matches.Z);\r\n } else if (!isUndefined(matches.z)) {\r\n zone = new IANAZone(matches.z);\r\n } else {\r\n zone = null;\r\n }\r\n\r\n if (!isUndefined(matches.h)) {\r\n if (matches.h < 12 && matches.a === 1) {\r\n matches.h += 12;\r\n } else if (matches.h === 12 && matches.a === 0) {\r\n matches.h = 0;\r\n }\r\n }\r\n\r\n if (matches.G === 0 && matches.y) {\r\n matches.y = -matches.y;\r\n }\r\n\r\n if (!isUndefined(matches.u)) {\r\n matches.S = parseMillis(matches.u);\r\n }\r\n\r\n const vals = Object.keys(matches).reduce((r, k) => {\r\n const f = toField(k);\r\n if (f) {\r\n r[f] = matches[k];\r\n }\r\n\r\n return r;\r\n }, {});\r\n\r\n return [vals, zone];\r\n}\r\n\r\n/**\r\n * @private\r\n */\r\n\r\nexport function explainFromTokens(locale, input, format) {\r\n const tokens = Formatter.parseFormat(format),\r\n units = tokens.map(t => unitForToken(t, locale)),\r\n disqualifyingUnit = units.find(t => t.invalidReason);\r\n\r\n if (disqualifyingUnit) {\r\n return { input, tokens, invalidReason: disqualifyingUnit.invalidReason };\r\n } else {\r\n const [regexString, handlers] = buildRegex(units),\r\n regex = RegExp(regexString, \"i\"),\r\n [rawMatches, matches] = match(input, regex, handlers),\r\n [result, zone] = matches ? dateTimeFromMatches(matches) : [null, null];\r\n\r\n return { input, tokens, regex, rawMatches, matches, result, zone };\r\n }\r\n}\r\n\r\nexport function parseFromTokens(locale, input, format) {\r\n const { result, zone, invalidReason } = explainFromTokens(locale, input, format);\r\n return [result, zone, invalidReason];\r\n}\r\n","import {\n numberBetween,\n isLeapYear,\n timeObject,\n daysInYear,\n daysInMonth,\n weeksInWeekYear,\n isNumber\n} from \"./util\";\nimport Invalid from \"./invalid\";\n\nconst nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334],\n leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\nfunction unitOutOfRange(unit, value) {\n return new Invalid(\n \"unit out of range\",\n `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`\n );\n}\n\nfunction dayOfWeek(year, month, day) {\n const js = new Date(Date.UTC(year, month - 1, day)).getUTCDay();\n return js === 0 ? 7 : js;\n}\n\nfunction computeOrdinal(year, month, day) {\n return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1];\n}\n\nfunction uncomputeOrdinal(year, ordinal) {\n const table = isLeapYear(year) ? leapLadder : nonLeapLadder,\n month0 = table.findIndex(i => i < ordinal),\n day = ordinal - table[month0];\n return { month: month0 + 1, day };\n}\n\n/**\n * @private\n */\n\nexport function gregorianToWeek(gregObj) {\n const { year, month, day } = gregObj,\n ordinal = computeOrdinal(year, month, day),\n weekday = dayOfWeek(year, month, day);\n\n let weekNumber = Math.floor((ordinal - weekday + 10) / 7),\n weekYear;\n\n if (weekNumber < 1) {\n weekYear = year - 1;\n weekNumber = weeksInWeekYear(weekYear);\n } else if (weekNumber > weeksInWeekYear(year)) {\n weekYear = year + 1;\n weekNumber = 1;\n } else {\n weekYear = year;\n }\n\n return Object.assign({ weekYear, weekNumber, weekday }, timeObject(gregObj));\n}\n\nexport function weekToGregorian(weekData) {\n const { weekYear, weekNumber, weekday } = weekData,\n weekdayOfJan4 = dayOfWeek(weekYear, 1, 4),\n yearInDays = daysInYear(weekYear);\n\n let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 3,\n year;\n\n if (ordinal < 1) {\n year = weekYear - 1;\n ordinal += daysInYear(year);\n } else if (ordinal > yearInDays) {\n year = weekYear + 1;\n ordinal -= daysInYear(weekYear);\n } else {\n year = weekYear;\n }\n\n const { month, day } = uncomputeOrdinal(year, ordinal);\n\n return Object.assign({ year, month, day }, timeObject(weekData));\n}\n\nexport function gregorianToOrdinal(gregData) {\n const { year, month, day } = gregData,\n ordinal = computeOrdinal(year, month, day);\n\n return Object.assign({ year, ordinal }, timeObject(gregData));\n}\n\nexport function ordinalToGregorian(ordinalData) {\n const { year, ordinal } = ordinalData,\n { month, day } = uncomputeOrdinal(year, ordinal);\n\n return Object.assign({ year, month, day }, timeObject(ordinalData));\n}\n\nexport function hasInvalidWeekData(obj) {\n const validYear = isNumber(obj.weekYear),\n validWeek = numberBetween(obj.weekNumber, 1, weeksInWeekYear(obj.weekYear)),\n validWeekday = numberBetween(obj.weekday, 1, 7);\n\n if (!validYear) {\n return unitOutOfRange(\"weekYear\", obj.weekYear);\n } else if (!validWeek) {\n return unitOutOfRange(\"week\", obj.week);\n } else if (!validWeekday) {\n return unitOutOfRange(\"weekday\", obj.weekday);\n } else return false;\n}\n\nexport function hasInvalidOrdinalData(obj) {\n const validYear = isNumber(obj.year),\n validOrdinal = numberBetween(obj.ordinal, 1, daysInYear(obj.year));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validOrdinal) {\n return unitOutOfRange(\"ordinal\", obj.ordinal);\n } else return false;\n}\n\nexport function hasInvalidGregorianData(obj) {\n const validYear = isNumber(obj.year),\n validMonth = numberBetween(obj.month, 1, 12),\n validDay = numberBetween(obj.day, 1, daysInMonth(obj.year, obj.month));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validMonth) {\n return unitOutOfRange(\"month\", obj.month);\n } else if (!validDay) {\n return unitOutOfRange(\"day\", obj.day);\n } else return false;\n}\n\nexport function hasInvalidTimeData(obj) {\n const validHour = numberBetween(obj.hour, 0, 23),\n validMinute = numberBetween(obj.minute, 0, 59),\n validSecond = numberBetween(obj.second, 0, 59),\n validMillisecond = numberBetween(obj.millisecond, 0, 999);\n\n if (!validHour) {\n return unitOutOfRange(\"hour\", obj.hour);\n } else if (!validMinute) {\n return unitOutOfRange(\"minute\", obj.minute);\n } else if (!validSecond) {\n return unitOutOfRange(\"second\", obj.secon);\n } else if (!validMillisecond) {\n return unitOutOfRange(\"millisecond\", obj.millisecond);\n } else return false;\n}\n","import Duration, { friendlyDuration } from \"./duration\";\r\nimport Interval from \"./interval\";\r\nimport Settings from \"./settings\";\r\nimport Info from \"./info\";\r\nimport Formatter from \"./impl/formatter\";\r\nimport FixedOffsetZone from \"./zones/fixedOffsetZone\";\r\nimport LocalZone from \"./zones/localZone\";\r\nimport Locale from \"./impl/locale\";\r\nimport {\r\n isUndefined,\r\n maybeArray,\r\n isDate,\r\n isNumber,\r\n bestBy,\r\n daysInMonth,\r\n daysInYear,\r\n isLeapYear,\r\n weeksInWeekYear,\r\n normalizeObject\r\n} from \"./impl/util\";\r\nimport { normalizeZone } from \"./impl/zoneUtil\";\r\nimport diff from \"./impl/diff\";\r\nimport { parseRFC2822Date, parseISODate, parseHTTPDate, parseSQL } from \"./impl/regexParser\";\r\nimport { parseFromTokens, explainFromTokens } from \"./impl/tokenParser\";\r\nimport {\r\n gregorianToWeek,\r\n weekToGregorian,\r\n gregorianToOrdinal,\r\n ordinalToGregorian,\r\n hasInvalidGregorianData,\r\n hasInvalidWeekData,\r\n hasInvalidOrdinalData,\r\n hasInvalidTimeData\r\n} from \"./impl/conversions\";\r\nimport * as Formats from \"./impl/formats\";\r\nimport {\r\n InvalidArgumentError,\r\n ConflictingSpecificationError,\r\n InvalidUnitError,\r\n InvalidDateTimeError\r\n} from \"./errors\";\r\nimport Invalid from \"./impl/invalid\";\r\n\r\nconst INVALID = \"Invalid DateTime\";\r\n\r\nfunction unsupportedZone(zone) {\r\n return new Invalid(\"unsupported zone\", `the zone \"${zone.name}\" is not supported`);\r\n}\r\n\r\n// we cache week data on the DT object and this intermediates the cache\r\nfunction possiblyCachedWeekData(dt) {\r\n if (dt.weekData === null) {\r\n dt.weekData = gregorianToWeek(dt.c);\r\n }\r\n return dt.weekData;\r\n}\r\n\r\n// clone really means, \"make a new object with these modifications\". all \"setters\" really use this\r\n// to create a new object while only changing some of the properties\r\nfunction clone(inst, alts) {\r\n const current = {\r\n ts: inst.ts,\r\n zone: inst.zone,\r\n c: inst.c,\r\n o: inst.o,\r\n loc: inst.loc,\r\n invalid: inst.invalid\r\n };\r\n return new DateTime(Object.assign({}, current, alts, { old: current }));\r\n}\r\n\r\n// find the right offset a given local time. The o input is our guess, which determines which\r\n// offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST)\r\nfunction fixOffset(localTS, o, tz) {\r\n // Our UTC time is just a guess because our offset is just a guess\r\n let utcGuess = localTS - o * 60 * 1000;\r\n\r\n // Test whether the zone matches the offset for this ts\r\n const o2 = tz.offset(utcGuess);\r\n\r\n // If so, offset didn't change and we're done\r\n if (o === o2) {\r\n return [utcGuess, o];\r\n }\r\n\r\n // If not, change the ts by the difference in the offset\r\n utcGuess -= (o2 - o) * 60 * 1000;\r\n\r\n // If that gives us the local time we want, we're done\r\n const o3 = tz.offset(utcGuess);\r\n if (o2 === o3) {\r\n return [utcGuess, o2];\r\n }\r\n\r\n // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\r\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\r\n}\r\n\r\n// convert an epoch timestamp into a calendar object with the given offset\r\nfunction tsToObj(ts, offset) {\r\n ts += offset * 60 * 1000;\r\n\r\n const d = new Date(ts);\r\n\r\n return {\r\n year: d.getUTCFullYear(),\r\n month: d.getUTCMonth() + 1,\r\n day: d.getUTCDate(),\r\n hour: d.getUTCHours(),\r\n minute: d.getUTCMinutes(),\r\n second: d.getUTCSeconds(),\r\n millisecond: d.getUTCMilliseconds()\r\n };\r\n}\r\n\r\n// covert a calendar object to a local timestamp (epoch, but with the offset baked in)\r\nfunction objToLocalTS(obj) {\r\n let d = Date.UTC(\r\n obj.year,\r\n obj.month - 1,\r\n obj.day,\r\n obj.hour,\r\n obj.minute,\r\n obj.second,\r\n obj.millisecond\r\n );\r\n\r\n // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that\r\n if (obj.year < 100 && obj.year >= 0) {\r\n d = new Date(d);\r\n d.setUTCFullYear(obj.year);\r\n }\r\n return +d;\r\n}\r\n\r\n// convert a calendar object to a epoch timestamp\r\nfunction objToTS(obj, offset, zone) {\r\n return fixOffset(objToLocalTS(obj), offset, zone);\r\n}\r\n\r\n// create a new DT instance by adding a duration, adjusting for DSTs\r\nfunction adjustTime(inst, dur) {\r\n const oPre = inst.o,\r\n year = inst.c.year + dur.years,\r\n month = inst.c.month + dur.months + dur.quarters * 3,\r\n c = Object.assign({}, inst.c, {\r\n year,\r\n month,\r\n day: Math.min(inst.c.day, daysInMonth(year, month)) + dur.days + dur.weeks * 7\r\n }),\r\n millisToAdd = Duration.fromObject({\r\n hours: dur.hours,\r\n minutes: dur.minutes,\r\n seconds: dur.seconds,\r\n milliseconds: dur.milliseconds\r\n }).as(\"milliseconds\"),\r\n localTS = objToLocalTS(c);\r\n\r\n let [ts, o] = fixOffset(localTS, oPre, inst.zone);\r\n\r\n if (millisToAdd !== 0) {\r\n ts += millisToAdd;\r\n // that could have changed the offset by going over a DST, but we want to keep the ts the same\r\n o = inst.zone.offset(ts);\r\n }\r\n\r\n return { ts, o };\r\n}\r\n\r\n// helper useful in turning the results of parsing into real dates\r\n// by handling the zone options\r\nfunction parseDataToDateTime(parsed, parsedZone, opts, format, text) {\r\n const { setZone, zone } = opts;\r\n if (parsed && Object.keys(parsed).length !== 0) {\r\n const interpretationZone = parsedZone || zone,\r\n inst = DateTime.fromObject(\r\n Object.assign(parsed, opts, {\r\n zone: interpretationZone\r\n })\r\n );\r\n return setZone ? inst : inst.setZone(zone);\r\n } else {\r\n return DateTime.invalid(\r\n new Invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ${format}`)\r\n );\r\n }\r\n}\r\n\r\n// if you want to output a technical format (e.g. RFC 2822), this helper\r\n// helps handle the details\r\nfunction toTechFormat(dt, format) {\r\n return dt.isValid\r\n ? Formatter.create(Locale.create(\"en-US\"), {\r\n allowZ: true,\r\n forceSimple: true\r\n }).formatDateTimeFromString(dt, format)\r\n : null;\r\n}\r\n\r\n// technical time formats (e.g. the time part of ISO 8601), take some options\r\n// and this commonizes their handling\r\nfunction toTechTimeFormat(\r\n dt,\r\n {\r\n suppressSeconds = false,\r\n suppressMilliseconds = false,\r\n includeOffset = true,\r\n includeZone = false,\r\n spaceZone = false\r\n }\r\n) {\r\n let fmt = \"HH:mm\";\r\n\r\n if (!suppressSeconds || dt.second !== 0 || dt.millisecond !== 0) {\r\n fmt += \":ss\";\r\n if (!suppressMilliseconds || dt.millisecond !== 0) {\r\n fmt += \".SSS\";\r\n }\r\n }\r\n\r\n if ((includeZone || includeOffset) && spaceZone) {\r\n fmt += \" \";\r\n }\r\n\r\n if (includeZone) {\r\n fmt += \"z\";\r\n } else if (includeOffset) {\r\n fmt += \"ZZ\";\r\n }\r\n\r\n return toTechFormat(dt, fmt);\r\n}\r\n\r\n// defaults for unspecified units in the supported calendars\r\nconst defaultUnitValues = {\r\n month: 1,\r\n day: 1,\r\n hour: 0,\r\n minute: 0,\r\n second: 0,\r\n millisecond: 0\r\n },\r\n defaultWeekUnitValues = {\r\n weekNumber: 1,\r\n weekday: 1,\r\n hour: 0,\r\n minute: 0,\r\n second: 0,\r\n millisecond: 0\r\n },\r\n defaultOrdinalUnitValues = {\r\n ordinal: 1,\r\n hour: 0,\r\n minute: 0,\r\n second: 0,\r\n millisecond: 0\r\n };\r\n\r\n// Units in the supported calendars, sorted by bigness\r\nconst orderedUnits = [\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\", \"millisecond\"],\r\n orderedWeekUnits = [\r\n \"weekYear\",\r\n \"weekNumber\",\r\n \"weekday\",\r\n \"hour\",\r\n \"minute\",\r\n \"second\",\r\n \"millisecond\"\r\n ],\r\n orderedOrdinalUnits = [\"year\", \"ordinal\", \"hour\", \"minute\", \"second\", \"millisecond\"];\r\n\r\n// standardize case and plurality in units\r\nfunction normalizeUnit(unit, ignoreUnknown = false) {\r\n const normalized = {\r\n year: \"year\",\r\n years: \"year\",\r\n month: \"month\",\r\n months: \"month\",\r\n day: \"day\",\r\n days: \"day\",\r\n hour: \"hour\",\r\n hours: \"hour\",\r\n minute: \"minute\",\r\n minutes: \"minute\",\r\n second: \"second\",\r\n seconds: \"second\",\r\n millisecond: \"millisecond\",\r\n milliseconds: \"millisecond\",\r\n weekday: \"weekday\",\r\n weekdays: \"weekday\",\r\n weeknumber: \"weekNumber\",\r\n weeksnumber: \"weekNumber\",\r\n weeknumbers: \"weekNumber\",\r\n weekyear: \"weekYear\",\r\n weekyears: \"weekYear\",\r\n ordinal: \"ordinal\"\r\n }[unit ? unit.toLowerCase() : unit];\r\n\r\n if (!ignoreUnknown && !normalized) throw new InvalidUnitError(unit);\r\n\r\n return normalized;\r\n}\r\n\r\n// this is a dumbed down version of fromObject() that runs about 60% faster\r\n// but doesn't do any validation, makes a bunch of assumptions about what units\r\n// are present, and so on.\r\nfunction quickDT(obj, zone) {\r\n // assume we have the higher-order units\r\n for (const u of orderedUnits) {\r\n if (isUndefined(obj[u])) {\r\n obj[u] = defaultUnitValues[u];\r\n }\r\n }\r\n\r\n const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj);\r\n if (invalid) {\r\n return DateTime.invalid(invalid);\r\n }\r\n\r\n const tsNow = Settings.now(),\r\n offsetProvis = zone.offset(tsNow),\r\n [ts, o] = objToTS(obj, offsetProvis, zone);\r\n\r\n return new DateTime({\r\n ts,\r\n zone,\r\n o\r\n });\r\n}\r\n\r\n/**\r\n * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them.\r\n *\r\n * A DateTime comprises of:\r\n * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch.\r\n * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone).\r\n * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`.\r\n *\r\n * Here is a brief overview of the most commonly used functionality it provides:\r\n *\r\n * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link local}, {@link utc}, and (most flexibly) {@link fromObject}. To create one from a standard string format, use {@link fromISO}, {@link fromHTTP}, and {@link fromRFC2822}. To create one from a custom string format, use {@link fromFormat}. To create one from a native JS date, use {@link fromJSDate}.\r\n * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link toObject}), use the {@link year}, {@link month},\r\n * {@link day}, {@link hour}, {@link minute}, {@link second}, {@link millisecond} accessors.\r\n * * **Week calendar**: For ISO week calendar attributes, see the {@link weekYear}, {@link weekNumber}, and {@link weekday} accessors.\r\n * * **Configuration** See the {@link locale} and {@link numberingSystem} accessors.\r\n * * **Transformation**: To transform the DateTime into other DateTimes, use {@link set}, {@link reconfigure}, {@link setZone}, {@link setLocale}, {@link plus}, {@link minus}, {@link endOf}, {@link startOf}, {@link toUTC}, and {@link toLocal}.\r\n * * **Output**: To convert the DateTime to other representations, use the {@link toJSON}, {@link toISO}, {@link toHTTP}, {@link toObject}, {@link toRFC2822}, {@link toString}, {@link toLocaleString}, {@link toFormat}, {@link toMillis} and {@link toJSDate}.\r\n *\r\n * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation.\r\n */\r\nexport default class DateTime {\r\n /**\r\n * @access private\r\n */\r\n constructor(config) {\r\n const zone = config.zone || Settings.defaultZone,\r\n invalid =\r\n config.invalid ||\r\n (Number.isNaN(config.ts) ? new Invalid(\"invalid input\") : null) ||\r\n (!zone.isValid ? unsupportedZone(zone) : null);\r\n /**\r\n * @access private\r\n */\r\n this.ts = isUndefined(config.ts) ? Settings.now() : config.ts;\r\n\r\n let c = null,\r\n o = null;\r\n if (!invalid) {\r\n const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone);\r\n c = unchanged ? config.old.c : tsToObj(this.ts, zone.offset(this.ts));\r\n o = unchanged ? config.old.o : zone.offset(this.ts);\r\n }\r\n\r\n /**\r\n * @access private\r\n */\r\n this.zone = zone;\r\n /**\r\n * @access private\r\n */\r\n this.loc = config.loc || Locale.create();\r\n /**\r\n * @access private\r\n */\r\n this.invalid = invalid;\r\n /**\r\n * @access private\r\n */\r\n this.weekData = null;\r\n /**\r\n * @access private\r\n */\r\n this.c = c;\r\n /**\r\n * @access private\r\n */\r\n this.o = o;\r\n /**\r\n * @access private\r\n */\r\n this.isLuxonDateTime = true;\r\n }\r\n\r\n // CONSTRUCT\r\n\r\n /**\r\n * Create a local DateTime\r\n * @param {number} year - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used\r\n * @param {number} [month=1] - The month, 1-indexed\r\n * @param {number} [day=1] - The day of the month\r\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\r\n * @param {number} [minute=0] - The minute of the hour, i.e. a number between 0 and 59\r\n * @param {number} [second=0] - The second of the minute, i.e. a number between 0 and 59\r\n * @param {number} [millisecond=0] - The millisecond of the second, i.e. a number between 0 and 999\r\n * @example DateTime.local() //~> now\r\n * @example DateTime.local(2017) //~> 2017-01-01T00:00:00\r\n * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00\r\n * @example DateTime.local(2017, 3, 12) //~> 2017-03-12T00:00:00\r\n * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00\r\n * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00\r\n * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10\r\n * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765\r\n * @return {DateTime}\r\n */\r\n static local(year, month, day, hour, minute, second, millisecond) {\r\n if (isUndefined(year)) {\r\n return new DateTime({ ts: Settings.now() });\r\n } else {\r\n return quickDT(\r\n {\r\n year,\r\n month,\r\n day,\r\n hour,\r\n minute,\r\n second,\r\n millisecond\r\n },\r\n Settings.defaultZone\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * Create a DateTime in UTC\r\n * @param {number} year - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used\r\n * @param {number} [month=1] - The month, 1-indexed\r\n * @param {number} [day=1] - The day of the month\r\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\r\n * @param {number} [minute=0] - The minute of the hour, i.e. a number between 0 and 59\r\n * @param {number} [second=0] - The second of the minute, i.e. a number between 0 and 59\r\n * @param {number} [millisecond=0] - The millisecond of the second, i.e. a number between 0 and 999\r\n * @example DateTime.utc() //~> now\r\n * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z\r\n * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z\r\n * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z\r\n * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z\r\n * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z\r\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z\r\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765Z\r\n * @return {DateTime}\r\n */\r\n static utc(year, month, day, hour, minute, second, millisecond) {\r\n if (isUndefined(year)) {\r\n return new DateTime({\r\n ts: Settings.now(),\r\n zone: FixedOffsetZone.utcInstance\r\n });\r\n } else {\r\n return quickDT(\r\n {\r\n year,\r\n month,\r\n day,\r\n hour,\r\n minute,\r\n second,\r\n millisecond\r\n },\r\n FixedOffsetZone.utcInstance\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * Create a DateTime from a Javascript Date object. Uses the default zone.\r\n * @param {Date} date - a Javascript Date object\r\n * @param {Object} options - configuration options for the DateTime\r\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\r\n * @return {DateTime}\r\n */\r\n static fromJSDate(date, options = {}) {\r\n return new DateTime({\r\n ts: isDate(date) ? date.valueOf() : NaN,\r\n zone: normalizeZone(options.zone, Settings.defaultZone),\r\n loc: Locale.fromObject(options)\r\n });\r\n }\r\n\r\n /**\r\n * Create a DateTime from a number of milliseconds since the epoch (i.e. since 1 January 1970 00:00:00 UTC). Uses the default zone.\r\n * @param {number} milliseconds - a number of milliseconds since 1970 UTC\r\n * @param {Object} options - configuration options for the DateTime\r\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\r\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\r\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\r\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\r\n * @return {DateTime}\r\n */\r\n static fromMillis(milliseconds, options = {}) {\r\n if (!isNumber(milliseconds)) {\r\n throw new InvalidArgumentError(\"fromMillis requires a numerical input\");\r\n } else {\r\n return new DateTime({\r\n ts: milliseconds,\r\n zone: normalizeZone(options.zone, Settings.defaultZone),\r\n loc: Locale.fromObject(options)\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Create a DateTime from a number of seconds since the epoch (i.e. since 1 January 1970 00:00:00 UTC). Uses the default zone.\r\n * @param {number} seconds - a number of seconds since 1970 UTC\r\n * @param {Object} options - configuration options for the DateTime\r\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\r\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\r\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\r\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\r\n * @return {DateTime}\r\n */\r\n static fromSeconds(seconds, options = {}) {\r\n if (!isNumber(seconds)) {\r\n throw new InvalidArgumentError(\"fromSeconds requires a numerical input\");\r\n } else {\r\n return new DateTime({\r\n ts: seconds * 1000,\r\n zone: normalizeZone(options.zone, Settings.defaultZone),\r\n loc: Locale.fromObject(options)\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Create a DateTime from a Javascript object with keys like 'year' and 'hour' with reasonable defaults.\r\n * @param {Object} obj - the object to create the DateTime from\r\n * @param {number} obj.year - a year, such as 1987\r\n * @param {number} obj.month - a month, 1-12\r\n * @param {number} obj.day - a day of the month, 1-31, depending on the month\r\n * @param {number} obj.ordinal - day of the year, 1-365 or 366\r\n * @param {number} obj.weekYear - an ISO week year\r\n * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year\r\n * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday\r\n * @param {number} obj.hour - hour of the day, 0-23\r\n * @param {number} obj.minute - minute of the hour, 0-59\r\n * @param {number} obj.second - second of the minute, 0-59\r\n * @param {number} obj.millisecond - millisecond of the second, 0-999\r\n * @param {string|Zone} [obj.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone()\r\n * @param {string} [obj.locale='en-US'] - a locale to set on the resulting DateTime instance\r\n * @param {string} obj.outputCalendar - the output calendar to set on the resulting DateTime instance\r\n * @param {string} obj.numberingSystem - the numbering system to set on the resulting DateTime instance\r\n * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25'\r\n * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01T00'\r\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06\r\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6, zone: 'utc' }),\r\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6, zone: 'local' })\r\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6, zone: 'America/New_York' })\r\n * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13'\r\n * @return {DateTime}\r\n */\r\n static fromObject(obj) {\r\n const zoneToUse = normalizeZone(obj.zone, Settings.defaultZone);\r\n if (!zoneToUse.isValid) {\r\n return DateTime.invalid(unsupportedZone(zoneToUse));\r\n }\r\n\r\n const tsNow = Settings.now(),\r\n offsetProvis = zoneToUse.offset(tsNow),\r\n normalized = normalizeObject(obj, normalizeUnit, true),\r\n containsOrdinal = !isUndefined(normalized.ordinal),\r\n containsGregorYear = !isUndefined(normalized.year),\r\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\r\n containsGregor = containsGregorYear || containsGregorMD,\r\n definiteWeekDef = normalized.weekYear || normalized.weekNumber,\r\n loc = Locale.fromObject(obj);\r\n\r\n // cases:\r\n // just a weekday -> this week's instance of that weekday, no worries\r\n // (gregorian data or ordinal) + (weekYear or weekNumber) -> error\r\n // (gregorian month or day) + ordinal -> error\r\n // otherwise just use weeks or ordinals or gregorian, depending on what's specified\r\n\r\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\r\n throw new ConflictingSpecificationError(\r\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\r\n );\r\n }\r\n\r\n if (containsGregorMD && containsOrdinal) {\r\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\r\n }\r\n\r\n const useWeekData = definiteWeekDef || (normalized.weekday && !containsGregor);\r\n\r\n // configure ourselves to deal with gregorian dates or week stuff\r\n let units,\r\n defaultValues,\r\n objNow = tsToObj(tsNow, offsetProvis);\r\n if (useWeekData) {\r\n units = orderedWeekUnits;\r\n defaultValues = defaultWeekUnitValues;\r\n objNow = gregorianToWeek(objNow);\r\n } else if (containsOrdinal) {\r\n units = orderedOrdinalUnits;\r\n defaultValues = defaultOrdinalUnitValues;\r\n objNow = gregorianToOrdinal(objNow);\r\n } else {\r\n units = orderedUnits;\r\n defaultValues = defaultUnitValues;\r\n }\r\n\r\n // set default values for missing stuff\r\n let foundFirst = false;\r\n for (const u of units) {\r\n const v = normalized[u];\r\n if (!isUndefined(v)) {\r\n foundFirst = true;\r\n } else if (foundFirst) {\r\n normalized[u] = defaultValues[u];\r\n } else {\r\n normalized[u] = objNow[u];\r\n }\r\n }\r\n\r\n // make sure the values we have are in range\r\n const higherOrderInvalid = useWeekData\r\n ? hasInvalidWeekData(normalized)\r\n : containsOrdinal\r\n ? hasInvalidOrdinalData(normalized)\r\n : hasInvalidGregorianData(normalized),\r\n invalid = higherOrderInvalid || hasInvalidTimeData(normalized);\r\n\r\n if (invalid) {\r\n return DateTime.invalid(invalid);\r\n }\r\n\r\n // compute the actual time\r\n const gregorian = useWeekData\r\n ? weekToGregorian(normalized)\r\n : containsOrdinal\r\n ? ordinalToGregorian(normalized)\r\n : normalized,\r\n [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse),\r\n inst = new DateTime({\r\n ts: tsFinal,\r\n zone: zoneToUse,\r\n o: offsetFinal,\r\n loc\r\n });\r\n\r\n // gregorian data + weekday serves only to validate\r\n if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) {\r\n return DateTime.invalid(\r\n \"mismatched weekday\",\r\n `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`\r\n );\r\n }\r\n\r\n return inst;\r\n }\r\n\r\n /**\r\n * Create a DateTime from an ISO 8601 string\r\n * @param {string} text - the ISO string\r\n * @param {Object} opts - options to affect the creation\r\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone\r\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\r\n * @param {string} [opts.locale='en-US'] - a locale to set on the resulting DateTime instance\r\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\r\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\r\n * @example DateTime.fromISO('2016-05-25T09:08:34.123')\r\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00')\r\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true})\r\n * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'})\r\n * @example DateTime.fromISO('2016-W05-4')\r\n * @return {DateTime}\r\n */\r\n static fromISO(text, opts = {}) {\r\n const [vals, parsedZone] = parseISODate(text);\r\n return parseDataToDateTime(vals, parsedZone, opts, \"ISO 8601\", text);\r\n }\r\n\r\n /**\r\n * Create a DateTime from an RFC 2822 string\r\n * @param {string} text - the RFC 2822 string\r\n * @param {Object} opts - options to affect the creation\r\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\r\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\r\n * @param {string} [opts.locale='en-US'] - a locale to set on the resulting DateTime instance\r\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\r\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\r\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT')\r\n * @example DateTime.fromRFC2822('Tue, 25 Nov 2016 13:23:12 +0600')\r\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z')\r\n * @return {DateTime}\r\n */\r\n static fromRFC2822(text, opts = {}) {\r\n const [vals, parsedZone] = parseRFC2822Date(text);\r\n return parseDataToDateTime(vals, parsedZone, opts, \"RFC 2822\", text);\r\n }\r\n\r\n /**\r\n * Create a DateTime from an HTTP header date\r\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\r\n * @param {string} text - the HTTP header date\r\n * @param {Object} opts - options to affect the creation\r\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\r\n * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods.\r\n * @param {string} [opts.locale='en-US'] - a locale to set on the resulting DateTime instance\r\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\r\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\r\n * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT')\r\n * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT')\r\n * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994')\r\n * @return {DateTime}\r\n */\r\n static fromHTTP(text, opts = {}) {\r\n const [vals, parsedZone] = parseHTTPDate(text);\r\n return parseDataToDateTime(vals, parsedZone, opts, \"HTTP\", opts);\r\n }\r\n\r\n /**\r\n * Create a DateTime from an input string and format string\r\n * Defaults to en-US if no locale has been specified, regardless of the system's locale\r\n * @param {string} text - the string to parse\r\n * @param {string} fmt - the format the string is expected to be in (see description)\r\n * @param {Object} opts - options to affect the creation\r\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\r\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\r\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\r\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\r\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\r\n * @return {DateTime}\r\n */\r\n static fromFormat(text, fmt, opts = {}) {\r\n if (isUndefined(text) || isUndefined(fmt)) {\r\n throw new InvalidArgumentError(\"fromFormat requires an input string and a format\");\r\n }\r\n\r\n const { locale = null, numberingSystem = null } = opts,\r\n localeToUse = Locale.fromOpts({ locale, numberingSystem, defaultToEN: true }),\r\n [vals, parsedZone, invalid] = parseFromTokens(localeToUse, text, fmt);\r\n if (invalid) {\r\n return DateTime.invalid(invalid);\r\n } else {\r\n return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text);\r\n }\r\n }\r\n\r\n /**\r\n * @deprecated use fromFormat instead\r\n */\r\n static fromString(text, fmt, opts = {}) {\r\n return DateTime.fromFormat(text, fmt, opts);\r\n }\r\n\r\n /**\r\n * Create a DateTime from a SQL date, time, or datetime\r\n * Defaults to en-US if no locale has been specified, regardless of the system's locale\r\n * @param {string} text - the string to parse\r\n * @param {Object} opts - options to affect the creation\r\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\r\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\r\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\r\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\r\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\r\n * @example DateTime.fromSQL('2017-05-15')\r\n * @example DateTime.fromSQL('2017-05-15 09:12:34')\r\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342')\r\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00')\r\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles')\r\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true })\r\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' })\r\n * @example DateTime.fromSQL('09:12:34.342')\r\n * @return {DateTime}\r\n */\r\n static fromSQL(text, opts = {}) {\r\n const [vals, parsedZone] = parseSQL(text);\r\n return parseDataToDateTime(vals, parsedZone, opts, \"SQL\", text);\r\n }\r\n\r\n /**\r\n * Create an invalid DateTime.\r\n * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent\r\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\r\n * @return {DateTime}\r\n */\r\n static invalid(reason, explanation = null) {\r\n if (!reason) {\r\n throw new InvalidArgumentError(\"need to specify a reason the DateTime is invalid\");\r\n }\r\n\r\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\r\n\r\n if (Settings.throwOnInvalid) {\r\n throw new InvalidDateTimeError(invalid);\r\n } else {\r\n return new DateTime({ invalid });\r\n }\r\n }\r\n\r\n /**\r\n * Check if an object is a DateTime. Works across context boundaries\r\n * @param {object} o\r\n * @return {boolean}\r\n */\r\n static isDateTime(o) {\r\n return o.isLuxonDateTime;\r\n }\r\n\r\n // INFO\r\n\r\n /**\r\n * Get the value of unit.\r\n * @param {string} unit - a unit such as 'minute' or 'day'\r\n * @example DateTime.local(2017, 7, 4).get('month'); //=> 7\r\n * @example DateTime.local(2017, 7, 4).get('day'); //=> 4\r\n * @return {number}\r\n */\r\n get(unit) {\r\n return this[unit];\r\n }\r\n\r\n /**\r\n * Returns whether the DateTime is valid. Invalid DateTimes occur when:\r\n * * The DateTime was created from invalid calendar information, such as the 13th month or February 30\r\n * * The DateTime was created by an operation on another invalid date\r\n * @type {boolean}\r\n */\r\n get isValid() {\r\n return this.invalid === null;\r\n }\r\n\r\n /**\r\n * Returns an error code if this DateTime is invalid, or null if the DateTime is valid\r\n * @type {string}\r\n */\r\n get invalidReason() {\r\n return this.invalid ? this.invalid.reason : null;\r\n }\r\n\r\n /**\r\n * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid\r\n * @type {string}\r\n */\r\n get invalidExplanation() {\r\n return this.invalid ? this.invalid.explanation : null;\r\n }\r\n\r\n /**\r\n * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime\r\n *\r\n * @type {string}\r\n */\r\n get locale() {\r\n return this.isValid ? this.loc.locale : null;\r\n }\r\n\r\n /**\r\n * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime\r\n *\r\n * @type {string}\r\n */\r\n get numberingSystem() {\r\n return this.isValid ? this.loc.numberingSystem : null;\r\n }\r\n\r\n /**\r\n * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime\r\n *\r\n * @type {string}\r\n */\r\n get outputCalendar() {\r\n return this.isValid ? this.loc.outputCalendar : null;\r\n }\r\n\r\n /**\r\n * Get the name of the time zone.\r\n * @type {string}\r\n */\r\n get zoneName() {\r\n return this.isValid ? this.zone.name : null;\r\n }\r\n\r\n /**\r\n * Get the year\r\n * @example DateTime.local(2017, 5, 25).year //=> 2017\r\n * @type {number}\r\n */\r\n get year() {\r\n return this.isValid ? this.c.year : NaN;\r\n }\r\n\r\n /**\r\n * Get the quarter\r\n * @example DateTime.local(2017, 5, 25).quarter //=> 2\r\n * @type {number}\r\n */\r\n get quarter() {\r\n return this.isValid ? Math.ceil(this.c.month / 3) : NaN;\r\n }\r\n\r\n /**\r\n * Get the month (1-12).\r\n * @example DateTime.local(2017, 5, 25).month //=> 5\r\n * @type {number}\r\n */\r\n get month() {\r\n return this.isValid ? this.c.month : NaN;\r\n }\r\n\r\n /**\r\n * Get the day of the month (1-30ish).\r\n * @example DateTime.local(2017, 5, 25).day //=> 25\r\n * @type {number}\r\n */\r\n get day() {\r\n return this.isValid ? this.c.day : NaN;\r\n }\r\n\r\n /**\r\n * Get the hour of the day (0-23).\r\n * @example DateTime.local(2017, 5, 25, 9).hour //=> 9\r\n * @type {number}\r\n */\r\n get hour() {\r\n return this.isValid ? this.c.hour : NaN;\r\n }\r\n\r\n /**\r\n * Get the minute of the hour (0-59).\r\n * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30\r\n * @type {number}\r\n */\r\n get minute() {\r\n return this.isValid ? this.c.minute : NaN;\r\n }\r\n\r\n /**\r\n * Get the second of the minute (0-59).\r\n * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52\r\n * @type {number}\r\n */\r\n get second() {\r\n return this.isValid ? this.c.second : NaN;\r\n }\r\n\r\n /**\r\n * Get the millisecond of the second (0-999).\r\n * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654\r\n * @type {number}\r\n */\r\n get millisecond() {\r\n return this.isValid ? this.c.millisecond : NaN;\r\n }\r\n\r\n /**\r\n * Get the week year\r\n * @see https://en.wikipedia.org/wiki/ISO_week_date\r\n * @example DateTime.local(2014, 11, 31).weekYear //=> 2015\r\n * @type {number}\r\n */\r\n get weekYear() {\r\n return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN;\r\n }\r\n\r\n /**\r\n * Get the week number of the week year (1-52ish).\r\n * @see https://en.wikipedia.org/wiki/ISO_week_date\r\n * @example DateTime.local(2017, 5, 25).weekNumber //=> 21\r\n * @type {number}\r\n */\r\n get weekNumber() {\r\n return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN;\r\n }\r\n\r\n /**\r\n * Get the day of the week.\r\n * 1 is Monday and 7 is Sunday\r\n * @see https://en.wikipedia.org/wiki/ISO_week_date\r\n * @example DateTime.local(2014, 11, 31).weekday //=> 4\r\n * @type {number}\r\n */\r\n get weekday() {\r\n return this.isValid ? possiblyCachedWeekData(this).weekday : NaN;\r\n }\r\n\r\n /**\r\n * Get the ordinal (i.e. the day of the year)\r\n * @example DateTime.local(2017, 5, 25).ordinal //=> 145\r\n * @type {number|DateTime}\r\n */\r\n get ordinal() {\r\n return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN;\r\n }\r\n\r\n /**\r\n * Get the human readable short month name, such as 'Oct'.\r\n * Defaults to the system's locale if no locale has been specified\r\n * @example DateTime.local(2017, 10, 30).monthShort //=> Oct\r\n * @type {string}\r\n */\r\n get monthShort() {\r\n return this.isValid ? Info.months(\"short\", { locale: this.locale })[this.month - 1] : null;\r\n }\r\n\r\n /**\r\n * Get the human readable long month name, such as 'October'.\r\n * Defaults to the system's locale if no locale has been specified\r\n * @example DateTime.local(2017, 10, 30).monthLong //=> October\r\n * @type {string}\r\n */\r\n get monthLong() {\r\n return this.isValid ? Info.months(\"long\", { locale: this.locale })[this.month - 1] : null;\r\n }\r\n\r\n /**\r\n * Get the human readable short weekday, such as 'Mon'.\r\n * Defaults to the system's locale if no locale has been specified\r\n * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon\r\n * @type {string}\r\n */\r\n get weekdayShort() {\r\n return this.isValid ? Info.weekdays(\"short\", { locale: this.locale })[this.weekday - 1] : null;\r\n }\r\n\r\n /**\r\n * Get the human readable long weekday, such as 'Monday'.\r\n * Defaults to the system's locale if no locale has been specified\r\n * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday\r\n * @type {string}\r\n */\r\n get weekdayLong() {\r\n return this.isValid ? Info.weekdays(\"long\", { locale: this.locale })[this.weekday - 1] : null;\r\n }\r\n\r\n /**\r\n * Get the UTC offset of this DateTime in minutes\r\n * @example DateTime.local().offset //=> -240\r\n * @example DateTime.utc().offset //=> 0\r\n * @type {number}\r\n */\r\n get offset() {\r\n return this.isValid ? this.zone.offset(this.ts) : NaN;\r\n }\r\n\r\n /**\r\n * Get the short human name for the zone's current offset, for example \"EST\" or \"EDT\".\r\n * Defaults to the system's locale if no locale has been specified\r\n * @type {string}\r\n */\r\n get offsetNameShort() {\r\n if (this.isValid) {\r\n return this.zone.offsetName(this.ts, {\r\n format: \"short\",\r\n locale: this.locale\r\n });\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n /**\r\n * Get the long human name for the zone's current offset, for example \"Eastern Standard Time\" or \"Eastern Daylight Time\".\r\n * Defaults to the system's locale if no locale has been specified\r\n * @type {string}\r\n */\r\n get offsetNameLong() {\r\n if (this.isValid) {\r\n return this.zone.offsetName(this.ts, {\r\n format: \"long\",\r\n locale: this.locale\r\n });\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n /**\r\n * Get whether this zone's offset ever changes, as in a DST.\r\n * @type {boolean}\r\n */\r\n get isOffsetFixed() {\r\n return this.isValid ? this.zone.universal : null;\r\n }\r\n\r\n /**\r\n * Get whether the DateTime is in a DST.\r\n * @type {boolean}\r\n */\r\n get isInDST() {\r\n if (this.isOffsetFixed) {\r\n return false;\r\n } else {\r\n return (\r\n this.offset > this.set({ month: 1 }).offset || this.offset > this.set({ month: 5 }).offset\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * Returns true if this DateTime is in a leap year, false otherwise\r\n * @example DateTime.local(2016).isInLeapYear //=> true\r\n * @example DateTime.local(2013).isInLeapYear //=> false\r\n * @type {boolean}\r\n */\r\n get isInLeapYear() {\r\n return isLeapYear(this.year);\r\n }\r\n\r\n /**\r\n * Returns the number of days in this DateTime's month\r\n * @example DateTime.local(2016, 2).daysInMonth //=> 29\r\n * @example DateTime.local(2016, 3).daysInMonth //=> 31\r\n * @type {number}\r\n */\r\n get daysInMonth() {\r\n return daysInMonth(this.year, this.month);\r\n }\r\n\r\n /**\r\n * Returns the number of days in this DateTime's year\r\n * @example DateTime.local(2016).daysInYear //=> 366\r\n * @example DateTime.local(2013).daysInYear //=> 365\r\n * @type {number}\r\n */\r\n get daysInYear() {\r\n return this.isValid ? daysInYear(this.year) : NaN;\r\n }\r\n\r\n /**\r\n * Returns the number of weeks in this DateTime's year\r\n * @see https://en.wikipedia.org/wiki/ISO_week_date\r\n * @example DateTime.local(2004).weeksInWeekYear //=> 53\r\n * @example DateTime.local(2013).weeksInWeekYear //=> 52\r\n * @type {number}\r\n */\r\n get weeksInWeekYear() {\r\n return this.isValid ? weeksInWeekYear(this.weekYear) : NaN;\r\n }\r\n\r\n /**\r\n * Returns the resolved Intl options for this DateTime.\r\n * This is useful in understanding the behavior of formatting methods\r\n * @param {Object} opts - the same options as toLocaleString\r\n * @return {Object}\r\n */\r\n resolvedLocaleOpts(opts = {}) {\r\n const { locale, numberingSystem, calendar } = Formatter.create(\r\n this.loc.clone(opts),\r\n opts\r\n ).resolvedOptions(this);\r\n return { locale, numberingSystem, outputCalendar: calendar };\r\n }\r\n\r\n // TRANSFORM\r\n\r\n /**\r\n * \"Set\" the DateTime's zone to UTC. Returns a newly-constructed DateTime.\r\n *\r\n * Equivalent to {@link setZone}('utc')\r\n * @param {number} [offset=0] - optionally, an offset from UTC in minutes\r\n * @param {Object} [opts={}] - options to pass to `setZone()`\r\n * @return {DateTime}\r\n */\r\n toUTC(offset = 0, opts = {}) {\r\n return this.setZone(FixedOffsetZone.instance(offset), opts);\r\n }\r\n\r\n /**\r\n * \"Set\" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.\r\n *\r\n * Equivalent to `setZone('local')`\r\n * @return {DateTime}\r\n */\r\n toLocal() {\r\n return this.setZone(new LocalZone());\r\n }\r\n\r\n /**\r\n * \"Set\" the DateTime's zone to specified zone. Returns a newly-constructed DateTime.\r\n *\r\n * By default, the setter keeps the underlying time the same (as in, the same UTC timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link plus}. You may wish to use {@link toLocal} and {@link toUTC} which provide simple convenience wrappers for commonly used zones.\r\n * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'utc+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link Zone} class.\r\n * @param {Object} opts - options\r\n * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this.\r\n * @return {DateTime}\r\n */\r\n setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) {\r\n zone = normalizeZone(zone, Settings.defaultZone);\r\n if (zone.equals(this.zone)) {\r\n return this;\r\n } else if (!zone.isValid) {\r\n return DateTime.invalid(unsupportedZone(zone));\r\n } else {\r\n const newTS =\r\n keepLocalTime || keepCalendarTime // keepCalendarTime is the deprecated name for keepLocalTime\r\n ? this.ts + (this.o - zone.offset(this.ts)) * 60 * 1000\r\n : this.ts;\r\n return clone(this, { ts: newTS, zone });\r\n }\r\n }\r\n\r\n /**\r\n * \"Set\" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.\r\n * @param {Object} properties - the properties to set\r\n * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' })\r\n * @return {DateTime}\r\n */\r\n reconfigure({ locale, numberingSystem, outputCalendar } = {}) {\r\n const loc = this.loc.clone({ locale, numberingSystem, outputCalendar });\r\n return clone(this, { loc });\r\n }\r\n\r\n /**\r\n * \"Set\" the locale. Returns a newly-constructed DateTime.\r\n * Just a convenient alias for reconfigure({ locale })\r\n * @example DateTime.local(2017, 5, 25).setLocale('en-GB')\r\n * @return {DateTime}\r\n */\r\n setLocale(locale) {\r\n return this.reconfigure({ locale });\r\n }\r\n\r\n /**\r\n * \"Set\" the values of specified units. Returns a newly-constructed DateTime.\r\n * You can only set units with this method; for \"setting\" metadata, see {@link reconfigure} and {@link setZone}.\r\n * @param {Object} values - a mapping of units to numbers\r\n * @example dt.set({ year: 2017 })\r\n * @example dt.set({ hour: 8, minute: 30 })\r\n * @example dt.set({ weekday: 5 })\r\n * @example dt.set({ year: 2005, ordinal: 234 })\r\n * @return {DateTime}\r\n */\r\n set(values) {\r\n if (!this.isValid) return this;\r\n\r\n const normalized = normalizeObject(values, normalizeUnit),\r\n settingWeekStuff =\r\n !isUndefined(normalized.weekYear) ||\r\n !isUndefined(normalized.weekNumber) ||\r\n !isUndefined(normalized.weekday);\r\n\r\n let mixed;\r\n if (settingWeekStuff) {\r\n mixed = weekToGregorian(Object.assign(gregorianToWeek(this.c), normalized));\r\n } else if (!isUndefined(normalized.ordinal)) {\r\n mixed = ordinalToGregorian(Object.assign(gregorianToOrdinal(this.c), normalized));\r\n } else {\r\n mixed = Object.assign(this.toObject(), normalized);\r\n\r\n // if we didn't set the day but we ended up on an overflow date,\r\n // use the last day of the right month\r\n if (isUndefined(normalized.day)) {\r\n mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day);\r\n }\r\n }\r\n\r\n const [ts, o] = objToTS(mixed, this.o, this.zone);\r\n return clone(this, { ts, o });\r\n }\r\n\r\n /**\r\n * Add a period of time to this DateTime and return the resulting DateTime\r\n *\r\n * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between.\r\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\r\n * @example DateTime.local().plus(123) //~> in 123 milliseconds\r\n * @example DateTime.local().plus({ minutes: 15 }) //~> in 15 minutes\r\n * @example DateTime.local().plus({ days: 1 }) //~> this time tomorrow\r\n * @example DateTime.local().plus({ days: -1 }) //~> this time yesterday\r\n * @example DateTime.local().plus({ hours: 3, minutes: 13 }) //~> in 1 hr, 13 min\r\n * @example DateTime.local().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 1 hr, 13 min\r\n * @return {DateTime}\r\n */\r\n plus(duration) {\r\n if (!this.isValid) return this;\r\n const dur = friendlyDuration(duration);\r\n return clone(this, adjustTime(this, dur));\r\n }\r\n\r\n /**\r\n * Subtract a period of time to this DateTime and return the resulting DateTime\r\n * See {@link plus}\r\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\r\n @return {DateTime}\r\n */\r\n minus(duration) {\r\n if (!this.isValid) return this;\r\n const dur = friendlyDuration(duration).negate();\r\n return clone(this, adjustTime(this, dur));\r\n }\r\n\r\n /**\r\n * \"Set\" this DateTime to the beginning of a unit of time.\r\n * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'month', 'day', 'hour', 'minute', 'second', or 'millisecond'.\r\n * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01'\r\n * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01'\r\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00'\r\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00'\r\n * @return {DateTime}\r\n */\r\n startOf(unit) {\r\n if (!this.isValid) return this;\r\n const o = {},\r\n normalizedUnit = Duration.normalizeUnit(unit);\r\n switch (normalizedUnit) {\r\n case \"years\":\r\n o.month = 1;\r\n // falls through\r\n case \"quarters\":\r\n case \"months\":\r\n o.day = 1;\r\n // falls through\r\n case \"weeks\":\r\n case \"days\":\r\n o.hour = 0;\r\n // falls through\r\n case \"hours\":\r\n o.minute = 0;\r\n // falls through\r\n case \"minutes\":\r\n o.second = 0;\r\n // falls through\r\n case \"seconds\":\r\n o.millisecond = 0;\r\n break;\r\n case \"milliseconds\":\r\n break;\r\n default:\r\n throw new InvalidUnitError(unit);\r\n }\r\n\r\n if (normalizedUnit === \"weeks\") {\r\n o.weekday = 1;\r\n }\r\n\r\n if (normalizedUnit === \"quarters\") {\r\n const q = Math.ceil(this.month / 3);\r\n o.month = (q - 1) * 3 + 1;\r\n }\r\n\r\n return this.set(o);\r\n }\r\n\r\n /**\r\n * \"Set\" this DateTime to the end (i.e. the last millisecond) of a unit of time\r\n * @param {string} unit - The unit to go to the end of. Can be 'year', 'month', 'day', 'hour', 'minute', 'second', or 'millisecond'.\r\n * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00'\r\n * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00'\r\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00'\r\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00'\r\n * @return {DateTime}\r\n */\r\n endOf(unit) {\r\n return this.isValid\r\n ? this.startOf(unit)\r\n .plus({ [unit]: 1 })\r\n .minus(1)\r\n : this;\r\n }\r\n\r\n // OUTPUT\r\n\r\n /**\r\n * Returns a string representation of this DateTime formatted according to the specified format string.\r\n * **You may not want this.** See {@link toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/docs/manual/formatting.html#table-of-tokens).\r\n * Defaults to en-US if no locale has been specified, regardless of the system's locale.\r\n * @see https://moment.github.io/luxon/docs/manual/formatting.html#table-of-tokens\r\n * @param {string} fmt - the format string\r\n * @param {Object} opts - opts to override the configuration options\r\n * @example DateTime.local().toFormat('yyyy LLL dd') //=> '2017 Apr 22'\r\n * @example DateTime.local().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22'\r\n * @example DateTime.local().toFormat('yyyy LLL dd', { locale: \"fr\" }) //=> '2017 avr. 22'\r\n * @example DateTime.local().toFormat(\"HH 'hours and' mm 'minutes'\") //=> '20 hours and 55 minutes'\r\n * @return {string}\r\n */\r\n toFormat(fmt, opts = {}) {\r\n return this.isValid\r\n ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt)\r\n : INVALID;\r\n }\r\n\r\n /**\r\n * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.\r\n * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation.\r\n * of the DateTime in the assigned locale.\r\n * Defaults to the system's locale if no locale has been specified\r\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\r\n * @param opts {Object} - Intl.DateTimeFormat constructor options and configuration options\r\n * @example DateTime.local().toLocaleString(); //=> 4/20/2017\r\n * @example DateTime.local().setLocale('en-gb').toLocaleString(); //=> '20/04/2017'\r\n * @example DateTime.local().toLocaleString({ locale: \"en-gb\" }); //=> '20/04/2017'\r\n * @example DateTime.local().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017'\r\n * @example DateTime.local().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM'\r\n * @example DateTime.local().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM'\r\n * @example DateTime.local().toLocaleString({weekday: 'long', month: 'long', day: '2-digit'}); //=> 'Thu, Apr 20'\r\n * @example DateTime.local().toLocaleString({weekday: 'long', month: 'long', day: '2-digit', hour: '2-digit', minute: '2-digit'}); //=> 'Thu, Apr 20, 11:27'\r\n * @example DateTime.local().toLocaleString({hour: '2-digit', minute: '2-digit'}); //=> '11:32'\r\n * @return {string}\r\n */\r\n toLocaleString(opts = Formats.DATE_SHORT) {\r\n return this.isValid\r\n ? Formatter.create(this.loc.clone(opts), opts).formatDateTime(this)\r\n : INVALID;\r\n }\r\n\r\n /**\r\n * Returns an array of format \"parts\", i.e. individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.\r\n * Defaults to the system's locale if no locale has been specified\r\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts\r\n * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`.\r\n * @example DateTime.local().toLocaleString(); //=> [\r\n * //=> { type: 'day', value: '25' },\r\n * //=> { type: 'literal', value: '/' },\r\n * //=> { type: 'month', value: '05' },\r\n * //=> { type: 'literal', value: '/' },\r\n * //=> { type: 'year', value: '1982' }\r\n * //=> ]\r\n */\r\n toLocaleParts(opts = {}) {\r\n return this.isValid\r\n ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this)\r\n : [];\r\n }\r\n\r\n /**\r\n * Returns an ISO 8601-compliant string representation of this DateTime\r\n * @param {Object} opts - options\r\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\r\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\r\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\r\n * @example DateTime.utc(1982, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z'\r\n * @example DateTime.local().toISO() //=> '2017-04-22T20:47:05.335-04:00'\r\n * @example DateTime.local().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335'\r\n * @return {string}\r\n */\r\n toISO(opts = {}) {\r\n if (!this.isValid) {\r\n return null;\r\n }\r\n\r\n return `${this.toISODate()}T${this.toISOTime(opts)}`;\r\n }\r\n\r\n /**\r\n * Returns an ISO 8601-compliant string representation of this DateTime's date component\r\n * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25'\r\n * @return {string}\r\n */\r\n toISODate() {\r\n return toTechFormat(this, \"yyyy-MM-dd\");\r\n }\r\n\r\n /**\r\n * Returns an ISO 8601-compliant string representation of this DateTime's week date\r\n * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2'\r\n * @return {string}\r\n */\r\n toISOWeekDate() {\r\n return toTechFormat(this, \"kkkk-'W'WW-c\");\r\n }\r\n\r\n /**\r\n * Returns an ISO 8601-compliant string representation of this DateTime's time component\r\n * @param {Object} opts - options\r\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\r\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\r\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\r\n * @example DateTime.utc().hour(7).minute(34).toISOTime() //=> '07:34:19.361Z'\r\n * @example DateTime.utc().hour(7).minute(34).toISOTime({ suppressSeconds: true }) //=> '07:34Z'\r\n * @return {string}\r\n */\r\n toISOTime({ suppressMilliseconds = false, suppressSeconds = false, includeOffset = true } = {}) {\r\n return toTechTimeFormat(this, { suppressSeconds, suppressMilliseconds, includeOffset });\r\n }\r\n\r\n /**\r\n * Returns an RFC 2822-compatible string representation of this DateTime, always in UTC\r\n * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000'\r\n * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400'\r\n * @return {string}\r\n */\r\n toRFC2822() {\r\n return toTechFormat(this, \"EEE, dd LLL yyyy HH:mm:ss ZZZ\");\r\n }\r\n\r\n /**\r\n * Returns a string representation of this DateTime appropriate for use in HTTP headers.\r\n * Specifically, the string conforms to RFC 1123.\r\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\r\n * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT'\r\n * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT'\r\n * @return {string}\r\n */\r\n toHTTP() {\r\n return toTechFormat(this.toUTC(), \"EEE, dd LLL yyyy HH:mm:ss 'GMT'\");\r\n }\r\n\r\n /**\r\n * Returns a string representation of this DateTime appropriate for use in SQL Date\r\n * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13'\r\n * @return {string}\r\n */\r\n toSQLDate() {\r\n return toTechFormat(this, \"yyyy-MM-dd\");\r\n }\r\n\r\n /**\r\n * Returns a string representation of this DateTime appropriate for use in SQL Time\r\n * @param {Object} opts - options\r\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overides includeOffset.\r\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\r\n * @example DateTime.utc().toSQL() //=> '05:15:16.345'\r\n * @example DateTime.local().toSQL() //=> '05:15:16.345 -04:00'\r\n * @example DateTime.local().toSQL({ includeOffset: false }) //=> '05:15:16.345'\r\n * @example DateTime.local().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York'\r\n * @return {string}\r\n */\r\n toSQLTime({ includeOffset = true, includeZone = false } = {}) {\r\n return toTechTimeFormat(this, { includeOffset, includeZone, spaceZone: true });\r\n }\r\n\r\n /**\r\n * Returns a string representation of this DateTime appropriate for use in SQL DateTime\r\n * @param {Object} opts - options\r\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\r\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\r\n * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z'\r\n * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00'\r\n * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000'\r\n * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York'\r\n * @return {string}\r\n */\r\n toSQL(opts = {}) {\r\n if (!this.isValid) {\r\n return null;\r\n }\r\n\r\n return `${this.toSQLDate()} ${this.toSQLTime(opts)}`;\r\n }\r\n\r\n /**\r\n * Returns a string representation of this DateTime appropriate for debugging\r\n * @return {string}\r\n */\r\n toString() {\r\n return this.isValid ? this.toISO() : INVALID;\r\n }\r\n\r\n /**\r\n * Returns the epoch milliseconds of this DateTime. Alias of {@link toMillis}\r\n * @return {number}\r\n */\r\n valueOf() {\r\n return this.toMillis();\r\n }\r\n\r\n /**\r\n * Returns the epoch milliseconds of this DateTime.\r\n * @return {number}\r\n */\r\n toMillis() {\r\n return this.isValid ? this.ts : NaN;\r\n }\r\n\r\n /**\r\n * Returns the epoch seconds of this DateTime.\r\n * @return {number}\r\n */\r\n toSeconds() {\r\n return this.isValid ? this.ts / 1000 : NaN;\r\n }\r\n\r\n /**\r\n * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.\r\n * @return {string}\r\n */\r\n toJSON() {\r\n return this.toISO();\r\n }\r\n\r\n /**\r\n * Returns a BSON serializable equivalent to this DateTime.\r\n * @return {Date}\r\n */\r\n toBSON() {\r\n return this.toJSDate();\r\n }\r\n\r\n /**\r\n * Returns a Javascript object with this DateTime's year, month, day, and so on.\r\n * @param opts - options for generating the object\r\n * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output\r\n * @example DateTime.local().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 }\r\n * @return {Object}\r\n */\r\n toObject(opts = {}) {\r\n if (!this.isValid) return {};\r\n\r\n const base = Object.assign({}, this.c);\r\n\r\n if (opts.includeConfig) {\r\n base.outputCalendar = this.outputCalendar;\r\n base.numberingSystem = this.loc.numberingSystem;\r\n base.locale = this.loc.locale;\r\n }\r\n return base;\r\n }\r\n\r\n /**\r\n * Returns a Javascript Date equivalent to this DateTime.\r\n * @return {Date}\r\n */\r\n toJSDate() {\r\n return new Date(this.isValid ? this.ts : NaN);\r\n }\r\n\r\n // COMPARE\r\n\r\n /**\r\n * Return the difference between two DateTimes as a Duration.\r\n * @param {DateTime} otherDateTime - the DateTime to compare this one to\r\n * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration.\r\n * @param {Object} opts - options that affect the creation of the Duration\r\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\r\n * @example\r\n * var i1 = DateTime.fromISO('1982-05-25T09:45'),\r\n * i2 = DateTime.fromISO('1983-10-14T10:30');\r\n * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 }\r\n * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 }\r\n * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 }\r\n * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 }\r\n * @return {Duration}\r\n */\r\n diff(otherDateTime, unit = \"milliseconds\", opts = {}) {\r\n if (!this.isValid || !otherDateTime.isValid)\r\n return Duration.invalid(this.invalid || otherDateTime.invalid);\r\n\r\n const units = maybeArray(unit).map(Duration.normalizeUnit),\r\n otherIsLater = otherDateTime.valueOf() > this.valueOf(),\r\n earlier = otherIsLater ? this : otherDateTime,\r\n later = otherIsLater ? otherDateTime : this,\r\n diffed = diff(earlier, later, units, opts);\r\n\r\n return otherIsLater ? diffed.negate() : diffed;\r\n }\r\n\r\n /**\r\n * Return the difference between this DateTime and right now.\r\n * See {@link diff}\r\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration\r\n * @param {Object} opts - options that affect the creation of the Duration\r\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\r\n * @return {Duration}\r\n */\r\n diffNow(unit = \"milliseconds\", opts = {}) {\r\n return this.diff(DateTime.local(), unit, opts);\r\n }\r\n\r\n /**\r\n * Return an Interval spanning between this DateTime and another DateTime\r\n * @param {DateTime} otherDateTime - the other end point of the Interval\r\n * @return {Interval}\r\n */\r\n until(otherDateTime) {\r\n return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;\r\n }\r\n\r\n /**\r\n * Return whether this DateTime is in the same unit of time as another DateTime\r\n * @param {DateTime} otherDateTime - the other DateTime\r\n * @param {string} unit - the unit of time to check sameness on\r\n * @example DateTime.local().hasSame(otherDT, 'day'); //~> true if both the same calendar day\r\n * @return {boolean}\r\n */\r\n hasSame(otherDateTime, unit) {\r\n if (!this.isValid) return false;\r\n if (unit === \"millisecond\") {\r\n return this.valueOf() === otherDateTime.valueOf();\r\n } else {\r\n const inputMs = otherDateTime.valueOf();\r\n return this.startOf(unit) <= inputMs && inputMs <= this.endOf(unit);\r\n }\r\n }\r\n\r\n /**\r\n * Equality check\r\n * Two DateTimes are equal iff they represent the same millisecond, have the same zone and location, and are both valid.\r\n * To compare just the millisecond values, use `+dt1 === ~dt2`.\r\n * @param {DateTime} other - the other DateTime\r\n * @return {boolean}\r\n */\r\n equals(other) {\r\n return (\r\n this.isValid &&\r\n other.isValid &&\r\n this.valueOf() === other.valueOf() &&\r\n this.zone.equals(other.zone) &&\r\n this.loc.equals(other.loc)\r\n );\r\n }\r\n\r\n /**\r\n * Return the min of several date times\r\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum\r\n * @return {DateTime} the min DateTime, or undefined if called with no argument\r\n */\r\n static min(...dateTimes) {\r\n return bestBy(dateTimes, i => i.valueOf(), Math.min);\r\n }\r\n\r\n /**\r\n * Return the max of several date times\r\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum\r\n * @return {DateTime} the max DateTime, or undefined if called with no argument\r\n */\r\n static max(...dateTimes) {\r\n return bestBy(dateTimes, i => i.valueOf(), Math.max);\r\n }\r\n\r\n // MISC\r\n\r\n /**\r\n * Explain how a string would be parsed by fromFormat()\r\n * @param {string} text - the string to parse\r\n * @param {string} fmt - the format the string is expected to be in (see description)\r\n * @param {Object} options - options taken by fromFormat()\r\n * @return {Object}\r\n */\r\n static fromFormatExplain(text, fmt, options = {}) {\r\n const { locale = null, numberingSystem = null } = options,\r\n localeToUse = Locale.fromOpts({ locale, numberingSystem, defaultToEN: true });\r\n return explainFromTokens(localeToUse, text, fmt);\r\n }\r\n\r\n /**\r\n * @deprecated use fromFormatExplain instead\r\n */\r\n static fromStringExplain(text, fmt, options = {}) {\r\n return DateTime.fromFormatExplain(text, fmt, options);\r\n }\r\n\r\n // FORMAT PRESETS\r\n\r\n /**\r\n * {@link toLocaleString} format like 10/14/1983\r\n * @type {Object}\r\n */\r\n static get DATE_SHORT() {\r\n return Formats.DATE_SHORT;\r\n }\r\n\r\n /**\r\n * {@link toLocaleString} format like 'Oct 14, 1983'\r\n * @type {Object}\r\n */\r\n static get DATE_MED() {\r\n return Formats.DATE_MED;\r\n }\r\n\r\n /**\r\n * {@link toLocaleString} format like 'October 14, 1983'\r\n * @type {Object}\r\n */\r\n static get DATE_FULL() {\r\n return Formats.DATE_FULL;\r\n }\r\n\r\n /**\r\n * {@link toLocaleString} format like 'Tuesday, October 14, 1983'\r\n * @type {Object}\r\n */\r\n static get DATE_HUGE() {\r\n return Formats.DATE_HUGE;\r\n }\r\n\r\n /**\r\n * {@link toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.\r\n * @type {Object}\r\n */\r\n static get TIME_SIMPLE() {\r\n return Formats.TIME_SIMPLE;\r\n }\r\n\r\n /**\r\n * {@link toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.\r\n * @type {Object}\r\n */\r\n static get TIME_WITH_SECONDS() {\r\n return Formats.TIME_WITH_SECONDS;\r\n }\r\n\r\n /**\r\n * {@link toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.\r\n * @type {Object}\r\n */\r\n static get TIME_WITH_SHORT_OFFSET() {\r\n return Formats.TIME_WITH_SHORT_OFFSET;\r\n }\r\n\r\n /**\r\n * {@link toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.\r\n * @type {Object}\r\n */\r\n static get TIME_WITH_LONG_OFFSET() {\r\n return Formats.TIME_WITH_LONG_OFFSET;\r\n }\r\n\r\n /**\r\n * {@link toLocaleString} format like '09:30', always 24-hour.\r\n * @type {Object}\r\n */\r\n static get TIME_24_SIMPLE() {\r\n return Formats.TIME_24_SIMPLE;\r\n }\r\n\r\n /**\r\n * {@link toLocaleString} format like '09:30:23', always 24-hour.\r\n * @type {Object}\r\n */\r\n static get TIME_24_WITH_SECONDS() {\r\n return Formats.TIME_24_WITH_SECONDS;\r\n }\r\n\r\n /**\r\n * {@link toLocaleString} format like '09:30:23 EDT', always 24-hour.\r\n * @type {Object}\r\n */\r\n static get TIME_24_WITH_SHORT_OFFSET() {\r\n return Formats.TIME_24_WITH_SHORT_OFFSET;\r\n }\r\n\r\n /**\r\n * {@link toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.\r\n * @type {Object}\r\n */\r\n static get TIME_24_WITH_LONG_OFFSET() {\r\n return Formats.TIME_24_WITH_LONG_OFFSET;\r\n }\r\n\r\n /**\r\n * {@link toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.\r\n * @type {Object}\r\n */\r\n static get DATETIME_SHORT() {\r\n return Formats.DATETIME_SHORT;\r\n }\r\n\r\n /**\r\n * {@link toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.\r\n * @type {Object}\r\n */\r\n static get DATETIME_SHORT_WITH_SECONDS() {\r\n return Formats.DATETIME_SHORT_WITH_SECONDS;\r\n }\r\n\r\n /**\r\n * {@link toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.\r\n * @type {Object}\r\n */\r\n static get DATETIME_MED() {\r\n return Formats.DATETIME_MED;\r\n }\r\n\r\n /**\r\n * {@link toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.\r\n * @type {Object}\r\n */\r\n static get DATETIME_MED_WITH_SECONDS() {\r\n return Formats.DATETIME_MED_WITH_SECONDS;\r\n }\r\n\r\n /**\r\n * {@link toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.\r\n * @type {Object}\r\n */\r\n static get DATETIME_FULL() {\r\n return Formats.DATETIME_FULL;\r\n }\r\n\r\n /**\r\n * {@link toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.\r\n * @type {Object}\r\n */\r\n static get DATETIME_FULL_WITH_SECONDS() {\r\n return Formats.DATETIME_FULL_WITH_SECONDS;\r\n }\r\n\r\n /**\r\n * {@link toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.\r\n * @type {Object}\r\n */\r\n static get DATETIME_HUGE() {\r\n return Formats.DATETIME_HUGE;\r\n }\r\n\r\n /**\r\n * {@link toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.\r\n * @type {Object}\r\n */\r\n static get DATETIME_HUGE_WITH_SECONDS() {\r\n return Formats.DATETIME_HUGE_WITH_SECONDS;\r\n }\r\n}\r\n\r\n/**\r\n * @private\r\n */\r\nexport function friendlyDateTime(dateTimeish) {\r\n if (DateTime.isDateTime(dateTimeish)) {\r\n return dateTimeish;\r\n } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) {\r\n return DateTime.fromJSDate(dateTimeish);\r\n } else if (dateTimeish && typeof dateTimeish === \"object\") {\r\n return DateTime.fromObject(dateTimeish);\r\n } else {\r\n throw new InvalidArgumentError(\r\n `Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`\r\n );\r\n }\r\n}\r\n","// @pushrocks scope\nimport * as smartpromise from '@pushrocks/smartpromise';\n\nexport { smartpromise };\n\n// third parties\nimport * as luxon from 'luxon';\n\nexport { luxon };\n","import * as plugins from './smarttime.plugins';\n\nexport type TAvailableZone = 'Europe/Berlin';\n\nexport class ExtendedDate extends Date {\n public static fromEuropeanDate(europeanDate: string) {\n const dateArray = /(.*)\\.(.*)\\.(.*)/.exec(europeanDate);\n const luxonDate = plugins.luxon.DateTime.utc(\n parseFloat(dateArray[3]), // year\n parseFloat(dateArray[2]), // month\n parseFloat(dateArray[1]) // day\n );\n const unixMilli = luxonDate.toMillis();\n return new ExtendedDate(unixMilli);\n }\n\n /** */\n public static fromEuropeanDateAndTime(\n europeanDateArg: string,\n timeArg: string,\n zoneArg: TAvailableZone\n ) {\n const dateArray = /(.*)\\.(.*)\\.(.*)/.exec(europeanDateArg);\n const sliceDate = (dateString: string) => {\n return `0${dateString}`.slice(-2);\n };\n const dateTimeString = `${dateArray[3]}-${sliceDate(dateArray[2])}-${sliceDate(\n dateArray[1]\n )}T${timeArg}`;\n const luxonDate = plugins.luxon.DateTime.fromISO(dateTimeString, {\n zone: zoneArg\n });\n const unixMilli = luxonDate.toMillis();\n return new ExtendedDate(unixMilli);\n }\n\n constructor(unixMilli: number) {\n super(unixMilli);\n }\n}\n","import * as process from 'process';\n\n/**\n * easy high resolution time measurement\n */\nexport class HrtMeasurement {\n nanoSeconds: number = null;\n milliSeconds: number = null;\n private _hrTimeStart = null;\n private _hrTimeStopDiff = null;\n private _started: boolean = false;\n\n /**\n * start the measurement\n */\n start() {\n this._started = true;\n this._hrTimeStart = process.hrtime();\n }\n\n /**\n * stop the measurement\n */\n stop() {\n if (this._started === false) {\n console.log(\"Hasn't started yet\");\n return;\n }\n this._hrTimeStopDiff = process.hrtime(this._hrTimeStart);\n this.nanoSeconds = this._hrTimeStopDiff[0] * 1e9 + this._hrTimeStopDiff[1];\n this.milliSeconds = this.nanoSeconds / 1000000;\n return this;\n }\n\n /**\n * reset the measurement\n */\n reset() {\n this.nanoSeconds = null;\n this.milliSeconds = null;\n this._hrTimeStart = null;\n this._hrTimeStopDiff = null;\n this._started = false;\n }\n}\n","import * as plugins from './smarttime.plugins';\n\n/**\n * TimeStamp\n * smart timestamp\n */\nexport class TimeStamp {\n /**\n * returns new TimeStamp from milliseconds\n */\n public static fromMilliSeconds(milliSecondsArg) {\n return new TimeStamp(milliSecondsArg);\n }\n\n /**\n * returns new TimeStamp for now with change set\n * @param timeStampArg\n */\n public static fromTimeStamp(timeStampArg: TimeStamp) {\n const localTimeStamp = new TimeStamp();\n localTimeStamp.change = localTimeStamp.milliSeconds - timeStampArg.milliSeconds;\n return localTimeStamp;\n }\n\n /**\n * The standard JavaScript Date\n */\n public date: Date;\n\n /**\n * The time as linux time (milliseconds, not seconds though)\n * good for comparison\n */\n public milliSeconds: number;\n\n /**\n * The standard epoch time in seconds\n */\n public epochtime: number;\n\n /**\n * if derived from another TimeStamp points out the change in milliseconds\n */\n public change: number = null;\n\n constructor(creatorArg?: number) {\n if (!creatorArg) {\n this.date = new Date();\n } else if (typeof creatorArg === 'number') {\n this.date = new Date(creatorArg);\n }\n this.milliSeconds = this.date.getTime();\n this.epochtime = Math.floor(this.milliSeconds / 1000);\n }\n\n /**\n * Is the current instance older than the argument\n * @param TimeStampArg\n */\n public isOlderThan(TimeStampArg: TimeStamp, tresholdTimeArg: number = 0) {\n if (this.milliSeconds + tresholdTimeArg < TimeStampArg.milliSeconds) {\n return true;\n } else {\n return false;\n }\n }\n\n public isYoungerThanOtherTimeStamp(TimeStampArg: TimeStamp, tresholdTimeArg: number = 0) {\n if (this.milliSeconds > TimeStampArg.milliSeconds + tresholdTimeArg) {\n return true;\n } else {\n return false;\n }\n }\n\n public isYoungerThanMilliSeconds(millisecondArg: number) {\n const nowTimeStamp = new TimeStamp();\n const compareEpochTime = nowTimeStamp.epochtime - millisecondArg;\n const compareTimeStamp = new TimeStamp(compareEpochTime);\n return this.isYoungerThanOtherTimeStamp(compareTimeStamp);\n }\n}\n","import * as plugins from './smarttime.plugins';\n\nimport { TimeStamp } from './smarttime.classes.timestamp';\n\nexport type TimerState = 'initiated' | 'started' | 'paused' | 'completed';\n\nexport class Timer {\n /**\n * the original amount of milliseconds for this Timer\n */\n public timeInMilliseconds: number;\n\n /**\n * the state of the timer\n */\n public state: TimerState = 'initiated';\n\n /**\n * completed Promise\n */\n public completed: Promise<void>;\n\n /**\n * a reference to when the Timeout started\n */\n public startedAt: TimeStamp;\n\n /**\n * a reference to when a Timer has been potentially paused\n */\n public pausedAt: TimeStamp;\n\n get timeLeft(): number {\n return this.timeInMilliseconds - this.pausedAt.change;\n }\n /**\n * the current timeout the needs to be canceled when this Timer is stopped\n */\n private currentTimeout: NodeJS.Timer;\n\n // a deferred triggeted when Timer has completed\n private completedDeferred = plugins.smartpromise.defer<void>();\n\n constructor(timeInMillisecondsArg: number) {\n this.timeInMilliseconds = timeInMillisecondsArg;\n this.completed = this.completedDeferred.promise;\n }\n\n /**\n * starts the timer\n */\n public start() {\n if (!this.startedAt) {\n this.currentTimeout = setTimeout(() => {\n this.completedDeferred.resolve();\n }, this.timeInMilliseconds);\n this.startedAt = new TimeStamp();\n } else {\n throw new Error('timer has been started before. Please use resume instead');\n }\n }\n\n public pause() {\n if (this.startedAt) {\n clearTimeout(this.currentTimeout);\n this.currentTimeout = null;\n this.pausedAt = TimeStamp.fromTimeStamp(this.startedAt);\n }\n }\n\n public resume() {\n if (this.startedAt) {\n this.currentTimeout = setTimeout(() => {\n this.completedDeferred.resolve();\n }, this.timeLeft);\n } else {\n throw new Error('timer has NOT been started before. Please use .start() instead');\n }\n }\n\n public reset() {\n this.pause();\n this.startedAt = null;\n this.pausedAt = null;\n }\n}\n","export let units = {\n years: (timesArg = 1): number => {\n return timesArg * 3.154e10;\n },\n months: (timesArg = 1): number => {\n return timesArg * 2.628e9;\n },\n weeks: (timesArg = 1) => {\n return timesArg * 6.048e8;\n },\n days: (timesArg = 1) => {\n return timesArg * 8.64e7;\n },\n hours: (timesArg = 1) => {\n return timesArg * 3.6e6;\n },\n minutes: (timesArg = 1) => {\n return timesArg * 60000;\n }\n};\n\nexport interface IUnitCombinationArg {\n years?: number;\n months?: number;\n weeks?: number;\n days?: number;\n hours?: number;\n minutes?: number;\n}\n\nexport let getMilliSecondsFromUnits = (combinationArg: IUnitCombinationArg) => {\n let timeInMilliseconds = 0;\n let addMilliSeconds = milliSecondsArg => {\n timeInMilliseconds = timeInMilliseconds + milliSecondsArg;\n };\n if (combinationArg.years) {\n addMilliSeconds(units.years(combinationArg.years));\n }\n if (combinationArg.months) {\n addMilliSeconds(units.months(combinationArg.months));\n }\n if (combinationArg.weeks) {\n addMilliSeconds(units.weeks(combinationArg.weeks));\n }\n if (combinationArg.days) {\n addMilliSeconds(units.days(combinationArg.days));\n }\n if (combinationArg.hours) {\n addMilliSeconds(units.hours(combinationArg.hours));\n }\n if (combinationArg.minutes) {\n addMilliSeconds(units.minutes(combinationArg.minutes));\n }\n\n return timeInMilliseconds;\n};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// Split a filename into [root, dir, basename, ext], unix version\n// 'root' is just a slash, or nothing.\nvar splitPathRe =\n /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\nvar splitPath = function(filename) {\n return splitPathRe.exec(filename).slice(1);\n};\n\n// path.resolve([from ...], to)\n// posix version\nexports.resolve = function() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : process.cwd();\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexports.normalize = function(path) {\n var isAbsolute = exports.isAbsolute(path),\n trailingSlash = substr(path, -1) === '/';\n\n // Normalize the path\n path = normalizeArray(filter(path.split('/'), function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n\n return (isAbsolute ? '/' : '') + path;\n};\n\n// posix version\nexports.isAbsolute = function(path) {\n return path.charAt(0) === '/';\n};\n\n// posix version\nexports.join = function() {\n var paths = Array.prototype.slice.call(arguments, 0);\n return exports.normalize(filter(paths, function(p, index) {\n if (typeof p !== 'string') {\n throw new TypeError('Arguments to path.join must be strings');\n }\n return p;\n }).join('/'));\n};\n\n\n// path.relative(from, to)\n// posix version\nexports.relative = function(from, to) {\n from = exports.resolve(from).substr(1);\n to = exports.resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n};\n\nexports.sep = '/';\nexports.delimiter = ':';\n\nexports.dirname = function(path) {\n var result = splitPath(path),\n root = result[0],\n dir = result[1];\n\n if (!root && !dir) {\n // No dirname whatsoever\n return '.';\n }\n\n if (dir) {\n // It has a dirname, strip trailing slash\n dir = dir.substr(0, dir.length - 1);\n }\n\n return root + dir;\n};\n\n\nexports.basename = function(path, ext) {\n var f = splitPath(path)[2];\n // TODO: make this comparison case-insensitive on windows?\n if (ext && f.substr(-1 * ext.length) === ext) {\n f = f.substr(0, f.length - ext.length);\n }\n return f;\n};\n\n\nexports.extname = function(path) {\n return splitPath(path)[3];\n};\n\nfunction filter (xs, f) {\n if (xs.filter) return xs.filter(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n if (f(xs[i], i, xs)) res.push(xs[i]);\n }\n return res;\n}\n\n// String.prototype.substr - negative index don't work in IE8\nvar substr = 'ab'.substr(-1) === 'b'\n ? function (str, start, len) { return str.substr(start, len) }\n : function (str, start, len) {\n if (start < 0) start = str.length + start;\n return str.substr(start, len);\n }\n;\n","module.exports = function (xs, fn) {\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n var x = fn(xs[i], i);\n if (isArray(x)) res.push.apply(res, x);\n else res.push(x);\n }\n return res;\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n","'use strict';\nmodule.exports = balanced;\nfunction balanced(a, b, str) {\n if (a instanceof RegExp) a = maybeMatch(a, str);\n if (b instanceof RegExp) b = maybeMatch(b, str);\n\n var r = range(a, b, str);\n\n return r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + a.length, r[1]),\n post: str.slice(r[1] + b.length)\n };\n}\n\nfunction maybeMatch(reg, str) {\n var m = str.match(reg);\n return m ? m[0] : null;\n}\n\nbalanced.range = range;\nfunction range(a, b, str) {\n var begs, beg, left, right, result;\n var ai = str.indexOf(a);\n var bi = str.indexOf(b, ai + 1);\n var i = ai;\n\n if (ai >= 0 && bi > 0) {\n begs = [];\n left = str.length;\n\n while (i >= 0 && !result) {\n if (i == ai) {\n begs.push(i);\n ai = str.indexOf(a, i + 1);\n } else if (begs.length == 1) {\n result = [ begs.pop(), bi ];\n } else {\n beg = begs.pop();\n if (beg < left) {\n left = beg;\n right = bi;\n }\n\n bi = str.indexOf(b, i + 1);\n }\n\n i = ai < bi && ai >= 0 ? ai : bi;\n }\n\n if (begs.length) {\n result = [ left, right ];\n }\n }\n\n return result;\n}\n","var concatMap = require('concat-map');\nvar balanced = require('balanced-match');\n\nmodule.exports = expandTop;\n\nvar escSlash = '\\0SLASH'+Math.random()+'\\0';\nvar escOpen = '\\0OPEN'+Math.random()+'\\0';\nvar escClose = '\\0CLOSE'+Math.random()+'\\0';\nvar escComma = '\\0COMMA'+Math.random()+'\\0';\nvar escPeriod = '\\0PERIOD'+Math.random()+'\\0';\n\nfunction numeric(str) {\n return parseInt(str, 10) == str\n ? parseInt(str, 10)\n : str.charCodeAt(0);\n}\n\nfunction escapeBraces(str) {\n return str.split('\\\\\\\\').join(escSlash)\n .split('\\\\{').join(escOpen)\n .split('\\\\}').join(escClose)\n .split('\\\\,').join(escComma)\n .split('\\\\.').join(escPeriod);\n}\n\nfunction unescapeBraces(str) {\n return str.split(escSlash).join('\\\\')\n .split(escOpen).join('{')\n .split(escClose).join('}')\n .split(escComma).join(',')\n .split(escPeriod).join('.');\n}\n\n\n// Basically just str.split(\",\"), but handling cases\n// where we have nested braced sections, which should be\n// treated as individual members, like {a,{b,c},d}\nfunction parseCommaParts(str) {\n if (!str)\n return [''];\n\n var parts = [];\n var m = balanced('{', '}', str);\n\n if (!m)\n return str.split(',');\n\n var pre = m.pre;\n var body = m.body;\n var post = m.post;\n var p = pre.split(',');\n\n p[p.length-1] += '{' + body + '}';\n var postParts = parseCommaParts(post);\n if (post.length) {\n p[p.length-1] += postParts.shift();\n p.push.apply(p, postParts);\n }\n\n parts.push.apply(parts, p);\n\n return parts;\n}\n\nfunction expandTop(str) {\n if (!str)\n return [];\n\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.substr(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.substr(2);\n }\n\n return expand(escapeBraces(str), true).map(unescapeBraces);\n}\n\nfunction identity(e) {\n return e;\n}\n\nfunction embrace(str) {\n return '{' + str + '}';\n}\nfunction isPadded(el) {\n return /^-?0\\d/.test(el);\n}\n\nfunction lte(i, y) {\n return i <= y;\n}\nfunction gte(i, y) {\n return i >= y;\n}\n\nfunction expand(str, isTop) {\n var expansions = [];\n\n var m = balanced('{', '}', str);\n if (!m || /\\$$/.test(m.pre)) return [str];\n\n var isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body);\n var isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(m.body);\n var isSequence = isNumericSequence || isAlphaSequence;\n var isOptions = m.body.indexOf(',') >= 0;\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,.*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post;\n return expand(str);\n }\n return [str];\n }\n\n var n;\n if (isSequence) {\n n = m.body.split(/\\.\\./);\n } else {\n n = parseCommaParts(m.body);\n if (n.length === 1) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand(n[0], false).map(embrace);\n if (n.length === 1) {\n var post = m.post.length\n ? expand(m.post, false)\n : [''];\n return post.map(function(p) {\n return m.pre + n[0] + p;\n });\n }\n }\n }\n\n // at this point, n is the parts, and we know it's not a comma set\n // with a single entry.\n\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n var pre = m.pre;\n var post = m.post.length\n ? expand(m.post, false)\n : [''];\n\n var N;\n\n if (isSequence) {\n var x = numeric(n[0]);\n var y = numeric(n[1]);\n var width = Math.max(n[0].length, n[1].length)\n var incr = n.length == 3\n ? Math.abs(numeric(n[2]))\n : 1;\n var test = lte;\n var reverse = y < x;\n if (reverse) {\n incr *= -1;\n test = gte;\n }\n var pad = n.some(isPadded);\n\n N = [];\n\n for (var i = x; test(i, y); i += incr) {\n var c;\n if (isAlphaSequence) {\n c = String.fromCharCode(i);\n if (c === '\\\\')\n c = '';\n } else {\n c = String(i);\n if (pad) {\n var need = width - c.length;\n if (need > 0) {\n var z = new Array(need + 1).join('0');\n if (i < 0)\n c = '-' + z + c.slice(1);\n else\n c = z + c;\n }\n }\n }\n N.push(c);\n }\n } else {\n N = concatMap(n, function(el) { return expand(el, false) });\n }\n\n for (var j = 0; j < N.length; j++) {\n for (var k = 0; k < post.length; k++) {\n var expansion = pre + N[j] + post[k];\n if (!isTop || isSequence || expansion)\n expansions.push(expansion);\n }\n }\n\n return expansions;\n}\n\n","module.exports = minimatch\nminimatch.Minimatch = Minimatch\n\nvar path = { sep: '/' }\ntry {\n path = require('path')\n} catch (er) {}\n\nvar GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}\nvar expand = require('brace-expansion')\n\nvar plTypes = {\n '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},\n '?': { open: '(?:', close: ')?' },\n '+': { open: '(?:', close: ')+' },\n '*': { open: '(?:', close: ')*' },\n '@': { open: '(?:', close: ')' }\n}\n\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nvar qmark = '[^/]'\n\n// * => any number of characters\nvar star = qmark + '*?'\n\n// ** when dots are allowed. Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nvar twoStarDot = '(?:(?!(?:\\\\\\/|^)(?:\\\\.{1,2})($|\\\\\\/)).)*?'\n\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nvar twoStarNoDot = '(?:(?!(?:\\\\\\/|^)\\\\.).)*?'\n\n// characters that need to be escaped in RegExp.\nvar reSpecials = charSet('().*{}+?[]^$\\\\!')\n\n// \"abc\" -> { a:true, b:true, c:true }\nfunction charSet (s) {\n return s.split('').reduce(function (set, c) {\n set[c] = true\n return set\n }, {})\n}\n\n// normalizes slashes.\nvar slashSplit = /\\/+/\n\nminimatch.filter = filter\nfunction filter (pattern, options) {\n options = options || {}\n return function (p, i, list) {\n return minimatch(p, pattern, options)\n }\n}\n\nfunction ext (a, b) {\n a = a || {}\n b = b || {}\n var t = {}\n Object.keys(b).forEach(function (k) {\n t[k] = b[k]\n })\n Object.keys(a).forEach(function (k) {\n t[k] = a[k]\n })\n return t\n}\n\nminimatch.defaults = function (def) {\n if (!def || !Object.keys(def).length) return minimatch\n\n var orig = minimatch\n\n var m = function minimatch (p, pattern, options) {\n return orig.minimatch(p, pattern, ext(def, options))\n }\n\n m.Minimatch = function Minimatch (pattern, options) {\n return new orig.Minimatch(pattern, ext(def, options))\n }\n\n return m\n}\n\nMinimatch.defaults = function (def) {\n if (!def || !Object.keys(def).length) return Minimatch\n return minimatch.defaults(def).Minimatch\n}\n\nfunction minimatch (p, pattern, options) {\n if (typeof pattern !== 'string') {\n throw new TypeError('glob pattern string required')\n }\n\n if (!options) options = {}\n\n // shortcut: comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n return false\n }\n\n // \"\" only matches \"\"\n if (pattern.trim() === '') return p === ''\n\n return new Minimatch(pattern, options).match(p)\n}\n\nfunction Minimatch (pattern, options) {\n if (!(this instanceof Minimatch)) {\n return new Minimatch(pattern, options)\n }\n\n if (typeof pattern !== 'string') {\n throw new TypeError('glob pattern string required')\n }\n\n if (!options) options = {}\n pattern = pattern.trim()\n\n // windows support: need to use /, not \\\n if (path.sep !== '/') {\n pattern = pattern.split(path.sep).join('/')\n }\n\n this.options = options\n this.set = []\n this.pattern = pattern\n this.regexp = null\n this.negate = false\n this.comment = false\n this.empty = false\n\n // make the set of regexps etc.\n this.make()\n}\n\nMinimatch.prototype.debug = function () {}\n\nMinimatch.prototype.make = make\nfunction make () {\n // don't do it more than once.\n if (this._made) return\n\n var pattern = this.pattern\n var options = this.options\n\n // empty patterns and comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n this.comment = true\n return\n }\n if (!pattern) {\n this.empty = true\n return\n }\n\n // step 1: figure out negation, etc.\n this.parseNegate()\n\n // step 2: expand braces\n var set = this.globSet = this.braceExpand()\n\n if (options.debug) this.debug = console.error\n\n this.debug(this.pattern, set)\n\n // step 3: now we have a set, so turn each one into a series of path-portion\n // matching patterns.\n // These will be regexps, except in the case of \"**\", which is\n // set to the GLOBSTAR object for globstar behavior,\n // and will not contain any / characters\n set = this.globParts = set.map(function (s) {\n return s.split(slashSplit)\n })\n\n this.debug(this.pattern, set)\n\n // glob --> regexps\n set = set.map(function (s, si, set) {\n return s.map(this.parse, this)\n }, this)\n\n this.debug(this.pattern, set)\n\n // filter out everything that didn't compile properly.\n set = set.filter(function (s) {\n return s.indexOf(false) === -1\n })\n\n this.debug(this.pattern, set)\n\n this.set = set\n}\n\nMinimatch.prototype.parseNegate = parseNegate\nfunction parseNegate () {\n var pattern = this.pattern\n var negate = false\n var options = this.options\n var negateOffset = 0\n\n if (options.nonegate) return\n\n for (var i = 0, l = pattern.length\n ; i < l && pattern.charAt(i) === '!'\n ; i++) {\n negate = !negate\n negateOffset++\n }\n\n if (negateOffset) this.pattern = pattern.substr(negateOffset)\n this.negate = negate\n}\n\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nminimatch.braceExpand = function (pattern, options) {\n return braceExpand(pattern, options)\n}\n\nMinimatch.prototype.braceExpand = braceExpand\n\nfunction braceExpand (pattern, options) {\n if (!options) {\n if (this instanceof Minimatch) {\n options = this.options\n } else {\n options = {}\n }\n }\n\n pattern = typeof pattern === 'undefined'\n ? this.pattern : pattern\n\n if (typeof pattern === 'undefined') {\n throw new TypeError('undefined pattern')\n }\n\n if (options.nobrace ||\n !pattern.match(/\\{.*\\}/)) {\n // shortcut. no need to expand.\n return [pattern]\n }\n\n return expand(pattern)\n}\n\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion. Otherwise, any series\n// of * is equivalent to a single *. Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\nMinimatch.prototype.parse = parse\nvar SUBPARSE = {}\nfunction parse (pattern, isSub) {\n if (pattern.length > 1024 * 64) {\n throw new TypeError('pattern is too long')\n }\n\n var options = this.options\n\n // shortcuts\n if (!options.noglobstar && pattern === '**') return GLOBSTAR\n if (pattern === '') return ''\n\n var re = ''\n var hasMagic = !!options.nocase\n var escaping = false\n // ? => one single character\n var patternListStack = []\n var negativeLists = []\n var stateChar\n var inClass = false\n var reClassStart = -1\n var classStart = -1\n // . and .. never match anything that doesn't start with .,\n // even when options.dot is set.\n var patternStart = pattern.charAt(0) === '.' ? '' // anything\n // not (start or / followed by . or .. followed by / or end)\n : options.dot ? '(?!(?:^|\\\\\\/)\\\\.{1,2}(?:$|\\\\\\/))'\n : '(?!\\\\.)'\n var self = this\n\n function clearStateChar () {\n if (stateChar) {\n // we had some state-tracking character\n // that wasn't consumed by this pass.\n switch (stateChar) {\n case '*':\n re += star\n hasMagic = true\n break\n case '?':\n re += qmark\n hasMagic = true\n break\n default:\n re += '\\\\' + stateChar\n break\n }\n self.debug('clearStateChar %j %j', stateChar, re)\n stateChar = false\n }\n }\n\n for (var i = 0, len = pattern.length, c\n ; (i < len) && (c = pattern.charAt(i))\n ; i++) {\n this.debug('%s\\t%s %s %j', pattern, i, re, c)\n\n // skip over any that are escaped.\n if (escaping && reSpecials[c]) {\n re += '\\\\' + c\n escaping = false\n continue\n }\n\n switch (c) {\n case '/':\n // completely not allowed, even escaped.\n // Should already be path-split by now.\n return false\n\n case '\\\\':\n clearStateChar()\n escaping = true\n continue\n\n // the various stateChar values\n // for the \"extglob\" stuff.\n case '?':\n case '*':\n case '+':\n case '@':\n case '!':\n this.debug('%s\\t%s %s %j <-- stateChar', pattern, i, re, c)\n\n // all of those are literals inside a class, except that\n // the glob [!a] means [^a] in regexp\n if (inClass) {\n this.debug(' in class')\n if (c === '!' && i === classStart + 1) c = '^'\n re += c\n continue\n }\n\n // if we already have a stateChar, then it means\n // that there was something like ** or +? in there.\n // Handle the stateChar, then proceed with this one.\n self.debug('call clearStateChar %j', stateChar)\n clearStateChar()\n stateChar = c\n // if extglob is disabled, then +(asdf|foo) isn't a thing.\n // just clear the statechar *now*, rather than even diving into\n // the patternList stuff.\n if (options.noext) clearStateChar()\n continue\n\n case '(':\n if (inClass) {\n re += '('\n continue\n }\n\n if (!stateChar) {\n re += '\\\\('\n continue\n }\n\n patternListStack.push({\n type: stateChar,\n start: i - 1,\n reStart: re.length,\n open: plTypes[stateChar].open,\n close: plTypes[stateChar].close\n })\n // negation is (?:(?!js)[^/]*)\n re += stateChar === '!' ? '(?:(?!(?:' : '(?:'\n this.debug('plType %j %j', stateChar, re)\n stateChar = false\n continue\n\n case ')':\n if (inClass || !patternListStack.length) {\n re += '\\\\)'\n continue\n }\n\n clearStateChar()\n hasMagic = true\n var pl = patternListStack.pop()\n // negation is (?:(?!js)[^/]*)\n // The others are (?:<pattern>)<type>\n re += pl.close\n if (pl.type === '!') {\n negativeLists.push(pl)\n }\n pl.reEnd = re.length\n continue\n\n case '|':\n if (inClass || !patternListStack.length || escaping) {\n re += '\\\\|'\n escaping = false\n continue\n }\n\n clearStateChar()\n re += '|'\n continue\n\n // these are mostly the same in regexp and glob\n case '[':\n // swallow any state-tracking char before the [\n clearStateChar()\n\n if (inClass) {\n re += '\\\\' + c\n continue\n }\n\n inClass = true\n classStart = i\n reClassStart = re.length\n re += c\n continue\n\n case ']':\n // a right bracket shall lose its special\n // meaning and represent itself in\n // a bracket expression if it occurs\n // first in the list. -- POSIX.2 2.8.3.2\n if (i === classStart + 1 || !inClass) {\n re += '\\\\' + c\n escaping = false\n continue\n }\n\n // handle the case where we left a class open.\n // \"[z-a]\" is valid, equivalent to \"\\[z-a\\]\"\n if (inClass) {\n // split where the last [ was, make sure we don't have\n // an invalid re. if so, re-walk the contents of the\n // would-be class to re-translate any characters that\n // were passed through as-is\n // TODO: It would probably be faster to determine this\n // without a try/catch and a new RegExp, but it's tricky\n // to do safely. For now, this is safe and works.\n var cs = pattern.substring(classStart + 1, i)\n try {\n RegExp('[' + cs + ']')\n } catch (er) {\n // not a valid class!\n var sp = this.parse(cs, SUBPARSE)\n re = re.substr(0, reClassStart) + '\\\\[' + sp[0] + '\\\\]'\n hasMagic = hasMagic || sp[1]\n inClass = false\n continue\n }\n }\n\n // finish up the class.\n hasMagic = true\n inClass = false\n re += c\n continue\n\n default:\n // swallow any state char that wasn't consumed\n clearStateChar()\n\n if (escaping) {\n // no need\n escaping = false\n } else if (reSpecials[c]\n && !(c === '^' && inClass)) {\n re += '\\\\'\n }\n\n re += c\n\n } // switch\n } // for\n\n // handle the case where we left a class open.\n // \"[abc\" is valid, equivalent to \"\\[abc\"\n if (inClass) {\n // split where the last [ was, and escape it\n // this is a huge pita. We now have to re-walk\n // the contents of the would-be class to re-translate\n // any characters that were passed through as-is\n cs = pattern.substr(classStart + 1)\n sp = this.parse(cs, SUBPARSE)\n re = re.substr(0, reClassStart) + '\\\\[' + sp[0]\n hasMagic = hasMagic || sp[1]\n }\n\n // handle the case where we had a +( thing at the *end*\n // of the pattern.\n // each pattern list stack adds 3 chars, and we need to go through\n // and escape any | chars that were passed through as-is for the regexp.\n // Go through and escape them, taking care not to double-escape any\n // | chars that were already escaped.\n for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {\n var tail = re.slice(pl.reStart + pl.open.length)\n this.debug('setting tail', re, pl)\n // maybe some even number of \\, then maybe 1 \\, followed by a |\n tail = tail.replace(/((?:\\\\{2}){0,64})(\\\\?)\\|/g, function (_, $1, $2) {\n if (!$2) {\n // the | isn't already escaped, so escape it.\n $2 = '\\\\'\n }\n\n // need to escape all those slashes *again*, without escaping the\n // one that we need for escaping the | character. As it works out,\n // escaping an even number of slashes can be done by simply repeating\n // it exactly after itself. That's why this trick works.\n //\n // I am sorry that you have to see this.\n return $1 + $1 + $2 + '|'\n })\n\n this.debug('tail=%j\\n %s', tail, tail, pl, re)\n var t = pl.type === '*' ? star\n : pl.type === '?' ? qmark\n : '\\\\' + pl.type\n\n hasMagic = true\n re = re.slice(0, pl.reStart) + t + '\\\\(' + tail\n }\n\n // handle trailing things that only matter at the very end.\n clearStateChar()\n if (escaping) {\n // trailing \\\\\n re += '\\\\\\\\'\n }\n\n // only need to apply the nodot start if the re starts with\n // something that could conceivably capture a dot\n var addPatternStart = false\n switch (re.charAt(0)) {\n case '.':\n case '[':\n case '(': addPatternStart = true\n }\n\n // Hack to work around lack of negative lookbehind in JS\n // A pattern like: *.!(x).!(y|z) needs to ensure that a name\n // like 'a.xyz.yz' doesn't match. So, the first negative\n // lookahead, has to look ALL the way ahead, to the end of\n // the pattern.\n for (var n = negativeLists.length - 1; n > -1; n--) {\n var nl = negativeLists[n]\n\n var nlBefore = re.slice(0, nl.reStart)\n var nlFirst = re.slice(nl.reStart, nl.reEnd - 8)\n var nlLast = re.slice(nl.reEnd - 8, nl.reEnd)\n var nlAfter = re.slice(nl.reEnd)\n\n nlLast += nlAfter\n\n // Handle nested stuff like *(*.js|!(*.json)), where open parens\n // mean that we should *not* include the ) in the bit that is considered\n // \"after\" the negated section.\n var openParensBefore = nlBefore.split('(').length - 1\n var cleanAfter = nlAfter\n for (i = 0; i < openParensBefore; i++) {\n cleanAfter = cleanAfter.replace(/\\)[+*?]?/, '')\n }\n nlAfter = cleanAfter\n\n var dollar = ''\n if (nlAfter === '' && isSub !== SUBPARSE) {\n dollar = '$'\n }\n var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast\n re = newRe\n }\n\n // if the re is not \"\" at this point, then we need to make sure\n // it doesn't match against an empty path part.\n // Otherwise a/* will match a/, which it should not.\n if (re !== '' && hasMagic) {\n re = '(?=.)' + re\n }\n\n if (addPatternStart) {\n re = patternStart + re\n }\n\n // parsing just a piece of a larger pattern.\n if (isSub === SUBPARSE) {\n return [re, hasMagic]\n }\n\n // skip the regexp for non-magical patterns\n // unescape anything in it, though, so that it'll be\n // an exact match against a file etc.\n if (!hasMagic) {\n return globUnescape(pattern)\n }\n\n var flags = options.nocase ? 'i' : ''\n try {\n var regExp = new RegExp('^' + re + '$', flags)\n } catch (er) {\n // If it was an invalid regular expression, then it can't match\n // anything. This trick looks for a character after the end of\n // the string, which is of course impossible, except in multi-line\n // mode, but it's not a /m regex.\n return new RegExp('$.')\n }\n\n regExp._glob = pattern\n regExp._src = re\n\n return regExp\n}\n\nminimatch.makeRe = function (pattern, options) {\n return new Minimatch(pattern, options || {}).makeRe()\n}\n\nMinimatch.prototype.makeRe = makeRe\nfunction makeRe () {\n if (this.regexp || this.regexp === false) return this.regexp\n\n // at this point, this.set is a 2d array of partial\n // pattern strings, or \"**\".\n //\n // It's better to use .match(). This function shouldn't\n // be used, really, but it's pretty convenient sometimes,\n // when you just want to work with a regex.\n var set = this.set\n\n if (!set.length) {\n this.regexp = false\n return this.regexp\n }\n var options = this.options\n\n var twoStar = options.noglobstar ? star\n : options.dot ? twoStarDot\n : twoStarNoDot\n var flags = options.nocase ? 'i' : ''\n\n var re = set.map(function (pattern) {\n return pattern.map(function (p) {\n return (p === GLOBSTAR) ? twoStar\n : (typeof p === 'string') ? regExpEscape(p)\n : p._src\n }).join('\\\\\\/')\n }).join('|')\n\n // must match entire pattern\n // ending in a * or ** will make it less strict.\n re = '^(?:' + re + ')$'\n\n // can match anything, as long as it's not this.\n if (this.negate) re = '^(?!' + re + ').*$'\n\n try {\n this.regexp = new RegExp(re, flags)\n } catch (ex) {\n this.regexp = false\n }\n return this.regexp\n}\n\nminimatch.match = function (list, pattern, options) {\n options = options || {}\n var mm = new Minimatch(pattern, options)\n list = list.filter(function (f) {\n return mm.match(f)\n })\n if (mm.options.nonull && !list.length) {\n list.push(pattern)\n }\n return list\n}\n\nMinimatch.prototype.match = match\nfunction match (f, partial) {\n this.debug('match', f, this.pattern)\n // short-circuit in the case of busted things.\n // comments, etc.\n if (this.comment) return false\n if (this.empty) return f === ''\n\n if (f === '/' && partial) return true\n\n var options = this.options\n\n // windows: need to use /, not \\\n if (path.sep !== '/') {\n f = f.split(path.sep).join('/')\n }\n\n // treat the test path as a set of pathparts.\n f = f.split(slashSplit)\n this.debug(this.pattern, 'split', f)\n\n // just ONE of the pattern sets in this.set needs to match\n // in order for it to be valid. If negating, then just one\n // match means that we have failed.\n // Either way, return on the first hit.\n\n var set = this.set\n this.debug(this.pattern, 'set', set)\n\n // Find the basename of the path by looking for the last non-empty segment\n var filename\n var i\n for (i = f.length - 1; i >= 0; i--) {\n filename = f[i]\n if (filename) break\n }\n\n for (i = 0; i < set.length; i++) {\n var pattern = set[i]\n var file = f\n if (options.matchBase && pattern.length === 1) {\n file = [filename]\n }\n var hit = this.matchOne(file, pattern, partial)\n if (hit) {\n if (options.flipNegate) return true\n return !this.negate\n }\n }\n\n // didn't get any hits. this is success if it's a negative\n // pattern, failure otherwise.\n if (options.flipNegate) return false\n return this.negate\n}\n\n// set partial to true to test if, for example,\n// \"/a/b\" matches the start of \"/*/b/*/d\"\n// Partial means, if you run out of file before you run\n// out of pattern, then that's fine, as long as all\n// the parts match.\nMinimatch.prototype.matchOne = function (file, pattern, partial) {\n var options = this.options\n\n this.debug('matchOne',\n { 'this': this, file: file, pattern: pattern })\n\n this.debug('matchOne', file.length, pattern.length)\n\n for (var fi = 0,\n pi = 0,\n fl = file.length,\n pl = pattern.length\n ; (fi < fl) && (pi < pl)\n ; fi++, pi++) {\n this.debug('matchOne loop')\n var p = pattern[pi]\n var f = file[fi]\n\n this.debug(pattern, p, f)\n\n // should be impossible.\n // some invalid regexp stuff in the set.\n if (p === false) return false\n\n if (p === GLOBSTAR) {\n this.debug('GLOBSTAR', [pattern, p, f])\n\n // \"**\"\n // a/**/b/**/c would match the following:\n // a/b/x/y/z/c\n // a/x/y/z/b/c\n // a/b/x/b/x/c\n // a/b/c\n // To do this, take the rest of the pattern after\n // the **, and see if it would match the file remainder.\n // If so, return success.\n // If not, the ** \"swallows\" a segment, and try again.\n // This is recursively awful.\n //\n // a/**/b/**/c matching a/b/x/y/z/c\n // - a matches a\n // - doublestar\n // - matchOne(b/x/y/z/c, b/**/c)\n // - b matches b\n // - doublestar\n // - matchOne(x/y/z/c, c) -> no\n // - matchOne(y/z/c, c) -> no\n // - matchOne(z/c, c) -> no\n // - matchOne(c, c) yes, hit\n var fr = fi\n var pr = pi + 1\n if (pr === pl) {\n this.debug('** at the end')\n // a ** at the end will just swallow the rest.\n // We have found a match.\n // however, it will not swallow /.x, unless\n // options.dot is set.\n // . and .. are *never* matched by **, for explosively\n // exponential reasons.\n for (; fi < fl; fi++) {\n if (file[fi] === '.' || file[fi] === '..' ||\n (!options.dot && file[fi].charAt(0) === '.')) return false\n }\n return true\n }\n\n // ok, let's see if we can swallow whatever we can.\n while (fr < fl) {\n var swallowee = file[fr]\n\n this.debug('\\nglobstar while', file, fr, pattern, pr, swallowee)\n\n // XXX remove this slice. Just pass the start index.\n if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {\n this.debug('globstar found match!', fr, fl, swallowee)\n // found a match.\n return true\n } else {\n // can't swallow \".\" or \"..\" ever.\n // can only swallow \".foo\" when explicitly asked.\n if (swallowee === '.' || swallowee === '..' ||\n (!options.dot && swallowee.charAt(0) === '.')) {\n this.debug('dot detected!', file, fr, pattern, pr)\n break\n }\n\n // ** swallows a segment, and continue.\n this.debug('globstar swallow a segment, and continue')\n fr++\n }\n }\n\n // no match was found.\n // However, in partial mode, we can't say this is necessarily over.\n // If there's more *pattern* left, then\n if (partial) {\n // ran out of file\n this.debug('\\n>>> no match, partial?', file, fr, pattern, pr)\n if (fr === fl) return true\n }\n return false\n }\n\n // something other than **\n // non-magic patterns just have to match exactly\n // patterns with magic have been turned into regexps.\n var hit\n if (typeof p === 'string') {\n if (options.nocase) {\n hit = f.toLowerCase() === p.toLowerCase()\n } else {\n hit = f === p\n }\n this.debug('string match', p, f, hit)\n } else {\n hit = f.match(p)\n this.debug('pattern match', p, f, hit)\n }\n\n if (!hit) return false\n }\n\n // Note: ending in / means that we'll get a final \"\"\n // at the end of the pattern. This can only match a\n // corresponding \"\" at the end of the file.\n // If the file ends in /, then it can only match a\n // a pattern that ends in /, unless the pattern just\n // doesn't have any more for it. But, a/b/ should *not*\n // match \"a/b/*\", even though \"\" matches against the\n // [^/]*? pattern, except in partial mode, where it might\n // simply not be reached yet.\n // However, a/b/ should still satisfy a/*\n\n // now either we fell off the end of the pattern, or we're done.\n if (fi === fl && pi === pl) {\n // ran out of pattern and filename at the same time.\n // an exact hit!\n return true\n } else if (fi === fl) {\n // ran out of file, but still had pattern left.\n // this is ok if we're doing the match as part of\n // a glob fs traversal.\n return partial\n } else if (pi === pl) {\n // ran out of pattern, still have file left.\n // this is only acceptable if we're on the very last\n // empty segment of a file with a trailing slash.\n // a/* should match a/b/\n var emptyFileEnd = (fi === fl - 1) && (file[fi] === '')\n return emptyFileEnd\n }\n\n // should be unreachable.\n throw new Error('wtf?')\n}\n\n// replace stuff like \\* with *\nfunction globUnescape (s) {\n return s.replace(/\\\\(.)/g, '$1')\n}\n\nfunction regExpEscape (s) {\n return s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n}\n","'use strict';\n\nmodule.exports = class SymbolTreeNode {\n constructor() {\n this.parent = null;\n this.previousSibling = null;\n this.nextSibling = null;\n\n this.firstChild = null;\n this.lastChild = null;\n\n /** This value is incremented anytime a children is added or removed */\n this.childrenVersion = 0;\n /** The last child object which has a cached index */\n this.childIndexCachedUpTo = null;\n\n /** This value represents the cached node index, as long as\n * cachedIndexVersion matches with the childrenVersion of the parent */\n this.cachedIndex = -1;\n this.cachedIndexVersion = NaN; // NaN is never equal to anything\n }\n\n get isAttached() {\n return Boolean(this.parent || this.previousSibling || this.nextSibling);\n }\n\n get hasChildren() {\n return Boolean(this.firstChild);\n }\n\n childrenChanged() {\n /* jshint -W016 */\n // integer wrap around\n this.childrenVersion = (this.childrenVersion + 1) & 0xFFFFFFFF;\n this.childIndexCachedUpTo = null;\n }\n\n getCachedIndex(parentNode) {\n // (assumes parentNode is actually the parent)\n if (this.cachedIndexVersion !== parentNode.childrenVersion) {\n this.cachedIndexVersion = NaN;\n // cachedIndex is no longer valid\n return -1;\n }\n\n return this.cachedIndex; // -1 if not cached\n }\n\n setCachedIndex(parentNode, index) {\n // (assumes parentNode is actually the parent)\n this.cachedIndexVersion = parentNode.childrenVersion;\n this.cachedIndex = index;\n }\n};\n","'use strict';\n\n/* eslint-disable sort-keys */\nmodule.exports = Object.freeze({\n // same as DOM DOCUMENT_POSITION_\n DISCONNECTED: 1,\n PRECEDING: 2,\n FOLLOWING: 4,\n CONTAINS: 8,\n CONTAINED_BY: 16,\n});\n","'use strict';\n\nconst TREE = Symbol();\nconst ROOT = Symbol();\nconst NEXT = Symbol();\nconst ITERATE_FUNC = Symbol();\n\nclass TreeIterator {\n constructor(tree, root, firstResult, iterateFunction) {\n this[TREE] = tree;\n this[ROOT] = root;\n this[NEXT] = firstResult;\n this[ITERATE_FUNC] = iterateFunction;\n }\n\n next() {\n const tree = this[TREE];\n const iterateFunc = this[ITERATE_FUNC];\n const root = this[ROOT];\n\n if (!this[NEXT]) {\n return {\n done: true,\n value: root,\n };\n }\n\n const value = this[NEXT];\n\n if (iterateFunc === 1) {\n this[NEXT] = tree._node(value).previousSibling;\n }\n else if (iterateFunc === 2) {\n this[NEXT] = tree._node(value).nextSibling;\n }\n else if (iterateFunc === 3) {\n this[NEXT] = tree._node(value).parent;\n }\n else if (iterateFunc === 4) {\n this[NEXT] = tree.preceding(value, {root: root});\n }\n else /* if (iterateFunc === 5)*/ {\n this[NEXT] = tree.following(value, {root: root});\n }\n\n return {\n done: false,\n value: value,\n };\n }\n}\n\nObject.defineProperty(TreeIterator.prototype, Symbol.iterator, {\n value: function() {\n return this;\n },\n writable: false,\n});\n\nTreeIterator.PREV = 1;\nTreeIterator.NEXT = 2;\nTreeIterator.PARENT = 3;\nTreeIterator.PRECEDING = 4;\nTreeIterator.FOLLOWING = 5;\n\nObject.freeze(TreeIterator);\nObject.freeze(TreeIterator.prototype);\n\nmodule.exports = TreeIterator;\n","'use strict';\n\n/**\n * @module symbol-tree\n * @author Joris van der Wel <joris@jorisvanderwel.com>\n */\n\nconst SymbolTreeNode = require('./SymbolTreeNode');\nconst TreePosition = require('./TreePosition');\nconst TreeIterator = require('./TreeIterator');\n\nfunction returnTrue() {\n return true;\n}\n\nfunction reverseArrayIndex(array, reverseIndex) {\n return array[array.length - 1 - reverseIndex]; // no need to check `index >= 0`\n}\n\nclass SymbolTree {\n\n /**\n * @constructor\n * @alias module:symbol-tree\n * @param {string} [description='SymbolTree data'] Description used for the Symbol\n */\n constructor(description) {\n this.symbol = Symbol(description || 'SymbolTree data');\n }\n\n /**\n * You can use this function to (optionally) initialize an object right after its creation,\n * to take advantage of V8's fast properties. Also useful if you would like to\n * freeze your object.\n *\n * `O(1)`\n *\n * @method\n * @alias module:symbol-tree#initialize\n * @param {Object} object\n * @return {Object} object\n */\n initialize(object) {\n this._node(object);\n\n return object;\n }\n\n _node(object) {\n if (!object) {\n return null;\n }\n\n const node = object[this.symbol];\n\n if (node) {\n return node;\n }\n\n return (object[this.symbol] = new SymbolTreeNode());\n }\n\n /**\n * Returns `true` if the object has any children. Otherwise it returns `false`.\n *\n * * `O(1)`\n *\n * @method hasChildren\n * @memberOf module:symbol-tree#\n * @param {Object} object\n * @return {Boolean}\n */\n hasChildren(object) {\n return this._node(object).hasChildren;\n }\n\n /**\n * Returns the first child of the given object.\n *\n * * `O(1)`\n *\n * @method firstChild\n * @memberOf module:symbol-tree#\n * @param {Object} object\n * @return {Object}\n */\n firstChild(object) {\n return this._node(object).firstChild;\n }\n\n /**\n * Returns the last child of the given object.\n *\n * * `O(1)`\n *\n * @method lastChild\n * @memberOf module:symbol-tree#\n * @param {Object} object\n * @return {Object}\n */\n lastChild(object) {\n return this._node(object).lastChild;\n }\n\n /**\n * Returns the previous sibling of the given object.\n *\n * * `O(1)`\n *\n * @method previousSibling\n * @memberOf module:symbol-tree#\n * @param {Object} object\n * @return {Object}\n */\n previousSibling(object) {\n return this._node(object).previousSibling;\n }\n\n /**\n * Returns the next sibling of the given object.\n *\n * * `O(1)`\n *\n * @method nextSibling\n * @memberOf module:symbol-tree#\n * @param {Object} object\n * @return {Object}\n */\n nextSibling(object) {\n return this._node(object).nextSibling;\n }\n\n /**\n * Return the parent of the given object.\n *\n * * `O(1)`\n *\n * @method parent\n * @memberOf module:symbol-tree#\n * @param {Object} object\n * @return {Object}\n */\n parent(object) {\n return this._node(object).parent;\n }\n\n /**\n * Find the inclusive descendant that is last in tree order of the given object.\n *\n * * `O(n)` (worst case) where `n` is the depth of the subtree of `object`\n *\n * @method lastInclusiveDescendant\n * @memberOf module:symbol-tree#\n * @param {Object} object\n * @return {Object}\n */\n lastInclusiveDescendant(object) {\n let lastChild;\n let current = object;\n\n while ((lastChild = this._node(current).lastChild)) {\n current = lastChild;\n }\n\n return current;\n }\n\n /**\n * Find the preceding object (A) of the given object (B).\n * An object A is preceding an object B if A and B are in the same tree\n * and A comes before B in tree order.\n *\n * * `O(n)` (worst case)\n * * `O(1)` (amortized when walking the entire tree)\n *\n * @method preceding\n * @memberOf module:symbol-tree#\n * @param {Object} object\n * @param {Object} [options]\n * @param {Object} [options.root] If set, `root` must be an inclusive ancestor\n * of the return value (or else null is returned). This check _assumes_\n * that `root` is also an inclusive ancestor of the given `object`\n * @return {?Object}\n */\n preceding(object, options) {\n const treeRoot = options && options.root;\n\n if (object === treeRoot) {\n return null;\n }\n\n const previousSibling = this._node(object).previousSibling;\n\n if (previousSibling) {\n return this.lastInclusiveDescendant(previousSibling);\n }\n\n // if there is no previous sibling return the parent (might be null)\n return this._node(object).parent;\n }\n\n /**\n * Find the following object (A) of the given object (B).\n * An object A is following an object B if A and B are in the same tree\n * and A comes after B in tree order.\n *\n * * `O(n)` (worst case) where `n` is the amount of objects in the entire tree\n * * `O(1)` (amortized when walking the entire tree)\n *\n * @method following\n * @memberOf module:symbol-tree#\n * @param {!Object} object\n * @param {Object} [options]\n * @param {Object} [options.root] If set, `root` must be an inclusive ancestor\n * of the return value (or else null is returned). This check _assumes_\n * that `root` is also an inclusive ancestor of the given `object`\n * @param {Boolean} [options.skipChildren=false] If set, ignore the children of `object`\n * @return {?Object}\n */\n following(object, options) {\n const treeRoot = options && options.root;\n const skipChildren = options && options.skipChildren;\n\n const firstChild = !skipChildren && this._node(object).firstChild;\n\n if (firstChild) {\n return firstChild;\n }\n\n let current = object;\n\n do {\n if (current === treeRoot) {\n return null;\n }\n\n const nextSibling = this._node(current).nextSibling;\n\n if (nextSibling) {\n return nextSibling;\n }\n\n current = this._node(current).parent;\n } while (current);\n\n return null;\n }\n\n /**\n * Append all children of the given object to an array.\n *\n * * `O(n)` where `n` is the amount of children of the given `parent`\n *\n * @method childrenToArray\n * @memberOf module:symbol-tree#\n * @param {Object} parent\n * @param {Object} [options]\n * @param {Object[]} [options.array=[]]\n * @param {Function} [options.filter] Function to test each object before it is added to the array.\n * Invoked with arguments (object). Should return `true` if an object\n * is to be included.\n * @param {*} [options.thisArg] Value to use as `this` when executing `filter`.\n * @return {Object[]}\n */\n childrenToArray(parent, options) {\n const array = (options && options.array) || [];\n const filter = (options && options.filter) || returnTrue;\n const thisArg = (options && options.thisArg) || undefined;\n\n const parentNode = this._node(parent);\n let object = parentNode.firstChild;\n let index = 0;\n\n while (object) {\n const node = this._node(object);\n node.setCachedIndex(parentNode, index);\n\n if (filter.call(thisArg, object)) {\n array.push(object);\n }\n\n object = node.nextSibling;\n ++index;\n }\n\n return array;\n }\n\n /**\n * Append all inclusive ancestors of the given object to an array.\n *\n * * `O(n)` where `n` is the amount of ancestors of the given `object`\n *\n * @method ancestorsToArray\n * @memberOf module:symbol-tree#\n * @param {Object} object\n * @param {Object} [options]\n * @param {Object[]} [options.array=[]]\n * @param {Function} [options.filter] Function to test each object before it is added to the array.\n * Invoked with arguments (object). Should return `true` if an object\n * is to be included.\n * @param {*} [options.thisArg] Value to use as `this` when executing `filter`.\n * @return {Object[]}\n */\n ancestorsToArray(object, options) {\n const array = (options && options.array) || [];\n const filter = (options && options.filter) || returnTrue;\n const thisArg = (options && options.thisArg) || undefined;\n\n let ancestor = object;\n\n while (ancestor) {\n if (filter.call(thisArg, ancestor)) {\n array.push(ancestor);\n }\n ancestor = this._node(ancestor).parent;\n }\n\n return array;\n }\n\n /**\n * Append all descendants of the given object to an array (in tree order).\n *\n * * `O(n)` where `n` is the amount of objects in the sub-tree of the given `object`\n *\n * @method treeToArray\n * @memberOf module:symbol-tree#\n * @param {Object} root\n * @param {Object} [options]\n * @param {Object[]} [options.array=[]]\n * @param {Function} [options.filter] Function to test each object before it is added to the array.\n * Invoked with arguments (object). Should return `true` if an object\n * is to be included.\n * @param {*} [options.thisArg] Value to use as `this` when executing `filter`.\n * @return {Object[]}\n */\n treeToArray(root, options) {\n const array = (options && options.array) || [];\n const filter = (options && options.filter) || returnTrue;\n const thisArg = (options && options.thisArg) || undefined;\n\n let object = root;\n\n while (object) {\n if (filter.call(thisArg, object)) {\n array.push(object);\n }\n object = this.following(object, {root: root});\n }\n\n return array;\n }\n\n /**\n * Iterate over all children of the given object\n *\n * * `O(1)` for a single iteration\n *\n * @method childrenIterator\n * @memberOf module:symbol-tree#\n * @param {Object} parent\n * @param {Object} [options]\n * @param {Boolean} [options.reverse=false]\n * @return {Object} An iterable iterator (ES6)\n */\n childrenIterator(parent, options) {\n const reverse = options && options.reverse;\n const parentNode = this._node(parent);\n\n return new TreeIterator(\n this,\n parent,\n reverse ? parentNode.lastChild : parentNode.firstChild,\n reverse ? TreeIterator.PREV : TreeIterator.NEXT\n );\n }\n\n /**\n * Iterate over all the previous siblings of the given object. (in reverse tree order)\n *\n * * `O(1)` for a single iteration\n *\n * @method previousSiblingsIterator\n * @memberOf module:symbol-tree#\n * @param {Object} object\n * @return {Object} An iterable iterator (ES6)\n */\n previousSiblingsIterator(object) {\n return new TreeIterator(\n this,\n object,\n this._node(object).previousSibling,\n TreeIterator.PREV\n );\n }\n\n /**\n * Iterate over all the next siblings of the given object. (in tree order)\n *\n * * `O(1)` for a single iteration\n *\n * @method nextSiblingsIterator\n * @memberOf module:symbol-tree#\n * @param {Object} object\n * @return {Object} An iterable iterator (ES6)\n */\n nextSiblingsIterator(object) {\n return new TreeIterator(\n this,\n object,\n this._node(object).nextSibling,\n TreeIterator.NEXT\n );\n }\n\n /**\n * Iterate over all inclusive ancestors of the given object\n *\n * * `O(1)` for a single iteration\n *\n * @method ancestorsIterator\n * @memberOf module:symbol-tree#\n * @param {Object} object\n * @return {Object} An iterable iterator (ES6)\n */\n ancestorsIterator(object) {\n return new TreeIterator(\n this,\n object,\n object,\n TreeIterator.PARENT\n );\n }\n\n /**\n * Iterate over all descendants of the given object (in tree order).\n *\n * Where `n` is the amount of objects in the sub-tree of the given `root`:\n *\n * * `O(n)` (worst case for a single iteration)\n * * `O(n)` (amortized, when completing the iterator)\n *\n * @method treeIterator\n * @memberOf module:symbol-tree#\n * @param {Object} root\n * @param {Object} options\n * @param {Boolean} [options.reverse=false]\n * @return {Object} An iterable iterator (ES6)\n */\n treeIterator(root, options) {\n const reverse = options && options.reverse;\n\n return new TreeIterator(\n this,\n root,\n reverse ? this.lastInclusiveDescendant(root) : root,\n reverse ? TreeIterator.PRECEDING : TreeIterator.FOLLOWING\n );\n }\n\n /**\n * Find the index of the given object (the number of preceding siblings).\n *\n * * `O(n)` where `n` is the amount of preceding siblings\n * * `O(1)` (amortized, if the tree is not modified)\n *\n * @method index\n * @memberOf module:symbol-tree#\n * @param {Object} child\n * @return {Number} The number of preceding siblings, or -1 if the object has no parent\n */\n index(child) {\n const childNode = this._node(child);\n const parentNode = this._node(childNode.parent);\n\n if (!parentNode) {\n // In principal, you could also find out the number of preceding siblings\n // for objects that do not have a parent. This method limits itself only to\n // objects that have a parent because that lets us optimize more.\n return -1;\n }\n\n let currentIndex = childNode.getCachedIndex(parentNode);\n\n if (currentIndex >= 0) {\n return currentIndex;\n }\n\n currentIndex = 0;\n let object = parentNode.firstChild;\n\n if (parentNode.childIndexCachedUpTo) {\n const cachedUpToNode = this._node(parentNode.childIndexCachedUpTo);\n object = cachedUpToNode.nextSibling;\n currentIndex = cachedUpToNode.getCachedIndex(parentNode) + 1;\n }\n\n while (object) {\n const node = this._node(object);\n node.setCachedIndex(parentNode, currentIndex);\n\n if (object === child) {\n break;\n }\n\n ++currentIndex;\n object = node.nextSibling;\n }\n\n parentNode.childIndexCachedUpTo = child;\n\n return currentIndex;\n }\n\n /**\n * Calculate the number of children.\n *\n * * `O(n)` where `n` is the amount of children\n * * `O(1)` (amortized, if the tree is not modified)\n *\n * @method childrenCount\n * @memberOf module:symbol-tree#\n * @param {Object} parent\n * @return {Number}\n */\n childrenCount(parent) {\n const parentNode = this._node(parent);\n\n if (!parentNode.lastChild) {\n return 0;\n }\n\n return this.index(parentNode.lastChild) + 1;\n }\n\n /**\n * Compare the position of an object relative to another object. A bit set is returned:\n *\n * <ul>\n * <li>DISCONNECTED : 1</li>\n * <li>PRECEDING : 2</li>\n * <li>FOLLOWING : 4</li>\n * <li>CONTAINS : 8</li>\n * <li>CONTAINED_BY : 16</li>\n * </ul>\n *\n * The semantics are the same as compareDocumentPosition in DOM, with the exception that\n * DISCONNECTED never occurs with any other bit.\n *\n * where `n` and `m` are the amount of ancestors of `left` and `right`;\n * where `o` is the amount of children of the lowest common ancestor of `left` and `right`:\n *\n * * `O(n + m + o)` (worst case)\n * * `O(n + m)` (amortized, if the tree is not modified)\n *\n * @method compareTreePosition\n * @memberOf module:symbol-tree#\n * @param {Object} left\n * @param {Object} right\n * @return {Number}\n */\n compareTreePosition(left, right) {\n // In DOM terms:\n // left = reference / context object\n // right = other\n\n if (left === right) {\n return 0;\n }\n\n /* jshint -W016 */\n\n const leftAncestors = []; { // inclusive\n let leftAncestor = left;\n\n while (leftAncestor) {\n if (leftAncestor === right) {\n return TreePosition.CONTAINS | TreePosition.PRECEDING;\n // other is ancestor of reference\n }\n\n leftAncestors.push(leftAncestor);\n leftAncestor = this.parent(leftAncestor);\n }\n }\n\n\n const rightAncestors = []; {\n let rightAncestor = right;\n\n while (rightAncestor) {\n if (rightAncestor === left) {\n return TreePosition.CONTAINED_BY | TreePosition.FOLLOWING;\n }\n\n rightAncestors.push(rightAncestor);\n rightAncestor = this.parent(rightAncestor);\n }\n }\n\n\n const root = reverseArrayIndex(leftAncestors, 0);\n\n if (!root || root !== reverseArrayIndex(rightAncestors, 0)) {\n // note: unlike DOM, preceding / following is not set here\n return TreePosition.DISCONNECTED;\n }\n\n // find the lowest common ancestor\n let commonAncestorIndex = 0;\n const ancestorsMinLength = Math.min(leftAncestors.length, rightAncestors.length);\n\n for (let i = 0; i < ancestorsMinLength; ++i) {\n const leftAncestor = reverseArrayIndex(leftAncestors, i);\n const rightAncestor = reverseArrayIndex(rightAncestors, i);\n\n if (leftAncestor !== rightAncestor) {\n break;\n }\n\n commonAncestorIndex = i;\n }\n\n // indexes within the common ancestor\n const leftIndex = this.index(reverseArrayIndex(leftAncestors, commonAncestorIndex + 1));\n const rightIndex = this.index(reverseArrayIndex(rightAncestors, commonAncestorIndex + 1));\n\n return rightIndex < leftIndex\n ? TreePosition.PRECEDING\n : TreePosition.FOLLOWING;\n }\n\n /**\n * Remove the object from this tree.\n * Has no effect if already removed.\n *\n * * `O(1)`\n *\n * @method remove\n * @memberOf module:symbol-tree#\n * @param {Object} removeObject\n * @return {Object} removeObject\n */\n remove(removeObject) {\n const removeNode = this._node(removeObject);\n const parentNode = this._node(removeNode.parent);\n const prevNode = this._node(removeNode.previousSibling);\n const nextNode = this._node(removeNode.nextSibling);\n\n if (parentNode) {\n if (parentNode.firstChild === removeObject) {\n parentNode.firstChild = removeNode.nextSibling;\n }\n\n if (parentNode.lastChild === removeObject) {\n parentNode.lastChild = removeNode.previousSibling;\n }\n }\n\n if (prevNode) {\n prevNode.nextSibling = removeNode.nextSibling;\n }\n\n if (nextNode) {\n nextNode.previousSibling = removeNode.previousSibling;\n }\n\n removeNode.parent = null;\n removeNode.previousSibling = null;\n removeNode.nextSibling = null;\n\n if (parentNode) {\n parentNode.childrenChanged();\n }\n\n return removeObject;\n }\n\n /**\n * Insert the given object before the reference object.\n * `newObject` is now the previous sibling of `referenceObject`.\n *\n * * `O(1)`\n *\n * @method insertBefore\n * @memberOf module:symbol-tree#\n * @param {Object} referenceObject\n * @param {Object} newObject\n * @throws {Error} If the newObject is already present in this SymbolTree\n * @return {Object} newObject\n */\n insertBefore(referenceObject, newObject) {\n const referenceNode = this._node(referenceObject);\n const prevNode = this._node(referenceNode.previousSibling);\n const newNode = this._node(newObject);\n const parentNode = this._node(referenceNode.parent);\n\n if (newNode.isAttached) {\n throw Error('Given object is already present in this SymbolTree, remove it first');\n }\n\n newNode.parent = referenceNode.parent;\n newNode.previousSibling = referenceNode.previousSibling;\n newNode.nextSibling = referenceObject;\n referenceNode.previousSibling = newObject;\n\n if (prevNode) {\n prevNode.nextSibling = newObject;\n }\n\n if (parentNode && parentNode.firstChild === referenceObject) {\n parentNode.firstChild = newObject;\n }\n\n if (parentNode) {\n parentNode.childrenChanged();\n }\n\n return newObject;\n }\n\n /**\n * Insert the given object after the reference object.\n * `newObject` is now the next sibling of `referenceObject`.\n *\n * * `O(1)`\n *\n * @method insertAfter\n * @memberOf module:symbol-tree#\n * @param {Object} referenceObject\n * @param {Object} newObject\n * @throws {Error} If the newObject is already present in this SymbolTree\n * @return {Object} newObject\n */\n insertAfter(referenceObject, newObject) {\n const referenceNode = this._node(referenceObject);\n const nextNode = this._node(referenceNode.nextSibling);\n const newNode = this._node(newObject);\n const parentNode = this._node(referenceNode.parent);\n\n if (newNode.isAttached) {\n throw Error('Given object is already present in this SymbolTree, remove it first');\n }\n\n newNode.parent = referenceNode.parent;\n newNode.previousSibling = referenceObject;\n newNode.nextSibling = referenceNode.nextSibling;\n referenceNode.nextSibling = newObject;\n\n if (nextNode) {\n nextNode.previousSibling = newObject;\n }\n\n if (parentNode && parentNode.lastChild === referenceObject) {\n parentNode.lastChild = newObject;\n }\n\n if (parentNode) {\n parentNode.childrenChanged();\n }\n\n return newObject;\n }\n\n /**\n * Insert the given object as the first child of the given reference object.\n * `newObject` is now the first child of `referenceObject`.\n *\n * * `O(1)`\n *\n * @method prependChild\n * @memberOf module:symbol-tree#\n * @param {Object} referenceObject\n * @param {Object} newObject\n * @throws {Error} If the newObject is already present in this SymbolTree\n * @return {Object} newObject\n */\n prependChild(referenceObject, newObject) {\n const referenceNode = this._node(referenceObject);\n const newNode = this._node(newObject);\n\n if (newNode.isAttached) {\n throw Error('Given object is already present in this SymbolTree, remove it first');\n }\n\n if (referenceNode.hasChildren) {\n this.insertBefore(referenceNode.firstChild, newObject);\n }\n else {\n newNode.parent = referenceObject;\n referenceNode.firstChild = newObject;\n referenceNode.lastChild = newObject;\n referenceNode.childrenChanged();\n }\n\n return newObject;\n }\n\n /**\n * Insert the given object as the last child of the given reference object.\n * `newObject` is now the last child of `referenceObject`.\n *\n * * `O(1)`\n *\n * @method appendChild\n * @memberOf module:symbol-tree#\n * @param {Object} referenceObject\n * @param {Object} newObject\n * @throws {Error} If the newObject is already present in this SymbolTree\n * @return {Object} newObject\n */\n appendChild(referenceObject, newObject) {\n const referenceNode = this._node(referenceObject);\n const newNode = this._node(newObject);\n\n if (newNode.isAttached) {\n throw Error('Given object is already present in this SymbolTree, remove it first');\n }\n\n if (referenceNode.hasChildren) {\n this.insertAfter(referenceNode.lastChild, newObject);\n }\n else {\n newNode.parent = referenceObject;\n referenceNode.firstChild = newObject;\n referenceNode.lastChild = newObject;\n referenceNode.childrenChanged();\n }\n\n return newObject;\n }\n}\n\nmodule.exports = SymbolTree;\nSymbolTree.TreePosition = TreePosition;\n","// ==============\n// native\n// ==============\n\nimport * as events from 'events';\n\nexport { events };\n\n// ==============\n// @pushrocks\n// ==============\nimport * as smartdelay from '@pushrocks/smartdelay';\nimport * as smartpromise from '@pushrocks/smartpromise';\nimport * as smartrx from '@pushrocks/smartrx';\nimport * as smarttime from '@pushrocks/smarttime';\n\nexport { smartdelay, smartpromise, smartrx, smarttime };\n\n// ==============\n// third party\n// ==============\nimport * as minimatch from 'minimatch';\nconst symbolTree = require('symbol-tree');\n\nexport { minimatch, symbolTree };\n","import * as plugins from './lik.plugins';\n\nexport interface IObjectmapForEachFunction<T> {\n (itemArg: T): void;\n}\n\nexport interface IObjectmapFindFunction<T> {\n (itemArg: T): boolean;\n}\n\n/**\n * allows keeping track of objects\n */\nexport class Objectmap<T> {\n private objectArray: T[] = [];\n\n /**\n * returns a new instance\n */\n constructor() {\n // nothing here\n }\n\n /**\n * add object to Objectmap\n * returns false if the object is already in the map\n * returns true if the object was added successfully\n */\n public add(objectArg: T): boolean {\n if (this.checkForObject(objectArg)) {\n // the object is already in the objectmap\n return false;\n } else {\n // the object is not yet in the objectmap\n this.objectArray.push(objectArg);\n return true;\n }\n }\n\n /**\n * like .add but adds an whole array of objects\n */\n public addArray(objectArrayArg: T[]) {\n for (let item of objectArrayArg) {\n this.add(item);\n }\n }\n\n /**\n * check if object is in Objectmap\n */\n public checkForObject(objectArg: T) {\n return this.objectArray.indexOf(objectArg) !== -1;\n }\n\n /**\n * find object\n */\n public find(findFunction: IObjectmapFindFunction<T>) {\n const resultArray = this.objectArray.filter(findFunction);\n if (resultArray.length > 0) {\n return resultArray[0];\n } else {\n return null;\n }\n }\n\n /**\n * finds a specific element and then removes it\n */\n public findOneAndRemove(findFunction: IObjectmapFindFunction<T>): T {\n const foundElement = this.find(findFunction);\n if (foundElement) {\n this.remove(foundElement);\n }\n return foundElement;\n }\n\n /**\n * run function for each item in Objectmap\n */\n public async forEach(functionArg: IObjectmapForEachFunction<T>) {\n for (let object of this.objectArray) {\n await functionArg(object);\n }\n }\n\n /**\n * gets an object in the Observablemap and removes it, so it can't be retrieved again\n */\n public getOneAndRemove(): T {\n return this.objectArray.shift();\n }\n\n /**\n * returns a cloned array of all the objects currently in the Objectmap\n */\n public getArray() {\n const returnArray: any[] = [];\n for (const objectItem of this.objectArray) {\n returnArray.push(objectItem);\n }\n return returnArray;\n }\n\n /**\n * check if Objectmap ist empty\n */\n public isEmpty(): boolean {\n if (this.objectArray.length === 0) {\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * remove object from Objectmap\n */\n public remove(objectArg: T) {\n let replacementArray = [];\n for (let item of this.objectArray) {\n if (item !== objectArg) {\n replacementArray.push(item);\n }\n }\n this.objectArray = replacementArray;\n }\n\n /**\n * wipe Objectmap\n */\n public wipe() {\n this.objectArray = [];\n }\n}\n","import * as plugins from './lik.plugins';\n\nimport { InterestMap, IInterestComparisonFunc } from './lik.interestmap';\n\nexport class Interest<DTInterestId, DTInterestFullfillment> {\n private interestMapRef: InterestMap<DTInterestId, DTInterestFullfillment>;\n public originalInterest: DTInterestId;\n public comparisonFunc: IInterestComparisonFunc<DTInterestId>;\n public destructionTimer = new plugins.smarttime.Timer(10000);\n public isFullfilled = false;\n\n /**\n * a generic store to store objects in that are needed for fullfillment;\n */\n public fullfillmentStore: any[] = [];\n\n /**\n * quick access to a string that makes the interest comparable for checking for similar interests\n */\n public get comparisonString() {\n return this.comparisonFunc(this.originalInterest);\n }\n\n private interestDeferred: plugins.smartpromise.Deferred<\n DTInterestFullfillment\n > = new plugins.smartpromise.Deferred();\n public interestFullfilled = this.interestDeferred.promise;\n\n /**\n * fullfill the interest\n */\n public fullfillInterest(objectArg: DTInterestFullfillment) {\n this.isFullfilled = true;\n this.fullfillmentStore = [];\n this.interestDeferred.resolve(objectArg);\n }\n\n /**\n *\n */\n constructor(\n interestMapArg: InterestMap<DTInterestId, DTInterestFullfillment>,\n interestArg: DTInterestId,\n comparisonFuncArg: IInterestComparisonFunc<DTInterestId>\n ) {\n this.originalInterest = interestArg;\n this.comparisonFunc = comparisonFuncArg;\n this.interestMapRef = interestMapArg;\n this.destructionTimer.completed.then(() => {\n this.destroy();\n });\n }\n\n // ===============================\n // LIFECYCLE MANAGEMENT\n // ===============================\n\n /**\n * self destructs the interest\n */\n public destroy() {\n this.interestMapRef.removeInterest(this);\n }\n\n /**\n * notifies the interest that the interest in it has been lost\n */\n public markLost() {\n this.destructionTimer.start();\n }\n\n /**\n * notifies the interest that the interest in it has been restored\n */\n public renew() {\n this.destructionTimer.reset();\n }\n}\n","import * as plugins from './lik.plugins';\nimport { Objectmap } from './lik.objectmap';\n\nimport { Observable } from 'rxjs';\n\nimport { Interest } from './lik.interestmap.interest';\n\nexport type IInterestComparisonFunc<T> = (objectArg: T) => string;\n\nexport class InterestMap<DTInterestId, DTInterestFullfillment> {\n /**\n * stores interests that are currently fullfilled by the cache\n */\n private interestObjectMap = new Objectmap<Interest<DTInterestId, DTInterestFullfillment>>();\n\n /**\n * a function to compare interests\n */\n private comparisonFunc: IInterestComparisonFunc<DTInterestId>;\n\n constructor(comparisonFuncArg: IInterestComparisonFunc<DTInterestId>) {\n this.comparisonFunc = comparisonFuncArg;\n }\n\n /**\n * adds an interest to the InterestMap\n * @param objectArg\n */\n public async addInterest(\n objectArg: DTInterestId\n ): Promise<Interest<DTInterestId, DTInterestFullfillment>> {\n const comparisonString = this.comparisonFunc(objectArg);\n let returnInterest: Interest<DTInterestId, DTInterestFullfillment>;\n const newInterest = new Interest<DTInterestId, DTInterestFullfillment>(\n this,\n objectArg,\n this.comparisonFunc\n );\n let interestExists = false;\n await this.interestObjectMap.forEach(interestArg => {\n if (!interestExists && interestArg.comparisonString === newInterest.comparisonString) {\n console.log('info', `interest already exists for ${newInterest.comparisonString}`);\n interestExists = true;\n returnInterest = interestArg;\n returnInterest.renew();\n }\n });\n if (!returnInterest) {\n returnInterest = newInterest;\n this.interestObjectMap.add(returnInterest);\n }\n this.interestObservable.push(returnInterest);\n return returnInterest;\n }\n\n // tslint:disable-next-line:member-ordering\n public interestObservable = new plugins.smartrx.ObservableIntake<Interest<DTInterestId, any>>();\n\n /**\n * removes an interest from the interest map\n * @param objectArg removes an interest from the InterestMap\n */\n public removeInterest(interestArg: Interest<DTInterestId, DTInterestFullfillment>) {\n const interestToRemove = this.interestObjectMap.findOneAndRemove(interestArg2 => {\n return interestArg.comparisonString === interestArg2.comparisonString;\n });\n }\n\n /**\n * check interest\n */\n public checkInterest(objectArg: DTInterestId): boolean {\n const comparisonString = this.comparisonFunc(objectArg);\n return this.checkInterestByString(comparisonString);\n }\n\n /**\n * checks an interest\n * @param comparisonStringArg\n */\n public checkInterestByString(comparisonStringArg: string): boolean {\n const foundInterest = this.interestObjectMap.find(interest => {\n return interest.comparisonString === comparisonStringArg;\n });\n if (foundInterest) {\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * inform lost interest\n * @param interestId\n */\n public informLostInterest(interestId: DTInterestId) {\n const wantedInterest = this.findInterest(interestId);\n if (wantedInterest) {\n wantedInterest.markLost();\n }\n }\n\n /**\n * finds an interest\n * @param objectArg\n */\n public findInterest(objectArg: DTInterestId): Interest<DTInterestId, DTInterestFullfillment> {\n const comparableString = this.comparisonFunc(objectArg);\n const interest = this.interestObjectMap.find(interest => {\n return interest.comparisonString === comparableString;\n });\n return interest; // if an interest is found, the interest is returned, otherwise interest is null\n }\n}\n","import * as plugins from './lik.plugins';\n\nexport class LimitedArray<T> {\n array: T[] = [];\n arrayLimit: number;\n constructor(limitArg: number) {\n this.arrayLimit = limitArg;\n }\n\n addOne(objectArg: T) {\n this.array.unshift(objectArg);\n if (this.array.length > this.arrayLimit) {\n this.array.length = this.arrayLimit;\n }\n }\n\n addMany(objectArrayArg: T[]) {\n for (let objectArg of objectArrayArg) {\n this.addOne(objectArg);\n }\n }\n\n setLimit(limitArg: number) {\n this.arrayLimit = limitArg;\n if (this.array.length > this.arrayLimit) {\n this.array.length = this.arrayLimit;\n }\n }\n\n getAverage(): number {\n if (typeof this.array[0] === 'number') {\n let sum = 0;\n for (let localNumber of this.array) {\n let localNumberAny: any = localNumber;\n sum = sum + localNumberAny;\n }\n return sum / this.array.length;\n } else {\n return null;\n }\n }\n}\n","import * as plugins from './lik.plugins';\n\nimport { Objectmap } from './lik.objectmap';\n\nexport class LoopTracker<T> {\n referenceObjectMap = new Objectmap<any>();\n constructor() {\n // nothing here\n }\n\n /**\n * checks and tracks an object\n * @param objectArg\n */\n checkAndTrack(objectArg: T) {\n return this.referenceObjectMap.add(objectArg);\n }\n}\n","import * as plugins from './lik.plugins';\n\n/**\n * allows you to easily keep track of a bunch of strings\n */\n\nexport interface ITriggerFunction {\n (): boolean;\n}\n\nexport class Stringmap {\n private _stringArray: string[] = [];\n private _triggerUntilTrueFunctionArray: ITriggerFunction[] = [];\n constructor() {}\n /**\n * add a string to the Stringmap\n */\n addString(stringArg: string) {\n this._stringArray.push(stringArg);\n this.notifyTrigger();\n }\n\n /**\n * like addString, but accepts an array of strings\n */\n addStringArray(stringArrayArg: string[]) {\n for (let stringItem of stringArrayArg) {\n this.addString(stringItem);\n }\n }\n\n /**\n * removes a string from Stringmap\n */\n removeString(stringArg: string) {\n for (let keyArg in this._stringArray) {\n if (this._stringArray[keyArg] === stringArg) {\n this._stringArray.splice(parseInt(keyArg), 1);\n }\n }\n this.notifyTrigger();\n }\n\n /**\n * wipes the Stringmap\n */\n wipe() {\n this._stringArray = [];\n this.notifyTrigger();\n }\n\n /**\n * check if string is in Stringmap\n */\n public checkString(stringArg: string): boolean {\n return this._stringArray.indexOf(stringArg) !== -1;\n }\n\n /**\n * checks stringPresence with minimatch\n */\n public checkMinimatch(miniMatchStringArg: string): boolean {\n let foundMatch: boolean = false;\n for (let stringItem of this._stringArray) {\n if (plugins.minimatch(stringItem, miniMatchStringArg)) {\n foundMatch = true;\n }\n }\n return foundMatch;\n }\n\n /**\n * checks if the Stringmap is empty\n */\n public checkIsEmpty() {\n return this._stringArray.length === 0;\n }\n\n /**\n * gets a cloned copy of the current string Array\n */\n public getStringArray() {\n const returnArray: string[] = [];\n for (const stringItem of this._stringArray) {\n returnArray.push(stringItem);\n }\n return returnArray;\n }\n\n // trigger registering\n\n /**\n * register a new trigger\n */\n public registerUntilTrue(functionArg: ITriggerFunction, doFunctionArg) {\n this._triggerUntilTrueFunctionArray.push(() => {\n let result = functionArg();\n if (result === true) {\n doFunctionArg();\n }\n return result;\n });\n this.notifyTrigger();\n }\n\n /**\n * notifies triggers\n */\n private notifyTrigger() {\n let filteredArray = this._triggerUntilTrueFunctionArray.filter(functionArg => {\n return !functionArg();\n });\n this._triggerUntilTrueFunctionArray = filteredArray;\n }\n}\n","import * as plugins from './lik.plugins';\n\nexport class Tree<T> {\n symbolTree: any;\n constructor() {\n this.symbolTree = new plugins.symbolTree();\n }\n\n // =======================================\n // Functions that map to the functionality of symbol-tree\n // =======================================\n\n /**\n *\n * @param objectArg\n */\n initialize(objectArg: T): T {\n return this.symbolTree.initialize(objectArg);\n }\n\n hasChildren(objectArg: T): boolean {\n return this.symbolTree.hasChildren(objectArg);\n }\n\n firstChild(objectArg: T): T {\n return this.symbolTree.firstChild(objectArg);\n }\n\n lastChild(objectArg: T): T {\n return this.symbolTree.lastChild(objectArg);\n }\n\n previousSibling(objectArg: T): T {\n return this.symbolTree.previousSibling(objectArg);\n }\n\n nextSibling(objectArg: T): T {\n return this.symbolTree.nextSibling(objectArg);\n }\n\n parent(objectArg: T): T {\n return this.symbolTree.parent(objectArg);\n }\n\n lastInclusiveDescendant(objectArg: T): T {\n return this.symbolTree.lastInclusiveDescendant(objectArg);\n }\n\n preceding(objectArg: T, optionsArg?: any): T {\n return this.symbolTree.preceding(objectArg, optionsArg);\n }\n\n following(object: T, optionsArg: any) {\n return this.symbolTree.following(object, optionsArg);\n }\n\n childrenToArray(parentArg: T, optionsArg: any): T[] {\n return this.symbolTree.childrenToArray(parentArg, optionsArg);\n }\n\n ancestorsToArray(objectArg: T, optionsArg: any): T[] {\n return this.symbolTree.ancestorsToArray(objectArg, optionsArg);\n }\n\n treeToArray(rootArg, optionsArg: any): T[] {\n return this.symbolTree.treeToArray(rootArg, optionsArg);\n }\n\n childrenIterator(parentArg: T, optionsArg): T {\n return this.symbolTree.childrenIterator(parentArg, optionsArg);\n }\n\n previousSiblingsIterator(objectArg): T {\n return this.symbolTree.previousSiblingsIterator(objectArg);\n }\n\n nextSiblingsIterator(objectArg: T) {\n return this.symbolTree.nextSiblingsIterator();\n }\n\n ancestorsIterator(objectArg) {\n this.symbolTree.ancestorsIterator();\n }\n\n treeIterator(rootArg: T, optionsArg): Iterable<T> {\n return this.symbolTree.treeIterator(rootArg);\n }\n\n index(childArg: T): number {\n return this.symbolTree.index(childArg);\n }\n\n childrenCount(parentArg: T): number {\n return this.symbolTree.childrenCount(parentArg);\n }\n\n compareTreePosition(leftArg: T, rightArg: T): number {\n return this.compareTreePosition(leftArg, rightArg);\n }\n\n remove(removeObjectArg: T): T {\n return this.symbolTree.remove(removeObjectArg);\n }\n\n insertBefore(referenceObjectArg: T, newObjectArg: T): T {\n return this.symbolTree.insertBefore(referenceObjectArg, newObjectArg);\n }\n\n insertAfter(referenceObject: T, newObjectArg: T) {\n return this.symbolTree.insertAfter(referenceObject, newObjectArg);\n }\n\n prependChild(referenceObjectArg: T, newObjectArg: T): T {\n return this.symbolTree.prependChild(referenceObjectArg, newObjectArg);\n }\n\n appendChild(referenceObjectArg, newObjectArg) {\n return this.symbolTree.appendChild(referenceObjectArg, newObjectArg);\n }\n\n // ===========================================\n // Functionionality that extends symbol-tree\n // ===========================================\n\n /**\n * returns a branch of the tree as JSON\n * can be user\n */\n toJsonWithHierachy(rootElement) {\n const treeIterable = this.treeIterator(rootElement, {});\n for (const treeItem of treeIterable) {\n console.log(treeItem);\n }\n }\n\n /**\n * builds a tree from a JSON with hierachy\n * @param rootElement\n */\n fromJsonWithHierachy(rootElement) {}\n}\n","import * as plugins from './smartrx.plugins';\nimport { Observable, fromEvent } from 'rxjs';\nimport { Objectmap, Stringmap } from '@pushrocks/lik';\n/**\n * bundles an observable with an emitter\n */\nexport interface ObservableEmitterBundle {\n observable: plugins.rxjs.Observable<any>;\n emitter: plugins.events.EventEmitter;\n event: string;\n}\n\n/**\n * manages observables by making sure that only one observable is regsitered per event\n */\nexport class Observablemap {\n ObservableEmitterBundleObjectmap = new Objectmap<ObservableEmitterBundle>();\n\n /**\n * creates a new observable if not yet registered for the same event.\n * In case event has been registered before the same observable is returned.\n */\n getObservableForEmitterEvent(emitterArg: plugins.events.EventEmitter, eventArg: string) {\n let existingBundle = this.ObservableEmitterBundleObjectmap.find(bundleArg => {\n return bundleArg.emitter === emitterArg && bundleArg.event === eventArg;\n });\n if (existingBundle) {\n return existingBundle.observable;\n } else {\n let emitterObservable = fromEvent(emitterArg, eventArg);\n this.ObservableEmitterBundleObjectmap.add({\n observable: emitterObservable,\n emitter: emitterArg,\n event: eventArg\n });\n return emitterObservable;\n }\n }\n}\n","import * as smartpromise from '@pushrocks/smartpromise';\nimport events = require('events');\n\nexport { events, smartpromise };\n","import * as events from 'events';\nimport * as lik from '@pushrocks/lik';\nimport * as rxjs from 'rxjs';\nimport * as smartevent from '@pushrocks/smartevent';\nimport * as smartpromise from '@pushrocks/smartpromise';\n\nexport { events, lik, rxjs, smartevent, smartpromise };\n","import * as plugins from './smartrx.plugins';\nimport { Observable, Subscription } from 'rxjs';\nimport { Deferred } from 'smartq';\n\n/**\n * ObservableIntake\n */\nexport class ObservableIntake<T> {\n observable: Observable<T>;\n completed: Promise<void>;\n private completedDeffered: Deferred<void>;\n private observableFunctions: any = {\n next: payloadArg => {\n // nothing\n },\n complete: payloadArg => {\n // nothing\n }\n };\n private generator = null;\n private buffered = false;\n private payloadBuffer = [];\n\n constructor() {\n this.observable = Observable.create(observerArg => {\n this.observableFunctions.next = (...args) => {\n return observerArg.next(...args);\n };\n this.observableFunctions.complete = (...args) => {\n this.completedDeffered.resolve();\n return observerArg.complete(...args);\n };\n });\n this.completedDeffered = plugins.smartpromise.defer();\n this.completed = this.completedDeffered.promise;\n }\n\n setObservable(observableFunc) {\n this.observable = observableFunc();\n }\n\n push(payloadArg: T) {\n if (this.buffered) {\n this.payloadBuffer.push(payloadArg);\n } else {\n this.internalPush(payloadArg);\n }\n }\n\n /**\n * pushes many payloads as array\n * @param payloadArgArray\n */\n pushMany(payloadArgArray: T[]) {\n for (let item of payloadArgArray) {\n this.push(item);\n }\n }\n\n /**\n * sets a generator to query the next pushed value\n * @param generatorArg\n */\n setGenerator(generatorArg) {\n this.generator = generatorArg;\n }\n\n makeBuffered() {\n this.buffered = true;\n }\n\n subscribe(...args) {\n return this.observable.subscribe(...args);\n }\n\n /**\n * request the next values in the quantity specified\n * @param howManyArg if a generator is set, of a buffer exists, this allows retrieving values\n */\n request(howManyArg: number) {\n if (howManyArg === 0) {\n return;\n } else {\n for (let i = 0; i !== howManyArg; i++) {\n if (this.payloadBuffer.length > 0) {\n this.internalPush(this.payloadBuffer.shift());\n } else {\n const nextPayload = this.generator();\n this.internalPush(nextPayload);\n }\n }\n }\n }\n\n /**\n * signals the completion of this observable\n */\n signalComplete() {\n this.observableFunctions.complete();\n }\n\n private internalPush(payloadArg) {\n this.observableFunctions.next(payloadArg);\n }\n}\n","import * as smartdelay from '@pushrocks/smartdelay';\nimport * as smartrx from '@pushrocks/smartrx';\n\nexport {\n smartdelay,\n smartrx\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { Subscription } from '../Subscription';\nimport { MonoTypeOperatorFunction, SubscribableOrPromise, TeardownLogic } from '../types';\n\nimport { tryCatch } from '../util/tryCatch';\nimport { errorObject } from '../util/errorObject';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\n\n/**\n * Ignores source values for a duration determined by another Observable, then\n * emits the most recent value from the source Observable, then repeats this\n * process.\n *\n * <span class=\"informal\">It's like {@link auditTime}, but the silencing\n * duration is determined by a second Observable.</span>\n *\n * ![](audit.png)\n *\n * `audit` is similar to `throttle`, but emits the last value from the silenced\n * time window, instead of the first value. `audit` emits the most recent value\n * from the source Observable on the output Observable as soon as its internal\n * timer becomes disabled, and ignores source values while the timer is enabled.\n * Initially, the timer is disabled. As soon as the first source value arrives,\n * the timer is enabled by calling the `durationSelector` function with the\n * source value, which returns the \"duration\" Observable. When the duration\n * Observable emits a value or completes, the timer is disabled, then the most\n * recent source value is emitted on the output Observable, and this process\n * repeats for the next source value.\n *\n * ## Example\n *\n * Emit clicks at a rate of at most one click per second\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(audit(ev => interval(1000)));\n * result.subscribe(x => console.log(x));\n * ```\n * @see {@link auditTime}\n * @see {@link debounce}\n * @see {@link delayWhen}\n * @see {@link sample}\n * @see {@link throttle}\n *\n * @param {function(value: T): SubscribableOrPromise} durationSelector A function\n * that receives a value from the source Observable, for computing the silencing\n * duration, returned as an Observable or a Promise.\n * @return {Observable<T>} An Observable that performs rate-limiting of\n * emissions from the source Observable.\n * @method audit\n * @owner Observable\n */\nexport function audit<T>(durationSelector: (value: T) => SubscribableOrPromise<any>): MonoTypeOperatorFunction<T> {\n return function auditOperatorFunction(source: Observable<T>) {\n return source.lift(new AuditOperator(durationSelector));\n };\n}\n\nclass AuditOperator<T> implements Operator<T, T> {\n constructor(private durationSelector: (value: T) => SubscribableOrPromise<any>) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new AuditSubscriber<T, T>(subscriber, this.durationSelector));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass AuditSubscriber<T, R> extends OuterSubscriber<T, R> {\n\n private value: T;\n private hasValue: boolean = false;\n private throttled: Subscription;\n\n constructor(destination: Subscriber<T>,\n private durationSelector: (value: T) => SubscribableOrPromise<any>) {\n super(destination);\n }\n\n protected _next(value: T): void {\n this.value = value;\n this.hasValue = true;\n if (!this.throttled) {\n const duration = tryCatch(this.durationSelector)(value);\n if (duration === errorObject) {\n this.destination.error(errorObject.e);\n } else {\n const innerSubscription = subscribeToResult(this, duration);\n if (!innerSubscription || innerSubscription.closed) {\n this.clearThrottle();\n } else {\n this.add(this.throttled = innerSubscription);\n }\n }\n }\n }\n\n clearThrottle() {\n const { value, hasValue, throttled } = this;\n if (throttled) {\n this.remove(throttled);\n this.throttled = null;\n throttled.unsubscribe();\n }\n if (hasValue) {\n this.value = null;\n this.hasValue = false;\n this.destination.next(value);\n }\n }\n\n notifyNext(outerValue: T, innerValue: R, outerIndex: number, innerIndex: number): void {\n this.clearThrottle();\n }\n\n notifyComplete(): void {\n this.clearThrottle();\n }\n}\n","import { async } from '../scheduler/async';\nimport { audit } from './audit';\nimport { timer } from '../observable/timer';\nimport { MonoTypeOperatorFunction, SchedulerLike } from '../types';\n\n/**\n * Ignores source values for `duration` milliseconds, then emits the most recent\n * value from the source Observable, then repeats this process.\n *\n * <span class=\"informal\">When it sees a source values, it ignores that plus\n * the next ones for `duration` milliseconds, and then it emits the most recent\n * value from the source.</span>\n *\n * ![](auditTime.png)\n *\n * `auditTime` is similar to `throttleTime`, but emits the last value from the\n * silenced time window, instead of the first value. `auditTime` emits the most\n * recent value from the source Observable on the output Observable as soon as\n * its internal timer becomes disabled, and ignores source values while the\n * timer is enabled. Initially, the timer is disabled. As soon as the first\n * source value arrives, the timer is enabled. After `duration` milliseconds (or\n * the time unit determined internally by the optional `scheduler`) has passed,\n * the timer is disabled, then the most recent source value is emitted on the\n * output Observable, and this process repeats for the next source value.\n * Optionally takes a {@link SchedulerLike} for managing timers.\n *\n * ## Example\n *\n * Emit clicks at a rate of at most one click per second\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(auditTime(1000));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link audit}\n * @see {@link debounceTime}\n * @see {@link delay}\n * @see {@link sampleTime}\n * @see {@link throttleTime}\n *\n * @param {number} duration Time to wait before emitting the most recent source\n * value, measured in milliseconds or the time unit determined internally\n * by the optional `scheduler`.\n * @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for\n * managing the timers that handle the rate-limiting behavior.\n * @return {Observable<T>} An Observable that performs rate-limiting of\n * emissions from the source Observable.\n * @method auditTime\n * @owner Observable\n */\nexport function auditTime<T>(duration: number, scheduler: SchedulerLike = async): MonoTypeOperatorFunction<T> {\n return audit(() => timer(duration, scheduler));\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { OperatorFunction } from '../types';\n\n/**\n * Buffers the source Observable values until `closingNotifier` emits.\n *\n * <span class=\"informal\">Collects values from the past as an array, and emits\n * that array only when another Observable emits.</span>\n *\n * ![](buffer.png)\n *\n * Buffers the incoming Observable values until the given `closingNotifier`\n * Observable emits a value, at which point it emits the buffer on the output\n * Observable and starts a new buffer internally, awaiting the next time\n * `closingNotifier` emits.\n *\n * ## Example\n *\n * On every click, emit array of most recent interval events\n *\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const interval = interval(1000);\n * const buffered = interval.pipe(buffer(clicks));\n * buffered.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link bufferCount}\n * @see {@link bufferTime}\n * @see {@link bufferToggle}\n * @see {@link bufferWhen}\n * @see {@link window}\n *\n * @param {Observable<any>} closingNotifier An Observable that signals the\n * buffer to be emitted on the output Observable.\n * @return {Observable<T[]>} An Observable of buffers, which are arrays of\n * values.\n * @method buffer\n * @owner Observable\n */\nexport function buffer<T>(closingNotifier: Observable<any>): OperatorFunction<T, T[]> {\n return function bufferOperatorFunction(source: Observable<T>) {\n return source.lift(new BufferOperator<T>(closingNotifier));\n };\n}\n\nclass BufferOperator<T> implements Operator<T, T[]> {\n\n constructor(private closingNotifier: Observable<any>) {\n }\n\n call(subscriber: Subscriber<T[]>, source: any): any {\n return source.subscribe(new BufferSubscriber(subscriber, this.closingNotifier));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass BufferSubscriber<T> extends OuterSubscriber<T, any> {\n private buffer: T[] = [];\n\n constructor(destination: Subscriber<T[]>, closingNotifier: Observable<any>) {\n super(destination);\n this.add(subscribeToResult(this, closingNotifier));\n }\n\n protected _next(value: T) {\n this.buffer.push(value);\n }\n\n notifyNext(outerValue: T, innerValue: any,\n outerIndex: number, innerIndex: number,\n innerSub: InnerSubscriber<T, any>): void {\n const buffer = this.buffer;\n this.buffer = [];\n this.destination.next(buffer);\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { OperatorFunction, TeardownLogic } from '../types';\n\n/**\n * Buffers the source Observable values until the size hits the maximum\n * `bufferSize` given.\n *\n * <span class=\"informal\">Collects values from the past as an array, and emits\n * that array only when its size reaches `bufferSize`.</span>\n *\n * ![](bufferCount.png)\n *\n * Buffers a number of values from the source Observable by `bufferSize` then\n * emits the buffer and clears it, and starts a new buffer each\n * `startBufferEvery` values. If `startBufferEvery` is not provided or is\n * `null`, then new buffers are started immediately at the start of the source\n * and when each buffer closes and is emitted.\n *\n * ## Examples\n *\n * Emit the last two click events as an array\n *\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const buffered = clicks.pipe(bufferCount(2));\n * buffered.subscribe(x => console.log(x));\n * ```\n *\n * On every click, emit the last two click events as an array\n *\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const buffered = clicks.pipe(bufferCount(2, 1));\n * buffered.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link buffer}\n * @see {@link bufferTime}\n * @see {@link bufferToggle}\n * @see {@link bufferWhen}\n * @see {@link pairwise}\n * @see {@link windowCount}\n *\n * @param {number} bufferSize The maximum size of the buffer emitted.\n * @param {number} [startBufferEvery] Interval at which to start a new buffer.\n * For example if `startBufferEvery` is `2`, then a new buffer will be started\n * on every other value from the source. A new buffer is started at the\n * beginning of the source by default.\n * @return {Observable<T[]>} An Observable of arrays of buffered values.\n * @method bufferCount\n * @owner Observable\n */\nexport function bufferCount<T>(bufferSize: number, startBufferEvery: number = null): OperatorFunction<T, T[]> {\n return function bufferCountOperatorFunction(source: Observable<T>) {\n return source.lift(new BufferCountOperator<T>(bufferSize, startBufferEvery));\n };\n}\n\nclass BufferCountOperator<T> implements Operator<T, T[]> {\n private subscriberClass: any;\n\n constructor(private bufferSize: number, private startBufferEvery: number) {\n if (!startBufferEvery || bufferSize === startBufferEvery) {\n this.subscriberClass = BufferCountSubscriber;\n } else {\n this.subscriberClass = BufferSkipCountSubscriber;\n }\n }\n\n call(subscriber: Subscriber<T[]>, source: any): TeardownLogic {\n return source.subscribe(new this.subscriberClass(subscriber, this.bufferSize, this.startBufferEvery));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass BufferCountSubscriber<T> extends Subscriber<T> {\n private buffer: T[] = [];\n\n constructor(destination: Subscriber<T[]>, private bufferSize: number) {\n super(destination);\n }\n\n protected _next(value: T): void {\n const buffer = this.buffer;\n\n buffer.push(value);\n\n if (buffer.length == this.bufferSize) {\n this.destination.next(buffer);\n this.buffer = [];\n }\n }\n\n protected _complete(): void {\n const buffer = this.buffer;\n if (buffer.length > 0) {\n this.destination.next(buffer);\n }\n super._complete();\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass BufferSkipCountSubscriber<T> extends Subscriber<T> {\n private buffers: Array<T[]> = [];\n private count: number = 0;\n\n constructor(destination: Subscriber<T[]>, private bufferSize: number, private startBufferEvery: number) {\n super(destination);\n }\n\n protected _next(value: T): void {\n const { bufferSize, startBufferEvery, buffers, count } = this;\n\n this.count++;\n if (count % startBufferEvery === 0) {\n buffers.push([]);\n }\n\n for (let i = buffers.length; i--; ) {\n const 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\n protected _complete(): void {\n const { buffers, destination } = this;\n\n while (buffers.length > 0) {\n let buffer = buffers.shift();\n if (buffer.length > 0) {\n destination.next(buffer);\n }\n }\n super._complete();\n }\n\n}\n","import { Operator } from '../Operator';\nimport { async } from '../scheduler/async';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { isScheduler } from '../util/isScheduler';\nimport { OperatorFunction, SchedulerAction, SchedulerLike } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function bufferTime<T>(bufferTimeSpan: number, scheduler?: SchedulerLike): OperatorFunction<T, T[]>;\nexport function bufferTime<T>(bufferTimeSpan: number, bufferCreationInterval: number | null | undefined, scheduler?: SchedulerLike): OperatorFunction<T, T[]>;\nexport function bufferTime<T>(bufferTimeSpan: number, bufferCreationInterval: number | null | undefined, maxBufferSize: number, scheduler?: SchedulerLike): OperatorFunction<T, T[]>;\n/* tslint:enable:max-line-length */\n\n/**\n * Buffers the source Observable values for a specific time period.\n *\n * <span class=\"informal\">Collects values from the past as an array, and emits\n * those arrays periodically in time.</span>\n *\n * ![](bufferTime.png)\n *\n * Buffers values from the source for a specific time duration `bufferTimeSpan`.\n * Unless the optional argument `bufferCreationInterval` is given, it emits and\n * resets the buffer every `bufferTimeSpan` milliseconds. If\n * `bufferCreationInterval` is given, this operator opens the buffer every\n * `bufferCreationInterval` milliseconds and closes (emits and resets) the\n * buffer every `bufferTimeSpan` milliseconds. When the optional argument\n * `maxBufferSize` is specified, the buffer will be closed either after\n * `bufferTimeSpan` milliseconds or when it contains `maxBufferSize` elements.\n *\n * ## Examples\n *\n * Every second, emit an array of the recent click events\n *\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const buffered = clicks.pipe(bufferTime(1000));\n * buffered.subscribe(x => console.log(x));\n * ```\n *\n * Every 5 seconds, emit the click events from the next 2 seconds\n *\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const buffered = clicks.pipe(bufferTime(2000, 5000));\n * buffered.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link buffer}\n * @see {@link bufferCount}\n * @see {@link bufferToggle}\n * @see {@link bufferWhen}\n * @see {@link windowTime}\n *\n * @param {number} bufferTimeSpan The amount of time to fill each buffer array.\n * @param {number} [bufferCreationInterval] The interval at which to start new\n * buffers.\n * @param {number} [maxBufferSize] The maximum buffer size.\n * @param {SchedulerLike} [scheduler=async] The scheduler on which to schedule the\n * intervals that determine buffer boundaries.\n * @return {Observable<T[]>} An observable of arrays of buffered values.\n * @method bufferTime\n * @owner Observable\n */\nexport function bufferTime<T>(bufferTimeSpan: number): OperatorFunction<T, T[]> {\n let length: number = arguments.length;\n\n let scheduler: SchedulerLike = async;\n if (isScheduler(arguments[arguments.length - 1])) {\n scheduler = arguments[arguments.length - 1];\n length--;\n }\n\n let bufferCreationInterval: number = null;\n if (length >= 2) {\n bufferCreationInterval = arguments[1];\n }\n\n let maxBufferSize: number = Number.POSITIVE_INFINITY;\n if (length >= 3) {\n maxBufferSize = arguments[2];\n }\n\n return function bufferTimeOperatorFunction(source: Observable<T>) {\n return source.lift(new BufferTimeOperator<T>(bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler));\n };\n}\n\nclass BufferTimeOperator<T> implements Operator<T, T[]> {\n constructor(private bufferTimeSpan: number,\n private bufferCreationInterval: number,\n private maxBufferSize: number,\n private scheduler: SchedulerLike) {\n }\n\n call(subscriber: Subscriber<T[]>, source: any): any {\n return source.subscribe(new BufferTimeSubscriber(\n subscriber, this.bufferTimeSpan, this.bufferCreationInterval, this.maxBufferSize, this.scheduler\n ));\n }\n}\n\nclass Context<T> {\n buffer: T[] = [];\n closeAction: Subscription;\n}\n\ninterface DispatchCreateArg<T> {\n bufferTimeSpan: number;\n bufferCreationInterval: number;\n subscriber: BufferTimeSubscriber<T>;\n scheduler: SchedulerLike;\n}\n\ninterface DispatchCloseArg<T> {\n subscriber: BufferTimeSubscriber<T>;\n context: Context<T>;\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass BufferTimeSubscriber<T> extends Subscriber<T> {\n private contexts: Array<Context<T>> = [];\n private timespanOnly: boolean;\n\n constructor(destination: Subscriber<T[]>,\n private bufferTimeSpan: number,\n private bufferCreationInterval: number,\n private maxBufferSize: number,\n private scheduler: SchedulerLike) {\n super(destination);\n const context = this.openContext();\n this.timespanOnly = bufferCreationInterval == null || bufferCreationInterval < 0;\n if (this.timespanOnly) {\n const timeSpanOnlyState = { subscriber: this, context, bufferTimeSpan };\n this.add(context.closeAction = scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState));\n } else {\n const closeState = { subscriber: this, context };\n const creationState: DispatchCreateArg<T> = { bufferTimeSpan, bufferCreationInterval, subscriber: this, scheduler };\n this.add(context.closeAction = scheduler.schedule<DispatchCloseArg<T>>(dispatchBufferClose, bufferTimeSpan, closeState));\n this.add(scheduler.schedule<DispatchCreateArg<T>>(dispatchBufferCreation, bufferCreationInterval, creationState));\n }\n }\n\n protected _next(value: T) {\n const contexts = this.contexts;\n const len = contexts.length;\n let filledBufferContext: Context<T>;\n for (let i = 0; i < len; i++) {\n const context = contexts[i];\n const buffer = context.buffer;\n buffer.push(value);\n if (buffer.length == this.maxBufferSize) {\n filledBufferContext = context;\n }\n }\n\n if (filledBufferContext) {\n this.onBufferFull(filledBufferContext);\n }\n }\n\n protected _error(err: any) {\n this.contexts.length = 0;\n super._error(err);\n }\n\n protected _complete() {\n const { contexts, destination } = this;\n while (contexts.length > 0) {\n const context = contexts.shift();\n destination.next(context.buffer);\n }\n super._complete();\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _unsubscribe() {\n this.contexts = null;\n }\n\n protected onBufferFull(context: Context<T>) {\n this.closeContext(context);\n const closeAction = context.closeAction;\n closeAction.unsubscribe();\n this.remove(closeAction);\n\n if (!this.closed && this.timespanOnly) {\n context = this.openContext();\n const bufferTimeSpan = this.bufferTimeSpan;\n const timeSpanOnlyState = { subscriber: this, context, bufferTimeSpan };\n this.add(context.closeAction = this.scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState));\n }\n }\n\n openContext(): Context<T> {\n const context: Context<T> = new Context<T>();\n this.contexts.push(context);\n return context;\n }\n\n closeContext(context: Context<T>) {\n this.destination.next(context.buffer);\n const contexts = this.contexts;\n\n const spliceIndex = contexts ? contexts.indexOf(context) : -1;\n if (spliceIndex >= 0) {\n contexts.splice(contexts.indexOf(context), 1);\n }\n }\n}\n\nfunction dispatchBufferTimeSpanOnly(this: SchedulerAction<any>, state: any) {\n const subscriber: BufferTimeSubscriber<any> = state.subscriber;\n\n const prevContext = state.context;\n if (prevContext) {\n subscriber.closeContext(prevContext);\n }\n\n if (!subscriber.closed) {\n state.context = subscriber.openContext();\n state.context.closeAction = this.schedule(state, state.bufferTimeSpan);\n }\n}\n\nfunction dispatchBufferCreation<T>(this: SchedulerAction<DispatchCreateArg<T>>, state: DispatchCreateArg<T>) {\n const { bufferCreationInterval, bufferTimeSpan, subscriber, scheduler } = state;\n const context = subscriber.openContext();\n const action = <SchedulerAction<DispatchCreateArg<T>>>this;\n if (!subscriber.closed) {\n subscriber.add(context.closeAction = scheduler.schedule<DispatchCloseArg<T>>(dispatchBufferClose, bufferTimeSpan, { subscriber, context }));\n action.schedule(state, bufferCreationInterval);\n }\n}\n\nfunction dispatchBufferClose<T>(arg: DispatchCloseArg<T>) {\n const { subscriber, context } = arg;\n subscriber.closeContext(context);\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { Subscription } from '../Subscription';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { OperatorFunction, SubscribableOrPromise } from '../types';\n\n/**\n * Buffers the source Observable values starting from an emission from\n * `openings` and ending when the output of `closingSelector` emits.\n *\n * <span class=\"informal\">Collects values from the past as an array. Starts\n * collecting only when `opening` emits, and calls the `closingSelector`\n * function to get an Observable that tells when to close the buffer.</span>\n *\n * ![](bufferToggle.png)\n *\n * Buffers values from the source by opening the buffer via signals from an\n * Observable provided to `openings`, and closing and sending the buffers when\n * a Subscribable or Promise returned by the `closingSelector` function emits.\n *\n * ## Example\n *\n * Every other second, emit the click events from the next 500ms\n *\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const openings = interval(1000);\n * const buffered = clicks.pipe(bufferToggle(openings, i =>\n * i % 2 ? interval(500) : empty()\n * ));\n * buffered.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link buffer}\n * @see {@link bufferCount}\n * @see {@link bufferTime}\n * @see {@link bufferWhen}\n * @see {@link windowToggle}\n *\n * @param {SubscribableOrPromise<O>} openings A Subscribable or Promise of notifications to start new\n * buffers.\n * @param {function(value: O): SubscribableOrPromise} closingSelector A function that takes\n * the value emitted by the `openings` observable and returns a Subscribable or Promise,\n * which, when it emits, signals that the associated buffer should be emitted\n * and cleared.\n * @return {Observable<T[]>} An observable of arrays of buffered values.\n * @method bufferToggle\n * @owner Observable\n */\nexport function bufferToggle<T, O>(\n openings: SubscribableOrPromise<O>,\n closingSelector: (value: O) => SubscribableOrPromise<any>\n): OperatorFunction<T, T[]> {\n return function bufferToggleOperatorFunction(source: Observable<T>) {\n return source.lift(new BufferToggleOperator<T, O>(openings, closingSelector));\n };\n}\n\nclass BufferToggleOperator<T, O> implements Operator<T, T[]> {\n\n constructor(private openings: SubscribableOrPromise<O>,\n private closingSelector: (value: O) => SubscribableOrPromise<any>) {\n }\n\n call(subscriber: Subscriber<T[]>, source: any): any {\n return source.subscribe(new BufferToggleSubscriber(subscriber, this.openings, this.closingSelector));\n }\n}\n\ninterface BufferContext<T> {\n buffer: T[];\n subscription: Subscription;\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass BufferToggleSubscriber<T, O> extends OuterSubscriber<T, O> {\n private contexts: Array<BufferContext<T>> = [];\n\n constructor(destination: Subscriber<T[]>,\n private openings: SubscribableOrPromise<O>,\n private closingSelector: (value: O) => SubscribableOrPromise<any> | void) {\n super(destination);\n this.add(subscribeToResult(this, openings));\n }\n\n protected _next(value: T): void {\n const contexts = this.contexts;\n const len = contexts.length;\n for (let i = 0; i < len; i++) {\n contexts[i].buffer.push(value);\n }\n }\n\n protected _error(err: any): void {\n const contexts = this.contexts;\n while (contexts.length > 0) {\n const context = contexts.shift();\n context.subscription.unsubscribe();\n context.buffer = null;\n context.subscription = null;\n }\n this.contexts = null;\n super._error(err);\n }\n\n protected _complete(): void {\n const contexts = this.contexts;\n while (contexts.length > 0) {\n const context = contexts.shift();\n this.destination.next(context.buffer);\n context.subscription.unsubscribe();\n context.buffer = null;\n context.subscription = null;\n }\n this.contexts = null;\n super._complete();\n }\n\n notifyNext(outerValue: any, innerValue: O,\n outerIndex: number, innerIndex: number,\n innerSub: InnerSubscriber<T, O>): void {\n outerValue ? this.closeBuffer(outerValue) : this.openBuffer(innerValue);\n }\n\n notifyComplete(innerSub: InnerSubscriber<T, O>): void {\n this.closeBuffer((<any> innerSub).context);\n }\n\n private openBuffer(value: O): void {\n try {\n const closingSelector = this.closingSelector;\n const closingNotifier = closingSelector.call(this, value);\n if (closingNotifier) {\n this.trySubscribe(closingNotifier);\n }\n } catch (err) {\n this._error(err);\n }\n }\n\n private closeBuffer(context: BufferContext<T>): void {\n const contexts = this.contexts;\n\n if (contexts && context) {\n const { buffer, subscription } = context;\n this.destination.next(buffer);\n contexts.splice(contexts.indexOf(context), 1);\n this.remove(subscription);\n subscription.unsubscribe();\n }\n }\n\n private trySubscribe(closingNotifier: any): void {\n const contexts = this.contexts;\n\n const buffer: Array<T> = [];\n const subscription = new Subscription();\n const context = { buffer, subscription };\n contexts.push(context);\n\n const innerSubscription = subscribeToResult(this, closingNotifier, <any>context);\n\n if (!innerSubscription || innerSubscription.closed) {\n this.closeBuffer(context);\n } else {\n (<any> innerSubscription).context = context;\n\n this.add(innerSubscription);\n subscription.add(innerSubscription);\n }\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { Subscription } from '../Subscription';\nimport { tryCatch } from '../util/tryCatch';\nimport { errorObject } from '../util/errorObject';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { OperatorFunction } from '../types';\n\n/**\n * Buffers the source Observable values, using a factory function of closing\n * Observables to determine when to close, emit, and reset the buffer.\n *\n * <span class=\"informal\">Collects values from the past as an array. When it\n * starts collecting values, it calls a function that returns an Observable that\n * tells when to close the buffer and restart collecting.</span>\n *\n * ![](bufferWhen.png)\n *\n * Opens a buffer immediately, then closes the buffer when the observable\n * returned by calling `closingSelector` function emits a value. When it closes\n * the buffer, it immediately opens a new buffer and repeats the process.\n *\n * ## Example\n *\n * Emit an array of the last clicks every [1-5] random seconds\n *\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const buffered = clicks.pipe(bufferWhen(() =>\n * interval(1000 + Math.random() * 4000)\n * ));\n * buffered.subscribe(x => console.log(x));\n * ```\n *\n *\n * @see {@link buffer}\n * @see {@link bufferCount}\n * @see {@link bufferTime}\n * @see {@link bufferToggle}\n * @see {@link windowWhen}\n *\n * @param {function(): Observable} closingSelector A function that takes no\n * arguments and returns an Observable that signals buffer closure.\n * @return {Observable<T[]>} An observable of arrays of buffered values.\n * @method bufferWhen\n * @owner Observable\n */\nexport function bufferWhen<T>(closingSelector: () => Observable<any>): OperatorFunction<T, T[]> {\n return function (source: Observable<T>) {\n return source.lift(new BufferWhenOperator(closingSelector));\n };\n}\n\nclass BufferWhenOperator<T> implements Operator<T, T[]> {\n\n constructor(private closingSelector: () => Observable<any>) {\n }\n\n call(subscriber: Subscriber<T[]>, source: any): any {\n return source.subscribe(new BufferWhenSubscriber(subscriber, this.closingSelector));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass BufferWhenSubscriber<T> extends OuterSubscriber<T, any> {\n private buffer: T[];\n private subscribing: boolean = false;\n private closingSubscription: Subscription;\n\n constructor(destination: Subscriber<T[]>, private closingSelector: () => Observable<any>) {\n super(destination);\n this.openBuffer();\n }\n\n protected _next(value: T) {\n this.buffer.push(value);\n }\n\n protected _complete() {\n const buffer = this.buffer;\n if (buffer) {\n this.destination.next(buffer);\n }\n super._complete();\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _unsubscribe() {\n this.buffer = null;\n this.subscribing = false;\n }\n\n notifyNext(outerValue: T, innerValue: any,\n outerIndex: number, innerIndex: number,\n innerSub: InnerSubscriber<T, any>): void {\n this.openBuffer();\n }\n\n notifyComplete(): void {\n if (this.subscribing) {\n this.complete();\n } else {\n this.openBuffer();\n }\n }\n\n openBuffer() {\n\n let { closingSubscription } = this;\n\n if (closingSubscription) {\n this.remove(closingSubscription);\n closingSubscription.unsubscribe();\n }\n\n const buffer = this.buffer;\n if (this.buffer) {\n this.destination.next(buffer);\n }\n\n this.buffer = [];\n\n const closingNotifier = tryCatch(this.closingSelector)();\n\n if (closingNotifier === errorObject) {\n this.error(errorObject.e);\n } else {\n closingSubscription = new Subscription();\n this.closingSubscription = closingSubscription;\n this.add(closingSubscription);\n this.subscribing = true;\n closingSubscription.add(subscribeToResult(this, closingNotifier));\n this.subscribing = false;\n }\n }\n}\n","import {Operator} from '../Operator';\nimport {Subscriber} from '../Subscriber';\nimport {Observable} from '../Observable';\n\nimport {OuterSubscriber} from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport {subscribeToResult} from '../util/subscribeToResult';\nimport {ObservableInput, OperatorFunction, MonoTypeOperatorFunction} from '../types';\n\n/**\n * Catches errors on the observable to be handled by returning a new observable or throwing an error.\n *\n * ![](catch.png)\n *\n * ## Examples\n * Continues with a different Observable when there's an error\n *\n * ```javascript\n * of(1, 2, 3, 4, 5).pipe(\n * map(n => {\n * \t if (n == 4) {\n * \t throw 'four!';\n * }\n *\t return n;\n * }),\n * catchError(err => of('I', 'II', 'III', 'IV', 'V')),\n * )\n * .subscribe(x => console.log(x));\n * // 1, 2, 3, I, II, III, IV, V\n * ```\n *\n * Retries the caught source Observable again in case of error, similar to retry() operator\n *\n * ```javascript\n * of(1, 2, 3, 4, 5).pipe(\n * map(n => {\n * \t if (n === 4) {\n * \t throw 'four!';\n * }\n * \t return n;\n * }),\n * catchError((err, caught) => caught),\n * take(30),\n * )\n * .subscribe(x => console.log(x));\n * // 1, 2, 3, 1, 2, 3, ...\n * ```\n *\n * Throws a new error when the source Observable throws an error\n *\n * ```javascript\n * of(1, 2, 3, 4, 5).pipe(\n * map(n => {\n * if (n == 4) {\n * throw 'four!';\n * }\n * return n;\n * }),\n * catchError(err => {\n * throw 'error in source. Details: ' + err;\n * }),\n * )\n * .subscribe(\n * x => console.log(x),\n * err => console.log(err)\n * );\n * // 1, 2, 3, error in source. Details: four!\n * ```\n *\n * @param {function} selector a function that takes as arguments `err`, which is the error, and `caught`, which\n * is the source observable, in case you'd like to \"retry\" that observable by returning it again. Whatever observable\n * is returned by the `selector` will be used to continue the observable chain.\n * @return {Observable} An observable that originates from either the source or the observable returned by the\n * catch `selector` function.\n * @name catchError\n */\nexport function catchError<T>(selector: (err: any, caught: Observable<T>) => never): MonoTypeOperatorFunction<T>;\nexport function catchError<T, R>(selector: (err: any, caught: Observable<T>) => ObservableInput<R>): OperatorFunction<T, T | R>;\nexport function catchError<T, R>(selector: (err: any, caught: Observable<T>) => ObservableInput<R>): OperatorFunction<T, T | R> {\n return function catchErrorOperatorFunction(source: Observable<T>): Observable<T | R> {\n const operator = new CatchOperator(selector);\n const caught = source.lift(operator);\n return (operator.caught = caught as Observable<T>);\n };\n}\n\nclass CatchOperator<T, R> implements Operator<T, T | R> {\n caught: Observable<T>;\n\n constructor(private selector: (err: any, caught: Observable<T>) => ObservableInput<T | R>) {\n }\n\n call(subscriber: Subscriber<R>, source: any): any {\n return source.subscribe(new CatchSubscriber(subscriber, this.selector, this.caught));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass CatchSubscriber<T, R> extends OuterSubscriber<T, T | R> {\n constructor(destination: Subscriber<any>,\n private selector: (err: any, caught: Observable<T>) => ObservableInput<T | R>,\n private caught: Observable<T>) {\n super(destination);\n }\n\n // NOTE: overriding `error` instead of `_error` because we don't want\n // to have this flag this subscriber as `isStopped`. We can mimic the\n // behavior of the RetrySubscriber (from the `retry` operator), where\n // we unsubscribe from our source chain, reset our Subscriber flags,\n // then subscribe to the selector result.\n error(err: any) {\n if (!this.isStopped) {\n let result: any;\n try {\n result = this.selector(err, this.caught);\n } catch (err2) {\n super.error(err2);\n return;\n }\n this._unsubscribeAndRecycle();\n const innerSubscriber = new InnerSubscriber(this, undefined, undefined);\n this.add(innerSubscriber);\n subscribeToResult(this, result, undefined, undefined, innerSubscriber);\n }\n }\n}\n","import { CombineLatestOperator } from '../observable/combineLatest';\nimport { Observable } from '../Observable';\nimport { OperatorFunction, ObservableInput } from '../types';\n\nexport function combineAll<T>(): OperatorFunction<ObservableInput<T>, T[]>;\nexport function combineAll<T>(): OperatorFunction<any, T[]>;\nexport function combineAll<T, R>(project: (...values: T[]) => R): OperatorFunction<ObservableInput<T>, R>;\nexport function combineAll<R>(project: (...values: Array<any>) => R): OperatorFunction<any, R>;\n/**\n * Flattens an Observable-of-Observables by applying {@link combineLatest} when the Observable-of-Observables completes.\n *\n * ![](combineAll.png)\n *\n * `combineAll` takes an Observable of Observables, and collects all Observables from it. Once the outer Observable completes,\n * it subscribes to all collected Observables and combines their values using the {@link combineLatest}</a> strategy, such that:\n *\n * * Every time an inner Observable emits, the output Observable emits\n * * When the returned observable emits, it emits all of the latest values by:\n * * If a `project` function is provided, it is called with each recent value from each inner Observable in whatever order they\n * arrived, and the result of the `project` function is what is emitted by the output Observable.\n * * If there is no `project` function, an array of all the most recent values is emitted by the output Observable.\n *\n * ---\n *\n * ## Examples\n * ### Map two click events to a finite interval Observable, then apply `combineAll`\n * ```javascript\n * import { map, combineAll, take } from 'rxjs/operators';\n * import { fromEvent } from 'rxjs/observable/fromEvent';\n *\n * const clicks = fromEvent(document, 'click');\n * const higherOrder = clicks.pipe(\n * map(ev =>\n * interval(Math.random() * 2000).pipe(take(3))\n * ),\n * take(2)\n * );\n * const result = higherOrder.pipe(\n * combineAll()\n * );\n *\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link combineLatest}\n * @see {@link mergeAll}\n *\n * @param {function(...values: Array<any>)} An optional function to map the most recent values from each inner Observable into a new result.\n * Takes each of the most recent values from each collected inner Observable as arguments, in order.\n * @return {Observable<T>}\n * @name combineAll\n */\nexport function combineAll<T, R>(project?: (...values: Array<any>) => R): OperatorFunction<T, R> {\n return (source: Observable<T>) => source.lift(new CombineLatestOperator(project));\n}\n","\nimport { isArray } from '../util/isArray';\nimport { CombineLatestOperator } from '../observable/combineLatest';\nimport { from } from '../observable/from';\nimport { Observable } from '../Observable';\nimport { ObservableInput, OperatorFunction } from '../types';\n\nconst none = {};\n\n/* tslint:disable:max-line-length */\n/** @deprecated Deprecated in favor of static combineLatest. */\nexport function combineLatest<T, R>(project: (v1: T) => R): OperatorFunction<T, R>;\n/** @deprecated Deprecated in favor of static combineLatest. */\nexport function combineLatest<T, T2, R>(v2: ObservableInput<T2>, project: (v1: T, v2: T2) => R): OperatorFunction<T, R>;\n/** @deprecated Deprecated in favor of static combineLatest. */\nexport function combineLatest<T, T2, T3, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, project: (v1: T, v2: T2, v3: T3) => R): OperatorFunction<T, R>;\n/** @deprecated Deprecated in favor of static combineLatest. */\nexport function combineLatest<T, T2, T3, T4, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, project: (v1: T, v2: T2, v3: T3, v4: T4) => R): OperatorFunction<T, R>;\n/** @deprecated Deprecated in favor of static combineLatest. */\nexport function combineLatest<T, T2, T3, T4, T5, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, project: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => R): OperatorFunction<T, R>;\n/** @deprecated Deprecated in favor of static combineLatest. */\nexport function combineLatest<T, T2, T3, T4, T5, T6, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>, project: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6) => R): OperatorFunction<T, R> ;\n/** @deprecated Deprecated in favor of static combineLatest. */\nexport function combineLatest<T, T2>(v2: ObservableInput<T2>): OperatorFunction<T, [T, T2]>;\n/** @deprecated Deprecated in favor of static combineLatest. */\nexport function combineLatest<T, T2, T3>(v2: ObservableInput<T2>, v3: ObservableInput<T3>): OperatorFunction<T, [T, T2, T3]>;\n/** @deprecated Deprecated in favor of static combineLatest. */\nexport function combineLatest<T, T2, T3, T4>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>): OperatorFunction<T, [T, T2, T3, T4]>;\n/** @deprecated Deprecated in favor of static combineLatest. */\nexport function combineLatest<T, T2, T3, T4, T5>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>): OperatorFunction<T, [T, T2, T3, T4, T5]>;\n/** @deprecated Deprecated in favor of static combineLatest. */\nexport function combineLatest<T, T2, T3, T4, T5, T6>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>): OperatorFunction<T, [T, T2, T3, T4, T5, T6]> ;\n/** @deprecated Deprecated in favor of static combineLatest. */\nexport function combineLatest<T, R>(...observables: Array<ObservableInput<T> | ((...values: Array<T>) => R)>): OperatorFunction<T, R>;\n/** @deprecated Deprecated in favor of static combineLatest. */\nexport function combineLatest<T, R>(array: ObservableInput<T>[]): OperatorFunction<T, Array<T>>;\n/** @deprecated Deprecated in favor of static combineLatest. */\nexport function combineLatest<T, TOther, R>(array: ObservableInput<TOther>[], project: (v1: T, ...values: Array<TOther>) => R): OperatorFunction<T, R>;\n/* tslint:enable:max-line-length */\n\n/**\n * @deprecated Deprecated in favor of static {@link combineLatest}.\n */\nexport function combineLatest<T, R>(...observables: Array<ObservableInput<any> |\n Array<ObservableInput<any>> |\n ((...values: Array<any>) => R)>): OperatorFunction<T, R> {\n let project: (...values: Array<any>) => R = null;\n if (typeof observables[observables.length - 1] === 'function') {\n project = <(...values: Array<any>) => R>observables.pop();\n }\n\n // if the first and only other argument besides the resultSelector is an array\n // assume it's been called with `combineLatest([obs1, obs2, obs3], project)`\n if (observables.length === 1 && isArray(observables[0])) {\n observables = (<any>observables[0]).slice();\n }\n\n return (source: Observable<T>) => source.lift.call(from([source, ...observables]), new CombineLatestOperator(project));\n}\n","import { concat as concatStatic } from '../observable/concat';\nimport { Observable } from '../Observable';\nimport { ObservableInput, OperatorFunction, MonoTypeOperatorFunction, SchedulerLike } from '../types';\n\n/* tslint:disable:max-line-length */\n/** @deprecated Deprecated in favor of static concat. */\nexport function concat<T>(scheduler?: SchedulerLike): MonoTypeOperatorFunction<T>;\n/** @deprecated Deprecated in favor of static concat. */\nexport function concat<T, T2>(v2: ObservableInput<T2>, scheduler?: SchedulerLike): OperatorFunction<T, T | T2>;\n/** @deprecated Deprecated in favor of static concat. */\nexport function concat<T, T2, T3>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, scheduler?: SchedulerLike): OperatorFunction<T, T | T2 | T3>;\n/** @deprecated Deprecated in favor of static concat. */\nexport function concat<T, T2, T3, T4>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, scheduler?: SchedulerLike): OperatorFunction<T, T | T2 | T3 | T4>;\n/** @deprecated Deprecated in favor of static concat. */\nexport function concat<T, T2, T3, T4, T5>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, scheduler?: SchedulerLike): OperatorFunction<T, T | T2 | T3 | T4 | T5>;\n/** @deprecated Deprecated in favor of static concat. */\nexport function concat<T, T2, T3, T4, T5, T6>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>, scheduler?: SchedulerLike): OperatorFunction<T, T | T2 | T3 | T4 | T5 | T6>;\n/** @deprecated Deprecated in favor of static concat. */\nexport function concat<T>(...observables: Array<ObservableInput<T> | SchedulerLike>): MonoTypeOperatorFunction<T>;\n/** @deprecated Deprecated in favor of static concat. */\nexport function concat<T, R>(...observables: Array<ObservableInput<any> | SchedulerLike>): OperatorFunction<T, R>;\n/* tslint:enable:max-line-length */\n\n/**\n * @deprecated Deprecated in favor of static {@link concat}.\n */\nexport function concat<T, R>(...observables: Array<ObservableInput<any> | SchedulerLike>): OperatorFunction<T, R> {\n return (source: Observable<T>) => source.lift.call(concatStatic<T, R>(source, ...observables));\n}\n","import { mergeMap } from './mergeMap';\nimport { ObservableInput, OperatorFunction } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function concatMap<T, R>(project: (value: T, index: number) => ObservableInput<R>): OperatorFunction<T, R>;\n/** @deprecated resultSelector no longer supported, use inner map instead */\nexport function concatMap<T, R>(project: (value: T, index: number) => ObservableInput<R>, resultSelector: undefined): OperatorFunction<T, R>;\n/** @deprecated resultSelector no longer supported, use inner map instead */\nexport function concatMap<T, I, R>(project: (value: T, index: number) => ObservableInput<I>, resultSelector: (outerValue: T, innerValue: I, outerIndex: number, innerIndex: number) => R): OperatorFunction<T, R>;\n/* tslint:enable:max-line-length */\n\n/**\n * Projects each source value to an Observable which is merged in the output\n * Observable, in a serialized fashion waiting for each one to complete before\n * merging the next.\n *\n * <span class=\"informal\">Maps each value to an Observable, then flattens all of\n * these inner Observables using {@link concatAll}.</span>\n *\n * ![](concatMap.png)\n *\n * Returns an Observable that emits items based on applying a function that you\n * supply to each item emitted by the source Observable, where that function\n * returns an (so-called \"inner\") Observable. Each new inner Observable is\n * concatenated with the previous inner Observable.\n *\n * __Warning:__ if source values arrive endlessly and faster than their\n * corresponding inner Observables can complete, it will result in memory issues\n * as inner Observables amass in an unbounded buffer waiting for their turn to\n * be subscribed to.\n *\n * Note: `concatMap` is equivalent to `mergeMap` with concurrency parameter set\n * to `1`.\n *\n * ## Example\n * For each click event, tick every second from 0 to 3, with no concurrency\n *\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(\n * concatMap(ev => interval(1000).pipe(take(4)),\n * );\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // (results are not concurrent)\n * // For every click on the \"document\" it will emit values 0 to 3 spaced\n * // on a 1000ms interval\n * // one click = 1000ms-> 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3\n * ```\n *\n * @see {@link concat}\n * @see {@link concatAll}\n * @see {@link concatMapTo}\n * @see {@link exhaustMap}\n * @see {@link mergeMap}\n * @see {@link switchMap}\n *\n * @param {function(value: T, ?index: number): ObservableInput} project A function\n * that, when applied to an item emitted by the source Observable, returns an\n * Observable.\n * @return {Observable} An Observable that emits the result of applying the\n * projection function (and the optional deprecated `resultSelector`) to each item emitted\n * by the source Observable and taking values from each projected inner\n * Observable sequentially.\n * @method concatMap\n * @owner Observable\n */\nexport function concatMap<T, I, R>(\n project: (value: T, index: number) => ObservableInput<I>,\n resultSelector?: (outerValue: T, innerValue: I, outerIndex: number, innerIndex: number) => R\n): OperatorFunction<T, I|R> {\n return mergeMap(project, resultSelector, 1);\n}\n","import { concatMap } from './concatMap';\nimport { ObservableInput, OperatorFunction } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function concatMapTo<T>(observable: ObservableInput<T>): OperatorFunction<any, T>;\n/** @deprecated */\nexport function concatMapTo<T>(observable: ObservableInput<T>, resultSelector: undefined): OperatorFunction<any, T>;\n/** @deprecated */\nexport function concatMapTo<T, I, R>(observable: ObservableInput<I>, resultSelector: (outerValue: T, innerValue: I, outerIndex: number, innerIndex: number) => R): OperatorFunction<T, R>;\n/* tslint:enable:max-line-length */\n\n/**\n * Projects each source value to the same Observable which is merged multiple\n * times in a serialized fashion on the output Observable.\n *\n * <span class=\"informal\">It's like {@link concatMap}, but maps each value\n * always to the same inner Observable.</span>\n *\n * ![](concatMapTo.png)\n *\n * Maps each source value to the given Observable `innerObservable` regardless\n * of the source value, and then flattens those resulting Observables into one\n * single Observable, which is the output Observable. Each new `innerObservable`\n * instance emitted on the output Observable is concatenated with the previous\n * `innerObservable` instance.\n *\n * __Warning:__ if source values arrive endlessly and faster than their\n * corresponding inner Observables can complete, it will result in memory issues\n * as inner Observables amass in an unbounded buffer waiting for their turn to\n * be subscribed to.\n *\n * Note: `concatMapTo` is equivalent to `mergeMapTo` with concurrency parameter\n * set to `1`.\n *\n * ## Example\n * For each click event, tick every second from 0 to 3, with no concurrency\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(\n * concatMapTo(interval(1000).pipe(take(4))),\n * );\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // (results are not concurrent)\n * // For every click on the \"document\" it will emit values 0 to 3 spaced\n * // on a 1000ms interval\n * // one click = 1000ms-> 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3\n * ```\n *\n * @see {@link concat}\n * @see {@link concatAll}\n * @see {@link concatMap}\n * @see {@link mergeMapTo}\n * @see {@link switchMapTo}\n *\n * @param {ObservableInput} innerObservable An Observable to replace each value from\n * the source Observable.\n * @return {Observable} An observable of values merged together by joining the\n * passed observable with itself, one after the other, for each value emitted\n * from the source.\n * @method concatMapTo\n * @owner Observable\n */\nexport function concatMapTo<T, I, R>(\n innerObservable: ObservableInput<I>,\n resultSelector?: (outerValue: T, innerValue: I, outerIndex: number, innerIndex: number) => R\n): OperatorFunction<T, R> {\n return concatMap(() => innerObservable, resultSelector);\n}\n","import { Observable } from '../Observable';\nimport { Operator } from '../Operator';\nimport { Observer, OperatorFunction } from '../types';\nimport { Subscriber } from '../Subscriber';\n/**\n * Counts the number of emissions on the source and emits that number when the\n * source completes.\n *\n * <span class=\"informal\">Tells how many values were emitted, when the source\n * completes.</span>\n *\n * ![](count.png)\n *\n * `count` transforms an Observable that emits values into an Observable that\n * emits a single value that represents the number of values emitted by the\n * source Observable. If the source Observable terminates with an error, `count`\n * will pass this error notification along without emitting a value first. If\n * the source Observable does not terminate at all, `count` will neither emit\n * a value nor terminate. This operator takes an optional `predicate` function\n * as argument, in which case the output emission will represent the number of\n * source values that matched `true` with the `predicate`.\n *\n * ## Examples\n *\n * Counts how many seconds have passed before the first click happened\n * ```javascript\n * const seconds = interval(1000);\n * const clicks = fromEvent(document, 'click');\n * const secondsBeforeClick = seconds.pipe(takeUntil(clicks));\n * const result = secondsBeforeClick.pipe(count());\n * result.subscribe(x => console.log(x));\n * ```\n *\n * Counts how many odd numbers are there between 1 and 7\n * ```javascript\n * const numbers = range(1, 7);\n * const result = numbers.pipe(count(i => i % 2 === 1));\n * result.subscribe(x => console.log(x));\n * // Results in:\n * // 4\n * ```\n *\n * @see {@link max}\n * @see {@link min}\n * @see {@link reduce}\n *\n * @param {function(value: T, i: number, source: Observable<T>): boolean} [predicate] A\n * boolean function to select what values are to be counted. It is provided with\n * arguments of:\n * - `value`: the value from the source Observable.\n * - `index`: the (zero-based) \"index\" of the value from the source Observable.\n * - `source`: the source Observable instance itself.\n * @return {Observable} An Observable of one number that represents the count as\n * described above.\n * @method count\n * @owner Observable\n */\n\nexport function count<T>(predicate?: (value: T, index: number, source: Observable<T>) => boolean): OperatorFunction<T, number> {\n return (source: Observable<T>) => source.lift(new CountOperator(predicate, source));\n}\n\nclass CountOperator<T> implements Operator<T, number> {\n constructor(private predicate?: (value: T, index: number, source: Observable<T>) => boolean,\n private source?: Observable<T>) {\n }\n\n call(subscriber: Subscriber<number>, source: any): any {\n return source.subscribe(new CountSubscriber(subscriber, this.predicate, this.source));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass CountSubscriber<T> extends Subscriber<T> {\n private count: number = 0;\n private index: number = 0;\n\n constructor(destination: Observer<number>,\n private predicate?: (value: T, index: number, source: Observable<T>) => boolean,\n private source?: Observable<T>) {\n super(destination);\n }\n\n protected _next(value: T): void {\n if (this.predicate) {\n this._tryPredicate(value);\n } else {\n this.count++;\n }\n }\n\n private _tryPredicate(value: T) {\n let result: any;\n\n try {\n result = this.predicate(value, this.index++, this.source);\n } catch (err) {\n this.destination.error(err);\n return;\n }\n\n if (result) {\n this.count++;\n }\n }\n\n protected _complete(): void {\n this.destination.next(this.count);\n this.destination.complete();\n }\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { MonoTypeOperatorFunction, SubscribableOrPromise, TeardownLogic } from '../types';\n\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\n\n/**\n * Emits a value from the source Observable only after a particular time span\n * determined by another Observable has passed without another source emission.\n *\n * <span class=\"informal\">It's like {@link debounceTime}, but the time span of\n * emission silence is determined by a second Observable.</span>\n *\n * ![](debounce.png)\n *\n * `debounce` delays values emitted by the source Observable, but drops previous\n * pending delayed emissions if a new value arrives on the source Observable.\n * This operator keeps track of the most recent value from the source\n * Observable, and spawns a duration Observable by calling the\n * `durationSelector` function. The value is emitted only when the duration\n * Observable emits a value or completes, and if no other value was emitted on\n * the source Observable since the duration Observable was spawned. If a new\n * value appears before the duration Observable emits, the previous value will\n * be dropped and will not be emitted on the output Observable.\n *\n * Like {@link debounceTime}, this is a rate-limiting operator, and also a\n * delay-like operator since output emissions do not necessarily occur at the\n * same time as they did on the source Observable.\n *\n * ## Example\n * Emit the most recent click after a burst of clicks\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(debounce(() => interval(1000)));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link audit}\n * @see {@link debounceTime}\n * @see {@link delayWhen}\n * @see {@link throttle}\n *\n * @param {function(value: T): SubscribableOrPromise} durationSelector A function\n * that receives a value from the source Observable, for computing the timeout\n * duration for each source value, returned as an Observable or a Promise.\n * @return {Observable} An Observable that delays the emissions of the source\n * Observable by the specified duration Observable returned by\n * `durationSelector`, and may drop some values if they occur too frequently.\n * @method debounce\n * @owner Observable\n */\nexport function debounce<T>(durationSelector: (value: T) => SubscribableOrPromise<any>): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => source.lift(new DebounceOperator(durationSelector));\n}\n\nclass DebounceOperator<T> implements Operator<T, T> {\n constructor(private durationSelector: (value: T) => SubscribableOrPromise<any>) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new DebounceSubscriber(subscriber, this.durationSelector));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass DebounceSubscriber<T, R> extends OuterSubscriber<T, R> {\n private value: T;\n private hasValue: boolean = false;\n private durationSubscription: Subscription = null;\n\n constructor(destination: Subscriber<R>,\n private durationSelector: (value: T) => SubscribableOrPromise<any>) {\n super(destination);\n }\n\n protected _next(value: T): void {\n try {\n const result = this.durationSelector.call(this, value);\n\n if (result) {\n this._tryNext(value, result);\n }\n } catch (err) {\n this.destination.error(err);\n }\n }\n\n protected _complete(): void {\n this.emitValue();\n this.destination.complete();\n }\n\n private _tryNext(value: T, duration: SubscribableOrPromise<any>): void {\n let subscription = this.durationSubscription;\n this.value = value;\n this.hasValue = true;\n if (subscription) {\n subscription.unsubscribe();\n this.remove(subscription);\n }\n\n subscription = subscribeToResult(this, duration);\n if (subscription && !subscription.closed) {\n this.add(this.durationSubscription = subscription);\n }\n }\n\n notifyNext(outerValue: T, innerValue: R,\n outerIndex: number, innerIndex: number,\n innerSub: InnerSubscriber<T, R>): void {\n this.emitValue();\n }\n\n notifyComplete(): void {\n this.emitValue();\n }\n\n emitValue(): void {\n if (this.hasValue) {\n const value = this.value;\n const subscription = this.durationSubscription;\n if (subscription) {\n this.durationSubscription = null;\n subscription.unsubscribe();\n this.remove(subscription);\n }\n // This must be done *before* passing the value\n // along to the destination because it's possible for\n // the value to synchronously re-enter this operator\n // recursively if the duration selector Observable\n // emits synchronously\n this.value = null;\n this.hasValue = false;\n super._next(value);\n }\n }\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { async } from '../scheduler/async';\nimport { MonoTypeOperatorFunction, SchedulerLike, TeardownLogic } from '../types';\n\n/**\n * Emits a value from the source Observable only after a particular time span\n * has passed without another source emission.\n *\n * <span class=\"informal\">It's like {@link delay}, but passes only the most\n * recent value from each burst of emissions.</span>\n *\n * ![](debounceTime.png)\n *\n * `debounceTime` delays values emitted by the source Observable, but drops\n * previous pending delayed emissions if a new value arrives on the source\n * Observable. This operator keeps track of the most recent value from the\n * source Observable, and emits that only when `dueTime` enough time has passed\n * without any other value appearing on the source Observable. If a new value\n * appears before `dueTime` silence occurs, the previous value will be dropped\n * and will not be emitted on the output Observable.\n *\n * This is a rate-limiting operator, because it is impossible for more than one\n * value to be emitted in any time window of duration `dueTime`, but it is also\n * a delay-like operator since output emissions do not occur at the same time as\n * they did on the source Observable. Optionally takes a {@link SchedulerLike} for\n * managing timers.\n *\n * ## Example\n * Emit the most recent click after a burst of clicks\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(debounceTime(1000));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link auditTime}\n * @see {@link debounce}\n * @see {@link delay}\n * @see {@link sampleTime}\n * @see {@link throttleTime}\n *\n * @param {number} dueTime The timeout duration in milliseconds (or the time\n * unit determined internally by the optional `scheduler`) for the window of\n * time required to wait for emission silence before emitting the most recent\n * source value.\n * @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for\n * managing the timers that handle the timeout for each value.\n * @return {Observable} An Observable that delays the emissions of the source\n * Observable by the specified `dueTime`, and may drop some values if they occur\n * too frequently.\n * @method debounceTime\n * @owner Observable\n */\nexport function debounceTime<T>(dueTime: number, scheduler: SchedulerLike = async): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => source.lift(new DebounceTimeOperator(dueTime, scheduler));\n}\n\nclass DebounceTimeOperator<T> implements Operator<T, T> {\n constructor(private dueTime: number, private scheduler: SchedulerLike) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new DebounceTimeSubscriber(subscriber, this.dueTime, this.scheduler));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass DebounceTimeSubscriber<T> extends Subscriber<T> {\n private debouncedSubscription: Subscription = null;\n private lastValue: T = null;\n private hasValue: boolean = false;\n\n constructor(destination: Subscriber<T>,\n private dueTime: number,\n private scheduler: SchedulerLike) {\n super(destination);\n }\n\n protected _next(value: T) {\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\n protected _complete() {\n this.debouncedNext();\n this.destination.complete();\n }\n\n debouncedNext(): void {\n this.clearDebounce();\n\n if (this.hasValue) {\n const { lastValue } = this;\n // This must be done *before* passing the value\n // along to the destination because it's possible for\n // the value to synchronously re-enter this operator\n // recursively when scheduled with things like\n // VirtualScheduler/TestScheduler.\n this.lastValue = null;\n this.hasValue = false;\n this.destination.next(lastValue);\n }\n }\n\n private clearDebounce(): void {\n const debouncedSubscription = this.debouncedSubscription;\n\n if (debouncedSubscription !== null) {\n this.remove(debouncedSubscription);\n debouncedSubscription.unsubscribe();\n this.debouncedSubscription = null;\n }\n }\n}\n\nfunction dispatchNext(subscriber: DebounceTimeSubscriber<any>) {\n subscriber.debouncedNext();\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { OperatorFunction, MonoTypeOperatorFunction } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function defaultIfEmpty<T>(defaultValue?: T): MonoTypeOperatorFunction<T>;\nexport function defaultIfEmpty<T, R>(defaultValue?: R): OperatorFunction<T, T | R>;\n/* tslint:enable:max-line-length */\n\n/**\n * Emits a given value if the source Observable completes without emitting any\n * `next` value, otherwise mirrors the source Observable.\n *\n * <span class=\"informal\">If the source Observable turns out to be empty, then\n * this operator will emit a default value.</span>\n *\n * ![](defaultIfEmpty.png)\n *\n * `defaultIfEmpty` emits the values emitted by the source Observable or a\n * specified default value if the source Observable is empty (completes without\n * having emitted any `next` value).\n *\n * ## Example\n * If no clicks happen in 5 seconds, then emit \"no clicks\"\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const clicksBeforeFive = clicks.pipe(takeUntil(interval(5000)));\n * const result = clicksBeforeFive.pipe(defaultIfEmpty('no clicks'));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link empty}\n * @see {@link last}\n *\n * @param {any} [defaultValue=null] The default value used if the source\n * Observable is empty.\n * @return {Observable} An Observable that emits either the specified\n * `defaultValue` if the source Observable emits no items, or the values emitted\n * by the source Observable.\n * @method defaultIfEmpty\n * @owner Observable\n */\nexport function defaultIfEmpty<T, R>(defaultValue: R = null): OperatorFunction<T, T | R> {\n return (source: Observable<T>) => source.lift(new DefaultIfEmptyOperator(defaultValue)) as Observable<T | R>;\n}\n\nclass DefaultIfEmptyOperator<T, R> implements Operator<T, T | R> {\n\n constructor(private defaultValue: R) {\n }\n\n call(subscriber: Subscriber<T | R>, source: any): any {\n return source.subscribe(new DefaultIfEmptySubscriber(subscriber, this.defaultValue));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass DefaultIfEmptySubscriber<T, R> extends Subscriber<T> {\n private isEmpty: boolean = true;\n\n constructor(destination: Subscriber<T | R>, private defaultValue: R) {\n super(destination);\n }\n\n protected _next(value: T): void {\n this.isEmpty = false;\n this.destination.next(value);\n }\n\n protected _complete(): void {\n if (this.isEmpty) {\n this.destination.next(this.defaultValue);\n }\n this.destination.complete();\n }\n}\n","export function isDate(value: any): value is Date {\n return value instanceof Date && !isNaN(+value);\n}\n","import { async } from '../scheduler/async';\nimport { isDate } from '../util/isDate';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { Notification } from '../Notification';\nimport { Observable } from '../Observable';\nimport { MonoTypeOperatorFunction, PartialObserver, SchedulerAction, SchedulerLike, TeardownLogic } from '../types';\n\n/**\n * Delays the emission of items from the source Observable by a given timeout or\n * until a given Date.\n *\n * <span class=\"informal\">Time shifts each item by some specified amount of\n * milliseconds.</span>\n *\n * ![](delay.png)\n *\n * If the delay argument is a Number, this operator time shifts the source\n * Observable by that amount of time expressed in milliseconds. The relative\n * time intervals between the values are preserved.\n *\n * If the delay argument is a Date, this operator time shifts the start of the\n * Observable execution until the given date occurs.\n *\n * ## Examples\n * Delay each click by one second\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const delayedClicks = clicks.pipe(delay(1000)); // each click emitted after 1 second\n * delayedClicks.subscribe(x => console.log(x));\n * ```\n *\n * Delay all clicks until a future date happens\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const date = new Date('March 15, 2050 12:00:00'); // in the future\n * const delayedClicks = clicks.pipe(delay(date)); // click emitted only after that date\n * delayedClicks.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link debounceTime}\n * @see {@link delayWhen}\n *\n * @param {number|Date} delay The delay duration in milliseconds (a `number`) or\n * a `Date` until which the emission of the source items is delayed.\n * @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for\n * managing the timers that handle the time-shift for each item.\n * @return {Observable} An Observable that delays the emissions of the source\n * Observable by the specified timeout or Date.\n * @method delay\n * @owner Observable\n */\nexport function delay<T>(delay: number|Date,\n scheduler: SchedulerLike = async): MonoTypeOperatorFunction<T> {\n const absoluteDelay = isDate(delay);\n const delayFor = absoluteDelay ? (+delay - scheduler.now()) : Math.abs(<number>delay);\n return (source: Observable<T>) => source.lift(new DelayOperator(delayFor, scheduler));\n}\n\nclass DelayOperator<T> implements Operator<T, T> {\n constructor(private delay: number,\n private scheduler: SchedulerLike) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new DelaySubscriber(subscriber, this.delay, this.scheduler));\n }\n}\n\ninterface DelayState<T> {\n source: DelaySubscriber<T>;\n destination: PartialObserver<T>;\n scheduler: SchedulerLike;\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass DelaySubscriber<T> extends Subscriber<T> {\n private queue: Array<DelayMessage<T>> = [];\n private active: boolean = false;\n private errored: boolean = false;\n\n private static dispatch<T>(this: SchedulerAction<DelayState<T>>, state: DelayState<T>): void {\n const source = state.source;\n const queue = source.queue;\n const scheduler = state.scheduler;\n const destination = state.destination;\n\n while (queue.length > 0 && (queue[0].time - scheduler.now()) <= 0) {\n queue.shift().notification.observe(destination);\n }\n\n if (queue.length > 0) {\n const delay = Math.max(0, queue[0].time - scheduler.now());\n this.schedule(state, delay);\n } else {\n this.unsubscribe();\n source.active = false;\n }\n }\n\n constructor(destination: Subscriber<T>,\n private delay: number,\n private scheduler: SchedulerLike) {\n super(destination);\n }\n\n private _schedule(scheduler: SchedulerLike): void {\n this.active = true;\n const destination = this.destination as Subscription;\n destination.add(scheduler.schedule<DelayState<T>>(DelaySubscriber.dispatch, this.delay, {\n source: this, destination: this.destination, scheduler: scheduler\n }));\n }\n\n private scheduleNotification(notification: Notification<T>): void {\n if (this.errored === true) {\n return;\n }\n\n const scheduler = this.scheduler;\n const message = new DelayMessage(scheduler.now() + this.delay, notification);\n this.queue.push(message);\n\n if (this.active === false) {\n this._schedule(scheduler);\n }\n }\n\n protected _next(value: T) {\n this.scheduleNotification(Notification.createNext(value));\n }\n\n protected _error(err: any) {\n this.errored = true;\n this.queue = [];\n this.destination.error(err);\n this.unsubscribe();\n }\n\n protected _complete() {\n this.scheduleNotification(Notification.createComplete());\n this.unsubscribe();\n }\n}\n\nclass DelayMessage<T> {\n constructor(public readonly time: number,\n public readonly notification: Notification<T>) {\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { Subscription } from '../Subscription';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/* tslint:disable:max-line-length */\n/** @deprecated In future versions, empty notifiers will no longer re-emit the source value on the output observable. */\nexport function delayWhen<T>(delayDurationSelector: (value: T, index: number) => Observable<never>, subscriptionDelay?: Observable<any>): MonoTypeOperatorFunction<T>;\nexport function delayWhen<T>(delayDurationSelector: (value: T, index: number) => Observable<any>, subscriptionDelay?: Observable<any>): MonoTypeOperatorFunction<T>;\n/* tslint:disable:max-line-length */\n\n/**\n * Delays the emission of items from the source Observable by a given time span\n * determined by the emissions of another Observable.\n *\n * <span class=\"informal\">It's like {@link delay}, but the time span of the\n * delay duration is determined by a second Observable.</span>\n *\n * ![](delayWhen.png)\n *\n * `delayWhen` time shifts each emitted value from the source Observable by a\n * time span determined by another Observable. When the source emits a value,\n * the `delayDurationSelector` function is called with the source value as\n * argument, and should return an Observable, called the \"duration\" Observable.\n * The source value is emitted on the output Observable only when the duration\n * Observable emits a value or completes.\n * The completion of the notifier triggering the emission of the source value\n * is deprecated behavior and will be removed in future versions.\n *\n * Optionally, `delayWhen` takes a second argument, `subscriptionDelay`, which\n * is an Observable. When `subscriptionDelay` emits its first value or\n * completes, the source Observable is subscribed to and starts behaving like\n * described in the previous paragraph. If `subscriptionDelay` is not provided,\n * `delayWhen` will subscribe to the source Observable as soon as the output\n * Observable is subscribed.\n *\n * ## Example\n * Delay each click by a random amount of time, between 0 and 5 seconds\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const delayedClicks = clicks.pipe(\n * delayWhen(event => interval(Math.random() * 5000)),\n * );\n * delayedClicks.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link debounce}\n * @see {@link delay}\n *\n * @param {function(value: T, index: number): Observable} delayDurationSelector A function that\n * returns an Observable for each value emitted by the source Observable, which\n * is then used to delay the emission of that item on the output Observable\n * until the Observable returned from this function emits a value.\n * @param {Observable} subscriptionDelay An Observable that triggers the\n * subscription to the source Observable once it emits any value.\n * @return {Observable} An Observable that delays the emissions of the source\n * Observable by an amount of time specified by the Observable returned by\n * `delayDurationSelector`.\n * @method delayWhen\n * @owner Observable\n */\nexport function delayWhen<T>(delayDurationSelector: (value: T, index: number) => Observable<any>,\n subscriptionDelay?: Observable<any>): MonoTypeOperatorFunction<T> {\n if (subscriptionDelay) {\n return (source: Observable<T>) =>\n new SubscriptionDelayObservable(source, subscriptionDelay)\n .lift(new DelayWhenOperator(delayDurationSelector));\n }\n return (source: Observable<T>) => source.lift(new DelayWhenOperator(delayDurationSelector));\n}\n\nclass DelayWhenOperator<T> implements Operator<T, T> {\n constructor(private delayDurationSelector: (value: T, index: number) => Observable<any>) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new DelayWhenSubscriber(subscriber, this.delayDurationSelector));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass DelayWhenSubscriber<T, R> extends OuterSubscriber<T, R> {\n private completed: boolean = false;\n private delayNotifierSubscriptions: Array<Subscription> = [];\n private index: number = 0;\n\n constructor(destination: Subscriber<T>,\n private delayDurationSelector: (value: T, index: number) => Observable<any>) {\n super(destination);\n }\n\n notifyNext(outerValue: T, innerValue: any,\n outerIndex: number, innerIndex: number,\n innerSub: InnerSubscriber<T, R>): void {\n this.destination.next(outerValue);\n this.removeSubscription(innerSub);\n this.tryComplete();\n }\n\n notifyError(error: any, innerSub: InnerSubscriber<T, R>): void {\n this._error(error);\n }\n\n notifyComplete(innerSub: InnerSubscriber<T, R>): void {\n const value = this.removeSubscription(innerSub);\n if (value) {\n this.destination.next(value);\n }\n this.tryComplete();\n }\n\n protected _next(value: T): void {\n const index = this.index++;\n try {\n const delayNotifier = this.delayDurationSelector(value, index);\n if (delayNotifier) {\n this.tryDelay(delayNotifier, value);\n }\n } catch (err) {\n this.destination.error(err);\n }\n }\n\n protected _complete(): void {\n this.completed = true;\n this.tryComplete();\n this.unsubscribe();\n }\n\n private removeSubscription(subscription: InnerSubscriber<T, R>): T {\n subscription.unsubscribe();\n\n const subscriptionIdx = this.delayNotifierSubscriptions.indexOf(subscription);\n if (subscriptionIdx !== -1) {\n this.delayNotifierSubscriptions.splice(subscriptionIdx, 1);\n }\n\n return subscription.outerValue;\n }\n\n private tryDelay(delayNotifier: Observable<any>, value: T): void {\n const notifierSubscription = subscribeToResult(this, delayNotifier, value);\n\n if (notifierSubscription && !notifierSubscription.closed) {\n const destination = this.destination as Subscription;\n destination.add(notifierSubscription);\n this.delayNotifierSubscriptions.push(notifierSubscription);\n }\n }\n\n private tryComplete(): void {\n if (this.completed && this.delayNotifierSubscriptions.length === 0) {\n this.destination.complete();\n }\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass SubscriptionDelayObservable<T> extends Observable<T> {\n constructor(public source: Observable<T>, private subscriptionDelay: Observable<any>) {\n super();\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _subscribe(subscriber: Subscriber<T>) {\n this.subscriptionDelay.subscribe(new SubscriptionDelaySubscriber(subscriber, this.source));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass SubscriptionDelaySubscriber<T> extends Subscriber<T> {\n private sourceSubscribed: boolean = false;\n\n constructor(private parent: Subscriber<T>, private source: Observable<T>) {\n super();\n }\n\n protected _next(unused: any) {\n this.subscribeToSource();\n }\n\n protected _error(err: any) {\n this.unsubscribe();\n this.parent.error(err);\n }\n\n protected _complete() {\n this.unsubscribe();\n this.subscribeToSource();\n }\n\n private subscribeToSource(): void {\n if (!this.sourceSubscribed) {\n this.sourceSubscribed = true;\n this.unsubscribe();\n this.source.subscribe(this.parent);\n }\n }\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Notification } from '../Notification';\nimport { OperatorFunction } from '../types';\n\n/**\n * Converts an Observable of {@link Notification} objects into the emissions\n * that they represent.\n *\n * <span class=\"informal\">Unwraps {@link Notification} objects as actual `next`,\n * `error` and `complete` emissions. The opposite of {@link materialize}.</span>\n *\n * ![](dematerialize.png)\n *\n * `dematerialize` is assumed to operate an Observable that only emits\n * {@link Notification} objects as `next` emissions, and does not emit any\n * `error`. Such Observable is the output of a `materialize` operation. Those\n * notifications are then unwrapped using the metadata they contain, and emitted\n * as `next`, `error`, and `complete` on the output Observable.\n *\n * Use this operator in conjunction with {@link materialize}.\n *\n * ## Example\n * Convert an Observable of Notifications to an actual Observable\n * ```javascript\n * const notifA = new Notification('N', 'A');\n * const notifB = new Notification('N', 'B');\n * const notifE = new Notification('E', undefined,\n * new TypeError('x.toUpperCase is not a function')\n * );\n * const materialized = of(notifA, notifB, notifE);\n * const upperCase = materialized.pipe(dematerialize());\n * upperCase.subscribe(x => console.log(x), e => console.error(e));\n *\n * // Results in:\n * // A\n * // B\n * // TypeError: x.toUpperCase is not a function\n * ```\n *\n * @see {@link Notification}\n * @see {@link materialize}\n *\n * @return {Observable} An Observable that emits items and notifications\n * embedded in Notification objects emitted by the source Observable.\n * @method dematerialize\n * @owner Observable\n */\nexport function dematerialize<T>(): OperatorFunction<Notification<T>, T> {\n return function dematerializeOperatorFunction(source: Observable<Notification<T>>) {\n return source.lift(new DeMaterializeOperator());\n };\n}\n\nclass DeMaterializeOperator<T extends Notification<any>, R> implements Operator<T, R> {\n call(subscriber: Subscriber<any>, source: any): any {\n return source.subscribe(new DeMaterializeSubscriber(subscriber));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass DeMaterializeSubscriber<T extends Notification<any>> extends Subscriber<T> {\n constructor(destination: Subscriber<any>) {\n super(destination);\n }\n\n protected _next(value: T) {\n value.observe(this.destination);\n }\n}\n","import { Observable } from '../Observable';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/**\n * Returns an Observable that emits all items emitted by the source Observable that are distinct by comparison from previous items.\n *\n * If a keySelector function is provided, then it will project each value from the source observable into a new value that it will\n * check for equality with previously projected values. If a keySelector function is not provided, it will use each value from the\n * source observable directly with an equality check against previous values.\n *\n * In JavaScript runtimes that support `Set`, this operator will use a `Set` to improve performance of the distinct value checking.\n *\n * In other runtimes, this operator will use a minimal implementation of `Set` that relies on an `Array` and `indexOf` under the\n * hood, so performance will degrade as more values are checked for distinction. Even in newer browsers, a long-running `distinct`\n * use might result in memory leaks. To help alleviate this in some scenarios, an optional `flushes` parameter is also provided so\n * that the internal `Set` can be \"flushed\", basically clearing it of values.\n *\n * ## Examples\n * A simple example with numbers\n * ```javascript\n * of(1, 1, 2, 2, 2, 1, 2, 3, 4, 3, 2, 1).pipe(\n * distinct(),\n * )\n * .subscribe(x => console.log(x)); // 1, 2, 3, 4\n * ```\n *\n * An example using a keySelector function\n * ```typescript\n * interface Person {\n * age: number,\n * name: string\n * }\n *\n * of<Person>(\n * { age: 4, name: 'Foo'},\n * { age: 7, name: 'Bar'},\n * { age: 5, name: 'Foo'},\n * ).pipe(\n * distinct((p: Person) => p.name),\n * )\n * .subscribe(x => console.log(x));\n *\n * // displays:\n * // { age: 4, name: 'Foo' }\n * // { age: 7, name: 'Bar' }\n * ```\n * @see {@link distinctUntilChanged}\n * @see {@link distinctUntilKeyChanged}\n *\n * @param {function} [keySelector] Optional function to select which value you want to check as distinct.\n * @param {Observable} [flushes] Optional Observable for flushing the internal HashSet of the operator.\n * @return {Observable} An Observable that emits items from the source Observable with distinct values.\n * @method distinct\n * @owner Observable\n */\nexport function distinct<T, K>(keySelector?: (value: T) => K,\n flushes?: Observable<any>): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => source.lift(new DistinctOperator(keySelector, flushes));\n}\n\nclass DistinctOperator<T, K> implements Operator<T, T> {\n constructor(private keySelector: (value: T) => K, private flushes: Observable<any>) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new DistinctSubscriber(subscriber, this.keySelector, this.flushes));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class DistinctSubscriber<T, K> extends OuterSubscriber<T, T> {\n private values = new Set<K>();\n\n constructor(destination: Subscriber<T>, private keySelector: (value: T) => K, flushes: Observable<any>) {\n super(destination);\n\n if (flushes) {\n this.add(subscribeToResult(this, flushes));\n }\n }\n\n notifyNext(outerValue: T, innerValue: T,\n outerIndex: number, innerIndex: number,\n innerSub: InnerSubscriber<T, T>): void {\n this.values.clear();\n }\n\n notifyError(error: any, innerSub: InnerSubscriber<T, T>): void {\n this._error(error);\n }\n\n protected _next(value: T): void {\n if (this.keySelector) {\n this._useKeySelector(value);\n } else {\n this._finalizeNext(value, value);\n }\n }\n\n private _useKeySelector(value: T): void {\n let key: K;\n const { destination } = this;\n try {\n key = this.keySelector(value);\n } catch (err) {\n destination.error(err);\n return;\n }\n this._finalizeNext(key, value);\n }\n\n private _finalizeNext(key: K|T, value: T) {\n const { values } = this;\n if (!values.has(<K>key)) {\n values.add(<K>key);\n this.destination.next(value);\n }\n }\n\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { tryCatch } from '../util/tryCatch';\nimport { errorObject } from '../util/errorObject';\nimport { Observable } from '../Observable';\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function distinctUntilChanged<T>(compare?: (x: T, y: T) => boolean): MonoTypeOperatorFunction<T>;\nexport function distinctUntilChanged<T, K>(compare: (x: K, y: K) => boolean, keySelector: (x: T) => K): MonoTypeOperatorFunction<T>;\n/* tslint:enable:max-line-length */\n\n/**\n * Returns an Observable that emits all items emitted by the source Observable that are distinct by comparison from the previous item.\n *\n * If a comparator function is provided, then it will be called for each item to test for whether or not that value should be emitted.\n *\n * If a comparator function is not provided, an equality check is used by default.\n *\n * ## Example\n * A simple example with numbers\n * ```javascript\n * of(1, 1, 2, 2, 2, 1, 1, 2, 3, 3, 4).pipe(\n * distinctUntilChanged(),\n * )\n * .subscribe(x => console.log(x)); // 1, 2, 1, 2, 3, 4\n * ```\n *\n * An example using a compare function\n * ```typescript\n * interface Person {\n * age: number,\n * name: string\n * }\n *\n * of<Person>(\n * { age: 4, name: 'Foo'},\n * { age: 7, name: 'Bar'},\n * { age: 5, name: 'Foo'},\n * { age: 6, name: 'Foo'},\n * ).pipe(\n * distinctUntilChanged((p: Person, q: Person) => p.name === q.name),\n * )\n * .subscribe(x => console.log(x));\n *\n * // displays:\n * // { age: 4, name: 'Foo' }\n * // { age: 7, name: 'Bar' }\n * // { age: 5, name: 'Foo' }\n * ```\n *\n * @see {@link distinct}\n * @see {@link distinctUntilKeyChanged}\n *\n * @param {function} [compare] Optional comparison function called to test if an item is distinct from the previous item in the source.\n * @return {Observable} An Observable that emits items from the source Observable with distinct values.\n * @method distinctUntilChanged\n * @owner Observable\n */\nexport function distinctUntilChanged<T, K>(compare?: (x: K, y: K) => boolean, keySelector?: (x: T) => K): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => source.lift(new DistinctUntilChangedOperator<T, K>(compare, keySelector));\n}\n\nclass DistinctUntilChangedOperator<T, K> implements Operator<T, T> {\n constructor(private compare: (x: K, y: K) => boolean,\n private keySelector: (x: T) => K) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new DistinctUntilChangedSubscriber(subscriber, this.compare, this.keySelector));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass DistinctUntilChangedSubscriber<T, K> extends Subscriber<T> {\n private key: K;\n private hasKey: boolean = false;\n\n constructor(destination: Subscriber<T>,\n compare: (x: K, y: K) => boolean,\n private keySelector: (x: T) => K) {\n super(destination);\n if (typeof compare === 'function') {\n this.compare = compare;\n }\n }\n\n private compare(x: any, y: any): boolean {\n return x === y;\n }\n\n protected _next(value: T): void {\n\n const keySelector = this.keySelector;\n let key: any = value;\n\n if (keySelector) {\n key = tryCatch(this.keySelector)(value);\n if (key === errorObject) {\n return this.destination.error(errorObject.e);\n }\n }\n\n let result: any = false;\n\n if (this.hasKey) {\n result = tryCatch(this.compare)(this.key, key);\n if (result === errorObject) {\n return this.destination.error(errorObject.e);\n }\n } else {\n this.hasKey = true;\n }\n\n if (Boolean(result) === false) {\n this.key = key;\n this.destination.next(value);\n }\n }\n}\n","import { distinctUntilChanged } from './distinctUntilChanged';\nimport { MonoTypeOperatorFunction } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function distinctUntilKeyChanged<T>(key: keyof T): MonoTypeOperatorFunction<T>;\nexport function distinctUntilKeyChanged<T, K extends keyof T>(key: K, compare: (x: T[K], y: T[K]) => boolean): MonoTypeOperatorFunction<T>;\n/* tslint:enable:max-line-length */\n\n/**\n * Returns an Observable that emits all items emitted by the source Observable that are distinct by comparison from the previous item,\n * using a property accessed by using the key provided to check if the two items are distinct.\n *\n * If a comparator function is provided, then it will be called for each item to test for whether or not that value should be emitted.\n *\n * If a comparator function is not provided, an equality check is used by default.\n *\n * ## Examples\n * An example comparing the name of persons\n * ```typescript\n * interface Person {\n * age: number,\n * name: string\n * }\n *\n * of<Person>(\n * { age: 4, name: 'Foo'},\n * { age: 7, name: 'Bar'},\n * { age: 5, name: 'Foo'},\n * { age: 6, name: 'Foo'},\n * ).pipe(\n * distinctUntilKeyChanged('name'),\n * )\n * .subscribe(x => console.log(x));\n *\n * // displays:\n * // { age: 4, name: 'Foo' }\n * // { age: 7, name: 'Bar' }\n * // { age: 5, name: 'Foo' }\n * ```\n *\n * An example comparing the first letters of the name\n * ```typescript\n * interface Person {\n * age: number,\n * name: string\n * }\n *\n * of<Person>(\n * { age: 4, name: 'Foo1'},\n * { age: 7, name: 'Bar'},\n * { age: 5, name: 'Foo2'},\n * { age: 6, name: 'Foo3'},\n * ).pipe(\n * distinctUntilKeyChanged('name', (x: string, y: string) => x.substring(0, 3) === y.substring(0, 3)),\n * )\n * .subscribe(x => console.log(x));\n *\n * // displays:\n * // { age: 4, name: 'Foo1' }\n * // { age: 7, name: 'Bar' }\n * // { age: 5, name: 'Foo2' }\n * ```\n *\n * @see {@link distinct}\n * @see {@link distinctUntilChanged}\n *\n * @param {string} key String key for object property lookup on each item.\n * @param {function} [compare] Optional comparison function called to test if an item is distinct from the previous item in the source.\n * @return {Observable} An Observable that emits items from the source Observable with distinct values based on the key specified.\n * @method distinctUntilKeyChanged\n * @owner Observable\n */\nexport function distinctUntilKeyChanged<T, K extends keyof T>(key: K, compare?: (x: T[K], y: T[K]) => boolean): MonoTypeOperatorFunction<T> {\n return distinctUntilChanged((x: T, y: T) => compare ? compare(x[key], y[key]) : x[key] === y[key]);\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { OperatorFunction, MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function filter<T, S extends T>(predicate: (value: T, index: number) => value is S,\n thisArg?: any): OperatorFunction<T, S>;\nexport function filter<T>(predicate: (value: T, index: number) => boolean,\n thisArg?: any): MonoTypeOperatorFunction<T>;\n/* tslint:enable:max-line-length */\n\n/**\n * Filter items emitted by the source Observable by only emitting those that\n * satisfy a specified predicate.\n *\n * <span class=\"informal\">Like\n * [Array.prototype.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter),\n * it only emits a value from the source if it passes a criterion function.</span>\n *\n * ![](filter.png)\n *\n * Similar to the well-known `Array.prototype.filter` method, this operator\n * takes values from the source Observable, passes them through a `predicate`\n * function and only emits those values that yielded `true`.\n *\n * ## Example\n * Emit only click events whose target was a DIV element\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const clicksOnDivs = clicks.pipe(filter(ev => ev.target.tagName === 'DIV'));\n * clicksOnDivs.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link distinct}\n * @see {@link distinctUntilChanged}\n * @see {@link distinctUntilKeyChanged}\n * @see {@link ignoreElements}\n * @see {@link partition}\n * @see {@link skip}\n *\n * @param {function(value: T, index: number): boolean} predicate A function that\n * evaluates each value emitted by the source Observable. If it returns `true`,\n * the value is emitted, if `false` the value is not passed to the output\n * Observable. The `index` parameter is the number `i` for the i-th source\n * emission that has happened since the subscription, starting from the number\n * `0`.\n * @param {any} [thisArg] An optional argument to determine the value of `this`\n * in the `predicate` function.\n * @return {Observable} An Observable of values from the source that were\n * allowed by the `predicate` function.\n * @method filter\n * @owner Observable\n */\nexport function filter<T>(predicate: (value: T, index: number) => boolean,\n thisArg?: any): MonoTypeOperatorFunction<T> {\n return function filterOperatorFunction(source: Observable<T>): Observable<T> {\n return source.lift(new FilterOperator(predicate, thisArg));\n };\n}\n\nclass FilterOperator<T> implements Operator<T, T> {\n constructor(private predicate: (value: T, index: number) => boolean,\n private thisArg?: any) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new FilterSubscriber(subscriber, this.predicate, this.thisArg));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass FilterSubscriber<T> extends Subscriber<T> {\n\n count: number = 0;\n\n constructor(destination: Subscriber<T>,\n private predicate: (value: T, index: number) => boolean,\n private thisArg: any) {\n super(destination);\n }\n\n // the try catch block below is left specifically for\n // optimization and perf reasons. a tryCatcher is not necessary here.\n protected _next(value: T) {\n let result: any;\n try {\n result = this.predicate.call(this.thisArg, value, this.count++);\n } catch (err) {\n this.destination.error(err);\n return;\n }\n if (result) {\n this.destination.next(value);\n }\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { MonoTypeOperatorFunction, PartialObserver, TeardownLogic } from '../types';\nimport { noop } from '../util/noop';\nimport { isFunction } from '../util/isFunction';\n\n/* tslint:disable:max-line-length */\nexport function tap<T>(next?: (x: T) => void, error?: (e: any) => void, complete?: () => void): MonoTypeOperatorFunction<T>;\nexport function tap<T>(observer: PartialObserver<T>): MonoTypeOperatorFunction<T>;\n/* tslint:enable:max-line-length */\n\n/**\n * Perform a side effect for every emission on the source Observable, but return\n * an Observable that is identical to the source.\n *\n * <span class=\"informal\">Intercepts each emission on the source and runs a\n * function, but returns an output which is identical to the source as long as errors don't occur.</span>\n *\n * ![](do.png)\n *\n * Returns a mirrored Observable of the source Observable, but modified so that\n * the provided Observer is called to perform a side effect for every value,\n * error, and completion emitted by the source. Any errors that are thrown in\n * the aforementioned Observer or handlers are safely sent down the error path\n * of the output Observable.\n *\n * This operator is useful for debugging your Observables for the correct values\n * or performing other side effects.\n *\n * Note: this is different to a `subscribe` on the Observable. If the Observable\n * returned by `tap` is not subscribed, the side effects specified by the\n * Observer will never happen. `tap` therefore simply spies on existing\n * execution, it does not trigger an execution to happen like `subscribe` does.\n *\n * ## Example\n * Map every click to the clientX position of that click, while also logging the click event\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const positions = clicks.pipe(\n * tap(ev => console.log(ev)),\n * map(ev => ev.clientX),\n * );\n * positions.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link map}\n * @see {@link Observable#subscribe}\n *\n * @param {Observer|function} [nextOrObserver] A normal Observer object or a\n * callback for `next`.\n * @param {function} [error] Callback for errors in the source.\n * @param {function} [complete] Callback for the completion of the source.\n * @return {Observable} An Observable identical to the source, but runs the\n * specified Observer or callback(s) for each item.\n * @name tap\n */\nexport function tap<T>(nextOrObserver?: PartialObserver<T> | ((x: T) => void),\n error?: (e: any) => void,\n complete?: () => void): MonoTypeOperatorFunction<T> {\n return function tapOperatorFunction(source: Observable<T>): Observable<T> {\n return source.lift(new DoOperator(nextOrObserver, error, complete));\n };\n}\n\nclass DoOperator<T> implements Operator<T, T> {\n constructor(private nextOrObserver?: PartialObserver<T> | ((x: T) => void),\n private error?: (e: any) => void,\n private complete?: () => void) {\n }\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new TapSubscriber(subscriber, this.nextOrObserver, this.error, this.complete));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\n\nclass TapSubscriber<T> extends Subscriber<T> {\n private _context: any;\n\n private _tapNext: ((value: T) => void) = noop;\n\n private _tapError: ((err: any) => void) = noop;\n\n private _tapComplete: (() => void) = noop;\n\n constructor(destination: Subscriber<T>,\n observerOrNext?: PartialObserver<T> | ((value: T) => void),\n error?: (e?: any) => void,\n complete?: () => void) {\n super(destination);\n this._tapError = error || noop;\n this._tapComplete = complete || noop;\n if (isFunction(observerOrNext)) {\n this._context = this;\n this._tapNext = observerOrNext;\n } else if (observerOrNext) {\n this._context = observerOrNext;\n this._tapNext = observerOrNext.next || noop;\n this._tapError = observerOrNext.error || noop;\n this._tapComplete = observerOrNext.complete || noop;\n }\n }\n\n _next(value: T) {\n try {\n this._tapNext.call(this._context, value);\n } catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(value);\n }\n\n _error(err: any) {\n try {\n this._tapError.call(this._context, err);\n } catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.error(err);\n }\n\n _complete() {\n try {\n this._tapComplete.call(this._context, );\n } catch (err) {\n this.destination.error(err);\n return;\n }\n return this.destination.complete();\n }\n}\n","import { tap } from './tap';\nimport { EmptyError } from '../util/EmptyError';\nimport { MonoTypeOperatorFunction } from '../types';\n\n/**\n * If the source observable completes without emitting a value, it will emit\n * an error. The error will be created at that time by the optional\n * `errorFactory` argument, otherwise, the error will be {@link EmptyError}.\n *\n * ![](throwIfEmpty.png)\n *\n * ## Example\n * ```javascript\n * const click$ = fromEvent(button, 'click');\n *\n * clicks$.pipe(\n * takeUntil(timer(1000)),\n * throwIfEmpty(\n * () => new Error('the button was not clicked within 1 second')\n * ),\n * )\n * .subscribe({\n * next() { console.log('The button was clicked'); },\n * error(err) { console.error(err); },\n * });\n * ```\n *\n * @param {Function} [errorFactory] A factory function called to produce the\n * error to be thrown when the source observable completes without emitting a\n * value.\n */\nexport const throwIfEmpty =\n <T>(errorFactory: (() => any) = defaultErrorFactory) => tap<T>({\n hasValue: false,\n next() { this.hasValue = true; },\n complete() {\n if (!this.hasValue) {\n throw errorFactory();\n }\n }\n } as any);\n\nfunction defaultErrorFactory() {\n return new EmptyError();\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { ArgumentOutOfRangeError } from '../util/ArgumentOutOfRangeError';\nimport { empty } from '../observable/empty';\nimport { Observable } from '../Observable';\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/**\n * Emits only the first `count` values emitted by the source Observable.\n *\n * <span class=\"informal\">Takes the first `count` values from the source, then\n * completes.</span>\n *\n * ![](take.png)\n *\n * `take` returns an Observable that emits only the first `count` values emitted\n * by the source Observable. If the source emits fewer than `count` values then\n * all of its values are emitted. After that, it completes, regardless if the\n * source completes.\n *\n * ## Example\n * Take the first 5 seconds of an infinite 1-second interval Observable\n * ```javascript\n * import { interval } from 'rxjs';\n * import { take } from 'rxjs/operators';\n *\n * const intervalCount = interval(1000);\n * const takeFive = intervalCount.pipe(take(5));\n * takeFive.subscribe(x => console.log(x));\n *\n * // Logs:\n * // 0\n * // 1\n * // 2\n * // 3\n * // 4\n * ```\n *\n * @see {@link takeLast}\n * @see {@link takeUntil}\n * @see {@link takeWhile}\n * @see {@link skip}\n *\n * @throws {ArgumentOutOfRangeError} When using `take(i)`, it delivers an\n * ArgumentOutOrRangeError to the Observer's `error` callback if `i < 0`.\n *\n * @param {number} count The maximum number of `next` values to emit.\n * @return {Observable<T>} An Observable that emits only the first `count`\n * values emitted by the source Observable, or all of the values from the source\n * if the source emits fewer than `count` values.\n * @method take\n * @owner Observable\n */\nexport function take<T>(count: number): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => {\n if (count === 0) {\n return empty();\n } else {\n return source.lift(new TakeOperator(count));\n }\n };\n}\n\nclass TakeOperator<T> implements Operator<T, T> {\n constructor(private total: number) {\n if (this.total < 0) {\n throw new ArgumentOutOfRangeError;\n }\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new TakeSubscriber(subscriber, this.total));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass TakeSubscriber<T> extends Subscriber<T> {\n private count: number = 0;\n\n constructor(destination: Subscriber<T>, private total: number) {\n super(destination);\n }\n\n protected _next(value: T): void {\n const total = this.total;\n const 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}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { ArgumentOutOfRangeError } from '../util/ArgumentOutOfRangeError';\nimport { Observable } from '../Observable';\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\nimport { filter } from './filter';\nimport { throwIfEmpty } from './throwIfEmpty';\nimport { defaultIfEmpty } from './defaultIfEmpty';\nimport { take } from './take';\n\n/**\n * Emits the single value at the specified `index` in a sequence of emissions\n * from the source Observable.\n *\n * <span class=\"informal\">Emits only the i-th value, then completes.</span>\n *\n * ![](elementAt.png)\n *\n * `elementAt` returns an Observable that emits the item at the specified\n * `index` in the source Observable, or a default value if that `index` is out\n * of range and the `default` argument is provided. If the `default` argument is\n * not given and the `index` is out of range, the output Observable will emit an\n * `ArgumentOutOfRangeError` error.\n *\n * ## Example\n * Emit only the third click event\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(elementAt(2));\n * result.subscribe(x => console.log(x));\n *\n * // Results in:\n * // click 1 = nothing\n * // click 2 = nothing\n * // click 3 = MouseEvent object logged to console\n * ```\n *\n * @see {@link first}\n * @see {@link last}\n * @see {@link skip}\n * @see {@link single}\n * @see {@link take}\n *\n * @throws {ArgumentOutOfRangeError} When using `elementAt(i)`, it delivers an\n * ArgumentOutOrRangeError to the Observer's `error` callback if `i < 0` or the\n * Observable has completed before emitting the i-th `next` notification.\n *\n * @param {number} index Is the number `i` for the i-th source emission that has\n * happened since the subscription, starting from the number `0`.\n * @param {T} [defaultValue] The default value returned for missing indices.\n * @return {Observable} An Observable that emits a single item, if it is found.\n * Otherwise, will emit the default value if given. If not, then emits an error.\n * @method elementAt\n * @owner Observable\n */\nexport function elementAt<T>(index: number, defaultValue?: T): MonoTypeOperatorFunction<T> {\n if (index < 0) { throw new ArgumentOutOfRangeError(); }\n const hasDefaultValue = arguments.length >= 2;\n return (source: Observable<T>) => source.pipe(\n filter((v, i) => i === index),\n take(1),\n hasDefaultValue\n ? defaultIfEmpty(defaultValue)\n : throwIfEmpty(() => new ArgumentOutOfRangeError()),\n );\n}\n","import { Observable } from '../Observable';\nimport { fromArray } from '../observable/fromArray';\nimport { scalar } from '../observable/scalar';\nimport { empty } from '../observable/empty';\nimport { concat as concatStatic } from '../observable/concat';\nimport { isScheduler } from '../util/isScheduler';\nimport { MonoTypeOperatorFunction, SchedulerLike } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function endWith<T>(scheduler?: SchedulerLike): MonoTypeOperatorFunction<T>;\nexport function endWith<T>(v1: T, scheduler?: SchedulerLike): MonoTypeOperatorFunction<T>;\nexport function endWith<T>(v1: T, v2: T, scheduler?: SchedulerLike): MonoTypeOperatorFunction<T>;\nexport function endWith<T>(v1: T, v2: T, v3: T, scheduler?: SchedulerLike): MonoTypeOperatorFunction<T>;\nexport function endWith<T>(v1: T, v2: T, v3: T, v4: T, scheduler?: SchedulerLike): MonoTypeOperatorFunction<T>;\nexport function endWith<T>(v1: T, v2: T, v3: T, v4: T, v5: T, scheduler?: SchedulerLike): MonoTypeOperatorFunction<T>;\nexport function endWith<T>(v1: T, v2: T, v3: T, v4: T, v5: T, v6: T, scheduler?: SchedulerLike): MonoTypeOperatorFunction<T>;\nexport function endWith<T>(...array: Array<T | SchedulerLike>): MonoTypeOperatorFunction<T>;\n/* tslint:enable:max-line-length */\n\n/**\n * Returns an Observable that emits the items you specify as arguments after it finishes emitting\n * items emitted by the source Observable.\n *\n * ![](endWith.png)\n *\n * ## Example\n * ### After the source observable completes, appends an emission and then completes too.\n *\n * ```javascript\n * of('hi', 'how are you?', 'sorry, I have to go now').pipe(\n * endWith('goodbye!'),\n * )\n * .subscribe(word => console.log(word));\n * // result:\n * // 'hi'\n * // 'how are you?'\n * // 'sorry, I have to go now'\n * // 'goodbye!'\n * ```\n *\n * @param {...T} values - Items you want the modified Observable to emit last.\n * @param {SchedulerLike} [scheduler] - A {@link SchedulerLike} to use for scheduling\n * the emissions of the `next` notifications.\n * @return {Observable} An Observable that emits the items emitted by the source Observable\n * and then emits the items in the specified Iterable.\n * @method endWith\n * @owner Observable\n */\nexport function endWith<T>(...array: Array<T | SchedulerLike>): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => {\n let scheduler = <SchedulerLike>array[array.length - 1];\n if (isScheduler(scheduler)) {\n array.pop();\n } else {\n scheduler = null;\n }\n\n const len = array.length;\n if (len === 1 && !scheduler) {\n return concatStatic(source, scalar(array[0] as T));\n } else if (len > 0) {\n return concatStatic(source, fromArray(array as T[], scheduler));\n } else {\n return concatStatic<T>(source, empty(scheduler) as any);\n }\n };\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Observer, OperatorFunction } from '../types';\n\n/**\n * Returns an Observable that emits whether or not every item of the source satisfies the condition specified.\n *\n * ## Example\n * A simple example emitting true if all elements are less than 5, false otherwise\n * ```javascript\n * of(1, 2, 3, 4, 5, 6).pipe(\n * every(x => x < 5),\n * )\n * .subscribe(x => console.log(x)); // -> false\n * ```\n *\n * @param {function} predicate A function for determining if an item meets a specified condition.\n * @param {any} [thisArg] Optional object to use for `this` in the callback.\n * @return {Observable} An Observable of booleans that determines if all items of the source Observable meet the condition specified.\n * @method every\n * @owner Observable\n */\nexport function every<T>(predicate: (value: T, index: number, source: Observable<T>) => boolean,\n thisArg?: any): OperatorFunction<T, boolean> {\n return (source: Observable<T>) => source.lift(new EveryOperator(predicate, thisArg, source));\n}\n\nclass EveryOperator<T> implements Operator<T, boolean> {\n constructor(private predicate: (value: T, index: number, source: Observable<T>) => boolean,\n private thisArg?: any,\n private source?: Observable<T>) {\n }\n\n call(observer: Subscriber<boolean>, source: any): any {\n return source.subscribe(new EverySubscriber(observer, this.predicate, this.thisArg, this.source));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass EverySubscriber<T> extends Subscriber<T> {\n private index: number = 0;\n\n constructor(destination: Observer<boolean>,\n private predicate: (value: T, index: number, source: Observable<T>) => boolean,\n private thisArg: any,\n private source?: Observable<T>) {\n super(destination);\n this.thisArg = thisArg || this;\n }\n\n private notifyComplete(everyValueMatch: boolean): void {\n this.destination.next(everyValueMatch);\n this.destination.complete();\n }\n\n protected _next(value: T): void {\n let result = false;\n try {\n result = this.predicate.call(this.thisArg, value, this.index++, this.source);\n } catch (err) {\n this.destination.error(err);\n return;\n }\n\n if (!result) {\n this.notifyComplete(false);\n }\n }\n\n protected _complete(): void {\n this.notifyComplete(true);\n }\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { ObservableInput, OperatorFunction, TeardownLogic } from '../types';\n\nexport function exhaust<T>(): OperatorFunction<ObservableInput<T>, T>;\nexport function exhaust<R>(): OperatorFunction<any, R>;\n\n/**\n * Converts a higher-order Observable into a first-order Observable by dropping\n * inner Observables while the previous inner Observable has not yet completed.\n *\n * <span class=\"informal\">Flattens an Observable-of-Observables by dropping the\n * next inner Observables while the current inner is still executing.</span>\n *\n * ![](exhaust.png)\n *\n * `exhaust` subscribes to an Observable that emits Observables, also known as a\n * higher-order Observable. Each time it observes one of these emitted inner\n * Observables, the output Observable begins emitting the items emitted by that\n * inner Observable. So far, it behaves like {@link mergeAll}. However,\n * `exhaust` ignores every new inner Observable if the previous Observable has\n * not yet completed. Once that one completes, it will accept and flatten the\n * next inner Observable and repeat this process.\n *\n * ## Example\n * Run a finite timer for each click, only if there is no currently active timer\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const higherOrder = clicks.pipe(\n * map((ev) => interval(1000).pipe(take(5))),\n * );\n * const result = higherOrder.pipe(exhaust());\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link combineAll}\n * @see {@link concatAll}\n * @see {@link switchAll}\n * @see {@link switchMap}\n * @see {@link mergeAll}\n * @see {@link exhaustMap}\n * @see {@link zipAll}\n *\n * @return {Observable} An Observable that takes a source of Observables and propagates the first observable\n * exclusively until it completes before subscribing to the next.\n * @method exhaust\n * @owner Observable\n */\nexport function exhaust<T>(): OperatorFunction<any, T> {\n return (source: Observable<T>) => source.lift(new SwitchFirstOperator<T>());\n}\n\nclass SwitchFirstOperator<T> implements Operator<T, T> {\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new SwitchFirstSubscriber(subscriber));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass SwitchFirstSubscriber<T> extends OuterSubscriber<T, T> {\n private hasCompleted: boolean = false;\n private hasSubscription: boolean = false;\n\n constructor(destination: Subscriber<T>) {\n super(destination);\n }\n\n protected _next(value: T): void {\n if (!this.hasSubscription) {\n this.hasSubscription = true;\n this.add(subscribeToResult(this, value));\n }\n }\n\n protected _complete(): void {\n this.hasCompleted = true;\n if (!this.hasSubscription) {\n this.destination.complete();\n }\n }\n\n notifyComplete(innerSub: Subscription): void {\n this.remove(innerSub);\n this.hasSubscription = false;\n if (this.hasCompleted) {\n this.destination.complete();\n }\n }\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { ObservableInput, OperatorFunction } from '../types';\nimport { map } from './map';\nimport { from } from '../observable/from';\n\n/* tslint:disable:max-line-length */\nexport function exhaustMap<T, R>(project: (value: T, index: number) => ObservableInput<R>): OperatorFunction<T, R>;\n/** @deprecated resultSelector is no longer supported. Use inner map instead. */\nexport function exhaustMap<T, R>(project: (value: T, index: number) => ObservableInput<R>, resultSelector: undefined): OperatorFunction<T, R>;\n/** @deprecated resultSelector is no longer supported. Use inner map instead. */\nexport function exhaustMap<T, I, R>(project: (value: T, index: number) => ObservableInput<I>, resultSelector: (outerValue: T, innerValue: I, outerIndex: number, innerIndex: number) => R): OperatorFunction<T, R>;\n/* tslint:enable:max-line-length */\n\n/**\n * Projects each source value to an Observable which is merged in the output\n * Observable only if the previous projected Observable has completed.\n *\n * <span class=\"informal\">Maps each value to an Observable, then flattens all of\n * these inner Observables using {@link exhaust}.</span>\n *\n * ![](exhaustMap.png)\n *\n * Returns an Observable that emits items based on applying a function that you\n * supply to each item emitted by the source Observable, where that function\n * returns an (so-called \"inner\") Observable. When it projects a source value to\n * an Observable, the output Observable begins emitting the items emitted by\n * that projected Observable. However, `exhaustMap` ignores every new projected\n * Observable if the previous projected Observable has not yet completed. Once\n * that one completes, it will accept and flatten the next projected Observable\n * and repeat this process.\n *\n * ## Example\n * Run a finite timer for each click, only if there is no currently active timer\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(\n * exhaustMap((ev) => interval(1000).pipe(take(5))),\n * );\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link concatMap}\n * @see {@link exhaust}\n * @see {@link mergeMap}\n * @see {@link switchMap}\n *\n * @param {function(value: T, ?index: number): ObservableInput} project A function\n * that, when applied to an item emitted by the source Observable, returns an\n * Observable.\n * @return {Observable} An Observable containing projected Observables\n * of each item of the source, ignoring projected Observables that start before\n * their preceding Observable has completed.\n * @method exhaustMap\n * @owner Observable\n */\nexport function exhaustMap<T, I, R>(\n project: (value: T, index: number) => ObservableInput<I>,\n resultSelector?: (outerValue: T, innerValue: I, outerIndex: number, innerIndex: number) => R,\n): OperatorFunction<T, I|R> {\n if (resultSelector) {\n // DEPRECATED PATH\n return (source: Observable<T>) => source.pipe(\n exhaustMap((a, i) => from(project(a, i)).pipe(\n map((b, ii) => resultSelector(a, b, i, ii)),\n )),\n );\n }\n return (source: Observable<T>) =>\n source.lift(new ExhauseMapOperator(project));\n}\n\nclass ExhauseMapOperator<T, R> implements Operator<T, R> {\n constructor(private project: (value: T, index: number) => ObservableInput<R>) {\n }\n\n call(subscriber: Subscriber<R>, source: any): any {\n return source.subscribe(new ExhaustMapSubscriber(subscriber, this.project));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass ExhaustMapSubscriber<T, R> extends OuterSubscriber<T, R> {\n private hasSubscription = false;\n private hasCompleted = false;\n private index = 0;\n\n constructor(destination: Subscriber<R>,\n private project: (value: T, index: number) => ObservableInput<R>) {\n super(destination);\n }\n\n protected _next(value: T): void {\n if (!this.hasSubscription) {\n this.tryNext(value);\n }\n }\n\n private tryNext(value: T): void {\n let result: ObservableInput<R>;\n const index = this.index++;\n try {\n result = this.project(value, index);\n } catch (err) {\n this.destination.error(err);\n return;\n }\n this.hasSubscription = true;\n this._innerSub(result, value, index);\n }\n\n private _innerSub(result: ObservableInput<R>, value: T, index: number): void {\n const innerSubscriber = new InnerSubscriber(this, undefined, undefined);\n const destination = this.destination as Subscription;\n destination.add(innerSubscriber);\n subscribeToResult<T, R>(this, result, value, index, innerSubscriber);\n }\n\n protected _complete(): void {\n this.hasCompleted = true;\n if (!this.hasSubscription) {\n this.destination.complete();\n }\n this.unsubscribe();\n }\n\n notifyNext(outerValue: T, innerValue: R,\n outerIndex: number, innerIndex: number,\n innerSub: InnerSubscriber<T, R>): void {\n this.destination.next(innerValue);\n }\n\n notifyError(err: any): void {\n this.destination.error(err);\n }\n\n notifyComplete(innerSub: Subscription): void {\n const destination = this.destination as Subscription;\n destination.remove(innerSub);\n\n this.hasSubscription = false;\n if (this.hasCompleted) {\n this.destination.complete();\n }\n }\n}\n","import { Observable } from '../Observable';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { tryCatch } from '../util/tryCatch';\nimport { errorObject } from '../util/errorObject';\nimport { Subscription } from '../Subscription';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { MonoTypeOperatorFunction, OperatorFunction, ObservableInput, SchedulerLike } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function expand<T, R>(project: (value: T, index: number) => ObservableInput<R>, concurrent?: number, scheduler?: SchedulerLike): OperatorFunction<T, R>;\nexport function expand<T>(project: (value: T, index: number) => ObservableInput<T>, concurrent?: number, scheduler?: SchedulerLike): MonoTypeOperatorFunction<T>;\n/* tslint:enable:max-line-length */\n\n/**\n * Recursively projects each source value to an Observable which is merged in\n * the output Observable.\n *\n * <span class=\"informal\">It's similar to {@link mergeMap}, but applies the\n * projection function to every source value as well as every output value.\n * It's recursive.</span>\n *\n * ![](expand.png)\n *\n * Returns an Observable that emits items based on applying a function that you\n * supply to each item emitted by the source Observable, where that function\n * returns an Observable, and then merging those resulting Observables and\n * emitting the results of this merger. *Expand* will re-emit on the output\n * Observable every source value. Then, each output value is given to the\n * `project` function which returns an inner Observable to be merged on the\n * output Observable. Those output values resulting from the projection are also\n * given to the `project` function to produce new output values. This is how\n * *expand* behaves recursively.\n *\n * ## Example\n * Start emitting the powers of two on every click, at most 10 of them\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const powersOfTwo = clicks.pipe(\n * mapTo(1),\n * expand(x => of(2 * x).pipe(delay(1000))),\n * take(10),\n * );\n * powersOfTwo.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link mergeMap}\n * @see {@link mergeScan}\n *\n * @param {function(value: T, index: number) => Observable} project A function\n * that, when applied to an item emitted by the source or the output Observable,\n * returns an Observable.\n * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of input\n * Observables being subscribed to concurrently.\n * @param {SchedulerLike} [scheduler=null] The {@link SchedulerLike} to use for subscribing to\n * each projected inner Observable.\n * @return {Observable} An Observable that emits the source values and also\n * result of applying the projection function to each value emitted on the\n * output Observable and and merging the results of the Observables obtained\n * from this transformation.\n * @method expand\n * @owner Observable\n */\nexport function expand<T, R>(project: (value: T, index: number) => ObservableInput<R>,\n concurrent: number = Number.POSITIVE_INFINITY,\n scheduler: SchedulerLike = undefined): OperatorFunction<T, R> {\n concurrent = (concurrent || 0) < 1 ? Number.POSITIVE_INFINITY : concurrent;\n\n return (source: Observable<T>) => source.lift(new ExpandOperator(project, concurrent, scheduler));\n}\n\nexport class ExpandOperator<T, R> implements Operator<T, R> {\n constructor(private project: (value: T, index: number) => ObservableInput<R>,\n private concurrent: number,\n private scheduler: SchedulerLike) {\n }\n\n call(subscriber: Subscriber<R>, source: any): any {\n return source.subscribe(new ExpandSubscriber(subscriber, this.project, this.concurrent, this.scheduler));\n }\n}\n\ninterface DispatchArg<T, R> {\n subscriber: ExpandSubscriber<T, R>;\n result: ObservableInput<R>;\n value: any;\n index: number;\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class ExpandSubscriber<T, R> extends OuterSubscriber<T, R> {\n private index: number = 0;\n private active: number = 0;\n private hasCompleted: boolean = false;\n private buffer: any[];\n\n constructor(destination: Subscriber<R>,\n private project: (value: T, index: number) => ObservableInput<R>,\n private concurrent: number,\n private scheduler: SchedulerLike) {\n super(destination);\n if (concurrent < Number.POSITIVE_INFINITY) {\n this.buffer = [];\n }\n }\n\n private static dispatch<T, R>(arg: DispatchArg<T, R>): void {\n const {subscriber, result, value, index} = arg;\n subscriber.subscribeToProjection(result, value, index);\n }\n\n protected _next(value: any): void {\n const destination = this.destination;\n\n if (destination.closed) {\n this._complete();\n return;\n }\n\n const index = this.index++;\n if (this.active < this.concurrent) {\n destination.next(value);\n let result = tryCatch(this.project)(value, index);\n if (result === errorObject) {\n destination.error(errorObject.e);\n } else if (!this.scheduler) {\n this.subscribeToProjection(result, value, index);\n } else {\n const state: DispatchArg<T, R> = { subscriber: this, result, value, index };\n const destination = this.destination as Subscription;\n destination.add(this.scheduler.schedule<DispatchArg<T, R>>(ExpandSubscriber.dispatch, 0, state));\n }\n } else {\n this.buffer.push(value);\n }\n }\n\n private subscribeToProjection(result: any, value: T, index: number): void {\n this.active++;\n const destination = this.destination as Subscription;\n destination.add(subscribeToResult<T, R>(this, result, value, index));\n }\n\n protected _complete(): void {\n this.hasCompleted = true;\n if (this.hasCompleted && this.active === 0) {\n this.destination.complete();\n }\n this.unsubscribe();\n }\n\n notifyNext(outerValue: T, innerValue: R,\n outerIndex: number, innerIndex: number,\n innerSub: InnerSubscriber<T, R>): void {\n this._next(innerValue);\n }\n\n notifyComplete(innerSub: Subscription): void {\n const buffer = this.buffer;\n const destination = this.destination as Subscription;\n destination.remove(innerSub);\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}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { Observable } from '../Observable';\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/**\n * Returns an Observable that mirrors the source Observable, but will call a specified function when\n * the source terminates on complete or error.\n * @param {function} callback Function to be called when source terminates.\n * @return {Observable} An Observable that mirrors the source, but will call the specified function on termination.\n * @method finally\n * @owner Observable\n */\nexport function finalize<T>(callback: () => void): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => source.lift(new FinallyOperator(callback));\n}\n\nclass FinallyOperator<T> implements Operator<T, T> {\n constructor(private callback: () => void) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new FinallySubscriber(subscriber, this.callback));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass FinallySubscriber<T> extends Subscriber<T> {\n constructor(destination: Subscriber<T>, callback: () => void) {\n super(destination);\n this.add(new Subscription(callback));\n }\n}\n","import {Observable} from '../Observable';\nimport {Operator} from '../Operator';\nimport {Subscriber} from '../Subscriber';\nimport {OperatorFunction} from '../types';\n\nexport function find<T, S extends T>(predicate: (value: T, index: number, source: Observable<T>) => value is S,\n thisArg?: any): OperatorFunction<T, S | undefined>;\nexport function find<T>(predicate: (value: T, index: number, source: Observable<T>) => boolean,\n thisArg?: any): OperatorFunction<T, T | undefined>;\n/**\n * Emits only the first value emitted by the source Observable that meets some\n * condition.\n *\n * <span class=\"informal\">Finds the first value that passes some test and emits\n * that.</span>\n *\n * ![](find.png)\n *\n * `find` searches for the first item in the source Observable that matches the\n * specified condition embodied by the `predicate`, and returns the first\n * occurrence in the source. Unlike {@link first}, the `predicate` is required\n * in `find`, and does not emit an error if a valid value is not found.\n *\n * ## Example\n * Find and emit the first click that happens on a DIV element\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(find(ev => ev.target.tagName === 'DIV'));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link filter}\n * @see {@link first}\n * @see {@link findIndex}\n * @see {@link take}\n *\n * @param {function(value: T, index: number, source: Observable<T>): boolean} predicate\n * A function called with each item to test for condition matching.\n * @param {any} [thisArg] An optional argument to determine the value of `this`\n * in the `predicate` function.\n * @return {Observable<T>} An Observable of the first item that matches the\n * condition.\n * @method find\n * @owner Observable\n */\nexport function find<T>(predicate: (value: T, index: number, source: Observable<T>) => boolean,\n thisArg?: any): OperatorFunction<T, T | undefined> {\n if (typeof predicate !== 'function') {\n throw new TypeError('predicate is not a function');\n }\n return (source: Observable<T>) => source.lift(new FindValueOperator(predicate, source, false, thisArg)) as Observable<T | undefined>;\n}\n\nexport class FindValueOperator<T> implements Operator<T, T | number | undefined> {\n constructor(private predicate: (value: T, index: number, source: Observable<T>) => boolean,\n private source: Observable<T>,\n private yieldIndex: boolean,\n private thisArg?: any) {\n }\n\n call(observer: Subscriber<T>, source: any): any {\n return source.subscribe(new FindValueSubscriber(observer, this.predicate, this.source, this.yieldIndex, this.thisArg));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class FindValueSubscriber<T> extends Subscriber<T> {\n private index: number = 0;\n\n constructor(destination: Subscriber<T>,\n private predicate: (value: T, index: number, source: Observable<T>) => boolean,\n private source: Observable<T>,\n private yieldIndex: boolean,\n private thisArg?: any) {\n super(destination);\n }\n\n private notifyComplete(value: any): void {\n const destination = this.destination;\n\n destination.next(value);\n destination.complete();\n this.unsubscribe();\n }\n\n protected _next(value: T): void {\n const {predicate, thisArg} = this;\n const index = this.index++;\n try {\n const result = predicate.call(thisArg || this, value, index, this.source);\n if (result) {\n this.notifyComplete(this.yieldIndex ? index : value);\n }\n } catch (err) {\n this.destination.error(err);\n }\n }\n\n protected _complete(): void {\n this.notifyComplete(this.yieldIndex ? -1 : undefined);\n }\n}\n","import { Observable } from '../Observable';\nimport { FindValueOperator } from '../operators/find';\nimport { OperatorFunction } from '../types';\n/**\n * Emits only the index of the first value emitted by the source Observable that\n * meets some condition.\n *\n * <span class=\"informal\">It's like {@link find}, but emits the index of the\n * found value, not the value itself.</span>\n *\n * ![](findIndex.png)\n *\n * `findIndex` searches for the first item in the source Observable that matches\n * the specified condition embodied by the `predicate`, and returns the\n * (zero-based) index of the first occurrence in the source. Unlike\n * {@link first}, the `predicate` is required in `findIndex`, and does not emit\n * an error if a valid value is not found.\n *\n * ## Example\n * Emit the index of first click that happens on a DIV element\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(findIndex(ev => ev.target.tagName === 'DIV'));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link filter}\n * @see {@link find}\n * @see {@link first}\n * @see {@link take}\n *\n * @param {function(value: T, index: number, source: Observable<T>): boolean} predicate\n * A function called with each item to test for condition matching.\n * @param {any} [thisArg] An optional argument to determine the value of `this`\n * in the `predicate` function.\n * @return {Observable} An Observable of the index of the first item that\n * matches the condition.\n * @method find\n * @owner Observable\n */\nexport function findIndex<T>(predicate: (value: T, index: number, source: Observable<T>) => boolean,\n thisArg?: any): OperatorFunction<T, number> {\n return (source: Observable<T>) => source.lift(new FindValueOperator(predicate, source, true, thisArg)) as Observable<any>;\n}\n","import { Observable } from '../Observable';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { EmptyError } from '../util/EmptyError';\nimport { OperatorFunction } from '../../internal/types';\nimport { filter } from './filter';\nimport { take } from './take';\nimport { defaultIfEmpty } from './defaultIfEmpty';\nimport { throwIfEmpty } from './throwIfEmpty';\nimport { identity } from '../util/identity';\n\n/* tslint:disable:max-line-length */\nexport function first<T, D = T>(\n predicate?: null,\n defaultValue?: D\n): OperatorFunction<T, T | D>;\nexport function first<T, S extends T>(\n predicate: (value: T, index: number, source: Observable<T>) => value is S,\n defaultValue?: S\n): OperatorFunction<T, S>;\nexport function first<T, D = T>(\n predicate: (value: T, index: number, source: Observable<T>) => boolean,\n defaultValue?: D\n): OperatorFunction<T, T | D>;\n/* tslint:enable:max-line-length */\n\n/**\n * Emits only the first value (or the first value that meets some condition)\n * emitted by the source Observable.\n *\n * <span class=\"informal\">Emits only the first value. Or emits only the first\n * value that passes some test.</span>\n *\n * ![](first.png)\n *\n * If called with no arguments, `first` emits the first value of the source\n * Observable, then completes. If called with a `predicate` function, `first`\n * emits the first value of the source that matches the specified condition. It\n * may also take a deprecated `resultSelector` function to produce the output\n * value from the input value, and a `defaultValue` to emit in case the source\n * completes before it is able to emit a valid value. Throws an error if\n * `defaultValue` was not provided and a matching element is not found.\n *\n * ## Examples\n * Emit only the first click that happens on the DOM\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(first());\n * result.subscribe(x => console.log(x));\n * ```\n *\n * Emits the first click that happens on a DIV\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(first(ev => ev.target.tagName === 'DIV'));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link filter}\n * @see {@link find}\n * @see {@link take}\n *\n * @throws {EmptyError} Delivers an EmptyError to the Observer's `error`\n * callback if the Observable completes before any `next` notification was sent.\n *\n * @param {function(value: T, index: number, source: Observable<T>): boolean} [predicate]\n * An optional function called with each item to test for condition matching.\n * @param {R} [defaultValue] The default value emitted in case no valid value\n * was found on the source.\n * @return {Observable<T|R>} An Observable of the first item that matches the\n * condition.\n * @method first\n * @owner Observable\n */\nexport function first<T, D>(\n predicate?: ((value: T, index: number, source: Observable<T>) => boolean) | null,\n defaultValue?: D\n): OperatorFunction<T, T | D> {\n const hasDefaultValue = arguments.length >= 2;\n return (source: Observable<T>) => source.pipe(\n predicate ? filter((v, i) => predicate(v, i, source)) : identity,\n take(1),\n hasDefaultValue ? defaultIfEmpty<T | D>(defaultValue) : throwIfEmpty(() => new EmptyError()),\n );\n}\n","import { Observable } from '../Observable';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { OperatorFunction } from '../types';\n\n/**\n * Ignores all items emitted by the source Observable and only passes calls of `complete` or `error`.\n *\n * ![](ignoreElements.png)\n *\n * ## Examples\n * ### Ignores emitted values, reacts to observable's completion.\n * ```javascript\n * of('you', 'talking', 'to', 'me').pipe(\n * ignoreElements(),\n * )\n * .subscribe(\n * word => console.log(word),\n * err => console.log('error:', err),\n * () => console.log('the end'),\n * );\n * // result:\n * // 'the end'\n * ```\n * @return {Observable} An empty Observable that only calls `complete`\n * or `error`, based on which one is called by the source Observable.\n * @method ignoreElements\n * @owner Observable\n */\nexport function ignoreElements(): OperatorFunction<any, never> {\n return function ignoreElementsOperatorFunction(source: Observable<any>) {\n return source.lift(new IgnoreElementsOperator());\n };\n}\n\nclass IgnoreElementsOperator<T, R> implements Operator<T, R> {\n call(subscriber: Subscriber<R>, source: any): any {\n return source.subscribe(new IgnoreElementsSubscriber(subscriber));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass IgnoreElementsSubscriber<T> extends Subscriber<T> {\n protected _next(unused: T): void {\n // Do nothing\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { OperatorFunction } from '../types';\n\nexport function isEmpty<T>(): OperatorFunction<T, boolean> {\n return (source: Observable<T>) => source.lift(new IsEmptyOperator());\n}\n\nclass IsEmptyOperator implements Operator<any, boolean> {\n call (observer: Subscriber<boolean>, source: any): any {\n return source.subscribe(new IsEmptySubscriber(observer));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass IsEmptySubscriber extends Subscriber<any> {\n constructor(destination: Subscriber<boolean>) {\n super(destination);\n }\n\n private notifyComplete(isEmpty: boolean): void {\n const destination = this.destination;\n\n destination.next(isEmpty);\n destination.complete();\n }\n\n protected _next(value: boolean) {\n this.notifyComplete(false);\n }\n\n protected _complete() {\n this.notifyComplete(true);\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { ArgumentOutOfRangeError } from '../util/ArgumentOutOfRangeError';\nimport { empty } from '../observable/empty';\nimport { Observable } from '../Observable';\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/**\n * Emits only the last `count` values emitted by the source Observable.\n *\n * <span class=\"informal\">Remembers the latest `count` values, then emits those\n * only when the source completes.</span>\n *\n * ![](takeLast.png)\n *\n * `takeLast` returns an Observable that emits at most the last `count` values\n * emitted by the source Observable. If the source emits fewer than `count`\n * values then all of its values are emitted. This operator must wait until the\n * `complete` notification emission from the source in order to emit the `next`\n * values on the output Observable, because otherwise it is impossible to know\n * whether or not more values will be emitted on the source. For this reason,\n * all values are emitted synchronously, followed by the complete notification.\n *\n * ## Example\n * Take the last 3 values of an Observable with many values\n * ```javascript\n * const many = range(1, 100);\n * const lastThree = many.pipe(takeLast(3));\n * lastThree.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link take}\n * @see {@link takeUntil}\n * @see {@link takeWhile}\n * @see {@link skip}\n *\n * @throws {ArgumentOutOfRangeError} When using `takeLast(i)`, it delivers an\n * ArgumentOutOrRangeError to the Observer's `error` callback if `i < 0`.\n *\n * @param {number} count The maximum number of values to emit from the end of\n * the sequence of values emitted by the source Observable.\n * @return {Observable<T>} An Observable that emits at most the last count\n * values emitted by the source Observable.\n * @method takeLast\n * @owner Observable\n */\nexport function takeLast<T>(count: number): MonoTypeOperatorFunction<T> {\n return function takeLastOperatorFunction(source: Observable<T>): Observable<T> {\n if (count === 0) {\n return empty();\n } else {\n return source.lift(new TakeLastOperator(count));\n }\n };\n}\n\nclass TakeLastOperator<T> implements Operator<T, T> {\n constructor(private total: number) {\n if (this.total < 0) {\n throw new ArgumentOutOfRangeError;\n }\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new TakeLastSubscriber(subscriber, this.total));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass TakeLastSubscriber<T> extends Subscriber<T> {\n private ring: Array<T> = new Array();\n private count: number = 0;\n\n constructor(destination: Subscriber<T>, private total: number) {\n super(destination);\n }\n\n protected _next(value: T): void {\n const ring = this.ring;\n const total = this.total;\n const count = this.count++;\n\n if (ring.length < total) {\n ring.push(value);\n } else {\n const index = count % total;\n ring[index] = value;\n }\n }\n\n protected _complete(): void {\n const destination = this.destination;\n let count = this.count;\n\n if (count > 0) {\n const total = this.count >= this.total ? this.total : this.count;\n const ring = this.ring;\n\n for (let i = 0; i < total; i++) {\n const idx = (count++) % total;\n destination.next(ring[idx]);\n }\n }\n\n destination.complete();\n }\n}\n","import { Observable } from '../Observable';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { EmptyError } from '../util/EmptyError';\nimport { OperatorFunction } from '../../internal/types';\nimport { filter } from './filter';\nimport { takeLast } from './takeLast';\nimport { throwIfEmpty } from './throwIfEmpty';\nimport { defaultIfEmpty } from './defaultIfEmpty';\nimport { identity } from '../util/identity';\n\n/* tslint:disable:max-line-length */\nexport function last<T, D = T>(\n predicate?: null,\n defaultValue?: D\n): OperatorFunction<T, T | D>;\nexport function last<T, S extends T>(\n predicate: (value: T, index: number, source: Observable<T>) => value is S,\n defaultValue?: S\n): OperatorFunction<T, S>;\nexport function last<T, D = T>(\n predicate: (value: T, index: number, source: Observable<T>) => boolean,\n defaultValue?: D\n): OperatorFunction<T, T | D>;\n/* tslint:enable:max-line-length */\n\n/**\n * Returns an Observable that emits only the last item emitted by the source Observable.\n * It optionally takes a predicate function as a parameter, in which case, rather than emitting\n * the last item from the source Observable, the resulting Observable will emit the last item\n * from the source Observable that satisfies the predicate.\n *\n * ![](last.png)\n *\n * @throws {EmptyError} Delivers an EmptyError to the Observer's `error`\n * callback if the Observable completes before any `next` notification was sent.\n * @param {function} [predicate] - The condition any source emitted item has to satisfy.\n * @param {any} [defaultValue] - An optional default value to provide if last\n * predicate isn't met or no values were emitted.\n * @return {Observable} An Observable that emits only the last item satisfying the given condition\n * from the source, or an NoSuchElementException if no such items are emitted.\n * @throws - Throws if no items that match the predicate are emitted by the source Observable.\n */\nexport function last<T, D>(\n predicate?: ((value: T, index: number, source: Observable<T>) => boolean) | null,\n defaultValue?: D\n): OperatorFunction<T, T | D> {\n const hasDefaultValue = arguments.length >= 2;\n return (source: Observable<T>) => source.pipe(\n predicate ? filter((v, i) => predicate(v, i, source)) : identity,\n takeLast(1),\n hasDefaultValue ? defaultIfEmpty<T | D>(defaultValue) : throwIfEmpty(() => new EmptyError()),\n );\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { OperatorFunction } from '../types';\n\n/**\n * Emits the given constant value on the output Observable every time the source\n * Observable emits a value.\n *\n * <span class=\"informal\">Like {@link map}, but it maps every source value to\n * the same output value every time.</span>\n *\n * ![](mapTo.png)\n *\n * Takes a constant `value` as argument, and emits that whenever the source\n * Observable emits a value. In other words, ignores the actual source value,\n * and simply uses the emission moment to know when to emit the given `value`.\n *\n * ## Example\n * Map every click to the string 'Hi'\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const greetings = clicks.pipe(mapTo('Hi'));\n * greetings.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link map}\n *\n * @param {any} value The value to map each source value to.\n * @return {Observable} An Observable that emits the given `value` every time\n * the source Observable emits something.\n * @method mapTo\n * @owner Observable\n */\nexport function mapTo<T, R>(value: R): OperatorFunction<T, R> {\n return (source: Observable<T>) => source.lift(new MapToOperator(value));\n}\n\nclass MapToOperator<T, R> implements Operator<T, R> {\n\n value: R;\n\n constructor(value: R) {\n this.value = value;\n }\n\n call(subscriber: Subscriber<R>, source: any): any {\n return source.subscribe(new MapToSubscriber(subscriber, this.value));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass MapToSubscriber<T, R> extends Subscriber<T> {\n\n value: R;\n\n constructor(destination: Subscriber<R>, value: R) {\n super(destination);\n this.value = value;\n }\n\n protected _next(x: T) {\n this.destination.next(this.value);\n }\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Notification } from '../Notification';\nimport { OperatorFunction } from '../types';\n\n/**\n * Represents all of the notifications from the source Observable as `next`\n * emissions marked with their original types within {@link Notification}\n * objects.\n *\n * <span class=\"informal\">Wraps `next`, `error` and `complete` emissions in\n * {@link Notification} objects, emitted as `next` on the output Observable.\n * </span>\n *\n * ![](materialize.png)\n *\n * `materialize` returns an Observable that emits a `next` notification for each\n * `next`, `error`, or `complete` emission of the source Observable. When the\n * source Observable emits `complete`, the output Observable will emit `next` as\n * a Notification of type \"complete\", and then it will emit `complete` as well.\n * When the source Observable emits `error`, the output will emit `next` as a\n * Notification of type \"error\", and then `complete`.\n *\n * This operator is useful for producing metadata of the source Observable, to\n * be consumed as `next` emissions. Use it in conjunction with\n * {@link dematerialize}.\n *\n * ## Example\n * Convert a faulty Observable to an Observable of Notifications\n * ```javascript\n * const letters = of('a', 'b', 13, 'd');\n * const upperCase = letters.pipe(map(x => x.toUpperCase()));\n * const materialized = upperCase.pipe(materialize());\n * materialized.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // - Notification {kind: \"N\", value: \"A\", error: undefined, hasValue: true}\n * // - Notification {kind: \"N\", value: \"B\", error: undefined, hasValue: true}\n * // - Notification {kind: \"E\", value: undefined, error: TypeError:\n * // x.toUpperCase is not a function at MapSubscriber.letters.map.x\n * // [as project] (http://1…, hasValue: false}\n * ```\n *\n * @see {@link Notification}\n * @see {@link dematerialize}\n *\n * @return {Observable<Notification<T>>} An Observable that emits\n * {@link Notification} objects that wrap the original emissions from the source\n * Observable with metadata.\n * @method materialize\n * @owner Observable\n */\nexport function materialize<T>(): OperatorFunction<T, Notification<T>> {\n return function materializeOperatorFunction(source: Observable<T>) {\n return source.lift(new MaterializeOperator());\n };\n}\n\nclass MaterializeOperator<T> implements Operator<T, Notification<T>> {\n call(subscriber: Subscriber<Notification<T>>, source: any): any {\n return source.subscribe(new MaterializeSubscriber(subscriber));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass MaterializeSubscriber<T> extends Subscriber<T> {\n constructor(destination: Subscriber<Notification<T>>) {\n super(destination);\n }\n\n protected _next(value: T) {\n this.destination.next(Notification.createNext(value));\n }\n\n protected _error(err: any) {\n const destination = this.destination;\n destination.next(Notification.createError(err));\n destination.complete();\n }\n\n protected _complete() {\n const destination = this.destination;\n destination.next(Notification.createComplete());\n destination.complete();\n }\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { OperatorFunction, MonoTypeOperatorFunction } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function scan<T>(accumulator: (acc: T, value: T, index: number) => T, seed?: T): MonoTypeOperatorFunction<T>;\nexport function scan<T>(accumulator: (acc: T[], value: T, index: number) => T[], seed?: T[]): OperatorFunction<T, T[]>;\nexport function scan<T, R>(accumulator: (acc: R, value: T, index: number) => R, seed?: R): OperatorFunction<T, R>;\n/* tslint:enable:max-line-length */\n\n/**\n * Applies an accumulator function over the source Observable, and returns each\n * intermediate result, with an optional seed value.\n *\n * <span class=\"informal\">It's like {@link reduce}, but emits the current\n * accumulation whenever the source emits a value.</span>\n *\n * ![](scan.png)\n *\n * Combines together all values emitted on the source, using an accumulator\n * function that knows how to join a new source value into the accumulation from\n * the past. Is similar to {@link reduce}, but emits the intermediate\n * accumulations.\n *\n * Returns an Observable that applies a specified `accumulator` function to each\n * item emitted by the source Observable. If a `seed` value is specified, then\n * that value will be used as the initial value for the accumulator. If no seed\n * value is specified, the first item of the source is used as the seed.\n *\n * ## Example\n * Count the number of click events\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const ones = clicks.pipe(mapTo(1));\n * const seed = 0;\n * const count = ones.pipe(scan((acc, one) => acc + one, seed));\n * count.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link expand}\n * @see {@link mergeScan}\n * @see {@link reduce}\n *\n * @param {function(acc: R, value: T, index: number): R} accumulator\n * The accumulator function called on each source value.\n * @param {T|R} [seed] The initial accumulation value.\n * @return {Observable<R>} An observable of the accumulated values.\n * @method scan\n * @owner Observable\n */\nexport function scan<T, R>(accumulator: (acc: R, value: T, index: number) => R, seed?: T | R): OperatorFunction<T, R> {\n let hasSeed = false;\n // providing a seed of `undefined` *should* be valid and trigger\n // hasSeed! so don't use `seed !== undefined` checks!\n // For this reason, we have to check it here at the original call site\n // otherwise inside Operator/Subscriber we won't know if `undefined`\n // means they didn't provide anything or if they literally provided `undefined`\n if (arguments.length >= 2) {\n hasSeed = true;\n }\n\n return function scanOperatorFunction(source: Observable<T>): Observable<R> {\n return source.lift(new ScanOperator(accumulator, seed, hasSeed));\n };\n}\n\nclass ScanOperator<T, R> implements Operator<T, R> {\n constructor(private accumulator: (acc: R, value: T, index: number) => R, private seed?: T | R, private hasSeed: boolean = false) {}\n\n call(subscriber: Subscriber<R>, source: any): any {\n return source.subscribe(new ScanSubscriber(subscriber, this.accumulator, this.seed, this.hasSeed));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass ScanSubscriber<T, R> extends Subscriber<T> {\n private index: number = 0;\n\n get seed(): T | R {\n return this._seed;\n }\n\n set seed(value: T | R) {\n this.hasSeed = true;\n this._seed = value;\n }\n\n constructor(destination: Subscriber<R>, private accumulator: (acc: R, value: T, index: number) => R, private _seed: T | R,\n private hasSeed: boolean) {\n super(destination);\n }\n\n protected _next(value: T): void {\n if (!this.hasSeed) {\n this.seed = value;\n this.destination.next(value);\n } else {\n return this._tryNext(value);\n }\n }\n\n private _tryNext(value: T): void {\n const index = this.index++;\n let result: any;\n try {\n result = this.accumulator(<R>this.seed, value, index);\n } catch (err) {\n this.destination.error(err);\n }\n this.seed = result;\n this.destination.next(result);\n }\n}\n","import { Observable } from '../Observable';\nimport { scan } from './scan';\nimport { takeLast } from './takeLast';\nimport { defaultIfEmpty } from './defaultIfEmpty';\nimport { OperatorFunction, MonoTypeOperatorFunction } from '../types';\nimport { pipe } from '../util/pipe';\n\n/* tslint:disable:max-line-length */\nexport function reduce<T>(accumulator: (acc: T, value: T, index: number) => T, seed?: T): MonoTypeOperatorFunction<T>;\nexport function reduce<T>(accumulator: (acc: T[], value: T, index: number) => T[], seed: T[]): OperatorFunction<T, T[]>;\nexport function reduce<T, R>(accumulator: (acc: R, value: T, index: number) => R, seed?: R): OperatorFunction<T, R>;\n/* tslint:enable:max-line-length */\n\n/**\n * Applies an accumulator function over the source Observable, and returns the\n * accumulated result when the source completes, given an optional seed value.\n *\n * <span class=\"informal\">Combines together all values emitted on the source,\n * using an accumulator function that knows how to join a new source value into\n * the accumulation from the past.</span>\n *\n * ![](reduce.png)\n *\n * Like\n * [Array.prototype.reduce()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce),\n * `reduce` applies an `accumulator` function against an accumulation and each\n * value of the source Observable (from the past) to reduce it to a single\n * value, emitted on the output Observable. Note that `reduce` will only emit\n * one value, only when the source Observable completes. It is equivalent to\n * applying operator {@link scan} followed by operator {@link last}.\n *\n * Returns an Observable that applies a specified `accumulator` function to each\n * item emitted by the source Observable. If a `seed` value is specified, then\n * that value will be used as the initial value for the accumulator. If no seed\n * value is specified, the first item of the source is used as the seed.\n *\n * ## Example\n * Count the number of click events that happened in 5 seconds\n * ```javascript\n * const clicksInFiveSeconds = fromEvent(document, 'click').pipe(\n * takeUntil(interval(5000)),\n * );\n * const ones = clicksInFiveSeconds.pipe(mapTo(1));\n * const seed = 0;\n * const count = ones.reduce((acc, one) => acc + one, seed);\n * count.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link count}\n * @see {@link expand}\n * @see {@link mergeScan}\n * @see {@link scan}\n *\n * @param {function(acc: R, value: T, index: number): R} accumulator The accumulator function\n * called on each source value.\n * @param {R} [seed] The initial accumulation value.\n * @return {Observable<R>} An Observable that emits a single value that is the\n * result of accumulating the values emitted by the source Observable.\n * @method reduce\n * @owner Observable\n */\nexport function reduce<T, R>(accumulator: (acc: R, value: T, index?: number) => R, seed?: R): OperatorFunction<T, R> {\n // providing a seed of `undefined` *should* be valid and trigger\n // hasSeed! so don't use `seed !== undefined` checks!\n // For this reason, we have to check it here at the original call site\n // otherwise inside Operator/Subscriber we won't know if `undefined`\n // means they didn't provide anything or if they literally provided `undefined`\n if (arguments.length >= 2) {\n return function reduceOperatorFunctionWithSeed(source: Observable<T>): Observable<R> {\n return pipe(scan(accumulator, seed), takeLast(1), defaultIfEmpty(seed))(source);\n };\n }\n return function reduceOperatorFunction(source: Observable<T>): Observable<R> {\n return pipe(\n scan((acc: R, value: T, index: number): R => accumulator(acc, value, index + 1)),\n takeLast(1),\n )(source);\n };\n}\n","import { reduce } from './reduce';\nimport { MonoTypeOperatorFunction } from '../types';\n\n/**\n * The Max operator operates on an Observable that emits numbers (or items that can be compared with a provided function),\n * and when source Observable completes it emits a single item: the item with the largest value.\n *\n * ![](max.png)\n *\n * ## Examples\n * Get the maximal value of a series of numbers\n * ```javascript\n * of(5, 4, 7, 2, 8).pipe(\n * max(),\n * )\n * .subscribe(x => console.log(x)); // -> 8\n * ```\n *\n * Use a comparer function to get the maximal item\n * ```typescript\n * interface Person {\n * age: number,\n * name: string\n * }\n * of<Person>(\n * {age: 7, name: 'Foo'},\n * {age: 5, name: 'Bar'},\n * {age: 9, name: 'Beer'},\n * ).pipe(\n * max<Person>((a: Person, b: Person) => a.age < b.age ? -1 : 1),\n * )\n * .subscribe((x: Person) => console.log(x.name)); // -> 'Beer'\n * ```\n *\n * @see {@link min}\n *\n * @param {Function} [comparer] - Optional comparer function that it will use instead of its default to compare the\n * value of two items.\n * @return {Observable} An Observable that emits item with the largest value.\n * @method max\n * @owner Observable\n */\nexport function max<T>(comparer?: (x: T, y: T) => number): MonoTypeOperatorFunction<T> {\n const max: (x: T, y: T) => T = (typeof comparer === 'function')\n ? (x, y) => comparer(x, y) > 0 ? x : y\n : (x, y) => x > y ? x : y;\n\n return reduce(max);\n}\n","import { merge as mergeStatic } from '../observable/merge';\nimport { Observable } from '../Observable';\nimport { ObservableInput, OperatorFunction, MonoTypeOperatorFunction, SchedulerLike } from '../types';\n\n/* tslint:disable:max-line-length */\n/** @deprecated Deprecated in favor of static merge. */\nexport function merge<T>(scheduler?: SchedulerLike): MonoTypeOperatorFunction<T>;\n/** @deprecated Deprecated in favor of static merge. */\nexport function merge<T>(concurrent?: number, scheduler?: SchedulerLike): MonoTypeOperatorFunction<T>;\n/** @deprecated Deprecated in favor of static merge. */\nexport function merge<T, T2>(v2: ObservableInput<T2>, scheduler?: SchedulerLike): OperatorFunction<T, T | T2>;\n/** @deprecated Deprecated in favor of static merge. */\nexport function merge<T, T2>(v2: ObservableInput<T2>, concurrent?: number, scheduler?: SchedulerLike): OperatorFunction<T, T | T2>;\n/** @deprecated Deprecated in favor of static merge. */\nexport function merge<T, T2, T3>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, scheduler?: SchedulerLike): OperatorFunction<T, T | T2 | T3>;\n/** @deprecated Deprecated in favor of static merge. */\nexport function merge<T, T2, T3>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, concurrent?: number, scheduler?: SchedulerLike): OperatorFunction<T, T | T2 | T3>;\n/** @deprecated Deprecated in favor of static merge. */\nexport function merge<T, T2, T3, T4>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, scheduler?: SchedulerLike): OperatorFunction<T, T | T2 | T3 | T4>;\n/** @deprecated Deprecated in favor of static merge. */\nexport function merge<T, T2, T3, T4>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, concurrent?: number, scheduler?: SchedulerLike): OperatorFunction<T, T | T2 | T3 | T4>;\n/** @deprecated Deprecated in favor of static merge. */\nexport function merge<T, T2, T3, T4, T5>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, scheduler?: SchedulerLike): OperatorFunction<T, T | T2 | T3 | T4 | T5>;\n/** @deprecated Deprecated in favor of static merge. */\nexport function merge<T, T2, T3, T4, T5>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, concurrent?: number, scheduler?: SchedulerLike): OperatorFunction<T, T | T2 | T3 | T4 | T5>;\n/** @deprecated Deprecated in favor of static merge. */\nexport function merge<T, T2, T3, T4, T5, T6>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>, scheduler?: SchedulerLike): OperatorFunction<T, T | T2 | T3 | T4 | T5 | T6>;\n/** @deprecated Deprecated in favor of static merge. */\nexport function merge<T, T2, T3, T4, T5, T6>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>, concurrent?: number, scheduler?: SchedulerLike): OperatorFunction<T, T | T2 | T3 | T4 | T5 | T6>;\n/** @deprecated Deprecated in favor of static merge. */\nexport function merge<T>(...observables: Array<ObservableInput<T> | SchedulerLike | number>): MonoTypeOperatorFunction<T>;\n/** @deprecated Deprecated in favor of static merge. */\nexport function merge<T, R>(...observables: Array<ObservableInput<any> | SchedulerLike | number>): OperatorFunction<T, R>;\n/* tslint:enable:max-line-length */\n\n/**\n * @deprecated Deprecated in favor of static {@link merge}.\n */\nexport function merge<T, R>(...observables: Array<ObservableInput<any> | SchedulerLike | number>): OperatorFunction<T, R> {\n return (source: Observable<T>) => source.lift.call(mergeStatic(source, ...observables));\n}\n","import { Observable } from '../Observable';\nimport { OperatorFunction } from '../../internal/types';\nimport { mergeMap } from './mergeMap';\nimport { ObservableInput } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function mergeMapTo<T>(innerObservable: ObservableInput<T>, concurrent?: number): OperatorFunction<any, T>;\n/** @deprecated */\nexport function mergeMapTo<T, I, R>(innerObservable: ObservableInput<I>, resultSelector: (outerValue: T, innerValue: I, outerIndex: number, innerIndex: number) => R, concurrent?: number): OperatorFunction<T, R>;\n/* tslint:enable:max-line-length */\n\n/**\n * Projects each source value to the same Observable which is merged multiple\n * times in the output Observable.\n *\n * <span class=\"informal\">It's like {@link mergeMap}, but maps each value always\n * to the same inner Observable.</span>\n *\n * ![](mergeMapTo.png)\n *\n * Maps each source value to the given Observable `innerObservable` regardless\n * of the source value, and then merges those resulting Observables into one\n * single Observable, which is the output Observable.\n *\n * ## Example\n * For each click event, start an interval Observable ticking every 1 second\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(mergeMapTo(interval(1000)));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link concatMapTo}\n * @see {@link merge}\n * @see {@link mergeAll}\n * @see {@link mergeMap}\n * @see {@link mergeScan}\n * @see {@link switchMapTo}\n *\n * @param {ObservableInput} innerObservable An Observable to replace each value from\n * the source Observable.\n * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of input\n * Observables being subscribed to concurrently.\n * @return {Observable} An Observable that emits items from the given\n * `innerObservable`\n * @method mergeMapTo\n * @owner Observable\n */\nexport function mergeMapTo<T, I, R>(\n innerObservable: ObservableInput<I>,\n resultSelector?: ((outerValue: T, innerValue: I, outerIndex: number, innerIndex: number) => R) | number,\n concurrent: number = Number.POSITIVE_INFINITY\n): OperatorFunction<T, I|R> {\n if (typeof resultSelector === 'function') {\n return mergeMap(() => innerObservable, resultSelector, concurrent);\n }\n if (typeof resultSelector === 'number') {\n concurrent = resultSelector;\n }\n return mergeMap(() => innerObservable, concurrent);\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { tryCatch } from '../util/tryCatch';\nimport { errorObject } from '../util/errorObject';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { ObservableInput, OperatorFunction } from '../types';\n\n/**\n * Applies an accumulator function over the source Observable where the\n * accumulator function itself returns an Observable, then each intermediate\n * Observable returned is merged into the output Observable.\n *\n * <span class=\"informal\">It's like {@link scan}, but the Observables returned\n * by the accumulator are merged into the outer Observable.</span>\n *\n * ## Example\n * Count the number of click events\n * ```javascript\n * const click$ = fromEvent(document, 'click');\n * const one$ = click$.pipe(mapTo(1));\n * const seed = 0;\n * const count$ = one$.pipe(\n * mergeScan((acc, one) => of(acc + one), seed),\n * );\n * count$.subscribe(x => console.log(x));\n *\n * // Results:\n * 1\n * 2\n * 3\n * 4\n * // ...and so on for each click\n * ```\n *\n * @param {function(acc: R, value: T): Observable<R>} accumulator\n * The accumulator function called on each source value.\n * @param seed The initial accumulation value.\n * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of\n * input Observables being subscribed to concurrently.\n * @return {Observable<R>} An observable of the accumulated values.\n * @method mergeScan\n * @owner Observable\n */\nexport function mergeScan<T, R>(accumulator: (acc: R, value: T) => ObservableInput<R>,\n seed: R,\n concurrent: number = Number.POSITIVE_INFINITY): OperatorFunction<T, R> {\n return (source: Observable<T>) => source.lift(new MergeScanOperator(accumulator, seed, concurrent));\n}\n\nexport class MergeScanOperator<T, R> implements Operator<T, R> {\n constructor(private accumulator: (acc: R, value: T) => ObservableInput<R>,\n private seed: R,\n private concurrent: number) {\n }\n\n call(subscriber: Subscriber<R>, source: any): any {\n return source.subscribe(new MergeScanSubscriber(\n subscriber, this.accumulator, this.seed, this.concurrent\n ));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class MergeScanSubscriber<T, R> extends OuterSubscriber<T, R> {\n private hasValue: boolean = false;\n private hasCompleted: boolean = false;\n private buffer: Observable<any>[] = [];\n private active: number = 0;\n protected index: number = 0;\n\n constructor(destination: Subscriber<R>,\n private accumulator: (acc: R, value: T) => ObservableInput<R>,\n private acc: R,\n private concurrent: number) {\n super(destination);\n }\n\n protected _next(value: any): void {\n if (this.active < this.concurrent) {\n const index = this.index++;\n const ish = tryCatch(this.accumulator)(this.acc, value);\n const destination = this.destination;\n if (ish === errorObject) {\n destination.error(errorObject.e);\n } else {\n this.active++;\n this._innerSub(ish, value, index);\n }\n } else {\n this.buffer.push(value);\n }\n }\n\n private _innerSub(ish: any, value: T, index: number): void {\n const innerSubscriber = new InnerSubscriber(this, undefined, undefined);\n const destination = this.destination as Subscription;\n destination.add(innerSubscriber);\n subscribeToResult<T, R>(this, ish, value, index, innerSubscriber);\n }\n\n protected _complete(): void {\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\n notifyNext(outerValue: T, innerValue: R,\n outerIndex: number, innerIndex: number,\n innerSub: InnerSubscriber<T, R>): void {\n const { destination } = this;\n this.acc = innerValue;\n this.hasValue = true;\n destination.next(innerValue);\n }\n\n notifyComplete(innerSub: Subscription): void {\n const buffer = this.buffer;\n const destination = this.destination as Subscription;\n destination.remove(innerSub);\n this.active--;\n if (buffer.length > 0) {\n this._next(buffer.shift());\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}\n","import { reduce } from './reduce';\nimport { MonoTypeOperatorFunction } from '../types';\n\n/**\n * The Min operator operates on an Observable that emits numbers (or items that can be compared with a provided function),\n * and when source Observable completes it emits a single item: the item with the smallest value.\n *\n * ![](min.png)\n *\n * ## Examples\n * Get the minimal value of a series of numbers\n * ```javascript\n * of(5, 4, 7, 2, 8).pipe(\n * min(),\n * )\n * .subscribe(x => console.log(x)); // -> 2\n * ```\n *\n * Use a comparer function to get the minimal item\n * ```typescript\n * interface Person {\n * age: number,\n * name: string\n * }\n * of<Person>(\n * {age: 7, name: 'Foo'},\n * {age: 5, name: 'Bar'},\n * {age: 9, name: 'Beer'},\n * ).pipe(\n * min<Person>( (a: Person, b: Person) => a.age < b.age ? -1 : 1),\n * )\n * .subscribe((x: Person) => console.log(x.name)); // -> 'Bar'\n * ```\n * @see {@link max}\n *\n * @param {Function} [comparer] - Optional comparer function that it will use instead of its default to compare the\n * value of two items.\n * @return {Observable<R>} An Observable that emits item with the smallest value.\n * @method min\n * @owner Observable\n */\nexport function min<T>(comparer?: (x: T, y: T) => number): MonoTypeOperatorFunction<T> {\n const min: (x: T, y: T) => T = (typeof comparer === 'function')\n ? (x, y) => comparer(x, y) < 0 ? x : y\n : (x, y) => x < y ? x : y;\n return reduce(min);\n}\n","import { Subject } from '../Subject';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { ConnectableObservable, connectableObservableDescriptor } from '../observable/ConnectableObservable';\nimport { FactoryOrValue, MonoTypeOperatorFunction, OperatorFunction, UnaryFunction } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function multicast<T>(subjectOrSubjectFactory: FactoryOrValue<Subject<T>>): UnaryFunction<Observable<T>, ConnectableObservable<T>>;\nexport function multicast<T>(SubjectFactory: (this: Observable<T>) => Subject<T>): UnaryFunction<Observable<T>, ConnectableObservable<T>>;\nexport function multicast<T>(SubjectFactory: (this: Observable<T>) => Subject<T>, selector?: MonoTypeOperatorFunction<T>): MonoTypeOperatorFunction<T>;\nexport function multicast<T, R>(SubjectFactory: (this: Observable<T>) => Subject<T>): UnaryFunction<Observable<T>, ConnectableObservable<R>>;\nexport function multicast<T, R>(SubjectFactory: (this: Observable<T>) => Subject<T>, selector?: OperatorFunction<T, R>): OperatorFunction<T, R>;\n/* tslint:enable:max-line-length */\n\n/**\n * Returns an Observable that emits the results of invoking a specified selector on items\n * emitted by a ConnectableObservable that shares a single subscription to the underlying stream.\n *\n * ![](multicast.png)\n *\n * @param {Function|Subject} subjectOrSubjectFactory - Factory function to create an intermediate subject through\n * which the source sequence's elements will be multicast to the selector function\n * or Subject to push source elements into.\n * @param {Function} [selector] - Optional selector function that can use the multicasted source stream\n * as many times as needed, without causing multiple subscriptions to the source stream.\n * Subscribers to the given source will receive all notifications of the source from the\n * time of the subscription forward.\n * @return {Observable} An Observable that emits the results of invoking the selector\n * on the items emitted by a `ConnectableObservable` that shares a single subscription to\n * the underlying stream.\n * @method multicast\n * @owner Observable\n */\nexport function multicast<T, R>(subjectOrSubjectFactory: Subject<T> | (() => Subject<T>),\n selector?: (source: Observable<T>) => Observable<R>): OperatorFunction<T, R> {\n return function multicastOperatorFunction(source: Observable<T>): Observable<R> {\n let subjectFactory: () => Subject<T>;\n if (typeof subjectOrSubjectFactory === 'function') {\n subjectFactory = <() => Subject<T>>subjectOrSubjectFactory;\n } else {\n subjectFactory = function subjectFactory() {\n return <Subject<T>>subjectOrSubjectFactory;\n };\n }\n\n if (typeof selector === 'function') {\n return source.lift(new MulticastOperator(subjectFactory, selector));\n }\n\n const connectable: any = Object.create(source, connectableObservableDescriptor);\n connectable.source = source;\n connectable.subjectFactory = subjectFactory;\n\n return <ConnectableObservable<R>> connectable;\n };\n}\n\nexport class MulticastOperator<T, R> implements Operator<T, R> {\n constructor(private subjectFactory: () => Subject<T>,\n private selector: (source: Observable<T>) => Observable<R>) {\n }\n call(subscriber: Subscriber<R>, source: any): any {\n const { selector } = this;\n const subject = this.subjectFactory();\n const subscription = selector(subject).subscribe(subscriber);\n subscription.add(source.subscribe(subject));\n return subscription;\n }\n}\n","import { Observable } from '../Observable';\nimport { from } from '../observable/from';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { isArray } from '../util/isArray';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { ObservableInput, OperatorFunction } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function onErrorResumeNext<T, R>(v: ObservableInput<R>): OperatorFunction<T, R>;\nexport function onErrorResumeNext<T, T2, T3, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>): OperatorFunction<T, R>;\nexport function onErrorResumeNext<T, T2, T3, T4, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>): OperatorFunction<T, R>;\nexport function onErrorResumeNext<T, T2, T3, T4, T5, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>): OperatorFunction<T, R>;\nexport function onErrorResumeNext<T, T2, T3, T4, T5, T6, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>): OperatorFunction<T, R> ;\nexport function onErrorResumeNext<T, R>(...observables: Array<ObservableInput<any> | ((...values: Array<any>) => R)>): OperatorFunction<T, R>;\nexport function onErrorResumeNext<T, R>(array: ObservableInput<any>[]): OperatorFunction<T, R>;\n/* tslint:enable:max-line-length */\n\n/**\n * When any of the provided Observable emits an complete or error notification, it immediately subscribes to the next one\n * that was passed.\n *\n * <span class=\"informal\">Execute series of Observables no matter what, even if it means swallowing errors.</span>\n *\n * ![](onErrorResumeNext.png)\n *\n * `onErrorResumeNext` is an operator that accepts a series of Observables, provided either directly as\n * arguments or as an array. If no single Observable is provided, returned Observable will simply behave the same\n * as the source.\n *\n * `onErrorResumeNext` returns an Observable that starts by subscribing and re-emitting values from the source Observable.\n * When its stream of values ends - no matter if Observable completed or emitted an error - `onErrorResumeNext`\n * will subscribe to the first Observable that was passed as an argument to the method. It will start re-emitting\n * its values as well and - again - when that stream ends, `onErrorResumeNext` will proceed to subscribing yet another\n * Observable in provided series, no matter if previous Observable completed or ended with an error. This will\n * be happening until there is no more Observables left in the series, at which point returned Observable will\n * complete - even if the last subscribed stream ended with an error.\n *\n * `onErrorResumeNext` can be therefore thought of as version of {@link concat} operator, which is more permissive\n * when it comes to the errors emitted by its input Observables. While `concat` subscribes to the next Observable\n * in series only if previous one successfully completed, `onErrorResumeNext` subscribes even if it ended with\n * an error.\n *\n * Note that you do not get any access to errors emitted by the Observables. In particular do not\n * expect these errors to appear in error callback passed to {@link Observable#subscribe}. If you want to take\n * specific actions based on what error was emitted by an Observable, you should try out {@link catchError} instead.\n *\n *\n * ## Example\n * Subscribe to the next Observable after map fails\n * ```javascript\n * of(1, 2, 3, 0).pipe(\n * map(x => {\n * if (x === 0) { throw Error(); }\n return 10 / x;\n * }),\n * onErrorResumeNext(of(1, 2, 3)),\n * )\n * .subscribe(\n * val => console.log(val),\n * err => console.log(err), // Will never be called.\n * () => console.log('that\\'s it!')\n * );\n *\n * // Logs:\n * // 10\n * // 5\n * // 3.3333333333333335\n * // 1\n * // 2\n * // 3\n * // \"that's it!\"\n * ```\n *\n * @see {@link concat}\n * @see {@link catchError}\n *\n * @param {...ObservableInput} observables Observables passed either directly or as an array.\n * @return {Observable} An Observable that emits values from source Observable, but - if it errors - subscribes\n * to the next passed Observable and so on, until it completes or runs out of Observables.\n * @method onErrorResumeNext\n * @owner Observable\n */\n\nexport function onErrorResumeNext<T, R>(...nextSources: Array<ObservableInput<any> |\n Array<ObservableInput<any>> |\n ((...values: Array<any>) => R)>): OperatorFunction<T, R> {\n if (nextSources.length === 1 && isArray(nextSources[0])) {\n nextSources = <Array<Observable<any>>>nextSources[0];\n }\n\n return (source: Observable<T>) => source.lift(new OnErrorResumeNextOperator<T, R>(nextSources));\n}\n\n/* tslint:disable:max-line-length */\nexport function onErrorResumeNextStatic<R>(v: ObservableInput<R>): Observable<R>;\nexport function onErrorResumeNextStatic<T2, T3, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>): Observable<R>;\nexport function onErrorResumeNextStatic<T2, T3, T4, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>): Observable<R>;\nexport function onErrorResumeNextStatic<T2, T3, T4, T5, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>): Observable<R>;\nexport function onErrorResumeNextStatic<T2, T3, T4, T5, T6, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>): Observable<R>;\n\nexport function onErrorResumeNextStatic<R>(...observables: Array<ObservableInput<any> | ((...values: Array<any>) => R)>): Observable<R>;\nexport function onErrorResumeNextStatic<R>(array: ObservableInput<any>[]): Observable<R>;\n/* tslint:enable:max-line-length */\n\nexport function onErrorResumeNextStatic<T, R>(...nextSources: Array<ObservableInput<any> |\n Array<ObservableInput<any>> |\n ((...values: Array<any>) => R)>): Observable<R> {\n let source: ObservableInput<any> = null;\n\n if (nextSources.length === 1 && isArray(nextSources[0])) {\n nextSources = <Array<ObservableInput<any>>>nextSources[0];\n }\n source = nextSources.shift();\n\n return from(source, null).lift(new OnErrorResumeNextOperator<T, R>(nextSources));\n}\n\nclass OnErrorResumeNextOperator<T, R> implements Operator<T, R> {\n constructor(private nextSources: Array<ObservableInput<any>>) {\n }\n\n call(subscriber: Subscriber<R>, source: any): any {\n return source.subscribe(new OnErrorResumeNextSubscriber(subscriber, this.nextSources));\n }\n}\n\nclass OnErrorResumeNextSubscriber<T, R> extends OuterSubscriber<T, R> {\n constructor(protected destination: Subscriber<T>,\n private nextSources: Array<ObservableInput<any>>) {\n super(destination);\n }\n\n notifyError(error: any, innerSub: InnerSubscriber<T, any>): void {\n this.subscribeToNextSource();\n }\n\n notifyComplete(innerSub: InnerSubscriber<T, any>): void {\n this.subscribeToNextSource();\n }\n\n protected _error(err: any): void {\n this.subscribeToNextSource();\n this.unsubscribe();\n }\n\n protected _complete(): void {\n this.subscribeToNextSource();\n this.unsubscribe();\n }\n\n private subscribeToNextSource(): void {\n const next = this.nextSources.shift();\n if (next) {\n const innerSubscriber = new InnerSubscriber(this, undefined, undefined);\n const destination = this.destination as Subscription;\n destination.add(innerSubscriber);\n subscribeToResult(this, next, undefined, undefined, innerSubscriber);\n } else {\n this.destination.complete();\n }\n }\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { OperatorFunction } from '../types';\n\n/**\n * Groups pairs of consecutive emissions together and emits them as an array of\n * two values.\n *\n * <span class=\"informal\">Puts the current value and previous value together as\n * an array, and emits that.</span>\n *\n * ![](pairwise.png)\n *\n * The Nth emission from the source Observable will cause the output Observable\n * to emit an array [(N-1)th, Nth] of the previous and the current value, as a\n * pair. For this reason, `pairwise` emits on the second and subsequent\n * emissions from the source Observable, but not on the first emission, because\n * there is no previous value in that case.\n *\n * ## Example\n * On every click (starting from the second), emit the relative distance to the previous click\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const pairs = clicks.pipe(pairwise());\n * const distance = pairs.pipe(\n * map(pair => {\n * const x0 = pair[0].clientX;\n * const y0 = pair[0].clientY;\n * const x1 = pair[1].clientX;\n * const y1 = pair[1].clientY;\n * return Math.sqrt(Math.pow(x0 - x1, 2) + Math.pow(y0 - y1, 2));\n * }),\n * );\n * distance.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link buffer}\n * @see {@link bufferCount}\n *\n * @return {Observable<Array<T>>} An Observable of pairs (as arrays) of\n * consecutive values from the source Observable.\n * @method pairwise\n * @owner Observable\n */\nexport function pairwise<T>(): OperatorFunction<T, [T, T]> {\n return (source: Observable<T>) => source.lift(new PairwiseOperator());\n}\n\nclass PairwiseOperator<T> implements Operator<T, [T, T]> {\n call(subscriber: Subscriber<[T, T]>, source: any): any {\n return source.subscribe(new PairwiseSubscriber(subscriber));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass PairwiseSubscriber<T> extends Subscriber<T> {\n private prev: T;\n private hasPrev: boolean = false;\n\n constructor(destination: Subscriber<[T, T]>) {\n super(destination);\n }\n\n _next(value: T): void {\n if (this.hasPrev) {\n this.destination.next([this.prev, value]);\n } else {\n this.hasPrev = true;\n }\n\n this.prev = value;\n }\n}\n","export function not(pred: Function, thisArg: any): Function {\n function notPred(): any {\n return !((<any> notPred).pred.apply((<any> notPred).thisArg, arguments));\n }\n (<any> notPred).pred = pred;\n (<any> notPred).thisArg = thisArg;\n return notPred;\n}","import { not } from '../util/not';\nimport { filter } from './filter';\nimport { Observable } from '../Observable';\nimport { UnaryFunction } from '../types';\n\n/**\n * Splits the source Observable into two, one with values that satisfy a\n * predicate, and another with values that don't satisfy the predicate.\n *\n * <span class=\"informal\">It's like {@link filter}, but returns two Observables:\n * one like the output of {@link filter}, and the other with values that did not\n * pass the condition.</span>\n *\n * ![](partition.png)\n *\n * `partition` outputs an array with two Observables that partition the values\n * from the source Observable through the given `predicate` function. The first\n * Observable in that array emits source values for which the predicate argument\n * returns true. The second Observable emits source values for which the\n * predicate returns false. The first behaves like {@link filter} and the second\n * behaves like {@link filter} with the predicate negated.\n *\n * ## Example\n * Partition click events into those on DIV elements and those elsewhere\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const parts = clicks.pipe(partition(ev => ev.target.tagName === 'DIV'));\n * const clicksOnDivs = parts[0];\n * const clicksElsewhere = parts[1];\n * clicksOnDivs.subscribe(x => console.log('DIV clicked: ', x));\n * clicksElsewhere.subscribe(x => console.log('Other clicked: ', x));\n * ```\n *\n * @see {@link filter}\n *\n * @param {function(value: T, index: number): boolean} predicate A function that\n * evaluates each value emitted by the source Observable. If it returns `true`,\n * the value is emitted on the first Observable in the returned array, if\n * `false` the value is emitted on the second Observable in the array. The\n * `index` parameter is the number `i` for the i-th source emission that has\n * happened since the subscription, starting from the number `0`.\n * @param {any} [thisArg] An optional argument to determine the value of `this`\n * in the `predicate` function.\n * @return {[Observable<T>, Observable<T>]} An array with two Observables: one\n * with values that passed the predicate, and another with values that did not\n * pass the predicate.\n * @method partition\n * @owner Observable\n */\nexport function partition<T>(predicate: (value: T, index: number) => boolean,\n thisArg?: any): UnaryFunction<Observable<T>, [Observable<T>, Observable<T>]> {\n return (source: Observable<T>) => [\n filter(predicate, thisArg)(source),\n filter(not(predicate, thisArg) as any)(source)\n ] as [Observable<T>, Observable<T>];\n}\n","import { Observable } from '../Observable';\nimport { map } from './map';\nimport { OperatorFunction } from '../types';\n\n/**\n * Maps each source value (an object) to its specified nested property.\n *\n * <span class=\"informal\">Like {@link map}, but meant only for picking one of\n * the nested properties of every emitted object.</span>\n *\n * ![](pluck.png)\n *\n * Given a list of strings describing a path to an object property, retrieves\n * the value of a specified nested property from all values in the source\n * Observable. If a property can't be resolved, it will return `undefined` for\n * that value.\n *\n * ## Example\n * Map every click to the tagName of the clicked target element\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const tagNames = clicks.pipe(pluck('target', 'tagName'));\n * tagNames.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link map}\n *\n * @param {...string} properties The nested properties to pluck from each source\n * value (an object).\n * @return {Observable} A new Observable of property values from the source values.\n * @method pluck\n * @owner Observable\n */\nexport function pluck<T, R>(...properties: string[]): OperatorFunction<T, R> {\n const length = properties.length;\n if (length === 0) {\n throw new Error('list of properties cannot be empty.');\n }\n return (source: Observable<T>) => map(plucker(properties, length))(source as any);\n}\n\nfunction plucker(props: string[], length: number): (x: string) => any {\n const mapper = (x: string) => {\n let currentProp = x;\n for (let i = 0; i < length; i++) {\n const p = currentProp[props[i]];\n if (typeof p !== 'undefined') {\n currentProp = p;\n } else {\n return undefined;\n }\n }\n return currentProp;\n };\n\n return mapper;\n}\n","import { Observable } from '../Observable';\nimport { Subject } from '../Subject';\nimport { multicast } from './multicast';\nimport { ConnectableObservable } from '../observable/ConnectableObservable';\nimport { MonoTypeOperatorFunction, OperatorFunction, UnaryFunction } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function publish<T>(): UnaryFunction<Observable<T>, ConnectableObservable<T>>;\nexport function publish<T, R>(selector: OperatorFunction<T, R>): OperatorFunction<T, R>;\nexport function publish<T>(selector: MonoTypeOperatorFunction<T>): MonoTypeOperatorFunction<T>;\n/* tslint:enable:max-line-length */\n\n/**\n * Returns a ConnectableObservable, which is a variety of Observable that waits until its connect method is called\n * before it begins emitting items to those Observers that have subscribed to it.\n *\n * ![](publish.png)\n *\n * @param {Function} [selector] - Optional selector function which can use the multicasted source sequence as many times\n * as needed, without causing multiple subscriptions to the source sequence.\n * Subscribers to the given source will receive all notifications of the source from the time of the subscription on.\n * @return A ConnectableObservable that upon connection causes the source Observable to emit items to its Observers.\n * @method publish\n * @owner Observable\n */\nexport function publish<T, R>(selector?: OperatorFunction<T, R>): MonoTypeOperatorFunction<T> | OperatorFunction<T, R> {\n return selector ?\n multicast(() => new Subject<T>(), selector) :\n multicast(new Subject<T>());\n}\n","import { Observable } from '../Observable';\nimport { BehaviorSubject } from '../BehaviorSubject';\nimport { multicast } from './multicast';\nimport { ConnectableObservable } from '../observable/ConnectableObservable';\nimport { UnaryFunction } from '../types';\n\n/**\n * @param value\n * @return {ConnectableObservable<T>}\n * @method publishBehavior\n * @owner Observable\n */\nexport function publishBehavior<T>(value: T): UnaryFunction<Observable<T>, ConnectableObservable<T>> {\n return (source: Observable<T>) => multicast(new BehaviorSubject<T>(value))(source) as ConnectableObservable<T>;\n}\n","import { Observable } from '../Observable';\nimport { AsyncSubject } from '../AsyncSubject';\nimport { multicast } from './multicast';\nimport { ConnectableObservable } from '../observable/ConnectableObservable';\nimport { UnaryFunction } from '../types';\n\n/**\n * Returns a connectable observable sequence that shares a single subscription to the\n * underlying sequence containing only the last notification.\n *\n * ![](publishLast.png)\n *\n * Similar to {@link publish}, but it waits until the source observable completes and stores\n * the last emitted value.\n * Similarly to {@link publishReplay} and {@link publishBehavior}, this keeps storing the last\n * value even if it has no more subscribers. If subsequent subscriptions happen, they will\n * immediately get that last stored value and complete.\n *\n * ## Example\n *\n * ```js\n * const connectable =\n * interval(1000)\n * .pipe(\n * tap(x => console.log(\"side effect\", x)),\n * take(3),\n * publishLast());\n *\n * connectable.subscribe(\n * x => console.log( \"Sub. A\", x),\n * err => console.log(\"Sub. A Error\", err),\n * () => console.log( \"Sub. A Complete\"));\n *\n * connectable.subscribe(\n * x => console.log( \"Sub. B\", x),\n * err => console.log(\"Sub. B Error\", err),\n * () => console.log( \"Sub. B Complete\"));\n *\n * connectable.connect();\n *\n * // Results:\n * // \"side effect 0\"\n * // \"side effect 1\"\n * // \"side effect 2\"\n * // \"Sub. A 2\"\n * // \"Sub. B 2\"\n * // \"Sub. A Complete\"\n * // \"Sub. B Complete\"\n * ```\n *\n * @see {@link ConnectableObservable}\n * @see {@link publish}\n * @see {@link publishReplay}\n * @see {@link publishBehavior}\n *\n * @return {ConnectableObservable} An observable sequence that contains the elements of a\n * sequence produced by multicasting the source sequence.\n * @method publishLast\n * @owner Observable\n */\n\nexport function publishLast<T>(): UnaryFunction<Observable<T>, ConnectableObservable<T>> {\n return (source: Observable<T>) => multicast(new AsyncSubject<T>())(source);\n}\n","import { Observable } from '../Observable';\nimport { ReplaySubject } from '../ReplaySubject';\nimport { multicast } from './multicast';\nimport { ConnectableObservable } from '../observable/ConnectableObservable';\nimport { UnaryFunction, MonoTypeOperatorFunction, OperatorFunction, SchedulerLike } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function publishReplay<T>(bufferSize?: number, windowTime?: number, scheduler?: SchedulerLike): MonoTypeOperatorFunction<T>;\nexport function publishReplay<T, R>(bufferSize?: number, windowTime?: number, selector?: OperatorFunction<T, R>, scheduler?: SchedulerLike): OperatorFunction<T, R>;\nexport function publishReplay<T>(bufferSize?: number, windowTime?: number, selector?: MonoTypeOperatorFunction<T>, scheduler?: SchedulerLike): MonoTypeOperatorFunction<T>;\n/* tslint:enable:max-line-length */\n\nexport function publishReplay<T, R>(bufferSize?: number,\n windowTime?: number,\n selectorOrScheduler?: SchedulerLike | OperatorFunction<T, R>,\n scheduler?: SchedulerLike): UnaryFunction<Observable<T>, ConnectableObservable<R>> {\n\n if (selectorOrScheduler && typeof selectorOrScheduler !== 'function') {\n scheduler = selectorOrScheduler;\n }\n\n const selector = typeof selectorOrScheduler === 'function' ? selectorOrScheduler : undefined;\n const subject = new ReplaySubject<T>(bufferSize, windowTime, scheduler);\n\n return (source: Observable<T>) => multicast(() => subject, selector)(source) as ConnectableObservable<R>;\n}\n","import { Observable } from '../Observable';\nimport { isArray } from '../util/isArray';\nimport { MonoTypeOperatorFunction, OperatorFunction } from '../types';\nimport { race as raceStatic } from '../observable/race';\n\n/* tslint:disable:max-line-length */\n/** @deprecated Deprecated in favor of static race. */\nexport function race<T>(observables: Array<Observable<T>>): MonoTypeOperatorFunction<T>;\n/** @deprecated Deprecated in favor of static race. */\nexport function race<T, R>(observables: Array<Observable<T>>): OperatorFunction<T, R>;\n/** @deprecated Deprecated in favor of static race. */\nexport function race<T>(...observables: Array<Observable<T> | Array<Observable<T>>>): MonoTypeOperatorFunction<T>;\n/** @deprecated Deprecated in favor of static race. */\nexport function race<T, R>(...observables: Array<Observable<any> | Array<Observable<any>>>): OperatorFunction<T, R>;\n/* tslint:enable:max-line-length */\n\n/**\n * Returns an Observable that mirrors the first source Observable to emit an item\n * from the combination of this Observable and supplied Observables.\n * @param {...Observables} ...observables Sources used to race for which Observable emits first.\n * @return {Observable} An Observable that mirrors the output of the first Observable to emit an item.\n * @method race\n * @owner Observable\n * @deprecated Deprecated in favor of static {@link race}.\n */\nexport function race<T>(...observables: Array<Observable<T> | Array<Observable<T>>>): MonoTypeOperatorFunction<T> {\n return function raceOperatorFunction(source: Observable<T>) {\n // if the only argument is an array, it was most likely called with\n // `pair([obs1, obs2, ...])`\n if (observables.length === 1 && isArray(observables[0])) {\n observables = <Array<Observable<T>>>observables[0];\n }\n\n return source.lift.call(raceStatic<T>(source, ...observables));\n };\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { empty } from '../observable/empty';\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/**\n * Returns an Observable that repeats the stream of items emitted by the source Observable at most count times.\n *\n * ![](repeat.png)\n *\n * @param {number} [count] The number of times the source Observable items are repeated, a count of 0 will yield\n * an empty Observable.\n * @return {Observable} An Observable that repeats the stream of items emitted by the source Observable at most\n * count times.\n * @method repeat\n * @owner Observable\n */\nexport function repeat<T>(count: number = -1): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => {\n if (count === 0) {\n return empty();\n } else if (count < 0) {\n return source.lift(new RepeatOperator(-1, source));\n } else {\n return source.lift(new RepeatOperator(count - 1, source));\n }\n };\n}\n\nclass RepeatOperator<T> implements Operator<T, T> {\n constructor(private count: number,\n private source: Observable<T>) {\n }\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new RepeatSubscriber(subscriber, this.count, this.source));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass RepeatSubscriber<T> extends Subscriber<T> {\n constructor(destination: Subscriber<any>,\n private count: number,\n private source: Observable<T>) {\n super(destination);\n }\n complete() {\n if (!this.isStopped) {\n const { source, count } = this;\n if (count === 0) {\n return super.complete();\n } else if (count > -1) {\n this.count = count - 1;\n }\n source.subscribe(this._unsubscribeAndRecycle());\n }\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { Subject } from '../Subject';\nimport { Subscription } from '../Subscription';\nimport { tryCatch } from '../util/tryCatch';\nimport { errorObject } from '../util/errorObject';\n\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\n\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/**\n * Returns an Observable that mirrors the source Observable with the exception of a `complete`. If the source\n * Observable calls `complete`, this method will emit to the Observable returned from `notifier`. If that Observable\n * calls `complete` or `error`, then this method will call `complete` or `error` on the child subscription. Otherwise\n * this method will resubscribe to the source Observable.\n *\n * ![](repeatWhen.png)\n *\n * @param {function(notifications: Observable): Observable} notifier - Receives an Observable of notifications with\n * which a user can `complete` or `error`, aborting the repetition.\n * @return {Observable} The source Observable modified with repeat logic.\n * @method repeatWhen\n * @owner Observable\n */\nexport function repeatWhen<T>(notifier: (notifications: Observable<any>) => Observable<any>): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => source.lift(new RepeatWhenOperator(notifier));\n}\n\nclass RepeatWhenOperator<T> implements Operator<T, T> {\n constructor(protected notifier: (notifications: Observable<any>) => Observable<any>) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new RepeatWhenSubscriber(subscriber, this.notifier, source));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass RepeatWhenSubscriber<T, R> extends OuterSubscriber<T, R> {\n\n private notifications: Subject<any>;\n private retries: Observable<any>;\n private retriesSubscription: Subscription;\n private sourceIsBeingSubscribedTo: boolean = true;\n\n constructor(destination: Subscriber<R>,\n private notifier: (notifications: Observable<any>) => Observable<any>,\n private source: Observable<T>) {\n super(destination);\n }\n\n notifyNext(outerValue: T, innerValue: R,\n outerIndex: number, innerIndex: number,\n innerSub: InnerSubscriber<T, R>): void {\n this.sourceIsBeingSubscribedTo = true;\n this.source.subscribe(this);\n }\n\n notifyComplete(innerSub: InnerSubscriber<T, R>): void {\n if (this.sourceIsBeingSubscribedTo === false) {\n return super.complete();\n }\n }\n\n complete() {\n this.sourceIsBeingSubscribedTo = false;\n\n if (!this.isStopped) {\n if (!this.retries) {\n this.subscribeToRetries();\n }\n if (!this.retriesSubscription || this.retriesSubscription.closed) {\n return super.complete();\n }\n\n this._unsubscribeAndRecycle();\n this.notifications.next();\n }\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _unsubscribe() {\n const { notifications, retriesSubscription } = this;\n if (notifications) {\n notifications.unsubscribe();\n this.notifications = null;\n }\n if (retriesSubscription) {\n retriesSubscription.unsubscribe();\n this.retriesSubscription = null;\n }\n this.retries = null;\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _unsubscribeAndRecycle(): Subscriber<T> {\n const { _unsubscribe } = this;\n\n this._unsubscribe = null;\n super._unsubscribeAndRecycle();\n this._unsubscribe = _unsubscribe;\n\n return this;\n }\n\n private subscribeToRetries() {\n this.notifications = new Subject();\n const retries = tryCatch(this.notifier)(this.notifications);\n if (retries === errorObject) {\n return super.complete();\n }\n this.retries = retries;\n this.retriesSubscription = subscribeToResult(this, retries);\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\n\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/**\n * Returns an Observable that mirrors the source Observable with the exception of an `error`. If the source Observable\n * calls `error`, this method will resubscribe to the source Observable for a maximum of `count` resubscriptions (given\n * as a number parameter) rather than propagating the `error` call.\n *\n * ![](retry.png)\n *\n * Any and all items emitted by the source Observable will be emitted by the resulting Observable, even those emitted\n * during failed subscriptions. For example, if an Observable fails at first but emits [1, 2] then succeeds the second\n * time and emits: [1, 2, 3, 4, 5] then the complete stream of emissions and notifications\n * would be: [1, 2, 1, 2, 3, 4, 5, `complete`].\n * @param {number} count - Number of retry attempts before failing.\n * @return {Observable} The source Observable modified with the retry logic.\n * @method retry\n * @owner Observable\n */\nexport function retry<T>(count: number = -1): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => source.lift(new RetryOperator(count, source));\n}\n\nclass RetryOperator<T> implements Operator<T, T> {\n constructor(private count: number,\n private source: Observable<T>) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new RetrySubscriber(subscriber, this.count, this.source));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass RetrySubscriber<T> extends Subscriber<T> {\n constructor(destination: Subscriber<any>,\n private count: number,\n private source: Observable<T>) {\n super(destination);\n }\n error(err: any) {\n if (!this.isStopped) {\n const { source, count } = this;\n if (count === 0) {\n return super.error(err);\n } else if (count > -1) {\n this.count = count - 1;\n }\n source.subscribe(this._unsubscribeAndRecycle());\n }\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { Subject } from '../Subject';\nimport { Subscription } from '../Subscription';\nimport { tryCatch } from '../util/tryCatch';\nimport { errorObject } from '../util/errorObject';\n\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\n\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/**\n * Returns an Observable that mirrors the source Observable with the exception of an `error`. If the source Observable\n * calls `error`, this method will emit the Throwable that caused the error to the Observable returned from `notifier`.\n * If that Observable calls `complete` or `error` then this method will call `complete` or `error` on the child\n * subscription. Otherwise this method will resubscribe to the source Observable.\n *\n * ![](retryWhen.png)\n *\n * @param {function(errors: Observable): Observable} notifier - Receives an Observable of notifications with which a\n * user can `complete` or `error`, aborting the retry.\n * @return {Observable} The source Observable modified with retry logic.\n * @method retryWhen\n * @owner Observable\n */\nexport function retryWhen<T>(notifier: (errors: Observable<any>) => Observable<any>): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => source.lift(new RetryWhenOperator(notifier, source));\n}\n\nclass RetryWhenOperator<T> implements Operator<T, T> {\n constructor(protected notifier: (errors: Observable<any>) => Observable<any>,\n protected source: Observable<T>) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new RetryWhenSubscriber(subscriber, this.notifier, this.source));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass RetryWhenSubscriber<T, R> extends OuterSubscriber<T, R> {\n\n private errors: Subject<any>;\n private retries: Observable<any>;\n private retriesSubscription: Subscription;\n\n constructor(destination: Subscriber<R>,\n private notifier: (errors: Observable<any>) => Observable<any>,\n private source: Observable<T>) {\n super(destination);\n }\n\n error(err: any) {\n if (!this.isStopped) {\n\n let errors = this.errors;\n let retries: any = this.retries;\n let retriesSubscription = this.retriesSubscription;\n\n if (!retries) {\n errors = new Subject();\n retries = tryCatch(this.notifier)(errors);\n if (retries === errorObject) {\n return super.error(errorObject.e);\n }\n retriesSubscription = subscribeToResult(this, retries);\n } else {\n this.errors = null;\n this.retriesSubscription = null;\n }\n\n this._unsubscribeAndRecycle();\n\n this.errors = errors;\n this.retries = retries;\n this.retriesSubscription = retriesSubscription;\n\n errors.next(err);\n }\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _unsubscribe() {\n const { errors, retriesSubscription } = this;\n if (errors) {\n errors.unsubscribe();\n this.errors = null;\n }\n if (retriesSubscription) {\n retriesSubscription.unsubscribe();\n this.retriesSubscription = null;\n }\n this.retries = null;\n }\n\n notifyNext(outerValue: T, innerValue: R,\n outerIndex: number, innerIndex: number,\n innerSub: InnerSubscriber<T, R>): void {\n const { _unsubscribe } = this;\n\n this._unsubscribe = null;\n this._unsubscribeAndRecycle();\n this._unsubscribe = _unsubscribe;\n\n this.source.subscribe(this);\n }\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\n\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/**\n * Emits the most recently emitted value from the source Observable whenever\n * another Observable, the `notifier`, emits.\n *\n * <span class=\"informal\">It's like {@link sampleTime}, but samples whenever\n * the `notifier` Observable emits something.</span>\n *\n * ![](sample.png)\n *\n * Whenever the `notifier` Observable emits a value or completes, `sample`\n * looks at the source Observable and emits whichever value it has most recently\n * emitted since the previous sampling, unless the source has not emitted\n * anything since the previous sampling. The `notifier` is subscribed to as soon\n * as the output Observable is subscribed.\n *\n * ## Example\n * On every click, sample the most recent \"seconds\" timer\n * ```javascript\n * const seconds = interval(1000);\n * const clicks = fromEvent(document, 'click');\n * const result = seconds.pipe(sample(clicks));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link audit}\n * @see {@link debounce}\n * @see {@link sampleTime}\n * @see {@link throttle}\n *\n * @param {Observable<any>} notifier The Observable to use for sampling the\n * source Observable.\n * @return {Observable<T>} An Observable that emits the results of sampling the\n * values emitted by the source Observable whenever the notifier Observable\n * emits value or completes.\n * @method sample\n * @owner Observable\n */\nexport function sample<T>(notifier: Observable<any>): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => source.lift(new SampleOperator(notifier));\n}\n\nclass SampleOperator<T> implements Operator<T, T> {\n constructor(private notifier: Observable<any>) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n const sampleSubscriber = new SampleSubscriber(subscriber);\n const subscription = source.subscribe(sampleSubscriber);\n subscription.add(subscribeToResult(sampleSubscriber, this.notifier));\n return subscription;\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass SampleSubscriber<T, R> extends OuterSubscriber<T, R> {\n private value: T;\n private hasValue: boolean = false;\n\n protected _next(value: T) {\n this.value = value;\n this.hasValue = true;\n }\n\n notifyNext(outerValue: T, innerValue: R,\n outerIndex: number, innerIndex: number,\n innerSub: InnerSubscriber<T, R>): void {\n this.emitValue();\n }\n\n notifyComplete(): void {\n this.emitValue();\n }\n\n emitValue() {\n if (this.hasValue) {\n this.hasValue = false;\n this.destination.next(this.value);\n }\n }\n}\n","import { Observable } from '../Observable';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { async } from '../scheduler/async';\nimport { MonoTypeOperatorFunction, SchedulerAction, SchedulerLike, TeardownLogic } from '../types';\n\n/**\n * Emits the most recently emitted value from the source Observable within\n * periodic time intervals.\n *\n * <span class=\"informal\">Samples the source Observable at periodic time\n * intervals, emitting what it samples.</span>\n *\n * ![](sampleTime.png)\n *\n * `sampleTime` periodically looks at the source Observable and emits whichever\n * value it has most recently emitted since the previous sampling, unless the\n * source has not emitted anything since the previous sampling. The sampling\n * happens periodically in time every `period` milliseconds (or the time unit\n * defined by the optional `scheduler` argument). The sampling starts as soon as\n * the output Observable is subscribed.\n *\n * ## Example\n * Every second, emit the most recent click at most once\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(sampleTime(1000));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link auditTime}\n * @see {@link debounceTime}\n * @see {@link delay}\n * @see {@link sample}\n * @see {@link throttleTime}\n *\n * @param {number} period The sampling period expressed in milliseconds or the\n * time unit determined internally by the optional `scheduler`.\n * @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for\n * managing the timers that handle the sampling.\n * @return {Observable<T>} An Observable that emits the results of sampling the\n * values emitted by the source Observable at the specified time interval.\n * @method sampleTime\n * @owner Observable\n */\nexport function sampleTime<T>(period: number, scheduler: SchedulerLike = async): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => source.lift(new SampleTimeOperator(period, scheduler));\n}\n\nclass SampleTimeOperator<T> implements Operator<T, T> {\n constructor(private period: number,\n private scheduler: SchedulerLike) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new SampleTimeSubscriber(subscriber, this.period, this.scheduler));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass SampleTimeSubscriber<T> extends Subscriber<T> {\n lastValue: T;\n hasValue: boolean = false;\n\n constructor(destination: Subscriber<T>,\n private period: number,\n private scheduler: SchedulerLike) {\n super(destination);\n this.add(scheduler.schedule(dispatchNotification, period, { subscriber: this, period }));\n }\n\n protected _next(value: T) {\n this.lastValue = value;\n this.hasValue = true;\n }\n\n notifyNext() {\n if (this.hasValue) {\n this.hasValue = false;\n this.destination.next(this.lastValue);\n }\n }\n}\n\nfunction dispatchNotification<T>(this: SchedulerAction<any>, state: any) {\n let { subscriber, period } = state;\n subscriber.notifyNext();\n this.schedule(state, period);\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { tryCatch } from '../util/tryCatch';\nimport { errorObject } from '../util/errorObject';\n\nimport { Observer, OperatorFunction } from '../types';\n\n/**\n * Compares all values of two observables in sequence using an optional comparor function\n * and returns an observable of a single boolean value representing whether or not the two sequences\n * are equal.\n *\n * <span class=\"informal\">Checks to see of all values emitted by both observables are equal, in order.</span>\n *\n * ![](sequenceEqual.png)\n *\n * `sequenceEqual` subscribes to two observables and buffers incoming values from each observable. Whenever either\n * observable emits a value, the value is buffered and the buffers are shifted and compared from the bottom\n * up; If any value pair doesn't match, the returned observable will emit `false` and complete. If one of the\n * observables completes, the operator will wait for the other observable to complete; If the other\n * observable emits before completing, the returned observable will emit `false` and complete. If one observable never\n * completes or emits after the other complets, the returned observable will never complete.\n *\n * ## Example\n * figure out if the Konami code matches\n * ```javascript\n * const codes = from([\n * 'ArrowUp',\n * 'ArrowUp',\n * 'ArrowDown',\n * 'ArrowDown',\n * 'ArrowLeft',\n * 'ArrowRight',\n * 'ArrowLeft',\n * 'ArrowRight',\n * 'KeyB',\n * 'KeyA',\n * 'Enter', // no start key, clearly.\n * ]);\n *\n * const keys = fromEvent(document, 'keyup').pipe(map(e => e.code));\n * const matches = keys.pipe(\n * bufferCount(11, 1),\n * mergeMap(\n * last11 => from(last11).pipe(sequenceEqual(codes)),\n * ),\n * );\n * matches.subscribe(matched => console.log('Successful cheat at Contra? ', matched));\n * ```\n *\n * @see {@link combineLatest}\n * @see {@link zip}\n * @see {@link withLatestFrom}\n *\n * @param {Observable} compareTo The observable sequence to compare the source sequence to.\n * @param {function} [comparor] An optional function to compare each value pair\n * @return {Observable} An Observable of a single boolean value representing whether or not\n * the values emitted by both observables were equal in sequence.\n * @method sequenceEqual\n * @owner Observable\n */\nexport function sequenceEqual<T>(compareTo: Observable<T>,\n comparor?: (a: T, b: T) => boolean): OperatorFunction<T, boolean> {\n return (source: Observable<T>) => source.lift(new SequenceEqualOperator(compareTo, comparor));\n}\n\nexport class SequenceEqualOperator<T> implements Operator<T, boolean> {\n constructor(private compareTo: Observable<T>,\n private comparor: (a: T, b: T) => boolean) {\n }\n\n call(subscriber: Subscriber<boolean>, source: any): any {\n return source.subscribe(new SequenceEqualSubscriber(subscriber, this.compareTo, this.comparor));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class SequenceEqualSubscriber<T, R> extends Subscriber<T> {\n private _a: T[] = [];\n private _b: T[] = [];\n private _oneComplete = false;\n\n constructor(destination: Observer<R>,\n private compareTo: Observable<T>,\n private comparor: (a: T, b: T) => boolean) {\n super(destination);\n (this.destination as Subscription).add(compareTo.subscribe(new SequenceEqualCompareToSubscriber(destination, this)));\n }\n\n protected _next(value: T): void {\n if (this._oneComplete && this._b.length === 0) {\n this.emit(false);\n } else {\n this._a.push(value);\n this.checkValues();\n }\n }\n\n public _complete(): void {\n if (this._oneComplete) {\n this.emit(this._a.length === 0 && this._b.length === 0);\n } else {\n this._oneComplete = true;\n }\n this.unsubscribe();\n }\n\n checkValues() {\n const { _a, _b, comparor } = this;\n while (_a.length > 0 && _b.length > 0) {\n let a = _a.shift();\n let b = _b.shift();\n let areEqual = false;\n if (comparor) {\n areEqual = tryCatch(comparor)(a, b);\n if (areEqual === errorObject) {\n this.destination.error(errorObject.e);\n }\n } else {\n areEqual = a === b;\n }\n if (!areEqual) {\n this.emit(false);\n }\n }\n }\n\n emit(value: boolean) {\n const { destination } = this;\n destination.next(value);\n destination.complete();\n }\n\n nextB(value: T) {\n if (this._oneComplete && this._a.length === 0) {\n this.emit(false);\n } else {\n this._b.push(value);\n this.checkValues();\n }\n }\n\n completeB() {\n if (this._oneComplete) {\n this.emit(this._a.length === 0 && this._b.length === 0);\n } else {\n this._oneComplete = true;\n }\n }\n}\n\nclass SequenceEqualCompareToSubscriber<T, R> extends Subscriber<T> {\n constructor(destination: Observer<R>, private parent: SequenceEqualSubscriber<T, R>) {\n super(destination);\n }\n\n protected _next(value: T): void {\n this.parent.nextB(value);\n }\n\n protected _error(err: any): void {\n this.parent.error(err);\n this.unsubscribe();\n }\n\n protected _complete(): void {\n this.parent.completeB();\n this.unsubscribe();\n }\n}\n","import { Observable } from '../Observable';\nimport { multicast } from './multicast';\nimport { refCount } from './refCount';\nimport { Subject } from '../Subject';\n\nimport { MonoTypeOperatorFunction } from '../types';\n\nfunction shareSubjectFactory() {\n return new Subject();\n}\n\n/**\n * Returns a new Observable that multicasts (shares) the original Observable. As long as there is at least one\n * Subscriber this Observable will be subscribed and emitting data. When all subscribers have unsubscribed it will\n * unsubscribe from the source Observable. Because the Observable is multicasting it makes the stream `hot`.\n * This is an alias for `multicast(() => new Subject()), refCount()`.\n *\n * ![](share.png)\n *\n * @return {Observable<T>} An Observable that upon connection causes the source Observable to emit items to its Observers.\n * @method share\n * @owner Observable\n */\nexport function share<T>(): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => refCount()(multicast(shareSubjectFactory)(source)) as Observable<T>;\n}\n","import { Observable } from '../Observable';\nimport { ReplaySubject } from '../ReplaySubject';\nimport { Subscription } from '../Subscription';\nimport { MonoTypeOperatorFunction, SchedulerLike } from '../types';\nimport { Subscriber } from '../Subscriber';\n\n/**\n * Share source and replay specified number of emissions on subscription.\n *\n * This operator is a specialization of `replay` that connects to a source observable\n * and multicasts through a `ReplaySubject` constructed with the specified arguments.\n * A successfully completed source will stay cached in the `shareReplayed observable` forever,\n * but an errored source can be retried.\n *\n * ## Why use shareReplay?\n * You generally want to use `shareReplay` when you have side-effects or taxing computations\n * that you do not wish to be executed amongst multiple subscribers.\n * It may also be valuable in situations where you know you will have late subscribers to\n * a stream that need access to previously emitted values.\n * This ability to replay values on subscription is what differentiates {@link share} and `shareReplay`.\n *\n * ![](shareReplay.png)\n *\n * ## Example\n * ```javascript\n * const obs$ = interval(1000);\n * const subscription = obs$.pipe(\n * take(4),\n * shareReplay(3)\n * );\n * subscription.subscribe(x => console.log('source A: ', x));\n * subscription.subscribe(y => console.log('source B: ', y));\n *\n * ```\n *\n * @see {@link publish}\n * @see {@link share}\n * @see {@link publishReplay}\n *\n * @param {Number} [bufferSize=Number.POSITIVE_INFINITY] Maximum element count of the replay buffer.\n * @param {Number} [windowTime=Number.POSITIVE_INFINITY] Maximum time length of the replay buffer in milliseconds.\n * @param {Scheduler} [scheduler] Scheduler where connected observers within the selector function\n * will be invoked on.\n * @return {Observable} An observable sequence that contains the elements of a sequence produced\n * by multicasting the source sequence within a selector function.\n * @method shareReplay\n * @owner Observable\n */\nexport function shareReplay<T>(\n bufferSize: number = Number.POSITIVE_INFINITY,\n windowTime: number = Number.POSITIVE_INFINITY,\n scheduler?: SchedulerLike\n): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => source.lift(shareReplayOperator(bufferSize, windowTime, scheduler));\n}\n\nfunction shareReplayOperator<T>(bufferSize?: number, windowTime?: number, scheduler?: SchedulerLike) {\n let subject: ReplaySubject<T>;\n let refCount = 0;\n let subscription: Subscription;\n let hasError = false;\n let isComplete = false;\n\n return function shareReplayOperation(this: Subscriber<T>, source: Observable<T>) {\n refCount++;\n if (!subject || hasError) {\n hasError = false;\n subject = new ReplaySubject<T>(bufferSize, windowTime, scheduler);\n subscription = source.subscribe({\n next(value) { subject.next(value); },\n error(err) {\n hasError = true;\n subject.error(err);\n },\n complete() {\n isComplete = true;\n subject.complete();\n },\n });\n }\n\n const innerSub = subject.subscribe(this);\n\n return () => {\n refCount--;\n innerSub.unsubscribe();\n if (subscription && refCount === 0 && isComplete) {\n subscription.unsubscribe();\n }\n };\n };\n}\n","import { Observable } from '../Observable';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { EmptyError } from '../util/EmptyError';\n\nimport { Observer, MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/**\n * Returns an Observable that emits the single item emitted by the source Observable that matches a specified\n * predicate, if that Observable emits one such item. If the source Observable emits more than one such item or no\n * items, notify of an IllegalArgumentException or NoSuchElementException respectively. If the source Observable\n * emits items but none match the specified predicate then `undefined` is emiited.\n *\n * ![](single.png)\n *\n * @throws {EmptyError} Delivers an EmptyError to the Observer's `error`\n * callback if the Observable completes before any `next` notification was sent.\n * @param {Function} predicate - A predicate function to evaluate items emitted by the source Observable.\n * @return {Observable<T>} An Observable that emits the single item emitted by the source Observable that matches\n * the predicate or `undefined` when no items match.\n *\n * @method single\n * @owner Observable\n */\nexport function single<T>(predicate?: (value: T, index: number, source: Observable<T>) => boolean): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => source.lift(new SingleOperator(predicate, source));\n}\n\nclass SingleOperator<T> implements Operator<T, T> {\n constructor(private predicate?: (value: T, index: number, source: Observable<T>) => boolean,\n private source?: Observable<T>) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new SingleSubscriber(subscriber, this.predicate, this.source));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass SingleSubscriber<T> extends Subscriber<T> {\n private seenValue: boolean = false;\n private singleValue: T;\n private index: number = 0;\n\n constructor(destination: Observer<T>,\n private predicate?: (value: T, index: number, source: Observable<T>) => boolean,\n private source?: Observable<T>) {\n super(destination);\n }\n\n private applySingleValue(value: T): void {\n if (this.seenValue) {\n this.destination.error('Sequence contains more than one element');\n } else {\n this.seenValue = true;\n this.singleValue = value;\n }\n }\n\n protected _next(value: T): void {\n const index = this.index++;\n\n if (this.predicate) {\n this.tryNext(value, index);\n } else {\n this.applySingleValue(value);\n }\n }\n\n private tryNext(value: T, index: number): void {\n try {\n if (this.predicate(value, index, this.source)) {\n this.applySingleValue(value);\n }\n } catch (err) {\n this.destination.error(err);\n }\n }\n\n protected _complete(): void {\n const destination = this.destination;\n\n if (this.index > 0) {\n destination.next(this.seenValue ? this.singleValue : undefined);\n destination.complete();\n } else {\n destination.error(new EmptyError);\n }\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/**\n * Returns an Observable that skips the first `count` items emitted by the source Observable.\n *\n * ![](skip.png)\n *\n * @param {Number} count - The number of times, items emitted by source Observable should be skipped.\n * @return {Observable} An Observable that skips values emitted by the source Observable.\n *\n * @method skip\n * @owner Observable\n */\nexport function skip<T>(count: number): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => source.lift(new SkipOperator(count));\n}\n\nclass SkipOperator<T> implements Operator<T, T> {\n constructor(private total: number) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new SkipSubscriber(subscriber, this.total));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass SkipSubscriber<T> extends Subscriber<T> {\n count: number = 0;\n\n constructor(destination: Subscriber<T>, private total: number) {\n super(destination);\n }\n\n protected _next(x: T) {\n if (++this.count > this.total) {\n this.destination.next(x);\n }\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { ArgumentOutOfRangeError } from '../util/ArgumentOutOfRangeError';\nimport { Observable } from '../Observable';\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/**\n * Skip the last `count` values emitted by the source Observable.\n *\n * ![](skipLast.png)\n *\n * `skipLast` returns an Observable that accumulates a queue with a length\n * enough to store the first `count` values. As more values are received,\n * values are taken from the front of the queue and produced on the result\n * sequence. This causes values to be delayed.\n *\n * ## Example\n * Skip the last 2 values of an Observable with many values\n * ```javascript\n * const many = range(1, 5);\n * const skipLastTwo = many.pipe(skipLast(2));\n * skipLastTwo.subscribe(x => console.log(x));\n *\n * // Results in:\n * // 1 2 3\n * ```\n *\n * @see {@link skip}\n * @see {@link skipUntil}\n * @see {@link skipWhile}\n * @see {@link take}\n *\n * @throws {ArgumentOutOfRangeError} When using `skipLast(i)`, it throws\n * ArgumentOutOrRangeError if `i < 0`.\n *\n * @param {number} count Number of elements to skip from the end of the source Observable.\n * @returns {Observable<T>} An Observable that skips the last count values\n * emitted by the source Observable.\n * @method skipLast\n * @owner Observable\n */\nexport function skipLast<T>(count: number): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => source.lift(new SkipLastOperator(count));\n}\n\nclass SkipLastOperator<T> implements Operator<T, T> {\n constructor(private _skipCount: number) {\n if (this._skipCount < 0) {\n throw new ArgumentOutOfRangeError;\n }\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n if (this._skipCount === 0) {\n // If we don't want to skip any values then just subscribe\n // to Subscriber without any further logic.\n return source.subscribe(new Subscriber(subscriber));\n } else {\n return source.subscribe(new SkipLastSubscriber(subscriber, this._skipCount));\n }\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass SkipLastSubscriber<T> extends Subscriber<T> {\n private _ring: T[];\n private _count: number = 0;\n\n constructor(destination: Subscriber<T>, private _skipCount: number) {\n super(destination);\n this._ring = new Array<T>(_skipCount);\n }\n\n protected _next(value: T): void {\n const skipCount = this._skipCount;\n const count = this._count++;\n\n if (count < skipCount) {\n this._ring[count] = value;\n } else {\n const currentIndex = count % skipCount;\n const ring = this._ring;\n const oldValue = ring[currentIndex];\n\n ring[currentIndex] = value;\n this.destination.next(oldValue);\n }\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { MonoTypeOperatorFunction, TeardownLogic, ObservableInput } from '../types';\nimport { Subscription } from '../Subscription';\n\n/**\n * Returns an Observable that skips items emitted by the source Observable until a second Observable emits an item.\n *\n * ![](skipUntil.png)\n *\n * @param {Observable} notifier - The second Observable that has to emit an item before the source Observable's elements begin to\n * be mirrored by the resulting Observable.\n * @return {Observable<T>} An Observable that skips items from the source Observable until the second Observable emits\n * an item, then emits the remaining items.\n * @method skipUntil\n * @owner Observable\n */\nexport function skipUntil<T>(notifier: Observable<any>): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => source.lift(new SkipUntilOperator(notifier));\n}\n\nclass SkipUntilOperator<T> implements Operator<T, T> {\n constructor(private notifier: Observable<any>) {\n }\n\n call(destination: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new SkipUntilSubscriber(destination, this.notifier));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass SkipUntilSubscriber<T, R> extends OuterSubscriber<T, R> {\n\n private hasValue: boolean = false;\n private innerSubscription: Subscription;\n\n constructor(destination: Subscriber<R>, notifier: ObservableInput<any>) {\n super(destination);\n const innerSubscriber = new InnerSubscriber(this, undefined, undefined);\n this.add(innerSubscriber);\n this.innerSubscription = innerSubscriber;\n subscribeToResult(this, notifier, undefined, undefined, innerSubscriber);\n }\n\n protected _next(value: T) {\n if (this.hasValue) {\n super._next(value);\n }\n }\n\n notifyNext(outerValue: T, innerValue: R,\n outerIndex: number, innerIndex: number,\n innerSub: InnerSubscriber<T, R>): void {\n this.hasValue = true;\n if (this.innerSubscription) {\n this.innerSubscription.unsubscribe();\n }\n }\n\n notifyComplete() {\n /* do nothing */\n }\n}\n","import { Observable } from '../Observable';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/**\n * Returns an Observable that skips all items emitted by the source Observable as long as a specified condition holds\n * true, but emits all further source items as soon as the condition becomes false.\n *\n * ![](skipWhile.png)\n *\n * @param {Function} predicate - A function to test each item emitted from the source Observable.\n * @return {Observable<T>} An Observable that begins emitting items emitted by the source Observable when the\n * specified predicate becomes false.\n * @method skipWhile\n * @owner Observable\n */\nexport function skipWhile<T>(predicate: (value: T, index: number) => boolean): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => source.lift(new SkipWhileOperator(predicate));\n}\n\nclass SkipWhileOperator<T> implements Operator<T, T> {\n constructor(private predicate: (value: T, index: number) => boolean) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new SkipWhileSubscriber(subscriber, this.predicate));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass SkipWhileSubscriber<T> extends Subscriber<T> {\n private skipping: boolean = true;\n private index: number = 0;\n\n constructor(destination: Subscriber<T>,\n private predicate: (value: T, index: number) => boolean) {\n super(destination);\n }\n\n protected _next(value: T): void {\n const destination = this.destination;\n if (this.skipping) {\n this.tryCallPredicate(value);\n }\n\n if (!this.skipping) {\n destination.next(value);\n }\n }\n\n private tryCallPredicate(value: T): void {\n try {\n const result = this.predicate(value, this.index++);\n this.skipping = Boolean(result);\n } catch (err) {\n this.destination.error(err);\n }\n }\n}\n","import { Observable } from '../Observable';\nimport { fromArray } from '../observable/fromArray';\nimport { scalar } from '../observable/scalar';\nimport { empty } from '../observable/empty';\nimport { concat as concatStatic } from '../observable/concat';\nimport { isScheduler } from '../util/isScheduler';\nimport { MonoTypeOperatorFunction, OperatorFunction, SchedulerLike } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function startWith<T>(scheduler?: SchedulerLike): MonoTypeOperatorFunction<T>;\nexport function startWith<T, D = T>(v1: D, scheduler?: SchedulerLike): OperatorFunction<T, T | D>;\nexport function startWith<T, D = T, E = T>(v1: D, v2: E, scheduler?: SchedulerLike): OperatorFunction<T, T | D | E>;\nexport function startWith<T, D = T, E = T, F = T>(v1: D, v2: E, v3: F, scheduler?: SchedulerLike): OperatorFunction<T, T | D | E | F>;\nexport function startWith<T, D = T, E = T, F = T, G = T>(v1: D, v2: E, v3: F, v4: G, scheduler?: SchedulerLike): OperatorFunction<T, T | D | E | F | G>;\nexport function startWith<T, D = T, E = T, F = T, G = T, H = T>(v1: D, v2: E, v3: F, v4: G, v5: H, scheduler?: SchedulerLike): OperatorFunction<T, T | D | E | F | G | H>;\nexport function startWith<T, D = T, E = T, F = T, G = T, H = T, I = T>(v1: D, v2: E, v3: F, v4: G, v5: H, v6: I, scheduler?: SchedulerLike): OperatorFunction<T, T | D | E | F | G | H | I>;\nexport function startWith<T, D = T>(...array: Array<D | SchedulerLike>): OperatorFunction<T, T | D>;\n/* tslint:enable:max-line-length */\n\n/**\n * Returns an Observable that emits the items you specify as arguments before it begins to emit\n * items emitted by the source Observable.\n *\n * <span class=\"informal\">First emits its arguments in order, and then any\n * emissions from the source.</span>\n *\n * ![](startWith.png)\n *\n * ## Examples\n *\n * Start the chain of emissions with `\"first\"`, `\"second\"`\n *\n * ```javascript\n * of(\"from source\")\n * .pipe(startWith(\"first\", \"second\"))\n * .subscribe(x => console.log(x));\n *\n * // results:\n * // \"first\"\n * // \"second\"\n * // \"from source\"\n * ```\n *\n * @param {...T} values - Items you want the modified Observable to emit first.\n * @param {SchedulerLike} [scheduler] - A {@link SchedulerLike} to use for scheduling\n * the emissions of the `next` notifications.\n * @return {Observable} An Observable that emits the items in the specified Iterable and then emits the items\n * emitted by the source Observable.\n * @method startWith\n * @owner Observable\n */\nexport function startWith<T, D>(...array: Array<T | SchedulerLike>): OperatorFunction<T, T | D> {\n return (source: Observable<T>) => {\n let scheduler = <SchedulerLike>array[array.length - 1];\n if (isScheduler(scheduler)) {\n array.pop();\n } else {\n scheduler = null;\n }\n\n const len = array.length;\n if (len === 1 && !scheduler) {\n return concatStatic(scalar(array[0] as T), source);\n } else if (len > 0) {\n return concatStatic(fromArray(array as T[], scheduler), source);\n } else {\n return concatStatic<T>(empty(scheduler) as any, source);\n }\n };\n}\n","import { SchedulerLike, SchedulerAction } from '../types';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { Observable } from '../Observable';\nimport { asap } from '../scheduler/asap';\nimport { isNumeric } from '../util/isNumeric';\n\nexport interface DispatchArg<T> {\n source: Observable<T>;\n subscriber: Subscriber<T>;\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nexport class SubscribeOnObservable<T> extends Observable<T> {\n /** @nocollapse */\n static create<T>(source: Observable<T>, delay: number = 0, scheduler: SchedulerLike = asap): Observable<T> {\n return new SubscribeOnObservable(source, delay, scheduler);\n }\n\n /** @nocollapse */\n static dispatch<T>(this: SchedulerAction<T>, arg: DispatchArg<T>): Subscription {\n const { source, subscriber } = arg;\n return this.add(source.subscribe(subscriber));\n }\n\n constructor(public source: Observable<T>,\n private delayTime: number = 0,\n private scheduler: SchedulerLike = asap) {\n super();\n if (!isNumeric(delayTime) || delayTime < 0) {\n this.delayTime = 0;\n }\n if (!scheduler || typeof scheduler.schedule !== 'function') {\n this.scheduler = asap;\n }\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _subscribe(subscriber: Subscriber<T>) {\n const delay = this.delayTime;\n const source = this.source;\n const scheduler = this.scheduler;\n\n return scheduler.schedule<DispatchArg<any>>(SubscribeOnObservable.dispatch, delay, {\n source, subscriber\n });\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { SubscribeOnObservable } from '../observable/SubscribeOnObservable';\nimport { MonoTypeOperatorFunction, SchedulerLike, TeardownLogic } from '../types';\n\n/**\n * Asynchronously subscribes Observers to this Observable on the specified {@link SchedulerLike}.\n *\n * ![](subscribeOn.png)\n *\n * @param {SchedulerLike} scheduler - The {@link SchedulerLike} to perform subscription actions on.\n * @return {Observable<T>} The source Observable modified so that its subscriptions happen on the specified {@link SchedulerLike}.\n .\n * @method subscribeOn\n * @owner Observable\n */\nexport function subscribeOn<T>(scheduler: SchedulerLike, delay: number = 0): MonoTypeOperatorFunction<T> {\n return function subscribeOnOperatorFunction(source: Observable<T>): Observable<T> {\n return source.lift(new SubscribeOnOperator<T>(scheduler, delay));\n };\n}\n\nclass SubscribeOnOperator<T> implements Operator<T, T> {\n constructor(private scheduler: SchedulerLike,\n private delay: number) {\n }\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return new SubscribeOnObservable<T>(\n source, this.delay, this.scheduler\n ).subscribe(subscriber);\n }\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { ObservableInput, OperatorFunction } from '../types';\nimport { map } from './map';\nimport { from } from '../observable/from';\n\n/* tslint:disable:max-line-length */\nexport function switchMap<T, R>(project: (value: T, index: number) => ObservableInput<R>): OperatorFunction<T, R>;\n/** @deprecated resultSelector is no longer supported, use inner map instead */\nexport function switchMap<T, R>(project: (value: T, index: number) => ObservableInput<R>, resultSelector: undefined): OperatorFunction<T, R>;\n/** @deprecated resultSelector is no longer supported, use inner map instead */\nexport function switchMap<T, I, R>(project: (value: T, index: number) => ObservableInput<I>, resultSelector: (outerValue: T, innerValue: I, outerIndex: number, innerIndex: number) => R): OperatorFunction<T, R>;\n/* tslint:enable:max-line-length */\n\n/**\n * Projects each source value to an Observable which is merged in the output\n * Observable, emitting values only from the most recently projected Observable.\n *\n * <span class=\"informal\">Maps each value to an Observable, then flattens all of\n * these inner Observables.</span>\n *\n * ![](switchMap.png)\n *\n * Returns an Observable that emits items based on applying a function that you\n * supply to each item emitted by the source Observable, where that function\n * returns an (so-called \"inner\") Observable. Each time it observes one of these\n * inner Observables, the output Observable begins emitting the items emitted by\n * that inner Observable. When a new inner Observable is emitted, `switchMap`\n * stops emitting items from the earlier-emitted inner Observable and begins\n * emitting items from the new one. It continues to behave like this for\n * subsequent inner Observables.\n *\n * ## Example\n * Rerun an interval Observable on every click event\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(switchMap((ev) => interval(1000)));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link concatMap}\n * @see {@link exhaustMap}\n * @see {@link mergeMap}\n * @see {@link switchAll}\n * @see {@link switchMapTo}\n *\n * @param {function(value: T, ?index: number): ObservableInput} project A function\n * that, when applied to an item emitted by the source Observable, returns an\n * Observable.\n * @return {Observable} An Observable that emits the result of applying the\n * projection function (and the optional deprecated `resultSelector`) to each item\n * emitted by the source Observable and taking only the values from the most recently\n * projected inner Observable.\n * @method switchMap\n * @owner Observable\n */\nexport function switchMap<T, I, R>(\n project: (value: T, index: number) => ObservableInput<I>,\n resultSelector?: (outerValue: T, innerValue: I, outerIndex: number, innerIndex: number) => R,\n): OperatorFunction<T, I|R> {\n if (typeof resultSelector === 'function') {\n return (source: Observable<T>) => source.pipe(\n switchMap((a, i) => from(project(a, i)).pipe(\n map((b, ii) => resultSelector(a, b, i, ii))\n ))\n );\n }\n return (source: Observable<T>) => source.lift(new SwitchMapOperator(project));\n}\n\nclass SwitchMapOperator<T, R> implements Operator<T, R> {\n constructor(private project: (value: T, index: number) => ObservableInput<R>) {\n }\n\n call(subscriber: Subscriber<R>, source: any): any {\n return source.subscribe(new SwitchMapSubscriber(subscriber, this.project));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass SwitchMapSubscriber<T, R> extends OuterSubscriber<T, R> {\n private index: number = 0;\n private innerSubscription: Subscription;\n\n constructor(destination: Subscriber<R>,\n private project: (value: T, index: number) => ObservableInput<R>) {\n super(destination);\n }\n\n protected _next(value: T) {\n let result: ObservableInput<R>;\n const index = this.index++;\n try {\n result = this.project(value, index);\n } catch (error) {\n this.destination.error(error);\n return;\n }\n this._innerSub(result, value, index);\n }\n\n private _innerSub(result: ObservableInput<R>, value: T, index: number) {\n const innerSubscription = this.innerSubscription;\n if (innerSubscription) {\n innerSubscription.unsubscribe();\n }\n const innerSubscriber = new InnerSubscriber(this, undefined, undefined);\n const destination = this.destination as Subscription;\n destination.add(innerSubscriber);\n this.innerSubscription = subscribeToResult(this, result, value, index, innerSubscriber);\n }\n\n protected _complete(): void {\n const {innerSubscription} = this;\n if (!innerSubscription || innerSubscription.closed) {\n super._complete();\n }\n this.unsubscribe();\n }\n\n protected _unsubscribe() {\n this.innerSubscription = null;\n }\n\n notifyComplete(innerSub: Subscription): void {\n const destination = this.destination as Subscription;\n destination.remove(innerSub);\n this.innerSubscription = null;\n if (this.isStopped) {\n super._complete();\n }\n }\n\n notifyNext(outerValue: T, innerValue: R,\n outerIndex: number, innerIndex: number,\n innerSub: InnerSubscriber<T, R>): void {\n this.destination.next(innerValue);\n }\n}\n","import { OperatorFunction, ObservableInput } from '../types';\nimport { switchMap } from './switchMap';\nimport { identity } from '../util/identity';\n\nexport function switchAll<T>(): OperatorFunction<ObservableInput<T>, T>;\nexport function switchAll<R>(): OperatorFunction<any, R>;\n\nexport function switchAll<T>(): OperatorFunction<ObservableInput<T>, T> {\n return switchMap(identity);\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { ObservableInput, OperatorFunction } from '../types';\nimport { switchMap } from './switchMap';\n\n/* tslint:disable:max-line-length */\nexport function switchMapTo<R>(observable: ObservableInput<R>): OperatorFunction<any, R>;\n/** @deprecated resultSelector is no longer supported. Switch to using switchMap with an inner map */\nexport function switchMapTo<T, R>(observable: ObservableInput<R>, resultSelector: undefined): OperatorFunction<T, R>;\n/** @deprecated resultSelector is no longer supported. Switch to using switchMap with an inner map */\nexport function switchMapTo<T, I, R>(observable: ObservableInput<I>, resultSelector: (outerValue: T, innerValue: I, outerIndex: number, innerIndex: number) => R): OperatorFunction<T, R>;\n/* tslint:enable:max-line-length */\n\n/**\n * Projects each source value to the same Observable which is flattened multiple\n * times with {@link switchMap} in the output Observable.\n *\n * <span class=\"informal\">It's like {@link switchMap}, but maps each value\n * always to the same inner Observable.</span>\n *\n * ![](switchMapTo.png)\n *\n * Maps each source value to the given Observable `innerObservable` regardless\n * of the source value, and then flattens those resulting Observables into one\n * single Observable, which is the output Observable. The output Observables\n * emits values only from the most recently emitted instance of\n * `innerObservable`.\n *\n * ## Example\n * Rerun an interval Observable on every click event\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(switchMapTo(interval(1000)));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link concatMapTo}\n * @see {@link switchAll}\n * @see {@link switchMap}\n * @see {@link mergeMapTo}\n *\n * @param {ObservableInput} innerObservable An Observable to replace each value from\n * the source Observable.\n * @return {Observable} An Observable that emits items from the given\n * `innerObservable` (and optionally transformed through the deprecated `resultSelector`)\n * every time a value is emitted on the source Observable, and taking only the values\n * from the most recently projected inner Observable.\n * @method switchMapTo\n * @owner Observable\n */\nexport function switchMapTo<T, I, R>(\n innerObservable: ObservableInput<I>,\n resultSelector?: (outerValue: T, innerValue: I, outerIndex: number, innerIndex: number) => R\n): OperatorFunction<T, I|R> {\n return resultSelector ? switchMap(() => innerObservable, resultSelector) : switchMap(() => innerObservable);\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\n\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\n\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/**\n * Emits the values emitted by the source Observable until a `notifier`\n * Observable emits a value.\n *\n * <span class=\"informal\">Lets values pass until a second Observable,\n * `notifier`, emits a value. Then, it completes.</span>\n *\n * ![](takeUntil.png)\n *\n * `takeUntil` subscribes and begins mirroring the source Observable. It also\n * monitors a second Observable, `notifier` that you provide. If the `notifier`\n * emits a value, the output Observable stops mirroring the source Observable\n * and completes. If the `notifier` doesn't emit any value and completes\n * then `takeUntil` will pass all values.\n *\n * ## Example\n * Tick every second until the first click happens\n * ```javascript\n * const interval = interval(1000);\n * const clicks = fromEvent(document, 'click');\n * const result = interval.pipe(takeUntil(clicks));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link take}\n * @see {@link takeLast}\n * @see {@link takeWhile}\n * @see {@link skip}\n *\n * @param {Observable} notifier The Observable whose first emitted value will\n * cause the output Observable of `takeUntil` to stop emitting values from the\n * source Observable.\n * @return {Observable<T>} An Observable that emits the values from the source\n * Observable until such time as `notifier` emits its first value.\n * @method takeUntil\n * @owner Observable\n */\nexport function takeUntil<T>(notifier: Observable<any>): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => source.lift(new TakeUntilOperator(notifier));\n}\n\nclass TakeUntilOperator<T> implements Operator<T, T> {\n constructor(private notifier: Observable<any>) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n const takeUntilSubscriber = new TakeUntilSubscriber(subscriber);\n const notifierSubscription = subscribeToResult(takeUntilSubscriber, this.notifier);\n if (notifierSubscription && !takeUntilSubscriber.seenValue) {\n takeUntilSubscriber.add(notifierSubscription);\n return source.subscribe(takeUntilSubscriber);\n }\n return takeUntilSubscriber;\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass TakeUntilSubscriber<T, R> extends OuterSubscriber<T, R> {\n seenValue = false;\n\n constructor(destination: Subscriber<any>, ) {\n super(destination);\n }\n\n notifyNext(outerValue: T, innerValue: R,\n outerIndex: number, innerIndex: number,\n innerSub: InnerSubscriber<T, R>): void {\n this.seenValue = true;\n this.complete();\n }\n\n notifyComplete(): void {\n // noop\n }\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { OperatorFunction, MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\nexport function takeWhile<T, S extends T>(predicate: (value: T, index: number) => value is S): OperatorFunction<T, S>;\nexport function takeWhile<T>(predicate: (value: T, index: number) => boolean): MonoTypeOperatorFunction<T>;\n\n/**\n * Emits values emitted by the source Observable so long as each value satisfies\n * the given `predicate`, and then completes as soon as this `predicate` is not\n * satisfied.\n *\n * <span class=\"informal\">Takes values from the source only while they pass the\n * condition given. When the first value does not satisfy, it completes.</span>\n *\n * ![](takeWhile.png)\n *\n * `takeWhile` subscribes and begins mirroring the source Observable. Each value\n * emitted on the source is given to the `predicate` function which returns a\n * boolean, representing a condition to be satisfied by the source values. The\n * output Observable emits the source values until such time as the `predicate`\n * returns false, at which point `takeWhile` stops mirroring the source\n * Observable and completes the output Observable.\n *\n * ## Example\n * Emit click events only while the clientX property is greater than 200\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(takeWhile(ev => ev.clientX > 200));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link take}\n * @see {@link takeLast}\n * @see {@link takeUntil}\n * @see {@link skip}\n *\n * @param {function(value: T, index: number): boolean} predicate A function that\n * evaluates a value emitted by the source Observable and returns a boolean.\n * Also takes the (zero-based) index as the second argument.\n * @return {Observable<T>} An Observable that emits the values from the source\n * Observable so long as each value satisfies the condition defined by the\n * `predicate`, then completes.\n * @method takeWhile\n * @owner Observable\n */\nexport function takeWhile<T>(predicate: (value: T, index: number) => boolean): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => source.lift(new TakeWhileOperator(predicate));\n}\n\nclass TakeWhileOperator<T> implements Operator<T, T> {\n constructor(private predicate: (value: T, index: number) => boolean) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new TakeWhileSubscriber(subscriber, this.predicate));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass TakeWhileSubscriber<T> extends Subscriber<T> {\n private index: number = 0;\n\n constructor(destination: Subscriber<T>,\n private predicate: (value: T, index: number) => boolean) {\n super(destination);\n }\n\n protected _next(value: T): void {\n const destination = this.destination;\n let result: boolean;\n try {\n result = this.predicate(value, this.index++);\n } catch (err) {\n destination.error(err);\n return;\n }\n this.nextOrComplete(value, result);\n }\n\n private nextOrComplete(value: T, predicateResult: boolean): void {\n const destination = this.destination;\n if (Boolean(predicateResult)) {\n destination.next(value);\n } else {\n destination.complete();\n }\n }\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\n\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\n\nimport { MonoTypeOperatorFunction, SubscribableOrPromise, TeardownLogic } from '../types';\n\nexport interface ThrottleConfig {\n leading?: boolean;\n trailing?: boolean;\n}\n\nexport const defaultThrottleConfig: ThrottleConfig = {\n leading: true,\n trailing: false\n};\n\n/**\n * Emits a value from the source Observable, then ignores subsequent source\n * values for a duration determined by another Observable, then repeats this\n * process.\n *\n * <span class=\"informal\">It's like {@link throttleTime}, but the silencing\n * duration is determined by a second Observable.</span>\n *\n * ![](throttle.png)\n *\n * `throttle` emits the source Observable values on the output Observable\n * when its internal timer is disabled, and ignores source values when the timer\n * is enabled. Initially, the timer is disabled. As soon as the first source\n * value arrives, it is forwarded to the output Observable, and then the timer\n * is enabled by calling the `durationSelector` function with the source value,\n * which returns the \"duration\" Observable. When the duration Observable emits a\n * value or completes, the timer is disabled, and this process repeats for the\n * next source value.\n *\n * ## Example\n * Emit clicks at a rate of at most one click per second\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(throttle(ev => interval(1000)));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link audit}\n * @see {@link debounce}\n * @see {@link delayWhen}\n * @see {@link sample}\n * @see {@link throttleTime}\n *\n * @param {function(value: T): SubscribableOrPromise} durationSelector A function\n * that receives a value from the source Observable, for computing the silencing\n * duration for each source value, returned as an Observable or a Promise.\n * @param {Object} config a configuration object to define `leading` and `trailing` behavior. Defaults\n * to `{ leading: true, trailing: false }`.\n * @return {Observable<T>} An Observable that performs the throttle operation to\n * limit the rate of emissions from the source.\n * @method throttle\n * @owner Observable\n */\nexport function throttle<T>(durationSelector: (value: T) => SubscribableOrPromise<any>,\n config: ThrottleConfig = defaultThrottleConfig): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => source.lift(new ThrottleOperator(durationSelector, config.leading, config.trailing));\n}\n\nclass ThrottleOperator<T> implements Operator<T, T> {\n constructor(private durationSelector: (value: T) => SubscribableOrPromise<any>,\n private leading: boolean,\n private trailing: boolean) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(\n new ThrottleSubscriber(subscriber, this.durationSelector, this.leading, this.trailing)\n );\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc\n * @ignore\n * @extends {Ignored}\n */\nclass ThrottleSubscriber<T, R> extends OuterSubscriber<T, R> {\n private _throttled: Subscription;\n private _sendValue: T;\n private _hasValue = false;\n\n constructor(protected destination: Subscriber<T>,\n private durationSelector: (value: T) => SubscribableOrPromise<number>,\n private _leading: boolean,\n private _trailing: boolean) {\n super(destination);\n }\n\n protected _next(value: T): void {\n this._hasValue = true;\n this._sendValue = value;\n\n if (!this._throttled) {\n if (this._leading) {\n this.send();\n } else {\n this.throttle(value);\n }\n }\n }\n\n private send() {\n const { _hasValue, _sendValue } = this;\n if (_hasValue) {\n this.destination.next(_sendValue);\n this.throttle(_sendValue);\n }\n this._hasValue = false;\n this._sendValue = null;\n }\n\n private throttle(value: T): void {\n const duration = this.tryDurationSelector(value);\n if (duration) {\n this.add(this._throttled = subscribeToResult(this, duration));\n }\n }\n\n private tryDurationSelector(value: T): SubscribableOrPromise<any> {\n try {\n return this.durationSelector(value);\n } catch (err) {\n this.destination.error(err);\n return null;\n }\n }\n\n private throttlingDone() {\n const { _throttled, _trailing } = this;\n if (_throttled) {\n _throttled.unsubscribe();\n }\n this._throttled = null;\n\n if (_trailing) {\n this.send();\n }\n }\n\n notifyNext(outerValue: T, innerValue: R,\n outerIndex: number, innerIndex: number,\n innerSub: InnerSubscriber<T, R>): void {\n this.throttlingDone();\n }\n\n notifyComplete(): void {\n this.throttlingDone();\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { async } from '../scheduler/async';\nimport { Observable } from '../Observable';\nimport { ThrottleConfig, defaultThrottleConfig } from './throttle';\nimport { MonoTypeOperatorFunction, SchedulerLike, TeardownLogic } from '../types';\n\n/**\n * Emits a value from the source Observable, then ignores subsequent source\n * values for `duration` milliseconds, then repeats this process.\n *\n * <span class=\"informal\">Lets a value pass, then ignores source values for the\n * next `duration` milliseconds.</span>\n *\n * ![](throttleTime.png)\n *\n * `throttleTime` emits the source Observable values on the output Observable\n * when its internal timer is disabled, and ignores source values when the timer\n * is enabled. Initially, the timer is disabled. As soon as the first source\n * value arrives, it is forwarded to the output Observable, and then the timer\n * is enabled. After `duration` milliseconds (or the time unit determined\n * internally by the optional `scheduler`) has passed, the timer is disabled,\n * and this process repeats for the next source value. Optionally takes a\n * {@link SchedulerLike} for managing timers.\n *\n * ## Example\n * Emit clicks at a rate of at most one click per second\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(throttleTime(1000));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link auditTime}\n * @see {@link debounceTime}\n * @see {@link delay}\n * @see {@link sampleTime}\n * @see {@link throttle}\n *\n * @param {number} duration Time to wait before emitting another value after\n * emitting the last value, measured in milliseconds or the time unit determined\n * internally by the optional `scheduler`.\n * @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for\n * managing the timers that handle the throttling.\n * @param {Object} config a configuration object to define `leading` and\n * `trailing` behavior. Defaults to `{ leading: true, trailing: false }`.\n * @return {Observable<T>} An Observable that performs the throttle operation to\n * limit the rate of emissions from the source.\n * @method throttleTime\n * @owner Observable\n */\nexport function throttleTime<T>(duration: number,\n scheduler: SchedulerLike = async,\n config: ThrottleConfig = defaultThrottleConfig): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => source.lift(new ThrottleTimeOperator(duration, scheduler, config.leading, config.trailing));\n}\n\nclass ThrottleTimeOperator<T> implements Operator<T, T> {\n constructor(private duration: number,\n private scheduler: SchedulerLike,\n private leading: boolean,\n private trailing: boolean) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(\n new ThrottleTimeSubscriber(subscriber, this.duration, this.scheduler, this.leading, this.trailing)\n );\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass ThrottleTimeSubscriber<T> extends Subscriber<T> {\n private throttled: Subscription;\n private _hasTrailingValue: boolean = false;\n private _trailingValue: T = null;\n\n constructor(destination: Subscriber<T>,\n private duration: number,\n private scheduler: SchedulerLike,\n private leading: boolean,\n private trailing: boolean) {\n super(destination);\n }\n\n protected _next(value: T) {\n if (this.throttled) {\n if (this.trailing) {\n this._trailingValue = value;\n this._hasTrailingValue = true;\n }\n } else {\n this.add(this.throttled = this.scheduler.schedule<DispatchArg<T>>(dispatchNext, this.duration, { subscriber: this }));\n if (this.leading) {\n this.destination.next(value);\n }\n }\n }\n\n protected _complete() {\n if (this._hasTrailingValue) {\n this.destination.next(this._trailingValue);\n this.destination.complete();\n } else {\n this.destination.complete();\n }\n }\n\n clearThrottle() {\n const 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}\n\ninterface DispatchArg<T> {\n subscriber: ThrottleTimeSubscriber<T>;\n}\n\nfunction dispatchNext<T>(arg: DispatchArg<T>) {\n const { subscriber } = arg;\n subscriber.clearThrottle();\n}\n","\nimport { Observable } from '../Observable';\nimport { async } from '../scheduler/async';\nimport { SchedulerLike, OperatorFunction } from '../types';\nimport { scan } from './scan';\nimport { defer } from '../observable/defer';\nimport { map } from './map';\n\nexport function timeInterval<T>(scheduler: SchedulerLike = async): OperatorFunction<T, TimeInterval<T>> {\n return (source: Observable<T>) => defer(() => {\n return source.pipe(\n // HACK: the typings seem off with scan\n scan(\n ({ current }, value) => ({ value, current: scheduler.now(), last: current }),\n { current: scheduler.now(), value: undefined, last: undefined }\n ) as any,\n map<any, TimeInterval<T>>(({ current, last, value }) => new TimeInterval(value, current - last)),\n );\n });\n}\n\nexport class TimeInterval<T> {\n constructor(public value: T, public interval: number) {}\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { async } from '../scheduler/async';\nimport { Observable } from '../Observable';\nimport { isDate } from '../util/isDate';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { ObservableInput, OperatorFunction, MonoTypeOperatorFunction, SchedulerAction, SchedulerLike, TeardownLogic } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function timeoutWith<T, R>(due: number | Date, withObservable: ObservableInput<R>, scheduler?: SchedulerLike): OperatorFunction<T, T | R>;\n/* tslint:enable:max-line-length */\n\n/**\n *\n * Errors if Observable does not emit a value in given time span, in case of which\n * subscribes to the second Observable.\n *\n * <span class=\"informal\">It's a version of `timeout` operator that let's you specify fallback Observable.</span>\n *\n * ![](timeoutWith.png)\n *\n * `timeoutWith` is a variation of `timeout` operator. It behaves exactly the same,\n * still accepting as a first argument either a number or a Date, which control - respectively -\n * when values of source Observable should be emitted or when it should complete.\n *\n * The only difference is that it accepts a second, required parameter. This parameter\n * should be an Observable which will be subscribed when source Observable fails any timeout check.\n * So whenever regular `timeout` would emit an error, `timeoutWith` will instead start re-emitting\n * values from second Observable. Note that this fallback Observable is not checked for timeouts\n * itself, so it can emit values and complete at arbitrary points in time. From the moment of a second\n * subscription, Observable returned from `timeoutWith` simply mirrors fallback stream. When that\n * stream completes, it completes as well.\n *\n * Scheduler, which in case of `timeout` is provided as as second argument, can be still provided\n * here - as a third, optional parameter. It still is used to schedule timeout checks and -\n * as a consequence - when second Observable will be subscribed, since subscription happens\n * immediately after failing check.\n *\n * ## Example\n * Add fallback observable\n * ```javascript\n * const seconds = interval(1000);\n * const minutes = interval(60 * 1000);\n *\n * seconds.pipe(timeoutWith(900, minutes))\n * .subscribe(\n * value => console.log(value), // After 900ms, will start emitting `minutes`,\n * // since first value of `seconds` will not arrive fast enough.\n * err => console.log(err), // Would be called after 900ms in case of `timeout`,\n * // but here will never be called.\n * );\n * ```\n *\n * @param {number|Date} due Number specifying period within which Observable must emit values\n * or Date specifying before when Observable should complete\n * @param {Observable<T>} withObservable Observable which will be subscribed if source fails timeout check.\n * @param {SchedulerLike} [scheduler] Scheduler controlling when timeout checks occur.\n * @return {Observable<T>} Observable that mirrors behaviour of source or, when timeout check fails, of an Observable\n * passed as a second parameter.\n * @method timeoutWith\n * @owner Observable\n */\nexport function timeoutWith<T, R>(due: number | Date,\n withObservable: ObservableInput<R>,\n scheduler: SchedulerLike = async): OperatorFunction<T, T | R> {\n return (source: Observable<T>) => {\n let absoluteTimeout = isDate(due);\n let waitFor = absoluteTimeout ? (+due - scheduler.now()) : Math.abs(<number>due);\n return source.lift(new TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler));\n };\n}\n\nclass TimeoutWithOperator<T> implements Operator<T, T> {\n constructor(private waitFor: number,\n private absoluteTimeout: boolean,\n private withObservable: ObservableInput<any>,\n private scheduler: SchedulerLike) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new TimeoutWithSubscriber(\n subscriber, this.absoluteTimeout, this.waitFor, this.withObservable, this.scheduler\n ));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass TimeoutWithSubscriber<T, R> extends OuterSubscriber<T, R> {\n\n private action: SchedulerAction<TimeoutWithSubscriber<T, R>> = null;\n\n constructor(destination: Subscriber<T>,\n private absoluteTimeout: boolean,\n private waitFor: number,\n private withObservable: ObservableInput<any>,\n private scheduler: SchedulerLike) {\n super(destination);\n this.scheduleTimeout();\n }\n\n private static dispatchTimeout<T, R>(subscriber: TimeoutWithSubscriber<T, R>): void {\n const { withObservable } = subscriber;\n (<any> subscriber)._unsubscribeAndRecycle();\n subscriber.add(subscribeToResult(subscriber, withObservable));\n }\n\n private scheduleTimeout(): void {\n const { action } = this;\n if (action) {\n // Recycle the action if we've already scheduled one. All the production\n // Scheduler Actions mutate their state/delay time and return themeselves.\n // VirtualActions are immutable, so they create and return a clone. In this\n // case, we need to set the action reference to the most recent VirtualAction,\n // to ensure that's the one we clone from next time.\n this.action = (<SchedulerAction<TimeoutWithSubscriber<T, R>>> action.schedule(this, this.waitFor));\n } else {\n this.add(this.action = (<SchedulerAction<TimeoutWithSubscriber<T, R>>> this.scheduler.schedule<TimeoutWithSubscriber<T, R>>(\n TimeoutWithSubscriber.dispatchTimeout, this.waitFor, this\n )));\n }\n }\n\n protected _next(value: T): void {\n if (!this.absoluteTimeout) {\n this.scheduleTimeout();\n }\n super._next(value);\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _unsubscribe() {\n this.action = null;\n this.scheduler = null;\n this.withObservable = null;\n }\n}\n","import { async } from '../scheduler/async';\nimport { isDate } from '../util/isDate';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { TimeoutError } from '../util/TimeoutError';\nimport { MonoTypeOperatorFunction, SchedulerAction, SchedulerLike, TeardownLogic } from '../types';\nimport { timeoutWith } from './timeoutWith';\nimport { throwError } from '../observable/throwError';\n\n/**\n *\n * Errors if Observable does not emit a value in given time span.\n *\n * <span class=\"informal\">Timeouts on Observable that doesn't emit values fast enough.</span>\n *\n * ![](timeout.png)\n *\n * `timeout` operator accepts as an argument either a number or a Date.\n *\n * If number was provided, it returns an Observable that behaves like a source\n * Observable, unless there is a period of time where there is no value emitted.\n * So if you provide `100` as argument and first value comes after 50ms from\n * the moment of subscription, this value will be simply re-emitted by the resulting\n * Observable. If however after that 100ms passes without a second value being emitted,\n * stream will end with an error and source Observable will be unsubscribed.\n * These checks are performed throughout whole lifecycle of Observable - from the moment\n * it was subscribed to, until it completes or errors itself. Thus every value must be\n * emitted within specified period since previous value.\n *\n * If provided argument was Date, returned Observable behaves differently. It throws\n * if Observable did not complete before provided Date. This means that periods between\n * emission of particular values do not matter in this case. If Observable did not complete\n * before provided Date, source Observable will be unsubscribed. Other than that, resulting\n * stream behaves just as source Observable.\n *\n * `timeout` accepts also a Scheduler as a second parameter. It is used to schedule moment (or moments)\n * when returned Observable will check if source stream emitted value or completed.\n *\n * ## Examples\n * Check if ticks are emitted within certain timespan\n * ```javascript\n * const seconds = interval(1000);\n *\n * seconds.pipe(timeout(1100)) // Let's use bigger timespan to be safe,\n * // since `interval` might fire a bit later then scheduled.\n * .subscribe(\n * value => console.log(value), // Will emit numbers just as regular `interval` would.\n * err => console.log(err), // Will never be called.\n * );\n *\n * seconds.pipe(timeout(900))\n * .subscribe(\n * value => console.log(value), // Will never be called.\n * err => console.log(err), // Will emit error before even first value is emitted,\n * // since it did not arrive within 900ms period.\n * );\n * ```\n *\n * Use Date to check if Observable completed\n * ```javascript\n * const seconds = interval(1000);\n *\n * seconds.pipe(\n * timeout(new Date(\"December 17, 2020 03:24:00\")),\n * )\n * .subscribe(\n * value => console.log(value), // Will emit values as regular `interval` would\n * // until December 17, 2020 at 03:24:00.\n * err => console.log(err) // On December 17, 2020 at 03:24:00 it will emit an error,\n * // since Observable did not complete by then.\n * );\n * ```\n * @see {@link timeoutWith}\n *\n * @param {number|Date} due Number specifying period within which Observable must emit values\n * or Date specifying before when Observable should complete\n * @param {SchedulerLike} [scheduler] Scheduler controlling when timeout checks occur.\n * @return {Observable<T>} Observable that mirrors behaviour of source, unless timeout checks fail.\n * @method timeout\n * @owner Observable\n */\nexport function timeout<T>(due: number | Date,\n scheduler: SchedulerLike = async): MonoTypeOperatorFunction<T> {\n return timeoutWith(due, throwError(new TimeoutError()), scheduler);\n}\n","\nimport { async } from '../scheduler/async';\nimport { OperatorFunction, SchedulerLike, Timestamp as TimestampInterface } from '../types';\nimport { map } from './map';\n\n/**\n * @param scheduler\n * @return {Observable<Timestamp<any>>|WebSocketSubject<T>|Observable<T>}\n * @method timestamp\n * @owner Observable\n */\nexport function timestamp<T>(scheduler: SchedulerLike = async): OperatorFunction<T, Timestamp<T>> {\n return map((value: T) => new Timestamp(value, scheduler.now()));\n // return (source: Observable<T>) => source.lift(new TimestampOperator(scheduler));\n}\n\nexport class Timestamp<T> implements TimestampInterface<T> {\n constructor(public value: T, public timestamp: number) {\n }\n}\n","import { reduce } from './reduce';\nimport { OperatorFunction } from '../types';\n\nfunction toArrayReducer<T>(arr: T[], item: T, index: number) {\n if (index === 0) {\n return [item];\n }\n arr.push(item);\n return arr;\n}\n\nexport function toArray<T>(): OperatorFunction<T, T[]> {\n return reduce(toArrayReducer, []) as OperatorFunction<T, T[]>;\n}\n","import { Observable } from '../Observable';\nimport { OperatorFunction } from '../types';\nimport { Subject } from '../Subject';\nimport { Subscriber } from '../Subscriber';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { Operator } from '../Operator';\n\n/**\n * Branch out the source Observable values as a nested Observable whenever\n * `windowBoundaries` emits.\n *\n * <span class=\"informal\">It's like {@link buffer}, but emits a nested Observable\n * instead of an array.</span>\n *\n * ![](window.png)\n *\n * Returns an Observable that emits windows of items it collects from the source\n * Observable. The output Observable emits connected, non-overlapping\n * windows. It emits the current window and opens a new one whenever the\n * Observable `windowBoundaries` emits an item. Because each window is an\n * Observable, the output is a higher-order Observable.\n *\n * ## Example\n * In every window of 1 second each, emit at most 2 click events\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const interval = interval(1000);\n * const result = clicks.pipe(\n * window(interval),\n * map(win => win.take(2)), // each window has at most 2 emissions\n * mergeAll(), // flatten the Observable-of-Observables\n * );\n * result.subscribe(x => console.log(x));\n * ```\n * @see {@link windowCount}\n * @see {@link windowTime}\n * @see {@link windowToggle}\n * @see {@link windowWhen}\n * @see {@link buffer}\n *\n * @param {Observable<any>} windowBoundaries An Observable that completes the\n * previous window and starts a new window.\n * @return {Observable<Observable<T>>} An Observable of windows, which are\n * Observables emitting values of the source Observable.\n * @method window\n * @owner Observable\n */\nexport function window<T>(windowBoundaries: Observable<any>): OperatorFunction<T, Observable<T>> {\n return function windowOperatorFunction(source: Observable<T>) {\n return source.lift(new WindowOperator(windowBoundaries));\n };\n}\n\nclass WindowOperator<T> implements Operator<T, Observable<T>> {\n\n constructor(private windowBoundaries: Observable<any>) {\n }\n\n call(subscriber: Subscriber<Observable<T>>, source: any): any {\n const windowSubscriber = new WindowSubscriber(subscriber);\n const sourceSubscription = source.subscribe(windowSubscriber);\n if (!sourceSubscription.closed) {\n windowSubscriber.add(subscribeToResult(windowSubscriber, this.windowBoundaries));\n }\n return sourceSubscription;\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass WindowSubscriber<T> extends OuterSubscriber<T, any> {\n\n private window: Subject<T> = new Subject<T>();\n\n constructor(destination: Subscriber<Observable<T>>) {\n super(destination);\n destination.next(this.window);\n }\n\n notifyNext(outerValue: T, innerValue: any,\n outerIndex: number, innerIndex: number,\n innerSub: InnerSubscriber<T, any>): void {\n this.openWindow();\n }\n\n notifyError(error: any, innerSub: InnerSubscriber<T, any>): void {\n this._error(error);\n }\n\n notifyComplete(innerSub: InnerSubscriber<T, any>): void {\n this._complete();\n }\n\n protected _next(value: T): void {\n this.window.next(value);\n }\n\n protected _error(err: any): void {\n this.window.error(err);\n this.destination.error(err);\n }\n\n protected _complete(): void {\n this.window.complete();\n this.destination.complete();\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _unsubscribe() {\n this.window = null;\n }\n\n private openWindow(): void {\n const prevWindow = this.window;\n if (prevWindow) {\n prevWindow.complete();\n }\n const destination = this.destination;\n const newWindow = this.window = new Subject<T>();\n destination.next(newWindow);\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { Subject } from '../Subject';\nimport { OperatorFunction } from '../types';\n\n/**\n * Branch out the source Observable values as a nested Observable with each\n * nested Observable emitting at most `windowSize` values.\n *\n * <span class=\"informal\">It's like {@link bufferCount}, but emits a nested\n * Observable instead of an array.</span>\n *\n * ![](windowCount.png)\n *\n * Returns an Observable that emits windows of items it collects from the source\n * Observable. The output Observable emits windows every `startWindowEvery`\n * items, each containing no more than `windowSize` items. When the source\n * Observable completes or encounters an error, the output Observable emits\n * the current window and propagates the notification from the source\n * Observable. If `startWindowEvery` is not provided, then new windows are\n * started immediately at the start of the source and when each window completes\n * with size `windowSize`.\n *\n * ## Examples\n * Ignore every 3rd click event, starting from the first one\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(\n * windowCount(3)),\n * map(win => win.skip(1)), // skip first of every 3 clicks\n * mergeAll(), // flatten the Observable-of-Observables\n * );\n * result.subscribe(x => console.log(x));\n * ```\n *\n * Ignore every 3rd click event, starting from the third one\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(\n * windowCount(2, 3),\n * mergeAll(), // flatten the Observable-of-Observables\n * );\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link window}\n * @see {@link windowTime}\n * @see {@link windowToggle}\n * @see {@link windowWhen}\n * @see {@link bufferCount}\n *\n * @param {number} windowSize The maximum number of values emitted by each\n * window.\n * @param {number} [startWindowEvery] Interval at which to start a new window.\n * For example if `startWindowEvery` is `2`, then a new window will be started\n * on every other value from the source. A new window is started at the\n * beginning of the source by default.\n * @return {Observable<Observable<T>>} An Observable of windows, which in turn\n * are Observable of values.\n * @method windowCount\n * @owner Observable\n */\nexport function windowCount<T>(windowSize: number,\n startWindowEvery: number = 0): OperatorFunction<T, Observable<T>> {\n return function windowCountOperatorFunction(source: Observable<T>) {\n return source.lift(new WindowCountOperator<T>(windowSize, startWindowEvery));\n };\n}\n\nclass WindowCountOperator<T> implements Operator<T, Observable<T>> {\n\n constructor(private windowSize: number,\n private startWindowEvery: number) {\n }\n\n call(subscriber: Subscriber<Observable<T>>, source: any): any {\n return source.subscribe(new WindowCountSubscriber(subscriber, this.windowSize, this.startWindowEvery));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass WindowCountSubscriber<T> extends Subscriber<T> {\n private windows: Subject<T>[] = [ new Subject<T>() ];\n private count: number = 0;\n\n constructor(protected destination: Subscriber<Observable<T>>,\n private windowSize: number,\n private startWindowEvery: number) {\n super(destination);\n destination.next(this.windows[0]);\n }\n\n protected _next(value: T) {\n const startWindowEvery = (this.startWindowEvery > 0) ? this.startWindowEvery : this.windowSize;\n const destination = this.destination;\n const windowSize = this.windowSize;\n const windows = this.windows;\n const len = windows.length;\n\n for (let i = 0; i < len && !this.closed; i++) {\n windows[i].next(value);\n }\n const 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 const window = new Subject<T>();\n windows.push(window);\n destination.next(window);\n }\n }\n\n protected _error(err: any) {\n const 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\n protected _complete() {\n const 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\n protected _unsubscribe() {\n this.count = 0;\n this.windows = null;\n }\n}\n","import { Subject } from '../Subject';\nimport { Operator } from '../Operator';\nimport { async } from '../scheduler/async';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { Subscription } from '../Subscription';\nimport { isNumeric } from '../util/isNumeric';\nimport { isScheduler } from '../util/isScheduler';\nimport { OperatorFunction, SchedulerLike, SchedulerAction } from '../types';\n\n/**\n * Branch out the source Observable values as a nested Observable periodically\n * in time.\n *\n * <span class=\"informal\">It's like {@link bufferTime}, but emits a nested\n * Observable instead of an array.</span>\n *\n * ![](windowTime.png)\n *\n * Returns an Observable that emits windows of items it collects from the source\n * Observable. The output Observable starts a new window periodically, as\n * determined by the `windowCreationInterval` argument. It emits each window\n * after a fixed timespan, specified by the `windowTimeSpan` argument. When the\n * source Observable completes or encounters an error, the output Observable\n * emits the current window and propagates the notification from the source\n * Observable. If `windowCreationInterval` is not provided, the output\n * Observable starts a new window when the previous window of duration\n * `windowTimeSpan` completes. If `maxWindowCount` is provided, each window\n * will emit at most fixed number of values. Window will complete immediately\n * after emitting last value and next one still will open as specified by\n * `windowTimeSpan` and `windowCreationInterval` arguments.\n *\n * ## Examples\n * In every window of 1 second each, emit at most 2 click events\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(\n * windowTime(1000),\n * map(win => win.take(2)), // each window has at most 2 emissions\n * mergeAll(), // flatten the Observable-of-Observables\n * );\n * result.subscribe(x => console.log(x));\n * ```\n *\n * Every 5 seconds start a window 1 second long, and emit at most 2 click events per window\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(\n * windowTime(1000, 5000),\n * map(win => win.take(2)), // each window has at most 2 emissions\n * mergeAll(), // flatten the Observable-of-Observables\n * );\n * result.subscribe(x => console.log(x));\n * ```\n *\n * Same as example above but with maxWindowCount instead of take\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(\n * windowTime(1000, 5000, 2), // each window has still at most 2 emissions\n * mergeAll(), // flatten the Observable-of-Observables\n * );\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link window}\n * @see {@link windowCount}\n * @see {@link windowToggle}\n * @see {@link windowWhen}\n * @see {@link bufferTime}\n *\n * @param {number} windowTimeSpan The amount of time to fill each window.\n * @param {number} [windowCreationInterval] The interval at which to start new\n * windows.\n * @param {number} [maxWindowSize=Number.POSITIVE_INFINITY] Max number of\n * values each window can emit before completion.\n * @param {SchedulerLike} [scheduler=async] The scheduler on which to schedule the\n * intervals that determine window boundaries.\n * @return {Observable<Observable<T>>} An observable of windows, which in turn\n * are Observables.\n * @method windowTime\n * @owner Observable\n */\nexport function windowTime<T>(windowTimeSpan: number,\n scheduler?: SchedulerLike): OperatorFunction<T, Observable<T>>;\nexport function windowTime<T>(windowTimeSpan: number,\n windowCreationInterval: number,\n scheduler?: SchedulerLike): OperatorFunction<T, Observable<T>>;\nexport function windowTime<T>(windowTimeSpan: number,\n windowCreationInterval: number,\n maxWindowSize: number,\n scheduler?: SchedulerLike): OperatorFunction<T, Observable<T>>;\n\nexport function windowTime<T>(windowTimeSpan: number): OperatorFunction<T, Observable<T>> {\n let scheduler: SchedulerLike = async;\n let windowCreationInterval: number = null;\n let maxWindowSize: number = Number.POSITIVE_INFINITY;\n\n if (isScheduler(arguments[3])) {\n scheduler = arguments[3];\n }\n\n if (isScheduler(arguments[2])) {\n scheduler = arguments[2];\n } else if (isNumeric(arguments[2])) {\n maxWindowSize = arguments[2];\n }\n\n if (isScheduler(arguments[1])) {\n scheduler = arguments[1];\n } else if (isNumeric(arguments[1])) {\n windowCreationInterval = arguments[1];\n }\n\n return function windowTimeOperatorFunction(source: Observable<T>) {\n return source.lift(new WindowTimeOperator<T>(windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler));\n };\n}\n\nclass WindowTimeOperator<T> implements Operator<T, Observable<T>> {\n\n constructor(private windowTimeSpan: number,\n private windowCreationInterval: number | null,\n private maxWindowSize: number,\n private scheduler: SchedulerLike) {\n }\n\n call(subscriber: Subscriber<Observable<T>>, source: any): any {\n return source.subscribe(new WindowTimeSubscriber(\n subscriber, this.windowTimeSpan, this.windowCreationInterval, this.maxWindowSize, this.scheduler\n ));\n }\n}\n\ninterface CreationState<T> {\n windowTimeSpan: number;\n windowCreationInterval: number;\n subscriber: WindowTimeSubscriber<T>;\n scheduler: SchedulerLike;\n}\n\ninterface TimeSpanOnlyState<T> {\n window: CountedSubject<T>;\n windowTimeSpan: number;\n subscriber: WindowTimeSubscriber<T>;\n }\n\ninterface CloseWindowContext<T> {\n action: SchedulerAction<CreationState<T>>;\n subscription: Subscription;\n}\n\ninterface CloseState<T> {\n subscriber: WindowTimeSubscriber<T>;\n window: CountedSubject<T>;\n context: CloseWindowContext<T>;\n}\n\nclass CountedSubject<T> extends Subject<T> {\n private _numberOfNextedValues: number = 0;\n\n next(value?: T): void {\n this._numberOfNextedValues++;\n super.next(value);\n }\n\n get numberOfNextedValues(): number {\n return this._numberOfNextedValues;\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass WindowTimeSubscriber<T> extends Subscriber<T> {\n private windows: CountedSubject<T>[] = [];\n\n constructor(protected destination: Subscriber<Observable<T>>,\n private windowTimeSpan: number,\n private windowCreationInterval: number | null,\n private maxWindowSize: number,\n private scheduler: SchedulerLike) {\n super(destination);\n\n const window = this.openWindow();\n if (windowCreationInterval !== null && windowCreationInterval >= 0) {\n const closeState: CloseState<T> = { subscriber: this, window, context: <any>null };\n const creationState: CreationState<T> = { windowTimeSpan, windowCreationInterval, subscriber: this, scheduler };\n this.add(scheduler.schedule<CloseState<T>>(dispatchWindowClose, windowTimeSpan, closeState));\n this.add(scheduler.schedule<CreationState<T>>(dispatchWindowCreation, windowCreationInterval, creationState));\n } else {\n const timeSpanOnlyState: TimeSpanOnlyState<T> = { subscriber: this, window, windowTimeSpan };\n this.add(scheduler.schedule<TimeSpanOnlyState<T>>(dispatchWindowTimeSpanOnly, windowTimeSpan, timeSpanOnlyState));\n }\n }\n\n protected _next(value: T): void {\n const windows = this.windows;\n const len = windows.length;\n for (let i = 0; i < len; i++) {\n const window = windows[i];\n if (!window.closed) {\n window.next(value);\n if (window.numberOfNextedValues >= this.maxWindowSize) {\n this.closeWindow(window);\n }\n }\n }\n }\n\n protected _error(err: any): void {\n const windows = this.windows;\n while (windows.length > 0) {\n windows.shift().error(err);\n }\n this.destination.error(err);\n }\n\n protected _complete(): void {\n const windows = this.windows;\n while (windows.length > 0) {\n const window = windows.shift();\n if (!window.closed) {\n window.complete();\n }\n }\n this.destination.complete();\n }\n\n public openWindow(): CountedSubject<T> {\n const window = new CountedSubject<T>();\n this.windows.push(window);\n const destination = this.destination;\n destination.next(window);\n return window;\n }\n\n public closeWindow(window: CountedSubject<T>): void {\n window.complete();\n const windows = this.windows;\n windows.splice(windows.indexOf(window), 1);\n }\n}\n\nfunction dispatchWindowTimeSpanOnly<T>(this: SchedulerAction<TimeSpanOnlyState<T>>, state: TimeSpanOnlyState<T>): void {\n const { subscriber, windowTimeSpan, window } = state;\n if (window) {\n subscriber.closeWindow(window);\n }\n state.window = subscriber.openWindow();\n this.schedule(state, windowTimeSpan);\n}\n\nfunction dispatchWindowCreation<T>(this: SchedulerAction<CreationState<T>>, state: CreationState<T>): void {\n const { windowTimeSpan, subscriber, scheduler, windowCreationInterval } = state;\n const window = subscriber.openWindow();\n const action = this;\n let context: CloseWindowContext<T> = { action, subscription: <any>null };\n const timeSpanState: CloseState<T> = { subscriber, window, context };\n context.subscription = scheduler.schedule<CloseState<T>>(dispatchWindowClose, windowTimeSpan, timeSpanState);\n action.add(context.subscription);\n action.schedule(state, windowCreationInterval);\n}\n\nfunction dispatchWindowClose<T>(state: CloseState<T>): void {\n const { subscriber, window, context } = state;\n if (context && context.action && context.subscription) {\n context.action.remove(context.subscription);\n }\n subscriber.closeWindow(window);\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { Subject } from '../Subject';\nimport { Subscription } from '../Subscription';\nimport { tryCatch } from '../util/tryCatch';\nimport { errorObject } from '../util/errorObject';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { OperatorFunction } from '../types';\n\n/**\n * Branch out the source Observable values as a nested Observable starting from\n * an emission from `openings` and ending when the output of `closingSelector`\n * emits.\n *\n * <span class=\"informal\">It's like {@link bufferToggle}, but emits a nested\n * Observable instead of an array.</span>\n *\n * ![](windowToggle.png)\n *\n * Returns an Observable that emits windows of items it collects from the source\n * Observable. The output Observable emits windows that contain those items\n * emitted by the source Observable between the time when the `openings`\n * Observable emits an item and when the Observable returned by\n * `closingSelector` emits an item.\n *\n * ## Example\n * Every other second, emit the click events from the next 500ms\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const openings = interval(1000);\n * const result = clicks.pipe(\n * windowToggle(openings, i => i % 2 ? interval(500) : empty()),\n * mergeAll(),\n * );\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link window}\n * @see {@link windowCount}\n * @see {@link windowTime}\n * @see {@link windowWhen}\n * @see {@link bufferToggle}\n *\n * @param {Observable<O>} openings An observable of notifications to start new\n * windows.\n * @param {function(value: O): Observable} closingSelector A function that takes\n * the value emitted by the `openings` observable and returns an Observable,\n * which, when it emits (either `next` or `complete`), signals that the\n * associated window should complete.\n * @return {Observable<Observable<T>>} An observable of windows, which in turn\n * are Observables.\n * @method windowToggle\n * @owner Observable\n */\nexport function windowToggle<T, O>(openings: Observable<O>,\n closingSelector: (openValue: O) => Observable<any>): OperatorFunction<T, Observable<T>> {\n return (source: Observable<T>) => source.lift(new WindowToggleOperator<T, O>(openings, closingSelector));\n}\n\nclass WindowToggleOperator<T, O> implements Operator<T, Observable<T>> {\n\n constructor(private openings: Observable<O>,\n private closingSelector: (openValue: O) => Observable<any>) {\n }\n\n call(subscriber: Subscriber<Observable<T>>, source: any): any {\n return source.subscribe(new WindowToggleSubscriber(\n subscriber, this.openings, this.closingSelector\n ));\n }\n}\n\ninterface WindowContext<T> {\n window: Subject<T>;\n subscription: Subscription;\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass WindowToggleSubscriber<T, O> extends OuterSubscriber<T, any> {\n private contexts: WindowContext<T>[] = [];\n private openSubscription: Subscription;\n\n constructor(destination: Subscriber<Observable<T>>,\n private openings: Observable<O>,\n private closingSelector: (openValue: O) => Observable<any>) {\n super(destination);\n this.add(this.openSubscription = subscribeToResult(this, openings, openings as any));\n }\n\n protected _next(value: T) {\n const { contexts } = this;\n if (contexts) {\n const len = contexts.length;\n for (let i = 0; i < len; i++) {\n contexts[i].window.next(value);\n }\n }\n }\n\n protected _error(err: any) {\n\n const { contexts } = this;\n this.contexts = null;\n\n if (contexts) {\n const len = contexts.length;\n let index = -1;\n\n while (++index < len) {\n const context = contexts[index];\n context.window.error(err);\n context.subscription.unsubscribe();\n }\n }\n\n super._error(err);\n }\n\n protected _complete() {\n const { contexts } = this;\n this.contexts = null;\n if (contexts) {\n const len = contexts.length;\n let index = -1;\n while (++index < len) {\n const context = contexts[index];\n context.window.complete();\n context.subscription.unsubscribe();\n }\n }\n super._complete();\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _unsubscribe() {\n const { contexts } = this;\n this.contexts = null;\n if (contexts) {\n const len = contexts.length;\n let index = -1;\n while (++index < len) {\n const context = contexts[index];\n context.window.unsubscribe();\n context.subscription.unsubscribe();\n }\n }\n }\n\n notifyNext(outerValue: any, innerValue: any,\n outerIndex: number, innerIndex: number,\n innerSub: InnerSubscriber<T, any>): void {\n\n if (outerValue === this.openings) {\n\n const { closingSelector } = this;\n const closingNotifier = tryCatch(closingSelector)(innerValue);\n\n if (closingNotifier === errorObject) {\n return this.error(errorObject.e);\n } else {\n const window = new Subject<T>();\n const subscription = new Subscription();\n const context = { window, subscription };\n this.contexts.push(context);\n const innerSubscription = subscribeToResult(this, closingNotifier, context as any);\n\n if (innerSubscription.closed) {\n this.closeWindow(this.contexts.length - 1);\n } else {\n (<any> innerSubscription).context = context;\n subscription.add(innerSubscription);\n }\n\n this.destination.next(window);\n\n }\n } else {\n this.closeWindow(this.contexts.indexOf(outerValue));\n }\n }\n\n notifyError(err: any): void {\n this.error(err);\n }\n\n notifyComplete(inner: Subscription): void {\n if (inner !== this.openSubscription) {\n this.closeWindow(this.contexts.indexOf((<any> inner).context));\n }\n }\n\n private closeWindow(index: number): void {\n if (index === -1) {\n return;\n }\n\n const { contexts } = this;\n const context = contexts[index];\n const { window, subscription } = context;\n contexts.splice(index, 1);\n window.complete();\n subscription.unsubscribe();\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { Subject } from '../Subject';\nimport { Subscription } from '../Subscription';\nimport { tryCatch } from '../util/tryCatch';\nimport { errorObject } from '../util/errorObject';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { OperatorFunction } from '../types';\n\n/**\n * Branch out the source Observable values as a nested Observable using a\n * factory function of closing Observables to determine when to start a new\n * window.\n *\n * <span class=\"informal\">It's like {@link bufferWhen}, but emits a nested\n * Observable instead of an array.</span>\n *\n * ![](windowWhen.png)\n *\n * Returns an Observable that emits windows of items it collects from the source\n * Observable. The output Observable emits connected, non-overlapping windows.\n * It emits the current window and opens a new one whenever the Observable\n * produced by the specified `closingSelector` function emits an item. The first\n * window is opened immediately when subscribing to the output Observable.\n *\n * ## Example\n * Emit only the first two clicks events in every window of [1-5] random seconds\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(\n * windowWhen(() => interval(1000 + Math.random() * 4000)),\n * map(win => win.pipe(take(2))), // each window has at most 2 emissions\n * mergeAll(), // flatten the Observable-of-Observables\n * );\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link window}\n * @see {@link windowCount}\n * @see {@link windowTime}\n * @see {@link windowToggle}\n * @see {@link bufferWhen}\n *\n * @param {function(): Observable} closingSelector A function that takes no\n * arguments and returns an Observable that signals (on either `next` or\n * `complete`) when to close the previous window and start a new one.\n * @return {Observable<Observable<T>>} An observable of windows, which in turn\n * are Observables.\n * @method windowWhen\n * @owner Observable\n */\nexport function windowWhen<T>(closingSelector: () => Observable<any>): OperatorFunction<T, Observable<T>> {\n return function windowWhenOperatorFunction(source: Observable<T>) {\n return source.lift(new WindowOperator<T>(closingSelector));\n };\n}\n\nclass WindowOperator<T> implements Operator<T, Observable<T>> {\n constructor(private closingSelector: () => Observable<any>) {\n }\n\n call(subscriber: Subscriber<Observable<T>>, source: any): any {\n return source.subscribe(new WindowSubscriber(subscriber, this.closingSelector));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass WindowSubscriber<T> extends OuterSubscriber<T, any> {\n private window: Subject<T>;\n private closingNotification: Subscription;\n\n constructor(protected destination: Subscriber<Observable<T>>,\n private closingSelector: () => Observable<any>) {\n super(destination);\n this.openWindow();\n }\n\n notifyNext(outerValue: T, innerValue: any,\n outerIndex: number, innerIndex: number,\n innerSub: InnerSubscriber<T, any>): void {\n this.openWindow(innerSub);\n }\n\n notifyError(error: any, innerSub: InnerSubscriber<T, any>): void {\n this._error(error);\n }\n\n notifyComplete(innerSub: InnerSubscriber<T, any>): void {\n this.openWindow(innerSub);\n }\n\n protected _next(value: T): void {\n this.window.next(value);\n }\n\n protected _error(err: any): void {\n this.window.error(err);\n this.destination.error(err);\n this.unsubscribeClosingNotification();\n }\n\n protected _complete(): void {\n this.window.complete();\n this.destination.complete();\n this.unsubscribeClosingNotification();\n }\n\n private unsubscribeClosingNotification(): void {\n if (this.closingNotification) {\n this.closingNotification.unsubscribe();\n }\n }\n\n private openWindow(innerSub: InnerSubscriber<T, any> = null): void {\n if (innerSub) {\n this.remove(innerSub);\n innerSub.unsubscribe();\n }\n\n const prevWindow = this.window;\n if (prevWindow) {\n prevWindow.complete();\n }\n\n const window = this.window = new Subject<T>();\n this.destination.next(window);\n\n const closingNotifier = tryCatch(this.closingSelector)();\n if (closingNotifier === errorObject) {\n const err = errorObject.e;\n this.destination.error(err);\n this.window.error(err);\n } else {\n this.add(this.closingNotification = subscribeToResult(this, closingNotifier));\n }\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { ObservableInput, OperatorFunction } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function withLatestFrom<T, R>(project: (v1: T) => R): OperatorFunction<T, R>;\nexport function withLatestFrom<T, T2, R>(v2: ObservableInput<T2>, project: (v1: T, v2: T2) => R): OperatorFunction<T, R>;\nexport function withLatestFrom<T, T2, T3, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, project: (v1: T, v2: T2, v3: T3) => R): OperatorFunction<T, R>;\nexport function withLatestFrom<T, T2, T3, T4, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, project: (v1: T, v2: T2, v3: T3, v4: T4) => R): OperatorFunction<T, R>;\nexport function withLatestFrom<T, T2, T3, T4, T5, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, project: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => R): OperatorFunction<T, R>;\nexport function withLatestFrom<T, T2, T3, T4, T5, T6, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>, project: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6) => R): OperatorFunction<T, R> ;\nexport function withLatestFrom<T, T2>(v2: ObservableInput<T2>): OperatorFunction<T, [T, T2]>;\nexport function withLatestFrom<T, T2, T3>(v2: ObservableInput<T2>, v3: ObservableInput<T3>): OperatorFunction<T, [T, T2, T3]>;\nexport function withLatestFrom<T, T2, T3, T4>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>): OperatorFunction<T, [T, T2, T3, T4]>;\nexport function withLatestFrom<T, T2, T3, T4, T5>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>): OperatorFunction<T, [T, T2, T3, T4, T5]>;\nexport function withLatestFrom<T, T2, T3, T4, T5, T6>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>): OperatorFunction<T, [T, T2, T3, T4, T5, T6]> ;\nexport function withLatestFrom<T, R>(...observables: Array<ObservableInput<any> | ((...values: Array<any>) => R)>): OperatorFunction<T, R>;\nexport function withLatestFrom<T, R>(array: ObservableInput<any>[]): OperatorFunction<T, R>;\nexport function withLatestFrom<T, R>(array: ObservableInput<any>[], project: (...values: Array<any>) => R): OperatorFunction<T, R>;\n/* tslint:enable:max-line-length */\n\n/**\n * Combines the source Observable with other Observables to create an Observable\n * whose values are calculated from the latest values of each, only when the\n * source emits.\n *\n * <span class=\"informal\">Whenever the source Observable emits a value, it\n * computes a formula using that value plus the latest values from other input\n * Observables, then emits the output of that formula.</span>\n *\n * ![](withLatestFrom.png)\n *\n * `withLatestFrom` combines each value from the source Observable (the\n * instance) with the latest values from the other input Observables only when\n * the source emits a value, optionally using a `project` function to determine\n * the value to be emitted on the output Observable. All input Observables must\n * emit at least one value before the output Observable will emit a value.\n *\n * ## Example\n * On every click event, emit an array with the latest timer event plus the click event\n * ```javascript\n * const clicks = fromEvent(document, 'click');\n * const timer = interval(1000);\n * const result = clicks.pipe(withLatestFrom(timer));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link combineLatest}\n *\n * @param {ObservableInput} other An input Observable to combine with the source\n * Observable. More than one input Observables may be given as argument.\n * @param {Function} [project] Projection function for combining values\n * together. Receives all values in order of the Observables passed, where the\n * first parameter is a value from the source Observable. (e.g.\n * `a.pipe(withLatestFrom(b, c), map(([a1, b1, c1]) => a1 + b1 + c1))`). If this is not\n * passed, arrays will be emitted on the output Observable.\n * @return {Observable} An Observable of projected values from the most recent\n * values from each input Observable, or an array of the most recent values from\n * each input Observable.\n * @method withLatestFrom\n * @owner Observable\n */\nexport function withLatestFrom<T, R>(...args: Array<ObservableInput<any> | ((...values: Array<any>) => R)>): OperatorFunction<T, R> {\n return (source: Observable<T>) => {\n let project: any;\n if (typeof args[args.length - 1] === 'function') {\n project = args.pop();\n }\n const observables = <Observable<any>[]>args;\n return source.lift(new WithLatestFromOperator(observables, project));\n };\n}\n\nclass WithLatestFromOperator<T, R> implements Operator<T, R> {\n constructor(private observables: Observable<any>[],\n private project?: (...values: any[]) => Observable<R>) {\n }\n\n call(subscriber: Subscriber<R>, source: any): any {\n return source.subscribe(new WithLatestFromSubscriber(subscriber, this.observables, this.project));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass WithLatestFromSubscriber<T, R> extends OuterSubscriber<T, R> {\n private values: any[];\n private toRespond: number[] = [];\n\n constructor(destination: Subscriber<R>,\n private observables: Observable<any>[],\n private project?: (...values: any[]) => Observable<R>) {\n super(destination);\n const len = observables.length;\n this.values = new Array(len);\n\n for (let i = 0; i < len; i++) {\n this.toRespond.push(i);\n }\n\n for (let i = 0; i < len; i++) {\n let observable = observables[i];\n this.add(subscribeToResult<T, R>(this, observable, <any>observable, i));\n }\n }\n\n notifyNext(outerValue: T, innerValue: R,\n outerIndex: number, innerIndex: number,\n innerSub: InnerSubscriber<T, R>): void {\n this.values[outerIndex] = innerValue;\n const toRespond = this.toRespond;\n if (toRespond.length > 0) {\n const found = toRespond.indexOf(outerIndex);\n if (found !== -1) {\n toRespond.splice(found, 1);\n }\n }\n }\n\n notifyComplete() {\n // noop\n }\n\n protected _next(value: T) {\n if (this.toRespond.length === 0) {\n const args = [value, ...this.values];\n if (this.project) {\n this._tryProject(args);\n } else {\n this.destination.next(args);\n }\n }\n }\n\n private _tryProject(args: any[]) {\n let result: any;\n try {\n result = this.project.apply(this, args);\n } catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n }\n}\n","import { zip as zipStatic } from '../observable/zip';\nimport { Observable } from '../Observable';\nimport { ObservableInput, OperatorFunction } from '../types';\n\n/* tslint:disable:max-line-length */\n/** @deprecated Deprecated in favor of static zip. */\nexport function zip<T, R>(project: (v1: T) => R): OperatorFunction<T, R>;\n/** @deprecated Deprecated in favor of static zip. */\nexport function zip<T, T2, R>(v2: ObservableInput<T2>, project: (v1: T, v2: T2) => R): OperatorFunction<T, R>;\n/** @deprecated Deprecated in favor of static zip. */\nexport function zip<T, T2, T3, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, project: (v1: T, v2: T2, v3: T3) => R): OperatorFunction<T, R>;\n/** @deprecated Deprecated in favor of static zip. */\nexport function zip<T, T2, T3, T4, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, project: (v1: T, v2: T2, v3: T3, v4: T4) => R): OperatorFunction<T, R>;\n/** @deprecated Deprecated in favor of static zip. */\nexport function zip<T, T2, T3, T4, T5, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, project: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => R): OperatorFunction<T, R>;\n/** @deprecated Deprecated in favor of static zip. */\nexport function zip<T, T2, T3, T4, T5, T6, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>, project: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6) => R): OperatorFunction<T, R> ;\n/** @deprecated Deprecated in favor of static zip. */\nexport function zip<T, T2>(v2: ObservableInput<T2>): OperatorFunction<T, [T, T2]>;\n/** @deprecated Deprecated in favor of static zip. */\nexport function zip<T, T2, T3>(v2: ObservableInput<T2>, v3: ObservableInput<T3>): OperatorFunction<T, [T, T2, T3]>;\n/** @deprecated Deprecated in favor of static zip. */\nexport function zip<T, T2, T3, T4>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>): OperatorFunction<T, [T, T2, T3, T4]>;\n/** @deprecated Deprecated in favor of static zip. */\nexport function zip<T, T2, T3, T4, T5>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>): OperatorFunction<T, [T, T2, T3, T4, T5]>;\n/** @deprecated Deprecated in favor of static zip. */\nexport function zip<T, T2, T3, T4, T5, T6>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>): OperatorFunction<T, [T, T2, T3, T4, T5, T6]> ;\n/** @deprecated Deprecated in favor of static zip. */\nexport function zip<T, R>(...observables: Array<ObservableInput<T> | ((...values: Array<T>) => R)>): OperatorFunction<T, R>;\n/** @deprecated Deprecated in favor of static zip. */\nexport function zip<T, R>(array: Array<ObservableInput<T>>): OperatorFunction<T, R>;\n/** @deprecated Deprecated in favor of static zip. */\nexport function zip<T, TOther, R>(array: Array<ObservableInput<TOther>>, project: (v1: T, ...values: Array<TOther>) => R): OperatorFunction<T, R>;\n/* tslint:enable:max-line-length */\n\n/**\n * @deprecated Deprecated in favor of static {@link zip}.\n */\nexport function zip<T, R>(...observables: Array<ObservableInput<any> | ((...values: Array<any>) => R)>): OperatorFunction<T, R> {\n return function zipOperatorFunction(source: Observable<T>) {\n return source.lift.call(zipStatic<R>(source, ...observables));\n };\n}","import { ZipOperator } from '../observable/zip';\nimport { Observable } from '../Observable';\nimport { OperatorFunction, ObservableInput } from '../types';\n\nexport function zipAll<T>(): OperatorFunction<ObservableInput<T>, T[]>;\nexport function zipAll<T>(): OperatorFunction<any, T[]>;\nexport function zipAll<T, R>(project: (...values: T[]) => R): OperatorFunction<ObservableInput<T>, R>;\nexport function zipAll<R>(project: (...values: Array<any>) => R): OperatorFunction<any, R>;\n\nexport function zipAll<T, R>(project?: (...values: Array<any>) => R): OperatorFunction<T, R> {\n return (source: Observable<T>) => source.lift(new ZipOperator(project));\n}\n","\n/* Operator exports */\nexport { audit } from '../internal/operators/audit';\nexport { auditTime } from '../internal/operators/auditTime';\nexport { buffer } from '../internal/operators/buffer';\nexport { bufferCount } from '../internal/operators/bufferCount';\nexport { bufferTime } from '../internal/operators/bufferTime';\nexport { bufferToggle } from '../internal/operators/bufferToggle';\nexport { bufferWhen } from '../internal/operators/bufferWhen';\nexport { catchError } from '../internal/operators/catchError';\nexport { combineAll } from '../internal/operators/combineAll';\nexport { combineLatest } from '../internal/operators/combineLatest';\nexport { concat } from '../internal/operators/concat';\nexport { concatAll } from '../internal/operators/concatAll';\nexport { concatMap } from '../internal/operators/concatMap';\nexport { concatMapTo } from '../internal/operators/concatMapTo';\nexport { count } from '../internal/operators/count';\nexport { debounce } from '../internal/operators/debounce';\nexport { debounceTime } from '../internal/operators/debounceTime';\nexport { defaultIfEmpty } from '../internal/operators/defaultIfEmpty';\nexport { delay } from '../internal/operators/delay';\nexport { delayWhen } from '../internal/operators/delayWhen';\nexport { dematerialize } from '../internal/operators/dematerialize';\nexport { distinct } from '../internal/operators/distinct';\nexport { distinctUntilChanged } from '../internal/operators/distinctUntilChanged';\nexport { distinctUntilKeyChanged } from '../internal/operators/distinctUntilKeyChanged';\nexport { elementAt } from '../internal/operators/elementAt';\nexport { endWith } from '../internal/operators/endWith';\nexport { every } from '../internal/operators/every';\nexport { exhaust } from '../internal/operators/exhaust';\nexport { exhaustMap } from '../internal/operators/exhaustMap';\nexport { expand } from '../internal/operators/expand';\nexport { filter } from '../internal/operators/filter';\nexport { finalize } from '../internal/operators/finalize';\nexport { find } from '../internal/operators/find';\nexport { findIndex } from '../internal/operators/findIndex';\nexport { first } from '../internal/operators/first';\nexport { groupBy } from '../internal/operators/groupBy';\nexport { ignoreElements } from '../internal/operators/ignoreElements';\nexport { isEmpty } from '../internal/operators/isEmpty';\nexport { last } from '../internal/operators/last';\nexport { map } from '../internal/operators/map';\nexport { mapTo } from '../internal/operators/mapTo';\nexport { materialize } from '../internal/operators/materialize';\nexport { max } from '../internal/operators/max';\nexport { merge } from '../internal/operators/merge';\nexport { mergeAll } from '../internal/operators/mergeAll';\nexport { mergeMap } from '../internal/operators/mergeMap';\nexport { mergeMap as flatMap } from '../internal/operators/mergeMap';\nexport { mergeMapTo } from '../internal/operators/mergeMapTo';\nexport { mergeScan } from '../internal/operators/mergeScan';\nexport { min } from '../internal/operators/min';\nexport { multicast } from '../internal/operators/multicast';\nexport { observeOn } from '../internal/operators/observeOn';\nexport { onErrorResumeNext } from '../internal/operators/onErrorResumeNext';\nexport { pairwise } from '../internal/operators/pairwise';\nexport { partition } from '../internal/operators/partition';\nexport { pluck } from '../internal/operators/pluck';\nexport { publish } from '../internal/operators/publish';\nexport { publishBehavior } from '../internal/operators/publishBehavior';\nexport { publishLast } from '../internal/operators/publishLast';\nexport { publishReplay } from '../internal/operators/publishReplay';\nexport { race } from '../internal/operators/race';\nexport { reduce } from '../internal/operators/reduce';\nexport { repeat } from '../internal/operators/repeat';\nexport { repeatWhen } from '../internal/operators/repeatWhen';\nexport { retry } from '../internal/operators/retry';\nexport { retryWhen } from '../internal/operators/retryWhen';\nexport { refCount } from '../internal/operators/refCount';\nexport { sample } from '../internal/operators/sample';\nexport { sampleTime } from '../internal/operators/sampleTime';\nexport { scan } from '../internal/operators/scan';\nexport { sequenceEqual } from '../internal/operators/sequenceEqual';\nexport { share } from '../internal/operators/share';\nexport { shareReplay } from '../internal/operators/shareReplay';\nexport { single } from '../internal/operators/single';\nexport { skip } from '../internal/operators/skip';\nexport { skipLast } from '../internal/operators/skipLast';\nexport { skipUntil } from '../internal/operators/skipUntil';\nexport { skipWhile } from '../internal/operators/skipWhile';\nexport { startWith } from '../internal/operators/startWith';\nexport { subscribeOn } from '../internal/operators/subscribeOn';\nexport { switchAll } from '../internal/operators/switchAll';\nexport { switchMap } from '../internal/operators/switchMap';\nexport { switchMapTo } from '../internal/operators/switchMapTo';\nexport { take } from '../internal/operators/take';\nexport { takeLast } from '../internal/operators/takeLast';\nexport { takeUntil } from '../internal/operators/takeUntil';\nexport { takeWhile } from '../internal/operators/takeWhile';\nexport { tap } from '../internal/operators/tap';\nexport { throttle } from '../internal/operators/throttle';\nexport { throttleTime } from '../internal/operators/throttleTime';\nexport { throwIfEmpty } from '../internal/operators/throwIfEmpty';\nexport { timeInterval } from '../internal/operators/timeInterval';\nexport { timeout } from '../internal/operators/timeout';\nexport { timeoutWith } from '../internal/operators/timeoutWith';\nexport { timestamp } from '../internal/operators/timestamp';\nexport { toArray } from '../internal/operators/toArray';\nexport { window } from '../internal/operators/window';\nexport { windowCount } from '../internal/operators/windowCount';\nexport { windowTime } from '../internal/operators/windowTime';\nexport { windowToggle } from '../internal/operators/windowToggle';\nexport { windowWhen } from '../internal/operators/windowWhen';\nexport { withLatestFrom } from '../internal/operators/withLatestFrom';\nexport { zip } from '../internal/operators/zip';\nexport { zipAll } from '../internal/operators/zipAll';\n","import * as webdetector from '../ts/index'\n\nconsole.log('hi');\n\nconst run = async () => {\n const testWebDetector = new webdetector.WebDetector({\n checkOnlineUrl: 'https://pubapi.lossless.one'\n });\n const onlineResultBoolean = await testWebDetector.isOnline();\n console.log('browser is online:')\n console.log(onlineResultBoolean);\n testWebDetector.startPeriodicChecks();\n testWebDetector.onlineObservable.subscribe((state) => {\n console.log(state);\n })\n}\nrun();\n"]}