{"version":3,"sources":["webpack:///./node_modules/@fxts/core/dist/esm/_internal/utils.js","webpack:///./node_modules/@fxts/core/dist/esm/_internal/error.js","webpack:///./node_modules/@fxts/core/dist/esm/Lazy/map.js","webpack:///./node_modules/@fxts/core/dist/esm/pipe1.js","webpack:///./node_modules/@fxts/core/dist/esm/reduce.js","webpack:///./node_modules/@fxts/core/dist/esm/pipe.js","webpack:///./node_modules/@fxts/core/dist/esm/isNull.js","webpack:///./node_modules/@fxts/core/dist/esm/isUndefined.js","webpack:///./node_modules/@fxts/core/dist/esm/isNil.js","webpack:///./node_modules/@fxts/core/dist/esm/countBy.js","webpack:///./node_modules/@fxts/core/dist/esm/Lazy/concurrent.js","webpack:///./node_modules/@fxts/core/dist/esm/not.js","webpack:///./node_modules/@fxts/core/dist/esm/Lazy/take.js","webpack:///./node_modules/@fxts/core/dist/esm/toArray.js","webpack:///./node_modules/@fxts/core/dist/esm/Lazy/filter.js","webpack:///./node_modules/@fxts/core/dist/esm/groupBy.js","webpack:///./node_modules/@fxts/core/dist/esm/Lazy/toAsync.js","webpack:///./node_modules/@fxts/core/dist/esm/unicodeToArray.js","webpack:///./node_modules/@fxts/core/dist/esm/Lazy/fx.js"],"names":["isIterable","a","Symbol","iterator","isAsyncIterable","asyncIterator","isPromise","Promise","then","catch","AsyncFunctionException","Error","message","MESSAGE","super","f","iterable","done","value","next","undefined","res","this","_concurrent","map","TypeError","pipe1","acc","async","reduce","seed","resolve","pipe","fns","isNull","input","isUndefined","isNil","incSel","parent","k","countBy","obj","group","key","Concurrent","length","isConcurrent","concurrent","Number","isFinite","RangeError","buffer","prev","nextCallCount","resolvedItemCount","finished","pending","settlementQueue","consumeBuffer","p","shift","reject","status","reason","fillBuffer","nextItems","allSettled","Array","from","of","push","recur","not","cur","take","l","item","toArray","iter","asyncConcurrent","resolvedCount","prevItem","nextItem","cond","toFilterIterator","Boolean","_iterator","filter","groupBy","toAsync","rsAstralRange","rsComboMarksRange","reComboHalfMarksRange","rsComboSymbolsRange","rsComboMarksExtendedRange","rsComboMarksSupplementRange","rsComboRange","rsVarRange","rsAstral","rsCombo","rsFitz","rsModifier","rsNonAstral","rsRegional","rsSurrPair","rsZWJ","reOptMod","rsOptVar","rsOptJoin","join","rsSeq","rsNonAstralCombo","rsSymbol","RegExp"],"mappings":"4GAAO,SAASA,EAAWC,GACvB,MAA6E,oBAAxD,OAANA,QAAoB,IAANA,OAAe,EAASA,EAAEC,OAAOC,WAE3D,SAASC,EAAgBH,GAC5B,MAAkF,oBAA7D,OAANA,QAAoB,IAANA,OAAe,EAASA,EAAEC,OAAOG,gB,sXAe3D,MAIMC,EAAaL,GAClBA,aAAaM,SAGP,OAANN,GACa,kBAANA,GACW,oBAAXA,EAAEO,MACU,oBAAZP,EAAEQ,MC9BV,MAAMC,UAA+BC,MACxC,YAAYC,EAAUF,EAAuBG,SACzCC,MAAMF,ICAd,SAAS,EAAKG,EAAGC,GACb,MAAMb,EAAWa,EAASd,OAAOC,YACjC,MAAO,CACH,OACI,MAAM,KAAEc,EAAI,MAAEC,GAAUf,EAASgB,OACjC,GAAIF,EACA,MAAO,CACHA,MAAM,EACNC,WAAOE,GAGf,MAAMC,EAAMN,EAAEG,GACd,GAAIZ,EAAUe,GACV,MAAM,IAAIX,EAEd,MAAO,CACHO,MAAM,EACNC,MAAOG,IAGf,CAACnB,OAAOC,YACJ,OAAOmB,OAInB,SAAS,EAAMP,EAAGC,GACd,MAAMb,EAAWa,EAASd,OAAOG,iBACjC,MAAO,CACH,WAAWkB,GACP,MAAM,KAAEN,EAAI,MAAEC,SAAgBf,EAASgB,KAAKI,GAC5C,OAAIN,EACO,CAAEA,OAAMC,SACZ,CACHD,MAAM,EACNC,YAAaH,EAAEG,KAGvB,CAAChB,OAAOG,iBACJ,OAAOiB,OAInB,SAASE,EAAIT,EAAGC,GACZ,QAAiBI,IAAbJ,EACA,OAAQA,GACGQ,EAAIT,EAAGC,GAGtB,GAAIhB,EAAWgB,GACX,OAAO,EAAKD,EAAGC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B,GAAGT,KAAcH,MACpCa,GAAW,MAAM,CACnBD,GACAZ,GACAI,GACAC,GACAN,IACFW,KAAK,QAGWI,OAAO,GAAGb,QAAYA,OAAWY,GAAWF,KAAS,KCTlE7G,OAAOG,cAkOPH,OAAOC","file":"js/npm.fxts.7cc7bdb3.js","sourcesContent":["export function isIterable(a) {\n return typeof (a === null || a === void 0 ? void 0 : a[Symbol.iterator]) === \"function\";\n}\nexport function isAsyncIterable(a) {\n return typeof (a === null || a === void 0 ? void 0 : a[Symbol.asyncIterator]) === \"function\";\n}\nexport function isIterator(a) {\n return typeof (a === null || a === void 0 ? void 0 : a.next) === \"function\";\n}\nexport function toIterator(iterable) {\n if (isIterable(iterable)) {\n return iterable[Symbol.iterator]();\n }\n if (isAsyncIterable(iterable)) {\n return iterable[Symbol.asyncIterator]();\n }\n throw new TypeError(\"toIterator: iterable must be type of Iterable or AsyncIterable\");\n}\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nexport const empty = function* () { };\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nexport const asyncEmpty = async function* () { };\nexport const isNotNullable = (a) => a !== null && a !== undefined;\nexport const isPromise = (a) => {\n if (a instanceof Promise) {\n return true;\n }\n if (a !== null &&\n typeof a === \"object\" &&\n typeof a.then === \"function\" &&\n typeof a.catch === \"function\") {\n return true;\n }\n return false;\n};\n//# sourceMappingURL=utils.js.map","export class AsyncFunctionException extends Error {\n constructor(message = AsyncFunctionException.MESSAGE) {\n super(message);\n }\n}\nAsyncFunctionException.MESSAGE = `'Iterable' can not used with async function.\nIf you want to deal with async function, see: [toAsync](https://fxts.dev/docs/toAsync)`;\n//# sourceMappingURL=error.js.map","import { AsyncFunctionException } from \"../_internal/error.js\";\nimport { isAsyncIterable, isIterable, isPromise } from \"../_internal/utils.js\";\nfunction sync(f, iterable) {\n const iterator = iterable[Symbol.iterator]();\n return {\n next() {\n const { done, value } = iterator.next();\n if (done) {\n return {\n done: true,\n value: undefined,\n };\n }\n const res = f(value);\n if (isPromise(res)) {\n throw new AsyncFunctionException();\n }\n return {\n done: false,\n value: res,\n };\n },\n [Symbol.iterator]() {\n return this;\n },\n };\n}\nfunction async(f, iterable) {\n const iterator = iterable[Symbol.asyncIterator]();\n return {\n async next(_concurrent) {\n const { done, value } = await iterator.next(_concurrent);\n if (done)\n return { done, value };\n return {\n done: false,\n value: await f(value),\n };\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n };\n}\nfunction map(f, iterable) {\n if (iterable === undefined) {\n return (iterable) => {\n return map(f, iterable);\n };\n }\n if (isIterable(iterable)) {\n return sync(f, iterable);\n }\n if (isAsyncIterable(iterable)) {\n return async(f, iterable);\n }\n throw new TypeError(\"'iterable' must be type of Iterable or AsyncIterable\");\n}\nexport default map;\n//# sourceMappingURL=map.js.map","import { isPromise } from \"./_internal/utils.js\";\n/**\n * @internal\n */\nconst pipe1 = (a, f) => {\n return isPromise(a) ? a.then(f) : f(a);\n};\nexport default pipe1;\n//# sourceMappingURL=pipe1.js.map","import { isAsyncIterable, isIterable } from \"./_internal/utils.js\";\nimport pipe1 from \"./pipe1.js\";\nfunction sync(f, acc, iterable) {\n for (const a of iterable) {\n acc = f(acc, a);\n }\n return acc;\n}\nasync function async(f, acc, iterable) {\n for await (const a of iterable) {\n // becauseof using es5, use `await`\n acc = await pipe1(acc, (acc) => f(acc, a));\n }\n return acc;\n}\nfunction reduce(f, seed, iterable) {\n if (iterable === undefined) {\n if (seed === undefined) {\n return (iterable) => reduce(f, iterable);\n }\n if (isIterable(seed)) {\n const iterator = seed[Symbol.iterator]();\n const { done, value } = iterator.next();\n if (done) {\n throw new TypeError(\"'reduce' of empty iterable with no initial value\");\n }\n return sync(f, value, {\n [Symbol.iterator]() {\n return iterator;\n },\n });\n }\n if (isAsyncIterable(seed)) {\n const iterator = seed[Symbol.asyncIterator]();\n return iterator.next().then(({ done, value }) => {\n if (done) {\n throw new TypeError(\"'reduce' of empty iterable with no initial value\");\n }\n return async(f, value, {\n [Symbol.asyncIterator]() {\n return iterator;\n },\n });\n });\n }\n throw new TypeError(\"'iterable' must be type of Iterable or AsyncIterable. Are you looking for 'reduceLazy'?\");\n }\n if (isIterable(iterable)) {\n return sync(f, seed, iterable);\n }\n if (isAsyncIterable(iterable)) {\n return async(f, Promise.resolve(seed), iterable);\n }\n throw new TypeError(\"'iterable' must be type of Iterable or AsyncIterable\");\n}\nexport default reduce;\n//# sourceMappingURL=reduce.js.map","import pipe1 from \"./pipe1.js\";\nimport reduce from \"./reduce.js\";\nfunction pipe(a, ...fns) {\n return reduce(pipe1, a, fns);\n}\nexport default pipe;\n//# sourceMappingURL=pipe.js.map","/**\n * Checks if the given value is `null`.\n *\n * @example\n * ```ts\n * isNull(1); // false\n * isNull('1'); // false\n * isNull(undefined); // false\n * isNull(null); // true\n * ```\n */\nconst isNull = (input) => input === null;\nexport default isNull;\n//# sourceMappingURL=isNull.js.map","/**\n * Checks if the given value is `undefined`.\n *\n * @example\n * ```ts\n * isUndefined(undefined); // true\n * isUndefined(2); // false\n * ```\n */\nconst isUndefined = (a) => a === undefined;\nexport default isUndefined;\n//# sourceMappingURL=isUndefined.js.map","import isNull from \"./isNull.js\";\nimport isUndefined from \"./isUndefined.js\";\n/**\n * Checks if the given value is `null` or `undefined`.\n *\n * @example\n * ```ts\n * isNil(1); // false\n * isNil('1'); // false\n * isNil(undefined); // true\n * isNil(null); // true\n * ```\n */\nconst isNil = (a) => isUndefined(a) || isNull(a);\nexport default isNil;\n//# sourceMappingURL=isNil.js.map","import { AsyncFunctionException } from \"./_internal/error.js\";\nimport { isAsyncIterable, isIterable, isPromise } from \"./_internal/utils.js\";\nimport reduce from \"./reduce.js\";\nfunction incSel(parent, k) {\n parent[k] ? parent[k]++ : (parent[k] = 1);\n return parent;\n}\nfunction countBy(f, iterable) {\n if (iterable === undefined) {\n return (iterable) => {\n return countBy(f, iterable);\n };\n }\n const obj = {};\n if (isIterable(iterable)) {\n return reduce((group, a) => {\n const key = f(a);\n if (isPromise(key)) {\n throw new AsyncFunctionException();\n }\n return incSel(group, key);\n }, obj, iterable);\n }\n if (isAsyncIterable(iterable)) {\n return reduce(async (group, a) => {\n const key = await f(a);\n return incSel(group, key);\n }, obj, iterable);\n }\n throw new TypeError(\"'iterable' must be type of Iterable or AsyncIterable\");\n}\nexport default countBy;\n//# sourceMappingURL=countBy.js.map","import { isAsyncIterable } from \"../_internal/utils.js\";\nexport class Concurrent {\n constructor(length) {\n this.length = length;\n }\n static of(length) {\n return new Concurrent(length);\n }\n}\nexport const isConcurrent = (concurrent) => {\n return concurrent instanceof Concurrent;\n};\nfunction concurrent(length, iterable) {\n if (iterable === undefined) {\n return (iterable) => {\n return concurrent(length, iterable);\n };\n }\n if (!Number.isFinite(length) || length <= 0) {\n throw new RangeError(\"'length' must be positive integer\");\n }\n if (!isAsyncIterable(iterable)) {\n throw new TypeError(\"'iterable' must be type of AsyncIterable\");\n }\n const iterator = iterable[Symbol.asyncIterator]();\n const buffer = [];\n let prev = Promise.resolve();\n let nextCallCount = 0;\n let resolvedItemCount = 0;\n let finished = false;\n let pending = false;\n const settlementQueue = [];\n const consumeBuffer = () => {\n while (buffer.length > 0 && nextCallCount > resolvedItemCount) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const p = buffer.shift();\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const [resolve, reject] = settlementQueue.shift();\n if (p.status === \"fulfilled\") {\n resolvedItemCount++;\n resolve(p.value);\n if (p.value.done) {\n finished = true;\n }\n }\n else {\n reject(p.reason);\n finished = true;\n break;\n }\n }\n };\n const fillBuffer = () => {\n if (pending) {\n prev = prev.then(() => void (!finished && nextCallCount > resolvedItemCount && fillBuffer()));\n }\n else {\n const nextItems = Promise.allSettled(Array.from({ length }, () => iterator.next(Concurrent.of(length))));\n pending = true;\n prev = prev\n .then(() => nextItems)\n .then((nextItems) => {\n buffer.push(...nextItems);\n pending = false;\n recur();\n });\n }\n };\n function recur() {\n if (finished || nextCallCount === resolvedItemCount) {\n return;\n }\n else if (buffer.length > 0) {\n consumeBuffer();\n }\n else {\n fillBuffer();\n }\n }\n return {\n [Symbol.asyncIterator]() {\n return this;\n },\n next() {\n nextCallCount++;\n if (finished) {\n return { done: true, value: undefined };\n }\n return new Promise((resolve, reject) => {\n settlementQueue.push([resolve, reject]);\n recur();\n });\n },\n };\n}\nexport default concurrent;\n//# sourceMappingURL=concurrent.js.map","/**\n * Returns the `!` of its argument.\n * It will return `true` when passed falsy value, and `false` when passed a truth value.\n *\n * @example\n * ```ts\n * not(true); // false\n * not(1); // false\n * not(NaN); // true\n * ```\n *\n * {@link https://codesandbox.io/s/fxts-not-37xmk | Try It}\n */\nfunction not(a) {\n return !a;\n}\nexport default not;\n//# sourceMappingURL=not.js.map","import { isAsyncIterable, isIterable } from \"../_internal/utils.js\";\nfunction* sync(length, iterable) {\n const iterator = iterable[Symbol.iterator]();\n let cur = null;\n while (length-- > 0 && (cur = iterator.next()).done === false) {\n yield cur.value;\n }\n}\nfunction async(length, iterable) {\n const iterator = iterable[Symbol.asyncIterator]();\n return {\n [Symbol.asyncIterator]() {\n return this;\n },\n async next(_concurrent) {\n if (length-- < 1)\n return { done: true, value: undefined };\n return iterator.next(_concurrent);\n },\n };\n}\nfunction take(l, iterable) {\n if (iterable === undefined) {\n return (iterable) => {\n return take(l, iterable);\n };\n }\n if (isIterable(iterable)) {\n return sync(l, iterable);\n }\n if (isAsyncIterable(iterable)) {\n return async(l, iterable);\n }\n throw new TypeError(\"'iterable' must be type of Iterable or AsyncIterable\");\n}\nexport default take;\n//# sourceMappingURL=take.js.map","import { isAsyncIterable, isIterable } from \"./_internal/utils.js\";\nasync function async(iterable) {\n const res = [];\n for await (const item of iterable) {\n res.push(item);\n }\n return res;\n}\nfunction toArray(iter) {\n if (isAsyncIterable(iter)) {\n return async(iter);\n }\n else if (isIterable(iter)) {\n return Array.from(iter);\n }\n else {\n return [];\n }\n}\nexport default toArray;\n//# sourceMappingURL=toArray.js.map","import { AsyncFunctionException } from \"../_internal/error.js\";\nimport { isAsyncIterable, isIterable, isPromise } from \"../_internal/utils.js\";\nimport pipe1 from \"../pipe1.js\";\nimport concurrent, { isConcurrent } from \"./concurrent.js\";\nasync function* asyncSequential(f, iterable) {\n for await (const item of iterable) {\n if (await f(item))\n yield item;\n }\n}\nfunction asyncConcurrent(iterable) {\n const iterator = iterable[Symbol.asyncIterator]();\n const settlementQueue = [];\n const buffer = [];\n let finished = false;\n let nextCallCount = 0;\n let resolvedCount = 0;\n let prevItem = Promise.resolve();\n function fillBuffer(concurrent) {\n const nextItem = iterator.next(concurrent);\n prevItem = prevItem\n .then(() => nextItem)\n .then(({ done, value }) => {\n if (done) {\n while (settlementQueue.length > 0) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const [resolve] = settlementQueue.shift();\n resolve({ done: true, value: undefined });\n }\n return void (finished = true);\n }\n const [cond, item] = value;\n if (cond) {\n buffer.push(item);\n }\n recur(concurrent);\n })\n .catch((reason) => {\n finished = true;\n while (settlementQueue.length > 0) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const [, reject] = settlementQueue.shift();\n reject(reason);\n }\n });\n }\n function consumeBuffer() {\n while (buffer.length > 0 && nextCallCount > resolvedCount) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const value = buffer.shift();\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const [resolve] = settlementQueue.shift();\n resolve({ done: false, value });\n resolvedCount++;\n }\n }\n function recur(concurrent) {\n if (finished || nextCallCount === resolvedCount) {\n return;\n }\n else if (buffer.length > 0) {\n consumeBuffer();\n }\n else {\n fillBuffer(concurrent);\n }\n }\n return {\n async next(concurrent) {\n nextCallCount++;\n if (finished) {\n return { done: true, value: undefined };\n }\n return new Promise((resolve, reject) => {\n settlementQueue.push([resolve, reject]);\n recur(concurrent);\n });\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n };\n}\nfunction toFilterIterator(f, iterable) {\n const iterator = iterable[Symbol.asyncIterator]();\n return {\n [Symbol.asyncIterator]() {\n return this;\n },\n async next(_concurrent) {\n const { done, value } = await iterator.next(_concurrent);\n if (done) {\n return {\n done: true,\n value: undefined,\n };\n }\n return pipe1(f(value), (cond) => ({\n done,\n value: [Boolean(cond), value],\n }));\n },\n };\n}\nfunction async(f, iterable) {\n let _iterator;\n return {\n async next(_concurrent) {\n if (_iterator === undefined) {\n _iterator = isConcurrent(_concurrent)\n ? asyncConcurrent(concurrent(_concurrent.length, toFilterIterator(f, iterable)))\n : asyncSequential(f, iterable);\n }\n return _iterator.next(_concurrent);\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n };\n}\nfunction* sync(f, iterable) {\n for (const a of iterable) {\n const res = f(a);\n if (isPromise(res)) {\n throw new AsyncFunctionException();\n }\n if (res) {\n yield a;\n }\n }\n}\nfunction filter(f, iterable) {\n if (iterable === undefined) {\n return (iterable) => filter(f, iterable);\n }\n if (isIterable(iterable)) {\n return sync(f, iterable);\n }\n if (isAsyncIterable(iterable)) {\n return async(f, iterable);\n }\n throw new TypeError(\"'iterable' must be type of Iterable or AsyncIterable\");\n}\nexport default filter;\n//# sourceMappingURL=filter.js.map","import { AsyncFunctionException } from \"./_internal/error.js\";\nimport { isAsyncIterable, isIterable, isPromise } from \"./_internal/utils.js\";\nimport reduce from \"./reduce.js\";\nfunction groupBy(f, iterable) {\n if (iterable === undefined) {\n return (iterable) => {\n return groupBy(f, iterable);\n };\n }\n const obj = {};\n if (isIterable(iterable)) {\n return reduce((group, a) => {\n const key = f(a);\n if (isPromise(key)) {\n throw new AsyncFunctionException();\n }\n return (group[key] || (group[key] = [])).push(a), group;\n }, obj, iterable);\n }\n if (isAsyncIterable(iterable)) {\n return reduce(async (group, a) => {\n const key = await f(a);\n return (group[key] || (group[key] = [])).push(a), group;\n }, obj, iterable);\n }\n throw new TypeError(\"'iterable' must be type of Iterable or AsyncIterable\");\n}\nexport default groupBy;\n//# sourceMappingURL=groupBy.js.map","import { isPromise } from \"../_internal/utils.js\";\n/**\n * Returns AsyncIterable, `toAsync` used when you want to handle Promise values inside Iterable.\n *\n * @example\n * ```ts\n * let acc = 0;\n * for await (const item of toAsync([1, 2, 3, 4, 5])) {\n * acc += item;\n * }\n * // acc: 15\n *\n * // with pipe\n * await pipe(\n * [Promise.resolve(1),Promise.resolve(2),Promise.resolve(3)],\n * toAsync,\n * map(a => a + 10),\n * toArray, // [11, 12, 13]\n * );\n * ```\n *\n * {@link https://codesandbox.io/s/fxts-toasync-00nxr | Try It}\n *\n * see {@link https://fxts.dev/docs/pipe | pipe}, {@link https://fxts.dev/docs/toAsync | toAsync},\n * {@link https://fxts.dev/docs/toArray | toArray}\n */\nfunction toAsync(iter) {\n const iterator = iter[Symbol.iterator]();\n return {\n async next() {\n const { value, done } = iterator.next();\n if (isPromise(value)) {\n return value.then((value) => ({ done, value }));\n }\n else {\n return { done, value };\n }\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n };\n}\nexport default toAsync;\n//# sourceMappingURL=toAsync.js.map","// source: https://github.com/lodash/lodash/blob/master/.internal/unicodeToArray.js\n/** Used to compose unicode character classes. */\nconst rsAstralRange = \"\\\\ud800-\\\\udfff\";\nconst rsComboMarksRange = \"\\\\u0300-\\\\u036f\";\nconst reComboHalfMarksRange = \"\\\\ufe20-\\\\ufe2f\";\nconst rsComboSymbolsRange = \"\\\\u20d0-\\\\u20ff\";\nconst rsComboMarksExtendedRange = \"\\\\u1ab0-\\\\u1aff\";\nconst rsComboMarksSupplementRange = \"\\\\u1dc0-\\\\u1dff\";\nconst rsComboRange = rsComboMarksRange +\n reComboHalfMarksRange +\n rsComboSymbolsRange +\n rsComboMarksExtendedRange +\n rsComboMarksSupplementRange;\nconst rsVarRange = \"\\\\ufe0e\\\\ufe0f\";\n/** Used to compose unicode capture groups. */\nconst rsAstral = `[${rsAstralRange}]`;\nconst rsCombo = `[${rsComboRange}]`;\nconst rsFitz = \"\\\\ud83c[\\\\udffb-\\\\udfff]\";\nconst rsModifier = `(?:${rsCombo}|${rsFitz})`;\nconst rsNonAstral = `[^${rsAstralRange}]`;\nconst rsRegional = \"(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}\";\nconst rsSurrPair = \"[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]\";\nconst rsZWJ = \"\\\\u200d\";\n/** Used to compose unicode regexes. */\nconst reOptMod = `${rsModifier}?`;\nconst rsOptVar = `[${rsVarRange}]?`;\nconst rsOptJoin = `(?:${rsZWJ}(?:${[rsNonAstral, rsRegional, rsSurrPair].join(\"|\")})${rsOptVar + reOptMod})*`;\nconst rsSeq = rsOptVar + reOptMod + rsOptJoin;\nconst rsNonAstralCombo = `${rsNonAstral}${rsCombo}?`;\nconst rsSymbol = `(?:${[\n rsNonAstralCombo,\n rsCombo,\n rsRegional,\n rsSurrPair,\n rsAstral,\n].join(\"|\")})`;\n/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\n// eslint-disable-next-line no-misleading-character-class\nconst reUnicode = RegExp(`${rsFitz}(?=${rsFitz})|${rsSymbol + rsSeq}`, \"g\");\n/**\n * Converts a Unicode `string` to an array.\n *\n * @example\n * ```ts\n * unicodeToArray('🙇‍♂️🤩😭'); // ['🙇‍♂️','🤩','😭'];\n * ```\n */\nfunction unicodeToArray(string) {\n return string.match(reUnicode) || [];\n}\nexport default unicodeToArray;\n//# sourceMappingURL=unicodeToArray.js.map","import { isAsyncIterable, isIterable } from \"../_internal/utils.js\";\nimport consume from \"../consume.js\";\nimport each from \"../each.js\";\nimport every from \"../every.js\";\nimport find from \"../find.js\";\nimport findIndex from \"../findIndex.js\";\nimport groupBy from \"../groupBy.js\";\nimport indexBy from \"../indexBy.js\";\nimport isUndefined from \"../isUndefined.js\";\nimport join from \"../join.js\";\nimport reduce from \"../reduce.js\";\nimport some from \"../some.js\";\nimport concurrent from \"./concurrent.js\";\nimport drop from \"./drop.js\";\nimport filter from \"./filter.js\";\nimport flat from \"./flat.js\";\nimport flatMap from \"./flatMap.js\";\nimport map from \"./map.js\";\nimport peek from \"./peek.js\";\nimport reject from \"./reject.js\";\nimport slice from \"./slice.js\";\nimport take from \"./take.js\";\nimport takeUntil from \"./takeUntil.js\";\nimport takeWhile from \"./takeWhile.js\";\nimport toAsync from \"./toAsync.js\";\nclass FxAsyncIterable {\n constructor(asyncIterable) {\n this.asyncIterable = asyncIterable;\n }\n [Symbol.asyncIterator]() {\n return this.asyncIterable[Symbol.asyncIterator]();\n }\n /**\n * Returns AsyncIterable of values by running each applying `f`.\n *\n * see {@link https://fxts.dev/docs/map | map}\n */\n map(f) {\n return new FxAsyncIterable(map(f, this.asyncIterable));\n }\n /**\n * Returns flattened AsyncIterable of values by running each element\n * flattening the mapped results.\n *\n * see {@link https://fxts.dev/docs/flatMap | flatMap}\n */\n flatMap(f) {\n return new FxAsyncIterable(flatMap(f, this.asyncIterable));\n }\n /**\n * Returns flattened AsyncIterable.\n * If first argument is number, more perform flatten\n *\n * @example\n * ```\n * await fx([[1],[[2]]])\n * .toAsync()\n * .flat(2).toArray(); // [1,2]\n * ```\n *\n * see {@link https://fxts.dev/docs/flat | flat}\n */\n flat(depth) {\n return new FxAsyncIterable(flat(this.asyncIterable, depth));\n }\n /**\n * Return AsyncIterable of all elements `f` returns truthy for\n *\n * see {@link https://fxts.dev/docs/filter | filter}\n */\n filter(f) {\n return new FxAsyncIterable(filter(f, this.asyncIterable));\n }\n /**\n * The opposite of filter method\n * AsyncIterable of all elements `f` returns falsy for\n *\n * see {@link https://fxts.dev/docs/reject | reject}\n */\n reject(f) {\n return new FxAsyncIterable(reject(f, this.asyncIterable));\n }\n /**\n * Returns AsyncIterable that taken the first argument `l` values from asyncIterable\n *\n * see {@link https://fxts.dev/docs/take | take}\n */\n take(n) {\n return new FxAsyncIterable(take(n, this.asyncIterable));\n }\n /**\n * Returns AsyncIterable that taken values until truthy when given `f` is applied.\n *\n * see {@link https://fxts.dev/docs/takeUntil | takeUntil}\n */\n takeUntil(f) {\n return new FxAsyncIterable(takeUntil(f, this.asyncIterable));\n }\n /**\n * Returns AsyncIterable that taken values as long as each value satisfies the give `f`.\n *\n * see {@link https://fxts.dev/docs/takeWhile | takeWhile}\n */\n takeWhile(f) {\n return new FxAsyncIterable(takeWhile(f, this.asyncIterable));\n }\n /**\n * Iterate over an input list,\n * calling a provided `f` for each element in the AsyncIterable.\n *\n * see {@link https://fxts.dev/docs/peek | peek}\n */\n peek(f) {\n return new FxAsyncIterable(peek(f, this.asyncIterable));\n }\n /**\n * Returns all but the first `length` elements of the given asyncIterable.\n *\n * see {@link https://fxts.dev/docs/drop | drop}\n */\n drop(length) {\n return new FxAsyncIterable(drop(length, this.asyncIterable));\n }\n /**\n * Returns AsyncIterable of the given elements from startIndex(inclusive) to endIndex(exclusive).\n *\n * see {@link https://fxts.dev/docs/slice | slice}\n */\n slice(start, end) {\n return isUndefined(end)\n ? new FxAsyncIterable(slice(start, this.asyncIterable))\n : new FxAsyncIterable(slice(start, end, this.asyncIterable));\n }\n /**\n *\n * `chain` allows you to use functions that are not provided in method chaining.\n * The functions available for the `chain` argument return an iterable.\n *\n * @example\n * ```\n * await fx(toAsync(range(1, 4)))\n * .chain(append(4))\n * .chain(append(5))\n * .toArray(); // [1, 2, 3, 4, 5]\n * ```\n */\n chain(f) {\n return new FxAsyncIterable(f(this.asyncIterable));\n }\n /**\n * Concurrent is used to balance the load of multiple asynchronous requests.\n * The first argument receives a number that controls the number of loads, and the second argument is an AsyncIterable.\n *\n * see {@link https://fxts.dev/docs/concurrent | concurrent}\n */\n concurrent(length) {\n return new FxAsyncIterable(concurrent(length, this.asyncIterable));\n }\n async consume() {\n return consume(this.asyncIterable);\n }\n /**\n * Splits AsyncIterable into sets, grouped by the result of running each value through `f`.\n *\n * see {@link https://fxts.dev/docs/groupBy | groupBy}\n */\n async groupBy(f) {\n return groupBy(f, this.asyncIterable);\n }\n /**\n * Given `f` that generates a key,\n * turns a list of objects into an object indexing the objects by the given key.\n * Note that if multiple objects generate the same value for the indexing key only the last value will be included in the generated object.\n *\n * see {@link https://fxts.dev/docs/indexBy | indexBy}\n */\n async indexBy(f) {\n return indexBy(f, this.asyncIterable);\n }\n /**\n * Returns true if any of the values in AsyncIterable pass `f` truth test\n *\n * see {@link https://fxts.dev/docs/some | some}\n */\n async some(f) {\n return some(f, this.asyncIterable);\n }\n /**\n * Returns true if all of the values in AsyncIterable pass the `f` truth test.\n *\n * see {@link https://fxts.dev/docs/every | every}\n */\n async every(f) {\n return every(f, this.asyncIterable);\n }\n /**\n * Returns all elements in the given iterable into a string separated by separator.\n *\n * see {@link https://fxts.dev/docs/join | join}\n */\n async join(sep) {\n return join(sep, this.asyncIterable);\n }\n /**\n * Looks through each value in AsyncIterable, returning the first one that passes a truth test `f`,\n * or `undefined` if no value passes the test.\n *\n * see {@link https://fxts.dev/docs/find | find}\n */\n async find(f) {\n return find(f, this.asyncIterable);\n }\n /**\n * Returns the index of the first element of AsyncIterable which matches f, or -1 if no element matches.\n *\n * see {@link https://fxts.dev/docs/findIndex | findIndex}\n */\n async findIndex(f) {\n return findIndex(f, this.asyncIterable);\n }\n /**\n * Also known as foldl, this method boils down a list of values into a single value.\n *\n * see {@link https://fxts.dev/docs/reduce | reduce}\n */\n async reduce(f, seed) {\n return isUndefined(seed)\n ? reduce(f, this.asyncIterable)\n : reduce(f, seed, this.asyncIterable);\n }\n /**\n * Iterates over AsyncIterable, applying each in turn to `f`.\n *\n * see {@link https://fxts.dev/docs/each | each}\n */\n async each(f) {\n return each(f, this.asyncIterable);\n }\n /**\n * Takes item from AsyncIterable and returns an array.\n *\n * see {@link https://fxts.dev/docs/toArray | toArray}\n */\n async toArray() {\n const array = [];\n for await (const a of this.asyncIterable) {\n array.push(a);\n }\n return array;\n }\n}\nexport class FxIterable {\n constructor(iterable) {\n this.iterable = iterable;\n }\n [Symbol.iterator]() {\n return this.iterable[Symbol.iterator]();\n }\n /**\n * Returns Iterable of values by running each applying `f`.\n *\n * see {@link https://fxts.dev/docs/map | map}\n */\n map(f) {\n return new FxIterable(map(f, this.iterable));\n }\n /**\n * Returns flattened Iterable of values by running each element\n * flattening the mapped results.\n *\n * see {@link https://fxts.dev/docs/flatMap | flatMap}\n */\n flatMap(f) {\n return new FxIterable(flatMap(f, this.iterable));\n }\n /**\n * Returns flattened Iterable.\n * If first argument is number, more perform flatten\n *\n * @example\n * `fx([[1],[[2]]]).flat(2).toArray(); // [1,2]`\n *\n * see {@link https://fxts.dev/docs/flat | flat}\n */\n flat(depth) {\n const res = flat(this.iterable, depth);\n return new FxIterable(res);\n }\n /**\n * Return Iterable of all elements `f` returns truthy for\n *\n * see {@link https://fxts.dev/docs/filter | filter}\n */\n filter(f) {\n return new FxIterable(filter(f, this.iterable));\n }\n /**\n * The opposite of filter method\n * Iterable of all elements `f` returns falsy for\n *\n * see {@link https://fxts.dev/docs/reject | reject}\n */\n reject(f) {\n return new FxIterable(reject(f, this.iterable));\n }\n /**\n * Returns Iterable that taken the first argument `l` values from iterable\n *\n * see {@link https://fxts.dev/docs/take | take}\n */\n take(n) {\n return new FxIterable(take(n, this.iterable));\n }\n /**\n * Returns Iterable that taken values until truthy when given `f` is applied.\n *\n * see {@link https://fxts.dev/docs/takeUntil | takeUntil}\n */\n takeUntil(f) {\n return new FxIterable(takeUntil(f, this.iterable));\n }\n /**\n * Returns Iterable that taken values as long as each value satisfies the give `f`.\n *\n * see {@link https://fxts.dev/docs/takeWhile | takeWhile}\n */\n takeWhile(f) {\n return new FxIterable(takeWhile(f, this.iterable));\n }\n /**\n * Iterate over an input list,\n * calling a provided `f` for each element in the Iterable.\n *\n * see {@link https://fxts.dev/docs/peek | peek}\n */\n peek(f) {\n return new FxIterable(peek(f, this.iterable));\n }\n /**\n * Returns all but the first `length` elements of the given iterable.\n *\n * see {@link https://fxts.dev/docs/drop | drop}\n */\n drop(length) {\n return new FxIterable(drop(length, this.iterable));\n }\n /**\n * Returns Iterable of the given elements from startIndex(inclusive) to endIndex(exclusive).\n *\n * see {@link https://fxts.dev/docs/slice | slice}\n */\n slice(start, end) {\n return isUndefined(end)\n ? new FxIterable(slice(start, this.iterable))\n : new FxIterable(slice(start, end, this.iterable));\n }\n /**\n *\n * `chain` allows you to use functions that are not provided in method chaining.\n * The functions available for the `chain` argument return an asyncIterable.\n *\n * @example\n * ```\n * fx(range(1, 4))\n * .chain(append(4))\n * .chain(append(5))\n * .toArray(); // [1, 2, 3, 4, 5]\n * ```\n */\n chain(f) {\n return new FxIterable(f(this.iterable));\n }\n /**\n * Returns AsyncIterable, `toAsync` used when you want to handle Promise values inside Iterable.\n *\n * see {@link https://fxts.dev/docs/toAsync | toAsync}\n */\n toAsync() {\n return new FxAsyncIterable(toAsync(this.iterable));\n }\n /**\n * Splits Iterable into sets, grouped by the result of running each value through `f`.\n *\n * see {@link https://fxts.dev/docs/groupBy | groupBy}\n */\n groupBy(f) {\n return groupBy(f, this.iterable);\n }\n /**\n * Given `f` that generates a key,\n * turns a list of objects into an object indexing the objects by the given key.\n * Note that if multiple objects generate the same value for the indexing key only the last value will be included in the generated object.\n *\n * see {@link https://fxts.dev/docs/indexBy | indexBy}\n */\n indexBy(f) {\n return indexBy(f, this.iterable);\n }\n /**\n * Returns true if any of the values in AsyncIterable pass `f` truth test\n *\n * see {@link https://fxts.dev/docs/some | some}\n */\n some(f) {\n return some(f, this.iterable);\n }\n /**\n * Returns true if all of the values in AsyncIterable pass the `f` truth test.\n *\n * see {@link https://fxts.dev/docs/every | every}\n */\n every(f) {\n return every(f, this.iterable);\n }\n /**\n * Returns all elements in the given iterable into a string separated by separator.\n *\n * see {@link https://fxts.dev/docs/join | join}\n */\n join(sep) {\n return join(sep, this.iterable);\n }\n /**\n * Looks through each value in AsyncIterable, returning the first one that passes a truth test `f`,\n * or `undefined` if no value passes the test.\n *\n * see {@link https://fxts.dev/docs/find | find}\n */\n find(f) {\n return find(f, this.iterable);\n }\n /**\n * Returns the index of the first element of AsyncIterable which matches f, or -1 if no element matches.\n *\n * see {@link https://fxts.dev/docs/findIndex | findIndex}\n */\n findIndex(f) {\n return findIndex(f, this.iterable);\n }\n /**\n * Also known as foldl, this method boils down a list of values into a single value.\n *\n * see {@link https://fxts.dev/docs/reduce | reduce}\n */\n reduce(f, seed) {\n return isUndefined(seed)\n ? reduce(f, this.iterable)\n : reduce(f, seed, this.iterable);\n }\n /**\n * Iterates over Iterable, applying each in turn to `f`.\n *\n * see {@link https://fxts.dev/docs/each | each}\n */\n each(f) {\n return each(f, this.iterable);\n }\n /**\n * Takes item from Iterable and returns an array.\n *\n * see {@link https://fxts.dev/docs/toArray | toArray}\n */\n toArray() {\n return Array.from(this.iterable);\n }\n toIterator() {\n return Array.from(this.iterable);\n }\n}\n/**\n * `fx` allows functions provided by existing `fxts` to be used in a method chaining.\n * Not all functions are provided as methods and can be connected through `chain` if necessary.\n *\n * see {@link https://fxts.dev/docs/method-chaining | guide}\n *\n * @example\n * ```ts\n * const syncArr1 = fx([1, 2, 3, 4])\n * .map((a) => a + 10)\n * .toArray(); // [11, 12, 13, 14]\n *\n * // If you want to use another function that is not provided for the method, use `chain`.\n * const syncArr2 = fx([1, 2, 3, 4])\n * .chain(append(5))\n * .map((a) => a + 10)\n * .toArray(); // [11, 12, 13, 14, 15]\n *\n * const asyncArr1 = await fx([1, 2, 3, 4])\n * .toAsync()\n * .map((a) => a + 10)\n * .toArray(); // [11, 12, 13, 14]\n *\n * const asyncArr2 = await fx(toAsync([1, 2, 3, 4]))\n * .map((a) => a + 10)\n * .toArray(); // [11, 12, 13, 14]\n * ```\n */\nfunction fx(a) {\n if (isAsyncIterable(a)) {\n return new FxAsyncIterable(a);\n }\n else if (isIterable(a)) {\n return new FxIterable(a);\n }\n throw new TypeError(`'fx' must be type of Iterable or AsyncIterable`);\n}\nexport default fx;\n//# sourceMappingURL=fx.js.map"],"sourceRoot":""}