@superutils/rx 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../core/dist/index.js","../../../promise/dist/index.js","../../../../node_modules/tslib/tslib.es6.mjs","../../../../node_modules/rxjs/src/internal/util/isFunction.ts","../../../../node_modules/rxjs/src/internal/util/createErrorClass.ts","../../../../node_modules/rxjs/src/internal/util/UnsubscriptionError.ts","../../../../node_modules/rxjs/src/internal/util/arrRemove.ts","../../../../node_modules/rxjs/src/internal/Subscription.ts","../../../../node_modules/rxjs/src/internal/config.ts","../../../../node_modules/rxjs/src/internal/scheduler/timeoutProvider.ts","../../../../node_modules/rxjs/src/internal/util/reportUnhandledError.ts","../../../../node_modules/rxjs/src/internal/util/noop.ts","../../../../node_modules/rxjs/src/internal/util/errorContext.ts","../../../../node_modules/rxjs/src/internal/Subscriber.ts","../../../../node_modules/rxjs/src/internal/symbol/observable.ts","../../../../node_modules/rxjs/src/internal/util/identity.ts","../../../../node_modules/rxjs/src/internal/util/pipe.ts","../../../../node_modules/rxjs/src/internal/Observable.ts","../../../../node_modules/rxjs/src/internal/util/lift.ts","../../../../node_modules/rxjs/src/internal/operators/OperatorSubscriber.ts","../../../../node_modules/rxjs/src/internal/util/ObjectUnsubscribedError.ts","../../../../node_modules/rxjs/src/internal/Subject.ts","../../../../node_modules/rxjs/src/internal/BehaviorSubject.ts","../../../../node_modules/rxjs/src/internal/util/isObservable.ts","../../../../node_modules/rxjs/src/internal/operators/filter.ts","../../../../node_modules/rxjs/src/internal/operators/skip.ts","../../src/asPromise.ts","../../src/isSubjectLike.ts","../../src/isSubscriptionLike.ts","../../src/unsubscribeAll.ts","../../src/copyRxSubject.ts","../../src/data-storage/DataStorage.ts","../../src/IntervalSubject.ts","../../src/IntervalRunner.ts"],"names":["isObj","x","strict","isObj_default","isArr","isArr2D","isArrLike","isInteger","isNumber","isPositiveInteger","isPositiveNumber","isEmpty","nonNumerable","fallback","proto","noop","isFn","isFn_default","isMap","isBool","isError","isPromise","isRegExp","isSet","isStr","isSubjectLike","withValue","isSymbol","fallbackIfFails","target","args","result","err","fallbackIfFails_default","objKeys","obj","sorted","includeSymbols","objKeys_default","clone","value","objCopy","input","output","ignoreKeys","override","recursive","_output","_ignoreKeys","inKeys","_key","key","ignoreChildKeys","objCreate","keys","values","i","arrReverse","arr","reverse2","newArray","arrUnique","flatDepth","debounce","callback","delay","config","leading","onError","thisArg","tid","_callback","firstArgs","leadingGlobal","debounce_default","throttle","d","trailing","handleCallback","trailArgs","cbArgs","throttle_default","deferred","options","filter","data","predicate","limit","asArray","_a","item","filter_default","getSize","s","_","getSize_default","getValues","getValues_default","search","ignore","asMap","ignoreCase","matchAll","matchExact","ranked","query","qIsStr","qIsRegExp","qKeys","preRankedResults","dataKey","dataValue","matchIndex","matchObjOrProp","indexes","index","a","b","n","transform","propertyName","_b","global","keyword","propVal","valueStr","search_default","find","optsOrCb","getEntries","map","getKeys","sort","keyOrFn","dataType","asString","newInstance","undefinedFirst","alt","getVal","val","gt","lt","entry","mapJoin","inputs","Promise2","_PromisEBase","_resolve","_reject","superCalled","finalize","fn","resolve","fn2","reject","reason","promise","callbackFn","PromisEBase","PromisEBase_default","sequence","onIgnore","onResult","delay2","ignoreStale","resolveError","resolveIgnored","lastInSeries","lastExecuted","queue","isSequential","handleIgnore","items","iId","iItem","isStale","handleRemaining","currentId","nextId","nextItem","handleItem","currentIndex","id","executeItem","qItem","deferred_default","deferredCallback","deferPromise","deferredCallback_default","duration","asRejected","result2","_result","_result2","delay_default","delayReject","delayReject_default","retry","func","finalized","maxRetries","retryBackOff","retryDelay","retryDelayJitter","retryDelayJitterMax","_retryDelay","retryCount","error","shouldRetry","retry_default","TIMEOUT_FALLBACK","TIMEOUT_MAX","TimeoutPromise","timeout2","_signals","_c","_d","signal","_e","TimeoutPromise_default","timeout","opts","promises","v","dataPromise","timeoutPromise","timeout_default","PromisE","PromisE_default","index_default","extendStatics","p","__extends","__","__values","o","m","__read","r","ar","e","__spreadArray","to","from","pack","l","isFunction","createErrorClass","createImpl","_super","instance","ctorFunc","UnsubscriptionError","errors","arrRemove","Subscription","initialTeardown","_parentage","_parentage_1","_parentage_1_1","parent_1","initialFinalizer","_finalizers","_finalizers_1","_finalizers_1_1","finalizer","execFinalizer","teardown","parent","empty","EMPTY_SUBSCRIPTION","isSubscription","timeoutProvider","handler","_i","handle","reportUnhandledError","errorContext","cb","Subscriber","destination","_this","EMPTY_OBSERVER","next","complete","SafeSubscriber","handleStoppedNotification","ConsumerObserver","partialObserver","handleUnhandledError","observerOrNext","defaultErrorHandler","notification","subscriber","observable","identity","pipeFromArray","fns","prev","Observable","subscribe","operator","isSubscriber","source","sink","promiseCtor","getPromiseCtor","operations","isObserver","hasLift","operate","init","liftedSource","createOperatorSubscriber","onNext","onComplete","onFinalize","OperatorSubscriber","shouldUnsubscribe","closed_1","ObjectUnsubscribedError","Subject","subject","AnonymousSubject","observer","observers","hasError","isStopped","thrownError","BehaviorSubject","_value","subscription","isObservable","skip","count","asPromise","expectedValue","timeoutOrOptions","onTimeout","timeoutMsg","msg","isSubjectLike_default","isSubscriptionLike","sub","isSubscriptionLike_default","unsubscribeAll","unsub","unsubscribeAll_default","IGNORE_UPDATE_SYMBOL","copyRxSubject","source$","copy$","valueModifier","sourceArr","cache","triggerChange","currentValue","modifiedValue","triggerChangeDeferred","subscriptions","newValue","unsubscribeOrg","forceUpdateCache$","DataStorage","name","k","predicateOrOptions","forceRead","wasInitialized","initialValue","refresh","newData","piped","handleChange","dataStr","replace","nameOrComparator","replacer","spacing","str","type","cacheDisabled","delayOptions","onChange","parse","spaces","storage","stringify","IntervalSubject","autoStart","_delay","incrementBy","newDelay","IntervalRunner","taskFn","taskArgs","intervalMs","sequential","preExecute","once","_err","resetRunCount","onBeforeExec","delayMs","newDelayMs","preExec"],"mappings":"uFAcA,IAAIA,CAAAA,CAAQ,CAACC,CAAAA,CAAGC,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A9NnC,IAAAzT,CAAAA,CAAAgC,CAAAA,CA+NE,OAAIyR,CAAAA,GAAe,IAAA,CAAK,QAAA,CAAW,CAAA,CAAA,CAEnC,IAAA,CAAK,OAAA,CAAU,KAAA,CAAA,CACfzR,CAAAA,CAAAA,CAAAhC,CAAAA,CAAA,IAAA,CAAK,YAAA,GAAL,IAAA,CAAA,MAAA,CAAAA,CAAAA,CAAmB,WAAA,GAAnB,IAAA,EAAAgC,CAAAA,CAAA,IAAA,CAAAhC,CAAAA,CAAAA,CAEA,IAAA,CAAK,aAAA,EAAc,CACZ,IACR,CAAA,CAjIC,IAAA,CAAK,WAAA,CACJoT,CAAAA,YAAsBnE,CAAAA,CACnBmE,CAAAA,CACA,IAAInE,CAAAA,CAAgBmE,CAAU,EACnC,CA8HD","file":"index.min.js","sourcesContent":["// src/curry.ts\nfunction curry(func, ...[arity = func.length]) {\n const curriedFn = (...args) => {\n const _args = args;\n if (_args.length >= arity) return func(...args);\n return (...nextArgs) => curriedFn(\n ..._args,\n ...nextArgs\n );\n };\n return curriedFn;\n}\n\n// src/is/isObj.ts\nvar isObj = (x, strict = true) => !!x && typeof x === \"object\" && (!strict || [\n Object.prototype,\n null\n // when an object is created using `Object.create(null)`\n].includes(Object.getPrototypeOf(x)));\nvar isObj_default = isObj;\n\n// src/is/isArr.ts\nvar isArr = (x) => Array.isArray(x);\nvar isArrObj = (x, strict = true) => isArr(x) && x.every((x2) => isObj(x2, strict));\nvar isArr2D = (x) => isArr(x) && x.every(isArr);\nvar isArrLike = (x) => isArr(x) || x instanceof Set || x instanceof Map;\nvar isArrLikeSafe = (x) => [\"[object Array]\", \"[object Map]\", \"[object Set]\"].includes(\n Object.prototype.toString.call(x)\n);\nvar isArrUnique = (x) => isArr(x) && new Set(x).size === x.length;\nvar isUint8Arr = (x) => x instanceof Uint8Array;\nvar isArr_default = isArr;\n\n// src/is/isDate.ts\nvar isDate = (x) => x instanceof Date;\nvar isDateValid = (date) => {\n const dateIsStr = typeof date === \"string\";\n if (!dateIsStr && !isDate(date)) return false;\n const dateObj = new Date(date);\n if (Number.isNaN(dateObj.getTime())) return false;\n if (!dateIsStr) return true;\n const [original, converted] = [date, dateObj.toISOString()].map(\n (y) => y.replace(/[TZ]/g, \"\").substring(0, 10)\n );\n return original === converted;\n};\nvar isDate_default = isDate;\n\n// src/is/isNumber.ts\nvar isInteger = (x) => Number.isInteger(x);\nvar isNegativeInteger = (x) => Number.isInteger(x) && x < 0;\nvar isNegativeNumber = (x) => isNumber(x) && x < 0;\nvar isNumber = (x) => typeof x === \"number\" && !Number.isNaN(x) && Number.isFinite(x);\nvar isPositiveInteger = (x) => isInteger(x) && x > 0;\nvar isPositiveNumber = (x) => isNumber(x) && x > 0;\n\n// src/is/isEmpty.ts\nvar isEmpty = (x, nonNumerable = false, fallback = false) => {\n if (x === null || x === void 0) return true;\n switch (typeof x) {\n case \"number\":\n return !isNumber(x);\n case \"string\":\n return !x.replaceAll(\"\t\", \"\").trim().length;\n case \"boolean\":\n case \"bigint\":\n case \"symbol\":\n case \"function\":\n return false;\n }\n if (x instanceof Date) return Number.isNaN(x.getTime());\n if (x instanceof Map || x instanceof Set) return !x.size;\n if (Array.isArray(x) || x instanceof Uint8Array) return !x.length;\n if (x instanceof Error) return !x.message.length;\n const proto = typeof x === \"object\" && Object.getPrototypeOf(x);\n if (proto === Object.prototype || proto === null) {\n return nonNumerable ? !Object.getOwnPropertyNames(x).length : !Object.keys(x).length;\n }\n return fallback;\n};\nvar isEmptySafe = (x, numberableOnly = false) => {\n const empty = isEmpty(x, numberableOnly, 0);\n if (empty !== 0) return empty;\n switch (Object.prototype.toString.call(x)) {\n case \"[object Uint8Array]\":\n return !x.length;\n case \"[object Date]\":\n return Number.isNaN(x.getTime());\n case \"[object Map]\":\n return !x.size;\n case \"[object Object]\":\n return !Object.keys(x).length;\n case \"[object Set]\":\n return !x.size;\n default:\n return false;\n }\n};\nvar isEmpty_default = isEmpty;\n\n// src/is/isEnv.ts\nvar isEnvBrowser = () => typeof window !== \"undefined\" && typeof (window == null ? void 0 : window.document) !== \"undefined\";\nvar isEnvNode = () => {\n var _a;\n return typeof process !== \"undefined\" && ((_a = process == null ? void 0 : process.versions) == null ? void 0 : _a.node) != null;\n};\nvar isEnvTouchable = () => {\n var _a, _b;\n return typeof window !== \"undefined\" && \"ontouchstart\" in ((_b = (_a = window == null ? void 0 : window.document) == null ? void 0 : _a.documentElement) != null ? _b : {});\n};\n\n// src/noop.ts\nfunction noop() {\n}\nasync function noopAsync() {\n}\n\n// src/is/isFn.ts\nvar isFn = (x) => typeof x === \"function\";\nvar isAsyncFn = (x) => x instanceof noopAsync.constructor && x[Symbol.toStringTag] === \"AsyncFunction\";\nvar isFn_default = isFn;\n\n// src/is/isMap.ts\nvar isMap = (x) => x instanceof Map;\nvar isMapObj = (x, strict = true) => isMap(x) && [...x.values()].every((value) => isObj_default(value, strict));\n\n// src/is/isUrl.ts\nvar isUrl = (x) => x instanceof URL;\nvar isUrlValid = (x, strict = true, tldExceptions = [\"localhost\"]) => {\n if (!x) return false;\n try {\n if (typeof x !== \"string\" && !isUrl(x)) return false;\n const url = isUrl(x) ? x : new URL(x);\n if (!strict) return true;\n const gotTld = tldExceptions.includes(url.hostname) || url.host.split(\".\").length > 1;\n if (!gotTld) return false;\n let y = `${x}`;\n if (y.endsWith(url.hostname)) y += \"/\";\n return url.href === y;\n } catch (_) {\n return false;\n }\n};\nvar isUrl_default = isUrl;\n\n// src/is/index.ts\nvar isBool = (x) => typeof x === \"boolean\" || x instanceof Boolean;\nvar isDefined = (x) => x !== void 0 && x !== null;\nvar isError = (x) => x instanceof Error;\nvar isPromise = (x) => x instanceof Promise;\nvar isRegExp = (x) => x instanceof RegExp;\nvar isSet = (x) => x instanceof Set;\nvar isStr = (x) => typeof x === \"string\";\nvar isSubjectLike = (x, withValue = false) => isObj_default(x, false) && isFn_default(x.subscribe) && isFn_default(x.next) && (!withValue || \"value\" in x);\nvar isSymbol = (x) => typeof x === \"symbol\";\nvar is = {\n arr: isArr_default,\n arr2D: isArr2D,\n arrLike: isArrLike,\n arrLikeSafe: isArrLikeSafe,\n arrObj: isArrObj,\n arrUnique: isArrUnique,\n asyncFn: isAsyncFn,\n bool: isBool,\n date: isDate_default,\n dateValid: isDateValid,\n defined: isDefined,\n empty: isEmpty_default,\n emptySafe: isEmptySafe,\n envBrowser: isEnvBrowser,\n envNode: isEnvNode,\n envTouchable: isEnvTouchable,\n error: isError,\n fn: isFn_default,\n integer: isInteger,\n map: isMap,\n mapObj: isMapObj,\n negativeInteger: isNegativeInteger,\n negativeNumber: isNegativeNumber,\n number: isNumber,\n obj: isObj_default,\n positiveInteger: isPositiveInteger,\n positiveNumber: isPositiveNumber,\n promise: isPromise,\n regExp: isRegExp,\n set: isSet,\n str: isStr,\n subjectLike: isSubjectLike,\n symbol: isSymbol,\n uint8Arr: isUint8Arr,\n url: isUrl_default,\n urlValid: isUrlValid\n};\n\n// src/fallbackIfFails.ts\nvar fallbackIfFails = (target, args, fallback) => {\n try {\n const result = !isFn(target) ? target : target(...isFn(args) ? args() : args);\n if (!isPromise(result)) return result;\n return result.catch(\n (err) => isFn(fallback) ? fallback(err) : fallback\n );\n } catch (err) {\n return isFn(fallback) ? fallback(err) : fallback;\n }\n};\nvar fallbackIfFails_default = fallbackIfFails;\n\n// src/toDatetimeLocal.ts\nvar toDatetimeLocal = (dateStr) => {\n const date = new Date(dateStr);\n if (!isDateValid(date)) return \"\";\n const year = date.getFullYear();\n const month = (date.getMonth() + 1).toString().padStart(2, \"0\");\n const day = date.getDate().toString().padStart(2, \"0\");\n const hours = date.getHours().toString().padStart(2, \"0\");\n const minutes = date.getMinutes().toString().padStart(2, \"0\");\n const res = `${year}-${month}-${day}T${hours}:${minutes}`;\n return res;\n};\n(/* @__PURE__ */ new Date()).getTime();\n\n// src/obj/objClean.ts\nvar objClean = (obj, keys, ignoreIfNotExist = true) => {\n const result = {};\n if (!isObj(obj) || !isArr(keys)) return result;\n const uniqKeys = arrUnique(\n keys.map((x) => String(x).split(\".\")[0])\n ).sort();\n for (const key of uniqKeys) {\n if (ignoreIfNotExist && !obj.hasOwnProperty(key)) continue;\n const value = obj[key];\n if (!isObj(value) || isSymbol(key)) {\n result[key] = value;\n continue;\n }\n const childPrefix = `${key}.`;\n const childKeys = keys.filter((k) => {\n var _a;\n return (_a = k == null ? void 0 : k.startsWith) == null ? void 0 : _a.call(k, childPrefix);\n }).map((k) => k.split(childPrefix)[1]);\n if (!childKeys.length) {\n result[key] = value;\n continue;\n }\n result[key] = objClean(\n value,\n childKeys\n );\n }\n return result;\n};\n\n// src/obj/objKeys.ts\nvar objKeys = (obj, sorted = true, includeSymbols = true) => (\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n fallbackIfFails_default(\n () => [\n ...includeSymbols && Object.getOwnPropertySymbols(obj) || [],\n ...sorted ? Object.keys(obj).sort() : Object.keys(obj)\n ],\n [],\n []\n )\n);\nvar objKeys_default = objKeys;\n\n// src/obj/objCopy.ts\nvar clone = (value, fallback = \"null\") => JSON.parse(fallbackIfFails_default(JSON.stringify, [value], fallback));\nvar objCopy = (input, output, ignoreKeys, override = false, recursive = true) => {\n const _output = isObj(output, false) || isFn(output) ? output : {};\n if (!isObj(input, false) && !isFn(output)) return _output;\n const _ignoreKeys = new Set(ignoreKeys != null ? ignoreKeys : []);\n const inKeys = objKeys_default(input, true, true).filter(\n (x) => !_ignoreKeys.has(x)\n );\n for (const _key of inKeys) {\n const key = _key;\n const value = input[key];\n const skip = _output.hasOwnProperty(key) && (override === \"empty\" ? !isEmpty(_output[key]) : isFn(override) ? !override(key, _output[key], value) : true);\n if (skip) continue;\n const isPrimitive = [void 0, null, Infinity, NaN].includes(value) || !isObj(value, false);\n if (isPrimitive) {\n _output[key] = value;\n continue;\n }\n _output[key] = (() => {\n switch (Object.getPrototypeOf(value)) {\n case Array.prototype:\n return clone(value, \"[]\");\n case ArrayBuffer.prototype:\n return value.slice(0);\n case Date.prototype:\n return new Date(value.getTime());\n case Map.prototype:\n return new Map(\n clone(\n Array.from(\n value\n ),\n \"[]\"\n )\n );\n case RegExp.prototype:\n return new RegExp(value);\n case Set.prototype:\n return new Set(\n clone(Array.from(value))\n );\n case Uint8Array.prototype:\n return new Uint8Array([...value]);\n case URL.prototype:\n return new URL(value);\n default:\n break;\n }\n if (isSymbol(key) || !recursive) return clone(value);\n const ignoreChildKeys = [..._ignoreKeys].map(\n (x) => String(x).startsWith(String(key).concat(\".\")) && String(x).split(String(key).concat(\".\"))[1]\n ).filter(Boolean);\n if (!ignoreChildKeys.length) return clone(value);\n return objCopy(\n value,\n _output[key],\n ignoreChildKeys,\n override,\n recursive\n );\n })();\n }\n return _output;\n};\n\n// src/obj/objCreate.ts\nvar objCreate = (keys = [], values = [], result) => {\n if (!isObj(result)) result = {};\n for (let i = 0; i < (isArr(keys) ? keys : []).length; i++) {\n ;\n result[keys[i]] = values == null ? void 0 : values[i];\n }\n return result;\n};\n\n// src/obj/objHasKeys.ts\nfunction objHasKeys(input = {}, keys = [], requireValue = false) {\n if (!isObj(input) || !isArr(keys)) return false;\n for (const key of keys) {\n if (!input.hasOwnProperty(key)) return false;\n if (requireValue && isEmpty(input[key])) return false;\n }\n return true;\n}\n\n// src/obj/objReadOnly.ts\nvar objReadOnly = (obj, config) => {\n if (!isObj(obj, false)) obj = {};\n const { add, revocable, silent = true } = config != null ? config : {};\n const [typeTitle, keyTitle] = isArr(obj) ? [\"array\", \"index\"] : [\"object\", \"property name\"];\n function handleSetProp(obj2, key, value) {\n const isUpdate = obj2[key] !== void 0;\n if (isUpdate && silent) return true;\n const allowAddition = !isUpdate && (!isFn(add) ? add : add(obj2, key, value));\n const shouldThrow = !silent && (isUpdate || !allowAddition);\n if (shouldThrow)\n throw new TypeError(\n `Mutation not allow on read-only ${typeTitle} ${keyTitle}: ${key.toString()}`\n );\n if (!allowAddition) return true;\n obj2[key] = value;\n return true;\n }\n const proxyHandler = {\n get: (obj2, key) => obj2[key],\n set: handleSetProp,\n defineProperty: (obj2, key, { value }) => handleSetProp(obj2, key, value),\n // Prevent removal of properties\n deleteProperty: (obj2, key) => {\n if (!silent && obj2.hasOwnProperty(key)) {\n throw new Error(\n `Mutation not allow on read-only ${typeTitle} ${keyTitle}: ${key.toString()}`\n );\n }\n return true;\n }\n };\n return revocable ? Proxy.revocable(obj, proxyHandler) : new Proxy(obj, proxyHandler);\n};\n\n// src/obj/objSetProp.ts\nvar objSetProp = (obj, key, falsyValue, condition, truthyValue) => {\n var _a;\n const result = !isObj(obj, false) ? {} : obj;\n falsyValue != null ? falsyValue : falsyValue = result[key];\n condition = isFn(condition) ? condition((_a = result[key]) != null ? _a : falsyValue, key, obj) : condition;\n result[key] = !condition ? falsyValue : truthyValue;\n return result;\n};\nvar objSetPropUndefined = (...[obj, key, ...args]) => (obj == null ? void 0 : obj[key]) === void 0 && objSetProp(obj, key, ...args) || obj;\n\n// src/obj/objSort.ts\nvar objSort = (obj, recursive = true, _done = /* @__PURE__ */ new Map()) => {\n const sorted = {};\n if (!isObj(obj)) return sorted;\n for (const key of objKeys_default(obj)) {\n const value = obj[key];\n _done.set(value, true);\n sorted[key] = !recursive || !isObj(value) ? value : objSort(\n value,\n recursive,\n _done\n );\n }\n return sorted;\n};\n\n// src/obj/objWithoutKeys.ts\nvar objWithoutKeys = (input, keys, output) => {\n if (!isObj(input, false)) return {};\n if (!isArr(keys) || !keys.length) return input;\n output = {\n ...isObj(output, false) && output,\n ...input\n };\n for (const key of keys) delete output[key];\n return output;\n};\n\n// src/arr/arrReadOnly.ts\nvar arrReadOnly = (arr, config = {}) => objReadOnly(new ReadOnlyArrayHelper(config, arr), config);\nvar ReadOnlyArrayHelper = class extends Array {\n constructor(config, arr) {\n var _a;\n (_a = config.silent) != null ? _a : config.silent = true;\n super(...arr);\n this.config = config;\n this.ignoreOrThrow = (returnValue) => {\n if (this.config.silent) return returnValue;\n throw new Error(\"Mutation not allowed on read-only array\");\n };\n this.pop = () => this.ignoreOrThrow(this[this.length - 1]);\n this.push = (...items) => !this.config.add ? this.ignoreOrThrow(this.length) : super.push(...items);\n this.reverse = () => this.ignoreOrThrow(this);\n this.shift = () => this.ignoreOrThrow(this[0]);\n this.splice = (..._ignoredArgs) => this.ignoreOrThrow([]);\n this.unshift = (..._ignoredArgs) => this.ignoreOrThrow(this.length);\n }\n // fromAsync = super.fromAsync\n // reduce = super.reduce\n // reduceRight = super.reduceRight\n};\n\n// src/arr/arrReverse.ts\nvar arrReverse = (arr, reverse2 = true, newArray = false) => {\n if (!isArr(arr)) return [];\n if (newArray) arr = [...arr];\n return reverse2 ? arr.reverse() : arr;\n};\n\n// src/arr/arrToMap.ts\nfunction arrToMap(arr, key, flatDepth = 0) {\n ;\n [key, flatDepth] = isNumber(key) ? [void 0, key] : [key, flatDepth];\n const flatEntries = (!isArr(arr) ? [] : flatDepth > 0 ? arr.flat(flatDepth) : arr).map((item, i, flatArr) => {\n var _a;\n return [\n (_a = isFn(key) ? key(item, i, flatArr) : isObj(item) && isDefined(key) ? item[key] : i) != null ? _a : i,\n item\n ];\n });\n return new Map(flatEntries);\n}\n\n// src/arr/arrUnique.ts\nvar arrUnique = (arr, flatDepth = 0) => !isArr(arr) ? [] : Array.from(new Set(arr.flat(flatDepth)));\n\n// src/deferred/debounce.ts\nvar debounce = (callback, delay = 50, config = {}) => {\n const {\n leading = debounce.defaults.leading,\n onError = debounce.defaults.onError,\n thisArg\n } = config;\n let { tid } = config;\n if (thisArg !== void 0) callback = callback.bind(thisArg);\n const _callback = (...args) => fallbackIfFails_default(callback, args, onError);\n let firstArgs = null;\n const leadingGlobal = leading === \"global\";\n return (...args) => {\n clearTimeout(tid);\n tid = setTimeout(() => {\n firstArgs !== args && _callback(...args);\n firstArgs = leadingGlobal ? true : null;\n }, delay);\n if (!leading || firstArgs) return;\n firstArgs = args;\n _callback(...args);\n };\n};\ndebounce.defaults = {\n /**\n * Set the default value of argument `leading` for the `deferred` function.\n * This change is applicable application-wide and only applies to any new invocation of `deferred()`.\n */\n leading: false,\n /**\n * Set the default value of argument `onError` for the `deferred` function.\n * This change is applicable application-wide and only applies to any new invocation of `deferred()`.\n */\n onError: void 0\n};\nvar debounce_default = debounce;\n\n// src/deferred/throttle.ts\nvar throttle = (callback, delay = 50, config = {}) => {\n const { defaults: d } = throttle;\n const { onError = d.onError, trailing = d.trailing, thisArg } = config;\n let { tid } = config;\n const handleCallback = (...args) => fallbackIfFails_default(\n thisArg !== void 0 ? callback.bind(thisArg) : callback,\n args,\n !isFn(onError) ? void 0 : (err) => fallbackIfFails_default(onError, [err], void 0)\n );\n let trailArgs = null;\n return (...args) => {\n if (tid) {\n trailArgs = args;\n return;\n }\n tid = setTimeout(() => {\n tid = void 0;\n if (!trailing) return;\n const cbArgs = trailArgs;\n trailArgs = null;\n cbArgs && cbArgs !== args && handleCallback(...cbArgs);\n }, delay);\n handleCallback(...args);\n };\n};\nthrottle.defaults = {\n onError: void 0,\n trailing: false\n};\nvar throttled = throttle;\nvar throttle_default = throttle;\n\n// src/deferred/deferred.ts\nvar deferred = (callback, delay = 50, options = {}) => options.throttle ? throttle_default(callback, delay, options) : debounce_default(callback, delay, options);\n\n// src/iterable/filter.ts\nvar filter = (data, predicate, limit, asArray, result) => {\n var _a;\n if (!isMap(result)) result = /* @__PURE__ */ new Map();\n if (!isPositiveInteger(limit)) limit = Infinity;\n for (const [key, item] of ((_a = data == null ? void 0 : data.entries) == null ? void 0 : _a.call(data)) || []) {\n if (result.size >= limit) break;\n fallbackIfFails_default(predicate != null ? predicate : item, [item, key, data], false) && result.set(key, item);\n }\n return asArray ? [...result.values()] : result;\n};\nvar filter_default = filter;\n\n// src/iterable/getSize.ts\nvar getSize = (x) => {\n if (!x) return 0;\n try {\n const s = \"size\" in x ? x.size : \"length\" in x ? x.length : 0;\n return isNumber(s) ? s : 0;\n } catch (_) {\n return 0;\n }\n};\nvar getSize_default = getSize;\n\n// src/iterable/getValues.ts\nvar getValues = (data) => {\n var _a;\n return [\n ...((_a = data == null ? void 0 : data.values) == null ? void 0 : _a.call(data)) || []\n ];\n};\nvar getValues_default = getValues;\n\n// src/iterable/search.ts\nvar search = (data, options) => {\n var _a;\n const ignore = !getSize_default(data) || isEmpty(options == null ? void 0 : options.query);\n const result = isMap(options == null ? void 0 : options.result) ? options.result : /* @__PURE__ */ new Map();\n const asMap = (_a = options == null ? void 0 : options.asMap) != null ? _a : search.defaults.asMap;\n if (ignore) return asMap ? result : getValues_default(result);\n options = objCopy(\n search.defaults,\n options,\n [],\n \"empty\"\n // override `option` property with default value when \"empty\" (undefined, null, '',....)\n );\n const {\n ignoreCase,\n limit = Infinity,\n matchAll,\n matchExact,\n ranked\n } = options;\n let { query } = options;\n const qIsStr = isStr(query);\n const qIsRegExp = isRegExp(query);\n const qKeys = fallbackIfFails_default(Object.keys, [query], []);\n if (ignoreCase && !matchExact && !qIsRegExp) {\n query = qIsStr ? query.toLowerCase() : objCreate(\n qKeys,\n Object.values(query).map(\n (x) => isRegExp(x) ? x : `${x}`.toLowerCase()\n )\n );\n }\n options.query = query;\n if (!ranked) {\n for (const [dataKey, dataValue] of data.entries()) {\n if (result.size >= limit) break;\n const matched = qIsStr || qIsRegExp ? (\n // global search across all properties\n matchObjOrProp(options, dataValue, void 0) >= 0\n ) : (\n // field-specific search\n qKeys[matchAll ? \"every\" : \"some\"](\n (key) => matchObjOrProp(options, dataValue, key) >= 0\n )\n );\n if (!matched) continue;\n result.set(dataKey, dataValue);\n }\n } else {\n const preRankedResults = [];\n for (const [dataKey, dataValue] of data.entries()) {\n let matchIndex = -1;\n if (qIsStr || qIsRegExp) {\n matchIndex = matchObjOrProp(options, dataValue, void 0);\n matchIndex >= 0 && preRankedResults.push([matchIndex, dataKey, dataValue]);\n continue;\n }\n const indexes = [];\n const match = qKeys[matchAll ? \"every\" : \"some\"](\n // field-specific search\n (key) => {\n const index = matchObjOrProp(options, dataValue, key);\n indexes.push(index);\n return index >= 0;\n }\n );\n if (!match) continue;\n matchIndex = // eslint-disable-next-line @typescript-eslint/prefer-find\n indexes.sort((a, b) => a - b).filter((n) => n !== -1)[0];\n matchIndex >= 0 && preRankedResults.push([matchIndex, dataKey, dataValue]);\n }\n preRankedResults.sort((a, b) => a[0] - b[0]).slice(0, limit).forEach(([_, key, value]) => result.set(key, value));\n }\n return asMap ? result : getValues_default(result);\n};\nsearch.defaults = {\n asMap: true,\n ignoreCase: true,\n limit: Infinity,\n matchAll: false,\n ranked: false,\n transform: true\n};\nfunction matchObjOrProp({\n query,\n ignoreCase,\n matchExact,\n transform = true\n}, item, propertyName) {\n var _a, _b;\n const global = isStr(query) || isRegExp(query) || propertyName === void 0;\n const keyword = global ? query : query[propertyName];\n const propVal = global || !isObj(item) ? item : item[propertyName];\n const value = fallbackIfFails_default(\n () => isFn(transform) ? transform(\n item,\n global ? void 0 : propVal,\n propertyName\n ) : matchExact && transform === false ? propVal : isObj(propVal, false) ? JSON.stringify(\n isArrLike(propVal) ? [...propVal.values()] : Object.values(propVal)\n ) : String(propVal != null ? propVal : \"\"),\n [],\n \"\"\n );\n if (value === keyword) return 0;\n if (matchExact && !isRegExp(keyword)) return -1;\n let valueStr = String(value);\n if (!valueStr.trim()) return -1;\n if (isRegExp(keyword)) return (_b = (_a = valueStr.match(keyword)) == null ? void 0 : _a.index) != null ? _b : -1;\n if (ignoreCase) valueStr = valueStr.toLowerCase();\n return valueStr.indexOf(String(keyword));\n}\nvar search_default = search;\n\n// src/iterable/find.ts\nfunction find(data, optsOrCb) {\n const result = isFn(optsOrCb) ? filter_default(data, optsOrCb, 1) : search_default(data, { ...optsOrCb, asMap: true, limit: 1 });\n return result[\n (optsOrCb == null ? void 0 : optsOrCb.includeKey) ? \"entries\" : \"values\"\n // returns: value\n ]().next().value;\n}\n\n// src/iterable/getEntries.ts\nvar getEntries = (map) => {\n var _a;\n return [\n ...((_a = map == null ? void 0 : map.entries) == null ? void 0 : _a.call(map)) || []\n ];\n};\n\n// src/iterable/getKeys.ts\nvar getKeys = (data) => {\n var _a;\n return [\n ...((_a = data == null ? void 0 : data.keys) == null ? void 0 : _a.call(data)) || []\n ];\n};\n\n// src/iterable/reverse.ts\nvar reverse = (data, reverse2 = true, newInstance = false) => {\n var _a, _b, _c;\n const dataType = isArr(data) ? 1 : isMap(data) ? 2 : isSet(data) ? 3 : 0;\n if (!dataType) return [];\n const arr = dataType === 1 ? !newInstance ? data : [...data] : dataType === 2 ? [...data.entries()] : [...data.values()];\n if (reverse2) arr.reverse();\n switch (dataType) {\n case 1:\n return arr;\n case 2:\n case 3:\n if (newInstance || !(\"clear\" in data && isFn(data.clear)))\n return dataType === 2 ? new Map(arr) : new Set(arr);\n }\n (_a = data == null ? void 0 : data.clear) == null ? void 0 : _a.call(data);\n for (const item of arr)\n \"set\" in data ? (_b = data.set) == null ? void 0 : _b.call(data, ...item) : \"add\" in data && ((_c = data == null ? void 0 : data.add) == null ? void 0 : _c.call(data, item));\n return data;\n};\n\n// src/iterable/sliceMap.ts\nvar sliceMap = (data, options) => {\n var _a;\n const {\n asMap = false,\n end,\n start = 0,\n transform,\n ignoreEmpty = true\n } = isFn(options) ? { transform: options } : isObj(options) ? options : {};\n const result = /* @__PURE__ */ new Map();\n const subset = [...((_a = data == null ? void 0 : data.entries) == null ? void 0 : _a.call(data)) || []].slice(start, end);\n for (const [_, [key, value]] of subset.entries()) {\n if (ignoreEmpty && isEmpty(value)) continue;\n const newValue = fallbackIfFails_default(\n transform != null ? transform : value,\n [value, key, data],\n void 0\n );\n newValue !== void 0 && result.set(key, newValue);\n }\n return asMap ? result : [...result.values()];\n};\n\n// src/iterable/sort.ts\nfunction sort(data, keyOrFn, options) {\n const dataType = isArr(data) ? 1 : isMap(data) ? 2 : isSet(data) ? 3 : 0;\n if (!dataType) return data;\n const { asString, ignoreCase, newInstance, reverse: reverse2, undefinedFirst } = {\n ...sort.defaults,\n ...isObj(options) ? options : isObj(keyOrFn) ? keyOrFn : {}\n };\n if (dataType === 1 && isFn(keyOrFn)) {\n return arrReverse(\n data.sort(keyOrFn),\n // use provided comparator function\n reverse2,\n newInstance\n );\n }\n const alt = asString ? undefinedFirst ? \"\" : \"Z\".repeat(10) : undefinedFirst ? -Infinity : Infinity;\n const sorted = isFn(keyOrFn) ? arrReverse(\n // handle Set with comparator function\n [...data.entries()].sort(keyOrFn),\n reverse2,\n false\n // not required because of entries() & spread\n ) : (() => {\n let index = 1;\n const getVal = (target) => {\n const val = isObj(target) && index !== 0 ? target[keyOrFn] : target;\n if (!asString) return val;\n const value = `${val != null ? val : alt}`;\n return ignoreCase ? value.toLowerCase() : value;\n };\n const [gt, lt] = reverse2 ? [-1, 1] : [1, -1];\n if ([1, 3].includes(dataType)) {\n return (dataType === 3 || newInstance ? [...data] : data).sort((a, b) => getVal(a) > getVal(b) ? gt : lt);\n }\n index = keyOrFn === true ? 0 : 1;\n return [...data.entries()].sort(\n (a, b) => getVal(a == null ? void 0 : a[index]) > getVal(b == null ? void 0 : b[index]) ? gt : lt\n );\n })();\n if (dataType === 1) return sorted;\n if (newInstance) {\n return dataType === 2 ? new Map(sorted) : new Set(sorted);\n }\n ;\n data.clear();\n for (const entry of sorted)\n dataType === 2 ? data.set(...entry) : data.add(entry);\n return data;\n}\nsort.defaults = {\n asString: true,\n ignoreCase: true,\n newInstance: false,\n reverse: false,\n undefinedFirst: false\n};\n\n// src/map/mapJoin.ts\nvar mapJoin = (...inputs) => {\n var _a;\n return new Map(\n (_a = inputs == null ? void 0 : inputs.flatMap) == null ? void 0 : _a.call(\n inputs,\n (input) => isMap(input) ? Array.from(input.entries()) : isArr2D(input) ? input : []\n )\n );\n};\n\n// src/number/randomInt.ts\nvar randomInt = (min = 0, max = Number.MAX_SAFE_INTEGER) => parseInt(`${Math.random() * (max - min) + min}`);\n\n// src/str/clearClutter.ts\nvar clearClutter = (text, lineSeparator = \" \") => `${text}`.split(\"\\n\").map((ln) => ln.trim()).filter(Boolean).join(lineSeparator);\n\n// src/str/copyToClipboard.ts\nvar copyToClipboard = (str) => fallbackIfFails(\n // First attempt: modern clipboard API\n () => navigator.clipboard.writeText(str).then(() => 1),\n [],\n // If clipboard API is not available or fails, use the fallback method\n () => Promise.resolve(copyLegacy(str) ? 2 : 0)\n);\nvar copyLegacy = (str) => fallbackIfFails(\n () => {\n const el = document.createElement(\"textarea\");\n el.value = str;\n el.setAttribute(\"readonly\", \"\");\n el.style.position = \"absolute\";\n el.style.left = \"-9999px\";\n document.body.appendChild(el);\n el.select();\n const success = document.execCommand(\"copy\");\n document.body.removeChild(el);\n return success;\n },\n [],\n false\n // On error, return false\n);\n\n// src/str/getUrlParam.ts\nvar getUrlParam = (name, url, asArray) => {\n var _a;\n url != null ? url : url = fallbackIfFails_default(() => window.location.href, [], \"\");\n const _asArray = isArr(asArray) ? asArray : asArray === true && isStr(name) ? [name] : [];\n const prepareResult = (value = \"\", values = {}) => name ? isArr(value) || !_asArray.includes(name) ? value : [value].filter(Boolean) : values;\n if (!url) return prepareResult();\n if (typeof URLSearchParams === \"undefined\" || !URLSearchParams) {\n const r = getUrlParamRegex(name, url, _asArray);\n return prepareResult(r, r);\n }\n const search2 = isUrl(url) ? url.search : ((_a = url.split(\"?\")) == null ? void 0 : _a[1]) || \"\";\n if (search2 === \"?\" || !search2) return prepareResult();\n const params = new URLSearchParams(search2);\n const getValue = (paramName) => {\n const value = arrUnique(params.getAll(paramName));\n return value.length > 1 || _asArray.includes(paramName) ? value : value[0];\n };\n if (name) return prepareResult(getValue(name));\n const result = {};\n for (const name2 of arrUnique([...params.keys()])) {\n result[name2] = getValue(name2);\n }\n return result;\n};\nvar getUrlParamRegex = (name, url, asArray = []) => {\n url != null ? url : url = fallbackIfFails_default(() => window.location.href, [], \"\");\n if (isUrl(url)) url = url.toString();\n const params = {};\n const regex = /[?&]+([^=&]+)=([^&]*)/gi;\n url == null ? void 0 : url.replace(regex, (_, name2, value) => {\n value = decodeURIComponent(value);\n if (asArray.includes(name2) || params[name2] !== void 0) {\n params[name2] = isArr(params[name2]) ? params[name2] : [params[name2]];\n params[name2] = arrUnique([...params[name2], value]).filter(Boolean);\n } else {\n params[name2] = value;\n }\n return \"\";\n });\n return name ? params[name] : params;\n};\n\n// src/str/regex.ts\nvar EMAIL_REGEX = new RegExp(\n /^((\"[\\w-\\s]+\")|([\\w-]+(?:\\.[\\w-]+)*)|(\"[\\w-\\s]+\")([\\w-]+(?:\\.[\\w-]+)*))(@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,9}(?:\\.[a-z]{2})?)$)|(@\\[?((25[0-5]\\.|2[0-4][0-9]\\.|1[0-9]{2}\\.|[0-9]{1,2}\\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\\]?$)/i\n);\nvar HEX_REGEX = /^0x[0-9a-f]+$/i;\nvar HASH_REGEX = /^0x[0-9a-f]{64}$/i;\n\n// src/str/strToArr.ts\nvar strToArr = (value, seperator = \",\") => typeof value === \"string\" && value.split(seperator).filter(Boolean) || [];\nexport {\n EMAIL_REGEX,\n HASH_REGEX,\n HEX_REGEX,\n ReadOnlyArrayHelper,\n arrReadOnly,\n arrReverse,\n arrToMap,\n arrUnique,\n clearClutter,\n copyToClipboard,\n curry,\n debounce,\n deferred,\n fallbackIfFails,\n filter,\n find,\n getEntries,\n getKeys,\n getSize,\n getUrlParam,\n getValues,\n is,\n isArr,\n isArr2D,\n isArrLike,\n isArrLikeSafe,\n isArrObj,\n isArrUnique,\n isAsyncFn,\n isBool,\n isDate,\n isDateValid,\n isDefined,\n isEmpty,\n isEmptySafe,\n isEnvBrowser,\n isEnvNode,\n isEnvTouchable,\n isError,\n isFn,\n isInteger,\n isMap,\n isMapObj,\n isNegativeInteger,\n isNegativeNumber,\n isNumber,\n isObj,\n isPositiveInteger,\n isPositiveNumber,\n isPromise,\n isRegExp,\n isSet,\n isStr,\n isSubjectLike,\n isSymbol,\n isUint8Arr,\n isUrl,\n isUrlValid,\n mapJoin,\n matchObjOrProp,\n noop,\n noopAsync,\n objClean,\n objCopy,\n objCreate,\n objHasKeys,\n objKeys,\n objReadOnly,\n objSetProp,\n objSetPropUndefined,\n objSort,\n objWithoutKeys,\n randomInt,\n reverse,\n search,\n sliceMap,\n sort,\n strToArr,\n throttle,\n throttled,\n toDatetimeLocal\n};\n","// src/deferred.ts\nimport {\n deferred as deferredSync,\n fallbackIfFails as fallbackIfFails2,\n isFn as isFn2,\n isPositiveNumber,\n objCopy\n} from \"@superutils/core\";\n\n// src/PromisEBase.ts\nimport { fallbackIfFails, isFn, isPromise } from \"@superutils/core\";\nvar Promise2 = globalThis.Promise;\nvar _PromisEBase = class _PromisEBase extends Promise2 {\n constructor(input) {\n let _resolve;\n let _reject;\n let superCalled = false;\n const finalize = (fn, resolve = true, value) => {\n if (!superCalled)\n return queueMicrotask(() => finalize(fn, resolve, value));\n fn(value);\n this._state = resolve ? 1 : 2;\n this.onFinalize.forEach(\n (fn2) => fallbackIfFails(\n fn2,\n resolve ? [value] : [void 0, value],\n void 0\n )\n );\n };\n super((resolve, reject) => {\n _reject = (reason) => finalize(reject, false, reason);\n _resolve = (value) => finalize(resolve, true, value);\n if (isFn(input)) {\n fallbackIfFails(input, [_resolve, _reject], _reject);\n } else if (isPromise(input)) {\n input.then(_resolve, _reject);\n } else if (input !== void 0) {\n _resolve(input);\n }\n });\n this._state = 0;\n /**\n * callbacks to be invoked whenever PromisE instance is finalized early using non-static resolve()/reject() methods */\n this.onEarlyFinalize = [];\n this.onFinalize = [];\n //\n //\n // --------------------------- Early resolve/reject ---------------------------\n //\n //\n /** Resovle pending promise early. */\n this.resolve = (value) => {\n var _a, _b;\n if (!this.pending) return;\n (_a = this._resolve) == null ? void 0 : _a.call(this, value);\n (_b = this.onEarlyFinalize) == null ? void 0 : _b.forEach((fn) => {\n fallbackIfFails(fn, [true, value], void 0);\n });\n };\n /** Reject pending promise early. */\n this.reject = (reason) => {\n var _a, _b;\n if (!this.pending) return;\n (_a = this._reject) == null ? void 0 : _a.call(this, reason);\n (_b = this.onEarlyFinalize) == null ? void 0 : _b.forEach((fn) => {\n fallbackIfFails(fn, [false, reason], void 0);\n });\n };\n superCalled = true;\n this._resolve = _resolve;\n this._reject = _reject;\n }\n //\n //\n //-------------------- Status related read-only attributes --------------------\n //\n //\n /** Indicates if the promise is still pending/unfinalized */\n get pending() {\n return this.state === 0;\n }\n /** Indicates if the promise has been rejected */\n get rejected() {\n return this.state === 2;\n }\n /** Indicates if the promise has been resolved */\n get resolved() {\n return this.state === 1;\n }\n /**\n * Get promise status code:\n *\n * - `0` = pending\n * - `1` = resolved\n * - `2` = rejected\n */\n get state() {\n return this._state;\n }\n};\n//\n//\n// Extend all static `Promise` methods\n//\n//\n/** Sugar for `new PromisE(Promise.all(...))` */\n_PromisEBase.all = (values) => new _PromisEBase(Promise2.all(values));\n/** Sugar for `new PromisE(Promise.allSettled(...))` */\n_PromisEBase.allSettled = (values) => new _PromisEBase(Promise2.allSettled(values));\n/** Sugar for `new PromisE(Promise.any(...))` */\n_PromisEBase.any = (values) => new _PromisEBase(Promise2.any(values));\n/** Sugar for `new PromisE(Promise.race(..))` */\n_PromisEBase.race = (values) => new _PromisEBase(Promise2.race(values));\n/** Extends Promise.reject */\n_PromisEBase.reject = (reason) => {\n const promise = new _PromisEBase();\n queueMicrotask(() => promise.reject(reason));\n return promise;\n};\n/** Sugar for `new PromisE(Promise.resolve(...))` */\n_PromisEBase.resolve = (value) => new _PromisEBase(Promise2.resolve(value));\n/** Sugar for `new PromisE(Promise.try(...))` */\n_PromisEBase.try = (callbackFn, ...args) => (\n // Promise.try is not supported in Node < 23.\n new _PromisEBase(\n fallbackIfFails(\n callbackFn,\n args,\n // rethrow error to ensure the returned promise is rejected\n (err) => _PromisEBase.reject(err)\n )\n )\n);\n/**\n * Creates a `PromisE` instance and returns it in an object, along with its `resolve` and `reject` functions.\n *\n * NB: this function is technically no longer needed because the `PromisE` class already comes with the resolvers.\n *\n * ---\n * @example\n * Using `PromisE` directly: simply provide an empty function as the executor\n *\n * ```typescript\n * import PromisE from '@superutils/promise'\n * const promisE = new PromisE<number>(() => {})\n * setTimeout(() => promisE.resolve(1), 1000)\n * promisE.then(console.log)\n * ```\n *\n * @example\n * Using `withResolvers`\n * ```typescript\n * import PromisE from '@superutils/promise'\n * const pwr = PromisE.withResolvers<number>()\n * setTimeout(() => pwr.resolve(1), 1000)\n * pwr.promise.then(console.log)\n * ```\n */\n_PromisEBase.withResolvers = () => {\n const promise = new _PromisEBase();\n return { promise, reject: promise.reject, resolve: promise.resolve };\n};\nvar PromisEBase = _PromisEBase;\nvar PromisEBase_default = PromisEBase;\n\n// src/types/deferred.ts\nvar ResolveError = /* @__PURE__ */ ((ResolveError2) => {\n ResolveError2[\"NEVER\"] = \"NEVER\";\n ResolveError2[\"REJECT\"] = \"REJECT\";\n ResolveError2[\"WITH_ERROR\"] = \"RESOLVE_ERROR\";\n ResolveError2[\"WITH_UNDEFINED\"] = \"RESOLVE_UNDEFINED\";\n return ResolveError2;\n})(ResolveError || {});\nvar ResolveIgnored = /* @__PURE__ */ ((ResolveIgnored2) => {\n ResolveIgnored2[\"NEVER\"] = \"NEVER\";\n ResolveIgnored2[\"WITH_LAST\"] = \"WITH_LAST\";\n ResolveIgnored2[\"WITH_UNDEFINED\"] = \"WITH_UNDEFINED\";\n return ResolveIgnored2;\n})(ResolveIgnored || {});\n\n// src/deferred.ts\nfunction deferred(options = {}) {\n let sequence = 0;\n options = objCopy(\n deferred.defaults,\n options,\n [],\n \"empty\"\n );\n let { onError, onIgnore, onResult } = options;\n const {\n delay: delay2 = 0,\n ignoreStale,\n resolveError,\n resolveIgnored,\n thisArg,\n throttle\n } = options;\n let lastInSeries = null;\n let lastExecuted;\n const queue = /* @__PURE__ */ new Map();\n const isSequential = !isPositiveNumber(delay2);\n if (thisArg !== void 0) {\n onError = onError == null ? void 0 : onError.bind(thisArg);\n onIgnore = onIgnore == null ? void 0 : onIgnore.bind(thisArg);\n onResult = onResult == null ? void 0 : onResult.bind(thisArg);\n }\n const handleIgnore = (items) => {\n for (const [iId, iItem] of items) {\n queue.delete(iId);\n const isStale = ignoreStale && iItem.sequence < lastExecuted.sequence;\n if (iItem.resolved || iItem.started && !isStale) continue;\n if (iItem.started) {\n iItem.getPromise = (() => iItem.result);\n }\n fallbackIfFails2(onIgnore, [iItem.getPromise], 0);\n switch (resolveIgnored) {\n case \"WITH_UNDEFINED\" /* WITH_UNDEFINED */:\n iItem.resolve(void 0);\n break;\n case \"WITH_LAST\" /* WITH_LAST */:\n lastExecuted == null ? void 0 : lastExecuted.then(iItem.resolve, iItem.reject);\n break;\n case \"NEVER\" /* NEVER */:\n break;\n }\n }\n if (!queue.size) sequence = 0;\n };\n const handleRemaining = (currentId) => {\n lastInSeries = null;\n if (isSequential) {\n queue.delete(currentId);\n const [nextId, nextItem] = [...queue.entries()][0] || [];\n return nextId && nextItem && handleItem(nextId, nextItem);\n }\n let items = [...queue.entries()];\n if (throttle === true && options.trailing) {\n const currentIndex = items.findIndex(([id]) => id === currentId);\n items = items.slice(0, currentIndex);\n } else if (!throttle) {\n items = items.slice(0, -1);\n }\n handleIgnore(items);\n queue.delete(currentId);\n };\n const executeItem = async (id, qItem) => {\n var _a;\n try {\n qItem.started = true;\n lastExecuted = qItem;\n lastInSeries = qItem;\n (_a = qItem.result) != null ? _a : qItem.result = PromisEBase_default.try(qItem.getPromise);\n const result = await qItem.result;\n const isStale = !!ignoreStale && qItem.sequence < lastExecuted.sequence;\n if (isStale) return handleIgnore([[id, qItem]]);\n qItem.resolve(result);\n onResult && fallbackIfFails2(onResult, [result], void 0);\n } catch (err) {\n onError && fallbackIfFails2(onError, [err], void 0);\n switch (resolveError) {\n case \"REJECT\" /* REJECT */:\n qItem.reject(err);\n // eslint-disable-next-line no-fallthrough\n case \"NEVER\" /* NEVER */:\n break;\n case \"RESOLVE_UNDEFINED\" /* WITH_UNDEFINED */:\n qItem.resolve(void 0);\n break;\n case \"RESOLVE_ERROR\" /* WITH_ERROR */:\n qItem.resolve(err);\n break;\n }\n }\n handleRemaining(id);\n };\n const handleItem = isSequential ? executeItem : deferredSync(\n executeItem,\n delay2,\n options\n );\n return (promise) => {\n const id = /* @__PURE__ */ Symbol(\"deferred-queue-item-id\");\n const qItem = new PromisEBase_default();\n qItem.getPromise = isFn2(promise) ? promise : () => promise;\n qItem.started = false;\n qItem.sequence = ++sequence;\n queue.set(id, qItem);\n if (!lastInSeries || !isSequential) handleItem(id, qItem);\n return qItem;\n };\n}\ndeferred.defaults = {\n /**\n * Default delay in milliseconds, used in `debounce` and `throttle` modes.\n *\n * Use `0` (or negative number) to disable debounce/throttle and execute all operations sequentially.\n */\n delay: 100,\n /** Set the default error resolution behavior. {@link ResolveError} for all options. */\n resolveError: \"REJECT\" /* REJECT */,\n /** Set the default ignored resolution behavior. See {@link ResolveIgnored} for all options. */\n resolveIgnored: \"WITH_LAST\" /* WITH_LAST */\n};\nvar deferred_default = deferred;\n\n// src/deferredCallback.ts\nfunction deferredCallback(callback, options = {}) {\n const { thisArg } = options;\n if (thisArg !== void 0) callback = callback.bind(thisArg);\n const deferPromise = deferred_default(options);\n return (...args) => deferPromise(() => callback(...args));\n}\nvar deferredCallback_default = deferredCallback;\n\n// src/delay.ts\nimport { fallbackIfFails as fallbackIfFails3, isFn as isFn3 } from \"@superutils/core\";\nfunction delay(duration = delay.defaults.duration, result, asRejected = false) {\n const promise = new PromisEBase_default();\n const finalize = (result2) => {\n const _result = fallbackIfFails3(\n async () => {\n const _result2 = await (isFn3(result2) ? result2() : result2);\n return !asRejected ? _result2 != null ? _result2 : duration : _result2 != null ? _result2 : new Error(\n `${delay.defaults.delayTimeoutMsg} ${duration}ms`\n );\n },\n [],\n // when result is a function and it fails/rejects,\n // promise will reject even if `asRejected = false`\n (err) => Promise.reject(err)\n );\n !asRejected ? promise.resolve(_result) : _result.then(promise.reject, promise.reject);\n };\n promise.timeoutId = setTimeout(() => finalize(result), duration);\n promise.pause = () => clearTimeout(promise.timeoutId);\n promise.catch(() => {\n }).finally(() => promise.pause());\n promise.onEarlyFinalize.push(() => promise.pause());\n return promise;\n}\ndelay.defaults = {\n /** Default delay duration in milliseconds */\n duration: 100,\n /** Default timed out message (if `result` is not provided) */\n delayTimeoutMsg: \"Timed out after\"\n};\nvar delay_default = delay;\n\n// src/delayReject.ts\nfunction delayReject(duration, reason) {\n return delay_default(duration, reason, true);\n}\nvar delayReject_default = delayReject;\n\n// src/retry.ts\nimport {\n fallbackIfFails as fallbackIfFails4,\n isEmpty,\n isPositiveInteger,\n objCopy as objCopy2\n} from \"@superutils/core\";\nvar retry = (func, options) => {\n let finalized = false;\n const promise = PromisEBase_default.try(async () => {\n var _a, _b;\n options = objCopy2(retry.defaults, options != null ? options : {}, [], (key, value) => {\n switch (key) {\n // case 'retryDelayJitter':\n // \treturn true\n case \"retry\":\n // eslint-disable-next-line no-fallthrough\n case \"retryDelay\":\n case \"retryDelayJitterMax\":\n return value !== 0 && !isPositiveInteger(value);\n }\n return !!isEmpty(value);\n });\n const {\n retry: maxRetries,\n retryBackOff,\n retryDelay,\n retryDelayJitter,\n retryDelayJitterMax\n } = options;\n let _retryDelay = retryDelay;\n let retryCount = -1;\n let result;\n let error;\n let shouldRetry = false;\n do {\n retryCount++;\n if (retryBackOff === \"exponential\" && retryCount > 1)\n _retryDelay *= 2;\n if (retryDelayJitter)\n _retryDelay += Math.floor(Math.random() * retryDelayJitterMax);\n if (!finalized && retryCount > 0) await delay_default(_retryDelay);\n if (!finalized) {\n try {\n error = void 0;\n result = await func();\n } catch (err) {\n error = err != null ? err : new Error(err);\n }\n }\n if (finalized || maxRetries === 0 || retryCount >= maxRetries) break;\n shouldRetry = !!((_b = await fallbackIfFails4(\n (_a = options.retryIf) != null ? _a : error,\n // if `retryIf` not provided, retry on error\n [result, retryCount, error],\n error\n // if `retryIf` throws error, default to retry on error\n )) != null ? _b : error);\n } while (shouldRetry);\n if (error !== void 0) return Promise.reject(error);\n return result;\n });\n promise.onEarlyFinalize.push(() => {\n finalized = true;\n });\n return promise;\n};\nretry.defaults = {\n retry: 1,\n retryBackOff: \"exponential\",\n retryDelay: 300,\n retryDelayJitter: true,\n retryDelayJitterMax: 100\n};\nvar retry_default = retry;\n\n// src/timeout.ts\nimport {\n arrUnique as arrUnique2,\n isFn as isFn4,\n isNumber,\n isObj as isObj2,\n isPositiveNumber as isPositiveNumber2,\n objCopy as objCopy3\n} from \"@superutils/core\";\n\n// src/TimeoutPromise.ts\nimport { arrUnique, fallbackIfFails as fallbackIfFails5, isObj } from \"@superutils/core\";\nvar TIMEOUT_FALLBACK = 1e4;\nvar TIMEOUT_MAX = 2147483647;\nvar TimeoutPromise = class extends PromisEBase_default {\n constructor(data, timeout2, options, _signals) {\n super(data);\n this.started = /* @__PURE__ */ new Date();\n this._setup = () => {\n var _a, _b, _c, _d;\n this._signals = arrUnique(\n [(_b = (_a = this.options) == null ? void 0 : _a.abortCtrl) == null ? void 0 : _b.signal, (_c = this.options) == null ? void 0 : _c.signal].filter(\n Boolean\n )\n );\n !this.onEarlyFinalize.includes(this._handleEarlyFinalize) && this.onEarlyFinalize.push(this._handleEarlyFinalize);\n !this.onFinalize.includes(this._handleFinalize) && this.onFinalize.push(this._handleFinalize);\n (_d = this._signals) == null ? void 0 : _d.forEach(\n (signal) => signal == null ? void 0 : signal.addEventListener(\n \"abort\",\n this._handleAbort\n )\n );\n };\n this._handleAbort = async () => {\n var _a, _b;\n let err = await fallbackIfFails5((_a = this.options) == null ? void 0 : _a.onAbort, [], void 0);\n err != null ? err : err = new Error(\n `Aborted after ${(/* @__PURE__ */ new Date()).getTime() - this.started.getTime()}ms`\n );\n (_b = err.name) != null ? _b : err.name = \"AbortError\";\n this.reject(err);\n };\n this._handleEarlyFinalize = () => {\n var _a, _b, _c, _d;\n ((_a = this.options) == null ? void 0 : _a.abortOnEarlyFinalize) && ((_d = (_c = (_b = this.options) == null ? void 0 : _b.abortCtrl) == null ? void 0 : _c.abort) == null ? void 0 : _d.call(_c));\n };\n // cleanup after execution\n this._handleFinalize = ((_, err) => {\n var _a, _b, _c, _d, _e;\n this.cancelAbort();\n this.clearTimeout();\n if (!this.timeout.rejected && !((_a = this._signals) == null ? void 0 : _a.find((x) => x == null ? void 0 : x.aborted)))\n return;\n ((_d = (_c = (_b = this.options) == null ? void 0 : _b.abortCtrl) == null ? void 0 : _c.signal) == null ? void 0 : _d.aborted) === false && ((_e = this.options) == null ? void 0 : _e.abortCtrl.abort(err));\n });\n this.data = data;\n this.options = isObj(options) ? options : {};\n this.timeout = timeout2;\n this._signals = _signals;\n this._setup();\n }\n get abortCtrl() {\n return this.options.abortCtrl;\n }\n get aborted() {\n var _a;\n return this.rejected && !this.timeout.rejected && !!((_a = this._signals) == null ? void 0 : _a.find((s) => s == null ? void 0 : s.aborted));\n }\n cancelAbort() {\n var _a;\n (_a = this._signals) == null ? void 0 : _a.forEach(\n (signal) => signal == null ? void 0 : signal.removeEventListener(\n \"abort\",\n this._handleAbort\n )\n );\n }\n clearTimeout() {\n clearTimeout(this.timeout.timeoutId);\n }\n get timedout() {\n return this.rejected && this.timeout.rejected;\n }\n};\nvar TimeoutPromise_default = TimeoutPromise;\n\n// src/timeout.ts\nfunction timeout(options, ...values) {\n var _a;\n const opts = objCopy3(\n timeout.defaults,\n isNumber(options) ? { timeout: options } : isObj2(options) ? options : {},\n [],\n \"empty\"\n );\n opts.timeout = Math.min(\n isPositiveNumber2(opts.timeout) ? opts.timeout : TIMEOUT_FALLBACK,\n TIMEOUT_MAX\n );\n const promises = values.map(\n (v) => isFn4(v) ? PromisEBase_default.try(v) : v\n );\n const dataPromise = promises.length <= 1 ? (\n // single promise resolves to a single result\n promises[0] instanceof PromisEBase_default ? promises[0] : new PromisEBase_default(promises[0])\n ) : (\n // multiple promises resolve to an array of results\n (isFn4(PromisEBase_default[opts.batchFunc]) ? PromisEBase_default[opts.batchFunc] : PromisEBase_default.all)(promises)\n );\n const timeoutPromise = delayReject_default(opts.timeout, opts.onTimeout);\n return new TimeoutPromise_default(\n PromisEBase_default.race([dataPromise, timeoutPromise]),\n timeoutPromise,\n opts,\n arrUnique2(\n [(_a = opts.abortCtrl) == null ? void 0 : _a.signal, opts.signal].filter(Boolean)\n )\n );\n}\ntimeout.defaults = {\n abortOnEarlyFinalize: true,\n batchFunc: \"all\",\n timeout: TIMEOUT_FALLBACK\n};\nvar timeout_default = timeout;\n\n// src/PromisE.ts\nvar PromisE = class extends PromisEBase_default {\n};\nPromisE.deferred = deferred_default;\nPromisE.deferredCallback = deferredCallback_default;\nPromisE.delay = delay_default;\nPromisE.delayReject = delayReject_default;\nPromisE.retry = retry_default;\nPromisE.timeout = timeout_default;\nvar PromisE_default = PromisE;\n\n// src/index.ts\nvar index_default = PromisE_default;\nexport {\n PromisE,\n PromisEBase,\n ResolveError,\n ResolveIgnored,\n TIMEOUT_FALLBACK,\n TIMEOUT_MAX,\n TimeoutPromise,\n index_default as default,\n deferred,\n deferredCallback,\n delay,\n delayReject,\n retry,\n timeout\n};\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\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;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\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);\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); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","/**\n * Returns true if the object is a function.\n * @param value The value to check\n */\nexport function isFunction(value: any): value is (...args: any[]) => any {\n return typeof value === 'function';\n}\n","/**\n * Used to create Error subclasses until the community moves away from ES5.\n *\n * This is because compiling from TypeScript down to ES5 has issues with subclassing Errors\n * as well as other built-in types: https://github.com/Microsoft/TypeScript/issues/12123\n *\n * @param createImpl A factory function to create the actual constructor implementation. The returned\n * function should be a named function that calls `_super` internally.\n */\nexport function createErrorClass<T>(createImpl: (_super: any) => any): T {\n const _super = (instance: any) => {\n Error.call(instance);\n instance.stack = new Error().stack;\n };\n\n const ctorFunc = createImpl(_super);\n ctorFunc.prototype = Object.create(Error.prototype);\n ctorFunc.prototype.constructor = ctorFunc;\n return ctorFunc;\n}\n","import { createErrorClass } from './createErrorClass';\n\nexport interface UnsubscriptionError extends Error {\n readonly errors: any[];\n}\n\nexport interface UnsubscriptionErrorCtor {\n /**\n * @deprecated Internal implementation detail. Do not construct error instances.\n * Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269\n */\n new (errors: any[]): UnsubscriptionError;\n}\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 = createErrorClass(\n (_super) =>\n function UnsubscriptionErrorImpl(this: any, errors: (Error | string)[]) {\n _super(this);\n this.message = errors\n ? `${errors.length} errors occurred during unsubscription:\n${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\\n ')}`\n : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n }\n);\n","/**\n * Removes an item from an array, mutating it.\n * @param arr The array to remove the item from\n * @param item The item to remove\n */\nexport function arrRemove<T>(arr: T[] | undefined | null, item: T) {\n if (arr) {\n const index = arr.indexOf(item);\n 0 <= index && arr.splice(index, 1);\n }\n}\n","import { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { SubscriptionLike, TeardownLogic, Unsubscribable } from './types';\nimport { arrRemove } from './util/arrRemove';\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 */\nexport class Subscription implements SubscriptionLike {\n public static EMPTY = (() => {\n const empty = new Subscription();\n empty.closed = true;\n return empty;\n })();\n\n /**\n * A flag to indicate whether this Subscription has already been unsubscribed.\n */\n public closed = false;\n\n private _parentage: Subscription[] | Subscription | null = null;\n\n /**\n * The list of registered finalizers to execute upon unsubscription. Adding and removing from this\n * list occurs in the {@link #add} and {@link #remove} methods.\n */\n private _finalizers: Exclude<TeardownLogic, void>[] | null = null;\n\n /**\n * @param initialTeardown A function executed first as part of the finalization\n * process that is kicked off when {@link #unsubscribe} is called.\n */\n constructor(private initialTeardown?: () => void) {}\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 */\n unsubscribe(): void {\n let errors: any[] | undefined;\n\n if (!this.closed) {\n this.closed = true;\n\n // Remove this from it's parents.\n const { _parentage } = this;\n if (_parentage) {\n this._parentage = null;\n if (Array.isArray(_parentage)) {\n for (const parent of _parentage) {\n parent.remove(this);\n }\n } else {\n _parentage.remove(this);\n }\n }\n\n const { initialTeardown: initialFinalizer } = this;\n if (isFunction(initialFinalizer)) {\n try {\n initialFinalizer();\n } catch (e) {\n errors = e instanceof UnsubscriptionError ? e.errors : [e];\n }\n }\n\n const { _finalizers } = this;\n if (_finalizers) {\n this._finalizers = null;\n for (const finalizer of _finalizers) {\n try {\n execFinalizer(finalizer);\n } catch (err) {\n errors = errors ?? [];\n if (err instanceof UnsubscriptionError) {\n errors = [...errors, ...err.errors];\n } else {\n errors.push(err);\n }\n }\n }\n }\n\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n }\n }\n\n /**\n * Adds a finalizer to this subscription, so that finalization will be unsubscribed/called\n * when this subscription is unsubscribed. If this subscription is already {@link #closed},\n * because it has already been unsubscribed, then whatever finalizer is passed to it\n * will automatically be executed (unless the finalizer itself is also a closed subscription).\n *\n * Closed Subscriptions cannot be added as finalizers to any subscription. Adding a closed\n * subscription to a any subscription will result in no operation. (A noop).\n *\n * Adding a subscription to itself, or adding `null` or `undefined` will not perform any\n * operation at all. (A noop).\n *\n * `Subscription` instances that are added to this instance will automatically remove themselves\n * if they are unsubscribed. Functions and {@link Unsubscribable} objects that you wish to remove\n * will need to be removed manually with {@link #remove}\n *\n * @param teardown The finalization logic to add to this subscription.\n */\n add(teardown: TeardownLogic): void {\n // Only add the finalizer if it's not undefined\n // and don't add a subscription to itself.\n if (teardown && teardown !== this) {\n if (this.closed) {\n // If this subscription is already closed,\n // execute whatever finalizer is handed to it automatically.\n execFinalizer(teardown);\n } else {\n if (teardown instanceof Subscription) {\n // We don't add closed subscriptions, and we don't add the same subscription\n // twice. Subscription unsubscribe is idempotent.\n if (teardown.closed || teardown._hasParent(this)) {\n return;\n }\n teardown._addParent(this);\n }\n (this._finalizers = this._finalizers ?? []).push(teardown);\n }\n }\n }\n\n /**\n * Checks to see if a this subscription already has a particular parent.\n * This will signal that this subscription has already been added to the parent in question.\n * @param parent the parent to check for\n */\n private _hasParent(parent: Subscription) {\n const { _parentage } = this;\n return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));\n }\n\n /**\n * Adds a parent to this subscription so it can be removed from the parent if it\n * unsubscribes on it's own.\n *\n * NOTE: THIS ASSUMES THAT {@link _hasParent} HAS ALREADY BEEN CHECKED.\n * @param parent The parent subscription to add\n */\n private _addParent(parent: Subscription) {\n const { _parentage } = this;\n this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;\n }\n\n /**\n * Called on a child when it is removed via {@link #remove}.\n * @param parent The parent to remove\n */\n private _removeParent(parent: Subscription) {\n const { _parentage } = this;\n if (_parentage === parent) {\n this._parentage = null;\n } else if (Array.isArray(_parentage)) {\n arrRemove(_parentage, parent);\n }\n }\n\n /**\n * Removes a finalizer from this subscription that was previously added with the {@link #add} method.\n *\n * Note that `Subscription` instances, when unsubscribed, will automatically remove themselves\n * from every other `Subscription` they have been added to. This means that using the `remove` method\n * is not a common thing and should be used thoughtfully.\n *\n * If you add the same finalizer instance of a function or an unsubscribable object to a `Subscription` instance\n * more than once, you will need to call `remove` the same number of times to remove all instances.\n *\n * All finalizer instances are removed to free up memory upon unsubscription.\n *\n * @param teardown The finalizer to remove from this subscription\n */\n remove(teardown: Exclude<TeardownLogic, void>): void {\n const { _finalizers } = this;\n _finalizers && arrRemove(_finalizers, teardown);\n\n if (teardown instanceof Subscription) {\n teardown._removeParent(this);\n }\n }\n}\n\nexport const EMPTY_SUBSCRIPTION = Subscription.EMPTY;\n\nexport function isSubscription(value: any): value is Subscription {\n return (\n value instanceof Subscription ||\n (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe))\n );\n}\n\nfunction execFinalizer(finalizer: Unsubscribable | (() => void)) {\n if (isFunction(finalizer)) {\n finalizer();\n } else {\n finalizer.unsubscribe();\n }\n}\n","import { Subscriber } from './Subscriber';\nimport { ObservableNotification } from './types';\n\n/**\n * The {@link GlobalConfig} object for RxJS. It is used to configure things\n * like how to react on unhandled errors.\n */\nexport const config: GlobalConfig = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: undefined,\n useDeprecatedSynchronousErrorHandling: false,\n useDeprecatedNextContext: false,\n};\n\n/**\n * The global configuration object for RxJS, used to configure things\n * like how to react on unhandled errors. Accessible via {@link config}\n * object.\n */\nexport interface GlobalConfig {\n /**\n * A registration point for unhandled errors from RxJS. These are errors that\n * cannot were not handled by consuming code in the usual subscription path. For\n * example, if you have this configured, and you subscribe to an observable without\n * providing an error handler, errors from that subscription will end up here. This\n * will _always_ be called asynchronously on another job in the runtime. This is because\n * we do not want errors thrown in this user-configured handler to interfere with the\n * behavior of the library.\n */\n onUnhandledError: ((err: any) => void) | null;\n\n /**\n * A registration point for notifications that cannot be sent to subscribers because they\n * have completed, errored or have been explicitly unsubscribed. By default, next, complete\n * and error notifications sent to stopped subscribers are noops. However, sometimes callers\n * might want a different behavior. For example, with sources that attempt to report errors\n * to stopped subscribers, a caller can configure RxJS to throw an unhandled error instead.\n * This will _always_ be called asynchronously on another job in the runtime. This is because\n * we do not want errors thrown in this user-configured handler to interfere with the\n * behavior of the library.\n */\n onStoppedNotification: ((notification: ObservableNotification<any>, subscriber: Subscriber<any>) => void) | null;\n\n /**\n * The promise constructor used by default for {@link Observable#toPromise toPromise} and {@link Observable#forEach forEach}\n * methods.\n *\n * @deprecated As of version 8, RxJS will no longer support this sort of injection of a\n * Promise constructor. If you need a Promise implementation other than native promises,\n * please polyfill/patch Promise as you see appropriate. Will be removed in v8.\n */\n Promise?: 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 BUY TIME\n * FOR MIGRATION REASONS.\n *\n * @deprecated As of version 8, RxJS will no longer support synchronous throwing\n * of unhandled errors. All errors will be thrown on a separate call stack to prevent bad\n * behaviors described above. Will be removed in v8.\n */\n useDeprecatedSynchronousErrorHandling: boolean;\n\n /**\n * If true, enables an as-of-yet undocumented feature from v5: The ability to access\n * `unsubscribe()` via `this` context in `next` functions created in observers passed\n * to `subscribe`.\n *\n * This is being removed because the performance was severely problematic, and it could also cause\n * issues when types other than POJOs are passed to subscribe as subscribers, as they will likely have\n * their `this` context overwritten.\n *\n * @deprecated As of version 8, RxJS will no longer support altering the\n * context of next functions provided as part of an observer to Subscribe. Instead,\n * you will have access to a subscription or a signal or token that will allow you to do things like\n * unsubscribe and test closed status. Will be removed in v8.\n */\n useDeprecatedNextContext: boolean;\n}\n","import type { TimerHandle } from './timerHandle';\ntype SetTimeoutFunction = (handler: () => void, timeout?: number, ...args: any[]) => TimerHandle;\ntype ClearTimeoutFunction = (handle: TimerHandle) => void;\n\ninterface TimeoutProvider {\n setTimeout: SetTimeoutFunction;\n clearTimeout: ClearTimeoutFunction;\n delegate:\n | {\n setTimeout: SetTimeoutFunction;\n clearTimeout: ClearTimeoutFunction;\n }\n | undefined;\n}\n\nexport const timeoutProvider: TimeoutProvider = {\n // When accessing the delegate, use the variable rather than `this` so that\n // the functions can be called without being bound to the provider.\n setTimeout(handler: () => void, timeout?: number, ...args) {\n const { delegate } = timeoutProvider;\n if (delegate?.setTimeout) {\n return delegate.setTimeout(handler, timeout, ...args);\n }\n return setTimeout(handler, timeout, ...args);\n },\n clearTimeout(handle) {\n const { delegate } = timeoutProvider;\n return (delegate?.clearTimeout || clearTimeout)(handle as any);\n },\n delegate: undefined,\n};\n","import { config } from '../config';\nimport { timeoutProvider } from '../scheduler/timeoutProvider';\n\n/**\n * Handles an error on another job either with the user-configured {@link onUnhandledError},\n * or by throwing it on that new job so it can be picked up by `window.onerror`, `process.on('error')`, etc.\n *\n * This should be called whenever there is an error that is out-of-band with the subscription\n * or when an error hits a terminal boundary of the subscription and no error handler was provided.\n *\n * @param err the error to report\n */\nexport function reportUnhandledError(err: any) {\n timeoutProvider.setTimeout(() => {\n const { onUnhandledError } = config;\n if (onUnhandledError) {\n // Execute the user-configured error handler.\n onUnhandledError(err);\n } else {\n // Throw so it is picked up by the runtime's uncaught error mechanism.\n throw err;\n }\n });\n}\n","/* tslint:disable:no-empty */\nexport function noop() { }\n","import { config } from '../config';\n\nlet context: { errorThrown: boolean; error: any } | null = null;\n\n/**\n * Handles dealing with errors for super-gross mode. Creates a context, in which\n * any synchronously thrown errors will be passed to {@link captureError}. Which\n * will record the error such that it will be rethrown after the call back is complete.\n * TODO: Remove in v8\n * @param cb An immediately executed function.\n */\nexport function errorContext(cb: () => void) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n const isRoot = !context;\n if (isRoot) {\n context = { errorThrown: false, error: null };\n }\n cb();\n if (isRoot) {\n const { errorThrown, error } = context!;\n context = null;\n if (errorThrown) {\n throw error;\n }\n }\n } else {\n // This is the general non-deprecated path for everyone that\n // isn't crazy enough to use super-gross mode (useDeprecatedSynchronousErrorHandling)\n cb();\n }\n}\n\n/**\n * Captures errors only in super-gross mode.\n * @param err the error to capture\n */\nexport function captureError(err: any) {\n if (config.useDeprecatedSynchronousErrorHandling && context) {\n context.errorThrown = true;\n context.error = err;\n }\n}\n","import { isFunction } from './util/isFunction';\nimport { Observer, ObservableNotification } from './types';\nimport { isSubscription, Subscription } from './Subscription';\nimport { config } from './config';\nimport { reportUnhandledError } from './util/reportUnhandledError';\nimport { noop } from './util/noop';\nimport { nextNotification, errorNotification, COMPLETE_NOTIFICATION } from './NotificationFactories';\nimport { timeoutProvider } from './scheduler/timeoutProvider';\nimport { captureError } from './util/errorContext';\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 */\nexport class Subscriber<T> extends Subscription implements Observer<T> {\n /**\n * A static factory for a Subscriber, given a (potentially partial) definition\n * of an Observer.\n * @param next The `next` callback of an Observer.\n * @param error The `error` callback of an\n * Observer.\n * @param complete The `complete` callback of an\n * Observer.\n * @return A Subscriber wrapping the (partially defined)\n * Observer represented by the given arguments.\n * @deprecated Do not use. Will be removed in v8. There is no replacement for this\n * method, and there is no reason to be creating instances of `Subscriber` directly.\n * If you have a specific use case, please file an issue.\n */\n static create<T>(next?: (x?: T) => void, error?: (e?: any) => void, complete?: () => void): Subscriber<T> {\n return new SafeSubscriber(next, error, complete);\n }\n\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n protected isStopped: boolean = false;\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n protected destination: Subscriber<any> | Observer<any>; // this `any` is the escape hatch to erase extra type param (e.g. R)\n\n /**\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n * There is no reason to directly create an instance of Subscriber. This type is exported for typings reasons.\n */\n constructor(destination?: Subscriber<any> | Observer<any>) {\n super();\n if (destination) {\n this.destination = destination;\n // Automatically chain subscriptions together here.\n // if destination is a Subscription, then it is a Subscriber.\n if (isSubscription(destination)) {\n destination.add(this);\n }\n } else {\n this.destination = EMPTY_OBSERVER;\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 value The `next` value.\n */\n next(value: T): void {\n if (this.isStopped) {\n handleStoppedNotification(nextNotification(value), this);\n } else {\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 err The `error` exception.\n */\n error(err?: any): void {\n if (this.isStopped) {\n handleStoppedNotification(errorNotification(err), this);\n } else {\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 */\n complete(): void {\n if (this.isStopped) {\n handleStoppedNotification(COMPLETE_NOTIFICATION, this);\n } else {\n this.isStopped = true;\n this._complete();\n }\n }\n\n unsubscribe(): void {\n if (!this.closed) {\n this.isStopped = true;\n super.unsubscribe();\n this.destination = null!;\n }\n }\n\n protected _next(value: T): void {\n this.destination.next(value);\n }\n\n protected _error(err: any): void {\n try {\n this.destination.error(err);\n } finally {\n this.unsubscribe();\n }\n }\n\n protected _complete(): void {\n try {\n this.destination.complete();\n } finally {\n this.unsubscribe();\n }\n }\n}\n\n/**\n * This bind is captured here because we want to be able to have\n * compatibility with monoid libraries that tend to use a method named\n * `bind`. In particular, a library called Monio requires this.\n */\nconst _bind = Function.prototype.bind;\n\nfunction bind<Fn extends (...args: any[]) => any>(fn: Fn, thisArg: any): Fn {\n return _bind.call(fn, thisArg);\n}\n\n/**\n * Internal optimization only, DO NOT EXPOSE.\n * @internal\n */\nclass ConsumerObserver<T> implements Observer<T> {\n constructor(private partialObserver: Partial<Observer<T>>) {}\n\n next(value: T): void {\n const { partialObserver } = this;\n if (partialObserver.next) {\n try {\n partialObserver.next(value);\n } catch (error) {\n handleUnhandledError(error);\n }\n }\n }\n\n error(err: any): void {\n const { partialObserver } = this;\n if (partialObserver.error) {\n try {\n partialObserver.error(err);\n } catch (error) {\n handleUnhandledError(error);\n }\n } else {\n handleUnhandledError(err);\n }\n }\n\n complete(): void {\n const { partialObserver } = this;\n if (partialObserver.complete) {\n try {\n partialObserver.complete();\n } catch (error) {\n handleUnhandledError(error);\n }\n }\n }\n}\n\nexport class SafeSubscriber<T> extends Subscriber<T> {\n constructor(\n observerOrNext?: Partial<Observer<T>> | ((value: T) => void) | null,\n error?: ((e?: any) => void) | null,\n complete?: (() => void) | null\n ) {\n super();\n\n let partialObserver: Partial<Observer<T>>;\n if (isFunction(observerOrNext) || !observerOrNext) {\n // The first argument is a function, not an observer. The next\n // two arguments *could* be observers, or they could be empty.\n partialObserver = {\n next: (observerOrNext ?? undefined) as ((value: T) => void) | undefined,\n error: error ?? undefined,\n complete: complete ?? undefined,\n };\n } else {\n // The first argument is a partial observer.\n let context: any;\n if (this && config.useDeprecatedNextContext) {\n // This is a deprecated path that made `this.unsubscribe()` available in\n // next handler functions passed to subscribe. This only exists behind a flag\n // now, as it is *very* slow.\n context = Object.create(observerOrNext);\n context.unsubscribe = () => this.unsubscribe();\n partialObserver = {\n next: observerOrNext.next && bind(observerOrNext.next, context),\n error: observerOrNext.error && bind(observerOrNext.error, context),\n complete: observerOrNext.complete && bind(observerOrNext.complete, context),\n };\n } else {\n // The \"normal\" path. Just use the partial observer directly.\n partialObserver = observerOrNext;\n }\n }\n\n // Wrap the partial observer to ensure it's a full observer, and\n // make sure proper error handling is accounted for.\n this.destination = new ConsumerObserver(partialObserver);\n }\n}\n\nfunction handleUnhandledError(error: any) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n captureError(error);\n } else {\n // Ideal path, we report this as an unhandled error,\n // which is thrown on a new call stack.\n reportUnhandledError(error);\n }\n}\n\n/**\n * An error handler used when no error handler was supplied\n * to the SafeSubscriber -- meaning no error handler was supplied\n * do the `subscribe` call on our observable.\n * @param err The error to handle\n */\nfunction defaultErrorHandler(err: any) {\n throw err;\n}\n\n/**\n * A handler for notifications that cannot be sent to a stopped subscriber.\n * @param notification The notification being sent.\n * @param subscriber The stopped subscriber.\n */\nfunction handleStoppedNotification(notification: ObservableNotification<any>, subscriber: Subscriber<any>) {\n const { onStoppedNotification } = config;\n onStoppedNotification && timeoutProvider.setTimeout(() => onStoppedNotification(notification, subscriber));\n}\n\n/**\n * The observer used as a stub for subscriptions where the user did not\n * pass any arguments to `subscribe`. Comes with the default error handling\n * behavior.\n */\nexport const EMPTY_OBSERVER: Readonly<Observer<any>> & { closed: true } = {\n closed: true,\n next: noop,\n error: defaultErrorHandler,\n complete: noop,\n};\n","/**\n * Symbol.observable or a string \"@@observable\". Used for interop\n *\n * @deprecated We will no longer be exporting this symbol in upcoming versions of RxJS.\n * Instead polyfill and use Symbol.observable directly *or* use https://www.npmjs.com/package/symbol-observable\n */\nexport const observable: string | symbol = (() => (typeof Symbol === 'function' && Symbol.observable) || '@@observable')();\n","/**\n * This function takes one parameter and just returns it. Simply put,\n * this is like `<T>(x: T): T => x`.\n *\n * ## Examples\n *\n * This is useful in some cases when using things like `mergeMap`\n *\n * ```ts\n * import { interval, take, map, range, mergeMap, identity } from 'rxjs';\n *\n * const source$ = interval(1000).pipe(take(5));\n *\n * const result$ = source$.pipe(\n * map(i => range(i)),\n * mergeMap(identity) // same as mergeMap(x => x)\n * );\n *\n * result$.subscribe({\n * next: console.log\n * });\n * ```\n *\n * Or when you want to selectively apply an operator\n *\n * ```ts\n * import { interval, take, identity } from 'rxjs';\n *\n * const shouldLimit = () => Math.random() < 0.5;\n *\n * const source$ = interval(1000);\n *\n * const result$ = source$.pipe(shouldLimit() ? take(5) : identity);\n *\n * result$.subscribe({\n * next: console.log\n * });\n * ```\n *\n * @param x Any value that is returned by this function\n * @returns The value passed as the first parameter to this function\n */\nexport function identity<T>(x: T): T {\n return x;\n}\n","import { identity } from './identity';\nimport { UnaryFunction } from '../types';\n\nexport function pipe(): typeof identity;\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>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>\n): UnaryFunction<T, D>;\nexport function pipe<T, A, B, C, D, E>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>\n): UnaryFunction<T, E>;\nexport function pipe<T, A, B, C, D, E, F>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>,\n fn6: UnaryFunction<E, F>\n): UnaryFunction<T, F>;\nexport function pipe<T, A, B, C, D, E, F, G>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>,\n fn6: UnaryFunction<E, F>,\n fn7: UnaryFunction<F, G>\n): UnaryFunction<T, G>;\nexport function pipe<T, A, B, C, D, E, F, G, H>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>,\n fn6: UnaryFunction<E, F>,\n fn7: UnaryFunction<F, G>,\n fn8: UnaryFunction<G, H>\n): UnaryFunction<T, H>;\nexport function pipe<T, A, B, C, D, E, F, G, H, I>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>,\n fn6: UnaryFunction<E, F>,\n fn7: UnaryFunction<F, G>,\n fn8: UnaryFunction<G, H>,\n fn9: UnaryFunction<H, I>\n): UnaryFunction<T, I>;\nexport function pipe<T, A, B, C, D, E, F, G, H, I>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>,\n fn6: UnaryFunction<E, F>,\n fn7: UnaryFunction<F, G>,\n fn8: UnaryFunction<G, H>,\n fn9: UnaryFunction<H, I>,\n ...fns: UnaryFunction<any, any>[]\n): UnaryFunction<T, unknown>;\n\n/**\n * pipe() can be called on one or more functions, each of which can take one argument (\"UnaryFunction\")\n * and uses it to return a value.\n * It returns a function that takes one argument, passes it to the first UnaryFunction, and then\n * passes the result to the next one, passes that result to the next one, and so on. \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.length === 0) {\n return identity 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 { SafeSubscriber, Subscriber } from './Subscriber';\nimport { isSubscription, Subscription } from './Subscription';\nimport { TeardownLogic, OperatorFunction, Subscribable, Observer } from './types';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nimport { isFunction } from './util/isFunction';\nimport { errorContext } from './util/errorContext';\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 */\nexport class Observable<T> implements Subscribable<T> {\n /**\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n */\n source: Observable<any> | undefined;\n\n /**\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n */\n operator: Operator<any, T> | undefined;\n\n /**\n * @param 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 Observable by calling the Observable constructor\n * @param subscribe the subscriber function to be passed to the Observable constructor\n * @return A new observable.\n * @deprecated Use `new Observable()` instead. Will be removed in v8.\n */\n static create: (...args: any[]) => any = <T>(subscribe?: (subscriber: Subscriber<T>) => TeardownLogic) => {\n return new Observable<T>(subscribe);\n };\n\n /**\n * Creates a new Observable, with this Observable instance as the source, and the passed\n * operator defined as the new observable's operator.\n * @param operator the operator defining the operation to take on the observable\n * @return A new observable with the Operator applied.\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n * If you have implemented an operator using `lift`, it is recommended that you create an\n * operator by simply returning `new Observable()` directly. See \"Creating new operators from\n * scratch\" section here: https://rxjs.dev/guide/operators\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(observerOrNext?: Partial<Observer<T>> | ((value: T) => void)): Subscription;\n /** @deprecated Instead of passing separate callback arguments, use an observer argument. Signatures taking separate callback arguments will be removed in v8. Details: https://rxjs.dev/deprecations/subscribe-arguments */\n subscribe(next?: ((value: T) => void) | null, error?: ((error: any) => void) | null, complete?: (() => void) | null): 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 and an error happens,\n * it will be thrown asynchronously. Errors thrown asynchronously cannot be caught using `try`/`catch`. Instead,\n * use the {@link onUnhandledError} configuration option or use a runtime handler (like `window.onerror` or\n * `process.on('error)`) to be notified of unhandled errors. Because of this, it's recommended that you provide\n * an `error` method to avoid missing thrown errors.\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 an Observer,\n * if you do not need to listen for something, you can omit a function by passing `undefined` or `null`,\n * since `subscribe` recognizes these functions by where they were placed in function call. When it comes\n * to the `error` function, as with an Observer, if not provided, errors emitted by an Observable will be thrown asynchronously.\n *\n * You can, however, subscribe with no parameters at all. This may be the case where you're not interested in terminal events\n * and you also handled emissions internally by using operators (e.g. using `tap`).\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 * #### Examples\n *\n * Subscribe with an {@link guide/observer Observer}\n *\n * ```ts\n * import { of } from 'rxjs';\n *\n * const sumObserver = {\n * sum: 0,\n * next(value) {\n * console.log('Adding: ' + value);\n * this.sum = this.sum + value;\n * },\n * error() {\n * // We actually could just remove this method,\n * // since we do not really care about errors right now.\n * },\n * complete() {\n * console.log('Sum equals: ' + this.sum);\n * }\n * };\n *\n * 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 ({@link deprecations/subscribe-arguments deprecated})\n *\n * ```ts\n * import { of } from 'rxjs'\n *\n * let sum = 0;\n *\n * of(1, 2, 3).subscribe(\n * value => {\n * console.log('Adding: ' + value);\n * sum = sum + value;\n * },\n * undefined,\n * () => console.log('Sum equals: ' + sum)\n * );\n *\n * // Logs:\n * // 'Adding: 1'\n * // 'Adding: 2'\n * // 'Adding: 3'\n * // 'Sum equals: 6'\n * ```\n *\n * Cancel a subscription\n *\n * ```ts\n * import { interval } from 'rxjs';\n *\n * const subscription = interval(1000).subscribe({\n * next(num) {\n * console.log(num)\n * },\n * complete() {\n * // Will not be called, even when cancelling subscription.\n * console.log('completed!');\n * }\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 observerOrNext Either an {@link Observer} with some or all callback methods,\n * or the `next` handler that is called for each value emitted from the subscribed Observable.\n * @param error A handler for a terminal event resulting from an error. If no error handler is provided,\n * the error will be thrown asynchronously as unhandled.\n * @param complete A handler for a terminal event resulting from successful completion.\n * @return A subscription reference to the registered handlers.\n */\n subscribe(\n observerOrNext?: Partial<Observer<T>> | ((value: T) => void) | null,\n error?: ((error: any) => void) | null,\n complete?: (() => void) | null\n ): Subscription {\n const subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);\n\n errorContext(() => {\n const { operator, source } = this;\n subscriber.add(\n operator\n ? // We're dealing with a subscription in the\n // operator chain to one of our lifted operators.\n operator.call(subscriber, source)\n : source\n ? // If `source` has a value, but `operator` does not, something that\n // had intimate knowledge of our API, like our `Subject`, must have\n // set it. We're going to just call `_subscribe` directly.\n this._subscribe(subscriber)\n : // In all other cases, we're likely wrapping a user-provided initializer\n // function, so we need to catch errors and handle them appropriately.\n this._trySubscribe(subscriber)\n );\n });\n\n return subscriber;\n }\n\n /** @internal */\n protected _trySubscribe(sink: Subscriber<T>): TeardownLogic {\n try {\n return this._subscribe(sink);\n } catch (err) {\n // We don't need to return anything in this case,\n // because it's just going to try to `add()` to a subscription\n // above.\n sink.error(err);\n }\n }\n\n /**\n * Used as a NON-CANCELLABLE means of subscribing to an observable, for use with\n * APIs that expect promises, like `async/await`. You cannot unsubscribe from this.\n *\n * **WARNING**: Only use this with observables you *know* will complete. If the source\n * observable does not complete, you will end up with a promise that is hung up, and\n * potentially all of the state of an async function hanging out in memory. To avoid\n * this situation, look into adding something like {@link timeout}, {@link take},\n * {@link takeWhile}, or {@link takeUntil} amongst others.\n *\n * #### Example\n *\n * ```ts\n * import { interval, take } from 'rxjs';\n *\n * const source$ = interval(1000).pipe(take(4));\n *\n * async function getTotal() {\n * let total = 0;\n *\n * await source$.forEach(value => {\n * total += value;\n * console.log('observable -> ' + value);\n * });\n *\n * return total;\n * }\n *\n * getTotal().then(\n * total => console.log('Total: ' + total)\n * );\n *\n * // Expected:\n * // 'observable -> 0'\n * // 'observable -> 1'\n * // 'observable -> 2'\n * // 'observable -> 3'\n * // 'Total: 6'\n * ```\n *\n * @param next A handler for each value emitted by the observable.\n * @return A promise that either resolves on observable completion or\n * rejects with the handled error.\n */\n forEach(next: (value: T) => void): Promise<void>;\n\n /**\n * @param next a handler for each value emitted by the observable\n * @param promiseCtor a constructor function used to instantiate the Promise\n * @return a promise that either resolves on observable completion or\n * rejects with the handled error\n * @deprecated Passing a Promise constructor will no longer be available\n * in upcoming versions of RxJS. This is because it adds weight to the library, for very\n * little benefit. If you need this functionality, it is recommended that you either\n * polyfill Promise, or you create an adapter to convert the returned native promise\n * to whatever promise implementation you wanted. Will be removed in v8.\n */\n forEach(next: (value: T) => void, promiseCtor: PromiseConstructorLike): Promise<void>;\n\n forEach(next: (value: T) => void, promiseCtor?: PromiseConstructorLike): Promise<void> {\n promiseCtor = getPromiseCtor(promiseCtor);\n\n return new promiseCtor<void>((resolve, reject) => {\n const subscriber = new SafeSubscriber<T>({\n next: (value) => {\n try {\n next(value);\n } catch (err) {\n reject(err);\n subscriber.unsubscribe();\n }\n },\n error: reject,\n complete: resolve,\n });\n this.subscribe(subscriber);\n }) as Promise<void>;\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber<any>): TeardownLogic {\n return this.source?.subscribe(subscriber);\n }\n\n /**\n * An interop point defined by the es7-observable spec https://github.com/zenparsing/es-observable\n * @return 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>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>\n ): Observable<D>;\n pipe<A, B, C, D, E>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>\n ): Observable<E>;\n pipe<A, B, C, D, E, F>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>,\n op6: OperatorFunction<E, F>\n ): Observable<F>;\n pipe<A, B, C, D, E, F, G>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>,\n op6: OperatorFunction<E, F>,\n op7: OperatorFunction<F, G>\n ): Observable<G>;\n pipe<A, B, C, D, E, F, G, H>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>,\n op6: OperatorFunction<E, F>,\n op7: OperatorFunction<F, G>,\n op8: OperatorFunction<G, H>\n ): Observable<H>;\n pipe<A, B, C, D, E, F, G, H, I>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>,\n op6: OperatorFunction<E, F>,\n op7: OperatorFunction<F, G>,\n op8: OperatorFunction<G, H>,\n op9: OperatorFunction<H, I>\n ): Observable<I>;\n pipe<A, B, C, D, E, F, G, H, I>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>,\n op6: OperatorFunction<E, F>,\n op7: OperatorFunction<F, G>,\n op8: OperatorFunction<G, H>,\n op9: OperatorFunction<H, I>,\n ...operations: OperatorFunction<any, any>[]\n ): Observable<unknown>;\n /* tslint:enable:max-line-length */\n\n /**\n * Used to stitch together functional operators into a chain.\n *\n * ## Example\n *\n * ```ts\n * import { interval, filter, map, scan } from 'rxjs';\n *\n * 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 * @return The Observable result of all the operators having been called\n * in the order they were passed in.\n */\n pipe(...operations: OperatorFunction<any, any>[]): Observable<any> {\n return pipeFromArray(operations)(this);\n }\n\n /* tslint:disable:max-line-length */\n /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */\n toPromise(): Promise<T | undefined>;\n /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */\n toPromise(PromiseCtor: typeof Promise): Promise<T | undefined>;\n /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */\n toPromise(PromiseCtor: PromiseConstructorLike): Promise<T | undefined>;\n /* tslint:enable:max-line-length */\n\n /**\n * Subscribe to this Observable and get a Promise resolving on\n * `complete` with the last emission (if any).\n *\n * **WARNING**: Only use this with observables you *know* will complete. If the source\n * observable does not complete, you will end up with a promise that is hung up, and\n * potentially all of the state of an async function hanging out in memory. To avoid\n * this situation, look into adding something like {@link timeout}, {@link take},\n * {@link takeWhile}, or {@link takeUntil} amongst others.\n *\n * @param [promiseCtor] a constructor function used to instantiate\n * the Promise\n * @return A Promise that resolves with the last value emit, or\n * rejects on an error. If there were no emissions, Promise\n * resolves with undefined.\n * @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise\n */\n toPromise(promiseCtor?: PromiseConstructorLike): Promise<T | undefined> {\n promiseCtor = getPromiseCtor(promiseCtor);\n\n return new promiseCtor((resolve, reject) => {\n let value: T | undefined;\n this.subscribe(\n (x: T) => (value = x),\n (err: any) => reject(err),\n () => resolve(value)\n );\n }) as Promise<T | undefined>;\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 return promiseCtor ?? config.Promise ?? Promise;\n}\n\nfunction isObserver<T>(value: any): value is Observer<T> {\n return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);\n}\n\nfunction isSubscriber<T>(value: any): value is Subscriber<T> {\n return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));\n}\n","import { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { OperatorFunction } from '../types';\nimport { isFunction } from './isFunction';\n\n/**\n * Used to determine if an object is an Observable with a lift function.\n */\nexport function hasLift(source: any): source is { lift: InstanceType<typeof Observable>['lift'] } {\n return isFunction(source?.lift);\n}\n\n/**\n * Creates an `OperatorFunction`. Used to define operators throughout the library in a concise way.\n * @param init The logic to connect the liftedSource to the subscriber at the moment of subscription.\n */\nexport function operate<T, R>(\n init: (liftedSource: Observable<T>, subscriber: Subscriber<R>) => (() => void) | void\n): OperatorFunction<T, R> {\n return (source: Observable<T>) => {\n if (hasLift(source)) {\n return source.lift(function (this: Subscriber<R>, liftedSource: Observable<T>) {\n try {\n return init(liftedSource, this);\n } catch (err) {\n this.error(err);\n }\n });\n }\n throw new TypeError('Unable to lift unknown Observable type');\n };\n}\n","import { Subscriber } from '../Subscriber';\n\n/**\n * Creates an instance of an `OperatorSubscriber`.\n * @param destination The downstream subscriber.\n * @param onNext Handles next values, only called if this subscriber is not stopped or closed. Any\n * error that occurs in this function is caught and sent to the `error` method of this subscriber.\n * @param onError Handles errors from the subscription, any errors that occur in this handler are caught\n * and send to the `destination` error handler.\n * @param onComplete Handles completion notification from the subscription. Any errors that occur in\n * this handler are sent to the `destination` error handler.\n * @param onFinalize Additional teardown logic here. This will only be called on teardown if the\n * subscriber itself is not already closed. This is called after all other teardown logic is executed.\n */\nexport function createOperatorSubscriber<T>(\n destination: Subscriber<any>,\n onNext?: (value: T) => void,\n onComplete?: () => void,\n onError?: (err: any) => void,\n onFinalize?: () => void\n): Subscriber<T> {\n return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);\n}\n\n/**\n * A generic helper for allowing operators to be created with a Subscriber and\n * use closures to capture necessary state from the operator function itself.\n */\nexport class OperatorSubscriber<T> extends Subscriber<T> {\n /**\n * Creates an instance of an `OperatorSubscriber`.\n * @param destination The downstream subscriber.\n * @param onNext Handles next values, only called if this subscriber is not stopped or closed. Any\n * error that occurs in this function is caught and sent to the `error` method of this subscriber.\n * @param onError Handles errors from the subscription, any errors that occur in this handler are caught\n * and send to the `destination` error handler.\n * @param onComplete Handles completion notification from the subscription. Any errors that occur in\n * this handler are sent to the `destination` error handler.\n * @param onFinalize Additional finalization logic here. This will only be called on finalization if the\n * subscriber itself is not already closed. This is called after all other finalization logic is executed.\n * @param shouldUnsubscribe An optional check to see if an unsubscribe call should truly unsubscribe.\n * NOTE: This currently **ONLY** exists to support the strange behavior of {@link groupBy}, where unsubscription\n * to the resulting observable does not actually disconnect from the source if there are active subscriptions\n * to any grouped observable. (DO NOT EXPOSE OR USE EXTERNALLY!!!)\n */\n constructor(\n destination: Subscriber<any>,\n onNext?: (value: T) => void,\n onComplete?: () => void,\n onError?: (err: any) => void,\n private onFinalize?: () => void,\n private shouldUnsubscribe?: () => boolean\n ) {\n // It's important - for performance reasons - that all of this class's\n // members are initialized and that they are always initialized in the same\n // order. This will ensure that all OperatorSubscriber instances have the\n // same hidden class in V8. This, in turn, will help keep the number of\n // hidden classes involved in property accesses within the base class as\n // low as possible. If the number of hidden classes involved exceeds four,\n // the property accesses will become megamorphic and performance penalties\n // will be incurred - i.e. inline caches won't be used.\n //\n // The reasons for ensuring all instances have the same hidden class are\n // further discussed in this blog post from Benedikt Meurer:\n // https://benediktmeurer.de/2018/03/23/impact-of-polymorphism-on-component-based-frameworks-like-react/\n super(destination);\n this._next = onNext\n ? function (this: OperatorSubscriber<T>, value: T) {\n try {\n onNext(value);\n } catch (err) {\n destination.error(err);\n }\n }\n : super._next;\n this._error = onError\n ? function (this: OperatorSubscriber<T>, err: any) {\n try {\n onError(err);\n } catch (err) {\n // Send any errors that occur down stream.\n destination.error(err);\n } finally {\n // Ensure finalization.\n this.unsubscribe();\n }\n }\n : super._error;\n this._complete = onComplete\n ? function (this: OperatorSubscriber<T>) {\n try {\n onComplete();\n } catch (err) {\n // Send any errors that occur down stream.\n destination.error(err);\n } finally {\n // Ensure finalization.\n this.unsubscribe();\n }\n }\n : super._complete;\n }\n\n unsubscribe() {\n if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {\n const { closed } = this;\n super.unsubscribe();\n // Execute additional teardown if we have any and we didn't already do so.\n !closed && this.onFinalize?.();\n }\n }\n}\n","import { createErrorClass } from './createErrorClass';\n\nexport interface ObjectUnsubscribedError extends Error {}\n\nexport interface ObjectUnsubscribedErrorCtor {\n /**\n * @deprecated Internal implementation detail. Do not construct error instances.\n * Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269\n */\n new (): ObjectUnsubscribedError;\n}\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 = createErrorClass(\n (_super) =>\n function ObjectUnsubscribedErrorImpl(this: any) {\n _super(this);\n this.name = 'ObjectUnsubscribedError';\n this.message = 'object unsubscribed';\n }\n);\n","import { Operator } from './Operator';\nimport { Observable } from './Observable';\nimport { Subscriber } from './Subscriber';\nimport { Subscription, EMPTY_SUBSCRIPTION } from './Subscription';\nimport { Observer, SubscriptionLike, TeardownLogic } from './types';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { arrRemove } from './util/arrRemove';\nimport { errorContext } from './util/errorContext';\n\n/**\n * A Subject is a special type of Observable that allows values to be\n * multicasted to many Observers. 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 */\nexport class Subject<T> extends Observable<T> implements SubscriptionLike {\n closed = false;\n\n private currentObservers: Observer<T>[] | null = null;\n\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n observers: Observer<T>[] = [];\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n isStopped = false;\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n hasError = false;\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n thrownError: any = null;\n\n /**\n * Creates a \"subject\" by basically gluing an observer to an observable.\n *\n * @deprecated Recommended you do not use. Will be removed at some point in the future. Plans for replacement still under discussion.\n */\n static create: (...args: any[]) => any = <T>(destination: Observer<T>, source: Observable<T>): AnonymousSubject<T> => {\n return new AnonymousSubject<T>(destination, source);\n };\n\n constructor() {\n // NOTE: This must be here to obscure Observable's constructor.\n super();\n }\n\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n lift<R>(operator: Operator<T, R>): Observable<R> {\n const subject = new AnonymousSubject(this, this);\n subject.operator = operator as any;\n return subject as any;\n }\n\n /** @internal */\n protected _throwIfClosed() {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n }\n\n next(value: T) {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n if (!this.currentObservers) {\n this.currentObservers = Array.from(this.observers);\n }\n for (const observer of this.currentObservers) {\n observer.next(value);\n }\n }\n });\n }\n\n error(err: any) {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n this.hasError = this.isStopped = true;\n this.thrownError = err;\n const { observers } = this;\n while (observers.length) {\n observers.shift()!.error(err);\n }\n }\n });\n }\n\n complete() {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n this.isStopped = true;\n const { observers } = this;\n while (observers.length) {\n observers.shift()!.complete();\n }\n }\n });\n }\n\n unsubscribe() {\n this.isStopped = this.closed = true;\n this.observers = this.currentObservers = null!;\n }\n\n get observed() {\n return this.observers?.length > 0;\n }\n\n /** @internal */\n protected _trySubscribe(subscriber: Subscriber<T>): TeardownLogic {\n this._throwIfClosed();\n return super._trySubscribe(subscriber);\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber<T>): Subscription {\n this._throwIfClosed();\n this._checkFinalizedStatuses(subscriber);\n return this._innerSubscribe(subscriber);\n }\n\n /** @internal */\n protected _innerSubscribe(subscriber: Subscriber<any>) {\n const { hasError, isStopped, observers } = this;\n if (hasError || isStopped) {\n return EMPTY_SUBSCRIPTION;\n }\n this.currentObservers = null;\n observers.push(subscriber);\n return new Subscription(() => {\n this.currentObservers = null;\n arrRemove(observers, subscriber);\n });\n }\n\n /** @internal */\n protected _checkFinalizedStatuses(subscriber: Subscriber<any>) {\n const { hasError, thrownError, isStopped } = this;\n if (hasError) {\n subscriber.error(thrownError);\n } else if (isStopped) {\n subscriber.complete();\n }\n }\n\n /**\n * Creates a new Observable with this Subject as the source. You can do this\n * to create custom Observer-side logic of the Subject and conceal it from\n * code that uses the Observable.\n * @return Observable that this Subject casts to.\n */\n asObservable(): Observable<T> {\n const observable: any = new Observable<T>();\n observable.source = this;\n return observable;\n }\n}\n\nexport class AnonymousSubject<T> extends Subject<T> {\n constructor(\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n public destination?: Observer<T>,\n source?: Observable<T>\n ) {\n super();\n this.source = source;\n }\n\n next(value: T) {\n this.destination?.next?.(value);\n }\n\n error(err: any) {\n this.destination?.error?.(err);\n }\n\n complete() {\n this.destination?.complete?.();\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber<T>): Subscription {\n return this.source?.subscribe(subscriber) ?? EMPTY_SUBSCRIPTION;\n }\n}\n","import { Subject } from './Subject';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\n\n/**\n * A variant of Subject that requires an initial value and emits its current\n * value whenever it is subscribed to.\n */\nexport class BehaviorSubject<T> extends Subject<T> {\n constructor(private _value: T) {\n super();\n }\n\n get value(): T {\n return this.getValue();\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber<T>): Subscription {\n const subscription = super._subscribe(subscriber);\n !subscription.closed && subscriber.next(this._value);\n return subscription;\n }\n\n getValue(): T {\n const { hasError, thrownError, _value } = this;\n if (hasError) {\n throw thrownError;\n }\n this._throwIfClosed();\n return _value;\n }\n\n next(value: T): void {\n super.next((this._value = value));\n }\n}\n","/** prettier */\nimport { Observable } from '../Observable';\nimport { isFunction } from './isFunction';\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(obj: any): obj is Observable<unknown> {\n // The !! is to ensure that this publicly exposed function returns\n // `false` if something like `null` or `0` is passed.\n return !!obj && (obj instanceof Observable || (isFunction(obj.lift) && isFunction(obj.subscribe)));\n}\n","import { OperatorFunction, MonoTypeOperatorFunction, TruthyTypesOf } from '../types';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\n\n/** @deprecated Use a closure instead of a `thisArg`. Signatures accepting a `thisArg` will be removed in v8. */\nexport function filter<T, S extends T, A>(predicate: (this: A, value: T, index: number) => value is S, thisArg: A): OperatorFunction<T, S>;\nexport function filter<T, S extends T>(predicate: (value: T, index: number) => value is S): OperatorFunction<T, S>;\nexport function filter<T>(predicate: BooleanConstructor): OperatorFunction<T, TruthyTypesOf<T>>;\n/** @deprecated Use a closure instead of a `thisArg`. Signatures accepting a `thisArg` will be removed in v8. */\nexport function filter<T, A>(predicate: (this: A, value: T, index: number) => boolean, thisArg: A): MonoTypeOperatorFunction<T>;\nexport function filter<T>(predicate: (value: T, index: number) => boolean): MonoTypeOperatorFunction<T>;\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 *\n * Emit only click events whose target was a DIV element\n *\n * ```ts\n * import { fromEvent, filter } from 'rxjs';\n *\n * const div = document.createElement('div');\n * div.style.cssText = 'width: 200px; height: 200px; background: #09c;';\n * document.body.appendChild(div);\n *\n * const clicks = fromEvent(document, 'click');\n * const clicksOnDivs = clicks.pipe(filter(ev => (<HTMLElement>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 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 thisArg An optional argument to determine the value of `this`\n * in the `predicate` function.\n * @return A function that returns an Observable that emits items from the\n * source Observable that satisfy the specified `predicate`.\n */\nexport function filter<T>(predicate: (value: T, index: number) => boolean, thisArg?: any): MonoTypeOperatorFunction<T> {\n return operate((source, subscriber) => {\n // An index passed to our predicate function on each call.\n let index = 0;\n\n // Subscribe to the source, all errors and completions are\n // forwarded to the consumer.\n source.subscribe(\n // Call the predicate with the appropriate `this` context,\n // if the predicate returns `true`, then send the value\n // to the consumer.\n createOperatorSubscriber(subscriber, (value) => predicate.call(thisArg, value, index++) && subscriber.next(value))\n );\n });\n}\n","import { MonoTypeOperatorFunction } from '../types';\nimport { filter } from './filter';\n\n/**\n * Returns an Observable that skips the first `count` items emitted by the source Observable.\n *\n * ![](skip.png)\n *\n * Skips the values until the sent notifications are equal or less than provided skip count. It raises\n * an error if skip count is equal or more than the actual number of emits and source raises an error.\n *\n * ## Example\n *\n * Skip the values before the emission\n *\n * ```ts\n * import { interval, skip } from 'rxjs';\n *\n * // emit every half second\n * const source = interval(500);\n * // skip the first 10 emitted values\n * const result = source.pipe(skip(10));\n *\n * result.subscribe(value => console.log(value));\n * // output: 10...11...12...13...\n * ```\n *\n * @see {@link last}\n * @see {@link skipWhile}\n * @see {@link skipUntil}\n * @see {@link skipLast}\n *\n * @param count The number of times, items emitted by source Observable should be skipped.\n * @return A function that returns an Observable that skips the first `count`\n * values emitted by the source Observable.\n */\nexport function skip<T>(count: number): MonoTypeOperatorFunction<T> {\n return filter((_, index) => count <= index);\n}\n","import {\n\tfallbackIfFails,\n\tisError,\n\tisFn,\n\tisObj,\n\tisPositiveNumber,\n\tisSubjectLike,\n} from '@superutils/core'\nimport PromisE, {\n\tIPromisE_Timeout,\n\tTIMEOUT_MAX,\n\tTimeoutOptions,\n} from '@superutils/promise'\nimport { isObservable, Subscribable } from './rxjs'\nimport { SubjectLike, SubscriptionLike } from './types'\n\n/**\n * @summary Create a promise using RxJS subject and wait until an expected value is received\n *\n * @param subject RxJS subject or observable\n * @param expectedValue\t(optional) if undefined, will resolve as soon as any value is received.\n * If function, it should return true or false to indicate whether the value should be resolved.\n * @param timeoutOrOptions (optional)\n * @param timeoutOrOptions.timeout (optional) timeout duration in milliseconds if no value received within given time\n * @param timeoutOrOptions.timeoutMsg (optional) error message to use when times out.\n *\n * @returns timeout promise\n *\n * @example\n * #### Create a promise using RxJS subject\n * ```typescript\n * import { BehaviorSubject, subjectAsPromise } from '@superutils/rx'\n *\n * const subject = new BehaviorSubject(0)\n * setInterval(() => subject.next(subject.value + 1), 1000)\n *\n * // resolve conditionally based on value received\n * subjectAsPromise(subject, value => value >= 3)\n * \t.then(value => console.log('Expected >= 3, received ', value))\n *\n * // resolve when only specific value is received\n * subjectAsPromise(subject, 5).then(value => console.log('Expected 5, received ', value))\n * ```\n */\nexport const asPromise = <T = unknown>(\n\tsubject: Subscribable<T> | SubjectLike<T>,\n\texpectedValue?: T | ((value: T) => boolean),\n\ttimeoutOrOptions?:\n\t\t| number\n\t\t| (Omit<TimeoutOptions, 'batchFunc'> & { timeoutMsg?: string | Error }),\n) => {\n\tif (!isSubjectLike(subject) && !isObservable(subject))\n\t\treturn PromisE.reject<T>(\n\t\t\tnew Error('subject must be an instance of BehaviorSubject'),\n\t\t) as unknown as IPromisE_Timeout<T>\n\n\tlet subscription: SubscriptionLike\n\tconst options = isObj(timeoutOrOptions)\n\t\t? timeoutOrOptions\n\t\t: { timeout: timeoutOrOptions }\n\n\toptions.timeout = isPositiveNumber(options.timeout)\n\t\t? options.timeout\n\t\t: TIMEOUT_MAX\n\n\tconst promise = PromisE.timeout(\n\t\t{\n\t\t\t...options,\n\t\t\tonTimeout: async () => {\n\t\t\t\tconst { onTimeout, timeoutMsg } = options\n\n\t\t\t\tconst msg = await fallbackIfFails(onTimeout, [], undefined)\n\t\t\t\treturn (\n\t\t\t\t\tmsg\n\t\t\t\t\t?? (isError(timeoutMsg)\n\t\t\t\t\t\t? timeoutMsg\n\t\t\t\t\t\t: new Error(\n\t\t\t\t\t\t\t\ttimeoutMsg\n\t\t\t\t\t\t\t\t\t?? 'request timed out before an expected value is received',\n\t\t\t\t\t\t\t))\n\t\t\t\t)\n\t\t\t},\n\t\t},\n\t\tnew PromisE<T>(resolve => {\n\t\t\tsubscription = subject.subscribe((value: T) => {\n\t\t\t\tconst shouldResolve =\n\t\t\t\t\tvalue === expectedValue // exact match\n\t\t\t\t\t// no expected value set. resolve with first value received\n\t\t\t\t\t|| expectedValue === undefined\n\t\t\t\t\t// expected value is a function and returns boolean\n\t\t\t\t\t|| (isFn(expectedValue)\n\t\t\t\t\t\t&& fallbackIfFails(expectedValue, [value], false))\n\n\t\t\t\tshouldResolve && resolve(value)\n\t\t\t})\n\t\t}),\n\t)\n\n\tpromise.onFinalize.push(() => {\n\t\tsubscription?.unsubscribe?.()\n\t})\n\treturn promise as IPromisE_Timeout<T>\n}\nexport default asPromise\n","import { isSubjectLike as _isSubjectLike } from '@superutils/core'\nimport { SubjectLike } from './types'\n\n/**\n * Check if value is similar to a RxJS subject with .subscribe & .next functions\n *\n * @param x The value to check\n * @param withValue When `true`, also checks if `value` property exists in `x`\n *\n * @returns `true` if the value is subject-like, `false` otherwise.\n */\nexport const isSubjectLike = <T>(\n\tx: unknown,\n\twithValue = false,\n): x is SubjectLike<T> => _isSubjectLike(x, withValue)\n\nexport default isSubjectLike\n","import { isBool, isFn } from '@superutils/core'\nimport { Subscription } from './rxjs'\n\n/**\n * Check if value is an instance of RxJS `Subscription` or subscription-like object\n *\n * @param value\n * @param strict (optional) if true, will only check if value is instance of Subscription. Default: `false`\n */\nexport const isSubscriptionLike = (\n\tvalue: unknown,\n\tstrict = false,\n): value is Subscription => {\n\tif (value instanceof Subscription) return true\n\n\tconst sub = value as Record<string, unknown>\n\treturn (\n\t\t!strict //\n\t\t&& !!sub\n\t\t&& isBool(sub.closed)\n\t\t&& isFn(sub.unsubscribe)\n\t)\n}\n\nexport default isSubscriptionLike\n","import { isFn } from '@superutils/core'\nimport isSubscriptionLike from './isSubscriptionLike'\nimport { UnsubscribeCandidates } from './types'\n\n/**\n * @function unsubscribeAll\n * @summary unsubscribe to multiple RxJS subscriptions\n * @param {Function|Unsubscribable|Array} unsub\n */\nexport const unsubscribeAll = (\n\tunsub: UnsubscribeCandidates = {},\n\tonError?: (err: unknown) => void,\n) => {\n\tif (!unsub) return\n\n\ttry {\n\t\t// single function supplied\n\t\tif (isFn(unsub)) return unsub()\n\n\t\t// single subscription\n\t\tif (isSubscriptionLike(unsub)) return unsub.unsubscribe()\n\n\t\t// array/object\n\t\tObject.values(unsub as UnsubscribeCandidates[]).forEach(value =>\n\t\t\tunsubscribeAll(value, onError),\n\t\t)\n\t} catch (err) {\n\t\tonError?.(err)\n\t}\n}\nexport default unsubscribeAll\n","import {\n\tdeferred,\n\tDeferredOptions,\n\tfallbackIfFails,\n\tisArr,\n\tisFn,\n\tisPositiveNumber,\n} from '@superutils/core'\nimport { BehaviorSubject, skip } from './rxjs'\nimport isSubjectLike from './isSubjectLike'\nimport { SubjectLike, UnwrapSubjectValue } from './types'\nimport { unsubscribeAll } from './unsubscribeAll'\n\n/** Symbol used to signal to ignore an update when using a `valueModifier()` callback with {@link copyRxSubject} */\nexport const IGNORE_UPDATE_SYMBOL = Symbol('ignore-rx-update')\n\nexport type CopyRxSubjectOptions<ThisArg> = {\n\tdelay?: number\n} & DeferredOptions<ThisArg>\n\n/**\n * Value modifier function definition for {@link copyRxSubject}\n *\n * Returning {@link IGNORE_UPDATE_SYMBOL} will ignore the update.\n */\nexport type ValueModifier<T = unknown, TCopy = T> = (\n\tnewValue: T,\n\tpreviousValue: TCopy | undefined,\n\tcopy$: SubjectLike<TCopy>,\n) => TCopy | typeof IGNORE_UPDATE_SYMBOL\n\n/**\n * @function copyRxSubject\n * @summary returns a subject that automatically copies the value(s) of the source subject(s).\n *\n * The the changes are applied unidirectionally from the source subject to the destination subject.\n * Changes on the destination subject is NOT applied back into the source subject.\n *\n * @param source$ RxJS source subject(s). If Array provied, value of `copy$` will also be an Array by default,\n * unless a different type is provided by `copy$` or `valueModifier`.\n *\n * @param copy$ (optional) RxJS copy/destination subject.\n * If `undefined`, a new subject will be created.\n * Value type will be inferred automatically based on `copy$`, `valueModifier` and `source$`.\n * Default: `new BehaviorSubject()`\n * @param valueModifier (optional) callback to modify the value (an thus type) before copying from `source$`.\n * Accepts async functions. Function invocation errors will be gracefully ignored.\n * PS: If the very first invokation returns `IGNORE_UPDATE_SYMBOL`, the value of `copy$.value` will be undefined.\n * Args: `newValue, previousValue, copy$`\n * @param {CopyRxSubjectOptions} options (optional) options to enable debouce/throttling `copy$` value changes.\n * @param options.delay (optional) delay in milliseconds. Default: `0`\n * @param options.onError (optional) callback invoked whenever `valueModifier` execution fails.\n * @param options.throttle (optional) `true`: throttle, `false`: debounce. Default: `false`\n *\n * @returns `copy$` if provided, otherwise, a new `BehaviorSubject` instance\n *\n * @example\n * #### Auto-copy values from a single subject\n * ```typescript\n * import { BehaviorSubject, copyRxSubject } from '@superutils/rx'\n *\n * const number$ = new BehaviorSubject(1)\n * const even$ = copyRxSubject(\n * // source subject\n * number$,\n * // create and return a new BehaviorSubject. An existing RxJS subject can also be provided here.\n * null,\n * // copy and transform the value from number$\n * newValue => newValue % 2 === 0,\n * // debounce/throttle value changes to even$t\n * // {\n * // delay: 300 //\n * // throttle: false,\n * // }\n * )\n * // subscribe to even$ changes\n * even$.subscribe(console.log)\n * number$.next(2) // prints: true\n * number$.next(3) // print: false\n * ```\n *\n * @example\n * #### Auto-copy from an array of subjects & values\n * ```javascript\n * import { BehaviorSubject, copyRxSubject } from '@superutils/rx'\n *\n * const theme$ = new BehaviorSubject('dark')\n * const userId$ = new BehaviorSubject('username')\n * const settings$ = copyRxSubject(\n * [\n * \t theme$,\n * \t userId$,\n * \t 'my-fancy-app' // fixed/unobserved value\n * \t ]\n * )\n * // subscribe to the subject with reduced array values\n * settings$.subscribe(([theme, user, appName]) =>\n * \t console.log({ theme, user, appName })\n * )\n * ```\n */\nexport function copyRxSubject<\n\tTCopy extends T,\n\tTSource$,\n\tT = UnwrapSubjectValue<TSource$>,\n\tTCopy$ extends SubjectLike<TCopy> = BehaviorSubject<TCopy>,\n\tThisArg = unknown,\n>(\n\tsource$: TSource$,\n\tcopy$?: TCopy$ | null,\n\tvalueModifier?: ValueModifier<T, TCopy> | null,\n\toptions?: CopyRxSubjectOptions<ThisArg>,\n): TCopy$\n\n// Overload to allow valueModifier to transforms T into TCopy\nexport function copyRxSubject<\n\tTCopy,\n\tTSource$,\n\tT = UnwrapSubjectValue<TSource$>,\n\tTCopy$ extends SubjectLike<TCopy> = BehaviorSubject<TCopy>,\n\tThisArg = unknown,\n>(\n\tsource$: TSource$,\n\tcopy$: TCopy$ | undefined | null,\n\tvalueModifier: ValueModifier<T, TCopy> | null,\n\toptions?: CopyRxSubjectOptions<ThisArg>,\n): TCopy$\n\nexport function copyRxSubject<\n\tTCopy,\n\tTSource$,\n\tT = UnwrapSubjectValue<TSource$>,\n\tTCopy$ extends SubjectLike<TCopy> = BehaviorSubject<TCopy>,\n\tThisArg = unknown,\n>(\n\tsource$: TSource$,\n\tcopy$?: TCopy$ | null,\n\tvalueModifier?: ValueModifier<T, TCopy> | null,\n\toptions?: CopyRxSubjectOptions<ThisArg>,\n): TCopy$ {\n\tcopy$ = isSubjectLike(copy$)\n\t\t? copy$\n\t\t: (new BehaviorSubject(undefined) as unknown as TCopy$)\n\toptions = {\n\t\t...copyRxSubject.defaults,\n\t\t...(options ?? {}),\n\t} as CopyRxSubjectOptions<ThisArg>\n\tconst sourceArr = isSubjectLike(source$)\n\t\t? [source$]\n\t\t: isArr(source$)\n\t\t\t? source$\n\t\t\t: [source$]\n\tconst cache = new Map(\n\t\tsourceArr.map((subject, i) => [\n\t\t\ti,\n\t\t\tisSubjectLike(subject)\n\t\t\t\t? subject.value // use subject value if available\n\t\t\t\t: subject, // fixed value provided\n\t\t]),\n\t)\n\n\tconst triggerChange = () => {\n\t\tconst currentValue = isArr(source$) ? [...cache.values()] : cache.get(0)\n\t\tif (!isFn(valueModifier)) return copy$.next(currentValue as TCopy)\n\n\t\tconst modifiedValue = fallbackIfFails(\n\t\t\tvalueModifier,\n\t\t\t[currentValue as T, undefined, copy$],\n\t\t\terr => {\n\t\t\t\tfallbackIfFails(\n\t\t\t\t\toptions.onError?.bind(options.thisArg as ThisArg),\n\t\t\t\t\t[err],\n\t\t\t\t\tundefined,\n\t\t\t\t)\n\t\t\t\treturn IGNORE_UPDATE_SYMBOL\n\t\t\t},\n\t\t)\n\t\tmodifiedValue !== IGNORE_UPDATE_SYMBOL\n\t\t\t&& copy$.next(modifiedValue as TCopy)\n\t}\n\tconst triggerChangeDeferred = isPositiveNumber(options.delay)\n\t\t? deferred(triggerChange, options.delay, options)\n\t\t: triggerChange\n\n\tconst subscriptions = sourceArr\n\t\t.map((subject, i) => {\n\t\t\tif (!isSubjectLike(subject) || subject.closed) return\n\n\t\t\treturn (\n\t\t\t\tsubject instanceof BehaviorSubject\n\t\t\t\t\t? ((subject as BehaviorSubject<unknown>).pipe(\n\t\t\t\t\t\t\tskip(1), // skip initial value\n\t\t\t\t\t\t) as typeof subject)\n\t\t\t\t\t: subject\n\t\t\t).subscribe(newValue => {\n\t\t\t\tcache.set(i, newValue)\n\t\t\t\ttriggerChangeDeferred()\n\t\t\t})\n\t\t})\n\t\t.filter(Boolean)\n\n\tconst unsubscribeOrg = copy$?.unsubscribe?.bind(copy$)\n\tcopy$.unsubscribe = (...args) => {\n\t\tunsubscribeOrg?.(...args)\n\t\tunsubscribeAll(subscriptions)\n\t\tcache.clear()\n\t}\n\n\t// update copy$ with the initial values\n\ttriggerChange()\n\treturn copy$\n}\ncopyRxSubject.defaults = {\n\tdelay: 0,\n\tthrottle: false,\n} as { delay: number } & DeferredOptions<unknown>\ncopyRxSubject.IGNORE_UPDATE_SYMBOL = IGNORE_UPDATE_SYMBOL\n\nexport default copyRxSubject\n","/* eslint-disable @typescript-eslint/no-floating-promises */\nimport {\n\tdeferred,\n\tfallbackIfFails,\n\tfilter,\n\tfind,\n\tgetEntries,\n\tgetKeys,\n\tisArr,\n\tisFn,\n\tisMap,\n\tisPositiveNumber,\n\tisStr,\n\tmapJoin,\n\tsearch,\n\tsort,\n\tSortOptions,\n} from '@superutils/core'\nimport { BehaviorSubject, skip, Subject, Subscription } from '../rxjs'\nimport {\n\tDelayOptions,\n\tIDataStorage,\n\tOnErrorType,\n\tStorageCompact,\n\tStorageFilter,\n\tStorageFind,\n\tStorageMap,\n\tStorageOnChangeFn,\n\tStorageOnErrorFn,\n\tStorageOptions,\n\tStorageParseFn,\n\tStorageSearch,\n\tStorageSort,\n\tStorageStringifyFn,\n\tStorageToJSON,\n\tStorageValue,\n} from './types'\nimport unsubscribeAll from '../unsubscribeAll'\n\n/**\n * Force all or specific instances of DataStorage to reload data from storage\n *\n * @example\n * ```javascript\n * import { DataStorage } from '@superutils/rx'\n *\n * // Update all DataStorage instances with specific name(s)\n * const name = 'products'\n * forceUpdateCache$.next([name])\n *\n * // Update every single instance of DataStorage that uses storage (has a \"name\")\n * forceUpdateCache$.next(true)\n * ```\n */\nexport const forceUpdateCache$ = new Subject<string | string[] | boolean>()\n\nexport class DataStorage<\n\tKey,\n\tValue extends StorageValue,\n\tCacheDisabled extends boolean = false,\n> implements IDataStorage<Key, Value, CacheDisabled> {\n\treadonly cacheDisabled: CacheDisabled\n\n\treadonly delay: number\n\n\treadonly delayOptions?: DelayOptions\n\n\t/** Debounce and throttle related options */\n\t// readonly deferOptions\n\n\treadonly initialized: boolean = false\n\n\treadonly name: string\n\n\tget size() {\n\t\treturn this.getAll().size\n\t}\n\n\tspaces?: number\n\n\treadonly storage?: StorageCompact | null\n\n\treadonly subject!: CacheDisabled extends true\n\t\t? Subject<Map<Key, Value>>\n\t\t: BehaviorSubject<Map<Key, Value>>\n\n\tprivate subscriptions = {\n\t\tsubject: undefined as Subscription | undefined,\n\t\tforceUpdateCache: undefined as Subscription | undefined,\n\t}\n\n\t/**\n\t * A wrapper for reading and writing to LocalStorage (browser) or JSON files (NodeJS),\n\t * providing a Map-like interface with advanced features like search, filtering, and sorting.\n\t *\n\t * #### Notes:\n\t * - **Performance**: `DataStorage` is optimized for small to medium datasets.\n\t * - For datasets > 1MB, consider increasing the `delay` option to reduce write frequency.\n\t * - It is **NOT** recommended for datasets larger than 3MB due to synchronous serialization costs.\n\t * - **RxJS Integration**: Built on RxJS for reactive data handling, though no prior RxJS knowledge is required.\n\t * - **Storage Behavior**:\n\t * - If `name` is omitted, the instance operates in-memory only and data is not persisted to storage.\n\t * - If `cacheDisabled` is `true`, data is not kept in memory; every read/write operation accesses the underlying\n\t * storage directly.\n\t *\n\t * @example\n\t * #### Browser Usage\n\t * ```javascript\n\t * import { DataStorage } from '@superutils/rx'\n\t * import fetch from '@superutils/fetch'\n\t *\n\t * const storage = new DataStorage('products')\n\t * const { products } = await fetch('[DUMMYJSON-DOT-COM]/products')\n\t * // save all items to storage\n\t * storage.setAll(\n\t * new Map(products.map(p => [p.id, p])), // convert to Map\n\t * )\n\t *\n\t * // print product with id `1`\n\t * console.log(storage.get(1))\n\t *\n\t * // search for items\n\t * const searchResult = storage.search({\n\t * query: { availabilityStatus: 'low' }\n\t * })\n\t * console.log(searchResult)\n\t * ```\n\t * @example\n\t * #### NodeJS Usage\n\t * ```javascript\n\t * import { DataStorage } from '@superutils/rx'\n\t * import fetch from '@superutils/fetch'\n\t * import { LocalStorage } from 'node-localstorage'\n\t *\n\t * // Add localStorage alternative for NodeJS that reads and writes to JSON files.\n\t * // This is not necessary for browsers.\n\t * globalThis.localStorage = new LocalStorage('./data', 1e7)\n\t *\n\t * const storage = new DataStorage('products')\n\t * const { products } = await fetch('[DUMMYJSON-DOT-COM]/products')\n\t * // save all items to storage\n\t * storage.setAll(\n\t * new Map(products.map(p => [p.id, p])), // convert to Map\n\t * )\n\t *\n\t * // print product with id `1`\n\t * console.log(storage.get(1))\n\t *\n\t * // search for items\n\t * const searchResult = storage.search({\n\t * query: { availabilityStatus: 'low' }\n\t * })\n\t * console.log(searchResult)\n\t * ```\n\t *\n\t * @example\n\t * #### Advanced: `onChange` and RxJS subject\n\t *\n\t * Internally, `DataStorage` uses RxJS subject which is exposed as `subject` property.\n\t * You can use this to subscribe to changes and do additional operations such as logging or sanitization etc.\n\t *\n\t * Alternatively, you can also set the `onChange` callback which is triggered whenever the subject changes and\n\t * does not require maintaining a subscription or knowledge of RxJS subject.\n\t *\n\t * ```javascript\n\t * import { DataStorage } from '@superutils/rx'\n\t *\n\t * const storage = new DataStorage('my-data')\n\t * const sub = storage.subject.subscribe(data => {\n\t * // Write to the database whenever data changes\n\t * console.log('Saving to database...', data)\n\t * })\n\t * // unsubscribe from subject\n\t * setTimeout(()=> sub.unsbuscribe(), 1000)\n\t *\n\t * // add an entry to storage\n\t * storage.set('bob', { age: 99, id: 'bob', name: 'Bob' })\n\t * ```\n\t */\n\tconstructor(\n\t\tname?: string | null,\n\t\toptions?: StorageOptions<Key, Value, CacheDisabled>,\n\t) {\n\t\tconst {\n\t\t\tcacheDisabled = false as CacheDisabled,\n\t\t\tdelay,\n\t\t\tdelayOptions,\n\t\t\tinitialValue,\n\t\t\tonError,\n\t\t\tonChange,\n\t\t\tparse,\n\t\t\tspaces,\n\t\t\tstorage,\n\t\t\tstringify,\n\t\t} = options ?? {}\n\t\tthis.delay = cacheDisabled\n\t\t\t? 0\n\t\t\t: delay === 0 || isPositiveNumber(delay)\n\t\t\t\t? delay\n\t\t\t\t: 300\n\t\tthis.name = `${name ?? ''}`.trim()\n\t\tthis.onError = onError\n\t\tthis.onChange = onChange\n\t\tthis.parse = parse\n\t\tthis.storage =\n\t\t\tstorage === null\n\t\t\t\t? null\n\t\t\t\t: (storage\n\t\t\t\t\t?? fallbackIfFails(\n\t\t\t\t\t\t() => globalThis.localStorage,\n\t\t\t\t\t\t[],\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t))\n\t\tif (this.name && !this.storage)\n\t\t\tthrow new Error(\n\t\t\t\t'options.storage: LocalStorage instance or equivalent required',\n\t\t\t)\n\t\tthis.cacheDisabled = (!!this.storage && cacheDisabled) as CacheDisabled\n\t\tthis.stringify = stringify\n\t\tthis.spaces = spaces\n\t\t;(this.subject as unknown) = this.cacheDisabled\n\t\t\t? new Subject<Map<Key, Value>>()\n\t\t\t: new BehaviorSubject(undefined)\n\t\tthis.delayOptions = delayOptions\n\t\tisMap(initialValue) && initialValue.size && this.init(initialValue)\n\t}\n\n\treadonly clear = () => {\n\t\tthis.setAll(new Map<Key, Value>(), true)\n\t\treturn this\n\t}\n\n\treadonly delete = (keys: Key | Key[]) => {\n\t\tif (!isArr(keys)) keys = [keys]\n\n\t\tconst data = this.getAll()\n\t\tfor (const k of keys) data.delete(k)\n\n\t\tthis.setAll(data, true)\n\t\treturn this\n\t}\n\n\treadonly find: StorageFind<Key, Value> = predicateOrOptions =>\n\t\tfind(this.getAll(), predicateOrOptions as Parameters<typeof find>[1])\n\n\treadonly filter: StorageFilter<Key, Value> = (\n\t\tpredicate,\n\t\tlimit,\n\t\tasArray,\n\t\tresult,\n\t) => filter(this.getAll(), predicate, limit, asArray, result)\n\n\t/**\n\t * Trigger forced update of cached data from storage.\n\t *\n\t * @param name determines which storage instances to be updated.\n\t * - name (`string` | `string[]`): update all instances with a specific name(s)\n\t * - global (`true`): update all instances globally\n\t *\n\t * @example\n\t * ```javascript\n\t * import { DataStorage } from '@superutils/rx'\n\t *\n\t * // Update all DataStorage instances with specific name(s)\n\t * const name = 'products'\n\t * DataStorage.forceUpdateCache([name])\n\t *\n\t * // Update every single instance of DataStorage that uses storage (has a \"name\")\n\t * DataStorage.forceUpdateCache(true)\n\t * ```\n\t */\n\tstatic forceUpdateCache = (name: string | string[] | true) => {\n\t\tforceUpdateCache$.next(name)\n\t}\n\n\treadonly get = (key: Key) => this.getAll().get(key)\n\n\treadonly getAll = (forceRead = false) => {\n\t\tconst wasInitialized = this.initialized\n\t\tif (!wasInitialized) this.init()\n\n\t\tconst readFromStorage = this.cacheDisabled || (this.name && forceRead)\n\t\tif (readFromStorage) {\n\t\t\tconst data = this.read()\n\t\t\tconst shouldTrigger = forceRead || (!wasInitialized && !!data.size)\n\t\t\tshouldTrigger && this.subject.next(data)\n\t\t\treturn data\n\t\t}\n\n\t\treturn (this.subject as BehaviorSubject<Map<Key, Value>>)?.value\n\t}\n\n\treadonly has = (key: Key) => this.getAll().has(key)\n\n\treadonly init = (initialValue?: Map<Key, Value>) => {\n\t\tif (this.initialized) return false\n\t\t;(this.initialized as unknown) = true\n\n\t\tthis.subject instanceof BehaviorSubject\n\t\t\t&& this.subject.next(this.read())\n\n\t\tunsubscribeAll(this.subscriptions)\n\t\t// update cached data from localStorage throughout the application only when triggered\n\t\tif (!this.cacheDisabled) {\n\t\t\tthis.subscriptions.forceUpdateCache = forceUpdateCache$.subscribe(\n\t\t\t\trefresh => {\n\t\t\t\t\tconst doRefresh = !this.name\n\t\t\t\t\t\t? false\n\t\t\t\t\t\t: isArr(refresh)\n\t\t\t\t\t\t\t? refresh.includes(this.name)\n\t\t\t\t\t\t\t: isStr(refresh)\n\t\t\t\t\t\t\t\t? refresh === this.name\n\t\t\t\t\t\t\t\t: refresh === true\n\n\t\t\t\t\tif (!doRefresh) return\n\t\t\t\t\tconst newData = this.read()\n\t\t\t\t\tthis.subject.next(newData)\n\t\t\t\t},\n\t\t\t)\n\t\t}\n\t\t!(this.subject as BehaviorSubject<Map<Key, Value>>)?.value?.size\n\t\t\t&& isMap(initialValue)\n\t\t\t&& !!initialValue?.size\n\t\t\t&& this.setAll(initialValue)\n\n\t\tconst piped = this.subject.pipe(\n\t\t\tskip(this.cacheDisabled || !!initialValue?.size ? 0 : 1),\n\t\t)\n\t\tlet handleChange = (data: Map<Key, Value>) => {\n\t\t\t// in-case non-map value is set, set it to empty map\n\t\t\tif (!isMap(data)) return this.subject.next(new Map<Key, Value>())\n\n\t\t\tthis.write(data)\n\t\t\tfallbackIfFails(\n\t\t\t\tasync () => await this.onChange?.(data),\n\t\t\t\t[],\n\t\t\t\tthis.triggerOnError('onChange'),\n\t\t\t)\n\t\t}\n\t\tif (this.delay > 0)\n\t\t\thandleChange = deferred(handleChange, this.delay, this.delayOptions)\n\t\t// Subscribe to data changes and write to storage.\n\t\tthis.subscriptions.subject = piped.subscribe(handleChange)\n\t\treturn true\n\t}\n\n\treadonly keys = () => getKeys(this.getAll())\n\n\treadonly map: StorageMap<Key, Value> = callback =>\n\t\tthis.toArray().map(([key, value], index, data) =>\n\t\t\tcallback(value, key, data, index),\n\t\t)\n\n\tonChange?: StorageOnChangeFn<Key, Value>\n\n\tonError?: StorageOnErrorFn\n\n\treadonly parse?: StorageParseFn<Key, Value>\n\n\treadonly read = () => {\n\t\t// !this.initialized && this.init()\n\t\tconst dataStr = this.storage?.getItem(this.name) ?? '[]'\n\t\tconst data =\n\t\t\tisFn(this.parse)\n\t\t\t&& fallbackIfFails(\n\t\t\t\tthis.parse,\n\t\t\t\t[dataStr],\n\t\t\t\tthis.triggerOnError('parse'),\n\t\t\t)\n\t\tif (isMap<Key, Value>(data)) return data\n\n\t\t// use fallback JSON.parse if this.parse is not provided, returns non-Map value or fails\n\t\treturn new Map<Key, Value>(\n\t\t\tfallbackIfFails(\n\t\t\t\t() => JSON.parse(dataStr) as [Key, Value][],\n\t\t\t\t[],\n\t\t\t\tthis.triggerOnError('parse-json'),\n\t\t\t),\n\t\t)\n\t}\n\n\treadonly search: StorageSearch<Key, Value> = options =>\n\t\tsearch(this.getAll(), options)\n\n\treadonly set = (key: Key, value: Value) => {\n\t\tthis.setAll(new Map([[key, value]]), false)\n\t\treturn this\n\t}\n\n\treadonly setAll = (data = new Map<Key, Value>(), replace = false) => {\n\t\tif (!isMap(data)) return this\n\n\t\tdata = replace\n\t\t\t? data // override all entries\n\t\t\t: mapJoin(this.getAll(), data) // merge with existing entries and override only matching keys\n\t\tthis.subject.next(new Map(data))\n\t\treturn this\n\t}\n\n\treadonly sort: StorageSort<Key, Value> = ((nameOrComparator, options) => {\n\t\tconst result = sort(\n\t\t\tthis.getAll(),\n\t\t\tnameOrComparator as string,\n\t\t\toptions as SortOptions,\n\t\t)\n\t\toptions?.save && this.setAll(result, true)\n\n\t\treturn result\n\t}) as StorageSort<Key, Value>\n\n\treadonly stringify?: StorageStringifyFn<Key, Value>\n\n\treadonly toArray = () => getEntries(this.getAll())\n\n\treadonly toJSON: StorageToJSON<Key, Value> = (\n\t\treplacer,\n\t\tspacing = this.spaces,\n\t\tdata = this.getAll(),\n\t) => {\n\t\tconst arr = Array.from(data)\n\t\tconst str = fallbackIfFails(\n\t\t\t() => this.stringify?.(data),\n\t\t\t[],\n\t\t\tthis.triggerOnError('stringify'),\n\t\t)\n\t\tif (isStr(str)) return str\n\n\t\t// use fallback JSON.stringify if this.stringify is not provided, returns non-string value or fails\n\t\treturn fallbackIfFails(\n\t\t\t() => JSON.stringify(arr, replacer as undefined, spacing),\n\t\t\t[],\n\t\t\tthis.triggerOnError('stringify-json'),\n\t\t)\n\t}\n\n\treadonly toString = (data?: Map<Key, Value>) =>\n\t\tthis.toJSON(undefined, undefined, data)\n\n\tprivate triggerOnError = (type: OnErrorType) => (err: unknown) => {\n\t\tthis.onError && fallbackIfFails(this.onError, [err, type], '')\n\t}\n\n\treadonly unsubscribe = () => unsubscribeAll(this.subscriptions)\n\n\treadonly values = () => [...this.getAll().values()]\n\n\treadonly write = (data?: Map<Key, Value>) => {\n\t\ttry {\n\t\t\t!this.initialized && this.init()\n\t\t\tdata ??= (this.subject as BehaviorSubject<Map<Key, Value>>).value\n\n\t\t\tif (!this.name || !this.storage || !isMap(data)) return false\n\t\t\tthis.storage.setItem(this.name, this.toString(data))\n\t\t\treturn true\n\t\t} catch (err) {\n\t\t\tthis.triggerOnError('write')(err)\n\t\t\treturn false\n\t\t}\n\t}\n}\nexport default DataStorage\n","import { TimeoutId } from '@superutils/core'\nimport { BehaviorSubject } from './rxjs'\n\n/**\n * @summary\tExtention of a BehaviorSubject with interval function\n *\n * -----------------------------------------------\n *\n * @example\n * #### Fetch data from API server every minute\n * ```typescript\n * import fetch from '@superutils/fetch'\n * import { IntervalSubject } from '@superutils/rx'\n *\n * const initialValue = 0\n * const interval$ = new IntervalSubject(\n * \ttrue, // auto-start\n * \t60 * 1000, // interval delay. increment counter every \"x\" milliseconds\n * initialValue, // initial counter value\n * \t1, // increment by 1 at each interval\n * )\n *\n * const onChange = (counter: number) => {\n * counter === initialValue && console.log('Counter started')\n * fetch.get('[DUMMYJSON-DOT-COM]/http/200').then(\n * () => console.log(new Date().toISOString(), 'Successful ping'),\n * (err: Error) => console.log('Ping failed.', err)\n * )\n * }\n *\n * // BehaviorSubject automatically resolves with the initial value if subscribed immediately.\n * // subscribe to the subject and execute `onChange`: first time immediately and then every 60 seconds\n * interval$.subscribe(onChange)\n * ```\n */\nexport class IntervalSubject extends BehaviorSubject<number> {\n\tprivate _intervalId: TimeoutId\n\tprivate _running = false\n\n\tconstructor(\n\t\tpublic autoStart: boolean,\n\t\tprivate _delay = 1000,\n\t\treadonly initialValue = 0,\n\t\tpublic incrementBy = 1,\n\t) {\n\t\tsuper(initialValue)\n\t\tthis.autoStart && this.start()\n\t}\n\n\tget delay() {\n\t\treturn this._delay\n\t}\n\n\tset delay(newDelay: number) {\n\t\t// ignore if interval is alreay running\n\t\tif (!this._running) this._delay = newDelay\n\t}\n\n\tget running() {\n\t\treturn this._running\n\t}\n\n\tpause = () => {\n\t\tclearInterval(this._intervalId)\n\n\t\tthis._running = false\n\t\treturn this\n\t}\n\n\tresume = () => this.start()\n\n\tstart = () => {\n\t\tif (!this._running) {\n\t\t\tthis._running = true\n\t\t\tthis._intervalId = setInterval(\n\t\t\t\t() => this.next(this.value + this.incrementBy),\n\t\t\t\tthis._delay,\n\t\t\t)\n\t\t}\n\t\treturn this\n\t}\n\n\tstop = () => {\n\t\tthis.pause()\n\t\tthis.next(0)\n\t\treturn this\n\t}\n}\nexport default IntervalSubject\n","/* eslint-disable @typescript-eslint/no-floating-promises */\n/* eslint-disable @typescript-eslint/no-misused-promises */\nimport { fallbackIfFails, noop, TimeoutId } from '@superutils/core'\nimport { BehaviorSubject, Subscription } from './rxjs'\n\nexport type OnResultType<TResult = unknown> = (\n\terror: Error | null,\n\tresult: TResult | undefined,\n\trunCount: number,\n\tonce: boolean,\n) => void | Promise<void>\nexport type onBeforeExecType = (\n\trunCount: number,\n\tonce: boolean,\n) => void | Promise<unknown>\n\n/**\n * @summary\ta simple runner to execute a task periodically.\n *\n * When to use `IntervalRunner` instead of `IntervalSubject`?\n *\n * `IntervalRunner` is useful when the execution of the `onResult` time must be on the clock and/or must be excluded\n * from the interval delay duration.\n *\n * Example use case:\n * When an API call needs to be made periodically and there's a possibility of delayed response (due to network issues\n * or longer backend execution time). In this case, using IntervalRunner with `sequential = true` will ensure the\n * delay is consistent between completion of current and start of the next API call.\n *\n * @param\ttaskFn\t\ttask function to be executed periodically\n * @param\ttaskArgs\targuments to be supplied to the task function.\n * @param\tintervalMs\ttimer delay in milliseconds.\n * @param\tsequential\ttrue (default): will use setTimeout and will delay until execution is completed.\n * This will ensure, in case the current execution takes longer, the following execution will not occur until current one is done and the interval delay is passed.\n *\n * false: will use setInterval and the delay time to execute task will not affected. This may cause unwanted issues if the execution takes longer than the interval delay time. Use with caution.\n *\n * Default: `true`\n *\n * @param\tpreExecute\t(optional) if true, will pre-execute task before starting the timer.\n *\n * Default: `true`\n *\n * @example\n * #### Execute a function sequentially\n * Counting time will not start until function execution ends, maintaining the delay betweeen\n * end of execution consistent.\n * ```typescript\n * import fetch from '@superutils/fetch'\n * import { IntervalRunner } fro '@superutils/rx'\n *\n * const runner = new IntervalRunner(\n * fetch.get,\n * \t ['[DUMMYJSON-DOT-COM]/products'],\n * 2000,\n * )\n * runner.start(result => console.log({ result }))\n * ```\n *\n * @example\n * #### Execute a function at without enforcing sequential execution.\n * Will start counting time even if function execution is unfinied, maintaining the delay betweeen\n * start of execution consistent.\n * ```typescript\n * import fetch from '@superutils/fetch'\n * import { IntervalRunner } fro '@superutils/rx'\n *\n * const runner = new IntervalRunner(\n * fetch.get,\n * \t ['[DUMMYJSON-DOT-COM]/products'],\n * 2000,\n * false,\n * )\n * runner.start(result => console.log({ result }))\n * ```\n */\nexport class IntervalRunner<\n\tTResult = unknown,\n\tTArgs extends unknown[] = unknown[],\n> {\n\tprivate idInterval: TimeoutId | undefined\n\tpublic lastResult: TResult | undefined\n\tpublic minIntervalMs = 1000\n\tprivate onBeforeExec?: onBeforeExecType\n\tprivate onResult: OnResultType<TResult> | undefined\n\t/**\n\t * @summary RxJS BehaviorSubject to change timer delay and restart the timer\n\t */\n\treadonly intervalMs$: BehaviorSubject<number>\n\tprivate runCount = 0\n\tprivate started = false\n\tprivate subscription: Subscription | undefined\n\n\tconstructor(\n\t\treadonly taskFn: (...args: TArgs) => TResult | Promise<TResult>,\n\t\treadonly taskArgs: TArgs,\n\t\tintervalMs: BehaviorSubject<number> | number,\n\t\treadonly sequential = true, // if true, timer will start start only after execution is finished\n\t\treadonly preExecute = true, // false = delay >> execute, true = execute >> delay\n\t\t// readonly deferStartMs = 100, // unused?\n\t) {\n\t\tthis.intervalMs$ =\n\t\t\tintervalMs instanceof BehaviorSubject\n\t\t\t\t? intervalMs\n\t\t\t\t: new BehaviorSubject(intervalMs)\n\t}\n\n\tprivate clearInterval = () => {\n\t\tthis.sequential\n\t\t\t? clearTimeout(this.idInterval)\n\t\t\t: clearInterval(this.idInterval)\n\t\tthis.idInterval = undefined\n\t}\n\n\tprivate executeTask = async (\n\t\tonce = false,\n\t): Promise<TResult | undefined> => {\n\t\tlet err: unknown\n\t\tlet result: TResult | undefined\n\n\t\tif (this.sequential || once) this.clearInterval()\n\n\t\ttry {\n\t\t\t++this.runCount\n\t\t\tawait this.onBeforeExec?.(this.runCount, once)\n\t\t\tresult = await this.taskFn.apply(undefined, this.taskArgs)\n\t\t\tthis.lastResult = result\n\t\t} catch (_err) {\n\t\t\terr = _err\n\t\t}\n\n\t\tfallbackIfFails(\n\t\t\tthis.onResult,\n\t\t\t[(err as Error) ?? null, result, this.runCount, once],\n\t\t\tundefined,\n\t\t)\n\n\t\tif (\n\t\t\t!once\n\t\t\t&& this.sequential\n\t\t\t&& this.intervalMs$.value > this.minIntervalMs\n\t\t) {\n\t\t\tthis.idInterval = setTimeout(\n\t\t\t\tthis.executeTask,\n\t\t\t\tthis.intervalMs$.value,\n\t\t\t)\n\t\t}\n\t\treturn this.lastResult\n\t}\n\n\t/** Execute the task function regardless of the interval runner state */\n\texecuteOnce = async (): Promise<TResult | undefined> =>\n\t\tawait this.executeTask(true)\n\n\t/** Check if interval is running*/\n\tisStarted = () => this.started\n\n\t/**\n\t * Restart interval\n\t *\n\t * @param resetRunCount (optional) whether to reset run count\n\t *\n\t * @returns {Boolean} indicates whether restart was successful\n\t */\n\trestart = (resetRunCount = false): boolean => {\n\t\tif (!this.onResult) return false\n\n\t\tthis.stop(resetRunCount)\n\t\tthis.start(this.onResult, this.onBeforeExec)\n\t\treturn true\n\t}\n\n\t/**\n\t * @summary set `onResult` & `onBeforeExec` callbacks and start execution.\n\t *\n\t * If it's already running, the callbacks will be used on the next execution.\n\t *\n\t * In order to start using callbacks immediately, invoke the `intervalRunner.stop()` function first.\n\t *\n\t * @returns {Boolean} indicates whether starting interveral waa successful\n\t */\n\tstart = (\n\t\tonResult: OnResultType<TResult>,\n\t\tonBeforeExec?: onBeforeExecType,\n\t): boolean => {\n\t\tif (!onResult) return false\n\n\t\tthis.onResult = onResult\n\t\tthis.onBeforeExec = onBeforeExec\n\n\t\t// already started, must stop using instance.stop() in order to re-start\n\t\t// new `onResult` & `onBeforeExec` will be used on next execution\n\t\tif (this.started) return false\n\n\t\tthis.started = true\n\t\tlet delayMs: number\n\t\tthis.subscription = this.intervalMs$.subscribe(newDelayMs => {\n\t\t\t// unchanged\n\t\t\tif (delayMs === newDelayMs && newDelayMs !== undefined) return\n\n\t\t\tdelayMs = Math.max(newDelayMs ?? delayMs ?? 0, this.minIntervalMs)\n\n\t\t\tthis.clearInterval()\n\n\t\t\tconst preExec = this.lastResult === undefined && this.preExecute\n\t\t\tpreExec && this.executeTask().catch(noop)\n\n\t\t\tthis.idInterval = !this.sequential\n\t\t\t\t? setInterval(this.executeTask, delayMs)\n\t\t\t\t: !preExec\n\t\t\t\t\t? setTimeout(this.executeTask, delayMs)\n\t\t\t\t\t: undefined\n\t\t})\n\n\t\treturn true\n\t}\n\n\t/**\n\t * Stop interval runner\n\t *\n\t * @param\tresetRunCount\t(optional) whether to reset the run counter\n\t */\n\tstop = (resetRunCount = false) => {\n\t\tif (resetRunCount) this.runCount = 0\n\n\t\tthis.started = false\n\t\tthis.subscription?.unsubscribe?.()\n\n\t\tthis.clearInterval()\n\t\treturn this\n\t}\n}\n\nexport default IntervalRunner\n"]}