From 770b25ae39387a99dfd6285839857a8df82666eb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Sep 2021 23:20:57 +0800 Subject: [PATCH] chore(deps): bump fp-ts from 2.9.5 to 2.11.4 (#102) * chore(deps): bump fp-ts from 2.9.5 to 2.11.4 Bumps [fp-ts](https://github.com/gcanti/fp-ts) from 2.9.5 to 2.11.4. - [Release notes](https://github.com/gcanti/fp-ts/releases) - [Changelog](https://github.com/gcanti/fp-ts/blob/master/CHANGELOG.md) - [Commits](https://github.com/gcanti/fp-ts/compare/2.9.5...2.11.4) --- updated-dependencies: - dependency-name: fp-ts dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * build Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Fuxing Loh --- dist/index.js | 16589 +++++++++++++++++++++++++++----------------- dist/index.js.map | 2 +- package-lock.json | 14 +- package.json | 2 +- 4 files changed, 10408 insertions(+), 6199 deletions(-) diff --git a/dist/index.js b/dist/index.js index ab77d83..ce3c730 100644 --- a/dist/index.js +++ b/dist/index.js @@ -5128,6 +5128,210 @@ class Deprecation extends Error { exports.Deprecation = Deprecation; +/***/ }), + +/***/ 4766: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getApplicativeComposition = exports.getApplicativeMonoid = void 0; +/** + * The `Applicative` type class extends the `Apply` type class with a `of` function, which can be used to create values + * of type `f a` from values of type `a`. + * + * Where `Apply` provides the ability to lift functions of two or more arguments to functions whose arguments are + * wrapped using `f`, and `Functor` provides the ability to lift functions of one argument, `pure` can be seen as the + * function which lifts functions of _zero_ arguments. That is, `Applicative` functors support a lifting operation for + * any number of function arguments. + * + * Instances must satisfy the following laws in addition to the `Apply` laws: + * + * 1. Identity: `A.ap(A.of(a => a), fa) <-> fa` + * 2. Homomorphism: `A.ap(A.of(ab), A.of(a)) <-> A.of(ab(a))` + * 3. Interchange: `A.ap(fab, A.of(a)) <-> A.ap(A.of(ab => ab(a)), fab)` + * + * Note. `Functor`'s `map` can be derived: `A.map(x, f) = A.ap(A.of(f), x)` + * + * @since 2.0.0 + */ +var Apply_1 = __nccwpck_require__(205); +var function_1 = __nccwpck_require__(6985); +var Functor_1 = __nccwpck_require__(5533); +function getApplicativeMonoid(F) { + var f = Apply_1.getApplySemigroup(F); + return function (M) { return ({ + concat: f(M).concat, + empty: F.of(M.empty) + }); }; +} +exports.getApplicativeMonoid = getApplicativeMonoid; +/** @deprecated */ +function getApplicativeComposition(F, G) { + var map = Functor_1.getFunctorComposition(F, G).map; + var _ap = Apply_1.ap(F, G); + return { + map: map, + of: function (a) { return F.of(G.of(a)); }, + ap: function (fgab, fga) { return function_1.pipe(fgab, _ap(fga)); } + }; +} +exports.getApplicativeComposition = getApplicativeComposition; + + +/***/ }), + +/***/ 205: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.sequenceS = exports.sequenceT = exports.getApplySemigroup = exports.apS = exports.apSecond = exports.apFirst = exports.ap = void 0; +var function_1 = __nccwpck_require__(6985); +function ap(F, G) { + return function (fa) { return function (fab) { + return F.ap(F.map(fab, function (gab) { return function (ga) { return G.ap(gab, ga); }; }), fa); + }; }; +} +exports.ap = ap; +function apFirst(A) { + return function (second) { return function (first) { + return A.ap(A.map(first, function (a) { return function () { return a; }; }), second); + }; }; +} +exports.apFirst = apFirst; +function apSecond(A) { + return function (second) { return function (first) { + return A.ap(A.map(first, function () { return function (b) { return b; }; }), second); + }; }; +} +exports.apSecond = apSecond; +function apS(F) { + return function (name, fb) { return function (fa) { + return F.ap(F.map(fa, function (a) { return function (b) { + var _a; + return Object.assign({}, a, (_a = {}, _a[name] = b, _a)); + }; }), fb); + }; }; +} +exports.apS = apS; +function getApplySemigroup(F) { + return function (S) { return ({ + concat: function (first, second) { + return F.ap(F.map(first, function (x) { return function (y) { return S.concat(x, y); }; }), second); + } + }); }; +} +exports.getApplySemigroup = getApplySemigroup; +function curried(f, n, acc) { + return function (x) { + var combined = Array(acc.length + 1); + for (var i = 0; i < acc.length; i++) { + combined[i] = acc[i]; + } + combined[acc.length] = x; + return n === 0 ? f.apply(null, combined) : curried(f, n - 1, combined); + }; +} +var tupleConstructors = { + 1: function (a) { return [a]; }, + 2: function (a) { return function (b) { return [a, b]; }; }, + 3: function (a) { return function (b) { return function (c) { return [a, b, c]; }; }; }, + 4: function (a) { return function (b) { return function (c) { return function (d) { return [a, b, c, d]; }; }; }; }, + 5: function (a) { return function (b) { return function (c) { return function (d) { return function (e) { return [a, b, c, d, e]; }; }; }; }; } +}; +function getTupleConstructor(len) { + if (!tupleConstructors.hasOwnProperty(len)) { + tupleConstructors[len] = curried(function_1.tuple, len - 1, []); + } + return tupleConstructors[len]; +} +function sequenceT(F) { + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var len = args.length; + var f = getTupleConstructor(len); + var fas = F.map(args[0], f); + for (var i = 1; i < len; i++) { + fas = F.ap(fas, args[i]); + } + return fas; + }; +} +exports.sequenceT = sequenceT; +function getRecordConstructor(keys) { + var len = keys.length; + switch (len) { + case 1: + return function (a) { + var _a; + return (_a = {}, _a[keys[0]] = a, _a); + }; + case 2: + return function (a) { return function (b) { + var _a; + return (_a = {}, _a[keys[0]] = a, _a[keys[1]] = b, _a); + }; }; + case 3: + return function (a) { return function (b) { return function (c) { + var _a; + return (_a = {}, _a[keys[0]] = a, _a[keys[1]] = b, _a[keys[2]] = c, _a); + }; }; }; + case 4: + return function (a) { return function (b) { return function (c) { return function (d) { + var _a; + return (_a = {}, + _a[keys[0]] = a, + _a[keys[1]] = b, + _a[keys[2]] = c, + _a[keys[3]] = d, + _a); + }; }; }; }; + case 5: + return function (a) { return function (b) { return function (c) { return function (d) { return function (e) { + var _a; + return (_a = {}, + _a[keys[0]] = a, + _a[keys[1]] = b, + _a[keys[2]] = c, + _a[keys[3]] = d, + _a[keys[4]] = e, + _a); + }; }; }; }; }; + default: + return curried(function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var r = {}; + for (var i = 0; i < len; i++) { + r[keys[i]] = args[i]; + } + return r; + }, len - 1, []); + } +} +function sequenceS(F) { + return function (r) { + var keys = Object.keys(r); + var len = keys.length; + var f = getRecordConstructor(keys); + var fr = F.map(r[keys[0]], f); + for (var i = 1; i < len; i++) { + fr = F.ap(fr, r[keys[i]]); + } + return fr; + }; +} +exports.sequenceS = sequenceS; + + /***/ }), /***/ 3834: @@ -5155,98 +5359,107 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.rotate = exports.intersperse = exports.prependToAll = exports.unzip = exports.zip = exports.zipWith = exports.sort = exports.lefts = exports.rights = exports.reverse = exports.modifyAt = exports.deleteAt = exports.updateAt = exports.insertAt = exports.copy = exports.findLastIndex = exports.findLastMap = exports.findLast = exports.findFirstMap = exports.findFirst = exports.findIndex = exports.dropLeftWhile = exports.dropRight = exports.dropLeft = exports.spanLeft = exports.takeLeftWhile = exports.takeRight = exports.takeLeft = exports.init = exports.tail = exports.last = exports.head = exports.snoc = exports.cons = exports.lookup = exports.isOutOfBound = exports.isNonEmpty = exports.isEmpty = exports.scanRight = exports.scanLeft = exports.foldRight = exports.foldLeft = exports.flatten = exports.replicate = exports.range = exports.makeBy = exports.getOrd = exports.getEq = exports.getMonoid = exports.getShow = void 0; -exports.Applicative = exports.FunctorWithIndex = exports.Functor = exports.URI = exports.zero = exports.unfold = exports.wilt = exports.wither = exports.traverseWithIndex = exports.sequence = exports.traverse = exports.reduceRightWithIndex = exports.reduceRight = exports.reduceWithIndex = exports.reduce = exports.foldMapWithIndex = exports.foldMap = exports.duplicate = exports.extend = exports.filterWithIndex = exports.filterMapWithIndex = exports.alt = exports.altW = exports.partitionMapWithIndex = exports.partitionMap = exports.partitionWithIndex = exports.partition = exports.filterMap = exports.filter = exports.separate = exports.compact = exports.mapWithIndex = exports.chainFirst = exports.chainWithIndex = exports.chain = exports.apSecond = exports.apFirst = exports.ap = exports.map = exports.of = exports.difference = exports.intersection = exports.union = exports.comprehension = exports.chunksOf = exports.splitAt = exports.chop = exports.sortBy = exports.uniq = exports.elem = void 0; -exports.apS = exports.bind = exports.bindTo = exports.Do = exports.some = exports.every = exports.empty = exports.unsafeDeleteAt = exports.unsafeUpdateAt = exports.unsafeInsertAt = exports.array = exports.Witherable = exports.TraversableWithIndex = exports.Traversable = exports.FoldableWithIndex = exports.Foldable = exports.FilterableWithIndex = exports.Filterable = exports.Compactable = exports.Extend = exports.Alternative = exports.Alt = exports.Unfoldable = exports.Monad = void 0; +exports.lefts = exports.rights = exports.reverse = exports.modifyAt = exports.deleteAt = exports.updateAt = exports.insertAt = exports.copy = exports.findLastIndex = exports.findLastMap = exports.findLast = exports.findFirstMap = exports.findFirst = exports.findIndex = exports.dropLeftWhile = exports.dropRight = exports.dropLeft = exports.spanLeft = exports.takeLeftWhile = exports.takeRight = exports.takeLeft = exports.init = exports.tail = exports.last = exports.head = exports.lookup = exports.isOutOfBound = exports.size = exports.scanRight = exports.scanLeft = exports.chainWithIndex = exports.foldRight = exports.matchRight = exports.matchRightW = exports.foldLeft = exports.matchLeft = exports.matchLeftW = exports.match = exports.matchW = exports.fromEither = exports.fromOption = exports.fromPredicate = exports.replicate = exports.makeBy = exports.appendW = exports.append = exports.prependW = exports.prepend = exports.isNonEmpty = exports.isEmpty = void 0; +exports.traverseWithIndex = exports.sequence = exports.traverse = exports.reduceRightWithIndex = exports.reduceRight = exports.reduceWithIndex = exports.reduce = exports.foldMapWithIndex = exports.foldMap = exports.duplicate = exports.extend = exports.filterWithIndex = exports.alt = exports.altW = exports.partitionMapWithIndex = exports.partitionMap = exports.partitionWithIndex = exports.partition = exports.filter = exports.separate = exports.compact = exports.filterMap = exports.filterMapWithIndex = exports.mapWithIndex = exports.flatten = exports.chain = exports.ap = exports.map = exports.zero = exports.of = exports.difference = exports.intersection = exports.union = exports.concat = exports.concatW = exports.comprehension = exports.fromOptionK = exports.chunksOf = exports.splitAt = exports.chop = exports.sortBy = exports.uniq = exports.elem = exports.rotate = exports.intersperse = exports.prependAll = exports.unzip = exports.zip = exports.zipWith = exports.sort = void 0; +exports.some = exports.every = exports.unsafeDeleteAt = exports.unsafeUpdateAt = exports.unsafeInsertAt = exports.fromEitherK = exports.FromEither = exports.filterE = exports.ChainRecBreadthFirst = exports.chainRecBreadthFirst = exports.ChainRecDepthFirst = exports.chainRecDepthFirst = exports.Witherable = exports.TraversableWithIndex = exports.Traversable = exports.FoldableWithIndex = exports.Foldable = exports.FilterableWithIndex = exports.Filterable = exports.Compactable = exports.Extend = exports.Alternative = exports.guard = exports.Zero = exports.Alt = exports.Unfoldable = exports.Monad = exports.chainFirst = exports.Chain = exports.Applicative = exports.apSecond = exports.apFirst = exports.Apply = exports.FunctorWithIndex = exports.Pointed = exports.flap = exports.Functor = exports.getDifferenceMagma = exports.getIntersectionSemigroup = exports.getUnionMonoid = exports.getUnionSemigroup = exports.getOrd = exports.getEq = exports.getMonoid = exports.getSemigroup = exports.getShow = exports.URI = exports.unfold = exports.wilt = exports.wither = void 0; +exports.array = exports.prependToAll = exports.snoc = exports.cons = exports.empty = exports.range = exports.apS = exports.bind = exports.bindTo = exports.Do = exports.exists = void 0; +var Apply_1 = __nccwpck_require__(205); +var Chain_1 = __nccwpck_require__(2372); +var FromEither_1 = __nccwpck_require__(1964); +var function_1 = __nccwpck_require__(6985); +var Functor_1 = __nccwpck_require__(5533); +var _ = __importStar(__nccwpck_require__(1840)); +var NEA = __importStar(__nccwpck_require__(240)); var RA = __importStar(__nccwpck_require__(4234)); +var Separated_1 = __nccwpck_require__(5877); +var Witherable_1 = __nccwpck_require__(4384); +var Zero_1 = __nccwpck_require__(9734); // ------------------------------------------------------------------------------------- -// model +// refinements // ------------------------------------------------------------------------------------- -/* tslint:disable:readonly-array */ -/** - * @category instances - * @since 2.0.0 - */ -exports.getShow = RA.getShow; /** - * Returns a `Monoid` for `Array` + * Test whether an array is empty * * @example - * import { getMonoid } from 'fp-ts/Array' + * import { isEmpty } from 'fp-ts/Array' * - * const M = getMonoid() - * assert.deepStrictEqual(M.concat([1, 2], [3, 4]), [1, 2, 3, 4]) + * assert.strictEqual(isEmpty([]), true) * - * @category instances + * @category refinements * @since 2.0.0 */ -exports.getMonoid = RA.getMonoid; +var isEmpty = function (as) { return as.length === 0; }; +exports.isEmpty = isEmpty; /** - * Derives an `Eq` over the `Array` of a given element type from the `Eq` of that type. The derived `Eq` defines two - * arrays as equal if all elements of both arrays are compared equal pairwise with the given `E`. In case of arrays of - * different lengths, the result is non equality. - * - * @example - * import { eqString } from 'fp-ts/Eq' - * import { getEq } from 'fp-ts/Array' - * - * const E = getEq(eqString) - * assert.strictEqual(E.equals(['a', 'b'], ['a', 'b']), true) - * assert.strictEqual(E.equals(['a'], []), false) + * Test whether an array is non empty narrowing down the type to `NonEmptyArray` * - * @category instances + * @category refinements * @since 2.0.0 */ -exports.getEq = RA.getEq; +exports.isNonEmpty = NEA.isNonEmpty; +// ------------------------------------------------------------------------------------- +// constructors +// ------------------------------------------------------------------------------------- /** - * Derives an `Ord` over the `Array` of a given element type from the `Ord` of that type. The ordering between two such - * arrays is equal to: the first non equal comparison of each arrays elements taken pairwise in increasing order, in - * case of equality over all the pairwise elements; the longest array is considered the greatest, if both arrays have - * the same length, the result is equality. + * Prepend an element to the front of a `Array`, creating a new `NonEmptyArray`. * * @example - * import { getOrd } from 'fp-ts/Array' - * import { ordString } from 'fp-ts/Ord' + * import { prepend } from 'fp-ts/Array' + * import { pipe } from 'fp-ts/function' * - * const O = getOrd(ordString) - * assert.strictEqual(O.compare(['b'], ['a']), 1) - * assert.strictEqual(O.compare(['a'], ['a']), 0) - * assert.strictEqual(O.compare(['a'], ['b']), -1) + * assert.deepStrictEqual(pipe([2, 3, 4], prepend(1)), [1, 2, 3, 4]) * - * @category instances - * @since 2.0.0 + * @category constructors + * @since 2.10.0 */ -exports.getOrd = RA.getOrd; -// ------------------------------------------------------------------------------------- -// constructors -// ------------------------------------------------------------------------------------- +exports.prepend = NEA.prepend; +/** + * Less strict version of [`prepend`](#prepend). + * + * @category constructors + * @since 2.11.0 + */ +exports.prependW = NEA.prependW; /** - * Return a list of length `n` with element `i` initialized with `f(i)` + * Append an element to the end of a `Array`, creating a new `NonEmptyArray`. * * @example - * import { makeBy } from 'fp-ts/Array' + * import { append } from 'fp-ts/Array' + * import { pipe } from 'fp-ts/function' * - * const double = (n: number): number => n * 2 - * assert.deepStrictEqual(makeBy(5, double), [0, 2, 4, 6, 8]) + * assert.deepStrictEqual(pipe([1, 2, 3], append(4)), [1, 2, 3, 4]) * * @category constructors - * @since 2.0.0 + * @since 2.10.0 + */ +exports.append = NEA.append; +/** + * Less strict version of [`append`](#append). + * + * @category constructors + * @since 2.11.0 */ -exports.makeBy = RA.makeBy; +exports.appendW = NEA.appendW; /** - * Create an array containing a range of integers, including both endpoints + * Return a `Array` of length `n` with element `i` initialized with `f(i)`. + * + * **Note**. `n` is normalized to a non negative integer. * * @example - * import { range } from 'fp-ts/Array' + * import { makeBy } from 'fp-ts/Array' * - * assert.deepStrictEqual(range(1, 5), [1, 2, 3, 4, 5]) + * const double = (n: number): number => n * 2 + * assert.deepStrictEqual(makeBy(5, double), [0, 2, 4, 6, 8]) * * @category constructors * @since 2.0.0 */ -exports.range = RA.range; +var makeBy = function (n, f) { return (n <= 0 ? [] : NEA.makeBy(f)(n)); }; +exports.makeBy = makeBy; /** - * Create an array containing a value repeated the specified number of times + * Create a `Array` containing a value repeated the specified number of times. + * + * **Note**. `n` is normalized to a non negative integer. * * @example * import { replicate } from 'fp-ts/Array' @@ -5256,41 +5469,112 @@ exports.range = RA.range; * @category constructors * @since 2.0.0 */ -exports.replicate = RA.replicate; +var replicate = function (n, a) { return exports.makeBy(n, function () { return a; }); }; +exports.replicate = replicate; +function fromPredicate(predicate) { + return function (a) { return (predicate(a) ? [a] : []); }; +} +exports.fromPredicate = fromPredicate; +// ------------------------------------------------------------------------------------- +// natural transformations +// ------------------------------------------------------------------------------------- +/** + * @category natural transformations + * @since 2.11.0 + */ +var fromOption = function (ma) { return (_.isNone(ma) ? [] : [ma.value]); }; +exports.fromOption = fromOption; /** - * Removes one level of nesting. - * - * Derivable from `Monad`. + * @category natural transformations + * @since 2.11.0 + */ +var fromEither = function (e) { return (_.isLeft(e) ? [] : [e.right]); }; +exports.fromEither = fromEither; +// ------------------------------------------------------------------------------------- +// destructors +// ------------------------------------------------------------------------------------- +/** + * Less strict version of [`match`](#match). * - * @example - * import { flatten } from 'fp-ts/Array' + * @category destructors + * @since 2.11.0 + */ +var matchW = function (onEmpty, onNonEmpty) { return function (as) { + return exports.isNonEmpty(as) ? onNonEmpty(as) : onEmpty(); +}; }; +exports.matchW = matchW; +/** + * Less strict version of [`match`](#match). * - * assert.deepStrictEqual(flatten([[1], [2], [3]]), [1, 2, 3]) + * @category destructors + * @since 2.11.0 + */ +exports.match = exports.matchW; +/** + * Less strict version of [`matchLeft`](#matchleft). * - * @category combinators - * @since 2.0.0 + * @category destructors + * @since 2.11.0 */ -exports.flatten = RA.flatten; +var matchLeftW = function (onEmpty, onNonEmpty) { return function (as) { return (exports.isNonEmpty(as) ? onNonEmpty(NEA.head(as), NEA.tail(as)) : onEmpty()); }; }; +exports.matchLeftW = matchLeftW; /** - * Break an array into its first element and remaining elements + * Break an `Array` into its first element and remaining elements. * * @example - * import { foldLeft } from 'fp-ts/Array' + * import { matchLeft } from 'fp-ts/Array' * - * const len: (as: Array) => number = foldLeft(() => 0, (_, tail) => 1 + len(tail)) + * const len: (as: Array) => number = matchLeft(() => 0, (_, tail) => 1 + len(tail)) * assert.strictEqual(len([1, 2, 3]), 3) * * @category destructors + * @since 2.10.0 + */ +exports.matchLeft = exports.matchLeftW; +/** + * Alias of [`matchLeft`](#matchleft). + * + * @category destructors * @since 2.0.0 */ -exports.foldLeft = RA.foldLeft; +exports.foldLeft = exports.matchLeft; +/** + * Less strict version of [`matchRight`](#matchright). + * + * @category destructors + * @since 2.11.0 + */ +var matchRightW = function (onEmpty, onNonEmpty) { return function (as) { return (exports.isNonEmpty(as) ? onNonEmpty(NEA.init(as), NEA.last(as)) : onEmpty()); }; }; +exports.matchRightW = matchRightW; /** - * Break an array into its initial elements and the last element + * Break an `Array` into its initial elements and the last element. + * + * @category destructors + * @since 2.10.0 + */ +exports.matchRight = exports.matchRightW; +/** + * Alias of [`matchRight`](#matchright). * * @category destructors * @since 2.0.0 */ -exports.foldRight = RA.foldRight; +exports.foldRight = exports.matchRight; +// ------------------------------------------------------------------------------------- +// combinators +// ------------------------------------------------------------------------------------- +/** + * @category combinators + * @since 2.7.0 + */ +var chainWithIndex = function (f) { return function (as) { + var out = []; + for (var i = 0; i < as.length; i++) { + out.push.apply(out, f(i, as[i])); + } + return out; +}; }; +exports.chainWithIndex = chainWithIndex; /** * Same as `reduce` but it carries over the intermediate steps * @@ -5302,7 +5586,16 @@ exports.foldRight = RA.foldRight; * @category combinators * @since 2.0.0 */ -exports.scanLeft = RA.scanLeft; +var scanLeft = function (b, f) { return function (as) { + var len = as.length; + var out = new Array(len + 1); + out[0] = b; + for (var i = 0; i < len; i++) { + out[i + 1] = f(out[i], as[i]); + } + return out; +}; }; +exports.scanLeft = scanLeft; /** * Fold an array from the right, keeping all intermediate results instead of only the final result * @@ -5314,31 +5607,29 @@ exports.scanLeft = RA.scanLeft; * @category combinators * @since 2.0.0 */ -exports.scanRight = RA.scanRight; -/** - * Test whether an array is empty - * - * @example - * import { isEmpty } from 'fp-ts/Array' - * - * assert.strictEqual(isEmpty([]), true) - * - * @since 2.0.0 - */ -exports.isEmpty = RA.isEmpty; +var scanRight = function (b, f) { return function (as) { + var len = as.length; + var out = new Array(len + 1); + out[len] = b; + for (var i = len - 1; i >= 0; i--) { + out[i] = f(as[i], out[i + 1]); + } + return out; +}; }; +exports.scanRight = scanRight; /** - * Test whether an array is non empty narrowing down the type to `NonEmptyArray` + * Calculate the number of elements in a `Array`. * - * @category guards - * @since 2.0.0 + * @since 2.10.0 */ -exports.isNonEmpty = RA.isNonEmpty; +var size = function (as) { return as.length; }; +exports.size = size; /** * Test whether an array contains a particular index * * @since 2.0.0 */ -exports.isOutOfBound = RA.isOutOfBound; +exports.isOutOfBound = NEA.isOutOfBound; // TODO: remove non-curried overloading in v3 /** * This function provides a safe way to read a value at a particular index from an array @@ -5354,33 +5645,6 @@ exports.isOutOfBound = RA.isOutOfBound; * @since 2.0.0 */ exports.lookup = RA.lookup; -// TODO: remove non-curried overloading in v3 -/** - * Attaches an element to the front of an array, creating a new non empty array - * - * @example - * import { cons } from 'fp-ts/Array' - * import { pipe } from 'fp-ts/function' - * - * assert.deepStrictEqual(pipe([1, 2, 3], cons(0)), [0, 1, 2, 3]) - * - * @category constructors - * @since 2.0.0 - */ -exports.cons = RA.cons; -// TODO: curry in v3 -/** - * Append an element to the end of an array, creating a new non empty array - * - * @example - * import { snoc } from 'fp-ts/Array' - * - * assert.deepStrictEqual(snoc([1, 2, 3], 4), [1, 2, 3, 4]) - * - * @category constructors - * @since 2.0.0 - */ -exports.snoc = RA.snoc; /** * Get the first element in an array, or `None` if the array is empty * @@ -5422,7 +5686,8 @@ exports.last = RA.last; * @category destructors * @since 2.0.0 */ -exports.tail = RA.tail; +var tail = function (as) { return (exports.isNonEmpty(as) ? _.some(NEA.tail(as)) : _.none); }; +exports.tail = tail; /** * Get all but the last element of an array, creating a new array, or `None` if the array is empty * @@ -5436,10 +5701,12 @@ exports.tail = RA.tail; * @category destructors * @since 2.0.0 */ -exports.init = RA.init; +var init = function (as) { return (exports.isNonEmpty(as) ? _.some(NEA.init(as)) : _.none); }; +exports.init = init; /** - * Keep only a number of elements from the start of an array, creating a new array. - * `n` must be a natural number + * Keep only a max number of elements from the start of an `Array`, creating a new `Array`. + * + * **Note**. `n` is normalized to a non negative integer. * * @example * import { takeLeft } from 'fp-ts/Array' @@ -5449,10 +5716,12 @@ exports.init = RA.init; * @category combinators * @since 2.0.0 */ -exports.takeLeft = RA.takeLeft; +var takeLeft = function (n) { return function (as) { return (exports.isOutOfBound(n, as) ? exports.copy(as) : as.slice(0, n)); }; }; +exports.takeLeft = takeLeft; /** - * Keep only a number of elements from the end of an array, creating a new array. - * `n` must be a natural number + * Keep only a max number of elements from the end of an `Array`, creating a new `Array`. + * + * **Note**. `n` is normalized to a non negative integer. * * @example * import { takeRight } from 'fp-ts/Array' @@ -5462,18 +5731,45 @@ exports.takeLeft = RA.takeLeft; * @category combinators * @since 2.0.0 */ -exports.takeRight = RA.takeRight; +var takeRight = function (n) { return function (as) { + return exports.isOutOfBound(n, as) ? exports.copy(as) : n === 0 ? [] : as.slice(-n); +}; }; +exports.takeRight = takeRight; function takeLeftWhile(predicate) { - return RA.takeLeftWhile(predicate); -} -exports.takeLeftWhile = takeLeftWhile; -function spanLeft(predicate) { - return RA.spanLeft(predicate); -} -exports.spanLeft = spanLeft; -/* tslint:enable:readonly-keyword */ -/** - * Drop a number of elements from the start of an array, creating a new array + return function (as) { + var out = []; + for (var _i = 0, as_1 = as; _i < as_1.length; _i++) { + var a = as_1[_i]; + if (!predicate(a)) { + break; + } + out.push(a); + } + return out; + }; +} +exports.takeLeftWhile = takeLeftWhile; +var spanLeftIndex = function (as, predicate) { + var l = as.length; + var i = 0; + for (; i < l; i++) { + if (!predicate(as[i])) { + break; + } + } + return i; +}; +function spanLeft(predicate) { + return function (as) { + var _a = exports.splitAt(spanLeftIndex(as, predicate))(as), init = _a[0], rest = _a[1]; + return { init: init, rest: rest }; + }; +} +exports.spanLeft = spanLeft; +/** + * Drop a max number of elements from the start of an `Array`, creating a new `Array`. + * + * **Note**. `n` is normalized to a non negative integer. * * @example * import { dropLeft } from 'fp-ts/Array' @@ -5483,9 +5779,14 @@ exports.spanLeft = spanLeft; * @category combinators * @since 2.0.0 */ -exports.dropLeft = RA.dropLeft; +var dropLeft = function (n) { return function (as) { + return n <= 0 || exports.isEmpty(as) ? exports.copy(as) : n >= as.length ? [] : as.slice(n, as.length); +}; }; +exports.dropLeft = dropLeft; /** - * Drop a number of elements from the end of an array, creating a new array + * Drop a max number of elements from the end of an `Array`, creating a new `Array`. + * + * **Note**. `n` is normalized to a non negative integer. * * @example * import { dropRight } from 'fp-ts/Array' @@ -5495,19 +5796,14 @@ exports.dropLeft = RA.dropLeft; * @category combinators * @since 2.0.0 */ -exports.dropRight = RA.dropRight; -/** - * Remove the longest initial subarray for which all element satisfy the specified predicate, creating a new array - * - * @example - * import { dropLeftWhile } from 'fp-ts/Array' - * - * assert.deepStrictEqual(dropLeftWhile((n: number) => n % 2 === 1)([1, 3, 2, 4, 5]), [2, 4, 5]) - * - * @category combinators - * @since 2.0.0 - */ -exports.dropLeftWhile = RA.dropLeftWhile; +var dropRight = function (n) { return function (as) { + return n <= 0 || exports.isEmpty(as) ? exports.copy(as) : n >= as.length ? [] : as.slice(0, as.length - n); +}; }; +exports.dropRight = dropRight; +function dropLeftWhile(predicate) { + return function (as) { return as.slice(spanLeftIndex(as, predicate)); }; +} +exports.dropLeftWhile = dropLeftWhile; /** * Find the first index for which a predicate holds * @@ -5533,8 +5829,8 @@ exports.findFirst = findFirst; * import { some, none } from 'fp-ts/Option' * * interface Person { - * name: string - * age?: number + * readonly name: string + * readonly age?: number * } * * const persons: Array = [{ name: 'John' }, { name: 'Mary', age: 45 }, { name: 'Joey', age: 28 }] @@ -5558,8 +5854,8 @@ exports.findLast = findLast; * import { some, none } from 'fp-ts/Option' * * interface Person { - * name: string - * age?: number + * readonly name: string + * readonly age?: number * } * * const persons: Array = [{ name: 'John' }, { name: 'Mary', age: 45 }, { name: 'Joey', age: 28 }] @@ -5579,12 +5875,12 @@ exports.findLastMap = RA.findLastMap; * import { some, none } from 'fp-ts/Option' * * interface X { - * a: number - * b: number + * readonly a: number + * readonly b: number * } * const xs: Array = [{ a: 1, b: 0 }, { a: 1, b: 1 }] - * assert.deepStrictEqual(findLastIndex((x: { a: number }) => x.a === 1)(xs), some(1)) - * assert.deepStrictEqual(findLastIndex((x: { a: number }) => x.a === 4)(xs), none) + * assert.deepStrictEqual(findLastIndex((x: { readonly a: number }) => x.a === 1)(xs), some(1)) + * assert.deepStrictEqual(findLastIndex((x: { readonly a: number }) => x.a === 4)(xs), none) * * * @since 2.0.0 @@ -5594,7 +5890,8 @@ exports.findLastIndex = RA.findLastIndex; * @category combinators * @since 2.0.0 */ -exports.copy = RA.toArray; +var copy = function (as) { return as.slice(); }; +exports.copy = copy; /** * Insert an element at the specified index, creating a new array, or returning `None` if the index is out of bounds * @@ -5606,7 +5903,10 @@ exports.copy = RA.toArray; * * @since 2.0.0 */ -exports.insertAt = RA.insertAt; +var insertAt = function (i, a) { return function (as) { + return i < 0 || i > as.length ? _.none : _.some(exports.unsafeInsertAt(i, a, as)); +}; }; +exports.insertAt = insertAt; /** * Change the element at the specified index, creating a new array, or returning `None` if the index is out of bounds * @@ -5619,7 +5919,8 @@ exports.insertAt = RA.insertAt; * * @since 2.0.0 */ -exports.updateAt = RA.updateAt; +var updateAt = function (i, a) { return exports.modifyAt(i, function () { return a; }); }; +exports.updateAt = updateAt; /** * Delete the element at the specified index, creating a new array, or returning `None` if the index is out of bounds * @@ -5632,7 +5933,10 @@ exports.updateAt = RA.updateAt; * * @since 2.0.0 */ -exports.deleteAt = RA.deleteAt; +var deleteAt = function (i) { return function (as) { + return exports.isOutOfBound(i, as) ? _.none : _.some(exports.unsafeDeleteAt(i, as)); +}; }; +exports.deleteAt = deleteAt; /** * Apply a function to the element at the specified index, creating a new array, or returning `None` if the index is out * of bounds @@ -5647,7 +5951,10 @@ exports.deleteAt = RA.deleteAt; * * @since 2.0.0 */ -exports.modifyAt = RA.modifyAt; +var modifyAt = function (i, f) { return function (as) { + return exports.isOutOfBound(i, as) ? _.none : _.some(exports.unsafeUpdateAt(i, f(as[i]), as)); +}; }; +exports.modifyAt = modifyAt; /** * Reverse an array, creating a new array * @@ -5659,7 +5966,8 @@ exports.modifyAt = RA.modifyAt; * @category combinators * @since 2.0.0 */ -exports.reverse = RA.reverse; +var reverse = function (as) { return (exports.isEmpty(as) ? [] : as.slice().reverse()); }; +exports.reverse = reverse; /** * Extracts from an array of `Either` all the `Right` elements. All the `Right` elements are extracted in order * @@ -5672,7 +5980,17 @@ exports.reverse = RA.reverse; * @category combinators * @since 2.0.0 */ -exports.rights = RA.rights; +var rights = function (as) { + var r = []; + for (var i = 0; i < as.length; i++) { + var a = as[i]; + if (a._tag === 'Right') { + r.push(a.right); + } + } + return r; +}; +exports.rights = rights; /** * Extracts from an array of `Either` all the `Left` elements. All the `Left` elements are extracted in order * @@ -5685,20 +6003,33 @@ exports.rights = RA.rights; * @category combinators * @since 2.0.0 */ -exports.lefts = RA.lefts; +var lefts = function (as) { + var r = []; + for (var i = 0; i < as.length; i++) { + var a = as[i]; + if (a._tag === 'Left') { + r.push(a.left); + } + } + return r; +}; +exports.lefts = lefts; /** * Sort the elements of an array in increasing order, creating a new array * * @example * import { sort } from 'fp-ts/Array' - * import { ordNumber } from 'fp-ts/Ord' + * import * as N from 'fp-ts/number' * - * assert.deepStrictEqual(sort(ordNumber)([3, 2, 1]), [1, 2, 3]) + * assert.deepStrictEqual(sort(N.Ord)([3, 2, 1]), [1, 2, 3]) * * @category combinators * @since 2.0.0 */ -exports.sort = RA.sort; +var sort = function (O) { return function (as) { + return as.length <= 1 ? exports.copy(as) : as.slice().sort(O.compare); +}; }; +exports.sort = sort; /** * Apply a function to pairs of elements at the same index in two arrays, collecting the results in a new array. If one * input array is short, excess elements of the longer array are discarded. @@ -5711,22 +6042,22 @@ exports.sort = RA.sort; * @category combinators * @since 2.0.0 */ -exports.zipWith = RA.zipWith; -// TODO: remove non-curried overloading in v3 -/** - * Takes two arrays and returns an array of corresponding pairs. If one input array is short, excess elements of the - * longer array are discarded - * - * @example - * import { zip } from 'fp-ts/Array' - * import { pipe } from 'fp-ts/function' - * - * assert.deepStrictEqual(pipe([1, 2, 3], zip(['a', 'b', 'c', 'd'])), [[1, 'a'], [2, 'b'], [3, 'c']]) - * - * @category combinators - * @since 2.0.0 - */ -exports.zip = RA.zip; +var zipWith = function (fa, fb, f) { + var fc = []; + var len = Math.min(fa.length, fb.length); + for (var i = 0; i < len; i++) { + fc[i] = f(fa[i], fb[i]); + } + return fc; +}; +exports.zipWith = zipWith; +function zip(as, bs) { + if (bs === undefined) { + return function (bs) { return zip(bs, as); }; + } + return exports.zipWith(as, bs, function (a, b) { return [a, b]; }); +} +exports.zip = zip; /** * The function is reverse of `zip`. Takes an array of pairs and return two corresponding arrays * @@ -5737,19 +6068,32 @@ exports.zip = RA.zip; * * @since 2.0.0 */ -exports.unzip = RA.unzip; +var unzip = function (as) { + var fa = []; + var fb = []; + for (var i = 0; i < as.length; i++) { + fa[i] = as[i][0]; + fb[i] = as[i][1]; + } + return [fa, fb]; +}; +exports.unzip = unzip; /** * Prepend an element to every member of an array * * @example - * import { prependToAll } from 'fp-ts/Array' + * import { prependAll } from 'fp-ts/Array' * - * assert.deepStrictEqual(prependToAll(9)([1, 2, 3, 4]), [9, 1, 9, 2, 9, 3, 9, 4]) + * assert.deepStrictEqual(prependAll(9)([1, 2, 3, 4]), [9, 1, 9, 2, 9, 3, 9, 4]) * * @category combinators - * @since 2.9.0 + * @since 2.10.0 */ -exports.prependToAll = RA.prependToAll; +var prependAll = function (middle) { + var f = NEA.prependAll(middle); + return function (as) { return (exports.isNonEmpty(as) ? f(as) : []); }; +}; +exports.prependAll = prependAll; /** * Places an element in between members of an array * @@ -5761,9 +6105,13 @@ exports.prependToAll = RA.prependToAll; * @category combinators * @since 2.9.0 */ -exports.intersperse = RA.intersperse; +var intersperse = function (middle) { + var f = NEA.intersperse(middle); + return function (as) { return (exports.isNonEmpty(as) ? f(as) : exports.copy(as)); }; +}; +exports.intersperse = intersperse; /** - * Rotate an array to the right by `n` steps + * Rotate a `Array` by `n` steps. * * @example * import { rotate } from 'fp-ts/Array' @@ -5773,7 +6121,11 @@ exports.intersperse = RA.intersperse; * @category combinators * @since 2.0.0 */ -exports.rotate = RA.rotate; +var rotate = function (n) { + var f = NEA.rotate(n); + return function (as) { return (exports.isNonEmpty(as) ? f(as) : exports.copy(as)); }; +}; +exports.rotate = rotate; // TODO: remove non-curried overloading in v3 /** * Test if a value is a member of an array. Takes a `Eq` as a single @@ -5782,11 +6134,11 @@ exports.rotate = RA.rotate; * * @example * import { elem } from 'fp-ts/Array' - * import { eqNumber } from 'fp-ts/Eq' + * import * as N from 'fp-ts/number' * import { pipe } from 'fp-ts/function' * - * assert.strictEqual(pipe([1, 2, 3], elem(eqNumber)(2)), true) - * assert.strictEqual(pipe([1, 2, 3], elem(eqNumber)(0)), false) + * assert.strictEqual(pipe([1, 2, 3], elem(N.Eq)(2)), true) + * assert.strictEqual(pipe([1, 2, 3], elem(N.Eq)(0)), false) * * @since 2.0.0 */ @@ -5796,28 +6148,35 @@ exports.elem = RA.elem; * * @example * import { uniq } from 'fp-ts/Array' - * import { eqNumber } from 'fp-ts/Eq' + * import * as N from 'fp-ts/number' * - * assert.deepStrictEqual(uniq(eqNumber)([1, 2, 1]), [1, 2]) + * assert.deepStrictEqual(uniq(N.Eq)([1, 2, 1]), [1, 2]) * * @category combinators * @since 2.0.0 */ -exports.uniq = RA.uniq; +var uniq = function (E) { + var f = NEA.uniq(E); + return function (as) { return (exports.isNonEmpty(as) ? f(as) : exports.copy(as)); }; +}; +exports.uniq = uniq; /** * Sort the elements of an array in increasing order, where elements are compared using first `ords[0]`, then `ords[1]`, * etc... * * @example * import { sortBy } from 'fp-ts/Array' - * import { ord, ordString, ordNumber } from 'fp-ts/Ord' + * import { contramap } from 'fp-ts/Ord' + * import * as S from 'fp-ts/string' + * import * as N from 'fp-ts/number' + * import { pipe } from 'fp-ts/function' * * interface Person { - * name: string - * age: number + * readonly name: string + * readonly age: number * } - * const byName = ord.contramap(ordString, (p: Person) => p.name) - * const byAge = ord.contramap(ordNumber, (p: Person) => p.age) + * const byName = pipe(S.Ord, contramap((p: Person) => p.name)) + * const byAge = pipe(N.Ord, contramap((p: Person) => p.age)) * * const sortByNameByAge = sortBy([byName, byAge]) * @@ -5832,39 +6191,53 @@ exports.uniq = RA.uniq; * @category combinators * @since 2.0.0 */ -exports.sortBy = RA.sortBy; +var sortBy = function (ords) { + var f = NEA.sortBy(ords); + return function (as) { return (exports.isNonEmpty(as) ? f(as) : exports.copy(as)); }; +}; +exports.sortBy = sortBy; /** * A useful recursion pattern for processing an array to produce a new array, often used for "chopping" up the input * array. Typically chop is called with some function that will consume an initial prefix of the array and produce a * value and the rest of the array. * * @example - * import { Eq, eqNumber } from 'fp-ts/Eq' - * import { chop, spanLeft } from 'fp-ts/Array' + * import { Eq } from 'fp-ts/Eq' + * import * as A from 'fp-ts/Array' + * import * as N from 'fp-ts/number' + * import { pipe } from 'fp-ts/function' * * const group = (S: Eq): ((as: Array) => Array>) => { - * return chop(as => { - * const { init, rest } = spanLeft((a: A) => S.equals(a, as[0]))(as) + * return A.chop(as => { + * const { init, rest } = pipe(as, A.spanLeft((a: A) => S.equals(a, as[0]))) * return [init, rest] * }) * } - * assert.deepStrictEqual(group(eqNumber)([1, 1, 2, 3, 3, 4]), [[1, 1], [2], [3, 3], [4]]) + * assert.deepStrictEqual(group(N.Eq)([1, 1, 2, 3, 3, 4]), [[1, 1], [2], [3, 3], [4]]) * * @category combinators * @since 2.0.0 */ -exports.chop = RA.chop; +var chop = function (f) { + var g = NEA.chop(f); + return function (as) { return (exports.isNonEmpty(as) ? g(as) : []); }; +}; +exports.chop = chop; /** - * Splits an array into two pieces, the first piece has `n` elements. + * Splits an `Array` into two pieces, the first piece has max `n` elements. * * @example * import { splitAt } from 'fp-ts/Array' * * assert.deepStrictEqual(splitAt(2)([1, 2, 3, 4, 5]), [[1, 2], [3, 4, 5]]) * + * @category combinators * @since 2.0.0 */ -exports.splitAt = RA.splitAt; +var splitAt = function (n) { return function (as) { + return n >= 1 && exports.isNonEmpty(as) ? NEA.splitAt(n)(as) : exports.isEmpty(as) ? [exports.copy(as), []] : [[], exports.copy(as)]; +}; }; +exports.splitAt = splitAt; /** * Splits an array into length-`n` pieces. The last piece will be shorter if `n` does not evenly divide the length of * the array. Note that `chunksOf(n)([])` is `[]`, not `[[]]`. This is intentional, and is consistent with a recursive @@ -5881,103 +6254,164 @@ exports.splitAt = RA.splitAt; * * assert.deepStrictEqual(chunksOf(2)([1, 2, 3, 4, 5]), [[1, 2], [3, 4], [5]]) * + * @category combinators * @since 2.0.0 */ -exports.chunksOf = RA.chunksOf; +var chunksOf = function (n) { + var f = NEA.chunksOf(n); + return function (as) { return (exports.isNonEmpty(as) ? f(as) : []); }; +}; +exports.chunksOf = chunksOf; +/** + * @category combinators + * @since 2.11.0 + */ +var fromOptionK = function (f) { return function () { + var a = []; + for (var _i = 0; _i < arguments.length; _i++) { + a[_i] = arguments[_i]; + } + return exports.fromOption(f.apply(void 0, a)); +}; }; +exports.fromOptionK = fromOptionK; function comprehension(input, f, g) { if (g === void 0) { g = function () { return true; }; } - return RA.comprehension(input, f, g); + var go = function (scope, input) { + return exports.isNonEmpty(input) + ? function_1.pipe(NEA.head(input), exports.chain(function (x) { return go(function_1.pipe(scope, exports.append(x)), NEA.tail(input)); })) + : g.apply(void 0, scope) ? [f.apply(void 0, scope)] + : []; + }; + return go([], input); } exports.comprehension = comprehension; -// TODO: remove non-curried overloading in v3 /** - * Creates an array of unique values, in order, from all given arrays using a `Eq` for equality comparisons - * - * @example - * import { union } from 'fp-ts/Array' - * import { eqNumber } from 'fp-ts/Eq' - * import { pipe } from 'fp-ts/function' - * - * assert.deepStrictEqual(pipe([1, 2], union(eqNumber)([2, 3])), [1, 2, 3]) - * * @category combinators - * @since 2.0.0 + * @since 2.11.0 */ -exports.union = RA.union; -// TODO: remove non-curried overloading in v3 +var concatW = function (second) { return function (first) { + return exports.isEmpty(first) ? exports.copy(second) : exports.isEmpty(second) ? exports.copy(first) : first.concat(second); +}; }; +exports.concatW = concatW; /** - * Creates an array of unique values that are included in all given arrays using a `Eq` for equality - * comparisons. The order and references of result values are determined by the first array. - * - * @example - * import { intersection } from 'fp-ts/Array' - * import { eqNumber } from 'fp-ts/Eq' - * import { pipe } from 'fp-ts/function' - * - * assert.deepStrictEqual(pipe([1, 2], intersection(eqNumber)([2, 3])), [2]) - * * @category combinators - * @since 2.0.0 + * @since 2.11.0 */ -exports.intersection = RA.intersection; -// TODO: remove non-curried overloading in v3 +exports.concat = exports.concatW; +function union(E) { + var unionE = NEA.union(E); + return function (first, second) { + if (second === undefined) { + var unionE_1 = union(E); + return function (second) { return unionE_1(second, first); }; + } + return exports.isNonEmpty(first) && exports.isNonEmpty(second) + ? unionE(second)(first) + : exports.isNonEmpty(first) + ? exports.copy(first) + : exports.copy(second); + }; +} +exports.union = union; +function intersection(E) { + var elemE = exports.elem(E); + return function (xs, ys) { + if (ys === undefined) { + var intersectionE_1 = intersection(E); + return function (ys) { return intersectionE_1(ys, xs); }; + } + return xs.filter(function (a) { return elemE(a, ys); }); + }; +} +exports.intersection = intersection; +function difference(E) { + var elemE = exports.elem(E); + return function (xs, ys) { + if (ys === undefined) { + var differenceE_1 = difference(E); + return function (ys) { return differenceE_1(ys, xs); }; + } + return xs.filter(function (a) { return !elemE(a, ys); }); + }; +} +exports.difference = difference; +// ------------------------------------------------------------------------------------- +// non-pipeables +// ------------------------------------------------------------------------------------- +var _map = function (fa, f) { return function_1.pipe(fa, exports.map(f)); }; +/* istanbul ignore next */ +var _mapWithIndex = function (fa, f) { return function_1.pipe(fa, exports.mapWithIndex(f)); }; +var _ap = function (fab, fa) { return function_1.pipe(fab, exports.ap(fa)); }; +var _chain = function (ma, f) { return function_1.pipe(ma, exports.chain(f)); }; +/* istanbul ignore next */ +var _filter = function (fa, predicate) { return function_1.pipe(fa, exports.filter(predicate)); }; +/* istanbul ignore next */ +var _filterMap = function (fa, f) { return function_1.pipe(fa, exports.filterMap(f)); }; +/* istanbul ignore next */ +var _partition = function (fa, predicate) { + return function_1.pipe(fa, exports.partition(predicate)); +}; +/* istanbul ignore next */ +var _partitionMap = function (fa, f) { return function_1.pipe(fa, exports.partitionMap(f)); }; +/* istanbul ignore next */ +var _partitionWithIndex = function (fa, predicateWithIndex) { return function_1.pipe(fa, exports.partitionWithIndex(predicateWithIndex)); }; +/* istanbul ignore next */ +var _partitionMapWithIndex = function (fa, f) { return function_1.pipe(fa, exports.partitionMapWithIndex(f)); }; +/* istanbul ignore next */ +var _alt = function (fa, that) { return function_1.pipe(fa, exports.alt(that)); }; +var _reduce = function (fa, b, f) { return function_1.pipe(fa, exports.reduce(b, f)); }; +/* istanbul ignore next */ +var _foldMap = function (M) { + var foldMapM = exports.foldMap(M); + return function (fa, f) { return function_1.pipe(fa, foldMapM(f)); }; +}; +/* istanbul ignore next */ +var _reduceRight = function (fa, b, f) { return function_1.pipe(fa, exports.reduceRight(b, f)); }; +/* istanbul ignore next */ +var _reduceWithIndex = function (fa, b, f) { + return function_1.pipe(fa, exports.reduceWithIndex(b, f)); +}; +/* istanbul ignore next */ +var _foldMapWithIndex = function (M) { + var foldMapWithIndexM = exports.foldMapWithIndex(M); + return function (fa, f) { return function_1.pipe(fa, foldMapWithIndexM(f)); }; +}; +/* istanbul ignore next */ +var _reduceRightWithIndex = function (fa, b, f) { + return function_1.pipe(fa, exports.reduceRightWithIndex(b, f)); +}; +/* istanbul ignore next */ +var _filterMapWithIndex = function (fa, f) { return function_1.pipe(fa, exports.filterMapWithIndex(f)); }; +/* istanbul ignore next */ +var _filterWithIndex = function (fa, predicateWithIndex) { return function_1.pipe(fa, exports.filterWithIndex(predicateWithIndex)); }; +/* istanbul ignore next */ +var _extend = function (fa, f) { return function_1.pipe(fa, exports.extend(f)); }; +/* istanbul ignore next */ +var _traverse = function (F) { + var traverseF = exports.traverse(F); + return function (ta, f) { return function_1.pipe(ta, traverseF(f)); }; +}; +/* istanbul ignore next */ +var _traverseWithIndex = function (F) { + var traverseWithIndexF = exports.traverseWithIndex(F); + return function (ta, f) { return function_1.pipe(ta, traverseWithIndexF(f)); }; +}; +var _chainRecDepthFirst = RA._chainRecDepthFirst; +var _chainRecBreadthFirst = RA._chainRecBreadthFirst; +// ------------------------------------------------------------------------------------- +// type class members +// ------------------------------------------------------------------------------------- /** - * Creates an array of array values not included in the other given array using a `Eq` for equality - * comparisons. The order and references of result values are determined by the first array. - * - * @example - * import { difference } from 'fp-ts/Array' - * import { eqNumber } from 'fp-ts/Eq' - * import { pipe } from 'fp-ts/function' - * - * assert.deepStrictEqual(pipe([1, 2], difference(eqNumber)([2, 3])), [1]) - * - * @category combinators + * @category Pointed * @since 2.0.0 */ -exports.difference = RA.difference; +exports.of = NEA.of; /** - * Wrap a value into the type constructor. - * - * @category Applicative - * @since 2.0.0 + * @category Zero + * @since 2.7.0 */ -exports.of = RA.of; -// ------------------------------------------------------------------------------------- -// non-pipeables -// ------------------------------------------------------------------------------------- -var map_ = RA.Monad.map; -var ap_ = RA.Monad.ap; -var chain_ = RA.Monad.chain; -var mapWithIndex_ = RA.FunctorWithIndex.mapWithIndex; -var filter_ = RA.Filterable.filter; -var filterMap_ = RA.Filterable.filterMap; -var partition_ = RA.Filterable.partition; -var partitionMap_ = RA.Filterable.partitionMap; -var filterWithIndex_ = RA.FilterableWithIndex - .filterWithIndex; -var filterMapWithIndex_ = RA.FilterableWithIndex - .filterMapWithIndex; -var partitionWithIndex_ = RA.FilterableWithIndex - .partitionWithIndex; -var partitionMapWithIndex_ = RA.FilterableWithIndex - .partitionMapWithIndex; -var reduce_ = RA.Foldable.reduce; -var foldMap_ = RA.Foldable.foldMap; -var reduceRight_ = RA.Foldable.reduceRight; -var traverse_ = RA.Traversable.traverse; -var alt_ = RA.Alternative.alt; -var reduceWithIndex_ = RA.FoldableWithIndex.reduceWithIndex; -var foldMapWithIndex_ = RA.FoldableWithIndex.foldMapWithIndex; -var reduceRightWithIndex_ = RA.FoldableWithIndex.reduceRightWithIndex; -var traverseWithIndex_ = RA.TraversableWithIndex - .traverseWithIndex; -var extend_ = RA.Extend.extend; -var wither_ = RA.Witherable.wither; -var wilt_ = RA.Witherable.wilt; -// ------------------------------------------------------------------------------------- -// pipeables -// ------------------------------------------------------------------------------------- +var zero = function () { return []; }; +exports.zero = zero; /** * `map` can be used to turn functions `(a: A) => B` into functions `(fa: F) => F` whose argument and return types * use the type constructor `F` to represent some computational context. @@ -5985,105 +6419,158 @@ var wilt_ = RA.Witherable.wilt; * @category Functor * @since 2.0.0 */ -exports.map = RA.map; +var map = function (f) { return function (fa) { return fa.map(function (a) { return f(a); }); }; }; +exports.map = map; /** * Apply a function to an argument under a type constructor. * * @category Apply * @since 2.0.0 */ -exports.ap = RA.ap; +var ap = function (fa) { return exports.chain(function (f) { return function_1.pipe(fa, exports.map(f)); }); }; +exports.ap = ap; /** - * Combine two effectful actions, keeping only the result of the first. - * - * Derivable from `Apply`. + * Composes computations in sequence, using the return value of one computation to determine the next computation. * - * @category combinators + * @category Monad * @since 2.0.0 */ -exports.apFirst = RA.apFirst; +var chain = function (f) { return function (ma) { + return function_1.pipe(ma, exports.chainWithIndex(function (_, a) { return f(a); })); +}; }; +exports.chain = chain; /** - * Combine two effectful actions, keeping only the result of the second. - * - * Derivable from `Apply`. + * Derivable from `Chain`. * * @category combinators - * @since 2.0.0 + * @since 2.5.0 */ -exports.apSecond = RA.apSecond; -/** - * Composes computations in sequence, using the return value of one computation to determine the next computation. - * - * @category Monad - * @since 2.0.0 - */ -exports.chain = RA.chain; -/** - * @since 2.7.0 - */ -exports.chainWithIndex = RA.chainWithIndex; +exports.flatten = +/*#__PURE__*/ +exports.chain(function_1.identity); /** - * Composes computations in sequence, using the return value of one computation to determine the next computation and - * keeping only the result of the first. - * - * Derivable from `Monad`. - * - * @category combinators + * @category FunctorWithIndex * @since 2.0.0 */ -exports.chainFirst = RA.chainFirst; +var mapWithIndex = function (f) { return function (fa) { + return fa.map(function (a, i) { return f(i, a); }); +}; }; +exports.mapWithIndex = mapWithIndex; /** - * @category FunctorWithIndex + * @category FilterableWithIndex * @since 2.0.0 */ -exports.mapWithIndex = RA.mapWithIndex; +var filterMapWithIndex = function (f) { return function (fa) { + var out = []; + for (var i = 0; i < fa.length; i++) { + var optionB = f(i, fa[i]); + if (_.isSome(optionB)) { + out.push(optionB.value); + } + } + return out; +}; }; +exports.filterMapWithIndex = filterMapWithIndex; /** - * @category Compactable + * @category Filterable * @since 2.0.0 */ -exports.compact = RA.compact; +var filterMap = function (f) { + return exports.filterMapWithIndex(function (_, a) { return f(a); }); +}; +exports.filterMap = filterMap; /** * @category Compactable * @since 2.0.0 */ -exports.separate = RA.separate; +exports.compact = +/*#__PURE__*/ +exports.filterMap(function_1.identity); /** - * @category Filterable + * @category Compactable * @since 2.0.0 */ -exports.filter = RA.filter; +var separate = function (fa) { + var left = []; + var right = []; + for (var _i = 0, fa_1 = fa; _i < fa_1.length; _i++) { + var e = fa_1[_i]; + if (e._tag === 'Left') { + left.push(e.left); + } + else { + right.push(e.right); + } + } + return Separated_1.separated(left, right); +}; +exports.separate = separate; /** * @category Filterable * @since 2.0.0 */ -exports.filterMap = RA.filterMap; +var filter = function (predicate) { return function (as) { return as.filter(predicate); }; }; +exports.filter = filter; /** * @category Filterable * @since 2.0.0 */ -exports.partition = RA.partition; +var partition = function (predicate) { + return exports.partitionWithIndex(function (_, a) { return predicate(a); }); +}; +exports.partition = partition; /** * @category FilterableWithIndex * @since 2.0.0 */ -exports.partitionWithIndex = RA.partitionWithIndex; +var partitionWithIndex = function (predicateWithIndex) { return function (as) { + var left = []; + var right = []; + for (var i = 0; i < as.length; i++) { + var b = as[i]; + if (predicateWithIndex(i, b)) { + right.push(b); + } + else { + left.push(b); + } + } + return Separated_1.separated(left, right); +}; }; +exports.partitionWithIndex = partitionWithIndex; /** * @category Filterable * @since 2.0.0 */ -exports.partitionMap = RA.partitionMap; +var partitionMap = function (f) { return exports.partitionMapWithIndex(function (_, a) { return f(a); }); }; +exports.partitionMap = partitionMap; /** * @category FilterableWithIndex * @since 2.0.0 */ -exports.partitionMapWithIndex = RA.partitionMapWithIndex; +var partitionMapWithIndex = function (f) { return function (fa) { + var left = []; + var right = []; + for (var i = 0; i < fa.length; i++) { + var e = f(i, fa[i]); + if (e._tag === 'Left') { + left.push(e.left); + } + else { + right.push(e.right); + } + } + return Separated_1.separated(left, right); +}; }; +exports.partitionMapWithIndex = partitionMapWithIndex; /** * Less strict version of [`alt`](#alt). * * @category Alt * @since 2.9.0 */ -exports.altW = RA.altW; +var altW = function (that) { return function (fa) { return fa.concat(that()); }; }; +exports.altW = altW; /** * Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to * types of kind `* -> *`. @@ -6091,29 +6578,32 @@ exports.altW = RA.altW; * @category Alt * @since 2.0.0 */ -exports.alt = RA.alt; -/** - * @category FilterableWithIndex - * @since 2.0.0 - */ -exports.filterMapWithIndex = RA.filterMapWithIndex; +exports.alt = exports.altW; /** * @category FilterableWithIndex * @since 2.0.0 */ -exports.filterWithIndex = RA.filterWithIndex; +var filterWithIndex = function (predicateWithIndex) { return function (as) { + return as.filter(function (b, i) { return predicateWithIndex(i, b); }); +}; }; +exports.filterWithIndex = filterWithIndex; /** * @category Extend * @since 2.0.0 */ -exports.extend = RA.extend; +var extend = function (f) { return function (wa) { + return wa.map(function (_, i) { return f(wa.slice(i)); }); +}; }; +exports.extend = extend; /** * Derivable from `Extend`. * * @category combinators * @since 2.0.0 */ -exports.duplicate = RA.duplicate; +exports.duplicate = +/*#__PURE__*/ +exports.extend(function_1.identity); /** * @category Foldable * @since 2.0.0 @@ -6145,43 +6635,84 @@ exports.reduceRight = RA.reduceRight; */ exports.reduceRightWithIndex = RA.reduceRightWithIndex; /** - * **for optimized and stack safe version check the data types `traverseArray` function** * @category Traversable * @since 2.6.3 */ -exports.traverse = RA.traverse; +var traverse = function (F) { + var traverseWithIndexF = exports.traverseWithIndex(F); + return function (f) { return traverseWithIndexF(function (_, a) { return f(a); }); }; +}; +exports.traverse = traverse; /** - * **for optimized and stack safe version check the data types `sequenceArray` function** * @category Traversable * @since 2.6.3 */ -exports.sequence = RA.sequence; +var sequence = function (F) { return function (ta) { + return _reduce(ta, F.of(exports.zero()), function (fas, fa) { + return F.ap(F.map(fas, function (as) { return function (a) { return function_1.pipe(as, exports.append(a)); }; }), fa); + }); +}; }; +exports.sequence = sequence; /** - * **for optimized and stack safe version check the data types `traverseArrayWithIndex` function** * @category TraversableWithIndex * @since 2.6.3 */ -exports.traverseWithIndex = RA.traverseWithIndex; +var traverseWithIndex = function (F) { return function (f) { + return exports.reduceWithIndex(F.of(exports.zero()), function (i, fbs, a) { + return F.ap(F.map(fbs, function (bs) { return function (b) { return function_1.pipe(bs, exports.append(b)); }; }), f(i, a)); + }); +}; }; +exports.traverseWithIndex = traverseWithIndex; /** * @category Witherable * @since 2.6.5 */ -exports.wither = RA.wither; +var wither = function (F) { + var _witherF = _wither(F); + return function (f) { return function (fa) { return _witherF(fa, f); }; }; +}; +exports.wither = wither; /** * @category Witherable * @since 2.6.5 */ -exports.wilt = RA.wilt; +var wilt = function (F) { + var _wiltF = _wilt(F); + return function (f) { return function (fa) { return _wiltF(fa, f); }; }; +}; +exports.wilt = wilt; /** + * Creates an `Array` from the results of `f(b)`, where `b` is an initial value. + * `unfold` stops when `f` returns `Option.none`. + * @example + * import { unfold } from 'fp-ts/Array' + * import { some, none } from 'fp-ts/Option' + * + * assert.deepStrictEqual( + * unfold(5, (n) => (n > 0 ? some([n, n - 1]) : none)), + * [5, 4, 3, 2, 1] + * ) + * * @category Unfoldable * @since 2.6.6 */ -exports.unfold = RA.unfold; -/** - * @category Alternative - * @since 2.7.0 - */ -exports.zero = RA.Alternative.zero; +var unfold = function (b, f) { + var out = []; + var bb = b; + while (true) { + var mt = f(bb); + if (_.isSome(mt)) { + var _a = mt.value, a = _a[0], b_1 = _a[1]; + out.push(a); + bb = b_1; + } + else { + break; + } + } + return out; +}; +exports.unfold = unfold; // ------------------------------------------------------------------------------------- // instances // ------------------------------------------------------------------------------------- @@ -6192,235 +6723,447 @@ exports.zero = RA.Alternative.zero; exports.URI = 'Array'; /** * @category instances - * @since 2.7.0 + * @since 2.0.0 */ -exports.Functor = { - URI: exports.URI, - map: map_ -}; +exports.getShow = RA.getShow; /** * @category instances - * @since 2.7.0 + * @since 2.10.0 */ -exports.FunctorWithIndex = { - URI: exports.URI, - map: map_, - mapWithIndex: mapWithIndex_ -}; +var getSemigroup = function () { return ({ + concat: function (first, second) { return first.concat(second); } +}); }; +exports.getSemigroup = getSemigroup; /** + * Returns a `Monoid` for `Array` + * + * @example + * import { getMonoid } from 'fp-ts/Array' + * + * const M = getMonoid() + * assert.deepStrictEqual(M.concat([1, 2], [3, 4]), [1, 2, 3, 4]) + * * @category instances - * @since 2.7.0 + * @since 2.0.0 */ -exports.Applicative = { - URI: exports.URI, - map: map_, - ap: ap_, - of: exports.of -}; +var getMonoid = function () { return ({ + concat: exports.getSemigroup().concat, + empty: [] +}); }; +exports.getMonoid = getMonoid; /** + * Derives an `Eq` over the `Array` of a given element type from the `Eq` of that type. The derived `Eq` defines two + * arrays as equal if all elements of both arrays are compared equal pairwise with the given `E`. In case of arrays of + * different lengths, the result is non equality. + * + * @example + * import * as S from 'fp-ts/string' + * import { getEq } from 'fp-ts/Array' + * + * const E = getEq(S.Eq) + * assert.strictEqual(E.equals(['a', 'b'], ['a', 'b']), true) + * assert.strictEqual(E.equals(['a'], []), false) + * * @category instances - * @since 2.7.0 + * @since 2.0.0 */ -exports.Monad = { - URI: exports.URI, - map: map_, - ap: ap_, - of: exports.of, - chain: chain_ -}; +exports.getEq = RA.getEq; /** + * Derives an `Ord` over the `Array` of a given element type from the `Ord` of that type. The ordering between two such + * arrays is equal to: the first non equal comparison of each arrays elements taken pairwise in increasing order, in + * case of equality over all the pairwise elements; the longest array is considered the greatest, if both arrays have + * the same length, the result is equality. + * + * @example + * import { getOrd } from 'fp-ts/Array' + * import * as S from 'fp-ts/string' + * + * const O = getOrd(S.Ord) + * assert.strictEqual(O.compare(['b'], ['a']), 1) + * assert.strictEqual(O.compare(['a'], ['a']), 0) + * assert.strictEqual(O.compare(['a'], ['b']), -1) + * * @category instances - * @since 2.7.0 + * @since 2.0.0 */ -exports.Unfoldable = { - URI: exports.URI, - unfold: exports.unfold -}; +exports.getOrd = RA.getOrd; /** * @category instances - * @since 2.7.0 + * @since 2.11.0 */ -exports.Alt = { - URI: exports.URI, - map: map_, - alt: alt_ +var getUnionSemigroup = function (E) { + var unionE = union(E); + return { + concat: function (first, second) { return unionE(second)(first); } + }; }; +exports.getUnionSemigroup = getUnionSemigroup; /** * @category instances - * @since 2.7.0 + * @since 2.11.0 */ -exports.Alternative = { - URI: exports.URI, - map: map_, - ap: ap_, - of: exports.of, - alt: alt_, - zero: exports.zero -}; +var getUnionMonoid = function (E) { return ({ + concat: exports.getUnionSemigroup(E).concat, + empty: [] +}); }; +exports.getUnionMonoid = getUnionMonoid; /** * @category instances - * @since 2.7.0 + * @since 2.11.0 */ -exports.Extend = { - URI: exports.URI, - map: map_, - extend: extend_ +var getIntersectionSemigroup = function (E) { + var intersectionE = intersection(E); + return { + concat: function (first, second) { return intersectionE(second)(first); } + }; }; +exports.getIntersectionSemigroup = getIntersectionSemigroup; /** * @category instances - * @since 2.7.0 + * @since 2.11.0 */ -exports.Compactable = { - URI: exports.URI, - compact: exports.compact, - separate: exports.separate +var getDifferenceMagma = function (E) { + var differenceE = difference(E); + return { + concat: function (first, second) { return differenceE(second)(first); } + }; }; +exports.getDifferenceMagma = getDifferenceMagma; /** * @category instances * @since 2.7.0 */ -exports.Filterable = { +exports.Functor = { URI: exports.URI, - map: map_, - compact: exports.compact, - separate: exports.separate, - filter: filter_, - filterMap: filterMap_, - partition: partition_, - partitionMap: partitionMap_ + map: _map }; /** - * @category instances - * @since 2.7.0 + * Derivable from `Functor`. + * + * @category combinators + * @since 2.10.0 */ -exports.FilterableWithIndex = { - URI: exports.URI, - map: map_, - mapWithIndex: mapWithIndex_, - compact: exports.compact, - separate: exports.separate, - filter: filter_, - filterMap: filterMap_, - partition: partition_, - partitionMap: partitionMap_, - partitionMapWithIndex: partitionMapWithIndex_, - partitionWithIndex: partitionWithIndex_, - filterMapWithIndex: filterMapWithIndex_, - filterWithIndex: filterWithIndex_ -}; +exports.flap = +/*#__PURE__*/ +Functor_1.flap(exports.Functor); /** * @category instances - * @since 2.7.0 + * @since 2.10.0 */ -exports.Foldable = { +exports.Pointed = { URI: exports.URI, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_ + of: exports.of }; /** * @category instances * @since 2.7.0 */ -exports.FoldableWithIndex = { +exports.FunctorWithIndex = { URI: exports.URI, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - reduceWithIndex: reduceWithIndex_, - foldMapWithIndex: foldMapWithIndex_, - reduceRightWithIndex: reduceRightWithIndex_ + map: _map, + mapWithIndex: _mapWithIndex }; /** * @category instances - * @since 2.7.0 + * @since 2.10.0 */ -exports.Traversable = { +exports.Apply = { URI: exports.URI, - map: map_, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - traverse: traverse_, - sequence: exports.sequence + map: _map, + ap: _ap }; /** - * @category instances - * @since 2.7.0 - */ -exports.TraversableWithIndex = { - URI: exports.URI, - map: map_, - mapWithIndex: mapWithIndex_, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - reduceWithIndex: reduceWithIndex_, - foldMapWithIndex: foldMapWithIndex_, - reduceRightWithIndex: reduceRightWithIndex_, - traverse: traverse_, - sequence: exports.sequence, - traverseWithIndex: traverseWithIndex_ -}; + * Combine two effectful actions, keeping only the result of the first. + * + * Derivable from `Apply`. + * + * @category combinators + * @since 2.5.0 + */ +exports.apFirst = +/*#__PURE__*/ +Apply_1.apFirst(exports.Apply); +/** + * Combine two effectful actions, keeping only the result of the second. + * + * Derivable from `Apply`. + * + * @category combinators + * @since 2.5.0 + */ +exports.apSecond = +/*#__PURE__*/ +Apply_1.apSecond(exports.Apply); /** * @category instances * @since 2.7.0 */ -exports.Witherable = { +exports.Applicative = { + URI: exports.URI, + map: _map, + ap: _ap, + of: exports.of +}; +/** + * @category instances + * @since 2.10.0 + */ +exports.Chain = { + URI: exports.URI, + map: _map, + ap: _ap, + chain: _chain +}; +/** + * Composes computations in sequence, using the return value of one computation to determine the next computation and + * keeping only the result of the first. + * + * Derivable from `Chain`. + * + * @category combinators + * @since 2.0.0 + */ +exports.chainFirst = +/*#__PURE__*/ +Chain_1.chainFirst(exports.Chain); +/** + * @category instances + * @since 2.7.0 + */ +exports.Monad = { + URI: exports.URI, + map: _map, + ap: _ap, + of: exports.of, + chain: _chain +}; +/** + * @category instances + * @since 2.7.0 + */ +exports.Unfoldable = { + URI: exports.URI, + unfold: exports.unfold +}; +/** + * @category instances + * @since 2.7.0 + */ +exports.Alt = { + URI: exports.URI, + map: _map, + alt: _alt +}; +/** + * @category instances + * @since 2.11.0 + */ +exports.Zero = { + URI: exports.URI, + zero: exports.zero +}; +/** + * @category constructors + * @since 2.11.0 + */ +exports.guard = +/*#__PURE__*/ +Zero_1.guard(exports.Zero, exports.Pointed); +/** + * @category instances + * @since 2.7.0 + */ +exports.Alternative = { + URI: exports.URI, + map: _map, + ap: _ap, + of: exports.of, + alt: _alt, + zero: exports.zero +}; +/** + * @category instances + * @since 2.7.0 + */ +exports.Extend = { + URI: exports.URI, + map: _map, + extend: _extend +}; +/** + * @category instances + * @since 2.7.0 + */ +exports.Compactable = { + URI: exports.URI, + compact: exports.compact, + separate: exports.separate +}; +/** + * @category instances + * @since 2.7.0 + */ +exports.Filterable = { + URI: exports.URI, + map: _map, + compact: exports.compact, + separate: exports.separate, + filter: _filter, + filterMap: _filterMap, + partition: _partition, + partitionMap: _partitionMap +}; +/** + * @category instances + * @since 2.7.0 + */ +exports.FilterableWithIndex = { URI: exports.URI, - map: map_, + map: _map, + mapWithIndex: _mapWithIndex, compact: exports.compact, separate: exports.separate, - filter: filter_, - filterMap: filterMap_, - partition: partition_, - partitionMap: partitionMap_, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - traverse: traverse_, + filter: _filter, + filterMap: _filterMap, + partition: _partition, + partitionMap: _partitionMap, + partitionMapWithIndex: _partitionMapWithIndex, + partitionWithIndex: _partitionWithIndex, + filterMapWithIndex: _filterMapWithIndex, + filterWithIndex: _filterWithIndex +}; +/** + * @category instances + * @since 2.7.0 + */ +exports.Foldable = { + URI: exports.URI, + reduce: _reduce, + foldMap: _foldMap, + reduceRight: _reduceRight +}; +/** + * @category instances + * @since 2.7.0 + */ +exports.FoldableWithIndex = { + URI: exports.URI, + reduce: _reduce, + foldMap: _foldMap, + reduceRight: _reduceRight, + reduceWithIndex: _reduceWithIndex, + foldMapWithIndex: _foldMapWithIndex, + reduceRightWithIndex: _reduceRightWithIndex +}; +/** + * @category instances + * @since 2.7.0 + */ +exports.Traversable = { + URI: exports.URI, + map: _map, + reduce: _reduce, + foldMap: _foldMap, + reduceRight: _reduceRight, + traverse: _traverse, + sequence: exports.sequence +}; +/** + * @category instances + * @since 2.7.0 + */ +exports.TraversableWithIndex = { + URI: exports.URI, + map: _map, + mapWithIndex: _mapWithIndex, + reduce: _reduce, + foldMap: _foldMap, + reduceRight: _reduceRight, + reduceWithIndex: _reduceWithIndex, + foldMapWithIndex: _foldMapWithIndex, + reduceRightWithIndex: _reduceRightWithIndex, + traverse: _traverse, sequence: exports.sequence, - wither: wither_, - wilt: wilt_ + traverseWithIndex: _traverseWithIndex }; -// TODO: remove in v3 +var _wither = Witherable_1.witherDefault(exports.Traversable, exports.Compactable); +var _wilt = Witherable_1.wiltDefault(exports.Traversable, exports.Compactable); /** * @category instances - * @since 2.0.0 + * @since 2.7.0 */ -exports.array = { +exports.Witherable = { URI: exports.URI, + map: _map, compact: exports.compact, separate: exports.separate, - map: map_, - ap: ap_, - of: exports.of, - chain: chain_, - filter: filter_, - filterMap: filterMap_, - partition: partition_, - partitionMap: partitionMap_, - mapWithIndex: mapWithIndex_, - partitionMapWithIndex: partitionMapWithIndex_, - partitionWithIndex: partitionWithIndex_, - filterMapWithIndex: filterMapWithIndex_, - filterWithIndex: filterWithIndex_, - alt: alt_, - zero: exports.zero, - unfold: exports.unfold, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - traverse: traverse_, + filter: _filter, + filterMap: _filterMap, + partition: _partition, + partitionMap: _partitionMap, + reduce: _reduce, + foldMap: _foldMap, + reduceRight: _reduceRight, + traverse: _traverse, sequence: exports.sequence, - reduceWithIndex: reduceWithIndex_, - foldMapWithIndex: foldMapWithIndex_, - reduceRightWithIndex: reduceRightWithIndex_, - traverseWithIndex: traverseWithIndex_, - extend: extend_, - wither: wither_, - wilt: wilt_ + wither: _wither, + wilt: _wilt +}; +/** + * @category ChainRec + * @since 2.11.0 + */ +exports.chainRecDepthFirst = RA.chainRecDepthFirst; +/** + * @category instances + * @since 2.11.0 + */ +exports.ChainRecDepthFirst = { + URI: exports.URI, + map: _map, + ap: _ap, + chain: _chain, + chainRec: _chainRecDepthFirst +}; +/** + * @category ChainRec + * @since 2.11.0 + */ +exports.chainRecBreadthFirst = RA.chainRecBreadthFirst; +/** + * @category instances + * @since 2.11.0 + */ +exports.ChainRecBreadthFirst = { + URI: exports.URI, + map: _map, + ap: _ap, + chain: _chain, + chainRec: _chainRecBreadthFirst +}; +/** + * Filter values inside a context. + * + * @since 2.11.0 + */ +exports.filterE = +/*#__PURE__*/ +Witherable_1.filterE(exports.Witherable); +/** + * @category instances + * @since 2.11.0 + */ +exports.FromEither = { + URI: exports.URI, + fromEither: exports.fromEither }; +/** + * @category combinators + * @since 2.11.0 + */ +exports.fromEitherK = +/*#__PURE__*/ +FromEither_1.fromEitherK(exports.FromEither); // ------------------------------------------------------------------------------------- // unsafe // ------------------------------------------------------------------------------------- @@ -6428,26 +7171,28 @@ exports.array = { * @category unsafe * @since 2.0.0 */ -exports.unsafeInsertAt = RA.unsafeInsertAt; +exports.unsafeInsertAt = NEA.unsafeInsertAt; /** * @category unsafe * @since 2.0.0 */ -exports.unsafeUpdateAt = RA.unsafeUpdateAt; +var unsafeUpdateAt = function (i, a, as) { + return exports.isNonEmpty(as) ? NEA.unsafeUpdateAt(i, a, as) : []; +}; +exports.unsafeUpdateAt = unsafeUpdateAt; /** * @category unsafe * @since 2.0.0 */ -exports.unsafeDeleteAt = RA.unsafeDeleteAt; +var unsafeDeleteAt = function (i, as) { + var xs = as.slice(); + xs.splice(i, 1); + return xs; +}; +exports.unsafeDeleteAt = unsafeDeleteAt; // ------------------------------------------------------------------------------------- // utils // ------------------------------------------------------------------------------------- -/** - * An empty array - * - * @since 2.0.0 - */ -exports.empty = []; /** * @since 2.9.0 */ @@ -6455,7 +7200,14 @@ exports.every = RA.every; /** * @since 2.9.0 */ -exports.some = RA.some; +var some = function (predicate) { return function (as) { return as.some(predicate); }; }; +exports.some = some; +/** + * Alias of [`some`](#some) + * + * @since 2.11.0 + */ +exports.exists = exports.some; // ------------------------------------------------------------------------------------- // do notation // ------------------------------------------------------------------------------------- @@ -6464,1649 +7216,2904 @@ exports.some = RA.some; */ exports.Do = /*#__PURE__*/ -exports.of({}); +exports.of(_.emptyRecord); /** * @since 2.8.0 */ -exports.bindTo = RA.bindTo; +exports.bindTo = +/*#__PURE__*/ +Functor_1.bindTo(exports.Functor); /** * @since 2.8.0 */ -exports.bind = RA.bind; +exports.bind = +/*#__PURE__*/ +Chain_1.bind(exports.Chain); // ------------------------------------------------------------------------------------- // pipeable sequence S // ------------------------------------------------------------------------------------- /** * @since 2.8.0 */ -exports.apS = RA.apS; - - -/***/ }), - -/***/ 5322: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.tailRec = void 0; -/** - * @since 2.0.0 - */ -function tailRec(a, f) { - var v = f(a); - while (v._tag === 'Left') { - v = f(v.left); - } - return v.right; -} -exports.tailRec = tailRec; - - -/***/ }), - -/***/ 7534: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getWitherable = exports.getFilterable = exports.getApplyMonoid = exports.getApplySemigroup = exports.getSemigroup = exports.getEq = exports.getShow = exports.URI = exports.throwError = exports.sequence = exports.traverse = exports.reduceRight = exports.foldMap = exports.reduce = exports.duplicate = exports.extend = exports.alt = exports.altW = exports.flatten = exports.chainFirst = exports.chainFirstW = exports.chain = exports.chainW = exports.of = exports.apSecond = exports.apFirst = exports.ap = exports.apW = exports.mapLeft = exports.bimap = exports.map = exports.filterOrElse = exports.filterOrElseW = exports.orElse = exports.swap = exports.chainNullableK = exports.fromNullableK = exports.getOrElse = exports.getOrElseW = exports.fold = exports.fromPredicate = exports.fromOption = exports.stringifyJSON = exports.parseJSON = exports.tryCatch = exports.fromNullable = exports.right = exports.left = exports.isRight = exports.isLeft = void 0; -exports.sequenceArray = exports.traverseArray = exports.traverseArrayWithIndex = exports.apS = exports.apSW = exports.bind = exports.bindW = exports.bindTo = exports.Do = exports.exists = exports.elem = exports.toError = exports.either = exports.getValidationMonoid = exports.MonadThrow = exports.ChainRec = exports.Extend = exports.Alt = exports.Bifunctor = exports.Traversable = exports.Foldable = exports.Monad = exports.Applicative = exports.Functor = exports.getValidationSemigroup = exports.getValidation = exports.getAltValidation = exports.getApplicativeValidation = void 0; -var ChainRec_1 = __nccwpck_require__(5322); -var function_1 = __nccwpck_require__(6985); +exports.apS = +/*#__PURE__*/ +Apply_1.apS(exports.Apply); // ------------------------------------------------------------------------------------- -// guards +// deprecated // ------------------------------------------------------------------------------------- +// tslint:disable: deprecation /** - * Returns `true` if the either is an instance of `Left`, `false` otherwise. + * Use `NonEmptyArray` module instead. * - * @category guards + * @category constructors * @since 2.0.0 + * @deprecated */ -var isLeft = function (ma) { return ma._tag === 'Left'; }; -exports.isLeft = isLeft; +exports.range = NEA.range; /** - * Returns `true` if the either is an instance of `Right`, `false` otherwise. + * Use a new `[]` instead. * - * @category guards * @since 2.0.0 + * @deprecated */ -var isRight = function (ma) { return ma._tag === 'Right'; }; -exports.isRight = isRight; -// ------------------------------------------------------------------------------------- -// constructors -// ------------------------------------------------------------------------------------- +exports.empty = []; /** - * Constructs a new `Either` holding a `Left` value. This usually represents a failure, due to the right-bias of this - * structure. + * Use `prepend` instead. * * @category constructors * @since 2.0.0 + * @deprecated */ -var left = function (e) { return ({ _tag: 'Left', left: e }); }; -exports.left = left; +exports.cons = NEA.cons; /** - * Constructs a new `Either` holding a `Right` value. This usually represents a successful value due to the right bias - * of this structure. + * Use `append` instead. * * @category constructors * @since 2.0.0 + * @deprecated */ -var right = function (a) { return ({ _tag: 'Right', right: a }); }; -exports.right = right; -// TODO: make lazy in v3 +exports.snoc = NEA.snoc; /** - * Takes a default and a nullable value, if the value is not nully, turn it into a `Right`, if the value is nully use - * the provided default as a `Left`. - * - * @example - * import { fromNullable, left, right } from 'fp-ts/Either' + * Use `prependAll` instead * - * const parse = fromNullable('nully') + * @category combinators + * @since 2.9.0 + * @deprecated + */ +exports.prependToAll = exports.prependAll; +/** + * Use small, specific instances instead. + * + * @category instances + * @since 2.0.0 + * @deprecated + */ +exports.array = { + URI: exports.URI, + compact: exports.compact, + separate: exports.separate, + map: _map, + ap: _ap, + of: exports.of, + chain: _chain, + filter: _filter, + filterMap: _filterMap, + partition: _partition, + partitionMap: _partitionMap, + mapWithIndex: _mapWithIndex, + partitionMapWithIndex: _partitionMapWithIndex, + partitionWithIndex: _partitionWithIndex, + filterMapWithIndex: _filterMapWithIndex, + filterWithIndex: _filterWithIndex, + alt: _alt, + zero: exports.zero, + unfold: exports.unfold, + reduce: _reduce, + foldMap: _foldMap, + reduceRight: _reduceRight, + traverse: _traverse, + sequence: exports.sequence, + reduceWithIndex: _reduceWithIndex, + foldMapWithIndex: _foldMapWithIndex, + reduceRightWithIndex: _reduceRightWithIndex, + traverseWithIndex: _traverseWithIndex, + extend: _extend, + wither: _wither, + wilt: _wilt +}; + + +/***/ }), + +/***/ 2372: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.bind = exports.chainFirst = void 0; +function chainFirst(M) { + return function (f) { return function (first) { return M.chain(first, function (a) { return M.map(f(a), function () { return a; }); }); }; }; +} +exports.chainFirst = chainFirst; +function bind(M) { + return function (name, f) { return function (ma) { return M.chain(ma, function (a) { return M.map(f(a), function (b) { + var _a; + return Object.assign({}, a, (_a = {}, _a[name] = b, _a)); + }); }); }; }; +} +exports.bind = bind; + + +/***/ }), + +/***/ 5322: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.tailRec = void 0; +/** + * @since 2.0.0 + */ +var tailRec = function (startWith, f) { + var ab = f(startWith); + while (ab._tag === 'Left') { + ab = f(ab.left); + } + return ab.right; +}; +exports.tailRec = tailRec; + + +/***/ }), + +/***/ 7534: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.fold = exports.match = exports.foldW = exports.matchW = exports.isRight = exports.isLeft = exports.fromOption = exports.fromPredicate = exports.FromEither = exports.MonadThrow = exports.throwError = exports.ChainRec = exports.Extend = exports.extend = exports.Alt = exports.alt = exports.altW = exports.Bifunctor = exports.mapLeft = exports.bimap = exports.Traversable = exports.sequence = exports.traverse = exports.Foldable = exports.reduceRight = exports.foldMap = exports.reduce = exports.Monad = exports.Chain = exports.chain = exports.chainW = exports.Applicative = exports.Apply = exports.ap = exports.apW = exports.Pointed = exports.of = exports.Functor = exports.map = exports.getAltValidation = exports.getApplicativeValidation = exports.getWitherable = exports.getFilterable = exports.getCompactable = exports.getSemigroup = exports.getEq = exports.getShow = exports.URI = exports.right = exports.left = void 0; +exports.getValidation = exports.getValidationMonoid = exports.getValidationSemigroup = exports.getApplyMonoid = exports.getApplySemigroup = exports.either = exports.stringifyJSON = exports.parseJSON = exports.sequenceArray = exports.traverseArray = exports.traverseArrayWithIndex = exports.traverseReadonlyArrayWithIndex = exports.traverseReadonlyNonEmptyArrayWithIndex = exports.ApT = exports.apSW = exports.apS = exports.bindW = exports.bind = exports.bindTo = exports.Do = exports.exists = exports.elem = exports.toError = exports.toUnion = exports.chainNullableK = exports.fromNullableK = exports.tryCatchK = exports.tryCatch = exports.fromNullable = exports.orElse = exports.orElseW = exports.swap = exports.filterOrElseW = exports.filterOrElse = exports.chainOptionK = exports.fromOptionK = exports.duplicate = exports.flatten = exports.flattenW = exports.chainFirstW = exports.chainFirst = exports.apSecond = exports.apFirst = exports.flap = exports.getOrElse = exports.getOrElseW = void 0; +var Applicative_1 = __nccwpck_require__(4766); +var Apply_1 = __nccwpck_require__(205); +var Chain_1 = __nccwpck_require__(2372); +var ChainRec_1 = __nccwpck_require__(5322); +var FromEither_1 = __nccwpck_require__(1964); +var function_1 = __nccwpck_require__(6985); +var Functor_1 = __nccwpck_require__(5533); +var _ = __importStar(__nccwpck_require__(1840)); +var Separated_1 = __nccwpck_require__(5877); +var Witherable_1 = __nccwpck_require__(4384); +// ------------------------------------------------------------------------------------- +// constructors +// ------------------------------------------------------------------------------------- +/** + * Constructs a new `Either` holding a `Left` value. This usually represents a failure, due to the right-bias of this + * structure. + * + * @category constructors + * @since 2.0.0 + */ +exports.left = _.left; +/** + * Constructs a new `Either` holding a `Right` value. This usually represents a successful value due to the right bias + * of this structure. + * + * @category constructors + * @since 2.0.0 + */ +exports.right = _.right; +// ------------------------------------------------------------------------------------- +// non-pipeables +// ------------------------------------------------------------------------------------- +var _map = function (fa, f) { return function_1.pipe(fa, exports.map(f)); }; +var _ap = function (fab, fa) { return function_1.pipe(fab, exports.ap(fa)); }; +/* istanbul ignore next */ +var _chain = function (ma, f) { return function_1.pipe(ma, exports.chain(f)); }; +/* istanbul ignore next */ +var _reduce = function (fa, b, f) { return function_1.pipe(fa, exports.reduce(b, f)); }; +/* istanbul ignore next */ +var _foldMap = function (M) { return function (fa, f) { + var foldMapM = exports.foldMap(M); + return function_1.pipe(fa, foldMapM(f)); +}; }; +/* istanbul ignore next */ +var _reduceRight = function (fa, b, f) { return function_1.pipe(fa, exports.reduceRight(b, f)); }; +var _traverse = function (F) { + var traverseF = exports.traverse(F); + return function (ta, f) { return function_1.pipe(ta, traverseF(f)); }; +}; +var _bimap = function (fa, f, g) { return function_1.pipe(fa, exports.bimap(f, g)); }; +var _mapLeft = function (fa, f) { return function_1.pipe(fa, exports.mapLeft(f)); }; +/* istanbul ignore next */ +var _alt = function (fa, that) { return function_1.pipe(fa, exports.alt(that)); }; +/* istanbul ignore next */ +var _extend = function (wa, f) { return function_1.pipe(wa, exports.extend(f)); }; +var _chainRec = function (a, f) { + return ChainRec_1.tailRec(f(a), function (e) { + return exports.isLeft(e) ? exports.right(exports.left(e.left)) : exports.isLeft(e.right) ? exports.left(f(e.right.left)) : exports.right(exports.right(e.right.right)); + }); +}; +// ------------------------------------------------------------------------------------- +// instances +// ------------------------------------------------------------------------------------- +/** + * @category instances + * @since 2.0.0 + */ +exports.URI = 'Either'; +/** + * @category instances + * @since 2.0.0 + */ +var getShow = function (SE, SA) { return ({ + show: function (ma) { return (exports.isLeft(ma) ? "left(" + SE.show(ma.left) + ")" : "right(" + SA.show(ma.right) + ")"); } +}); }; +exports.getShow = getShow; +/** + * @category instances + * @since 2.0.0 + */ +var getEq = function (EL, EA) { return ({ + equals: function (x, y) { + return x === y || (exports.isLeft(x) ? exports.isLeft(y) && EL.equals(x.left, y.left) : exports.isRight(y) && EA.equals(x.right, y.right)); + } +}); }; +exports.getEq = getEq; +/** + * Semigroup returning the left-most non-`Left` value. If both operands are `Right`s then the inner values are + * concatenated using the provided `Semigroup` + * + * @example + * import { getSemigroup, left, right } from 'fp-ts/Either' + * import { SemigroupSum } from 'fp-ts/number' + * + * const S = getSemigroup(SemigroupSum) + * assert.deepStrictEqual(S.concat(left('a'), left('b')), left('a')) + * assert.deepStrictEqual(S.concat(left('a'), right(2)), right(2)) + * assert.deepStrictEqual(S.concat(right(1), left('b')), right(1)) + * assert.deepStrictEqual(S.concat(right(1), right(2)), right(3)) + * + * @category instances + * @since 2.0.0 + */ +var getSemigroup = function (S) { return ({ + concat: function (x, y) { return (exports.isLeft(y) ? x : exports.isLeft(x) ? y : exports.right(S.concat(x.right, y.right))); } +}); }; +exports.getSemigroup = getSemigroup; +/** + * Builds a `Compactable` instance for `Either` given `Monoid` for the left side. + * + * @category instances + * @since 2.10.0 + */ +var getCompactable = function (M) { + var empty = exports.left(M.empty); + return { + URI: exports.URI, + _E: undefined, + compact: function (ma) { return (exports.isLeft(ma) ? ma : ma.right._tag === 'None' ? empty : exports.right(ma.right.value)); }, + separate: function (ma) { + return exports.isLeft(ma) + ? Separated_1.separated(ma, ma) + : exports.isLeft(ma.right) + ? Separated_1.separated(exports.right(ma.right.left), empty) + : Separated_1.separated(empty, exports.right(ma.right.right)); + } + }; +}; +exports.getCompactable = getCompactable; +/** + * Builds a `Filterable` instance for `Either` given `Monoid` for the left side + * + * @category instances + * @since 2.10.0 + */ +var getFilterable = function (M) { + var empty = exports.left(M.empty); + var _a = exports.getCompactable(M), compact = _a.compact, separate = _a.separate; + var filter = function (ma, predicate) { + return exports.isLeft(ma) ? ma : predicate(ma.right) ? ma : empty; + }; + var partition = function (ma, p) { + return exports.isLeft(ma) + ? Separated_1.separated(ma, ma) + : p(ma.right) + ? Separated_1.separated(empty, exports.right(ma.right)) + : Separated_1.separated(exports.right(ma.right), empty); + }; + return { + URI: exports.URI, + _E: undefined, + map: _map, + compact: compact, + separate: separate, + filter: filter, + filterMap: function (ma, f) { + if (exports.isLeft(ma)) { + return ma; + } + var ob = f(ma.right); + return ob._tag === 'None' ? empty : exports.right(ob.value); + }, + partition: partition, + partitionMap: function (ma, f) { + if (exports.isLeft(ma)) { + return Separated_1.separated(ma, ma); + } + var e = f(ma.right); + return exports.isLeft(e) ? Separated_1.separated(exports.right(e.left), empty) : Separated_1.separated(empty, exports.right(e.right)); + } + }; +}; +exports.getFilterable = getFilterable; +/** + * Builds `Witherable` instance for `Either` given `Monoid` for the left side + * + * @category instances + * @since 2.0.0 + */ +var getWitherable = function (M) { + var F_ = exports.getFilterable(M); + var C = exports.getCompactable(M); + return { + URI: exports.URI, + _E: undefined, + map: _map, + compact: F_.compact, + separate: F_.separate, + filter: F_.filter, + filterMap: F_.filterMap, + partition: F_.partition, + partitionMap: F_.partitionMap, + traverse: _traverse, + sequence: exports.sequence, + reduce: _reduce, + foldMap: _foldMap, + reduceRight: _reduceRight, + wither: Witherable_1.witherDefault(exports.Traversable, C), + wilt: Witherable_1.wiltDefault(exports.Traversable, C) + }; +}; +exports.getWitherable = getWitherable; +/** + * @category instances + * @since 2.7.0 + */ +var getApplicativeValidation = function (SE) { return ({ + URI: exports.URI, + _E: undefined, + map: _map, + ap: function (fab, fa) { + return exports.isLeft(fab) + ? exports.isLeft(fa) + ? exports.left(SE.concat(fab.left, fa.left)) + : fab + : exports.isLeft(fa) + ? fa + : exports.right(fab.right(fa.right)); + }, + of: exports.of +}); }; +exports.getApplicativeValidation = getApplicativeValidation; +/** + * @category instances + * @since 2.7.0 + */ +var getAltValidation = function (SE) { return ({ + URI: exports.URI, + _E: undefined, + map: _map, + alt: function (me, that) { + if (exports.isRight(me)) { + return me; + } + var ea = that(); + return exports.isLeft(ea) ? exports.left(SE.concat(me.left, ea.left)) : ea; + } +}); }; +exports.getAltValidation = getAltValidation; +/** + * @category instance operations + * @since 2.0.0 + */ +var map = function (f) { return function (fa) { + return exports.isLeft(fa) ? fa : exports.right(f(fa.right)); +}; }; +exports.map = map; +/** + * @category instances + * @since 2.7.0 + */ +exports.Functor = { + URI: exports.URI, + map: _map +}; +/** + * @category instance operations + * @since 2.7.0 + */ +exports.of = exports.right; +/** + * @category instances + * @since 2.10.0 + */ +exports.Pointed = { + URI: exports.URI, + of: exports.of +}; +/** + * Less strict version of [`ap`](#ap). + * + * @category instance operations + * @since 2.8.0 + */ +var apW = function (fa) { return function (fab) { return (exports.isLeft(fab) ? fab : exports.isLeft(fa) ? fa : exports.right(fab.right(fa.right))); }; }; +exports.apW = apW; +/** + * Apply a function to an argument under a type constructor. + * + * @category instance operations + * @since 2.0.0 + */ +exports.ap = exports.apW; +/** + * @category instances + * @since 2.10.0 + */ +exports.Apply = { + URI: exports.URI, + map: _map, + ap: _ap +}; +/** + * @category instances + * @since 2.7.0 + */ +exports.Applicative = { + URI: exports.URI, + map: _map, + ap: _ap, + of: exports.of +}; +/** + * Less strict version of [`chain`](#chain). + * + * @category instance operations + * @since 2.6.0 + */ +var chainW = function (f) { return function (ma) { + return exports.isLeft(ma) ? ma : f(ma.right); +}; }; +exports.chainW = chainW; +/** + * Composes computations in sequence, using the return value of one computation to determine the next computation. + * + * @category instance operations + * @since 2.0.0 + */ +exports.chain = exports.chainW; +/** + * @category instances + * @since 2.10.0 + */ +exports.Chain = { + URI: exports.URI, + map: _map, + ap: _ap, + chain: _chain +}; +/** + * @category instances + * @since 2.7.0 + */ +exports.Monad = { + URI: exports.URI, + map: _map, + ap: _ap, + of: exports.of, + chain: _chain +}; +/** + * Left-associative fold of a structure. + * + * @example + * import { pipe } from 'fp-ts/function' + * import * as E from 'fp-ts/Either' + * + * const startWith = 'prefix' + * const concat = (a: string, b: string) => `${a}:${b}` + * + * assert.deepStrictEqual( + * pipe(E.right('a'), E.reduce(startWith, concat)), + * 'prefix:a' + * ) + * + * assert.deepStrictEqual( + * pipe(E.left('e'), E.reduce(startWith, concat)), + * 'prefix' + * ) + * + * @category instance operations + * @since 2.0.0 + */ +var reduce = function (b, f) { return function (fa) { + return exports.isLeft(fa) ? b : f(b, fa.right); +}; }; +exports.reduce = reduce; +/** + * Map each element of the structure to a monoid, and combine the results. + * + * @example + * import { pipe } from 'fp-ts/function' + * import * as E from 'fp-ts/Either' + * import * as S from 'fp-ts/string' + * + * const yell = (a: string) => `${a}!` + * + * assert.deepStrictEqual( + * pipe(E.right('a'), E.foldMap(S.Monoid)(yell)), + * 'a!' + * ) + * + * assert.deepStrictEqual( + * pipe(E.left('e'), E.foldMap(S.Monoid)(yell)), + * S.Monoid.empty + * ) + * + * @category instance operations + * @since 2.0.0 + */ +var foldMap = function (M) { return function (f) { return function (fa) { + return exports.isLeft(fa) ? M.empty : f(fa.right); +}; }; }; +exports.foldMap = foldMap; +/** + * Right-associative fold of a structure. + * + * @example + * import { pipe } from 'fp-ts/function' + * import * as E from 'fp-ts/Either' + * + * const startWith = 'postfix' + * const concat = (a: string, b: string) => `${a}:${b}` + * + * assert.deepStrictEqual( + * pipe(E.right('a'), E.reduceRight(startWith, concat)), + * 'a:postfix' + * ) + * + * assert.deepStrictEqual( + * pipe(E.left('e'), E.reduceRight(startWith, concat)), + * 'postfix' + * ) + * + * @category instance operations + * @since 2.0.0 + */ +var reduceRight = function (b, f) { return function (fa) { + return exports.isLeft(fa) ? b : f(fa.right, b); +}; }; +exports.reduceRight = reduceRight; +/** + * @category instances + * @since 2.7.0 + */ +exports.Foldable = { + URI: exports.URI, + reduce: _reduce, + foldMap: _foldMap, + reduceRight: _reduceRight +}; +/** + * Map each element of a structure to an action, evaluate these actions from left to right, and collect the results. + * + * @example + * import { pipe } from 'fp-ts/function' + * import * as RA from 'fp-ts/ReadonlyArray' + * import * as E from 'fp-ts/Either' + * import * as O from 'fp-ts/Option' + * + * assert.deepStrictEqual( + * pipe(E.right(['a']), E.traverse(O.Applicative)(RA.head)), + * O.some(E.right('a')) + * ) + * + * assert.deepStrictEqual( + * pipe(E.right([]), E.traverse(O.Applicative)(RA.head)), + * O.none + * ) + * + * @category instance operations + * @since 2.6.3 + */ +var traverse = function (F) { return function (f) { return function (ta) { return (exports.isLeft(ta) ? F.of(exports.left(ta.left)) : F.map(f(ta.right), exports.right)); }; }; }; +exports.traverse = traverse; +/** + * Evaluate each monadic action in the structure from left to right, and collect the results. + * + * @example + * import { pipe } from 'fp-ts/function' + * import * as E from 'fp-ts/Either' + * import * as O from 'fp-ts/Option' + * + * assert.deepStrictEqual( + * pipe(E.right(O.some('a')), E.sequence(O.Applicative)), + * O.some(E.right('a')) + * ) + * + * assert.deepStrictEqual( + * pipe(E.right(O.none), E.sequence(O.Applicative)), + * O.none + * ) + * + * @category instance operations + * @since 2.6.3 + */ +var sequence = function (F) { return function (ma) { + return exports.isLeft(ma) ? F.of(exports.left(ma.left)) : F.map(ma.right, exports.right); +}; }; +exports.sequence = sequence; +/** + * @category instances + * @since 2.7.0 + */ +exports.Traversable = { + URI: exports.URI, + map: _map, + reduce: _reduce, + foldMap: _foldMap, + reduceRight: _reduceRight, + traverse: _traverse, + sequence: exports.sequence +}; +/** + * Map a pair of functions over the two type arguments of the bifunctor. + * + * @category instance operations + * @since 2.0.0 + */ +var bimap = function (f, g) { return function (fa) { return (exports.isLeft(fa) ? exports.left(f(fa.left)) : exports.right(g(fa.right))); }; }; +exports.bimap = bimap; +/** + * Map a function over the first type argument of a bifunctor. + * + * @category instance operations + * @since 2.0.0 + */ +var mapLeft = function (f) { return function (fa) { + return exports.isLeft(fa) ? exports.left(f(fa.left)) : fa; +}; }; +exports.mapLeft = mapLeft; +/** + * @category instances + * @since 2.7.0 + */ +exports.Bifunctor = { + URI: exports.URI, + bimap: _bimap, + mapLeft: _mapLeft +}; +/** + * Less strict version of [`alt`](#alt). + * + * @category instance operations + * @since 2.9.0 + */ +var altW = function (that) { return function (fa) { return (exports.isLeft(fa) ? that() : fa); }; }; +exports.altW = altW; +/** + * Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to + * types of kind `* -> *`. + * + * @category instance operations + * @since 2.0.0 + */ +exports.alt = exports.altW; +/** + * @category instances + * @since 2.7.0 + */ +exports.Alt = { + URI: exports.URI, + map: _map, + alt: _alt +}; +/** + * @category instance operations + * @since 2.0.0 + */ +var extend = function (f) { return function (wa) { + return exports.isLeft(wa) ? wa : exports.right(f(wa)); +}; }; +exports.extend = extend; +/** + * @category instances + * @since 2.7.0 + */ +exports.Extend = { + URI: exports.URI, + map: _map, + extend: _extend +}; +/** + * @category instances + * @since 2.7.0 + */ +exports.ChainRec = { + URI: exports.URI, + map: _map, + ap: _ap, + chain: _chain, + chainRec: _chainRec +}; +/** + * @category instance operations + * @since 2.6.3 + */ +exports.throwError = exports.left; +/** + * @category instances + * @since 2.7.0 + */ +exports.MonadThrow = { + URI: exports.URI, + map: _map, + ap: _ap, + of: exports.of, + chain: _chain, + throwError: exports.throwError +}; +/** + * @category instances + * @since 2.10.0 + */ +exports.FromEither = { + URI: exports.URI, + fromEither: function_1.identity +}; +/** + * @example + * import { fromPredicate, left, right } from 'fp-ts/Either' + * import { pipe } from 'fp-ts/function' + * + * assert.deepStrictEqual( + * pipe( + * 1, + * fromPredicate( + * (n) => n > 0, + * () => 'error' + * ) + * ), + * right(1) + * ) + * assert.deepStrictEqual( + * pipe( + * -1, + * fromPredicate( + * (n) => n > 0, + * () => 'error' + * ) + * ), + * left('error') + * ) + * + * @category constructors + * @since 2.0.0 + */ +exports.fromPredicate = +/*#__PURE__*/ +FromEither_1.fromPredicate(exports.FromEither); +// ------------------------------------------------------------------------------------- +// natural transformations +// ------------------------------------------------------------------------------------- +/** + * @example + * import * as E from 'fp-ts/Either' + * import { pipe } from 'fp-ts/function' + * import * as O from 'fp-ts/Option' + * + * assert.deepStrictEqual( + * pipe( + * O.some(1), + * E.fromOption(() => 'error') + * ), + * E.right(1) + * ) + * assert.deepStrictEqual( + * pipe( + * O.none, + * E.fromOption(() => 'error') + * ), + * E.left('error') + * ) + * + * @category natural transformations + * @since 2.0.0 + */ +exports.fromOption = +/*#__PURE__*/ +FromEither_1.fromOption(exports.FromEither); +// ------------------------------------------------------------------------------------- +// refinements +// ------------------------------------------------------------------------------------- +/** + * Returns `true` if the either is an instance of `Left`, `false` otherwise. + * + * @category refinements + * @since 2.0.0 + */ +exports.isLeft = _.isLeft; +/** + * Returns `true` if the either is an instance of `Right`, `false` otherwise. + * + * @category refinements + * @since 2.0.0 + */ +exports.isRight = _.isRight; +// ------------------------------------------------------------------------------------- +// destructors +// ------------------------------------------------------------------------------------- +/** + * Less strict version of [`match`](#match). + * + * @category destructors + * @since 2.10.0 + */ +var matchW = function (onLeft, onRight) { return function (ma) { + return exports.isLeft(ma) ? onLeft(ma.left) : onRight(ma.right); +}; }; +exports.matchW = matchW; +/** + * Alias of [`matchW`](#matchw). + * + * @category destructors + * @since 2.10.0 + */ +exports.foldW = exports.matchW; +/** + * Takes two functions and an `Either` value, if the value is a `Left` the inner value is applied to the first function, + * if the value is a `Right` the inner value is applied to the second function. + * + * @example + * import { match, left, right } from 'fp-ts/Either' + * import { pipe } from 'fp-ts/function' + * + * function onLeft(errors: Array): string { + * return `Errors: ${errors.join(', ')}` + * } + * + * function onRight(value: number): string { + * return `Ok: ${value}` + * } + * + * assert.strictEqual( + * pipe( + * right(1), + * match(onLeft, onRight) + * ), + * 'Ok: 1' + * ) + * assert.strictEqual( + * pipe( + * left(['error 1', 'error 2']), + * match(onLeft, onRight) + * ), + * 'Errors: error 1, error 2' + * ) + * + * @category destructors + * @since 2.10.0 + */ +exports.match = exports.matchW; +/** + * Alias of [`match`](#match). + * + * @category destructors + * @since 2.0.0 + */ +exports.fold = exports.match; +/** + * Less strict version of [`getOrElse`](#getorelse). + * + * @category destructors + * @since 2.6.0 + */ +var getOrElseW = function (onLeft) { return function (ma) { + return exports.isLeft(ma) ? onLeft(ma.left) : ma.right; +}; }; +exports.getOrElseW = getOrElseW; +/** + * Returns the wrapped value if it's a `Right` or a default value if is a `Left`. + * + * @example + * import { getOrElse, left, right } from 'fp-ts/Either' + * import { pipe } from 'fp-ts/function' + * + * assert.deepStrictEqual( + * pipe( + * right(1), + * getOrElse(() => 0) + * ), + * 1 + * ) + * assert.deepStrictEqual( + * pipe( + * left('error'), + * getOrElse(() => 0) + * ), + * 0 + * ) + * + * @category destructors + * @since 2.0.0 + */ +exports.getOrElse = exports.getOrElseW; +// ------------------------------------------------------------------------------------- +// combinators +// ------------------------------------------------------------------------------------- +/** + * Derivable from `Functor`. + * + * @category combinators + * @since 2.10.0 + */ +exports.flap = +/*#__PURE__*/ +Functor_1.flap(exports.Functor); +/** + * Combine two effectful actions, keeping only the result of the first. + * + * Derivable from `Apply`. + * + * @category combinators + * @since 2.0.0 + */ +exports.apFirst = +/*#__PURE__*/ +Apply_1.apFirst(exports.Apply); +/** + * Combine two effectful actions, keeping only the result of the second. + * + * Derivable from `Apply`. + * + * @category combinators + * @since 2.0.0 + */ +exports.apSecond = +/*#__PURE__*/ +Apply_1.apSecond(exports.Apply); +/** + * Composes computations in sequence, using the return value of one computation to determine the next computation and + * keeping only the result of the first. + * + * Derivable from `Chain`. + * + * @category combinators + * @since 2.0.0 + */ +exports.chainFirst = +/*#__PURE__*/ +Chain_1.chainFirst(exports.Chain); +/** + * Less strict version of [`chainFirst`](#chainfirst) + * + * Derivable from `Chain`. + * + * @category combinators + * @since 2.8.0 + */ +exports.chainFirstW = exports.chainFirst; +/** + * Less strict version of [`flatten`](#flatten). + * + * @category combinators + * @since 2.11.0 + */ +exports.flattenW = +/*#__PURE__*/ +exports.chainW(function_1.identity); +/** + * The `flatten` function is the conventional monad join operator. It is used to remove one level of monadic structure, projecting its bound argument into the outer level. + * + * Derivable from `Chain`. + * + * @example + * import * as E from 'fp-ts/Either' + * + * assert.deepStrictEqual(E.flatten(E.right(E.right('a'))), E.right('a')) + * assert.deepStrictEqual(E.flatten(E.right(E.left('e'))), E.left('e')) + * assert.deepStrictEqual(E.flatten(E.left('e')), E.left('e')) + * + * @category combinators + * @since 2.0.0 + */ +exports.flatten = exports.flattenW; +/** + * Derivable from `Extend`. + * + * @category combinators + * @since 2.0.0 + */ +exports.duplicate = +/*#__PURE__*/ +exports.extend(function_1.identity); +/** + * @category combinators + * @since 2.10.0 + */ +exports.fromOptionK = +/*#__PURE__*/ +FromEither_1.fromOptionK(exports.FromEither); +/** + * @category combinators + * @since 2.11.0 + */ +exports.chainOptionK = +/*#__PURE__*/ +FromEither_1.chainOptionK(exports.FromEither, exports.Chain); +/** + * @example + * import * as E from 'fp-ts/Either' + * import { pipe } from 'fp-ts/function' + * + * assert.deepStrictEqual( + * pipe( + * E.right(1), + * E.filterOrElse( + * (n) => n > 0, + * () => 'error' + * ) + * ), + * E.right(1) + * ) + * assert.deepStrictEqual( + * pipe( + * E.right(-1), + * E.filterOrElse( + * (n) => n > 0, + * () => 'error' + * ) + * ), + * E.left('error') + * ) + * assert.deepStrictEqual( + * pipe( + * E.left('a'), + * E.filterOrElse( + * (n) => n > 0, + * () => 'error' + * ) + * ), + * E.left('a') + * ) + * + * @category combinators + * @since 2.0.0 + */ +exports.filterOrElse = +/*#__PURE__*/ +FromEither_1.filterOrElse(exports.FromEither, exports.Chain); +/** + * Less strict version of [`filterOrElse`](#filterorelse). + * + * @category combinators + * @since 2.9.0 + */ +exports.filterOrElseW = exports.filterOrElse; +/** + * Returns a `Right` if is a `Left` (and vice versa). + * + * @category combinators + * @since 2.0.0 + */ +var swap = function (ma) { return (exports.isLeft(ma) ? exports.right(ma.left) : exports.left(ma.right)); }; +exports.swap = swap; +/** + * Less strict version of [`orElse`](#orelse). + * + * @category combinators + * @since 2.10.0 + */ +var orElseW = function (onLeft) { return function (ma) { + return exports.isLeft(ma) ? onLeft(ma.left) : ma; +}; }; +exports.orElseW = orElseW; +/** + * Useful for recovering from errors. + * + * @category combinators + * @since 2.0.0 + */ +exports.orElse = exports.orElseW; +// ------------------------------------------------------------------------------------- +// interop +// ------------------------------------------------------------------------------------- +/** + * Takes a default and a nullable value, if the value is not nully, turn it into a `Right`, if the value is nully use + * the provided default as a `Left`. + * + * @example + * import { fromNullable, left, right } from 'fp-ts/Either' + * + * const parse = fromNullable('nully') * * assert.deepStrictEqual(parse(1), right(1)) * assert.deepStrictEqual(parse(null), left('nully')) * - * @category constructors + * @category interop + * @since 2.0.0 + */ +var fromNullable = function (e) { return function (a) { + return a == null ? exports.left(e) : exports.right(a); +}; }; +exports.fromNullable = fromNullable; +/** + * Constructs a new `Either` from a function that might throw. + * + * See also [`tryCatchK`](#trycatchk). + * + * @example + * import * as E from 'fp-ts/Either' + * + * const unsafeHead = (as: ReadonlyArray): A => { + * if (as.length > 0) { + * return as[0] + * } else { + * throw new Error('empty array') + * } + * } + * + * const head = (as: ReadonlyArray): E.Either => + * E.tryCatch(() => unsafeHead(as), e => (e instanceof Error ? e : new Error('unknown error'))) + * + * assert.deepStrictEqual(head([]), E.left(new Error('empty array'))) + * assert.deepStrictEqual(head([1, 2, 3]), E.right(1)) + * + * @category interop + * @since 2.0.0 + */ +var tryCatch = function (f, onThrow) { + try { + return exports.right(f()); + } + catch (e) { + return exports.left(onThrow(e)); + } +}; +exports.tryCatch = tryCatch; +/** + * Converts a function that may throw to one returning a `Either`. + * + * @category interop + * @since 2.10.0 + */ +var tryCatchK = function (f, onThrow) { return function () { + var a = []; + for (var _i = 0; _i < arguments.length; _i++) { + a[_i] = arguments[_i]; + } + return exports.tryCatch(function () { return f.apply(void 0, a); }, onThrow); +}; }; +exports.tryCatchK = tryCatchK; +/** + * @category interop + * @since 2.9.0 + */ +var fromNullableK = function (e) { + var from = exports.fromNullable(e); + return function (f) { return function_1.flow(f, from); }; +}; +exports.fromNullableK = fromNullableK; +/** + * @category interop + * @since 2.9.0 + */ +var chainNullableK = function (e) { + var from = exports.fromNullableK(e); + return function (f) { return exports.chain(from(f)); }; +}; +exports.chainNullableK = chainNullableK; +/** + * @category interop + * @since 2.10.0 + */ +exports.toUnion = +/*#__PURE__*/ +exports.foldW(function_1.identity, function_1.identity); +// ------------------------------------------------------------------------------------- +// utils +// ------------------------------------------------------------------------------------- +/** + * Default value for the `onError` argument of `tryCatch` + * + * @since 2.0.0 + */ +function toError(e) { + return e instanceof Error ? e : new Error(String(e)); +} +exports.toError = toError; +/** + * @since 2.0.0 + */ +var elem = function (E) { return function (a, ma) { + return exports.isLeft(ma) ? false : E.equals(a, ma.right); +}; }; +exports.elem = elem; +/** + * Returns `false` if `Left` or returns the result of the application of the given predicate to the `Right` value. + * + * @example + * import { exists, left, right } from 'fp-ts/Either' + * + * const gt2 = exists((n: number) => n > 2) + * + * assert.strictEqual(gt2(left('a')), false) + * assert.strictEqual(gt2(right(1)), false) + * assert.strictEqual(gt2(right(3)), true) + * * @since 2.0.0 */ -function fromNullable(e) { - return function (a) { return (a == null ? exports.left(e) : exports.right(a)); }; -} -exports.fromNullable = fromNullable; -// TODO: `onError => Lazy => Either` in v3 +var exists = function (predicate) { return function (ma) { + return exports.isLeft(ma) ? false : predicate(ma.right); +}; }; +exports.exists = exists; +// ------------------------------------------------------------------------------------- +// do notation +// ------------------------------------------------------------------------------------- +/** + * @since 2.9.0 + */ +exports.Do = +/*#__PURE__*/ +exports.of(_.emptyRecord); +/** + * @since 2.8.0 + */ +exports.bindTo = +/*#__PURE__*/ +Functor_1.bindTo(exports.Functor); +/** + * @since 2.8.0 + */ +exports.bind = +/*#__PURE__*/ +Chain_1.bind(exports.Chain); +/** + * @since 2.8.0 + */ +exports.bindW = exports.bind; +// ------------------------------------------------------------------------------------- +// pipeable sequence S +// ------------------------------------------------------------------------------------- +/** + * @since 2.8.0 + */ +exports.apS = +/*#__PURE__*/ +Apply_1.apS(exports.Apply); +/** + * @since 2.8.0 + */ +exports.apSW = exports.apS; +// ------------------------------------------------------------------------------------- +// sequence T +// ------------------------------------------------------------------------------------- /** - * Constructs a new `Either` from a function that might throw. - * - * @example - * import { Either, left, right, tryCatch } from 'fp-ts/Either' - * - * const unsafeHead = (as: Array): A => { - * if (as.length > 0) { - * return as[0] - * } else { - * throw new Error('empty array') - * } - * } - * - * const head = (as: Array): Either => { - * return tryCatch(() => unsafeHead(as), e => (e instanceof Error ? e : new Error('unknown error'))) - * } - * - * assert.deepStrictEqual(head([]), left(new Error('empty array'))) - * assert.deepStrictEqual(head([1, 2, 3]), right(1)) + * @since 2.11.0 + */ +exports.ApT = +/*#__PURE__*/ +exports.of(_.emptyReadonlyArray); +// ------------------------------------------------------------------------------------- +// array utils +// ------------------------------------------------------------------------------------- +/** + * Equivalent to `ReadonlyNonEmptyArray#traverseWithIndex(Applicative)`. * - * @category constructors - * @since 2.0.0 + * @since 2.11.0 */ -function tryCatch(f, onError) { - try { - return exports.right(f()); +var traverseReadonlyNonEmptyArrayWithIndex = function (f) { return function (as) { + var e = f(0, _.head(as)); + if (exports.isLeft(e)) { + return e; } - catch (e) { - return exports.left(onError(e)); + var out = [e.right]; + for (var i = 1; i < as.length; i++) { + var e_1 = f(i, as[i]); + if (exports.isLeft(e_1)) { + return e_1; + } + out.push(e_1.right); } -} -exports.tryCatch = tryCatch; -// TODO curry in v3 + return exports.right(out); +}; }; +exports.traverseReadonlyNonEmptyArrayWithIndex = traverseReadonlyNonEmptyArrayWithIndex; /** - * Converts a JavaScript Object Notation (JSON) string into an object. + * Equivalent to `ReadonlyArray#traverseWithIndex(Applicative)`. * - * @example - * import { parseJSON, toError, right, left } from 'fp-ts/Either' - * - * assert.deepStrictEqual(parseJSON('{"a":1}', toError), right({ a: 1 })) - * assert.deepStrictEqual(parseJSON('{"a":}', toError), left(new SyntaxError('Unexpected token } in JSON at position 5'))) + * @since 2.11.0 + */ +var traverseReadonlyArrayWithIndex = function (f) { + var g = exports.traverseReadonlyNonEmptyArrayWithIndex(f); + return function (as) { return (_.isNonEmpty(as) ? g(as) : exports.ApT); }; +}; +exports.traverseReadonlyArrayWithIndex = traverseReadonlyArrayWithIndex; +/** + * @since 2.9.0 + */ +exports.traverseArrayWithIndex = exports.traverseReadonlyArrayWithIndex; +/** + * @since 2.9.0 + */ +var traverseArray = function (f) { return exports.traverseReadonlyArrayWithIndex(function (_, a) { return f(a); }); }; +exports.traverseArray = traverseArray; +/** + * @since 2.9.0 + */ +exports.sequenceArray = +/*#__PURE__*/ +exports.traverseArray(function_1.identity); +/** + * Use [`parse`](./Json.ts.html#parse) instead. * * @category constructors * @since 2.0.0 + * @deprecated */ function parseJSON(s, onError) { - return tryCatch(function () { return JSON.parse(s); }, onError); + return exports.tryCatch(function () { return JSON.parse(s); }, onError); } exports.parseJSON = parseJSON; -// TODO curry in v3 /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * - * @example - * import * as E from 'fp-ts/Either' - * import { pipe } from 'fp-ts/function' - * - * assert.deepStrictEqual(E.stringifyJSON({ a: 1 }, E.toError), E.right('{"a":1}')) - * const circular: any = { ref: null } - * circular.ref = circular - * assert.deepStrictEqual( - * pipe( - * E.stringifyJSON(circular, E.toError), - * E.mapLeft(e => e.message.includes('Converting circular structure to JSON')) - * ), - * E.left(true) - * ) + * Use [`stringify`](./Json.ts.html#stringify) instead. * * @category constructors * @since 2.0.0 + * @deprecated */ -function stringifyJSON(u, onError) { - return tryCatch(function () { return JSON.stringify(u); }, onError); -} +var stringifyJSON = function (u, onError) { + return exports.tryCatch(function () { + var s = JSON.stringify(u); + if (typeof s !== 'string') { + throw new Error('Converting unsupported structure to JSON'); + } + return s; + }, onError); +}; exports.stringifyJSON = stringifyJSON; /** - * Derivable from `MonadThrow`. + * Use small, specific instances instead. * - * @example - * import { fromOption, left, right } from 'fp-ts/Either' - * import { pipe } from 'fp-ts/function' - * import { none, some } from 'fp-ts/Option' - * - * assert.deepStrictEqual( - * pipe( - * some(1), - * fromOption(() => 'error') - * ), - * right(1) - * ) - * assert.deepStrictEqual( - * pipe( - * none, - * fromOption(() => 'error') - * ), - * left('error') - * ) - * - * @category constructors + * @category instances * @since 2.0.0 + * @deprecated */ -var fromOption = function (onNone) { return function (ma) { - return ma._tag === 'None' ? exports.left(onNone()) : exports.right(ma.value); -}; }; -exports.fromOption = fromOption; +exports.either = { + URI: exports.URI, + map: _map, + of: exports.of, + ap: _ap, + chain: _chain, + reduce: _reduce, + foldMap: _foldMap, + reduceRight: _reduceRight, + traverse: _traverse, + sequence: exports.sequence, + bimap: _bimap, + mapLeft: _mapLeft, + alt: _alt, + extend: _extend, + chainRec: _chainRec, + throwError: exports.throwError +}; /** - * Derivable from `MonadThrow`. - * - * @example - * import { fromPredicate, left, right } from 'fp-ts/Either' - * import { pipe } from 'fp-ts/function' + * Use [`getApplySemigroup`](./Apply.ts.html#getapplysemigroup) instead. * - * assert.deepStrictEqual( - * pipe( - * 1, - * fromPredicate( - * (n) => n > 0, - * () => 'error' - * ) - * ), - * right(1) - * ) - * assert.deepStrictEqual( - * pipe( - * -1, - * fromPredicate( - * (n) => n > 0, - * () => 'error' - * ) - * ), - * left('error') - * ) + * Semigroup returning the left-most `Left` value. If both operands are `Right`s then the inner values + * are concatenated using the provided `Semigroup` * - * @category constructors + * @category instances * @since 2.0.0 + * @deprecated */ -var fromPredicate = function (predicate, onFalse) { return function (a) { return (predicate(a) ? exports.right(a) : exports.left(onFalse(a))); }; }; -exports.fromPredicate = fromPredicate; -// ------------------------------------------------------------------------------------- -// destructors -// ------------------------------------------------------------------------------------- +exports.getApplySemigroup = +/*#__PURE__*/ +Apply_1.getApplySemigroup(exports.Apply); /** - * Takes two functions and an `Either` value, if the value is a `Left` the inner value is applied to the first function, - * if the value is a `Right` the inner value is applied to the second function. - * - * @example - * import { fold, left, right } from 'fp-ts/Either' - * import { pipe } from 'fp-ts/function' - * - * function onLeft(errors: Array): string { - * return `Errors: ${errors.join(', ')}` - * } - * - * function onRight(value: number): string { - * return `Ok: ${value}` - * } - * - * assert.strictEqual( - * pipe( - * right(1), - * fold(onLeft, onRight) - * ), - * 'Ok: 1' - * ) - * assert.strictEqual( - * pipe( - * left(['error 1', 'error 2']), - * fold(onLeft, onRight) - * ), - * 'Errors: error 1, error 2' - * ) + * Use [`getApplicativeMonoid`](./Applicative.ts.html#getapplicativemonoid) instead. * - * @category destructors + * @category instances * @since 2.0.0 + * @deprecated */ -function fold(onLeft, onRight) { - return function (ma) { return (exports.isLeft(ma) ? onLeft(ma.left) : onRight(ma.right)); }; -} -exports.fold = fold; +exports.getApplyMonoid = +/*#__PURE__*/ +Applicative_1.getApplicativeMonoid(exports.Applicative); /** - * Less strict version of [`getOrElse`](#getOrElse). + * Use [`getApplySemigroup`](./Apply.ts.html#getapplysemigroup) instead. * - * @category destructors - * @since 2.6.0 + * @category instances + * @since 2.0.0 + * @deprecated */ -var getOrElseW = function (onLeft) { return function (ma) { - return exports.isLeft(ma) ? onLeft(ma.left) : ma.right; -}; }; -exports.getOrElseW = getOrElseW; +var getValidationSemigroup = function (SE, SA) { + return Apply_1.getApplySemigroup(exports.getApplicativeValidation(SE))(SA); +}; +exports.getValidationSemigroup = getValidationSemigroup; /** - * Returns the wrapped value if it's a `Right` or a default value if is a `Left`. - * - * @example - * import { getOrElse, left, right } from 'fp-ts/Either' - * import { pipe } from 'fp-ts/function' - * - * assert.deepStrictEqual( - * pipe( - * right(1), - * getOrElse(() => 0) - * ), - * 1 - * ) - * assert.deepStrictEqual( - * pipe( - * left('error'), - * getOrElse(() => 0) - * ), - * 0 - * ) + * Use [`getApplicativeMonoid`](./Applicative.ts.html#getapplicativemonoid) instead. * - * @category destructors + * @category instances * @since 2.0.0 + * @deprecated */ -exports.getOrElse = exports.getOrElseW; -// ------------------------------------------------------------------------------------- -// combinators -// ------------------------------------------------------------------------------------- -/** - * @category combinators - * @since 2.9.0 - */ -function fromNullableK(e) { - var from = fromNullable(e); - return function (f) { return function () { - var a = []; - for (var _i = 0; _i < arguments.length; _i++) { - a[_i] = arguments[_i]; - } - return from(f.apply(void 0, a)); - }; }; -} -exports.fromNullableK = fromNullableK; -/** - * @category combinators - * @since 2.9.0 - */ -function chainNullableK(e) { - var from = fromNullableK(e); - return function (f) { return exports.chain(from(f)); }; -} -exports.chainNullableK = chainNullableK; +var getValidationMonoid = function (SE, MA) { + return Applicative_1.getApplicativeMonoid(exports.getApplicativeValidation(SE))(MA); +}; +exports.getValidationMonoid = getValidationMonoid; /** - * Returns a `Right` if is a `Left` (and vice versa). + * Use [`getApplicativeValidation`](#getapplicativevalidation) and [`getAltValidation`](#getaltvalidation) instead. * - * @category combinators + * @category instances * @since 2.0.0 + * @deprecated */ -function swap(ma) { - return exports.isLeft(ma) ? exports.right(ma.left) : exports.left(ma.right); +function getValidation(SE) { + var ap = exports.getApplicativeValidation(SE).ap; + var alt = exports.getAltValidation(SE).alt; + return { + URI: exports.URI, + _E: undefined, + map: _map, + of: exports.of, + chain: _chain, + bimap: _bimap, + mapLeft: _mapLeft, + reduce: _reduce, + foldMap: _foldMap, + reduceRight: _reduceRight, + extend: _extend, + traverse: _traverse, + sequence: exports.sequence, + chainRec: _chainRec, + throwError: exports.throwError, + ap: ap, + alt: alt + }; } -exports.swap = swap; +exports.getValidation = getValidation; + + +/***/ }), + +/***/ 6964: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.eqDate = exports.eqNumber = exports.eqString = exports.eqBoolean = exports.eq = exports.strictEqual = exports.getStructEq = exports.getTupleEq = exports.Contravariant = exports.getMonoid = exports.getSemigroup = exports.eqStrict = exports.URI = exports.contramap = exports.tuple = exports.struct = exports.fromEquals = void 0; +var function_1 = __nccwpck_require__(6985); +// ------------------------------------------------------------------------------------- +// constructors +// ------------------------------------------------------------------------------------- /** - * Useful for recovering from errors. - * - * @category combinators + * @category constructors * @since 2.0.0 */ -function orElse(onLeft) { - return function (ma) { return (exports.isLeft(ma) ? onLeft(ma.left) : ma); }; -} -exports.orElse = orElse; +var fromEquals = function (equals) { return ({ + equals: function (x, y) { return x === y || equals(x, y); } +}); }; +exports.fromEquals = fromEquals; +// ------------------------------------------------------------------------------------- +// combinators +// ------------------------------------------------------------------------------------- /** - * Less strict version of [`filterOrElse`](#filterOrElse). - * - * @since 2.9.0 + * @category combinators + * @since 2.10.0 */ -var filterOrElseW = function (predicate, onFalse) { - return exports.chainW(function (a) { return (predicate(a) ? exports.right(a) : exports.left(onFalse(a))); }); +var struct = function (eqs) { + return exports.fromEquals(function (first, second) { + for (var key in eqs) { + if (!eqs[key].equals(first[key], second[key])) { + return false; + } + } + return true; + }); }; -exports.filterOrElseW = filterOrElseW; +exports.struct = struct; /** - * Derivable from `MonadThrow`. + * Given a tuple of `Eq`s returns a `Eq` for the tuple * * @example - * import { filterOrElse, left, right } from 'fp-ts/Either' - * import { pipe } from 'fp-ts/function' + * import { tuple } from 'fp-ts/Eq' + * import * as S from 'fp-ts/string' + * import * as N from 'fp-ts/number' + * import * as B from 'fp-ts/boolean' * - * assert.deepStrictEqual( - * pipe( - * right(1), - * filterOrElse( - * (n) => n > 0, - * () => 'error' - * ) - * ), - * right(1) - * ) - * assert.deepStrictEqual( - * pipe( - * right(-1), - * filterOrElse( - * (n) => n > 0, - * () => 'error' - * ) - * ), - * left('error') - * ) - * assert.deepStrictEqual( - * pipe( - * left('a'), - * filterOrElse( - * (n) => n > 0, - * () => 'error' - * ) - * ), - * left('a') - * ) + * const E = tuple(S.Eq, N.Eq, B.Eq) + * assert.strictEqual(E.equals(['a', 1, true], ['a', 1, true]), true) + * assert.strictEqual(E.equals(['a', 1, true], ['b', 1, true]), false) + * assert.strictEqual(E.equals(['a', 1, true], ['a', 2, true]), false) + * assert.strictEqual(E.equals(['a', 1, true], ['a', 1, false]), false) * * @category combinators - * @since 2.0.0 + * @since 2.10.0 */ -exports.filterOrElse = exports.filterOrElseW; +var tuple = function () { + var eqs = []; + for (var _i = 0; _i < arguments.length; _i++) { + eqs[_i] = arguments[_i]; + } + return exports.fromEquals(function (first, second) { return eqs.every(function (E, i) { return E.equals(first[i], second[i]); }); }); +}; +exports.tuple = tuple; // ------------------------------------------------------------------------------------- // non-pipeables // ------------------------------------------------------------------------------------- -var map_ = function (fa, f) { return function_1.pipe(fa, exports.map(f)); }; -var ap_ = function (fab, fa) { return function_1.pipe(fab, exports.ap(fa)); }; -/* istanbul ignore next */ -var chain_ = function (ma, f) { return function_1.pipe(ma, exports.chain(f)); }; -/* istanbul ignore next */ -var reduce_ = function (fa, b, f) { return function_1.pipe(fa, exports.reduce(b, f)); }; /* istanbul ignore next */ -var foldMap_ = function (M) { return function (fa, f) { - var foldMapM = exports.foldMap(M); - return function_1.pipe(fa, foldMapM(f)); +var contramap_ = function (fa, f) { return function_1.pipe(fa, exports.contramap(f)); }; +// ------------------------------------------------------------------------------------- +// type class members +// ------------------------------------------------------------------------------------- +/** + * @category Contravariant + * @since 2.0.0 + */ +var contramap = function (f) { return function (fa) { + return exports.fromEquals(function (x, y) { return fa.equals(f(x), f(y)); }); }; }; -/* istanbul ignore next */ -var reduceRight_ = function (fa, b, f) { return function_1.pipe(fa, exports.reduceRight(b, f)); }; -var traverse_ = function (F) { - var traverseF = exports.traverse(F); - return function (ta, f) { return function_1.pipe(ta, traverseF(f)); }; +exports.contramap = contramap; +// ------------------------------------------------------------------------------------- +// instances +// ------------------------------------------------------------------------------------- +/** + * @category instances + * @since 2.0.0 + */ +exports.URI = 'Eq'; +/** + * @category instances + * @since 2.5.0 + */ +exports.eqStrict = { + equals: function (a, b) { return a === b; } }; -var bimap_ = function (fa, f, g) { return function_1.pipe(fa, exports.bimap(f, g)); }; -var mapLeft_ = function (fa, f) { return function_1.pipe(fa, exports.mapLeft(f)); }; -/* istanbul ignore next */ -var alt_ = function (fa, that) { return function_1.pipe(fa, exports.alt(that)); }; -/* istanbul ignore next */ -var extend_ = function (wa, f) { return function_1.pipe(wa, exports.extend(f)); }; -var chainRec_ = function (a, f) { - return ChainRec_1.tailRec(f(a), function (e) { - return exports.isLeft(e) ? exports.right(exports.left(e.left)) : exports.isLeft(e.right) ? exports.left(f(e.right.left)) : exports.right(exports.right(e.right.right)); - }); +var empty = { + equals: function () { return true; } +}; +/** + * @category instances + * @since 2.10.0 + */ +var getSemigroup = function () { return ({ + concat: function (x, y) { return exports.fromEquals(function (a, b) { return x.equals(a, b) && y.equals(a, b); }); } +}); }; +exports.getSemigroup = getSemigroup; +/** + * @category instances + * @since 2.6.0 + */ +var getMonoid = function () { return ({ + concat: exports.getSemigroup().concat, + empty: empty +}); }; +exports.getMonoid = getMonoid; +/** + * @category instances + * @since 2.7.0 + */ +exports.Contravariant = { + URI: exports.URI, + contramap: contramap_ }; // ------------------------------------------------------------------------------------- -// pipeables +// deprecated // ------------------------------------------------------------------------------------- /** - * `map` can be used to turn functions `(a: A) => B` into functions `(fa: F) => F` whose argument and return types - * use the type constructor `F` to represent some computational context. + * Use [`tuple`](#tuple) instead. * - * @category Functor + * @category combinators * @since 2.0.0 + * @deprecated */ -var map = function (f) { return function (fa) { - return exports.isLeft(fa) ? fa : exports.right(f(fa.right)); -}; }; -exports.map = map; +exports.getTupleEq = exports.tuple; /** - * Map a pair of functions over the two type arguments of the bifunctor. + * Use [`struct`](#struct) instead. * - * @category Bifunctor + * @category combinators * @since 2.0.0 + * @deprecated */ -var bimap = function (f, g) { return function (fa) { return (exports.isLeft(fa) ? exports.left(f(fa.left)) : exports.right(g(fa.right))); }; }; -exports.bimap = bimap; +exports.getStructEq = exports.struct; /** - * Map a function over the first type argument of a bifunctor. + * Use [`eqStrict`](#eqstrict) instead * - * @category Bifunctor * @since 2.0.0 + * @deprecated */ -var mapLeft = function (f) { return function (fa) { - return exports.isLeft(fa) ? exports.left(f(fa.left)) : fa; -}; }; -exports.mapLeft = mapLeft; +exports.strictEqual = exports.eqStrict.equals; /** - * Less strict version of [`ap`](#ap). + * Use small, specific instances instead. * - * @category Apply - * @since 2.8.0 + * @category instances + * @since 2.0.0 + * @deprecated */ -var apW = function (fa) { return function (fab) { - return exports.isLeft(fab) ? fab : exports.isLeft(fa) ? fa : exports.right(fab.right(fa.right)); -}; }; -exports.apW = apW; +exports.eq = exports.Contravariant; /** - * Apply a function to an argument under a type constructor. + * Use [`Eq`](./boolean.ts.html#eq) instead. * - * @category Apply + * @category instances * @since 2.0.0 + * @deprecated */ -exports.ap = exports.apW; +exports.eqBoolean = exports.eqStrict; /** - * Combine two effectful actions, keeping only the result of the first. + * Use [`Eq`](./string.ts.html#eq) instead. * - * Derivable from `Apply`. - * - * @category combinators + * @category instances * @since 2.0.0 + * @deprecated */ -var apFirst = function (fb) { - return function_1.flow(exports.map(function (a) { return function () { return a; }; }), exports.ap(fb)); -}; -exports.apFirst = apFirst; +exports.eqString = exports.eqStrict; /** - * Combine two effectful actions, keeping only the result of the second. + * Use [`Eq`](./number.ts.html#eq) instead. * - * Derivable from `Apply`. + * @category instances + * @since 2.0.0 + * @deprecated + */ +exports.eqNumber = exports.eqStrict; +/** + * Use [`Eq`](./Date.ts.html#eq) instead. * - * @category combinators + * @category instances * @since 2.0.0 + * @deprecated */ -var apSecond = function (fb) { - return function_1.flow(exports.map(function () { return function (b) { return b; }; }), exports.ap(fb)); +exports.eqDate = { + equals: function (first, second) { return first.valueOf() === second.valueOf(); } }; -exports.apSecond = apSecond; + + +/***/ }), + +/***/ 1964: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/** + * The `FromEither` type class represents those data types which support errors. + * + * @since 2.10.0 + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.filterOrElse = exports.chainEitherK = exports.fromEitherK = exports.chainOptionK = exports.fromOptionK = exports.fromPredicate = exports.fromOption = void 0; +var function_1 = __nccwpck_require__(6985); +var _ = __importStar(__nccwpck_require__(1840)); +function fromOption(F) { + return function (onNone) { return function (ma) { return F.fromEither(_.isNone(ma) ? _.left(onNone()) : _.right(ma.value)); }; }; +} +exports.fromOption = fromOption; +function fromPredicate(F) { + return function (predicate, onFalse) { return function (a) { + return F.fromEither(predicate(a) ? _.right(a) : _.left(onFalse(a))); + }; }; +} +exports.fromPredicate = fromPredicate; +function fromOptionK(F) { + var fromOptionF = fromOption(F); + return function (onNone) { + var from = fromOptionF(onNone); + return function (f) { return function_1.flow(f, from); }; + }; +} +exports.fromOptionK = fromOptionK; +function chainOptionK(F, M) { + var fromOptionKF = fromOptionK(F); + return function (onNone) { + var from = fromOptionKF(onNone); + return function (f) { return function (ma) { return M.chain(ma, from(f)); }; }; + }; +} +exports.chainOptionK = chainOptionK; +function fromEitherK(F) { + return function (f) { return function_1.flow(f, F.fromEither); }; +} +exports.fromEitherK = fromEitherK; +function chainEitherK(F, M) { + var fromEitherKF = fromEitherK(F); + return function (f) { return function (ma) { return M.chain(ma, fromEitherKF(f)); }; }; +} +exports.chainEitherK = chainEitherK; +function filterOrElse(F, M) { + return function (predicate, onFalse) { return function (ma) { + return M.chain(ma, function (a) { return F.fromEither(predicate(a) ? _.right(a) : _.left(onFalse(a))); }); + }; }; +} +exports.filterOrElse = filterOrElse; + + +/***/ }), + +/***/ 5533: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getFunctorComposition = exports.bindTo = exports.flap = exports.map = void 0; /** - * Wrap a value into the type constructor. + * A `Functor` is a type constructor which supports a mapping operation `map`. * - * Equivalent to [`right`](#right). + * `map` can be used to turn functions `a -> b` into functions `f a -> f b` whose argument and return types use the type + * constructor `f` to represent some computational context. * - * @example - * import * as E from 'fp-ts/Either' + * Instances must satisfy the following laws: * - * assert.deepStrictEqual(E.of('a'), E.right('a')) + * 1. Identity: `F.map(fa, a => a) <-> fa` + * 2. Composition: `F.map(fa, a => bc(ab(a))) <-> F.map(F.map(fa, ab), bc)` * - * @category Applicative - * @since 2.7.0 + * @since 2.0.0 */ -exports.of = exports.right; +var function_1 = __nccwpck_require__(6985); +function map(F, G) { + return function (f) { return function (fa) { return F.map(fa, function (ga) { return G.map(ga, f); }); }; }; +} +exports.map = map; +function flap(F) { + return function (a) { return function (fab) { return F.map(fab, function (f) { return f(a); }); }; }; +} +exports.flap = flap; +function bindTo(F) { + return function (name) { return function (fa) { return F.map(fa, function (a) { + var _a; + return (_a = {}, _a[name] = a, _a); + }); }; }; +} +exports.bindTo = bindTo; +/** @deprecated */ +function getFunctorComposition(F, G) { + var _map = map(F, G); + return { + map: function (fga, f) { return function_1.pipe(fga, _map(f)); } + }; +} +exports.getFunctorComposition = getFunctorComposition; + + +/***/ }), + +/***/ 179: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + /** - * Less strict version of [`chain`](#chain). + * A `Magma` is a pair `(A, concat)` in which `A` is a non-empty set and `concat` is a binary operation on `A` * - * @category Monad - * @since 2.6.0 + * See [Semigroup](https://gcanti.github.io/fp-ts/modules/Semigroup.ts.html) for some instances. + * + * @since 2.0.0 */ -var chainW = function (f) { return function (ma) { - return exports.isLeft(ma) ? ma : f(ma.right); -}; }; -exports.chainW = chainW; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.concatAll = exports.endo = exports.filterSecond = exports.filterFirst = exports.reverse = void 0; +// ------------------------------------------------------------------------------------- +// combinators +// ------------------------------------------------------------------------------------- /** - * Composes computations in sequence, using the return value of one computation to determine the next computation. + * The dual of a `Magma`, obtained by swapping the arguments of `concat`. * - * @category Monad - * @since 2.0.0 + * @example + * import { reverse, concatAll } from 'fp-ts/Magma' + * import * as N from 'fp-ts/number' + * + * const subAll = concatAll(reverse(N.MagmaSub))(0) + * + * assert.deepStrictEqual(subAll([1, 2, 3]), 2) + * + * @category combinators + * @since 2.11.0 + */ +var reverse = function (M) { return ({ + concat: function (first, second) { return M.concat(second, first); } +}); }; +exports.reverse = reverse; +/** + * @category combinators + * @since 2.11.0 */ -exports.chain = exports.chainW; +var filterFirst = function (predicate) { return function (M) { return ({ + concat: function (first, second) { return (predicate(first) ? M.concat(first, second) : second); } +}); }; }; +exports.filterFirst = filterFirst; /** - * Less strict version of [`chainFirst`](#chainFirst) - * - * Derivable from `Monad`. - * * @category combinators - * @since 2.8.0 + * @since 2.11.0 */ -var chainFirstW = function (f) { return function (ma) { - return function_1.pipe(ma, exports.chainW(function (a) { - return function_1.pipe(f(a), exports.map(function () { return a; })); - })); -}; }; -exports.chainFirstW = chainFirstW; +var filterSecond = function (predicate) { return function (M) { return ({ + concat: function (first, second) { return (predicate(second) ? M.concat(first, second) : first); } +}); }; }; +exports.filterSecond = filterSecond; /** - * Composes computations in sequence, using the return value of one computation to determine the next computation and - * keeping only the result of the first. - * - * Derivable from `Monad`. - * * @category combinators - * @since 2.0.0 + * @since 2.11.0 */ -exports.chainFirst = exports.chainFirstW; +var endo = function (f) { return function (M) { return ({ + concat: function (first, second) { return M.concat(f(first), f(second)); } +}); }; }; +exports.endo = endo; +// ------------------------------------------------------------------------------------- +// utils +// ------------------------------------------------------------------------------------- /** - * The `flatten` function is the conventional monad join operator. It is used to remove one level of monadic structure, projecting its bound argument into the outer level. + * Given a sequence of `as`, concat them and return the total. * - * Derivable from `Monad`. + * If `as` is empty, return the provided `startWith` value. * * @example - * import * as E from 'fp-ts/Either' + * import { concatAll } from 'fp-ts/Magma' + * import * as N from 'fp-ts/number' * - * assert.deepStrictEqual(E.flatten(E.right(E.right('a'))), E.right('a')) - * assert.deepStrictEqual(E.flatten(E.right(E.left('e'))), E.left('e')) - * assert.deepStrictEqual(E.flatten(E.left('e')), E.left('e')) + * const subAll = concatAll(N.MagmaSub)(0) * - * @category combinators - * @since 2.0.0 + * assert.deepStrictEqual(subAll([1, 2, 3]), -6) + * + * @since 2.11.0 */ -exports.flatten = -/*#__PURE__*/ -exports.chain(function_1.identity); +var concatAll = function (M) { return function (startWith) { return function (as) { + return as.reduce(function (a, acc) { return M.concat(a, acc); }, startWith); +}; }; }; +exports.concatAll = concatAll; + + +/***/ }), + +/***/ 240: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __spreadArray = (this && this.__spreadArray) || function (to, from) { + for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) + to[j] = from[i]; + return to; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.mapWithIndex = exports.map = exports.flatten = exports.duplicate = exports.extend = exports.chain = exports.ap = exports.alt = exports.altW = exports.chunksOf = exports.splitAt = exports.chop = exports.chainWithIndex = exports.foldMap = exports.foldMapWithIndex = exports.intersperse = exports.prependAll = exports.unzip = exports.zip = exports.zipWith = exports.of = exports.copy = exports.modifyAt = exports.updateAt = exports.insertAt = exports.sort = exports.groupBy = exports.group = exports.reverse = exports.concat = exports.concatW = exports.unappend = exports.unprepend = exports.range = exports.replicate = exports.makeBy = exports.fromArray = exports.fromReadonlyNonEmptyArray = exports.rotate = exports.union = exports.sortBy = exports.uniq = exports.unsafeUpdateAt = exports.unsafeInsertAt = exports.append = exports.appendW = exports.prepend = exports.prependW = exports.isOutOfBound = exports.isNonEmpty = void 0; +exports.filterWithIndex = exports.filter = exports.groupSort = exports.updateLast = exports.modifyLast = exports.updateHead = exports.modifyHead = exports.matchRight = exports.matchLeft = exports.concatAll = exports.max = exports.min = exports.init = exports.last = exports.tail = exports.head = exports.apS = exports.bind = exports.bindTo = exports.Do = exports.Comonad = exports.Alt = exports.TraversableWithIndex = exports.Traversable = exports.FoldableWithIndex = exports.Foldable = exports.Monad = exports.chainFirst = exports.Chain = exports.Applicative = exports.apSecond = exports.apFirst = exports.Apply = exports.FunctorWithIndex = exports.Pointed = exports.flap = exports.Functor = exports.getUnionSemigroup = exports.getEq = exports.getSemigroup = exports.getShow = exports.URI = exports.extract = exports.traverseWithIndex = exports.sequence = exports.traverse = exports.reduceRightWithIndex = exports.reduceRight = exports.reduceWithIndex = exports.reduce = void 0; +exports.nonEmptyArray = exports.fold = exports.prependToAll = exports.snoc = exports.cons = exports.unsnoc = exports.uncons = void 0; +var Apply_1 = __nccwpck_require__(205); +var Chain_1 = __nccwpck_require__(2372); +var function_1 = __nccwpck_require__(6985); +var Functor_1 = __nccwpck_require__(5533); +var _ = __importStar(__nccwpck_require__(1840)); +var Ord_1 = __nccwpck_require__(6685); +var RNEA = __importStar(__nccwpck_require__(8630)); +// ------------------------------------------------------------------------------------- +// internal +// ------------------------------------------------------------------------------------- /** - * Less strict version of [`alt`](#alt). - * - * @category Alt - * @since 2.9.0 + * @internal */ -var altW = function (that) { return function (fa) { return (exports.isLeft(fa) ? that() : fa); }; }; -exports.altW = altW; +var isNonEmpty = function (as) { return as.length > 0; }; +exports.isNonEmpty = isNonEmpty; /** - * Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to - * types of kind `* -> *`. - * - * @category Alt - * @since 2.0.0 + * @internal */ -exports.alt = exports.altW; +var isOutOfBound = function (i, as) { return i < 0 || i >= as.length; }; +exports.isOutOfBound = isOutOfBound; /** - * @category Extend - * @since 2.0.0 + * @internal */ -var extend = function (f) { return function (wa) { - return exports.isLeft(wa) ? wa : exports.right(f(wa)); -}; }; -exports.extend = extend; +var prependW = function (head) { return function (tail) { return __spreadArray([head], tail); }; }; +exports.prependW = prependW; /** - * Derivable from `Extend`. - * - * @category combinators - * @since 2.0.0 + * @internal */ -exports.duplicate = -/*#__PURE__*/ -exports.extend(function_1.identity); +exports.prepend = exports.prependW; /** - * Left-associative fold of a structure. - * - * @example - * import { pipe } from 'fp-ts/function' - * import * as E from 'fp-ts/Either' - * - * const startWith = 'prefix' - * const concat = (a: string, b: string) => `${a}:${b}` - * - * assert.deepStrictEqual( - * pipe(E.right('a'), E.reduce(startWith, concat)), - * 'prefix:a', - * ) - * - * assert.deepStrictEqual( - * pipe(E.left('e'), E.reduce(startWith, concat)), - * 'prefix', - * ) - * - * @category Foldable - * @since 2.0.0 + * @internal */ -var reduce = function (b, f) { return function (fa) { - return exports.isLeft(fa) ? b : f(b, fa.right); -}; }; -exports.reduce = reduce; +var appendW = function (end) { return function (init) { return __spreadArray(__spreadArray([], init), [end]); }; }; +exports.appendW = appendW; /** - * Map each element of the structure to a monoid, and combine the results. + * @internal + */ +exports.append = exports.appendW; +/** + * @internal + */ +var unsafeInsertAt = function (i, a, as) { + if (exports.isNonEmpty(as)) { + var xs = exports.fromReadonlyNonEmptyArray(as); + xs.splice(i, 0, a); + return xs; + } + return [a]; +}; +exports.unsafeInsertAt = unsafeInsertAt; +/** + * @internal + */ +var unsafeUpdateAt = function (i, a, as) { + var xs = exports.fromReadonlyNonEmptyArray(as); + xs[i] = a; + return xs; +}; +exports.unsafeUpdateAt = unsafeUpdateAt; +/** + * Remove duplicates from a `NonEmptyArray`, keeping the first occurrence of an element. * * @example - * import { pipe } from 'fp-ts/function'; - * import * as E from 'fp-ts/Either' - * import { monoidString } from 'fp-ts/Monoid' - * - * const yell = (a: string) => `${a}!` - * - * assert.deepStrictEqual( - * pipe(E.right('a'), E.foldMap(monoidString)(yell)), - * 'a!', - * ) + * import { uniq } from 'fp-ts/NonEmptyArray' + * import * as N from 'fp-ts/number' * - * assert.deepStrictEqual( - * pipe(E.left('e'), E.foldMap(monoidString)(yell)), - * monoidString.empty, - * ) + * assert.deepStrictEqual(uniq(N.Eq)([1, 2, 1]), [1, 2]) * - * @category Foldable - * @since 2.0.0 + * @category combinators + * @since 2.11.0 */ -var foldMap = function (M) { return function (f) { return function (fa) { - return exports.isLeft(fa) ? M.empty : f(fa.right); -}; }; }; -exports.foldMap = foldMap; +var uniq = function (E) { return function (as) { + if (as.length === 1) { + return exports.copy(as); + } + var out = [exports.head(as)]; + var rest = exports.tail(as); + var _loop_1 = function (a) { + if (out.every(function (o) { return !E.equals(o, a); })) { + out.push(a); + } + }; + for (var _i = 0, rest_1 = rest; _i < rest_1.length; _i++) { + var a = rest_1[_i]; + _loop_1(a); + } + return out; +}; }; +exports.uniq = uniq; /** - * Right-associative fold of a structure. + * Sort the elements of a `NonEmptyArray` in increasing order, where elements are compared using first `ords[0]`, then `ords[1]`, + * etc... * * @example + * import * as NEA from 'fp-ts/NonEmptyArray' + * import { contramap } from 'fp-ts/Ord' + * import * as S from 'fp-ts/string' + * import * as N from 'fp-ts/number' * import { pipe } from 'fp-ts/function' - * import * as E from 'fp-ts/Either' - * - * const startWith = 'postfix' - * const concat = (a: string, b: string) => `${a}:${b}` * - * assert.deepStrictEqual( - * pipe(E.right('a'), E.reduceRight(startWith, concat)), - * 'a:postfix', - * ) + * interface Person { + * name: string + * age: number + * } * - * assert.deepStrictEqual( - * pipe(E.left('e'), E.reduceRight(startWith, concat)), - * 'postfix', - * ) + * const byName = pipe(S.Ord, contramap((p: Person) => p.name)) * - * @category Foldable - * @since 2.0.0 - */ -var reduceRight = function (b, f) { return function (fa) { - return exports.isLeft(fa) ? b : f(fa.right, b); -}; }; -exports.reduceRight = reduceRight; -/** - * Map each element of a structure to an action, evaluate these actions from left to right, and collect the results. + * const byAge = pipe(N.Ord, contramap((p: Person) => p.age)) * - * @example - * import { pipe } from 'fp-ts/function' - * import * as A from 'fp-ts/Array' - * import * as E from 'fp-ts/Either' - * import * as O from 'fp-ts/Option' + * const sortByNameByAge = NEA.sortBy([byName, byAge]) * - * assert.deepStrictEqual( - * pipe(E.right(['a']), E.traverse(O.option)(A.head)), - * O.some(E.right('a')), - * ) + * const persons: NEA.NonEmptyArray = [ + * { name: 'a', age: 1 }, + * { name: 'b', age: 3 }, + * { name: 'c', age: 2 }, + * { name: 'b', age: 2 } + * ] * - * assert.deepStrictEqual( - * pipe(E.right([]), E.traverse(O.option)(A.head)), - * O.none, - * ) + * assert.deepStrictEqual(sortByNameByAge(persons), [ + * { name: 'a', age: 1 }, + * { name: 'b', age: 2 }, + * { name: 'b', age: 3 }, + * { name: 'c', age: 2 } + * ]) * - * @category Traversable - * @since 2.6.3 + * @category combinators + * @since 2.11.0 */ -var traverse = function (F) { return function (f) { return function (ta) { return (exports.isLeft(ta) ? F.of(exports.left(ta.left)) : F.map(f(ta.right), exports.right)); }; }; }; -exports.traverse = traverse; +var sortBy = function (ords) { + if (exports.isNonEmpty(ords)) { + var M = Ord_1.getMonoid(); + return exports.sort(ords.reduce(M.concat, M.empty)); + } + return exports.copy; +}; +exports.sortBy = sortBy; /** - * Evaluate each monadic action in the structure from left to right, and collect the results. + * @category combinators + * @since 2.11.0 + */ +var union = function (E) { + var uniqE = exports.uniq(E); + return function (second) { return function (first) { return uniqE(function_1.pipe(first, concat(second))); }; }; +}; +exports.union = union; +/** + * Rotate a `NonEmptyArray` by `n` steps. * * @example - * import { pipe } from 'fp-ts/function' - * import * as E from 'fp-ts/Either' - * import * as O from 'fp-ts/Option' - * - * assert.deepStrictEqual( - * pipe(E.right(O.some('a')), E.sequence(O.option)), - * O.some(E.right('a')), - * ) + * import { rotate } from 'fp-ts/NonEmptyArray' * - * assert.deepStrictEqual( - * pipe(E.right(O.none), E.sequence(O.option)), - * O.none - * ) + * assert.deepStrictEqual(rotate(2)([1, 2, 3, 4, 5]), [4, 5, 1, 2, 3]) + * assert.deepStrictEqual(rotate(-2)([1, 2, 3, 4, 5]), [3, 4, 5, 1, 2]) * - * @category Traversable - * @since 2.6.3 + * @category combinators + * @since 2.11.0 */ -var sequence = function (F) { return function (ma) { - return exports.isLeft(ma) ? F.of(exports.left(ma.left)) : F.map(ma.right, exports.right); +var rotate = function (n) { return function (as) { + var len = as.length; + var m = Math.round(n) % len; + if (exports.isOutOfBound(Math.abs(m), as) || m === 0) { + return exports.copy(as); + } + if (m < 0) { + var _a = exports.splitAt(-m)(as), f = _a[0], s = _a[1]; + return function_1.pipe(s, concat(f)); + } + else { + return exports.rotate(m - len)(as); + } }; }; -exports.sequence = sequence; -/** - * @category MonadThrow - * @since 2.6.3 - */ -exports.throwError = exports.left; +exports.rotate = rotate; // ------------------------------------------------------------------------------------- -// instances +// constructors // ------------------------------------------------------------------------------------- /** - * @category instances - * @since 2.0.0 - */ -exports.URI = 'Either'; -/** - * @category instances - * @since 2.0.0 - */ -function getShow(SE, SA) { - return { - show: function (ma) { return (exports.isLeft(ma) ? "left(" + SE.show(ma.left) + ")" : "right(" + SA.show(ma.right) + ")"); } - }; -} -exports.getShow = getShow; -/** - * @category instances + * @category constructors + * @since 2.10.0 + */ +exports.fromReadonlyNonEmptyArray = _.fromReadonlyNonEmptyArray; +/** + * Builds a `NonEmptyArray` from an `Array` returning `none` if `as` is an empty array + * + * @category constructors * @since 2.0.0 */ -function getEq(EL, EA) { - return { - equals: function (x, y) { - return x === y || (exports.isLeft(x) ? exports.isLeft(y) && EL.equals(x.left, y.left) : exports.isRight(y) && EA.equals(x.right, y.right)); - } - }; -} -exports.getEq = getEq; +var fromArray = function (as) { return (exports.isNonEmpty(as) ? _.some(as) : _.none); }; +exports.fromArray = fromArray; /** - * Semigroup returning the left-most non-`Left` value. If both operands are `Right`s then the inner values are - * concatenated using the provided `Semigroup` + * Return a `NonEmptyArray` of length `n` with element `i` initialized with `f(i)`. + * + * **Note**. `n` is normalized to a natural number. * * @example - * import { getSemigroup, left, right } from 'fp-ts/Either' - * import { semigroupSum } from 'fp-ts/Semigroup' + * import { makeBy } from 'fp-ts/NonEmptyArray' + * import { pipe } from 'fp-ts/function' * - * const S = getSemigroup(semigroupSum) - * assert.deepStrictEqual(S.concat(left('a'), left('b')), left('a')) - * assert.deepStrictEqual(S.concat(left('a'), right(2)), right(2)) - * assert.deepStrictEqual(S.concat(right(1), left('b')), right(1)) - * assert.deepStrictEqual(S.concat(right(1), right(2)), right(3)) + * const double = (n: number): number => n * 2 + * assert.deepStrictEqual(pipe(5, makeBy(double)), [0, 2, 4, 6, 8]) * - * @category instances - * @since 2.0.0 + * @category constructors + * @since 2.11.0 */ -function getSemigroup(S) { - return { - concat: function (x, y) { return (exports.isLeft(y) ? x : exports.isLeft(x) ? y : exports.right(S.concat(x.right, y.right))); } - }; -} -exports.getSemigroup = getSemigroup; +var makeBy = function (f) { return function (n) { + var j = Math.max(0, Math.floor(n)); + var out = [f(0)]; + for (var i = 1; i < j; i++) { + out.push(f(i)); + } + return out; +}; }; +exports.makeBy = makeBy; /** - * Semigroup returning the left-most `Left` value. If both operands are `Right`s then the inner values - * are concatenated using the provided `Semigroup` + * Create a `NonEmptyArray` containing a value repeated the specified number of times. + * + * **Note**. `n` is normalized to a natural number. * * @example - * import { getApplySemigroup, left, right } from 'fp-ts/Either' - * import { semigroupSum } from 'fp-ts/Semigroup' + * import { replicate } from 'fp-ts/NonEmptyArray' + * import { pipe } from 'fp-ts/function' * - * const S = getApplySemigroup(semigroupSum) - * assert.deepStrictEqual(S.concat(left('a'), left('b')), left('a')) - * assert.deepStrictEqual(S.concat(left('a'), right(2)), left('a')) - * assert.deepStrictEqual(S.concat(right(1), left('b')), left('b')) - * assert.deepStrictEqual(S.concat(right(1), right(2)), right(3)) + * assert.deepStrictEqual(pipe(3, replicate('a')), ['a', 'a', 'a']) * - * @category instances - * @since 2.0.0 + * @category constructors + * @since 2.11.0 */ -function getApplySemigroup(S) { - return { - concat: function (x, y) { return (exports.isLeft(x) ? x : exports.isLeft(y) ? y : exports.right(S.concat(x.right, y.right))); } - }; -} -exports.getApplySemigroup = getApplySemigroup; +var replicate = function (a) { return exports.makeBy(function () { return a; }); }; +exports.replicate = replicate; /** - * @category instances - * @since 2.0.0 + * Create a `NonEmptyArray` containing a range of integers, including both endpoints. + * + * @example + * import { range } from 'fp-ts/NonEmptyArray' + * + * assert.deepStrictEqual(range(1, 5), [1, 2, 3, 4, 5]) + * + * @category constructors + * @since 2.11.0 */ -function getApplyMonoid(M) { - return { - concat: getApplySemigroup(M).concat, - empty: exports.right(M.empty) - }; -} -exports.getApplyMonoid = getApplyMonoid; +var range = function (start, end) { + return start <= end ? exports.makeBy(function (i) { return start + i; })(end - start + 1) : [start]; +}; +exports.range = range; +// ------------------------------------------------------------------------------------- +// destructors +// ------------------------------------------------------------------------------------- /** - * Builds a `Filterable` instance for `Either` given `Monoid` for the left side + * Return the tuple of the `head` and the `tail`. * - * @category instances - * @since 3.0.0 + * @example + * import { unprepend } from 'fp-ts/NonEmptyArray' + * + * assert.deepStrictEqual(unprepend([1, 2, 3]), [1, [2, 3]]) + * + * @category destructors + * @since 2.9.0 */ -function getFilterable(M) { - var empty = exports.left(M.empty); - var compact = function (ma) { - return exports.isLeft(ma) ? ma : ma.right._tag === 'None' ? empty : exports.right(ma.right.value); - }; - var separate = function (ma) { - return exports.isLeft(ma) - ? { left: ma, right: ma } - : exports.isLeft(ma.right) - ? { left: exports.right(ma.right.left), right: empty } - : { left: empty, right: exports.right(ma.right.right) }; - }; - var partitionMap = function (ma, f) { - if (exports.isLeft(ma)) { - return { left: ma, right: ma }; - } - var e = f(ma.right); - return exports.isLeft(e) ? { left: exports.right(e.left), right: empty } : { left: empty, right: exports.right(e.right) }; - }; - var partition = function (ma, p) { - return exports.isLeft(ma) - ? { left: ma, right: ma } - : p(ma.right) - ? { left: empty, right: exports.right(ma.right) } - : { left: exports.right(ma.right), right: empty }; - }; - var filterMap = function (ma, f) { - if (exports.isLeft(ma)) { - return ma; - } - var ob = f(ma.right); - return ob._tag === 'None' ? empty : exports.right(ob.value); - }; - var filter = function (ma, predicate) { - return exports.isLeft(ma) ? ma : predicate(ma.right) ? ma : empty; - }; - return { - URI: exports.URI, - _E: undefined, - map: map_, - compact: compact, - separate: separate, - filter: filter, - filterMap: filterMap, - partition: partition, - partitionMap: partitionMap - }; -} -exports.getFilterable = getFilterable; +var unprepend = function (as) { return [exports.head(as), exports.tail(as)]; }; +exports.unprepend = unprepend; /** - * Builds `Witherable` instance for `Either` given `Monoid` for the left side + * Return the tuple of the `init` and the `last`. * - * @category instances - * @since 2.0.0 + * @example + * import { unappend } from 'fp-ts/NonEmptyArray' + * + * assert.deepStrictEqual(unappend([1, 2, 3, 4]), [[1, 2, 3], 4]) + * + * @category destructors + * @since 2.9.0 */ -function getWitherable(M) { - var F_ = getFilterable(M); - var wither = function (F) { - var traverseF = traverse_(F); - return function (ma, f) { return F.map(traverseF(ma, f), F_.compact); }; - }; - var wilt = function (F) { - var traverseF = traverse_(F); - return function (ma, f) { return F.map(traverseF(ma, f), F_.separate); }; - }; - return { - URI: exports.URI, - _E: undefined, - map: map_, - compact: F_.compact, - separate: F_.separate, - filter: F_.filter, - filterMap: F_.filterMap, - partition: F_.partition, - partitionMap: F_.partitionMap, - traverse: traverse_, - sequence: exports.sequence, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - wither: wither, - wilt: wilt - }; +var unappend = function (as) { return [exports.init(as), exports.last(as)]; }; +exports.unappend = unappend; +function concatW(second) { + return function (first) { return first.concat(second); }; } -exports.getWitherable = getWitherable; -/** - * @category instances - * @since 2.7.0 - */ -function getApplicativeValidation(SE) { - return { - URI: exports.URI, - _E: undefined, - map: map_, - ap: function (fab, fa) { - return exports.isLeft(fab) - ? exports.isLeft(fa) - ? exports.left(SE.concat(fab.left, fa.left)) - : fab - : exports.isLeft(fa) - ? fa - : exports.right(fab.right(fa.right)); - }, - of: exports.of - }; +exports.concatW = concatW; +function concat(x, y) { + return y ? x.concat(y) : function (y) { return y.concat(x); }; } -exports.getApplicativeValidation = getApplicativeValidation; +exports.concat = concat; /** - * @category instances - * @since 2.7.0 + * @category combinators + * @since 2.0.0 */ -function getAltValidation(SE) { - return { - URI: exports.URI, - _E: undefined, - map: map_, - alt: function (me, that) { - if (exports.isRight(me)) { - return me; +var reverse = function (as) { return __spreadArray([exports.last(as)], as.slice(0, -1).reverse()); }; +exports.reverse = reverse; +function group(E) { + return function (as) { + var len = as.length; + if (len === 0) { + return []; + } + var out = []; + var head = as[0]; + var nea = [head]; + for (var i = 1; i < len; i++) { + var a = as[i]; + if (E.equals(a, head)) { + nea.push(a); + } + else { + out.push(nea); + head = a; + nea = [head]; } - var ea = that(); - return exports.isLeft(ea) ? exports.left(SE.concat(me.left, ea.left)) : ea; } + out.push(nea); + return out; }; } -exports.getAltValidation = getAltValidation; -// TODO: remove in v3 -/** - * @category instances - * @since 2.0.0 - */ -function getValidation(SE) { - var applicativeValidation = getApplicativeValidation(SE); - var altValidation = getAltValidation(SE); - return { - URI: exports.URI, - _E: undefined, - map: map_, - of: exports.of, - chain: chain_, - bimap: bimap_, - mapLeft: mapLeft_, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - extend: extend_, - traverse: traverse_, - sequence: exports.sequence, - chainRec: chainRec_, - throwError: exports.throwError, - ap: applicativeValidation.ap, - alt: altValidation.alt - }; -} -exports.getValidation = getValidation; +exports.group = group; /** - * @category instances + * Splits an array into sub-non-empty-arrays stored in an object, based on the result of calling a `string`-returning + * function on each element, and grouping the results according to values returned + * + * @example + * import { groupBy } from 'fp-ts/NonEmptyArray' + * + * assert.deepStrictEqual(groupBy((s: string) => String(s.length))(['a', 'b', 'ab']), { + * '1': ['a', 'b'], + * '2': ['ab'] + * }) + * + * @category combinators * @since 2.0.0 */ -function getValidationSemigroup(SE, SA) { - return { - concat: function (x, y) { - return exports.isLeft(x) ? (exports.isLeft(y) ? exports.left(SE.concat(x.left, y.left)) : x) : exports.isLeft(y) ? y : exports.right(SA.concat(x.right, y.right)); +var groupBy = function (f) { return function (as) { + var out = {}; + for (var _i = 0, as_1 = as; _i < as_1.length; _i++) { + var a = as_1[_i]; + var k = f(a); + if (out.hasOwnProperty(k)) { + out[k].push(a); } - }; -} -exports.getValidationSemigroup = getValidationSemigroup; -/** - * @category instances - * @since 2.7.0 - */ -exports.Functor = { - URI: exports.URI, - map: map_ -}; -/** - * @category instances - * @since 2.7.0 - */ -exports.Applicative = { - URI: exports.URI, - map: map_, - ap: ap_, - of: exports.of -}; -/** - * @category instances - * @since 2.7.0 - */ -exports.Monad = { - URI: exports.URI, - map: map_, - ap: ap_, - of: exports.of, - chain: chain_ -}; -/** - * @category instances - * @since 2.7.0 - */ -exports.Foldable = { - URI: exports.URI, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_ -}; -/** - * @category instances - * @since 2.7.0 - */ -exports.Traversable = { - URI: exports.URI, - map: map_, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - traverse: traverse_, - sequence: exports.sequence -}; -/** - * @category instances - * @since 2.7.0 - */ -exports.Bifunctor = { - URI: exports.URI, - bimap: bimap_, - mapLeft: mapLeft_ -}; -/** - * @category instances - * @since 2.7.0 - */ -exports.Alt = { - URI: exports.URI, - map: map_, - alt: alt_ -}; + else { + out[k] = [a]; + } + } + return out; +}; }; +exports.groupBy = groupBy; /** - * @category instances - * @since 2.7.0 + * @category combinators + * @since 2.0.0 */ -exports.Extend = { - URI: exports.URI, - map: map_, - extend: extend_ -}; +var sort = function (O) { return function (as) { + return as.slice().sort(O.compare); +}; }; +exports.sort = sort; /** - * @category instances - * @since 2.7.0 - */ -exports.ChainRec = { - URI: exports.URI, - map: map_, - ap: ap_, - chain: chain_, - chainRec: chainRec_ -}; + * @category combinators + * @since 2.0.0 + */ +var insertAt = function (i, a) { return function (as) { + return i < 0 || i > as.length ? _.none : _.some(exports.unsafeInsertAt(i, a, as)); +}; }; +exports.insertAt = insertAt; /** - * @category instances - * @since 2.7.0 + * @category combinators + * @since 2.0.0 */ -exports.MonadThrow = { - URI: exports.URI, - map: map_, - ap: ap_, - of: exports.of, - chain: chain_, - throwError: exports.throwError +var updateAt = function (i, a) { + return exports.modifyAt(i, function () { return a; }); }; +exports.updateAt = updateAt; /** - * @category instances + * @category combinators * @since 2.0.0 */ -function getValidationMonoid(SE, SA) { - return { - concat: getValidationSemigroup(SE, SA).concat, - empty: exports.right(SA.empty) - }; -} -exports.getValidationMonoid = getValidationMonoid; +var modifyAt = function (i, f) { return function (as) { + return exports.isOutOfBound(i, as) ? _.none : _.some(exports.unsafeUpdateAt(i, f(as[i]), as)); +}; }; +exports.modifyAt = modifyAt; /** - * @category instances + * @category combinators * @since 2.0.0 */ -exports.either = { - URI: exports.URI, - map: map_, - of: exports.of, - ap: ap_, - chain: chain_, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - traverse: traverse_, - sequence: exports.sequence, - bimap: bimap_, - mapLeft: mapLeft_, - alt: alt_, - extend: extend_, - chainRec: chainRec_, - throwError: exports.throwError -}; -// ------------------------------------------------------------------------------------- -// utils -// ------------------------------------------------------------------------------------- +exports.copy = exports.fromReadonlyNonEmptyArray; /** - * Default value for the `onError` argument of `tryCatch` - * + * @category Pointed * @since 2.0.0 */ -function toError(e) { - return e instanceof Error ? e : new Error(String(e)); -} -exports.toError = toError; +var of = function (a) { return [a]; }; +exports.of = of; /** - * @since 2.0.0 + * @category combinators + * @since 2.5.1 */ -function elem(E) { - return function (a, ma) { return (exports.isLeft(ma) ? false : E.equals(a, ma.right)); }; +var zipWith = function (as, bs, f) { + var cs = [f(as[0], bs[0])]; + var len = Math.min(as.length, bs.length); + for (var i = 1; i < len; i++) { + cs[i] = f(as[i], bs[i]); + } + return cs; +}; +exports.zipWith = zipWith; +function zip(as, bs) { + if (bs === undefined) { + return function (bs) { return zip(bs, as); }; + } + return exports.zipWith(as, bs, function (a, b) { return [a, b]; }); } -exports.elem = elem; +exports.zip = zip; /** - * Returns `false` if `Left` or returns the result of the application of the given predicate to the `Right` value. + * @category combinators + * @since 2.5.1 + */ +var unzip = function (abs) { + var fa = [abs[0][0]]; + var fb = [abs[0][1]]; + for (var i = 1; i < abs.length; i++) { + fa[i] = abs[i][0]; + fb[i] = abs[i][1]; + } + return [fa, fb]; +}; +exports.unzip = unzip; +/** + * Prepend an element to every member of an array * * @example - * import { exists, left, right } from 'fp-ts/Either' - * - * const gt2 = exists((n: number) => n > 2) + * import { prependAll } from 'fp-ts/NonEmptyArray' * - * assert.strictEqual(gt2(left('a')), false) - * assert.strictEqual(gt2(right(1)), false) - * assert.strictEqual(gt2(right(3)), true) + * assert.deepStrictEqual(prependAll(9)([1, 2, 3, 4]), [9, 1, 9, 2, 9, 3, 9, 4]) * - * @since 2.0.0 + * @category combinators + * @since 2.10.0 */ -function exists(predicate) { - return function (ma) { return (exports.isLeft(ma) ? false : predicate(ma.right)); }; -} -exports.exists = exists; -// ------------------------------------------------------------------------------------- -// do notation -// ------------------------------------------------------------------------------------- +var prependAll = function (middle) { return function (as) { + var out = [middle, as[0]]; + for (var i = 1; i < as.length; i++) { + out.push(middle, as[i]); + } + return out; +}; }; +exports.prependAll = prependAll; /** + * Places an element in between members of an array + * + * @example + * import { intersperse } from 'fp-ts/NonEmptyArray' + * + * assert.deepStrictEqual(intersperse(9)([1, 2, 3, 4]), [1, 9, 2, 9, 3, 9, 4]) + * + * @category combinators * @since 2.9.0 */ -exports.Do = -/*#__PURE__*/ -exports.of({}); +var intersperse = function (middle) { return function (as) { + var rest = exports.tail(as); + return exports.isNonEmpty(rest) ? function_1.pipe(rest, exports.prependAll(middle), exports.prepend(exports.head(as))) : exports.copy(as); +}; }; +exports.intersperse = intersperse; /** - * @since 2.8.0 + * @category combinators + * @since 2.0.0 */ -var bindTo = function (name) { - return exports.map(function_1.bindTo_(name)); -}; -exports.bindTo = bindTo; +exports.foldMapWithIndex = RNEA.foldMapWithIndex; /** - * @since 2.8.0 + * @category combinators + * @since 2.0.0 */ -var bindW = function (name, f) { - return exports.chainW(function (a) { - return function_1.pipe(f(a), exports.map(function (b) { return function_1.bind_(a, name, b); })); - }); -}; -exports.bindW = bindW; +exports.foldMap = RNEA.foldMap; /** - * @since 2.8.0 + * @category combinators + * @since 2.10.0 */ -exports.bind = exports.bindW; -// ------------------------------------------------------------------------------------- -// pipeable sequence S -// ------------------------------------------------------------------------------------- +var chainWithIndex = function (f) { return function (as) { + var out = exports.fromReadonlyNonEmptyArray(f(0, exports.head(as))); + for (var i = 1; i < as.length; i++) { + out.push.apply(out, f(i, as[i])); + } + return out; +}; }; +exports.chainWithIndex = chainWithIndex; /** - * @since 2.8.0 + * @category combinators + * @since 2.10.0 */ -var apSW = function (name, fb) { - return function_1.flow(exports.map(function (a) { return function (b) { return function_1.bind_(a, name, b); }; }), exports.apW(fb)); -}; -exports.apSW = apSW; +var chop = function (f) { return function (as) { + var _a = f(as), b = _a[0], rest = _a[1]; + var out = [b]; + var next = rest; + while (exports.isNonEmpty(next)) { + var _b = f(next), b_1 = _b[0], rest_2 = _b[1]; + out.push(b_1); + next = rest_2; + } + return out; +}; }; +exports.chop = chop; /** - * @since 2.8.0 + * Splits a `NonEmptyArray` into two pieces, the first piece has max `n` elements. + * + * @category combinators + * @since 2.10.0 + */ +var splitAt = function (n) { return function (as) { + var m = Math.max(1, n); + return m >= as.length ? [exports.copy(as), []] : [function_1.pipe(as.slice(1, m), exports.prepend(exports.head(as))), as.slice(m)]; +}; }; +exports.splitAt = splitAt; +/** + * @category combinators + * @since 2.10.0 */ -exports.apS = exports.apSW; +var chunksOf = function (n) { return exports.chop(exports.splitAt(n)); }; +exports.chunksOf = chunksOf; // ------------------------------------------------------------------------------------- -// array utils +// non-pipeables +// ------------------------------------------------------------------------------------- +/* istanbul ignore next */ +var _map = function (fa, f) { return function_1.pipe(fa, exports.map(f)); }; +/* istanbul ignore next */ +var _mapWithIndex = function (fa, f) { return function_1.pipe(fa, exports.mapWithIndex(f)); }; +/* istanbul ignore next */ +var _ap = function (fab, fa) { return function_1.pipe(fab, exports.ap(fa)); }; +/* istanbul ignore next */ +var _chain = function (ma, f) { return function_1.pipe(ma, exports.chain(f)); }; +/* istanbul ignore next */ +var _extend = function (wa, f) { return function_1.pipe(wa, exports.extend(f)); }; +/* istanbul ignore next */ +var _reduce = function (fa, b, f) { return function_1.pipe(fa, exports.reduce(b, f)); }; +/* istanbul ignore next */ +var _foldMap = function (M) { + var foldMapM = exports.foldMap(M); + return function (fa, f) { return function_1.pipe(fa, foldMapM(f)); }; +}; +/* istanbul ignore next */ +var _reduceRight = function (fa, b, f) { return function_1.pipe(fa, exports.reduceRight(b, f)); }; +/* istanbul ignore next */ +var _traverse = function (F) { + var traverseF = exports.traverse(F); + return function (ta, f) { return function_1.pipe(ta, traverseF(f)); }; +}; +/* istanbul ignore next */ +var _alt = function (fa, that) { return function_1.pipe(fa, exports.alt(that)); }; +/* istanbul ignore next */ +var _reduceWithIndex = function (fa, b, f) { + return function_1.pipe(fa, exports.reduceWithIndex(b, f)); +}; +/* istanbul ignore next */ +var _foldMapWithIndex = function (M) { + var foldMapWithIndexM = exports.foldMapWithIndex(M); + return function (fa, f) { return function_1.pipe(fa, foldMapWithIndexM(f)); }; +}; +/* istanbul ignore next */ +var _reduceRightWithIndex = function (fa, b, f) { + return function_1.pipe(fa, exports.reduceRightWithIndex(b, f)); +}; +/* istanbul ignore next */ +var _traverseWithIndex = function (F) { + var traverseWithIndexF = exports.traverseWithIndex(F); + return function (ta, f) { return function_1.pipe(ta, traverseWithIndexF(f)); }; +}; +// ------------------------------------------------------------------------------------- +// type class members // ------------------------------------------------------------------------------------- /** + * Less strict version of [`alt`](#alt). * + * @category Alt * @since 2.9.0 */ -var traverseArrayWithIndex = function (f) { return function (arr) { - // tslint:disable-next-line: readonly-array - var result = []; - for (var i = 0; i < arr.length; i++) { - var e = f(i, arr[i]); - if (e._tag === 'Left') { - return e; - } - result.push(e.right); - } - return exports.right(result); +var altW = function (that) { return function (as) { + return function_1.pipe(as, concatW(that())); }; }; -exports.traverseArrayWithIndex = traverseArrayWithIndex; +exports.altW = altW; /** - * map an array using provided function to Either then transform to Either of the array - * this function has the same behavior of `A.traverse(E.either)` but it's optimized and performs better - * - * @example - * - * - * import { traverseArray, left, right, fromPredicate } from 'fp-ts/Either' - * import { pipe } from 'fp-ts/function' - * import * as A from 'fp-ts/Array' + * Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to + * types of kind `* -> *`. * - * const arr = A.range(0, 10) - * assert.deepStrictEqual( - * pipe( - * arr, - * traverseArray((x) => right(x)) - * ), - * right(arr) - * ) - * assert.deepStrictEqual( - * pipe( - * arr, - * traverseArray( - * fromPredicate( - * (x) => x > 5, - * () => 'a' - * ) - * ) - * ), - * left('a') - * ) - * @since 2.9.0 + * @category Alt + * @since 2.6.2 */ -var traverseArray = function (f) { return exports.traverseArrayWithIndex(function (_, a) { return f(a); }); }; -exports.traverseArray = traverseArray; +exports.alt = exports.altW; /** - * convert an array of either to an either of array - * this function has the same behavior of `A.sequence(E.either)` but it's optimized and performs better + * Apply a function to an argument under a type constructor. * - * @example + * @category Apply + * @since 2.0.0 + */ +var ap = function (as) { + return exports.chain(function (f) { return function_1.pipe(as, exports.map(f)); }); +}; +exports.ap = ap; +/** + * Composes computations in sequence, using the return value of one computation to determine the next computation. * - * import { sequenceArray, left, right } from 'fp-ts/Either' - * import { pipe } from 'fp-ts/function' - * import * as A from 'fp-ts/Array' + * @category Monad + * @since 2.0.0 + */ +var chain = function (f) { + return exports.chainWithIndex(function (_, a) { return f(a); }); +}; +exports.chain = chain; +/** + * @category Extend + * @since 2.0.0 + */ +var extend = function (f) { return function (as) { + var next = exports.tail(as); + var out = [f(as)]; + while (exports.isNonEmpty(next)) { + out.push(f(next)); + next = exports.tail(next); + } + return out; +}; }; +exports.extend = extend; +/** + * Derivable from `Extend`. * - * const arr = A.range(0, 10) - * assert.deepStrictEqual(pipe(arr, A.map(right), sequenceArray), right(arr)) - * assert.deepStrictEqual(pipe(arr, A.map(right), A.cons(left('Error')), sequenceArray), left('Error')) + * @category combinators + * @since 2.5.0 + */ +exports.duplicate = +/*#__PURE__*/ +exports.extend(function_1.identity); +/** + * Derivable from `Chain`. * - * @since 2.9.0 + * @category combinators + * @since 2.5.0 */ -exports.sequenceArray = +exports.flatten = /*#__PURE__*/ -exports.traverseArray(function_1.identity); - - -/***/ }), - -/***/ 6964: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.eq = exports.Contravariant = exports.getMonoid = exports.eqDate = exports.getTupleEq = exports.getStructEq = exports.eqBoolean = exports.eqNumber = exports.eqString = exports.strictEqual = exports.eqStrict = exports.URI = exports.contramap = exports.fromEquals = void 0; -var function_1 = __nccwpck_require__(6985); -// ------------------------------------------------------------------------------------- -// constructors -// ------------------------------------------------------------------------------------- +exports.chain(function_1.identity); +/** + * `map` can be used to turn functions `(a: A) => B` into functions `(fa: F) => F` whose argument and return types + * use the type constructor `F` to represent some computational context. + * + * @category Functor + * @since 2.0.0 + */ +var map = function (f) { return exports.mapWithIndex(function (_, a) { return f(a); }); }; +exports.map = map; +/** + * @category FunctorWithIndex + * @since 2.0.0 + */ +var mapWithIndex = function (f) { return function (as) { + var out = [f(0, exports.head(as))]; + for (var i = 1; i < as.length; i++) { + out.push(f(i, as[i])); + } + return out; +}; }; +exports.mapWithIndex = mapWithIndex; /** - * @category constructors + * @category Foldable * @since 2.0.0 */ -function fromEquals(equals) { - return { - equals: function (x, y) { return x === y || equals(x, y); } - }; -} -exports.fromEquals = fromEquals; -// ------------------------------------------------------------------------------------- -// non-pipeables -// ------------------------------------------------------------------------------------- -/* istanbul ignore next */ -var contramap_ = function (fa, f) { return function_1.pipe(fa, exports.contramap(f)); }; -// ------------------------------------------------------------------------------------- -// pipeables -// ------------------------------------------------------------------------------------- +exports.reduce = RNEA.reduce; /** - * @category Contravariant + * @category FoldableWithIndex * @since 2.0.0 */ -var contramap = function (f) { return function (fa) { - return fromEquals(function (x, y) { return fa.equals(f(x), f(y)); }); -}; }; -exports.contramap = contramap; -// ------------------------------------------------------------------------------------- -// instances -// ------------------------------------------------------------------------------------- +exports.reduceWithIndex = RNEA.reduceWithIndex; /** - * @category instances + * @category Foldable * @since 2.0.0 */ -exports.URI = 'Eq'; +exports.reduceRight = RNEA.reduceRight; /** - * @category instances - * @since 2.5.0 + * @category FoldableWithIndex + * @since 2.0.0 */ -exports.eqStrict = { - // tslint:disable-next-line: deprecation - equals: strictEqual +exports.reduceRightWithIndex = RNEA.reduceRightWithIndex; +/** + * @since 2.6.3 + */ +var traverse = function (F) { + var traverseWithIndexF = exports.traverseWithIndex(F); + return function (f) { return traverseWithIndexF(function (_, a) { return f(a); }); }; }; +exports.traverse = traverse; /** - * Use `eqStrict` instead - * - * @since 2.0.0 - * @deprecated + * @since 2.6.3 */ -function strictEqual(a, b) { - return a === b; -} -exports.strictEqual = strictEqual; +var sequence = function (F) { return exports.traverseWithIndex(F)(function (_, a) { return a; }); }; +exports.sequence = sequence; /** - * @category instances - * @since 2.0.0 + * @since 2.6.3 */ -exports.eqString = exports.eqStrict; +var traverseWithIndex = function (F) { return function (f) { return function (as) { + var out = F.map(f(0, exports.head(as)), exports.of); + for (var i = 1; i < as.length; i++) { + out = F.ap(F.map(out, function (bs) { return function (b) { return function_1.pipe(bs, exports.append(b)); }; }), f(i, as[i])); + } + return out; +}; }; }; +exports.traverseWithIndex = traverseWithIndex; +/** + * @since 2.7.0 + */ +exports.extract = RNEA.head; +// ------------------------------------------------------------------------------------- +// instances +// ------------------------------------------------------------------------------------- /** * @category instances * @since 2.0.0 */ -exports.eqNumber = exports.eqStrict; +exports.URI = 'NonEmptyArray'; /** * @category instances * @since 2.0.0 */ -exports.eqBoolean = exports.eqStrict; +exports.getShow = RNEA.getShow; /** + * Builds a `Semigroup` instance for `NonEmptyArray` + * * @category instances * @since 2.0.0 */ -function getStructEq(eqs) { - return fromEquals(function (x, y) { - for (var k in eqs) { - if (!eqs[k].equals(x[k], y[k])) { - return false; - } - } - return true; - }); -} -exports.getStructEq = getStructEq; +var getSemigroup = function () { return ({ + concat: concat +}); }; +exports.getSemigroup = getSemigroup; /** - * Given a tuple of `Eq`s returns a `Eq` for the tuple - * * @example - * import { getTupleEq, eqString, eqNumber, eqBoolean } from 'fp-ts/Eq' + * import { getEq } from 'fp-ts/NonEmptyArray' + * import * as N from 'fp-ts/number' * - * const E = getTupleEq(eqString, eqNumber, eqBoolean) - * assert.strictEqual(E.equals(['a', 1, true], ['a', 1, true]), true) - * assert.strictEqual(E.equals(['a', 1, true], ['b', 1, true]), false) - * assert.strictEqual(E.equals(['a', 1, true], ['a', 2, true]), false) - * assert.strictEqual(E.equals(['a', 1, true], ['a', 1, false]), false) + * const E = getEq(N.Eq) + * assert.strictEqual(E.equals([1, 2], [1, 2]), true) + * assert.strictEqual(E.equals([1, 2], [1, 3]), false) * * @category instances * @since 2.0.0 */ -function getTupleEq() { - var eqs = []; - for (var _i = 0; _i < arguments.length; _i++) { - eqs[_i] = arguments[_i]; - } - return fromEquals(function (x, y) { return eqs.every(function (E, i) { return E.equals(x[i], y[i]); }); }); -} -exports.getTupleEq = getTupleEq; +exports.getEq = RNEA.getEq; /** - * @category instances - * @since 2.0.0 + * @category combinators + * @since 2.11.0 */ -exports.eqDate = { - equals: function (x, y) { return x.valueOf() === y.valueOf(); } +var getUnionSemigroup = function (E) { + var unionE = exports.union(E); + return { + concat: function (first, second) { return unionE(second)(first); } + }; }; -var empty = { - equals: function () { return true; } +exports.getUnionSemigroup = getUnionSemigroup; +/** + * @category instances + * @since 2.7.0 + */ +exports.Functor = { + URI: exports.URI, + map: _map }; +/** + * Derivable from `Functor`. + * + * @category combinators + * @since 2.10.0 + */ +exports.flap = +/*#__PURE__*/ +Functor_1.flap(exports.Functor); /** * @category instances - * @since 2.6.0 + * @since 2.10.0 */ -function getMonoid() { - return { - concat: function (x, y) { return fromEquals(function (a, b) { return x.equals(a, b) && y.equals(a, b); }); }, - empty: empty - }; -} -exports.getMonoid = getMonoid; +exports.Pointed = { + URI: exports.URI, + of: exports.of +}; /** * @category instances * @since 2.7.0 */ -exports.Contravariant = { +exports.FunctorWithIndex = { URI: exports.URI, - contramap: contramap_ + map: _map, + mapWithIndex: _mapWithIndex }; -// TODO: remove in v3 /** * @category instances - * @since 2.0.0 + * @since 2.10.0 */ -exports.eq = exports.Contravariant; - - -/***/ }), - -/***/ 240: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; +exports.Apply = { + URI: exports.URI, + map: _map, + ap: _ap }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.reduceRight = exports.reduceWithIndex = exports.reduce = exports.mapWithIndex = exports.map = exports.flatten = exports.extend = exports.duplicate = exports.chainFirst = exports.chain = exports.apSecond = exports.apFirst = exports.ap = exports.alt = exports.altW = exports.foldMap = exports.foldMapWithIndex = exports.intersperse = exports.prependToAll = exports.unzip = exports.zip = exports.zipWith = exports.fold = exports.concat = exports.of = exports.filterWithIndex = exports.filter = exports.copy = exports.modifyAt = exports.updateAt = exports.insertAt = exports.sort = exports.init = exports.last = exports.groupBy = exports.groupSort = exports.group = exports.getEq = exports.getSemigroup = exports.max = exports.min = exports.reverse = exports.tail = exports.head = exports.getShow = exports.unsnoc = exports.uncons = exports.fromArray = exports.snoc = exports.cons = void 0; -exports.apS = exports.bind = exports.bindTo = exports.Do = exports.nonEmptyArray = exports.Comonad = exports.Alt = exports.TraversableWithIndex = exports.Traversable = exports.FoldableWithIndex = exports.Foldable = exports.Monad = exports.Applicative = exports.FunctorWithIndex = exports.Functor = exports.URI = exports.extract = exports.traverseWithIndex = exports.sequence = exports.traverse = exports.reduceRightWithIndex = void 0; -var RNEA = __importStar(__nccwpck_require__(8630)); -/* tslint:enable:readonly-keyword */ /** - * Append an element to the front of an array, creating a new non empty array - * - * @example - * import { cons } from 'fp-ts/NonEmptyArray' + * Combine two effectful actions, keeping only the result of the first. * - * assert.deepStrictEqual(cons(1, [2, 3, 4]), [1, 2, 3, 4]) + * Derivable from `Apply`. * - * @category constructors - * @since 2.0.0 + * @category combinators + * @since 2.5.0 */ -exports.cons = RNEA.cons; +exports.apFirst = +/*#__PURE__*/ +Apply_1.apFirst(exports.Apply); /** - * Append an element to the end of an array, creating a new non empty array - * - * @example - * import { snoc } from 'fp-ts/NonEmptyArray' + * Combine two effectful actions, keeping only the result of the second. * - * assert.deepStrictEqual(snoc([1, 2, 3], 4), [1, 2, 3, 4]) + * Derivable from `Apply`. * - * @category constructors - * @since 2.0.0 + * @category combinators + * @since 2.5.0 */ -exports.snoc = RNEA.snoc; +exports.apSecond = +/*#__PURE__*/ +Apply_1.apSecond(exports.Apply); /** - * Builds a `NonEmptyArray` from an `Array` returning `none` if `as` is an empty array - * - * @category constructors - * @since 2.0.0 + * @category instances + * @since 2.7.0 */ -exports.fromArray = RNEA.fromArray; +exports.Applicative = { + URI: exports.URI, + map: _map, + ap: _ap, + of: exports.of +}; /** - * Produces a couple of the first element of the array, and a new array of the remaining elements, if any - * - * @example - * import { cons, uncons } from 'fp-ts/NonEmptyArray' - * - * assert.deepStrictEqual(uncons(cons(1, [2, 3, 4])), [1, [2, 3, 4]]) - * - * @category destructors - * @since 2.9.0 + * @category instances + * @since 2.10.0 */ -exports.uncons = RNEA.uncons; +exports.Chain = { + URI: exports.URI, + map: _map, + ap: _ap, + chain: _chain +}; /** - * Produces a couple of a copy of the array without its last element, and that last element - * - * @example - * import { snoc, unsnoc } from 'fp-ts/NonEmptyArray' + * Composes computations in sequence, using the return value of one computation to determine the next computation and + * keeping only the result of the first. * - * assert.deepStrictEqual(unsnoc(snoc([1, 2, 3], 4)), [[1, 2, 3], 4]) + * Derivable from `Chain`. * - * @category destructors - * @since 2.9.0 + * @category combinators + * @since 2.5.0 */ -exports.unsnoc = RNEA.unsnoc; +exports.chainFirst = +/*#__PURE__*/ +Chain_1.chainFirst(exports.Chain); /** * @category instances - * @since 2.0.0 + * @since 2.7.0 */ -exports.getShow = RNEA.getShow; +exports.Monad = { + URI: exports.URI, + map: _map, + ap: _ap, + of: exports.of, + chain: _chain +}; /** - * @since 2.0.0 + * @category instances + * @since 2.7.0 */ -exports.head = RNEA.head; +exports.Foldable = { + URI: exports.URI, + reduce: _reduce, + foldMap: _foldMap, + reduceRight: _reduceRight +}; /** - * @since 2.0.0 + * @category instances + * @since 2.7.0 */ -exports.tail = RNEA.tail; +exports.FoldableWithIndex = { + URI: exports.URI, + reduce: _reduce, + foldMap: _foldMap, + reduceRight: _reduceRight, + reduceWithIndex: _reduceWithIndex, + foldMapWithIndex: _foldMapWithIndex, + reduceRightWithIndex: _reduceRightWithIndex +}; /** - * @category combinators - * @since 2.0.0 + * @category instances + * @since 2.7.0 */ -exports.reverse = RNEA.reverse; +exports.Traversable = { + URI: exports.URI, + map: _map, + reduce: _reduce, + foldMap: _foldMap, + reduceRight: _reduceRight, + traverse: _traverse, + sequence: exports.sequence +}; /** - * @since 2.0.0 + * @category instances + * @since 2.7.0 + */ +exports.TraversableWithIndex = { + URI: exports.URI, + map: _map, + mapWithIndex: _mapWithIndex, + reduce: _reduce, + foldMap: _foldMap, + reduceRight: _reduceRight, + traverse: _traverse, + sequence: exports.sequence, + reduceWithIndex: _reduceWithIndex, + foldMapWithIndex: _foldMapWithIndex, + reduceRightWithIndex: _reduceRightWithIndex, + traverseWithIndex: _traverseWithIndex +}; +/** + * @category instances + * @since 2.7.0 + */ +exports.Alt = { + URI: exports.URI, + map: _map, + alt: _alt +}; +/** + * @category instances + * @since 2.7.0 + */ +exports.Comonad = { + URI: exports.URI, + map: _map, + extend: _extend, + extract: exports.extract +}; +// ------------------------------------------------------------------------------------- +// do notation +// ------------------------------------------------------------------------------------- +/** + * @since 2.9.0 */ -exports.min = RNEA.min; +exports.Do = +/*#__PURE__*/ +exports.of(_.emptyRecord); /** - * @since 2.0.0 + * @since 2.8.0 */ -exports.max = RNEA.max; +exports.bindTo = +/*#__PURE__*/ +Functor_1.bindTo(exports.Functor); /** - * Builds a `Semigroup` instance for `NonEmptyArray` - * - * @category instances - * @since 2.0.0 + * @since 2.8.0 */ -exports.getSemigroup = RNEA.getSemigroup; +exports.bind = +/*#__PURE__*/ +Chain_1.bind(exports.Chain); +// ------------------------------------------------------------------------------------- +// pipeable sequence S +// ------------------------------------------------------------------------------------- /** - * @example - * import { getEq, cons } from 'fp-ts/NonEmptyArray' - * import { eqNumber } from 'fp-ts/Eq' - * - * const E = getEq(eqNumber) - * assert.strictEqual(E.equals(cons(1, [2]), [1, 2]), true) - * assert.strictEqual(E.equals(cons(1, [2]), [1, 3]), false) - * - * @category instances - * @since 2.0.0 + * @since 2.8.0 */ -exports.getEq = RNEA.getEq; -function group(E) { - return RNEA.group(E); -} -exports.group = group; +exports.apS = +/*#__PURE__*/ +Apply_1.apS(exports.Apply); +// ------------------------------------------------------------------------------------- +// utils +// ------------------------------------------------------------------------------------- /** - * Sort and then group the elements of an array into non empty arrays. - * - * @example - * import { cons, groupSort } from 'fp-ts/NonEmptyArray' - * import { ordNumber } from 'fp-ts/Ord' - * - * assert.deepStrictEqual(groupSort(ordNumber)([1, 2, 1, 1]), [cons(1, [1, 1]), cons(2, [])]) - * - * @category combinators * @since 2.0.0 */ -exports.groupSort = RNEA.groupSort; +exports.head = RNEA.head; /** - * Splits an array into sub-non-empty-arrays stored in an object, based on the result of calling a `string`-returning - * function on each element, and grouping the results according to values returned - * - * @example - * import { cons, groupBy } from 'fp-ts/NonEmptyArray' - * - * assert.deepStrictEqual(groupBy((s: string) => String(s.length))(['foo', 'bar', 'foobar']), { - * '3': cons('foo', ['bar']), - * '6': cons('foobar', []) - * }) - * - * @category constructors * @since 2.0.0 */ -exports.groupBy = RNEA.groupBy; +var tail = function (as) { return as.slice(1); }; +exports.tail = tail; /** * @since 2.0.0 */ @@ -8122,440 +10129,770 @@ exports.last = RNEA.last; * * @since 2.2.0 */ -exports.init = RNEA.init; +var init = function (as) { return as.slice(0, -1); }; +exports.init = init; /** - * @category combinators * @since 2.0.0 */ -exports.sort = RNEA.sort; +exports.min = RNEA.min; /** * @since 2.0.0 */ -exports.insertAt = RNEA.insertAt; +exports.max = RNEA.max; /** - * @since 2.0.0 + * @since 2.10.0 */ -exports.updateAt = RNEA.updateAt; +var concatAll = function (S) { return function (as) { return as.reduce(S.concat); }; }; +exports.concatAll = concatAll; /** - * @since 2.0.0 + * Break an `Array` into its first element and remaining elements. + * + * @category destructors + * @since 2.11.0 + */ +var matchLeft = function (f) { return function (as) { return f(exports.head(as), exports.tail(as)); }; }; +exports.matchLeft = matchLeft; +/** + * Break an `Array` into its initial elements and the last element. + * + * @category destructors + * @since 2.11.0 + */ +var matchRight = function (f) { return function (as) { + return f(exports.init(as), exports.last(as)); +}; }; +exports.matchRight = matchRight; +/** + * Apply a function to the head, creating a new `NonEmptyArray`. + * + * @since 2.11.0 */ -exports.modifyAt = RNEA.modifyAt; +var modifyHead = function (f) { return function (as) { return __spreadArray([ + f(exports.head(as)) +], exports.tail(as)); }; }; +exports.modifyHead = modifyHead; /** + * Change the head, creating a new `NonEmptyArray`. + * * @category combinators - * @since 2.0.0 + * @since 2.11.0 */ -function copy(nea) { - var l = nea.length; - var as = Array(l); - for (var i = 0; i < l; i++) { - as[i] = nea[i]; - } - return as; +var updateHead = function (a) { return exports.modifyHead(function () { return a; }); }; +exports.updateHead = updateHead; +/** + * Apply a function to the last element, creating a new `NonEmptyArray`. + * + * @since 2.11.0 + */ +var modifyLast = function (f) { return function (as) { + return function_1.pipe(exports.init(as), exports.append(f(exports.last(as)))); +}; }; +exports.modifyLast = modifyLast; +/** + * Change the last element, creating a new `NonEmptyArray`. + * + * @category combinators + * @since 2.11.0 + */ +var updateLast = function (a) { return exports.modifyLast(function () { return a; }); }; +exports.updateLast = updateLast; +function groupSort(O) { + var sortO = exports.sort(O); + var groupO = group(O); + return function (as) { return (exports.isNonEmpty(as) ? groupO(sortO(as)) : []); }; } -exports.copy = copy; +exports.groupSort = groupSort; function filter(predicate) { - return RNEA.filter(predicate); + return exports.filterWithIndex(function (_, a) { return predicate(a); }); } exports.filter = filter; /** + * Use [`filterWithIndex`](./Array.ts.html#filterwithindex) instead. + * + * @category combinators * @since 2.0.0 + * @deprecated */ -exports.filterWithIndex = RNEA.filterWithIndex; +var filterWithIndex = function (predicate) { return function (as) { return exports.fromArray(as.filter(function (a, i) { return predicate(i, a); })); }; }; +exports.filterWithIndex = filterWithIndex; /** - * Wrap a value into the type constructor. + * Use [`unprepend`](#unprepend) instead. * - * @category Applicative - * @since 2.0.0 + * @category destructors + * @since 2.9.0 + * @deprecated */ -exports.of = RNEA.of; -function concat(fx, fy) { - return RNEA.concat(fx, fy); +exports.uncons = exports.unprepend; +/** + * Use [`unappend`](#unappend) instead. + * + * @category destructors + * @since 2.9.0 + * @deprecated + */ +exports.unsnoc = exports.unappend; +function cons(head, tail) { + return tail === undefined ? exports.prepend(head) : function_1.pipe(tail, exports.prepend(head)); } -exports.concat = concat; +exports.cons = cons; /** - * @since 2.5.0 + * Use [`append`](./Array.ts.html#append) instead. + * + * @category constructors + * @since 2.0.0 + * @deprecated */ -exports.fold = RNEA.fold; +var snoc = function (init, end) { return function_1.pipe(init, exports.append(end)); }; +exports.snoc = snoc; /** + * Use [`prependAll`](#prependall) instead. + * * @category combinators - * @since 2.5.1 + * @since 2.9.0 + * @deprecated */ -exports.zipWith = RNEA.zipWith; +exports.prependToAll = exports.prependAll; /** - * @category combinators - * @since 2.5.1 + * Use [`concatAll`](#concatall) instead. + * + * @since 2.5.0 + * @deprecated */ -exports.zip = RNEA.zip; +exports.fold = RNEA.concatAll; /** - * @since 2.5.1 + * Use small, specific instances instead. + * + * @category instances + * @since 2.0.0 + * @deprecated + */ +exports.nonEmptyArray = { + URI: exports.URI, + of: exports.of, + map: _map, + mapWithIndex: _mapWithIndex, + ap: _ap, + chain: _chain, + extend: _extend, + extract: exports.extract, + reduce: _reduce, + foldMap: _foldMap, + reduceRight: _reduceRight, + traverse: _traverse, + sequence: exports.sequence, + reduceWithIndex: _reduceWithIndex, + foldMapWithIndex: _foldMapWithIndex, + reduceRightWithIndex: _reduceRightWithIndex, + traverseWithIndex: _traverseWithIndex, + alt: _alt +}; + + +/***/ }), + +/***/ 2569: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.fromEither = exports.MonadThrow = exports.throwError = exports.Witherable = exports.wilt = exports.wither = exports.Traversable = exports.sequence = exports.traverse = exports.Filterable = exports.partitionMap = exports.partition = exports.filterMap = exports.filter = exports.Compactable = exports.separate = exports.compact = exports.Extend = exports.extend = exports.Alternative = exports.guard = exports.Zero = exports.zero = exports.Alt = exports.alt = exports.altW = exports.Foldable = exports.reduceRight = exports.foldMap = exports.reduce = exports.Monad = exports.Chain = exports.chain = exports.Applicative = exports.Apply = exports.ap = exports.Pointed = exports.of = exports.Functor = exports.map = exports.getMonoid = exports.getOrd = exports.getEq = exports.getShow = exports.URI = exports.getRight = exports.getLeft = exports.fromPredicate = exports.some = exports.none = void 0; +exports.getLastMonoid = exports.getFirstMonoid = exports.getApplyMonoid = exports.getApplySemigroup = exports.option = exports.mapNullable = exports.getRefinement = exports.sequenceArray = exports.traverseArray = exports.traverseArrayWithIndex = exports.traverseReadonlyArrayWithIndex = exports.traverseReadonlyNonEmptyArrayWithIndex = exports.ApT = exports.apS = exports.bind = exports.bindTo = exports.Do = exports.exists = exports.elem = exports.toUndefined = exports.toNullable = exports.chainNullableK = exports.fromNullableK = exports.tryCatchK = exports.tryCatch = exports.fromNullable = exports.chainEitherK = exports.fromEitherK = exports.duplicate = exports.chainFirst = exports.flatten = exports.apSecond = exports.apFirst = exports.flap = exports.getOrElse = exports.getOrElseW = exports.fold = exports.match = exports.foldW = exports.matchW = exports.isNone = exports.isSome = exports.FromEither = void 0; +var Applicative_1 = __nccwpck_require__(4766); +var Apply_1 = __nccwpck_require__(205); +var Chain_1 = __nccwpck_require__(2372); +var FromEither_1 = __nccwpck_require__(1964); +var function_1 = __nccwpck_require__(6985); +var Functor_1 = __nccwpck_require__(5533); +var _ = __importStar(__nccwpck_require__(1840)); +var Predicate_1 = __nccwpck_require__(6382); +var Semigroup_1 = __nccwpck_require__(6339); +var Separated_1 = __nccwpck_require__(5877); +var Witherable_1 = __nccwpck_require__(4384); +var Zero_1 = __nccwpck_require__(9734); +// ------------------------------------------------------------------------------------- +// constructors +// ------------------------------------------------------------------------------------- +/** + * `None` doesn't have a constructor, instead you can use it directly as a value. Represents a missing value. + * + * @category constructors + * @since 2.0.0 */ -exports.unzip = RNEA.unzip; +exports.none = _.none; /** - * Prepend an element to every member of an array + * Constructs a `Some`. Represents an optional value that exists. + * + * @category constructors + * @since 2.0.0 + */ +exports.some = _.some; +function fromPredicate(predicate) { + return function (a) { return (predicate(a) ? exports.some(a) : exports.none); }; +} +exports.fromPredicate = fromPredicate; +/** + * Returns the `Left` value of an `Either` if possible. * * @example - * import { cons, prependToAll } from 'fp-ts/NonEmptyArray' + * import { getLeft, none, some } from 'fp-ts/Option' + * import { right, left } from 'fp-ts/Either' * - * assert.deepStrictEqual(prependToAll(9)(cons(1, [2, 3, 4])), cons(9, [1, 9, 2, 9, 3, 9, 4])) + * assert.deepStrictEqual(getLeft(right(1)), none) + * assert.deepStrictEqual(getLeft(left('a')), some('a')) * - * @category combinators - * @since 2.9.0 + * @category constructors + * @since 2.0.0 */ -exports.prependToAll = RNEA.prependToAll; +var getLeft = function (ma) { return (ma._tag === 'Right' ? exports.none : exports.some(ma.left)); }; +exports.getLeft = getLeft; /** - * Places an element in between members of an array + * Returns the `Right` value of an `Either` if possible. * * @example - * import { cons, intersperse } from 'fp-ts/NonEmptyArray' + * import { getRight, none, some } from 'fp-ts/Option' + * import { right, left } from 'fp-ts/Either' * - * assert.deepStrictEqual(intersperse(9)(cons(1, [2, 3, 4])), cons(1, [9, 2, 9, 3, 9, 4])) + * assert.deepStrictEqual(getRight(right(1)), some(1)) + * assert.deepStrictEqual(getRight(left('a')), none) * - * @category combinators - * @since 2.9.0 + * @category constructors + * @since 2.0.0 */ -exports.intersperse = RNEA.intersperse; +var getRight = function (ma) { return (ma._tag === 'Left' ? exports.none : exports.some(ma.right)); }; +exports.getRight = getRight; // ------------------------------------------------------------------------------------- // non-pipeables // ------------------------------------------------------------------------------------- -var map_ = RNEA.Functor.map; -var mapWithIndex_ = RNEA.FunctorWithIndex.mapWithIndex; -var ap_ = RNEA.Applicative.ap; -var chain_ = RNEA.Monad.chain; -var extend_ = RNEA.Comonad.extend; -var reduce_ = RNEA.Foldable.reduce; -var foldMap_ = RNEA.Foldable.foldMap; -var reduceRight_ = RNEA.Foldable.reduceRight; -var traverse_ = RNEA.Traversable.traverse; -var alt_ = RNEA.Alt.alt; -var reduceWithIndex_ = RNEA.FoldableWithIndex - .reduceWithIndex; -var foldMapWithIndex_ = RNEA.FoldableWithIndex - .foldMapWithIndex; -var reduceRightWithIndex_ = RNEA.FoldableWithIndex - .reduceRightWithIndex; -var traverseWithIndex_ = RNEA.TraversableWithIndex - .traverseWithIndex; -// ------------------------------------------------------------------------------------- -// pipeables +var _map = function (fa, f) { return function_1.pipe(fa, exports.map(f)); }; +var _ap = function (fab, fa) { return function_1.pipe(fab, exports.ap(fa)); }; +var _chain = function (ma, f) { return function_1.pipe(ma, exports.chain(f)); }; +var _reduce = function (fa, b, f) { return function_1.pipe(fa, exports.reduce(b, f)); }; +var _foldMap = function (M) { + var foldMapM = exports.foldMap(M); + return function (fa, f) { return function_1.pipe(fa, foldMapM(f)); }; +}; +var _reduceRight = function (fa, b, f) { return function_1.pipe(fa, exports.reduceRight(b, f)); }; +var _traverse = function (F) { + var traverseF = exports.traverse(F); + return function (ta, f) { return function_1.pipe(ta, traverseF(f)); }; +}; +/* istanbul ignore next */ +var _alt = function (fa, that) { return function_1.pipe(fa, exports.alt(that)); }; +var _filter = function (fa, predicate) { return function_1.pipe(fa, exports.filter(predicate)); }; +/* istanbul ignore next */ +var _filterMap = function (fa, f) { return function_1.pipe(fa, exports.filterMap(f)); }; +/* istanbul ignore next */ +var _extend = function (wa, f) { return function_1.pipe(wa, exports.extend(f)); }; +/* istanbul ignore next */ +var _partition = function (fa, predicate) { + return function_1.pipe(fa, exports.partition(predicate)); +}; +/* istanbul ignore next */ +var _partitionMap = function (fa, f) { return function_1.pipe(fa, exports.partitionMap(f)); }; +// ------------------------------------------------------------------------------------- +// instances // ------------------------------------------------------------------------------------- /** - * @category FoldableWithIndex + * @category instances * @since 2.0.0 */ -exports.foldMapWithIndex = RNEA.foldMapWithIndex; +exports.URI = 'Option'; /** - * @category Foldable + * @category instances * @since 2.0.0 */ -exports.foldMap = RNEA.foldMap; -/** - * Less strict version of [`alt`](#alt). - * - * @category Alt - * @since 2.9.0 - */ -exports.altW = RNEA.altW; +var getShow = function (S) { return ({ + show: function (ma) { return (exports.isNone(ma) ? 'none' : "some(" + S.show(ma.value) + ")"); } +}); }; +exports.getShow = getShow; /** - * Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to - * types of kind `* -> *`. + * @example + * import { none, some, getEq } from 'fp-ts/Option' + * import * as N from 'fp-ts/number' * - * @category Alt - * @since 2.6.2 - */ -exports.alt = RNEA.alt; -/** - * Apply a function to an argument under a type constructor. + * const E = getEq(N.Eq) + * assert.strictEqual(E.equals(none, none), true) + * assert.strictEqual(E.equals(none, some(1)), false) + * assert.strictEqual(E.equals(some(1), none), false) + * assert.strictEqual(E.equals(some(1), some(2)), false) + * assert.strictEqual(E.equals(some(1), some(1)), true) * - * @category Apply + * @category instances * @since 2.0.0 */ -exports.ap = RNEA.ap; +var getEq = function (E) { return ({ + equals: function (x, y) { return x === y || (exports.isNone(x) ? exports.isNone(y) : exports.isNone(y) ? false : E.equals(x.value, y.value)); } +}); }; +exports.getEq = getEq; /** - * Combine two effectful actions, keeping only the result of the first. + * The `Ord` instance allows `Option` values to be compared with + * `compare`, whenever there is an `Ord` instance for + * the type the `Option` contains. * - * Derivable from `Apply`. + * `None` is considered to be less than any `Some` value. + * + * + * @example + * import { none, some, getOrd } from 'fp-ts/Option' + * import * as N from 'fp-ts/number' + * + * const O = getOrd(N.Ord) + * assert.strictEqual(O.compare(none, none), 0) + * assert.strictEqual(O.compare(none, some(1)), -1) + * assert.strictEqual(O.compare(some(1), none), 1) + * assert.strictEqual(O.compare(some(1), some(2)), -1) + * assert.strictEqual(O.compare(some(1), some(1)), 0) * - * @category combinators + * @category instances * @since 2.0.0 */ -exports.apFirst = RNEA.apFirst; +var getOrd = function (O) { return ({ + equals: exports.getEq(O).equals, + compare: function (x, y) { return (x === y ? 0 : exports.isSome(x) ? (exports.isSome(y) ? O.compare(x.value, y.value) : 1) : -1); } +}); }; +exports.getOrd = getOrd; /** - * Combine two effectful actions, keeping only the result of the second. + * Monoid returning the left-most non-`None` value. If both operands are `Some`s then the inner values are + * concatenated using the provided `Semigroup` * - * Derivable from `Apply`. + * | x | y | concat(x, y) | + * | ------- | ------- | ------------------ | + * | none | none | none | + * | some(a) | none | some(a) | + * | none | some(b) | some(b) | + * | some(a) | some(b) | some(concat(a, b)) | * - * @category combinators + * @example + * import { getMonoid, some, none } from 'fp-ts/Option' + * import { SemigroupSum } from 'fp-ts/number' + * + * const M = getMonoid(SemigroupSum) + * assert.deepStrictEqual(M.concat(none, none), none) + * assert.deepStrictEqual(M.concat(some(1), none), some(1)) + * assert.deepStrictEqual(M.concat(none, some(1)), some(1)) + * assert.deepStrictEqual(M.concat(some(1), some(2)), some(3)) + * + * @category instances * @since 2.0.0 */ -exports.apSecond = RNEA.apSecond; +var getMonoid = function (S) { return ({ + concat: function (x, y) { return (exports.isNone(x) ? y : exports.isNone(y) ? x : exports.some(S.concat(x.value, y.value))); }, + empty: exports.none +}); }; +exports.getMonoid = getMonoid; /** - * Composes computations in sequence, using the return value of one computation to determine the next computation. - * - * @category Monad + * @category instance operations * @since 2.0.0 */ -exports.chain = RNEA.chain; +var map = function (f) { return function (fa) { + return exports.isNone(fa) ? exports.none : exports.some(f(fa.value)); +}; }; +exports.map = map; /** - * Composes computations in sequence, using the return value of one computation to determine the next computation and - * keeping only the result of the first. - * - * Derivable from `Monad`. - * - * @category combinators - * @since 2.0.0 + * @category instances + * @since 2.7.0 */ -exports.chainFirst = RNEA.chainFirst; +exports.Functor = { + URI: exports.URI, + map: _map +}; /** - * Derivable from `Extend`. - * - * @category combinators - * @since 2.0.0 + * @category instance operations + * @since 2.7.0 */ -exports.duplicate = RNEA.duplicate; +exports.of = exports.some; /** - * @category Extend - * @since 2.0.0 + * @category instances + * @since 2.10.0 */ -exports.extend = RNEA.extend; +exports.Pointed = { + URI: exports.URI, + of: exports.of +}; /** - * Derivable from `Monad`. - * - * @category combinators + * @category instance operations * @since 2.0.0 */ -exports.flatten = RNEA.flatten; +var ap = function (fa) { return function (fab) { + return exports.isNone(fab) ? exports.none : exports.isNone(fa) ? exports.none : exports.some(fab.value(fa.value)); +}; }; +exports.ap = ap; /** - * `map` can be used to turn functions `(a: A) => B` into functions `(fa: F) => F` whose argument and return types - * use the type constructor `F` to represent some computational context. - * - * @category Functor - * @since 2.0.0 + * @category instances + * @since 2.10.0 */ -exports.map = RNEA.map; +exports.Apply = { + URI: exports.URI, + map: _map, + ap: _ap +}; /** - * @category FunctorWithIndex - * @since 2.0.0 + * @category instances + * @since 2.7.0 */ -exports.mapWithIndex = RNEA.mapWithIndex; +exports.Applicative = { + URI: exports.URI, + map: _map, + ap: _ap, + of: exports.of +}; /** - * @category Foldable + * Composes computations in sequence, using the return value of one computation to determine the next computation. + * + * @category instance operations * @since 2.0.0 */ -exports.reduce = RNEA.reduce; +var chain = function (f) { return function (ma) { + return exports.isNone(ma) ? exports.none : f(ma.value); +}; }; +exports.chain = chain; /** - * @category FoldableWithIndex - * @since 2.0.0 + * @category instances + * @since 2.10.0 */ -exports.reduceWithIndex = RNEA.reduceWithIndex; +exports.Chain = { + URI: exports.URI, + map: _map, + ap: _ap, + chain: _chain +}; /** - * @category Foldable - * @since 2.0.0 + * @category instances + * @since 2.7.0 */ -exports.reduceRight = RNEA.reduceRight; +exports.Monad = { + URI: exports.URI, + map: _map, + ap: _ap, + of: exports.of, + chain: _chain +}; /** - * @category FoldableWithIndex + * @category instance operations * @since 2.0.0 */ -exports.reduceRightWithIndex = RNEA.reduceRightWithIndex; +var reduce = function (b, f) { return function (fa) { + return exports.isNone(fa) ? b : f(b, fa.value); +}; }; +exports.reduce = reduce; /** - * @since 2.6.3 + * @category instance operations + * @since 2.0.0 */ -exports.traverse = RNEA.traverse; +var foldMap = function (M) { return function (f) { return function (fa) { + return exports.isNone(fa) ? M.empty : f(fa.value); +}; }; }; +exports.foldMap = foldMap; /** - * @since 2.6.3 + * @category instance operations + * @since 2.0.0 */ -exports.sequence = RNEA.sequence; +var reduceRight = function (b, f) { return function (fa) { + return exports.isNone(fa) ? b : f(fa.value, b); +}; }; +exports.reduceRight = reduceRight; /** - * @since 2.6.3 + * @category instances + * @since 2.7.0 */ -exports.traverseWithIndex = RNEA.traverseWithIndex; +exports.Foldable = { + URI: exports.URI, + reduce: _reduce, + foldMap: _foldMap, + reduceRight: _reduceRight +}; /** - * @since 2.7.0 + * Less strict version of [`alt`](#alt). + * + * @category instance operations + * @since 2.9.0 */ -exports.extract = exports.head; -// ------------------------------------------------------------------------------------- -// instances -// ------------------------------------------------------------------------------------- +var altW = function (that) { return function (fa) { + return exports.isNone(fa) ? that() : fa; +}; }; +exports.altW = altW; /** - * @category instances + * Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to + * types of kind `* -> *`. + * + * In case of `Option` returns the left-most non-`None` value. + * + * @example + * import * as O from 'fp-ts/Option' + * import { pipe } from 'fp-ts/function' + * + * assert.deepStrictEqual( + * pipe( + * O.some('a'), + * O.alt(() => O.some('b')) + * ), + * O.some('a') + * ) + * assert.deepStrictEqual( + * pipe( + * O.none, + * O.alt(() => O.some('b')) + * ), + * O.some('b') + * ) + * + * @category instance operations * @since 2.0.0 */ -exports.URI = 'NonEmptyArray'; +exports.alt = exports.altW; /** * @category instances * @since 2.7.0 */ -exports.Functor = { +exports.Alt = { URI: exports.URI, - map: map_ + map: _map, + alt: _alt }; /** - * @category instances + * @category instance operations * @since 2.7.0 */ -exports.FunctorWithIndex = { +var zero = function () { return exports.none; }; +exports.zero = zero; +/** + * @category instances + * @since 2.11.0 + */ +exports.Zero = { URI: exports.URI, - map: map_, - mapWithIndex: mapWithIndex_ + zero: exports.zero }; +/** + * @category constructors + * @since 2.11.0 + */ +exports.guard = +/*#__PURE__*/ +Zero_1.guard(exports.Zero, exports.Pointed); /** * @category instances * @since 2.7.0 */ -exports.Applicative = { +exports.Alternative = { URI: exports.URI, - map: map_, - ap: ap_, - of: exports.of + map: _map, + ap: _ap, + of: exports.of, + alt: _alt, + zero: exports.zero }; +/** + * @category instance operations + * @since 2.0.0 + */ +var extend = function (f) { return function (wa) { + return exports.isNone(wa) ? exports.none : exports.some(f(wa)); +}; }; +exports.extend = extend; /** * @category instances * @since 2.7.0 */ -exports.Monad = { +exports.Extend = { URI: exports.URI, - map: map_, - ap: ap_, - of: exports.of, - chain: chain_ + map: _map, + extend: _extend +}; +/** + * @category instance operations + * @since 2.0.0 + */ +exports.compact = +/*#__PURE__*/ +exports.chain(function_1.identity); +var defaultSeparated = +/*#__PURE__*/ +Separated_1.separated(exports.none, exports.none); +/** + * @category instance operations + * @since 2.0.0 + */ +var separate = function (ma) { + return exports.isNone(ma) ? defaultSeparated : Separated_1.separated(exports.getLeft(ma.value), exports.getRight(ma.value)); }; +exports.separate = separate; /** * @category instances * @since 2.7.0 */ -exports.Foldable = { +exports.Compactable = { URI: exports.URI, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_ + compact: exports.compact, + separate: exports.separate }; +/** + * @category instance operations + * @since 2.0.0 + */ +var filter = function (predicate) { return function (fa) { return (exports.isNone(fa) ? exports.none : predicate(fa.value) ? fa : exports.none); }; }; +exports.filter = filter; +/** + * @category instance operations + * @since 2.0.0 + */ +var filterMap = function (f) { return function (fa) { + return exports.isNone(fa) ? exports.none : f(fa.value); +}; }; +exports.filterMap = filterMap; +/** + * @category instance operations + * @since 2.0.0 + */ +var partition = function (predicate) { return function (fa) { return Separated_1.separated(_filter(fa, Predicate_1.not(predicate)), _filter(fa, predicate)); }; }; +exports.partition = partition; +/** + * @category instance operations + * @since 2.0.0 + */ +var partitionMap = function (f) { return function_1.flow(exports.map(f), exports.separate); }; +exports.partitionMap = partitionMap; /** * @category instances * @since 2.7.0 */ -exports.FoldableWithIndex = { +exports.Filterable = { URI: exports.URI, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - reduceWithIndex: reduceWithIndex_, - foldMapWithIndex: foldMapWithIndex_, - reduceRightWithIndex: reduceRightWithIndex_ + map: _map, + compact: exports.compact, + separate: exports.separate, + filter: _filter, + filterMap: _filterMap, + partition: _partition, + partitionMap: _partitionMap }; +/** + * @category instance operations + * @since 2.6.3 + */ +var traverse = function (F) { return function (f) { return function (ta) { return (exports.isNone(ta) ? F.of(exports.none) : F.map(f(ta.value), exports.some)); }; }; }; +exports.traverse = traverse; +/** + * @category instance operations + * @since 2.6.3 + */ +var sequence = function (F) { return function (ta) { return (exports.isNone(ta) ? F.of(exports.none) : F.map(ta.value, exports.some)); }; }; +exports.sequence = sequence; /** * @category instances * @since 2.7.0 */ exports.Traversable = { URI: exports.URI, - map: map_, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - traverse: traverse_, + map: _map, + reduce: _reduce, + foldMap: _foldMap, + reduceRight: _reduceRight, + traverse: _traverse, sequence: exports.sequence }; +var _wither = +/*#__PURE__*/ +Witherable_1.witherDefault(exports.Traversable, exports.Compactable); +var _wilt = +/*#__PURE__*/ +Witherable_1.wiltDefault(exports.Traversable, exports.Compactable); +/** + * @category instance operations + * @since 2.6.5 + */ +var wither = function (F) { + var _witherF = _wither(F); + return function (f) { return function (fa) { return _witherF(fa, f); }; }; +}; +exports.wither = wither; +/** + * @category instance operations + * @since 2.6.5 + */ +var wilt = function (F) { + var _wiltF = _wilt(F); + return function (f) { return function (fa) { return _wiltF(fa, f); }; }; +}; +exports.wilt = wilt; /** * @category instances * @since 2.7.0 */ -exports.TraversableWithIndex = { +exports.Witherable = { URI: exports.URI, - map: map_, - mapWithIndex: mapWithIndex_, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - traverse: traverse_, + map: _map, + reduce: _reduce, + foldMap: _foldMap, + reduceRight: _reduceRight, + traverse: _traverse, sequence: exports.sequence, - reduceWithIndex: reduceWithIndex_, - foldMapWithIndex: foldMapWithIndex_, - reduceRightWithIndex: reduceRightWithIndex_, - traverseWithIndex: traverseWithIndex_ + compact: exports.compact, + separate: exports.separate, + filter: _filter, + filterMap: _filterMap, + partition: _partition, + partitionMap: _partitionMap, + wither: _wither, + wilt: _wilt }; /** - * @category instances + * @category instance operations * @since 2.7.0 */ -exports.Alt = { - URI: exports.URI, - map: map_, - alt: alt_ -}; +var throwError = function () { return exports.none; }; +exports.throwError = throwError; /** * @category instances * @since 2.7.0 */ -exports.Comonad = { - URI: exports.URI, - map: map_, - extend: extend_, - extract: exports.extract -}; -// TODO: remove in v3 -/** - * @category instances - * @since 2.0.0 - */ -exports.nonEmptyArray = { +exports.MonadThrow = { URI: exports.URI, + map: _map, + ap: _ap, of: exports.of, - map: map_, - mapWithIndex: mapWithIndex_, - ap: ap_, - chain: chain_, - extend: extend_, - extract: exports.extract, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - traverse: traverse_, - sequence: exports.sequence, - reduceWithIndex: reduceWithIndex_, - foldMapWithIndex: foldMapWithIndex_, - reduceRightWithIndex: reduceRightWithIndex_, - traverseWithIndex: traverseWithIndex_, - alt: alt_ + chain: _chain, + throwError: exports.throwError }; -// ------------------------------------------------------------------------------------- -// do notation -// ------------------------------------------------------------------------------------- -/** - * @since 2.9.0 - */ -exports.Do = -/*#__PURE__*/ -exports.of({}); /** - * @since 2.8.0 - */ -exports.bindTo = RNEA.bindTo; -/** - * @since 2.8.0 + * Transforms an `Either` to an `Option` discarding the error. + * + * Alias of [getRight](#getright) + * + * @category natural transformations + * @since 2.0.0 */ -exports.bind = RNEA.bind; -// ------------------------------------------------------------------------------------- -// pipeable sequence S -// ------------------------------------------------------------------------------------- +exports.fromEither = exports.getRight; /** - * @since 2.8.0 + * @category instances + * @since 2.11.0 */ -exports.apS = RNEA.apS; - - -/***/ }), - -/***/ 2569: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getApplySemigroup = exports.getOrd = exports.getEq = exports.getShow = exports.URI = exports.wilt = exports.wither = exports.sequence = exports.traverse = exports.partitionMap = exports.partition = exports.filterMap = exports.filter = exports.separate = exports.compact = exports.reduceRight = exports.foldMap = exports.reduce = exports.duplicate = exports.extend = exports.throwError = exports.zero = exports.alt = exports.altW = exports.flatten = exports.chainFirst = exports.chain = exports.of = exports.apSecond = exports.apFirst = exports.ap = exports.map = exports.chainNullableK = exports.mapNullable = exports.fromNullableK = exports.getOrElse = exports.getOrElseW = exports.toUndefined = exports.toNullable = exports.fold = exports.fromEither = exports.getRight = exports.getLeft = exports.tryCatch = exports.fromPredicate = exports.fromNullable = exports.some = exports.none = exports.isNone = exports.isSome = void 0; -exports.sequenceArray = exports.traverseArray = exports.traverseArrayWithIndex = exports.apS = exports.bind = exports.bindTo = exports.Do = exports.getRefinement = exports.exists = exports.elem = exports.option = exports.MonadThrow = exports.Witherable = exports.Traversable = exports.Filterable = exports.Compactable = exports.Extend = exports.Alternative = exports.Alt = exports.Foldable = exports.Monad = exports.Applicative = exports.Functor = exports.getMonoid = exports.getLastMonoid = exports.getFirstMonoid = exports.getApplyMonoid = void 0; -var function_1 = __nccwpck_require__(6985); +exports.FromEither = { + URI: exports.URI, + fromEither: exports.fromEither +}; // ------------------------------------------------------------------------------------- -// guards +// refinements // ------------------------------------------------------------------------------------- /** * Returns `true` if the option is an instance of `Some`, `false` otherwise. @@ -8566,11 +10903,10 @@ var function_1 = __nccwpck_require__(6985); * assert.strictEqual(isSome(some(1)), true) * assert.strictEqual(isSome(none), false) * - * @category guards + * @category refinements * @since 2.0.0 */ -var isSome = function (fa) { return fa._tag === 'Some'; }; -exports.isSome = isSome; +exports.isSome = _.isSome; /** * Returns `true` if the option is `None`, `false` otherwise. * @@ -8580,29 +10916,179 @@ exports.isSome = isSome; * assert.strictEqual(isNone(some(1)), false) * assert.strictEqual(isNone(none), true) * - * @category guards + * @category refinements * @since 2.0.0 */ var isNone = function (fa) { return fa._tag === 'None'; }; exports.isNone = isNone; // ------------------------------------------------------------------------------------- -// constructors +// destructors // ------------------------------------------------------------------------------------- /** - * `None` doesn't have a constructor, instead you can use it directly as a value. Represents a missing value. + * Less strict version of [`match`](#match). * - * @category constructors + * @category destructors + * @since 2.10.0 + */ +var matchW = function (onNone, onSome) { return function (ma) { + return exports.isNone(ma) ? onNone() : onSome(ma.value); +}; }; +exports.matchW = matchW; +/** + * Alias of [`matchW`](#matchw). + * + * @category destructors + * @since 2.10.0 + */ +exports.foldW = exports.matchW; +/** + * Takes a (lazy) default value, a function, and an `Option` value, if the `Option` value is `None` the default value is + * returned, otherwise the function is applied to the value inside the `Some` and the result is returned. + * + * @example + * import { some, none, match } from 'fp-ts/Option' + * import { pipe } from 'fp-ts/function' + * + * assert.strictEqual( + * pipe( + * some(1), + * match(() => 'a none', a => `a some containing ${a}`) + * ), + * 'a some containing 1' + * ) + * + * assert.strictEqual( + * pipe( + * none, + * match(() => 'a none', a => `a some containing ${a}`) + * ), + * 'a none' + * ) + * + * @category destructors + * @since 2.10.0 + */ +exports.match = exports.matchW; +/** + * Alias of [`match`](#match). + * + * @category destructors * @since 2.0.0 */ -exports.none = { _tag: 'None' }; +exports.fold = exports.match; /** - * Constructs a `Some`. Represents an optional value that exists. + * Less strict version of [`getOrElse`](#getorelse). * - * @category constructors + * @category destructors + * @since 2.6.0 + */ +var getOrElseW = function (onNone) { return function (ma) { return (exports.isNone(ma) ? onNone() : ma.value); }; }; +exports.getOrElseW = getOrElseW; +/** + * Extracts the value out of the structure, if it exists. Otherwise returns the given default value + * + * @example + * import { some, none, getOrElse } from 'fp-ts/Option' + * import { pipe } from 'fp-ts/function' + * + * assert.strictEqual( + * pipe( + * some(1), + * getOrElse(() => 0) + * ), + * 1 + * ) + * assert.strictEqual( + * pipe( + * none, + * getOrElse(() => 0) + * ), + * 0 + * ) + * + * @category destructors * @since 2.0.0 */ -var some = function (a) { return ({ _tag: 'Some', value: a }); }; -exports.some = some; +exports.getOrElse = exports.getOrElseW; +// ------------------------------------------------------------------------------------- +// combinators +// ------------------------------------------------------------------------------------- +/** + * Derivable from `Functor`. + * + * @category combinators + * @since 2.10.0 + */ +exports.flap = +/*#__PURE__*/ +Functor_1.flap(exports.Functor); +/** + * Combine two effectful actions, keeping only the result of the first. + * + * Derivable from `Apply`. + * + * @category combinators + * @since 2.0.0 + */ +exports.apFirst = +/*#__PURE__*/ +Apply_1.apFirst(exports.Apply); +/** + * Combine two effectful actions, keeping only the result of the second. + * + * Derivable from `Apply`. + * + * @category combinators + * @since 2.0.0 + */ +exports.apSecond = +/*#__PURE__*/ +Apply_1.apSecond(exports.Apply); +/** + * Derivable from `Chain`. + * + * @category combinators + * @since 2.0.0 + */ +exports.flatten = exports.compact; +/** + * Composes computations in sequence, using the return value of one computation to determine the next computation and + * keeping only the result of the first. + * + * Derivable from `Chain`. + * + * @category combinators + * @since 2.0.0 + */ +exports.chainFirst = +/*#__PURE__*/ +Chain_1.chainFirst(exports.Chain); +/** + * Derivable from `Extend`. + * + * @category combinators + * @since 2.0.0 + */ +exports.duplicate = +/*#__PURE__*/ +exports.extend(function_1.identity); +/** + * @category combinators + * @since 2.11.0 + */ +exports.fromEitherK = +/*#__PURE__*/ +FromEither_1.fromEitherK(exports.FromEither); +/** + * @category combinators + * @since 2.11.0 + */ +exports.chainEitherK = +/*#__PURE__*/ +FromEither_1.chainEitherK(exports.FromEither, exports.Chain); +// ------------------------------------------------------------------------------------- +// interop +// ------------------------------------------------------------------------------------- /** * Constructs a new `Option` from a nullable type. If the value is `null` or `undefined`, returns `None`, otherwise * returns the value wrapped in a `Some`. @@ -8614,21 +11100,17 @@ exports.some = some; * assert.deepStrictEqual(fromNullable(null), none) * assert.deepStrictEqual(fromNullable(1), some(1)) * - * @category constructors + * @category interop * @since 2.0.0 */ -function fromNullable(a) { - return a == null ? exports.none : exports.some(a); -} +var fromNullable = function (a) { return (a == null ? exports.none : exports.some(a)); }; exports.fromNullable = fromNullable; -function fromPredicate(predicate) { - return function (a) { return (predicate(a) ? exports.some(a) : exports.none); }; -} -exports.fromPredicate = fromPredicate; /** * Transforms an exception into an `Option`. If `f` throws, returns `None`, otherwise returns the output wrapped in a * `Some`. * + * See also [`tryCatchK`](#trycatchk). + * * @example * import { none, some, tryCatch } from 'fp-ts/Option' * @@ -8640,97 +11122,101 @@ exports.fromPredicate = fromPredicate; * ) * assert.deepStrictEqual(tryCatch(() => 1), some(1)) * - * @category constructors + * @category interop * @since 2.0.0 */ -function tryCatch(f) { +var tryCatch = function (f) { try { return exports.some(f()); } catch (e) { return exports.none; } -} +}; exports.tryCatch = tryCatch; /** - * Returns the `Left` value of an `Either` if possible. - * - * @example - * import { getLeft, none, some } from 'fp-ts/Option' - * import { right, left } from 'fp-ts/Either' - * - * assert.deepStrictEqual(getLeft(right(1)), none) - * assert.deepStrictEqual(getLeft(left('a')), some('a')) + * Converts a function that may throw to one returning a `Option`. * - * @category constructors - * @since 2.0.0 + * @category interop + * @since 2.10.0 */ -function getLeft(ma) { - return ma._tag === 'Right' ? exports.none : exports.some(ma.left); -} -exports.getLeft = getLeft; +var tryCatchK = function (f) { return function () { + var a = []; + for (var _i = 0; _i < arguments.length; _i++) { + a[_i] = arguments[_i]; + } + return exports.tryCatch(function () { return f.apply(void 0, a); }); +}; }; +exports.tryCatchK = tryCatchK; /** - * Returns the `Right` value of an `Either` if possible. + * Returns a *smart constructor* from a function that returns a nullable value. * * @example - * import { getRight, none, some } from 'fp-ts/Option' - * import { right, left } from 'fp-ts/Either' - * - * assert.deepStrictEqual(getRight(right(1)), some(1)) - * assert.deepStrictEqual(getRight(left('a')), none) + * import { fromNullableK, none, some } from 'fp-ts/Option' * - * @category constructors - * @since 2.0.0 - */ -function getRight(ma) { - return ma._tag === 'Left' ? exports.none : exports.some(ma.right); -} -exports.getRight = getRight; -/** - * Transforms an `Either` to an `Option` discarding the error. + * const f = (s: string): number | undefined => { + * const n = parseFloat(s) + * return isNaN(n) ? undefined : n + * } * - * Alias of [getRight](#getRight) + * const g = fromNullableK(f) * - * Derivable from `MonadThrow`. + * assert.deepStrictEqual(g('1'), some(1)) + * assert.deepStrictEqual(g('a'), none) * - * @category constructors - * @since 2.0.0 + * @category interop + * @since 2.9.0 */ -exports.fromEither = getRight; -// ------------------------------------------------------------------------------------- -// destructors -// ------------------------------------------------------------------------------------- +var fromNullableK = function (f) { return function_1.flow(f, exports.fromNullable); }; +exports.fromNullableK = fromNullableK; /** - * Takes a (lazy) default value, a function, and an `Option` value, if the `Option` value is `None` the default value is - * returned, otherwise the function is applied to the value inside the `Some` and the result is returned. + * This is `chain` + `fromNullable`, useful when working with optional values. + * + * @example + * import { some, none, fromNullable, chainNullableK } from 'fp-ts/Option' + * import { pipe } from 'fp-ts/function' + * + * interface Employee { + * readonly company?: { + * readonly address?: { + * readonly street?: { + * readonly name?: string + * } + * } + * } + * } * - * @example - * import { some, none, fold } from 'fp-ts/Option' - * import { pipe } from 'fp-ts/function' + * const employee1: Employee = { company: { address: { street: { name: 'high street' } } } } * - * assert.strictEqual( + * assert.deepStrictEqual( * pipe( - * some(1), - * fold(() => 'a none', a => `a some containing ${a}`) + * fromNullable(employee1.company), + * chainNullableK(company => company.address), + * chainNullableK(address => address.street), + * chainNullableK(street => street.name) * ), - * 'a some containing 1' + * some('high street') * ) * - * assert.strictEqual( + * const employee2: Employee = { company: { address: { street: {} } } } + * + * assert.deepStrictEqual( * pipe( - * none, - * fold(() => 'a none', a => `a some containing ${a}`) + * fromNullable(employee2.company), + * chainNullableK(company => company.address), + * chainNullableK(address => address.street), + * chainNullableK(street => street.name) * ), - * 'a none' + * none * ) * - * @category destructors - * @since 2.0.0 + * @category interop + * @since 2.9.0 */ -function fold(onNone, onSome) { - return function (ma) { return (exports.isNone(ma) ? onNone() : onSome(ma.value)); }; -} -exports.fold = fold; +var chainNullableK = function (f) { return function (ma) { + return exports.isNone(ma) ? exports.none : exports.fromNullable(f(ma.value)); +}; }; +exports.chainNullableK = chainNullableK; /** * Extracts the value out of the structure, if it exists. Otherwise returns `null`. * @@ -8753,13 +11239,12 @@ exports.fold = fold; * null * ) * - * @category destructors + * @category interop * @since 2.0.0 */ -function toNullable(ma) { - return exports.isNone(ma) ? null : ma.value; -} -exports.toNullable = toNullable; +exports.toNullable = +/*#__PURE__*/ +exports.match(function_1.constNull, function_1.identity); /** * Extracts the value out of the structure, if it exists. Otherwise returns `undefined`. * @@ -8782,2633 +11267,2385 @@ exports.toNullable = toNullable; * undefined * ) * - * @category destructors + * @category interop * @since 2.0.0 */ -function toUndefined(ma) { - return exports.isNone(ma) ? undefined : ma.value; -} -exports.toUndefined = toUndefined; +exports.toUndefined = +/*#__PURE__*/ +exports.match(function_1.constUndefined, function_1.identity); +// ------------------------------------------------------------------------------------- +// utils +// ------------------------------------------------------------------------------------- /** - * Less strict version of [`getOrElse`](#getOrElse). + * Returns `true` if `ma` contains `a` * - * @category destructors - * @since 2.6.0 + * @example + * import { some, none, elem } from 'fp-ts/Option' + * import * as N from 'fp-ts/number' + * + * assert.strictEqual(elem(N.Eq)(1, some(1)), true) + * assert.strictEqual(elem(N.Eq)(2, some(1)), false) + * assert.strictEqual(elem(N.Eq)(1, none), false) + * + * @since 2.0.0 */ -var getOrElseW = function (onNone) { return function (ma) { return (exports.isNone(ma) ? onNone() : ma.value); }; }; -exports.getOrElseW = getOrElseW; +function elem(E) { + return function (a, ma) { return (exports.isNone(ma) ? false : E.equals(a, ma.value)); }; +} +exports.elem = elem; /** - * Extracts the value out of the structure, if it exists. Otherwise returns the given default value + * Returns `true` if the predicate is satisfied by the wrapped value * * @example - * import { some, none, getOrElse } from 'fp-ts/Option' + * import { some, none, exists } from 'fp-ts/Option' * import { pipe } from 'fp-ts/function' * * assert.strictEqual( * pipe( * some(1), - * getOrElse(() => 0) + * exists(n => n > 0) * ), - * 1 + * true + * ) + * assert.strictEqual( + * pipe( + * some(1), + * exists(n => n > 1) + * ), + * false * ) * assert.strictEqual( * pipe( * none, - * getOrElse(() => 0) + * exists(n => n > 0) * ), - * 0 + * false * ) * - * @category destructors * @since 2.0.0 */ -exports.getOrElse = exports.getOrElseW; +var exists = function (predicate) { return function (ma) { + return exports.isNone(ma) ? false : predicate(ma.value); +}; }; +exports.exists = exists; // ------------------------------------------------------------------------------------- -// combinators +// do notation // ------------------------------------------------------------------------------------- /** - * Returns a *smart constructor* from a function that returns a nullable value. - * - * @example - * import { fromNullableK, none, some } from 'fp-ts/Option' - * - * const f = (s: string): number | undefined => { - * const n = parseFloat(s) - * return isNaN(n) ? undefined : n - * } - * - * const g = fromNullableK(f) + * @since 2.9.0 + */ +exports.Do = +/*#__PURE__*/ +exports.of(_.emptyRecord); +/** + * @since 2.8.0 + */ +exports.bindTo = +/*#__PURE__*/ +Functor_1.bindTo(exports.Functor); +/** + * @since 2.8.0 + */ +exports.bind = +/*#__PURE__*/ +Chain_1.bind(exports.Chain); +// ------------------------------------------------------------------------------------- +// pipeable sequence S +// ------------------------------------------------------------------------------------- +/** + * @since 2.8.0 + */ +exports.apS = +/*#__PURE__*/ +Apply_1.apS(exports.Apply); +// ------------------------------------------------------------------------------------- +// sequence T +// ------------------------------------------------------------------------------------- +/** + * @since 2.11.0 + */ +exports.ApT = +/*#__PURE__*/ +exports.of(_.emptyReadonlyArray); +// ------------------------------------------------------------------------------------- +// array utils +// ------------------------------------------------------------------------------------- +/** + * Equivalent to `ReadonlyNonEmptyArray#traverseWithIndex(Applicative)`. * - * assert.deepStrictEqual(g('1'), some(1)) - * assert.deepStrictEqual(g('a'), none) + * @since 2.11.0 + */ +var traverseReadonlyNonEmptyArrayWithIndex = function (f) { return function (as) { + var o = f(0, _.head(as)); + if (exports.isNone(o)) { + return exports.none; + } + var out = [o.value]; + for (var i = 1; i < as.length; i++) { + var o_1 = f(i, as[i]); + if (exports.isNone(o_1)) { + return exports.none; + } + out.push(o_1.value); + } + return exports.some(out); +}; }; +exports.traverseReadonlyNonEmptyArrayWithIndex = traverseReadonlyNonEmptyArrayWithIndex; +/** + * Equivalent to `ReadonlyArray#traverseWithIndex(Applicative)`. * - * @category combinators + * @since 2.11.0 + */ +var traverseReadonlyArrayWithIndex = function (f) { + var g = exports.traverseReadonlyNonEmptyArrayWithIndex(f); + return function (as) { return (_.isNonEmpty(as) ? g(as) : exports.ApT); }; +}; +exports.traverseReadonlyArrayWithIndex = traverseReadonlyArrayWithIndex; +/** * @since 2.9.0 */ -function fromNullableK(f) { - return function () { - var a = []; - for (var _i = 0; _i < arguments.length; _i++) { - a[_i] = arguments[_i]; - } - return fromNullable(f.apply(void 0, a)); - }; +exports.traverseArrayWithIndex = exports.traverseReadonlyArrayWithIndex; +/** + * @since 2.9.0 + */ +var traverseArray = function (f) { + return exports.traverseReadonlyArrayWithIndex(function (_, a) { return f(a); }); +}; +exports.traverseArray = traverseArray; +/** + * @since 2.9.0 + */ +exports.sequenceArray = +/*#__PURE__*/ +exports.traverseArray(function_1.identity); +// ------------------------------------------------------------------------------------- +// deprecated +// ------------------------------------------------------------------------------------- +// tslint:disable: deprecation +/** + * Use `Refinement` module instead. + * + * @since 2.0.0 + * @deprecated + */ +function getRefinement(getOption) { + return function (a) { return exports.isSome(getOption(a)); }; } -exports.fromNullableK = fromNullableK; +exports.getRefinement = getRefinement; /** + * Use [`chainNullableK`](#chainnullablek) instead. + * * @category combinators * @since 2.0.0 * @deprecated */ -exports.mapNullable = chainNullableK; +exports.mapNullable = exports.chainNullableK; /** - * This is `chain` + `fromNullable`, useful when working with optional values. + * Use small, specific instances instead. * - * @example - * import { some, none, fromNullable, chainNullableK } from 'fp-ts/Option' - * import { pipe } from 'fp-ts/function' + * @category instances + * @since 2.0.0 + * @deprecated + */ +exports.option = { + URI: exports.URI, + map: _map, + of: exports.of, + ap: _ap, + chain: _chain, + reduce: _reduce, + foldMap: _foldMap, + reduceRight: _reduceRight, + traverse: _traverse, + sequence: exports.sequence, + zero: exports.zero, + alt: _alt, + extend: _extend, + compact: exports.compact, + separate: exports.separate, + filter: _filter, + filterMap: _filterMap, + partition: _partition, + partitionMap: _partitionMap, + wither: _wither, + wilt: _wilt, + throwError: exports.throwError +}; +/** + * Use [`getApplySemigroup`](./Apply.ts.html#getapplysemigroup) instead. * - * interface Employee { - * company?: { - * address?: { - * street?: { - * name?: string - * } - * } - * } - * } + * @category instances + * @since 2.0.0 + * @deprecated + */ +exports.getApplySemigroup = +/*#__PURE__*/ +Apply_1.getApplySemigroup(exports.Apply); +/** + * Use [`getApplicativeMonoid`](./Applicative.ts.html#getapplicativemonoid) instead. * - * const employee1: Employee = { company: { address: { street: { name: 'high street' } } } } + * @category instances + * @since 2.0.0 + * @deprecated + */ +exports.getApplyMonoid = +/*#__PURE__*/ +Applicative_1.getApplicativeMonoid(exports.Applicative); +/** + * Use * - * assert.deepStrictEqual( - * pipe( - * fromNullable(employee1.company), - * chainNullableK(company => company.address), - * chainNullableK(address => address.street), - * chainNullableK(street => street.name) - * ), - * some('high street') - * ) + * ```ts + * import { first } from 'fp-ts/Semigroup' + * import { getMonoid } from 'fp-ts/Option' * - * const employee2: Employee = { company: { address: { street: {} } } } + * getMonoid(first()) + * ``` * - * assert.deepStrictEqual( - * pipe( - * fromNullable(employee2.company), - * chainNullableK(company => company.address), - * chainNullableK(address => address.street), - * chainNullableK(street => street.name) - * ), - * none - * ) + * instead. * - * @category combinators - * @since 2.9.0 - */ -function chainNullableK(f) { - return function (ma) { return (exports.isNone(ma) ? exports.none : fromNullable(f(ma.value))); }; -} -exports.chainNullableK = chainNullableK; -// ------------------------------------------------------------------------------------- -// non-pipeables -// ------------------------------------------------------------------------------------- -var map_ = function (fa, f) { return function_1.pipe(fa, exports.map(f)); }; -var ap_ = function (fab, fa) { return function_1.pipe(fab, exports.ap(fa)); }; -var chain_ = function (ma, f) { return function_1.pipe(ma, exports.chain(f)); }; -var reduce_ = function (fa, b, f) { return function_1.pipe(fa, exports.reduce(b, f)); }; -var foldMap_ = function (M) { - var foldMapM = exports.foldMap(M); - return function (fa, f) { return function_1.pipe(fa, foldMapM(f)); }; -}; -var reduceRight_ = function (fa, b, f) { return function_1.pipe(fa, exports.reduceRight(b, f)); }; -var traverse_ = function (F) { - var traverseF = exports.traverse(F); - return function (ta, f) { return function_1.pipe(ta, traverseF(f)); }; -}; -/* istanbul ignore next */ -var alt_ = function (fa, that) { return function_1.pipe(fa, exports.alt(that)); }; -var filter_ = function (fa, predicate) { - return function_1.pipe(fa, exports.filter(predicate)); -}; -/* istanbul ignore next */ -var filterMap_ = function (fa, f) { return function_1.pipe(fa, exports.filterMap(f)); }; -/* istanbul ignore next */ -var extend_ = function (wa, f) { return function_1.pipe(wa, exports.extend(f)); }; -/* istanbul ignore next */ -var partition_ = function (fa, predicate) { return function_1.pipe(fa, exports.partition(predicate)); }; -/* istanbul ignore next */ -var partitionMap_ = function (fa, f) { return function_1.pipe(fa, exports.partitionMap(f)); }; -/* istanbul ignore next */ -var wither_ = function (F) { - var witherF = exports.wither(F); - return function (fa, f) { return function_1.pipe(fa, witherF(f)); }; -}; -/* istanbul ignore next */ -var wilt_ = function (F) { - var wiltF = exports.wilt(F); - return function (fa, f) { return function_1.pipe(fa, wiltF(f)); }; -}; -// ------------------------------------------------------------------------------------- -// pipeables -// ------------------------------------------------------------------------------------- -/** - * `map` can be used to turn functions `(a: A) => B` into functions `(fa: F) => F` whose argument and return types - * use the type constructor `F` to represent some computational context. + * Monoid returning the left-most non-`None` value + * + * | x | y | concat(x, y) | + * | ------- | ------- | ------------ | + * | none | none | none | + * | some(a) | none | some(a) | + * | none | some(b) | some(b) | + * | some(a) | some(b) | some(a) | * - * @category Functor - * @since 2.0.0 - */ -var map = function (f) { return function (fa) { - return exports.isNone(fa) ? exports.none : exports.some(f(fa.value)); -}; }; -exports.map = map; -/** - * Apply a function to an argument under a type constructor. + * @example + * import { getFirstMonoid, some, none } from 'fp-ts/Option' * - * @category Apply + * const M = getFirstMonoid() + * assert.deepStrictEqual(M.concat(none, none), none) + * assert.deepStrictEqual(M.concat(some(1), none), some(1)) + * assert.deepStrictEqual(M.concat(none, some(2)), some(2)) + * assert.deepStrictEqual(M.concat(some(1), some(2)), some(1)) + * + * @category instances * @since 2.0.0 + * @deprecated */ -var ap = function (fa) { return function (fab) { - return exports.isNone(fab) ? exports.none : exports.isNone(fa) ? exports.none : exports.some(fab.value(fa.value)); -}; }; -exports.ap = ap; +var getFirstMonoid = function () { return exports.getMonoid(Semigroup_1.first()); }; +exports.getFirstMonoid = getFirstMonoid; /** - * Combine two effectful actions, keeping only the result of the first. + * Use * - * Derivable from `Apply`. + * ```ts + * import { last } from 'fp-ts/Semigroup' + * import { getMonoid } from 'fp-ts/Option' * - * @category combinators - * @since 2.0.0 - */ -var apFirst = function (fb) { - return function_1.flow(exports.map(function (a) { return function () { return a; }; }), exports.ap(fb)); -}; -exports.apFirst = apFirst; -/** - * Combine two effectful actions, keeping only the result of the second. + * getMonoid(last()) + * ``` * - * Derivable from `Apply`. + * instead. * - * @category combinators + * Monoid returning the right-most non-`None` value + * + * | x | y | concat(x, y) | + * | ------- | ------- | ------------ | + * | none | none | none | + * | some(a) | none | some(a) | + * | none | some(b) | some(b) | + * | some(a) | some(b) | some(b) | + * + * @example + * import { getLastMonoid, some, none } from 'fp-ts/Option' + * + * const M = getLastMonoid() + * assert.deepStrictEqual(M.concat(none, none), none) + * assert.deepStrictEqual(M.concat(some(1), none), some(1)) + * assert.deepStrictEqual(M.concat(none, some(2)), some(2)) + * assert.deepStrictEqual(M.concat(some(1), some(2)), some(2)) + * + * @category instances * @since 2.0.0 + * @deprecated */ -var apSecond = function (fb) { - return function_1.flow(exports.map(function () { return function (b) { return b; }; }), exports.ap(fb)); -}; -exports.apSecond = apSecond; +var getLastMonoid = function () { return exports.getMonoid(Semigroup_1.last()); }; +exports.getLastMonoid = getLastMonoid; + + +/***/ }), + +/***/ 6685: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ordDate = exports.ordNumber = exports.ordString = exports.ordBoolean = exports.ord = exports.getDualOrd = exports.getTupleOrd = exports.between = exports.clamp = exports.max = exports.min = exports.geq = exports.leq = exports.gt = exports.lt = exports.equals = exports.trivial = exports.Contravariant = exports.getMonoid = exports.getSemigroup = exports.URI = exports.contramap = exports.reverse = exports.tuple = exports.fromCompare = exports.equalsDefault = void 0; +var Eq_1 = __nccwpck_require__(6964); +var function_1 = __nccwpck_require__(6985); +// ------------------------------------------------------------------------------------- +// defaults +// ------------------------------------------------------------------------------------- /** - * Wrap a value into the type constructor. - * - * @category Applicative - * @since 2.7.0 + * @category defaults + * @since 2.10.0 */ -exports.of = exports.some; +var equalsDefault = function (compare) { return function (first, second) { + return first === second || compare(first, second) === 0; +}; }; +exports.equalsDefault = equalsDefault; +// ------------------------------------------------------------------------------------- +// constructors +// ------------------------------------------------------------------------------------- /** - * Composes computations in sequence, using the return value of one computation to determine the next computation. - * - * @category Monad + * @category constructors * @since 2.0.0 */ -var chain = function (f) { return function (ma) { - return exports.isNone(ma) ? exports.none : f(ma.value); -}; }; -exports.chain = chain; +var fromCompare = function (compare) { return ({ + equals: exports.equalsDefault(compare), + compare: function (first, second) { return (first === second ? 0 : compare(first, second)); } +}); }; +exports.fromCompare = fromCompare; +// ------------------------------------------------------------------------------------- +// combinators +// ------------------------------------------------------------------------------------- /** - * Composes computations in sequence, using the return value of one computation to determine the next computation and - * keeping only the result of the first. + * Given a tuple of `Ord`s returns an `Ord` for the tuple. + * + * @example + * import { tuple } from 'fp-ts/Ord' + * import * as B from 'fp-ts/boolean' + * import * as S from 'fp-ts/string' + * import * as N from 'fp-ts/number' * - * Derivable from `Monad`. + * const O = tuple(S.Ord, N.Ord, B.Ord) + * assert.strictEqual(O.compare(['a', 1, true], ['b', 2, true]), -1) + * assert.strictEqual(O.compare(['a', 1, true], ['a', 2, true]), -1) + * assert.strictEqual(O.compare(['a', 1, true], ['a', 1, false]), 1) * * @category combinators - * @since 2.0.0 + * @since 2.10.0 */ -var chainFirst = function (f) { - return exports.chain(function (a) { - return function_1.pipe(f(a), exports.map(function () { return a; })); +var tuple = function () { + var ords = []; + for (var _i = 0; _i < arguments.length; _i++) { + ords[_i] = arguments[_i]; + } + return exports.fromCompare(function (first, second) { + var i = 0; + for (; i < ords.length - 1; i++) { + var r = ords[i].compare(first[i], second[i]); + if (r !== 0) { + return r; + } + } + return ords[i].compare(first[i], second[i]); }); }; -exports.chainFirst = chainFirst; +exports.tuple = tuple; /** - * Derivable from `Monad`. - * * @category combinators - * @since 2.0.0 + * @since 2.10.0 */ -exports.flatten = -/*#__PURE__*/ -exports.chain(function_1.identity); +var reverse = function (O) { return exports.fromCompare(function (first, second) { return O.compare(second, first); }); }; +exports.reverse = reverse; +// ------------------------------------------------------------------------------------- +// non-pipeables +// ------------------------------------------------------------------------------------- +/* istanbul ignore next */ +var contramap_ = function (fa, f) { return function_1.pipe(fa, exports.contramap(f)); }; +// ------------------------------------------------------------------------------------- +// type class members +// ------------------------------------------------------------------------------------- /** - * Less strict version of [`alt`](#alt). - * - * @category Alt - * @since 2.9.0 + * @category Contravariant + * @since 2.0.0 */ -var altW = function (that) { return function (fa) { - return exports.isNone(fa) ? that() : fa; +var contramap = function (f) { return function (fa) { + return exports.fromCompare(function (first, second) { return fa.compare(f(first), f(second)); }); }; }; -exports.altW = altW; +exports.contramap = contramap; +// ------------------------------------------------------------------------------------- +// instances +// ------------------------------------------------------------------------------------- /** - * Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to - * types of kind `* -> *`. + * @category instances + * @since 2.0.0 + */ +exports.URI = 'Ord'; +/** + * @category instances + * @since 2.0.0 + */ +var getSemigroup = function () { return ({ + concat: function (first, second) { + return exports.fromCompare(function (a, b) { + var ox = first.compare(a, b); + return ox !== 0 ? ox : second.compare(a, b); + }); + } +}); }; +exports.getSemigroup = getSemigroup; +/** + * Returns a `Monoid` such that: * - * In case of `Option` returns the left-most non-`None` value. + * - its `concat(ord1, ord2)` operation will order first by `ord1`, and then by `ord2` + * - its `empty` value is an `Ord` that always considers compared elements equal * * @example - * import * as O from 'fp-ts/Option' + * import { sort } from 'fp-ts/Array' + * import { contramap, reverse, getMonoid } from 'fp-ts/Ord' + * import * as S from 'fp-ts/string' + * import * as B from 'fp-ts/boolean' * import { pipe } from 'fp-ts/function' + * import { concatAll } from 'fp-ts/Monoid' + * import * as N from 'fp-ts/number' * - * assert.deepStrictEqual( - * pipe( - * O.some('a'), - * O.alt(() => O.some('b')) - * ), - * O.some('a') + * interface User { + * readonly id: number + * readonly name: string + * readonly age: number + * readonly rememberMe: boolean + * } + * + * const byName = pipe( + * S.Ord, + * contramap((p: User) => p.name) * ) - * assert.deepStrictEqual( - * pipe( - * O.none, - * O.alt(() => O.some('b')) - * ), - * O.some('b') + * + * const byAge = pipe( + * N.Ord, + * contramap((p: User) => p.age) * ) * - * @category Alt - * @since 2.0.0 - */ -exports.alt = exports.altW; -/** - * @category Alternative - * @since 2.7.0 + * const byRememberMe = pipe( + * B.Ord, + * contramap((p: User) => p.rememberMe) + * ) + * + * const M = getMonoid() + * + * const users: Array = [ + * { id: 1, name: 'Guido', age: 47, rememberMe: false }, + * { id: 2, name: 'Guido', age: 46, rememberMe: true }, + * { id: 3, name: 'Giulio', age: 44, rememberMe: false }, + * { id: 4, name: 'Giulio', age: 44, rememberMe: true } + * ] + * + * // sort by name, then by age, then by `rememberMe` + * const O1 = concatAll(M)([byName, byAge, byRememberMe]) + * assert.deepStrictEqual(sort(O1)(users), [ + * { id: 3, name: 'Giulio', age: 44, rememberMe: false }, + * { id: 4, name: 'Giulio', age: 44, rememberMe: true }, + * { id: 2, name: 'Guido', age: 46, rememberMe: true }, + * { id: 1, name: 'Guido', age: 47, rememberMe: false } + * ]) + * + * // now `rememberMe = true` first, then by name, then by age + * const O2 = concatAll(M)([reverse(byRememberMe), byName, byAge]) + * assert.deepStrictEqual(sort(O2)(users), [ + * { id: 4, name: 'Giulio', age: 44, rememberMe: true }, + * { id: 2, name: 'Guido', age: 46, rememberMe: true }, + * { id: 3, name: 'Giulio', age: 44, rememberMe: false }, + * { id: 1, name: 'Guido', age: 47, rememberMe: false } + * ]) + * + * @category instances + * @since 2.4.0 */ -var zero = function () { return exports.none; }; -exports.zero = zero; +var getMonoid = function () { return ({ + concat: exports.getSemigroup().concat, + empty: exports.fromCompare(function () { return 0; }) +}); }; +exports.getMonoid = getMonoid; /** - * @category MonadThrow + * @category instances * @since 2.7.0 */ -var throwError = function () { return exports.none; }; -exports.throwError = throwError; -/** - * @category Extend - * @since 2.0.0 - */ -var extend = function (f) { return function (wa) { - return exports.isNone(wa) ? exports.none : exports.some(f(wa)); -}; }; -exports.extend = extend; -/** - * Derivable from `Extend`. - * - * @category combinators - * @since 2.0.0 - */ -exports.duplicate = -/*#__PURE__*/ -exports.extend(function_1.identity); +exports.Contravariant = { + URI: exports.URI, + contramap: contramap_ +}; +// ------------------------------------------------------------------------------------- +// utils +// ------------------------------------------------------------------------------------- /** - * @category Foldable - * @since 2.0.0 + * @since 2.11.0 */ -var reduce = function (b, f) { return function (fa) { - return exports.isNone(fa) ? b : f(b, fa.value); -}; }; -exports.reduce = reduce; +exports.trivial = { + equals: function_1.constTrue, + compare: + /*#__PURE__*/ + function_1.constant(0) +}; /** - * @category Foldable - * @since 2.0.0 + * @since 2.11.0 */ -var foldMap = function (M) { return function (f) { return function (fa) { - return exports.isNone(fa) ? M.empty : f(fa.value); +var equals = function (O) { return function (second) { return function (first) { + return first === second || O.compare(first, second) === 0; }; }; }; -exports.foldMap = foldMap; +exports.equals = equals; +// TODO: curry in v3 /** - * @category Foldable + * Test whether one value is _strictly less than_ another + * * @since 2.0.0 */ -var reduceRight = function (b, f) { return function (fa) { - return exports.isNone(fa) ? b : f(fa.value, b); -}; }; -exports.reduceRight = reduceRight; +var lt = function (O) { return function (first, second) { return O.compare(first, second) === -1; }; }; +exports.lt = lt; +// TODO: curry in v3 /** - * @category Compactable + * Test whether one value is _strictly greater than_ another + * * @since 2.0.0 */ -exports.compact = exports.flatten; -var defaultSeparate = { left: exports.none, right: exports.none }; +var gt = function (O) { return function (first, second) { return O.compare(first, second) === 1; }; }; +exports.gt = gt; +// TODO: curry in v3 /** - * @category Compactable + * Test whether one value is _non-strictly less than_ another + * * @since 2.0.0 */ -var separate = function (ma) { - var o = function_1.pipe(ma, exports.map(function (e) { return ({ - left: getLeft(e), - right: getRight(e) - }); })); - return exports.isNone(o) ? defaultSeparate : o.value; -}; -exports.separate = separate; +var leq = function (O) { return function (first, second) { return O.compare(first, second) !== 1; }; }; +exports.leq = leq; +// TODO: curry in v3 /** - * @category Filterable + * Test whether one value is _non-strictly greater than_ another + * * @since 2.0.0 */ -var filter = function (predicate) { return function (fa) { return (exports.isNone(fa) ? exports.none : predicate(fa.value) ? fa : exports.none); }; }; -exports.filter = filter; +var geq = function (O) { return function (first, second) { return O.compare(first, second) !== -1; }; }; +exports.geq = geq; +// TODO: curry in v3 /** - * @category Filterable + * Take the minimum of two values. If they are considered equal, the first argument is chosen + * * @since 2.0.0 */ -var filterMap = function (f) { return function (fa) { - return exports.isNone(fa) ? exports.none : f(fa.value); +var min = function (O) { return function (first, second) { + return first === second || O.compare(first, second) < 1 ? first : second; }; }; -exports.filterMap = filterMap; +exports.min = min; +// TODO: curry in v3 /** - * @category Filterable + * Take the maximum of two values. If they are considered equal, the first argument is chosen + * * @since 2.0.0 */ -var partition = function (predicate) { return function (fa) { - return { - left: filter_(fa, function (a) { return !predicate(a); }), - right: filter_(fa, predicate) - }; +var max = function (O) { return function (first, second) { + return first === second || O.compare(first, second) > -1 ? first : second; }; }; -exports.partition = partition; +exports.max = max; /** - * @category Filterable + * Clamp a value between a minimum and a maximum + * * @since 2.0.0 */ -var partitionMap = function (f) { return function_1.flow(exports.map(f), exports.separate); }; -exports.partitionMap = partitionMap; -/** - * @category Traversable - * @since 2.6.3 - */ -var traverse = function (F) { return function (f) { return function (ta) { return (exports.isNone(ta) ? F.of(exports.none) : F.map(f(ta.value), exports.some)); }; }; }; -exports.traverse = traverse; -/** - * @category Traversable - * @since 2.6.3 - */ -var sequence = function (F) { return function (ta) { return (exports.isNone(ta) ? F.of(exports.none) : F.map(ta.value, exports.some)); }; }; -exports.sequence = sequence; -/** - * @category Witherable - * @since 2.6.5 - */ -var wither = function (F) { return function (f) { return function (fa) { return (exports.isNone(fa) ? F.of(exports.none) : f(fa.value)); }; }; }; -exports.wither = wither; +var clamp = function (O) { + var minO = exports.min(O); + var maxO = exports.max(O); + return function (low, hi) { return function (a) { return maxO(minO(a, hi), low); }; }; +}; +exports.clamp = clamp; /** - * @category Witherable - * @since 2.6.5 + * Test whether a value is between a minimum and a maximum (inclusive) + * + * @since 2.0.0 */ -var wilt = function (F) { return function (f) { return function (fa) { - return exports.isNone(fa) - ? F.of({ - left: exports.none, - right: exports.none - }) - : F.map(f(fa.value), function (e) { return ({ - left: getLeft(e), - right: getRight(e) - }); }); -}; }; }; -exports.wilt = wilt; +var between = function (O) { + var ltO = exports.lt(O); + var gtO = exports.gt(O); + return function (low, hi) { return function (a) { return (ltO(a, low) || gtO(a, hi) ? false : true); }; }; +}; +exports.between = between; // ------------------------------------------------------------------------------------- -// instances +// deprecated // ------------------------------------------------------------------------------------- +// tslint:disable: deprecation /** - * @category instances - * @since 2.0.0 - */ -exports.URI = 'Option'; -/** - * @category instances - * @since 2.0.0 - */ -function getShow(S) { - return { - show: function (ma) { return (exports.isNone(ma) ? 'none' : "some(" + S.show(ma.value) + ")"); } - }; -} -exports.getShow = getShow; -/** - * @example - * import { none, some, getEq } from 'fp-ts/Option' - * import { eqNumber } from 'fp-ts/Eq' - * - * const E = getEq(eqNumber) - * assert.strictEqual(E.equals(none, none), true) - * assert.strictEqual(E.equals(none, some(1)), false) - * assert.strictEqual(E.equals(some(1), none), false) - * assert.strictEqual(E.equals(some(1), some(2)), false) - * assert.strictEqual(E.equals(some(1), some(1)), true) + * Use [`tuple`](#tuple) instead. * - * @category instances + * @category combinators * @since 2.0.0 + * @deprecated */ -function getEq(E) { - return { - equals: function (x, y) { return x === y || (exports.isNone(x) ? exports.isNone(y) : exports.isNone(y) ? false : E.equals(x.value, y.value)); } - }; -} -exports.getEq = getEq; +exports.getTupleOrd = exports.tuple; /** - * The `Ord` instance allows `Option` values to be compared with - * `compare`, whenever there is an `Ord` instance for - * the type the `Option` contains. - * - * `None` is considered to be less than any `Some` value. - * - * - * @example - * import { none, some, getOrd } from 'fp-ts/Option' - * import { ordNumber } from 'fp-ts/Ord' - * - * const O = getOrd(ordNumber) - * assert.strictEqual(O.compare(none, none), 0) - * assert.strictEqual(O.compare(none, some(1)), -1) - * assert.strictEqual(O.compare(some(1), none), 1) - * assert.strictEqual(O.compare(some(1), some(2)), -1) - * assert.strictEqual(O.compare(some(1), some(1)), 0) + * Use [`reverse`](#reverse) instead. * - * @category instances + * @category combinators * @since 2.0.0 + * @deprecated */ -function getOrd(O) { - return { - equals: getEq(O).equals, - compare: function (x, y) { return (x === y ? 0 : exports.isSome(x) ? (exports.isSome(y) ? O.compare(x.value, y.value) : 1) : -1); } - }; -} -exports.getOrd = getOrd; +exports.getDualOrd = exports.reverse; /** - * `Apply` semigroup - * - * | x | y | concat(x, y) | - * | ------- | ------- | ------------------ | - * | none | none | none | - * | some(a) | none | none | - * | none | some(a) | none | - * | some(a) | some(b) | some(concat(a, b)) | - * - * @example - * import { getApplySemigroup, some, none } from 'fp-ts/Option' - * import { semigroupSum } from 'fp-ts/Semigroup' - * - * const S = getApplySemigroup(semigroupSum) - * assert.deepStrictEqual(S.concat(none, none), none) - * assert.deepStrictEqual(S.concat(some(1), none), none) - * assert.deepStrictEqual(S.concat(none, some(1)), none) - * assert.deepStrictEqual(S.concat(some(1), some(2)), some(3)) + * Use [`Contravariant`](#contravariant) instead. * * @category instances * @since 2.0.0 + * @deprecated */ -function getApplySemigroup(S) { - return { - concat: function (x, y) { return (exports.isSome(x) && exports.isSome(y) ? exports.some(S.concat(x.value, y.value)) : exports.none); } - }; +exports.ord = exports.Contravariant; +// default compare for primitive types +function compare(first, second) { + return first < second ? -1 : first > second ? 1 : 0; } -exports.getApplySemigroup = getApplySemigroup; +var strictOrd = { + equals: Eq_1.eqStrict.equals, + compare: compare +}; /** + * Use [`Ord`](./boolean.ts.html#ord) instead. + * * @category instances * @since 2.0.0 + * @deprecated */ -function getApplyMonoid(M) { - return { - concat: getApplySemigroup(M).concat, - empty: exports.some(M.empty) - }; -} -exports.getApplyMonoid = getApplyMonoid; +exports.ordBoolean = strictOrd; /** - * Monoid returning the left-most non-`None` value - * - * | x | y | concat(x, y) | - * | ------- | ------- | ------------ | - * | none | none | none | - * | some(a) | none | some(a) | - * | none | some(a) | some(a) | - * | some(a) | some(b) | some(a) | - * - * @example - * import { getFirstMonoid, some, none } from 'fp-ts/Option' - * - * const M = getFirstMonoid() - * assert.deepStrictEqual(M.concat(none, none), none) - * assert.deepStrictEqual(M.concat(some(1), none), some(1)) - * assert.deepStrictEqual(M.concat(none, some(1)), some(1)) - * assert.deepStrictEqual(M.concat(some(1), some(2)), some(1)) + * Use [`Ord`](./string.ts.html#ord) instead. * * @category instances * @since 2.0.0 + * @deprecated */ -function getFirstMonoid() { - return { - concat: function (x, y) { return (exports.isNone(x) ? y : x); }, - empty: exports.none - }; -} -exports.getFirstMonoid = getFirstMonoid; +exports.ordString = strictOrd; /** - * Monoid returning the right-most non-`None` value - * - * | x | y | concat(x, y) | - * | ------- | ------- | ------------ | - * | none | none | none | - * | some(a) | none | some(a) | - * | none | some(a) | some(a) | - * | some(a) | some(b) | some(b) | - * - * @example - * import { getLastMonoid, some, none } from 'fp-ts/Option' - * - * const M = getLastMonoid() - * assert.deepStrictEqual(M.concat(none, none), none) - * assert.deepStrictEqual(M.concat(some(1), none), some(1)) - * assert.deepStrictEqual(M.concat(none, some(1)), some(1)) - * assert.deepStrictEqual(M.concat(some(1), some(2)), some(2)) + * Use [`Ord`](./number.ts.html#ord) instead. * * @category instances * @since 2.0.0 + * @deprecated */ -function getLastMonoid() { - return { - concat: function (x, y) { return (exports.isNone(y) ? x : y); }, - empty: exports.none - }; -} -exports.getLastMonoid = getLastMonoid; +exports.ordNumber = strictOrd; /** - * Monoid returning the left-most non-`None` value. If both operands are `Some`s then the inner values are - * concatenated using the provided `Semigroup` - * - * | x | y | concat(x, y) | - * | ------- | ------- | ------------------ | - * | none | none | none | - * | some(a) | none | some(a) | - * | none | some(a) | some(a) | - * | some(a) | some(b) | some(concat(a, b)) | - * - * @example - * import { getMonoid, some, none } from 'fp-ts/Option' - * import { semigroupSum } from 'fp-ts/Semigroup' - * - * const M = getMonoid(semigroupSum) - * assert.deepStrictEqual(M.concat(none, none), none) - * assert.deepStrictEqual(M.concat(some(1), none), some(1)) - * assert.deepStrictEqual(M.concat(none, some(1)), some(1)) - * assert.deepStrictEqual(M.concat(some(1), some(2)), some(3)) + * Use [`Ord`](./Date.ts.html#ord) instead. * * @category instances * @since 2.0.0 + * @deprecated */ -function getMonoid(S) { - return { - concat: function (x, y) { return (exports.isNone(x) ? y : exports.isNone(y) ? x : exports.some(S.concat(x.value, y.value))); }, - empty: exports.none - }; -} -exports.getMonoid = getMonoid; -/** - * @category instances - * @since 2.7.0 - */ -exports.Functor = { - URI: exports.URI, - map: map_ -}; -/** - * @category instances - * @since 2.7.0 - */ -exports.Applicative = { - URI: exports.URI, - map: map_, - ap: ap_, - of: exports.of -}; -/** - * @category instances - * @since 2.7.0 - */ -exports.Monad = { - URI: exports.URI, - map: map_, - ap: ap_, - of: exports.of, - chain: chain_ -}; +exports.ordDate = +/*#__PURE__*/ +function_1.pipe(exports.ordNumber, +/*#__PURE__*/ +exports.contramap(function (date) { return date.valueOf(); })); + + +/***/ }), + +/***/ 6382: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.and = exports.or = exports.not = exports.Contravariant = exports.getMonoidAll = exports.getSemigroupAll = exports.getMonoidAny = exports.getSemigroupAny = exports.URI = exports.contramap = void 0; +var function_1 = __nccwpck_require__(6985); +// ------------------------------------------------------------------------------------- +// type class members +// ------------------------------------------------------------------------------------- +var contramap_ = function (predicate, f) { return function_1.pipe(predicate, exports.contramap(f)); }; /** - * @category instances - * @since 2.7.0 + * @category Contravariant + * @since 2.11.0 */ -exports.Foldable = { - URI: exports.URI, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_ -}; +var contramap = function (f) { return function (predicate) { return function_1.flow(f, predicate); }; }; +exports.contramap = contramap; +// ------------------------------------------------------------------------------------- +// instances +// ------------------------------------------------------------------------------------- /** * @category instances - * @since 2.7.0 + * @since 2.11.0 */ -exports.Alt = { - URI: exports.URI, - map: map_, - alt: alt_ -}; +exports.URI = 'Predicate'; /** * @category instances - * @since 2.7.0 + * @since 2.11.0 */ -exports.Alternative = { - URI: exports.URI, - map: map_, - ap: ap_, - of: exports.of, - alt: alt_, - zero: exports.zero -}; +var getSemigroupAny = function () { return ({ + concat: function (first, second) { return function_1.pipe(first, exports.or(second)); } +}); }; +exports.getSemigroupAny = getSemigroupAny; /** * @category instances - * @since 2.7.0 + * @since 2.11.0 */ -exports.Extend = { - URI: exports.URI, - map: map_, - extend: extend_ -}; +var getMonoidAny = function () { return ({ + concat: exports.getSemigroupAny().concat, + empty: function_1.constFalse +}); }; +exports.getMonoidAny = getMonoidAny; /** * @category instances - * @since 2.7.0 + * @since 2.11.0 */ -exports.Compactable = { - URI: exports.URI, - compact: exports.compact, - separate: exports.separate -}; +var getSemigroupAll = function () { return ({ + concat: function (first, second) { return function_1.pipe(first, exports.and(second)); } +}); }; +exports.getSemigroupAll = getSemigroupAll; /** * @category instances - * @since 2.7.0 + * @since 2.11.0 */ -exports.Filterable = { - URI: exports.URI, - map: map_, - compact: exports.compact, - separate: exports.separate, - filter: filter_, - filterMap: filterMap_, - partition: partition_, - partitionMap: partitionMap_ -}; +var getMonoidAll = function () { return ({ + concat: exports.getSemigroupAll().concat, + empty: function_1.constTrue +}); }; +exports.getMonoidAll = getMonoidAll; /** * @category instances - * @since 2.7.0 + * @since 2.11.0 */ -exports.Traversable = { +exports.Contravariant = { URI: exports.URI, - map: map_, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - traverse: traverse_, - sequence: exports.sequence + contramap: contramap_ }; +// ------------------------------------------------------------------------------------- +// utils +// ------------------------------------------------------------------------------------- /** - * @category instances - * @since 2.7.0 + * @since 2.11.0 */ -exports.Witherable = { - URI: exports.URI, - map: map_, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - traverse: traverse_, - sequence: exports.sequence, - compact: exports.compact, - separate: exports.separate, - filter: filter_, - filterMap: filterMap_, - partition: partition_, - partitionMap: partitionMap_, - wither: wither_, - wilt: wilt_ -}; +var not = function (predicate) { return function (a) { return !predicate(a); }; }; +exports.not = not; /** - * @category instances - * @since 2.7.0 + * @since 2.11.0 */ -exports.MonadThrow = { - URI: exports.URI, - map: map_, - ap: ap_, - of: exports.of, - chain: chain_, - throwError: exports.throwError -}; -// TODO: remove in v3 +var or = function (second) { return function (first) { return function (a) { return first(a) || second(a); }; }; }; +exports.or = or; /** - * @category instances - * @since 2.0.0 + * @since 2.11.0 */ -exports.option = { - URI: exports.URI, - map: map_, - of: exports.of, - ap: ap_, - chain: chain_, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - traverse: traverse_, - sequence: exports.sequence, - zero: exports.zero, - alt: alt_, - extend: extend_, - compact: exports.compact, - separate: exports.separate, - filter: filter_, - filterMap: filterMap_, - partition: partition_, - partitionMap: partitionMap_, - wither: wither_, - wilt: wilt_, - throwError: exports.throwError +var and = function (second) { return function (first) { return function (a) { return first(a) && second(a); }; }; }; +exports.and = and; + + +/***/ }), + +/***/ 4234: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __spreadArray = (this && this.__spreadArray) || function (to, from) { + for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) + to[j] = from[i]; + return to; }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.sort = exports.lefts = exports.rights = exports.reverse = exports.modifyAt = exports.deleteAt = exports.updateAt = exports.insertAt = exports.findLastIndex = exports.findLastMap = exports.findLast = exports.findFirstMap = exports.findFirst = exports.findIndex = exports.dropLeftWhile = exports.dropRight = exports.dropLeft = exports.spanLeft = exports.takeLeftWhile = exports.takeRight = exports.takeLeft = exports.init = exports.tail = exports.last = exports.head = exports.lookup = exports.isOutOfBound = exports.size = exports.scanRight = exports.scanLeft = exports.chainWithIndex = exports.foldRight = exports.matchRight = exports.matchRightW = exports.foldLeft = exports.matchLeft = exports.matchLeftW = exports.match = exports.matchW = exports.fromEither = exports.fromOption = exports.fromPredicate = exports.replicate = exports.makeBy = exports.appendW = exports.append = exports.prependW = exports.prepend = exports.isNonEmpty = exports.isEmpty = void 0; +exports.sequence = exports.traverse = exports.reduceRightWithIndex = exports.reduceRight = exports.reduceWithIndex = exports.foldMap = exports.reduce = exports.foldMapWithIndex = exports.duplicate = exports.extend = exports.filterWithIndex = exports.partitionMapWithIndex = exports.partitionMap = exports.partitionWithIndex = exports.partition = exports.compact = exports.filterMap = exports.filterMapWithIndex = exports.filter = exports.separate = exports.mapWithIndex = exports.map = exports.flatten = exports.chain = exports.ap = exports.alt = exports.altW = exports.zero = exports.of = exports._chainRecBreadthFirst = exports._chainRecDepthFirst = exports.difference = exports.intersection = exports.union = exports.concat = exports.concatW = exports.comprehension = exports.fromOptionK = exports.chunksOf = exports.splitAt = exports.chop = exports.sortBy = exports.uniq = exports.elem = exports.rotate = exports.intersperse = exports.prependAll = exports.unzip = exports.zip = exports.zipWith = void 0; +exports.toArray = exports.unsafeDeleteAt = exports.unsafeUpdateAt = exports.unsafeInsertAt = exports.fromEitherK = exports.FromEither = exports.filterE = exports.Witherable = exports.ChainRecBreadthFirst = exports.chainRecBreadthFirst = exports.ChainRecDepthFirst = exports.chainRecDepthFirst = exports.TraversableWithIndex = exports.Traversable = exports.FoldableWithIndex = exports.Foldable = exports.FilterableWithIndex = exports.Filterable = exports.Compactable = exports.Extend = exports.Alternative = exports.guard = exports.Zero = exports.Alt = exports.Unfoldable = exports.chainFirst = exports.Monad = exports.Chain = exports.Applicative = exports.apSecond = exports.apFirst = exports.Apply = exports.FunctorWithIndex = exports.Pointed = exports.flap = exports.Functor = exports.getDifferenceMagma = exports.getIntersectionSemigroup = exports.getUnionMonoid = exports.getUnionSemigroup = exports.getOrd = exports.getEq = exports.getMonoid = exports.getSemigroup = exports.getShow = exports.URI = exports.unfold = exports.wilt = exports.wither = exports.traverseWithIndex = void 0; +exports.readonlyArray = exports.prependToAll = exports.snoc = exports.cons = exports.range = exports.apS = exports.bind = exports.bindTo = exports.Do = exports.exists = exports.some = exports.every = exports.empty = exports.fromArray = void 0; +var Apply_1 = __nccwpck_require__(205); +var Chain_1 = __nccwpck_require__(2372); +var Eq_1 = __nccwpck_require__(6964); +var FromEither_1 = __nccwpck_require__(1964); +var function_1 = __nccwpck_require__(6985); +var Functor_1 = __nccwpck_require__(5533); +var _ = __importStar(__nccwpck_require__(1840)); +var N = __importStar(__nccwpck_require__(52)); +var Ord_1 = __nccwpck_require__(6685); +var RNEA = __importStar(__nccwpck_require__(8630)); +var Separated_1 = __nccwpck_require__(5877); +var Witherable_1 = __nccwpck_require__(4384); +var Zero_1 = __nccwpck_require__(9734); // ------------------------------------------------------------------------------------- -// utils +// refinements // ------------------------------------------------------------------------------------- /** - * Returns `true` if `ma` contains `a` + * Test whether a `ReadonlyArray` is empty. * * @example - * import { some, none, elem } from 'fp-ts/Option' - * import { eqNumber } from 'fp-ts/Eq' + * import { isEmpty } from 'fp-ts/ReadonlyArray' * - * assert.strictEqual(elem(eqNumber)(1, some(1)), true) - * assert.strictEqual(elem(eqNumber)(2, some(1)), false) - * assert.strictEqual(elem(eqNumber)(1, none), false) + * assert.strictEqual(isEmpty([]), true) * - * @since 2.0.0 + * @category refinements + * @since 2.5.0 */ -function elem(E) { - return function (a, ma) { return (exports.isNone(ma) ? false : E.equals(a, ma.value)); }; -} -exports.elem = elem; +var isEmpty = function (as) { return as.length === 0; }; +exports.isEmpty = isEmpty; /** - * Returns `true` if the predicate is satisfied by the wrapped value + * Test whether a `ReadonlyArray` is non empty. + * + * @category refinements + * @since 2.5.0 + */ +exports.isNonEmpty = RNEA.isNonEmpty; +// ------------------------------------------------------------------------------------- +// constructors +// ------------------------------------------------------------------------------------- +/** + * Prepend an element to the front of a `ReadonlyArray`, creating a new `ReadonlyNonEmptyArray`. * * @example - * import { some, none, exists } from 'fp-ts/Option' + * import { prepend } from 'fp-ts/ReadonlyArray' * import { pipe } from 'fp-ts/function' * - * assert.strictEqual( - * pipe( - * some(1), - * exists(n => n > 0) - * ), - * true - * ) - * assert.strictEqual( - * pipe( - * some(1), - * exists(n => n > 1) - * ), - * false - * ) - * assert.strictEqual( - * pipe( - * none, - * exists(n => n > 0) - * ), - * false - * ) + * assert.deepStrictEqual(pipe([2, 3, 4], prepend(1)), [1, 2, 3, 4]) * - * @since 2.0.0 + * @category constructors + * @since 2.10.0 */ -function exists(predicate) { - return function (ma) { return (exports.isNone(ma) ? false : predicate(ma.value)); }; -} -exports.exists = exists; +exports.prepend = RNEA.prepend; /** - * Returns a `Refinement` (i.e. a custom type guard) from a `Option` returning function. - * This function ensures that a custom type guard definition is type-safe. + * Less strict version of [`prepend`](#prepend). * - * ```ts - * import { some, none, getRefinement } from 'fp-ts/Option' + * @category constructors + * @since 2.11.0 + */ +exports.prependW = RNEA.prependW; +/** + * Append an element to the end of a `ReadonlyArray`, creating a new `ReadonlyNonEmptyArray`. * - * type A = { type: 'A' } - * type B = { type: 'B' } - * type C = A | B + * @example + * import { append } from 'fp-ts/ReadonlyArray' + * import { pipe } from 'fp-ts/function' * - * const isA = (c: C): c is A => c.type === 'B' // <= typo but typescript doesn't complain - * const isA = getRefinement(c => (c.type === 'B' ? some(c) : none)) // static error: Type '"B"' is not assignable to type '"A"' - * ``` + * assert.deepStrictEqual(pipe([1, 2, 3], append(4)), [1, 2, 3, 4]) * - * @since 2.0.0 - */ -function getRefinement(getOption) { - return function (a) { return exports.isSome(getOption(a)); }; -} -exports.getRefinement = getRefinement; -// ------------------------------------------------------------------------------------- -// do notation -// ------------------------------------------------------------------------------------- -/** - * @since 2.9.0 - */ -exports.Do = -/*#__PURE__*/ -exports.of({}); -/** - * @since 2.8.0 - */ -var bindTo = function (name) { return exports.map(function_1.bindTo_(name)); }; -exports.bindTo = bindTo; -/** - * @since 2.8.0 - */ -var bind = function (name, f) { - return exports.chain(function (a) { - return function_1.pipe(f(a), exports.map(function (b) { return function_1.bind_(a, name, b); })); - }); -}; -exports.bind = bind; -// ------------------------------------------------------------------------------------- -// pipeable sequence S -// ------------------------------------------------------------------------------------- -/** - * @since 2.8.0 + * @category constructors + * @since 2.10.0 */ -var apS = function (name, fb) { - return function_1.flow(exports.map(function (a) { return function (b) { return function_1.bind_(a, name, b); }; }), exports.ap(fb)); -}; -exports.apS = apS; -// ------------------------------------------------------------------------------------- -// array utils -// ------------------------------------------------------------------------------------- +exports.append = RNEA.append; /** + * Less strict version of [`append`](#append). * - * @since 2.9.0 + * @category constructors + * @since 2.11.0 */ -var traverseArrayWithIndex = function (f) { return function (arr) { - // tslint:disable-next-line: readonly-array - var result = []; - for (var i = 0; i < arr.length; i++) { - var b = f(i, arr[i]); - if (exports.isNone(b)) { - return exports.none; - } - result.push(b.value); - } - return exports.some(result); -}; }; -exports.traverseArrayWithIndex = traverseArrayWithIndex; +exports.appendW = RNEA.appendW; /** - * Runs an action for every element in array and accumulates the results in option + * Return a `ReadonlyArray` of length `n` with element `i` initialized with `f(i)`. * - * this function has the same behavior of `A.sequence(O.option)` but it's optimized and performs better + * **Note**. `n` is normalized to a non negative integer. * * @example + * import { makeBy } from 'fp-ts/ReadonlyArray' * - * import * as A from 'fp-ts/Array' - * import { traverseArray, some, fromPredicate, none } from 'fp-ts/Option' - * import { pipe } from 'fp-ts/function' - * - * const arr = A.range(0, 10) - * assert.deepStrictEqual(pipe(arr, traverseArray(some)), some(arr)) - * assert.deepStrictEqual(pipe(arr, traverseArray(fromPredicate((x) => x > 5))), none) + * const double = (n: number): number => n * 2 + * assert.deepStrictEqual(makeBy(5, double), [0, 2, 4, 6, 8]) * - * @since 2.9.0 + * @category constructors + * @since 2.5.0 */ -var traverseArray = function (f) { return exports.traverseArrayWithIndex(function (_, a) { return f(a); }); }; -exports.traverseArray = traverseArray; +var makeBy = function (n, f) { return (n <= 0 ? exports.empty : RNEA.makeBy(f)(n)); }; +exports.makeBy = makeBy; /** - * get an array of option and convert it to option of array + * Create a `ReadonlyArray` containing a value repeated the specified number of times. * - * this function has the same behavior of `A.sequence(O.option)` but it's optimized and performs better + * **Note**. `n` is normalized to a non negative integer. * * @example + * import { replicate } from 'fp-ts/ReadonlyArray' * - * import * as A from 'fp-ts/Array' - * import { sequenceArray, some, none, fromPredicate } from 'fp-ts/Option' - * import { pipe } from 'fp-ts/function' - * - * const arr = A.range(0, 10) - * assert.deepStrictEqual(pipe(arr, A.map(some), sequenceArray), some(arr)) - * assert.deepStrictEqual(pipe(arr, A.map(fromPredicate(x => x > 8)), sequenceArray), none) + * assert.deepStrictEqual(replicate(3, 'a'), ['a', 'a', 'a']) * - * @since 2.9.0 + * @category constructors + * @since 2.5.0 */ -exports.sequenceArray = -/*#__PURE__*/ -exports.traverseArray(function_1.identity); - - -/***/ }), - -/***/ 6685: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ord = exports.Contravariant = exports.ordDate = exports.URI = exports.contramap = exports.getDualOrd = exports.getTupleOrd = exports.getMonoid = exports.getSemigroup = exports.fromCompare = exports.between = exports.clamp = exports.max = exports.min = exports.geq = exports.leq = exports.gt = exports.lt = exports.ordBoolean = exports.ordNumber = exports.ordString = void 0; -var Ordering_1 = __nccwpck_require__(4397); -var function_1 = __nccwpck_require__(6985); -// default compare for primitive types -function compare(x, y) { - return x < y ? -1 : x > y ? 1 : 0; -} -function strictEqual(a, b) { - return a === b; +var replicate = function (n, a) { return exports.makeBy(n, function () { return a; }); }; +exports.replicate = replicate; +function fromPredicate(predicate) { + return function (a) { return (predicate(a) ? [a] : exports.empty); }; } +exports.fromPredicate = fromPredicate; +// ------------------------------------------------------------------------------------- +// natural transformations +// ------------------------------------------------------------------------------------- /** - * @category instances - * @since 2.0.0 - */ -exports.ordString = { - equals: strictEqual, - compare: compare -}; -/** - * @category instances - * @since 2.0.0 - */ -exports.ordNumber = { - equals: strictEqual, - compare: compare -}; -/** - * @category instances - * @since 2.0.0 + * @category natural transformations + * @since 2.11.0 */ -exports.ordBoolean = { - equals: strictEqual, - compare: compare -}; -// TODO: curry in v3 +var fromOption = function (ma) { return (_.isNone(ma) ? exports.empty : [ma.value]); }; +exports.fromOption = fromOption; /** - * Test whether one value is _strictly less than_ another + * Transforms an `Either` to a `ReadonlyArray`. * - * @since 2.0.0 + * @category natural transformations + * @since 2.11.0 */ -function lt(O) { - return function (x, y) { return O.compare(x, y) === -1; }; -} -exports.lt = lt; -// TODO: curry in v3 +var fromEither = function (e) { return (_.isLeft(e) ? exports.empty : [e.right]); }; +exports.fromEither = fromEither; +// ------------------------------------------------------------------------------------- +// destructors +// ------------------------------------------------------------------------------------- /** - * Test whether one value is _strictly greater than_ another + * Less strict version of [`match`](#match). * - * @since 2.0.0 + * @category destructors + * @since 2.11.0 */ -function gt(O) { - return function (x, y) { return O.compare(x, y) === 1; }; -} -exports.gt = gt; -// TODO: curry in v3 +var matchW = function (onEmpty, onNonEmpty) { return function (as) { return (exports.isNonEmpty(as) ? onNonEmpty(as) : onEmpty()); }; }; +exports.matchW = matchW; /** - * Test whether one value is _non-strictly less than_ another - * - * @since 2.0.0 + * @category destructors + * @since 2.11.0 */ -function leq(O) { - return function (x, y) { return O.compare(x, y) !== 1; }; -} -exports.leq = leq; -// TODO: curry in v3 +exports.match = exports.matchW; /** - * Test whether one value is _non-strictly greater than_ another + * Less strict version of [`matchLeft`](#matchleft). * - * @since 2.0.0 + * @category destructors + * @since 2.11.0 */ -function geq(O) { - return function (x, y) { return O.compare(x, y) !== -1; }; -} -exports.geq = geq; -// TODO: curry in v3 +var matchLeftW = function (onEmpty, onNonEmpty) { return function (as) { return (exports.isNonEmpty(as) ? onNonEmpty(RNEA.head(as), RNEA.tail(as)) : onEmpty()); }; }; +exports.matchLeftW = matchLeftW; /** - * Take the minimum of two values. If they are considered equal, the first argument is chosen + * Break a `ReadonlyArray` into its first element and remaining elements. * - * @since 2.0.0 + * @example + * import { matchLeft } from 'fp-ts/ReadonlyArray' + * + * const len: (as: ReadonlyArray) => number = matchLeft(() => 0, (_, tail) => 1 + len(tail)) + * assert.strictEqual(len([1, 2, 3]), 3) + * + * @category destructors + * @since 2.10.0 */ -function min(O) { - return function (x, y) { return (O.compare(x, y) === 1 ? y : x); }; -} -exports.min = min; -// TODO: curry in v3 +exports.matchLeft = exports.matchLeftW; /** - * Take the maximum of two values. If they are considered equal, the first argument is chosen + * Alias of [`matchLeft`](#matchleft). * - * @since 2.0.0 + * @category destructors + * @since 2.5.0 */ -function max(O) { - return function (x, y) { return (O.compare(x, y) === -1 ? y : x); }; -} -exports.max = max; +exports.foldLeft = exports.matchLeft; /** - * Clamp a value between a minimum and a maximum + * Less strict version of [`matchRight`](#matchright). * - * @since 2.0.0 + * @category destructors + * @since 2.11.0 */ -function clamp(O) { - var minO = min(O); - var maxO = max(O); - return function (low, hi) { return function (x) { return maxO(minO(x, hi), low); }; }; -} -exports.clamp = clamp; +var matchRightW = function (onEmpty, onNonEmpty) { return function (as) { return (exports.isNonEmpty(as) ? onNonEmpty(RNEA.init(as), RNEA.last(as)) : onEmpty()); }; }; +exports.matchRightW = matchRightW; /** - * Test whether a value is between a minimum and a maximum (inclusive) + * Break a `ReadonlyArray` into its initial elements and the last element. * - * @since 2.0.0 + * @category destructors + * @since 2.10.0 */ -function between(O) { - var lessThanO = lt(O); - var greaterThanO = gt(O); - return function (low, hi) { return function (x) { return (lessThanO(x, low) || greaterThanO(x, hi) ? false : true); }; }; -} -exports.between = between; +exports.matchRight = exports.matchRightW; /** - * @category constructors - * @since 2.0.0 + * Alias of [`matchRight`](#matchright). + * + * @category destructors + * @since 2.5.0 */ -function fromCompare(compare) { - var optimizedCompare = function (x, y) { return (x === y ? 0 : compare(x, y)); }; - return { - equals: function (x, y) { return optimizedCompare(x, y) === 0; }, - compare: optimizedCompare - }; -} -exports.fromCompare = fromCompare; +exports.foldRight = exports.matchRight; +// ------------------------------------------------------------------------------------- +// combinators +// ------------------------------------------------------------------------------------- /** - * Use `getMonoid` instead - * - * @category instances - * @since 2.0.0 - * @deprecated + * @category combinators + * @since 2.7.0 */ -function getSemigroup() { - return { - concat: function (x, y) { return fromCompare(function (a, b) { return Ordering_1.monoidOrdering.concat(x.compare(a, b), y.compare(a, b)); }); } - }; -} -exports.getSemigroup = getSemigroup; +var chainWithIndex = function (f) { return function (as) { + if (exports.isEmpty(as)) { + return exports.empty; + } + var out = []; + for (var i = 0; i < as.length; i++) { + out.push.apply(out, f(i, as[i])); + } + return out; +}; }; +exports.chainWithIndex = chainWithIndex; /** - * Returns a `Monoid` such that: - * - * - its `concat(ord1, ord2)` operation will order first by `ord1`, and then by `ord2` - * - its `empty` value is an `Ord` that always considers compared elements equal + * Same as `reduce` but it carries over the intermediate steps. * * @example - * import { sort } from 'fp-ts/Array' - * import { contramap, getDualOrd, getMonoid, ordBoolean, ordNumber, ordString } from 'fp-ts/Ord' - * import { pipe } from 'fp-ts/function' - * import { fold } from 'fp-ts/Monoid' - * - * interface User { - * id: number - * name: string - * age: number - * rememberMe: boolean - * } - * - * const byName = pipe( - * ordString, - * contramap((p: User) => p.name) - * ) - * - * const byAge = pipe( - * ordNumber, - * contramap((p: User) => p.age) - * ) - * - * const byRememberMe = pipe( - * ordBoolean, - * contramap((p: User) => p.rememberMe) - * ) - * - * const M = getMonoid() - * - * const users: Array = [ - * { id: 1, name: 'Guido', age: 47, rememberMe: false }, - * { id: 2, name: 'Guido', age: 46, rememberMe: true }, - * { id: 3, name: 'Giulio', age: 44, rememberMe: false }, - * { id: 4, name: 'Giulio', age: 44, rememberMe: true } - * ] - * - * // sort by name, then by age, then by `rememberMe` - * const O1 = fold(M)([byName, byAge, byRememberMe]) - * assert.deepStrictEqual(sort(O1)(users), [ - * { id: 3, name: 'Giulio', age: 44, rememberMe: false }, - * { id: 4, name: 'Giulio', age: 44, rememberMe: true }, - * { id: 2, name: 'Guido', age: 46, rememberMe: true }, - * { id: 1, name: 'Guido', age: 47, rememberMe: false } - * ]) + * import { scanLeft } from 'fp-ts/ReadonlyArray' * - * // now `rememberMe = true` first, then by name, then by age - * const O2 = fold(M)([getDualOrd(byRememberMe), byName, byAge]) - * assert.deepStrictEqual(sort(O2)(users), [ - * { id: 4, name: 'Giulio', age: 44, rememberMe: true }, - * { id: 2, name: 'Guido', age: 46, rememberMe: true }, - * { id: 3, name: 'Giulio', age: 44, rememberMe: false }, - * { id: 1, name: 'Guido', age: 47, rememberMe: false } - * ]) + * assert.deepStrictEqual(scanLeft(10, (b, a: number) => b - a)([1, 2, 3]), [10, 9, 7, 4]) * - * @category instances - * @since 2.4.0 + * @category combinators + * @since 2.5.0 */ -function getMonoid() { - return { - // tslint:disable-next-line: deprecation - concat: getSemigroup().concat, - empty: fromCompare(function () { return 0; }) - }; -} -exports.getMonoid = getMonoid; +var scanLeft = function (b, f) { return function (as) { + var len = as.length; + var out = new Array(len + 1); + out[0] = b; + for (var i = 0; i < len; i++) { + out[i + 1] = f(out[i], as[i]); + } + return out; +}; }; +exports.scanLeft = scanLeft; /** - * Given a tuple of `Ord`s returns an `Ord` for the tuple + * Fold an array from the right, keeping all intermediate results instead of only the final result * * @example - * import { getTupleOrd, ordString, ordNumber, ordBoolean } from 'fp-ts/Ord' + * import { scanRight } from 'fp-ts/ReadonlyArray' * - * const O = getTupleOrd(ordString, ordNumber, ordBoolean) - * assert.strictEqual(O.compare(['a', 1, true], ['b', 2, true]), -1) - * assert.strictEqual(O.compare(['a', 1, true], ['a', 2, true]), -1) - * assert.strictEqual(O.compare(['a', 1, true], ['a', 1, false]), 1) + * assert.deepStrictEqual(scanRight(10, (a: number, b) => b - a)([1, 2, 3]), [4, 5, 7, 10]) * - * @category instances - * @since 2.0.0 - */ -function getTupleOrd() { - var ords = []; - for (var _i = 0; _i < arguments.length; _i++) { - ords[_i] = arguments[_i]; - } - var len = ords.length; - return fromCompare(function (x, y) { - var i = 0; - for (; i < len - 1; i++) { - var r = ords[i].compare(x[i], y[i]); - if (r !== 0) { - return r; - } - } - return ords[i].compare(x[i], y[i]); - }); -} -exports.getTupleOrd = getTupleOrd; -/** * @category combinators - * @since 2.0.0 - */ -function getDualOrd(O) { - return fromCompare(function (x, y) { return O.compare(y, x); }); -} -exports.getDualOrd = getDualOrd; -// ------------------------------------------------------------------------------------- -// non-pipeables -// ------------------------------------------------------------------------------------- -/* istanbul ignore next */ -var contramap_ = function (fa, f) { return function_1.pipe(fa, exports.contramap(f)); }; -// ------------------------------------------------------------------------------------- -// pipeables -// ------------------------------------------------------------------------------------- -/** - * @category Contravariant - * @since 2.0.0 + * @since 2.5.0 */ -var contramap = function (f) { return function (fa) { - return fromCompare(function (x, y) { return fa.compare(f(x), f(y)); }); +var scanRight = function (b, f) { return function (as) { + var len = as.length; + var out = new Array(len + 1); + out[len] = b; + for (var i = len - 1; i >= 0; i--) { + out[i] = f(as[i], out[i + 1]); + } + return out; }; }; -exports.contramap = contramap; -// ------------------------------------------------------------------------------------- -// instances -// ------------------------------------------------------------------------------------- -/** - * @category instances - * @since 2.0.0 - */ -exports.URI = 'Ord'; +exports.scanRight = scanRight; /** - * @category instances - * @since 2.0.0 + * Calculate the number of elements in a `ReadonlyArray`. + * + * @since 2.10.0 */ -exports.ordDate = -/*#__PURE__*/ -function_1.pipe(exports.ordNumber, -/*#__PURE__*/ -exports.contramap(function (date) { return date.valueOf(); })); +var size = function (as) { return as.length; }; +exports.size = size; /** - * @category instances - * @since 2.7.0 + * Test whether an array contains a particular index + * + * @since 2.5.0 */ -exports.Contravariant = { - URI: exports.URI, - contramap: contramap_ -}; -// TODO: remove in v3 +exports.isOutOfBound = RNEA.isOutOfBound; +function lookup(i, as) { + return as === undefined ? function (as) { return lookup(i, as); } : exports.isOutOfBound(i, as) ? _.none : _.some(as[i]); +} +exports.lookup = lookup; /** - * @category instances - * @since 2.0.0 + * Get the first element in an array, or `None` if the array is empty + * + * @example + * import { head } from 'fp-ts/ReadonlyArray' + * import { some, none } from 'fp-ts/Option' + * + * assert.deepStrictEqual(head([1, 2, 3]), some(1)) + * assert.deepStrictEqual(head([]), none) + * + * @since 2.5.0 */ -exports.ord = exports.Contravariant; - - -/***/ }), - -/***/ 4397: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.invert = exports.monoidOrdering = exports.semigroupOrdering = exports.eqOrdering = exports.sign = void 0; +var head = function (as) { return (exports.isNonEmpty(as) ? _.some(RNEA.head(as)) : _.none); }; +exports.head = head; /** - * @since 2.0.0 + * Get the last element in an array, or `None` if the array is empty + * + * @example + * import { last } from 'fp-ts/ReadonlyArray' + * import { some, none } from 'fp-ts/Option' + * + * assert.deepStrictEqual(last([1, 2, 3]), some(3)) + * assert.deepStrictEqual(last([]), none) + * + * @since 2.5.0 */ -function sign(n) { - return n <= -1 ? -1 : n >= 1 ? 1 : 0; -} -exports.sign = sign; +var last = function (as) { return (exports.isNonEmpty(as) ? _.some(RNEA.last(as)) : _.none); }; +exports.last = last; /** - * @category instances - * @since 2.0.0 + * Get all but the first element of an array, creating a new array, or `None` if the array is empty + * + * @example + * import { tail } from 'fp-ts/ReadonlyArray' + * import { some, none } from 'fp-ts/Option' + * + * assert.deepStrictEqual(tail([1, 2, 3]), some([2, 3])) + * assert.deepStrictEqual(tail([]), none) + * + * @since 2.5.0 */ -exports.eqOrdering = { - equals: function (x, y) { return x === y; } +var tail = function (as) { + return exports.isNonEmpty(as) ? _.some(RNEA.tail(as)) : _.none; }; +exports.tail = tail; /** - * Use `monoidOrdering` instead + * Get all but the last element of an array, creating a new array, or `None` if the array is empty * - * @category instances - * @since 2.0.0 - * @deprecated + * @example + * import { init } from 'fp-ts/ReadonlyArray' + * import { some, none } from 'fp-ts/Option' + * + * assert.deepStrictEqual(init([1, 2, 3]), some([1, 2])) + * assert.deepStrictEqual(init([]), none) + * + * @since 2.5.0 */ -exports.semigroupOrdering = { - concat: function (x, y) { return (x !== 0 ? x : y); } +var init = function (as) { + return exports.isNonEmpty(as) ? _.some(RNEA.init(as)) : _.none; }; +exports.init = init; /** - * @category instances - * @since 2.4.0 + * Keep only a max number of elements from the start of an `ReadonlyArray`, creating a new `ReadonlyArray`. + * + * **Note**. `n` is normalized to a non negative integer. + * + * @example + * import * as RA from 'fp-ts/ReadonlyArray' + * import { pipe } from 'fp-ts/function' + * + * const input: ReadonlyArray = [1, 2, 3] + * assert.deepStrictEqual(pipe(input, RA.takeLeft(2)), [1, 2]) + * + * // out of bounds + * assert.strictEqual(pipe(input, RA.takeLeft(4)), input) + * assert.strictEqual(pipe(input, RA.takeLeft(-1)), input) + * + * @category combinators + * @since 2.5.0 */ -exports.monoidOrdering = { - // tslint:disable-next-line: deprecation - concat: exports.semigroupOrdering.concat, - empty: 0 -}; +var takeLeft = function (n) { return function (as) { + return exports.isOutOfBound(n, as) ? as : n === 0 ? exports.empty : as.slice(0, n); +}; }; +exports.takeLeft = takeLeft; /** - * @since 2.0.0 + * Keep only a max number of elements from the end of an `ReadonlyArray`, creating a new `ReadonlyArray`. + * + * **Note**. `n` is normalized to a non negative integer. + * + * @example + * import * as RA from 'fp-ts/ReadonlyArray' + * import { pipe } from 'fp-ts/function' + * + * const input: ReadonlyArray = [1, 2, 3] + * assert.deepStrictEqual(pipe(input, RA.takeRight(2)), [2, 3]) + * + * // out of bounds + * assert.strictEqual(pipe(input, RA.takeRight(4)), input) + * assert.strictEqual(pipe(input, RA.takeRight(-1)), input) + * + * @category combinators + * @since 2.5.0 */ -function invert(O) { - switch (O) { - case -1: - return 1; - case 1: - return -1; - default: - return 0; - } +var takeRight = function (n) { return function (as) { + return exports.isOutOfBound(n, as) ? as : n === 0 ? exports.empty : as.slice(-n); +}; }; +exports.takeRight = takeRight; +function takeLeftWhile(predicate) { + return function (as) { + var out = []; + for (var _i = 0, as_1 = as; _i < as_1.length; _i++) { + var a = as_1[_i]; + if (!predicate(a)) { + break; + } + out.push(a); + } + var len = out.length; + return len === as.length ? as : len === 0 ? exports.empty : out; + }; } -exports.invert = invert; - - -/***/ }), - -/***/ 4234: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; +exports.takeLeftWhile = takeLeftWhile; +var spanLeftIndex = function (as, predicate) { + var l = as.length; + var i = 0; + for (; i < l; i++) { + if (!predicate(as[i])) { + break; + } + } + return i; }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.intersperse = exports.prependToAll = exports.unzip = exports.zip = exports.zipWith = exports.sort = exports.lefts = exports.rights = exports.reverse = exports.modifyAt = exports.deleteAt = exports.updateAt = exports.insertAt = exports.findLastIndex = exports.findLastMap = exports.findLast = exports.findFirstMap = exports.findFirst = exports.findIndex = exports.dropLeftWhile = exports.dropRight = exports.dropLeft = exports.spanLeft = exports.takeLeftWhile = exports.takeRight = exports.takeLeft = exports.init = exports.tail = exports.last = exports.head = exports.snoc = exports.cons = exports.lookup = exports.isOutOfBound = exports.isNonEmpty = exports.isEmpty = exports.scanRight = exports.scanLeft = exports.foldRight = exports.foldLeft = exports.flatten = exports.replicate = exports.range = exports.makeBy = exports.getOrd = exports.getEq = exports.getMonoid = exports.getShow = exports.toArray = exports.fromArray = void 0; -exports.FunctorWithIndex = exports.Functor = exports.URI = exports.unfold = exports.wilt = exports.wither = exports.traverseWithIndex = exports.sequence = exports.traverse = exports.reduceRightWithIndex = exports.reduceRight = exports.reduceWithIndex = exports.foldMap = exports.reduce = exports.foldMapWithIndex = exports.duplicate = exports.extend = exports.filterWithIndex = exports.partitionMapWithIndex = exports.partitionMap = exports.partitionWithIndex = exports.partition = exports.compact = exports.filterMap = exports.filterMapWithIndex = exports.filter = exports.separate = exports.mapWithIndex = exports.map = exports.chainFirst = exports.chainWithIndex = exports.chain = exports.apSecond = exports.apFirst = exports.ap = exports.alt = exports.altW = exports.zero = exports.of = exports.difference = exports.intersection = exports.union = exports.comprehension = exports.chunksOf = exports.splitAt = exports.chop = exports.sortBy = exports.uniq = exports.elem = exports.rotate = void 0; -exports.apS = exports.bind = exports.bindTo = exports.Do = exports.some = exports.every = exports.empty = exports.unsafeDeleteAt = exports.unsafeUpdateAt = exports.unsafeInsertAt = exports.readonlyArray = exports.Witherable = exports.TraversableWithIndex = exports.Traversable = exports.FoldableWithIndex = exports.Foldable = exports.FilterableWithIndex = exports.Filterable = exports.Compactable = exports.Extend = exports.Alternative = exports.Alt = exports.Unfoldable = exports.Monad = exports.Applicative = void 0; -var function_1 = __nccwpck_require__(6985); -var O = __importStar(__nccwpck_require__(2569)); -var Ord_1 = __nccwpck_require__(6685); -// ------------------------------------------------------------------------------------- -// model -// ------------------------------------------------------------------------------------- +function spanLeft(predicate) { + return function (as) { + var _a = exports.splitAt(spanLeftIndex(as, predicate))(as), init = _a[0], rest = _a[1]; + return { init: init, rest: rest }; + }; +} +exports.spanLeft = spanLeft; /** - * @category constructors + * Drop a max number of elements from the start of an `ReadonlyArray`, creating a new `ReadonlyArray`. + * + * **Note**. `n` is normalized to a non negative integer. + * + * @example + * import * as RA from 'fp-ts/ReadonlyArray' + * import { pipe } from 'fp-ts/function' + * + * const input: ReadonlyArray = [1, 2, 3] + * assert.deepStrictEqual(pipe(input, RA.dropLeft(2)), [3]) + * assert.strictEqual(pipe(input, RA.dropLeft(0)), input) + * assert.strictEqual(pipe(input, RA.dropLeft(-1)), input) + * + * @category combinators * @since 2.5.0 */ -// tslint:disable-next-line: readonly-array -function fromArray(as) { - var l = as.length; - if (l === 0) { - return exports.empty; - } - var ras = Array(l); - for (var i = 0; i < l; i++) { - ras[i] = as[i]; - } - return ras; +var dropLeft = function (n) { return function (as) { + return n <= 0 || exports.isEmpty(as) ? as : n >= as.length ? exports.empty : as.slice(n, as.length); +}; }; +exports.dropLeft = dropLeft; +/** + * Drop a max number of elements from the end of an `ReadonlyArray`, creating a new `ReadonlyArray`. + * + * **Note**. `n` is normalized to a non negative integer. + * + * @example + * import * as RA from 'fp-ts/ReadonlyArray' + * import { pipe } from 'fp-ts/function' + * + * const input: ReadonlyArray = [1, 2, 3] + * assert.deepStrictEqual(pipe(input, RA.dropRight(2)), [1]) + * assert.strictEqual(pipe(input, RA.dropRight(0)), input) + * assert.strictEqual(pipe(input, RA.dropRight(-1)), input) + * + * @category combinators + * @since 2.5.0 + */ +var dropRight = function (n) { return function (as) { + return n <= 0 || exports.isEmpty(as) ? as : n >= as.length ? exports.empty : as.slice(0, as.length - n); +}; }; +exports.dropRight = dropRight; +function dropLeftWhile(predicate) { + return function (as) { + var i = spanLeftIndex(as, predicate); + return i === 0 ? as : i === as.length ? exports.empty : as.slice(i); + }; } -exports.fromArray = fromArray; +exports.dropLeftWhile = dropLeftWhile; /** - * @category destructors + * Find the first index for which a predicate holds + * + * @example + * import { findIndex } from 'fp-ts/ReadonlyArray' + * import { some, none } from 'fp-ts/Option' + * + * assert.deepStrictEqual(findIndex((n: number) => n === 2)([1, 2, 3]), some(1)) + * assert.deepStrictEqual(findIndex((n: number) => n === 2)([]), none) + * * @since 2.5.0 */ -// tslint:disable-next-line: readonly-array -function toArray(ras) { - var l = ras.length; - var as = Array(l); - for (var i = 0; i < l; i++) { - as[i] = ras[i]; +var findIndex = function (predicate) { return function (as) { + for (var i = 0; i < as.length; i++) { + if (predicate(as[i])) { + return _.some(i); + } } - return as; + return _.none; +}; }; +exports.findIndex = findIndex; +function findFirst(predicate) { + return function (as) { + for (var i = 0; i < as.length; i++) { + if (predicate(as[i])) { + return _.some(as[i]); + } + } + return _.none; + }; } -exports.toArray = toArray; +exports.findFirst = findFirst; /** - * @category instances + * Find the first element returned by an option based selector function + * + * @example + * import { findFirstMap } from 'fp-ts/ReadonlyArray' + * import { some, none } from 'fp-ts/Option' + * + * interface Person { + * readonly name: string + * readonly age?: number + * } + * + * const persons: ReadonlyArray = [{ name: 'John' }, { name: 'Mary', age: 45 }, { name: 'Joey', age: 28 }] + * + * // returns the name of the first person that has an age + * assert.deepStrictEqual(findFirstMap((p: Person) => (p.age === undefined ? none : some(p.name)))(persons), some('Mary')) + * * @since 2.5.0 */ -function getShow(S) { - return { - show: function (as) { return "[" + as.map(S.show).join(', ') + "]"; } +var findFirstMap = function (f) { return function (as) { + for (var i = 0; i < as.length; i++) { + var out = f(as[i]); + if (_.isSome(out)) { + return out; + } + } + return _.none; +}; }; +exports.findFirstMap = findFirstMap; +function findLast(predicate) { + return function (as) { + for (var i = as.length - 1; i >= 0; i--) { + if (predicate(as[i])) { + return _.some(as[i]); + } + } + return _.none; }; } -exports.getShow = getShow; -var concat = function (x, y) { - var lenx = x.length; - if (lenx === 0) { - return y; - } - var leny = y.length; - if (leny === 0) { - return x; - } - var r = Array(lenx + leny); - for (var i = 0; i < lenx; i++) { - r[i] = x[i]; - } - for (var i = 0; i < leny; i++) { - r[i + lenx] = y[i]; +exports.findLast = findLast; +/** + * Find the last element returned by an option based selector function + * + * @example + * import { findLastMap } from 'fp-ts/ReadonlyArray' + * import { some, none } from 'fp-ts/Option' + * + * interface Person { + * readonly name: string + * readonly age?: number + * } + * + * const persons: ReadonlyArray = [{ name: 'John' }, { name: 'Mary', age: 45 }, { name: 'Joey', age: 28 }] + * + * // returns the name of the last person that has an age + * assert.deepStrictEqual(findLastMap((p: Person) => (p.age === undefined ? none : some(p.name)))(persons), some('Joey')) + * + * @since 2.5.0 + */ +var findLastMap = function (f) { return function (as) { + for (var i = as.length - 1; i >= 0; i--) { + var out = f(as[i]); + if (_.isSome(out)) { + return out; + } } - return r; -}; + return _.none; +}; }; +exports.findLastMap = findLastMap; /** - * Returns a `Monoid` for `ReadonlyArray` + * Returns the index of the last element of the list which matches the predicate * * @example - * import { getMonoid } from 'fp-ts/ReadonlyArray' + * import { findLastIndex } from 'fp-ts/ReadonlyArray' + * import { some, none } from 'fp-ts/Option' + * + * interface X { + * readonly a: number + * readonly b: number + * } + * const xs: ReadonlyArray = [{ a: 1, b: 0 }, { a: 1, b: 1 }] + * assert.deepStrictEqual(findLastIndex((x: { readonly a: number }) => x.a === 1)(xs), some(1)) + * assert.deepStrictEqual(findLastIndex((x: { readonly a: number }) => x.a === 4)(xs), none) * - * const M = getMonoid() - * assert.deepStrictEqual(M.concat([1, 2], [3, 4]), [1, 2, 3, 4]) * - * @category instances * @since 2.5.0 */ -function getMonoid() { - return { - concat: concat, - empty: exports.empty - }; -} -exports.getMonoid = getMonoid; +var findLastIndex = function (predicate) { return function (as) { + for (var i = as.length - 1; i >= 0; i--) { + if (predicate(as[i])) { + return _.some(i); + } + } + return _.none; +}; }; +exports.findLastIndex = findLastIndex; /** - * Derives an `Eq` over the `ReadonlyArray` of a given element type from the `Eq` of that type. The derived `Eq` defines two - * arrays as equal if all elements of both arrays are compared equal pairwise with the given `E`. In case of arrays of - * different lengths, the result is non equality. + * Insert an element at the specified index, creating a new array, or returning `None` if the index is out of bounds * * @example - * import { eqString } from 'fp-ts/Eq' - * import { getEq } from 'fp-ts/ReadonlyArray' + * import { insertAt } from 'fp-ts/ReadonlyArray' + * import { some } from 'fp-ts/Option' * - * const E = getEq(eqString) - * assert.strictEqual(E.equals(['a', 'b'], ['a', 'b']), true) - * assert.strictEqual(E.equals(['a'], []), false) + * assert.deepStrictEqual(insertAt(2, 5)([1, 2, 3, 4]), some([1, 2, 5, 3, 4])) * - * @category instances * @since 2.5.0 */ -function getEq(E) { - return { - equals: function (xs, ys) { return xs === ys || (xs.length === ys.length && xs.every(function (x, i) { return E.equals(x, ys[i]); })); } - }; -} -exports.getEq = getEq; +var insertAt = function (i, a) { return function (as) { + return i < 0 || i > as.length ? _.none : _.some(RNEA.unsafeInsertAt(i, a, as)); +}; }; +exports.insertAt = insertAt; /** - * Derives an `Ord` over the `ReadonlyArray` of a given element type from the `Ord` of that type. The ordering between two such - * arrays is equal to: the first non equal comparison of each arrays elements taken pairwise in increasing order, in - * case of equality over all the pairwise elements; the longest array is considered the greatest, if both arrays have - * the same length, the result is equality. + * Change the element at the specified index, creating a new array, or returning `None` if the index is out of bounds * * @example - * import { getOrd } from 'fp-ts/ReadonlyArray' - * import { ordString } from 'fp-ts/Ord' - * - * const O = getOrd(ordString) - * assert.strictEqual(O.compare(['b'], ['a']), 1) - * assert.strictEqual(O.compare(['a'], ['a']), 0) - * assert.strictEqual(O.compare(['a'], ['b']), -1) + * import { updateAt } from 'fp-ts/ReadonlyArray' + * import { some, none } from 'fp-ts/Option' * + * assert.deepStrictEqual(updateAt(1, 1)([1, 2, 3]), some([1, 1, 3])) + * assert.deepStrictEqual(updateAt(1, 1)([]), none) * - * @category instances * @since 2.5.0 */ -function getOrd(O) { - return Ord_1.fromCompare(function (a, b) { - var aLen = a.length; - var bLen = b.length; - var len = Math.min(aLen, bLen); - for (var i = 0; i < len; i++) { - var ordering = O.compare(a[i], b[i]); - if (ordering !== 0) { - return ordering; - } - } - return Ord_1.ordNumber.compare(aLen, bLen); - }); -} -exports.getOrd = getOrd; +var updateAt = function (i, a) { + return exports.modifyAt(i, function () { return a; }); +}; +exports.updateAt = updateAt; /** - * Return a list of length `n` with element `i` initialized with `f(i)` + * Delete the element at the specified index, creating a new array, or returning `None` if the index is out of bounds * * @example - * import { makeBy } from 'fp-ts/ReadonlyArray' + * import { deleteAt } from 'fp-ts/ReadonlyArray' + * import { some, none } from 'fp-ts/Option' * - * const double = (n: number): number => n * 2 - * assert.deepStrictEqual(makeBy(5, double), [0, 2, 4, 6, 8]) + * assert.deepStrictEqual(deleteAt(0)([1, 2, 3]), some([2, 3])) + * assert.deepStrictEqual(deleteAt(1)([]), none) * - * @category constructors * @since 2.5.0 */ -function makeBy(n, f) { - // tslint:disable-next-line: readonly-array - var r = []; - for (var i = 0; i < n; i++) { - r.push(f(i)); - } - return r; -} -exports.makeBy = makeBy; +var deleteAt = function (i) { return function (as) { + return exports.isOutOfBound(i, as) ? _.none : _.some(exports.unsafeDeleteAt(i, as)); +}; }; +exports.deleteAt = deleteAt; /** - * Create an array containing a range of integers, including both endpoints + * Apply a function to the element at the specified index, creating a new array, or returning `None` if the index is out + * of bounds * * @example - * import { range } from 'fp-ts/ReadonlyArray' + * import { modifyAt } from 'fp-ts/ReadonlyArray' + * import { some, none } from 'fp-ts/Option' * - * assert.deepStrictEqual(range(1, 5), [1, 2, 3, 4, 5]) + * const double = (x: number): number => x * 2 + * assert.deepStrictEqual(modifyAt(1, double)([1, 2, 3]), some([1, 4, 3])) + * assert.deepStrictEqual(modifyAt(1, double)([]), none) * - * @category constructors * @since 2.5.0 */ -function range(start, end) { - return makeBy(end - start + 1, function (i) { return start + i; }); -} -exports.range = range; +var modifyAt = function (i, f) { return function (as) { + return exports.isOutOfBound(i, as) ? _.none : _.some(exports.unsafeUpdateAt(i, f(as[i]), as)); +}; }; +exports.modifyAt = modifyAt; /** - * Create an array containing a value repeated the specified number of times + * Reverse an array, creating a new array * * @example - * import { replicate } from 'fp-ts/ReadonlyArray' + * import { reverse } from 'fp-ts/ReadonlyArray' * - * assert.deepStrictEqual(replicate(3, 'a'), ['a', 'a', 'a']) + * assert.deepStrictEqual(reverse([1, 2, 3]), [3, 2, 1]) * - * @category constructors + * @category combinators * @since 2.5.0 */ -function replicate(n, a) { - return makeBy(n, function () { return a; }); -} -exports.replicate = replicate; +var reverse = function (as) { return (as.length <= 1 ? as : as.slice().reverse()); }; +exports.reverse = reverse; /** - * Removes one level of nesting - * - * Derivable from `Monad`. + * Extracts from an array of `Either` all the `Right` elements. All the `Right` elements are extracted in order * * @example - * import { flatten } from 'fp-ts/ReadonlyArray' + * import { rights } from 'fp-ts/ReadonlyArray' + * import { right, left } from 'fp-ts/Either' * - * assert.deepStrictEqual(flatten([[1], [2], [3]]), [1, 2, 3]) + * assert.deepStrictEqual(rights([right(1), left('foo'), right(2)]), [1, 2]) * * @category combinators * @since 2.5.0 */ -function flatten(mma) { - var rLen = 0; - var len = mma.length; - for (var i = 0; i < len; i++) { - rLen += mma[i].length; - } - var r = Array(rLen); - var start = 0; - for (var i = 0; i < len; i++) { - var arr = mma[i]; - var l = arr.length; - for (var j = 0; j < l; j++) { - r[j + start] = arr[j]; +var rights = function (as) { + var r = []; + for (var i = 0; i < as.length; i++) { + var a = as[i]; + if (a._tag === 'Right') { + r.push(a.right); } - start += l; } return r; -} -exports.flatten = flatten; +}; +exports.rights = rights; /** - * Break an array into its first element and remaining elements + * Extracts from an array of `Either` all the `Left` elements. All the `Left` elements are extracted in order * * @example - * import { foldLeft } from 'fp-ts/ReadonlyArray' - * - * const len: (as: ReadonlyArray) => number = foldLeft(() => 0, (_, tail) => 1 + len(tail)) - * assert.strictEqual(len([1, 2, 3]), 3) + * import { lefts } from 'fp-ts/ReadonlyArray' + * import { left, right } from 'fp-ts/Either' * - * @category destructors - * @since 2.5.0 - */ -function foldLeft(onEmpty, onCons) { - return function (as) { return (isEmpty(as) ? onEmpty() : onCons(as[0], as.slice(1))); }; -} -exports.foldLeft = foldLeft; -/** - * Break an array into its initial elements and the last element + * assert.deepStrictEqual(lefts([right(1), left('foo'), right(2)]), ['foo']) * - * @category destructors + * @category combinators * @since 2.5.0 */ -function foldRight(onEmpty, onCons) { - return function (as) { return (isEmpty(as) ? onEmpty() : onCons(as.slice(0, as.length - 1), as[as.length - 1])); }; -} -exports.foldRight = foldRight; +var lefts = function (as) { + var r = []; + for (var i = 0; i < as.length; i++) { + var a = as[i]; + if (a._tag === 'Left') { + r.push(a.left); + } + } + return r; +}; +exports.lefts = lefts; /** - * Same as `reduce` but it carries over the intermediate steps + * Sort the elements of an array in increasing order, creating a new array * * @example - * import { scanLeft } from 'fp-ts/ReadonlyArray' + * import { sort } from 'fp-ts/ReadonlyArray' + * import * as N from 'fp-ts/number' * - * assert.deepStrictEqual(scanLeft(10, (b, a: number) => b - a)([1, 2, 3]), [10, 9, 7, 4]) + * assert.deepStrictEqual(sort(N.Ord)([3, 2, 1]), [1, 2, 3]) * * @category combinators * @since 2.5.0 */ -function scanLeft(b, f) { - return function (as) { - var l = as.length; - var r = new Array(l + 1); - r[0] = b; - for (var i = 0; i < l; i++) { - r[i + 1] = f(r[i], as[i]); - } - return r; - }; -} -exports.scanLeft = scanLeft; +var sort = function (O) { return function (as) { + return as.length <= 1 ? as : as.slice().sort(O.compare); +}; }; +exports.sort = sort; +// TODO: curry and make data-last in v3 /** - * Fold an array from the right, keeping all intermediate results instead of only the final result + * Apply a function to pairs of elements at the same index in two arrays, collecting the results in a new array. If one + * input array is short, excess elements of the longer array are discarded. * * @example - * import { scanRight } from 'fp-ts/ReadonlyArray' + * import { zipWith } from 'fp-ts/ReadonlyArray' * - * assert.deepStrictEqual(scanRight(10, (a: number, b) => b - a)([1, 2, 3]), [4, 5, 7, 10]) + * assert.deepStrictEqual(zipWith([1, 2, 3], ['a', 'b', 'c', 'd'], (n, s) => s + n), ['a1', 'b2', 'c3']) * * @category combinators * @since 2.5.0 */ -function scanRight(b, f) { - return function (as) { - var l = as.length; - var r = new Array(l + 1); - r[l] = b; - for (var i = l - 1; i >= 0; i--) { - r[i] = f(as[i], r[i + 1]); - } - return r; - }; +var zipWith = function (fa, fb, f) { + var fc = []; + var len = Math.min(fa.length, fb.length); + for (var i = 0; i < len; i++) { + fc[i] = f(fa[i], fb[i]); + } + return fc; +}; +exports.zipWith = zipWith; +function zip(as, bs) { + if (bs === undefined) { + return function (bs) { return zip(bs, as); }; + } + return exports.zipWith(as, bs, function (a, b) { return [a, b]; }); } -exports.scanRight = scanRight; +exports.zip = zip; /** - * Test whether an array is empty + * The function is reverse of `zip`. Takes an array of pairs and return two corresponding arrays * * @example - * import { isEmpty } from 'fp-ts/ReadonlyArray' + * import { unzip } from 'fp-ts/ReadonlyArray' * - * assert.strictEqual(isEmpty([]), true) + * assert.deepStrictEqual(unzip([[1, 'a'], [2, 'b'], [3, 'c']]), [[1, 2, 3], ['a', 'b', 'c']]) * + * @category combinators * @since 2.5.0 */ -function isEmpty(as) { - return as.length === 0; -} -exports.isEmpty = isEmpty; +var unzip = function (as) { + var fa = []; + var fb = []; + for (var i = 0; i < as.length; i++) { + fa[i] = as[i][0]; + fb[i] = as[i][1]; + } + return [fa, fb]; +}; +exports.unzip = unzip; /** - * Test whether an array is non empty narrowing down the type to `NonEmptyReadonlyArray` + * Prepend an element to every member of an array * - * @category guards - * @since 2.5.0 - */ -function isNonEmpty(as) { - return as.length > 0; -} -exports.isNonEmpty = isNonEmpty; -/** - * Test whether an array contains a particular index + * @example + * import { prependAll } from 'fp-ts/ReadonlyArray' * - * @since 2.5.0 + * assert.deepStrictEqual(prependAll(9)([1, 2, 3, 4]), [9, 1, 9, 2, 9, 3, 9, 4]) + * + * @category combinators + * @since 2.10.0 */ -function isOutOfBound(i, as) { - return i < 0 || i >= as.length; -} -exports.isOutOfBound = isOutOfBound; -function lookup(i, as) { - return as === undefined ? function (as) { return lookup(i, as); } : isOutOfBound(i, as) ? O.none : O.some(as[i]); -} -exports.lookup = lookup; -function cons(head, tail) { - if (tail === undefined) { - return function (tail) { return cons(head, tail); }; - } - var len = tail.length; - var r = Array(len + 1); - for (var i = 0; i < len; i++) { - r[i + 1] = tail[i]; - } - r[0] = head; - return r; -} -exports.cons = cons; -// TODO: curry and make data-last in v3 +var prependAll = function (middle) { + var f = RNEA.prependAll(middle); + return function (as) { return (exports.isNonEmpty(as) ? f(as) : as); }; +}; +exports.prependAll = prependAll; /** - * Append an element to the end of an array, creating a new non empty array + * Places an element in between members of an array * * @example - * import { snoc } from 'fp-ts/ReadonlyArray' + * import { intersperse } from 'fp-ts/ReadonlyArray' * - * assert.deepStrictEqual(snoc([1, 2, 3], 4), [1, 2, 3, 4]) + * assert.deepStrictEqual(intersperse(9)([1, 2, 3, 4]), [1, 9, 2, 9, 3, 9, 4]) * - * @category constructors - * @since 2.5.0 + * @category combinators + * @since 2.9.0 */ -function snoc(init, end) { - var len = init.length; - var r = Array(len + 1); - for (var i = 0; i < len; i++) { - r[i] = init[i]; - } - r[len] = end; - return r; -} -exports.snoc = snoc; +var intersperse = function (middle) { + var f = RNEA.intersperse(middle); + return function (as) { return (exports.isNonEmpty(as) ? f(as) : as); }; +}; +exports.intersperse = intersperse; /** - * Get the first element in an array, or `None` if the array is empty + * Rotate a `ReadonlyArray` by `n` steps. * * @example - * import { head } from 'fp-ts/ReadonlyArray' - * import { some, none } from 'fp-ts/Option' + * import { rotate } from 'fp-ts/ReadonlyArray' * - * assert.deepStrictEqual(head([1, 2, 3]), some(1)) - * assert.deepStrictEqual(head([]), none) + * assert.deepStrictEqual(rotate(2)([1, 2, 3, 4, 5]), [4, 5, 1, 2, 3]) * + * @category combinators * @since 2.5.0 */ -function head(as) { - return isEmpty(as) ? O.none : O.some(as[0]); +var rotate = function (n) { + var f = RNEA.rotate(n); + return function (as) { return (exports.isNonEmpty(as) ? f(as) : as); }; +}; +exports.rotate = rotate; +function elem(E) { + return function (a, as) { + if (as === undefined) { + var elemE_1 = elem(E); + return function (as) { return elemE_1(a, as); }; + } + var predicate = function (element) { return E.equals(element, a); }; + var i = 0; + for (; i < as.length; i++) { + if (predicate(as[i])) { + return true; + } + } + return false; + }; } -exports.head = head; +exports.elem = elem; /** - * Get the last element in an array, or `None` if the array is empty + * Remove duplicates from an array, keeping the first occurrence of an element. * * @example - * import { last } from 'fp-ts/ReadonlyArray' - * import { some, none } from 'fp-ts/Option' + * import { uniq } from 'fp-ts/ReadonlyArray' + * import * as N from 'fp-ts/number' * - * assert.deepStrictEqual(last([1, 2, 3]), some(3)) - * assert.deepStrictEqual(last([]), none) + * assert.deepStrictEqual(uniq(N.Eq)([1, 2, 1]), [1, 2]) * + * @category combinators * @since 2.5.0 */ -function last(as) { - return lookup(as.length - 1, as); -} -exports.last = last; +var uniq = function (E) { + var f = RNEA.uniq(E); + return function (as) { return (exports.isNonEmpty(as) ? f(as) : as); }; +}; +exports.uniq = uniq; /** - * Get all but the first element of an array, creating a new array, or `None` if the array is empty + * Sort the elements of an array in increasing order, where elements are compared using first `ords[0]`, then `ords[1]`, + * etc... * * @example - * import { tail } from 'fp-ts/ReadonlyArray' - * import { some, none } from 'fp-ts/Option' + * import { sortBy } from 'fp-ts/ReadonlyArray' + * import { contramap } from 'fp-ts/Ord' + * import * as S from 'fp-ts/string' + * import * as N from 'fp-ts/number' + * import { pipe } from 'fp-ts/function' * - * assert.deepStrictEqual(tail([1, 2, 3]), some([2, 3])) - * assert.deepStrictEqual(tail([]), none) + * interface Person { + * readonly name: string + * readonly age: number + * } + * const byName = pipe(S.Ord, contramap((p: Person) => p.name)) + * const byAge = pipe(N.Ord, contramap((p: Person) => p.age)) + * + * const sortByNameByAge = sortBy([byName, byAge]) + * + * const persons = [{ name: 'a', age: 1 }, { name: 'b', age: 3 }, { name: 'c', age: 2 }, { name: 'b', age: 2 }] + * assert.deepStrictEqual(sortByNameByAge(persons), [ + * { name: 'a', age: 1 }, + * { name: 'b', age: 2 }, + * { name: 'b', age: 3 }, + * { name: 'c', age: 2 } + * ]) * + * @category combinators * @since 2.5.0 */ -function tail(as) { - return isEmpty(as) ? O.none : O.some(as.slice(1)); -} -exports.tail = tail; +var sortBy = function (ords) { + var f = RNEA.sortBy(ords); + return function (as) { return (exports.isNonEmpty(as) ? f(as) : as); }; +}; +exports.sortBy = sortBy; /** - * Get all but the last element of an array, creating a new array, or `None` if the array is empty + * A useful recursion pattern for processing a `ReadonlyArray` to produce a new `ReadonlyArray`, often used for "chopping" up the input + * `ReadonlyArray`. Typically `chop` is called with some function that will consume an initial prefix of the `ReadonlyArray` and produce a + * value and the tail of the `ReadonlyArray`. * * @example - * import { init } from 'fp-ts/ReadonlyArray' - * import { some, none } from 'fp-ts/Option' + * import { Eq } from 'fp-ts/Eq' + * import * as RA from 'fp-ts/ReadonlyArray' + * import * as N from 'fp-ts/number' + * import { pipe } from 'fp-ts/function' * - * assert.deepStrictEqual(init([1, 2, 3]), some([1, 2])) - * assert.deepStrictEqual(init([]), none) + * const group = (S: Eq): ((as: ReadonlyArray) => ReadonlyArray>) => { + * return RA.chop(as => { + * const { init, rest } = pipe(as, RA.spanLeft((a: A) => S.equals(a, as[0]))) + * return [init, rest] + * }) + * } + * assert.deepStrictEqual(group(N.Eq)([1, 1, 2, 3, 3, 4]), [[1, 1], [2], [3, 3], [4]]) * + * @category combinators * @since 2.5.0 */ -function init(as) { - var len = as.length; - return len === 0 ? O.none : O.some(as.slice(0, len - 1)); -} -exports.init = init; +var chop = function (f) { + var g = RNEA.chop(f); + return function (as) { return (exports.isNonEmpty(as) ? g(as) : exports.empty); }; +}; +exports.chop = chop; /** - * Keep only a number of elements from the start of an array, creating a new array. - * `n` must be a natural number + * Splits a `ReadonlyArray` into two pieces, the first piece has max `n` elements. * * @example - * import { takeLeft } from 'fp-ts/ReadonlyArray' + * import { splitAt } from 'fp-ts/ReadonlyArray' * - * assert.deepStrictEqual(takeLeft(2)([1, 2, 3]), [1, 2]) + * assert.deepStrictEqual(splitAt(2)([1, 2, 3, 4, 5]), [[1, 2], [3, 4, 5]]) * * @category combinators * @since 2.5.0 */ -function takeLeft(n) { - return function (as) { return as.slice(0, n); }; -} -exports.takeLeft = takeLeft; +var splitAt = function (n) { return function (as) { + return n >= 1 && exports.isNonEmpty(as) ? RNEA.splitAt(n)(as) : exports.isEmpty(as) ? [as, exports.empty] : [exports.empty, as]; +}; }; +exports.splitAt = splitAt; /** - * Keep only a number of elements from the end of an array, creating a new array. - * `n` must be a natural number + * Splits a `ReadonlyArray` into length-`n` pieces. The last piece will be shorter if `n` does not evenly divide the length of + * the `ReadonlyArray`. Note that `chunksOf(n)([])` is `[]`, not `[[]]`. This is intentional, and is consistent with a recursive + * definition of `chunksOf`; it satisfies the property that: + * + * ```ts + * chunksOf(n)(xs).concat(chunksOf(n)(ys)) == chunksOf(n)(xs.concat(ys))) + * ``` + * + * whenever `n` evenly divides the length of `as`. * * @example - * import { takeRight } from 'fp-ts/ReadonlyArray' + * import { chunksOf } from 'fp-ts/ReadonlyArray' * - * assert.deepStrictEqual(takeRight(2)([1, 2, 3, 4, 5]), [4, 5]) + * assert.deepStrictEqual(chunksOf(2)([1, 2, 3, 4, 5]), [[1, 2], [3, 4], [5]]) * + * @category combinators * @since 2.5.0 */ -function takeRight(n) { - return function (as) { return (n === 0 ? exports.empty : as.slice(-n)); }; +var chunksOf = function (n) { + var f = RNEA.chunksOf(n); + return function (as) { return (exports.isNonEmpty(as) ? f(as) : exports.empty); }; +}; +exports.chunksOf = chunksOf; +/** + * @category combinators + * @since 2.11.0 + */ +var fromOptionK = function (f) { return function () { + var a = []; + for (var _i = 0; _i < arguments.length; _i++) { + a[_i] = arguments[_i]; + } + return exports.fromOption(f.apply(void 0, a)); +}; }; +exports.fromOptionK = fromOptionK; +function comprehension(input, f, g) { + if (g === void 0) { g = function () { return true; }; } + var go = function (scope, input) { + return exports.isNonEmpty(input) + ? function_1.pipe(RNEA.head(input), exports.chain(function (x) { return go(function_1.pipe(scope, exports.append(x)), RNEA.tail(input)); })) + : g.apply(void 0, scope) ? [f.apply(void 0, scope)] + : exports.empty; + }; + return go(exports.empty, input); } -exports.takeRight = takeRight; -function takeLeftWhile(predicate) { - return function (as) { - var i = spanIndexUncurry(as, predicate); - var init = Array(i); - for (var j = 0; j < i; j++) { - init[j] = as[j]; +exports.comprehension = comprehension; +/** + * @category combinators + * @since 2.11.0 + */ +var concatW = function (second) { return function (first) { + return exports.isEmpty(first) ? second : exports.isEmpty(second) ? first : first.concat(second); +}; }; +exports.concatW = concatW; +/** + * @category combinators + * @since 2.11.0 + */ +exports.concat = exports.concatW; +function union(E) { + var unionE = RNEA.union(E); + return function (first, second) { + if (second === undefined) { + var unionE_1 = union(E); + return function (second) { return unionE_1(second, first); }; } - return init; + return exports.isNonEmpty(first) && exports.isNonEmpty(second) ? unionE(second)(first) : exports.isNonEmpty(first) ? first : second; }; } -exports.takeLeftWhile = takeLeftWhile; -var spanIndexUncurry = function (as, predicate) { - var l = as.length; - var i = 0; - for (; i < l; i++) { - if (!predicate(as[i])) { - break; - } - } - return i; -}; -function spanLeft(predicate) { - return function (as) { - var i = spanIndexUncurry(as, predicate); - var init = Array(i); - for (var j = 0; j < i; j++) { - init[j] = as[j]; +exports.union = union; +function intersection(E) { + var elemE = elem(E); + return function (xs, ys) { + if (ys === undefined) { + var intersectionE_1 = intersection(E); + return function (ys) { return intersectionE_1(ys, xs); }; } - var l = as.length; - var rest = Array(l - i); - for (var j = i; j < l; j++) { - rest[j - i] = as[j]; + return xs.filter(function (a) { return elemE(a, ys); }); + }; +} +exports.intersection = intersection; +function difference(E) { + var elemE = elem(E); + return function (xs, ys) { + if (ys === undefined) { + var differenceE_1 = difference(E); + return function (ys) { return differenceE_1(ys, xs); }; } - return { init: init, rest: rest }; + return xs.filter(function (a) { return !elemE(a, ys); }); }; } -exports.spanLeft = spanLeft; +exports.difference = difference; +// ------------------------------------------------------------------------------------- +// non-pipeables +// ------------------------------------------------------------------------------------- +var _map = function (fa, f) { return function_1.pipe(fa, exports.map(f)); }; +var _mapWithIndex = function (fa, f) { return function_1.pipe(fa, exports.mapWithIndex(f)); }; +var _ap = function (fab, fa) { return function_1.pipe(fab, exports.ap(fa)); }; +var _chain = function (ma, f) { return function_1.pipe(ma, exports.chain(f)); }; +var _filter = function (fa, predicate) { + return function_1.pipe(fa, exports.filter(predicate)); +}; +var _filterMap = function (fa, f) { return function_1.pipe(fa, exports.filterMap(f)); }; +var _partition = function (fa, predicate) { + return function_1.pipe(fa, exports.partition(predicate)); +}; +var _partitionMap = function (fa, f) { return function_1.pipe(fa, exports.partitionMap(f)); }; +var _partitionWithIndex = function (fa, predicateWithIndex) { return function_1.pipe(fa, exports.partitionWithIndex(predicateWithIndex)); }; +var _partitionMapWithIndex = function (fa, f) { return function_1.pipe(fa, exports.partitionMapWithIndex(f)); }; +var _alt = function (fa, that) { return function_1.pipe(fa, exports.alt(that)); }; +var _reduce = function (fa, b, f) { return function_1.pipe(fa, exports.reduce(b, f)); }; +var _foldMap = function (M) { + var foldMapM = exports.foldMap(M); + return function (fa, f) { return function_1.pipe(fa, foldMapM(f)); }; +}; +var _reduceRight = function (fa, b, f) { return function_1.pipe(fa, exports.reduceRight(b, f)); }; +var _reduceWithIndex = function (fa, b, f) { + return function_1.pipe(fa, exports.reduceWithIndex(b, f)); +}; +var _foldMapWithIndex = function (M) { + var foldMapWithIndexM = exports.foldMapWithIndex(M); + return function (fa, f) { return function_1.pipe(fa, foldMapWithIndexM(f)); }; +}; +var _reduceRightWithIndex = function (fa, b, f) { + return function_1.pipe(fa, exports.reduceRightWithIndex(b, f)); +}; +var _filterMapWithIndex = function (fa, f) { return function_1.pipe(fa, exports.filterMapWithIndex(f)); }; +var _filterWithIndex = function (fa, predicateWithIndex) { return function_1.pipe(fa, exports.filterWithIndex(predicateWithIndex)); }; +var _extend = function (fa, f) { return function_1.pipe(fa, exports.extend(f)); }; +var _traverse = function (F) { + var traverseF = exports.traverse(F); + return function (ta, f) { return function_1.pipe(ta, traverseF(f)); }; +}; +/* istanbul ignore next */ +var _traverseWithIndex = function (F) { + var traverseWithIndexF = exports.traverseWithIndex(F); + return function (ta, f) { return function_1.pipe(ta, traverseWithIndexF(f)); }; +}; +/** @internal */ +var _chainRecDepthFirst = function (a, f) { return function_1.pipe(a, exports.chainRecDepthFirst(f)); }; +exports._chainRecDepthFirst = _chainRecDepthFirst; +/** @internal */ +var _chainRecBreadthFirst = function (a, f) { return function_1.pipe(a, exports.chainRecBreadthFirst(f)); }; +exports._chainRecBreadthFirst = _chainRecBreadthFirst; +// ------------------------------------------------------------------------------------- +// type class members +// ------------------------------------------------------------------------------------- /** - * Drop a number of elements from the start of an array, creating a new array - * - * @example - * import { dropLeft } from 'fp-ts/ReadonlyArray' + * @category Pointed + * @since 2.5.0 + */ +exports.of = RNEA.of; +/** + * @category Zero + * @since 2.7.0 + */ +var zero = function () { return exports.empty; }; +exports.zero = zero; +/** + * Less strict version of [`alt`](#alt). * - * assert.deepStrictEqual(dropLeft(2)([1, 2, 3]), [3]) + * @category Alt + * @since 2.9.0 + */ +var altW = function (that) { return function (fa) { + return fa.concat(that()); +}; }; +exports.altW = altW; +/** + * Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to + * types of kind `* -> *`. * - * @category combinators + * @category Alt * @since 2.5.0 */ -function dropLeft(n) { - return function (as) { return as.slice(n, as.length); }; -} -exports.dropLeft = dropLeft; +exports.alt = exports.altW; /** - * Drop a number of elements from the end of an array, creating a new array + * Apply a function to an argument under a type constructor. * - * @example - * import { dropRight } from 'fp-ts/ReadonlyArray' + * @category Apply + * @since 2.5.0 + */ +var ap = function (fa) { + return exports.chain(function (f) { return function_1.pipe(fa, exports.map(f)); }); +}; +exports.ap = ap; +/** + * Composes computations in sequence, using the return value of one computation to determine the next computation. * - * assert.deepStrictEqual(dropRight(2)([1, 2, 3, 4, 5]), [1, 2, 3]) + * @category Monad + * @since 2.5.0 + */ +var chain = function (f) { return function (ma) { + return function_1.pipe(ma, exports.chainWithIndex(function (_, a) { return f(a); })); +}; }; +exports.chain = chain; +/** + * Derivable from `Chain`. * * @category combinators * @since 2.5.0 */ -function dropRight(n) { - return function (as) { return as.slice(0, as.length - n); }; -} -exports.dropRight = dropRight; +exports.flatten = +/*#__PURE__*/ +exports.chain(function_1.identity); /** - * Remove the longest initial subarray for which all element satisfy the specified predicate, creating a new array - * - * @example - * import { dropLeftWhile } from 'fp-ts/ReadonlyArray' - * - * assert.deepStrictEqual(dropLeftWhile((n: number) => n % 2 === 1)([1, 3, 2, 4, 5]), [2, 4, 5]) + * `map` can be used to turn functions `(a: A) => B` into functions `(fa: F) => F` whose argument and return types + * use the type constructor `F` to represent some computational context. * - * @category combinators + * @category Functor + * @since 2.5.0 + */ +var map = function (f) { return function (fa) { + return fa.map(function (a) { return f(a); }); +}; }; +exports.map = map; +/** + * @category FunctorWithIndex + * @since 2.5.0 + */ +var mapWithIndex = function (f) { return function (fa) { return fa.map(function (a, i) { return f(i, a); }); }; }; +exports.mapWithIndex = mapWithIndex; +/** + * @category Compactable + * @since 2.5.0 + */ +var separate = function (fa) { + var left = []; + var right = []; + for (var _i = 0, fa_1 = fa; _i < fa_1.length; _i++) { + var e = fa_1[_i]; + if (e._tag === 'Left') { + left.push(e.left); + } + else { + right.push(e.right); + } + } + return Separated_1.separated(left, right); +}; +exports.separate = separate; +/** + * @category Filterable + * @since 2.5.0 + */ +var filter = function (predicate) { return function (as) { return as.filter(predicate); }; }; +exports.filter = filter; +/** + * @category FilterableWithIndex + * @since 2.5.0 + */ +var filterMapWithIndex = function (f) { return function (fa) { + var out = []; + for (var i = 0; i < fa.length; i++) { + var optionB = f(i, fa[i]); + if (_.isSome(optionB)) { + out.push(optionB.value); + } + } + return out; +}; }; +exports.filterMapWithIndex = filterMapWithIndex; +/** + * @category Filterable + * @since 2.5.0 + */ +var filterMap = function (f) { + return exports.filterMapWithIndex(function (_, a) { return f(a); }); +}; +exports.filterMap = filterMap; +/** + * @category Compactable * @since 2.5.0 */ -function dropLeftWhile(predicate) { - return function (as) { - var i = spanIndexUncurry(as, predicate); - var l = as.length; - var rest = Array(l - i); - for (var j = i; j < l; j++) { - rest[j - i] = as[j]; - } - return rest; - }; -} -exports.dropLeftWhile = dropLeftWhile; +exports.compact = +/*#__PURE__*/ +exports.filterMap(function_1.identity); /** - * Find the first index for which a predicate holds - * - * @example - * import { findIndex } from 'fp-ts/ReadonlyArray' - * import { some, none } from 'fp-ts/Option' - * - * assert.deepStrictEqual(findIndex((n: number) => n === 2)([1, 2, 3]), some(1)) - * assert.deepStrictEqual(findIndex((n: number) => n === 2)([]), none) - * + * @category Filterable * @since 2.5.0 */ -function findIndex(predicate) { - return function (as) { - var len = as.length; - for (var i = 0; i < len; i++) { - if (predicate(as[i])) { - return O.some(i); - } - } - return O.none; - }; -} -exports.findIndex = findIndex; -function findFirst(predicate) { - return function (as) { - var len = as.length; - for (var i = 0; i < len; i++) { - if (predicate(as[i])) { - return O.some(as[i]); - } - } - return O.none; - }; -} -exports.findFirst = findFirst; +var partition = function (predicate) { + return exports.partitionWithIndex(function (_, a) { return predicate(a); }); +}; +exports.partition = partition; /** - * Find the first element returned by an option based selector function - * - * @example - * import { findFirstMap } from 'fp-ts/ReadonlyArray' - * import { some, none } from 'fp-ts/Option' - * - * interface Person { - * name: string - * age?: number - * } - * - * const persons: ReadonlyArray = [{ name: 'John' }, { name: 'Mary', age: 45 }, { name: 'Joey', age: 28 }] - * - * // returns the name of the first person that has an age - * assert.deepStrictEqual(findFirstMap((p: Person) => (p.age === undefined ? none : some(p.name)))(persons), some('Mary')) - * + * @category FilterableWithIndex * @since 2.5.0 */ -function findFirstMap(f) { - return function (as) { - var len = as.length; - for (var i = 0; i < len; i++) { - var v = f(as[i]); - if (O.isSome(v)) { - return v; - } +var partitionWithIndex = function (predicateWithIndex) { return function (as) { + var left = []; + var right = []; + for (var i = 0; i < as.length; i++) { + var a = as[i]; + if (predicateWithIndex(i, a)) { + right.push(a); } - return O.none; - }; -} -exports.findFirstMap = findFirstMap; -function findLast(predicate) { - return function (as) { - var len = as.length; - for (var i = len - 1; i >= 0; i--) { - if (predicate(as[i])) { - return O.some(as[i]); - } + else { + left.push(a); } - return O.none; - }; -} -exports.findLast = findLast; + } + return Separated_1.separated(left, right); +}; }; +exports.partitionWithIndex = partitionWithIndex; /** - * Find the last element returned by an option based selector function - * - * @example - * import { findLastMap } from 'fp-ts/ReadonlyArray' - * import { some, none } from 'fp-ts/Option' - * - * interface Person { - * name: string - * age?: number - * } - * - * const persons: ReadonlyArray = [{ name: 'John' }, { name: 'Mary', age: 45 }, { name: 'Joey', age: 28 }] - * - * // returns the name of the last person that has an age - * assert.deepStrictEqual(findLastMap((p: Person) => (p.age === undefined ? none : some(p.name)))(persons), some('Joey')) - * + * @category Filterable * @since 2.5.0 */ -function findLastMap(f) { - return function (as) { - var len = as.length; - for (var i = len - 1; i >= 0; i--) { - var v = f(as[i]); - if (O.isSome(v)) { - return v; - } - } - return O.none; - }; -} -exports.findLastMap = findLastMap; +var partitionMap = function (f) { + return exports.partitionMapWithIndex(function (_, a) { return f(a); }); +}; +exports.partitionMap = partitionMap; /** - * Returns the index of the last element of the list which matches the predicate - * - * @example - * import { findLastIndex } from 'fp-ts/ReadonlyArray' - * import { some, none } from 'fp-ts/Option' - * - * interface X { - * a: number - * b: number - * } - * const xs: ReadonlyArray = [{ a: 1, b: 0 }, { a: 1, b: 1 }] - * assert.deepStrictEqual(findLastIndex((x: { a: number }) => x.a === 1)(xs), some(1)) - * assert.deepStrictEqual(findLastIndex((x: { a: number }) => x.a === 4)(xs), none) - * - * + * @category FilterableWithIndex * @since 2.5.0 */ -function findLastIndex(predicate) { - return function (as) { - var len = as.length; - for (var i = len - 1; i >= 0; i--) { - if (predicate(as[i])) { - return O.some(i); - } +var partitionMapWithIndex = function (f) { return function (fa) { + var left = []; + var right = []; + for (var i = 0; i < fa.length; i++) { + var e = f(i, fa[i]); + if (e._tag === 'Left') { + left.push(e.left); } - return O.none; - }; -} -exports.findLastIndex = findLastIndex; + else { + right.push(e.right); + } + } + return Separated_1.separated(left, right); +}; }; +exports.partitionMapWithIndex = partitionMapWithIndex; /** - * Insert an element at the specified index, creating a new array, or returning `None` if the index is out of bounds - * - * @example - * import { insertAt } from 'fp-ts/ReadonlyArray' - * import { some } from 'fp-ts/Option' - * - * assert.deepStrictEqual(insertAt(2, 5)([1, 2, 3, 4]), some([1, 2, 5, 3, 4])) - * + * @category FilterableWithIndex * @since 2.5.0 */ -function insertAt(i, a) { - return function (as) { return (i < 0 || i > as.length ? O.none : O.some(unsafeInsertAt(i, a, as))); }; -} -exports.insertAt = insertAt; +var filterWithIndex = function (predicateWithIndex) { return function (as) { + return as.filter(function (a, i) { return predicateWithIndex(i, a); }); +}; }; +exports.filterWithIndex = filterWithIndex; /** - * Change the element at the specified index, creating a new array, or returning `None` if the index is out of bounds - * - * @example - * import { updateAt } from 'fp-ts/ReadonlyArray' - * import { some, none } from 'fp-ts/Option' - * - * assert.deepStrictEqual(updateAt(1, 1)([1, 2, 3]), some([1, 1, 3])) - * assert.deepStrictEqual(updateAt(1, 1)([]), none) - * + * @category Extend * @since 2.5.0 */ -function updateAt(i, a) { - return function (as) { return (isOutOfBound(i, as) ? O.none : O.some(unsafeUpdateAt(i, a, as))); }; -} -exports.updateAt = updateAt; +var extend = function (f) { return function (wa) { return wa.map(function (_, i) { return f(wa.slice(i)); }); }; }; +exports.extend = extend; /** - * Delete the element at the specified index, creating a new array, or returning `None` if the index is out of bounds - * - * @example - * import { deleteAt } from 'fp-ts/ReadonlyArray' - * import { some, none } from 'fp-ts/Option' - * - * assert.deepStrictEqual(deleteAt(0)([1, 2, 3]), some([2, 3])) - * assert.deepStrictEqual(deleteAt(1)([]), none) + * Derivable from `Extend`. * + * @category combinators * @since 2.5.0 */ -function deleteAt(i) { - return function (as) { return (isOutOfBound(i, as) ? O.none : O.some(unsafeDeleteAt(i, as))); }; -} -exports.deleteAt = deleteAt; +exports.duplicate = +/*#__PURE__*/ +exports.extend(function_1.identity); /** - * Apply a function to the element at the specified index, creating a new array, or returning `None` if the index is out - * of bounds - * - * @example - * import { modifyAt } from 'fp-ts/ReadonlyArray' - * import { some, none } from 'fp-ts/Option' - * - * const double = (x: number): number => x * 2 - * assert.deepStrictEqual(modifyAt(1, double)([1, 2, 3]), some([1, 4, 3])) - * assert.deepStrictEqual(modifyAt(1, double)([]), none) - * + * @category FoldableWithIndex * @since 2.5.0 */ -function modifyAt(i, f) { - return function (as) { return (isOutOfBound(i, as) ? O.none : O.some(unsafeUpdateAt(i, f(as[i]), as))); }; -} -exports.modifyAt = modifyAt; +var foldMapWithIndex = function (M) { return function (f) { return function (fa) { + return fa.reduce(function (b, a, i) { return M.concat(b, f(i, a)); }, M.empty); +}; }; }; +exports.foldMapWithIndex = foldMapWithIndex; /** - * Reverse an array, creating a new array - * - * @example - * import { reverse } from 'fp-ts/ReadonlyArray' - * - * assert.deepStrictEqual(reverse([1, 2, 3]), [3, 2, 1]) - * - * @category combinators + * @category Foldable * @since 2.5.0 */ -function reverse(as) { - if (isEmpty(as)) { - return as; - } - return as.slice().reverse(); -} -exports.reverse = reverse; +var reduce = function (b, f) { + return exports.reduceWithIndex(b, function (_, b, a) { return f(b, a); }); +}; +exports.reduce = reduce; /** - * Extracts from an array of `Either` all the `Right` elements. All the `Right` elements are extracted in order - * - * @example - * import { rights } from 'fp-ts/ReadonlyArray' - * import { right, left } from 'fp-ts/Either' - * - * assert.deepStrictEqual(rights([right(1), left('foo'), right(2)]), [1, 2]) - * - * @category combinators + * @category Foldable * @since 2.5.0 */ -function rights(as) { - // tslint:disable-next-line: readonly-array - var r = []; - var len = as.length; - for (var i = 0; i < len; i++) { - var a = as[i]; - if (a._tag === 'Right') { - r.push(a.right); - } - } - return r; -} -exports.rights = rights; -/** - * Extracts from an array of `Either` all the `Left` elements. All the `Left` elements are extracted in order - * - * @example - * import { lefts } from 'fp-ts/ReadonlyArray' - * import { left, right } from 'fp-ts/Either' - * - * assert.deepStrictEqual(lefts([right(1), left('foo'), right(2)]), ['foo']) - * +var foldMap = function (M) { + var foldMapWithIndexM = exports.foldMapWithIndex(M); + return function (f) { return foldMapWithIndexM(function (_, a) { return f(a); }); }; +}; +exports.foldMap = foldMap; +/** + * @category FoldableWithIndex * @since 2.5.0 */ -function lefts(as) { - // tslint:disable-next-line: readonly-array - var r = []; - var len = as.length; +var reduceWithIndex = function (b, f) { return function (fa) { + var len = fa.length; + var out = b; for (var i = 0; i < len; i++) { - var a = as[i]; - if (a._tag === 'Left') { - r.push(a.left); - } + out = f(i, out, fa[i]); } - return r; -} -exports.lefts = lefts; + return out; +}; }; +exports.reduceWithIndex = reduceWithIndex; /** - * Sort the elements of an array in increasing order, creating a new array - * - * @example - * import { sort } from 'fp-ts/ReadonlyArray' - * import { ordNumber } from 'fp-ts/Ord' - * - * assert.deepStrictEqual(sort(ordNumber)([3, 2, 1]), [1, 2, 3]) - * - * @category combinators + * @category Foldable * @since 2.5.0 */ -var sort = function (O) { return function (as) { - return as.length <= 1 ? as : as.slice().sort(O.compare); -}; }; -exports.sort = sort; -// TODO: curry and make data-last in v3 +var reduceRight = function (b, f) { + return exports.reduceRightWithIndex(b, function (_, a, b) { return f(a, b); }); +}; +exports.reduceRight = reduceRight; /** - * Apply a function to pairs of elements at the same index in two arrays, collecting the results in a new array. If one - * input array is short, excess elements of the longer array are discarded. - * - * @example - * import { zipWith } from 'fp-ts/ReadonlyArray' - * - * assert.deepStrictEqual(zipWith([1, 2, 3], ['a', 'b', 'c', 'd'], (n, s) => s + n), ['a1', 'b2', 'c3']) - * - * @category combinators + * @category FoldableWithIndex * @since 2.5.0 */ -function zipWith(fa, fb, f) { - // tslint:disable-next-line: readonly-array - var fc = []; - var len = Math.min(fa.length, fb.length); - for (var i = 0; i < len; i++) { - fc[i] = f(fa[i], fb[i]); - } - return fc; -} -exports.zipWith = zipWith; -function zip(as, bs) { - if (bs === undefined) { - return function (bs) { return zip(bs, as); }; - } - return zipWith(as, bs, function (a, b) { return [a, b]; }); -} -exports.zip = zip; +var reduceRightWithIndex = function (b, f) { return function (fa) { return fa.reduceRight(function (b, a, i) { return f(i, a, b); }, b); }; }; +exports.reduceRightWithIndex = reduceRightWithIndex; /** - * The function is reverse of `zip`. Takes an array of pairs and return two corresponding arrays - * - * @example - * import { unzip } from 'fp-ts/ReadonlyArray' - * - * assert.deepStrictEqual(unzip([[1, 'a'], [2, 'b'], [3, 'c']]), [[1, 2, 3], ['a', 'b', 'c']]) - * - * @since 2.5.0 + * @category Traversable + * @since 2.6.3 */ -function unzip(as) { - // tslint:disable-next-line: readonly-array - var fa = []; - // tslint:disable-next-line: readonly-array - var fb = []; - for (var i = 0; i < as.length; i++) { - fa[i] = as[i][0]; - fb[i] = as[i][1]; - } - return [fa, fb]; -} -exports.unzip = unzip; +var traverse = function (F) { + var traverseWithIndexF = exports.traverseWithIndex(F); + return function (f) { return traverseWithIndexF(function (_, a) { return f(a); }); }; +}; +exports.traverse = traverse; /** - * Prepend an element to every member of an array - * - * @example - * import { prependToAll } from 'fp-ts/ReadonlyArray' - * - * assert.deepStrictEqual(prependToAll(9)([1, 2, 3, 4]), [9, 1, 9, 2, 9, 3, 9, 4]) - * - * @category combinators - * @since 2.9.0 + * @category Traversable + * @since 2.6.3 */ -var prependToAll = function (e) { return function (xs) { - // tslint:disable-next-line: readonly-array - var ys = []; - for (var _i = 0, xs_1 = xs; _i < xs_1.length; _i++) { - var x = xs_1[_i]; - ys.push(e, x); - } - return ys; +var sequence = function (F) { return function (ta) { + return _reduce(ta, F.of(exports.zero()), function (fas, fa) { + return F.ap(F.map(fas, function (as) { return function (a) { return function_1.pipe(as, exports.append(a)); }; }), fa); + }); }; }; -exports.prependToAll = prependToAll; +exports.sequence = sequence; /** - * Places an element in between members of an array - * - * @example - * import { intersperse } from 'fp-ts/ReadonlyArray' - * - * assert.deepStrictEqual(intersperse(9)([1, 2, 3, 4]), [1, 9, 2, 9, 3, 9, 4]) - * - * @category combinators - * @since 2.9.0 + * @category TraversableWithIndex + * @since 2.6.3 */ -function intersperse(e) { - return function (as) { - var length = as.length; - if (length === 0) { - return as; - } - return cons(as[0], exports.prependToAll(e)(as.slice(1, as.length))); - }; -} -exports.intersperse = intersperse; +var traverseWithIndex = function (F) { return function (f) { + return exports.reduceWithIndex(F.of(exports.zero()), function (i, fbs, a) { + return F.ap(F.map(fbs, function (bs) { return function (b) { return function_1.pipe(bs, exports.append(b)); }; }), f(i, a)); + }); +}; }; +exports.traverseWithIndex = traverseWithIndex; /** - * Rotate an array to the right by `n` steps - * - * @example - * import { rotate } from 'fp-ts/ReadonlyArray' - * - * assert.deepStrictEqual(rotate(2)([1, 2, 3, 4, 5]), [4, 5, 1, 2, 3]) - * - * @category combinators - * @since 2.5.0 + * @category Witherable + * @since 2.6.5 */ -function rotate(n) { - return function (as) { - var len = as.length; - if (n === 0 || len <= 1 || len === Math.abs(n)) { - return as; - } - else if (n < 0) { - return rotate(len + n)(as); +var wither = function (F) { + var _witherF = _wither(F); + return function (f) { return function (fa) { return _witherF(fa, f); }; }; +}; +exports.wither = wither; +/** + * @category Witherable + * @since 2.6.5 + */ +var wilt = function (F) { + var _wiltF = _wilt(F); + return function (f) { return function (fa) { return _wiltF(fa, f); }; }; +}; +exports.wilt = wilt; +/** + * @category Unfoldable + * @since 2.6.6 + */ +var unfold = function (b, f) { + var out = []; + var bb = b; + while (true) { + var mt = f(bb); + if (_.isSome(mt)) { + var _a = mt.value, a = _a[0], b_1 = _a[1]; + out.push(a); + bb = b_1; } else { - return as.slice(-n).concat(as.slice(0, len - n)); - } - }; -} -exports.rotate = rotate; -function elem(E) { - return function (a, as) { - if (as === undefined) { - var elemE_1 = elem(E); - return function (as) { return elemE_1(a, as); }; - } - var predicate = function (element) { return E.equals(element, a); }; - var i = 0; - var len = as.length; - for (; i < len; i++) { - if (predicate(as[i])) { - return true; - } + break; } - return false; - }; -} -exports.elem = elem; + } + return out; +}; +exports.unfold = unfold; +// ------------------------------------------------------------------------------------- +// instances +// ------------------------------------------------------------------------------------- /** - * Remove duplicates from an array, keeping the first occurrence of an element. - * - * @example - * import { uniq } from 'fp-ts/ReadonlyArray' - * import { eqNumber } from 'fp-ts/Eq' - * - * assert.deepStrictEqual(uniq(eqNumber)([1, 2, 1]), [1, 2]) - * - * @category combinators + * @category instances * @since 2.5.0 */ -function uniq(E) { - var elemS = elem(E); - return function (as) { - var len = as.length; - if (len <= 1) { - return as; - } - // tslint:disable-next-line: readonly-array - var r = []; - var i = 0; - for (; i < len; i++) { - var a = as[i]; - if (!elemS(a, r)) { - r.push(a); - } - } - return len === r.length ? as : r; - }; -} -exports.uniq = uniq; +exports.URI = 'ReadonlyArray'; /** - * Sort the elements of an array in increasing order, where elements are compared using first `ords[0]`, then `ords[1]`, - * etc... - * - * @example - * import { sortBy } from 'fp-ts/ReadonlyArray' - * import { ord, ordString, ordNumber } from 'fp-ts/Ord' - * - * interface Person { - * name: string - * age: number - * } - * const byName = ord.contramap(ordString, (p: Person) => p.name) - * const byAge = ord.contramap(ordNumber, (p: Person) => p.age) - * - * const sortByNameByAge = sortBy([byName, byAge]) - * - * const persons = [{ name: 'a', age: 1 }, { name: 'b', age: 3 }, { name: 'c', age: 2 }, { name: 'b', age: 2 }] - * assert.deepStrictEqual(sortByNameByAge(persons), [ - * { name: 'a', age: 1 }, - * { name: 'b', age: 2 }, - * { name: 'b', age: 3 }, - * { name: 'c', age: 2 } - * ]) - * - * @category combinators + * @category instances * @since 2.5.0 */ -function sortBy(ords) { - var M = Ord_1.getMonoid(); - return exports.sort(ords.reduce(M.concat, M.empty)); -} -exports.sortBy = sortBy; +var getShow = function (S) { return ({ + show: function (as) { return "[" + as.map(S.show).join(', ') + "]"; } +}); }; +exports.getShow = getShow; /** - * A useful recursion pattern for processing an array to produce a new array, often used for "chopping" up the input - * array. Typically chop is called with some function that will consume an initial prefix of the array and produce a - * value and the rest of the array. + * @category instances + * @since 2.5.0 + */ +var getSemigroup = function () { return ({ + concat: function (first, second) { return (exports.isEmpty(first) ? second : exports.isEmpty(second) ? first : first.concat(second)); } +}); }; +exports.getSemigroup = getSemigroup; +/** + * Returns a `Monoid` for `ReadonlyArray`. * * @example - * import { Eq, eqNumber } from 'fp-ts/Eq' - * import { chop, spanLeft } from 'fp-ts/ReadonlyArray' + * import { getMonoid } from 'fp-ts/ReadonlyArray' * - * const group = (S: Eq): ((as: ReadonlyArray) => ReadonlyArray>) => { - * return chop(as => { - * const { init, rest } = spanLeft((a: A) => S.equals(a, as[0]))(as) - * return [init, rest] - * }) - * } - * assert.deepStrictEqual(group(eqNumber)([1, 1, 2, 3, 3, 4]), [[1, 1], [2], [3, 3], [4]]) + * const M = getMonoid() + * assert.deepStrictEqual(M.concat([1, 2], [3, 4]), [1, 2, 3, 4]) * - * @category combinators + * @category instances * @since 2.5.0 */ -var chop = function (f) { return function (as) { - // tslint:disable-next-line: readonly-array - var result = []; - var cs = as; - while (isNonEmpty(cs)) { - var _a = f(cs), b = _a[0], c = _a[1]; - result.push(b); - cs = c; - } - return result; -}; }; -exports.chop = chop; +var getMonoid = function () { return ({ + concat: exports.getSemigroup().concat, + empty: exports.empty +}); }; +exports.getMonoid = getMonoid; /** - * Splits an array into two pieces, the first piece has `n` elements. + * Derives an `Eq` over the `ReadonlyArray` of a given element type from the `Eq` of that type. The derived `Eq` defines two + * arrays as equal if all elements of both arrays are compared equal pairwise with the given `E`. In case of arrays of + * different lengths, the result is non equality. * * @example - * import { splitAt } from 'fp-ts/ReadonlyArray' + * import * as S from 'fp-ts/string' + * import { getEq } from 'fp-ts/ReadonlyArray' * - * assert.deepStrictEqual(splitAt(2)([1, 2, 3, 4, 5]), [[1, 2], [3, 4, 5]]) + * const E = getEq(S.Eq) + * assert.strictEqual(E.equals(['a', 'b'], ['a', 'b']), true) + * assert.strictEqual(E.equals(['a'], []), false) * + * @category instances * @since 2.5.0 */ -function splitAt(n) { - return function (as) { return [as.slice(0, n), as.slice(n)]; }; -} -exports.splitAt = splitAt; +var getEq = function (E) { + return Eq_1.fromEquals(function (xs, ys) { return xs.length === ys.length && xs.every(function (x, i) { return E.equals(x, ys[i]); }); }); +}; +exports.getEq = getEq; /** - * Splits an array into length-`n` pieces. The last piece will be shorter if `n` does not evenly divide the length of - * the array. Note that `chunksOf(n)([])` is `[]`, not `[[]]`. This is intentional, and is consistent with a recursive - * definition of `chunksOf`; it satisfies the property that - * - * ```ts - * chunksOf(n)(xs).concat(chunksOf(n)(ys)) == chunksOf(n)(xs.concat(ys))) - * ``` - * - * whenever `n` evenly divides the length of `xs`. + * Derives an `Ord` over the `ReadonlyArray` of a given element type from the `Ord` of that type. The ordering between two such + * arrays is equal to: the first non equal comparison of each arrays elements taken pairwise in increasing order, in + * case of equality over all the pairwise elements; the longest array is considered the greatest, if both arrays have + * the same length, the result is equality. * * @example - * import { chunksOf } from 'fp-ts/ReadonlyArray' + * import { getOrd } from 'fp-ts/ReadonlyArray' + * import * as S from 'fp-ts/string' * - * assert.deepStrictEqual(chunksOf(2)([1, 2, 3, 4, 5]), [[1, 2], [3, 4], [5]]) + * const O = getOrd(S.Ord) + * assert.strictEqual(O.compare(['b'], ['a']), 1) + * assert.strictEqual(O.compare(['a'], ['a']), 0) + * assert.strictEqual(O.compare(['a'], ['b']), -1) * * + * @category instances * @since 2.5.0 */ -function chunksOf(n) { - var f = exports.chop(splitAt(n)); - return function (as) { return (as.length === 0 ? exports.empty : isOutOfBound(n - 1, as) ? [as] : f(as)); }; -} -exports.chunksOf = chunksOf; -function comprehension(input, f, g) { - if (g === void 0) { g = function () { return true; }; } - var go = function (scope, input) { - if (input.length === 0) { - return g.apply(void 0, scope) ? [f.apply(void 0, scope)] : exports.empty; - } - else { - return chain_(input[0], function (x) { return go(snoc(scope, x), input.slice(1)); }); - } - }; - return go(exports.empty, input); -} -exports.comprehension = comprehension; -function union(E) { - var elemE = elem(E); - return function (xs, ys) { - if (ys === undefined) { - var unionE_1 = union(E); - return function (ys) { return unionE_1(ys, xs); }; - } - return concat(xs, ys.filter(function (a) { return !elemE(a, xs); })); - }; -} -exports.union = union; -function intersection(E) { - var elemE = elem(E); - return function (xs, ys) { - if (ys === undefined) { - var intersectionE_1 = intersection(E); - return function (ys) { return intersectionE_1(ys, xs); }; - } - return xs.filter(function (a) { return elemE(a, ys); }); - }; -} -exports.intersection = intersection; -function difference(E) { - var elemE = elem(E); - return function (xs, ys) { - if (ys === undefined) { - var differenceE_1 = difference(E); - return function (ys) { return differenceE_1(ys, xs); }; +var getOrd = function (O) { + return Ord_1.fromCompare(function (a, b) { + var aLen = a.length; + var bLen = b.length; + var len = Math.min(aLen, bLen); + for (var i = 0; i < len; i++) { + var ordering = O.compare(a[i], b[i]); + if (ordering !== 0) { + return ordering; + } } - return xs.filter(function (a) { return !elemE(a, ys); }); + return N.Ord.compare(aLen, bLen); + }); +}; +exports.getOrd = getOrd; +/** + * @category instances + * @since 2.11.0 + */ +var getUnionSemigroup = function (E) { + var unionE = union(E); + return { + concat: function (first, second) { return unionE(second)(first); } }; -} -exports.difference = difference; +}; +exports.getUnionSemigroup = getUnionSemigroup; /** - * Wrap a value into the type constructor. - * - * @category Applicative - * @since 2.5.0 + * @category instances + * @since 2.11.0 */ -var of = function (a) { return [a]; }; -exports.of = of; +var getUnionMonoid = function (E) { return ({ + concat: exports.getUnionSemigroup(E).concat, + empty: exports.empty +}); }; +exports.getUnionMonoid = getUnionMonoid; /** - * @category Alternative - * @since 2.7.0 + * @category instances + * @since 2.11.0 */ -var zero = function () { return exports.empty; }; -exports.zero = zero; -// ------------------------------------------------------------------------------------- -// non-pipeables -// ------------------------------------------------------------------------------------- -var map_ = function (fa, f) { return function_1.pipe(fa, exports.map(f)); }; -var mapWithIndex_ = function (fa, f) { return function_1.pipe(fa, exports.mapWithIndex(f)); }; -var ap_ = function (fab, fa) { return function_1.pipe(fab, exports.ap(fa)); }; -var chain_ = function (ma, f) { - return function_1.pipe(ma, exports.chain(f)); -}; -var filter_ = function (fa, predicate) { return function_1.pipe(fa, exports.filter(predicate)); }; -var filterMap_ = function (fa, f) { return function_1.pipe(fa, exports.filterMap(f)); }; -var partitionWithIndex_ = function (fa, predicateWithIndex) { return function_1.pipe(fa, exports.partitionWithIndex(predicateWithIndex)); }; -var partition_ = function (fa, predicate) { return function_1.pipe(fa, exports.partition(predicate)); }; -var partitionMap_ = function (fa, f) { return function_1.pipe(fa, exports.partitionMap(f)); }; -var partitionMapWithIndex_ = function (fa, f) { return function_1.pipe(fa, exports.partitionMapWithIndex(f)); }; -var alt_ = function (fa, that) { return function_1.pipe(fa, exports.alt(that)); }; -var reduce_ = function (fa, b, f) { return function_1.pipe(fa, exports.reduce(b, f)); }; -var foldMap_ = function (M) { - var foldMapM = exports.foldMap(M); - return function (fa, f) { return function_1.pipe(fa, foldMapM(f)); }; -}; -var reduceRight_ = function (fa, b, f) { return function_1.pipe(fa, exports.reduceRight(b, f)); }; -var reduceWithIndex_ = function (fa, b, f) { - var l = fa.length; - var r = b; - for (var i = 0; i < l; i++) { - r = f(i, r, fa[i]); - } - return r; -}; -var foldMapWithIndex_ = function (M) { return function (fa, f) { - return fa.reduce(function (b, a, i) { return M.concat(b, f(i, a)); }, M.empty); -}; }; -var reduceRightWithIndex_ = function (fa, b, f) { - return function_1.pipe(fa, exports.reduceRightWithIndex(b, f)); -}; -var filterMapWithIndex_ = function (fa, f) { - return function_1.pipe(fa, exports.filterMapWithIndex(f)); -}; -var filterWithIndex_ = function (fa, predicateWithIndex) { return function_1.pipe(fa, exports.filterWithIndex(predicateWithIndex)); }; -var extend_ = function (fa, f) { return function_1.pipe(fa, exports.extend(f)); }; -var traverse_ = function (F) { - var traverseF = exports.traverse(F); - return function (ta, f) { return function_1.pipe(ta, traverseF(f)); }; -}; -/* istanbul ignore next */ -var traverseWithIndex_ = function (F) { - var traverseWithIndexF = exports.traverseWithIndex(F); - return function (ta, f) { return function_1.pipe(ta, traverseWithIndexF(f)); }; +var getIntersectionSemigroup = function (E) { + var intersectionE = intersection(E); + return { + concat: function (first, second) { return intersectionE(second)(first); } + }; }; -/* istanbul ignore next */ -var wither_ = function (F) { - var witherF = exports.wither(F); - return function (fa, f) { return function_1.pipe(fa, witherF(f)); }; +exports.getIntersectionSemigroup = getIntersectionSemigroup; +/** + * @category instances + * @since 2.11.0 + */ +var getDifferenceMagma = function (E) { + var differenceE = difference(E); + return { + concat: function (first, second) { return differenceE(second)(first); } + }; }; -/* istanbul ignore next */ -var wilt_ = function (F) { - var wiltF = exports.wilt(F); - return function (fa, f) { return function_1.pipe(fa, wiltF(f)); }; +exports.getDifferenceMagma = getDifferenceMagma; +/** + * @category instances + * @since 2.7.0 + */ +exports.Functor = { + URI: exports.URI, + map: _map }; -// ------------------------------------------------------------------------------------- -// pipeables -// ------------------------------------------------------------------------------------- /** - * Less strict version of [`alt`](#alt). + * Derivable from `Functor`. * - * @category Alt - * @since 2.9.0 + * @category combinators + * @since 2.10.0 */ -var altW = function (that) { return function (fa) { return concat(fa, that()); }; }; -exports.altW = altW; +exports.flap = +/*#__PURE__*/ +Functor_1.flap(exports.Functor); /** - * Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to - * types of kind `* -> *`. - * - * @category Alt - * @since 2.5.0 + * @category instances + * @since 2.10.0 */ -exports.alt = exports.altW; +exports.Pointed = { + URI: exports.URI, + of: exports.of +}; /** - * Apply a function to an argument under a type constructor. - * - * @category Apply - * @since 2.5.0 + * @category instances + * @since 2.7.0 */ -var ap = function (fa) { - return exports.chain(function (f) { return function_1.pipe(fa, exports.map(f)); }); +exports.FunctorWithIndex = { + URI: exports.URI, + map: _map, + mapWithIndex: _mapWithIndex +}; +/** + * @category instances + * @since 2.10.0 + */ +exports.Apply = { + URI: exports.URI, + map: _map, + ap: _ap }; -exports.ap = ap; /** * Combine two effectful actions, keeping only the result of the first. * @@ -11417,10 +13654,9 @@ exports.ap = ap; * @category combinators * @since 2.5.0 */ -var apFirst = function (fb) { - return function_1.flow(exports.map(function (a) { return function () { return a; }; }), exports.ap(fb)); -}; -exports.apFirst = apFirst; +exports.apFirst = +/*#__PURE__*/ +Apply_1.apFirst(exports.Apply); /** * Combine two effectful actions, keeping only the result of the second. * @@ -11429,1110 +13665,1378 @@ exports.apFirst = apFirst; * @category combinators * @since 2.5.0 */ -var apSecond = function (fb) { - return function_1.flow(exports.map(function () { return function (b) { return b; }; }), exports.ap(fb)); +exports.apSecond = +/*#__PURE__*/ +Apply_1.apSecond(exports.Apply); +/** + * @category instances + * @since 2.7.0 + */ +exports.Applicative = { + URI: exports.URI, + map: _map, + ap: _ap, + of: exports.of }; -exports.apSecond = apSecond; /** - * Composes computations in sequence, using the return value of one computation to determine the next computation. - * - * @category Monad - * @since 2.5.0 + * @category instances + * @since 2.10.0 */ -var chain = function (f) { return function (ma) { - return function_1.pipe(ma, exports.chainWithIndex(function (_, a) { return f(a); })); -}; }; -exports.chain = chain; +exports.Chain = { + URI: exports.URI, + map: _map, + ap: _ap, + chain: _chain +}; /** + * @category instances * @since 2.7.0 */ -var chainWithIndex = function (f) { return function (ma) { - var outLen = 0; - var l = ma.length; - var temp = new Array(l); - for (var i = 0; i < l; i++) { - var e = ma[i]; - var arr = f(i, e); - outLen += arr.length; - temp[i] = arr; - } - var out = Array(outLen); - var start = 0; - for (var i = 0; i < l; i++) { - var arr = temp[i]; - var l_1 = arr.length; - for (var j = 0; j < l_1; j++) { - out[j + start] = arr[j]; - } - start += l_1; - } - return out; -}; }; -exports.chainWithIndex = chainWithIndex; +exports.Monad = { + URI: exports.URI, + map: _map, + ap: _ap, + of: exports.of, + chain: _chain +}; /** * Composes computations in sequence, using the return value of one computation to determine the next computation and * keeping only the result of the first. * - * Derivable from `Monad`. + * Derivable from `Chain`. * * @category combinators * @since 2.5.0 */ -var chainFirst = function (f) { - return exports.chain(function (a) { - return function_1.pipe(f(a), exports.map(function () { return a; })); - }); +exports.chainFirst = +/*#__PURE__*/ +Chain_1.chainFirst(exports.Chain); +/** + * @category instances + * @since 2.7.0 + */ +exports.Unfoldable = { + URI: exports.URI, + unfold: exports.unfold }; -exports.chainFirst = chainFirst; /** - * `map` can be used to turn functions `(a: A) => B` into functions `(fa: F) => F` whose argument and return types - * use the type constructor `F` to represent some computational context. - * - * @category Functor - * @since 2.5.0 + * @category instances + * @since 2.7.0 */ -var map = function (f) { return function (fa) { - return fa.map(function (a) { return f(a); }); -}; }; -exports.map = map; +exports.Alt = { + URI: exports.URI, + map: _map, + alt: _alt +}; /** - * @category FunctorWithIndex - * @since 2.5.0 + * @category instances + * @since 2.11.0 */ -var mapWithIndex = function (f) { return function (fa) { return fa.map(function (a, i) { return f(i, a); }); }; }; -exports.mapWithIndex = mapWithIndex; +exports.Zero = { + URI: exports.URI, + zero: exports.zero +}; +/** + * @category constructors + * @since 2.11.0 + */ +exports.guard = +/*#__PURE__*/ +Zero_1.guard(exports.Zero, exports.Pointed); +/** + * @category instances + * @since 2.7.0 + */ +exports.Alternative = { + URI: exports.URI, + map: _map, + ap: _ap, + of: exports.of, + alt: _alt, + zero: exports.zero +}; +/** + * @category instances + * @since 2.7.0 + */ +exports.Extend = { + URI: exports.URI, + map: _map, + extend: _extend +}; +/** + * @category instances + * @since 2.7.0 + */ +exports.Compactable = { + URI: exports.URI, + compact: exports.compact, + separate: exports.separate +}; /** - * @category Compactable - * @since 2.5.0 + * @category instances + * @since 2.7.0 */ -var separate = function (fa) { - // tslint:disable-next-line: readonly-array - var left = []; - // tslint:disable-next-line: readonly-array - var right = []; - for (var _i = 0, fa_1 = fa; _i < fa_1.length; _i++) { - var e = fa_1[_i]; - if (e._tag === 'Left') { - left.push(e.left); - } - else { - right.push(e.right); - } - } - return { - left: left, - right: right - }; +exports.Filterable = { + URI: exports.URI, + map: _map, + compact: exports.compact, + separate: exports.separate, + filter: _filter, + filterMap: _filterMap, + partition: _partition, + partitionMap: _partitionMap }; -exports.separate = separate; /** - * @category Filterable - * @since 2.5.0 + * @category instances + * @since 2.7.0 */ -var filter = function (predicate) { return function (fa) { return fa.filter(predicate); }; }; -exports.filter = filter; +exports.FilterableWithIndex = { + URI: exports.URI, + map: _map, + mapWithIndex: _mapWithIndex, + compact: exports.compact, + separate: exports.separate, + filter: _filter, + filterMap: _filterMap, + partition: _partition, + partitionMap: _partitionMap, + partitionMapWithIndex: _partitionMapWithIndex, + partitionWithIndex: _partitionWithIndex, + filterMapWithIndex: _filterMapWithIndex, + filterWithIndex: _filterWithIndex +}; /** - * @category FilterableWithIndex - * @since 2.5.0 + * @category instances + * @since 2.7.0 */ -var filterMapWithIndex = function (f) { return function (fa) { - // tslint:disable-next-line: readonly-array - var result = []; - for (var i = 0; i < fa.length; i++) { - var optionB = f(i, fa[i]); - if (O.isSome(optionB)) { - result.push(optionB.value); - } - } - return result; -}; }; -exports.filterMapWithIndex = filterMapWithIndex; +exports.Foldable = { + URI: exports.URI, + reduce: _reduce, + foldMap: _foldMap, + reduceRight: _reduceRight +}; /** - * @category Filterable - * @since 2.5.0 + * @category instances + * @since 2.7.0 */ -var filterMap = function (f) { - return exports.filterMapWithIndex(function (_, a) { return f(a); }); +exports.FoldableWithIndex = { + URI: exports.URI, + reduce: _reduce, + foldMap: _foldMap, + reduceRight: _reduceRight, + reduceWithIndex: _reduceWithIndex, + foldMapWithIndex: _foldMapWithIndex, + reduceRightWithIndex: _reduceRightWithIndex }; -exports.filterMap = filterMap; /** - * @category Compactable - * @since 2.5.0 + * @category instances + * @since 2.7.0 */ -exports.compact = -/*#__PURE__*/ -exports.filterMap(function_1.identity); +exports.Traversable = { + URI: exports.URI, + map: _map, + reduce: _reduce, + foldMap: _foldMap, + reduceRight: _reduceRight, + traverse: _traverse, + sequence: exports.sequence +}; /** - * @category Filterable - * @since 2.5.0 + * @category instances + * @since 2.7.0 */ -var partition = function (predicate) { - return exports.partitionWithIndex(function (_, a) { return predicate(a); }); +exports.TraversableWithIndex = { + URI: exports.URI, + map: _map, + mapWithIndex: _mapWithIndex, + reduce: _reduce, + foldMap: _foldMap, + reduceRight: _reduceRight, + reduceWithIndex: _reduceWithIndex, + foldMapWithIndex: _foldMapWithIndex, + reduceRightWithIndex: _reduceRightWithIndex, + traverse: _traverse, + sequence: exports.sequence, + traverseWithIndex: _traverseWithIndex }; -exports.partition = partition; /** - * @category FilterableWithIndex - * @since 2.5.0 + * @category ChainRec + * @since 2.11.0 */ -var partitionWithIndex = function (predicateWithIndex) { return function (fa) { - // tslint:disable-next-line: readonly-array - var left = []; - // tslint:disable-next-line: readonly-array - var right = []; - for (var i = 0; i < fa.length; i++) { - var a = fa[i]; - if (predicateWithIndex(i, a)) { - right.push(a); +var chainRecDepthFirst = function (f) { return function (a) { + var todo = __spreadArray([], f(a)); + var out = []; + while (todo.length > 0) { + var e = todo.shift(); + if (_.isLeft(e)) { + todo.unshift.apply(todo, f(e.left)); } else { - left.push(a); + out.push(e.right); } } - return { - left: left, - right: right - }; + return out; }; }; -exports.partitionWithIndex = partitionWithIndex; +exports.chainRecDepthFirst = chainRecDepthFirst; /** - * @category Filterable - * @since 2.5.0 - */ -var partitionMap = function (f) { - return exports.partitionMapWithIndex(function (_, a) { return f(a); }); -}; -exports.partitionMap = partitionMap; -/** - * @category FilterableWithIndex - * @since 2.5.0 + * @category instances + * @since 2.11.0 */ -var partitionMapWithIndex = function (f) { return function (fa) { - // tslint:disable-next-line: readonly-array - var left = []; - // tslint:disable-next-line: readonly-array - var right = []; - for (var i = 0; i < fa.length; i++) { - var e = f(i, fa[i]); - if (e._tag === 'Left') { - left.push(e.left); +exports.ChainRecDepthFirst = { + URI: exports.URI, + map: _map, + ap: _ap, + chain: _chain, + chainRec: exports._chainRecDepthFirst +}; +/** + * @category ChainRec + * @since 2.11.0 + */ +var chainRecBreadthFirst = function (f) { return function (a) { + var initial = f(a); + var todo = []; + var out = []; + function go(e) { + if (_.isLeft(e)) { + f(e.left).forEach(function (v) { return todo.push(v); }); } else { - right.push(e.right); + out.push(e.right); } } - return { - left: left, - right: right - }; + for (var _i = 0, initial_1 = initial; _i < initial_1.length; _i++) { + var e = initial_1[_i]; + go(e); + } + while (todo.length > 0) { + go(todo.shift()); + } + return out; }; }; -exports.partitionMapWithIndex = partitionMapWithIndex; +exports.chainRecBreadthFirst = chainRecBreadthFirst; /** - * @category FilterableWithIndex - * @since 2.5.0 + * @category instances + * @since 2.11.0 */ -var filterWithIndex = function (predicateWithIndex) { return function (fa) { - return fa.filter(function (a, i) { return predicateWithIndex(i, a); }); -}; }; -exports.filterWithIndex = filterWithIndex; +exports.ChainRecBreadthFirst = { + URI: exports.URI, + map: _map, + ap: _ap, + chain: _chain, + chainRec: exports._chainRecBreadthFirst +}; +var _wither = Witherable_1.witherDefault(exports.Traversable, exports.Compactable); +var _wilt = Witherable_1.wiltDefault(exports.Traversable, exports.Compactable); /** - * @category Extend - * @since 2.5.0 + * @category instances + * @since 2.7.0 */ -var extend = function (f) { return function (wa) { return wa.map(function (_, i, as) { return f(as.slice(i)); }); }; }; -exports.extend = extend; +exports.Witherable = { + URI: exports.URI, + map: _map, + compact: exports.compact, + separate: exports.separate, + filter: _filter, + filterMap: _filterMap, + partition: _partition, + partitionMap: _partitionMap, + reduce: _reduce, + foldMap: _foldMap, + reduceRight: _reduceRight, + traverse: _traverse, + sequence: exports.sequence, + wither: _wither, + wilt: _wilt +}; /** - * Derivable from `Extend`. + * Filter values inside a context. + * + * @example + * import { pipe } from 'fp-ts/function' + * import * as RA from 'fp-ts/ReadonlyArray' + * import * as T from 'fp-ts/Task' + * + * const filterE = RA.filterE(T.ApplicativePar) + * async function test() { + * assert.deepStrictEqual( + * await pipe( + * [-1, 2, 3], + * filterE((n) => T.of(n > 0)) + * )(), + * [2, 3] + * ) + * } + * test() * + * @since 2.11.0 + */ +exports.filterE = +/*#__PURE__*/ +Witherable_1.filterE(exports.Witherable); +/** + * @category instances + * @since 2.11.0 + */ +exports.FromEither = { + URI: exports.URI, + fromEither: exports.fromEither +}; +/** * @category combinators - * @since 2.5.0 + * @since 2.11.0 */ -exports.duplicate = +exports.fromEitherK = /*#__PURE__*/ -exports.extend(function_1.identity); +FromEither_1.fromEitherK(exports.FromEither); +// ------------------------------------------------------------------------------------- +// unsafe +// ------------------------------------------------------------------------------------- /** - * @category FoldableWithIndex + * @category unsafe * @since 2.5.0 */ -var foldMapWithIndex = function (M) { - var foldMapWithIndexM = foldMapWithIndex_(M); - return function (f) { return function (fa) { return foldMapWithIndexM(fa, f); }; }; -}; -exports.foldMapWithIndex = foldMapWithIndex; +exports.unsafeInsertAt = RNEA.unsafeInsertAt; /** - * @category Foldable + * @category unsafe * @since 2.5.0 */ -var reduce = function (b, f) { - return exports.reduceWithIndex(b, function (_, b, a) { return f(b, a); }); +var unsafeUpdateAt = function (i, a, as) { + return exports.isNonEmpty(as) ? RNEA.unsafeUpdateAt(i, a, as) : as; }; -exports.reduce = reduce; +exports.unsafeUpdateAt = unsafeUpdateAt; /** - * @category Foldable + * @category unsafe * @since 2.5.0 */ -var foldMap = function (M) { - var foldMapWithIndexM = exports.foldMapWithIndex(M); - return function (f) { return foldMapWithIndexM(function (_, a) { return f(a); }); }; +var unsafeDeleteAt = function (i, as) { + var xs = as.slice(); + xs.splice(i, 1); + return xs; }; -exports.foldMap = foldMap; +exports.unsafeDeleteAt = unsafeDeleteAt; +// ------------------------------------------------------------------------------------- +// interop +// ------------------------------------------------------------------------------------- /** - * @category FoldableWithIndex + * @category interop * @since 2.5.0 */ -var reduceWithIndex = function (b, f) { return function (fa) { return reduceWithIndex_(fa, b, f); }; }; -exports.reduceWithIndex = reduceWithIndex; +var toArray = function (as) { return as.slice(); }; +exports.toArray = toArray; /** - * @category Foldable + * @category interop * @since 2.5.0 */ -var reduceRight = function (b, f) { - return exports.reduceRightWithIndex(b, function (_, a, b) { return f(a, b); }); -}; -exports.reduceRight = reduceRight; +var fromArray = function (as) { return (exports.isEmpty(as) ? exports.empty : as.slice()); }; +exports.fromArray = fromArray; +// ------------------------------------------------------------------------------------- +// utils +// ------------------------------------------------------------------------------------- /** - * @category FoldableWithIndex + * An empty array + * * @since 2.5.0 */ -var reduceRightWithIndex = function (b, f) { return function (fa) { return fa.reduceRight(function (b, a, i) { return f(i, a, b); }, b); }; }; -exports.reduceRightWithIndex = reduceRightWithIndex; +exports.empty = RNEA.empty; /** - * **for optimized and stack safe version check the data types `traverseArray` function** - * @category Traversable - * @since 2.6.3 + * Check if a predicate holds true for every array member. + * + * @example + * import { every } from 'fp-ts/ReadonlyArray' + * import { pipe } from 'fp-ts/function' + * + * const isPositive = (n: number): boolean => n > 0 + * + * assert.deepStrictEqual(pipe([1, 2, 3], every(isPositive)), true) + * assert.deepStrictEqual(pipe([1, 2, -3], every(isPositive)), false) + * + * @since 2.9.0 */ -var traverse = function (F) { - var traverseWithIndexF = exports.traverseWithIndex(F); - return function (f) { return traverseWithIndexF(function (_, a) { return f(a); }); }; -}; -exports.traverse = traverse; +var every = function (predicate) { return function (as) { return as.every(predicate); }; }; +exports.every = every; /** - * **for optimized and stack safe version check the data types `sequenceArray` function** - * @category Traversable - * @since 2.6.3 + * Check if a predicate holds true for any array member. + * + * @example + * import { some } from 'fp-ts/ReadonlyArray' + * import { pipe } from 'fp-ts/function' + * + * const isPositive = (n: number): boolean => n > 0 + * + * assert.deepStrictEqual(pipe([-1, -2, 3], some(isPositive)), true) + * assert.deepStrictEqual(pipe([-1, -2, -3], some(isPositive)), false) + * + * @since 2.9.0 */ -var sequence = function (F) { return function (ta) { - return reduce_(ta, F.of(exports.zero()), function (fas, fa) { - return F.ap(F.map(fas, function (as) { return function (a) { return snoc(as, a); }; }), fa); - }); +var some = function (predicate) { return function (as) { + return as.some(predicate); }; }; -exports.sequence = sequence; +exports.some = some; /** - * **for optimized and stack safe version check the data types `traverseArrayWithIndex` function** - * @category TraversableWithIndex - * @since 2.6.3 + * Alias of [`some`](#some) + * + * @since 2.11.0 */ -var traverseWithIndex = function (F) { return function (f) { - return exports.reduceWithIndex(F.of(exports.zero()), function (i, fbs, a) { - return F.ap(F.map(fbs, function (bs) { return function (b) { return snoc(bs, b); }; }), f(i, a)); - }); -}; }; -exports.traverseWithIndex = traverseWithIndex; +exports.exists = exports.some; +// ------------------------------------------------------------------------------------- +// do notation +// ------------------------------------------------------------------------------------- /** - * @category Witherable - * @since 2.6.5 + * @since 2.9.0 + */ +exports.Do = +/*#__PURE__*/ +exports.of(_.emptyRecord); +/** + * @since 2.8.0 */ -var wither = function (F) { - var traverseF = exports.traverse(F); - return function (f) { return function (fa) { return F.map(function_1.pipe(fa, traverseF(f)), exports.compact); }; }; -}; -exports.wither = wither; +exports.bindTo = +/*#__PURE__*/ +Functor_1.bindTo(exports.Functor); /** - * @category Witherable - * @since 2.6.5 + * @since 2.8.0 */ -var wilt = function (F) { - var traverseF = exports.traverse(F); - return function (f) { return function (fa) { return F.map(function_1.pipe(fa, traverseF(f)), exports.separate); }; }; -}; -exports.wilt = wilt; +exports.bind = +/*#__PURE__*/ +Chain_1.bind(exports.Chain); +// ------------------------------------------------------------------------------------- +// pipeable sequence S +// ------------------------------------------------------------------------------------- /** - * @category Unfoldable - * @since 2.6.6 + * @since 2.8.0 */ -var unfold = function (b, f) { - // tslint:disable-next-line: readonly-array - var ret = []; - var bb = b; - while (true) { - var mt = f(bb); - if (O.isSome(mt)) { - var _a = mt.value, a = _a[0], b_1 = _a[1]; - ret.push(a); - bb = b_1; - } - else { - break; - } - } - return ret; -}; -exports.unfold = unfold; +exports.apS = +/*#__PURE__*/ +Apply_1.apS(exports.Apply); // ------------------------------------------------------------------------------------- -// instances +// deprecated // ------------------------------------------------------------------------------------- +// tslint:disable: deprecation /** - * @category instances + * Use `ReadonlyNonEmptyArray` module instead. + * + * @category constructors * @since 2.5.0 + * @deprecated */ -exports.URI = 'ReadonlyArray'; +exports.range = RNEA.range; /** - * @category instances - * @since 2.7.0 + * Use [`prepend`](#prepend) instead. + * + * @category constructors + * @since 2.5.0 + * @deprecated */ -exports.Functor = { - URI: exports.URI, - map: map_ -}; +exports.cons = RNEA.cons; /** - * @category instances - * @since 2.7.0 + * Use [`append`](#append) instead. + * + * @category constructors + * @since 2.5.0 + * @deprecated */ -exports.FunctorWithIndex = { - URI: exports.URI, - map: map_, - mapWithIndex: mapWithIndex_ -}; +exports.snoc = RNEA.snoc; /** - * @category instances - * @since 2.7.0 + * Use [`prependAll`](#prependall) instead. + * + * @category combinators + * @since 2.9.0 + * @deprecated */ -exports.Applicative = { - URI: exports.URI, - map: map_, - ap: ap_, - of: exports.of -}; +exports.prependToAll = exports.prependAll; /** + * Use small, specific instances instead. + * * @category instances - * @since 2.7.0 + * @since 2.5.0 + * @deprecated */ -exports.Monad = { +exports.readonlyArray = { URI: exports.URI, - map: map_, - ap: ap_, + compact: exports.compact, + separate: exports.separate, + map: _map, + ap: _ap, of: exports.of, - chain: chain_ + chain: _chain, + filter: _filter, + filterMap: _filterMap, + partition: _partition, + partitionMap: _partitionMap, + mapWithIndex: _mapWithIndex, + partitionMapWithIndex: _partitionMapWithIndex, + partitionWithIndex: _partitionWithIndex, + filterMapWithIndex: _filterMapWithIndex, + filterWithIndex: _filterWithIndex, + alt: _alt, + zero: exports.zero, + unfold: exports.unfold, + reduce: _reduce, + foldMap: _foldMap, + reduceRight: _reduceRight, + traverse: _traverse, + sequence: exports.sequence, + reduceWithIndex: _reduceWithIndex, + foldMapWithIndex: _foldMapWithIndex, + reduceRightWithIndex: _reduceRightWithIndex, + traverseWithIndex: _traverseWithIndex, + extend: _extend, + wither: _wither, + wilt: _wilt }; -/** - * @category instances - * @since 2.7.0 - */ -exports.Unfoldable = { - URI: exports.URI, - unfold: exports.unfold + + +/***/ }), + +/***/ 8630: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; }; -/** - * @category instances - * @since 2.7.0 - */ -exports.Alt = { - URI: exports.URI, - map: map_, - alt: alt_ +var __spreadArray = (this && this.__spreadArray) || function (to, from) { + for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) + to[j] = from[i]; + return to; }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.reduceRight = exports.foldMap = exports.reduce = exports.mapWithIndex = exports.map = exports.flatten = exports.duplicate = exports.extend = exports.chain = exports.ap = exports.alt = exports.altW = exports.of = exports.chunksOf = exports.splitAt = exports.chop = exports.chainWithIndex = exports.intersperse = exports.prependAll = exports.unzip = exports.zip = exports.zipWith = exports.modifyAt = exports.updateAt = exports.sort = exports.groupBy = exports.group = exports.reverse = exports.concat = exports.concatW = exports.fromArray = exports.unappend = exports.unprepend = exports.range = exports.replicate = exports.makeBy = exports.fromReadonlyArray = exports.rotate = exports.union = exports.sortBy = exports.uniq = exports.unsafeUpdateAt = exports.unsafeInsertAt = exports.append = exports.appendW = exports.prepend = exports.prependW = exports.isOutOfBound = exports.isNonEmpty = exports.empty = void 0; +exports.uncons = exports.filterWithIndex = exports.filter = exports.groupSort = exports.updateLast = exports.modifyLast = exports.updateHead = exports.modifyHead = exports.matchRight = exports.matchLeft = exports.concatAll = exports.max = exports.min = exports.init = exports.last = exports.tail = exports.head = exports.apS = exports.bind = exports.bindTo = exports.Do = exports.Comonad = exports.Alt = exports.TraversableWithIndex = exports.Traversable = exports.FoldableWithIndex = exports.Foldable = exports.Monad = exports.chainFirst = exports.Chain = exports.Applicative = exports.apSecond = exports.apFirst = exports.Apply = exports.FunctorWithIndex = exports.Pointed = exports.flap = exports.Functor = exports.getUnionSemigroup = exports.getEq = exports.getSemigroup = exports.getShow = exports.URI = exports.extract = exports.traverseWithIndex = exports.sequence = exports.traverse = exports.reduceRightWithIndex = exports.foldMapWithIndex = exports.reduceWithIndex = void 0; +exports.readonlyNonEmptyArray = exports.fold = exports.prependToAll = exports.insertAt = exports.snoc = exports.cons = exports.unsnoc = void 0; +var Apply_1 = __nccwpck_require__(205); +var Chain_1 = __nccwpck_require__(2372); +var Eq_1 = __nccwpck_require__(6964); +var function_1 = __nccwpck_require__(6985); +var Functor_1 = __nccwpck_require__(5533); +var _ = __importStar(__nccwpck_require__(1840)); +var Ord_1 = __nccwpck_require__(6685); +var Se = __importStar(__nccwpck_require__(6339)); +// ------------------------------------------------------------------------------------- +// internal +// ------------------------------------------------------------------------------------- /** - * @category instances - * @since 2.7.0 + * @internal */ -exports.Alternative = { - URI: exports.URI, - map: map_, - ap: ap_, - of: exports.of, - alt: alt_, - zero: exports.zero -}; +exports.empty = _.emptyReadonlyArray; /** - * @category instances - * @since 2.7.0 + * @internal */ -exports.Extend = { - URI: exports.URI, - map: map_, - extend: extend_ -}; +exports.isNonEmpty = _.isNonEmpty; /** - * @category instances - * @since 2.7.0 + * @internal */ -exports.Compactable = { - URI: exports.URI, - compact: exports.compact, - separate: exports.separate -}; +var isOutOfBound = function (i, as) { return i < 0 || i >= as.length; }; +exports.isOutOfBound = isOutOfBound; /** - * @category instances - * @since 2.7.0 + * @internal */ -exports.Filterable = { - URI: exports.URI, - map: map_, - compact: exports.compact, - separate: exports.separate, - filter: filter_, - filterMap: filterMap_, - partition: partition_, - partitionMap: partitionMap_ -}; +var prependW = function (head) { return function (tail) { return __spreadArray([head], tail); }; }; +exports.prependW = prependW; /** - * @category instances - * @since 2.7.0 + * @internal */ -exports.FilterableWithIndex = { - URI: exports.URI, - map: map_, - mapWithIndex: mapWithIndex_, - compact: exports.compact, - separate: exports.separate, - filter: filter_, - filterMap: filterMap_, - partition: partition_, - partitionMap: partitionMap_, - partitionMapWithIndex: partitionMapWithIndex_, - partitionWithIndex: partitionWithIndex_, - filterMapWithIndex: filterMapWithIndex_, - filterWithIndex: filterWithIndex_ -}; +exports.prepend = exports.prependW; /** - * @category instances - * @since 2.7.0 + * @internal */ -exports.Foldable = { - URI: exports.URI, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_ -}; +var appendW = function (end) { return function (init) { return __spreadArray(__spreadArray([], init), [end]); }; }; +exports.appendW = appendW; /** - * @category instances - * @since 2.7.0 + * @internal */ -exports.FoldableWithIndex = { - URI: exports.URI, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - reduceWithIndex: reduceWithIndex_, - foldMapWithIndex: foldMapWithIndex_, - reduceRightWithIndex: reduceRightWithIndex_ -}; +exports.append = exports.appendW; /** - * @category instances - * @since 2.7.0 + * @internal */ -exports.Traversable = { - URI: exports.URI, - map: map_, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - traverse: traverse_, - sequence: exports.sequence +var unsafeInsertAt = function (i, a, as) { + if (exports.isNonEmpty(as)) { + var xs = _.fromReadonlyNonEmptyArray(as); + xs.splice(i, 0, a); + return xs; + } + return [a]; }; +exports.unsafeInsertAt = unsafeInsertAt; /** - * @category instances - * @since 2.7.0 + * @internal */ -exports.TraversableWithIndex = { - URI: exports.URI, - map: map_, - mapWithIndex: mapWithIndex_, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - reduceWithIndex: reduceWithIndex_, - foldMapWithIndex: foldMapWithIndex_, - reduceRightWithIndex: reduceRightWithIndex_, - traverse: traverse_, - sequence: exports.sequence, - traverseWithIndex: traverseWithIndex_ +var unsafeUpdateAt = function (i, a, as) { + if (as[i] === a) { + return as; + } + else { + var xs = _.fromReadonlyNonEmptyArray(as); + xs[i] = a; + return xs; + } }; +exports.unsafeUpdateAt = unsafeUpdateAt; /** - * @category instances - * @since 2.7.0 + * Remove duplicates from a `ReadonlyNonEmptyArray`, keeping the first occurrence of an element. + * + * @example + * import { uniq } from 'fp-ts/ReadonlyNonEmptyArray' + * import * as N from 'fp-ts/number' + * + * assert.deepStrictEqual(uniq(N.Eq)([1, 2, 1]), [1, 2]) + * + * @category combinators + * @since 2.11.0 */ -exports.Witherable = { - URI: exports.URI, - map: map_, - compact: exports.compact, - separate: exports.separate, - filter: filter_, - filterMap: filterMap_, - partition: partition_, - partitionMap: partitionMap_, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - traverse: traverse_, - sequence: exports.sequence, - wither: wither_, - wilt: wilt_ -}; -// TODO: remove in v3 +var uniq = function (E) { return function (as) { + if (as.length === 1) { + return as; + } + var out = [exports.head(as)]; + var rest = exports.tail(as); + var _loop_1 = function (a) { + if (out.every(function (o) { return !E.equals(o, a); })) { + out.push(a); + } + }; + for (var _i = 0, rest_1 = rest; _i < rest_1.length; _i++) { + var a = rest_1[_i]; + _loop_1(a); + } + return out; +}; }; +exports.uniq = uniq; /** - * @category instances - * @since 2.5.0 - */ -exports.readonlyArray = { - URI: exports.URI, - compact: exports.compact, - separate: exports.separate, - map: map_, - ap: ap_, - of: exports.of, - chain: chain_, - filter: filter_, - filterMap: filterMap_, - partition: partition_, - partitionMap: partitionMap_, - mapWithIndex: mapWithIndex_, - partitionMapWithIndex: partitionMapWithIndex_, - partitionWithIndex: partitionWithIndex_, - filterMapWithIndex: filterMapWithIndex_, - filterWithIndex: filterWithIndex_, - alt: alt_, - zero: exports.zero, - unfold: exports.unfold, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - traverse: traverse_, - sequence: exports.sequence, - reduceWithIndex: reduceWithIndex_, - foldMapWithIndex: foldMapWithIndex_, - reduceRightWithIndex: reduceRightWithIndex_, - traverseWithIndex: traverseWithIndex_, - extend: extend_, - wither: wither_, - wilt: wilt_ + * Sort the elements of a `ReadonlyNonEmptyArray` in increasing order, where elements are compared using first `ords[0]`, then `ords[1]`, + * etc... + * + * @example + * import * as RNEA from 'fp-ts/ReadonlyNonEmptyArray' + * import { contramap } from 'fp-ts/Ord' + * import * as S from 'fp-ts/string' + * import * as N from 'fp-ts/number' + * import { pipe } from 'fp-ts/function' + * + * interface Person { + * name: string + * age: number + * } + * + * const byName = pipe(S.Ord, contramap((p: Person) => p.name)) + * + * const byAge = pipe(N.Ord, contramap((p: Person) => p.age)) + * + * const sortByNameByAge = RNEA.sortBy([byName, byAge]) + * + * const persons: RNEA.ReadonlyNonEmptyArray = [ + * { name: 'a', age: 1 }, + * { name: 'b', age: 3 }, + * { name: 'c', age: 2 }, + * { name: 'b', age: 2 } + * ] + * + * assert.deepStrictEqual(sortByNameByAge(persons), [ + * { name: 'a', age: 1 }, + * { name: 'b', age: 2 }, + * { name: 'b', age: 3 }, + * { name: 'c', age: 2 } + * ]) + * + * @category combinators + * @since 2.11.0 + */ +var sortBy = function (ords) { + if (exports.isNonEmpty(ords)) { + var M = Ord_1.getMonoid(); + return exports.sort(ords.reduce(M.concat, M.empty)); + } + return function_1.identity; }; -// ------------------------------------------------------------------------------------- -// unsafe -// ------------------------------------------------------------------------------------- +exports.sortBy = sortBy; /** - * @category unsafe - * @since 2.5.0 + * @category combinators + * @since 2.11.0 */ -function unsafeInsertAt(i, a, as) { - var xs = as.slice(); - xs.splice(i, 0, a); - return xs; -} -exports.unsafeInsertAt = unsafeInsertAt; +var union = function (E) { + var uniqE = exports.uniq(E); + return function (second) { return function (first) { return uniqE(function_1.pipe(first, concat(second))); }; }; +}; +exports.union = union; /** - * @category unsafe - * @since 2.5.0 + * Rotate a `ReadonlyNonEmptyArray` by `n` steps. + * + * @example + * import { rotate } from 'fp-ts/ReadonlyNonEmptyArray' + * + * assert.deepStrictEqual(rotate(2)([1, 2, 3, 4, 5]), [4, 5, 1, 2, 3]) + * assert.deepStrictEqual(rotate(-2)([1, 2, 3, 4, 5]), [3, 4, 5, 1, 2]) + * + * @category combinators + * @since 2.11.0 */ -function unsafeUpdateAt(i, a, as) { - if (as[i] === a) { +var rotate = function (n) { return function (as) { + var len = as.length; + var m = Math.round(n) % len; + if (exports.isOutOfBound(Math.abs(m), as) || m === 0) { return as; } + if (m < 0) { + var _a = exports.splitAt(-m)(as), f = _a[0], s = _a[1]; + return function_1.pipe(s, concat(f)); + } else { - var xs = as.slice(); - xs[i] = a; - return xs; + return exports.rotate(m - len)(as); } -} -exports.unsafeUpdateAt = unsafeUpdateAt; -/** - * @category unsafe - * @since 2.5.0 - */ -function unsafeDeleteAt(i, as) { - var xs = as.slice(); - xs.splice(i, 1); - return xs; -} -exports.unsafeDeleteAt = unsafeDeleteAt; +}; }; +exports.rotate = rotate; // ------------------------------------------------------------------------------------- -// utils +// constructors // ------------------------------------------------------------------------------------- /** - * An empty array + * Return a `ReadonlyNonEmptyArray` from a `ReadonlyArray` returning `none` if the input is empty. * + * @category constructors * @since 2.5.0 */ -exports.empty = []; +var fromReadonlyArray = function (as) { + return exports.isNonEmpty(as) ? _.some(as) : _.none; +}; +exports.fromReadonlyArray = fromReadonlyArray; /** - * Check if a predicate holds true for every array member. + * Return a `ReadonlyNonEmptyArray` of length `n` with element `i` initialized with `f(i)`. + * + * **Note**. `n` is normalized to a natural number. * * @example - * import { every } from 'fp-ts/ReadonlyArray' + * import { makeBy } from 'fp-ts/ReadonlyNonEmptyArray' * import { pipe } from 'fp-ts/function' * - * const isPositive = (n: number): boolean => n > 0 - * - * assert.deepStrictEqual(pipe([1, 2, 3], every(isPositive)), true) - * assert.deepStrictEqual(pipe([1, 2, -3], every(isPositive)), false) + * const double = (n: number): number => n * 2 + * assert.deepStrictEqual(pipe(5, makeBy(double)), [0, 2, 4, 6, 8]) * - * @since 2.9.0 + * @category constructors + * @since 2.11.0 */ -var every = function (predicate) { return function (as) { return as.every(predicate); }; }; -exports.every = every; +var makeBy = function (f) { return function (n) { + var j = Math.max(0, Math.floor(n)); + var out = [f(0)]; + for (var i = 1; i < j; i++) { + out.push(f(i)); + } + return out; +}; }; +exports.makeBy = makeBy; /** - * Check if a predicate holds true for any array member. + * Create a `ReadonlyNonEmptyArray` containing a value repeated the specified number of times. + * + * **Note**. `n` is normalized to a natural number. * * @example - * import { some } from 'fp-ts/ReadonlyArray' + * import { replicate } from 'fp-ts/ReadonlyNonEmptyArray' * import { pipe } from 'fp-ts/function' * - * const isPositive = (n: number): boolean => n > 0 + * assert.deepStrictEqual(pipe(3, replicate('a')), ['a', 'a', 'a']) * - * assert.deepStrictEqual(pipe([-1, -2, 3], some(isPositive)), true) - * assert.deepStrictEqual(pipe([-1, -2, -3], some(isPositive)), false) + * @category constructors + * @since 2.11.0 + */ +var replicate = function (a) { return exports.makeBy(function () { return a; }); }; +exports.replicate = replicate; +/** + * Create a `ReadonlyNonEmptyArray` containing a range of integers, including both endpoints. * - * @since 2.9.0 + * @example + * import { range } from 'fp-ts/ReadonlyNonEmptyArray' + * + * assert.deepStrictEqual(range(1, 5), [1, 2, 3, 4, 5]) + * + * @category constructors + * @since 2.11.0 */ -var some = function (predicate) { return function (as) { return as.some(predicate); }; }; -exports.some = some; +var range = function (start, end) { + return start <= end ? exports.makeBy(function (i) { return start + i; })(end - start + 1) : [start]; +}; +exports.range = range; // ------------------------------------------------------------------------------------- -// do notation +// destructors // ------------------------------------------------------------------------------------- /** + * Return the tuple of the `head` and the `tail`. + * + * @example + * import { unprepend } from 'fp-ts/ReadonlyNonEmptyArray' + * + * assert.deepStrictEqual(unprepend([1, 2, 3, 4]), [1, [2, 3, 4]]) + * + * @category destructors * @since 2.9.0 */ -exports.Do = -/*#__PURE__*/ -exports.of({}); +var unprepend = function (as) { return [exports.head(as), exports.tail(as)]; }; +exports.unprepend = unprepend; /** - * @since 2.8.0 + * Return the tuple of the `init` and the `last`. + * + * @example + * import { unappend } from 'fp-ts/ReadonlyNonEmptyArray' + * + * assert.deepStrictEqual(unappend([1, 2, 3, 4]), [[1, 2, 3], 4]) + * + * @category destructors + * @since 2.9.0 + */ +var unappend = function (as) { return [exports.init(as), exports.last(as)]; }; +exports.unappend = unappend; +// ------------------------------------------------------------------------------------- +// interop +// ------------------------------------------------------------------------------------- +/** + * @category interop + * @since 2.5.0 + */ +var fromArray = function (as) { return exports.fromReadonlyArray(as.slice()); }; +exports.fromArray = fromArray; +function concatW(second) { + return function (first) { return first.concat(second); }; +} +exports.concatW = concatW; +function concat(x, y) { + return y ? x.concat(y) : function (y) { return y.concat(x); }; +} +exports.concat = concat; +/** + * @category combinators + * @since 2.5.0 */ -var bindTo = function (name) { - return exports.map(function_1.bindTo_(name)); +var reverse = function (as) { + return as.length === 1 ? as : __spreadArray([exports.last(as)], as.slice(0, -1).reverse()); }; -exports.bindTo = bindTo; +exports.reverse = reverse; +function group(E) { + return function (as) { + var len = as.length; + if (len === 0) { + return exports.empty; + } + var out = []; + var head = as[0]; + var nea = [head]; + for (var i = 1; i < len; i++) { + var a = as[i]; + if (E.equals(a, head)) { + nea.push(a); + } + else { + out.push(nea); + head = a; + nea = [head]; + } + } + out.push(nea); + return out; + }; +} +exports.group = group; /** - * @since 2.8.0 + * Splits an array into sub-non-empty-arrays stored in an object, based on the result of calling a `string`-returning + * function on each element, and grouping the results according to values returned + * + * @example + * import { groupBy } from 'fp-ts/ReadonlyNonEmptyArray' + * + * assert.deepStrictEqual(groupBy((s: string) => String(s.length))(['a', 'b', 'ab']), { + * '1': ['a', 'b'], + * '2': ['ab'] + * }) + * + * @category combinators + * @since 2.5.0 */ -var bind = function (name, f) { - return exports.chain(function (a) { - return function_1.pipe(f(a), exports.map(function (b) { return function_1.bind_(a, name, b); })); - }); +var groupBy = function (f) { return function (as) { + var out = {}; + for (var _i = 0, as_1 = as; _i < as_1.length; _i++) { + var a = as_1[_i]; + var k = f(a); + if (out.hasOwnProperty(k)) { + out[k].push(a); + } + else { + out[k] = [a]; + } + } + return out; +}; }; +exports.groupBy = groupBy; +/** + * @category combinators + * @since 2.5.0 + */ +var sort = function (O) { return function (as) { + return as.length === 1 ? as : as.slice().sort(O.compare); +}; }; +exports.sort = sort; +/** + * @category combinators + * @since 2.5.0 + */ +var updateAt = function (i, a) { + return exports.modifyAt(i, function () { return a; }); }; -exports.bind = bind; -// ------------------------------------------------------------------------------------- -// pipeable sequence S -// ------------------------------------------------------------------------------------- +exports.updateAt = updateAt; /** - * @since 2.8.0 + * @category combinators + * @since 2.5.0 + */ +var modifyAt = function (i, f) { return function (as) { return (exports.isOutOfBound(i, as) ? _.none : _.some(exports.unsafeUpdateAt(i, f(as[i]), as))); }; }; +exports.modifyAt = modifyAt; +/** + * @category combinators + * @since 2.5.1 */ -var apS = function (name, fb) { - return function_1.flow(exports.map(function (a) { return function (b) { return function_1.bind_(a, name, b); }; }), exports.ap(fb)); +var zipWith = function (as, bs, f) { + var cs = [f(as[0], bs[0])]; + var len = Math.min(as.length, bs.length); + for (var i = 1; i < len; i++) { + cs[i] = f(as[i], bs[i]); + } + return cs; }; -exports.apS = apS; - - -/***/ }), - -/***/ 8630: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; +exports.zipWith = zipWith; +function zip(as, bs) { + if (bs === undefined) { + return function (bs) { return zip(bs, as); }; + } + return exports.zipWith(as, bs, function (a, b) { return [a, b]; }); +} +exports.zip = zip; +/** + * @category combinators + * @since 2.5.1 + */ +var unzip = function (abs) { + var fa = [abs[0][0]]; + var fb = [abs[0][1]]; + for (var i = 1; i < abs.length; i++) { + fa[i] = abs[i][0]; + fb[i] = abs[i][1]; + } + return [fa, fb]; }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.reduceRight = exports.reduceWithIndex = exports.reduce = exports.mapWithIndex = exports.map = exports.flatten = exports.extend = exports.duplicate = exports.chainFirst = exports.chain = exports.apSecond = exports.apFirst = exports.ap = exports.alt = exports.altW = exports.foldMap = exports.foldMapWithIndex = exports.intersperse = exports.prependToAll = exports.unzip = exports.zip = exports.zipWith = exports.fold = exports.concat = exports.of = exports.filterWithIndex = exports.filter = exports.modifyAt = exports.updateAt = exports.insertAt = exports.sort = exports.init = exports.last = exports.groupBy = exports.groupSort = exports.group = exports.getEq = exports.getSemigroup = exports.max = exports.min = exports.reverse = exports.tail = exports.head = exports.getShow = exports.unsnoc = exports.uncons = exports.fromArray = exports.fromReadonlyArray = exports.snoc = exports.cons = void 0; -exports.apS = exports.bind = exports.bindTo = exports.Do = exports.readonlyNonEmptyArray = exports.Comonad = exports.Alt = exports.TraversableWithIndex = exports.Traversable = exports.FoldableWithIndex = exports.Foldable = exports.Monad = exports.Applicative = exports.FunctorWithIndex = exports.Functor = exports.URI = exports.extract = exports.traverseWithIndex = exports.sequence = exports.traverse = exports.reduceRightWithIndex = void 0; -var function_1 = __nccwpck_require__(6985); -var Option_1 = __nccwpck_require__(2569); -var RA = __importStar(__nccwpck_require__(4234)); -var Semigroup_1 = __nccwpck_require__(6339); +exports.unzip = unzip; /** - * Append an element to the front of an array, creating a new non empty array + * Prepend an element to every member of a `ReadonlyNonEmptyArray`. * * @example - * import { cons } from 'fp-ts/ReadonlyNonEmptyArray' + * import { prependAll } from 'fp-ts/ReadonlyNonEmptyArray' * - * assert.deepStrictEqual(cons(1, [2, 3, 4]), [1, 2, 3, 4]) + * assert.deepStrictEqual(prependAll(9)([1, 2, 3, 4]), [9, 1, 9, 2, 9, 3, 9, 4]) * - * @category constructors - * @since 2.5.0 + * @category combinators + * @since 2.10.0 + */ +var prependAll = function (middle) { return function (as) { + var out = [middle, as[0]]; + for (var i = 1; i < as.length; i++) { + out.push(middle, as[i]); + } + return out; +}; }; +exports.prependAll = prependAll; +/** + * Places an element in between members of a `ReadonlyNonEmptyArray`. + * + * @example + * import { intersperse } from 'fp-ts/ReadonlyNonEmptyArray' + * + * assert.deepStrictEqual(intersperse(9)([1, 2, 3, 4]), [1, 9, 2, 9, 3, 9, 4]) + * + * @category combinators + * @since 2.9.0 + */ +var intersperse = function (middle) { return function (as) { + var rest = exports.tail(as); + return exports.isNonEmpty(rest) ? function_1.pipe(rest, exports.prependAll(middle), exports.prepend(exports.head(as))) : as; +}; }; +exports.intersperse = intersperse; +/** + * @category combinators + * @since 2.10.0 + */ +var chainWithIndex = function (f) { return function (as) { + var out = _.fromReadonlyNonEmptyArray(f(0, exports.head(as))); + for (var i = 1; i < as.length; i++) { + out.push.apply(out, f(i, as[i])); + } + return out; +}; }; +exports.chainWithIndex = chainWithIndex; +/** + * A useful recursion pattern for processing a `ReadonlyNonEmptyArray` to produce a new `ReadonlyNonEmptyArray`, often used for "chopping" up the input + * `ReadonlyNonEmptyArray`. Typically `chop` is called with some function that will consume an initial prefix of the `ReadonlyNonEmptyArray` and produce a + * value and the tail of the `ReadonlyNonEmptyArray`. + * + * @category combinators + * @since 2.10.0 */ -exports.cons = RA.cons; +var chop = function (f) { return function (as) { + var _a = f(as), b = _a[0], rest = _a[1]; + var out = [b]; + var next = rest; + while (exports.isNonEmpty(next)) { + var _b = f(next), b_1 = _b[0], rest_2 = _b[1]; + out.push(b_1); + next = rest_2; + } + return out; +}; }; +exports.chop = chop; /** - * Append an element to the end of an array, creating a new non empty array + * Splits a `ReadonlyNonEmptyArray` into two pieces, the first piece has max `n` elements. * - * @example - * import { snoc } from 'fp-ts/ReadonlyNonEmptyArray' - * - * assert.deepStrictEqual(snoc([1, 2, 3], 4), [1, 2, 3, 4]) - * - * @category constructors - * @since 2.5.0 + * @category combinators + * @since 2.10.0 */ -exports.snoc = RA.snoc; +var splitAt = function (n) { return function (as) { + var m = Math.max(1, n); + return m >= as.length ? [as, exports.empty] : [function_1.pipe(as.slice(1, m), exports.prepend(exports.head(as))), as.slice(m)]; +}; }; +exports.splitAt = splitAt; /** - * Builds a `ReadonlyNonEmptyArray` from an array returning `none` if `as` is an empty array + * Splits a `ReadonlyNonEmptyArray` into length-`n` pieces. The last piece will be shorter if `n` does not evenly divide the length of + * the `ReadonlyNonEmptyArray`. * - * @category constructors - * @since 2.5.0 + * @category combinators + * @since 2.10.0 */ -function fromReadonlyArray(as) { - return RA.isNonEmpty(as) ? Option_1.some(as) : Option_1.none; -} -exports.fromReadonlyArray = fromReadonlyArray; +var chunksOf = function (n) { return exports.chop(exports.splitAt(n)); }; +exports.chunksOf = chunksOf; +// ------------------------------------------------------------------------------------- +// non-pipeables +// ------------------------------------------------------------------------------------- +var _map = function (fa, f) { return function_1.pipe(fa, exports.map(f)); }; +/* istanbul ignore next */ +var _mapWithIndex = function (fa, f) { return function_1.pipe(fa, exports.mapWithIndex(f)); }; +var _ap = function (fab, fa) { return function_1.pipe(fab, exports.ap(fa)); }; +var _chain = function (ma, f) { return function_1.pipe(ma, exports.chain(f)); }; +/* istanbul ignore next */ +var _extend = function (wa, f) { return function_1.pipe(wa, exports.extend(f)); }; +/* istanbul ignore next */ +var _reduce = function (fa, b, f) { return function_1.pipe(fa, exports.reduce(b, f)); }; +/* istanbul ignore next */ +var _foldMap = function (M) { + var foldMapM = exports.foldMap(M); + return function (fa, f) { return function_1.pipe(fa, foldMapM(f)); }; +}; +/* istanbul ignore next */ +var _reduceRight = function (fa, b, f) { return function_1.pipe(fa, exports.reduceRight(b, f)); }; +/* istanbul ignore next */ +var _traverse = function (F) { + var traverseF = exports.traverse(F); + return function (ta, f) { return function_1.pipe(ta, traverseF(f)); }; +}; +/* istanbul ignore next */ +var _alt = function (fa, that) { return function_1.pipe(fa, exports.alt(that)); }; +/* istanbul ignore next */ +var _reduceWithIndex = function (fa, b, f) { + return function_1.pipe(fa, exports.reduceWithIndex(b, f)); +}; +/* istanbul ignore next */ +var _foldMapWithIndex = function (M) { + var foldMapWithIndexM = exports.foldMapWithIndex(M); + return function (fa, f) { return function_1.pipe(fa, foldMapWithIndexM(f)); }; +}; +/* istanbul ignore next */ +var _reduceRightWithIndex = function (fa, b, f) { + return function_1.pipe(fa, exports.reduceRightWithIndex(b, f)); +}; +/* istanbul ignore next */ +var _traverseWithIndex = function (F) { + var traverseWithIndexF = exports.traverseWithIndex(F); + return function (ta, f) { return function_1.pipe(ta, traverseWithIndexF(f)); }; +}; +// ------------------------------------------------------------------------------------- +// type class members +// ------------------------------------------------------------------------------------- /** - * @category constructors + * @category Pointed * @since 2.5.0 */ -// tslint:disable-next-line: readonly-array -function fromArray(as) { - return fromReadonlyArray(RA.fromArray(as)); -} -exports.fromArray = fromArray; +exports.of = _.singleton; /** - * Produces a couple of the first element of the array, and a new array of the remaining elements, if any - * - * @example - * import { cons, uncons } from 'fp-ts/ReadonlyNonEmptyArray' - * - * assert.deepStrictEqual(uncons(cons(1, [2, 3, 4])), [1, [2, 3, 4]]) + * Less strict version of [`alt`](#alt). * - * @category destructors + * @category Alt * @since 2.9.0 */ -function uncons(nea) { - return [nea[0], nea.slice(1)]; -} -exports.uncons = uncons; +var altW = function (that) { return function (as) { return function_1.pipe(as, concatW(that())); }; }; +exports.altW = altW; /** - * Produces a couple of a copy of the array without its last element, and that last element - * - * @example - * import { snoc, unsnoc } from 'fp-ts/ReadonlyNonEmptyArray' - * - * assert.deepStrictEqual(unsnoc(snoc([1, 2, 3], 4)), [[1, 2, 3], 4]) + * Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to + * types of kind `* -> *`. * - * @category destructors - * @since 2.9.0 + * @category Alt + * @since 2.6.2 */ -function unsnoc(nea) { - var l = nea.length - 1; - return [nea.slice(0, l), nea[l]]; -} -exports.unsnoc = unsnoc; +exports.alt = exports.altW; /** - * @category instances + * @category Apply * @since 2.5.0 */ -exports.getShow = RA.getShow; +var ap = function (as) { return exports.chain(function (f) { return function_1.pipe(as, exports.map(f)); }); }; +exports.ap = ap; /** + * Composes computations in sequence, using the return value of one computation to determine the next computation. + * + * @category Monad * @since 2.5.0 */ -function head(nea) { - return nea[0]; -} -exports.head = head; +var chain = function (f) { return exports.chainWithIndex(function (_, a) { return f(a); }); }; +exports.chain = chain; /** + * @category Extend * @since 2.5.0 */ -function tail(nea) { - return nea.slice(1); -} -exports.tail = tail; +var extend = function (f) { return function (as) { + var next = exports.tail(as); + var out = [f(as)]; + while (exports.isNonEmpty(next)) { + out.push(f(next)); + next = exports.tail(next); + } + return out; +}; }; +exports.extend = extend; /** + * Derivable from `Extend`. + * * @category combinators * @since 2.5.0 */ -exports.reverse = RA.reverse; +exports.duplicate = +/*#__PURE__*/ +exports.extend(function_1.identity); /** + * Derivable from `Chain`. + * + * @category combinators * @since 2.5.0 */ -function min(ord) { - var S = Semigroup_1.getMeetSemigroup(ord); - return function (nea) { return nea.reduce(S.concat); }; -} -exports.min = min; +exports.flatten = +/*#__PURE__*/ +exports.chain(function_1.identity); /** + * `map` can be used to turn functions `(a: A) => B` into functions `(fa: F) => F` whose argument and return types + * use the type constructor `F` to represent some computational context. + * + * @category Functor * @since 2.5.0 */ -function max(ord) { - var S = Semigroup_1.getJoinSemigroup(ord); - return function (nea) { return nea.reduce(S.concat); }; -} -exports.max = max; +var map = function (f) { + return exports.mapWithIndex(function (_, a) { return f(a); }); +}; +exports.map = map; /** - * Builds a `Semigroup` instance for `ReadonlyNonEmptyArray` - * - * @category instances + * @category FunctorWithIndex * @since 2.5.0 */ -function getSemigroup() { - return { - concat: concat - }; -} -exports.getSemigroup = getSemigroup; +var mapWithIndex = function (f) { return function (as) { + var out = [f(0, exports.head(as))]; + for (var i = 1; i < as.length; i++) { + out.push(f(i, as[i])); + } + return out; +}; }; +exports.mapWithIndex = mapWithIndex; /** - * @example - * import { getEq, cons } from 'fp-ts/ReadonlyNonEmptyArray' - * import { eqNumber } from 'fp-ts/Eq' - * - * const E = getEq(eqNumber) - * assert.strictEqual(E.equals(cons(1, [2]), [1, 2]), true) - * assert.strictEqual(E.equals(cons(1, [2]), [1, 3]), false) - * - * @category instances + * @category Foldable * @since 2.5.0 */ -exports.getEq = RA.getEq; -function group(E) { - return function (as) { - var len = as.length; - if (len === 0) { - return RA.empty; - } - // tslint:disable-next-line: readonly-array - var r = []; - var head = as[0]; - var nea = [head]; - for (var i = 1; i < len; i++) { - var x = as[i]; - if (E.equals(x, head)) { - nea.push(x); - } - else { - r.push(nea); - head = x; - nea = [head]; - } - } - r.push(nea); - return r; - }; -} -exports.group = group; -function groupSort(O) { - var sortO = RA.sort(O); - var groupO = group(O); - return function (as) { return groupO(sortO(as)); }; -} -exports.groupSort = groupSort; +var reduce = function (b, f) { + return exports.reduceWithIndex(b, function (_, b, a) { return f(b, a); }); +}; +exports.reduce = reduce; /** - * Splits an array into sub-non-empty-arrays stored in an object, based on the result of calling a `string`-returning - * function on each element, and grouping the results according to values returned - * - * @example - * import { cons, groupBy } from 'fp-ts/ReadonlyNonEmptyArray' - * - * assert.deepStrictEqual(groupBy((s: string) => String(s.length))(['foo', 'bar', 'foobar']), { - * '3': cons('foo', ['bar']), - * '6': cons('foobar', []) - * }) + * **Note**. The constraint is relaxed: a `Semigroup` instead of a `Monoid`. * - * @category constructors + * @category Foldable * @since 2.5.0 */ -function groupBy(f) { - return function (as) { - var r = {}; - for (var _i = 0, as_1 = as; _i < as_1.length; _i++) { - var a = as_1[_i]; - var k = f(a); - if (r.hasOwnProperty(k)) { - r[k].push(a); - } - else { - r[k] = [a]; - } - } - return r; - }; -} -exports.groupBy = groupBy; +var foldMap = function (S) { return function (f) { return function (as) { + return as.slice(1).reduce(function (s, a) { return S.concat(s, f(a)); }, f(as[0])); +}; }; }; +exports.foldMap = foldMap; /** + * @category Foldable * @since 2.5.0 */ -function last(nea) { - return nea[nea.length - 1]; -} -exports.last = last; +var reduceRight = function (b, f) { + return exports.reduceRightWithIndex(b, function (_, b, a) { return f(b, a); }); +}; +exports.reduceRight = reduceRight; /** - * Get all but the last element of a non empty array, creating a new array. - * - * @example - * import { init } from 'fp-ts/ReadonlyNonEmptyArray' - * - * assert.deepStrictEqual(init([1, 2, 3]), [1, 2]) - * assert.deepStrictEqual(init([1]), []) - * + * @category FoldableWithIndex * @since 2.5.0 */ -function init(nea) { - return nea.slice(0, -1); -} -exports.init = init; +var reduceWithIndex = function (b, f) { return function (as) { + return as.reduce(function (b, a, i) { return f(i, b, a); }, b); +}; }; +exports.reduceWithIndex = reduceWithIndex; /** - * @category combinators + * **Note**. The constraint is relaxed: a `Semigroup` instead of a `Monoid`. + * + * @category FoldableWithIndex * @since 2.5.0 */ -function sort(O) { - return RA.sort(O); -} -exports.sort = sort; +var foldMapWithIndex = function (S) { return function (f) { return function (as) { return as.slice(1).reduce(function (s, a, i) { return S.concat(s, f(i + 1, a)); }, f(0, as[0])); }; }; }; +exports.foldMapWithIndex = foldMapWithIndex; /** + * @category FoldableWithIndex * @since 2.5.0 */ -function insertAt(i, a) { - return RA.insertAt(i, a); -} -exports.insertAt = insertAt; +var reduceRightWithIndex = function (b, f) { return function (as) { return as.reduceRight(function (b, a, i) { return f(i, a, b); }, b); }; }; +exports.reduceRightWithIndex = reduceRightWithIndex; /** - * @since 2.5.0 + * @category Traversable + * @since 2.6.3 */ -function updateAt(i, a) { - return RA.updateAt(i, a); -} -exports.updateAt = updateAt; +var traverse = function (F) { + var traverseWithIndexF = exports.traverseWithIndex(F); + return function (f) { return traverseWithIndexF(function (_, a) { return f(a); }); }; +}; +exports.traverse = traverse; /** - * @since 2.5.0 + * @category Traversable + * @since 2.6.3 */ -function modifyAt(i, f) { - return RA.modifyAt(i, f); -} -exports.modifyAt = modifyAt; -function filter(predicate) { - return filterWithIndex(function (_, a) { return predicate(a); }); -} -exports.filter = filter; +var sequence = function (F) { return exports.traverseWithIndex(F)(function_1.SK); }; +exports.sequence = sequence; /** - * @since 2.5.0 + * @category TraversableWithIndex + * @since 2.6.3 */ -function filterWithIndex(predicate) { - return function (nea) { return fromReadonlyArray(nea.filter(function (a, i) { return predicate(i, a); })); }; -} -exports.filterWithIndex = filterWithIndex; +var traverseWithIndex = function (F) { return function (f) { return function (as) { + var out = F.map(f(0, exports.head(as)), exports.of); + for (var i = 1; i < as.length; i++) { + out = F.ap(F.map(out, function (bs) { return function (b) { return function_1.pipe(bs, exports.append(b)); }; }), f(i, as[i])); + } + return out; +}; }; }; +exports.traverseWithIndex = traverseWithIndex; /** - * Wrap a value into the type constructor. - * - * @category Applicative - * @since 2.5.0 + * @category Comonad + * @since 2.6.3 */ -exports.of = RA.of; -function concat(fx, fy) { - return fx.concat(fy); -} -exports.concat = concat; +exports.extract = _.head; +// ------------------------------------------------------------------------------------- +// instances +// ------------------------------------------------------------------------------------- /** + * @category instances * @since 2.5.0 */ -function fold(S) { - return function (fa) { return fa.reduce(S.concat); }; -} -exports.fold = fold; -/** - * @category combinators - * @since 2.5.1 - */ -exports.zipWith = RA.zipWith; +exports.URI = 'ReadonlyNonEmptyArray'; /** - * @category combinators - * @since 2.5.1 + * @category instances + * @since 2.5.0 */ -exports.zip = RA.zip; +var getShow = function (S) { return ({ + show: function (as) { return "[" + as.map(S.show).join(', ') + "]"; } +}); }; +exports.getShow = getShow; /** - * @since 2.5.1 + * Builds a `Semigroup` instance for `ReadonlyNonEmptyArray` + * + * @category instances + * @since 2.5.0 */ -exports.unzip = RA.unzip; +var getSemigroup = function () { return ({ + concat: concat +}); }; +exports.getSemigroup = getSemigroup; /** - * Prepend an element to every member of an array - * * @example - * import { cons, prependToAll } from 'fp-ts/ReadonlyNonEmptyArray' + * import { getEq } from 'fp-ts/ReadonlyNonEmptyArray' + * import * as N from 'fp-ts/number' * - * assert.deepStrictEqual(prependToAll(9)(cons(1, [2, 3, 4])), cons(9, [1, 9, 2, 9, 3, 9, 4])) + * const E = getEq(N.Eq) + * assert.strictEqual(E.equals([1, 2], [1, 2]), true) + * assert.strictEqual(E.equals([1, 2], [1, 3]), false) * - * @category combinators - * @since 2.9.0 + * @category instances + * @since 2.5.0 */ -exports.prependToAll = RA.prependToAll; +var getEq = function (E) { + return Eq_1.fromEquals(function (xs, ys) { return xs.length === ys.length && xs.every(function (x, i) { return E.equals(x, ys[i]); }); }); +}; +exports.getEq = getEq; /** - * Places an element in between members of an array - * - * @example - * import { cons, intersperse } from 'fp-ts/ReadonlyNonEmptyArray' - * - * assert.deepStrictEqual(intersperse(9)(cons(1, [2, 3, 4])), cons(1, [9, 2, 9, 3, 9, 4])) - * * @category combinators - * @since 2.9.0 + * @since 2.11.0 */ -exports.intersperse = RA.intersperse; -// ------------------------------------------------------------------------------------- -// non-pipeables -// ------------------------------------------------------------------------------------- -var map_ = RA.Functor.map; -var mapWithIndex_ = RA.FunctorWithIndex.mapWithIndex; -var ap_ = RA.Applicative.ap; -var chain_ = RA.Monad.chain; -var extend_ = RA.Extend.extend; -var reduce_ = RA.Foldable.reduce; -var foldMap_ = RA.Foldable.foldMap; -var reduceRight_ = RA.Foldable.reduceRight; -var traverse_ = RA.Traversable.traverse; -var alt_ = RA.Alt.alt; -var reduceWithIndex_ = RA.FoldableWithIndex.reduceWithIndex; -var foldMapWithIndex_ = RA.FoldableWithIndex - .foldMapWithIndex; -var reduceRightWithIndex_ = RA.FoldableWithIndex - .reduceRightWithIndex; -var traverseWithIndex_ = RA.TraversableWithIndex - .traverseWithIndex; -// ------------------------------------------------------------------------------------- -// pipeables -// ------------------------------------------------------------------------------------- +var getUnionSemigroup = function (E) { + var unionE = exports.union(E); + return { + concat: function (first, second) { return unionE(second)(first); } + }; +}; +exports.getUnionSemigroup = getUnionSemigroup; /** - * @category FoldableWithIndex - * @since 2.5.0 + * @category instances + * @since 2.7.0 */ -var foldMapWithIndex = function (S) { return function (f) { return function (fa) { return fa.slice(1).reduce(function (s, a, i) { return S.concat(s, f(i + 1, a)); }, f(0, fa[0])); }; }; }; -exports.foldMapWithIndex = foldMapWithIndex; +exports.Functor = { + URI: exports.URI, + map: _map +}; /** - * @category Foldable - * @since 2.5.0 + * Derivable from `Functor`. + * + * @category combinators + * @since 2.10.0 */ -var foldMap = function (S) { return function (f) { return function (fa) { - return fa.slice(1).reduce(function (s, a) { return S.concat(s, f(a)); }, f(fa[0])); -}; }; }; -exports.foldMap = foldMap; +exports.flap = +/*#__PURE__*/ +Functor_1.flap(exports.Functor); /** - * Less strict version of [`alt`](#alt). - * - * @category Alt - * @since 2.9.0 + * @category instances + * @since 2.10.0 */ -exports.altW = RA.altW; +exports.Pointed = { + URI: exports.URI, + of: exports.of +}; /** - * Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to - * types of kind `* -> *`. - * - * @category Alt - * @since 2.6.2 + * @category instances + * @since 2.7.0 */ -exports.alt = RA.alt; +exports.FunctorWithIndex = { + URI: exports.URI, + map: _map, + mapWithIndex: _mapWithIndex +}; /** - * @category Apply - * @since 2.5.0 + * @category instances + * @since 2.10.0 */ -exports.ap = RA.ap; +exports.Apply = { + URI: exports.URI, + map: _map, + ap: _ap +}; /** * Combine two effectful actions, keeping only the result of the first. * @@ -12541,7 +15045,9 @@ exports.ap = RA.ap; * @category combinators * @since 2.5.0 */ -exports.apFirst = RA.apFirst; +exports.apFirst = +/*#__PURE__*/ +Apply_1.apFirst(exports.Apply); /** * Combine two effectful actions, keeping only the result of the second. * @@ -12550,398 +15056,501 @@ exports.apFirst = RA.apFirst; * @category combinators * @since 2.5.0 */ -exports.apSecond = RA.apSecond; +exports.apSecond = +/*#__PURE__*/ +Apply_1.apSecond(exports.Apply); /** - * Composes computations in sequence, using the return value of one computation to determine the next computation. - * - * @category Monad - * @since 2.5.0 + * @category instances + * @since 2.7.0 */ -exports.chain = RA.chain; +exports.Applicative = { + URI: exports.URI, + map: _map, + ap: _ap, + of: exports.of +}; +/** + * @category instances + * @since 2.10.0 + */ +exports.Chain = { + URI: exports.URI, + map: _map, + ap: _ap, + chain: _chain +}; /** * Composes computations in sequence, using the return value of one computation to determine the next computation and * keeping only the result of the first. * - * Derivable from `Monad`. + * Derivable from `Chain`. * * @category combinators * @since 2.5.0 */ -exports.chainFirst = RA.chainFirst; +exports.chainFirst = +/*#__PURE__*/ +Chain_1.chainFirst(exports.Chain); /** - * Derivable from `Extend`. - * - * @category combinators - * @since 2.5.0 + * @category instances + * @since 2.7.0 */ -exports.duplicate = RA.duplicate; +exports.Monad = { + URI: exports.URI, + map: _map, + ap: _ap, + of: exports.of, + chain: _chain +}; /** - * @category Extend - * @since 2.5.0 + * @category instances + * @since 2.7.0 */ -exports.extend = RA.extend; +exports.Foldable = { + URI: exports.URI, + reduce: _reduce, + foldMap: _foldMap, + reduceRight: _reduceRight +}; /** - * Derivable from `Monad`. - * - * @category combinators - * @since 2.5.0 + * @category instances + * @since 2.7.0 */ -exports.flatten = RA.flatten; +exports.FoldableWithIndex = { + URI: exports.URI, + reduce: _reduce, + foldMap: _foldMap, + reduceRight: _reduceRight, + reduceWithIndex: _reduceWithIndex, + foldMapWithIndex: _foldMapWithIndex, + reduceRightWithIndex: _reduceRightWithIndex +}; /** - * `map` can be used to turn functions `(a: A) => B` into functions `(fa: F) => F` whose argument and return types - * use the type constructor `F` to represent some computational context. - * - * @category Functor - * @since 2.5.0 + * @category instances + * @since 2.7.0 */ -exports.map = RA.map; +exports.Traversable = { + URI: exports.URI, + map: _map, + reduce: _reduce, + foldMap: _foldMap, + reduceRight: _reduceRight, + traverse: _traverse, + sequence: exports.sequence +}; +/** + * @category instances + * @since 2.7.0 + */ +exports.TraversableWithIndex = { + URI: exports.URI, + map: _map, + mapWithIndex: _mapWithIndex, + reduce: _reduce, + foldMap: _foldMap, + reduceRight: _reduceRight, + traverse: _traverse, + sequence: exports.sequence, + reduceWithIndex: _reduceWithIndex, + foldMapWithIndex: _foldMapWithIndex, + reduceRightWithIndex: _reduceRightWithIndex, + traverseWithIndex: _traverseWithIndex +}; +/** + * @category instances + * @since 2.7.0 + */ +exports.Alt = { + URI: exports.URI, + map: _map, + alt: _alt +}; +/** + * @category instances + * @since 2.7.0 + */ +exports.Comonad = { + URI: exports.URI, + map: _map, + extend: _extend, + extract: exports.extract +}; +// ------------------------------------------------------------------------------------- +// do notation +// ------------------------------------------------------------------------------------- +/** + * @since 2.9.0 + */ +exports.Do = +/*#__PURE__*/ +exports.of(_.emptyRecord); +/** + * @since 2.8.0 + */ +exports.bindTo = +/*#__PURE__*/ +Functor_1.bindTo(exports.Functor); +/** + * @since 2.8.0 + */ +exports.bind = +/*#__PURE__*/ +Chain_1.bind(exports.Chain); +// ------------------------------------------------------------------------------------- +// pipeable sequence S +// ------------------------------------------------------------------------------------- +/** + * @since 2.8.0 + */ +exports.apS = +/*#__PURE__*/ +Apply_1.apS(exports.Apply); +// ------------------------------------------------------------------------------------- +// utils +// ------------------------------------------------------------------------------------- /** - * @category FunctorWithIndex * @since 2.5.0 */ -exports.mapWithIndex = RA.mapWithIndex; +exports.head = exports.extract; /** - * @category Foldable * @since 2.5.0 */ -exports.reduce = RA.reduce; +exports.tail = _.tail; /** - * @category FoldableWithIndex * @since 2.5.0 */ -exports.reduceWithIndex = RA.reduceWithIndex; +var last = function (as) { return as[as.length - 1]; }; +exports.last = last; /** - * @category Foldable + * Get all but the last element of a non empty array, creating a new array. + * + * @example + * import { init } from 'fp-ts/ReadonlyNonEmptyArray' + * + * assert.deepStrictEqual(init([1, 2, 3]), [1, 2]) + * assert.deepStrictEqual(init([1]), []) + * * @since 2.5.0 */ -exports.reduceRight = RA.reduceRight; +var init = function (as) { return as.slice(0, -1); }; +exports.init = init; /** - * @category FoldableWithIndex * @since 2.5.0 */ -exports.reduceRightWithIndex = RA.reduceRightWithIndex; +var min = function (O) { + var S = Se.min(O); + return function (as) { return as.reduce(S.concat); }; +}; +exports.min = min; /** - * @since 2.6.3 + * @since 2.5.0 */ -exports.traverse = RA.traverse; +var max = function (O) { + var S = Se.max(O); + return function (as) { return as.reduce(S.concat); }; +}; +exports.max = max; /** - * @since 2.6.3 + * @since 2.10.0 */ -exports.sequence = RA.sequence; +var concatAll = function (S) { return function (as) { return as.reduce(S.concat); }; }; +exports.concatAll = concatAll; /** - * @since 2.6.3 + * Break a `ReadonlyArray` into its first element and remaining elements. + * + * @category destructors + * @since 2.11.0 */ -exports.traverseWithIndex = RA.traverseWithIndex; +var matchLeft = function (f) { return function (as) { + return f(exports.head(as), exports.tail(as)); +}; }; +exports.matchLeft = matchLeft; /** - * @since 2.6.3 + * Break a `ReadonlyArray` into its initial elements and the last element. + * + * @category destructors + * @since 2.11.0 */ -exports.extract = head; -// ------------------------------------------------------------------------------------- -// instances -// ------------------------------------------------------------------------------------- +var matchRight = function (f) { return function (as) { + return f(exports.init(as), exports.last(as)); +}; }; +exports.matchRight = matchRight; /** - * @category instances - * @since 2.5.0 + * Apply a function to the head, creating a new `ReadonlyNonEmptyArray`. + * + * @since 2.11.0 */ -exports.URI = 'ReadonlyNonEmptyArray'; +var modifyHead = function (f) { return function (as) { return __spreadArray([ + f(exports.head(as)) +], exports.tail(as)); }; }; +exports.modifyHead = modifyHead; /** - * @category instances - * @since 2.7.0 + * Change the head, creating a new `ReadonlyNonEmptyArray`. + * + * @category combinators + * @since 2.11.0 */ -exports.Functor = { - URI: exports.URI, - map: map_ -}; +var updateHead = function (a) { return exports.modifyHead(function () { return a; }); }; +exports.updateHead = updateHead; /** - * @category instances - * @since 2.7.0 + * Apply a function to the last element, creating a new `ReadonlyNonEmptyArray`. + * + * @since 2.11.0 */ -exports.FunctorWithIndex = { - URI: exports.URI, - map: map_, - mapWithIndex: mapWithIndex_ -}; +var modifyLast = function (f) { return function (as) { + return function_1.pipe(exports.init(as), exports.append(f(exports.last(as)))); +}; }; +exports.modifyLast = modifyLast; /** - * @category instances - * @since 2.7.0 + * Change the last element, creating a new `ReadonlyNonEmptyArray`. + * + * @category combinators + * @since 2.11.0 */ -exports.Applicative = { - URI: exports.URI, - map: map_, - ap: ap_, - of: exports.of -}; +var updateLast = function (a) { return exports.modifyLast(function () { return a; }); }; +exports.updateLast = updateLast; +function groupSort(O) { + var sortO = exports.sort(O); + var groupO = group(O); + return function (as) { return (exports.isNonEmpty(as) ? groupO(sortO(as)) : exports.empty); }; +} +exports.groupSort = groupSort; +function filter(predicate) { + return exports.filterWithIndex(function (_, a) { return predicate(a); }); +} +exports.filter = filter; /** - * @category instances - * @since 2.7.0 + * Use [`filterWithIndex`](./ReadonlyArray.ts.html#filterwithindex) instead. + * + * @category combinators + * @since 2.5.0 + * @deprecated */ -exports.Monad = { - URI: exports.URI, - map: map_, - ap: ap_, - of: exports.of, - chain: chain_ -}; +var filterWithIndex = function (predicate) { return function (as) { return exports.fromReadonlyArray(as.filter(function (a, i) { return predicate(i, a); })); }; }; +exports.filterWithIndex = filterWithIndex; /** - * @category instances - * @since 2.7.0 + * Use [`unprepend`](#unprepend) instead. + * + * @category destructors + * @since 2.10.0 + * @deprecated */ -exports.Foldable = { - URI: exports.URI, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_ -}; +exports.uncons = exports.unprepend; /** - * @category instances - * @since 2.7.0 + * Use [`unappend`](#unappend) instead. + * + * @category destructors + * @since 2.10.0 + * @deprecated */ -exports.FoldableWithIndex = { - URI: exports.URI, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - reduceWithIndex: reduceWithIndex_, - foldMapWithIndex: foldMapWithIndex_, - reduceRightWithIndex: reduceRightWithIndex_ -}; +exports.unsnoc = exports.unappend; +function cons(head, tail) { + return tail === undefined ? exports.prepend(head) : function_1.pipe(tail, exports.prepend(head)); +} +exports.cons = cons; /** - * @category instances - * @since 2.7.0 + * Use [`append`](./ReadonlyArray.ts.html#append) instead. + * + * @category constructors + * @since 2.5.0 + * @deprecated */ -exports.Traversable = { - URI: exports.URI, - map: map_, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - traverse: traverse_, - sequence: exports.sequence -}; +var snoc = function (init, end) { return function_1.pipe(init, concat([end])); }; +exports.snoc = snoc; /** - * @category instances - * @since 2.7.0 + * Use [`insertAt`](./ReadonlyArray.ts.html#insertat) instead. + * + * @category combinators + * @since 2.5.0 + * @deprecated */ -exports.TraversableWithIndex = { - URI: exports.URI, - map: map_, - mapWithIndex: mapWithIndex_, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - traverse: traverse_, - sequence: exports.sequence, - reduceWithIndex: reduceWithIndex_, - foldMapWithIndex: foldMapWithIndex_, - reduceRightWithIndex: reduceRightWithIndex_, - traverseWithIndex: traverseWithIndex_ -}; +var insertAt = function (i, a) { return function (as) { + return i < 0 || i > as.length ? _.none : _.some(exports.unsafeInsertAt(i, a, as)); +}; }; +exports.insertAt = insertAt; /** - * @category instances - * @since 2.7.0 + * Use [`prependAll`](#prependall) instead. + * + * @category combinators + * @since 2.9.0 + * @deprecated */ -exports.Alt = { - URI: exports.URI, - map: map_, - alt: alt_ -}; +exports.prependToAll = exports.prependAll; /** - * @category instances - * @since 2.7.0 + * Use [`concatAll`](#concatall) instead. + * + * @since 2.5.0 + * @deprecated */ -exports.Comonad = { - URI: exports.URI, - map: map_, - extend: extend_, - extract: exports.extract -}; -// TODO: remove in v3 +exports.fold = exports.concatAll; /** + * Use small, specific instances instead. + * * @category instances * @since 2.5.0 + * @deprecated */ exports.readonlyNonEmptyArray = { URI: exports.URI, of: exports.of, - map: map_, - mapWithIndex: mapWithIndex_, - ap: ap_, - chain: chain_, - extend: extend_, + map: _map, + mapWithIndex: _mapWithIndex, + ap: _ap, + chain: _chain, + extend: _extend, extract: exports.extract, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - traverse: traverse_, + reduce: _reduce, + foldMap: _foldMap, + reduceRight: _reduceRight, + traverse: _traverse, sequence: exports.sequence, - reduceWithIndex: reduceWithIndex_, - foldMapWithIndex: foldMapWithIndex_, - reduceRightWithIndex: reduceRightWithIndex_, - traverseWithIndex: traverseWithIndex_, - alt: alt_ -}; -// ------------------------------------------------------------------------------------- -// do notation -// ------------------------------------------------------------------------------------- -/** - * @since 2.9.0 - */ -exports.Do = -/*#__PURE__*/ -exports.of({}); -/** - * @since 2.8.0 - */ -var bindTo = function (name) { return exports.map(function_1.bindTo_(name)); }; -exports.bindTo = bindTo; -/** - * @since 2.8.0 - */ -var bind = function (name, f) { - return exports.chain(function (a) { - return function_1.pipe(f(a), exports.map(function (b) { return function_1.bind_(a, name, b); })); - }); -}; -exports.bind = bind; -// ------------------------------------------------------------------------------------- -// pipeable sequence S -// ------------------------------------------------------------------------------------- -/** - * @since 2.8.0 - */ -var apS = function (name, fb) { - return function_1.flow(exports.map(function (a) { return function (b) { return function_1.bind_(a, name, b); }; }), exports.ap(fb)); + reduceWithIndex: _reduceWithIndex, + foldMapWithIndex: _foldMapWithIndex, + reduceRightWithIndex: _reduceRightWithIndex, + traverseWithIndex: _traverseWithIndex, + alt: _alt }; -exports.apS = apS; /***/ }), /***/ 1897: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.URI = exports.separate = exports.compact = exports.reduceRight = exports.foldMap = exports.reduce = exports.partitionMap = exports.partition = exports.filterMap = exports.filter = exports.elem = exports.some = exports.every = exports.fromFoldableMap = exports.fromFoldable = exports.filterWithIndex = exports.filterMapWithIndex = exports.partitionWithIndex = exports.partitionMapWithIndex = exports.wilt = exports.wither = exports.sequence = exports.traverse = exports.traverseWithIndex = exports.singleton = exports.reduceRightWithIndex = exports.foldMapWithIndex = exports.reduceWithIndex = exports.map = exports.mapWithIndex = exports.empty = exports.lookup = exports.getMonoid = exports.getEq = exports.isSubrecord = exports.pop = exports.modifyAt = exports.updateAt = exports.deleteAt = exports.hasOwnProperty = exports.insertAt = exports.toUnfoldable = exports.toReadonlyArray = exports.collect = exports.keys = exports.isEmpty = exports.size = exports.getShow = exports.toRecord = exports.fromRecord = void 0; -exports.readonlyRecord = exports.Witherable = exports.TraversableWithIndex = exports.Traversable = exports.FilterableWithIndex = exports.Filterable = exports.Compactable = exports.FoldableWithIndex = exports.Foldable = exports.FunctorWithIndex = exports.Functor = void 0; +exports._reduceWithIndex = exports._partitionMap = exports._partition = exports._filterMap = exports._filter = exports._reduceRight = exports._foldMap = exports._reduce = exports._mapWithIndex = exports._map = exports.difference = exports.intersection = exports.union = exports.elem = exports.some = exports.every = exports.fromFoldableMap = exports.fromFoldable = exports.filterWithIndex = exports.filterMapWithIndex = exports.partitionWithIndex = exports.partitionMapWithIndex = exports.wilt = exports.wither = exports.sequence = exports.traverse = exports.traverseWithIndex = exports.singleton = exports.reduceRightWithIndex = exports.foldMapWithIndex = exports.reduceWithIndex = exports.map = exports.mapWithIndex = exports.empty = exports.lookup = exports.isSubrecord = exports.pop = exports.modifyAt = exports.updateAt = exports.deleteAt = exports.has = exports.upsertAt = exports.toUnfoldable = exports.toReadonlyArray = exports.collect = exports.keys = exports.isEmpty = exports.size = exports.toRecord = exports.fromRecord = void 0; +exports.readonlyRecord = exports.hasOwnProperty = exports.insertAt = exports.Witherable = exports.TraversableWithIndex = exports.Traversable = exports.FoldableWithIndex = exports.Foldable = exports.getDifferenceMagma = exports.getIntersectionSemigroup = exports.getUnionMonoid = exports.getUnionSemigroup = exports.getWitherable = exports.getTraversableWithIndex = exports.getTraversable = exports.FilterableWithIndex = exports.Filterable = exports.Compactable = exports.getFoldableWithIndex = exports.getFoldable = exports.FunctorWithIndex = exports.flap = exports.Functor = exports.getMonoid = exports.getEq = exports.getShow = exports.URI = exports.separate = exports.compact = exports.reduceRight = exports.foldMap = exports.reduce = exports.partitionMap = exports.partition = exports.filterMap = exports.filter = exports._sequence = exports._traverse = exports._filterWithIndex = exports._filterMapWithIndex = exports._partitionWithIndex = exports._partitionMapWithIndex = exports._reduceRightWithIndex = exports._foldMapWithIndex = void 0; var Eq_1 = __nccwpck_require__(6964); var function_1 = __nccwpck_require__(6985); -var Option_1 = __nccwpck_require__(2569); +var Functor_1 = __nccwpck_require__(5533); +var _ = __importStar(__nccwpck_require__(1840)); +var Separated_1 = __nccwpck_require__(5877); +var S = __importStar(__nccwpck_require__(5189)); +var Witherable_1 = __nccwpck_require__(4384); +// ------------------------------------------------------------------------------------- +// interop +// ------------------------------------------------------------------------------------- /** - * @category constructors + * @category interop * @since 2.5.0 */ -function fromRecord(r) { - return Object.assign({}, r); -} +var fromRecord = function (r) { return Object.assign({}, r); }; exports.fromRecord = fromRecord; /** - * @category destructors + * @category interop * @since 2.5.0 */ -function toRecord(r) { - return Object.assign({}, r); -} +var toRecord = function (r) { return Object.assign({}, r); }; exports.toRecord = toRecord; /** - * @category instances - * @since 2.5.0 - */ -function getShow(S) { - return { - show: function (r) { - var elements = collect(function (k, a) { return JSON.stringify(k) + ": " + S.show(a); })(r).join(', '); - return elements === '' ? '{}' : "{ " + elements + " }"; - } - }; -} -exports.getShow = getShow; -/** - * Calculate the number of key/value pairs in a record + * Calculate the number of key/value pairs in a `ReadonlyRecord`, * * @since 2.5.0 */ -function size(r) { - return Object.keys(r).length; -} +var size = function (r) { return Object.keys(r).length; }; exports.size = size; /** - * Test whether a record is empty + * Test whether a `ReadonlyRecord` is empty. * * @since 2.5.0 */ -function isEmpty(r) { - return Object.keys(r).length === 0; -} +var isEmpty = function (r) { + for (var k in r) { + if (_.has.call(r, k)) { + return false; + } + } + return true; +}; exports.isEmpty = isEmpty; +var keys_ = function (O) { return function (r) { + return Object.keys(r).sort(O.compare); +}; }; /** * @since 2.5.0 */ -function keys(r) { - return Object.keys(r).sort(); -} -exports.keys = keys; -/** - * Map a record into an array - * - * @example - * import {collect} from 'fp-ts/ReadonlyRecord' - * - * const x: { a: string, b: boolean } = { a: 'foo', b: false } - * assert.deepStrictEqual( - * collect((key, val) => ({key: key, value: val}))(x), - * [{key: 'a', value: 'foo'}, {key: 'b', value: false}] - * ) - * - * @since 2.5.0 - */ -function collect(f) { - return function (r) { - // tslint:disable-next-line: readonly-array +exports.keys = +/*#__PURE__*/ +keys_(S.Ord); +function collect(O) { + if (typeof O === 'function') { + return collect(S.Ord)(O); + } + var keysO = keys_(O); + return function (f) { return function (r) { var out = []; - for (var _i = 0, _a = keys(r); _i < _a.length; _i++) { + for (var _i = 0, _a = keysO(r); _i < _a.length; _i++) { var key = _a[_i]; out.push(f(key, r[key])); } return out; - }; + }; }; } exports.collect = collect; /** - * @category destructors + * Get a sorted `ReadonlyArray` of the key/value pairs contained in a `ReadonlyRecord`. + * * @since 2.5.0 */ exports.toReadonlyArray = /*#__PURE__*/ -collect(function (k, a) { return [k, a]; }); +collect(S.Ord)(function (k, a) { return [k, a]; }); function toUnfoldable(U) { return function (r) { - var arr = exports.toReadonlyArray(r); - var len = arr.length; - return U.unfold(0, function (b) { return (b < len ? Option_1.some([arr[b], b + 1]) : Option_1.none); }); + var sas = exports.toReadonlyArray(r); + var len = sas.length; + return U.unfold(0, function (b) { return (b < len ? _.some([sas[b], b + 1]) : _.none); }); }; } exports.toUnfoldable = toUnfoldable; -function insertAt(k, a) { - return function (r) { - if (r[k] === a) { - return r; - } - var out = Object.assign({}, r); - out[k] = a; - return out; - }; -} -exports.insertAt = insertAt; -var _hasOwnProperty = Object.prototype.hasOwnProperty; -function hasOwnProperty(k, r) { - return _hasOwnProperty.call(r === undefined ? this : r, k); -} -exports.hasOwnProperty = hasOwnProperty; +/** + * Insert or replace a key/value pair in a `ReadonlyRecord`. + * + * @category combinators + * @since 2.10.0 + */ +var upsertAt = function (k, a) { return function (r) { + if (_.has.call(r, k) && r[k] === a) { + return r; + } + var out = Object.assign({}, r); + out[k] = a; + return out; +}; }; +exports.upsertAt = upsertAt; +/** + * Test whether or not a key exists in a `ReadonlyRecord`. + * + * Note. This function is not pipeable because is a `Refinement`. + * + * @since 2.10.0 + */ +var has = function (k, r) { return _.has.call(r, k); }; +exports.has = has; function deleteAt(k) { return function (r) { - if (!_hasOwnProperty.call(r, k)) { + if (!_.has.call(r, k)) { return r; } var out = Object.assign({}, r); @@ -12953,39 +15562,39 @@ exports.deleteAt = deleteAt; /** * @since 2.5.0 */ -function updateAt(k, a) { - return function (r) { - if (!hasOwnProperty(k, r)) { - return Option_1.none; - } - if (r[k] === a) { - return Option_1.some(r); - } - var out = Object.assign({}, r); - out[k] = a; - return Option_1.some(out); - }; -} +var updateAt = function (k, a) { return function (r) { + if (!exports.has(k, r)) { + return _.none; + } + if (r[k] === a) { + return _.some(r); + } + var out = Object.assign({}, r); + out[k] = a; + return _.some(out); +}; }; exports.updateAt = updateAt; /** * @since 2.5.0 */ -function modifyAt(k, f) { - return function (r) { - if (!hasOwnProperty(k, r)) { - return Option_1.none; - } - var out = Object.assign({}, r); - out[k] = f(r[k]); - return Option_1.some(out); - }; -} +var modifyAt = function (k, f) { return function (r) { + if (!exports.has(k, r)) { + return _.none; + } + var next = f(r[k]); + if (next === r[k]) { + return _.some(r); + } + var out = Object.assign({}, r); + out[k] = next; + return _.some(out); +}; }; exports.modifyAt = modifyAt; function pop(k) { var deleteAtk = deleteAt(k); return function (r) { var oa = lookup(k, r); - return Option_1.isNone(oa) ? Option_1.none : Option_1.some([oa.value, deleteAtk(r)]); + return _.isNone(oa) ? _.none : _.some([oa.value, deleteAtk(r)]); }; } exports.pop = pop; @@ -12996,7 +15605,7 @@ function isSubrecord(E) { return function (that) { return isSubrecordE_1(that, me); }; } for (var k in me) { - if (!_hasOwnProperty.call(that, k) || !E.equals(me[k], that[k])) { + if (!_.has.call(that, k) || !E.equals(me[k], that[k])) { return false; } } @@ -13004,41 +15613,11 @@ function isSubrecord(E) { }; } exports.isSubrecord = isSubrecord; -function getEq(E) { - var isSubrecordE = isSubrecord(E); - return Eq_1.fromEquals(function (x, y) { return isSubrecordE(x)(y) && isSubrecordE(y)(x); }); -} -exports.getEq = getEq; -function getMonoid(S) { - return { - concat: function (x, y) { - if (x === exports.empty) { - return y; - } - if (y === exports.empty) { - return x; - } - var keys = Object.keys(y); - var len = keys.length; - if (len === 0) { - return x; - } - var r = Object.assign({}, x); - for (var i = 0; i < len; i++) { - var k = keys[i]; - r[k] = _hasOwnProperty.call(x, k) ? S.concat(x[k], y[k]) : y[k]; - } - return r; - }, - empty: exports.empty - }; -} -exports.getMonoid = getMonoid; function lookup(k, r) { if (r === undefined) { return function (r) { return lookup(k, r); }; } - return _hasOwnProperty.call(r, k) ? Option_1.some(r[k]) : Option_1.none; + return _.has.call(r, k) ? _.some(r[k]) : _.none; } exports.lookup = lookup; /** @@ -13046,12 +15625,12 @@ exports.lookup = lookup; */ exports.empty = {}; function mapWithIndex(f) { - return function (fa) { + return function (r) { var out = {}; - var keys = Object.keys(fa); - for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { - var key = keys_1[_i]; - out[key] = f(key, fa[key]); + for (var k in r) { + if (_.has.call(r, k)) { + out[k] = f(k, r[k]); + } } return out; }; @@ -13061,84 +15640,88 @@ function map(f) { return mapWithIndex(function (_, a) { return f(a); }); } exports.map = map; -function reduceWithIndex(b, f) { - return function (fa) { +function reduceWithIndex() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (args.length === 2) { + return reduceWithIndex(S.Ord).apply(void 0, args); + } + var keysO = keys_(args[0]); + return function (b, f) { return function (fa) { var out = b; - var ks = keys(fa); + var ks = keysO(fa); var len = ks.length; for (var i = 0; i < len; i++) { var k = ks[i]; out = f(k, out, fa[k]); } return out; - }; + }; }; } exports.reduceWithIndex = reduceWithIndex; -function foldMapWithIndex(M) { - return function (f) { return function (fa) { - var out = M.empty; - var ks = keys(fa); - var len = ks.length; - for (var i = 0; i < len; i++) { - var k = ks[i]; - out = M.concat(out, f(k, fa[k])); - } - return out; - }; }; +function foldMapWithIndex(O) { + if ('compare' in O) { + var keysO_1 = keys_(O); + return function (M) { return function (f) { return function (fa) { + var out = M.empty; + var ks = keysO_1(fa); + var len = ks.length; + for (var i = 0; i < len; i++) { + var k = ks[i]; + out = M.concat(out, f(k, fa[k])); + } + return out; + }; }; }; + } + return foldMapWithIndex(S.Ord)(O); } exports.foldMapWithIndex = foldMapWithIndex; -function reduceRightWithIndex(b, f) { - return function (fa) { +function reduceRightWithIndex() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (args.length === 2) { + return reduceRightWithIndex(S.Ord).apply(void 0, args); + } + var keysO = keys_(args[0]); + return function (b, f) { return function (fa) { var out = b; - var ks = keys(fa); - var len = ks.length; - for (var i = len - 1; i >= 0; i--) { - var k = ks[i]; - out = f(k, fa[k], out); - } - return out; - }; -} -exports.reduceRightWithIndex = reduceRightWithIndex; -/** - * Create a record with one key/value pair - * - * @category constructors - * @since 2.5.0 - */ -function singleton(k, a) { - var _a; - return _a = {}, _a[k] = a, _a; -} -exports.singleton = singleton; -function traverseWithIndex(F) { - return function (f) { return function (ta) { - var ks = keys(ta); - if (ks.length === 0) { - return F.of(exports.empty); - } - var fr = F.of({}); - var _loop_1 = function (key) { - fr = F.ap(F.map(fr, function (r) { return function (b) { - r[key] = b; - return r; - }; }), f(key, ta[key])); - }; - for (var _i = 0, ks_1 = ks; _i < ks_1.length; _i++) { - var key = ks_1[_i]; - _loop_1(key); + var ks = keysO(fa); + var len = ks.length; + for (var i = len - 1; i >= 0; i--) { + var k = ks[i]; + out = f(k, fa[k], out); } - return fr; + return out; }; }; } +exports.reduceRightWithIndex = reduceRightWithIndex; +/** + * Create a `ReadonlyRecord` with one key/value pair. + * + * @category constructors + * @since 2.5.0 + */ +var singleton = function (k, a) { + var _a; + return (_a = {}, _a[k] = a, _a); +}; +exports.singleton = singleton; +function traverseWithIndex(F) { + var traverseWithIndexOF = _traverseWithIndex(S.Ord)(F); + return function (f) { return function (ta) { return traverseWithIndexOF(ta, f); }; }; +} exports.traverseWithIndex = traverseWithIndex; function traverse(F) { - var traverseWithIndexF = traverseWithIndex(F); - return function (f) { return traverseWithIndexF(function (_, a) { return f(a); }); }; + var traverseOF = exports._traverse(S.Ord)(F); + return function (f) { return function (ta) { return traverseOF(ta, f); }; }; } exports.traverse = traverse; function sequence(F) { - return traverseWithIndex(F)(function (_, a) { return a; }); + return exports._sequence(S.Ord)(F); } exports.sequence = sequence; /** @@ -13160,63 +15743,57 @@ var wilt = function (F) { }; exports.wilt = wilt; function partitionMapWithIndex(f) { - return function (fa) { + return function (r) { var left = {}; var right = {}; - var keys = Object.keys(fa); - for (var _i = 0, keys_2 = keys; _i < keys_2.length; _i++) { - var key = keys_2[_i]; - var e = f(key, fa[key]); - switch (e._tag) { - case 'Left': - left[key] = e.left; - break; - case 'Right': - right[key] = e.right; - break; + for (var k in r) { + if (_.has.call(r, k)) { + var e = f(k, r[k]); + switch (e._tag) { + case 'Left': + left[k] = e.left; + break; + case 'Right': + right[k] = e.right; + break; + } } } - return { - left: left, - right: right - }; + return Separated_1.separated(left, right); }; } exports.partitionMapWithIndex = partitionMapWithIndex; function partitionWithIndex(predicateWithIndex) { - return function (fa) { + return function (r) { var left = {}; var right = {}; - var keys = Object.keys(fa); - for (var _i = 0, keys_3 = keys; _i < keys_3.length; _i++) { - var key = keys_3[_i]; - var a = fa[key]; - if (predicateWithIndex(key, a)) { - right[key] = a; - } - else { - left[key] = a; + for (var k in r) { + if (_.has.call(r, k)) { + var a = r[k]; + if (predicateWithIndex(k, a)) { + right[k] = a; + } + else { + left[k] = a; + } } } - return { - left: left, - right: right - }; + return Separated_1.separated(left, right); }; } exports.partitionWithIndex = partitionWithIndex; function filterMapWithIndex(f) { - return function (fa) { - var r = {}; - var keys = Object.keys(fa); - for (var _i = 0, keys_4 = keys; _i < keys_4.length; _i++) { - var key = keys_4[_i]; - var optionB = f(key, fa[key]); - if (Option_1.isSome(optionB)) { - r[key] = optionB.value; + return function (r) { + var out = {}; + for (var k in r) { + if (_.has.call(r, k)) { + var ob = f(k, r[k]); + if (_.isSome(ob)) { + out[k] = ob.value; + } } } - return r; + return out; }; } exports.filterMapWithIndex = filterMapWithIndex; @@ -13225,7 +15802,7 @@ function filterWithIndex(predicateWithIndex) { var out = {}; var changed = false; for (var key in fa) { - if (_hasOwnProperty.call(fa, key)) { + if (_.has.call(fa, key)) { var a = fa[key]; if (predicateWithIndex(key, a)) { out[key] = a; @@ -13248,7 +15825,7 @@ function fromFoldableMap(M, F) { return function (ta, f) { return F.reduce(ta, {}, function (r, a) { var _a = f(a), k = _a[0], b = _a[1]; - r[k] = _hasOwnProperty.call(r, k) ? M.concat(r[k], b) : b; + r[k] = _.has.call(r, k) ? M.concat(r[k], b) : b; return r; }); }; @@ -13297,80 +15874,208 @@ function elem(E) { }; } exports.elem = elem; +/** + * @category combinators + * @since 2.11.0 + */ +var union = function (M) { return function (second) { return function (first) { + if (exports.isEmpty(first)) { + return second; + } + if (exports.isEmpty(second)) { + return first; + } + var out = {}; + for (var k in first) { + if (exports.has(k, second)) { + out[k] = M.concat(first[k], second[k]); + } + else { + out[k] = first[k]; + } + } + for (var k in second) { + if (!exports.has(k, out)) { + out[k] = second[k]; + } + } + return out; +}; }; }; +exports.union = union; +/** + * @category combinators + * @since 2.11.0 + */ +var intersection = function (M) { return function (second) { return function (first) { + if (exports.isEmpty(first) || exports.isEmpty(second)) { + return exports.empty; + } + var out = {}; + for (var k in first) { + if (exports.has(k, second)) { + out[k] = M.concat(first[k], second[k]); + } + } + return out; +}; }; }; +exports.intersection = intersection; +/** + * @category combinators + * @since 2.11.0 + */ +var difference = function (second) { return function (first) { + if (exports.isEmpty(first)) { + return second; + } + if (exports.isEmpty(second)) { + return first; + } + var out = {}; + for (var k in first) { + if (!exports.has(k, second)) { + out[k] = first[k]; + } + } + for (var k in second) { + if (!exports.has(k, first)) { + out[k] = second[k]; + } + } + return out; +}; }; +exports.difference = difference; // ------------------------------------------------------------------------------------- // non-pipeables // ------------------------------------------------------------------------------------- -var map_ = function (fa, f) { return function_1.pipe(fa, map(f)); }; +/** @internal */ +var _map = function (fa, f) { return function_1.pipe(fa, map(f)); }; +exports._map = _map; +/** @internal */ /* istanbul ignore next */ -var mapWithIndex_ = function (fa, f) { return function_1.pipe(fa, mapWithIndex(f)); }; +var _mapWithIndex = function (fa, f) { return function_1.pipe(fa, mapWithIndex(f)); }; +exports._mapWithIndex = _mapWithIndex; +/** @internal */ /* istanbul ignore next */ -var reduce_ = function (fa, b, f) { return function_1.pipe(fa, exports.reduce(b, f)); }; -/* istanbul ignore next */ -var foldMap_ = function (M) { - var foldMapM = exports.foldMap(M); +var _reduce = function (O) { + var reduceO = reduce(O); + return function (fa, b, f) { return function_1.pipe(fa, reduceO(b, f)); }; +}; +exports._reduce = _reduce; +/** @internal */ +var _foldMap = function (O) { return function (M) { + var foldMapM = foldMap(O)(M); return function (fa, f) { return function_1.pipe(fa, foldMapM(f)); }; -}; -/* istanbul ignore next */ -var reduceRight_ = function (fa, b, f) { return function_1.pipe(fa, exports.reduceRight(b, f)); }; +}; }; +exports._foldMap = _foldMap; +/** @internal */ /* istanbul ignore next */ -var traverse_ = function (F) { - var traverseF = traverse(F); - return function (ta, f) { return function_1.pipe(ta, traverseF(f)); }; +var _reduceRight = function (O) { + var reduceRightO = reduceRight(O); + return function (fa, b, f) { return function_1.pipe(fa, reduceRightO(b, f)); }; }; +exports._reduceRight = _reduceRight; +/** @internal */ /* istanbul ignore next */ -var filter_ = function (fa, predicate) { +var _filter = function (fa, predicate) { return function_1.pipe(fa, exports.filter(predicate)); }; +exports._filter = _filter; +/** @internal */ /* istanbul ignore next */ -var filterMap_ = function (fa, f) { return function_1.pipe(fa, exports.filterMap(f)); }; -/* istanbul ignore next */ -var partition_ = function (fa, predicate) { return function_1.pipe(fa, exports.partition(predicate)); }; +var _filterMap = function (fa, f) { return function_1.pipe(fa, exports.filterMap(f)); }; +exports._filterMap = _filterMap; +/** @internal */ /* istanbul ignore next */ -var partitionMap_ = function (fa, f) { return function_1.pipe(fa, exports.partitionMap(f)); }; +var _partition = function (fa, predicate) { return function_1.pipe(fa, exports.partition(predicate)); }; +exports._partition = _partition; +/** @internal */ /* istanbul ignore next */ -var reduceWithIndex_ = function (fa, b, f) { - return function_1.pipe(fa, reduceWithIndex(b, f)); -}; +var _partitionMap = function (fa, f) { return function_1.pipe(fa, exports.partitionMap(f)); }; +exports._partitionMap = _partitionMap; +/** @internal */ /* istanbul ignore next */ -var foldMapWithIndex_ = function (M) { - var foldMapWithIndexM = foldMapWithIndex(M); - return function (fa, f) { return function_1.pipe(fa, foldMapWithIndexM(f)); }; +var _reduceWithIndex = function (O) { + var reduceWithIndexO = reduceWithIndex(O); + return function (fa, b, f) { return function_1.pipe(fa, reduceWithIndexO(b, f)); }; +}; +exports._reduceWithIndex = _reduceWithIndex; +/** @internal */ +var _foldMapWithIndex = function (O) { + var foldMapWithIndexO = foldMapWithIndex(O); + return function (M) { + var foldMapWithIndexM = foldMapWithIndexO(M); + return function (fa, f) { return function_1.pipe(fa, foldMapWithIndexM(f)); }; + }; }; +exports._foldMapWithIndex = _foldMapWithIndex; +/** @internal */ /* istanbul ignore next */ -var reduceRightWithIndex_ = function (fa, b, f) { - return function_1.pipe(fa, reduceRightWithIndex(b, f)); +var _reduceRightWithIndex = function (O) { + var reduceRightWithIndexO = reduceRightWithIndex(O); + return function (fa, b, f) { return function_1.pipe(fa, reduceRightWithIndexO(b, f)); }; }; +exports._reduceRightWithIndex = _reduceRightWithIndex; +/** @internal */ /* istanbul ignore next */ -var partitionMapWithIndex_ = function (fa, f) { return function_1.pipe(fa, partitionMapWithIndex(f)); }; +var _partitionMapWithIndex = function (fa, f) { return function_1.pipe(fa, partitionMapWithIndex(f)); }; +exports._partitionMapWithIndex = _partitionMapWithIndex; +/** @internal */ /* istanbul ignore next */ -var partitionWithIndex_ = function (fa, predicateWithIndex) { - return function_1.pipe(fa, partitionWithIndex(predicateWithIndex)); -}; +var _partitionWithIndex = function (fa, predicateWithIndex) { return function_1.pipe(fa, partitionWithIndex(predicateWithIndex)); }; +exports._partitionWithIndex = _partitionWithIndex; +/** @internal */ /* istanbul ignore next */ -var filterMapWithIndex_ = function (fa, f) { +var _filterMapWithIndex = function (fa, f) { return function_1.pipe(fa, filterMapWithIndex(f)); }; +exports._filterMapWithIndex = _filterMapWithIndex; +/** @internal */ /* istanbul ignore next */ -var filterWithIndex_ = function (fa, predicateWithIndex) { +var _filterWithIndex = function (fa, predicateWithIndex) { return function_1.pipe(fa, filterWithIndex(predicateWithIndex)); }; -/* istanbul ignore next */ -var traverseWithIndex_ = function (F) { - var traverseWithIndexF = traverseWithIndex(F); - return function (ta, f) { return function_1.pipe(ta, traverseWithIndexF(f)); }; -}; -/* istanbul ignore next */ -var wither_ = function (F) { - var witherF = exports.wither(F); - return function (fa, f) { return function_1.pipe(fa, witherF(f)); }; +exports._filterWithIndex = _filterWithIndex; +/** @internal */ +var _traverse = function (O) { + var traverseWithIndexO = _traverseWithIndex(O); + return function (F) { + var traverseWithIndexOF = traverseWithIndexO(F); + return function (ta, f) { return traverseWithIndexOF(ta, function_1.flow(function_1.SK, f)); }; + }; }; -/* istanbul ignore next */ -var wilt_ = function (F) { - var wiltF = exports.wilt(F); - return function (fa, f) { return function_1.pipe(fa, wiltF(f)); }; +exports._traverse = _traverse; +/** @internal */ +var _sequence = function (O) { + var traverseO = exports._traverse(O); + return function (F) { + var traverseOF = traverseO(F); + return function (ta) { return traverseOF(ta, function_1.identity); }; + }; }; +exports._sequence = _sequence; +var _traverseWithIndex = function (O) { return function (F) { + var keysO = keys_(O); + return function (ta, f) { + var ks = keysO(ta); + if (ks.length === 0) { + return F.of(exports.empty); + } + var fr = F.of({}); + var _loop_1 = function (key) { + fr = F.ap(F.map(fr, function (r) { return function (b) { + r[key] = b; + return r; + }; }), f(key, ta[key])); + }; + for (var _i = 0, ks_1 = ks; _i < ks_1.length; _i++) { + var key = ks_1[_i]; + _loop_1(key); + } + return fr; + }; +}; }; // ------------------------------------------------------------------------------------- -// pipeables +// type class members // ------------------------------------------------------------------------------------- /** * @category Filterable @@ -13402,72 +16107,77 @@ var partitionMap = function (f) { return partitionMapWithIndex(function (_, a) { return f(a); }); }; exports.partitionMap = partitionMap; -/** - * @category Foldable - * @since 2.5.0 - */ -var reduce = function (b, f) { - return reduceWithIndex(b, function (_, b, a) { return f(b, a); }); -}; +function reduce() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (args.length === 1) { + var reduceWithIndexO_1 = reduceWithIndex(args[0]); + return function (b, f) { return reduceWithIndexO_1(b, function (_, b, a) { return f(b, a); }); }; + } + return reduce(S.Ord).apply(void 0, args); +} exports.reduce = reduce; -/** - * @category Foldable - * @since 2.5.0 - */ -var foldMap = function (M) { - var foldMapWithIndexM = foldMapWithIndex(M); - return function (f) { return foldMapWithIndexM(function (_, a) { return f(a); }); }; -}; +function foldMap(O) { + if ('compare' in O) { + var foldMapWithIndexO_1 = foldMapWithIndex(O); + return function (M) { + var foldMapWithIndexM = foldMapWithIndexO_1(M); + return function (f) { return foldMapWithIndexM(function (_, a) { return f(a); }); }; + }; + } + return foldMap(S.Ord)(O); +} exports.foldMap = foldMap; -/** - * @category Foldable - * @since 2.5.0 - */ -var reduceRight = function (b, f) { - return reduceRightWithIndex(b, function (_, a, b) { return f(a, b); }); -}; +function reduceRight() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (args.length === 1) { + var reduceRightWithIndexO_1 = reduceRightWithIndex(args[0]); + return function (b, f) { return reduceRightWithIndexO_1(b, function (_, b, a) { return f(b, a); }); }; + } + return reduceRight(S.Ord).apply(void 0, args); +} exports.reduceRight = reduceRight; /** * @category Compactable * @since 2.5.0 */ -var compact = function (fa) { - var r = {}; - var keys = Object.keys(fa); - for (var _i = 0, keys_5 = keys; _i < keys_5.length; _i++) { - var key = keys_5[_i]; - var optionA = fa[key]; - if (Option_1.isSome(optionA)) { - r[key] = optionA.value; +var compact = function (r) { + var out = {}; + for (var k in r) { + if (_.has.call(r, k)) { + var oa = r[k]; + if (_.isSome(oa)) { + out[k] = oa.value; + } } } - return r; + return out; }; exports.compact = compact; /** * @category Compactable * @since 2.5.0 */ -var separate = function (fa) { +var separate = function (r) { var left = {}; var right = {}; - var keys = Object.keys(fa); - for (var _i = 0, keys_6 = keys; _i < keys_6.length; _i++) { - var key = keys_6[_i]; - var e = fa[key]; - switch (e._tag) { - case 'Left': - left[key] = e.left; - break; - case 'Right': - right[key] = e.right; - break; + for (var k in r) { + if (_.has.call(r, k)) { + var e = r[k]; + if (_.isLeft(e)) { + left[k] = e.left; + } + else { + right[k] = e.right; + } } } - return { - left: left, - right: right - }; + return Separated_1.separated(left, right); }; exports.separate = separate; // ------------------------------------------------------------------------------------- @@ -13478,46 +16188,95 @@ exports.separate = separate; * @since 2.5.0 */ exports.URI = 'ReadonlyRecord'; +function getShow(O) { + if ('compare' in O) { + return function (S) { return ({ + show: function (r) { + var elements = collect(O)(function (k, a) { return JSON.stringify(k) + ": " + S.show(a); })(r).join(', '); + return elements === '' ? '{}' : "{ " + elements + " }"; + } + }); }; + } + return getShow(S.Ord)(O); +} +exports.getShow = getShow; +function getEq(E) { + var isSubrecordE = isSubrecord(E); + return Eq_1.fromEquals(function (x, y) { return isSubrecordE(x)(y) && isSubrecordE(y)(x); }); +} +exports.getEq = getEq; +function getMonoid(S) { + return { + concat: function (first, second) { + if (exports.isEmpty(first)) { + return second; + } + if (exports.isEmpty(second)) { + return first; + } + var r = Object.assign({}, first); + for (var k in second) { + if (_.has.call(second, k)) { + r[k] = _.has.call(first, k) ? S.concat(first[k], second[k]) : second[k]; + } + } + return r; + }, + empty: exports.empty + }; +} +exports.getMonoid = getMonoid; /** * @category instances * @since 2.7.0 */ exports.Functor = { URI: exports.URI, - map: map_ + map: exports._map }; +/** + * Derivable from `Functor`. + * + * @category combinators + * @since 2.10.0 + */ +exports.flap = +/*#__PURE__*/ +Functor_1.flap(exports.Functor); /** * @category instances * @since 2.7.0 */ exports.FunctorWithIndex = { URI: exports.URI, - map: map_, - mapWithIndex: mapWithIndex_ + map: exports._map, + mapWithIndex: exports._mapWithIndex }; /** * @category instances - * @since 2.7.0 + * @since 2.11.0 */ -exports.Foldable = { +var getFoldable = function (O) { return ({ URI: exports.URI, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_ -}; + reduce: exports._reduce(O), + foldMap: exports._foldMap(O), + reduceRight: exports._reduceRight(O) +}); }; +exports.getFoldable = getFoldable; /** * @category instances - * @since 2.7.0 + * @since 2.11.0 */ -exports.FoldableWithIndex = { +var getFoldableWithIndex = function (O) { return ({ URI: exports.URI, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - reduceWithIndex: reduceWithIndex_, - foldMapWithIndex: foldMapWithIndex_, - reduceRightWithIndex: reduceRightWithIndex_ -}; + reduce: exports._reduce(O), + foldMap: exports._foldMap(O), + reduceRight: exports._reduceRight(O), + reduceWithIndex: exports._reduceWithIndex(O), + foldMapWithIndex: exports._foldMapWithIndex(O), + reduceRightWithIndex: exports._reduceRightWithIndex(O) +}); }; +exports.getFoldableWithIndex = getFoldableWithIndex; /** * @category instances * @since 2.7.0 @@ -13533,13 +16292,13 @@ exports.Compactable = { */ exports.Filterable = { URI: exports.URI, - map: map_, + map: exports._map, compact: exports.compact, separate: exports.separate, - filter: filter_, - filterMap: filterMap_, - partition: partition_, - partitionMap: partitionMap_ + filter: exports._filter, + filterMap: exports._filterMap, + partition: exports._partition, + partitionMap: exports._partitionMap }; /** * @category instances @@ -13547,101 +16306,326 @@ exports.Filterable = { */ exports.FilterableWithIndex = { URI: exports.URI, - map: map_, - mapWithIndex: mapWithIndex_, + map: exports._map, + mapWithIndex: exports._mapWithIndex, compact: exports.compact, separate: exports.separate, - filter: filter_, - filterMap: filterMap_, - partition: partition_, - partitionMap: partitionMap_, - filterMapWithIndex: filterMapWithIndex_, - filterWithIndex: filterWithIndex_, - partitionMapWithIndex: partitionMapWithIndex_, - partitionWithIndex: partitionWithIndex_ + filter: exports._filter, + filterMap: exports._filterMap, + partition: exports._partition, + partitionMap: exports._partitionMap, + filterMapWithIndex: exports._filterMapWithIndex, + filterWithIndex: exports._filterWithIndex, + partitionMapWithIndex: exports._partitionMapWithIndex, + partitionWithIndex: exports._partitionWithIndex +}; +/** + * @category instances + * @since 2.11.0 + */ +var getTraversable = function (O) { return ({ + URI: exports.URI, + map: exports._map, + reduce: exports._reduce(O), + foldMap: exports._foldMap(O), + reduceRight: exports._reduceRight(O), + traverse: exports._traverse(O), + sequence: exports._sequence(O) +}); }; +exports.getTraversable = getTraversable; +/** + * @category instances + * @since 2.11.0 + */ +var getTraversableWithIndex = function (O) { return ({ + URI: exports.URI, + map: exports._map, + mapWithIndex: exports._mapWithIndex, + reduce: exports._reduce(O), + foldMap: exports._foldMap(O), + reduceRight: exports._reduceRight(O), + reduceWithIndex: exports._reduceWithIndex(O), + foldMapWithIndex: exports._foldMapWithIndex(O), + reduceRightWithIndex: exports._reduceRightWithIndex(O), + traverse: exports._traverse(O), + sequence: exports._sequence(O), + traverseWithIndex: _traverseWithIndex(O) +}); }; +exports.getTraversableWithIndex = getTraversableWithIndex; +/** + * @category instances + * @since 2.11.0 + */ +var getWitherable = function (O) { + var T = exports.getTraversable(O); + return { + URI: exports.URI, + map: exports._map, + reduce: exports._reduce(O), + foldMap: exports._foldMap(O), + reduceRight: exports._reduceRight(O), + traverse: T.traverse, + sequence: T.sequence, + compact: exports.compact, + separate: exports.separate, + filter: exports._filter, + filterMap: exports._filterMap, + partition: exports._partition, + partitionMap: exports._partitionMap, + wither: Witherable_1.witherDefault(T, exports.Compactable), + wilt: Witherable_1.wiltDefault(T, exports.Compactable) + }; +}; +exports.getWitherable = getWitherable; +/** + * @category instances + * @since 2.11.0 + */ +var getUnionSemigroup = function (S) { + var unionS = exports.union(S); + return { + concat: function (first, second) { return unionS(second)(first); } + }; +}; +exports.getUnionSemigroup = getUnionSemigroup; +/** + * @category instances + * @since 2.11.0 + */ +var getUnionMonoid = function (S) { return ({ + concat: exports.getUnionSemigroup(S).concat, + empty: exports.empty +}); }; +exports.getUnionMonoid = getUnionMonoid; +/** + * @category instances + * @since 2.11.0 + */ +var getIntersectionSemigroup = function (S) { + var intersectionS = exports.intersection(S); + return { + concat: function (first, second) { return intersectionS(second)(first); } + }; +}; +exports.getIntersectionSemigroup = getIntersectionSemigroup; +/** + * @category instances + * @since 2.11.0 + */ +var getDifferenceMagma = function () { return ({ + concat: function (first, second) { return exports.difference(second)(first); } +}); }; +exports.getDifferenceMagma = getDifferenceMagma; +// ------------------------------------------------------------------------------------- +// deprecated +// ------------------------------------------------------------------------------------- +// tslint:disable: deprecation +/** + * Use `getFoldable` instead. + * + * @category instances + * @since 2.7.0 + * @deprecated + */ +exports.Foldable = { + URI: exports.URI, + reduce: + /*#__PURE__*/ + exports._reduce(S.Ord), + foldMap: + /*#__PURE__*/ + exports._foldMap(S.Ord), + reduceRight: + /*#__PURE__*/ + exports._reduceRight(S.Ord) }; /** + * Use `getFoldableWithIndex` instead. + * + * @category instances + * @since 2.7.0 + * @deprecated + */ +exports.FoldableWithIndex = { + URI: exports.URI, + reduce: + /*#__PURE__*/ + exports._reduce(S.Ord), + foldMap: + /*#__PURE__*/ + exports._foldMap(S.Ord), + reduceRight: + /*#__PURE__*/ + exports._reduceRight(S.Ord), + reduceWithIndex: + /*#__PURE__*/ + exports._reduceWithIndex(S.Ord), + foldMapWithIndex: + /*#__PURE__*/ + exports._foldMapWithIndex(S.Ord), + reduceRightWithIndex: + /*#__PURE__*/ + exports._reduceRightWithIndex(S.Ord) +}; +/** + * Use `getTraversable` instead. + * * @category instances * @since 2.7.0 + * @deprecated */ exports.Traversable = { URI: exports.URI, - map: map_, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - traverse: traverse_, + map: exports._map, + reduce: + /*#__PURE__*/ + exports._reduce(S.Ord), + foldMap: + /*#__PURE__*/ + exports._foldMap(S.Ord), + reduceRight: + /*#__PURE__*/ + exports._reduceRight(S.Ord), + traverse: + /*#__PURE__*/ + exports._traverse(S.Ord), sequence: sequence }; /** + * Use `getTraversableWithIndex` instead. + * * @category instances * @since 2.7.0 + * @deprecated */ exports.TraversableWithIndex = { URI: exports.URI, - map: map_, - mapWithIndex: mapWithIndex_, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - reduceWithIndex: reduceWithIndex_, - foldMapWithIndex: foldMapWithIndex_, - reduceRightWithIndex: reduceRightWithIndex_, - traverse: traverse_, + map: exports._map, + mapWithIndex: exports._mapWithIndex, + reduce: + /*#__PURE__*/ + exports._reduce(S.Ord), + foldMap: + /*#__PURE__*/ + exports._foldMap(S.Ord), + reduceRight: + /*#__PURE__*/ + exports._reduceRight(S.Ord), + reduceWithIndex: + /*#__PURE__*/ + exports._reduceWithIndex(S.Ord), + foldMapWithIndex: + /*#__PURE__*/ + exports._foldMapWithIndex(S.Ord), + reduceRightWithIndex: + /*#__PURE__*/ + exports._reduceRightWithIndex(S.Ord), + traverse: + /*#__PURE__*/ + exports._traverse(S.Ord), sequence: sequence, - traverseWithIndex: traverseWithIndex_ + traverseWithIndex: + /*#__PURE__*/ + _traverseWithIndex(S.Ord) }; +var _wither = +/*#__PURE__*/ +Witherable_1.witherDefault(exports.Traversable, exports.Compactable); +var _wilt = +/*#__PURE__*/ +Witherable_1.wiltDefault(exports.Traversable, exports.Compactable); /** + * Use `getWitherable` instead. + * * @category instances * @since 2.7.0 + * @deprecated */ exports.Witherable = { URI: exports.URI, - map: map_, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - traverse: traverse_, + map: exports._map, + reduce: + /*#__PURE__*/ + exports._reduce(S.Ord), + foldMap: + /*#__PURE__*/ + exports._foldMap(S.Ord), + reduceRight: + /*#__PURE__*/ + exports._reduceRight(S.Ord), + traverse: + /*#__PURE__*/ + exports._traverse(S.Ord), sequence: sequence, compact: exports.compact, separate: exports.separate, - filter: filter_, - filterMap: filterMap_, - partition: partition_, - partitionMap: partitionMap_, - wither: wither_, - wilt: wilt_ + filter: exports._filter, + filterMap: exports._filterMap, + partition: exports._partition, + partitionMap: exports._partitionMap, + wither: _wither, + wilt: _wilt }; -// TODO: remove in v3 /** + * Use [`upsertAt`](#upsertat) instead. + * + * @category combinators + * @since 2.5.0 + * @deprecated + */ +exports.insertAt = exports.upsertAt; +function hasOwnProperty(k, r) { + return _.has.call(r === undefined ? this : r, k); +} +exports.hasOwnProperty = hasOwnProperty; +/** + * Use small, specific instances instead. + * * @category instances * @since 2.5.0 + * @deprecated */ exports.readonlyRecord = { URI: exports.URI, - map: map_, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - traverse: traverse_, + map: exports._map, + reduce: + /*#__PURE__*/ + exports._reduce(S.Ord), + foldMap: + /*#__PURE__*/ + exports._foldMap(S.Ord), + reduceRight: + /*#__PURE__*/ + exports._reduceRight(S.Ord), + traverse: + /*#__PURE__*/ + exports._traverse(S.Ord), sequence: sequence, compact: exports.compact, separate: exports.separate, - filter: filter_, - filterMap: filterMap_, - partition: partition_, - partitionMap: partitionMap_, - mapWithIndex: mapWithIndex_, - reduceWithIndex: reduceWithIndex_, - foldMapWithIndex: foldMapWithIndex_, - reduceRightWithIndex: reduceRightWithIndex_, - filterMapWithIndex: filterMapWithIndex_, - filterWithIndex: filterWithIndex_, - partitionMapWithIndex: partitionMapWithIndex_, - partitionWithIndex: partitionWithIndex_, - traverseWithIndex: traverseWithIndex_, - wither: wither_, - wilt: wilt_ + filter: exports._filter, + filterMap: exports._filterMap, + partition: exports._partition, + partitionMap: exports._partitionMap, + mapWithIndex: exports._mapWithIndex, + reduceWithIndex: + /*#__PURE__*/ + exports._reduceWithIndex(S.Ord), + foldMapWithIndex: + /*#__PURE__*/ + exports._foldMapWithIndex(S.Ord), + reduceRightWithIndex: + /*#__PURE__*/ + exports._reduceRightWithIndex(S.Ord), + filterMapWithIndex: exports._filterMapWithIndex, + filterWithIndex: exports._filterWithIndex, + partitionMapWithIndex: exports._partitionMapWithIndex, + partitionWithIndex: exports._partitionWithIndex, + traverseWithIndex: + /*#__PURE__*/ + _traverseWithIndex(S.Ord), + wither: _wither, + wilt: _wilt }; @@ -13652,6 +16636,17 @@ exports.readonlyRecord = { "use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); @@ -13672,128 +16667,170 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FunctorWithIndex = exports.Functor = exports.URI = exports.separate = exports.compact = exports.reduceRight = exports.reduce = exports.partitionMap = exports.partition = exports.foldMap = exports.filterMap = exports.filter = exports.elem = exports.some = exports.every = exports.fromFoldableMap = exports.fromFoldable = exports.filterWithIndex = exports.filterMapWithIndex = exports.partitionWithIndex = exports.partitionMapWithIndex = exports.wilt = exports.wither = exports.sequence = exports.traverse = exports.traverseWithIndex = exports.singleton = exports.reduceRightWithIndex = exports.foldMapWithIndex = exports.reduceWithIndex = exports.map = exports.mapWithIndex = exports.empty = exports.lookup = exports.getMonoid = exports.getEq = exports.isSubrecord = exports.pop = exports.modifyAt = exports.updateAt = exports.deleteAt = exports.hasOwnProperty = exports.insertAt = exports.toUnfoldable = exports.toArray = exports.collect = exports.keys = exports.isEmpty = exports.size = exports.getShow = void 0; -exports.record = exports.Witherable = exports.TraversableWithIndex = exports.Traversable = exports.FilterableWithIndex = exports.Filterable = exports.Compactable = exports.FoldableWithIndex = exports.Foldable = void 0; +exports.getMonoid = exports.getEq = exports.getShow = exports.URI = exports.separate = exports.compact = exports.reduceRight = exports.foldMap = exports.reduce = exports.partitionMap = exports.partition = exports.filterMap = exports.filter = exports.difference = exports.intersection = exports.union = exports.elem = exports.some = exports.every = exports.fromFoldableMap = exports.fromFoldable = exports.filterWithIndex = exports.filterMapWithIndex = exports.partitionWithIndex = exports.partitionMapWithIndex = exports.wilt = exports.wither = exports.sequence = exports.traverse = exports.traverseWithIndex = exports.singleton = exports.reduceRightWithIndex = exports.foldMapWithIndex = exports.reduceWithIndex = exports.map = exports.mapWithIndex = exports.lookup = exports.isSubrecord = exports.pop = exports.modifyAt = exports.updateAt = exports.deleteAt = exports.has = exports.upsertAt = exports.toUnfoldable = exports.toArray = exports.collect = exports.keys = exports.isEmpty = exports.size = void 0; +exports.record = exports.hasOwnProperty = exports.insertAt = exports.empty = exports.Witherable = exports.TraversableWithIndex = exports.Traversable = exports.FoldableWithIndex = exports.Foldable = exports.getDifferenceMagma = exports.getIntersectionSemigroup = exports.getUnionMonoid = exports.getUnionSemigroup = exports.getWitherable = exports.getTraversableWithIndex = exports.getTraversable = exports.FilterableWithIndex = exports.Filterable = exports.Compactable = exports.getFoldableWithIndex = exports.getFoldable = exports.FunctorWithIndex = exports.flap = exports.Functor = void 0; +var function_1 = __nccwpck_require__(6985); +var Functor_1 = __nccwpck_require__(5533); +var _ = __importStar(__nccwpck_require__(1840)); var RR = __importStar(__nccwpck_require__(1897)); -/* tslint:disable:readonly-array */ +var S = __importStar(__nccwpck_require__(5189)); +var Witherable_1 = __nccwpck_require__(4384); // ------------------------------------------------------------------------------------- // model // ------------------------------------------------------------------------------------- /** - * @since 2.0.0 - */ -exports.getShow = RR.getShow; -/** - * Calculate the number of key/value pairs in a record + * Calculate the number of key/value pairs in a `Record`. * * @since 2.0.0 */ exports.size = RR.size; /** - * Test whether a record is empty + * Test whether a `Record` is empty. * * @since 2.0.0 */ exports.isEmpty = RR.isEmpty; +var keys_ = function (O) { return function (r) { + return Object.keys(r).sort(O.compare); +}; }; /** * @since 2.0.0 */ -exports.keys = RR.keys; +exports.keys = +/*#__PURE__*/ +keys_(S.Ord); +function collect(O) { + if (typeof O === 'function') { + return collect(S.Ord)(O); + } + var keysO = keys_(O); + return function (f) { return function (r) { + var out = []; + for (var _i = 0, _a = keysO(r); _i < _a.length; _i++) { + var key = _a[_i]; + out.push(f(key, r[key])); + } + return out; + }; }; +} +exports.collect = collect; /** - * Map a record into an array - * - * @example - * import {collect} from 'fp-ts/Record' - * - * const x: { a: string, b: boolean } = { a: 'foo', b: false } - * assert.deepStrictEqual( - * collect((key, val) => ({key: key, value: val}))(x), - * [{key: 'a', value: 'foo'}, {key: 'b', value: false}] - * ) + * Get a sorted `Array` of the key/value pairs contained in a `Record`. * * @since 2.0.0 */ -exports.collect = RR.collect; -/** - * @since 2.0.0 - */ -exports.toArray = RR.toReadonlyArray; +exports.toArray = +/*#__PURE__*/ +collect(S.Ord)(function (k, a) { return [k, a]; }); function toUnfoldable(U) { - return RR.toUnfoldable(U); + return function (r) { + var sas = exports.toArray(r); + var len = sas.length; + return U.unfold(0, function (b) { return (b < len ? _.some([sas[b], b + 1]) : _.none); }); + }; } exports.toUnfoldable = toUnfoldable; -function insertAt(k, a) { - return RR.insertAt(k, a); -} -exports.insertAt = insertAt; /** - * @since 2.0.0 + * Insert or replace a key/value pair in a `Record`. + * + * @category combinators + * @since 2.10.0 */ -exports.hasOwnProperty = RR.hasOwnProperty; +exports.upsertAt = RR.upsertAt; +/** + * Test whether or not a key exists in a `Record`. + * + * Note. This function is not pipeable because is a `Refinement`. + * + * @since 2.10.0 + */ +exports.has = RR.has; function deleteAt(k) { - return RR.deleteAt(k); + return function (r) { + if (!_.has.call(r, k)) { + return r; + } + var out = Object.assign({}, r); + delete out[k]; + return out; + }; } exports.deleteAt = deleteAt; /** * @since 2.0.0 */ -exports.updateAt = RR.updateAt; +var updateAt = function (k, a) { + return exports.modifyAt(k, function () { return a; }); +}; +exports.updateAt = updateAt; /** * @since 2.0.0 */ -exports.modifyAt = RR.modifyAt; +var modifyAt = function (k, f) { return function (r) { + if (!exports.has(k, r)) { + return _.none; + } + var out = Object.assign({}, r); + out[k] = f(r[k]); + return _.some(out); +}; }; +exports.modifyAt = modifyAt; function pop(k) { - return RR.pop(k); + var deleteAtk = deleteAt(k); + return function (r) { + var oa = exports.lookup(k, r); + return _.isNone(oa) ? _.none : _.some([oa.value, deleteAtk(r)]); + }; } exports.pop = pop; // TODO: remove non-curried overloading in v3 /** - * Test whether one record contains all of the keys and values contained in another record + * Test whether one `Record` contains all of the keys and values contained in another `Record`. * * @since 2.0.0 */ exports.isSubrecord = RR.isSubrecord; -function getEq(E) { - return RR.getEq(E); -} -exports.getEq = getEq; -function getMonoid(S) { - return RR.getMonoid(S); -} -exports.getMonoid = getMonoid; // TODO: remove non-curried overloading in v3 /** - * Lookup the value for a key in a record + * Lookup the value for a key in a `Record`. * * @since 2.0.0 */ exports.lookup = RR.lookup; /** + * Map a `Record` passing the keys to the iterating function. + * * @since 2.0.0 */ -exports.empty = {}; -function mapWithIndex(f) { - return RR.mapWithIndex(f); -} -exports.mapWithIndex = mapWithIndex; -function map(f) { - return RR.map(f); -} -exports.map = map; -function reduceWithIndex(b, f) { - return RR.reduceWithIndex(b, f); +exports.mapWithIndex = RR.mapWithIndex; +/** + * Map a `Record` passing the values to the iterating function. + * + * @since 2.0.0 + */ +exports.map = RR.map; +function reduceWithIndex() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return args.length === 1 ? RR.reduceWithIndex(args[0]) : RR.reduceWithIndex(S.Ord).apply(void 0, args); } exports.reduceWithIndex = reduceWithIndex; -function foldMapWithIndex(M) { - return RR.foldMapWithIndex(M); +function foldMapWithIndex(O) { + return 'compare' in O ? RR.foldMapWithIndex(O) : RR.foldMapWithIndex(S.Ord)(O); } exports.foldMapWithIndex = foldMapWithIndex; -function reduceRightWithIndex(b, f) { - return RR.reduceRightWithIndex(b, f); +function reduceRightWithIndex() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return args.length === 1 ? RR.reduceRightWithIndex(args[0]) : RR.reduceRightWithIndex(S.Ord).apply(void 0, args); } exports.reduceRightWithIndex = reduceRightWithIndex; /** - * Create a record with one key/value pair + * Create a `Record` with one key/value pair. * * @since 2.0.0 */ @@ -13814,24 +16851,32 @@ exports.sequence = sequence; * @category Witherable * @since 2.6.5 */ -exports.wither = RR.wither; +var wither = function (F) { + var traverseF = traverse(F); + return function (f) { return function (fa) { return F.map(function_1.pipe(fa, traverseF(f)), exports.compact); }; }; +}; +exports.wither = wither; /** * @category Witherable * @since 2.6.5 */ -exports.wilt = RR.wilt; -function partitionMapWithIndex(f) { - return RR.partitionMapWithIndex(f); -} -exports.partitionMapWithIndex = partitionMapWithIndex; +var wilt = function (F) { + var traverseF = traverse(F); + return function (f) { return function (fa) { return F.map(function_1.pipe(fa, traverseF(f)), exports.separate); }; }; +}; +exports.wilt = wilt; +/** + * @since 2.0.0 + */ +exports.partitionMapWithIndex = RR.partitionMapWithIndex; function partitionWithIndex(predicateWithIndex) { return RR.partitionWithIndex(predicateWithIndex); } exports.partitionWithIndex = partitionWithIndex; -function filterMapWithIndex(f) { - return RR.filterMapWithIndex(f); -} -exports.filterMapWithIndex = filterMapWithIndex; +/** + * @since 2.0.0 + */ +exports.filterMapWithIndex = RR.filterMapWithIndex; function filterWithIndex(predicateWithIndex) { return RR.filterWithIndex(predicateWithIndex); } @@ -13857,37 +16902,92 @@ exports.some = RR.some; * @since 2.0.0 */ exports.elem = RR.elem; +/** + * @category combinators + * @since 2.11.0 + */ +var union = function (M) { + var unionM = RR.union(M); + return function (second) { return function (first) { + if (exports.isEmpty(first)) { + return __assign({}, second); + } + if (exports.isEmpty(second)) { + return __assign({}, first); + } + return unionM(second)(first); + }; }; +}; +exports.union = union; +/** + * @category combinators + * @since 2.11.0 + */ +var intersection = function (M) { return function (second) { return function (first) { + if (exports.isEmpty(first) || exports.isEmpty(second)) { + return {}; + } + return RR.intersection(M)(second)(first); +}; }; }; +exports.intersection = intersection; +/** + * @category combinators + * @since 2.11.0 + */ +var difference = function (second) { return function (first) { + if (exports.isEmpty(first)) { + return __assign({}, second); + } + if (exports.isEmpty(second)) { + return __assign({}, first); + } + return RR.difference(second)(first); +}; }; +exports.difference = difference; // ------------------------------------------------------------------------------------- // non-pipeables // ------------------------------------------------------------------------------------- -var map_ = RR.Functor.map; -var mapWithIndex_ = RR.FunctorWithIndex.mapWithIndex; -var reduce_ = RR.Foldable.reduce; -var foldMap_ = RR.Foldable.foldMap; -var reduceRight_ = RR.Foldable.reduceRight; -var reduceWithIndex_ = RR.FoldableWithIndex.reduceWithIndex; -var foldMapWithIndex_ = RR.FoldableWithIndex.foldMapWithIndex; -var reduceRightWithIndex_ = RR.FoldableWithIndex.reduceRightWithIndex; -var filter_ = RR.Filterable.filter; -var filterMap_ = RR.Filterable.filterMap; -var partition_ = RR.Filterable.partition; -var partitionMap_ = RR.Filterable.partitionMap; -var filterWithIndex_ = RR.FilterableWithIndex - .filterWithIndex; -var filterMapWithIndex_ = RR.FilterableWithIndex.filterMapWithIndex; -var partitionWithIndex_ = RR.FilterableWithIndex - .partitionWithIndex; -var partitionMapWithIndex_ = RR.FilterableWithIndex.partitionMapWithIndex; -var traverseWithIndex_ = RR.TraversableWithIndex - .traverseWithIndex; -var wither_ = RR.Witherable.wither; -var wilt_ = RR.Witherable.wilt; -var traverse_ = function (F) { - var traverseF = traverse(F); - return function (ta, f) { return traverseF(f)(ta); }; -}; +var _map = RR._map; +var _mapWithIndex = RR._mapWithIndex; +var _reduce = RR._reduce; +var _foldMap = RR._foldMap; +var _reduceRight = RR._reduceRight; +var _filter = RR._filter; +var _filterMap = RR._filterMap; +var _partition = RR._partition; +var _partitionMap = RR._partitionMap; +var _reduceWithIndex = RR._reduceWithIndex; +var _foldMapWithIndex = RR._foldMapWithIndex; +var _reduceRightWithIndex = RR._reduceRightWithIndex; +var _partitionMapWithIndex = RR._partitionMapWithIndex; +var _partitionWithIndex = RR._partitionWithIndex; +var _filterMapWithIndex = RR._filterMapWithIndex; +var _filterWithIndex = RR._filterWithIndex; +var _traverse = RR._traverse; +var _sequence = RR._sequence; +var _traverseWithIndex = function (O) { return function (F) { + var keysO = keys_(O); + return function (ta, f) { + var ks = keysO(ta); + if (ks.length === 0) { + return F.of({}); + } + var fr = F.of({}); + var _loop_1 = function (key) { + fr = F.ap(F.map(fr, function (r) { return function (b) { + r[key] = b; + return r; + }; }), f(key, ta[key])); + }; + for (var _i = 0, ks_1 = ks; _i < ks_1.length; _i++) { + var key = ks_1[_i]; + _loop_1(key); + } + return fr; + }; +}; }; // ------------------------------------------------------------------------------------- -// pipeables +// type class members // ------------------------------------------------------------------------------------- /** * @category Filterable @@ -13899,11 +16999,6 @@ exports.filter = RR.filter; * @since 2.0.0 */ exports.filterMap = RR.filterMap; -/** - * @category Foldable - * @since 2.0.0 - */ -exports.foldMap = RR.foldMap; /** * @category Filterable * @since 2.0.0 @@ -13914,16 +17009,26 @@ exports.partition = RR.partition; * @since 2.0.0 */ exports.partitionMap = RR.partitionMap; -/** - * @category Foldable - * @since 2.0.0 - */ -exports.reduce = RR.reduce; -/** - * @category Foldable - * @since 2.0.0 - */ -exports.reduceRight = RR.reduceRight; +function reduce() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return args.length === 1 ? RR.reduce(args[0]) : RR.reduce(S.Ord).apply(void 0, args); +} +exports.reduce = reduce; +function foldMap(O) { + return 'compare' in O ? RR.foldMap(O) : RR.foldMap(S.Ord)(O); +} +exports.foldMap = foldMap; +function reduceRight() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return args.length === 1 ? RR.reduceRight(args[0]) : RR.reduceRight(S.Ord).apply(void 0, args); +} +exports.reduceRight = reduceRight; /** * @category Compactable * @since 2.0.0 @@ -13942,182 +17047,469 @@ exports.separate = RR.separate; * @since 2.0.0 */ exports.URI = 'Record'; +function getShow(O) { + return 'compare' in O ? RR.getShow(O) : RR.getShow(S.Ord)(O); +} +exports.getShow = getShow; +/** + * @category instances + * @since 2.0.0 + */ +exports.getEq = RR.getEq; +/** + * Returns a `Monoid` instance for `Record`s given a `Semigroup` instance for their values. + * + * @example + * import { SemigroupSum } from 'fp-ts/number' + * import { getMonoid } from 'fp-ts/Record' + * + * const M = getMonoid(SemigroupSum) + * assert.deepStrictEqual(M.concat({ foo: 123 }, { foo: 456 }), { foo: 579 }) + * + * @category instances + * @since 2.0.0 + */ +exports.getMonoid = RR.getMonoid; /** * @category instances * @since 2.7.0 */ exports.Functor = { URI: exports.URI, - map: map_ + map: _map }; +/** + * Derivable from `Functor`. + * + * @category combinators + * @since 2.10.0 + */ +exports.flap = +/*#__PURE__*/ +Functor_1.flap(exports.Functor); /** * @category instances * @since 2.7.0 */ exports.FunctorWithIndex = { URI: exports.URI, - map: map_, - mapWithIndex: mapWithIndex_ + map: _map, + mapWithIndex: _mapWithIndex }; +/** + * @category instances + * @since 2.11.0 + */ +var getFoldable = function (O) { return ({ + URI: exports.URI, + reduce: _reduce(O), + foldMap: _foldMap(O), + reduceRight: _reduceRight(O) +}); }; +exports.getFoldable = getFoldable; +/** + * @category instances + * @since 2.11.0 + */ +var getFoldableWithIndex = function (O) { return ({ + URI: exports.URI, + reduce: _reduce(O), + foldMap: _foldMap(O), + reduceRight: _reduceRight(O), + reduceWithIndex: _reduceWithIndex(O), + foldMapWithIndex: _foldMapWithIndex(O), + reduceRightWithIndex: _reduceRightWithIndex(O) +}); }; +exports.getFoldableWithIndex = getFoldableWithIndex; /** * @category instances * @since 2.7.0 */ -exports.Foldable = { +exports.Compactable = { URI: exports.URI, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_ + compact: exports.compact, + separate: exports.separate }; /** * @category instances * @since 2.7.0 */ -exports.FoldableWithIndex = { +exports.Filterable = { URI: exports.URI, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - reduceWithIndex: reduceWithIndex_, - foldMapWithIndex: foldMapWithIndex_, - reduceRightWithIndex: reduceRightWithIndex_ + map: _map, + compact: exports.compact, + separate: exports.separate, + filter: _filter, + filterMap: _filterMap, + partition: _partition, + partitionMap: _partitionMap }; /** * @category instances * @since 2.7.0 */ -exports.Compactable = { +exports.FilterableWithIndex = { URI: exports.URI, + map: _map, + mapWithIndex: _mapWithIndex, compact: exports.compact, - separate: exports.separate + separate: exports.separate, + filter: _filter, + filterMap: _filterMap, + partition: _partition, + partitionMap: _partitionMap, + filterMapWithIndex: _filterMapWithIndex, + filterWithIndex: _filterWithIndex, + partitionMapWithIndex: _partitionMapWithIndex, + partitionWithIndex: _partitionWithIndex +}; +/** + * @category instances + * @since 2.11.0 + */ +var getTraversable = function (O) { return ({ + URI: exports.URI, + map: _map, + reduce: _reduce(O), + foldMap: _foldMap(O), + reduceRight: _reduceRight(O), + traverse: _traverse(O), + sequence: _sequence(O) +}); }; +exports.getTraversable = getTraversable; +/** + * @category instances + * @since 2.11.0 + */ +var getTraversableWithIndex = function (O) { return ({ + URI: exports.URI, + map: _map, + mapWithIndex: _mapWithIndex, + reduce: _reduce(O), + foldMap: _foldMap(O), + reduceRight: _reduceRight(O), + reduceWithIndex: _reduceWithIndex(O), + foldMapWithIndex: _foldMapWithIndex(O), + reduceRightWithIndex: _reduceRightWithIndex(O), + traverse: _traverse(O), + sequence: _sequence(O), + traverseWithIndex: _traverseWithIndex(O) +}); }; +exports.getTraversableWithIndex = getTraversableWithIndex; +/** + * @category instances + * @since 2.11.0 + */ +var getWitherable = function (O) { + var T = exports.getTraversable(O); + return { + URI: exports.URI, + map: _map, + reduce: _reduce(O), + foldMap: _foldMap(O), + reduceRight: _reduceRight(O), + traverse: T.traverse, + sequence: T.sequence, + compact: exports.compact, + separate: exports.separate, + filter: _filter, + filterMap: _filterMap, + partition: _partition, + partitionMap: _partitionMap, + wither: Witherable_1.witherDefault(T, exports.Compactable), + wilt: Witherable_1.wiltDefault(T, exports.Compactable) + }; +}; +exports.getWitherable = getWitherable; +/** + * @category instances + * @since 2.11.0 + */ +var getUnionSemigroup = function (S) { + var unionS = exports.union(S); + return { + concat: function (first, second) { return unionS(second)(first); } + }; +}; +exports.getUnionSemigroup = getUnionSemigroup; +/** + * @category instances + * @since 2.11.0 + */ +var getUnionMonoid = function (S) { return ({ + concat: exports.getUnionSemigroup(S).concat, + empty: {} +}); }; +exports.getUnionMonoid = getUnionMonoid; +/** + * @category instances + * @since 2.11.0 + */ +var getIntersectionSemigroup = function (S) { + var intersectionS = exports.intersection(S); + return { + concat: function (first, second) { return intersectionS(second)(first); } + }; }; +exports.getIntersectionSemigroup = getIntersectionSemigroup; +/** + * @category instances + * @since 2.11.0 + */ +var getDifferenceMagma = function () { return ({ + concat: function (first, second) { return exports.difference(second)(first); } +}); }; +exports.getDifferenceMagma = getDifferenceMagma; +// ------------------------------------------------------------------------------------- +// deprecated +// ------------------------------------------------------------------------------------- +// tslint:disable: deprecation /** + * Use `getFoldable` instead. + * * @category instances * @since 2.7.0 + * @deprecated */ -exports.Filterable = { +exports.Foldable = { URI: exports.URI, - map: map_, - compact: exports.compact, - separate: exports.separate, - filter: filter_, - filterMap: filterMap_, - partition: partition_, - partitionMap: partitionMap_ + reduce: + /*#__PURE__*/ + _reduce(S.Ord), + foldMap: + /*#__PURE__*/ + _foldMap(S.Ord), + reduceRight: + /*#__PURE__*/ + _reduceRight(S.Ord) }; /** + * Use `getFoldableWithIndex` instead. + * * @category instances * @since 2.7.0 + * @deprecated */ -exports.FilterableWithIndex = { +exports.FoldableWithIndex = { URI: exports.URI, - map: map_, - mapWithIndex: mapWithIndex_, - compact: exports.compact, - separate: exports.separate, - filter: filter_, - filterMap: filterMap_, - partition: partition_, - partitionMap: partitionMap_, - filterMapWithIndex: filterMapWithIndex_, - filterWithIndex: filterWithIndex_, - partitionMapWithIndex: partitionMapWithIndex_, - partitionWithIndex: partitionWithIndex_ -}; -/** + reduce: + /*#__PURE__*/ + _reduce(S.Ord), + foldMap: + /*#__PURE__*/ + _foldMap(S.Ord), + reduceRight: + /*#__PURE__*/ + _reduceRight(S.Ord), + reduceWithIndex: + /*#__PURE__*/ + _reduceWithIndex(S.Ord), + foldMapWithIndex: + /*#__PURE__*/ + _foldMapWithIndex(S.Ord), + reduceRightWithIndex: + /*#__PURE__*/ + _reduceRightWithIndex(S.Ord) +}; +/** + * Use `getTraversable` instead. + * * @category instances * @since 2.7.0 + * @deprecated */ exports.Traversable = { URI: exports.URI, - map: map_, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - traverse: traverse_, + map: _map, + reduce: + /*#__PURE__*/ + _reduce(S.Ord), + foldMap: + /*#__PURE__*/ + _foldMap(S.Ord), + reduceRight: + /*#__PURE__*/ + _reduceRight(S.Ord), + traverse: + /*#__PURE__*/ + _traverse(S.Ord), sequence: sequence }; /** + * Use the `getTraversableWithIndex` instead. + * * @category instances * @since 2.7.0 + * @deprecated */ exports.TraversableWithIndex = { URI: exports.URI, - map: map_, - mapWithIndex: mapWithIndex_, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - reduceWithIndex: reduceWithIndex_, - foldMapWithIndex: foldMapWithIndex_, - reduceRightWithIndex: reduceRightWithIndex_, - traverse: traverse_, + map: _map, + mapWithIndex: _mapWithIndex, + reduce: + /*#__PURE__*/ + _reduce(S.Ord), + foldMap: + /*#__PURE__*/ + _foldMap(S.Ord), + reduceRight: + /*#__PURE__*/ + _reduceRight(S.Ord), + reduceWithIndex: + /*#__PURE__*/ + _reduceWithIndex(S.Ord), + foldMapWithIndex: + /*#__PURE__*/ + _foldMapWithIndex(S.Ord), + reduceRightWithIndex: + /*#__PURE__*/ + _reduceRightWithIndex(S.Ord), + traverse: + /*#__PURE__*/ + _traverse(S.Ord), sequence: sequence, - traverseWithIndex: traverseWithIndex_ + traverseWithIndex: + /*#__PURE__*/ + _traverseWithIndex(S.Ord) }; +var _wither = +/*#__PURE__*/ +Witherable_1.witherDefault(exports.Traversable, exports.Compactable); +var _wilt = +/*#__PURE__*/ +Witherable_1.wiltDefault(exports.Traversable, exports.Compactable); /** + * Use `getWitherable` instead. + * * @category instances * @since 2.7.0 + * @deprecated */ exports.Witherable = { URI: exports.URI, - map: map_, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - traverse: traverse_, + map: _map, + reduce: + /*#__PURE__*/ + _reduce(S.Ord), + foldMap: + /*#__PURE__*/ + _foldMap(S.Ord), + reduceRight: + /*#__PURE__*/ + _reduceRight(S.Ord), + traverse: + /*#__PURE__*/ + _traverse(S.Ord), sequence: sequence, compact: exports.compact, separate: exports.separate, - filter: filter_, - filterMap: filterMap_, - partition: partition_, - partitionMap: partitionMap_, - wither: wither_, - wilt: wilt_ + filter: _filter, + filterMap: _filterMap, + partition: _partition, + partitionMap: _partitionMap, + wither: _wither, + wilt: _wilt }; -// TODO: remove in v3 /** + * Use a new `{}` instead. + * + * @since 2.0.0 + * @deprecated + */ +exports.empty = {}; +/** + * Use [`upsertAt`](#upsertat) instead. + * + * @since 2.0.0 + * @deprecated + */ +exports.insertAt = exports.upsertAt; +/** + * Use [`has`](#has) instead. + * + * @since 2.0.0 + * @deprecated + */ +exports.hasOwnProperty = RR.hasOwnProperty; +/** + * Use small, specific instances instead. + * * @category instances * @since 2.0.0 + * @deprecated */ exports.record = { URI: exports.URI, - map: map_, - reduce: reduce_, - foldMap: foldMap_, - reduceRight: reduceRight_, - traverse: traverse_, + map: _map, + reduce: + /*#__PURE__*/ + _reduce(S.Ord), + foldMap: + /*#__PURE__*/ + _foldMap(S.Ord), + reduceRight: + /*#__PURE__*/ + _reduceRight(S.Ord), + traverse: + /*#__PURE__*/ + _traverse(S.Ord), sequence: sequence, compact: exports.compact, separate: exports.separate, - filter: filter_, - filterMap: filterMap_, - partition: partition_, - partitionMap: partitionMap_, - mapWithIndex: mapWithIndex_, - reduceWithIndex: reduceWithIndex_, - foldMapWithIndex: foldMapWithIndex_, - reduceRightWithIndex: reduceRightWithIndex_, - filterMapWithIndex: filterMapWithIndex_, - filterWithIndex: filterWithIndex_, - partitionMapWithIndex: partitionMapWithIndex_, - partitionWithIndex: partitionWithIndex_, - traverseWithIndex: traverseWithIndex_, - wither: wither_, - wilt: wilt_ + filter: _filter, + filterMap: _filterMap, + partition: _partition, + partitionMap: _partitionMap, + mapWithIndex: _mapWithIndex, + reduceWithIndex: + /*#__PURE__*/ + _reduceWithIndex(S.Ord), + foldMapWithIndex: + /*#__PURE__*/ + _foldMapWithIndex(S.Ord), + reduceRightWithIndex: + /*#__PURE__*/ + _reduceRightWithIndex(S.Ord), + filterMapWithIndex: _filterMapWithIndex, + filterWithIndex: _filterWithIndex, + partitionMapWithIndex: _partitionMapWithIndex, + partitionWithIndex: _partitionWithIndex, + traverseWithIndex: + /*#__PURE__*/ + _traverseWithIndex(S.Ord), + wither: _wither, + wilt: _wilt }; /***/ }), /***/ 6339: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getIntercalateSemigroup = exports.semigroupVoid = exports.semigroupString = exports.semigroupProduct = exports.semigroupSum = exports.semigroupAny = exports.semigroupAll = exports.getObjectSemigroup = exports.getJoinSemigroup = exports.getMeetSemigroup = exports.getStructSemigroup = exports.getFunctionSemigroup = exports.getDualSemigroup = exports.getTupleSemigroup = exports.getLastSemigroup = exports.getFirstSemigroup = exports.fold = void 0; +exports.semigroupProduct = exports.semigroupSum = exports.semigroupString = exports.getFunctionSemigroup = exports.semigroupAny = exports.semigroupAll = exports.fold = exports.getIntercalateSemigroup = exports.getMeetSemigroup = exports.getJoinSemigroup = exports.getDualSemigroup = exports.getStructSemigroup = exports.getTupleSemigroup = exports.getFirstSemigroup = exports.getLastSemigroup = exports.getObjectSemigroup = exports.semigroupVoid = exports.concatAll = exports.last = exports.first = exports.intercalate = exports.tuple = exports.struct = exports.reverse = exports.constant = exports.max = exports.min = void 0; /** * If a type `A` can form a `Semigroup` it has an **associative** binary operation. * @@ -14157,330 +17549,660 @@ exports.getIntercalateSemigroup = exports.semigroupVoid = exports.semigroupStrin * * @since 2.0.0 */ -var function_1 = __nccwpck_require__(6985); -var Ord_1 = __nccwpck_require__(6685); +var function_1 = __nccwpck_require__(6985); +var _ = __importStar(__nccwpck_require__(1840)); +var M = __importStar(__nccwpck_require__(179)); +var Or = __importStar(__nccwpck_require__(6685)); +// ------------------------------------------------------------------------------------- +// constructors +// ------------------------------------------------------------------------------------- +/** + * Get a semigroup where `concat` will return the minimum, based on the provided order. + * + * @example + * import * as N from 'fp-ts/number' + * import * as S from 'fp-ts/Semigroup' + * + * const S1 = S.min(N.Ord) + * + * assert.deepStrictEqual(S1.concat(1, 2), 1) + * + * @category constructors + * @since 2.10.0 + */ +var min = function (O) { return ({ + concat: Or.min(O) +}); }; +exports.min = min; +/** + * Get a semigroup where `concat` will return the maximum, based on the provided order. + * + * @example + * import * as N from 'fp-ts/number' + * import * as S from 'fp-ts/Semigroup' + * + * const S1 = S.max(N.Ord) + * + * assert.deepStrictEqual(S1.concat(1, 2), 2) + * + * @category constructors + * @since 2.10.0 + */ +var max = function (O) { return ({ + concat: Or.max(O) +}); }; +exports.max = max; +/** + * @category constructors + * @since 2.10.0 + */ +var constant = function (a) { return ({ + concat: function () { return a; } +}); }; +exports.constant = constant; +// ------------------------------------------------------------------------------------- +// combinators +// ------------------------------------------------------------------------------------- +/** + * The dual of a `Semigroup`, obtained by swapping the arguments of `concat`. + * + * @example + * import { reverse } from 'fp-ts/Semigroup' + * import * as S from 'fp-ts/string' + * + * assert.deepStrictEqual(reverse(S.Semigroup).concat('a', 'b'), 'ba') + * + * @category combinators + * @since 2.10.0 + */ +exports.reverse = M.reverse; +/** + * Given a struct of semigroups returns a semigroup for the struct. + * + * @example + * import { struct } from 'fp-ts/Semigroup' + * import * as N from 'fp-ts/number' + * + * interface Point { + * readonly x: number + * readonly y: number + * } + * + * const S = struct({ + * x: N.SemigroupSum, + * y: N.SemigroupSum + * }) + * + * assert.deepStrictEqual(S.concat({ x: 1, y: 2 }, { x: 3, y: 4 }), { x: 4, y: 6 }) + * + * @category combinators + * @since 2.10.0 + */ +var struct = function (semigroups) { return ({ + concat: function (first, second) { + var r = {}; + for (var k in semigroups) { + if (_.has.call(semigroups, k)) { + r[k] = semigroups[k].concat(first[k], second[k]); + } + } + return r; + } +}); }; +exports.struct = struct; +/** + * Given a tuple of semigroups returns a semigroup for the tuple. + * + * @example + * import { tuple } from 'fp-ts/Semigroup' + * import * as B from 'fp-ts/boolean' + * import * as N from 'fp-ts/number' + * import * as S from 'fp-ts/string' + * + * const S1 = tuple(S.Semigroup, N.SemigroupSum) + * assert.deepStrictEqual(S1.concat(['a', 1], ['b', 2]), ['ab', 3]) + * + * const S2 = tuple(S.Semigroup, N.SemigroupSum, B.SemigroupAll) + * assert.deepStrictEqual(S2.concat(['a', 1, true], ['b', 2, false]), ['ab', 3, false]) + * + * @category combinators + * @since 2.10.0 + */ +var tuple = function () { + var semigroups = []; + for (var _i = 0; _i < arguments.length; _i++) { + semigroups[_i] = arguments[_i]; + } + return ({ + concat: function (first, second) { return semigroups.map(function (s, i) { return s.concat(first[i], second[i]); }); } + }); +}; +exports.tuple = tuple; +/** + * Between each pair of elements insert `middle`. + * + * @example + * import { intercalate } from 'fp-ts/Semigroup' + * import * as S from 'fp-ts/string' + * import { pipe } from 'fp-ts/function' + * + * const S1 = pipe(S.Semigroup, intercalate(' + ')) + * + * assert.strictEqual(S1.concat('a', 'b'), 'a + b') + * + * @category combinators + * @since 2.10.0 + */ +var intercalate = function (middle) { return function (S) { return ({ + concat: function (x, y) { return S.concat(x, S.concat(middle, y)); } +}); }; }; +exports.intercalate = intercalate; +// ------------------------------------------------------------------------------------- +// instances +// ------------------------------------------------------------------------------------- +/** + * Always return the first argument. + * + * @example + * import * as S from 'fp-ts/Semigroup' + * + * assert.deepStrictEqual(S.first().concat(1, 2), 1) + * + * @category instances + * @since 2.10.0 + */ +var first = function () { return ({ concat: function_1.identity }); }; +exports.first = first; +/** + * Always return the last argument. + * + * @example + * import * as S from 'fp-ts/Semigroup' + * + * assert.deepStrictEqual(S.last().concat(1, 2), 2) + * + * @category instances + * @since 2.10.0 + */ +var last = function () { return ({ concat: function (_, y) { return y; } }); }; +exports.last = last; +// ------------------------------------------------------------------------------------- +// utils +// ------------------------------------------------------------------------------------- +/** + * Given a sequence of `as`, concat them and return the total. + * + * If `as` is empty, return the provided `startWith` value. + * + * @example + * import { concatAll } from 'fp-ts/Semigroup' + * import * as N from 'fp-ts/number' + * + * const sum = concatAll(N.SemigroupSum)(0) + * + * assert.deepStrictEqual(sum([1, 2, 3]), 6) + * assert.deepStrictEqual(sum([]), 0) + * + * @since 2.10.0 + */ +exports.concatAll = M.concatAll; +// ------------------------------------------------------------------------------------- +// deprecated +// ------------------------------------------------------------------------------------- +/** + * Use `void` module instead. + * + * @category instances + * @since 2.0.0 + * @deprecated + */ +exports.semigroupVoid = exports.constant(undefined); +/** + * Use [`getAssignSemigroup`](./struct.ts.html#getAssignSemigroup) instead. + * + * @category instances + * @since 2.0.0 + * @deprecated + */ +var getObjectSemigroup = function () { return ({ + concat: function (first, second) { return Object.assign({}, first, second); } +}); }; +exports.getObjectSemigroup = getObjectSemigroup; +/** + * Use [`last`](#last) instead. + * + * @category instances + * @since 2.0.0 + * @deprecated + */ +exports.getLastSemigroup = exports.last; +/** + * Use [`first`](#first) instead. + * + * @category instances + * @since 2.0.0 + * @deprecated + */ +exports.getFirstSemigroup = exports.first; +/** + * Use [`tuple`](#tuple) instead. + * + * @category combinators + * @since 2.0.0 + * @deprecated + */ +exports.getTupleSemigroup = exports.tuple; +/** + * Use [`struct`](#struct) instead. + * + * @category combinators + * @since 2.0.0 + * @deprecated + */ +exports.getStructSemigroup = exports.struct; +/** + * Use [`reverse`](#reverse) instead. + * + * @category combinators + * @since 2.0.0 + * @deprecated + */ +exports.getDualSemigroup = exports.reverse; +/** + * Use [`max`](#max) instead. + * + * @category constructors + * @since 2.0.0 + * @deprecated + */ +exports.getJoinSemigroup = exports.max; +/** + * Use [`min`](#min) instead. + * + * @category constructors + * @since 2.0.0 + * @deprecated + */ +exports.getMeetSemigroup = exports.min; +/** + * Use [`intercalate`](#intercalate) instead. + * + * @category combinators + * @since 2.5.0 + * @deprecated + */ +exports.getIntercalateSemigroup = exports.intercalate; function fold(S) { - return function (startWith, as) { - if (as === undefined) { - var foldS_1 = fold(S); - return function (as) { return foldS_1(startWith, as); }; - } - return as.reduce(S.concat, startWith); - }; + var concatAllS = exports.concatAll(S); + return function (startWith, as) { return (as === undefined ? concatAllS(startWith) : concatAllS(startWith)(as)); }; } exports.fold = fold; /** - * Always return the first argument. - * - * @example - * import * as S from 'fp-ts/Semigroup' - * - * assert.deepStrictEqual(S.getFirstSemigroup().concat(1, 2), 1) + * Use [`SemigroupAll`](./boolean.ts.html#SemigroupAll) instead. * * @category instances * @since 2.0.0 + * @deprecated */ -function getFirstSemigroup() { - return { concat: function_1.identity }; -} -exports.getFirstSemigroup = getFirstSemigroup; +exports.semigroupAll = { + concat: function (x, y) { return x && y; } +}; /** - * Always return the last argument. - * - * @example - * import * as S from 'fp-ts/Semigroup' - * - * assert.deepStrictEqual(S.getLastSemigroup().concat(1, 2), 2) + * Use [`SemigroupAny`](./boolean.ts.html#SemigroupAny) instead. * * @category instances * @since 2.0.0 + * @deprecated */ -function getLastSemigroup() { - return { concat: function (_, y) { return y; } }; -} -exports.getLastSemigroup = getLastSemigroup; +exports.semigroupAny = { + concat: function (x, y) { return x || y; } +}; /** - * Given a tuple of semigroups returns a semigroup for the tuple. - * - * @example - * import * as S from 'fp-ts/Semigroup' - * - * const S1 = S.getTupleSemigroup(S.semigroupString, S.semigroupSum) - * assert.deepStrictEqual(S1.concat(['a', 1], ['b', 2]), ['ab', 3]) - * - * const S2 = S.getTupleSemigroup(S.semigroupString, S.semigroupSum, S.semigroupAll) - * assert.deepStrictEqual(S2.concat(['a', 1, true], ['b', 2, false]), ['ab', 3, false]) + * Use [`getSemigroup`](./function.ts.html#getSemigroup) instead. * * @category instances * @since 2.0.0 + * @deprecated */ -function getTupleSemigroup() { - var semigroups = []; - for (var _i = 0; _i < arguments.length; _i++) { - semigroups[_i] = arguments[_i]; - } - return { - concat: function (x, y) { return semigroups.map(function (s, i) { return s.concat(x[i], y[i]); }); } - }; -} -exports.getTupleSemigroup = getTupleSemigroup; +exports.getFunctionSemigroup = function_1.getSemigroup; /** - * The dual of a `Semigroup`, obtained by swapping the arguments of `concat`. - * - * @example - * import * as S from 'fp-ts/Semigroup' - * - * assert.deepStrictEqual(S.getDualSemigroup(S.semigroupString).concat('a', 'b'), 'ba') + * Use [`Semigroup`](./string.ts.html#Semigroup) instead. * * @category instances * @since 2.0.0 + * @deprecated */ -function getDualSemigroup(S) { - return { - concat: function (x, y) { return S.concat(y, x); } - }; -} -exports.getDualSemigroup = getDualSemigroup; +exports.semigroupString = { + concat: function (x, y) { return x + y; } +}; /** - * Unary functions form a semigroup as long as you can provide a semigroup for the codomain. - * - * @example - * import { Predicate } from 'fp-ts/function' - * import * as S from 'fp-ts/Semigroup' - * - * const f: Predicate = (n) => n <= 2 - * const g: Predicate = (n) => n >= 0 - * - * const S1 = S.getFunctionSemigroup(S.semigroupAll)() - * - * assert.deepStrictEqual(S1.concat(f, g)(1), true) - * assert.deepStrictEqual(S1.concat(f, g)(3), false) - * - * const S2 = S.getFunctionSemigroup(S.semigroupAny)() - * - * assert.deepStrictEqual(S2.concat(f, g)(1), true) - * assert.deepStrictEqual(S2.concat(f, g)(3), true) + * Use [`SemigroupSum`](./number.ts.html#SemigroupSum) instead. * * @category instances * @since 2.0.0 + * @deprecated */ -function getFunctionSemigroup(S) { - return function () { return ({ - concat: function (f, g) { return function (a) { return S.concat(f(a), g(a)); }; } - }); }; -} -exports.getFunctionSemigroup = getFunctionSemigroup; +exports.semigroupSum = { + concat: function (x, y) { return x + y; } +}; /** - * Given a struct of semigroups returns a semigroup for the struct. - * - * @example - * import * as S from 'fp-ts/Semigroup' - * - * interface Point { - * readonly x: number - * readonly y: number - * } - * - * const semigroupPoint = S.getStructSemigroup({ - * x: S.semigroupSum, - * y: S.semigroupSum - * }) - * - * assert.deepStrictEqual(semigroupPoint.concat({ x: 1, y: 2 }, { x: 3, y: 4 }), { x: 4, y: 6 }) + * Use [`SemigroupProduct`](./number.ts.html#SemigroupProduct) instead. * * @category instances * @since 2.0.0 + * @deprecated */ -function getStructSemigroup(semigroups) { - return { - concat: function (x, y) { - var r = {}; - for (var _i = 0, _a = Object.keys(semigroups); _i < _a.length; _i++) { - var key = _a[_i]; - r[key] = semigroups[key].concat(x[key], y[key]); - } - return r; - } - }; -} -exports.getStructSemigroup = getStructSemigroup; +exports.semigroupProduct = { + concat: function (x, y) { return x * y; } +}; + + +/***/ }), + +/***/ 5877: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + /** - * Get a semigroup where `concat` will return the minimum, based on the provided order. - * - * @example - * import * as O from 'fp-ts/Ord' - * import * as S from 'fp-ts/Semigroup' - * - * const S1 = S.getMeetSemigroup(O.ordNumber) + * ```ts + * interface Separated { + * readonly left: E + * readonly right: A + * } + * ``` * - * assert.deepStrictEqual(S1.concat(1, 2), 1) + * Represents a result of separating a whole into two parts. * - * @category instances - * @since 2.0.0 + * @since 2.10.0 */ -function getMeetSemigroup(O) { - return { - concat: Ord_1.min(O) - }; -} -exports.getMeetSemigroup = getMeetSemigroup; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.right = exports.left = exports.flap = exports.Functor = exports.Bifunctor = exports.URI = exports.bimap = exports.mapLeft = exports.map = exports.separated = void 0; +var function_1 = __nccwpck_require__(6985); +var Functor_1 = __nccwpck_require__(5533); +// ------------------------------------------------------------------------------------- +// constructors +// ------------------------------------------------------------------------------------- /** - * Get a semigroup where `concat` will return the maximum, based on the provided order. - * - * @example - * import * as O from 'fp-ts/Ord' - * import * as S from 'fp-ts/Semigroup' + * @category constructors + * @since 2.10.0 + */ +var separated = function (left, right) { return ({ left: left, right: right }); }; +exports.separated = separated; +// ------------------------------------------------------------------------------------- +// non-pipeables +// ------------------------------------------------------------------------------------- +var _map = function (fa, f) { return function_1.pipe(fa, exports.map(f)); }; +var _mapLeft = function (fa, f) { return function_1.pipe(fa, exports.mapLeft(f)); }; +var _bimap = function (fa, g, f) { return function_1.pipe(fa, exports.bimap(g, f)); }; +// ------------------------------------------------------------------------------------- +// type class members +// ------------------------------------------------------------------------------------- +/** + * `map` can be used to turn functions `(a: A) => B` into functions `(fa: F) => F` whose argument and return types + * use the type constructor `F` to represent some computational context. * - * const S1 = S.getJoinSemigroup(O.ordNumber) + * @category Functor + * @since 2.10.0 + */ +var map = function (f) { return function (fa) { + return exports.separated(exports.left(fa), f(exports.right(fa))); +}; }; +exports.map = map; +/** + * Map a function over the first type argument of a bifunctor. * - * assert.deepStrictEqual(S1.concat(1, 2), 2) + * @category Bifunctor + * @since 2.10.0 + */ +var mapLeft = function (f) { return function (fa) { + return exports.separated(f(exports.left(fa)), exports.right(fa)); +}; }; +exports.mapLeft = mapLeft; +/** + * Map a pair of functions over the two type arguments of the bifunctor. * + * @category Bifunctor + * @since 2.10.0 + */ +var bimap = function (f, g) { return function (fa) { + return exports.separated(f(exports.left(fa)), g(exports.right(fa))); +}; }; +exports.bimap = bimap; +// ------------------------------------------------------------------------------------- +// instances +// ------------------------------------------------------------------------------------- +/** * @category instances - * @since 2.0.0 + * @since 2.10.0 */ -function getJoinSemigroup(O) { - return { - concat: Ord_1.max(O) - }; -} -exports.getJoinSemigroup = getJoinSemigroup; +exports.URI = 'Separated'; /** - * Return a semigroup for objects, preserving their type. - * - * @example - * import * as S from 'fp-ts/Semigroup' - * - * interface Person { - * name: string - * age: number - * } - * - * const S1 = S.getObjectSemigroup() - * assert.deepStrictEqual(S1.concat({ name: 'name', age: 23 }, { name: 'name', age: 24 }), { name: 'name', age: 24 }) - * * @category instances - * @since 2.0.0 + * @since 2.10.0 */ -function getObjectSemigroup() { - return { - concat: function (x, y) { return Object.assign({}, x, y); } +exports.Bifunctor = { + URI: exports.URI, + mapLeft: _mapLeft, + bimap: _bimap +}; +/** + * @category instances + * @since 2.10.0 + */ +exports.Functor = { + URI: exports.URI, + map: _map +}; +/** + * Derivable from `Functor`. + * + * @category combinators + * @since 2.10.0 + */ +exports.flap = +/*#__PURE__*/ +Functor_1.flap(exports.Functor); +// ------------------------------------------------------------------------------------- +// utils +// ------------------------------------------------------------------------------------- +/** + * @since 2.10.0 + */ +var left = function (s) { return s.left; }; +exports.left = left; +/** + * @since 2.10.0 + */ +var right = function (s) { return s.right; }; +exports.right = right; + + +/***/ }), + +/***/ 4384: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.filterE = exports.witherDefault = exports.wiltDefault = void 0; +var _ = __importStar(__nccwpck_require__(1840)); +function wiltDefault(T, C) { + return function (F) { + var traverseF = T.traverse(F); + return function (wa, f) { return F.map(traverseF(wa, f), C.separate); }; }; } -exports.getObjectSemigroup = getObjectSemigroup; +exports.wiltDefault = wiltDefault; +function witherDefault(T, C) { + return function (F) { + var traverseF = T.traverse(F); + return function (wa, f) { return F.map(traverseF(wa, f), C.compact); }; + }; +} +exports.witherDefault = witherDefault; +function filterE(W) { + return function (F) { + var witherF = W.wither(F); + return function (predicate) { return function (ga) { return witherF(ga, function (a) { return F.map(predicate(a), function (b) { return (b ? _.some(a) : _.none); }); }); }; }; + }; +} +exports.filterE = filterE; + + +/***/ }), + +/***/ 9734: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.guard = void 0; +function guard(F, P) { + return function (b) { return (b ? P.of(undefined) : F.zero()); }; +} +exports.guard = guard; + + +/***/ }), + +/***/ 6985: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getEndomorphismMonoid = exports.not = exports.SK = exports.hole = exports.pipe = exports.untupled = exports.tupled = exports.absurd = exports.decrement = exports.increment = exports.tuple = exports.flow = exports.flip = exports.constVoid = exports.constUndefined = exports.constNull = exports.constFalse = exports.constTrue = exports.constant = exports.unsafeCoerce = exports.identity = exports.apply = exports.getRing = exports.getSemiring = exports.getMonoid = exports.getSemigroup = exports.getBooleanAlgebra = void 0; +// ------------------------------------------------------------------------------------- +// instances +// ------------------------------------------------------------------------------------- /** - * `boolean` semigroup under conjunction. - * - * @example - * import * as S from 'fp-ts/Semigroup' - * - * assert.deepStrictEqual(S.semigroupAll.concat(true, true), true) - * assert.deepStrictEqual(S.semigroupAll.concat(true, false), false) - * * @category instances - * @since 2.0.0 - */ -exports.semigroupAll = { - concat: function (x, y) { return x && y; } -}; + * @since 2.10.0 + */ +var getBooleanAlgebra = function (B) { return function () { return ({ + meet: function (x, y) { return function (a) { return B.meet(x(a), y(a)); }; }, + join: function (x, y) { return function (a) { return B.join(x(a), y(a)); }; }, + zero: function () { return B.zero; }, + one: function () { return B.one; }, + implies: function (x, y) { return function (a) { return B.implies(x(a), y(a)); }; }, + not: function (x) { return function (a) { return B.not(x(a)); }; } +}); }; }; +exports.getBooleanAlgebra = getBooleanAlgebra; /** - * `boolean` semigroup under disjunction. + * Unary functions form a semigroup as long as you can provide a semigroup for the codomain. * * @example - * import * as S from 'fp-ts/Semigroup' + * import { Predicate, getSemigroup } from 'fp-ts/function' + * import * as B from 'fp-ts/boolean' * - * assert.deepStrictEqual(S.semigroupAny.concat(true, true), true) - * assert.deepStrictEqual(S.semigroupAny.concat(true, false), true) - * assert.deepStrictEqual(S.semigroupAny.concat(false, false), false) + * const f: Predicate = (n) => n <= 2 + * const g: Predicate = (n) => n >= 0 * - * @category instances - * @since 2.0.0 - */ -exports.semigroupAny = { - concat: function (x, y) { return x || y; } -}; -/** - * `number` semigroup under addition. + * const S1 = getSemigroup(B.SemigroupAll)() * - * @example - * import * as S from 'fp-ts/Semigroup' + * assert.deepStrictEqual(S1.concat(f, g)(1), true) + * assert.deepStrictEqual(S1.concat(f, g)(3), false) + * + * const S2 = getSemigroup(B.SemigroupAny)() * - * assert.deepStrictEqual(S.semigroupSum.concat(2, 3), 5) + * assert.deepStrictEqual(S2.concat(f, g)(1), true) + * assert.deepStrictEqual(S2.concat(f, g)(3), true) * * @category instances - * @since 2.0.0 + * @since 2.10.0 */ -exports.semigroupSum = { - concat: function (x, y) { return x + y; } -}; +var getSemigroup = function (S) { return function () { return ({ + concat: function (f, g) { return function (a) { return S.concat(f(a), g(a)); }; } +}); }; }; +exports.getSemigroup = getSemigroup; /** - * `number` semigroup under multiplication. + * Unary functions form a monoid as long as you can provide a monoid for the codomain. * * @example - * import * as S from 'fp-ts/Semigroup' + * import { Predicate } from 'fp-ts/Predicate' + * import { getMonoid } from 'fp-ts/function' + * import * as B from 'fp-ts/boolean' * - * assert.deepStrictEqual(S.semigroupProduct.concat(2, 3), 6) + * const f: Predicate = (n) => n <= 2 + * const g: Predicate = (n) => n >= 0 * - * @category instances - * @since 2.0.0 - */ -exports.semigroupProduct = { - concat: function (x, y) { return x * y; } -}; -/** - * `string` semigroup under concatenation. + * const M1 = getMonoid(B.MonoidAll)() * - * @example - * import * as S from 'fp-ts/Semigroup' + * assert.deepStrictEqual(M1.concat(f, g)(1), true) + * assert.deepStrictEqual(M1.concat(f, g)(3), false) + * + * const M2 = getMonoid(B.MonoidAny)() * - * assert.deepStrictEqual(S.semigroupString.concat('a', 'b'), 'ab') + * assert.deepStrictEqual(M2.concat(f, g)(1), true) + * assert.deepStrictEqual(M2.concat(f, g)(3), true) * * @category instances - * @since 2.0.0 + * @since 2.10.0 */ -exports.semigroupString = { - concat: function (x, y) { return x + y; } +var getMonoid = function (M) { + var getSemigroupM = exports.getSemigroup(M); + return function () { return ({ + concat: getSemigroupM().concat, + empty: function () { return M.empty; } + }); }; }; +exports.getMonoid = getMonoid; /** * @category instances - * @since 2.0.0 + * @since 2.10.0 */ -exports.semigroupVoid = { - concat: function () { return undefined; } -}; +var getSemiring = function (S) { return ({ + add: function (f, g) { return function (x) { return S.add(f(x), g(x)); }; }, + zero: function () { return S.zero; }, + mul: function (f, g) { return function (x) { return S.mul(f(x), g(x)); }; }, + one: function () { return S.one; } +}); }; +exports.getSemiring = getSemiring; /** - * You can glue items between and stay associative. - * - * @example - * import * as S from 'fp-ts/Semigroup' - * - * const S1 = S.getIntercalateSemigroup(' ')(S.semigroupString) - * - * assert.strictEqual(S1.concat('a', 'b'), 'a b') - * assert.strictEqual(S1.concat(S1.concat('a', 'b'), 'c'), S1.concat('a', S1.concat('b', 'c'))) - * * @category instances - * @since 2.5.0 + * @since 2.10.0 */ -function getIntercalateSemigroup(a) { - return function (S) { return ({ - concat: function (x, y) { return S.concat(x, S.concat(a, y)); } - }); }; -} -exports.getIntercalateSemigroup = getIntercalateSemigroup; - - -/***/ }), - -/***/ 6985: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - +var getRing = function (R) { + var S = exports.getSemiring(R); + return { + add: S.add, + mul: S.mul, + one: S.one, + zero: S.zero, + sub: function (f, g) { return function (x) { return R.sub(f(x), g(x)); }; } + }; +}; +exports.getRing = getRing; +// ------------------------------------------------------------------------------------- +// utils +// ------------------------------------------------------------------------------------- /** - * @since 2.0.0 + * @since 2.11.0 */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.bindTo_ = exports.bind_ = exports.hole = exports.pipe = exports.untupled = exports.tupled = exports.absurd = exports.decrement = exports.increment = exports.tuple = exports.flow = exports.flip = exports.constVoid = exports.constUndefined = exports.constNull = exports.constFalse = exports.constTrue = exports.constant = exports.not = exports.unsafeCoerce = exports.identity = void 0; +var apply = function (a) { return function (f) { return f(a); }; }; +exports.apply = apply; /** * @since 2.0.0 */ @@ -14492,13 +18214,6 @@ exports.identity = identity; * @since 2.0.0 */ exports.unsafeCoerce = identity; -/** - * @since 2.0.0 - */ -function not(predicate) { - return function (a) { return !predicate(a); }; -} -exports.not = not; /** * @since 2.0.0 */ @@ -14544,7 +18259,6 @@ constant(undefined); * @since 2.0.0 */ exports.constVoid = exports.constUndefined; -// TODO: remove in v3 /** * Flips the order of the arguments of a function of two arguments. * @@ -14622,109 +18336,319 @@ exports.decrement = decrement; /** * @since 2.0.0 */ -function absurd(_) { - throw new Error('Called `absurd` function which should be uncallable'); -} -exports.absurd = absurd; +function absurd(_) { + throw new Error('Called `absurd` function which should be uncallable'); +} +exports.absurd = absurd; +/** + * Creates a tupled version of this function: instead of `n` arguments, it accepts a single tuple argument. + * + * @example + * import { tupled } from 'fp-ts/function' + * + * const add = tupled((x: number, y: number): number => x + y) + * + * assert.strictEqual(add([1, 2]), 3) + * + * @since 2.4.0 + */ +function tupled(f) { + return function (a) { return f.apply(void 0, a); }; +} +exports.tupled = tupled; +/** + * Inverse function of `tupled` + * + * @since 2.4.0 + */ +function untupled(f) { + return function () { + var a = []; + for (var _i = 0; _i < arguments.length; _i++) { + a[_i] = arguments[_i]; + } + return f(a); + }; +} +exports.untupled = untupled; +function pipe(a, ab, bc, cd, de, ef, fg, gh, hi) { + switch (arguments.length) { + case 1: + return a; + case 2: + return ab(a); + case 3: + return bc(ab(a)); + case 4: + return cd(bc(ab(a))); + case 5: + return de(cd(bc(ab(a)))); + case 6: + return ef(de(cd(bc(ab(a))))); + case 7: + return fg(ef(de(cd(bc(ab(a)))))); + case 8: + return gh(fg(ef(de(cd(bc(ab(a))))))); + case 9: + return hi(gh(fg(ef(de(cd(bc(ab(a)))))))); + default: + var ret = arguments[0]; + for (var i = 1; i < arguments.length; i++) { + ret = arguments[i](ret); + } + return ret; + } +} +exports.pipe = pipe; +/** + * Type hole simulation + * + * @since 2.7.0 + */ +exports.hole = absurd; +/** + * @since 2.11.0 + */ +var SK = function (_, b) { return b; }; +exports.SK = SK; +/** + * Use `Predicate` module instead. + * + * @since 2.0.0 + * @deprecated + */ +function not(predicate) { + return function (a) { return !predicate(a); }; +} +exports.not = not; +/** + * Use `Endomorphism` module instead. + * + * @category instances + * @since 2.10.0 + * @deprecated + */ +var getEndomorphismMonoid = function () { return ({ + concat: function (first, second) { return flow(first, second); }, + empty: identity +}); }; +exports.getEndomorphismMonoid = getEndomorphismMonoid; + + +/***/ }), + +/***/ 1840: +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + +var __spreadArray = (this && this.__spreadArray) || function (to, from) { + for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) + to[j] = from[i]; + return to; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.fromReadonlyNonEmptyArray = exports.has = exports.emptyRecord = exports.emptyReadonlyArray = exports.tail = exports.head = exports.isNonEmpty = exports.singleton = exports.right = exports.left = exports.isRight = exports.isLeft = exports.some = exports.none = exports.isSome = exports.isNone = void 0; +// ------------------------------------------------------------------------------------- +// Option +// ------------------------------------------------------------------------------------- +/** @internal */ +var isNone = function (fa) { return fa._tag === 'None'; }; +exports.isNone = isNone; +/** @internal */ +var isSome = function (fa) { return fa._tag === 'Some'; }; +exports.isSome = isSome; +/** @internal */ +exports.none = { _tag: 'None' }; +/** @internal */ +var some = function (a) { return ({ _tag: 'Some', value: a }); }; +exports.some = some; +// ------------------------------------------------------------------------------------- +// Either +// ------------------------------------------------------------------------------------- +/** @internal */ +var isLeft = function (ma) { return ma._tag === 'Left'; }; +exports.isLeft = isLeft; +/** @internal */ +var isRight = function (ma) { return ma._tag === 'Right'; }; +exports.isRight = isRight; +/** @internal */ +var left = function (e) { return ({ _tag: 'Left', left: e }); }; +exports.left = left; +/** @internal */ +var right = function (a) { return ({ _tag: 'Right', right: a }); }; +exports.right = right; +// ------------------------------------------------------------------------------------- +// ReadonlyNonEmptyArray +// ------------------------------------------------------------------------------------- +/** @internal */ +var singleton = function (a) { return [a]; }; +exports.singleton = singleton; +/** @internal */ +var isNonEmpty = function (as) { return as.length > 0; }; +exports.isNonEmpty = isNonEmpty; +/** @internal */ +var head = function (as) { return as[0]; }; +exports.head = head; +/** @internal */ +var tail = function (as) { return as.slice(1); }; +exports.tail = tail; +// ------------------------------------------------------------------------------------- +// empty +// ------------------------------------------------------------------------------------- +/** @internal */ +exports.emptyReadonlyArray = []; +/** @internal */ +exports.emptyRecord = {}; +// ------------------------------------------------------------------------------------- +// Record +// ------------------------------------------------------------------------------------- +/** @internal */ +exports.has = Object.prototype.hasOwnProperty; +// ------------------------------------------------------------------------------------- +// NonEmptyArray +// ------------------------------------------------------------------------------------- +/** @internal */ +var fromReadonlyNonEmptyArray = function (as) { return __spreadArray([as[0]], as.slice(1)); }; +exports.fromReadonlyNonEmptyArray = fromReadonlyNonEmptyArray; + + +/***/ }), + +/***/ 52: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Field = exports.MonoidProduct = exports.MonoidSum = exports.SemigroupProduct = exports.SemigroupSum = exports.MagmaSub = exports.Show = exports.Bounded = exports.Ord = exports.Eq = exports.isNumber = void 0; +// ------------------------------------------------------------------------------------- +// refinements +// ------------------------------------------------------------------------------------- +/** + * @category refinements + * @since 2.11.0 + */ +var isNumber = function (u) { return typeof u === 'number'; }; +exports.isNumber = isNumber; +// ------------------------------------------------------------------------------------- +// instances +// ------------------------------------------------------------------------------------- +/** + * @category instances + * @since 2.10.0 + */ +exports.Eq = { + equals: function (first, second) { return first === second; } +}; +/** + * @category instances + * @since 2.10.0 + */ +exports.Ord = { + equals: exports.Eq.equals, + compare: function (first, second) { return (first < second ? -1 : first > second ? 1 : 0); } +}; +/** + * @category instances + * @since 2.10.0 + */ +exports.Bounded = { + equals: exports.Eq.equals, + compare: exports.Ord.compare, + top: Infinity, + bottom: -Infinity +}; +/** + * @category instances + * @since 2.10.0 + */ +exports.Show = { + show: function (n) { return JSON.stringify(n); } +}; +/** + * @category instances + * @since 2.11.0 + */ +exports.MagmaSub = { + concat: function (first, second) { return first - second; } +}; /** - * Creates a tupled version of this function: instead of `n` arguments, it accepts a single tuple argument. + * `number` semigroup under addition. * * @example - * import { tupled } from 'fp-ts/function' + * import { SemigroupSum } from 'fp-ts/number' * - * const add = tupled((x: number, y: number): number => x + y) - * - * assert.strictEqual(add([1, 2]), 3) + * assert.deepStrictEqual(SemigroupSum.concat(2, 3), 5) * - * @since 2.4.0 + * @category instances + * @since 2.10.0 */ -function tupled(f) { - return function (a) { return f.apply(void 0, a); }; -} -exports.tupled = tupled; +exports.SemigroupSum = { + concat: function (first, second) { return first + second; } +}; /** - * Inverse function of `tupled` + * `number` semigroup under multiplication. * - * @since 2.4.0 + * @example + * import { SemigroupProduct } from 'fp-ts/number' + * + * assert.deepStrictEqual(SemigroupProduct.concat(2, 3), 6) + * + * @category instances + * @since 2.10.0 */ -function untupled(f) { - return function () { - var a = []; - for (var _i = 0; _i < arguments.length; _i++) { - a[_i] = arguments[_i]; - } - return f(a); - }; -} -exports.untupled = untupled; -function pipe(a, ab, bc, cd, de, ef, fg, gh, hi, ij, jk, kl, lm, mn, no, op, pq, qr, rs, st) { - switch (arguments.length) { - case 1: - return a; - case 2: - return ab(a); - case 3: - return bc(ab(a)); - case 4: - return cd(bc(ab(a))); - case 5: - return de(cd(bc(ab(a)))); - case 6: - return ef(de(cd(bc(ab(a))))); - case 7: - return fg(ef(de(cd(bc(ab(a)))))); - case 8: - return gh(fg(ef(de(cd(bc(ab(a))))))); - case 9: - return hi(gh(fg(ef(de(cd(bc(ab(a)))))))); - case 10: - return ij(hi(gh(fg(ef(de(cd(bc(ab(a))))))))); - case 11: - return jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a)))))))))); - case 12: - return kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a))))))))))); - case 13: - return lm(kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a)))))))))))); - case 14: - return mn(lm(kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a))))))))))))); - case 15: - return no(mn(lm(kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a)))))))))))))); - case 16: - return op(no(mn(lm(kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a))))))))))))))); - case 17: - return pq(op(no(mn(lm(kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a)))))))))))))))); - case 18: - return qr(pq(op(no(mn(lm(kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a))))))))))))))))); - case 19: - return rs(qr(pq(op(no(mn(lm(kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a)))))))))))))))))); - case 20: - return st(rs(qr(pq(op(no(mn(lm(kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a))))))))))))))))))); - } - return; -} -exports.pipe = pipe; +exports.SemigroupProduct = { + concat: function (first, second) { return first * second; } +}; /** - * Type hole simulation + * `number` monoid under addition. * - * @since 2.7.0 + * The `empty` value is `0`. + * + * @example + * import { MonoidSum } from 'fp-ts/number' + * + * assert.deepStrictEqual(MonoidSum.concat(2, MonoidSum.empty), 2) + * + * @category instances + * @since 2.10.0 */ -exports.hole = absurd; +exports.MonoidSum = { + concat: exports.SemigroupSum.concat, + empty: 0 +}; /** - * @internal + * `number` monoid under multiplication. + * + * The `empty` value is `1`. + * + * @example + * import { MonoidProduct } from 'fp-ts/number' + * + * assert.deepStrictEqual(MonoidProduct.concat(2, MonoidProduct.empty), 2) + * + * @category instances + * @since 2.10.0 */ -var bind_ = function (a, name, b) { - var _a; - return Object.assign({}, a, (_a = {}, _a[name] = b, _a)); +exports.MonoidProduct = { + concat: exports.SemigroupProduct.concat, + empty: 1 }; -exports.bind_ = bind_; /** - * @internal + * @category instances + * @since 2.10.0 */ -var bindTo_ = function (name) { return function (b) { - var _a; - return (_a = {}, _a[name] = b, _a); -}; }; -exports.bindTo_ = bindTo_; +exports.Field = { + add: exports.SemigroupSum.concat, + zero: 0, + mul: exports.SemigroupProduct.concat, + one: 1, + sub: exports.MagmaSub.concat, + degree: function (_) { return 1; }, + div: function (first, second) { return first / second; }, + mod: function (first, second) { return first % second; } +}; /***/ }), @@ -14735,15 +18659,8 @@ exports.bindTo_ = bindTo_; "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.pipeable = exports.pipe = void 0; +exports.pipe = exports.pipeable = void 0; var function_1 = __nccwpck_require__(6985); -// TODO: remove module in v3 -/** - * Use [`pipe`](https://gcanti.github.io/fp-ts/modules/function.ts.html#flow) from `function` module instead. - * - * @since 2.0.0 - */ -exports.pipe = function_1.pipe; var isFunctor = function (I) { return typeof I.map === 'function'; }; var isContravariant = function (I) { return typeof I.contramap === 'function'; }; var isFunctorWithIndex = function (I) { return typeof I.mapWithIndex === 'function'; }; @@ -14762,6 +18679,7 @@ var isFilterableWithIndex = function (I) { var isProfunctor = function (I) { return typeof I.promap === 'function'; }; var isSemigroupoid = function (I) { return typeof I.compose === 'function'; }; var isMonadThrow = function (I) { return typeof I.throwError === 'function'; }; +/** @deprecated */ function pipeable(I) { var r = {}; if (isFunctor(I)) { @@ -14894,6 +18812,297 @@ function pipeable(I) { return r; } exports.pipeable = pipeable; +/** + * Use [`pipe`](https://gcanti.github.io/fp-ts/modules/function.ts.html#flow) from `function` module instead. + * + * @since 2.0.0 + * @deprecated + */ +exports.pipe = function_1.pipe; + + +/***/ }), + +/***/ 5189: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.endsWith = exports.startsWith = exports.includes = exports.split = exports.size = exports.isEmpty = exports.empty = exports.slice = exports.trimRight = exports.trimLeft = exports.trim = exports.replace = exports.toLowerCase = exports.toUpperCase = exports.isString = exports.Show = exports.Ord = exports.Monoid = exports.Semigroup = exports.Eq = void 0; +var ReadonlyNonEmptyArray_1 = __nccwpck_require__(8630); +// ------------------------------------------------------------------------------------- +// instances +// ------------------------------------------------------------------------------------- +/** + * @example + * import * as S from 'fp-ts/string' + * + * assert.deepStrictEqual(S.Eq.equals('a', 'a'), true) + * assert.deepStrictEqual(S.Eq.equals('a', 'b'), false) + * + * @category instances + * @since 2.10.0 + */ +exports.Eq = { + equals: function (first, second) { return first === second; } +}; +/** + * `string` semigroup under concatenation. + * + * @example + * import * as S from 'fp-ts/string' + * + * assert.deepStrictEqual(S.Semigroup.concat('a', 'b'), 'ab') + * + * @category instances + * @since 2.10.0 + */ +exports.Semigroup = { + concat: function (first, second) { return first + second; } +}; +/** + * `string` monoid under concatenation. + * + * The `empty` value is `''`. + * + * @example + * import * as S from 'fp-ts/string' + * + * assert.deepStrictEqual(S.Monoid.concat('a', 'b'), 'ab') + * assert.deepStrictEqual(S.Monoid.concat('a', S.Monoid.empty), 'a') + * + * @category instances + * @since 2.10.0 + */ +exports.Monoid = { + concat: exports.Semigroup.concat, + empty: '' +}; +/** + * @example + * import * as S from 'fp-ts/string' + * + * assert.deepStrictEqual(S.Ord.compare('a', 'a'), 0) + * assert.deepStrictEqual(S.Ord.compare('a', 'b'), -1) + * assert.deepStrictEqual(S.Ord.compare('b', 'a'), 1) + * + * @category instances + * @since 2.10.0 + */ +exports.Ord = { + equals: exports.Eq.equals, + compare: function (first, second) { return (first < second ? -1 : first > second ? 1 : 0); } +}; +/** + * @example + * import * as S from 'fp-ts/string' + * + * assert.deepStrictEqual(S.Show.show('a'), '"a"') + * + * @category instances + * @since 2.10.0 + */ +exports.Show = { + show: function (s) { return JSON.stringify(s); } +}; +// ------------------------------------------------------------------------------------- +// refinements +// ------------------------------------------------------------------------------------- +/** + * @example + * import * as S from 'fp-ts/string' + * + * assert.deepStrictEqual(S.isString('a'), true) + * assert.deepStrictEqual(S.isString(1), false) + * + * @category refinements + * @since 2.11.0 + */ +var isString = function (u) { return typeof u === 'string'; }; +exports.isString = isString; +// ------------------------------------------------------------------------------------- +// combinators +// ------------------------------------------------------------------------------------- +/** + * @example + * import * as S from 'fp-ts/string' + * import { pipe } from 'fp-ts/function' + * + * assert.deepStrictEqual(pipe('a', S.toUpperCase), 'A') + * + * @category combinators + * @since 2.11.0 + */ +var toUpperCase = function (s) { return s.toUpperCase(); }; +exports.toUpperCase = toUpperCase; +/** + * @example + * import * as S from 'fp-ts/string' + * import { pipe } from 'fp-ts/function' + * + * assert.deepStrictEqual(pipe('A', S.toLowerCase), 'a') + * + * @category combinators + * @since 2.11.0 + */ +var toLowerCase = function (s) { return s.toLowerCase(); }; +exports.toLowerCase = toLowerCase; +/** + * @example + * import * as S from 'fp-ts/string' + * import { pipe } from 'fp-ts/function' + * + * assert.deepStrictEqual(pipe('abc', S.replace('b', 'd')), 'adc') + * + * @category combinators + * @since 2.11.0 + */ +var replace = function (searchValue, replaceValue) { return function (s) { + return s.replace(searchValue, replaceValue); +}; }; +exports.replace = replace; +/** + * @example + * import * as S from 'fp-ts/string' + * import { pipe } from 'fp-ts/function' + * + * assert.deepStrictEqual(pipe(' a ', S.trim), 'a') + * + * @category combinators + * @since 2.11.0 + */ +var trim = function (s) { return s.trim(); }; +exports.trim = trim; +/** + * @example + * import * as S from 'fp-ts/string' + * import { pipe } from 'fp-ts/function' + * + * assert.deepStrictEqual(pipe(' a ', S.trimLeft), 'a ') + * + * @category combinators + * @since 2.11.0 + */ +var trimLeft = function (s) { return s.trimLeft(); }; +exports.trimLeft = trimLeft; +/** + * @example + * import * as S from 'fp-ts/string' + * import { pipe } from 'fp-ts/function' + * + * assert.deepStrictEqual(pipe(' a ', S.trimRight), ' a') + * + * @category combinators + * @since 2.11.0 + */ +var trimRight = function (s) { return s.trimRight(); }; +exports.trimRight = trimRight; +/** + * @example + * import * as S from 'fp-ts/string' + * import { pipe } from 'fp-ts/function' + * + * assert.deepStrictEqual(pipe('abcd', S.slice(1, 3)), 'bc') + * + * @category combinators + * @since 2.11.0 + */ +var slice = function (start, end) { return function (s) { return s.slice(start, end); }; }; +exports.slice = slice; +// ------------------------------------------------------------------------------------- +// utils +// ------------------------------------------------------------------------------------- +/** + * An empty `string`. + * + * @since 2.10.0 + */ +exports.empty = ''; +/** + * Test whether a `string` is empty. + * + * @example + * import * as S from 'fp-ts/string' + * import { pipe } from 'fp-ts/function' + * + * assert.deepStrictEqual(pipe('', S.isEmpty), true) + * assert.deepStrictEqual(pipe('a', S.isEmpty), false) + * + * @since 2.10.0 + */ +var isEmpty = function (s) { return s.length === 0; }; +exports.isEmpty = isEmpty; +/** + * Calculate the number of characters in a `string`. + * + * @example + * import * as S from 'fp-ts/string' + * import { pipe } from 'fp-ts/function' + * + * assert.deepStrictEqual(pipe('abc', S.size), 3) + * + * @since 2.10.0 + */ +var size = function (s) { return s.length; }; +exports.size = size; +/** + * @example + * import * as S from 'fp-ts/string' + * import { pipe } from 'fp-ts/function' + * + * assert.deepStrictEqual(pipe('abc', S.split('')), ['a', 'b', 'c']) + * assert.deepStrictEqual(pipe('', S.split('')), ['']) + * + * @since 2.11.0 + */ +var split = function (separator) { return function (s) { + var out = s.split(separator); + return ReadonlyNonEmptyArray_1.isNonEmpty(out) ? out : [s]; +}; }; +exports.split = split; +/** + * @example + * import * as S from 'fp-ts/string' + * import { pipe } from 'fp-ts/function' + * + * assert.deepStrictEqual(pipe('abc', S.includes('b')), true) + * assert.deepStrictEqual(pipe('abc', S.includes('d')), false) + * + * @since 2.11.0 + */ +var includes = function (searchString, position) { return function (s) { + return s.includes(searchString, position); +}; }; +exports.includes = includes; +/** + * @example + * import * as S from 'fp-ts/string' + * import { pipe } from 'fp-ts/function' + * + * assert.deepStrictEqual(pipe('abc', S.startsWith('a')), true) + * assert.deepStrictEqual(pipe('bc', S.startsWith('a')), false) + * + * @since 2.11.0 + */ +var startsWith = function (searchString, position) { return function (s) { + return s.startsWith(searchString, position); +}; }; +exports.startsWith = startsWith; +/** + * @example + * import * as S from 'fp-ts/string' + * import { pipe } from 'fp-ts/function' + * + * assert.deepStrictEqual(pipe('abc', S.endsWith('c')), true) + * assert.deepStrictEqual(pipe('ab', S.endsWith('c')), false) + * + * @since 2.11.0 + */ +var endsWith = function (searchString, position) { return function (s) { + return s.endsWith(searchString, position); +}; }; +exports.endsWith = endsWith; /***/ }), diff --git a/dist/index.js.map b/dist/index.js.map index 048504c..7bc5ab0 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../webpack://oss-governance-bot/./lib/command.js","../webpack://oss-governance-bot/./lib/config.js","../webpack://oss-governance-bot/./lib/github.js","../webpack://oss-governance-bot/./lib/main.js","../webpack://oss-governance-bot/./lib/operators/capture.js","../webpack://oss-governance-bot/./lib/operators/chat-ops/assign.js","../webpack://oss-governance-bot/./lib/operators/chat-ops/close.js","../webpack://oss-governance-bot/./lib/operators/chat-ops/comment.js","../webpack://oss-governance-bot/./lib/operators/chat-ops/label.js","../webpack://oss-governance-bot/./lib/operators/chat-ops/review.js","../webpack://oss-governance-bot/./lib/operators/index.js","../webpack://oss-governance-bot/./lib/operators/label.js","../webpack://oss-governance-bot/./lib/rules/author-association.js","../webpack://oss-governance-bot/./lib/rules/ignore.js","../webpack://oss-governance-bot/./node_modules/@actions/core/lib/command.js","../webpack://oss-governance-bot/./node_modules/@actions/core/lib/core.js","../webpack://oss-governance-bot/./node_modules/@actions/core/lib/file-command.js","../webpack://oss-governance-bot/./node_modules/@actions/core/lib/utils.js","../webpack://oss-governance-bot/./node_modules/@actions/github/lib/context.js","../webpack://oss-governance-bot/./node_modules/@actions/github/lib/github.js","../webpack://oss-governance-bot/./node_modules/@actions/github/lib/internal/utils.js","../webpack://oss-governance-bot/./node_modules/@actions/github/lib/utils.js","../webpack://oss-governance-bot/./node_modules/@actions/http-client/index.js","../webpack://oss-governance-bot/./node_modules/@actions/http-client/proxy.js","../webpack://oss-governance-bot/./node_modules/@octokit/auth-token/dist-node/index.js","../webpack://oss-governance-bot/./node_modules/@octokit/core/dist-node/index.js","../webpack://oss-governance-bot/./node_modules/@octokit/endpoint/dist-node/index.js","../webpack://oss-governance-bot/./node_modules/@octokit/graphql/dist-node/index.js","../webpack://oss-governance-bot/./node_modules/@octokit/plugin-paginate-rest/dist-node/index.js","../webpack://oss-governance-bot/./node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js","../webpack://oss-governance-bot/./node_modules/@octokit/request-error/dist-node/index.js","../webpack://oss-governance-bot/./node_modules/@octokit/request/dist-node/index.js","../webpack://oss-governance-bot/./node_modules/before-after-hook/index.js","../webpack://oss-governance-bot/./node_modules/before-after-hook/lib/add.js","../webpack://oss-governance-bot/./node_modules/before-after-hook/lib/register.js","../webpack://oss-governance-bot/./node_modules/before-after-hook/lib/remove.js","../webpack://oss-governance-bot/./node_modules/deprecation/dist-node/index.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/Array.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/ChainRec.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/Either.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/Eq.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/NonEmptyArray.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/Option.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/Ord.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/Ordering.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/ReadonlyArray.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/ReadonlyNonEmptyArray.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/ReadonlyRecord.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/Record.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/Semigroup.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/function.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/pipeable.js","../webpack://oss-governance-bot/./node_modules/io-ts-reporters/target/src/index.js","../webpack://oss-governance-bot/./node_modules/io-ts-reporters/target/src/utils.js","../webpack://oss-governance-bot/./node_modules/io-ts/lib/index.js","../webpack://oss-governance-bot/./node_modules/is-plain-object/dist/is-plain-object.js","../webpack://oss-governance-bot/./node_modules/js-yaml/index.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/common.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/dumper.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/exception.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/loader.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/schema.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/schema/core.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/schema/default.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/schema/failsafe.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/schema/json.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/snippet.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/type.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/type/binary.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/type/bool.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/type/float.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/type/int.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/type/map.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/type/merge.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/type/null.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/type/omap.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/type/pairs.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/type/seq.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/type/set.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/type/str.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/type/timestamp.js","../webpack://oss-governance-bot/./node_modules/node-fetch/lib/index.js","../webpack://oss-governance-bot/./node_modules/once/once.js","../webpack://oss-governance-bot/./node_modules/tunnel/index.js","../webpack://oss-governance-bot/./node_modules/tunnel/lib/tunnel.js","../webpack://oss-governance-bot/./node_modules/universal-user-agent/dist-node/index.js","../webpack://oss-governance-bot/./node_modules/wrappy/wrappy.js","../webpack://oss-governance-bot/./node_modules/@vercel/ncc/dist/ncc/@@notfound.js","../webpack://oss-governance-bot/external \"assert\"","../webpack://oss-governance-bot/external \"events\"","../webpack://oss-governance-bot/external \"fs\"","../webpack://oss-governance-bot/external \"http\"","../webpack://oss-governance-bot/external \"https\"","../webpack://oss-governance-bot/external \"net\"","../webpack://oss-governance-bot/external \"os\"","../webpack://oss-governance-bot/external \"path\"","../webpack://oss-governance-bot/external \"stream\"","../webpack://oss-governance-bot/external \"tls\"","../webpack://oss-governance-bot/external \"url\"","../webpack://oss-governance-bot/external \"util\"","../webpack://oss-governance-bot/external \"zlib\"","../webpack://oss-governance-bot/webpack/bootstrap","../webpack://oss-governance-bot/webpack/runtime/compat","../webpack://oss-governance-bot/webpack/startup"],"sourcesContent":["\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (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};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getCommands = exports.getBody = exports.Commands = exports.ArgsCommand = exports.Command = void 0;\nconst github = __importStar(require(\"@actions/github\"));\nclass Command {\n constructor(text) {\n this.args = [];\n this.text = text;\n }\n}\nexports.Command = Command;\nclass ArgsCommand extends Command {\n constructor(text, prefix) {\n super(text);\n this.args = [];\n const postfix = this.text.split(prefix)[1];\n if (postfix) {\n this.args = postfix.trim().split(' ');\n }\n }\n}\nexports.ArgsCommand = ArgsCommand;\nclass Commands {\n constructor(commands) {\n this.commands = commands;\n }\n prefix(start) {\n return this.commands\n .filter(command => {\n return command.text.startsWith(start);\n })\n .map(value => {\n return new ArgsCommand(value.text, start + ' ');\n });\n }\n}\nexports.Commands = Commands;\nfunction getBody() {\n const payload = github.context.payload;\n const content = payload.comment || payload.pull_request || payload.issue;\n let body = (content === null || content === void 0 ? void 0 : content.body) || '';\n // Replace comments so that it's not processed\n body = body.replace('\\r', '\\n');\n body = body.replace('\\r\\n', '\\n');\n body = body.replace(//g, '');\n return body;\n}\nexports.getBody = getBody;\nfunction getCommands() {\n return getBody()\n .split('\\n')\n .map(text => { var _a; return (_a = /^\\/(.+)/.exec(text)) === null || _a === void 0 ? void 0 : _a[0]; })\n .filter((cmd) => !!cmd)\n .map(value => new Command(value));\n}\nexports.getCommands = getCommands;\nfunction default_1() {\n return __awaiter(this, void 0, void 0, function* () {\n const commands = getCommands();\n return new Commands(commands);\n });\n}\nexports.default = default_1;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (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};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getConfig = void 0;\nconst js_yaml_1 = require(\"js-yaml\");\nconst t = __importStar(require(\"io-ts\"));\nconst io_ts_reporters_1 = __importDefault(require(\"io-ts-reporters\"));\nconst Either_1 = require(\"fp-ts/Either\");\nconst github = __importStar(require(\"@actions/github\"));\nconst AuthorAssociation = t.partial({\n // Author of issue or pull_request\n author: t.boolean,\n // Author has been invited to collaborate on the repository.\n collaborator: t.boolean,\n // Author has previously committed to the repository.\n contributor: t.boolean,\n // Author has not previously committed to GitHub.\n first_timer: t.boolean,\n // Author has not previously committed to the repository.\n first_time_contributor: t.boolean,\n // Author is a placeholder for an unclaimed user.\n mannequin: t.boolean,\n // Author is a member of the organization that owns the repository.\n member: t.boolean,\n // Author has no association with the repository.\n none: t.boolean,\n // Author is the owner of the repository.\n owner: t.boolean\n});\nconst Label = t.intersection([\n t.type({\n prefix: t.string,\n list: t.array(t.string)\n }),\n t.partial({\n multiple: t.boolean,\n author_association: AuthorAssociation,\n needs: t.union([\n t.boolean,\n t.partial({\n comment: t.string,\n status: t.intersection([\n t.type({\n context: t.string\n }),\n t.partial({\n url: t.string,\n description: t.union([\n t.string,\n t.partial({\n success: t.string,\n failure: t.string\n })\n ])\n })\n ])\n })\n ])\n })\n]);\nconst Capture = t.intersection([\n t.type({\n regex: t.string,\n label: t.string\n }),\n t.partial({\n author_association: AuthorAssociation,\n ignore_case: t.boolean,\n github_release: t.boolean\n })\n]);\nconst CommentChatOps = t.intersection([\n t.type({\n cmd: t.string,\n type: t.literal('comment'),\n comment: t.string\n }),\n t.partial({\n author_association: AuthorAssociation\n })\n]);\nconst LabelChatOps = t.intersection([\n t.type({\n cmd: t.string,\n type: t.literal('label'),\n label: t.partial({\n add: t.union([t.string, t.array(t.string)]),\n remove: t.union([t.string, t.array(t.string)])\n })\n }),\n t.partial({\n author_association: AuthorAssociation\n })\n]);\nconst GenericChatOps = t.intersection([\n t.type({\n cmd: t.string,\n type: t.keyof({\n close: null,\n none: null,\n assign: null,\n review: null\n })\n }),\n t.partial({\n author_association: AuthorAssociation\n })\n]);\nconst ChatOps = t.union([GenericChatOps, LabelChatOps, CommentChatOps]);\nconst Governance = t.partial({\n labels: t.array(Label),\n captures: t.array(Capture),\n chat_ops: t.array(ChatOps)\n});\nconst Config = t.intersection([\n t.type({\n version: t.literal('v1')\n }),\n t.partial({\n issue: Governance,\n pull_request: Governance\n })\n]);\nfunction parse(content) {\n const config = js_yaml_1.load(content);\n const decoded = Config.decode(config);\n if (Either_1.isRight(decoded)) {\n return decoded.right;\n }\n else {\n throw new Error(`Config parse error:\\\\n${io_ts_reporters_1.default.report(decoded).join('\\\\n')}`);\n }\n}\n/**\n * @param client used to get governance config from\n * @param configPath location of the config file\n */\nfunction getConfig(client, configPath) {\n return __awaiter(this, void 0, void 0, function* () {\n const response = yield client.repos.getContent({\n owner: github.context.repo.owner,\n repo: github.context.repo.repo,\n ref: github.context.sha,\n path: configPath\n });\n const content = Buffer.from(response.data.content, response.data.encoding).toString();\n return parse(content);\n });\n}\nexports.getConfig = getConfig;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (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};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.hasReleaseByTag = exports.commitStatus = exports.requestReviewers = exports.assign = exports.patchIssue = exports.postComment = exports.removeLabels = exports.addLabels = exports.getLabels = exports.getBotUserId = exports.initClient = void 0;\nconst github = __importStar(require(\"@actions/github\"));\nconst core = __importStar(require(\"@actions/core\"));\nfunction initClient(token = core.getInput('github-token')) {\n return github.getOctokit(token);\n}\nexports.initClient = initClient;\nfunction getBotUserId() {\n return __awaiter(this, void 0, void 0, function* () {\n core.info('github-client: getBotUserId');\n const client = initClient();\n const user = yield client.users.getAuthenticated();\n return user.data.id;\n });\n}\nexports.getBotUserId = getBotUserId;\nfunction getNumber() {\n var _a, _b;\n return (((_a = github.context.payload.pull_request) === null || _a === void 0 ? void 0 : _a.number) || ((_b = github.context.payload.issue) === null || _b === void 0 ? void 0 : _b.number));\n}\nfunction getLabels() {\n var _a;\n const contents = github.context.payload.pull_request || github.context.payload.issue;\n return ((_a = contents === null || contents === void 0 ? void 0 : contents.labels) === null || _a === void 0 ? void 0 : _a.map(({ name }) => name)) || [];\n}\nexports.getLabels = getLabels;\nfunction addLabels(labels) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!labels.length)\n return;\n core.info('github-client: addLabels');\n const client = initClient();\n yield client.issues.addLabels({\n owner: github.context.repo.owner,\n repo: github.context.repo.repo,\n issue_number: getNumber(),\n labels: labels\n });\n });\n}\nexports.addLabels = addLabels;\nfunction removeLabels(labels) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!labels.length)\n return;\n core.info('github-client: removeLabels');\n const client = initClient();\n yield Promise.all(labels.map(name => client.issues.removeLabel({\n owner: github.context.repo.owner,\n repo: github.context.repo.repo,\n issue_number: getNumber(),\n name: name\n })));\n });\n}\nexports.removeLabels = removeLabels;\n/**\n * Comment details.\n */\nfunction getDetails() {\n const repository = github.context.payload.repository;\n const configPath = core.getInput('config-path', { required: true });\n const repoUrl = repository === null || repository === void 0 ? void 0 : repository.html_url;\n const owner = repository === null || repository === void 0 ? void 0 : repository.owner;\n const branch = repository === null || repository === void 0 ? void 0 : repository.default_branch;\n let details = '';\n details += '\\n';\n details += '
Details';\n details += '\\n\\n';\n if ((owner === null || owner === void 0 ? void 0 : owner.type) === 'Organization') {\n details += `I am a bot created to help the [${owner === null || owner === void 0 ? void 0 : owner.login}](${owner === null || owner === void 0 ? void 0 : owner.html_url}) developers manage community feedback and contributions.`;\n }\n else {\n details += `I am a bot created to help [${owner === null || owner === void 0 ? void 0 : owner.login}](${owner === null || owner === void 0 ? void 0 : owner.html_url}) manage community feedback and contributions.`;\n }\n details += ' ';\n details += `You can check out my [manifest file](${repoUrl}/blob/${branch}/${configPath}) to understand my behavior and what I can do.`;\n details += ' ';\n details +=\n 'If you want to use this for your project, you can check out the [DeFiCh/oss-governance-bot](https://github.com/DeFiCh/oss-governance-bot) repository.';\n details += '\\n\\n';\n details += '
';\n return details;\n}\nfunction getIssueUserLogin() {\n var _a, _b;\n if (github.context.payload.issue) {\n return (_a = github.context.payload.issue.user) === null || _a === void 0 ? void 0 : _a.login;\n }\n if (github.context.payload.pull_request) {\n return (_b = github.context.payload.pull_request.user) === null || _b === void 0 ? void 0 : _b.login;\n }\n}\n/**\n * Comment to post with added details.\n *\n * @param body comment\n */\nfunction postComment(body) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n core.info('github-client: postComment');\n const client = initClient();\n body = body.replace('$AUTHOR', (_a = github.context.payload.sender) === null || _a === void 0 ? void 0 : _a.login);\n body = body.replace('$ISSUE_AUTHOR', getIssueUserLogin());\n body += getDetails();\n yield client.issues.createComment({\n owner: github.context.repo.owner,\n repo: github.context.repo.repo,\n issue_number: getNumber(),\n body: body\n });\n });\n}\nexports.postComment = postComment;\nfunction patchIssue(changes) {\n return __awaiter(this, void 0, void 0, function* () {\n core.info('github-client: patchIssue');\n const client = initClient();\n yield client.issues.update(Object.assign({ owner: github.context.repo.owner, repo: github.context.repo.repo, issue_number: getNumber() }, changes));\n });\n}\nexports.patchIssue = patchIssue;\nfunction assign(assignees) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!assignees.length)\n return;\n core.info('github-client: assign');\n const client = initClient();\n yield client.issues.addAssignees({\n owner: github.context.repo.owner,\n repo: github.context.repo.repo,\n issue_number: getNumber(),\n assignees: assignees\n });\n });\n}\nexports.assign = assign;\nfunction requestReviewers(reviewers) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!reviewers.length)\n return;\n core.info('github-client: requestReviewers');\n const client = initClient();\n yield client.pulls.requestReviewers({\n owner: github.context.repo.owner,\n repo: github.context.repo.repo,\n pull_number: getNumber(),\n reviewers: reviewers\n });\n });\n}\nexports.requestReviewers = requestReviewers;\nfunction commitStatus(context, state, description, url) {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n core.info('github-client: commitStatus');\n const client = initClient();\n function sendStatus(sha) {\n return __awaiter(this, void 0, void 0, function* () {\n yield client.repos.createCommitStatus({\n owner: github.context.repo.owner,\n repo: github.context.repo.repo,\n sha: sha,\n context: context,\n state: state,\n description: description,\n target_url: url\n });\n });\n }\n if (github.context.payload.pull_request) {\n yield sendStatus((_a = github.context.payload.pull_request) === null || _a === void 0 ? void 0 : _a.head.sha);\n return;\n }\n if (github.context.payload.comment && ((_b = github.context.payload.issue) === null || _b === void 0 ? void 0 : _b.pull_request)) {\n const response = yield client.pulls.get({\n owner: github.context.repo.owner,\n repo: github.context.repo.repo,\n pull_number: getNumber()\n });\n yield sendStatus(response.data.head.sha);\n }\n });\n}\nexports.commitStatus = commitStatus;\nfunction hasReleaseByTag(tag) {\n return __awaiter(this, void 0, void 0, function* () {\n core.info('github-client: getReleaseByTag');\n const client = initClient();\n const release = client.repos.getReleaseByTag({\n owner: github.context.repo.owner,\n repo: github.context.repo.repo,\n tag: tag\n });\n return release.then(() => true).catch(() => false);\n });\n}\nexports.hasReleaseByTag = hasReleaseByTag;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (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};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.runGovernance = exports.getGovernance = void 0;\nconst core = __importStar(require(\"@actions/core\"));\nconst github = __importStar(require(\"@actions/github\"));\nconst config_1 = require(\"./config\");\nconst ignore_1 = __importDefault(require(\"./rules/ignore\"));\nconst command_1 = __importDefault(require(\"./command\"));\nconst operators_1 = __importDefault(require(\"./operators\"));\nconst github_1 = require(\"./github\");\n/**\n * @return the current governance config based on the context, it could be 'pull_request' or 'issue'.\n */\nfunction getGovernance() {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const configPath = core.getInput('config-path', { required: true });\n const config = yield config_1.getConfig(github_1.initClient(), configPath);\n if (github.context.payload.comment) {\n if ((_a = github.context.payload.issue) === null || _a === void 0 ? void 0 : _a.pull_request) {\n return config.pull_request;\n }\n if (github.context.payload.issue) {\n return config.issue;\n }\n }\n if (github.context.payload.issue) {\n return config.issue;\n }\n if (github.context.payload.pull_request) {\n return config.pull_request;\n }\n throw new Error('Could not get pull_request or issue from context');\n });\n}\nexports.getGovernance = getGovernance;\n/**\n * Get governance config, parse and run commands from context.\n */\nfunction runGovernance() {\n return __awaiter(this, void 0, void 0, function* () {\n const governance = yield getGovernance();\n core.info('main: fetched governance.yml');\n if (!governance) {\n return;\n }\n core.info('main: parsing commands');\n const commands = yield command_1.default();\n core.info('main: running operations');\n yield operators_1.default(governance, commands);\n core.info('main: completed operations');\n });\n}\nexports.runGovernance = runGovernance;\n/* eslint github/no-then: off */\nignore_1.default()\n .then((toIgnore) => __awaiter(void 0, void 0, void 0, function* () {\n if (toIgnore)\n return;\n yield runGovernance();\n}))\n .catch(error => {\n core.error(error);\n core.setFailed(error);\n});\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (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};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst command_1 = require(\"../command\");\nconst github_1 = require(\"../github\");\nfunction parseLabel(capture, array) {\n return __awaiter(this, void 0, void 0, function* () {\n let capturedText = (array[1] || '').trim();\n if (capture.github_release) {\n // Automatically parse semantic release\n capturedText = capturedText.replace(/^v/, '');\n if (!(yield github_1.hasReleaseByTag(`v${capturedText}`)) &&\n !(yield github_1.hasReleaseByTag(capturedText))) {\n return;\n }\n }\n return capture.label.replace('$CAPTURED', capturedText);\n });\n}\nfunction default_1(capture) {\n return __awaiter(this, void 0, void 0, function* () {\n const regex = new RegExp(capture.regex, `${capture.ignore_case ? 'i' : ''}`);\n for (const line of command_1.getBody().split('\\n')) {\n const array = regex.exec(line);\n if (!array) {\n continue;\n }\n const label = yield parseLabel(capture, array);\n if (label) {\n yield github_1.addLabels([label]);\n }\n }\n });\n}\nexports.default = default_1;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (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};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst github_1 = require(\"../../github\");\nfunction default_1(chatOps, commands) {\n return __awaiter(this, void 0, void 0, function* () {\n const matched = commands.prefix(chatOps.cmd);\n if (!matched.length) {\n return;\n }\n const assignees = matched\n .flatMap(value => value.args)\n .map(value => {\n value = value.trim();\n if (value.startsWith('@')) {\n return value.replace(/^@/, '');\n }\n })\n .filter(value => value);\n yield github_1.assign(assignees);\n });\n}\nexports.default = default_1;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (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};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst github_1 = require(\"../../github\");\nfunction default_1(chatOps, commands) {\n return __awaiter(this, void 0, void 0, function* () {\n const matched = commands.prefix(chatOps.cmd);\n if (!matched.length) {\n return;\n }\n yield github_1.patchIssue({\n state: 'closed'\n });\n });\n}\nexports.default = default_1;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (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};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst github_1 = require(\"../../github\");\nfunction default_1(chatOps, commands) {\n return __awaiter(this, void 0, void 0, function* () {\n const matched = commands.prefix(chatOps.cmd);\n if (!matched.length) {\n return;\n }\n yield github_1.postComment(chatOps.comment);\n });\n}\nexports.default = default_1;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (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};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst github_1 = require(\"../../github\");\nfunction default_1(chatOps, commands) {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n const matched = commands.prefix(chatOps.cmd);\n if (!matched.length) {\n return;\n }\n const add = (_a = chatOps.label) === null || _a === void 0 ? void 0 : _a.add;\n if (typeof add === 'string' && add) {\n yield github_1.addLabels([add]);\n }\n else if (Array.isArray(add)) {\n yield github_1.addLabels(add);\n }\n const remove = (_b = chatOps.label) === null || _b === void 0 ? void 0 : _b.remove;\n if (typeof remove === 'string' && remove) {\n yield github_1.removeLabels([remove]);\n }\n else if (Array.isArray(remove)) {\n yield github_1.removeLabels(remove);\n }\n });\n}\nexports.default = default_1;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (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};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst github_1 = require(\"../../github\");\nfunction default_1(chatOps, commands) {\n return __awaiter(this, void 0, void 0, function* () {\n const matched = commands.prefix(chatOps.cmd);\n if (!matched.length) {\n return;\n }\n const reviewers = matched\n .flatMap(value => value.args)\n .map(value => {\n value = value.trim();\n if (value.startsWith('@')) {\n return value.replace(/^@/, '');\n }\n })\n .filter(value => value);\n yield github_1.requestReviewers(reviewers);\n });\n}\nexports.default = default_1;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (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};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst author_association_1 = require(\"../rules/author-association\");\nconst label_1 = __importDefault(require(\"./label\"));\nconst capture_1 = __importDefault(require(\"./capture\"));\nconst close_1 = __importDefault(require(\"./chat-ops/close\"));\nconst comment_1 = __importDefault(require(\"./chat-ops/comment\"));\nconst assign_1 = __importDefault(require(\"./chat-ops/assign\"));\nconst review_1 = __importDefault(require(\"./chat-ops/review\"));\nconst label_2 = __importDefault(require(\"./chat-ops/label\"));\nconst ignore_1 = require(\"../rules/ignore\");\nconst core = __importStar(require(\"@actions/core\"));\nfunction processLabels(labels, commands) {\n return __awaiter(this, void 0, void 0, function* () {\n for (const labelOp of labels) {\n yield label_1.default(labelOp, commands);\n }\n });\n}\nfunction processCaptures(captures) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!ignore_1.isCreatedOpened()) {\n return;\n }\n for (const captureOp of captures) {\n if (author_association_1.isAuthorAssociationAllowed(captureOp.author_association)) {\n yield capture_1.default(captureOp);\n }\n }\n });\n}\nfunction processChatOps(chatOps, commands) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!ignore_1.isCreatedOpened()) {\n return;\n }\n for (const chatOp of chatOps) {\n if (!author_association_1.isAuthorAssociationAllowed(chatOp.author_association)) {\n continue;\n }\n switch (chatOp.type) {\n case 'close':\n yield close_1.default(chatOp, commands);\n break;\n case 'assign':\n yield assign_1.default(chatOp, commands);\n break;\n case 'review':\n yield review_1.default(chatOp, commands);\n break;\n case 'comment':\n yield comment_1.default(chatOp, commands);\n break;\n case 'label':\n yield label_2.default(chatOp, commands);\n break;\n }\n }\n });\n}\nfunction default_1(governance, commands) {\n var _a, _b, _c;\n return __awaiter(this, void 0, void 0, function* () {\n if ((_a = governance.captures) === null || _a === void 0 ? void 0 : _a.length) {\n core.info('operations: processing captures');\n yield processCaptures(governance.captures);\n }\n if ((_b = governance.chat_ops) === null || _b === void 0 ? void 0 : _b.length) {\n core.info('operations: processing chatops');\n yield processChatOps(governance.chat_ops, commands);\n }\n if ((_c = governance.labels) === null || _c === void 0 ? void 0 : _c.length) {\n core.info('operations: processing labels');\n yield processLabels(governance.labels, commands);\n }\n });\n}\nexports.default = default_1;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (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};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst github_1 = require(\"../github\");\nconst github = __importStar(require(\"@actions/github\"));\nconst ignore_1 = require(\"../rules/ignore\");\nconst author_association_1 = require(\"../rules/author-association\");\nclass PrefixLabelSet {\n constructor(prefix) {\n this.needs = false;\n this.labels = new Set();\n this.existing = [];\n this.prefix = prefix;\n for (const label of github_1.getLabels()) {\n if (label === `needs/${prefix}`) {\n this.existing.push(label);\n this.needs = true;\n }\n else if (label.startsWith(`${prefix}/`)) {\n this.existing.push(label);\n this.add(label);\n }\n }\n }\n remove(label) {\n this.labels.delete(label);\n }\n add(label) {\n this.labels.add(label);\n this.last = label;\n }\n setMultiple(bool) {\n if (bool) {\n return;\n }\n this.labels.clear();\n if (this.last) {\n this.labels.add(this.last);\n }\n }\n setNeeds(bool) {\n this.needs = bool && this.labels.size === 0;\n }\n persist() {\n return __awaiter(this, void 0, void 0, function* () {\n const removes = [];\n const adds = [];\n for (const string of this.existing) {\n if (!this.labels.has(string)) {\n removes.push(string);\n }\n }\n for (const label of this.labels) {\n if (!this.existing.includes(label)) {\n adds.push(label);\n }\n }\n if (this.needs) {\n if (this.existing.includes(`needs/${this.prefix}`)) {\n // don't remove\n const index = removes.indexOf(`needs/${this.prefix}`);\n if (index > -1) {\n removes.splice(index, 1);\n }\n }\n else {\n // add missing\n adds.push(`needs/${this.prefix}`);\n }\n }\n yield github_1.removeLabels(removes);\n yield github_1.addLabels(adds);\n });\n }\n}\nfunction default_1(label, commands) {\n return __awaiter(this, void 0, void 0, function* () {\n const labelSet = new PrefixLabelSet(label.prefix);\n /**\n * Check if labeled is required\n */\n function needs() {\n const needCommands = [\n ...commands.prefix(`/needs ${label.prefix}`),\n ...commands.prefix(`/need ${label.prefix}`)\n ];\n if (needCommands.length) {\n return true;\n }\n if (labelSet.needs) {\n return true;\n }\n return !!label.needs;\n }\n /**\n * Compute labels to add and remove\n * @return whether any prefixed label is present\n */\n function computeLabels() {\n const removing = commands\n .prefix(`/${label.prefix}-remove`)\n .flatMap(add => add.args.map(value => `${label.prefix}/${value}`));\n for (const value of removing) {\n labelSet.remove(value);\n }\n const adding = commands\n .prefix(`/${label.prefix}`)\n .flatMap(add => add.args\n .filter(value => label.list.includes(value))\n .map(value => `${label.prefix}/${value}`));\n for (const value of adding) {\n labelSet.add(value);\n }\n }\n if (ignore_1.isCreatedOpened() &&\n author_association_1.isAuthorAssociationAllowed(label.author_association)) {\n computeLabels();\n }\n labelSet.setMultiple(label.multiple === undefined || label.multiple);\n labelSet.setNeeds(needs());\n yield labelSet.persist();\n if (labelSet.needs) {\n yield sendComment(label);\n }\n yield sendStatus(label, !labelSet.needs);\n });\n}\nexports.default = default_1;\n/**\n * This only run on opened action so that it's not duplicated everytime a user comment.\n *\n * @param label to send comment to\n */\nfunction sendComment(label) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n if (github.context.payload.action !== 'opened') {\n return;\n }\n if (typeof label.needs === 'boolean') {\n return;\n }\n // Post comment if needs.comment is available\n const comment = (_a = label.needs) === null || _a === void 0 ? void 0 : _a.comment;\n if (comment) {\n yield github_1.postComment(comment);\n }\n });\n}\nfunction sendStatus(label, success) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof label.needs === 'boolean') {\n return;\n }\n const status = (_a = label.needs) === null || _a === void 0 ? void 0 : _a.status;\n if (!status) {\n return;\n }\n function description() {\n var _a, _b;\n if (typeof (status === null || status === void 0 ? void 0 : status.description) === 'string') {\n return status === null || status === void 0 ? void 0 : status.description;\n }\n if (success) {\n return (_a = status === null || status === void 0 ? void 0 : status.description) === null || _a === void 0 ? void 0 : _a.success;\n }\n return (_b = status === null || status === void 0 ? void 0 : status.description) === null || _b === void 0 ? void 0 : _b.failure;\n }\n function state() {\n var _a;\n if (success) {\n return 'success';\n }\n if (typeof (status === null || status === void 0 ? void 0 : status.description) === 'string') {\n return 'failure';\n }\n if (typeof ((_a = status === null || status === void 0 ? void 0 : status.description) === null || _a === void 0 ? void 0 : _a.failure) === 'string') {\n return 'failure';\n }\n return 'pending';\n }\n yield github_1.commitStatus(status.context, state(), description(), status.url);\n });\n}\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isAuthorAssociationAllowed = void 0;\nconst github = __importStar(require(\"@actions/github\"));\nfunction getAuthorAssociation() {\n const payload = github.context.payload;\n const current = payload.comment || payload.pull_request || payload.issue;\n return current === null || current === void 0 ? void 0 : current.author_association;\n}\nfunction isCommentUserIssueAuthor() {\n var _a, _b, _c, _d;\n const payload = github.context.payload;\n return ((_b = (_a = payload.comment) === null || _a === void 0 ? void 0 : _a.user) === null || _b === void 0 ? void 0 : _b.login) === ((_d = (_c = payload.issue) === null || _c === void 0 ? void 0 : _c.user) === null || _d === void 0 ? void 0 : _d.login);\n}\nfunction isAuthorAssociationAllowed(authorAssociation) {\n if (!authorAssociation) {\n return true;\n }\n if (authorAssociation.author && isCommentUserIssueAuthor()) {\n return true;\n }\n switch (getAuthorAssociation()) {\n case 'COLLABORATOR':\n return !!authorAssociation.collaborator;\n case 'CONTRIBUTOR':\n return !!authorAssociation.contributor;\n case 'FIRST_TIMER':\n return !!authorAssociation.first_timer;\n case 'FIRST_TIME_CONTRIBUTOR':\n return !!authorAssociation.first_time_contributor;\n case 'MANNEQUIN':\n return !!authorAssociation.mannequin;\n case 'MEMBER':\n return !!authorAssociation.member;\n case 'NONE':\n return !!authorAssociation.none;\n case 'OWNER':\n return !!authorAssociation.owner;\n default:\n return false;\n }\n}\nexports.isAuthorAssociationAllowed = isAuthorAssociationAllowed;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (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};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isCreatedOpened = void 0;\nconst github = __importStar(require(\"@actions/github\"));\nconst core = __importStar(require(\"@actions/core\"));\nconst github_1 = require(\"../github\");\nfunction is(eventName, actions) {\n return (github.context.eventName === eventName &&\n actions.includes(github.context.payload.action));\n}\n/**\n * Ignore labeled race condition where it get created before needs labels.\n * Not sure what is a better way to do this.\n */\nfunction ignoreLabeledRaceCondition() {\n var _a, _b, _c, _d, _e, _f, _g;\n const payload = github.context.payload;\n if (((_a = payload.sender) === null || _a === void 0 ? void 0 : _a.type) !== 'User' &&\n github.context.payload.action === 'labeled') {\n return false;\n }\n if (is('issues', ['labeled'])) {\n return (Date.parse((_b = payload.issue) === null || _b === void 0 ? void 0 : _b.created_at) + 5000 >=\n Date.parse((_c = payload.issue) === null || _c === void 0 ? void 0 : _c.updated_at));\n }\n if (is('pull_request', ['labeled'])) {\n return (Date.parse((_d = payload.pull_request) === null || _d === void 0 ? void 0 : _d.created_at) + 5000 >=\n Date.parse((_e = payload.pull_request) === null || _e === void 0 ? void 0 : _e.updated_at));\n }\n if (is('pull_request_target', ['labeled'])) {\n return (Date.parse((_f = payload.pull_request) === null || _f === void 0 ? void 0 : _f.created_at) + 5000 >=\n Date.parse((_g = payload.pull_request) === null || _g === void 0 ? void 0 : _g.updated_at));\n }\n return false;\n}\n/**\n * Ignore non 'User' to prevent infinite loop.\n */\nfunction ignoreBot() {\n var _a, _b, _c, _d;\n const payload = github.context.payload;\n core.info(`ignore: ignore bot - type:${(_a = payload.sender) === null || _a === void 0 ? void 0 : _a.type} - login:${(_b = payload.sender) === null || _b === void 0 ? void 0 : _b.login}`);\n if (((_c = payload.sender) === null || _c === void 0 ? void 0 : _c.login) === 'dependabot[bot]') {\n return false;\n }\n return ((_d = payload.sender) === null || _d === void 0 ? void 0 : _d.type) !== 'User';\n}\n/**\n * Ignores if sender is self\n */\nfunction ignoreSelf() {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const payload = github.context.payload;\n // allow fail because with 'github-token' > 'resource not accessible by integration'\n try {\n return ((_a = payload.sender) === null || _a === void 0 ? void 0 : _a.id) === (yield github_1.getBotUserId());\n }\n catch (e) {\n return false;\n }\n });\n}\n/**\n * Closed issue and pull_request should not trigger governance\n */\nfunction ignoreClosed() {\n var _a, _b;\n const payload = github.context.payload;\n if (((_a = payload === null || payload === void 0 ? void 0 : payload.pull_request) === null || _a === void 0 ? void 0 : _a.state) === 'closed') {\n return true;\n }\n if (((_b = payload === null || payload === void 0 ? void 0 : payload.issue) === null || _b === void 0 ? void 0 : _b.state) === 'closed') {\n return true;\n }\n return false;\n}\n/**\n * To prevent mistakes, this will ignore invalid workflow trigger\n */\nfunction default_1() {\n return __awaiter(this, void 0, void 0, function* () {\n if (ignoreClosed()) {\n core.info('ignore: closed');\n return true;\n }\n if (ignoreLabeledRaceCondition()) {\n core.info('ignore: labeled race condition');\n return true;\n }\n if (yield ignoreSelf()) {\n if (is('pull_request_target', ['synchronize', 'opened'])) {\n return false;\n }\n core.info('ignore: ignore self');\n return true;\n }\n if (is('issue_comment', ['created'])) {\n return ignoreBot();\n }\n if (is('pull_request', ['synchronize', 'opened'])) {\n return ignoreBot();\n }\n if (is('pull_request', ['labeled', 'unlabeled'])) {\n return false;\n }\n if (is('pull_request_target', ['synchronize', 'opened'])) {\n return ignoreBot();\n }\n if (is('pull_request_target', ['labeled', 'unlabeled'])) {\n return false;\n }\n if (is('issues', ['opened'])) {\n return ignoreBot();\n }\n if (is('issues', ['labeled', 'unlabeled'])) {\n return false;\n }\n core.info('ignore: catch all');\n return true;\n });\n}\nexports.default = default_1;\nfunction isCreatedOpened() {\n if (is('issue_comment', ['created'])) {\n return true;\n }\n if (is('pull_request', ['opened'])) {\n return true;\n }\n if (is('pull_request_target', ['opened'])) {\n return true;\n }\n if (is('issues', ['opened'])) {\n return true;\n }\n return false;\n}\nexports.isCreatedOpened = isCreatedOpened;\n","\"use strict\";\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\n/**\n * Commands\n *\n * Command Format:\n * ::name key=value,key=value::message\n *\n * Examples:\n * ::warning::This is the message\n * ::set-env name=MY_VAR::some value\n */\nfunction issueCommand(command, properties, message) {\n const cmd = new Command(command, properties, message);\n process.stdout.write(cmd.toString() + os.EOL);\n}\nexports.issueCommand = issueCommand;\nfunction issue(name, message = '') {\n issueCommand(name, {}, message);\n}\nexports.issue = issue;\nconst CMD_STRING = '::';\nclass Command {\n constructor(command, properties, message) {\n if (!command) {\n command = 'missing.command';\n }\n this.command = command;\n this.properties = properties;\n this.message = message;\n }\n toString() {\n let cmdStr = CMD_STRING + this.command;\n if (this.properties && Object.keys(this.properties).length > 0) {\n cmdStr += ' ';\n let first = true;\n for (const key in this.properties) {\n if (this.properties.hasOwnProperty(key)) {\n const val = this.properties[key];\n if (val) {\n if (first) {\n first = false;\n }\n else {\n cmdStr += ',';\n }\n cmdStr += `${key}=${escapeProperty(val)}`;\n }\n }\n }\n }\n cmdStr += `${CMD_STRING}${escapeData(this.message)}`;\n return cmdStr;\n }\n}\nfunction escapeData(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A');\n}\nfunction escapeProperty(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A')\n .replace(/:/g, '%3A')\n .replace(/,/g, '%2C');\n}\n//# sourceMappingURL=command.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (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};\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst command_1 = require(\"./command\");\nconst file_command_1 = require(\"./file-command\");\nconst utils_1 = require(\"./utils\");\nconst os = __importStar(require(\"os\"));\nconst path = __importStar(require(\"path\"));\n/**\n * The code to exit an action\n */\nvar ExitCode;\n(function (ExitCode) {\n /**\n * A code indicating that the action was successful\n */\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\n /**\n * A code indicating that the action was a failure\n */\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\n})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));\n//-----------------------------------------------------------------------\n// Variables\n//-----------------------------------------------------------------------\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction exportVariable(name, val) {\n const convertedVal = utils_1.toCommandValue(val);\n process.env[name] = convertedVal;\n const filePath = process.env['GITHUB_ENV'] || '';\n if (filePath) {\n const delimiter = '_GitHubActionsFileCommandDelimeter_';\n const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;\n file_command_1.issueCommand('ENV', commandValue);\n }\n else {\n command_1.issueCommand('set-env', { name }, convertedVal);\n }\n}\nexports.exportVariable = exportVariable;\n/**\n * Registers a secret which will get masked from logs\n * @param secret value of the secret\n */\nfunction setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}\nexports.setSecret = setSecret;\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nfunction addPath(inputPath) {\n const filePath = process.env['GITHUB_PATH'] || '';\n if (filePath) {\n file_command_1.issueCommand('PATH', inputPath);\n }\n else {\n command_1.issueCommand('add-path', {}, inputPath);\n }\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\n}\nexports.addPath = addPath;\n/**\n * Gets the value of an input. The value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nfunction getInput(name, options) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`);\n }\n return val.trim();\n}\nexports.getInput = getInput;\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}\nexports.setOutput = setOutput;\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nfunction setCommandEcho(enabled) {\n command_1.issue('echo', enabled ? 'on' : 'off');\n}\nexports.setCommandEcho = setCommandEcho;\n//-----------------------------------------------------------------------\n// Results\n//-----------------------------------------------------------------------\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nfunction setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}\nexports.setFailed = setFailed;\n//-----------------------------------------------------------------------\n// Logging Commands\n//-----------------------------------------------------------------------\n/**\n * Gets whether Actions Step Debug is on or not\n */\nfunction isDebug() {\n return process.env['RUNNER_DEBUG'] === '1';\n}\nexports.isDebug = isDebug;\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nfunction debug(message) {\n command_1.issueCommand('debug', {}, message);\n}\nexports.debug = debug;\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n */\nfunction error(message) {\n command_1.issue('error', message instanceof Error ? message.toString() : message);\n}\nexports.error = error;\n/**\n * Adds an warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n */\nfunction warning(message) {\n command_1.issue('warning', message instanceof Error ? message.toString() : message);\n}\nexports.warning = warning;\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nfunction info(message) {\n process.stdout.write(message + os.EOL);\n}\nexports.info = info;\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nfunction startGroup(name) {\n command_1.issue('group', name);\n}\nexports.startGroup = startGroup;\n/**\n * End an output group.\n */\nfunction endGroup() {\n command_1.issue('endgroup');\n}\nexports.endGroup = endGroup;\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nfunction group(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n startGroup(name);\n let result;\n try {\n result = yield fn();\n }\n finally {\n endGroup();\n }\n return result;\n });\n}\nexports.group = group;\n//-----------------------------------------------------------------------\n// Wrapper action state\n//-----------------------------------------------------------------------\n/**\n * Saves state for current action, the state can only be retrieved by this action's post job execution.\n *\n * @param name name of the state to store\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction saveState(name, value) {\n command_1.issueCommand('save-state', { name }, value);\n}\nexports.saveState = saveState;\n/**\n * Gets the value of an state set by this action's main execution.\n *\n * @param name name of the state to get\n * @returns string\n */\nfunction getState(name) {\n return process.env[`STATE_${name}`] || '';\n}\nexports.getState = getState;\n//# sourceMappingURL=core.js.map","\"use strict\";\n// For internal use, subject to change.\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst fs = __importStar(require(\"fs\"));\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\nfunction issueCommand(command, message) {\n const filePath = process.env[`GITHUB_${command}`];\n if (!filePath) {\n throw new Error(`Unable to find environment variable for file command ${command}`);\n }\n if (!fs.existsSync(filePath)) {\n throw new Error(`Missing file at path: ${filePath}`);\n }\n fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {\n encoding: 'utf8'\n });\n}\nexports.issueCommand = issueCommand;\n//# sourceMappingURL=file-command.js.map","\"use strict\";\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nfunction toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}\nexports.toCommandValue = toCommandValue;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Context = void 0;\nconst fs_1 = require(\"fs\");\nconst os_1 = require(\"os\");\nclass Context {\n /**\n * Hydrate the context from the environment\n */\n constructor() {\n this.payload = {};\n if (process.env.GITHUB_EVENT_PATH) {\n if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {\n this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));\n }\n else {\n const path = process.env.GITHUB_EVENT_PATH;\n process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);\n }\n }\n this.eventName = process.env.GITHUB_EVENT_NAME;\n this.sha = process.env.GITHUB_SHA;\n this.ref = process.env.GITHUB_REF;\n this.workflow = process.env.GITHUB_WORKFLOW;\n this.action = process.env.GITHUB_ACTION;\n this.actor = process.env.GITHUB_ACTOR;\n this.job = process.env.GITHUB_JOB;\n this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10);\n this.runId = parseInt(process.env.GITHUB_RUN_ID, 10);\n }\n get issue() {\n const payload = this.payload;\n return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });\n }\n get repo() {\n if (process.env.GITHUB_REPOSITORY) {\n const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');\n return { owner, repo };\n }\n if (this.payload.repository) {\n return {\n owner: this.payload.repository.owner.login,\n repo: this.payload.repository.name\n };\n }\n throw new Error(\"context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'\");\n }\n}\nexports.Context = Context;\n//# sourceMappingURL=context.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getOctokit = exports.context = void 0;\nconst Context = __importStar(require(\"./context\"));\nconst utils_1 = require(\"./utils\");\nexports.context = new Context.Context();\n/**\n * Returns a hydrated octokit ready to use for GitHub Actions\n *\n * @param token the repo PAT or GITHUB_TOKEN\n * @param options other options to set\n */\nfunction getOctokit(token, options) {\n return new utils_1.GitHub(utils_1.getOctokitOptions(token, options));\n}\nexports.getOctokit = getOctokit;\n//# sourceMappingURL=github.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getApiBaseUrl = exports.getProxyAgent = exports.getAuthString = void 0;\nconst httpClient = __importStar(require(\"@actions/http-client\"));\nfunction getAuthString(token, options) {\n if (!token && !options.auth) {\n throw new Error('Parameter token or opts.auth is required');\n }\n else if (token && options.auth) {\n throw new Error('Parameters token and opts.auth may not both be specified');\n }\n return typeof options.auth === 'string' ? options.auth : `token ${token}`;\n}\nexports.getAuthString = getAuthString;\nfunction getProxyAgent(destinationUrl) {\n const hc = new httpClient.HttpClient();\n return hc.getAgent(destinationUrl);\n}\nexports.getProxyAgent = getProxyAgent;\nfunction getApiBaseUrl() {\n return process.env['GITHUB_API_URL'] || 'https://api.github.com';\n}\nexports.getApiBaseUrl = getApiBaseUrl;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getOctokitOptions = exports.GitHub = exports.context = void 0;\nconst Context = __importStar(require(\"./context\"));\nconst Utils = __importStar(require(\"./internal/utils\"));\n// octokit + plugins\nconst core_1 = require(\"@octokit/core\");\nconst plugin_rest_endpoint_methods_1 = require(\"@octokit/plugin-rest-endpoint-methods\");\nconst plugin_paginate_rest_1 = require(\"@octokit/plugin-paginate-rest\");\nexports.context = new Context.Context();\nconst baseUrl = Utils.getApiBaseUrl();\nconst defaults = {\n baseUrl,\n request: {\n agent: Utils.getProxyAgent(baseUrl)\n }\n};\nexports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(defaults);\n/**\n * Convience function to correctly format Octokit Options to pass into the constructor.\n *\n * @param token the repo PAT or GITHUB_TOKEN\n * @param options other options to set\n */\nfunction getOctokitOptions(token, options) {\n const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller\n // Auth\n const auth = Utils.getAuthString(token, opts);\n if (auth) {\n opts.auth = auth;\n }\n return opts;\n}\nexports.getOctokitOptions = getOctokitOptions;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst http = require(\"http\");\nconst https = require(\"https\");\nconst pm = require(\"./proxy\");\nlet tunnel;\nvar HttpCodes;\n(function (HttpCodes) {\n HttpCodes[HttpCodes[\"OK\"] = 200] = \"OK\";\n HttpCodes[HttpCodes[\"MultipleChoices\"] = 300] = \"MultipleChoices\";\n HttpCodes[HttpCodes[\"MovedPermanently\"] = 301] = \"MovedPermanently\";\n HttpCodes[HttpCodes[\"ResourceMoved\"] = 302] = \"ResourceMoved\";\n HttpCodes[HttpCodes[\"SeeOther\"] = 303] = \"SeeOther\";\n HttpCodes[HttpCodes[\"NotModified\"] = 304] = \"NotModified\";\n HttpCodes[HttpCodes[\"UseProxy\"] = 305] = \"UseProxy\";\n HttpCodes[HttpCodes[\"SwitchProxy\"] = 306] = \"SwitchProxy\";\n HttpCodes[HttpCodes[\"TemporaryRedirect\"] = 307] = \"TemporaryRedirect\";\n HttpCodes[HttpCodes[\"PermanentRedirect\"] = 308] = \"PermanentRedirect\";\n HttpCodes[HttpCodes[\"BadRequest\"] = 400] = \"BadRequest\";\n HttpCodes[HttpCodes[\"Unauthorized\"] = 401] = \"Unauthorized\";\n HttpCodes[HttpCodes[\"PaymentRequired\"] = 402] = \"PaymentRequired\";\n HttpCodes[HttpCodes[\"Forbidden\"] = 403] = \"Forbidden\";\n HttpCodes[HttpCodes[\"NotFound\"] = 404] = \"NotFound\";\n HttpCodes[HttpCodes[\"MethodNotAllowed\"] = 405] = \"MethodNotAllowed\";\n HttpCodes[HttpCodes[\"NotAcceptable\"] = 406] = \"NotAcceptable\";\n HttpCodes[HttpCodes[\"ProxyAuthenticationRequired\"] = 407] = \"ProxyAuthenticationRequired\";\n HttpCodes[HttpCodes[\"RequestTimeout\"] = 408] = \"RequestTimeout\";\n HttpCodes[HttpCodes[\"Conflict\"] = 409] = \"Conflict\";\n HttpCodes[HttpCodes[\"Gone\"] = 410] = \"Gone\";\n HttpCodes[HttpCodes[\"TooManyRequests\"] = 429] = \"TooManyRequests\";\n HttpCodes[HttpCodes[\"InternalServerError\"] = 500] = \"InternalServerError\";\n HttpCodes[HttpCodes[\"NotImplemented\"] = 501] = \"NotImplemented\";\n HttpCodes[HttpCodes[\"BadGateway\"] = 502] = \"BadGateway\";\n HttpCodes[HttpCodes[\"ServiceUnavailable\"] = 503] = \"ServiceUnavailable\";\n HttpCodes[HttpCodes[\"GatewayTimeout\"] = 504] = \"GatewayTimeout\";\n})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));\nvar Headers;\n(function (Headers) {\n Headers[\"Accept\"] = \"accept\";\n Headers[\"ContentType\"] = \"content-type\";\n})(Headers = exports.Headers || (exports.Headers = {}));\nvar MediaTypes;\n(function (MediaTypes) {\n MediaTypes[\"ApplicationJson\"] = \"application/json\";\n})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));\n/**\n * Returns the proxy URL, depending upon the supplied url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\nfunction getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}\nexports.getProxyUrl = getProxyUrl;\nconst HttpRedirectCodes = [\n HttpCodes.MovedPermanently,\n HttpCodes.ResourceMoved,\n HttpCodes.SeeOther,\n HttpCodes.TemporaryRedirect,\n HttpCodes.PermanentRedirect\n];\nconst HttpResponseRetryCodes = [\n HttpCodes.BadGateway,\n HttpCodes.ServiceUnavailable,\n HttpCodes.GatewayTimeout\n];\nconst RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];\nconst ExponentialBackoffCeiling = 10;\nconst ExponentialBackoffTimeSlice = 5;\nclass HttpClientError extends Error {\n constructor(message, statusCode) {\n super(message);\n this.name = 'HttpClientError';\n this.statusCode = statusCode;\n Object.setPrototypeOf(this, HttpClientError.prototype);\n }\n}\nexports.HttpClientError = HttpClientError;\nclass HttpClientResponse {\n constructor(message) {\n this.message = message;\n }\n readBody() {\n return new Promise(async (resolve, reject) => {\n let output = Buffer.alloc(0);\n this.message.on('data', (chunk) => {\n output = Buffer.concat([output, chunk]);\n });\n this.message.on('end', () => {\n resolve(output.toString());\n });\n });\n }\n}\nexports.HttpClientResponse = HttpClientResponse;\nfunction isHttps(requestUrl) {\n let parsedUrl = new URL(requestUrl);\n return parsedUrl.protocol === 'https:';\n}\nexports.isHttps = isHttps;\nclass HttpClient {\n constructor(userAgent, handlers, requestOptions) {\n this._ignoreSslError = false;\n this._allowRedirects = true;\n this._allowRedirectDowngrade = false;\n this._maxRedirects = 50;\n this._allowRetries = false;\n this._maxRetries = 1;\n this._keepAlive = false;\n this._disposed = false;\n this.userAgent = userAgent;\n this.handlers = handlers || [];\n this.requestOptions = requestOptions;\n if (requestOptions) {\n if (requestOptions.ignoreSslError != null) {\n this._ignoreSslError = requestOptions.ignoreSslError;\n }\n this._socketTimeout = requestOptions.socketTimeout;\n if (requestOptions.allowRedirects != null) {\n this._allowRedirects = requestOptions.allowRedirects;\n }\n if (requestOptions.allowRedirectDowngrade != null) {\n this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;\n }\n if (requestOptions.maxRedirects != null) {\n this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);\n }\n if (requestOptions.keepAlive != null) {\n this._keepAlive = requestOptions.keepAlive;\n }\n if (requestOptions.allowRetries != null) {\n this._allowRetries = requestOptions.allowRetries;\n }\n if (requestOptions.maxRetries != null) {\n this._maxRetries = requestOptions.maxRetries;\n }\n }\n }\n options(requestUrl, additionalHeaders) {\n return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});\n }\n get(requestUrl, additionalHeaders) {\n return this.request('GET', requestUrl, null, additionalHeaders || {});\n }\n del(requestUrl, additionalHeaders) {\n return this.request('DELETE', requestUrl, null, additionalHeaders || {});\n }\n post(requestUrl, data, additionalHeaders) {\n return this.request('POST', requestUrl, data, additionalHeaders || {});\n }\n patch(requestUrl, data, additionalHeaders) {\n return this.request('PATCH', requestUrl, data, additionalHeaders || {});\n }\n put(requestUrl, data, additionalHeaders) {\n return this.request('PUT', requestUrl, data, additionalHeaders || {});\n }\n head(requestUrl, additionalHeaders) {\n return this.request('HEAD', requestUrl, null, additionalHeaders || {});\n }\n sendStream(verb, requestUrl, stream, additionalHeaders) {\n return this.request(verb, requestUrl, stream, additionalHeaders);\n }\n /**\n * Gets a typed object from an endpoint\n * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise\n */\n async getJson(requestUrl, additionalHeaders = {}) {\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n let res = await this.get(requestUrl, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n }\n async postJson(requestUrl, obj, additionalHeaders = {}) {\n let data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n let res = await this.post(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n }\n async putJson(requestUrl, obj, additionalHeaders = {}) {\n let data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n let res = await this.put(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n }\n async patchJson(requestUrl, obj, additionalHeaders = {}) {\n let data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n let res = await this.patch(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n }\n /**\n * Makes a raw http request.\n * All other methods such as get, post, patch, and request ultimately call this.\n * Prefer get, del, post and patch\n */\n async request(verb, requestUrl, data, headers) {\n if (this._disposed) {\n throw new Error('Client has already been disposed.');\n }\n let parsedUrl = new URL(requestUrl);\n let info = this._prepareRequest(verb, parsedUrl, headers);\n // Only perform retries on reads since writes may not be idempotent.\n let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1\n ? this._maxRetries + 1\n : 1;\n let numTries = 0;\n let response;\n while (numTries < maxTries) {\n response = await this.requestRaw(info, data);\n // Check if it's an authentication challenge\n if (response &&\n response.message &&\n response.message.statusCode === HttpCodes.Unauthorized) {\n let authenticationHandler;\n for (let i = 0; i < this.handlers.length; i++) {\n if (this.handlers[i].canHandleAuthentication(response)) {\n authenticationHandler = this.handlers[i];\n break;\n }\n }\n if (authenticationHandler) {\n return authenticationHandler.handleAuthentication(this, info, data);\n }\n else {\n // We have received an unauthorized response but have no handlers to handle it.\n // Let the response return to the caller.\n return response;\n }\n }\n let redirectsRemaining = this._maxRedirects;\n while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 &&\n this._allowRedirects &&\n redirectsRemaining > 0) {\n const redirectUrl = response.message.headers['location'];\n if (!redirectUrl) {\n // if there's no location to redirect to, we won't\n break;\n }\n let parsedRedirectUrl = new URL(redirectUrl);\n if (parsedUrl.protocol == 'https:' &&\n parsedUrl.protocol != parsedRedirectUrl.protocol &&\n !this._allowRedirectDowngrade) {\n throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');\n }\n // we need to finish reading the response before reassigning response\n // which will leak the open socket.\n await response.readBody();\n // strip authorization header if redirected to a different hostname\n if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {\n for (let header in headers) {\n // header names are case insensitive\n if (header.toLowerCase() === 'authorization') {\n delete headers[header];\n }\n }\n }\n // let's make the request with the new redirectUrl\n info = this._prepareRequest(verb, parsedRedirectUrl, headers);\n response = await this.requestRaw(info, data);\n redirectsRemaining--;\n }\n if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {\n // If not a retry code, return immediately instead of retrying\n return response;\n }\n numTries += 1;\n if (numTries < maxTries) {\n await response.readBody();\n await this._performExponentialBackoff(numTries);\n }\n }\n return response;\n }\n /**\n * Needs to be called if keepAlive is set to true in request options.\n */\n dispose() {\n if (this._agent) {\n this._agent.destroy();\n }\n this._disposed = true;\n }\n /**\n * Raw request.\n * @param info\n * @param data\n */\n requestRaw(info, data) {\n return new Promise((resolve, reject) => {\n let callbackForResult = function (err, res) {\n if (err) {\n reject(err);\n }\n resolve(res);\n };\n this.requestRawWithCallback(info, data, callbackForResult);\n });\n }\n /**\n * Raw request with callback.\n * @param info\n * @param data\n * @param onResult\n */\n requestRawWithCallback(info, data, onResult) {\n let socket;\n if (typeof data === 'string') {\n info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n }\n let callbackCalled = false;\n let handleResult = (err, res) => {\n if (!callbackCalled) {\n callbackCalled = true;\n onResult(err, res);\n }\n };\n let req = info.httpModule.request(info.options, (msg) => {\n let res = new HttpClientResponse(msg);\n handleResult(null, res);\n });\n req.on('socket', sock => {\n socket = sock;\n });\n // If we ever get disconnected, we want the socket to timeout eventually\n req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n if (socket) {\n socket.end();\n }\n handleResult(new Error('Request timeout: ' + info.options.path), null);\n });\n req.on('error', function (err) {\n // err has statusCode property\n // res should have headers\n handleResult(err, null);\n });\n if (data && typeof data === 'string') {\n req.write(data, 'utf8');\n }\n if (data && typeof data !== 'string') {\n data.on('close', function () {\n req.end();\n });\n data.pipe(req);\n }\n else {\n req.end();\n }\n }\n /**\n * Gets an http agent. This function is useful when you need an http agent that handles\n * routing through a proxy server - depending upon the url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\n getAgent(serverUrl) {\n let parsedUrl = new URL(serverUrl);\n return this._getAgent(parsedUrl);\n }\n _prepareRequest(method, requestUrl, headers) {\n const info = {};\n info.parsedUrl = requestUrl;\n const usingSsl = info.parsedUrl.protocol === 'https:';\n info.httpModule = usingSsl ? https : http;\n const defaultPort = usingSsl ? 443 : 80;\n info.options = {};\n info.options.host = info.parsedUrl.hostname;\n info.options.port = info.parsedUrl.port\n ? parseInt(info.parsedUrl.port)\n : defaultPort;\n info.options.path =\n (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');\n info.options.method = method;\n info.options.headers = this._mergeHeaders(headers);\n if (this.userAgent != null) {\n info.options.headers['user-agent'] = this.userAgent;\n }\n info.options.agent = this._getAgent(info.parsedUrl);\n // gives handlers an opportunity to participate\n if (this.handlers) {\n this.handlers.forEach(handler => {\n handler.prepareRequest(info.options);\n });\n }\n return info;\n }\n _mergeHeaders(headers) {\n const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n if (this.requestOptions && this.requestOptions.headers) {\n return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));\n }\n return lowercaseKeys(headers || {});\n }\n _getExistingOrDefaultHeader(additionalHeaders, header, _default) {\n const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n let clientHeader;\n if (this.requestOptions && this.requestOptions.headers) {\n clientHeader = lowercaseKeys(this.requestOptions.headers)[header];\n }\n return additionalHeaders[header] || clientHeader || _default;\n }\n _getAgent(parsedUrl) {\n let agent;\n let proxyUrl = pm.getProxyUrl(parsedUrl);\n let useProxy = proxyUrl && proxyUrl.hostname;\n if (this._keepAlive && useProxy) {\n agent = this._proxyAgent;\n }\n if (this._keepAlive && !useProxy) {\n agent = this._agent;\n }\n // if agent is already assigned use that agent.\n if (!!agent) {\n return agent;\n }\n const usingSsl = parsedUrl.protocol === 'https:';\n let maxSockets = 100;\n if (!!this.requestOptions) {\n maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;\n }\n if (useProxy) {\n // If using proxy, need tunnel\n if (!tunnel) {\n tunnel = require('tunnel');\n }\n const agentOptions = {\n maxSockets: maxSockets,\n keepAlive: this._keepAlive,\n proxy: {\n proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`,\n host: proxyUrl.hostname,\n port: proxyUrl.port\n }\n };\n let tunnelAgent;\n const overHttps = proxyUrl.protocol === 'https:';\n if (usingSsl) {\n tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;\n }\n else {\n tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;\n }\n agent = tunnelAgent(agentOptions);\n this._proxyAgent = agent;\n }\n // if reusing agent across request and tunneling agent isn't assigned create a new agent\n if (this._keepAlive && !agent) {\n const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };\n agent = usingSsl ? new https.Agent(options) : new http.Agent(options);\n this._agent = agent;\n }\n // if not using private agent and tunnel agent isn't setup then use global agent\n if (!agent) {\n agent = usingSsl ? https.globalAgent : http.globalAgent;\n }\n if (usingSsl && this._ignoreSslError) {\n // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n // we have to cast it to any and change it directly\n agent.options = Object.assign(agent.options || {}, {\n rejectUnauthorized: false\n });\n }\n return agent;\n }\n _performExponentialBackoff(retryNumber) {\n retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);\n const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);\n return new Promise(resolve => setTimeout(() => resolve(), ms));\n }\n static dateTimeDeserializer(key, value) {\n if (typeof value === 'string') {\n let a = new Date(value);\n if (!isNaN(a.valueOf())) {\n return a;\n }\n }\n return value;\n }\n async _processResponse(res, options) {\n return new Promise(async (resolve, reject) => {\n const statusCode = res.message.statusCode;\n const response = {\n statusCode: statusCode,\n result: null,\n headers: {}\n };\n // not found leads to null obj returned\n if (statusCode == HttpCodes.NotFound) {\n resolve(response);\n }\n let obj;\n let contents;\n // get the result from the body\n try {\n contents = await res.readBody();\n if (contents && contents.length > 0) {\n if (options && options.deserializeDates) {\n obj = JSON.parse(contents, HttpClient.dateTimeDeserializer);\n }\n else {\n obj = JSON.parse(contents);\n }\n response.result = obj;\n }\n response.headers = res.message.headers;\n }\n catch (err) {\n // Invalid resource (contents not json); leaving result obj null\n }\n // note that 3xx redirects are handled by the http layer.\n if (statusCode > 299) {\n let msg;\n // if exception/error in body, attempt to get better error\n if (obj && obj.message) {\n msg = obj.message;\n }\n else if (contents && contents.length > 0) {\n // it may be the case that the exception is in the body message as string\n msg = contents;\n }\n else {\n msg = 'Failed request: (' + statusCode + ')';\n }\n let err = new HttpClientError(msg, statusCode);\n err.result = response.result;\n reject(err);\n }\n else {\n resolve(response);\n }\n });\n }\n}\nexports.HttpClient = HttpClient;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction getProxyUrl(reqUrl) {\n let usingSsl = reqUrl.protocol === 'https:';\n let proxyUrl;\n if (checkBypass(reqUrl)) {\n return proxyUrl;\n }\n let proxyVar;\n if (usingSsl) {\n proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY'];\n }\n else {\n proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY'];\n }\n if (proxyVar) {\n proxyUrl = new URL(proxyVar);\n }\n return proxyUrl;\n}\nexports.getProxyUrl = getProxyUrl;\nfunction checkBypass(reqUrl) {\n if (!reqUrl.hostname) {\n return false;\n }\n let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';\n if (!noProxy) {\n return false;\n }\n // Determine the request port\n let reqPort;\n if (reqUrl.port) {\n reqPort = Number(reqUrl.port);\n }\n else if (reqUrl.protocol === 'http:') {\n reqPort = 80;\n }\n else if (reqUrl.protocol === 'https:') {\n reqPort = 443;\n }\n // Format the request hostname and hostname with port\n let upperReqHosts = [reqUrl.hostname.toUpperCase()];\n if (typeof reqPort === 'number') {\n upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);\n }\n // Compare request host against noproxy\n for (let upperNoProxyItem of noProxy\n .split(',')\n .map(x => x.trim().toUpperCase())\n .filter(x => x)) {\n if (upperReqHosts.some(x => x === upperNoProxyItem)) {\n return true;\n }\n }\n return false;\n}\nexports.checkBypass = checkBypass;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nasync function auth(token) {\n const tokenType = token.split(/\\./).length === 3 ? \"app\" : /^v\\d+\\./.test(token) ? \"installation\" : \"oauth\";\n return {\n type: \"token\",\n token: token,\n tokenType\n };\n}\n\n/**\n * Prefix token for usage in the Authorization header\n *\n * @param token OAuth token or JSON Web Token\n */\nfunction withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n\n return `token ${token}`;\n}\n\nasync function hook(token, request, route, parameters) {\n const endpoint = request.endpoint.merge(route, parameters);\n endpoint.headers.authorization = withAuthorizationPrefix(token);\n return request(endpoint);\n}\n\nconst createTokenAuth = function createTokenAuth(token) {\n if (!token) {\n throw new Error(\"[@octokit/auth-token] No token passed to createTokenAuth\");\n }\n\n if (typeof token !== \"string\") {\n throw new Error(\"[@octokit/auth-token] Token passed to createTokenAuth is not a string\");\n }\n\n token = token.replace(/^(token|bearer) +/i, \"\");\n return Object.assign(auth.bind(null, token), {\n hook: hook.bind(null, token)\n });\n};\n\nexports.createTokenAuth = createTokenAuth;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar universalUserAgent = require('universal-user-agent');\nvar beforeAfterHook = require('before-after-hook');\nvar request = require('@octokit/request');\nvar graphql = require('@octokit/graphql');\nvar authToken = require('@octokit/auth-token');\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nconst VERSION = \"3.2.5\";\n\nclass Octokit {\n constructor(options = {}) {\n const hook = new beforeAfterHook.Collection();\n const requestDefaults = {\n baseUrl: request.request.endpoint.DEFAULTS.baseUrl,\n headers: {},\n request: Object.assign({}, options.request, {\n hook: hook.bind(null, \"request\")\n }),\n mediaType: {\n previews: [],\n format: \"\"\n }\n }; // prepend default user agent with `options.userAgent` if set\n\n requestDefaults.headers[\"user-agent\"] = [options.userAgent, `octokit-core.js/${VERSION} ${universalUserAgent.getUserAgent()}`].filter(Boolean).join(\" \");\n\n if (options.baseUrl) {\n requestDefaults.baseUrl = options.baseUrl;\n }\n\n if (options.previews) {\n requestDefaults.mediaType.previews = options.previews;\n }\n\n if (options.timeZone) {\n requestDefaults.headers[\"time-zone\"] = options.timeZone;\n }\n\n this.request = request.request.defaults(requestDefaults);\n this.graphql = graphql.withCustomRequest(this.request).defaults(requestDefaults);\n this.log = Object.assign({\n debug: () => {},\n info: () => {},\n warn: console.warn.bind(console),\n error: console.error.bind(console)\n }, options.log);\n this.hook = hook; // (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance\n // is unauthenticated. The `this.auth()` method is a no-op and no request hook is registered.\n // (2) If only `options.auth` is set, use the default token authentication strategy.\n // (3) If `options.authStrategy` is set then use it and pass in `options.auth`. Always pass own request as many strategies accept a custom request instance.\n // TODO: type `options.auth` based on `options.authStrategy`.\n\n if (!options.authStrategy) {\n if (!options.auth) {\n // (1)\n this.auth = async () => ({\n type: \"unauthenticated\"\n });\n } else {\n // (2)\n const auth = authToken.createTokenAuth(options.auth); // @ts-ignore ¯\\_(ツ)_/¯\n\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n }\n } else {\n const {\n authStrategy\n } = options,\n otherOptions = _objectWithoutProperties(options, [\"authStrategy\"]);\n\n const auth = authStrategy(Object.assign({\n request: this.request,\n log: this.log,\n // we pass the current octokit instance as well as its constructor options\n // to allow for authentication strategies that return a new octokit instance\n // that shares the same internal state as the current one. The original\n // requirement for this was the \"event-octokit\" authentication strategy\n // of https://github.com/probot/octokit-auth-probot.\n octokit: this,\n octokitOptions: otherOptions\n }, options.auth)); // @ts-ignore ¯\\_(ツ)_/¯\n\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n } // apply plugins\n // https://stackoverflow.com/a/16345172\n\n\n const classConstructor = this.constructor;\n classConstructor.plugins.forEach(plugin => {\n Object.assign(this, plugin(this, options));\n });\n }\n\n static defaults(defaults) {\n const OctokitWithDefaults = class extends this {\n constructor(...args) {\n const options = args[0] || {};\n\n if (typeof defaults === \"function\") {\n super(defaults(options));\n return;\n }\n\n super(Object.assign({}, defaults, options, options.userAgent && defaults.userAgent ? {\n userAgent: `${options.userAgent} ${defaults.userAgent}`\n } : null));\n }\n\n };\n return OctokitWithDefaults;\n }\n /**\n * Attach a plugin (or many) to your Octokit instance.\n *\n * @example\n * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)\n */\n\n\n static plugin(...newPlugins) {\n var _a;\n\n const currentPlugins = this.plugins;\n const NewOctokit = (_a = class extends this {}, _a.plugins = currentPlugins.concat(newPlugins.filter(plugin => !currentPlugins.includes(plugin))), _a);\n return NewOctokit;\n }\n\n}\nOctokit.VERSION = VERSION;\nOctokit.plugins = [];\n\nexports.Octokit = Octokit;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar isPlainObject = require('is-plain-object');\nvar universalUserAgent = require('universal-user-agent');\n\nfunction lowercaseKeys(object) {\n if (!object) {\n return {};\n }\n\n return Object.keys(object).reduce((newObj, key) => {\n newObj[key.toLowerCase()] = object[key];\n return newObj;\n }, {});\n}\n\nfunction mergeDeep(defaults, options) {\n const result = Object.assign({}, defaults);\n Object.keys(options).forEach(key => {\n if (isPlainObject.isPlainObject(options[key])) {\n if (!(key in defaults)) Object.assign(result, {\n [key]: options[key]\n });else result[key] = mergeDeep(defaults[key], options[key]);\n } else {\n Object.assign(result, {\n [key]: options[key]\n });\n }\n });\n return result;\n}\n\nfunction removeUndefinedProperties(obj) {\n for (const key in obj) {\n if (obj[key] === undefined) {\n delete obj[key];\n }\n }\n\n return obj;\n}\n\nfunction merge(defaults, route, options) {\n if (typeof route === \"string\") {\n let [method, url] = route.split(\" \");\n options = Object.assign(url ? {\n method,\n url\n } : {\n url: method\n }, options);\n } else {\n options = Object.assign({}, route);\n } // lowercase header names before merging with defaults to avoid duplicates\n\n\n options.headers = lowercaseKeys(options.headers); // remove properties with undefined values before merging\n\n removeUndefinedProperties(options);\n removeUndefinedProperties(options.headers);\n const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten\n\n if (defaults && defaults.mediaType.previews.length) {\n mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);\n }\n\n mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, \"\"));\n return mergedOptions;\n}\n\nfunction addQueryParameters(url, parameters) {\n const separator = /\\?/.test(url) ? \"&\" : \"?\";\n const names = Object.keys(parameters);\n\n if (names.length === 0) {\n return url;\n }\n\n return url + separator + names.map(name => {\n if (name === \"q\") {\n return \"q=\" + parameters.q.split(\"+\").map(encodeURIComponent).join(\"+\");\n }\n\n return `${name}=${encodeURIComponent(parameters[name])}`;\n }).join(\"&\");\n}\n\nconst urlVariableRegex = /\\{[^}]+\\}/g;\n\nfunction removeNonChars(variableName) {\n return variableName.replace(/^\\W+|\\W+$/g, \"\").split(/,/);\n}\n\nfunction extractUrlVariableNames(url) {\n const matches = url.match(urlVariableRegex);\n\n if (!matches) {\n return [];\n }\n\n return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);\n}\n\nfunction omit(object, keysToOmit) {\n return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {\n obj[key] = object[key];\n return obj;\n }, {});\n}\n\n// Based on https://github.com/bramstein/url-template, licensed under BSD\n// TODO: create separate package.\n//\n// Copyright (c) 2012-2014, Bram Stein\n// All rights reserved.\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions\n// are met:\n// 1. Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// 2. Redistributions in binary form must reproduce the above copyright\n// notice, this list of conditions and the following disclaimer in the\n// documentation and/or other materials provided with the distribution.\n// 3. The name of the author may not be used to endorse or promote products\n// derived from this software without specific prior written permission.\n// THIS SOFTWARE IS PROVIDED BY THE AUTHOR \"AS IS\" AND ANY EXPRESS OR IMPLIED\n// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n// EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n/* istanbul ignore file */\nfunction encodeReserved(str) {\n return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {\n if (!/%[0-9A-Fa-f]/.test(part)) {\n part = encodeURI(part).replace(/%5B/g, \"[\").replace(/%5D/g, \"]\");\n }\n\n return part;\n }).join(\"\");\n}\n\nfunction encodeUnreserved(str) {\n return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {\n return \"%\" + c.charCodeAt(0).toString(16).toUpperCase();\n });\n}\n\nfunction encodeValue(operator, value, key) {\n value = operator === \"+\" || operator === \"#\" ? encodeReserved(value) : encodeUnreserved(value);\n\n if (key) {\n return encodeUnreserved(key) + \"=\" + value;\n } else {\n return value;\n }\n}\n\nfunction isDefined(value) {\n return value !== undefined && value !== null;\n}\n\nfunction isKeyOperator(operator) {\n return operator === \";\" || operator === \"&\" || operator === \"?\";\n}\n\nfunction getValues(context, operator, key, modifier) {\n var value = context[key],\n result = [];\n\n if (isDefined(value) && value !== \"\") {\n if (typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") {\n value = value.toString();\n\n if (modifier && modifier !== \"*\") {\n value = value.substring(0, parseInt(modifier, 10));\n }\n\n result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : \"\"));\n } else {\n if (modifier === \"*\") {\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function (value) {\n result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : \"\"));\n });\n } else {\n Object.keys(value).forEach(function (k) {\n if (isDefined(value[k])) {\n result.push(encodeValue(operator, value[k], k));\n }\n });\n }\n } else {\n const tmp = [];\n\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function (value) {\n tmp.push(encodeValue(operator, value));\n });\n } else {\n Object.keys(value).forEach(function (k) {\n if (isDefined(value[k])) {\n tmp.push(encodeUnreserved(k));\n tmp.push(encodeValue(operator, value[k].toString()));\n }\n });\n }\n\n if (isKeyOperator(operator)) {\n result.push(encodeUnreserved(key) + \"=\" + tmp.join(\",\"));\n } else if (tmp.length !== 0) {\n result.push(tmp.join(\",\"));\n }\n }\n }\n } else {\n if (operator === \";\") {\n if (isDefined(value)) {\n result.push(encodeUnreserved(key));\n }\n } else if (value === \"\" && (operator === \"&\" || operator === \"?\")) {\n result.push(encodeUnreserved(key) + \"=\");\n } else if (value === \"\") {\n result.push(\"\");\n }\n }\n\n return result;\n}\n\nfunction parseUrl(template) {\n return {\n expand: expand.bind(null, template)\n };\n}\n\nfunction expand(template, context) {\n var operators = [\"+\", \"#\", \".\", \"/\", \";\", \"?\", \"&\"];\n return template.replace(/\\{([^\\{\\}]+)\\}|([^\\{\\}]+)/g, function (_, expression, literal) {\n if (expression) {\n let operator = \"\";\n const values = [];\n\n if (operators.indexOf(expression.charAt(0)) !== -1) {\n operator = expression.charAt(0);\n expression = expression.substr(1);\n }\n\n expression.split(/,/g).forEach(function (variable) {\n var tmp = /([^:\\*]*)(?::(\\d+)|(\\*))?/.exec(variable);\n values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));\n });\n\n if (operator && operator !== \"+\") {\n var separator = \",\";\n\n if (operator === \"?\") {\n separator = \"&\";\n } else if (operator !== \"#\") {\n separator = operator;\n }\n\n return (values.length !== 0 ? operator : \"\") + values.join(separator);\n } else {\n return values.join(\",\");\n }\n } else {\n return encodeReserved(literal);\n }\n });\n}\n\nfunction parse(options) {\n // https://fetch.spec.whatwg.org/#methods\n let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible\n\n let url = (options.url || \"/\").replace(/:([a-z]\\w+)/g, \"{$1}\");\n let headers = Object.assign({}, options.headers);\n let body;\n let parameters = omit(options, [\"method\", \"baseUrl\", \"url\", \"headers\", \"request\", \"mediaType\"]); // extract variable names from URL to calculate remaining variables later\n\n const urlVariableNames = extractUrlVariableNames(url);\n url = parseUrl(url).expand(parameters);\n\n if (!/^http/.test(url)) {\n url = options.baseUrl + url;\n }\n\n const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat(\"baseUrl\");\n const remainingParameters = omit(parameters, omittedParameters);\n const isBinaryRequest = /application\\/octet-stream/i.test(headers.accept);\n\n if (!isBinaryRequest) {\n if (options.mediaType.format) {\n // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw\n headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\\/vnd(\\.\\w+)(\\.v3)?(\\.\\w+)?(\\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(\",\");\n }\n\n if (options.mediaType.previews.length) {\n const previewsFromAcceptHeader = headers.accept.match(/[\\w-]+(?=-preview)/g) || [];\n headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {\n const format = options.mediaType.format ? `.${options.mediaType.format}` : \"+json\";\n return `application/vnd.github.${preview}-preview${format}`;\n }).join(\",\");\n }\n } // for GET/HEAD requests, set URL query parameters from remaining parameters\n // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters\n\n\n if ([\"GET\", \"HEAD\"].includes(method)) {\n url = addQueryParameters(url, remainingParameters);\n } else {\n if (\"data\" in remainingParameters) {\n body = remainingParameters.data;\n } else {\n if (Object.keys(remainingParameters).length) {\n body = remainingParameters;\n } else {\n headers[\"content-length\"] = 0;\n }\n }\n } // default content-type for JSON if body is set\n\n\n if (!headers[\"content-type\"] && typeof body !== \"undefined\") {\n headers[\"content-type\"] = \"application/json; charset=utf-8\";\n } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.\n // fetch does not allow to set `content-length` header, but we can set body to an empty string\n\n\n if ([\"PATCH\", \"PUT\"].includes(method) && typeof body === \"undefined\") {\n body = \"\";\n } // Only return body/request keys if present\n\n\n return Object.assign({\n method,\n url,\n headers\n }, typeof body !== \"undefined\" ? {\n body\n } : null, options.request ? {\n request: options.request\n } : null);\n}\n\nfunction endpointWithDefaults(defaults, route, options) {\n return parse(merge(defaults, route, options));\n}\n\nfunction withDefaults(oldDefaults, newDefaults) {\n const DEFAULTS = merge(oldDefaults, newDefaults);\n const endpoint = endpointWithDefaults.bind(null, DEFAULTS);\n return Object.assign(endpoint, {\n DEFAULTS,\n defaults: withDefaults.bind(null, DEFAULTS),\n merge: merge.bind(null, DEFAULTS),\n parse\n });\n}\n\nconst VERSION = \"6.0.11\";\n\nconst userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.\n// So we use RequestParameters and add method as additional required property.\n\nconst DEFAULTS = {\n method: \"GET\",\n baseUrl: \"https://api.github.com\",\n headers: {\n accept: \"application/vnd.github.v3+json\",\n \"user-agent\": userAgent\n },\n mediaType: {\n format: \"\",\n previews: []\n }\n};\n\nconst endpoint = withDefaults(null, DEFAULTS);\n\nexports.endpoint = endpoint;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar request = require('@octokit/request');\nvar universalUserAgent = require('universal-user-agent');\n\nconst VERSION = \"4.6.0\";\n\nclass GraphqlError extends Error {\n constructor(request, response) {\n const message = response.data.errors[0].message;\n super(message);\n Object.assign(this, response.data);\n Object.assign(this, {\n headers: response.headers\n });\n this.name = \"GraphqlError\";\n this.request = request; // Maintains proper stack trace (only available on V8)\n\n /* istanbul ignore next */\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n }\n\n}\n\nconst NON_VARIABLE_OPTIONS = [\"method\", \"baseUrl\", \"url\", \"headers\", \"request\", \"query\", \"mediaType\"];\nconst GHES_V3_SUFFIX_REGEX = /\\/api\\/v3\\/?$/;\nfunction graphql(request, query, options) {\n if (typeof query === \"string\" && options && \"query\" in options) {\n return Promise.reject(new Error(`[@octokit/graphql] \"query\" cannot be used as variable name`));\n }\n\n const parsedOptions = typeof query === \"string\" ? Object.assign({\n query\n }, options) : query;\n const requestOptions = Object.keys(parsedOptions).reduce((result, key) => {\n if (NON_VARIABLE_OPTIONS.includes(key)) {\n result[key] = parsedOptions[key];\n return result;\n }\n\n if (!result.variables) {\n result.variables = {};\n }\n\n result.variables[key] = parsedOptions[key];\n return result;\n }, {}); // workaround for GitHub Enterprise baseUrl set with /api/v3 suffix\n // https://github.com/octokit/auth-app.js/issues/111#issuecomment-657610451\n\n const baseUrl = parsedOptions.baseUrl || request.endpoint.DEFAULTS.baseUrl;\n\n if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {\n requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, \"/api/graphql\");\n }\n\n return request(requestOptions).then(response => {\n if (response.data.errors) {\n const headers = {};\n\n for (const key of Object.keys(response.headers)) {\n headers[key] = response.headers[key];\n }\n\n throw new GraphqlError(requestOptions, {\n headers,\n data: response.data\n });\n }\n\n return response.data.data;\n });\n}\n\nfunction withDefaults(request$1, newDefaults) {\n const newRequest = request$1.defaults(newDefaults);\n\n const newApi = (query, options) => {\n return graphql(newRequest, query, options);\n };\n\n return Object.assign(newApi, {\n defaults: withDefaults.bind(null, newRequest),\n endpoint: request.request.endpoint\n });\n}\n\nconst graphql$1 = withDefaults(request.request, {\n headers: {\n \"user-agent\": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`\n },\n method: \"POST\",\n url: \"/graphql\"\n});\nfunction withCustomRequest(customRequest) {\n return withDefaults(customRequest, {\n method: \"POST\",\n url: \"/graphql\"\n });\n}\n\nexports.graphql = graphql$1;\nexports.withCustomRequest = withCustomRequest;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst VERSION = \"2.9.1\";\n\n/**\n * Some “list” response that can be paginated have a different response structure\n *\n * They have a `total_count` key in the response (search also has `incomplete_results`,\n * /installation/repositories also has `repository_selection`), as well as a key with\n * the list of the items which name varies from endpoint to endpoint.\n *\n * Octokit normalizes these responses so that paginated results are always returned following\n * the same structure. One challenge is that if the list response has only one page, no Link\n * header is provided, so this header alone is not sufficient to check wether a response is\n * paginated or not.\n *\n * We check if a \"total_count\" key is present in the response data, but also make sure that\n * a \"url\" property is not, as the \"Get the combined status for a specific ref\" endpoint would\n * otherwise match: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref\n */\nfunction normalizePaginatedListResponse(response) {\n const responseNeedsNormalization = \"total_count\" in response.data && !(\"url\" in response.data);\n if (!responseNeedsNormalization) return response; // keep the additional properties intact as there is currently no other way\n // to retrieve the same information.\n\n const incompleteResults = response.data.incomplete_results;\n const repositorySelection = response.data.repository_selection;\n const totalCount = response.data.total_count;\n delete response.data.incomplete_results;\n delete response.data.repository_selection;\n delete response.data.total_count;\n const namespaceKey = Object.keys(response.data)[0];\n const data = response.data[namespaceKey];\n response.data = data;\n\n if (typeof incompleteResults !== \"undefined\") {\n response.data.incomplete_results = incompleteResults;\n }\n\n if (typeof repositorySelection !== \"undefined\") {\n response.data.repository_selection = repositorySelection;\n }\n\n response.data.total_count = totalCount;\n return response;\n}\n\nfunction iterator(octokit, route, parameters) {\n const options = typeof route === \"function\" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);\n const requestMethod = typeof route === \"function\" ? route : octokit.request;\n const method = options.method;\n const headers = options.headers;\n let url = options.url;\n return {\n [Symbol.asyncIterator]: () => ({\n async next() {\n if (!url) return {\n done: true\n };\n const response = await requestMethod({\n method,\n url,\n headers\n });\n const normalizedResponse = normalizePaginatedListResponse(response); // `response.headers.link` format:\n // '; rel=\"next\", ; rel=\"last\"'\n // sets `url` to undefined if \"next\" URL is not present or `link` header is not set\n\n url = ((normalizedResponse.headers.link || \"\").match(/<([^>]+)>;\\s*rel=\"next\"/) || [])[1];\n return {\n value: normalizedResponse\n };\n }\n\n })\n };\n}\n\nfunction paginate(octokit, route, parameters, mapFn) {\n if (typeof parameters === \"function\") {\n mapFn = parameters;\n parameters = undefined;\n }\n\n return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn);\n}\n\nfunction gather(octokit, results, iterator, mapFn) {\n return iterator.next().then(result => {\n if (result.done) {\n return results;\n }\n\n let earlyExit = false;\n\n function done() {\n earlyExit = true;\n }\n\n results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data);\n\n if (earlyExit) {\n return results;\n }\n\n return gather(octokit, results, iterator, mapFn);\n });\n}\n\nconst composePaginateRest = Object.assign(paginate, {\n iterator\n});\n\n/**\n * @param octokit Octokit instance\n * @param options Options passed to Octokit constructor\n */\n\nfunction paginateRest(octokit) {\n return {\n paginate: Object.assign(paginate.bind(null, octokit), {\n iterator: iterator.bind(null, octokit)\n })\n };\n}\npaginateRest.VERSION = VERSION;\n\nexports.composePaginateRest = composePaginateRest;\nexports.paginateRest = paginateRest;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst Endpoints = {\n actions: {\n addSelectedRepoToOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\"],\n cancelWorkflowRun: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel\"],\n createOrUpdateOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}\"],\n createOrUpdateRepoSecret: [\"PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n createRegistrationTokenForOrg: [\"POST /orgs/{org}/actions/runners/registration-token\"],\n createRegistrationTokenForRepo: [\"POST /repos/{owner}/{repo}/actions/runners/registration-token\"],\n createRemoveTokenForOrg: [\"POST /orgs/{org}/actions/runners/remove-token\"],\n createRemoveTokenForRepo: [\"POST /repos/{owner}/{repo}/actions/runners/remove-token\"],\n createWorkflowDispatch: [\"POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches\"],\n deleteArtifact: [\"DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\"],\n deleteOrgSecret: [\"DELETE /orgs/{org}/actions/secrets/{secret_name}\"],\n deleteRepoSecret: [\"DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n deleteSelfHostedRunnerFromOrg: [\"DELETE /orgs/{org}/actions/runners/{runner_id}\"],\n deleteSelfHostedRunnerFromRepo: [\"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}\"],\n deleteWorkflowRun: [\"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}\"],\n deleteWorkflowRunLogs: [\"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs\"],\n disableSelectedRepositoryGithubActionsOrganization: [\"DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}\"],\n disableWorkflow: [\"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable\"],\n downloadArtifact: [\"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}\"],\n downloadJobLogsForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs\"],\n downloadWorkflowRunLogs: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs\"],\n enableSelectedRepositoryGithubActionsOrganization: [\"PUT /orgs/{org}/actions/permissions/repositories/{repository_id}\"],\n enableWorkflow: [\"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable\"],\n getAllowedActionsOrganization: [\"GET /orgs/{org}/actions/permissions/selected-actions\"],\n getAllowedActionsRepository: [\"GET /repos/{owner}/{repo}/actions/permissions/selected-actions\"],\n getArtifact: [\"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\"],\n getGithubActionsPermissionsOrganization: [\"GET /orgs/{org}/actions/permissions\"],\n getGithubActionsPermissionsRepository: [\"GET /repos/{owner}/{repo}/actions/permissions\"],\n getJobForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/jobs/{job_id}\"],\n getOrgPublicKey: [\"GET /orgs/{org}/actions/secrets/public-key\"],\n getOrgSecret: [\"GET /orgs/{org}/actions/secrets/{secret_name}\"],\n getRepoPermissions: [\"GET /repos/{owner}/{repo}/actions/permissions\", {}, {\n renamed: [\"actions\", \"getGithubActionsPermissionsRepository\"]\n }],\n getRepoPublicKey: [\"GET /repos/{owner}/{repo}/actions/secrets/public-key\"],\n getRepoSecret: [\"GET /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n getSelfHostedRunnerForOrg: [\"GET /orgs/{org}/actions/runners/{runner_id}\"],\n getSelfHostedRunnerForRepo: [\"GET /repos/{owner}/{repo}/actions/runners/{runner_id}\"],\n getWorkflow: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}\"],\n getWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}\"],\n getWorkflowRunUsage: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing\"],\n getWorkflowUsage: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing\"],\n listArtifactsForRepo: [\"GET /repos/{owner}/{repo}/actions/artifacts\"],\n listJobsForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs\"],\n listOrgSecrets: [\"GET /orgs/{org}/actions/secrets\"],\n listRepoSecrets: [\"GET /repos/{owner}/{repo}/actions/secrets\"],\n listRepoWorkflows: [\"GET /repos/{owner}/{repo}/actions/workflows\"],\n listRunnerApplicationsForOrg: [\"GET /orgs/{org}/actions/runners/downloads\"],\n listRunnerApplicationsForRepo: [\"GET /repos/{owner}/{repo}/actions/runners/downloads\"],\n listSelectedReposForOrgSecret: [\"GET /orgs/{org}/actions/secrets/{secret_name}/repositories\"],\n listSelectedRepositoriesEnabledGithubActionsOrganization: [\"GET /orgs/{org}/actions/permissions/repositories\"],\n listSelfHostedRunnersForOrg: [\"GET /orgs/{org}/actions/runners\"],\n listSelfHostedRunnersForRepo: [\"GET /repos/{owner}/{repo}/actions/runners\"],\n listWorkflowRunArtifacts: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts\"],\n listWorkflowRuns: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs\"],\n listWorkflowRunsForRepo: [\"GET /repos/{owner}/{repo}/actions/runs\"],\n reRunWorkflow: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun\"],\n removeSelectedRepoFromOrgSecret: [\"DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\"],\n setAllowedActionsOrganization: [\"PUT /orgs/{org}/actions/permissions/selected-actions\"],\n setAllowedActionsRepository: [\"PUT /repos/{owner}/{repo}/actions/permissions/selected-actions\"],\n setGithubActionsPermissionsOrganization: [\"PUT /orgs/{org}/actions/permissions\"],\n setGithubActionsPermissionsRepository: [\"PUT /repos/{owner}/{repo}/actions/permissions\"],\n setSelectedReposForOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories\"],\n setSelectedRepositoriesEnabledGithubActionsOrganization: [\"PUT /orgs/{org}/actions/permissions/repositories\"]\n },\n activity: {\n checkRepoIsStarredByAuthenticatedUser: [\"GET /user/starred/{owner}/{repo}\"],\n deleteRepoSubscription: [\"DELETE /repos/{owner}/{repo}/subscription\"],\n deleteThreadSubscription: [\"DELETE /notifications/threads/{thread_id}/subscription\"],\n getFeeds: [\"GET /feeds\"],\n getRepoSubscription: [\"GET /repos/{owner}/{repo}/subscription\"],\n getThread: [\"GET /notifications/threads/{thread_id}\"],\n getThreadSubscriptionForAuthenticatedUser: [\"GET /notifications/threads/{thread_id}/subscription\"],\n listEventsForAuthenticatedUser: [\"GET /users/{username}/events\"],\n listNotificationsForAuthenticatedUser: [\"GET /notifications\"],\n listOrgEventsForAuthenticatedUser: [\"GET /users/{username}/events/orgs/{org}\"],\n listPublicEvents: [\"GET /events\"],\n listPublicEventsForRepoNetwork: [\"GET /networks/{owner}/{repo}/events\"],\n listPublicEventsForUser: [\"GET /users/{username}/events/public\"],\n listPublicOrgEvents: [\"GET /orgs/{org}/events\"],\n listReceivedEventsForUser: [\"GET /users/{username}/received_events\"],\n listReceivedPublicEventsForUser: [\"GET /users/{username}/received_events/public\"],\n listRepoEvents: [\"GET /repos/{owner}/{repo}/events\"],\n listRepoNotificationsForAuthenticatedUser: [\"GET /repos/{owner}/{repo}/notifications\"],\n listReposStarredByAuthenticatedUser: [\"GET /user/starred\"],\n listReposStarredByUser: [\"GET /users/{username}/starred\"],\n listReposWatchedByUser: [\"GET /users/{username}/subscriptions\"],\n listStargazersForRepo: [\"GET /repos/{owner}/{repo}/stargazers\"],\n listWatchedReposForAuthenticatedUser: [\"GET /user/subscriptions\"],\n listWatchersForRepo: [\"GET /repos/{owner}/{repo}/subscribers\"],\n markNotificationsAsRead: [\"PUT /notifications\"],\n markRepoNotificationsAsRead: [\"PUT /repos/{owner}/{repo}/notifications\"],\n markThreadAsRead: [\"PATCH /notifications/threads/{thread_id}\"],\n setRepoSubscription: [\"PUT /repos/{owner}/{repo}/subscription\"],\n setThreadSubscription: [\"PUT /notifications/threads/{thread_id}/subscription\"],\n starRepoForAuthenticatedUser: [\"PUT /user/starred/{owner}/{repo}\"],\n unstarRepoForAuthenticatedUser: [\"DELETE /user/starred/{owner}/{repo}\"]\n },\n apps: {\n addRepoToInstallation: [\"PUT /user/installations/{installation_id}/repositories/{repository_id}\"],\n checkToken: [\"POST /applications/{client_id}/token\"],\n createContentAttachment: [\"POST /content_references/{content_reference_id}/attachments\", {\n mediaType: {\n previews: [\"corsair\"]\n }\n }],\n createFromManifest: [\"POST /app-manifests/{code}/conversions\"],\n createInstallationAccessToken: [\"POST /app/installations/{installation_id}/access_tokens\"],\n deleteAuthorization: [\"DELETE /applications/{client_id}/grant\"],\n deleteInstallation: [\"DELETE /app/installations/{installation_id}\"],\n deleteToken: [\"DELETE /applications/{client_id}/token\"],\n getAuthenticated: [\"GET /app\"],\n getBySlug: [\"GET /apps/{app_slug}\"],\n getInstallation: [\"GET /app/installations/{installation_id}\"],\n getOrgInstallation: [\"GET /orgs/{org}/installation\"],\n getRepoInstallation: [\"GET /repos/{owner}/{repo}/installation\"],\n getSubscriptionPlanForAccount: [\"GET /marketplace_listing/accounts/{account_id}\"],\n getSubscriptionPlanForAccountStubbed: [\"GET /marketplace_listing/stubbed/accounts/{account_id}\"],\n getUserInstallation: [\"GET /users/{username}/installation\"],\n getWebhookConfigForApp: [\"GET /app/hook/config\"],\n listAccountsForPlan: [\"GET /marketplace_listing/plans/{plan_id}/accounts\"],\n listAccountsForPlanStubbed: [\"GET /marketplace_listing/stubbed/plans/{plan_id}/accounts\"],\n listInstallationReposForAuthenticatedUser: [\"GET /user/installations/{installation_id}/repositories\"],\n listInstallations: [\"GET /app/installations\"],\n listInstallationsForAuthenticatedUser: [\"GET /user/installations\"],\n listPlans: [\"GET /marketplace_listing/plans\"],\n listPlansStubbed: [\"GET /marketplace_listing/stubbed/plans\"],\n listReposAccessibleToInstallation: [\"GET /installation/repositories\"],\n listSubscriptionsForAuthenticatedUser: [\"GET /user/marketplace_purchases\"],\n listSubscriptionsForAuthenticatedUserStubbed: [\"GET /user/marketplace_purchases/stubbed\"],\n removeRepoFromInstallation: [\"DELETE /user/installations/{installation_id}/repositories/{repository_id}\"],\n resetToken: [\"PATCH /applications/{client_id}/token\"],\n revokeInstallationAccessToken: [\"DELETE /installation/token\"],\n scopeToken: [\"POST /applications/{client_id}/token/scoped\"],\n suspendInstallation: [\"PUT /app/installations/{installation_id}/suspended\"],\n unsuspendInstallation: [\"DELETE /app/installations/{installation_id}/suspended\"],\n updateWebhookConfigForApp: [\"PATCH /app/hook/config\"]\n },\n billing: {\n getGithubActionsBillingOrg: [\"GET /orgs/{org}/settings/billing/actions\"],\n getGithubActionsBillingUser: [\"GET /users/{username}/settings/billing/actions\"],\n getGithubPackagesBillingOrg: [\"GET /orgs/{org}/settings/billing/packages\"],\n getGithubPackagesBillingUser: [\"GET /users/{username}/settings/billing/packages\"],\n getSharedStorageBillingOrg: [\"GET /orgs/{org}/settings/billing/shared-storage\"],\n getSharedStorageBillingUser: [\"GET /users/{username}/settings/billing/shared-storage\"]\n },\n checks: {\n create: [\"POST /repos/{owner}/{repo}/check-runs\"],\n createSuite: [\"POST /repos/{owner}/{repo}/check-suites\"],\n get: [\"GET /repos/{owner}/{repo}/check-runs/{check_run_id}\"],\n getSuite: [\"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}\"],\n listAnnotations: [\"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations\"],\n listForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/check-runs\"],\n listForSuite: [\"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs\"],\n listSuitesForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/check-suites\"],\n rerequestSuite: [\"POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest\"],\n setSuitesPreferences: [\"PATCH /repos/{owner}/{repo}/check-suites/preferences\"],\n update: [\"PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}\"]\n },\n codeScanning: {\n getAlert: [\"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\", {}, {\n renamedParameters: {\n alert_id: \"alert_number\"\n }\n }],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/code-scanning/alerts\"],\n listRecentAnalyses: [\"GET /repos/{owner}/{repo}/code-scanning/analyses\"],\n updateAlert: [\"PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\"],\n uploadSarif: [\"POST /repos/{owner}/{repo}/code-scanning/sarifs\"]\n },\n codesOfConduct: {\n getAllCodesOfConduct: [\"GET /codes_of_conduct\", {\n mediaType: {\n previews: [\"scarlet-witch\"]\n }\n }],\n getConductCode: [\"GET /codes_of_conduct/{key}\", {\n mediaType: {\n previews: [\"scarlet-witch\"]\n }\n }],\n getForRepo: [\"GET /repos/{owner}/{repo}/community/code_of_conduct\", {\n mediaType: {\n previews: [\"scarlet-witch\"]\n }\n }]\n },\n emojis: {\n get: [\"GET /emojis\"]\n },\n enterpriseAdmin: {\n disableSelectedOrganizationGithubActionsEnterprise: [\"DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id}\"],\n enableSelectedOrganizationGithubActionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}\"],\n getAllowedActionsEnterprise: [\"GET /enterprises/{enterprise}/actions/permissions/selected-actions\"],\n getGithubActionsPermissionsEnterprise: [\"GET /enterprises/{enterprise}/actions/permissions\"],\n listSelectedOrganizationsEnabledGithubActionsEnterprise: [\"GET /enterprises/{enterprise}/actions/permissions/organizations\"],\n setAllowedActionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions/selected-actions\"],\n setGithubActionsPermissionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions\"],\n setSelectedOrganizationsEnabledGithubActionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions/organizations\"]\n },\n gists: {\n checkIsStarred: [\"GET /gists/{gist_id}/star\"],\n create: [\"POST /gists\"],\n createComment: [\"POST /gists/{gist_id}/comments\"],\n delete: [\"DELETE /gists/{gist_id}\"],\n deleteComment: [\"DELETE /gists/{gist_id}/comments/{comment_id}\"],\n fork: [\"POST /gists/{gist_id}/forks\"],\n get: [\"GET /gists/{gist_id}\"],\n getComment: [\"GET /gists/{gist_id}/comments/{comment_id}\"],\n getRevision: [\"GET /gists/{gist_id}/{sha}\"],\n list: [\"GET /gists\"],\n listComments: [\"GET /gists/{gist_id}/comments\"],\n listCommits: [\"GET /gists/{gist_id}/commits\"],\n listForUser: [\"GET /users/{username}/gists\"],\n listForks: [\"GET /gists/{gist_id}/forks\"],\n listPublic: [\"GET /gists/public\"],\n listStarred: [\"GET /gists/starred\"],\n star: [\"PUT /gists/{gist_id}/star\"],\n unstar: [\"DELETE /gists/{gist_id}/star\"],\n update: [\"PATCH /gists/{gist_id}\"],\n updateComment: [\"PATCH /gists/{gist_id}/comments/{comment_id}\"]\n },\n git: {\n createBlob: [\"POST /repos/{owner}/{repo}/git/blobs\"],\n createCommit: [\"POST /repos/{owner}/{repo}/git/commits\"],\n createRef: [\"POST /repos/{owner}/{repo}/git/refs\"],\n createTag: [\"POST /repos/{owner}/{repo}/git/tags\"],\n createTree: [\"POST /repos/{owner}/{repo}/git/trees\"],\n deleteRef: [\"DELETE /repos/{owner}/{repo}/git/refs/{ref}\"],\n getBlob: [\"GET /repos/{owner}/{repo}/git/blobs/{file_sha}\"],\n getCommit: [\"GET /repos/{owner}/{repo}/git/commits/{commit_sha}\"],\n getRef: [\"GET /repos/{owner}/{repo}/git/ref/{ref}\"],\n getTag: [\"GET /repos/{owner}/{repo}/git/tags/{tag_sha}\"],\n getTree: [\"GET /repos/{owner}/{repo}/git/trees/{tree_sha}\"],\n listMatchingRefs: [\"GET /repos/{owner}/{repo}/git/matching-refs/{ref}\"],\n updateRef: [\"PATCH /repos/{owner}/{repo}/git/refs/{ref}\"]\n },\n gitignore: {\n getAllTemplates: [\"GET /gitignore/templates\"],\n getTemplate: [\"GET /gitignore/templates/{name}\"]\n },\n interactions: {\n getRestrictionsForAuthenticatedUser: [\"GET /user/interaction-limits\"],\n getRestrictionsForOrg: [\"GET /orgs/{org}/interaction-limits\"],\n getRestrictionsForRepo: [\"GET /repos/{owner}/{repo}/interaction-limits\"],\n getRestrictionsForYourPublicRepos: [\"GET /user/interaction-limits\", {}, {\n renamed: [\"interactions\", \"getRestrictionsForAuthenticatedUser\"]\n }],\n removeRestrictionsForAuthenticatedUser: [\"DELETE /user/interaction-limits\"],\n removeRestrictionsForOrg: [\"DELETE /orgs/{org}/interaction-limits\"],\n removeRestrictionsForRepo: [\"DELETE /repos/{owner}/{repo}/interaction-limits\"],\n removeRestrictionsForYourPublicRepos: [\"DELETE /user/interaction-limits\", {}, {\n renamed: [\"interactions\", \"removeRestrictionsForAuthenticatedUser\"]\n }],\n setRestrictionsForAuthenticatedUser: [\"PUT /user/interaction-limits\"],\n setRestrictionsForOrg: [\"PUT /orgs/{org}/interaction-limits\"],\n setRestrictionsForRepo: [\"PUT /repos/{owner}/{repo}/interaction-limits\"],\n setRestrictionsForYourPublicRepos: [\"PUT /user/interaction-limits\", {}, {\n renamed: [\"interactions\", \"setRestrictionsForAuthenticatedUser\"]\n }]\n },\n issues: {\n addAssignees: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/assignees\"],\n addLabels: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n checkUserCanBeAssigned: [\"GET /repos/{owner}/{repo}/assignees/{assignee}\"],\n create: [\"POST /repos/{owner}/{repo}/issues\"],\n createComment: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/comments\"],\n createLabel: [\"POST /repos/{owner}/{repo}/labels\"],\n createMilestone: [\"POST /repos/{owner}/{repo}/milestones\"],\n deleteComment: [\"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n deleteLabel: [\"DELETE /repos/{owner}/{repo}/labels/{name}\"],\n deleteMilestone: [\"DELETE /repos/{owner}/{repo}/milestones/{milestone_number}\"],\n get: [\"GET /repos/{owner}/{repo}/issues/{issue_number}\"],\n getComment: [\"GET /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n getEvent: [\"GET /repos/{owner}/{repo}/issues/events/{event_id}\"],\n getLabel: [\"GET /repos/{owner}/{repo}/labels/{name}\"],\n getMilestone: [\"GET /repos/{owner}/{repo}/milestones/{milestone_number}\"],\n list: [\"GET /issues\"],\n listAssignees: [\"GET /repos/{owner}/{repo}/assignees\"],\n listComments: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/comments\"],\n listCommentsForRepo: [\"GET /repos/{owner}/{repo}/issues/comments\"],\n listEvents: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/events\"],\n listEventsForRepo: [\"GET /repos/{owner}/{repo}/issues/events\"],\n listEventsForTimeline: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline\", {\n mediaType: {\n previews: [\"mockingbird\"]\n }\n }],\n listForAuthenticatedUser: [\"GET /user/issues\"],\n listForOrg: [\"GET /orgs/{org}/issues\"],\n listForRepo: [\"GET /repos/{owner}/{repo}/issues\"],\n listLabelsForMilestone: [\"GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels\"],\n listLabelsForRepo: [\"GET /repos/{owner}/{repo}/labels\"],\n listLabelsOnIssue: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n listMilestones: [\"GET /repos/{owner}/{repo}/milestones\"],\n lock: [\"PUT /repos/{owner}/{repo}/issues/{issue_number}/lock\"],\n removeAllLabels: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n removeAssignees: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees\"],\n removeLabel: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}\"],\n setLabels: [\"PUT /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n unlock: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock\"],\n update: [\"PATCH /repos/{owner}/{repo}/issues/{issue_number}\"],\n updateComment: [\"PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n updateLabel: [\"PATCH /repos/{owner}/{repo}/labels/{name}\"],\n updateMilestone: [\"PATCH /repos/{owner}/{repo}/milestones/{milestone_number}\"]\n },\n licenses: {\n get: [\"GET /licenses/{license}\"],\n getAllCommonlyUsed: [\"GET /licenses\"],\n getForRepo: [\"GET /repos/{owner}/{repo}/license\"]\n },\n markdown: {\n render: [\"POST /markdown\"],\n renderRaw: [\"POST /markdown/raw\", {\n headers: {\n \"content-type\": \"text/plain; charset=utf-8\"\n }\n }]\n },\n meta: {\n get: [\"GET /meta\"],\n getOctocat: [\"GET /octocat\"],\n getZen: [\"GET /zen\"],\n root: [\"GET /\"]\n },\n migrations: {\n cancelImport: [\"DELETE /repos/{owner}/{repo}/import\"],\n deleteArchiveForAuthenticatedUser: [\"DELETE /user/migrations/{migration_id}/archive\", {\n mediaType: {\n previews: [\"wyandotte\"]\n }\n }],\n deleteArchiveForOrg: [\"DELETE /orgs/{org}/migrations/{migration_id}/archive\", {\n mediaType: {\n previews: [\"wyandotte\"]\n }\n }],\n downloadArchiveForOrg: [\"GET /orgs/{org}/migrations/{migration_id}/archive\", {\n mediaType: {\n previews: [\"wyandotte\"]\n }\n }],\n getArchiveForAuthenticatedUser: [\"GET /user/migrations/{migration_id}/archive\", {\n mediaType: {\n previews: [\"wyandotte\"]\n }\n }],\n getCommitAuthors: [\"GET /repos/{owner}/{repo}/import/authors\"],\n getImportStatus: [\"GET /repos/{owner}/{repo}/import\"],\n getLargeFiles: [\"GET /repos/{owner}/{repo}/import/large_files\"],\n getStatusForAuthenticatedUser: [\"GET /user/migrations/{migration_id}\", {\n mediaType: {\n previews: [\"wyandotte\"]\n }\n }],\n getStatusForOrg: [\"GET /orgs/{org}/migrations/{migration_id}\", {\n mediaType: {\n previews: [\"wyandotte\"]\n }\n }],\n listForAuthenticatedUser: [\"GET /user/migrations\", {\n mediaType: {\n previews: [\"wyandotte\"]\n }\n }],\n listForOrg: [\"GET /orgs/{org}/migrations\", {\n mediaType: {\n previews: [\"wyandotte\"]\n }\n }],\n listReposForOrg: [\"GET /orgs/{org}/migrations/{migration_id}/repositories\", {\n mediaType: {\n previews: [\"wyandotte\"]\n }\n }],\n listReposForUser: [\"GET /user/migrations/{migration_id}/repositories\", {\n mediaType: {\n previews: [\"wyandotte\"]\n }\n }],\n mapCommitAuthor: [\"PATCH /repos/{owner}/{repo}/import/authors/{author_id}\"],\n setLfsPreference: [\"PATCH /repos/{owner}/{repo}/import/lfs\"],\n startForAuthenticatedUser: [\"POST /user/migrations\"],\n startForOrg: [\"POST /orgs/{org}/migrations\"],\n startImport: [\"PUT /repos/{owner}/{repo}/import\"],\n unlockRepoForAuthenticatedUser: [\"DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock\", {\n mediaType: {\n previews: [\"wyandotte\"]\n }\n }],\n unlockRepoForOrg: [\"DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock\", {\n mediaType: {\n previews: [\"wyandotte\"]\n }\n }],\n updateImport: [\"PATCH /repos/{owner}/{repo}/import\"]\n },\n orgs: {\n blockUser: [\"PUT /orgs/{org}/blocks/{username}\"],\n cancelInvitation: [\"DELETE /orgs/{org}/invitations/{invitation_id}\"],\n checkBlockedUser: [\"GET /orgs/{org}/blocks/{username}\"],\n checkMembershipForUser: [\"GET /orgs/{org}/members/{username}\"],\n checkPublicMembershipForUser: [\"GET /orgs/{org}/public_members/{username}\"],\n convertMemberToOutsideCollaborator: [\"PUT /orgs/{org}/outside_collaborators/{username}\"],\n createInvitation: [\"POST /orgs/{org}/invitations\"],\n createWebhook: [\"POST /orgs/{org}/hooks\"],\n deleteWebhook: [\"DELETE /orgs/{org}/hooks/{hook_id}\"],\n get: [\"GET /orgs/{org}\"],\n getMembershipForAuthenticatedUser: [\"GET /user/memberships/orgs/{org}\"],\n getMembershipForUser: [\"GET /orgs/{org}/memberships/{username}\"],\n getWebhook: [\"GET /orgs/{org}/hooks/{hook_id}\"],\n getWebhookConfigForOrg: [\"GET /orgs/{org}/hooks/{hook_id}/config\"],\n list: [\"GET /organizations\"],\n listAppInstallations: [\"GET /orgs/{org}/installations\"],\n listBlockedUsers: [\"GET /orgs/{org}/blocks\"],\n listFailedInvitations: [\"GET /orgs/{org}/failed_invitations\"],\n listForAuthenticatedUser: [\"GET /user/orgs\"],\n listForUser: [\"GET /users/{username}/orgs\"],\n listInvitationTeams: [\"GET /orgs/{org}/invitations/{invitation_id}/teams\"],\n listMembers: [\"GET /orgs/{org}/members\"],\n listMembershipsForAuthenticatedUser: [\"GET /user/memberships/orgs\"],\n listOutsideCollaborators: [\"GET /orgs/{org}/outside_collaborators\"],\n listPendingInvitations: [\"GET /orgs/{org}/invitations\"],\n listPublicMembers: [\"GET /orgs/{org}/public_members\"],\n listWebhooks: [\"GET /orgs/{org}/hooks\"],\n pingWebhook: [\"POST /orgs/{org}/hooks/{hook_id}/pings\"],\n removeMember: [\"DELETE /orgs/{org}/members/{username}\"],\n removeMembershipForUser: [\"DELETE /orgs/{org}/memberships/{username}\"],\n removeOutsideCollaborator: [\"DELETE /orgs/{org}/outside_collaborators/{username}\"],\n removePublicMembershipForAuthenticatedUser: [\"DELETE /orgs/{org}/public_members/{username}\"],\n setMembershipForUser: [\"PUT /orgs/{org}/memberships/{username}\"],\n setPublicMembershipForAuthenticatedUser: [\"PUT /orgs/{org}/public_members/{username}\"],\n unblockUser: [\"DELETE /orgs/{org}/blocks/{username}\"],\n update: [\"PATCH /orgs/{org}\"],\n updateMembershipForAuthenticatedUser: [\"PATCH /user/memberships/orgs/{org}\"],\n updateWebhook: [\"PATCH /orgs/{org}/hooks/{hook_id}\"],\n updateWebhookConfigForOrg: [\"PATCH /orgs/{org}/hooks/{hook_id}/config\"]\n },\n projects: {\n addCollaborator: [\"PUT /projects/{project_id}/collaborators/{username}\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n createCard: [\"POST /projects/columns/{column_id}/cards\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n createColumn: [\"POST /projects/{project_id}/columns\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n createForAuthenticatedUser: [\"POST /user/projects\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n createForOrg: [\"POST /orgs/{org}/projects\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n createForRepo: [\"POST /repos/{owner}/{repo}/projects\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n delete: [\"DELETE /projects/{project_id}\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n deleteCard: [\"DELETE /projects/columns/cards/{card_id}\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n deleteColumn: [\"DELETE /projects/columns/{column_id}\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n get: [\"GET /projects/{project_id}\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n getCard: [\"GET /projects/columns/cards/{card_id}\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n getColumn: [\"GET /projects/columns/{column_id}\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n getPermissionForUser: [\"GET /projects/{project_id}/collaborators/{username}/permission\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n listCards: [\"GET /projects/columns/{column_id}/cards\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n listCollaborators: [\"GET /projects/{project_id}/collaborators\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n listColumns: [\"GET /projects/{project_id}/columns\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n listForOrg: [\"GET /orgs/{org}/projects\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n listForRepo: [\"GET /repos/{owner}/{repo}/projects\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n listForUser: [\"GET /users/{username}/projects\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n moveCard: [\"POST /projects/columns/cards/{card_id}/moves\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n moveColumn: [\"POST /projects/columns/{column_id}/moves\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n removeCollaborator: [\"DELETE /projects/{project_id}/collaborators/{username}\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n update: [\"PATCH /projects/{project_id}\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n updateCard: [\"PATCH /projects/columns/cards/{card_id}\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n updateColumn: [\"PATCH /projects/columns/{column_id}\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }]\n },\n pulls: {\n checkIfMerged: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/merge\"],\n create: [\"POST /repos/{owner}/{repo}/pulls\"],\n createReplyForReviewComment: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies\"],\n createReview: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews\"],\n createReviewComment: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments\"],\n deletePendingReview: [\"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\"],\n deleteReviewComment: [\"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}\"],\n dismissReview: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals\"],\n get: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}\"],\n getReview: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\"],\n getReviewComment: [\"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}\"],\n list: [\"GET /repos/{owner}/{repo}/pulls\"],\n listCommentsForReview: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments\"],\n listCommits: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/commits\"],\n listFiles: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/files\"],\n listRequestedReviewers: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\"],\n listReviewComments: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments\"],\n listReviewCommentsForRepo: [\"GET /repos/{owner}/{repo}/pulls/comments\"],\n listReviews: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews\"],\n merge: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge\"],\n removeRequestedReviewers: [\"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\"],\n requestReviewers: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\"],\n submitReview: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events\"],\n update: [\"PATCH /repos/{owner}/{repo}/pulls/{pull_number}\"],\n updateBranch: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch\", {\n mediaType: {\n previews: [\"lydian\"]\n }\n }],\n updateReview: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\"],\n updateReviewComment: [\"PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}\"]\n },\n rateLimit: {\n get: [\"GET /rate_limit\"]\n },\n reactions: {\n createForCommitComment: [\"POST /repos/{owner}/{repo}/comments/{comment_id}/reactions\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n createForIssue: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/reactions\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n createForIssueComment: [\"POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n createForPullRequestReviewComment: [\"POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n createForTeamDiscussionCommentInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n createForTeamDiscussionInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n deleteForCommitComment: [\"DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n deleteForIssue: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n deleteForIssueComment: [\"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n deleteForPullRequestComment: [\"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n deleteForTeamDiscussion: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n deleteForTeamDiscussionComment: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n deleteLegacy: [\"DELETE /reactions/{reaction_id}\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }, {\n deprecated: \"octokit.reactions.deleteLegacy() is deprecated, see https://docs.github.com/v3/reactions/#delete-a-reaction-legacy\"\n }],\n listForCommitComment: [\"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n listForIssue: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/reactions\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n listForIssueComment: [\"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n listForPullRequestReviewComment: [\"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n listForTeamDiscussionCommentInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n listForTeamDiscussionInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }]\n },\n repos: {\n acceptInvitation: [\"PATCH /user/repository_invitations/{invitation_id}\"],\n addAppAccessRestrictions: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\", {}, {\n mapToData: \"apps\"\n }],\n addCollaborator: [\"PUT /repos/{owner}/{repo}/collaborators/{username}\"],\n addStatusCheckContexts: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\", {}, {\n mapToData: \"contexts\"\n }],\n addTeamAccessRestrictions: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\", {}, {\n mapToData: \"teams\"\n }],\n addUserAccessRestrictions: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\", {}, {\n mapToData: \"users\"\n }],\n checkCollaborator: [\"GET /repos/{owner}/{repo}/collaborators/{username}\"],\n checkVulnerabilityAlerts: [\"GET /repos/{owner}/{repo}/vulnerability-alerts\", {\n mediaType: {\n previews: [\"dorian\"]\n }\n }],\n compareCommits: [\"GET /repos/{owner}/{repo}/compare/{base}...{head}\"],\n createCommitComment: [\"POST /repos/{owner}/{repo}/commits/{commit_sha}/comments\"],\n createCommitSignatureProtection: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\", {\n mediaType: {\n previews: [\"zzzax\"]\n }\n }],\n createCommitStatus: [\"POST /repos/{owner}/{repo}/statuses/{sha}\"],\n createDeployKey: [\"POST /repos/{owner}/{repo}/keys\"],\n createDeployment: [\"POST /repos/{owner}/{repo}/deployments\"],\n createDeploymentStatus: [\"POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\"],\n createDispatchEvent: [\"POST /repos/{owner}/{repo}/dispatches\"],\n createForAuthenticatedUser: [\"POST /user/repos\"],\n createFork: [\"POST /repos/{owner}/{repo}/forks\"],\n createInOrg: [\"POST /orgs/{org}/repos\"],\n createOrUpdateFileContents: [\"PUT /repos/{owner}/{repo}/contents/{path}\"],\n createPagesSite: [\"POST /repos/{owner}/{repo}/pages\", {\n mediaType: {\n previews: [\"switcheroo\"]\n }\n }],\n createRelease: [\"POST /repos/{owner}/{repo}/releases\"],\n createUsingTemplate: [\"POST /repos/{template_owner}/{template_repo}/generate\", {\n mediaType: {\n previews: [\"baptiste\"]\n }\n }],\n createWebhook: [\"POST /repos/{owner}/{repo}/hooks\"],\n declineInvitation: [\"DELETE /user/repository_invitations/{invitation_id}\"],\n delete: [\"DELETE /repos/{owner}/{repo}\"],\n deleteAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\"],\n deleteAdminBranchProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\"],\n deleteBranchProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection\"],\n deleteCommitComment: [\"DELETE /repos/{owner}/{repo}/comments/{comment_id}\"],\n deleteCommitSignatureProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\", {\n mediaType: {\n previews: [\"zzzax\"]\n }\n }],\n deleteDeployKey: [\"DELETE /repos/{owner}/{repo}/keys/{key_id}\"],\n deleteDeployment: [\"DELETE /repos/{owner}/{repo}/deployments/{deployment_id}\"],\n deleteFile: [\"DELETE /repos/{owner}/{repo}/contents/{path}\"],\n deleteInvitation: [\"DELETE /repos/{owner}/{repo}/invitations/{invitation_id}\"],\n deletePagesSite: [\"DELETE /repos/{owner}/{repo}/pages\", {\n mediaType: {\n previews: [\"switcheroo\"]\n }\n }],\n deletePullRequestReviewProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\"],\n deleteRelease: [\"DELETE /repos/{owner}/{repo}/releases/{release_id}\"],\n deleteReleaseAsset: [\"DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n deleteWebhook: [\"DELETE /repos/{owner}/{repo}/hooks/{hook_id}\"],\n disableAutomatedSecurityFixes: [\"DELETE /repos/{owner}/{repo}/automated-security-fixes\", {\n mediaType: {\n previews: [\"london\"]\n }\n }],\n disableVulnerabilityAlerts: [\"DELETE /repos/{owner}/{repo}/vulnerability-alerts\", {\n mediaType: {\n previews: [\"dorian\"]\n }\n }],\n downloadArchive: [\"GET /repos/{owner}/{repo}/zipball/{ref}\", {}, {\n renamed: [\"repos\", \"downloadZipballArchive\"]\n }],\n downloadTarballArchive: [\"GET /repos/{owner}/{repo}/tarball/{ref}\"],\n downloadZipballArchive: [\"GET /repos/{owner}/{repo}/zipball/{ref}\"],\n enableAutomatedSecurityFixes: [\"PUT /repos/{owner}/{repo}/automated-security-fixes\", {\n mediaType: {\n previews: [\"london\"]\n }\n }],\n enableVulnerabilityAlerts: [\"PUT /repos/{owner}/{repo}/vulnerability-alerts\", {\n mediaType: {\n previews: [\"dorian\"]\n }\n }],\n get: [\"GET /repos/{owner}/{repo}\"],\n getAccessRestrictions: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\"],\n getAdminBranchProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\"],\n getAllStatusCheckContexts: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\"],\n getAllTopics: [\"GET /repos/{owner}/{repo}/topics\", {\n mediaType: {\n previews: [\"mercy\"]\n }\n }],\n getAppsWithAccessToProtectedBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\"],\n getBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}\"],\n getBranchProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection\"],\n getClones: [\"GET /repos/{owner}/{repo}/traffic/clones\"],\n getCodeFrequencyStats: [\"GET /repos/{owner}/{repo}/stats/code_frequency\"],\n getCollaboratorPermissionLevel: [\"GET /repos/{owner}/{repo}/collaborators/{username}/permission\"],\n getCombinedStatusForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/status\"],\n getCommit: [\"GET /repos/{owner}/{repo}/commits/{ref}\"],\n getCommitActivityStats: [\"GET /repos/{owner}/{repo}/stats/commit_activity\"],\n getCommitComment: [\"GET /repos/{owner}/{repo}/comments/{comment_id}\"],\n getCommitSignatureProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\", {\n mediaType: {\n previews: [\"zzzax\"]\n }\n }],\n getCommunityProfileMetrics: [\"GET /repos/{owner}/{repo}/community/profile\"],\n getContent: [\"GET /repos/{owner}/{repo}/contents/{path}\"],\n getContributorsStats: [\"GET /repos/{owner}/{repo}/stats/contributors\"],\n getDeployKey: [\"GET /repos/{owner}/{repo}/keys/{key_id}\"],\n getDeployment: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}\"],\n getDeploymentStatus: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}\"],\n getLatestPagesBuild: [\"GET /repos/{owner}/{repo}/pages/builds/latest\"],\n getLatestRelease: [\"GET /repos/{owner}/{repo}/releases/latest\"],\n getPages: [\"GET /repos/{owner}/{repo}/pages\"],\n getPagesBuild: [\"GET /repos/{owner}/{repo}/pages/builds/{build_id}\"],\n getParticipationStats: [\"GET /repos/{owner}/{repo}/stats/participation\"],\n getPullRequestReviewProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\"],\n getPunchCardStats: [\"GET /repos/{owner}/{repo}/stats/punch_card\"],\n getReadme: [\"GET /repos/{owner}/{repo}/readme\"],\n getRelease: [\"GET /repos/{owner}/{repo}/releases/{release_id}\"],\n getReleaseAsset: [\"GET /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n getReleaseByTag: [\"GET /repos/{owner}/{repo}/releases/tags/{tag}\"],\n getStatusChecksProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\"],\n getTeamsWithAccessToProtectedBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\"],\n getTopPaths: [\"GET /repos/{owner}/{repo}/traffic/popular/paths\"],\n getTopReferrers: [\"GET /repos/{owner}/{repo}/traffic/popular/referrers\"],\n getUsersWithAccessToProtectedBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\"],\n getViews: [\"GET /repos/{owner}/{repo}/traffic/views\"],\n getWebhook: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}\"],\n getWebhookConfigForRepo: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}/config\"],\n listBranches: [\"GET /repos/{owner}/{repo}/branches\"],\n listBranchesForHeadCommit: [\"GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head\", {\n mediaType: {\n previews: [\"groot\"]\n }\n }],\n listCollaborators: [\"GET /repos/{owner}/{repo}/collaborators\"],\n listCommentsForCommit: [\"GET /repos/{owner}/{repo}/commits/{commit_sha}/comments\"],\n listCommitCommentsForRepo: [\"GET /repos/{owner}/{repo}/comments\"],\n listCommitStatusesForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/statuses\"],\n listCommits: [\"GET /repos/{owner}/{repo}/commits\"],\n listContributors: [\"GET /repos/{owner}/{repo}/contributors\"],\n listDeployKeys: [\"GET /repos/{owner}/{repo}/keys\"],\n listDeploymentStatuses: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\"],\n listDeployments: [\"GET /repos/{owner}/{repo}/deployments\"],\n listForAuthenticatedUser: [\"GET /user/repos\"],\n listForOrg: [\"GET /orgs/{org}/repos\"],\n listForUser: [\"GET /users/{username}/repos\"],\n listForks: [\"GET /repos/{owner}/{repo}/forks\"],\n listInvitations: [\"GET /repos/{owner}/{repo}/invitations\"],\n listInvitationsForAuthenticatedUser: [\"GET /user/repository_invitations\"],\n listLanguages: [\"GET /repos/{owner}/{repo}/languages\"],\n listPagesBuilds: [\"GET /repos/{owner}/{repo}/pages/builds\"],\n listPublic: [\"GET /repositories\"],\n listPullRequestsAssociatedWithCommit: [\"GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls\", {\n mediaType: {\n previews: [\"groot\"]\n }\n }],\n listReleaseAssets: [\"GET /repos/{owner}/{repo}/releases/{release_id}/assets\"],\n listReleases: [\"GET /repos/{owner}/{repo}/releases\"],\n listTags: [\"GET /repos/{owner}/{repo}/tags\"],\n listTeams: [\"GET /repos/{owner}/{repo}/teams\"],\n listWebhooks: [\"GET /repos/{owner}/{repo}/hooks\"],\n merge: [\"POST /repos/{owner}/{repo}/merges\"],\n pingWebhook: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/pings\"],\n removeAppAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\", {}, {\n mapToData: \"apps\"\n }],\n removeCollaborator: [\"DELETE /repos/{owner}/{repo}/collaborators/{username}\"],\n removeStatusCheckContexts: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\", {}, {\n mapToData: \"contexts\"\n }],\n removeStatusCheckProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\"],\n removeTeamAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\", {}, {\n mapToData: \"teams\"\n }],\n removeUserAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\", {}, {\n mapToData: \"users\"\n }],\n renameBranch: [\"POST /repos/{owner}/{repo}/branches/{branch}/rename\"],\n replaceAllTopics: [\"PUT /repos/{owner}/{repo}/topics\", {\n mediaType: {\n previews: [\"mercy\"]\n }\n }],\n requestPagesBuild: [\"POST /repos/{owner}/{repo}/pages/builds\"],\n setAdminBranchProtection: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\"],\n setAppAccessRestrictions: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\", {}, {\n mapToData: \"apps\"\n }],\n setStatusCheckContexts: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\", {}, {\n mapToData: \"contexts\"\n }],\n setTeamAccessRestrictions: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\", {}, {\n mapToData: \"teams\"\n }],\n setUserAccessRestrictions: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\", {}, {\n mapToData: \"users\"\n }],\n testPushWebhook: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/tests\"],\n transfer: [\"POST /repos/{owner}/{repo}/transfer\"],\n update: [\"PATCH /repos/{owner}/{repo}\"],\n updateBranchProtection: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection\"],\n updateCommitComment: [\"PATCH /repos/{owner}/{repo}/comments/{comment_id}\"],\n updateInformationAboutPagesSite: [\"PUT /repos/{owner}/{repo}/pages\"],\n updateInvitation: [\"PATCH /repos/{owner}/{repo}/invitations/{invitation_id}\"],\n updatePullRequestReviewProtection: [\"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\"],\n updateRelease: [\"PATCH /repos/{owner}/{repo}/releases/{release_id}\"],\n updateReleaseAsset: [\"PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n updateStatusCheckPotection: [\"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\", {}, {\n renamed: [\"repos\", \"updateStatusCheckProtection\"]\n }],\n updateStatusCheckProtection: [\"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\"],\n updateWebhook: [\"PATCH /repos/{owner}/{repo}/hooks/{hook_id}\"],\n updateWebhookConfigForRepo: [\"PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config\"],\n uploadReleaseAsset: [\"POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}\", {\n baseUrl: \"https://uploads.github.com\"\n }]\n },\n search: {\n code: [\"GET /search/code\"],\n commits: [\"GET /search/commits\", {\n mediaType: {\n previews: [\"cloak\"]\n }\n }],\n issuesAndPullRequests: [\"GET /search/issues\"],\n labels: [\"GET /search/labels\"],\n repos: [\"GET /search/repositories\"],\n topics: [\"GET /search/topics\", {\n mediaType: {\n previews: [\"mercy\"]\n }\n }],\n users: [\"GET /search/users\"]\n },\n secretScanning: {\n getAlert: [\"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}\"],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/secret-scanning/alerts\"],\n updateAlert: [\"PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}\"]\n },\n teams: {\n addOrUpdateMembershipForUserInOrg: [\"PUT /orgs/{org}/teams/{team_slug}/memberships/{username}\"],\n addOrUpdateProjectPermissionsInOrg: [\"PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n addOrUpdateRepoPermissionsInOrg: [\"PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\"],\n checkPermissionsForProjectInOrg: [\"GET /orgs/{org}/teams/{team_slug}/projects/{project_id}\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n checkPermissionsForRepoInOrg: [\"GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\"],\n create: [\"POST /orgs/{org}/teams\"],\n createDiscussionCommentInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\"],\n createDiscussionInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions\"],\n deleteDiscussionCommentInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\"],\n deleteDiscussionInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\"],\n deleteInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}\"],\n getByName: [\"GET /orgs/{org}/teams/{team_slug}\"],\n getDiscussionCommentInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\"],\n getDiscussionInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\"],\n getMembershipForUserInOrg: [\"GET /orgs/{org}/teams/{team_slug}/memberships/{username}\"],\n list: [\"GET /orgs/{org}/teams\"],\n listChildInOrg: [\"GET /orgs/{org}/teams/{team_slug}/teams\"],\n listDiscussionCommentsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\"],\n listDiscussionsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions\"],\n listForAuthenticatedUser: [\"GET /user/teams\"],\n listMembersInOrg: [\"GET /orgs/{org}/teams/{team_slug}/members\"],\n listPendingInvitationsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/invitations\"],\n listProjectsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/projects\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n listReposInOrg: [\"GET /orgs/{org}/teams/{team_slug}/repos\"],\n removeMembershipForUserInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}\"],\n removeProjectInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}\"],\n removeRepoInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\"],\n updateDiscussionCommentInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\"],\n updateDiscussionInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\"],\n updateInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}\"]\n },\n users: {\n addEmailForAuthenticated: [\"POST /user/emails\"],\n block: [\"PUT /user/blocks/{username}\"],\n checkBlocked: [\"GET /user/blocks/{username}\"],\n checkFollowingForUser: [\"GET /users/{username}/following/{target_user}\"],\n checkPersonIsFollowedByAuthenticated: [\"GET /user/following/{username}\"],\n createGpgKeyForAuthenticated: [\"POST /user/gpg_keys\"],\n createPublicSshKeyForAuthenticated: [\"POST /user/keys\"],\n deleteEmailForAuthenticated: [\"DELETE /user/emails\"],\n deleteGpgKeyForAuthenticated: [\"DELETE /user/gpg_keys/{gpg_key_id}\"],\n deletePublicSshKeyForAuthenticated: [\"DELETE /user/keys/{key_id}\"],\n follow: [\"PUT /user/following/{username}\"],\n getAuthenticated: [\"GET /user\"],\n getByUsername: [\"GET /users/{username}\"],\n getContextForUser: [\"GET /users/{username}/hovercard\"],\n getGpgKeyForAuthenticated: [\"GET /user/gpg_keys/{gpg_key_id}\"],\n getPublicSshKeyForAuthenticated: [\"GET /user/keys/{key_id}\"],\n list: [\"GET /users\"],\n listBlockedByAuthenticated: [\"GET /user/blocks\"],\n listEmailsForAuthenticated: [\"GET /user/emails\"],\n listFollowedByAuthenticated: [\"GET /user/following\"],\n listFollowersForAuthenticatedUser: [\"GET /user/followers\"],\n listFollowersForUser: [\"GET /users/{username}/followers\"],\n listFollowingForUser: [\"GET /users/{username}/following\"],\n listGpgKeysForAuthenticated: [\"GET /user/gpg_keys\"],\n listGpgKeysForUser: [\"GET /users/{username}/gpg_keys\"],\n listPublicEmailsForAuthenticated: [\"GET /user/public_emails\"],\n listPublicKeysForUser: [\"GET /users/{username}/keys\"],\n listPublicSshKeysForAuthenticated: [\"GET /user/keys\"],\n setPrimaryEmailVisibilityForAuthenticated: [\"PATCH /user/email/visibility\"],\n unblock: [\"DELETE /user/blocks/{username}\"],\n unfollow: [\"DELETE /user/following/{username}\"],\n updateAuthenticated: [\"PATCH /user\"]\n }\n};\n\nconst VERSION = \"4.10.1\";\n\nfunction endpointsToMethods(octokit, endpointsMap) {\n const newMethods = {};\n\n for (const [scope, endpoints] of Object.entries(endpointsMap)) {\n for (const [methodName, endpoint] of Object.entries(endpoints)) {\n const [route, defaults, decorations] = endpoint;\n const [method, url] = route.split(/ /);\n const endpointDefaults = Object.assign({\n method,\n url\n }, defaults);\n\n if (!newMethods[scope]) {\n newMethods[scope] = {};\n }\n\n const scopeMethods = newMethods[scope];\n\n if (decorations) {\n scopeMethods[methodName] = decorate(octokit, scope, methodName, endpointDefaults, decorations);\n continue;\n }\n\n scopeMethods[methodName] = octokit.request.defaults(endpointDefaults);\n }\n }\n\n return newMethods;\n}\n\nfunction decorate(octokit, scope, methodName, defaults, decorations) {\n const requestWithDefaults = octokit.request.defaults(defaults);\n /* istanbul ignore next */\n\n function withDecorations(...args) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n let options = requestWithDefaults.endpoint.merge(...args); // There are currently no other decorations than `.mapToData`\n\n if (decorations.mapToData) {\n options = Object.assign({}, options, {\n data: options[decorations.mapToData],\n [decorations.mapToData]: undefined\n });\n return requestWithDefaults(options);\n }\n\n if (decorations.renamed) {\n const [newScope, newMethodName] = decorations.renamed;\n octokit.log.warn(`octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`);\n }\n\n if (decorations.deprecated) {\n octokit.log.warn(decorations.deprecated);\n }\n\n if (decorations.renamedParameters) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n const options = requestWithDefaults.endpoint.merge(...args);\n\n for (const [name, alias] of Object.entries(decorations.renamedParameters)) {\n if (name in options) {\n octokit.log.warn(`\"${name}\" parameter is deprecated for \"octokit.${scope}.${methodName}()\". Use \"${alias}\" instead`);\n\n if (!(alias in options)) {\n options[alias] = options[name];\n }\n\n delete options[name];\n }\n }\n\n return requestWithDefaults(options);\n } // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n\n\n return requestWithDefaults(...args);\n }\n\n return Object.assign(withDecorations, requestWithDefaults);\n}\n\n/**\n * This plugin is a 1:1 copy of internal @octokit/rest plugins. The primary\n * goal is to rebuild @octokit/rest on top of @octokit/core. Once that is\n * done, we will remove the registerEndpoints methods and return the methods\n * directly as with the other plugins. At that point we will also remove the\n * legacy workarounds and deprecations.\n *\n * See the plan at\n * https://github.com/octokit/plugin-rest-endpoint-methods.js/pull/1\n */\n\nfunction restEndpointMethods(octokit) {\n return endpointsToMethods(octokit, Endpoints);\n}\nrestEndpointMethods.VERSION = VERSION;\n\nexports.restEndpointMethods = restEndpointMethods;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar deprecation = require('deprecation');\nvar once = _interopDefault(require('once'));\n\nconst logOnce = once(deprecation => console.warn(deprecation));\n/**\n * Error with extra properties to help with debugging\n */\n\nclass RequestError extends Error {\n constructor(message, statusCode, options) {\n super(message); // Maintains proper stack trace (only available on V8)\n\n /* istanbul ignore next */\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = \"HttpError\";\n this.status = statusCode;\n Object.defineProperty(this, \"code\", {\n get() {\n logOnce(new deprecation.Deprecation(\"[@octokit/request-error] `error.code` is deprecated, use `error.status`.\"));\n return statusCode;\n }\n\n });\n this.headers = options.headers || {}; // redact request credentials without mutating original request options\n\n const requestCopy = Object.assign({}, options.request);\n\n if (options.request.headers.authorization) {\n requestCopy.headers = Object.assign({}, options.request.headers, {\n authorization: options.request.headers.authorization.replace(/ .*$/, \" [REDACTED]\")\n });\n }\n\n requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit\n // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications\n .replace(/\\bclient_secret=\\w+/g, \"client_secret=[REDACTED]\") // OAuth tokens can be passed as URL query parameters, although it is not recommended\n // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header\n .replace(/\\baccess_token=\\w+/g, \"access_token=[REDACTED]\");\n this.request = requestCopy;\n }\n\n}\n\nexports.RequestError = RequestError;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar endpoint = require('@octokit/endpoint');\nvar universalUserAgent = require('universal-user-agent');\nvar isPlainObject = require('is-plain-object');\nvar nodeFetch = _interopDefault(require('node-fetch'));\nvar requestError = require('@octokit/request-error');\n\nconst VERSION = \"5.4.14\";\n\nfunction getBufferResponse(response) {\n return response.arrayBuffer();\n}\n\nfunction fetchWrapper(requestOptions) {\n if (isPlainObject.isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {\n requestOptions.body = JSON.stringify(requestOptions.body);\n }\n\n let headers = {};\n let status;\n let url;\n const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;\n return fetch(requestOptions.url, Object.assign({\n method: requestOptions.method,\n body: requestOptions.body,\n headers: requestOptions.headers,\n redirect: requestOptions.redirect\n }, requestOptions.request)).then(response => {\n url = response.url;\n status = response.status;\n\n for (const keyAndValue of response.headers) {\n headers[keyAndValue[0]] = keyAndValue[1];\n }\n\n if (status === 204 || status === 205) {\n return;\n } // GitHub API returns 200 for HEAD requests\n\n\n if (requestOptions.method === \"HEAD\") {\n if (status < 400) {\n return;\n }\n\n throw new requestError.RequestError(response.statusText, status, {\n headers,\n request: requestOptions\n });\n }\n\n if (status === 304) {\n throw new requestError.RequestError(\"Not modified\", status, {\n headers,\n request: requestOptions\n });\n }\n\n if (status >= 400) {\n return response.text().then(message => {\n const error = new requestError.RequestError(message, status, {\n headers,\n request: requestOptions\n });\n\n try {\n let responseBody = JSON.parse(error.message);\n Object.assign(error, responseBody);\n let errors = responseBody.errors; // Assumption `errors` would always be in Array format\n\n error.message = error.message + \": \" + errors.map(JSON.stringify).join(\", \");\n } catch (e) {// ignore, see octokit/rest.js#684\n }\n\n throw error;\n });\n }\n\n const contentType = response.headers.get(\"content-type\");\n\n if (/application\\/json/.test(contentType)) {\n return response.json();\n }\n\n if (!contentType || /^text\\/|charset=utf-8$/.test(contentType)) {\n return response.text();\n }\n\n return getBufferResponse(response);\n }).then(data => {\n return {\n status,\n url,\n headers,\n data\n };\n }).catch(error => {\n if (error instanceof requestError.RequestError) {\n throw error;\n }\n\n throw new requestError.RequestError(error.message, 500, {\n headers,\n request: requestOptions\n });\n });\n}\n\nfunction withDefaults(oldEndpoint, newDefaults) {\n const endpoint = oldEndpoint.defaults(newDefaults);\n\n const newApi = function (route, parameters) {\n const endpointOptions = endpoint.merge(route, parameters);\n\n if (!endpointOptions.request || !endpointOptions.request.hook) {\n return fetchWrapper(endpoint.parse(endpointOptions));\n }\n\n const request = (route, parameters) => {\n return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));\n };\n\n Object.assign(request, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint)\n });\n return endpointOptions.request.hook(request, endpointOptions);\n };\n\n return Object.assign(newApi, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint)\n });\n}\n\nconst request = withDefaults(endpoint.endpoint, {\n headers: {\n \"user-agent\": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`\n }\n});\n\nexports.request = request;\n//# sourceMappingURL=index.js.map\n","var register = require('./lib/register')\nvar addHook = require('./lib/add')\nvar removeHook = require('./lib/remove')\n\n// bind with array of arguments: https://stackoverflow.com/a/21792913\nvar bind = Function.bind\nvar bindable = bind.bind(bind)\n\nfunction bindApi (hook, state, name) {\n var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])\n hook.api = { remove: removeHookRef }\n hook.remove = removeHookRef\n\n ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {\n var args = name ? [state, kind, name] : [state, kind]\n hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)\n })\n}\n\nfunction HookSingular () {\n var singularHookName = 'h'\n var singularHookState = {\n registry: {}\n }\n var singularHook = register.bind(null, singularHookState, singularHookName)\n bindApi(singularHook, singularHookState, singularHookName)\n return singularHook\n}\n\nfunction HookCollection () {\n var state = {\n registry: {}\n }\n\n var hook = register.bind(null, state)\n bindApi(hook, state)\n\n return hook\n}\n\nvar collectionHookDeprecationMessageDisplayed = false\nfunction Hook () {\n if (!collectionHookDeprecationMessageDisplayed) {\n console.warn('[before-after-hook]: \"Hook()\" repurposing warning, use \"Hook.Collection()\". Read more: https://git.io/upgrade-before-after-hook-to-1.4')\n collectionHookDeprecationMessageDisplayed = true\n }\n return HookCollection()\n}\n\nHook.Singular = HookSingular.bind()\nHook.Collection = HookCollection.bind()\n\nmodule.exports = Hook\n// expose constructors as a named property for TypeScript\nmodule.exports.Hook = Hook\nmodule.exports.Singular = Hook.Singular\nmodule.exports.Collection = Hook.Collection\n","module.exports = addHook;\n\nfunction addHook(state, kind, name, hook) {\n var orig = hook;\n if (!state.registry[name]) {\n state.registry[name] = [];\n }\n\n if (kind === \"before\") {\n hook = function (method, options) {\n return Promise.resolve()\n .then(orig.bind(null, options))\n .then(method.bind(null, options));\n };\n }\n\n if (kind === \"after\") {\n hook = function (method, options) {\n var result;\n return Promise.resolve()\n .then(method.bind(null, options))\n .then(function (result_) {\n result = result_;\n return orig(result, options);\n })\n .then(function () {\n return result;\n });\n };\n }\n\n if (kind === \"error\") {\n hook = function (method, options) {\n return Promise.resolve()\n .then(method.bind(null, options))\n .catch(function (error) {\n return orig(error, options);\n });\n };\n }\n\n state.registry[name].push({\n hook: hook,\n orig: orig,\n });\n}\n","module.exports = register;\n\nfunction register(state, name, method, options) {\n if (typeof method !== \"function\") {\n throw new Error(\"method for before hook must be a function\");\n }\n\n if (!options) {\n options = {};\n }\n\n if (Array.isArray(name)) {\n return name.reverse().reduce(function (callback, name) {\n return register.bind(null, state, name, callback, options);\n }, method)();\n }\n\n return Promise.resolve().then(function () {\n if (!state.registry[name]) {\n return method(options);\n }\n\n return state.registry[name].reduce(function (method, registered) {\n return registered.hook.bind(null, method, options);\n }, method)();\n });\n}\n","module.exports = removeHook;\n\nfunction removeHook(state, name, method) {\n if (!state.registry[name]) {\n return;\n }\n\n var index = state.registry[name]\n .map(function (registered) {\n return registered.orig;\n })\n .indexOf(method);\n\n if (index === -1) {\n return;\n }\n\n state.registry[name].splice(index, 1);\n}\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nclass Deprecation extends Error {\n constructor(message) {\n super(message); // Maintains proper stack trace (only available on V8)\n\n /* istanbul ignore next */\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = 'Deprecation';\n }\n\n}\n\nexports.Deprecation = Deprecation;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.rotate = exports.intersperse = exports.prependToAll = exports.unzip = exports.zip = exports.zipWith = exports.sort = exports.lefts = exports.rights = exports.reverse = exports.modifyAt = exports.deleteAt = exports.updateAt = exports.insertAt = exports.copy = exports.findLastIndex = exports.findLastMap = exports.findLast = exports.findFirstMap = exports.findFirst = exports.findIndex = exports.dropLeftWhile = exports.dropRight = exports.dropLeft = exports.spanLeft = exports.takeLeftWhile = exports.takeRight = exports.takeLeft = exports.init = exports.tail = exports.last = exports.head = exports.snoc = exports.cons = exports.lookup = exports.isOutOfBound = exports.isNonEmpty = exports.isEmpty = exports.scanRight = exports.scanLeft = exports.foldRight = exports.foldLeft = exports.flatten = exports.replicate = exports.range = exports.makeBy = exports.getOrd = exports.getEq = exports.getMonoid = exports.getShow = void 0;\nexports.Applicative = exports.FunctorWithIndex = exports.Functor = exports.URI = exports.zero = exports.unfold = exports.wilt = exports.wither = exports.traverseWithIndex = exports.sequence = exports.traverse = exports.reduceRightWithIndex = exports.reduceRight = exports.reduceWithIndex = exports.reduce = exports.foldMapWithIndex = exports.foldMap = exports.duplicate = exports.extend = exports.filterWithIndex = exports.filterMapWithIndex = exports.alt = exports.altW = exports.partitionMapWithIndex = exports.partitionMap = exports.partitionWithIndex = exports.partition = exports.filterMap = exports.filter = exports.separate = exports.compact = exports.mapWithIndex = exports.chainFirst = exports.chainWithIndex = exports.chain = exports.apSecond = exports.apFirst = exports.ap = exports.map = exports.of = exports.difference = exports.intersection = exports.union = exports.comprehension = exports.chunksOf = exports.splitAt = exports.chop = exports.sortBy = exports.uniq = exports.elem = void 0;\nexports.apS = exports.bind = exports.bindTo = exports.Do = exports.some = exports.every = exports.empty = exports.unsafeDeleteAt = exports.unsafeUpdateAt = exports.unsafeInsertAt = exports.array = exports.Witherable = exports.TraversableWithIndex = exports.Traversable = exports.FoldableWithIndex = exports.Foldable = exports.FilterableWithIndex = exports.Filterable = exports.Compactable = exports.Extend = exports.Alternative = exports.Alt = exports.Unfoldable = exports.Monad = void 0;\nvar RA = __importStar(require(\"./ReadonlyArray\"));\n// -------------------------------------------------------------------------------------\n// model\n// -------------------------------------------------------------------------------------\n/* tslint:disable:readonly-array */\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.getShow = RA.getShow;\n/**\n * Returns a `Monoid` for `Array
`\n *\n * @example\n * import { getMonoid } from 'fp-ts/Array'\n *\n * const M = getMonoid()\n * assert.deepStrictEqual(M.concat([1, 2], [3, 4]), [1, 2, 3, 4])\n *\n * @category instances\n * @since 2.0.0\n */\nexports.getMonoid = RA.getMonoid;\n/**\n * Derives an `Eq` over the `Array` of a given element type from the `Eq` of that type. The derived `Eq` defines two\n * arrays as equal if all elements of both arrays are compared equal pairwise with the given `E`. In case of arrays of\n * different lengths, the result is non equality.\n *\n * @example\n * import { eqString } from 'fp-ts/Eq'\n * import { getEq } from 'fp-ts/Array'\n *\n * const E = getEq(eqString)\n * assert.strictEqual(E.equals(['a', 'b'], ['a', 'b']), true)\n * assert.strictEqual(E.equals(['a'], []), false)\n *\n * @category instances\n * @since 2.0.0\n */\nexports.getEq = RA.getEq;\n/**\n * Derives an `Ord` over the `Array` of a given element type from the `Ord` of that type. The ordering between two such\n * arrays is equal to: the first non equal comparison of each arrays elements taken pairwise in increasing order, in\n * case of equality over all the pairwise elements; the longest array is considered the greatest, if both arrays have\n * the same length, the result is equality.\n *\n * @example\n * import { getOrd } from 'fp-ts/Array'\n * import { ordString } from 'fp-ts/Ord'\n *\n * const O = getOrd(ordString)\n * assert.strictEqual(O.compare(['b'], ['a']), 1)\n * assert.strictEqual(O.compare(['a'], ['a']), 0)\n * assert.strictEqual(O.compare(['a'], ['b']), -1)\n *\n * @category instances\n * @since 2.0.0\n */\nexports.getOrd = RA.getOrd;\n// -------------------------------------------------------------------------------------\n// constructors\n// -------------------------------------------------------------------------------------\n/**\n * Return a list of length `n` with element `i` initialized with `f(i)`\n *\n * @example\n * import { makeBy } from 'fp-ts/Array'\n *\n * const double = (n: number): number => n * 2\n * assert.deepStrictEqual(makeBy(5, double), [0, 2, 4, 6, 8])\n *\n * @category constructors\n * @since 2.0.0\n */\nexports.makeBy = RA.makeBy;\n/**\n * Create an array containing a range of integers, including both endpoints\n *\n * @example\n * import { range } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(range(1, 5), [1, 2, 3, 4, 5])\n *\n * @category constructors\n * @since 2.0.0\n */\nexports.range = RA.range;\n/**\n * Create an array containing a value repeated the specified number of times\n *\n * @example\n * import { replicate } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(replicate(3, 'a'), ['a', 'a', 'a'])\n *\n * @category constructors\n * @since 2.0.0\n */\nexports.replicate = RA.replicate;\n/**\n * Removes one level of nesting.\n *\n * Derivable from `Monad`.\n *\n * @example\n * import { flatten } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(flatten([[1], [2], [3]]), [1, 2, 3])\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.flatten = RA.flatten;\n/**\n * Break an array into its first element and remaining elements\n *\n * @example\n * import { foldLeft } from 'fp-ts/Array'\n *\n * const len: (as: Array) => number = foldLeft(() => 0, (_, tail) => 1 + len(tail))\n * assert.strictEqual(len([1, 2, 3]), 3)\n *\n * @category destructors\n * @since 2.0.0\n */\nexports.foldLeft = RA.foldLeft;\n/**\n * Break an array into its initial elements and the last element\n *\n * @category destructors\n * @since 2.0.0\n */\nexports.foldRight = RA.foldRight;\n/**\n * Same as `reduce` but it carries over the intermediate steps\n *\n * @example\n * import { scanLeft } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(scanLeft(10, (b, a: number) => b - a)([1, 2, 3]), [10, 9, 7, 4])\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.scanLeft = RA.scanLeft;\n/**\n * Fold an array from the right, keeping all intermediate results instead of only the final result\n *\n * @example\n * import { scanRight } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(scanRight(10, (a: number, b) => b - a)([1, 2, 3]), [4, 5, 7, 10])\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.scanRight = RA.scanRight;\n/**\n * Test whether an array is empty\n *\n * @example\n * import { isEmpty } from 'fp-ts/Array'\n *\n * assert.strictEqual(isEmpty([]), true)\n *\n * @since 2.0.0\n */\nexports.isEmpty = RA.isEmpty;\n/**\n * Test whether an array is non empty narrowing down the type to `NonEmptyArray`\n *\n * @category guards\n * @since 2.0.0\n */\nexports.isNonEmpty = RA.isNonEmpty;\n/**\n * Test whether an array contains a particular index\n *\n * @since 2.0.0\n */\nexports.isOutOfBound = RA.isOutOfBound;\n// TODO: remove non-curried overloading in v3\n/**\n * This function provides a safe way to read a value at a particular index from an array\n *\n * @example\n * import { lookup } from 'fp-ts/Array'\n * import { some, none } from 'fp-ts/Option'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe([1, 2, 3], lookup(1)), some(2))\n * assert.deepStrictEqual(pipe([1, 2, 3], lookup(3)), none)\n *\n * @since 2.0.0\n */\nexports.lookup = RA.lookup;\n// TODO: remove non-curried overloading in v3\n/**\n * Attaches an element to the front of an array, creating a new non empty array\n *\n * @example\n * import { cons } from 'fp-ts/Array'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe([1, 2, 3], cons(0)), [0, 1, 2, 3])\n *\n * @category constructors\n * @since 2.0.0\n */\nexports.cons = RA.cons;\n// TODO: curry in v3\n/**\n * Append an element to the end of an array, creating a new non empty array\n *\n * @example\n * import { snoc } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(snoc([1, 2, 3], 4), [1, 2, 3, 4])\n *\n * @category constructors\n * @since 2.0.0\n */\nexports.snoc = RA.snoc;\n/**\n * Get the first element in an array, or `None` if the array is empty\n *\n * @example\n * import { head } from 'fp-ts/Array'\n * import { some, none } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(head([1, 2, 3]), some(1))\n * assert.deepStrictEqual(head([]), none)\n *\n * @category destructors\n * @since 2.0.0\n */\nexports.head = RA.head;\n/**\n * Get the last element in an array, or `None` if the array is empty\n *\n * @example\n * import { last } from 'fp-ts/Array'\n * import { some, none } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(last([1, 2, 3]), some(3))\n * assert.deepStrictEqual(last([]), none)\n *\n * @category destructors\n * @since 2.0.0\n */\nexports.last = RA.last;\n/**\n * Get all but the first element of an array, creating a new array, or `None` if the array is empty\n *\n * @example\n * import { tail } from 'fp-ts/Array'\n * import { some, none } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(tail([1, 2, 3]), some([2, 3]))\n * assert.deepStrictEqual(tail([]), none)\n *\n * @category destructors\n * @since 2.0.0\n */\nexports.tail = RA.tail;\n/**\n * Get all but the last element of an array, creating a new array, or `None` if the array is empty\n *\n * @example\n * import { init } from 'fp-ts/Array'\n * import { some, none } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(init([1, 2, 3]), some([1, 2]))\n * assert.deepStrictEqual(init([]), none)\n *\n * @category destructors\n * @since 2.0.0\n */\nexports.init = RA.init;\n/**\n * Keep only a number of elements from the start of an array, creating a new array.\n * `n` must be a natural number\n *\n * @example\n * import { takeLeft } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(takeLeft(2)([1, 2, 3]), [1, 2])\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.takeLeft = RA.takeLeft;\n/**\n * Keep only a number of elements from the end of an array, creating a new array.\n * `n` must be a natural number\n *\n * @example\n * import { takeRight } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(takeRight(2)([1, 2, 3, 4, 5]), [4, 5])\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.takeRight = RA.takeRight;\nfunction takeLeftWhile(predicate) {\n return RA.takeLeftWhile(predicate);\n}\nexports.takeLeftWhile = takeLeftWhile;\nfunction spanLeft(predicate) {\n return RA.spanLeft(predicate);\n}\nexports.spanLeft = spanLeft;\n/* tslint:enable:readonly-keyword */\n/**\n * Drop a number of elements from the start of an array, creating a new array\n *\n * @example\n * import { dropLeft } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(dropLeft(2)([1, 2, 3]), [3])\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.dropLeft = RA.dropLeft;\n/**\n * Drop a number of elements from the end of an array, creating a new array\n *\n * @example\n * import { dropRight } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(dropRight(2)([1, 2, 3, 4, 5]), [1, 2, 3])\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.dropRight = RA.dropRight;\n/**\n * Remove the longest initial subarray for which all element satisfy the specified predicate, creating a new array\n *\n * @example\n * import { dropLeftWhile } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(dropLeftWhile((n: number) => n % 2 === 1)([1, 3, 2, 4, 5]), [2, 4, 5])\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.dropLeftWhile = RA.dropLeftWhile;\n/**\n * Find the first index for which a predicate holds\n *\n * @example\n * import { findIndex } from 'fp-ts/Array'\n * import { some, none } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(findIndex((n: number) => n === 2)([1, 2, 3]), some(1))\n * assert.deepStrictEqual(findIndex((n: number) => n === 2)([]), none)\n *\n * @since 2.0.0\n */\nexports.findIndex = RA.findIndex;\nfunction findFirst(predicate) {\n return RA.findFirst(predicate);\n}\nexports.findFirst = findFirst;\n/**\n * Find the first element returned by an option based selector function\n *\n * @example\n * import { findFirstMap } from 'fp-ts/Array'\n * import { some, none } from 'fp-ts/Option'\n *\n * interface Person {\n * name: string\n * age?: number\n * }\n *\n * const persons: Array = [{ name: 'John' }, { name: 'Mary', age: 45 }, { name: 'Joey', age: 28 }]\n *\n * // returns the name of the first person that has an age\n * assert.deepStrictEqual(findFirstMap((p: Person) => (p.age === undefined ? none : some(p.name)))(persons), some('Mary'))\n *\n * @category destructors\n * @since 2.0.0\n */\nexports.findFirstMap = RA.findFirstMap;\nfunction findLast(predicate) {\n return RA.findLast(predicate);\n}\nexports.findLast = findLast;\n/**\n * Find the last element returned by an option based selector function\n *\n * @example\n * import { findLastMap } from 'fp-ts/Array'\n * import { some, none } from 'fp-ts/Option'\n *\n * interface Person {\n * name: string\n * age?: number\n * }\n *\n * const persons: Array = [{ name: 'John' }, { name: 'Mary', age: 45 }, { name: 'Joey', age: 28 }]\n *\n * // returns the name of the last person that has an age\n * assert.deepStrictEqual(findLastMap((p: Person) => (p.age === undefined ? none : some(p.name)))(persons), some('Joey'))\n *\n * @category destructors\n * @since 2.0.0\n */\nexports.findLastMap = RA.findLastMap;\n/**\n * Returns the index of the last element of the list which matches the predicate\n *\n * @example\n * import { findLastIndex } from 'fp-ts/Array'\n * import { some, none } from 'fp-ts/Option'\n *\n * interface X {\n * a: number\n * b: number\n * }\n * const xs: Array = [{ a: 1, b: 0 }, { a: 1, b: 1 }]\n * assert.deepStrictEqual(findLastIndex((x: { a: number }) => x.a === 1)(xs), some(1))\n * assert.deepStrictEqual(findLastIndex((x: { a: number }) => x.a === 4)(xs), none)\n *\n *\n * @since 2.0.0\n */\nexports.findLastIndex = RA.findLastIndex;\n/**\n * @category combinators\n * @since 2.0.0\n */\nexports.copy = RA.toArray;\n/**\n * Insert an element at the specified index, creating a new array, or returning `None` if the index is out of bounds\n *\n * @example\n * import { insertAt } from 'fp-ts/Array'\n * import { some } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(insertAt(2, 5)([1, 2, 3, 4]), some([1, 2, 5, 3, 4]))\n *\n * @since 2.0.0\n */\nexports.insertAt = RA.insertAt;\n/**\n * Change the element at the specified index, creating a new array, or returning `None` if the index is out of bounds\n *\n * @example\n * import { updateAt } from 'fp-ts/Array'\n * import { some, none } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(updateAt(1, 1)([1, 2, 3]), some([1, 1, 3]))\n * assert.deepStrictEqual(updateAt(1, 1)([]), none)\n *\n * @since 2.0.0\n */\nexports.updateAt = RA.updateAt;\n/**\n * Delete the element at the specified index, creating a new array, or returning `None` if the index is out of bounds\n *\n * @example\n * import { deleteAt } from 'fp-ts/Array'\n * import { some, none } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(deleteAt(0)([1, 2, 3]), some([2, 3]))\n * assert.deepStrictEqual(deleteAt(1)([]), none)\n *\n * @since 2.0.0\n */\nexports.deleteAt = RA.deleteAt;\n/**\n * Apply a function to the element at the specified index, creating a new array, or returning `None` if the index is out\n * of bounds\n *\n * @example\n * import { modifyAt } from 'fp-ts/Array'\n * import { some, none } from 'fp-ts/Option'\n *\n * const double = (x: number): number => x * 2\n * assert.deepStrictEqual(modifyAt(1, double)([1, 2, 3]), some([1, 4, 3]))\n * assert.deepStrictEqual(modifyAt(1, double)([]), none)\n *\n * @since 2.0.0\n */\nexports.modifyAt = RA.modifyAt;\n/**\n * Reverse an array, creating a new array\n *\n * @example\n * import { reverse } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(reverse([1, 2, 3]), [3, 2, 1])\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.reverse = RA.reverse;\n/**\n * Extracts from an array of `Either` all the `Right` elements. All the `Right` elements are extracted in order\n *\n * @example\n * import { rights } from 'fp-ts/Array'\n * import { right, left } from 'fp-ts/Either'\n *\n * assert.deepStrictEqual(rights([right(1), left('foo'), right(2)]), [1, 2])\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.rights = RA.rights;\n/**\n * Extracts from an array of `Either` all the `Left` elements. All the `Left` elements are extracted in order\n *\n * @example\n * import { lefts } from 'fp-ts/Array'\n * import { left, right } from 'fp-ts/Either'\n *\n * assert.deepStrictEqual(lefts([right(1), left('foo'), right(2)]), ['foo'])\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.lefts = RA.lefts;\n/**\n * Sort the elements of an array in increasing order, creating a new array\n *\n * @example\n * import { sort } from 'fp-ts/Array'\n * import { ordNumber } from 'fp-ts/Ord'\n *\n * assert.deepStrictEqual(sort(ordNumber)([3, 2, 1]), [1, 2, 3])\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.sort = RA.sort;\n/**\n * Apply a function to pairs of elements at the same index in two arrays, collecting the results in a new array. If one\n * input array is short, excess elements of the longer array are discarded.\n *\n * @example\n * import { zipWith } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(zipWith([1, 2, 3], ['a', 'b', 'c', 'd'], (n, s) => s + n), ['a1', 'b2', 'c3'])\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.zipWith = RA.zipWith;\n// TODO: remove non-curried overloading in v3\n/**\n * Takes two arrays and returns an array of corresponding pairs. If one input array is short, excess elements of the\n * longer array are discarded\n *\n * @example\n * import { zip } from 'fp-ts/Array'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe([1, 2, 3], zip(['a', 'b', 'c', 'd'])), [[1, 'a'], [2, 'b'], [3, 'c']])\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.zip = RA.zip;\n/**\n * The function is reverse of `zip`. Takes an array of pairs and return two corresponding arrays\n *\n * @example\n * import { unzip } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(unzip([[1, 'a'], [2, 'b'], [3, 'c']]), [[1, 2, 3], ['a', 'b', 'c']])\n *\n * @since 2.0.0\n */\nexports.unzip = RA.unzip;\n/**\n * Prepend an element to every member of an array\n *\n * @example\n * import { prependToAll } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(prependToAll(9)([1, 2, 3, 4]), [9, 1, 9, 2, 9, 3, 9, 4])\n *\n * @category combinators\n * @since 2.9.0\n */\nexports.prependToAll = RA.prependToAll;\n/**\n * Places an element in between members of an array\n *\n * @example\n * import { intersperse } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(intersperse(9)([1, 2, 3, 4]), [1, 9, 2, 9, 3, 9, 4])\n *\n * @category combinators\n * @since 2.9.0\n */\nexports.intersperse = RA.intersperse;\n/**\n * Rotate an array to the right by `n` steps\n *\n * @example\n * import { rotate } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(rotate(2)([1, 2, 3, 4, 5]), [4, 5, 1, 2, 3])\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.rotate = RA.rotate;\n// TODO: remove non-curried overloading in v3\n/**\n * Test if a value is a member of an array. Takes a `Eq` as a single\n * argument which returns the function to use to search for a value of type `A` in\n * an array of type `Array`.\n *\n * @example\n * import { elem } from 'fp-ts/Array'\n * import { eqNumber } from 'fp-ts/Eq'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.strictEqual(pipe([1, 2, 3], elem(eqNumber)(2)), true)\n * assert.strictEqual(pipe([1, 2, 3], elem(eqNumber)(0)), false)\n *\n * @since 2.0.0\n */\nexports.elem = RA.elem;\n/**\n * Remove duplicates from an array, keeping the first occurrence of an element.\n *\n * @example\n * import { uniq } from 'fp-ts/Array'\n * import { eqNumber } from 'fp-ts/Eq'\n *\n * assert.deepStrictEqual(uniq(eqNumber)([1, 2, 1]), [1, 2])\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.uniq = RA.uniq;\n/**\n * Sort the elements of an array in increasing order, where elements are compared using first `ords[0]`, then `ords[1]`,\n * etc...\n *\n * @example\n * import { sortBy } from 'fp-ts/Array'\n * import { ord, ordString, ordNumber } from 'fp-ts/Ord'\n *\n * interface Person {\n * name: string\n * age: number\n * }\n * const byName = ord.contramap(ordString, (p: Person) => p.name)\n * const byAge = ord.contramap(ordNumber, (p: Person) => p.age)\n *\n * const sortByNameByAge = sortBy([byName, byAge])\n *\n * const persons = [{ name: 'a', age: 1 }, { name: 'b', age: 3 }, { name: 'c', age: 2 }, { name: 'b', age: 2 }]\n * assert.deepStrictEqual(sortByNameByAge(persons), [\n * { name: 'a', age: 1 },\n * { name: 'b', age: 2 },\n * { name: 'b', age: 3 },\n * { name: 'c', age: 2 }\n * ])\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.sortBy = RA.sortBy;\n/**\n * A useful recursion pattern for processing an array to produce a new array, often used for \"chopping\" up the input\n * array. Typically chop is called with some function that will consume an initial prefix of the array and produce a\n * value and the rest of the array.\n *\n * @example\n * import { Eq, eqNumber } from 'fp-ts/Eq'\n * import { chop, spanLeft } from 'fp-ts/Array'\n *\n * const group = (S: Eq): ((as: Array) => Array>) => {\n * return chop(as => {\n * const { init, rest } = spanLeft((a: A) => S.equals(a, as[0]))(as)\n * return [init, rest]\n * })\n * }\n * assert.deepStrictEqual(group(eqNumber)([1, 1, 2, 3, 3, 4]), [[1, 1], [2], [3, 3], [4]])\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.chop = RA.chop;\n/**\n * Splits an array into two pieces, the first piece has `n` elements.\n *\n * @example\n * import { splitAt } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(splitAt(2)([1, 2, 3, 4, 5]), [[1, 2], [3, 4, 5]])\n *\n * @since 2.0.0\n */\nexports.splitAt = RA.splitAt;\n/**\n * Splits an array into length-`n` pieces. The last piece will be shorter if `n` does not evenly divide the length of\n * the array. Note that `chunksOf(n)([])` is `[]`, not `[[]]`. This is intentional, and is consistent with a recursive\n * definition of `chunksOf`; it satisfies the property that\n *\n * ```ts\n * chunksOf(n)(xs).concat(chunksOf(n)(ys)) == chunksOf(n)(xs.concat(ys)))\n * ```\n *\n * whenever `n` evenly divides the length of `xs`.\n *\n * @example\n * import { chunksOf } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(chunksOf(2)([1, 2, 3, 4, 5]), [[1, 2], [3, 4], [5]])\n *\n * @since 2.0.0\n */\nexports.chunksOf = RA.chunksOf;\nfunction comprehension(input, f, g) {\n if (g === void 0) { g = function () { return true; }; }\n return RA.comprehension(input, f, g);\n}\nexports.comprehension = comprehension;\n// TODO: remove non-curried overloading in v3\n/**\n * Creates an array of unique values, in order, from all given arrays using a `Eq` for equality comparisons\n *\n * @example\n * import { union } from 'fp-ts/Array'\n * import { eqNumber } from 'fp-ts/Eq'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe([1, 2], union(eqNumber)([2, 3])), [1, 2, 3])\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.union = RA.union;\n// TODO: remove non-curried overloading in v3\n/**\n * Creates an array of unique values that are included in all given arrays using a `Eq` for equality\n * comparisons. The order and references of result values are determined by the first array.\n *\n * @example\n * import { intersection } from 'fp-ts/Array'\n * import { eqNumber } from 'fp-ts/Eq'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe([1, 2], intersection(eqNumber)([2, 3])), [2])\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.intersection = RA.intersection;\n// TODO: remove non-curried overloading in v3\n/**\n * Creates an array of array values not included in the other given array using a `Eq` for equality\n * comparisons. The order and references of result values are determined by the first array.\n *\n * @example\n * import { difference } from 'fp-ts/Array'\n * import { eqNumber } from 'fp-ts/Eq'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe([1, 2], difference(eqNumber)([2, 3])), [1])\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.difference = RA.difference;\n/**\n * Wrap a value into the type constructor.\n *\n * @category Applicative\n * @since 2.0.0\n */\nexports.of = RA.of;\n// -------------------------------------------------------------------------------------\n// non-pipeables\n// -------------------------------------------------------------------------------------\nvar map_ = RA.Monad.map;\nvar ap_ = RA.Monad.ap;\nvar chain_ = RA.Monad.chain;\nvar mapWithIndex_ = RA.FunctorWithIndex.mapWithIndex;\nvar filter_ = RA.Filterable.filter;\nvar filterMap_ = RA.Filterable.filterMap;\nvar partition_ = RA.Filterable.partition;\nvar partitionMap_ = RA.Filterable.partitionMap;\nvar filterWithIndex_ = RA.FilterableWithIndex\n .filterWithIndex;\nvar filterMapWithIndex_ = RA.FilterableWithIndex\n .filterMapWithIndex;\nvar partitionWithIndex_ = RA.FilterableWithIndex\n .partitionWithIndex;\nvar partitionMapWithIndex_ = RA.FilterableWithIndex\n .partitionMapWithIndex;\nvar reduce_ = RA.Foldable.reduce;\nvar foldMap_ = RA.Foldable.foldMap;\nvar reduceRight_ = RA.Foldable.reduceRight;\nvar traverse_ = RA.Traversable.traverse;\nvar alt_ = RA.Alternative.alt;\nvar reduceWithIndex_ = RA.FoldableWithIndex.reduceWithIndex;\nvar foldMapWithIndex_ = RA.FoldableWithIndex.foldMapWithIndex;\nvar reduceRightWithIndex_ = RA.FoldableWithIndex.reduceRightWithIndex;\nvar traverseWithIndex_ = RA.TraversableWithIndex\n .traverseWithIndex;\nvar extend_ = RA.Extend.extend;\nvar wither_ = RA.Witherable.wither;\nvar wilt_ = RA.Witherable.wilt;\n// -------------------------------------------------------------------------------------\n// pipeables\n// -------------------------------------------------------------------------------------\n/**\n * `map` can be used to turn functions `(a: A) => B` into functions `(fa: F) => F` whose argument and return types\n * use the type constructor `F` to represent some computational context.\n *\n * @category Functor\n * @since 2.0.0\n */\nexports.map = RA.map;\n/**\n * Apply a function to an argument under a type constructor.\n *\n * @category Apply\n * @since 2.0.0\n */\nexports.ap = RA.ap;\n/**\n * Combine two effectful actions, keeping only the result of the first.\n *\n * Derivable from `Apply`.\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.apFirst = RA.apFirst;\n/**\n * Combine two effectful actions, keeping only the result of the second.\n *\n * Derivable from `Apply`.\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.apSecond = RA.apSecond;\n/**\n * Composes computations in sequence, using the return value of one computation to determine the next computation.\n *\n * @category Monad\n * @since 2.0.0\n */\nexports.chain = RA.chain;\n/**\n * @since 2.7.0\n */\nexports.chainWithIndex = RA.chainWithIndex;\n/**\n * Composes computations in sequence, using the return value of one computation to determine the next computation and\n * keeping only the result of the first.\n *\n * Derivable from `Monad`.\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.chainFirst = RA.chainFirst;\n/**\n * @category FunctorWithIndex\n * @since 2.0.0\n */\nexports.mapWithIndex = RA.mapWithIndex;\n/**\n * @category Compactable\n * @since 2.0.0\n */\nexports.compact = RA.compact;\n/**\n * @category Compactable\n * @since 2.0.0\n */\nexports.separate = RA.separate;\n/**\n * @category Filterable\n * @since 2.0.0\n */\nexports.filter = RA.filter;\n/**\n * @category Filterable\n * @since 2.0.0\n */\nexports.filterMap = RA.filterMap;\n/**\n * @category Filterable\n * @since 2.0.0\n */\nexports.partition = RA.partition;\n/**\n * @category FilterableWithIndex\n * @since 2.0.0\n */\nexports.partitionWithIndex = RA.partitionWithIndex;\n/**\n * @category Filterable\n * @since 2.0.0\n */\nexports.partitionMap = RA.partitionMap;\n/**\n * @category FilterableWithIndex\n * @since 2.0.0\n */\nexports.partitionMapWithIndex = RA.partitionMapWithIndex;\n/**\n * Less strict version of [`alt`](#alt).\n *\n * @category Alt\n * @since 2.9.0\n */\nexports.altW = RA.altW;\n/**\n * Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to\n * types of kind `* -> *`.\n *\n * @category Alt\n * @since 2.0.0\n */\nexports.alt = RA.alt;\n/**\n * @category FilterableWithIndex\n * @since 2.0.0\n */\nexports.filterMapWithIndex = RA.filterMapWithIndex;\n/**\n * @category FilterableWithIndex\n * @since 2.0.0\n */\nexports.filterWithIndex = RA.filterWithIndex;\n/**\n * @category Extend\n * @since 2.0.0\n */\nexports.extend = RA.extend;\n/**\n * Derivable from `Extend`.\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.duplicate = RA.duplicate;\n/**\n * @category Foldable\n * @since 2.0.0\n */\nexports.foldMap = RA.foldMap;\n/**\n * @category FoldableWithIndex\n * @since 2.0.0\n */\nexports.foldMapWithIndex = RA.foldMapWithIndex;\n/**\n * @category Foldable\n * @since 2.0.0\n */\nexports.reduce = RA.reduce;\n/**\n * @category FoldableWithIndex\n * @since 2.0.0\n */\nexports.reduceWithIndex = RA.reduceWithIndex;\n/**\n * @category Foldable\n * @since 2.0.0\n */\nexports.reduceRight = RA.reduceRight;\n/**\n * @category FoldableWithIndex\n * @since 2.0.0\n */\nexports.reduceRightWithIndex = RA.reduceRightWithIndex;\n/**\n * **for optimized and stack safe version check the data types `traverseArray` function**\n * @category Traversable\n * @since 2.6.3\n */\nexports.traverse = RA.traverse;\n/**\n * **for optimized and stack safe version check the data types `sequenceArray` function**\n * @category Traversable\n * @since 2.6.3\n */\nexports.sequence = RA.sequence;\n/**\n * **for optimized and stack safe version check the data types `traverseArrayWithIndex` function**\n * @category TraversableWithIndex\n * @since 2.6.3\n */\nexports.traverseWithIndex = RA.traverseWithIndex;\n/**\n * @category Witherable\n * @since 2.6.5\n */\nexports.wither = RA.wither;\n/**\n * @category Witherable\n * @since 2.6.5\n */\nexports.wilt = RA.wilt;\n/**\n * @category Unfoldable\n * @since 2.6.6\n */\nexports.unfold = RA.unfold;\n/**\n * @category Alternative\n * @since 2.7.0\n */\nexports.zero = RA.Alternative.zero;\n// -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.URI = 'Array';\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Functor = {\n URI: exports.URI,\n map: map_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.FunctorWithIndex = {\n URI: exports.URI,\n map: map_,\n mapWithIndex: mapWithIndex_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Applicative = {\n URI: exports.URI,\n map: map_,\n ap: ap_,\n of: exports.of\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Monad = {\n URI: exports.URI,\n map: map_,\n ap: ap_,\n of: exports.of,\n chain: chain_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Unfoldable = {\n URI: exports.URI,\n unfold: exports.unfold\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Alt = {\n URI: exports.URI,\n map: map_,\n alt: alt_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Alternative = {\n URI: exports.URI,\n map: map_,\n ap: ap_,\n of: exports.of,\n alt: alt_,\n zero: exports.zero\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Extend = {\n URI: exports.URI,\n map: map_,\n extend: extend_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Compactable = {\n URI: exports.URI,\n compact: exports.compact,\n separate: exports.separate\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Filterable = {\n URI: exports.URI,\n map: map_,\n compact: exports.compact,\n separate: exports.separate,\n filter: filter_,\n filterMap: filterMap_,\n partition: partition_,\n partitionMap: partitionMap_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.FilterableWithIndex = {\n URI: exports.URI,\n map: map_,\n mapWithIndex: mapWithIndex_,\n compact: exports.compact,\n separate: exports.separate,\n filter: filter_,\n filterMap: filterMap_,\n partition: partition_,\n partitionMap: partitionMap_,\n partitionMapWithIndex: partitionMapWithIndex_,\n partitionWithIndex: partitionWithIndex_,\n filterMapWithIndex: filterMapWithIndex_,\n filterWithIndex: filterWithIndex_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Foldable = {\n URI: exports.URI,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.FoldableWithIndex = {\n URI: exports.URI,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n reduceWithIndex: reduceWithIndex_,\n foldMapWithIndex: foldMapWithIndex_,\n reduceRightWithIndex: reduceRightWithIndex_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Traversable = {\n URI: exports.URI,\n map: map_,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n traverse: traverse_,\n sequence: exports.sequence\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.TraversableWithIndex = {\n URI: exports.URI,\n map: map_,\n mapWithIndex: mapWithIndex_,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n reduceWithIndex: reduceWithIndex_,\n foldMapWithIndex: foldMapWithIndex_,\n reduceRightWithIndex: reduceRightWithIndex_,\n traverse: traverse_,\n sequence: exports.sequence,\n traverseWithIndex: traverseWithIndex_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Witherable = {\n URI: exports.URI,\n map: map_,\n compact: exports.compact,\n separate: exports.separate,\n filter: filter_,\n filterMap: filterMap_,\n partition: partition_,\n partitionMap: partitionMap_,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n traverse: traverse_,\n sequence: exports.sequence,\n wither: wither_,\n wilt: wilt_\n};\n// TODO: remove in v3\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.array = {\n URI: exports.URI,\n compact: exports.compact,\n separate: exports.separate,\n map: map_,\n ap: ap_,\n of: exports.of,\n chain: chain_,\n filter: filter_,\n filterMap: filterMap_,\n partition: partition_,\n partitionMap: partitionMap_,\n mapWithIndex: mapWithIndex_,\n partitionMapWithIndex: partitionMapWithIndex_,\n partitionWithIndex: partitionWithIndex_,\n filterMapWithIndex: filterMapWithIndex_,\n filterWithIndex: filterWithIndex_,\n alt: alt_,\n zero: exports.zero,\n unfold: exports.unfold,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n traverse: traverse_,\n sequence: exports.sequence,\n reduceWithIndex: reduceWithIndex_,\n foldMapWithIndex: foldMapWithIndex_,\n reduceRightWithIndex: reduceRightWithIndex_,\n traverseWithIndex: traverseWithIndex_,\n extend: extend_,\n wither: wither_,\n wilt: wilt_\n};\n// -------------------------------------------------------------------------------------\n// unsafe\n// -------------------------------------------------------------------------------------\n/**\n * @category unsafe\n * @since 2.0.0\n */\nexports.unsafeInsertAt = RA.unsafeInsertAt;\n/**\n * @category unsafe\n * @since 2.0.0\n */\nexports.unsafeUpdateAt = RA.unsafeUpdateAt;\n/**\n * @category unsafe\n * @since 2.0.0\n */\nexports.unsafeDeleteAt = RA.unsafeDeleteAt;\n// -------------------------------------------------------------------------------------\n// utils\n// -------------------------------------------------------------------------------------\n/**\n * An empty array\n *\n * @since 2.0.0\n */\nexports.empty = [];\n/**\n * @since 2.9.0\n */\nexports.every = RA.every;\n/**\n * @since 2.9.0\n */\nexports.some = RA.some;\n// -------------------------------------------------------------------------------------\n// do notation\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.9.0\n */\nexports.Do = \n/*#__PURE__*/\nexports.of({});\n/**\n * @since 2.8.0\n */\nexports.bindTo = RA.bindTo;\n/**\n * @since 2.8.0\n */\nexports.bind = RA.bind;\n// -------------------------------------------------------------------------------------\n// pipeable sequence S\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.8.0\n */\nexports.apS = RA.apS;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.tailRec = void 0;\n/**\n * @since 2.0.0\n */\nfunction tailRec(a, f) {\n var v = f(a);\n while (v._tag === 'Left') {\n v = f(v.left);\n }\n return v.right;\n}\nexports.tailRec = tailRec;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getWitherable = exports.getFilterable = exports.getApplyMonoid = exports.getApplySemigroup = exports.getSemigroup = exports.getEq = exports.getShow = exports.URI = exports.throwError = exports.sequence = exports.traverse = exports.reduceRight = exports.foldMap = exports.reduce = exports.duplicate = exports.extend = exports.alt = exports.altW = exports.flatten = exports.chainFirst = exports.chainFirstW = exports.chain = exports.chainW = exports.of = exports.apSecond = exports.apFirst = exports.ap = exports.apW = exports.mapLeft = exports.bimap = exports.map = exports.filterOrElse = exports.filterOrElseW = exports.orElse = exports.swap = exports.chainNullableK = exports.fromNullableK = exports.getOrElse = exports.getOrElseW = exports.fold = exports.fromPredicate = exports.fromOption = exports.stringifyJSON = exports.parseJSON = exports.tryCatch = exports.fromNullable = exports.right = exports.left = exports.isRight = exports.isLeft = void 0;\nexports.sequenceArray = exports.traverseArray = exports.traverseArrayWithIndex = exports.apS = exports.apSW = exports.bind = exports.bindW = exports.bindTo = exports.Do = exports.exists = exports.elem = exports.toError = exports.either = exports.getValidationMonoid = exports.MonadThrow = exports.ChainRec = exports.Extend = exports.Alt = exports.Bifunctor = exports.Traversable = exports.Foldable = exports.Monad = exports.Applicative = exports.Functor = exports.getValidationSemigroup = exports.getValidation = exports.getAltValidation = exports.getApplicativeValidation = void 0;\nvar ChainRec_1 = require(\"./ChainRec\");\nvar function_1 = require(\"./function\");\n// -------------------------------------------------------------------------------------\n// guards\n// -------------------------------------------------------------------------------------\n/**\n * Returns `true` if the either is an instance of `Left`, `false` otherwise.\n *\n * @category guards\n * @since 2.0.0\n */\nvar isLeft = function (ma) { return ma._tag === 'Left'; };\nexports.isLeft = isLeft;\n/**\n * Returns `true` if the either is an instance of `Right`, `false` otherwise.\n *\n * @category guards\n * @since 2.0.0\n */\nvar isRight = function (ma) { return ma._tag === 'Right'; };\nexports.isRight = isRight;\n// -------------------------------------------------------------------------------------\n// constructors\n// -------------------------------------------------------------------------------------\n/**\n * Constructs a new `Either` holding a `Left` value. This usually represents a failure, due to the right-bias of this\n * structure.\n *\n * @category constructors\n * @since 2.0.0\n */\nvar left = function (e) { return ({ _tag: 'Left', left: e }); };\nexports.left = left;\n/**\n * Constructs a new `Either` holding a `Right` value. This usually represents a successful value due to the right bias\n * of this structure.\n *\n * @category constructors\n * @since 2.0.0\n */\nvar right = function (a) { return ({ _tag: 'Right', right: a }); };\nexports.right = right;\n// TODO: make lazy in v3\n/**\n * Takes a default and a nullable value, if the value is not nully, turn it into a `Right`, if the value is nully use\n * the provided default as a `Left`.\n *\n * @example\n * import { fromNullable, left, right } from 'fp-ts/Either'\n *\n * const parse = fromNullable('nully')\n *\n * assert.deepStrictEqual(parse(1), right(1))\n * assert.deepStrictEqual(parse(null), left('nully'))\n *\n * @category constructors\n * @since 2.0.0\n */\nfunction fromNullable(e) {\n return function (a) { return (a == null ? exports.left(e) : exports.right(a)); };\n}\nexports.fromNullable = fromNullable;\n// TODO: `onError => Lazy => Either` in v3\n/**\n * Constructs a new `Either` from a function that might throw.\n *\n * @example\n * import { Either, left, right, tryCatch } from 'fp-ts/Either'\n *\n * const unsafeHead = (as: Array): A => {\n * if (as.length > 0) {\n * return as[0]\n * } else {\n * throw new Error('empty array')\n * }\n * }\n *\n * const head = (as: Array): Either => {\n * return tryCatch(() => unsafeHead(as), e => (e instanceof Error ? e : new Error('unknown error')))\n * }\n *\n * assert.deepStrictEqual(head([]), left(new Error('empty array')))\n * assert.deepStrictEqual(head([1, 2, 3]), right(1))\n *\n * @category constructors\n * @since 2.0.0\n */\nfunction tryCatch(f, onError) {\n try {\n return exports.right(f());\n }\n catch (e) {\n return exports.left(onError(e));\n }\n}\nexports.tryCatch = tryCatch;\n// TODO curry in v3\n/**\n * Converts a JavaScript Object Notation (JSON) string into an object.\n *\n * @example\n * import { parseJSON, toError, right, left } from 'fp-ts/Either'\n *\n * assert.deepStrictEqual(parseJSON('{\"a\":1}', toError), right({ a: 1 }))\n * assert.deepStrictEqual(parseJSON('{\"a\":}', toError), left(new SyntaxError('Unexpected token } in JSON at position 5')))\n *\n * @category constructors\n * @since 2.0.0\n */\nfunction parseJSON(s, onError) {\n return tryCatch(function () { return JSON.parse(s); }, onError);\n}\nexports.parseJSON = parseJSON;\n// TODO curry in v3\n/**\n * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.\n *\n * @example\n * import * as E from 'fp-ts/Either'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(E.stringifyJSON({ a: 1 }, E.toError), E.right('{\"a\":1}'))\n * const circular: any = { ref: null }\n * circular.ref = circular\n * assert.deepStrictEqual(\n * pipe(\n * E.stringifyJSON(circular, E.toError),\n * E.mapLeft(e => e.message.includes('Converting circular structure to JSON'))\n * ),\n * E.left(true)\n * )\n *\n * @category constructors\n * @since 2.0.0\n */\nfunction stringifyJSON(u, onError) {\n return tryCatch(function () { return JSON.stringify(u); }, onError);\n}\nexports.stringifyJSON = stringifyJSON;\n/**\n * Derivable from `MonadThrow`.\n *\n * @example\n * import { fromOption, left, right } from 'fp-ts/Either'\n * import { pipe } from 'fp-ts/function'\n * import { none, some } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(\n * pipe(\n * some(1),\n * fromOption(() => 'error')\n * ),\n * right(1)\n * )\n * assert.deepStrictEqual(\n * pipe(\n * none,\n * fromOption(() => 'error')\n * ),\n * left('error')\n * )\n *\n * @category constructors\n * @since 2.0.0\n */\nvar fromOption = function (onNone) { return function (ma) {\n return ma._tag === 'None' ? exports.left(onNone()) : exports.right(ma.value);\n}; };\nexports.fromOption = fromOption;\n/**\n * Derivable from `MonadThrow`.\n *\n * @example\n * import { fromPredicate, left, right } from 'fp-ts/Either'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(\n * pipe(\n * 1,\n * fromPredicate(\n * (n) => n > 0,\n * () => 'error'\n * )\n * ),\n * right(1)\n * )\n * assert.deepStrictEqual(\n * pipe(\n * -1,\n * fromPredicate(\n * (n) => n > 0,\n * () => 'error'\n * )\n * ),\n * left('error')\n * )\n *\n * @category constructors\n * @since 2.0.0\n */\nvar fromPredicate = function (predicate, onFalse) { return function (a) { return (predicate(a) ? exports.right(a) : exports.left(onFalse(a))); }; };\nexports.fromPredicate = fromPredicate;\n// -------------------------------------------------------------------------------------\n// destructors\n// -------------------------------------------------------------------------------------\n/**\n * Takes two functions and an `Either` value, if the value is a `Left` the inner value is applied to the first function,\n * if the value is a `Right` the inner value is applied to the second function.\n *\n * @example\n * import { fold, left, right } from 'fp-ts/Either'\n * import { pipe } from 'fp-ts/function'\n *\n * function onLeft(errors: Array): string {\n * return `Errors: ${errors.join(', ')}`\n * }\n *\n * function onRight(value: number): string {\n * return `Ok: ${value}`\n * }\n *\n * assert.strictEqual(\n * pipe(\n * right(1),\n * fold(onLeft, onRight)\n * ),\n * 'Ok: 1'\n * )\n * assert.strictEqual(\n * pipe(\n * left(['error 1', 'error 2']),\n * fold(onLeft, onRight)\n * ),\n * 'Errors: error 1, error 2'\n * )\n *\n * @category destructors\n * @since 2.0.0\n */\nfunction fold(onLeft, onRight) {\n return function (ma) { return (exports.isLeft(ma) ? onLeft(ma.left) : onRight(ma.right)); };\n}\nexports.fold = fold;\n/**\n * Less strict version of [`getOrElse`](#getOrElse).\n *\n * @category destructors\n * @since 2.6.0\n */\nvar getOrElseW = function (onLeft) { return function (ma) {\n return exports.isLeft(ma) ? onLeft(ma.left) : ma.right;\n}; };\nexports.getOrElseW = getOrElseW;\n/**\n * Returns the wrapped value if it's a `Right` or a default value if is a `Left`.\n *\n * @example\n * import { getOrElse, left, right } from 'fp-ts/Either'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(\n * pipe(\n * right(1),\n * getOrElse(() => 0)\n * ),\n * 1\n * )\n * assert.deepStrictEqual(\n * pipe(\n * left('error'),\n * getOrElse(() => 0)\n * ),\n * 0\n * )\n *\n * @category destructors\n * @since 2.0.0\n */\nexports.getOrElse = exports.getOrElseW;\n// -------------------------------------------------------------------------------------\n// combinators\n// -------------------------------------------------------------------------------------\n/**\n * @category combinators\n * @since 2.9.0\n */\nfunction fromNullableK(e) {\n var from = fromNullable(e);\n return function (f) { return function () {\n var a = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n a[_i] = arguments[_i];\n }\n return from(f.apply(void 0, a));\n }; };\n}\nexports.fromNullableK = fromNullableK;\n/**\n * @category combinators\n * @since 2.9.0\n */\nfunction chainNullableK(e) {\n var from = fromNullableK(e);\n return function (f) { return exports.chain(from(f)); };\n}\nexports.chainNullableK = chainNullableK;\n/**\n * Returns a `Right` if is a `Left` (and vice versa).\n *\n * @category combinators\n * @since 2.0.0\n */\nfunction swap(ma) {\n return exports.isLeft(ma) ? exports.right(ma.left) : exports.left(ma.right);\n}\nexports.swap = swap;\n/**\n * Useful for recovering from errors.\n *\n * @category combinators\n * @since 2.0.0\n */\nfunction orElse(onLeft) {\n return function (ma) { return (exports.isLeft(ma) ? onLeft(ma.left) : ma); };\n}\nexports.orElse = orElse;\n/**\n * Less strict version of [`filterOrElse`](#filterOrElse).\n *\n * @since 2.9.0\n */\nvar filterOrElseW = function (predicate, onFalse) {\n return exports.chainW(function (a) { return (predicate(a) ? exports.right(a) : exports.left(onFalse(a))); });\n};\nexports.filterOrElseW = filterOrElseW;\n/**\n * Derivable from `MonadThrow`.\n *\n * @example\n * import { filterOrElse, left, right } from 'fp-ts/Either'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(\n * pipe(\n * right(1),\n * filterOrElse(\n * (n) => n > 0,\n * () => 'error'\n * )\n * ),\n * right(1)\n * )\n * assert.deepStrictEqual(\n * pipe(\n * right(-1),\n * filterOrElse(\n * (n) => n > 0,\n * () => 'error'\n * )\n * ),\n * left('error')\n * )\n * assert.deepStrictEqual(\n * pipe(\n * left('a'),\n * filterOrElse(\n * (n) => n > 0,\n * () => 'error'\n * )\n * ),\n * left('a')\n * )\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.filterOrElse = exports.filterOrElseW;\n// -------------------------------------------------------------------------------------\n// non-pipeables\n// -------------------------------------------------------------------------------------\nvar map_ = function (fa, f) { return function_1.pipe(fa, exports.map(f)); };\nvar ap_ = function (fab, fa) { return function_1.pipe(fab, exports.ap(fa)); };\n/* istanbul ignore next */\nvar chain_ = function (ma, f) { return function_1.pipe(ma, exports.chain(f)); };\n/* istanbul ignore next */\nvar reduce_ = function (fa, b, f) { return function_1.pipe(fa, exports.reduce(b, f)); };\n/* istanbul ignore next */\nvar foldMap_ = function (M) { return function (fa, f) {\n var foldMapM = exports.foldMap(M);\n return function_1.pipe(fa, foldMapM(f));\n}; };\n/* istanbul ignore next */\nvar reduceRight_ = function (fa, b, f) { return function_1.pipe(fa, exports.reduceRight(b, f)); };\nvar traverse_ = function (F) {\n var traverseF = exports.traverse(F);\n return function (ta, f) { return function_1.pipe(ta, traverseF(f)); };\n};\nvar bimap_ = function (fa, f, g) { return function_1.pipe(fa, exports.bimap(f, g)); };\nvar mapLeft_ = function (fa, f) { return function_1.pipe(fa, exports.mapLeft(f)); };\n/* istanbul ignore next */\nvar alt_ = function (fa, that) { return function_1.pipe(fa, exports.alt(that)); };\n/* istanbul ignore next */\nvar extend_ = function (wa, f) { return function_1.pipe(wa, exports.extend(f)); };\nvar chainRec_ = function (a, f) {\n return ChainRec_1.tailRec(f(a), function (e) {\n return exports.isLeft(e) ? exports.right(exports.left(e.left)) : exports.isLeft(e.right) ? exports.left(f(e.right.left)) : exports.right(exports.right(e.right.right));\n });\n};\n// -------------------------------------------------------------------------------------\n// pipeables\n// -------------------------------------------------------------------------------------\n/**\n * `map` can be used to turn functions `(a: A) => B` into functions `(fa: F) => F` whose argument and return types\n * use the type constructor `F` to represent some computational context.\n *\n * @category Functor\n * @since 2.0.0\n */\nvar map = function (f) { return function (fa) {\n return exports.isLeft(fa) ? fa : exports.right(f(fa.right));\n}; };\nexports.map = map;\n/**\n * Map a pair of functions over the two type arguments of the bifunctor.\n *\n * @category Bifunctor\n * @since 2.0.0\n */\nvar bimap = function (f, g) { return function (fa) { return (exports.isLeft(fa) ? exports.left(f(fa.left)) : exports.right(g(fa.right))); }; };\nexports.bimap = bimap;\n/**\n * Map a function over the first type argument of a bifunctor.\n *\n * @category Bifunctor\n * @since 2.0.0\n */\nvar mapLeft = function (f) { return function (fa) {\n return exports.isLeft(fa) ? exports.left(f(fa.left)) : fa;\n}; };\nexports.mapLeft = mapLeft;\n/**\n * Less strict version of [`ap`](#ap).\n *\n * @category Apply\n * @since 2.8.0\n */\nvar apW = function (fa) { return function (fab) {\n return exports.isLeft(fab) ? fab : exports.isLeft(fa) ? fa : exports.right(fab.right(fa.right));\n}; };\nexports.apW = apW;\n/**\n * Apply a function to an argument under a type constructor.\n *\n * @category Apply\n * @since 2.0.0\n */\nexports.ap = exports.apW;\n/**\n * Combine two effectful actions, keeping only the result of the first.\n *\n * Derivable from `Apply`.\n *\n * @category combinators\n * @since 2.0.0\n */\nvar apFirst = function (fb) {\n return function_1.flow(exports.map(function (a) { return function () { return a; }; }), exports.ap(fb));\n};\nexports.apFirst = apFirst;\n/**\n * Combine two effectful actions, keeping only the result of the second.\n *\n * Derivable from `Apply`.\n *\n * @category combinators\n * @since 2.0.0\n */\nvar apSecond = function (fb) {\n return function_1.flow(exports.map(function () { return function (b) { return b; }; }), exports.ap(fb));\n};\nexports.apSecond = apSecond;\n/**\n * Wrap a value into the type constructor.\n *\n * Equivalent to [`right`](#right).\n *\n * @example\n * import * as E from 'fp-ts/Either'\n *\n * assert.deepStrictEqual(E.of('a'), E.right('a'))\n *\n * @category Applicative\n * @since 2.7.0\n */\nexports.of = exports.right;\n/**\n * Less strict version of [`chain`](#chain).\n *\n * @category Monad\n * @since 2.6.0\n */\nvar chainW = function (f) { return function (ma) {\n return exports.isLeft(ma) ? ma : f(ma.right);\n}; };\nexports.chainW = chainW;\n/**\n * Composes computations in sequence, using the return value of one computation to determine the next computation.\n *\n * @category Monad\n * @since 2.0.0\n */\nexports.chain = exports.chainW;\n/**\n * Less strict version of [`chainFirst`](#chainFirst)\n *\n * Derivable from `Monad`.\n *\n * @category combinators\n * @since 2.8.0\n */\nvar chainFirstW = function (f) { return function (ma) {\n return function_1.pipe(ma, exports.chainW(function (a) {\n return function_1.pipe(f(a), exports.map(function () { return a; }));\n }));\n}; };\nexports.chainFirstW = chainFirstW;\n/**\n * Composes computations in sequence, using the return value of one computation to determine the next computation and\n * keeping only the result of the first.\n *\n * Derivable from `Monad`.\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.chainFirst = exports.chainFirstW;\n/**\n * The `flatten` function is the conventional monad join operator. It is used to remove one level of monadic structure, projecting its bound argument into the outer level.\n *\n * Derivable from `Monad`.\n *\n * @example\n * import * as E from 'fp-ts/Either'\n *\n * assert.deepStrictEqual(E.flatten(E.right(E.right('a'))), E.right('a'))\n * assert.deepStrictEqual(E.flatten(E.right(E.left('e'))), E.left('e'))\n * assert.deepStrictEqual(E.flatten(E.left('e')), E.left('e'))\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.flatten = \n/*#__PURE__*/\nexports.chain(function_1.identity);\n/**\n * Less strict version of [`alt`](#alt).\n *\n * @category Alt\n * @since 2.9.0\n */\nvar altW = function (that) { return function (fa) { return (exports.isLeft(fa) ? that() : fa); }; };\nexports.altW = altW;\n/**\n * Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to\n * types of kind `* -> *`.\n *\n * @category Alt\n * @since 2.0.0\n */\nexports.alt = exports.altW;\n/**\n * @category Extend\n * @since 2.0.0\n */\nvar extend = function (f) { return function (wa) {\n return exports.isLeft(wa) ? wa : exports.right(f(wa));\n}; };\nexports.extend = extend;\n/**\n * Derivable from `Extend`.\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.duplicate = \n/*#__PURE__*/\nexports.extend(function_1.identity);\n/**\n * Left-associative fold of a structure.\n *\n * @example\n * import { pipe } from 'fp-ts/function'\n * import * as E from 'fp-ts/Either'\n *\n * const startWith = 'prefix'\n * const concat = (a: string, b: string) => `${a}:${b}`\n *\n * assert.deepStrictEqual(\n * pipe(E.right('a'), E.reduce(startWith, concat)),\n * 'prefix:a',\n * )\n *\n * assert.deepStrictEqual(\n * pipe(E.left('e'), E.reduce(startWith, concat)),\n * 'prefix',\n * )\n *\n * @category Foldable\n * @since 2.0.0\n */\nvar reduce = function (b, f) { return function (fa) {\n return exports.isLeft(fa) ? b : f(b, fa.right);\n}; };\nexports.reduce = reduce;\n/**\n * Map each element of the structure to a monoid, and combine the results.\n *\n * @example\n * import { pipe } from 'fp-ts/function';\n * import * as E from 'fp-ts/Either'\n * import { monoidString } from 'fp-ts/Monoid'\n *\n * const yell = (a: string) => `${a}!`\n *\n * assert.deepStrictEqual(\n * pipe(E.right('a'), E.foldMap(monoidString)(yell)),\n * 'a!',\n * )\n *\n * assert.deepStrictEqual(\n * pipe(E.left('e'), E.foldMap(monoidString)(yell)),\n * monoidString.empty,\n * )\n *\n * @category Foldable\n * @since 2.0.0\n */\nvar foldMap = function (M) { return function (f) { return function (fa) {\n return exports.isLeft(fa) ? M.empty : f(fa.right);\n}; }; };\nexports.foldMap = foldMap;\n/**\n * Right-associative fold of a structure.\n *\n * @example\n * import { pipe } from 'fp-ts/function'\n * import * as E from 'fp-ts/Either'\n *\n * const startWith = 'postfix'\n * const concat = (a: string, b: string) => `${a}:${b}`\n *\n * assert.deepStrictEqual(\n * pipe(E.right('a'), E.reduceRight(startWith, concat)),\n * 'a:postfix',\n * )\n *\n * assert.deepStrictEqual(\n * pipe(E.left('e'), E.reduceRight(startWith, concat)),\n * 'postfix',\n * )\n *\n * @category Foldable\n * @since 2.0.0\n */\nvar reduceRight = function (b, f) { return function (fa) {\n return exports.isLeft(fa) ? b : f(fa.right, b);\n}; };\nexports.reduceRight = reduceRight;\n/**\n * Map each element of a structure to an action, evaluate these actions from left to right, and collect the results.\n *\n * @example\n * import { pipe } from 'fp-ts/function'\n * import * as A from 'fp-ts/Array'\n * import * as E from 'fp-ts/Either'\n * import * as O from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(\n * pipe(E.right(['a']), E.traverse(O.option)(A.head)),\n * O.some(E.right('a')),\n * )\n *\n * assert.deepStrictEqual(\n * pipe(E.right([]), E.traverse(O.option)(A.head)),\n * O.none,\n * )\n *\n * @category Traversable\n * @since 2.6.3\n */\nvar traverse = function (F) { return function (f) { return function (ta) { return (exports.isLeft(ta) ? F.of(exports.left(ta.left)) : F.map(f(ta.right), exports.right)); }; }; };\nexports.traverse = traverse;\n/**\n * Evaluate each monadic action in the structure from left to right, and collect the results.\n *\n * @example\n * import { pipe } from 'fp-ts/function'\n * import * as E from 'fp-ts/Either'\n * import * as O from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(\n * pipe(E.right(O.some('a')), E.sequence(O.option)),\n * O.some(E.right('a')),\n * )\n *\n * assert.deepStrictEqual(\n * pipe(E.right(O.none), E.sequence(O.option)),\n * O.none\n * )\n *\n * @category Traversable\n * @since 2.6.3\n */\nvar sequence = function (F) { return function (ma) {\n return exports.isLeft(ma) ? F.of(exports.left(ma.left)) : F.map(ma.right, exports.right);\n}; };\nexports.sequence = sequence;\n/**\n * @category MonadThrow\n * @since 2.6.3\n */\nexports.throwError = exports.left;\n// -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.URI = 'Either';\n/**\n * @category instances\n * @since 2.0.0\n */\nfunction getShow(SE, SA) {\n return {\n show: function (ma) { return (exports.isLeft(ma) ? \"left(\" + SE.show(ma.left) + \")\" : \"right(\" + SA.show(ma.right) + \")\"); }\n };\n}\nexports.getShow = getShow;\n/**\n * @category instances\n * @since 2.0.0\n */\nfunction getEq(EL, EA) {\n return {\n equals: function (x, y) {\n return x === y || (exports.isLeft(x) ? exports.isLeft(y) && EL.equals(x.left, y.left) : exports.isRight(y) && EA.equals(x.right, y.right));\n }\n };\n}\nexports.getEq = getEq;\n/**\n * Semigroup returning the left-most non-`Left` value. If both operands are `Right`s then the inner values are\n * concatenated using the provided `Semigroup`\n *\n * @example\n * import { getSemigroup, left, right } from 'fp-ts/Either'\n * import { semigroupSum } from 'fp-ts/Semigroup'\n *\n * const S = getSemigroup(semigroupSum)\n * assert.deepStrictEqual(S.concat(left('a'), left('b')), left('a'))\n * assert.deepStrictEqual(S.concat(left('a'), right(2)), right(2))\n * assert.deepStrictEqual(S.concat(right(1), left('b')), right(1))\n * assert.deepStrictEqual(S.concat(right(1), right(2)), right(3))\n *\n * @category instances\n * @since 2.0.0\n */\nfunction getSemigroup(S) {\n return {\n concat: function (x, y) { return (exports.isLeft(y) ? x : exports.isLeft(x) ? y : exports.right(S.concat(x.right, y.right))); }\n };\n}\nexports.getSemigroup = getSemigroup;\n/**\n * Semigroup returning the left-most `Left` value. If both operands are `Right`s then the inner values\n * are concatenated using the provided `Semigroup`\n *\n * @example\n * import { getApplySemigroup, left, right } from 'fp-ts/Either'\n * import { semigroupSum } from 'fp-ts/Semigroup'\n *\n * const S = getApplySemigroup(semigroupSum)\n * assert.deepStrictEqual(S.concat(left('a'), left('b')), left('a'))\n * assert.deepStrictEqual(S.concat(left('a'), right(2)), left('a'))\n * assert.deepStrictEqual(S.concat(right(1), left('b')), left('b'))\n * assert.deepStrictEqual(S.concat(right(1), right(2)), right(3))\n *\n * @category instances\n * @since 2.0.0\n */\nfunction getApplySemigroup(S) {\n return {\n concat: function (x, y) { return (exports.isLeft(x) ? x : exports.isLeft(y) ? y : exports.right(S.concat(x.right, y.right))); }\n };\n}\nexports.getApplySemigroup = getApplySemigroup;\n/**\n * @category instances\n * @since 2.0.0\n */\nfunction getApplyMonoid(M) {\n return {\n concat: getApplySemigroup(M).concat,\n empty: exports.right(M.empty)\n };\n}\nexports.getApplyMonoid = getApplyMonoid;\n/**\n * Builds a `Filterable` instance for `Either` given `Monoid` for the left side\n *\n * @category instances\n * @since 3.0.0\n */\nfunction getFilterable(M) {\n var empty = exports.left(M.empty);\n var compact = function (ma) {\n return exports.isLeft(ma) ? ma : ma.right._tag === 'None' ? empty : exports.right(ma.right.value);\n };\n var separate = function (ma) {\n return exports.isLeft(ma)\n ? { left: ma, right: ma }\n : exports.isLeft(ma.right)\n ? { left: exports.right(ma.right.left), right: empty }\n : { left: empty, right: exports.right(ma.right.right) };\n };\n var partitionMap = function (ma, f) {\n if (exports.isLeft(ma)) {\n return { left: ma, right: ma };\n }\n var e = f(ma.right);\n return exports.isLeft(e) ? { left: exports.right(e.left), right: empty } : { left: empty, right: exports.right(e.right) };\n };\n var partition = function (ma, p) {\n return exports.isLeft(ma)\n ? { left: ma, right: ma }\n : p(ma.right)\n ? { left: empty, right: exports.right(ma.right) }\n : { left: exports.right(ma.right), right: empty };\n };\n var filterMap = function (ma, f) {\n if (exports.isLeft(ma)) {\n return ma;\n }\n var ob = f(ma.right);\n return ob._tag === 'None' ? empty : exports.right(ob.value);\n };\n var filter = function (ma, predicate) {\n return exports.isLeft(ma) ? ma : predicate(ma.right) ? ma : empty;\n };\n return {\n URI: exports.URI,\n _E: undefined,\n map: map_,\n compact: compact,\n separate: separate,\n filter: filter,\n filterMap: filterMap,\n partition: partition,\n partitionMap: partitionMap\n };\n}\nexports.getFilterable = getFilterable;\n/**\n * Builds `Witherable` instance for `Either` given `Monoid` for the left side\n *\n * @category instances\n * @since 2.0.0\n */\nfunction getWitherable(M) {\n var F_ = getFilterable(M);\n var wither = function (F) {\n var traverseF = traverse_(F);\n return function (ma, f) { return F.map(traverseF(ma, f), F_.compact); };\n };\n var wilt = function (F) {\n var traverseF = traverse_(F);\n return function (ma, f) { return F.map(traverseF(ma, f), F_.separate); };\n };\n return {\n URI: exports.URI,\n _E: undefined,\n map: map_,\n compact: F_.compact,\n separate: F_.separate,\n filter: F_.filter,\n filterMap: F_.filterMap,\n partition: F_.partition,\n partitionMap: F_.partitionMap,\n traverse: traverse_,\n sequence: exports.sequence,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n wither: wither,\n wilt: wilt\n };\n}\nexports.getWitherable = getWitherable;\n/**\n * @category instances\n * @since 2.7.0\n */\nfunction getApplicativeValidation(SE) {\n return {\n URI: exports.URI,\n _E: undefined,\n map: map_,\n ap: function (fab, fa) {\n return exports.isLeft(fab)\n ? exports.isLeft(fa)\n ? exports.left(SE.concat(fab.left, fa.left))\n : fab\n : exports.isLeft(fa)\n ? fa\n : exports.right(fab.right(fa.right));\n },\n of: exports.of\n };\n}\nexports.getApplicativeValidation = getApplicativeValidation;\n/**\n * @category instances\n * @since 2.7.0\n */\nfunction getAltValidation(SE) {\n return {\n URI: exports.URI,\n _E: undefined,\n map: map_,\n alt: function (me, that) {\n if (exports.isRight(me)) {\n return me;\n }\n var ea = that();\n return exports.isLeft(ea) ? exports.left(SE.concat(me.left, ea.left)) : ea;\n }\n };\n}\nexports.getAltValidation = getAltValidation;\n// TODO: remove in v3\n/**\n * @category instances\n * @since 2.0.0\n */\nfunction getValidation(SE) {\n var applicativeValidation = getApplicativeValidation(SE);\n var altValidation = getAltValidation(SE);\n return {\n URI: exports.URI,\n _E: undefined,\n map: map_,\n of: exports.of,\n chain: chain_,\n bimap: bimap_,\n mapLeft: mapLeft_,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n extend: extend_,\n traverse: traverse_,\n sequence: exports.sequence,\n chainRec: chainRec_,\n throwError: exports.throwError,\n ap: applicativeValidation.ap,\n alt: altValidation.alt\n };\n}\nexports.getValidation = getValidation;\n/**\n * @category instances\n * @since 2.0.0\n */\nfunction getValidationSemigroup(SE, SA) {\n return {\n concat: function (x, y) {\n return exports.isLeft(x) ? (exports.isLeft(y) ? exports.left(SE.concat(x.left, y.left)) : x) : exports.isLeft(y) ? y : exports.right(SA.concat(x.right, y.right));\n }\n };\n}\nexports.getValidationSemigroup = getValidationSemigroup;\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Functor = {\n URI: exports.URI,\n map: map_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Applicative = {\n URI: exports.URI,\n map: map_,\n ap: ap_,\n of: exports.of\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Monad = {\n URI: exports.URI,\n map: map_,\n ap: ap_,\n of: exports.of,\n chain: chain_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Foldable = {\n URI: exports.URI,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Traversable = {\n URI: exports.URI,\n map: map_,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n traverse: traverse_,\n sequence: exports.sequence\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Bifunctor = {\n URI: exports.URI,\n bimap: bimap_,\n mapLeft: mapLeft_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Alt = {\n URI: exports.URI,\n map: map_,\n alt: alt_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Extend = {\n URI: exports.URI,\n map: map_,\n extend: extend_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.ChainRec = {\n URI: exports.URI,\n map: map_,\n ap: ap_,\n chain: chain_,\n chainRec: chainRec_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.MonadThrow = {\n URI: exports.URI,\n map: map_,\n ap: ap_,\n of: exports.of,\n chain: chain_,\n throwError: exports.throwError\n};\n/**\n * @category instances\n * @since 2.0.0\n */\nfunction getValidationMonoid(SE, SA) {\n return {\n concat: getValidationSemigroup(SE, SA).concat,\n empty: exports.right(SA.empty)\n };\n}\nexports.getValidationMonoid = getValidationMonoid;\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.either = {\n URI: exports.URI,\n map: map_,\n of: exports.of,\n ap: ap_,\n chain: chain_,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n traverse: traverse_,\n sequence: exports.sequence,\n bimap: bimap_,\n mapLeft: mapLeft_,\n alt: alt_,\n extend: extend_,\n chainRec: chainRec_,\n throwError: exports.throwError\n};\n// -------------------------------------------------------------------------------------\n// utils\n// -------------------------------------------------------------------------------------\n/**\n * Default value for the `onError` argument of `tryCatch`\n *\n * @since 2.0.0\n */\nfunction toError(e) {\n return e instanceof Error ? e : new Error(String(e));\n}\nexports.toError = toError;\n/**\n * @since 2.0.0\n */\nfunction elem(E) {\n return function (a, ma) { return (exports.isLeft(ma) ? false : E.equals(a, ma.right)); };\n}\nexports.elem = elem;\n/**\n * Returns `false` if `Left` or returns the result of the application of the given predicate to the `Right` value.\n *\n * @example\n * import { exists, left, right } from 'fp-ts/Either'\n *\n * const gt2 = exists((n: number) => n > 2)\n *\n * assert.strictEqual(gt2(left('a')), false)\n * assert.strictEqual(gt2(right(1)), false)\n * assert.strictEqual(gt2(right(3)), true)\n *\n * @since 2.0.0\n */\nfunction exists(predicate) {\n return function (ma) { return (exports.isLeft(ma) ? false : predicate(ma.right)); };\n}\nexports.exists = exists;\n// -------------------------------------------------------------------------------------\n// do notation\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.9.0\n */\nexports.Do = \n/*#__PURE__*/\nexports.of({});\n/**\n * @since 2.8.0\n */\nvar bindTo = function (name) {\n return exports.map(function_1.bindTo_(name));\n};\nexports.bindTo = bindTo;\n/**\n * @since 2.8.0\n */\nvar bindW = function (name, f) {\n return exports.chainW(function (a) {\n return function_1.pipe(f(a), exports.map(function (b) { return function_1.bind_(a, name, b); }));\n });\n};\nexports.bindW = bindW;\n/**\n * @since 2.8.0\n */\nexports.bind = exports.bindW;\n// -------------------------------------------------------------------------------------\n// pipeable sequence S\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.8.0\n */\nvar apSW = function (name, fb) {\n return function_1.flow(exports.map(function (a) { return function (b) { return function_1.bind_(a, name, b); }; }), exports.apW(fb));\n};\nexports.apSW = apSW;\n/**\n * @since 2.8.0\n */\nexports.apS = exports.apSW;\n// -------------------------------------------------------------------------------------\n// array utils\n// -------------------------------------------------------------------------------------\n/**\n *\n * @since 2.9.0\n */\nvar traverseArrayWithIndex = function (f) { return function (arr) {\n // tslint:disable-next-line: readonly-array\n var result = [];\n for (var i = 0; i < arr.length; i++) {\n var e = f(i, arr[i]);\n if (e._tag === 'Left') {\n return e;\n }\n result.push(e.right);\n }\n return exports.right(result);\n}; };\nexports.traverseArrayWithIndex = traverseArrayWithIndex;\n/**\n * map an array using provided function to Either then transform to Either of the array\n * this function has the same behavior of `A.traverse(E.either)` but it's optimized and performs better\n *\n * @example\n *\n *\n * import { traverseArray, left, right, fromPredicate } from 'fp-ts/Either'\n * import { pipe } from 'fp-ts/function'\n * import * as A from 'fp-ts/Array'\n *\n * const arr = A.range(0, 10)\n * assert.deepStrictEqual(\n * pipe(\n * arr,\n * traverseArray((x) => right(x))\n * ),\n * right(arr)\n * )\n * assert.deepStrictEqual(\n * pipe(\n * arr,\n * traverseArray(\n * fromPredicate(\n * (x) => x > 5,\n * () => 'a'\n * )\n * )\n * ),\n * left('a')\n * )\n * @since 2.9.0\n */\nvar traverseArray = function (f) { return exports.traverseArrayWithIndex(function (_, a) { return f(a); }); };\nexports.traverseArray = traverseArray;\n/**\n * convert an array of either to an either of array\n * this function has the same behavior of `A.sequence(E.either)` but it's optimized and performs better\n *\n * @example\n *\n * import { sequenceArray, left, right } from 'fp-ts/Either'\n * import { pipe } from 'fp-ts/function'\n * import * as A from 'fp-ts/Array'\n *\n * const arr = A.range(0, 10)\n * assert.deepStrictEqual(pipe(arr, A.map(right), sequenceArray), right(arr))\n * assert.deepStrictEqual(pipe(arr, A.map(right), A.cons(left('Error')), sequenceArray), left('Error'))\n *\n * @since 2.9.0\n */\nexports.sequenceArray = \n/*#__PURE__*/\nexports.traverseArray(function_1.identity);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.eq = exports.Contravariant = exports.getMonoid = exports.eqDate = exports.getTupleEq = exports.getStructEq = exports.eqBoolean = exports.eqNumber = exports.eqString = exports.strictEqual = exports.eqStrict = exports.URI = exports.contramap = exports.fromEquals = void 0;\nvar function_1 = require(\"./function\");\n// -------------------------------------------------------------------------------------\n// constructors\n// -------------------------------------------------------------------------------------\n/**\n * @category constructors\n * @since 2.0.0\n */\nfunction fromEquals(equals) {\n return {\n equals: function (x, y) { return x === y || equals(x, y); }\n };\n}\nexports.fromEquals = fromEquals;\n// -------------------------------------------------------------------------------------\n// non-pipeables\n// -------------------------------------------------------------------------------------\n/* istanbul ignore next */\nvar contramap_ = function (fa, f) { return function_1.pipe(fa, exports.contramap(f)); };\n// -------------------------------------------------------------------------------------\n// pipeables\n// -------------------------------------------------------------------------------------\n/**\n * @category Contravariant\n * @since 2.0.0\n */\nvar contramap = function (f) { return function (fa) {\n return fromEquals(function (x, y) { return fa.equals(f(x), f(y)); });\n}; };\nexports.contramap = contramap;\n// -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.URI = 'Eq';\n/**\n * @category instances\n * @since 2.5.0\n */\nexports.eqStrict = {\n // tslint:disable-next-line: deprecation\n equals: strictEqual\n};\n/**\n * Use `eqStrict` instead\n *\n * @since 2.0.0\n * @deprecated\n */\nfunction strictEqual(a, b) {\n return a === b;\n}\nexports.strictEqual = strictEqual;\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.eqString = exports.eqStrict;\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.eqNumber = exports.eqStrict;\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.eqBoolean = exports.eqStrict;\n/**\n * @category instances\n * @since 2.0.0\n */\nfunction getStructEq(eqs) {\n return fromEquals(function (x, y) {\n for (var k in eqs) {\n if (!eqs[k].equals(x[k], y[k])) {\n return false;\n }\n }\n return true;\n });\n}\nexports.getStructEq = getStructEq;\n/**\n * Given a tuple of `Eq`s returns a `Eq` for the tuple\n *\n * @example\n * import { getTupleEq, eqString, eqNumber, eqBoolean } from 'fp-ts/Eq'\n *\n * const E = getTupleEq(eqString, eqNumber, eqBoolean)\n * assert.strictEqual(E.equals(['a', 1, true], ['a', 1, true]), true)\n * assert.strictEqual(E.equals(['a', 1, true], ['b', 1, true]), false)\n * assert.strictEqual(E.equals(['a', 1, true], ['a', 2, true]), false)\n * assert.strictEqual(E.equals(['a', 1, true], ['a', 1, false]), false)\n *\n * @category instances\n * @since 2.0.0\n */\nfunction getTupleEq() {\n var eqs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n eqs[_i] = arguments[_i];\n }\n return fromEquals(function (x, y) { return eqs.every(function (E, i) { return E.equals(x[i], y[i]); }); });\n}\nexports.getTupleEq = getTupleEq;\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.eqDate = {\n equals: function (x, y) { return x.valueOf() === y.valueOf(); }\n};\nvar empty = {\n equals: function () { return true; }\n};\n/**\n * @category instances\n * @since 2.6.0\n */\nfunction getMonoid() {\n return {\n concat: function (x, y) { return fromEquals(function (a, b) { return x.equals(a, b) && y.equals(a, b); }); },\n empty: empty\n };\n}\nexports.getMonoid = getMonoid;\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Contravariant = {\n URI: exports.URI,\n contramap: contramap_\n};\n// TODO: remove in v3\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.eq = exports.Contravariant;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.reduceRight = exports.reduceWithIndex = exports.reduce = exports.mapWithIndex = exports.map = exports.flatten = exports.extend = exports.duplicate = exports.chainFirst = exports.chain = exports.apSecond = exports.apFirst = exports.ap = exports.alt = exports.altW = exports.foldMap = exports.foldMapWithIndex = exports.intersperse = exports.prependToAll = exports.unzip = exports.zip = exports.zipWith = exports.fold = exports.concat = exports.of = exports.filterWithIndex = exports.filter = exports.copy = exports.modifyAt = exports.updateAt = exports.insertAt = exports.sort = exports.init = exports.last = exports.groupBy = exports.groupSort = exports.group = exports.getEq = exports.getSemigroup = exports.max = exports.min = exports.reverse = exports.tail = exports.head = exports.getShow = exports.unsnoc = exports.uncons = exports.fromArray = exports.snoc = exports.cons = void 0;\nexports.apS = exports.bind = exports.bindTo = exports.Do = exports.nonEmptyArray = exports.Comonad = exports.Alt = exports.TraversableWithIndex = exports.Traversable = exports.FoldableWithIndex = exports.Foldable = exports.Monad = exports.Applicative = exports.FunctorWithIndex = exports.Functor = exports.URI = exports.extract = exports.traverseWithIndex = exports.sequence = exports.traverse = exports.reduceRightWithIndex = void 0;\nvar RNEA = __importStar(require(\"./ReadonlyNonEmptyArray\"));\n/* tslint:enable:readonly-keyword */\n/**\n * Append an element to the front of an array, creating a new non empty array\n *\n * @example\n * import { cons } from 'fp-ts/NonEmptyArray'\n *\n * assert.deepStrictEqual(cons(1, [2, 3, 4]), [1, 2, 3, 4])\n *\n * @category constructors\n * @since 2.0.0\n */\nexports.cons = RNEA.cons;\n/**\n * Append an element to the end of an array, creating a new non empty array\n *\n * @example\n * import { snoc } from 'fp-ts/NonEmptyArray'\n *\n * assert.deepStrictEqual(snoc([1, 2, 3], 4), [1, 2, 3, 4])\n *\n * @category constructors\n * @since 2.0.0\n */\nexports.snoc = RNEA.snoc;\n/**\n * Builds a `NonEmptyArray` from an `Array` returning `none` if `as` is an empty array\n *\n * @category constructors\n * @since 2.0.0\n */\nexports.fromArray = RNEA.fromArray;\n/**\n * Produces a couple of the first element of the array, and a new array of the remaining elements, if any\n *\n * @example\n * import { cons, uncons } from 'fp-ts/NonEmptyArray'\n *\n * assert.deepStrictEqual(uncons(cons(1, [2, 3, 4])), [1, [2, 3, 4]])\n *\n * @category destructors\n * @since 2.9.0\n */\nexports.uncons = RNEA.uncons;\n/**\n * Produces a couple of a copy of the array without its last element, and that last element\n *\n * @example\n * import { snoc, unsnoc } from 'fp-ts/NonEmptyArray'\n *\n * assert.deepStrictEqual(unsnoc(snoc([1, 2, 3], 4)), [[1, 2, 3], 4])\n *\n * @category destructors\n * @since 2.9.0\n */\nexports.unsnoc = RNEA.unsnoc;\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.getShow = RNEA.getShow;\n/**\n * @since 2.0.0\n */\nexports.head = RNEA.head;\n/**\n * @since 2.0.0\n */\nexports.tail = RNEA.tail;\n/**\n * @category combinators\n * @since 2.0.0\n */\nexports.reverse = RNEA.reverse;\n/**\n * @since 2.0.0\n */\nexports.min = RNEA.min;\n/**\n * @since 2.0.0\n */\nexports.max = RNEA.max;\n/**\n * Builds a `Semigroup` instance for `NonEmptyArray`\n *\n * @category instances\n * @since 2.0.0\n */\nexports.getSemigroup = RNEA.getSemigroup;\n/**\n * @example\n * import { getEq, cons } from 'fp-ts/NonEmptyArray'\n * import { eqNumber } from 'fp-ts/Eq'\n *\n * const E = getEq(eqNumber)\n * assert.strictEqual(E.equals(cons(1, [2]), [1, 2]), true)\n * assert.strictEqual(E.equals(cons(1, [2]), [1, 3]), false)\n *\n * @category instances\n * @since 2.0.0\n */\nexports.getEq = RNEA.getEq;\nfunction group(E) {\n return RNEA.group(E);\n}\nexports.group = group;\n/**\n * Sort and then group the elements of an array into non empty arrays.\n *\n * @example\n * import { cons, groupSort } from 'fp-ts/NonEmptyArray'\n * import { ordNumber } from 'fp-ts/Ord'\n *\n * assert.deepStrictEqual(groupSort(ordNumber)([1, 2, 1, 1]), [cons(1, [1, 1]), cons(2, [])])\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.groupSort = RNEA.groupSort;\n/**\n * Splits an array into sub-non-empty-arrays stored in an object, based on the result of calling a `string`-returning\n * function on each element, and grouping the results according to values returned\n *\n * @example\n * import { cons, groupBy } from 'fp-ts/NonEmptyArray'\n *\n * assert.deepStrictEqual(groupBy((s: string) => String(s.length))(['foo', 'bar', 'foobar']), {\n * '3': cons('foo', ['bar']),\n * '6': cons('foobar', [])\n * })\n *\n * @category constructors\n * @since 2.0.0\n */\nexports.groupBy = RNEA.groupBy;\n/**\n * @since 2.0.0\n */\nexports.last = RNEA.last;\n/**\n * Get all but the last element of a non empty array, creating a new array.\n *\n * @example\n * import { init } from 'fp-ts/NonEmptyArray'\n *\n * assert.deepStrictEqual(init([1, 2, 3]), [1, 2])\n * assert.deepStrictEqual(init([1]), [])\n *\n * @since 2.2.0\n */\nexports.init = RNEA.init;\n/**\n * @category combinators\n * @since 2.0.0\n */\nexports.sort = RNEA.sort;\n/**\n * @since 2.0.0\n */\nexports.insertAt = RNEA.insertAt;\n/**\n * @since 2.0.0\n */\nexports.updateAt = RNEA.updateAt;\n/**\n * @since 2.0.0\n */\nexports.modifyAt = RNEA.modifyAt;\n/**\n * @category combinators\n * @since 2.0.0\n */\nfunction copy(nea) {\n var l = nea.length;\n var as = Array(l);\n for (var i = 0; i < l; i++) {\n as[i] = nea[i];\n }\n return as;\n}\nexports.copy = copy;\nfunction filter(predicate) {\n return RNEA.filter(predicate);\n}\nexports.filter = filter;\n/**\n * @since 2.0.0\n */\nexports.filterWithIndex = RNEA.filterWithIndex;\n/**\n * Wrap a value into the type constructor.\n *\n * @category Applicative\n * @since 2.0.0\n */\nexports.of = RNEA.of;\nfunction concat(fx, fy) {\n return RNEA.concat(fx, fy);\n}\nexports.concat = concat;\n/**\n * @since 2.5.0\n */\nexports.fold = RNEA.fold;\n/**\n * @category combinators\n * @since 2.5.1\n */\nexports.zipWith = RNEA.zipWith;\n/**\n * @category combinators\n * @since 2.5.1\n */\nexports.zip = RNEA.zip;\n/**\n * @since 2.5.1\n */\nexports.unzip = RNEA.unzip;\n/**\n * Prepend an element to every member of an array\n *\n * @example\n * import { cons, prependToAll } from 'fp-ts/NonEmptyArray'\n *\n * assert.deepStrictEqual(prependToAll(9)(cons(1, [2, 3, 4])), cons(9, [1, 9, 2, 9, 3, 9, 4]))\n *\n * @category combinators\n * @since 2.9.0\n */\nexports.prependToAll = RNEA.prependToAll;\n/**\n * Places an element in between members of an array\n *\n * @example\n * import { cons, intersperse } from 'fp-ts/NonEmptyArray'\n *\n * assert.deepStrictEqual(intersperse(9)(cons(1, [2, 3, 4])), cons(1, [9, 2, 9, 3, 9, 4]))\n *\n * @category combinators\n * @since 2.9.0\n */\nexports.intersperse = RNEA.intersperse;\n// -------------------------------------------------------------------------------------\n// non-pipeables\n// -------------------------------------------------------------------------------------\nvar map_ = RNEA.Functor.map;\nvar mapWithIndex_ = RNEA.FunctorWithIndex.mapWithIndex;\nvar ap_ = RNEA.Applicative.ap;\nvar chain_ = RNEA.Monad.chain;\nvar extend_ = RNEA.Comonad.extend;\nvar reduce_ = RNEA.Foldable.reduce;\nvar foldMap_ = RNEA.Foldable.foldMap;\nvar reduceRight_ = RNEA.Foldable.reduceRight;\nvar traverse_ = RNEA.Traversable.traverse;\nvar alt_ = RNEA.Alt.alt;\nvar reduceWithIndex_ = RNEA.FoldableWithIndex\n .reduceWithIndex;\nvar foldMapWithIndex_ = RNEA.FoldableWithIndex\n .foldMapWithIndex;\nvar reduceRightWithIndex_ = RNEA.FoldableWithIndex\n .reduceRightWithIndex;\nvar traverseWithIndex_ = RNEA.TraversableWithIndex\n .traverseWithIndex;\n// -------------------------------------------------------------------------------------\n// pipeables\n// -------------------------------------------------------------------------------------\n/**\n * @category FoldableWithIndex\n * @since 2.0.0\n */\nexports.foldMapWithIndex = RNEA.foldMapWithIndex;\n/**\n * @category Foldable\n * @since 2.0.0\n */\nexports.foldMap = RNEA.foldMap;\n/**\n * Less strict version of [`alt`](#alt).\n *\n * @category Alt\n * @since 2.9.0\n */\nexports.altW = RNEA.altW;\n/**\n * Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to\n * types of kind `* -> *`.\n *\n * @category Alt\n * @since 2.6.2\n */\nexports.alt = RNEA.alt;\n/**\n * Apply a function to an argument under a type constructor.\n *\n * @category Apply\n * @since 2.0.0\n */\nexports.ap = RNEA.ap;\n/**\n * Combine two effectful actions, keeping only the result of the first.\n *\n * Derivable from `Apply`.\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.apFirst = RNEA.apFirst;\n/**\n * Combine two effectful actions, keeping only the result of the second.\n *\n * Derivable from `Apply`.\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.apSecond = RNEA.apSecond;\n/**\n * Composes computations in sequence, using the return value of one computation to determine the next computation.\n *\n * @category Monad\n * @since 2.0.0\n */\nexports.chain = RNEA.chain;\n/**\n * Composes computations in sequence, using the return value of one computation to determine the next computation and\n * keeping only the result of the first.\n *\n * Derivable from `Monad`.\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.chainFirst = RNEA.chainFirst;\n/**\n * Derivable from `Extend`.\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.duplicate = RNEA.duplicate;\n/**\n * @category Extend\n * @since 2.0.0\n */\nexports.extend = RNEA.extend;\n/**\n * Derivable from `Monad`.\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.flatten = RNEA.flatten;\n/**\n * `map` can be used to turn functions `(a: A) => B` into functions `(fa: F) => F` whose argument and return types\n * use the type constructor `F` to represent some computational context.\n *\n * @category Functor\n * @since 2.0.0\n */\nexports.map = RNEA.map;\n/**\n * @category FunctorWithIndex\n * @since 2.0.0\n */\nexports.mapWithIndex = RNEA.mapWithIndex;\n/**\n * @category Foldable\n * @since 2.0.0\n */\nexports.reduce = RNEA.reduce;\n/**\n * @category FoldableWithIndex\n * @since 2.0.0\n */\nexports.reduceWithIndex = RNEA.reduceWithIndex;\n/**\n * @category Foldable\n * @since 2.0.0\n */\nexports.reduceRight = RNEA.reduceRight;\n/**\n * @category FoldableWithIndex\n * @since 2.0.0\n */\nexports.reduceRightWithIndex = RNEA.reduceRightWithIndex;\n/**\n * @since 2.6.3\n */\nexports.traverse = RNEA.traverse;\n/**\n * @since 2.6.3\n */\nexports.sequence = RNEA.sequence;\n/**\n * @since 2.6.3\n */\nexports.traverseWithIndex = RNEA.traverseWithIndex;\n/**\n * @since 2.7.0\n */\nexports.extract = exports.head;\n// -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.URI = 'NonEmptyArray';\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Functor = {\n URI: exports.URI,\n map: map_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.FunctorWithIndex = {\n URI: exports.URI,\n map: map_,\n mapWithIndex: mapWithIndex_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Applicative = {\n URI: exports.URI,\n map: map_,\n ap: ap_,\n of: exports.of\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Monad = {\n URI: exports.URI,\n map: map_,\n ap: ap_,\n of: exports.of,\n chain: chain_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Foldable = {\n URI: exports.URI,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.FoldableWithIndex = {\n URI: exports.URI,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n reduceWithIndex: reduceWithIndex_,\n foldMapWithIndex: foldMapWithIndex_,\n reduceRightWithIndex: reduceRightWithIndex_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Traversable = {\n URI: exports.URI,\n map: map_,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n traverse: traverse_,\n sequence: exports.sequence\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.TraversableWithIndex = {\n URI: exports.URI,\n map: map_,\n mapWithIndex: mapWithIndex_,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n traverse: traverse_,\n sequence: exports.sequence,\n reduceWithIndex: reduceWithIndex_,\n foldMapWithIndex: foldMapWithIndex_,\n reduceRightWithIndex: reduceRightWithIndex_,\n traverseWithIndex: traverseWithIndex_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Alt = {\n URI: exports.URI,\n map: map_,\n alt: alt_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Comonad = {\n URI: exports.URI,\n map: map_,\n extend: extend_,\n extract: exports.extract\n};\n// TODO: remove in v3\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.nonEmptyArray = {\n URI: exports.URI,\n of: exports.of,\n map: map_,\n mapWithIndex: mapWithIndex_,\n ap: ap_,\n chain: chain_,\n extend: extend_,\n extract: exports.extract,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n traverse: traverse_,\n sequence: exports.sequence,\n reduceWithIndex: reduceWithIndex_,\n foldMapWithIndex: foldMapWithIndex_,\n reduceRightWithIndex: reduceRightWithIndex_,\n traverseWithIndex: traverseWithIndex_,\n alt: alt_\n};\n// -------------------------------------------------------------------------------------\n// do notation\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.9.0\n */\nexports.Do = \n/*#__PURE__*/\nexports.of({});\n/**\n * @since 2.8.0\n */\nexports.bindTo = RNEA.bindTo;\n/**\n * @since 2.8.0\n */\nexports.bind = RNEA.bind;\n// -------------------------------------------------------------------------------------\n// pipeable sequence S\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.8.0\n */\nexports.apS = RNEA.apS;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getApplySemigroup = exports.getOrd = exports.getEq = exports.getShow = exports.URI = exports.wilt = exports.wither = exports.sequence = exports.traverse = exports.partitionMap = exports.partition = exports.filterMap = exports.filter = exports.separate = exports.compact = exports.reduceRight = exports.foldMap = exports.reduce = exports.duplicate = exports.extend = exports.throwError = exports.zero = exports.alt = exports.altW = exports.flatten = exports.chainFirst = exports.chain = exports.of = exports.apSecond = exports.apFirst = exports.ap = exports.map = exports.chainNullableK = exports.mapNullable = exports.fromNullableK = exports.getOrElse = exports.getOrElseW = exports.toUndefined = exports.toNullable = exports.fold = exports.fromEither = exports.getRight = exports.getLeft = exports.tryCatch = exports.fromPredicate = exports.fromNullable = exports.some = exports.none = exports.isNone = exports.isSome = void 0;\nexports.sequenceArray = exports.traverseArray = exports.traverseArrayWithIndex = exports.apS = exports.bind = exports.bindTo = exports.Do = exports.getRefinement = exports.exists = exports.elem = exports.option = exports.MonadThrow = exports.Witherable = exports.Traversable = exports.Filterable = exports.Compactable = exports.Extend = exports.Alternative = exports.Alt = exports.Foldable = exports.Monad = exports.Applicative = exports.Functor = exports.getMonoid = exports.getLastMonoid = exports.getFirstMonoid = exports.getApplyMonoid = void 0;\nvar function_1 = require(\"./function\");\n// -------------------------------------------------------------------------------------\n// guards\n// -------------------------------------------------------------------------------------\n/**\n * Returns `true` if the option is an instance of `Some`, `false` otherwise.\n *\n * @example\n * import { some, none, isSome } from 'fp-ts/Option'\n *\n * assert.strictEqual(isSome(some(1)), true)\n * assert.strictEqual(isSome(none), false)\n *\n * @category guards\n * @since 2.0.0\n */\nvar isSome = function (fa) { return fa._tag === 'Some'; };\nexports.isSome = isSome;\n/**\n * Returns `true` if the option is `None`, `false` otherwise.\n *\n * @example\n * import { some, none, isNone } from 'fp-ts/Option'\n *\n * assert.strictEqual(isNone(some(1)), false)\n * assert.strictEqual(isNone(none), true)\n *\n * @category guards\n * @since 2.0.0\n */\nvar isNone = function (fa) { return fa._tag === 'None'; };\nexports.isNone = isNone;\n// -------------------------------------------------------------------------------------\n// constructors\n// -------------------------------------------------------------------------------------\n/**\n * `None` doesn't have a constructor, instead you can use it directly as a value. Represents a missing value.\n *\n * @category constructors\n * @since 2.0.0\n */\nexports.none = { _tag: 'None' };\n/**\n * Constructs a `Some`. Represents an optional value that exists.\n *\n * @category constructors\n * @since 2.0.0\n */\nvar some = function (a) { return ({ _tag: 'Some', value: a }); };\nexports.some = some;\n/**\n * Constructs a new `Option` from a nullable type. If the value is `null` or `undefined`, returns `None`, otherwise\n * returns the value wrapped in a `Some`.\n *\n * @example\n * import { none, some, fromNullable } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(fromNullable(undefined), none)\n * assert.deepStrictEqual(fromNullable(null), none)\n * assert.deepStrictEqual(fromNullable(1), some(1))\n *\n * @category constructors\n * @since 2.0.0\n */\nfunction fromNullable(a) {\n return a == null ? exports.none : exports.some(a);\n}\nexports.fromNullable = fromNullable;\nfunction fromPredicate(predicate) {\n return function (a) { return (predicate(a) ? exports.some(a) : exports.none); };\n}\nexports.fromPredicate = fromPredicate;\n/**\n * Transforms an exception into an `Option`. If `f` throws, returns `None`, otherwise returns the output wrapped in a\n * `Some`.\n *\n * @example\n * import { none, some, tryCatch } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(\n * tryCatch(() => {\n * throw new Error()\n * }),\n * none\n * )\n * assert.deepStrictEqual(tryCatch(() => 1), some(1))\n *\n * @category constructors\n * @since 2.0.0\n */\nfunction tryCatch(f) {\n try {\n return exports.some(f());\n }\n catch (e) {\n return exports.none;\n }\n}\nexports.tryCatch = tryCatch;\n/**\n * Returns the `Left` value of an `Either` if possible.\n *\n * @example\n * import { getLeft, none, some } from 'fp-ts/Option'\n * import { right, left } from 'fp-ts/Either'\n *\n * assert.deepStrictEqual(getLeft(right(1)), none)\n * assert.deepStrictEqual(getLeft(left('a')), some('a'))\n *\n * @category constructors\n * @since 2.0.0\n */\nfunction getLeft(ma) {\n return ma._tag === 'Right' ? exports.none : exports.some(ma.left);\n}\nexports.getLeft = getLeft;\n/**\n * Returns the `Right` value of an `Either` if possible.\n *\n * @example\n * import { getRight, none, some } from 'fp-ts/Option'\n * import { right, left } from 'fp-ts/Either'\n *\n * assert.deepStrictEqual(getRight(right(1)), some(1))\n * assert.deepStrictEqual(getRight(left('a')), none)\n *\n * @category constructors\n * @since 2.0.0\n */\nfunction getRight(ma) {\n return ma._tag === 'Left' ? exports.none : exports.some(ma.right);\n}\nexports.getRight = getRight;\n/**\n * Transforms an `Either` to an `Option` discarding the error.\n *\n * Alias of [getRight](#getRight)\n *\n * Derivable from `MonadThrow`.\n *\n * @category constructors\n * @since 2.0.0\n */\nexports.fromEither = getRight;\n// -------------------------------------------------------------------------------------\n// destructors\n// -------------------------------------------------------------------------------------\n/**\n * Takes a (lazy) default value, a function, and an `Option` value, if the `Option` value is `None` the default value is\n * returned, otherwise the function is applied to the value inside the `Some` and the result is returned.\n *\n * @example\n * import { some, none, fold } from 'fp-ts/Option'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.strictEqual(\n * pipe(\n * some(1),\n * fold(() => 'a none', a => `a some containing ${a}`)\n * ),\n * 'a some containing 1'\n * )\n *\n * assert.strictEqual(\n * pipe(\n * none,\n * fold(() => 'a none', a => `a some containing ${a}`)\n * ),\n * 'a none'\n * )\n *\n * @category destructors\n * @since 2.0.0\n */\nfunction fold(onNone, onSome) {\n return function (ma) { return (exports.isNone(ma) ? onNone() : onSome(ma.value)); };\n}\nexports.fold = fold;\n/**\n * Extracts the value out of the structure, if it exists. Otherwise returns `null`.\n *\n * @example\n * import { some, none, toNullable } from 'fp-ts/Option'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.strictEqual(\n * pipe(\n * some(1),\n * toNullable\n * ),\n * 1\n * )\n * assert.strictEqual(\n * pipe(\n * none,\n * toNullable\n * ),\n * null\n * )\n *\n * @category destructors\n * @since 2.0.0\n */\nfunction toNullable(ma) {\n return exports.isNone(ma) ? null : ma.value;\n}\nexports.toNullable = toNullable;\n/**\n * Extracts the value out of the structure, if it exists. Otherwise returns `undefined`.\n *\n * @example\n * import { some, none, toUndefined } from 'fp-ts/Option'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.strictEqual(\n * pipe(\n * some(1),\n * toUndefined\n * ),\n * 1\n * )\n * assert.strictEqual(\n * pipe(\n * none,\n * toUndefined\n * ),\n * undefined\n * )\n *\n * @category destructors\n * @since 2.0.0\n */\nfunction toUndefined(ma) {\n return exports.isNone(ma) ? undefined : ma.value;\n}\nexports.toUndefined = toUndefined;\n/**\n * Less strict version of [`getOrElse`](#getOrElse).\n *\n * @category destructors\n * @since 2.6.0\n */\nvar getOrElseW = function (onNone) { return function (ma) { return (exports.isNone(ma) ? onNone() : ma.value); }; };\nexports.getOrElseW = getOrElseW;\n/**\n * Extracts the value out of the structure, if it exists. Otherwise returns the given default value\n *\n * @example\n * import { some, none, getOrElse } from 'fp-ts/Option'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.strictEqual(\n * pipe(\n * some(1),\n * getOrElse(() => 0)\n * ),\n * 1\n * )\n * assert.strictEqual(\n * pipe(\n * none,\n * getOrElse(() => 0)\n * ),\n * 0\n * )\n *\n * @category destructors\n * @since 2.0.0\n */\nexports.getOrElse = exports.getOrElseW;\n// -------------------------------------------------------------------------------------\n// combinators\n// -------------------------------------------------------------------------------------\n/**\n * Returns a *smart constructor* from a function that returns a nullable value.\n *\n * @example\n * import { fromNullableK, none, some } from 'fp-ts/Option'\n *\n * const f = (s: string): number | undefined => {\n * const n = parseFloat(s)\n * return isNaN(n) ? undefined : n\n * }\n *\n * const g = fromNullableK(f)\n *\n * assert.deepStrictEqual(g('1'), some(1))\n * assert.deepStrictEqual(g('a'), none)\n *\n * @category combinators\n * @since 2.9.0\n */\nfunction fromNullableK(f) {\n return function () {\n var a = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n a[_i] = arguments[_i];\n }\n return fromNullable(f.apply(void 0, a));\n };\n}\nexports.fromNullableK = fromNullableK;\n/**\n * @category combinators\n * @since 2.0.0\n * @deprecated\n */\nexports.mapNullable = chainNullableK;\n/**\n * This is `chain` + `fromNullable`, useful when working with optional values.\n *\n * @example\n * import { some, none, fromNullable, chainNullableK } from 'fp-ts/Option'\n * import { pipe } from 'fp-ts/function'\n *\n * interface Employee {\n * company?: {\n * address?: {\n * street?: {\n * name?: string\n * }\n * }\n * }\n * }\n *\n * const employee1: Employee = { company: { address: { street: { name: 'high street' } } } }\n *\n * assert.deepStrictEqual(\n * pipe(\n * fromNullable(employee1.company),\n * chainNullableK(company => company.address),\n * chainNullableK(address => address.street),\n * chainNullableK(street => street.name)\n * ),\n * some('high street')\n * )\n *\n * const employee2: Employee = { company: { address: { street: {} } } }\n *\n * assert.deepStrictEqual(\n * pipe(\n * fromNullable(employee2.company),\n * chainNullableK(company => company.address),\n * chainNullableK(address => address.street),\n * chainNullableK(street => street.name)\n * ),\n * none\n * )\n *\n * @category combinators\n * @since 2.9.0\n */\nfunction chainNullableK(f) {\n return function (ma) { return (exports.isNone(ma) ? exports.none : fromNullable(f(ma.value))); };\n}\nexports.chainNullableK = chainNullableK;\n// -------------------------------------------------------------------------------------\n// non-pipeables\n// -------------------------------------------------------------------------------------\nvar map_ = function (fa, f) { return function_1.pipe(fa, exports.map(f)); };\nvar ap_ = function (fab, fa) { return function_1.pipe(fab, exports.ap(fa)); };\nvar chain_ = function (ma, f) { return function_1.pipe(ma, exports.chain(f)); };\nvar reduce_ = function (fa, b, f) { return function_1.pipe(fa, exports.reduce(b, f)); };\nvar foldMap_ = function (M) {\n var foldMapM = exports.foldMap(M);\n return function (fa, f) { return function_1.pipe(fa, foldMapM(f)); };\n};\nvar reduceRight_ = function (fa, b, f) { return function_1.pipe(fa, exports.reduceRight(b, f)); };\nvar traverse_ = function (F) {\n var traverseF = exports.traverse(F);\n return function (ta, f) { return function_1.pipe(ta, traverseF(f)); };\n};\n/* istanbul ignore next */\nvar alt_ = function (fa, that) { return function_1.pipe(fa, exports.alt(that)); };\nvar filter_ = function (fa, predicate) {\n return function_1.pipe(fa, exports.filter(predicate));\n};\n/* istanbul ignore next */\nvar filterMap_ = function (fa, f) { return function_1.pipe(fa, exports.filterMap(f)); };\n/* istanbul ignore next */\nvar extend_ = function (wa, f) { return function_1.pipe(wa, exports.extend(f)); };\n/* istanbul ignore next */\nvar partition_ = function (fa, predicate) { return function_1.pipe(fa, exports.partition(predicate)); };\n/* istanbul ignore next */\nvar partitionMap_ = function (fa, f) { return function_1.pipe(fa, exports.partitionMap(f)); };\n/* istanbul ignore next */\nvar wither_ = function (F) {\n var witherF = exports.wither(F);\n return function (fa, f) { return function_1.pipe(fa, witherF(f)); };\n};\n/* istanbul ignore next */\nvar wilt_ = function (F) {\n var wiltF = exports.wilt(F);\n return function (fa, f) { return function_1.pipe(fa, wiltF(f)); };\n};\n// -------------------------------------------------------------------------------------\n// pipeables\n// -------------------------------------------------------------------------------------\n/**\n * `map` can be used to turn functions `(a: A) => B` into functions `(fa: F) => F` whose argument and return types\n * use the type constructor `F` to represent some computational context.\n *\n * @category Functor\n * @since 2.0.0\n */\nvar map = function (f) { return function (fa) {\n return exports.isNone(fa) ? exports.none : exports.some(f(fa.value));\n}; };\nexports.map = map;\n/**\n * Apply a function to an argument under a type constructor.\n *\n * @category Apply\n * @since 2.0.0\n */\nvar ap = function (fa) { return function (fab) {\n return exports.isNone(fab) ? exports.none : exports.isNone(fa) ? exports.none : exports.some(fab.value(fa.value));\n}; };\nexports.ap = ap;\n/**\n * Combine two effectful actions, keeping only the result of the first.\n *\n * Derivable from `Apply`.\n *\n * @category combinators\n * @since 2.0.0\n */\nvar apFirst = function (fb) {\n return function_1.flow(exports.map(function (a) { return function () { return a; }; }), exports.ap(fb));\n};\nexports.apFirst = apFirst;\n/**\n * Combine two effectful actions, keeping only the result of the second.\n *\n * Derivable from `Apply`.\n *\n * @category combinators\n * @since 2.0.0\n */\nvar apSecond = function (fb) {\n return function_1.flow(exports.map(function () { return function (b) { return b; }; }), exports.ap(fb));\n};\nexports.apSecond = apSecond;\n/**\n * Wrap a value into the type constructor.\n *\n * @category Applicative\n * @since 2.7.0\n */\nexports.of = exports.some;\n/**\n * Composes computations in sequence, using the return value of one computation to determine the next computation.\n *\n * @category Monad\n * @since 2.0.0\n */\nvar chain = function (f) { return function (ma) {\n return exports.isNone(ma) ? exports.none : f(ma.value);\n}; };\nexports.chain = chain;\n/**\n * Composes computations in sequence, using the return value of one computation to determine the next computation and\n * keeping only the result of the first.\n *\n * Derivable from `Monad`.\n *\n * @category combinators\n * @since 2.0.0\n */\nvar chainFirst = function (f) {\n return exports.chain(function (a) {\n return function_1.pipe(f(a), exports.map(function () { return a; }));\n });\n};\nexports.chainFirst = chainFirst;\n/**\n * Derivable from `Monad`.\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.flatten = \n/*#__PURE__*/\nexports.chain(function_1.identity);\n/**\n * Less strict version of [`alt`](#alt).\n *\n * @category Alt\n * @since 2.9.0\n */\nvar altW = function (that) { return function (fa) {\n return exports.isNone(fa) ? that() : fa;\n}; };\nexports.altW = altW;\n/**\n * Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to\n * types of kind `* -> *`.\n *\n * In case of `Option` returns the left-most non-`None` value.\n *\n * @example\n * import * as O from 'fp-ts/Option'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(\n * pipe(\n * O.some('a'),\n * O.alt(() => O.some('b'))\n * ),\n * O.some('a')\n * )\n * assert.deepStrictEqual(\n * pipe(\n * O.none,\n * O.alt(() => O.some('b'))\n * ),\n * O.some('b')\n * )\n *\n * @category Alt\n * @since 2.0.0\n */\nexports.alt = exports.altW;\n/**\n * @category Alternative\n * @since 2.7.0\n */\nvar zero = function () { return exports.none; };\nexports.zero = zero;\n/**\n * @category MonadThrow\n * @since 2.7.0\n */\nvar throwError = function () { return exports.none; };\nexports.throwError = throwError;\n/**\n * @category Extend\n * @since 2.0.0\n */\nvar extend = function (f) { return function (wa) {\n return exports.isNone(wa) ? exports.none : exports.some(f(wa));\n}; };\nexports.extend = extend;\n/**\n * Derivable from `Extend`.\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.duplicate = \n/*#__PURE__*/\nexports.extend(function_1.identity);\n/**\n * @category Foldable\n * @since 2.0.0\n */\nvar reduce = function (b, f) { return function (fa) {\n return exports.isNone(fa) ? b : f(b, fa.value);\n}; };\nexports.reduce = reduce;\n/**\n * @category Foldable\n * @since 2.0.0\n */\nvar foldMap = function (M) { return function (f) { return function (fa) {\n return exports.isNone(fa) ? M.empty : f(fa.value);\n}; }; };\nexports.foldMap = foldMap;\n/**\n * @category Foldable\n * @since 2.0.0\n */\nvar reduceRight = function (b, f) { return function (fa) {\n return exports.isNone(fa) ? b : f(fa.value, b);\n}; };\nexports.reduceRight = reduceRight;\n/**\n * @category Compactable\n * @since 2.0.0\n */\nexports.compact = exports.flatten;\nvar defaultSeparate = { left: exports.none, right: exports.none };\n/**\n * @category Compactable\n * @since 2.0.0\n */\nvar separate = function (ma) {\n var o = function_1.pipe(ma, exports.map(function (e) { return ({\n left: getLeft(e),\n right: getRight(e)\n }); }));\n return exports.isNone(o) ? defaultSeparate : o.value;\n};\nexports.separate = separate;\n/**\n * @category Filterable\n * @since 2.0.0\n */\nvar filter = function (predicate) { return function (fa) { return (exports.isNone(fa) ? exports.none : predicate(fa.value) ? fa : exports.none); }; };\nexports.filter = filter;\n/**\n * @category Filterable\n * @since 2.0.0\n */\nvar filterMap = function (f) { return function (fa) {\n return exports.isNone(fa) ? exports.none : f(fa.value);\n}; };\nexports.filterMap = filterMap;\n/**\n * @category Filterable\n * @since 2.0.0\n */\nvar partition = function (predicate) { return function (fa) {\n return {\n left: filter_(fa, function (a) { return !predicate(a); }),\n right: filter_(fa, predicate)\n };\n}; };\nexports.partition = partition;\n/**\n * @category Filterable\n * @since 2.0.0\n */\nvar partitionMap = function (f) { return function_1.flow(exports.map(f), exports.separate); };\nexports.partitionMap = partitionMap;\n/**\n * @category Traversable\n * @since 2.6.3\n */\nvar traverse = function (F) { return function (f) { return function (ta) { return (exports.isNone(ta) ? F.of(exports.none) : F.map(f(ta.value), exports.some)); }; }; };\nexports.traverse = traverse;\n/**\n * @category Traversable\n * @since 2.6.3\n */\nvar sequence = function (F) { return function (ta) { return (exports.isNone(ta) ? F.of(exports.none) : F.map(ta.value, exports.some)); }; };\nexports.sequence = sequence;\n/**\n * @category Witherable\n * @since 2.6.5\n */\nvar wither = function (F) { return function (f) { return function (fa) { return (exports.isNone(fa) ? F.of(exports.none) : f(fa.value)); }; }; };\nexports.wither = wither;\n/**\n * @category Witherable\n * @since 2.6.5\n */\nvar wilt = function (F) { return function (f) { return function (fa) {\n return exports.isNone(fa)\n ? F.of({\n left: exports.none,\n right: exports.none\n })\n : F.map(f(fa.value), function (e) { return ({\n left: getLeft(e),\n right: getRight(e)\n }); });\n}; }; };\nexports.wilt = wilt;\n// -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.URI = 'Option';\n/**\n * @category instances\n * @since 2.0.0\n */\nfunction getShow(S) {\n return {\n show: function (ma) { return (exports.isNone(ma) ? 'none' : \"some(\" + S.show(ma.value) + \")\"); }\n };\n}\nexports.getShow = getShow;\n/**\n * @example\n * import { none, some, getEq } from 'fp-ts/Option'\n * import { eqNumber } from 'fp-ts/Eq'\n *\n * const E = getEq(eqNumber)\n * assert.strictEqual(E.equals(none, none), true)\n * assert.strictEqual(E.equals(none, some(1)), false)\n * assert.strictEqual(E.equals(some(1), none), false)\n * assert.strictEqual(E.equals(some(1), some(2)), false)\n * assert.strictEqual(E.equals(some(1), some(1)), true)\n *\n * @category instances\n * @since 2.0.0\n */\nfunction getEq(E) {\n return {\n equals: function (x, y) { return x === y || (exports.isNone(x) ? exports.isNone(y) : exports.isNone(y) ? false : E.equals(x.value, y.value)); }\n };\n}\nexports.getEq = getEq;\n/**\n * The `Ord` instance allows `Option` values to be compared with\n * `compare`, whenever there is an `Ord` instance for\n * the type the `Option` contains.\n *\n * `None` is considered to be less than any `Some` value.\n *\n *\n * @example\n * import { none, some, getOrd } from 'fp-ts/Option'\n * import { ordNumber } from 'fp-ts/Ord'\n *\n * const O = getOrd(ordNumber)\n * assert.strictEqual(O.compare(none, none), 0)\n * assert.strictEqual(O.compare(none, some(1)), -1)\n * assert.strictEqual(O.compare(some(1), none), 1)\n * assert.strictEqual(O.compare(some(1), some(2)), -1)\n * assert.strictEqual(O.compare(some(1), some(1)), 0)\n *\n * @category instances\n * @since 2.0.0\n */\nfunction getOrd(O) {\n return {\n equals: getEq(O).equals,\n compare: function (x, y) { return (x === y ? 0 : exports.isSome(x) ? (exports.isSome(y) ? O.compare(x.value, y.value) : 1) : -1); }\n };\n}\nexports.getOrd = getOrd;\n/**\n * `Apply` semigroup\n *\n * | x | y | concat(x, y) |\n * | ------- | ------- | ------------------ |\n * | none | none | none |\n * | some(a) | none | none |\n * | none | some(a) | none |\n * | some(a) | some(b) | some(concat(a, b)) |\n *\n * @example\n * import { getApplySemigroup, some, none } from 'fp-ts/Option'\n * import { semigroupSum } from 'fp-ts/Semigroup'\n *\n * const S = getApplySemigroup(semigroupSum)\n * assert.deepStrictEqual(S.concat(none, none), none)\n * assert.deepStrictEqual(S.concat(some(1), none), none)\n * assert.deepStrictEqual(S.concat(none, some(1)), none)\n * assert.deepStrictEqual(S.concat(some(1), some(2)), some(3))\n *\n * @category instances\n * @since 2.0.0\n */\nfunction getApplySemigroup(S) {\n return {\n concat: function (x, y) { return (exports.isSome(x) && exports.isSome(y) ? exports.some(S.concat(x.value, y.value)) : exports.none); }\n };\n}\nexports.getApplySemigroup = getApplySemigroup;\n/**\n * @category instances\n * @since 2.0.0\n */\nfunction getApplyMonoid(M) {\n return {\n concat: getApplySemigroup(M).concat,\n empty: exports.some(M.empty)\n };\n}\nexports.getApplyMonoid = getApplyMonoid;\n/**\n * Monoid returning the left-most non-`None` value\n *\n * | x | y | concat(x, y) |\n * | ------- | ------- | ------------ |\n * | none | none | none |\n * | some(a) | none | some(a) |\n * | none | some(a) | some(a) |\n * | some(a) | some(b) | some(a) |\n *\n * @example\n * import { getFirstMonoid, some, none } from 'fp-ts/Option'\n *\n * const M = getFirstMonoid()\n * assert.deepStrictEqual(M.concat(none, none), none)\n * assert.deepStrictEqual(M.concat(some(1), none), some(1))\n * assert.deepStrictEqual(M.concat(none, some(1)), some(1))\n * assert.deepStrictEqual(M.concat(some(1), some(2)), some(1))\n *\n * @category instances\n * @since 2.0.0\n */\nfunction getFirstMonoid() {\n return {\n concat: function (x, y) { return (exports.isNone(x) ? y : x); },\n empty: exports.none\n };\n}\nexports.getFirstMonoid = getFirstMonoid;\n/**\n * Monoid returning the right-most non-`None` value\n *\n * | x | y | concat(x, y) |\n * | ------- | ------- | ------------ |\n * | none | none | none |\n * | some(a) | none | some(a) |\n * | none | some(a) | some(a) |\n * | some(a) | some(b) | some(b) |\n *\n * @example\n * import { getLastMonoid, some, none } from 'fp-ts/Option'\n *\n * const M = getLastMonoid()\n * assert.deepStrictEqual(M.concat(none, none), none)\n * assert.deepStrictEqual(M.concat(some(1), none), some(1))\n * assert.deepStrictEqual(M.concat(none, some(1)), some(1))\n * assert.deepStrictEqual(M.concat(some(1), some(2)), some(2))\n *\n * @category instances\n * @since 2.0.0\n */\nfunction getLastMonoid() {\n return {\n concat: function (x, y) { return (exports.isNone(y) ? x : y); },\n empty: exports.none\n };\n}\nexports.getLastMonoid = getLastMonoid;\n/**\n * Monoid returning the left-most non-`None` value. If both operands are `Some`s then the inner values are\n * concatenated using the provided `Semigroup`\n *\n * | x | y | concat(x, y) |\n * | ------- | ------- | ------------------ |\n * | none | none | none |\n * | some(a) | none | some(a) |\n * | none | some(a) | some(a) |\n * | some(a) | some(b) | some(concat(a, b)) |\n *\n * @example\n * import { getMonoid, some, none } from 'fp-ts/Option'\n * import { semigroupSum } from 'fp-ts/Semigroup'\n *\n * const M = getMonoid(semigroupSum)\n * assert.deepStrictEqual(M.concat(none, none), none)\n * assert.deepStrictEqual(M.concat(some(1), none), some(1))\n * assert.deepStrictEqual(M.concat(none, some(1)), some(1))\n * assert.deepStrictEqual(M.concat(some(1), some(2)), some(3))\n *\n * @category instances\n * @since 2.0.0\n */\nfunction getMonoid(S) {\n return {\n concat: function (x, y) { return (exports.isNone(x) ? y : exports.isNone(y) ? x : exports.some(S.concat(x.value, y.value))); },\n empty: exports.none\n };\n}\nexports.getMonoid = getMonoid;\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Functor = {\n URI: exports.URI,\n map: map_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Applicative = {\n URI: exports.URI,\n map: map_,\n ap: ap_,\n of: exports.of\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Monad = {\n URI: exports.URI,\n map: map_,\n ap: ap_,\n of: exports.of,\n chain: chain_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Foldable = {\n URI: exports.URI,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Alt = {\n URI: exports.URI,\n map: map_,\n alt: alt_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Alternative = {\n URI: exports.URI,\n map: map_,\n ap: ap_,\n of: exports.of,\n alt: alt_,\n zero: exports.zero\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Extend = {\n URI: exports.URI,\n map: map_,\n extend: extend_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Compactable = {\n URI: exports.URI,\n compact: exports.compact,\n separate: exports.separate\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Filterable = {\n URI: exports.URI,\n map: map_,\n compact: exports.compact,\n separate: exports.separate,\n filter: filter_,\n filterMap: filterMap_,\n partition: partition_,\n partitionMap: partitionMap_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Traversable = {\n URI: exports.URI,\n map: map_,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n traverse: traverse_,\n sequence: exports.sequence\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Witherable = {\n URI: exports.URI,\n map: map_,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n traverse: traverse_,\n sequence: exports.sequence,\n compact: exports.compact,\n separate: exports.separate,\n filter: filter_,\n filterMap: filterMap_,\n partition: partition_,\n partitionMap: partitionMap_,\n wither: wither_,\n wilt: wilt_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.MonadThrow = {\n URI: exports.URI,\n map: map_,\n ap: ap_,\n of: exports.of,\n chain: chain_,\n throwError: exports.throwError\n};\n// TODO: remove in v3\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.option = {\n URI: exports.URI,\n map: map_,\n of: exports.of,\n ap: ap_,\n chain: chain_,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n traverse: traverse_,\n sequence: exports.sequence,\n zero: exports.zero,\n alt: alt_,\n extend: extend_,\n compact: exports.compact,\n separate: exports.separate,\n filter: filter_,\n filterMap: filterMap_,\n partition: partition_,\n partitionMap: partitionMap_,\n wither: wither_,\n wilt: wilt_,\n throwError: exports.throwError\n};\n// -------------------------------------------------------------------------------------\n// utils\n// -------------------------------------------------------------------------------------\n/**\n * Returns `true` if `ma` contains `a`\n *\n * @example\n * import { some, none, elem } from 'fp-ts/Option'\n * import { eqNumber } from 'fp-ts/Eq'\n *\n * assert.strictEqual(elem(eqNumber)(1, some(1)), true)\n * assert.strictEqual(elem(eqNumber)(2, some(1)), false)\n * assert.strictEqual(elem(eqNumber)(1, none), false)\n *\n * @since 2.0.0\n */\nfunction elem(E) {\n return function (a, ma) { return (exports.isNone(ma) ? false : E.equals(a, ma.value)); };\n}\nexports.elem = elem;\n/**\n * Returns `true` if the predicate is satisfied by the wrapped value\n *\n * @example\n * import { some, none, exists } from 'fp-ts/Option'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.strictEqual(\n * pipe(\n * some(1),\n * exists(n => n > 0)\n * ),\n * true\n * )\n * assert.strictEqual(\n * pipe(\n * some(1),\n * exists(n => n > 1)\n * ),\n * false\n * )\n * assert.strictEqual(\n * pipe(\n * none,\n * exists(n => n > 0)\n * ),\n * false\n * )\n *\n * @since 2.0.0\n */\nfunction exists(predicate) {\n return function (ma) { return (exports.isNone(ma) ? false : predicate(ma.value)); };\n}\nexports.exists = exists;\n/**\n * Returns a `Refinement` (i.e. a custom type guard) from a `Option` returning function.\n * This function ensures that a custom type guard definition is type-safe.\n *\n * ```ts\n * import { some, none, getRefinement } from 'fp-ts/Option'\n *\n * type A = { type: 'A' }\n * type B = { type: 'B' }\n * type C = A | B\n *\n * const isA = (c: C): c is A => c.type === 'B' // <= typo but typescript doesn't complain\n * const isA = getRefinement(c => (c.type === 'B' ? some(c) : none)) // static error: Type '\"B\"' is not assignable to type '\"A\"'\n * ```\n *\n * @since 2.0.0\n */\nfunction getRefinement(getOption) {\n return function (a) { return exports.isSome(getOption(a)); };\n}\nexports.getRefinement = getRefinement;\n// -------------------------------------------------------------------------------------\n// do notation\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.9.0\n */\nexports.Do = \n/*#__PURE__*/\nexports.of({});\n/**\n * @since 2.8.0\n */\nvar bindTo = function (name) { return exports.map(function_1.bindTo_(name)); };\nexports.bindTo = bindTo;\n/**\n * @since 2.8.0\n */\nvar bind = function (name, f) {\n return exports.chain(function (a) {\n return function_1.pipe(f(a), exports.map(function (b) { return function_1.bind_(a, name, b); }));\n });\n};\nexports.bind = bind;\n// -------------------------------------------------------------------------------------\n// pipeable sequence S\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.8.0\n */\nvar apS = function (name, fb) {\n return function_1.flow(exports.map(function (a) { return function (b) { return function_1.bind_(a, name, b); }; }), exports.ap(fb));\n};\nexports.apS = apS;\n// -------------------------------------------------------------------------------------\n// array utils\n// -------------------------------------------------------------------------------------\n/**\n *\n * @since 2.9.0\n */\nvar traverseArrayWithIndex = function (f) { return function (arr) {\n // tslint:disable-next-line: readonly-array\n var result = [];\n for (var i = 0; i < arr.length; i++) {\n var b = f(i, arr[i]);\n if (exports.isNone(b)) {\n return exports.none;\n }\n result.push(b.value);\n }\n return exports.some(result);\n}; };\nexports.traverseArrayWithIndex = traverseArrayWithIndex;\n/**\n * Runs an action for every element in array and accumulates the results in option\n *\n * this function has the same behavior of `A.sequence(O.option)` but it's optimized and performs better\n *\n * @example\n *\n * import * as A from 'fp-ts/Array'\n * import { traverseArray, some, fromPredicate, none } from 'fp-ts/Option'\n * import { pipe } from 'fp-ts/function'\n *\n * const arr = A.range(0, 10)\n * assert.deepStrictEqual(pipe(arr, traverseArray(some)), some(arr))\n * assert.deepStrictEqual(pipe(arr, traverseArray(fromPredicate((x) => x > 5))), none)\n *\n * @since 2.9.0\n */\nvar traverseArray = function (f) { return exports.traverseArrayWithIndex(function (_, a) { return f(a); }); };\nexports.traverseArray = traverseArray;\n/**\n * get an array of option and convert it to option of array\n *\n * this function has the same behavior of `A.sequence(O.option)` but it's optimized and performs better\n *\n * @example\n *\n * import * as A from 'fp-ts/Array'\n * import { sequenceArray, some, none, fromPredicate } from 'fp-ts/Option'\n * import { pipe } from 'fp-ts/function'\n *\n * const arr = A.range(0, 10)\n * assert.deepStrictEqual(pipe(arr, A.map(some), sequenceArray), some(arr))\n * assert.deepStrictEqual(pipe(arr, A.map(fromPredicate(x => x > 8)), sequenceArray), none)\n *\n * @since 2.9.0\n */\nexports.sequenceArray = \n/*#__PURE__*/\nexports.traverseArray(function_1.identity);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ord = exports.Contravariant = exports.ordDate = exports.URI = exports.contramap = exports.getDualOrd = exports.getTupleOrd = exports.getMonoid = exports.getSemigroup = exports.fromCompare = exports.between = exports.clamp = exports.max = exports.min = exports.geq = exports.leq = exports.gt = exports.lt = exports.ordBoolean = exports.ordNumber = exports.ordString = void 0;\nvar Ordering_1 = require(\"./Ordering\");\nvar function_1 = require(\"./function\");\n// default compare for primitive types\nfunction compare(x, y) {\n return x < y ? -1 : x > y ? 1 : 0;\n}\nfunction strictEqual(a, b) {\n return a === b;\n}\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.ordString = {\n equals: strictEqual,\n compare: compare\n};\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.ordNumber = {\n equals: strictEqual,\n compare: compare\n};\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.ordBoolean = {\n equals: strictEqual,\n compare: compare\n};\n// TODO: curry in v3\n/**\n * Test whether one value is _strictly less than_ another\n *\n * @since 2.0.0\n */\nfunction lt(O) {\n return function (x, y) { return O.compare(x, y) === -1; };\n}\nexports.lt = lt;\n// TODO: curry in v3\n/**\n * Test whether one value is _strictly greater than_ another\n *\n * @since 2.0.0\n */\nfunction gt(O) {\n return function (x, y) { return O.compare(x, y) === 1; };\n}\nexports.gt = gt;\n// TODO: curry in v3\n/**\n * Test whether one value is _non-strictly less than_ another\n *\n * @since 2.0.0\n */\nfunction leq(O) {\n return function (x, y) { return O.compare(x, y) !== 1; };\n}\nexports.leq = leq;\n// TODO: curry in v3\n/**\n * Test whether one value is _non-strictly greater than_ another\n *\n * @since 2.0.0\n */\nfunction geq(O) {\n return function (x, y) { return O.compare(x, y) !== -1; };\n}\nexports.geq = geq;\n// TODO: curry in v3\n/**\n * Take the minimum of two values. If they are considered equal, the first argument is chosen\n *\n * @since 2.0.0\n */\nfunction min(O) {\n return function (x, y) { return (O.compare(x, y) === 1 ? y : x); };\n}\nexports.min = min;\n// TODO: curry in v3\n/**\n * Take the maximum of two values. If they are considered equal, the first argument is chosen\n *\n * @since 2.0.0\n */\nfunction max(O) {\n return function (x, y) { return (O.compare(x, y) === -1 ? y : x); };\n}\nexports.max = max;\n/**\n * Clamp a value between a minimum and a maximum\n *\n * @since 2.0.0\n */\nfunction clamp(O) {\n var minO = min(O);\n var maxO = max(O);\n return function (low, hi) { return function (x) { return maxO(minO(x, hi), low); }; };\n}\nexports.clamp = clamp;\n/**\n * Test whether a value is between a minimum and a maximum (inclusive)\n *\n * @since 2.0.0\n */\nfunction between(O) {\n var lessThanO = lt(O);\n var greaterThanO = gt(O);\n return function (low, hi) { return function (x) { return (lessThanO(x, low) || greaterThanO(x, hi) ? false : true); }; };\n}\nexports.between = between;\n/**\n * @category constructors\n * @since 2.0.0\n */\nfunction fromCompare(compare) {\n var optimizedCompare = function (x, y) { return (x === y ? 0 : compare(x, y)); };\n return {\n equals: function (x, y) { return optimizedCompare(x, y) === 0; },\n compare: optimizedCompare\n };\n}\nexports.fromCompare = fromCompare;\n/**\n * Use `getMonoid` instead\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nfunction getSemigroup() {\n return {\n concat: function (x, y) { return fromCompare(function (a, b) { return Ordering_1.monoidOrdering.concat(x.compare(a, b), y.compare(a, b)); }); }\n };\n}\nexports.getSemigroup = getSemigroup;\n/**\n * Returns a `Monoid` such that:\n *\n * - its `concat(ord1, ord2)` operation will order first by `ord1`, and then by `ord2`\n * - its `empty` value is an `Ord` that always considers compared elements equal\n *\n * @example\n * import { sort } from 'fp-ts/Array'\n * import { contramap, getDualOrd, getMonoid, ordBoolean, ordNumber, ordString } from 'fp-ts/Ord'\n * import { pipe } from 'fp-ts/function'\n * import { fold } from 'fp-ts/Monoid'\n *\n * interface User {\n * id: number\n * name: string\n * age: number\n * rememberMe: boolean\n * }\n *\n * const byName = pipe(\n * ordString,\n * contramap((p: User) => p.name)\n * )\n *\n * const byAge = pipe(\n * ordNumber,\n * contramap((p: User) => p.age)\n * )\n *\n * const byRememberMe = pipe(\n * ordBoolean,\n * contramap((p: User) => p.rememberMe)\n * )\n *\n * const M = getMonoid()\n *\n * const users: Array = [\n * { id: 1, name: 'Guido', age: 47, rememberMe: false },\n * { id: 2, name: 'Guido', age: 46, rememberMe: true },\n * { id: 3, name: 'Giulio', age: 44, rememberMe: false },\n * { id: 4, name: 'Giulio', age: 44, rememberMe: true }\n * ]\n *\n * // sort by name, then by age, then by `rememberMe`\n * const O1 = fold(M)([byName, byAge, byRememberMe])\n * assert.deepStrictEqual(sort(O1)(users), [\n * { id: 3, name: 'Giulio', age: 44, rememberMe: false },\n * { id: 4, name: 'Giulio', age: 44, rememberMe: true },\n * { id: 2, name: 'Guido', age: 46, rememberMe: true },\n * { id: 1, name: 'Guido', age: 47, rememberMe: false }\n * ])\n *\n * // now `rememberMe = true` first, then by name, then by age\n * const O2 = fold(M)([getDualOrd(byRememberMe), byName, byAge])\n * assert.deepStrictEqual(sort(O2)(users), [\n * { id: 4, name: 'Giulio', age: 44, rememberMe: true },\n * { id: 2, name: 'Guido', age: 46, rememberMe: true },\n * { id: 3, name: 'Giulio', age: 44, rememberMe: false },\n * { id: 1, name: 'Guido', age: 47, rememberMe: false }\n * ])\n *\n * @category instances\n * @since 2.4.0\n */\nfunction getMonoid() {\n return {\n // tslint:disable-next-line: deprecation\n concat: getSemigroup().concat,\n empty: fromCompare(function () { return 0; })\n };\n}\nexports.getMonoid = getMonoid;\n/**\n * Given a tuple of `Ord`s returns an `Ord` for the tuple\n *\n * @example\n * import { getTupleOrd, ordString, ordNumber, ordBoolean } from 'fp-ts/Ord'\n *\n * const O = getTupleOrd(ordString, ordNumber, ordBoolean)\n * assert.strictEqual(O.compare(['a', 1, true], ['b', 2, true]), -1)\n * assert.strictEqual(O.compare(['a', 1, true], ['a', 2, true]), -1)\n * assert.strictEqual(O.compare(['a', 1, true], ['a', 1, false]), 1)\n *\n * @category instances\n * @since 2.0.0\n */\nfunction getTupleOrd() {\n var ords = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n ords[_i] = arguments[_i];\n }\n var len = ords.length;\n return fromCompare(function (x, y) {\n var i = 0;\n for (; i < len - 1; i++) {\n var r = ords[i].compare(x[i], y[i]);\n if (r !== 0) {\n return r;\n }\n }\n return ords[i].compare(x[i], y[i]);\n });\n}\nexports.getTupleOrd = getTupleOrd;\n/**\n * @category combinators\n * @since 2.0.0\n */\nfunction getDualOrd(O) {\n return fromCompare(function (x, y) { return O.compare(y, x); });\n}\nexports.getDualOrd = getDualOrd;\n// -------------------------------------------------------------------------------------\n// non-pipeables\n// -------------------------------------------------------------------------------------\n/* istanbul ignore next */\nvar contramap_ = function (fa, f) { return function_1.pipe(fa, exports.contramap(f)); };\n// -------------------------------------------------------------------------------------\n// pipeables\n// -------------------------------------------------------------------------------------\n/**\n * @category Contravariant\n * @since 2.0.0\n */\nvar contramap = function (f) { return function (fa) {\n return fromCompare(function (x, y) { return fa.compare(f(x), f(y)); });\n}; };\nexports.contramap = contramap;\n// -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.URI = 'Ord';\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.ordDate = \n/*#__PURE__*/\nfunction_1.pipe(exports.ordNumber, \n/*#__PURE__*/\nexports.contramap(function (date) { return date.valueOf(); }));\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Contravariant = {\n URI: exports.URI,\n contramap: contramap_\n};\n// TODO: remove in v3\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.ord = exports.Contravariant;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.invert = exports.monoidOrdering = exports.semigroupOrdering = exports.eqOrdering = exports.sign = void 0;\n/**\n * @since 2.0.0\n */\nfunction sign(n) {\n return n <= -1 ? -1 : n >= 1 ? 1 : 0;\n}\nexports.sign = sign;\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.eqOrdering = {\n equals: function (x, y) { return x === y; }\n};\n/**\n * Use `monoidOrdering` instead\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nexports.semigroupOrdering = {\n concat: function (x, y) { return (x !== 0 ? x : y); }\n};\n/**\n * @category instances\n * @since 2.4.0\n */\nexports.monoidOrdering = {\n // tslint:disable-next-line: deprecation\n concat: exports.semigroupOrdering.concat,\n empty: 0\n};\n/**\n * @since 2.0.0\n */\nfunction invert(O) {\n switch (O) {\n case -1:\n return 1;\n case 1:\n return -1;\n default:\n return 0;\n }\n}\nexports.invert = invert;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.intersperse = exports.prependToAll = exports.unzip = exports.zip = exports.zipWith = exports.sort = exports.lefts = exports.rights = exports.reverse = exports.modifyAt = exports.deleteAt = exports.updateAt = exports.insertAt = exports.findLastIndex = exports.findLastMap = exports.findLast = exports.findFirstMap = exports.findFirst = exports.findIndex = exports.dropLeftWhile = exports.dropRight = exports.dropLeft = exports.spanLeft = exports.takeLeftWhile = exports.takeRight = exports.takeLeft = exports.init = exports.tail = exports.last = exports.head = exports.snoc = exports.cons = exports.lookup = exports.isOutOfBound = exports.isNonEmpty = exports.isEmpty = exports.scanRight = exports.scanLeft = exports.foldRight = exports.foldLeft = exports.flatten = exports.replicate = exports.range = exports.makeBy = exports.getOrd = exports.getEq = exports.getMonoid = exports.getShow = exports.toArray = exports.fromArray = void 0;\nexports.FunctorWithIndex = exports.Functor = exports.URI = exports.unfold = exports.wilt = exports.wither = exports.traverseWithIndex = exports.sequence = exports.traverse = exports.reduceRightWithIndex = exports.reduceRight = exports.reduceWithIndex = exports.foldMap = exports.reduce = exports.foldMapWithIndex = exports.duplicate = exports.extend = exports.filterWithIndex = exports.partitionMapWithIndex = exports.partitionMap = exports.partitionWithIndex = exports.partition = exports.compact = exports.filterMap = exports.filterMapWithIndex = exports.filter = exports.separate = exports.mapWithIndex = exports.map = exports.chainFirst = exports.chainWithIndex = exports.chain = exports.apSecond = exports.apFirst = exports.ap = exports.alt = exports.altW = exports.zero = exports.of = exports.difference = exports.intersection = exports.union = exports.comprehension = exports.chunksOf = exports.splitAt = exports.chop = exports.sortBy = exports.uniq = exports.elem = exports.rotate = void 0;\nexports.apS = exports.bind = exports.bindTo = exports.Do = exports.some = exports.every = exports.empty = exports.unsafeDeleteAt = exports.unsafeUpdateAt = exports.unsafeInsertAt = exports.readonlyArray = exports.Witherable = exports.TraversableWithIndex = exports.Traversable = exports.FoldableWithIndex = exports.Foldable = exports.FilterableWithIndex = exports.Filterable = exports.Compactable = exports.Extend = exports.Alternative = exports.Alt = exports.Unfoldable = exports.Monad = exports.Applicative = void 0;\nvar function_1 = require(\"./function\");\nvar O = __importStar(require(\"./Option\"));\nvar Ord_1 = require(\"./Ord\");\n// -------------------------------------------------------------------------------------\n// model\n// -------------------------------------------------------------------------------------\n/**\n * @category constructors\n * @since 2.5.0\n */\n// tslint:disable-next-line: readonly-array\nfunction fromArray(as) {\n var l = as.length;\n if (l === 0) {\n return exports.empty;\n }\n var ras = Array(l);\n for (var i = 0; i < l; i++) {\n ras[i] = as[i];\n }\n return ras;\n}\nexports.fromArray = fromArray;\n/**\n * @category destructors\n * @since 2.5.0\n */\n// tslint:disable-next-line: readonly-array\nfunction toArray(ras) {\n var l = ras.length;\n var as = Array(l);\n for (var i = 0; i < l; i++) {\n as[i] = ras[i];\n }\n return as;\n}\nexports.toArray = toArray;\n/**\n * @category instances\n * @since 2.5.0\n */\nfunction getShow(S) {\n return {\n show: function (as) { return \"[\" + as.map(S.show).join(', ') + \"]\"; }\n };\n}\nexports.getShow = getShow;\nvar concat = function (x, y) {\n var lenx = x.length;\n if (lenx === 0) {\n return y;\n }\n var leny = y.length;\n if (leny === 0) {\n return x;\n }\n var r = Array(lenx + leny);\n for (var i = 0; i < lenx; i++) {\n r[i] = x[i];\n }\n for (var i = 0; i < leny; i++) {\n r[i + lenx] = y[i];\n }\n return r;\n};\n/**\n * Returns a `Monoid` for `ReadonlyArray`\n *\n * @example\n * import { getMonoid } from 'fp-ts/ReadonlyArray'\n *\n * const M = getMonoid()\n * assert.deepStrictEqual(M.concat([1, 2], [3, 4]), [1, 2, 3, 4])\n *\n * @category instances\n * @since 2.5.0\n */\nfunction getMonoid() {\n return {\n concat: concat,\n empty: exports.empty\n };\n}\nexports.getMonoid = getMonoid;\n/**\n * Derives an `Eq` over the `ReadonlyArray` of a given element type from the `Eq` of that type. The derived `Eq` defines two\n * arrays as equal if all elements of both arrays are compared equal pairwise with the given `E`. In case of arrays of\n * different lengths, the result is non equality.\n *\n * @example\n * import { eqString } from 'fp-ts/Eq'\n * import { getEq } from 'fp-ts/ReadonlyArray'\n *\n * const E = getEq(eqString)\n * assert.strictEqual(E.equals(['a', 'b'], ['a', 'b']), true)\n * assert.strictEqual(E.equals(['a'], []), false)\n *\n * @category instances\n * @since 2.5.0\n */\nfunction getEq(E) {\n return {\n equals: function (xs, ys) { return xs === ys || (xs.length === ys.length && xs.every(function (x, i) { return E.equals(x, ys[i]); })); }\n };\n}\nexports.getEq = getEq;\n/**\n * Derives an `Ord` over the `ReadonlyArray` of a given element type from the `Ord` of that type. The ordering between two such\n * arrays is equal to: the first non equal comparison of each arrays elements taken pairwise in increasing order, in\n * case of equality over all the pairwise elements; the longest array is considered the greatest, if both arrays have\n * the same length, the result is equality.\n *\n * @example\n * import { getOrd } from 'fp-ts/ReadonlyArray'\n * import { ordString } from 'fp-ts/Ord'\n *\n * const O = getOrd(ordString)\n * assert.strictEqual(O.compare(['b'], ['a']), 1)\n * assert.strictEqual(O.compare(['a'], ['a']), 0)\n * assert.strictEqual(O.compare(['a'], ['b']), -1)\n *\n *\n * @category instances\n * @since 2.5.0\n */\nfunction getOrd(O) {\n return Ord_1.fromCompare(function (a, b) {\n var aLen = a.length;\n var bLen = b.length;\n var len = Math.min(aLen, bLen);\n for (var i = 0; i < len; i++) {\n var ordering = O.compare(a[i], b[i]);\n if (ordering !== 0) {\n return ordering;\n }\n }\n return Ord_1.ordNumber.compare(aLen, bLen);\n });\n}\nexports.getOrd = getOrd;\n/**\n * Return a list of length `n` with element `i` initialized with `f(i)`\n *\n * @example\n * import { makeBy } from 'fp-ts/ReadonlyArray'\n *\n * const double = (n: number): number => n * 2\n * assert.deepStrictEqual(makeBy(5, double), [0, 2, 4, 6, 8])\n *\n * @category constructors\n * @since 2.5.0\n */\nfunction makeBy(n, f) {\n // tslint:disable-next-line: readonly-array\n var r = [];\n for (var i = 0; i < n; i++) {\n r.push(f(i));\n }\n return r;\n}\nexports.makeBy = makeBy;\n/**\n * Create an array containing a range of integers, including both endpoints\n *\n * @example\n * import { range } from 'fp-ts/ReadonlyArray'\n *\n * assert.deepStrictEqual(range(1, 5), [1, 2, 3, 4, 5])\n *\n * @category constructors\n * @since 2.5.0\n */\nfunction range(start, end) {\n return makeBy(end - start + 1, function (i) { return start + i; });\n}\nexports.range = range;\n/**\n * Create an array containing a value repeated the specified number of times\n *\n * @example\n * import { replicate } from 'fp-ts/ReadonlyArray'\n *\n * assert.deepStrictEqual(replicate(3, 'a'), ['a', 'a', 'a'])\n *\n * @category constructors\n * @since 2.5.0\n */\nfunction replicate(n, a) {\n return makeBy(n, function () { return a; });\n}\nexports.replicate = replicate;\n/**\n * Removes one level of nesting\n *\n * Derivable from `Monad`.\n *\n * @example\n * import { flatten } from 'fp-ts/ReadonlyArray'\n *\n * assert.deepStrictEqual(flatten([[1], [2], [3]]), [1, 2, 3])\n *\n * @category combinators\n * @since 2.5.0\n */\nfunction flatten(mma) {\n var rLen = 0;\n var len = mma.length;\n for (var i = 0; i < len; i++) {\n rLen += mma[i].length;\n }\n var r = Array(rLen);\n var start = 0;\n for (var i = 0; i < len; i++) {\n var arr = mma[i];\n var l = arr.length;\n for (var j = 0; j < l; j++) {\n r[j + start] = arr[j];\n }\n start += l;\n }\n return r;\n}\nexports.flatten = flatten;\n/**\n * Break an array into its first element and remaining elements\n *\n * @example\n * import { foldLeft } from 'fp-ts/ReadonlyArray'\n *\n * const len: (as: ReadonlyArray) => number = foldLeft(() => 0, (_, tail) => 1 + len(tail))\n * assert.strictEqual(len([1, 2, 3]), 3)\n *\n * @category destructors\n * @since 2.5.0\n */\nfunction foldLeft(onEmpty, onCons) {\n return function (as) { return (isEmpty(as) ? onEmpty() : onCons(as[0], as.slice(1))); };\n}\nexports.foldLeft = foldLeft;\n/**\n * Break an array into its initial elements and the last element\n *\n * @category destructors\n * @since 2.5.0\n */\nfunction foldRight(onEmpty, onCons) {\n return function (as) { return (isEmpty(as) ? onEmpty() : onCons(as.slice(0, as.length - 1), as[as.length - 1])); };\n}\nexports.foldRight = foldRight;\n/**\n * Same as `reduce` but it carries over the intermediate steps\n *\n * @example\n * import { scanLeft } from 'fp-ts/ReadonlyArray'\n *\n * assert.deepStrictEqual(scanLeft(10, (b, a: number) => b - a)([1, 2, 3]), [10, 9, 7, 4])\n *\n * @category combinators\n * @since 2.5.0\n */\nfunction scanLeft(b, f) {\n return function (as) {\n var l = as.length;\n var r = new Array(l + 1);\n r[0] = b;\n for (var i = 0; i < l; i++) {\n r[i + 1] = f(r[i], as[i]);\n }\n return r;\n };\n}\nexports.scanLeft = scanLeft;\n/**\n * Fold an array from the right, keeping all intermediate results instead of only the final result\n *\n * @example\n * import { scanRight } from 'fp-ts/ReadonlyArray'\n *\n * assert.deepStrictEqual(scanRight(10, (a: number, b) => b - a)([1, 2, 3]), [4, 5, 7, 10])\n *\n * @category combinators\n * @since 2.5.0\n */\nfunction scanRight(b, f) {\n return function (as) {\n var l = as.length;\n var r = new Array(l + 1);\n r[l] = b;\n for (var i = l - 1; i >= 0; i--) {\n r[i] = f(as[i], r[i + 1]);\n }\n return r;\n };\n}\nexports.scanRight = scanRight;\n/**\n * Test whether an array is empty\n *\n * @example\n * import { isEmpty } from 'fp-ts/ReadonlyArray'\n *\n * assert.strictEqual(isEmpty([]), true)\n *\n * @since 2.5.0\n */\nfunction isEmpty(as) {\n return as.length === 0;\n}\nexports.isEmpty = isEmpty;\n/**\n * Test whether an array is non empty narrowing down the type to `NonEmptyReadonlyArray`\n *\n * @category guards\n * @since 2.5.0\n */\nfunction isNonEmpty(as) {\n return as.length > 0;\n}\nexports.isNonEmpty = isNonEmpty;\n/**\n * Test whether an array contains a particular index\n *\n * @since 2.5.0\n */\nfunction isOutOfBound(i, as) {\n return i < 0 || i >= as.length;\n}\nexports.isOutOfBound = isOutOfBound;\nfunction lookup(i, as) {\n return as === undefined ? function (as) { return lookup(i, as); } : isOutOfBound(i, as) ? O.none : O.some(as[i]);\n}\nexports.lookup = lookup;\nfunction cons(head, tail) {\n if (tail === undefined) {\n return function (tail) { return cons(head, tail); };\n }\n var len = tail.length;\n var r = Array(len + 1);\n for (var i = 0; i < len; i++) {\n r[i + 1] = tail[i];\n }\n r[0] = head;\n return r;\n}\nexports.cons = cons;\n// TODO: curry and make data-last in v3\n/**\n * Append an element to the end of an array, creating a new non empty array\n *\n * @example\n * import { snoc } from 'fp-ts/ReadonlyArray'\n *\n * assert.deepStrictEqual(snoc([1, 2, 3], 4), [1, 2, 3, 4])\n *\n * @category constructors\n * @since 2.5.0\n */\nfunction snoc(init, end) {\n var len = init.length;\n var r = Array(len + 1);\n for (var i = 0; i < len; i++) {\n r[i] = init[i];\n }\n r[len] = end;\n return r;\n}\nexports.snoc = snoc;\n/**\n * Get the first element in an array, or `None` if the array is empty\n *\n * @example\n * import { head } from 'fp-ts/ReadonlyArray'\n * import { some, none } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(head([1, 2, 3]), some(1))\n * assert.deepStrictEqual(head([]), none)\n *\n * @since 2.5.0\n */\nfunction head(as) {\n return isEmpty(as) ? O.none : O.some(as[0]);\n}\nexports.head = head;\n/**\n * Get the last element in an array, or `None` if the array is empty\n *\n * @example\n * import { last } from 'fp-ts/ReadonlyArray'\n * import { some, none } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(last([1, 2, 3]), some(3))\n * assert.deepStrictEqual(last([]), none)\n *\n * @since 2.5.0\n */\nfunction last(as) {\n return lookup(as.length - 1, as);\n}\nexports.last = last;\n/**\n * Get all but the first element of an array, creating a new array, or `None` if the array is empty\n *\n * @example\n * import { tail } from 'fp-ts/ReadonlyArray'\n * import { some, none } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(tail([1, 2, 3]), some([2, 3]))\n * assert.deepStrictEqual(tail([]), none)\n *\n * @since 2.5.0\n */\nfunction tail(as) {\n return isEmpty(as) ? O.none : O.some(as.slice(1));\n}\nexports.tail = tail;\n/**\n * Get all but the last element of an array, creating a new array, or `None` if the array is empty\n *\n * @example\n * import { init } from 'fp-ts/ReadonlyArray'\n * import { some, none } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(init([1, 2, 3]), some([1, 2]))\n * assert.deepStrictEqual(init([]), none)\n *\n * @since 2.5.0\n */\nfunction init(as) {\n var len = as.length;\n return len === 0 ? O.none : O.some(as.slice(0, len - 1));\n}\nexports.init = init;\n/**\n * Keep only a number of elements from the start of an array, creating a new array.\n * `n` must be a natural number\n *\n * @example\n * import { takeLeft } from 'fp-ts/ReadonlyArray'\n *\n * assert.deepStrictEqual(takeLeft(2)([1, 2, 3]), [1, 2])\n *\n * @category combinators\n * @since 2.5.0\n */\nfunction takeLeft(n) {\n return function (as) { return as.slice(0, n); };\n}\nexports.takeLeft = takeLeft;\n/**\n * Keep only a number of elements from the end of an array, creating a new array.\n * `n` must be a natural number\n *\n * @example\n * import { takeRight } from 'fp-ts/ReadonlyArray'\n *\n * assert.deepStrictEqual(takeRight(2)([1, 2, 3, 4, 5]), [4, 5])\n *\n * @since 2.5.0\n */\nfunction takeRight(n) {\n return function (as) { return (n === 0 ? exports.empty : as.slice(-n)); };\n}\nexports.takeRight = takeRight;\nfunction takeLeftWhile(predicate) {\n return function (as) {\n var i = spanIndexUncurry(as, predicate);\n var init = Array(i);\n for (var j = 0; j < i; j++) {\n init[j] = as[j];\n }\n return init;\n };\n}\nexports.takeLeftWhile = takeLeftWhile;\nvar spanIndexUncurry = function (as, predicate) {\n var l = as.length;\n var i = 0;\n for (; i < l; i++) {\n if (!predicate(as[i])) {\n break;\n }\n }\n return i;\n};\nfunction spanLeft(predicate) {\n return function (as) {\n var i = spanIndexUncurry(as, predicate);\n var init = Array(i);\n for (var j = 0; j < i; j++) {\n init[j] = as[j];\n }\n var l = as.length;\n var rest = Array(l - i);\n for (var j = i; j < l; j++) {\n rest[j - i] = as[j];\n }\n return { init: init, rest: rest };\n };\n}\nexports.spanLeft = spanLeft;\n/**\n * Drop a number of elements from the start of an array, creating a new array\n *\n * @example\n * import { dropLeft } from 'fp-ts/ReadonlyArray'\n *\n * assert.deepStrictEqual(dropLeft(2)([1, 2, 3]), [3])\n *\n * @category combinators\n * @since 2.5.0\n */\nfunction dropLeft(n) {\n return function (as) { return as.slice(n, as.length); };\n}\nexports.dropLeft = dropLeft;\n/**\n * Drop a number of elements from the end of an array, creating a new array\n *\n * @example\n * import { dropRight } from 'fp-ts/ReadonlyArray'\n *\n * assert.deepStrictEqual(dropRight(2)([1, 2, 3, 4, 5]), [1, 2, 3])\n *\n * @category combinators\n * @since 2.5.0\n */\nfunction dropRight(n) {\n return function (as) { return as.slice(0, as.length - n); };\n}\nexports.dropRight = dropRight;\n/**\n * Remove the longest initial subarray for which all element satisfy the specified predicate, creating a new array\n *\n * @example\n * import { dropLeftWhile } from 'fp-ts/ReadonlyArray'\n *\n * assert.deepStrictEqual(dropLeftWhile((n: number) => n % 2 === 1)([1, 3, 2, 4, 5]), [2, 4, 5])\n *\n * @category combinators\n * @since 2.5.0\n */\nfunction dropLeftWhile(predicate) {\n return function (as) {\n var i = spanIndexUncurry(as, predicate);\n var l = as.length;\n var rest = Array(l - i);\n for (var j = i; j < l; j++) {\n rest[j - i] = as[j];\n }\n return rest;\n };\n}\nexports.dropLeftWhile = dropLeftWhile;\n/**\n * Find the first index for which a predicate holds\n *\n * @example\n * import { findIndex } from 'fp-ts/ReadonlyArray'\n * import { some, none } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(findIndex((n: number) => n === 2)([1, 2, 3]), some(1))\n * assert.deepStrictEqual(findIndex((n: number) => n === 2)([]), none)\n *\n * @since 2.5.0\n */\nfunction findIndex(predicate) {\n return function (as) {\n var len = as.length;\n for (var i = 0; i < len; i++) {\n if (predicate(as[i])) {\n return O.some(i);\n }\n }\n return O.none;\n };\n}\nexports.findIndex = findIndex;\nfunction findFirst(predicate) {\n return function (as) {\n var len = as.length;\n for (var i = 0; i < len; i++) {\n if (predicate(as[i])) {\n return O.some(as[i]);\n }\n }\n return O.none;\n };\n}\nexports.findFirst = findFirst;\n/**\n * Find the first element returned by an option based selector function\n *\n * @example\n * import { findFirstMap } from 'fp-ts/ReadonlyArray'\n * import { some, none } from 'fp-ts/Option'\n *\n * interface Person {\n * name: string\n * age?: number\n * }\n *\n * const persons: ReadonlyArray = [{ name: 'John' }, { name: 'Mary', age: 45 }, { name: 'Joey', age: 28 }]\n *\n * // returns the name of the first person that has an age\n * assert.deepStrictEqual(findFirstMap((p: Person) => (p.age === undefined ? none : some(p.name)))(persons), some('Mary'))\n *\n * @since 2.5.0\n */\nfunction findFirstMap(f) {\n return function (as) {\n var len = as.length;\n for (var i = 0; i < len; i++) {\n var v = f(as[i]);\n if (O.isSome(v)) {\n return v;\n }\n }\n return O.none;\n };\n}\nexports.findFirstMap = findFirstMap;\nfunction findLast(predicate) {\n return function (as) {\n var len = as.length;\n for (var i = len - 1; i >= 0; i--) {\n if (predicate(as[i])) {\n return O.some(as[i]);\n }\n }\n return O.none;\n };\n}\nexports.findLast = findLast;\n/**\n * Find the last element returned by an option based selector function\n *\n * @example\n * import { findLastMap } from 'fp-ts/ReadonlyArray'\n * import { some, none } from 'fp-ts/Option'\n *\n * interface Person {\n * name: string\n * age?: number\n * }\n *\n * const persons: ReadonlyArray = [{ name: 'John' }, { name: 'Mary', age: 45 }, { name: 'Joey', age: 28 }]\n *\n * // returns the name of the last person that has an age\n * assert.deepStrictEqual(findLastMap((p: Person) => (p.age === undefined ? none : some(p.name)))(persons), some('Joey'))\n *\n * @since 2.5.0\n */\nfunction findLastMap(f) {\n return function (as) {\n var len = as.length;\n for (var i = len - 1; i >= 0; i--) {\n var v = f(as[i]);\n if (O.isSome(v)) {\n return v;\n }\n }\n return O.none;\n };\n}\nexports.findLastMap = findLastMap;\n/**\n * Returns the index of the last element of the list which matches the predicate\n *\n * @example\n * import { findLastIndex } from 'fp-ts/ReadonlyArray'\n * import { some, none } from 'fp-ts/Option'\n *\n * interface X {\n * a: number\n * b: number\n * }\n * const xs: ReadonlyArray = [{ a: 1, b: 0 }, { a: 1, b: 1 }]\n * assert.deepStrictEqual(findLastIndex((x: { a: number }) => x.a === 1)(xs), some(1))\n * assert.deepStrictEqual(findLastIndex((x: { a: number }) => x.a === 4)(xs), none)\n *\n *\n * @since 2.5.0\n */\nfunction findLastIndex(predicate) {\n return function (as) {\n var len = as.length;\n for (var i = len - 1; i >= 0; i--) {\n if (predicate(as[i])) {\n return O.some(i);\n }\n }\n return O.none;\n };\n}\nexports.findLastIndex = findLastIndex;\n/**\n * Insert an element at the specified index, creating a new array, or returning `None` if the index is out of bounds\n *\n * @example\n * import { insertAt } from 'fp-ts/ReadonlyArray'\n * import { some } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(insertAt(2, 5)([1, 2, 3, 4]), some([1, 2, 5, 3, 4]))\n *\n * @since 2.5.0\n */\nfunction insertAt(i, a) {\n return function (as) { return (i < 0 || i > as.length ? O.none : O.some(unsafeInsertAt(i, a, as))); };\n}\nexports.insertAt = insertAt;\n/**\n * Change the element at the specified index, creating a new array, or returning `None` if the index is out of bounds\n *\n * @example\n * import { updateAt } from 'fp-ts/ReadonlyArray'\n * import { some, none } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(updateAt(1, 1)([1, 2, 3]), some([1, 1, 3]))\n * assert.deepStrictEqual(updateAt(1, 1)([]), none)\n *\n * @since 2.5.0\n */\nfunction updateAt(i, a) {\n return function (as) { return (isOutOfBound(i, as) ? O.none : O.some(unsafeUpdateAt(i, a, as))); };\n}\nexports.updateAt = updateAt;\n/**\n * Delete the element at the specified index, creating a new array, or returning `None` if the index is out of bounds\n *\n * @example\n * import { deleteAt } from 'fp-ts/ReadonlyArray'\n * import { some, none } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(deleteAt(0)([1, 2, 3]), some([2, 3]))\n * assert.deepStrictEqual(deleteAt(1)([]), none)\n *\n * @since 2.5.0\n */\nfunction deleteAt(i) {\n return function (as) { return (isOutOfBound(i, as) ? O.none : O.some(unsafeDeleteAt(i, as))); };\n}\nexports.deleteAt = deleteAt;\n/**\n * Apply a function to the element at the specified index, creating a new array, or returning `None` if the index is out\n * of bounds\n *\n * @example\n * import { modifyAt } from 'fp-ts/ReadonlyArray'\n * import { some, none } from 'fp-ts/Option'\n *\n * const double = (x: number): number => x * 2\n * assert.deepStrictEqual(modifyAt(1, double)([1, 2, 3]), some([1, 4, 3]))\n * assert.deepStrictEqual(modifyAt(1, double)([]), none)\n *\n * @since 2.5.0\n */\nfunction modifyAt(i, f) {\n return function (as) { return (isOutOfBound(i, as) ? O.none : O.some(unsafeUpdateAt(i, f(as[i]), as))); };\n}\nexports.modifyAt = modifyAt;\n/**\n * Reverse an array, creating a new array\n *\n * @example\n * import { reverse } from 'fp-ts/ReadonlyArray'\n *\n * assert.deepStrictEqual(reverse([1, 2, 3]), [3, 2, 1])\n *\n * @category combinators\n * @since 2.5.0\n */\nfunction reverse(as) {\n if (isEmpty(as)) {\n return as;\n }\n return as.slice().reverse();\n}\nexports.reverse = reverse;\n/**\n * Extracts from an array of `Either` all the `Right` elements. All the `Right` elements are extracted in order\n *\n * @example\n * import { rights } from 'fp-ts/ReadonlyArray'\n * import { right, left } from 'fp-ts/Either'\n *\n * assert.deepStrictEqual(rights([right(1), left('foo'), right(2)]), [1, 2])\n *\n * @category combinators\n * @since 2.5.0\n */\nfunction rights(as) {\n // tslint:disable-next-line: readonly-array\n var r = [];\n var len = as.length;\n for (var i = 0; i < len; i++) {\n var a = as[i];\n if (a._tag === 'Right') {\n r.push(a.right);\n }\n }\n return r;\n}\nexports.rights = rights;\n/**\n * Extracts from an array of `Either` all the `Left` elements. All the `Left` elements are extracted in order\n *\n * @example\n * import { lefts } from 'fp-ts/ReadonlyArray'\n * import { left, right } from 'fp-ts/Either'\n *\n * assert.deepStrictEqual(lefts([right(1), left('foo'), right(2)]), ['foo'])\n *\n * @since 2.5.0\n */\nfunction lefts(as) {\n // tslint:disable-next-line: readonly-array\n var r = [];\n var len = as.length;\n for (var i = 0; i < len; i++) {\n var a = as[i];\n if (a._tag === 'Left') {\n r.push(a.left);\n }\n }\n return r;\n}\nexports.lefts = lefts;\n/**\n * Sort the elements of an array in increasing order, creating a new array\n *\n * @example\n * import { sort } from 'fp-ts/ReadonlyArray'\n * import { ordNumber } from 'fp-ts/Ord'\n *\n * assert.deepStrictEqual(sort(ordNumber)([3, 2, 1]), [1, 2, 3])\n *\n * @category combinators\n * @since 2.5.0\n */\nvar sort = function (O) { return function (as) {\n return as.length <= 1 ? as : as.slice().sort(O.compare);\n}; };\nexports.sort = sort;\n// TODO: curry and make data-last in v3\n/**\n * Apply a function to pairs of elements at the same index in two arrays, collecting the results in a new array. If one\n * input array is short, excess elements of the longer array are discarded.\n *\n * @example\n * import { zipWith } from 'fp-ts/ReadonlyArray'\n *\n * assert.deepStrictEqual(zipWith([1, 2, 3], ['a', 'b', 'c', 'd'], (n, s) => s + n), ['a1', 'b2', 'c3'])\n *\n * @category combinators\n * @since 2.5.0\n */\nfunction zipWith(fa, fb, f) {\n // tslint:disable-next-line: readonly-array\n var fc = [];\n var len = Math.min(fa.length, fb.length);\n for (var i = 0; i < len; i++) {\n fc[i] = f(fa[i], fb[i]);\n }\n return fc;\n}\nexports.zipWith = zipWith;\nfunction zip(as, bs) {\n if (bs === undefined) {\n return function (bs) { return zip(bs, as); };\n }\n return zipWith(as, bs, function (a, b) { return [a, b]; });\n}\nexports.zip = zip;\n/**\n * The function is reverse of `zip`. Takes an array of pairs and return two corresponding arrays\n *\n * @example\n * import { unzip } from 'fp-ts/ReadonlyArray'\n *\n * assert.deepStrictEqual(unzip([[1, 'a'], [2, 'b'], [3, 'c']]), [[1, 2, 3], ['a', 'b', 'c']])\n *\n * @since 2.5.0\n */\nfunction unzip(as) {\n // tslint:disable-next-line: readonly-array\n var fa = [];\n // tslint:disable-next-line: readonly-array\n var fb = [];\n for (var i = 0; i < as.length; i++) {\n fa[i] = as[i][0];\n fb[i] = as[i][1];\n }\n return [fa, fb];\n}\nexports.unzip = unzip;\n/**\n * Prepend an element to every member of an array\n *\n * @example\n * import { prependToAll } from 'fp-ts/ReadonlyArray'\n *\n * assert.deepStrictEqual(prependToAll(9)([1, 2, 3, 4]), [9, 1, 9, 2, 9, 3, 9, 4])\n *\n * @category combinators\n * @since 2.9.0\n */\nvar prependToAll = function (e) { return function (xs) {\n // tslint:disable-next-line: readonly-array\n var ys = [];\n for (var _i = 0, xs_1 = xs; _i < xs_1.length; _i++) {\n var x = xs_1[_i];\n ys.push(e, x);\n }\n return ys;\n}; };\nexports.prependToAll = prependToAll;\n/**\n * Places an element in between members of an array\n *\n * @example\n * import { intersperse } from 'fp-ts/ReadonlyArray'\n *\n * assert.deepStrictEqual(intersperse(9)([1, 2, 3, 4]), [1, 9, 2, 9, 3, 9, 4])\n *\n * @category combinators\n * @since 2.9.0\n */\nfunction intersperse(e) {\n return function (as) {\n var length = as.length;\n if (length === 0) {\n return as;\n }\n return cons(as[0], exports.prependToAll(e)(as.slice(1, as.length)));\n };\n}\nexports.intersperse = intersperse;\n/**\n * Rotate an array to the right by `n` steps\n *\n * @example\n * import { rotate } from 'fp-ts/ReadonlyArray'\n *\n * assert.deepStrictEqual(rotate(2)([1, 2, 3, 4, 5]), [4, 5, 1, 2, 3])\n *\n * @category combinators\n * @since 2.5.0\n */\nfunction rotate(n) {\n return function (as) {\n var len = as.length;\n if (n === 0 || len <= 1 || len === Math.abs(n)) {\n return as;\n }\n else if (n < 0) {\n return rotate(len + n)(as);\n }\n else {\n return as.slice(-n).concat(as.slice(0, len - n));\n }\n };\n}\nexports.rotate = rotate;\nfunction elem(E) {\n return function (a, as) {\n if (as === undefined) {\n var elemE_1 = elem(E);\n return function (as) { return elemE_1(a, as); };\n }\n var predicate = function (element) { return E.equals(element, a); };\n var i = 0;\n var len = as.length;\n for (; i < len; i++) {\n if (predicate(as[i])) {\n return true;\n }\n }\n return false;\n };\n}\nexports.elem = elem;\n/**\n * Remove duplicates from an array, keeping the first occurrence of an element.\n *\n * @example\n * import { uniq } from 'fp-ts/ReadonlyArray'\n * import { eqNumber } from 'fp-ts/Eq'\n *\n * assert.deepStrictEqual(uniq(eqNumber)([1, 2, 1]), [1, 2])\n *\n * @category combinators\n * @since 2.5.0\n */\nfunction uniq(E) {\n var elemS = elem(E);\n return function (as) {\n var len = as.length;\n if (len <= 1) {\n return as;\n }\n // tslint:disable-next-line: readonly-array\n var r = [];\n var i = 0;\n for (; i < len; i++) {\n var a = as[i];\n if (!elemS(a, r)) {\n r.push(a);\n }\n }\n return len === r.length ? as : r;\n };\n}\nexports.uniq = uniq;\n/**\n * Sort the elements of an array in increasing order, where elements are compared using first `ords[0]`, then `ords[1]`,\n * etc...\n *\n * @example\n * import { sortBy } from 'fp-ts/ReadonlyArray'\n * import { ord, ordString, ordNumber } from 'fp-ts/Ord'\n *\n * interface Person {\n * name: string\n * age: number\n * }\n * const byName = ord.contramap(ordString, (p: Person) => p.name)\n * const byAge = ord.contramap(ordNumber, (p: Person) => p.age)\n *\n * const sortByNameByAge = sortBy([byName, byAge])\n *\n * const persons = [{ name: 'a', age: 1 }, { name: 'b', age: 3 }, { name: 'c', age: 2 }, { name: 'b', age: 2 }]\n * assert.deepStrictEqual(sortByNameByAge(persons), [\n * { name: 'a', age: 1 },\n * { name: 'b', age: 2 },\n * { name: 'b', age: 3 },\n * { name: 'c', age: 2 }\n * ])\n *\n * @category combinators\n * @since 2.5.0\n */\nfunction sortBy(ords) {\n var M = Ord_1.getMonoid();\n return exports.sort(ords.reduce(M.concat, M.empty));\n}\nexports.sortBy = sortBy;\n/**\n * A useful recursion pattern for processing an array to produce a new array, often used for \"chopping\" up the input\n * array. Typically chop is called with some function that will consume an initial prefix of the array and produce a\n * value and the rest of the array.\n *\n * @example\n * import { Eq, eqNumber } from 'fp-ts/Eq'\n * import { chop, spanLeft } from 'fp-ts/ReadonlyArray'\n *\n * const group = (S: Eq): ((as: ReadonlyArray) => ReadonlyArray>) => {\n * return chop(as => {\n * const { init, rest } = spanLeft((a: A) => S.equals(a, as[0]))(as)\n * return [init, rest]\n * })\n * }\n * assert.deepStrictEqual(group(eqNumber)([1, 1, 2, 3, 3, 4]), [[1, 1], [2], [3, 3], [4]])\n *\n * @category combinators\n * @since 2.5.0\n */\nvar chop = function (f) { return function (as) {\n // tslint:disable-next-line: readonly-array\n var result = [];\n var cs = as;\n while (isNonEmpty(cs)) {\n var _a = f(cs), b = _a[0], c = _a[1];\n result.push(b);\n cs = c;\n }\n return result;\n}; };\nexports.chop = chop;\n/**\n * Splits an array into two pieces, the first piece has `n` elements.\n *\n * @example\n * import { splitAt } from 'fp-ts/ReadonlyArray'\n *\n * assert.deepStrictEqual(splitAt(2)([1, 2, 3, 4, 5]), [[1, 2], [3, 4, 5]])\n *\n * @since 2.5.0\n */\nfunction splitAt(n) {\n return function (as) { return [as.slice(0, n), as.slice(n)]; };\n}\nexports.splitAt = splitAt;\n/**\n * Splits an array into length-`n` pieces. The last piece will be shorter if `n` does not evenly divide the length of\n * the array. Note that `chunksOf(n)([])` is `[]`, not `[[]]`. This is intentional, and is consistent with a recursive\n * definition of `chunksOf`; it satisfies the property that\n *\n * ```ts\n * chunksOf(n)(xs).concat(chunksOf(n)(ys)) == chunksOf(n)(xs.concat(ys)))\n * ```\n *\n * whenever `n` evenly divides the length of `xs`.\n *\n * @example\n * import { chunksOf } from 'fp-ts/ReadonlyArray'\n *\n * assert.deepStrictEqual(chunksOf(2)([1, 2, 3, 4, 5]), [[1, 2], [3, 4], [5]])\n *\n *\n * @since 2.5.0\n */\nfunction chunksOf(n) {\n var f = exports.chop(splitAt(n));\n return function (as) { return (as.length === 0 ? exports.empty : isOutOfBound(n - 1, as) ? [as] : f(as)); };\n}\nexports.chunksOf = chunksOf;\nfunction comprehension(input, f, g) {\n if (g === void 0) { g = function () { return true; }; }\n var go = function (scope, input) {\n if (input.length === 0) {\n return g.apply(void 0, scope) ? [f.apply(void 0, scope)] : exports.empty;\n }\n else {\n return chain_(input[0], function (x) { return go(snoc(scope, x), input.slice(1)); });\n }\n };\n return go(exports.empty, input);\n}\nexports.comprehension = comprehension;\nfunction union(E) {\n var elemE = elem(E);\n return function (xs, ys) {\n if (ys === undefined) {\n var unionE_1 = union(E);\n return function (ys) { return unionE_1(ys, xs); };\n }\n return concat(xs, ys.filter(function (a) { return !elemE(a, xs); }));\n };\n}\nexports.union = union;\nfunction intersection(E) {\n var elemE = elem(E);\n return function (xs, ys) {\n if (ys === undefined) {\n var intersectionE_1 = intersection(E);\n return function (ys) { return intersectionE_1(ys, xs); };\n }\n return xs.filter(function (a) { return elemE(a, ys); });\n };\n}\nexports.intersection = intersection;\nfunction difference(E) {\n var elemE = elem(E);\n return function (xs, ys) {\n if (ys === undefined) {\n var differenceE_1 = difference(E);\n return function (ys) { return differenceE_1(ys, xs); };\n }\n return xs.filter(function (a) { return !elemE(a, ys); });\n };\n}\nexports.difference = difference;\n/**\n * Wrap a value into the type constructor.\n *\n * @category Applicative\n * @since 2.5.0\n */\nvar of = function (a) { return [a]; };\nexports.of = of;\n/**\n * @category Alternative\n * @since 2.7.0\n */\nvar zero = function () { return exports.empty; };\nexports.zero = zero;\n// -------------------------------------------------------------------------------------\n// non-pipeables\n// -------------------------------------------------------------------------------------\nvar map_ = function (fa, f) { return function_1.pipe(fa, exports.map(f)); };\nvar mapWithIndex_ = function (fa, f) { return function_1.pipe(fa, exports.mapWithIndex(f)); };\nvar ap_ = function (fab, fa) { return function_1.pipe(fab, exports.ap(fa)); };\nvar chain_ = function (ma, f) {\n return function_1.pipe(ma, exports.chain(f));\n};\nvar filter_ = function (fa, predicate) { return function_1.pipe(fa, exports.filter(predicate)); };\nvar filterMap_ = function (fa, f) { return function_1.pipe(fa, exports.filterMap(f)); };\nvar partitionWithIndex_ = function (fa, predicateWithIndex) { return function_1.pipe(fa, exports.partitionWithIndex(predicateWithIndex)); };\nvar partition_ = function (fa, predicate) { return function_1.pipe(fa, exports.partition(predicate)); };\nvar partitionMap_ = function (fa, f) { return function_1.pipe(fa, exports.partitionMap(f)); };\nvar partitionMapWithIndex_ = function (fa, f) { return function_1.pipe(fa, exports.partitionMapWithIndex(f)); };\nvar alt_ = function (fa, that) { return function_1.pipe(fa, exports.alt(that)); };\nvar reduce_ = function (fa, b, f) { return function_1.pipe(fa, exports.reduce(b, f)); };\nvar foldMap_ = function (M) {\n var foldMapM = exports.foldMap(M);\n return function (fa, f) { return function_1.pipe(fa, foldMapM(f)); };\n};\nvar reduceRight_ = function (fa, b, f) { return function_1.pipe(fa, exports.reduceRight(b, f)); };\nvar reduceWithIndex_ = function (fa, b, f) {\n var l = fa.length;\n var r = b;\n for (var i = 0; i < l; i++) {\n r = f(i, r, fa[i]);\n }\n return r;\n};\nvar foldMapWithIndex_ = function (M) { return function (fa, f) {\n return fa.reduce(function (b, a, i) { return M.concat(b, f(i, a)); }, M.empty);\n}; };\nvar reduceRightWithIndex_ = function (fa, b, f) {\n return function_1.pipe(fa, exports.reduceRightWithIndex(b, f));\n};\nvar filterMapWithIndex_ = function (fa, f) {\n return function_1.pipe(fa, exports.filterMapWithIndex(f));\n};\nvar filterWithIndex_ = function (fa, predicateWithIndex) { return function_1.pipe(fa, exports.filterWithIndex(predicateWithIndex)); };\nvar extend_ = function (fa, f) { return function_1.pipe(fa, exports.extend(f)); };\nvar traverse_ = function (F) {\n var traverseF = exports.traverse(F);\n return function (ta, f) { return function_1.pipe(ta, traverseF(f)); };\n};\n/* istanbul ignore next */\nvar traverseWithIndex_ = function (F) {\n var traverseWithIndexF = exports.traverseWithIndex(F);\n return function (ta, f) { return function_1.pipe(ta, traverseWithIndexF(f)); };\n};\n/* istanbul ignore next */\nvar wither_ = function (F) {\n var witherF = exports.wither(F);\n return function (fa, f) { return function_1.pipe(fa, witherF(f)); };\n};\n/* istanbul ignore next */\nvar wilt_ = function (F) {\n var wiltF = exports.wilt(F);\n return function (fa, f) { return function_1.pipe(fa, wiltF(f)); };\n};\n// -------------------------------------------------------------------------------------\n// pipeables\n// -------------------------------------------------------------------------------------\n/**\n * Less strict version of [`alt`](#alt).\n *\n * @category Alt\n * @since 2.9.0\n */\nvar altW = function (that) { return function (fa) { return concat(fa, that()); }; };\nexports.altW = altW;\n/**\n * Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to\n * types of kind `* -> *`.\n *\n * @category Alt\n * @since 2.5.0\n */\nexports.alt = exports.altW;\n/**\n * Apply a function to an argument under a type constructor.\n *\n * @category Apply\n * @since 2.5.0\n */\nvar ap = function (fa) {\n return exports.chain(function (f) { return function_1.pipe(fa, exports.map(f)); });\n};\nexports.ap = ap;\n/**\n * Combine two effectful actions, keeping only the result of the first.\n *\n * Derivable from `Apply`.\n *\n * @category combinators\n * @since 2.5.0\n */\nvar apFirst = function (fb) {\n return function_1.flow(exports.map(function (a) { return function () { return a; }; }), exports.ap(fb));\n};\nexports.apFirst = apFirst;\n/**\n * Combine two effectful actions, keeping only the result of the second.\n *\n * Derivable from `Apply`.\n *\n * @category combinators\n * @since 2.5.0\n */\nvar apSecond = function (fb) {\n return function_1.flow(exports.map(function () { return function (b) { return b; }; }), exports.ap(fb));\n};\nexports.apSecond = apSecond;\n/**\n * Composes computations in sequence, using the return value of one computation to determine the next computation.\n *\n * @category Monad\n * @since 2.5.0\n */\nvar chain = function (f) { return function (ma) {\n return function_1.pipe(ma, exports.chainWithIndex(function (_, a) { return f(a); }));\n}; };\nexports.chain = chain;\n/**\n * @since 2.7.0\n */\nvar chainWithIndex = function (f) { return function (ma) {\n var outLen = 0;\n var l = ma.length;\n var temp = new Array(l);\n for (var i = 0; i < l; i++) {\n var e = ma[i];\n var arr = f(i, e);\n outLen += arr.length;\n temp[i] = arr;\n }\n var out = Array(outLen);\n var start = 0;\n for (var i = 0; i < l; i++) {\n var arr = temp[i];\n var l_1 = arr.length;\n for (var j = 0; j < l_1; j++) {\n out[j + start] = arr[j];\n }\n start += l_1;\n }\n return out;\n}; };\nexports.chainWithIndex = chainWithIndex;\n/**\n * Composes computations in sequence, using the return value of one computation to determine the next computation and\n * keeping only the result of the first.\n *\n * Derivable from `Monad`.\n *\n * @category combinators\n * @since 2.5.0\n */\nvar chainFirst = function (f) {\n return exports.chain(function (a) {\n return function_1.pipe(f(a), exports.map(function () { return a; }));\n });\n};\nexports.chainFirst = chainFirst;\n/**\n * `map` can be used to turn functions `(a: A) => B` into functions `(fa: F) => F` whose argument and return types\n * use the type constructor `F` to represent some computational context.\n *\n * @category Functor\n * @since 2.5.0\n */\nvar map = function (f) { return function (fa) {\n return fa.map(function (a) { return f(a); });\n}; };\nexports.map = map;\n/**\n * @category FunctorWithIndex\n * @since 2.5.0\n */\nvar mapWithIndex = function (f) { return function (fa) { return fa.map(function (a, i) { return f(i, a); }); }; };\nexports.mapWithIndex = mapWithIndex;\n/**\n * @category Compactable\n * @since 2.5.0\n */\nvar separate = function (fa) {\n // tslint:disable-next-line: readonly-array\n var left = [];\n // tslint:disable-next-line: readonly-array\n var right = [];\n for (var _i = 0, fa_1 = fa; _i < fa_1.length; _i++) {\n var e = fa_1[_i];\n if (e._tag === 'Left') {\n left.push(e.left);\n }\n else {\n right.push(e.right);\n }\n }\n return {\n left: left,\n right: right\n };\n};\nexports.separate = separate;\n/**\n * @category Filterable\n * @since 2.5.0\n */\nvar filter = function (predicate) { return function (fa) { return fa.filter(predicate); }; };\nexports.filter = filter;\n/**\n * @category FilterableWithIndex\n * @since 2.5.0\n */\nvar filterMapWithIndex = function (f) { return function (fa) {\n // tslint:disable-next-line: readonly-array\n var result = [];\n for (var i = 0; i < fa.length; i++) {\n var optionB = f(i, fa[i]);\n if (O.isSome(optionB)) {\n result.push(optionB.value);\n }\n }\n return result;\n}; };\nexports.filterMapWithIndex = filterMapWithIndex;\n/**\n * @category Filterable\n * @since 2.5.0\n */\nvar filterMap = function (f) {\n return exports.filterMapWithIndex(function (_, a) { return f(a); });\n};\nexports.filterMap = filterMap;\n/**\n * @category Compactable\n * @since 2.5.0\n */\nexports.compact = \n/*#__PURE__*/\nexports.filterMap(function_1.identity);\n/**\n * @category Filterable\n * @since 2.5.0\n */\nvar partition = function (predicate) {\n return exports.partitionWithIndex(function (_, a) { return predicate(a); });\n};\nexports.partition = partition;\n/**\n * @category FilterableWithIndex\n * @since 2.5.0\n */\nvar partitionWithIndex = function (predicateWithIndex) { return function (fa) {\n // tslint:disable-next-line: readonly-array\n var left = [];\n // tslint:disable-next-line: readonly-array\n var right = [];\n for (var i = 0; i < fa.length; i++) {\n var a = fa[i];\n if (predicateWithIndex(i, a)) {\n right.push(a);\n }\n else {\n left.push(a);\n }\n }\n return {\n left: left,\n right: right\n };\n}; };\nexports.partitionWithIndex = partitionWithIndex;\n/**\n * @category Filterable\n * @since 2.5.0\n */\nvar partitionMap = function (f) {\n return exports.partitionMapWithIndex(function (_, a) { return f(a); });\n};\nexports.partitionMap = partitionMap;\n/**\n * @category FilterableWithIndex\n * @since 2.5.0\n */\nvar partitionMapWithIndex = function (f) { return function (fa) {\n // tslint:disable-next-line: readonly-array\n var left = [];\n // tslint:disable-next-line: readonly-array\n var right = [];\n for (var i = 0; i < fa.length; i++) {\n var e = f(i, fa[i]);\n if (e._tag === 'Left') {\n left.push(e.left);\n }\n else {\n right.push(e.right);\n }\n }\n return {\n left: left,\n right: right\n };\n}; };\nexports.partitionMapWithIndex = partitionMapWithIndex;\n/**\n * @category FilterableWithIndex\n * @since 2.5.0\n */\nvar filterWithIndex = function (predicateWithIndex) { return function (fa) {\n return fa.filter(function (a, i) { return predicateWithIndex(i, a); });\n}; };\nexports.filterWithIndex = filterWithIndex;\n/**\n * @category Extend\n * @since 2.5.0\n */\nvar extend = function (f) { return function (wa) { return wa.map(function (_, i, as) { return f(as.slice(i)); }); }; };\nexports.extend = extend;\n/**\n * Derivable from `Extend`.\n *\n * @category combinators\n * @since 2.5.0\n */\nexports.duplicate = \n/*#__PURE__*/\nexports.extend(function_1.identity);\n/**\n * @category FoldableWithIndex\n * @since 2.5.0\n */\nvar foldMapWithIndex = function (M) {\n var foldMapWithIndexM = foldMapWithIndex_(M);\n return function (f) { return function (fa) { return foldMapWithIndexM(fa, f); }; };\n};\nexports.foldMapWithIndex = foldMapWithIndex;\n/**\n * @category Foldable\n * @since 2.5.0\n */\nvar reduce = function (b, f) {\n return exports.reduceWithIndex(b, function (_, b, a) { return f(b, a); });\n};\nexports.reduce = reduce;\n/**\n * @category Foldable\n * @since 2.5.0\n */\nvar foldMap = function (M) {\n var foldMapWithIndexM = exports.foldMapWithIndex(M);\n return function (f) { return foldMapWithIndexM(function (_, a) { return f(a); }); };\n};\nexports.foldMap = foldMap;\n/**\n * @category FoldableWithIndex\n * @since 2.5.0\n */\nvar reduceWithIndex = function (b, f) { return function (fa) { return reduceWithIndex_(fa, b, f); }; };\nexports.reduceWithIndex = reduceWithIndex;\n/**\n * @category Foldable\n * @since 2.5.0\n */\nvar reduceRight = function (b, f) {\n return exports.reduceRightWithIndex(b, function (_, a, b) { return f(a, b); });\n};\nexports.reduceRight = reduceRight;\n/**\n * @category FoldableWithIndex\n * @since 2.5.0\n */\nvar reduceRightWithIndex = function (b, f) { return function (fa) { return fa.reduceRight(function (b, a, i) { return f(i, a, b); }, b); }; };\nexports.reduceRightWithIndex = reduceRightWithIndex;\n/**\n * **for optimized and stack safe version check the data types `traverseArray` function**\n * @category Traversable\n * @since 2.6.3\n */\nvar traverse = function (F) {\n var traverseWithIndexF = exports.traverseWithIndex(F);\n return function (f) { return traverseWithIndexF(function (_, a) { return f(a); }); };\n};\nexports.traverse = traverse;\n/**\n * **for optimized and stack safe version check the data types `sequenceArray` function**\n * @category Traversable\n * @since 2.6.3\n */\nvar sequence = function (F) { return function (ta) {\n return reduce_(ta, F.of(exports.zero()), function (fas, fa) {\n return F.ap(F.map(fas, function (as) { return function (a) { return snoc(as, a); }; }), fa);\n });\n}; };\nexports.sequence = sequence;\n/**\n * **for optimized and stack safe version check the data types `traverseArrayWithIndex` function**\n * @category TraversableWithIndex\n * @since 2.6.3\n */\nvar traverseWithIndex = function (F) { return function (f) {\n return exports.reduceWithIndex(F.of(exports.zero()), function (i, fbs, a) {\n return F.ap(F.map(fbs, function (bs) { return function (b) { return snoc(bs, b); }; }), f(i, a));\n });\n}; };\nexports.traverseWithIndex = traverseWithIndex;\n/**\n * @category Witherable\n * @since 2.6.5\n */\nvar wither = function (F) {\n var traverseF = exports.traverse(F);\n return function (f) { return function (fa) { return F.map(function_1.pipe(fa, traverseF(f)), exports.compact); }; };\n};\nexports.wither = wither;\n/**\n * @category Witherable\n * @since 2.6.5\n */\nvar wilt = function (F) {\n var traverseF = exports.traverse(F);\n return function (f) { return function (fa) { return F.map(function_1.pipe(fa, traverseF(f)), exports.separate); }; };\n};\nexports.wilt = wilt;\n/**\n * @category Unfoldable\n * @since 2.6.6\n */\nvar unfold = function (b, f) {\n // tslint:disable-next-line: readonly-array\n var ret = [];\n var bb = b;\n while (true) {\n var mt = f(bb);\n if (O.isSome(mt)) {\n var _a = mt.value, a = _a[0], b_1 = _a[1];\n ret.push(a);\n bb = b_1;\n }\n else {\n break;\n }\n }\n return ret;\n};\nexports.unfold = unfold;\n// -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n/**\n * @category instances\n * @since 2.5.0\n */\nexports.URI = 'ReadonlyArray';\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Functor = {\n URI: exports.URI,\n map: map_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.FunctorWithIndex = {\n URI: exports.URI,\n map: map_,\n mapWithIndex: mapWithIndex_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Applicative = {\n URI: exports.URI,\n map: map_,\n ap: ap_,\n of: exports.of\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Monad = {\n URI: exports.URI,\n map: map_,\n ap: ap_,\n of: exports.of,\n chain: chain_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Unfoldable = {\n URI: exports.URI,\n unfold: exports.unfold\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Alt = {\n URI: exports.URI,\n map: map_,\n alt: alt_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Alternative = {\n URI: exports.URI,\n map: map_,\n ap: ap_,\n of: exports.of,\n alt: alt_,\n zero: exports.zero\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Extend = {\n URI: exports.URI,\n map: map_,\n extend: extend_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Compactable = {\n URI: exports.URI,\n compact: exports.compact,\n separate: exports.separate\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Filterable = {\n URI: exports.URI,\n map: map_,\n compact: exports.compact,\n separate: exports.separate,\n filter: filter_,\n filterMap: filterMap_,\n partition: partition_,\n partitionMap: partitionMap_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.FilterableWithIndex = {\n URI: exports.URI,\n map: map_,\n mapWithIndex: mapWithIndex_,\n compact: exports.compact,\n separate: exports.separate,\n filter: filter_,\n filterMap: filterMap_,\n partition: partition_,\n partitionMap: partitionMap_,\n partitionMapWithIndex: partitionMapWithIndex_,\n partitionWithIndex: partitionWithIndex_,\n filterMapWithIndex: filterMapWithIndex_,\n filterWithIndex: filterWithIndex_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Foldable = {\n URI: exports.URI,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.FoldableWithIndex = {\n URI: exports.URI,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n reduceWithIndex: reduceWithIndex_,\n foldMapWithIndex: foldMapWithIndex_,\n reduceRightWithIndex: reduceRightWithIndex_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Traversable = {\n URI: exports.URI,\n map: map_,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n traverse: traverse_,\n sequence: exports.sequence\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.TraversableWithIndex = {\n URI: exports.URI,\n map: map_,\n mapWithIndex: mapWithIndex_,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n reduceWithIndex: reduceWithIndex_,\n foldMapWithIndex: foldMapWithIndex_,\n reduceRightWithIndex: reduceRightWithIndex_,\n traverse: traverse_,\n sequence: exports.sequence,\n traverseWithIndex: traverseWithIndex_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Witherable = {\n URI: exports.URI,\n map: map_,\n compact: exports.compact,\n separate: exports.separate,\n filter: filter_,\n filterMap: filterMap_,\n partition: partition_,\n partitionMap: partitionMap_,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n traverse: traverse_,\n sequence: exports.sequence,\n wither: wither_,\n wilt: wilt_\n};\n// TODO: remove in v3\n/**\n * @category instances\n * @since 2.5.0\n */\nexports.readonlyArray = {\n URI: exports.URI,\n compact: exports.compact,\n separate: exports.separate,\n map: map_,\n ap: ap_,\n of: exports.of,\n chain: chain_,\n filter: filter_,\n filterMap: filterMap_,\n partition: partition_,\n partitionMap: partitionMap_,\n mapWithIndex: mapWithIndex_,\n partitionMapWithIndex: partitionMapWithIndex_,\n partitionWithIndex: partitionWithIndex_,\n filterMapWithIndex: filterMapWithIndex_,\n filterWithIndex: filterWithIndex_,\n alt: alt_,\n zero: exports.zero,\n unfold: exports.unfold,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n traverse: traverse_,\n sequence: exports.sequence,\n reduceWithIndex: reduceWithIndex_,\n foldMapWithIndex: foldMapWithIndex_,\n reduceRightWithIndex: reduceRightWithIndex_,\n traverseWithIndex: traverseWithIndex_,\n extend: extend_,\n wither: wither_,\n wilt: wilt_\n};\n// -------------------------------------------------------------------------------------\n// unsafe\n// -------------------------------------------------------------------------------------\n/**\n * @category unsafe\n * @since 2.5.0\n */\nfunction unsafeInsertAt(i, a, as) {\n var xs = as.slice();\n xs.splice(i, 0, a);\n return xs;\n}\nexports.unsafeInsertAt = unsafeInsertAt;\n/**\n * @category unsafe\n * @since 2.5.0\n */\nfunction unsafeUpdateAt(i, a, as) {\n if (as[i] === a) {\n return as;\n }\n else {\n var xs = as.slice();\n xs[i] = a;\n return xs;\n }\n}\nexports.unsafeUpdateAt = unsafeUpdateAt;\n/**\n * @category unsafe\n * @since 2.5.0\n */\nfunction unsafeDeleteAt(i, as) {\n var xs = as.slice();\n xs.splice(i, 1);\n return xs;\n}\nexports.unsafeDeleteAt = unsafeDeleteAt;\n// -------------------------------------------------------------------------------------\n// utils\n// -------------------------------------------------------------------------------------\n/**\n * An empty array\n *\n * @since 2.5.0\n */\nexports.empty = [];\n/**\n * Check if a predicate holds true for every array member.\n *\n * @example\n * import { every } from 'fp-ts/ReadonlyArray'\n * import { pipe } from 'fp-ts/function'\n *\n * const isPositive = (n: number): boolean => n > 0\n *\n * assert.deepStrictEqual(pipe([1, 2, 3], every(isPositive)), true)\n * assert.deepStrictEqual(pipe([1, 2, -3], every(isPositive)), false)\n *\n * @since 2.9.0\n */\nvar every = function (predicate) { return function (as) { return as.every(predicate); }; };\nexports.every = every;\n/**\n * Check if a predicate holds true for any array member.\n *\n * @example\n * import { some } from 'fp-ts/ReadonlyArray'\n * import { pipe } from 'fp-ts/function'\n *\n * const isPositive = (n: number): boolean => n > 0\n *\n * assert.deepStrictEqual(pipe([-1, -2, 3], some(isPositive)), true)\n * assert.deepStrictEqual(pipe([-1, -2, -3], some(isPositive)), false)\n *\n * @since 2.9.0\n */\nvar some = function (predicate) { return function (as) { return as.some(predicate); }; };\nexports.some = some;\n// -------------------------------------------------------------------------------------\n// do notation\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.9.0\n */\nexports.Do = \n/*#__PURE__*/\nexports.of({});\n/**\n * @since 2.8.0\n */\nvar bindTo = function (name) {\n return exports.map(function_1.bindTo_(name));\n};\nexports.bindTo = bindTo;\n/**\n * @since 2.8.0\n */\nvar bind = function (name, f) {\n return exports.chain(function (a) {\n return function_1.pipe(f(a), exports.map(function (b) { return function_1.bind_(a, name, b); }));\n });\n};\nexports.bind = bind;\n// -------------------------------------------------------------------------------------\n// pipeable sequence S\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.8.0\n */\nvar apS = function (name, fb) {\n return function_1.flow(exports.map(function (a) { return function (b) { return function_1.bind_(a, name, b); }; }), exports.ap(fb));\n};\nexports.apS = apS;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.reduceRight = exports.reduceWithIndex = exports.reduce = exports.mapWithIndex = exports.map = exports.flatten = exports.extend = exports.duplicate = exports.chainFirst = exports.chain = exports.apSecond = exports.apFirst = exports.ap = exports.alt = exports.altW = exports.foldMap = exports.foldMapWithIndex = exports.intersperse = exports.prependToAll = exports.unzip = exports.zip = exports.zipWith = exports.fold = exports.concat = exports.of = exports.filterWithIndex = exports.filter = exports.modifyAt = exports.updateAt = exports.insertAt = exports.sort = exports.init = exports.last = exports.groupBy = exports.groupSort = exports.group = exports.getEq = exports.getSemigroup = exports.max = exports.min = exports.reverse = exports.tail = exports.head = exports.getShow = exports.unsnoc = exports.uncons = exports.fromArray = exports.fromReadonlyArray = exports.snoc = exports.cons = void 0;\nexports.apS = exports.bind = exports.bindTo = exports.Do = exports.readonlyNonEmptyArray = exports.Comonad = exports.Alt = exports.TraversableWithIndex = exports.Traversable = exports.FoldableWithIndex = exports.Foldable = exports.Monad = exports.Applicative = exports.FunctorWithIndex = exports.Functor = exports.URI = exports.extract = exports.traverseWithIndex = exports.sequence = exports.traverse = exports.reduceRightWithIndex = void 0;\nvar function_1 = require(\"./function\");\nvar Option_1 = require(\"./Option\");\nvar RA = __importStar(require(\"./ReadonlyArray\"));\nvar Semigroup_1 = require(\"./Semigroup\");\n/**\n * Append an element to the front of an array, creating a new non empty array\n *\n * @example\n * import { cons } from 'fp-ts/ReadonlyNonEmptyArray'\n *\n * assert.deepStrictEqual(cons(1, [2, 3, 4]), [1, 2, 3, 4])\n *\n * @category constructors\n * @since 2.5.0\n */\nexports.cons = RA.cons;\n/**\n * Append an element to the end of an array, creating a new non empty array\n *\n * @example\n * import { snoc } from 'fp-ts/ReadonlyNonEmptyArray'\n *\n * assert.deepStrictEqual(snoc([1, 2, 3], 4), [1, 2, 3, 4])\n *\n * @category constructors\n * @since 2.5.0\n */\nexports.snoc = RA.snoc;\n/**\n * Builds a `ReadonlyNonEmptyArray` from an array returning `none` if `as` is an empty array\n *\n * @category constructors\n * @since 2.5.0\n */\nfunction fromReadonlyArray(as) {\n return RA.isNonEmpty(as) ? Option_1.some(as) : Option_1.none;\n}\nexports.fromReadonlyArray = fromReadonlyArray;\n/**\n * @category constructors\n * @since 2.5.0\n */\n// tslint:disable-next-line: readonly-array\nfunction fromArray(as) {\n return fromReadonlyArray(RA.fromArray(as));\n}\nexports.fromArray = fromArray;\n/**\n * Produces a couple of the first element of the array, and a new array of the remaining elements, if any\n *\n * @example\n * import { cons, uncons } from 'fp-ts/ReadonlyNonEmptyArray'\n *\n * assert.deepStrictEqual(uncons(cons(1, [2, 3, 4])), [1, [2, 3, 4]])\n *\n * @category destructors\n * @since 2.9.0\n */\nfunction uncons(nea) {\n return [nea[0], nea.slice(1)];\n}\nexports.uncons = uncons;\n/**\n * Produces a couple of a copy of the array without its last element, and that last element\n *\n * @example\n * import { snoc, unsnoc } from 'fp-ts/ReadonlyNonEmptyArray'\n *\n * assert.deepStrictEqual(unsnoc(snoc([1, 2, 3], 4)), [[1, 2, 3], 4])\n *\n * @category destructors\n * @since 2.9.0\n */\nfunction unsnoc(nea) {\n var l = nea.length - 1;\n return [nea.slice(0, l), nea[l]];\n}\nexports.unsnoc = unsnoc;\n/**\n * @category instances\n * @since 2.5.0\n */\nexports.getShow = RA.getShow;\n/**\n * @since 2.5.0\n */\nfunction head(nea) {\n return nea[0];\n}\nexports.head = head;\n/**\n * @since 2.5.0\n */\nfunction tail(nea) {\n return nea.slice(1);\n}\nexports.tail = tail;\n/**\n * @category combinators\n * @since 2.5.0\n */\nexports.reverse = RA.reverse;\n/**\n * @since 2.5.0\n */\nfunction min(ord) {\n var S = Semigroup_1.getMeetSemigroup(ord);\n return function (nea) { return nea.reduce(S.concat); };\n}\nexports.min = min;\n/**\n * @since 2.5.0\n */\nfunction max(ord) {\n var S = Semigroup_1.getJoinSemigroup(ord);\n return function (nea) { return nea.reduce(S.concat); };\n}\nexports.max = max;\n/**\n * Builds a `Semigroup` instance for `ReadonlyNonEmptyArray`\n *\n * @category instances\n * @since 2.5.0\n */\nfunction getSemigroup() {\n return {\n concat: concat\n };\n}\nexports.getSemigroup = getSemigroup;\n/**\n * @example\n * import { getEq, cons } from 'fp-ts/ReadonlyNonEmptyArray'\n * import { eqNumber } from 'fp-ts/Eq'\n *\n * const E = getEq(eqNumber)\n * assert.strictEqual(E.equals(cons(1, [2]), [1, 2]), true)\n * assert.strictEqual(E.equals(cons(1, [2]), [1, 3]), false)\n *\n * @category instances\n * @since 2.5.0\n */\nexports.getEq = RA.getEq;\nfunction group(E) {\n return function (as) {\n var len = as.length;\n if (len === 0) {\n return RA.empty;\n }\n // tslint:disable-next-line: readonly-array\n var r = [];\n var head = as[0];\n var nea = [head];\n for (var i = 1; i < len; i++) {\n var x = as[i];\n if (E.equals(x, head)) {\n nea.push(x);\n }\n else {\n r.push(nea);\n head = x;\n nea = [head];\n }\n }\n r.push(nea);\n return r;\n };\n}\nexports.group = group;\nfunction groupSort(O) {\n var sortO = RA.sort(O);\n var groupO = group(O);\n return function (as) { return groupO(sortO(as)); };\n}\nexports.groupSort = groupSort;\n/**\n * Splits an array into sub-non-empty-arrays stored in an object, based on the result of calling a `string`-returning\n * function on each element, and grouping the results according to values returned\n *\n * @example\n * import { cons, groupBy } from 'fp-ts/ReadonlyNonEmptyArray'\n *\n * assert.deepStrictEqual(groupBy((s: string) => String(s.length))(['foo', 'bar', 'foobar']), {\n * '3': cons('foo', ['bar']),\n * '6': cons('foobar', [])\n * })\n *\n * @category constructors\n * @since 2.5.0\n */\nfunction groupBy(f) {\n return function (as) {\n var r = {};\n for (var _i = 0, as_1 = as; _i < as_1.length; _i++) {\n var a = as_1[_i];\n var k = f(a);\n if (r.hasOwnProperty(k)) {\n r[k].push(a);\n }\n else {\n r[k] = [a];\n }\n }\n return r;\n };\n}\nexports.groupBy = groupBy;\n/**\n * @since 2.5.0\n */\nfunction last(nea) {\n return nea[nea.length - 1];\n}\nexports.last = last;\n/**\n * Get all but the last element of a non empty array, creating a new array.\n *\n * @example\n * import { init } from 'fp-ts/ReadonlyNonEmptyArray'\n *\n * assert.deepStrictEqual(init([1, 2, 3]), [1, 2])\n * assert.deepStrictEqual(init([1]), [])\n *\n * @since 2.5.0\n */\nfunction init(nea) {\n return nea.slice(0, -1);\n}\nexports.init = init;\n/**\n * @category combinators\n * @since 2.5.0\n */\nfunction sort(O) {\n return RA.sort(O);\n}\nexports.sort = sort;\n/**\n * @since 2.5.0\n */\nfunction insertAt(i, a) {\n return RA.insertAt(i, a);\n}\nexports.insertAt = insertAt;\n/**\n * @since 2.5.0\n */\nfunction updateAt(i, a) {\n return RA.updateAt(i, a);\n}\nexports.updateAt = updateAt;\n/**\n * @since 2.5.0\n */\nfunction modifyAt(i, f) {\n return RA.modifyAt(i, f);\n}\nexports.modifyAt = modifyAt;\nfunction filter(predicate) {\n return filterWithIndex(function (_, a) { return predicate(a); });\n}\nexports.filter = filter;\n/**\n * @since 2.5.0\n */\nfunction filterWithIndex(predicate) {\n return function (nea) { return fromReadonlyArray(nea.filter(function (a, i) { return predicate(i, a); })); };\n}\nexports.filterWithIndex = filterWithIndex;\n/**\n * Wrap a value into the type constructor.\n *\n * @category Applicative\n * @since 2.5.0\n */\nexports.of = RA.of;\nfunction concat(fx, fy) {\n return fx.concat(fy);\n}\nexports.concat = concat;\n/**\n * @since 2.5.0\n */\nfunction fold(S) {\n return function (fa) { return fa.reduce(S.concat); };\n}\nexports.fold = fold;\n/**\n * @category combinators\n * @since 2.5.1\n */\nexports.zipWith = RA.zipWith;\n/**\n * @category combinators\n * @since 2.5.1\n */\nexports.zip = RA.zip;\n/**\n * @since 2.5.1\n */\nexports.unzip = RA.unzip;\n/**\n * Prepend an element to every member of an array\n *\n * @example\n * import { cons, prependToAll } from 'fp-ts/ReadonlyNonEmptyArray'\n *\n * assert.deepStrictEqual(prependToAll(9)(cons(1, [2, 3, 4])), cons(9, [1, 9, 2, 9, 3, 9, 4]))\n *\n * @category combinators\n * @since 2.9.0\n */\nexports.prependToAll = RA.prependToAll;\n/**\n * Places an element in between members of an array\n *\n * @example\n * import { cons, intersperse } from 'fp-ts/ReadonlyNonEmptyArray'\n *\n * assert.deepStrictEqual(intersperse(9)(cons(1, [2, 3, 4])), cons(1, [9, 2, 9, 3, 9, 4]))\n *\n * @category combinators\n * @since 2.9.0\n */\nexports.intersperse = RA.intersperse;\n// -------------------------------------------------------------------------------------\n// non-pipeables\n// -------------------------------------------------------------------------------------\nvar map_ = RA.Functor.map;\nvar mapWithIndex_ = RA.FunctorWithIndex.mapWithIndex;\nvar ap_ = RA.Applicative.ap;\nvar chain_ = RA.Monad.chain;\nvar extend_ = RA.Extend.extend;\nvar reduce_ = RA.Foldable.reduce;\nvar foldMap_ = RA.Foldable.foldMap;\nvar reduceRight_ = RA.Foldable.reduceRight;\nvar traverse_ = RA.Traversable.traverse;\nvar alt_ = RA.Alt.alt;\nvar reduceWithIndex_ = RA.FoldableWithIndex.reduceWithIndex;\nvar foldMapWithIndex_ = RA.FoldableWithIndex\n .foldMapWithIndex;\nvar reduceRightWithIndex_ = RA.FoldableWithIndex\n .reduceRightWithIndex;\nvar traverseWithIndex_ = RA.TraversableWithIndex\n .traverseWithIndex;\n// -------------------------------------------------------------------------------------\n// pipeables\n// -------------------------------------------------------------------------------------\n/**\n * @category FoldableWithIndex\n * @since 2.5.0\n */\nvar foldMapWithIndex = function (S) { return function (f) { return function (fa) { return fa.slice(1).reduce(function (s, a, i) { return S.concat(s, f(i + 1, a)); }, f(0, fa[0])); }; }; };\nexports.foldMapWithIndex = foldMapWithIndex;\n/**\n * @category Foldable\n * @since 2.5.0\n */\nvar foldMap = function (S) { return function (f) { return function (fa) {\n return fa.slice(1).reduce(function (s, a) { return S.concat(s, f(a)); }, f(fa[0]));\n}; }; };\nexports.foldMap = foldMap;\n/**\n * Less strict version of [`alt`](#alt).\n *\n * @category Alt\n * @since 2.9.0\n */\nexports.altW = RA.altW;\n/**\n * Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to\n * types of kind `* -> *`.\n *\n * @category Alt\n * @since 2.6.2\n */\nexports.alt = RA.alt;\n/**\n * @category Apply\n * @since 2.5.0\n */\nexports.ap = RA.ap;\n/**\n * Combine two effectful actions, keeping only the result of the first.\n *\n * Derivable from `Apply`.\n *\n * @category combinators\n * @since 2.5.0\n */\nexports.apFirst = RA.apFirst;\n/**\n * Combine two effectful actions, keeping only the result of the second.\n *\n * Derivable from `Apply`.\n *\n * @category combinators\n * @since 2.5.0\n */\nexports.apSecond = RA.apSecond;\n/**\n * Composes computations in sequence, using the return value of one computation to determine the next computation.\n *\n * @category Monad\n * @since 2.5.0\n */\nexports.chain = RA.chain;\n/**\n * Composes computations in sequence, using the return value of one computation to determine the next computation and\n * keeping only the result of the first.\n *\n * Derivable from `Monad`.\n *\n * @category combinators\n * @since 2.5.0\n */\nexports.chainFirst = RA.chainFirst;\n/**\n * Derivable from `Extend`.\n *\n * @category combinators\n * @since 2.5.0\n */\nexports.duplicate = RA.duplicate;\n/**\n * @category Extend\n * @since 2.5.0\n */\nexports.extend = RA.extend;\n/**\n * Derivable from `Monad`.\n *\n * @category combinators\n * @since 2.5.0\n */\nexports.flatten = RA.flatten;\n/**\n * `map` can be used to turn functions `(a: A) => B` into functions `(fa: F) => F` whose argument and return types\n * use the type constructor `F` to represent some computational context.\n *\n * @category Functor\n * @since 2.5.0\n */\nexports.map = RA.map;\n/**\n * @category FunctorWithIndex\n * @since 2.5.0\n */\nexports.mapWithIndex = RA.mapWithIndex;\n/**\n * @category Foldable\n * @since 2.5.0\n */\nexports.reduce = RA.reduce;\n/**\n * @category FoldableWithIndex\n * @since 2.5.0\n */\nexports.reduceWithIndex = RA.reduceWithIndex;\n/**\n * @category Foldable\n * @since 2.5.0\n */\nexports.reduceRight = RA.reduceRight;\n/**\n * @category FoldableWithIndex\n * @since 2.5.0\n */\nexports.reduceRightWithIndex = RA.reduceRightWithIndex;\n/**\n * @since 2.6.3\n */\nexports.traverse = RA.traverse;\n/**\n * @since 2.6.3\n */\nexports.sequence = RA.sequence;\n/**\n * @since 2.6.3\n */\nexports.traverseWithIndex = RA.traverseWithIndex;\n/**\n * @since 2.6.3\n */\nexports.extract = head;\n// -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n/**\n * @category instances\n * @since 2.5.0\n */\nexports.URI = 'ReadonlyNonEmptyArray';\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Functor = {\n URI: exports.URI,\n map: map_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.FunctorWithIndex = {\n URI: exports.URI,\n map: map_,\n mapWithIndex: mapWithIndex_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Applicative = {\n URI: exports.URI,\n map: map_,\n ap: ap_,\n of: exports.of\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Monad = {\n URI: exports.URI,\n map: map_,\n ap: ap_,\n of: exports.of,\n chain: chain_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Foldable = {\n URI: exports.URI,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.FoldableWithIndex = {\n URI: exports.URI,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n reduceWithIndex: reduceWithIndex_,\n foldMapWithIndex: foldMapWithIndex_,\n reduceRightWithIndex: reduceRightWithIndex_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Traversable = {\n URI: exports.URI,\n map: map_,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n traverse: traverse_,\n sequence: exports.sequence\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.TraversableWithIndex = {\n URI: exports.URI,\n map: map_,\n mapWithIndex: mapWithIndex_,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n traverse: traverse_,\n sequence: exports.sequence,\n reduceWithIndex: reduceWithIndex_,\n foldMapWithIndex: foldMapWithIndex_,\n reduceRightWithIndex: reduceRightWithIndex_,\n traverseWithIndex: traverseWithIndex_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Alt = {\n URI: exports.URI,\n map: map_,\n alt: alt_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Comonad = {\n URI: exports.URI,\n map: map_,\n extend: extend_,\n extract: exports.extract\n};\n// TODO: remove in v3\n/**\n * @category instances\n * @since 2.5.0\n */\nexports.readonlyNonEmptyArray = {\n URI: exports.URI,\n of: exports.of,\n map: map_,\n mapWithIndex: mapWithIndex_,\n ap: ap_,\n chain: chain_,\n extend: extend_,\n extract: exports.extract,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n traverse: traverse_,\n sequence: exports.sequence,\n reduceWithIndex: reduceWithIndex_,\n foldMapWithIndex: foldMapWithIndex_,\n reduceRightWithIndex: reduceRightWithIndex_,\n traverseWithIndex: traverseWithIndex_,\n alt: alt_\n};\n// -------------------------------------------------------------------------------------\n// do notation\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.9.0\n */\nexports.Do = \n/*#__PURE__*/\nexports.of({});\n/**\n * @since 2.8.0\n */\nvar bindTo = function (name) { return exports.map(function_1.bindTo_(name)); };\nexports.bindTo = bindTo;\n/**\n * @since 2.8.0\n */\nvar bind = function (name, f) {\n return exports.chain(function (a) {\n return function_1.pipe(f(a), exports.map(function (b) { return function_1.bind_(a, name, b); }));\n });\n};\nexports.bind = bind;\n// -------------------------------------------------------------------------------------\n// pipeable sequence S\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.8.0\n */\nvar apS = function (name, fb) {\n return function_1.flow(exports.map(function (a) { return function (b) { return function_1.bind_(a, name, b); }; }), exports.ap(fb));\n};\nexports.apS = apS;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.URI = exports.separate = exports.compact = exports.reduceRight = exports.foldMap = exports.reduce = exports.partitionMap = exports.partition = exports.filterMap = exports.filter = exports.elem = exports.some = exports.every = exports.fromFoldableMap = exports.fromFoldable = exports.filterWithIndex = exports.filterMapWithIndex = exports.partitionWithIndex = exports.partitionMapWithIndex = exports.wilt = exports.wither = exports.sequence = exports.traverse = exports.traverseWithIndex = exports.singleton = exports.reduceRightWithIndex = exports.foldMapWithIndex = exports.reduceWithIndex = exports.map = exports.mapWithIndex = exports.empty = exports.lookup = exports.getMonoid = exports.getEq = exports.isSubrecord = exports.pop = exports.modifyAt = exports.updateAt = exports.deleteAt = exports.hasOwnProperty = exports.insertAt = exports.toUnfoldable = exports.toReadonlyArray = exports.collect = exports.keys = exports.isEmpty = exports.size = exports.getShow = exports.toRecord = exports.fromRecord = void 0;\nexports.readonlyRecord = exports.Witherable = exports.TraversableWithIndex = exports.Traversable = exports.FilterableWithIndex = exports.Filterable = exports.Compactable = exports.FoldableWithIndex = exports.Foldable = exports.FunctorWithIndex = exports.Functor = void 0;\nvar Eq_1 = require(\"./Eq\");\nvar function_1 = require(\"./function\");\nvar Option_1 = require(\"./Option\");\n/**\n * @category constructors\n * @since 2.5.0\n */\nfunction fromRecord(r) {\n return Object.assign({}, r);\n}\nexports.fromRecord = fromRecord;\n/**\n * @category destructors\n * @since 2.5.0\n */\nfunction toRecord(r) {\n return Object.assign({}, r);\n}\nexports.toRecord = toRecord;\n/**\n * @category instances\n * @since 2.5.0\n */\nfunction getShow(S) {\n return {\n show: function (r) {\n var elements = collect(function (k, a) { return JSON.stringify(k) + \": \" + S.show(a); })(r).join(', ');\n return elements === '' ? '{}' : \"{ \" + elements + \" }\";\n }\n };\n}\nexports.getShow = getShow;\n/**\n * Calculate the number of key/value pairs in a record\n *\n * @since 2.5.0\n */\nfunction size(r) {\n return Object.keys(r).length;\n}\nexports.size = size;\n/**\n * Test whether a record is empty\n *\n * @since 2.5.0\n */\nfunction isEmpty(r) {\n return Object.keys(r).length === 0;\n}\nexports.isEmpty = isEmpty;\n/**\n * @since 2.5.0\n */\nfunction keys(r) {\n return Object.keys(r).sort();\n}\nexports.keys = keys;\n/**\n * Map a record into an array\n *\n * @example\n * import {collect} from 'fp-ts/ReadonlyRecord'\n *\n * const x: { a: string, b: boolean } = { a: 'foo', b: false }\n * assert.deepStrictEqual(\n * collect((key, val) => ({key: key, value: val}))(x),\n * [{key: 'a', value: 'foo'}, {key: 'b', value: false}]\n * )\n *\n * @since 2.5.0\n */\nfunction collect(f) {\n return function (r) {\n // tslint:disable-next-line: readonly-array\n var out = [];\n for (var _i = 0, _a = keys(r); _i < _a.length; _i++) {\n var key = _a[_i];\n out.push(f(key, r[key]));\n }\n return out;\n };\n}\nexports.collect = collect;\n/**\n * @category destructors\n * @since 2.5.0\n */\nexports.toReadonlyArray = \n/*#__PURE__*/\ncollect(function (k, a) { return [k, a]; });\nfunction toUnfoldable(U) {\n return function (r) {\n var arr = exports.toReadonlyArray(r);\n var len = arr.length;\n return U.unfold(0, function (b) { return (b < len ? Option_1.some([arr[b], b + 1]) : Option_1.none); });\n };\n}\nexports.toUnfoldable = toUnfoldable;\nfunction insertAt(k, a) {\n return function (r) {\n if (r[k] === a) {\n return r;\n }\n var out = Object.assign({}, r);\n out[k] = a;\n return out;\n };\n}\nexports.insertAt = insertAt;\nvar _hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction hasOwnProperty(k, r) {\n return _hasOwnProperty.call(r === undefined ? this : r, k);\n}\nexports.hasOwnProperty = hasOwnProperty;\nfunction deleteAt(k) {\n return function (r) {\n if (!_hasOwnProperty.call(r, k)) {\n return r;\n }\n var out = Object.assign({}, r);\n delete out[k];\n return out;\n };\n}\nexports.deleteAt = deleteAt;\n/**\n * @since 2.5.0\n */\nfunction updateAt(k, a) {\n return function (r) {\n if (!hasOwnProperty(k, r)) {\n return Option_1.none;\n }\n if (r[k] === a) {\n return Option_1.some(r);\n }\n var out = Object.assign({}, r);\n out[k] = a;\n return Option_1.some(out);\n };\n}\nexports.updateAt = updateAt;\n/**\n * @since 2.5.0\n */\nfunction modifyAt(k, f) {\n return function (r) {\n if (!hasOwnProperty(k, r)) {\n return Option_1.none;\n }\n var out = Object.assign({}, r);\n out[k] = f(r[k]);\n return Option_1.some(out);\n };\n}\nexports.modifyAt = modifyAt;\nfunction pop(k) {\n var deleteAtk = deleteAt(k);\n return function (r) {\n var oa = lookup(k, r);\n return Option_1.isNone(oa) ? Option_1.none : Option_1.some([oa.value, deleteAtk(r)]);\n };\n}\nexports.pop = pop;\nfunction isSubrecord(E) {\n return function (me, that) {\n if (that === undefined) {\n var isSubrecordE_1 = isSubrecord(E);\n return function (that) { return isSubrecordE_1(that, me); };\n }\n for (var k in me) {\n if (!_hasOwnProperty.call(that, k) || !E.equals(me[k], that[k])) {\n return false;\n }\n }\n return true;\n };\n}\nexports.isSubrecord = isSubrecord;\nfunction getEq(E) {\n var isSubrecordE = isSubrecord(E);\n return Eq_1.fromEquals(function (x, y) { return isSubrecordE(x)(y) && isSubrecordE(y)(x); });\n}\nexports.getEq = getEq;\nfunction getMonoid(S) {\n return {\n concat: function (x, y) {\n if (x === exports.empty) {\n return y;\n }\n if (y === exports.empty) {\n return x;\n }\n var keys = Object.keys(y);\n var len = keys.length;\n if (len === 0) {\n return x;\n }\n var r = Object.assign({}, x);\n for (var i = 0; i < len; i++) {\n var k = keys[i];\n r[k] = _hasOwnProperty.call(x, k) ? S.concat(x[k], y[k]) : y[k];\n }\n return r;\n },\n empty: exports.empty\n };\n}\nexports.getMonoid = getMonoid;\nfunction lookup(k, r) {\n if (r === undefined) {\n return function (r) { return lookup(k, r); };\n }\n return _hasOwnProperty.call(r, k) ? Option_1.some(r[k]) : Option_1.none;\n}\nexports.lookup = lookup;\n/**\n * @since 2.5.0\n */\nexports.empty = {};\nfunction mapWithIndex(f) {\n return function (fa) {\n var out = {};\n var keys = Object.keys(fa);\n for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {\n var key = keys_1[_i];\n out[key] = f(key, fa[key]);\n }\n return out;\n };\n}\nexports.mapWithIndex = mapWithIndex;\nfunction map(f) {\n return mapWithIndex(function (_, a) { return f(a); });\n}\nexports.map = map;\nfunction reduceWithIndex(b, f) {\n return function (fa) {\n var out = b;\n var ks = keys(fa);\n var len = ks.length;\n for (var i = 0; i < len; i++) {\n var k = ks[i];\n out = f(k, out, fa[k]);\n }\n return out;\n };\n}\nexports.reduceWithIndex = reduceWithIndex;\nfunction foldMapWithIndex(M) {\n return function (f) { return function (fa) {\n var out = M.empty;\n var ks = keys(fa);\n var len = ks.length;\n for (var i = 0; i < len; i++) {\n var k = ks[i];\n out = M.concat(out, f(k, fa[k]));\n }\n return out;\n }; };\n}\nexports.foldMapWithIndex = foldMapWithIndex;\nfunction reduceRightWithIndex(b, f) {\n return function (fa) {\n var out = b;\n var ks = keys(fa);\n var len = ks.length;\n for (var i = len - 1; i >= 0; i--) {\n var k = ks[i];\n out = f(k, fa[k], out);\n }\n return out;\n };\n}\nexports.reduceRightWithIndex = reduceRightWithIndex;\n/**\n * Create a record with one key/value pair\n *\n * @category constructors\n * @since 2.5.0\n */\nfunction singleton(k, a) {\n var _a;\n return _a = {}, _a[k] = a, _a;\n}\nexports.singleton = singleton;\nfunction traverseWithIndex(F) {\n return function (f) { return function (ta) {\n var ks = keys(ta);\n if (ks.length === 0) {\n return F.of(exports.empty);\n }\n var fr = F.of({});\n var _loop_1 = function (key) {\n fr = F.ap(F.map(fr, function (r) { return function (b) {\n r[key] = b;\n return r;\n }; }), f(key, ta[key]));\n };\n for (var _i = 0, ks_1 = ks; _i < ks_1.length; _i++) {\n var key = ks_1[_i];\n _loop_1(key);\n }\n return fr;\n }; };\n}\nexports.traverseWithIndex = traverseWithIndex;\nfunction traverse(F) {\n var traverseWithIndexF = traverseWithIndex(F);\n return function (f) { return traverseWithIndexF(function (_, a) { return f(a); }); };\n}\nexports.traverse = traverse;\nfunction sequence(F) {\n return traverseWithIndex(F)(function (_, a) { return a; });\n}\nexports.sequence = sequence;\n/**\n * @category Witherable\n * @since 2.6.5\n */\nvar wither = function (F) {\n var traverseF = traverse(F);\n return function (f) { return function (fa) { return F.map(function_1.pipe(fa, traverseF(f)), exports.compact); }; };\n};\nexports.wither = wither;\n/**\n * @category Witherable\n * @since 2.6.5\n */\nvar wilt = function (F) {\n var traverseF = traverse(F);\n return function (f) { return function (fa) { return F.map(function_1.pipe(fa, traverseF(f)), exports.separate); }; };\n};\nexports.wilt = wilt;\nfunction partitionMapWithIndex(f) {\n return function (fa) {\n var left = {};\n var right = {};\n var keys = Object.keys(fa);\n for (var _i = 0, keys_2 = keys; _i < keys_2.length; _i++) {\n var key = keys_2[_i];\n var e = f(key, fa[key]);\n switch (e._tag) {\n case 'Left':\n left[key] = e.left;\n break;\n case 'Right':\n right[key] = e.right;\n break;\n }\n }\n return {\n left: left,\n right: right\n };\n };\n}\nexports.partitionMapWithIndex = partitionMapWithIndex;\nfunction partitionWithIndex(predicateWithIndex) {\n return function (fa) {\n var left = {};\n var right = {};\n var keys = Object.keys(fa);\n for (var _i = 0, keys_3 = keys; _i < keys_3.length; _i++) {\n var key = keys_3[_i];\n var a = fa[key];\n if (predicateWithIndex(key, a)) {\n right[key] = a;\n }\n else {\n left[key] = a;\n }\n }\n return {\n left: left,\n right: right\n };\n };\n}\nexports.partitionWithIndex = partitionWithIndex;\nfunction filterMapWithIndex(f) {\n return function (fa) {\n var r = {};\n var keys = Object.keys(fa);\n for (var _i = 0, keys_4 = keys; _i < keys_4.length; _i++) {\n var key = keys_4[_i];\n var optionB = f(key, fa[key]);\n if (Option_1.isSome(optionB)) {\n r[key] = optionB.value;\n }\n }\n return r;\n };\n}\nexports.filterMapWithIndex = filterMapWithIndex;\nfunction filterWithIndex(predicateWithIndex) {\n return function (fa) {\n var out = {};\n var changed = false;\n for (var key in fa) {\n if (_hasOwnProperty.call(fa, key)) {\n var a = fa[key];\n if (predicateWithIndex(key, a)) {\n out[key] = a;\n }\n else {\n changed = true;\n }\n }\n }\n return changed ? out : fa;\n };\n}\nexports.filterWithIndex = filterWithIndex;\nfunction fromFoldable(M, F) {\n var fromFoldableMapM = fromFoldableMap(M, F);\n return function (fka) { return fromFoldableMapM(fka, function_1.identity); };\n}\nexports.fromFoldable = fromFoldable;\nfunction fromFoldableMap(M, F) {\n return function (ta, f) {\n return F.reduce(ta, {}, function (r, a) {\n var _a = f(a), k = _a[0], b = _a[1];\n r[k] = _hasOwnProperty.call(r, k) ? M.concat(r[k], b) : b;\n return r;\n });\n };\n}\nexports.fromFoldableMap = fromFoldableMap;\n/**\n * @since 2.5.0\n */\nfunction every(predicate) {\n return function (r) {\n for (var k in r) {\n if (!predicate(r[k])) {\n return false;\n }\n }\n return true;\n };\n}\nexports.every = every;\n/**\n * @since 2.5.0\n */\nfunction some(predicate) {\n return function (r) {\n for (var k in r) {\n if (predicate(r[k])) {\n return true;\n }\n }\n return false;\n };\n}\nexports.some = some;\nfunction elem(E) {\n return function (a, fa) {\n if (fa === undefined) {\n var elemE_1 = elem(E);\n return function (fa) { return elemE_1(a, fa); };\n }\n for (var k in fa) {\n if (E.equals(fa[k], a)) {\n return true;\n }\n }\n return false;\n };\n}\nexports.elem = elem;\n// -------------------------------------------------------------------------------------\n// non-pipeables\n// -------------------------------------------------------------------------------------\nvar map_ = function (fa, f) { return function_1.pipe(fa, map(f)); };\n/* istanbul ignore next */\nvar mapWithIndex_ = function (fa, f) { return function_1.pipe(fa, mapWithIndex(f)); };\n/* istanbul ignore next */\nvar reduce_ = function (fa, b, f) { return function_1.pipe(fa, exports.reduce(b, f)); };\n/* istanbul ignore next */\nvar foldMap_ = function (M) {\n var foldMapM = exports.foldMap(M);\n return function (fa, f) { return function_1.pipe(fa, foldMapM(f)); };\n};\n/* istanbul ignore next */\nvar reduceRight_ = function (fa, b, f) { return function_1.pipe(fa, exports.reduceRight(b, f)); };\n/* istanbul ignore next */\nvar traverse_ = function (F) {\n var traverseF = traverse(F);\n return function (ta, f) { return function_1.pipe(ta, traverseF(f)); };\n};\n/* istanbul ignore next */\nvar filter_ = function (fa, predicate) {\n return function_1.pipe(fa, exports.filter(predicate));\n};\n/* istanbul ignore next */\nvar filterMap_ = function (fa, f) { return function_1.pipe(fa, exports.filterMap(f)); };\n/* istanbul ignore next */\nvar partition_ = function (fa, predicate) { return function_1.pipe(fa, exports.partition(predicate)); };\n/* istanbul ignore next */\nvar partitionMap_ = function (fa, f) { return function_1.pipe(fa, exports.partitionMap(f)); };\n/* istanbul ignore next */\nvar reduceWithIndex_ = function (fa, b, f) {\n return function_1.pipe(fa, reduceWithIndex(b, f));\n};\n/* istanbul ignore next */\nvar foldMapWithIndex_ = function (M) {\n var foldMapWithIndexM = foldMapWithIndex(M);\n return function (fa, f) { return function_1.pipe(fa, foldMapWithIndexM(f)); };\n};\n/* istanbul ignore next */\nvar reduceRightWithIndex_ = function (fa, b, f) {\n return function_1.pipe(fa, reduceRightWithIndex(b, f));\n};\n/* istanbul ignore next */\nvar partitionMapWithIndex_ = function (fa, f) { return function_1.pipe(fa, partitionMapWithIndex(f)); };\n/* istanbul ignore next */\nvar partitionWithIndex_ = function (fa, predicateWithIndex) {\n return function_1.pipe(fa, partitionWithIndex(predicateWithIndex));\n};\n/* istanbul ignore next */\nvar filterMapWithIndex_ = function (fa, f) {\n return function_1.pipe(fa, filterMapWithIndex(f));\n};\n/* istanbul ignore next */\nvar filterWithIndex_ = function (fa, predicateWithIndex) {\n return function_1.pipe(fa, filterWithIndex(predicateWithIndex));\n};\n/* istanbul ignore next */\nvar traverseWithIndex_ = function (F) {\n var traverseWithIndexF = traverseWithIndex(F);\n return function (ta, f) { return function_1.pipe(ta, traverseWithIndexF(f)); };\n};\n/* istanbul ignore next */\nvar wither_ = function (F) {\n var witherF = exports.wither(F);\n return function (fa, f) { return function_1.pipe(fa, witherF(f)); };\n};\n/* istanbul ignore next */\nvar wilt_ = function (F) {\n var wiltF = exports.wilt(F);\n return function (fa, f) { return function_1.pipe(fa, wiltF(f)); };\n};\n// -------------------------------------------------------------------------------------\n// pipeables\n// -------------------------------------------------------------------------------------\n/**\n * @category Filterable\n * @since 2.5.0\n */\nvar filter = function (predicate) {\n return filterWithIndex(function (_, a) { return predicate(a); });\n};\nexports.filter = filter;\n/**\n * @category Filterable\n * @since 2.5.0\n */\nvar filterMap = function (f) { return filterMapWithIndex(function (_, a) { return f(a); }); };\nexports.filterMap = filterMap;\n/**\n * @category Filterable\n * @since 2.5.0\n */\nvar partition = function (predicate) {\n return partitionWithIndex(function (_, a) { return predicate(a); });\n};\nexports.partition = partition;\n/**\n * @category Filterable\n * @since 2.5.0\n */\nvar partitionMap = function (f) {\n return partitionMapWithIndex(function (_, a) { return f(a); });\n};\nexports.partitionMap = partitionMap;\n/**\n * @category Foldable\n * @since 2.5.0\n */\nvar reduce = function (b, f) {\n return reduceWithIndex(b, function (_, b, a) { return f(b, a); });\n};\nexports.reduce = reduce;\n/**\n * @category Foldable\n * @since 2.5.0\n */\nvar foldMap = function (M) {\n var foldMapWithIndexM = foldMapWithIndex(M);\n return function (f) { return foldMapWithIndexM(function (_, a) { return f(a); }); };\n};\nexports.foldMap = foldMap;\n/**\n * @category Foldable\n * @since 2.5.0\n */\nvar reduceRight = function (b, f) {\n return reduceRightWithIndex(b, function (_, a, b) { return f(a, b); });\n};\nexports.reduceRight = reduceRight;\n/**\n * @category Compactable\n * @since 2.5.0\n */\nvar compact = function (fa) {\n var r = {};\n var keys = Object.keys(fa);\n for (var _i = 0, keys_5 = keys; _i < keys_5.length; _i++) {\n var key = keys_5[_i];\n var optionA = fa[key];\n if (Option_1.isSome(optionA)) {\n r[key] = optionA.value;\n }\n }\n return r;\n};\nexports.compact = compact;\n/**\n * @category Compactable\n * @since 2.5.0\n */\nvar separate = function (fa) {\n var left = {};\n var right = {};\n var keys = Object.keys(fa);\n for (var _i = 0, keys_6 = keys; _i < keys_6.length; _i++) {\n var key = keys_6[_i];\n var e = fa[key];\n switch (e._tag) {\n case 'Left':\n left[key] = e.left;\n break;\n case 'Right':\n right[key] = e.right;\n break;\n }\n }\n return {\n left: left,\n right: right\n };\n};\nexports.separate = separate;\n// -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n/**\n * @category instances\n * @since 2.5.0\n */\nexports.URI = 'ReadonlyRecord';\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Functor = {\n URI: exports.URI,\n map: map_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.FunctorWithIndex = {\n URI: exports.URI,\n map: map_,\n mapWithIndex: mapWithIndex_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Foldable = {\n URI: exports.URI,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.FoldableWithIndex = {\n URI: exports.URI,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n reduceWithIndex: reduceWithIndex_,\n foldMapWithIndex: foldMapWithIndex_,\n reduceRightWithIndex: reduceRightWithIndex_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Compactable = {\n URI: exports.URI,\n compact: exports.compact,\n separate: exports.separate\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Filterable = {\n URI: exports.URI,\n map: map_,\n compact: exports.compact,\n separate: exports.separate,\n filter: filter_,\n filterMap: filterMap_,\n partition: partition_,\n partitionMap: partitionMap_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.FilterableWithIndex = {\n URI: exports.URI,\n map: map_,\n mapWithIndex: mapWithIndex_,\n compact: exports.compact,\n separate: exports.separate,\n filter: filter_,\n filterMap: filterMap_,\n partition: partition_,\n partitionMap: partitionMap_,\n filterMapWithIndex: filterMapWithIndex_,\n filterWithIndex: filterWithIndex_,\n partitionMapWithIndex: partitionMapWithIndex_,\n partitionWithIndex: partitionWithIndex_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Traversable = {\n URI: exports.URI,\n map: map_,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n traverse: traverse_,\n sequence: sequence\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.TraversableWithIndex = {\n URI: exports.URI,\n map: map_,\n mapWithIndex: mapWithIndex_,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n reduceWithIndex: reduceWithIndex_,\n foldMapWithIndex: foldMapWithIndex_,\n reduceRightWithIndex: reduceRightWithIndex_,\n traverse: traverse_,\n sequence: sequence,\n traverseWithIndex: traverseWithIndex_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Witherable = {\n URI: exports.URI,\n map: map_,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n traverse: traverse_,\n sequence: sequence,\n compact: exports.compact,\n separate: exports.separate,\n filter: filter_,\n filterMap: filterMap_,\n partition: partition_,\n partitionMap: partitionMap_,\n wither: wither_,\n wilt: wilt_\n};\n// TODO: remove in v3\n/**\n * @category instances\n * @since 2.5.0\n */\nexports.readonlyRecord = {\n URI: exports.URI,\n map: map_,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n traverse: traverse_,\n sequence: sequence,\n compact: exports.compact,\n separate: exports.separate,\n filter: filter_,\n filterMap: filterMap_,\n partition: partition_,\n partitionMap: partitionMap_,\n mapWithIndex: mapWithIndex_,\n reduceWithIndex: reduceWithIndex_,\n foldMapWithIndex: foldMapWithIndex_,\n reduceRightWithIndex: reduceRightWithIndex_,\n filterMapWithIndex: filterMapWithIndex_,\n filterWithIndex: filterWithIndex_,\n partitionMapWithIndex: partitionMapWithIndex_,\n partitionWithIndex: partitionWithIndex_,\n traverseWithIndex: traverseWithIndex_,\n wither: wither_,\n wilt: wilt_\n};\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FunctorWithIndex = exports.Functor = exports.URI = exports.separate = exports.compact = exports.reduceRight = exports.reduce = exports.partitionMap = exports.partition = exports.foldMap = exports.filterMap = exports.filter = exports.elem = exports.some = exports.every = exports.fromFoldableMap = exports.fromFoldable = exports.filterWithIndex = exports.filterMapWithIndex = exports.partitionWithIndex = exports.partitionMapWithIndex = exports.wilt = exports.wither = exports.sequence = exports.traverse = exports.traverseWithIndex = exports.singleton = exports.reduceRightWithIndex = exports.foldMapWithIndex = exports.reduceWithIndex = exports.map = exports.mapWithIndex = exports.empty = exports.lookup = exports.getMonoid = exports.getEq = exports.isSubrecord = exports.pop = exports.modifyAt = exports.updateAt = exports.deleteAt = exports.hasOwnProperty = exports.insertAt = exports.toUnfoldable = exports.toArray = exports.collect = exports.keys = exports.isEmpty = exports.size = exports.getShow = void 0;\nexports.record = exports.Witherable = exports.TraversableWithIndex = exports.Traversable = exports.FilterableWithIndex = exports.Filterable = exports.Compactable = exports.FoldableWithIndex = exports.Foldable = void 0;\nvar RR = __importStar(require(\"./ReadonlyRecord\"));\n/* tslint:disable:readonly-array */\n// -------------------------------------------------------------------------------------\n// model\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.0.0\n */\nexports.getShow = RR.getShow;\n/**\n * Calculate the number of key/value pairs in a record\n *\n * @since 2.0.0\n */\nexports.size = RR.size;\n/**\n * Test whether a record is empty\n *\n * @since 2.0.0\n */\nexports.isEmpty = RR.isEmpty;\n/**\n * @since 2.0.0\n */\nexports.keys = RR.keys;\n/**\n * Map a record into an array\n *\n * @example\n * import {collect} from 'fp-ts/Record'\n *\n * const x: { a: string, b: boolean } = { a: 'foo', b: false }\n * assert.deepStrictEqual(\n * collect((key, val) => ({key: key, value: val}))(x),\n * [{key: 'a', value: 'foo'}, {key: 'b', value: false}]\n * )\n *\n * @since 2.0.0\n */\nexports.collect = RR.collect;\n/**\n * @since 2.0.0\n */\nexports.toArray = RR.toReadonlyArray;\nfunction toUnfoldable(U) {\n return RR.toUnfoldable(U);\n}\nexports.toUnfoldable = toUnfoldable;\nfunction insertAt(k, a) {\n return RR.insertAt(k, a);\n}\nexports.insertAt = insertAt;\n/**\n * @since 2.0.0\n */\nexports.hasOwnProperty = RR.hasOwnProperty;\nfunction deleteAt(k) {\n return RR.deleteAt(k);\n}\nexports.deleteAt = deleteAt;\n/**\n * @since 2.0.0\n */\nexports.updateAt = RR.updateAt;\n/**\n * @since 2.0.0\n */\nexports.modifyAt = RR.modifyAt;\nfunction pop(k) {\n return RR.pop(k);\n}\nexports.pop = pop;\n// TODO: remove non-curried overloading in v3\n/**\n * Test whether one record contains all of the keys and values contained in another record\n *\n * @since 2.0.0\n */\nexports.isSubrecord = RR.isSubrecord;\nfunction getEq(E) {\n return RR.getEq(E);\n}\nexports.getEq = getEq;\nfunction getMonoid(S) {\n return RR.getMonoid(S);\n}\nexports.getMonoid = getMonoid;\n// TODO: remove non-curried overloading in v3\n/**\n * Lookup the value for a key in a record\n *\n * @since 2.0.0\n */\nexports.lookup = RR.lookup;\n/**\n * @since 2.0.0\n */\nexports.empty = {};\nfunction mapWithIndex(f) {\n return RR.mapWithIndex(f);\n}\nexports.mapWithIndex = mapWithIndex;\nfunction map(f) {\n return RR.map(f);\n}\nexports.map = map;\nfunction reduceWithIndex(b, f) {\n return RR.reduceWithIndex(b, f);\n}\nexports.reduceWithIndex = reduceWithIndex;\nfunction foldMapWithIndex(M) {\n return RR.foldMapWithIndex(M);\n}\nexports.foldMapWithIndex = foldMapWithIndex;\nfunction reduceRightWithIndex(b, f) {\n return RR.reduceRightWithIndex(b, f);\n}\nexports.reduceRightWithIndex = reduceRightWithIndex;\n/**\n * Create a record with one key/value pair\n *\n * @since 2.0.0\n */\nexports.singleton = RR.singleton;\nfunction traverseWithIndex(F) {\n return RR.traverseWithIndex(F);\n}\nexports.traverseWithIndex = traverseWithIndex;\nfunction traverse(F) {\n return RR.traverse(F);\n}\nexports.traverse = traverse;\nfunction sequence(F) {\n return RR.sequence(F);\n}\nexports.sequence = sequence;\n/**\n * @category Witherable\n * @since 2.6.5\n */\nexports.wither = RR.wither;\n/**\n * @category Witherable\n * @since 2.6.5\n */\nexports.wilt = RR.wilt;\nfunction partitionMapWithIndex(f) {\n return RR.partitionMapWithIndex(f);\n}\nexports.partitionMapWithIndex = partitionMapWithIndex;\nfunction partitionWithIndex(predicateWithIndex) {\n return RR.partitionWithIndex(predicateWithIndex);\n}\nexports.partitionWithIndex = partitionWithIndex;\nfunction filterMapWithIndex(f) {\n return RR.filterMapWithIndex(f);\n}\nexports.filterMapWithIndex = filterMapWithIndex;\nfunction filterWithIndex(predicateWithIndex) {\n return RR.filterWithIndex(predicateWithIndex);\n}\nexports.filterWithIndex = filterWithIndex;\nfunction fromFoldable(M, F) {\n return RR.fromFoldable(M, F);\n}\nexports.fromFoldable = fromFoldable;\nfunction fromFoldableMap(M, F) {\n return RR.fromFoldableMap(M, F);\n}\nexports.fromFoldableMap = fromFoldableMap;\n/**\n * @since 2.0.0\n */\nexports.every = RR.every;\n/**\n * @since 2.0.0\n */\nexports.some = RR.some;\n// TODO: remove non-curried overloading in v3\n/**\n * @since 2.0.0\n */\nexports.elem = RR.elem;\n// -------------------------------------------------------------------------------------\n// non-pipeables\n// -------------------------------------------------------------------------------------\nvar map_ = RR.Functor.map;\nvar mapWithIndex_ = RR.FunctorWithIndex.mapWithIndex;\nvar reduce_ = RR.Foldable.reduce;\nvar foldMap_ = RR.Foldable.foldMap;\nvar reduceRight_ = RR.Foldable.reduceRight;\nvar reduceWithIndex_ = RR.FoldableWithIndex.reduceWithIndex;\nvar foldMapWithIndex_ = RR.FoldableWithIndex.foldMapWithIndex;\nvar reduceRightWithIndex_ = RR.FoldableWithIndex.reduceRightWithIndex;\nvar filter_ = RR.Filterable.filter;\nvar filterMap_ = RR.Filterable.filterMap;\nvar partition_ = RR.Filterable.partition;\nvar partitionMap_ = RR.Filterable.partitionMap;\nvar filterWithIndex_ = RR.FilterableWithIndex\n .filterWithIndex;\nvar filterMapWithIndex_ = RR.FilterableWithIndex.filterMapWithIndex;\nvar partitionWithIndex_ = RR.FilterableWithIndex\n .partitionWithIndex;\nvar partitionMapWithIndex_ = RR.FilterableWithIndex.partitionMapWithIndex;\nvar traverseWithIndex_ = RR.TraversableWithIndex\n .traverseWithIndex;\nvar wither_ = RR.Witherable.wither;\nvar wilt_ = RR.Witherable.wilt;\nvar traverse_ = function (F) {\n var traverseF = traverse(F);\n return function (ta, f) { return traverseF(f)(ta); };\n};\n// -------------------------------------------------------------------------------------\n// pipeables\n// -------------------------------------------------------------------------------------\n/**\n * @category Filterable\n * @since 2.0.0\n */\nexports.filter = RR.filter;\n/**\n * @category Filterable\n * @since 2.0.0\n */\nexports.filterMap = RR.filterMap;\n/**\n * @category Foldable\n * @since 2.0.0\n */\nexports.foldMap = RR.foldMap;\n/**\n * @category Filterable\n * @since 2.0.0\n */\nexports.partition = RR.partition;\n/**\n * @category Filterable\n * @since 2.0.0\n */\nexports.partitionMap = RR.partitionMap;\n/**\n * @category Foldable\n * @since 2.0.0\n */\nexports.reduce = RR.reduce;\n/**\n * @category Foldable\n * @since 2.0.0\n */\nexports.reduceRight = RR.reduceRight;\n/**\n * @category Compactable\n * @since 2.0.0\n */\nexports.compact = RR.compact;\n/**\n * @category Compactable\n * @since 2.0.0\n */\nexports.separate = RR.separate;\n// -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.URI = 'Record';\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Functor = {\n URI: exports.URI,\n map: map_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.FunctorWithIndex = {\n URI: exports.URI,\n map: map_,\n mapWithIndex: mapWithIndex_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Foldable = {\n URI: exports.URI,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.FoldableWithIndex = {\n URI: exports.URI,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n reduceWithIndex: reduceWithIndex_,\n foldMapWithIndex: foldMapWithIndex_,\n reduceRightWithIndex: reduceRightWithIndex_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Compactable = {\n URI: exports.URI,\n compact: exports.compact,\n separate: exports.separate\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Filterable = {\n URI: exports.URI,\n map: map_,\n compact: exports.compact,\n separate: exports.separate,\n filter: filter_,\n filterMap: filterMap_,\n partition: partition_,\n partitionMap: partitionMap_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.FilterableWithIndex = {\n URI: exports.URI,\n map: map_,\n mapWithIndex: mapWithIndex_,\n compact: exports.compact,\n separate: exports.separate,\n filter: filter_,\n filterMap: filterMap_,\n partition: partition_,\n partitionMap: partitionMap_,\n filterMapWithIndex: filterMapWithIndex_,\n filterWithIndex: filterWithIndex_,\n partitionMapWithIndex: partitionMapWithIndex_,\n partitionWithIndex: partitionWithIndex_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Traversable = {\n URI: exports.URI,\n map: map_,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n traverse: traverse_,\n sequence: sequence\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.TraversableWithIndex = {\n URI: exports.URI,\n map: map_,\n mapWithIndex: mapWithIndex_,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n reduceWithIndex: reduceWithIndex_,\n foldMapWithIndex: foldMapWithIndex_,\n reduceRightWithIndex: reduceRightWithIndex_,\n traverse: traverse_,\n sequence: sequence,\n traverseWithIndex: traverseWithIndex_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Witherable = {\n URI: exports.URI,\n map: map_,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n traverse: traverse_,\n sequence: sequence,\n compact: exports.compact,\n separate: exports.separate,\n filter: filter_,\n filterMap: filterMap_,\n partition: partition_,\n partitionMap: partitionMap_,\n wither: wither_,\n wilt: wilt_\n};\n// TODO: remove in v3\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.record = {\n URI: exports.URI,\n map: map_,\n reduce: reduce_,\n foldMap: foldMap_,\n reduceRight: reduceRight_,\n traverse: traverse_,\n sequence: sequence,\n compact: exports.compact,\n separate: exports.separate,\n filter: filter_,\n filterMap: filterMap_,\n partition: partition_,\n partitionMap: partitionMap_,\n mapWithIndex: mapWithIndex_,\n reduceWithIndex: reduceWithIndex_,\n foldMapWithIndex: foldMapWithIndex_,\n reduceRightWithIndex: reduceRightWithIndex_,\n filterMapWithIndex: filterMapWithIndex_,\n filterWithIndex: filterWithIndex_,\n partitionMapWithIndex: partitionMapWithIndex_,\n partitionWithIndex: partitionWithIndex_,\n traverseWithIndex: traverseWithIndex_,\n wither: wither_,\n wilt: wilt_\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getIntercalateSemigroup = exports.semigroupVoid = exports.semigroupString = exports.semigroupProduct = exports.semigroupSum = exports.semigroupAny = exports.semigroupAll = exports.getObjectSemigroup = exports.getJoinSemigroup = exports.getMeetSemigroup = exports.getStructSemigroup = exports.getFunctionSemigroup = exports.getDualSemigroup = exports.getTupleSemigroup = exports.getLastSemigroup = exports.getFirstSemigroup = exports.fold = void 0;\n/**\n * If a type `A` can form a `Semigroup` it has an **associative** binary operation.\n *\n * ```ts\n * interface Semigroup {\n * readonly concat: (x: A, y: A) => A\n * }\n * ```\n *\n * Associativity means the following equality must hold for any choice of `x`, `y`, and `z`.\n *\n * ```ts\n * concat(x, concat(y, z)) = concat(concat(x, y), z)\n * ```\n *\n * A common example of a semigroup is the type `string` with the operation `+`.\n *\n * ```ts\n * import { Semigroup } from 'fp-ts/Semigroup'\n *\n * const semigroupString: Semigroup = {\n * concat: (x, y) => x + y\n * }\n *\n * const x = 'x'\n * const y = 'y'\n * const z = 'z'\n *\n * semigroupString.concat(x, y) // 'xy'\n *\n * semigroupString.concat(x, semigroupString.concat(y, z)) // 'xyz'\n *\n * semigroupString.concat(semigroupString.concat(x, y), z) // 'xyz'\n * ```\n *\n * *Adapted from https://typelevel.org/cats*\n *\n * @since 2.0.0\n */\nvar function_1 = require(\"./function\");\nvar Ord_1 = require(\"./Ord\");\nfunction fold(S) {\n return function (startWith, as) {\n if (as === undefined) {\n var foldS_1 = fold(S);\n return function (as) { return foldS_1(startWith, as); };\n }\n return as.reduce(S.concat, startWith);\n };\n}\nexports.fold = fold;\n/**\n * Always return the first argument.\n *\n * @example\n * import * as S from 'fp-ts/Semigroup'\n *\n * assert.deepStrictEqual(S.getFirstSemigroup().concat(1, 2), 1)\n *\n * @category instances\n * @since 2.0.0\n */\nfunction getFirstSemigroup() {\n return { concat: function_1.identity };\n}\nexports.getFirstSemigroup = getFirstSemigroup;\n/**\n * Always return the last argument.\n *\n * @example\n * import * as S from 'fp-ts/Semigroup'\n *\n * assert.deepStrictEqual(S.getLastSemigroup().concat(1, 2), 2)\n *\n * @category instances\n * @since 2.0.0\n */\nfunction getLastSemigroup() {\n return { concat: function (_, y) { return y; } };\n}\nexports.getLastSemigroup = getLastSemigroup;\n/**\n * Given a tuple of semigroups returns a semigroup for the tuple.\n *\n * @example\n * import * as S from 'fp-ts/Semigroup'\n *\n * const S1 = S.getTupleSemigroup(S.semigroupString, S.semigroupSum)\n * assert.deepStrictEqual(S1.concat(['a', 1], ['b', 2]), ['ab', 3])\n *\n * const S2 = S.getTupleSemigroup(S.semigroupString, S.semigroupSum, S.semigroupAll)\n * assert.deepStrictEqual(S2.concat(['a', 1, true], ['b', 2, false]), ['ab', 3, false])\n *\n * @category instances\n * @since 2.0.0\n */\nfunction getTupleSemigroup() {\n var semigroups = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n semigroups[_i] = arguments[_i];\n }\n return {\n concat: function (x, y) { return semigroups.map(function (s, i) { return s.concat(x[i], y[i]); }); }\n };\n}\nexports.getTupleSemigroup = getTupleSemigroup;\n/**\n * The dual of a `Semigroup`, obtained by swapping the arguments of `concat`.\n *\n * @example\n * import * as S from 'fp-ts/Semigroup'\n *\n * assert.deepStrictEqual(S.getDualSemigroup(S.semigroupString).concat('a', 'b'), 'ba')\n *\n * @category instances\n * @since 2.0.0\n */\nfunction getDualSemigroup(S) {\n return {\n concat: function (x, y) { return S.concat(y, x); }\n };\n}\nexports.getDualSemigroup = getDualSemigroup;\n/**\n * Unary functions form a semigroup as long as you can provide a semigroup for the codomain.\n *\n * @example\n * import { Predicate } from 'fp-ts/function'\n * import * as S from 'fp-ts/Semigroup'\n *\n * const f: Predicate = (n) => n <= 2\n * const g: Predicate = (n) => n >= 0\n *\n * const S1 = S.getFunctionSemigroup(S.semigroupAll)()\n *\n * assert.deepStrictEqual(S1.concat(f, g)(1), true)\n * assert.deepStrictEqual(S1.concat(f, g)(3), false)\n *\n * const S2 = S.getFunctionSemigroup(S.semigroupAny)()\n *\n * assert.deepStrictEqual(S2.concat(f, g)(1), true)\n * assert.deepStrictEqual(S2.concat(f, g)(3), true)\n *\n * @category instances\n * @since 2.0.0\n */\nfunction getFunctionSemigroup(S) {\n return function () { return ({\n concat: function (f, g) { return function (a) { return S.concat(f(a), g(a)); }; }\n }); };\n}\nexports.getFunctionSemigroup = getFunctionSemigroup;\n/**\n * Given a struct of semigroups returns a semigroup for the struct.\n *\n * @example\n * import * as S from 'fp-ts/Semigroup'\n *\n * interface Point {\n * readonly x: number\n * readonly y: number\n * }\n *\n * const semigroupPoint = S.getStructSemigroup({\n * x: S.semigroupSum,\n * y: S.semigroupSum\n * })\n *\n * assert.deepStrictEqual(semigroupPoint.concat({ x: 1, y: 2 }, { x: 3, y: 4 }), { x: 4, y: 6 })\n *\n * @category instances\n * @since 2.0.0\n */\nfunction getStructSemigroup(semigroups) {\n return {\n concat: function (x, y) {\n var r = {};\n for (var _i = 0, _a = Object.keys(semigroups); _i < _a.length; _i++) {\n var key = _a[_i];\n r[key] = semigroups[key].concat(x[key], y[key]);\n }\n return r;\n }\n };\n}\nexports.getStructSemigroup = getStructSemigroup;\n/**\n * Get a semigroup where `concat` will return the minimum, based on the provided order.\n *\n * @example\n * import * as O from 'fp-ts/Ord'\n * import * as S from 'fp-ts/Semigroup'\n *\n * const S1 = S.getMeetSemigroup(O.ordNumber)\n *\n * assert.deepStrictEqual(S1.concat(1, 2), 1)\n *\n * @category instances\n * @since 2.0.0\n */\nfunction getMeetSemigroup(O) {\n return {\n concat: Ord_1.min(O)\n };\n}\nexports.getMeetSemigroup = getMeetSemigroup;\n/**\n * Get a semigroup where `concat` will return the maximum, based on the provided order.\n *\n * @example\n * import * as O from 'fp-ts/Ord'\n * import * as S from 'fp-ts/Semigroup'\n *\n * const S1 = S.getJoinSemigroup(O.ordNumber)\n *\n * assert.deepStrictEqual(S1.concat(1, 2), 2)\n *\n * @category instances\n * @since 2.0.0\n */\nfunction getJoinSemigroup(O) {\n return {\n concat: Ord_1.max(O)\n };\n}\nexports.getJoinSemigroup = getJoinSemigroup;\n/**\n * Return a semigroup for objects, preserving their type.\n *\n * @example\n * import * as S from 'fp-ts/Semigroup'\n *\n * interface Person {\n * name: string\n * age: number\n * }\n *\n * const S1 = S.getObjectSemigroup()\n * assert.deepStrictEqual(S1.concat({ name: 'name', age: 23 }, { name: 'name', age: 24 }), { name: 'name', age: 24 })\n *\n * @category instances\n * @since 2.0.0\n */\nfunction getObjectSemigroup() {\n return {\n concat: function (x, y) { return Object.assign({}, x, y); }\n };\n}\nexports.getObjectSemigroup = getObjectSemigroup;\n/**\n * `boolean` semigroup under conjunction.\n *\n * @example\n * import * as S from 'fp-ts/Semigroup'\n *\n * assert.deepStrictEqual(S.semigroupAll.concat(true, true), true)\n * assert.deepStrictEqual(S.semigroupAll.concat(true, false), false)\n *\n * @category instances\n * @since 2.0.0\n */\nexports.semigroupAll = {\n concat: function (x, y) { return x && y; }\n};\n/**\n * `boolean` semigroup under disjunction.\n *\n * @example\n * import * as S from 'fp-ts/Semigroup'\n *\n * assert.deepStrictEqual(S.semigroupAny.concat(true, true), true)\n * assert.deepStrictEqual(S.semigroupAny.concat(true, false), true)\n * assert.deepStrictEqual(S.semigroupAny.concat(false, false), false)\n *\n * @category instances\n * @since 2.0.0\n */\nexports.semigroupAny = {\n concat: function (x, y) { return x || y; }\n};\n/**\n * `number` semigroup under addition.\n *\n * @example\n * import * as S from 'fp-ts/Semigroup'\n *\n * assert.deepStrictEqual(S.semigroupSum.concat(2, 3), 5)\n *\n * @category instances\n * @since 2.0.0\n */\nexports.semigroupSum = {\n concat: function (x, y) { return x + y; }\n};\n/**\n * `number` semigroup under multiplication.\n *\n * @example\n * import * as S from 'fp-ts/Semigroup'\n *\n * assert.deepStrictEqual(S.semigroupProduct.concat(2, 3), 6)\n *\n * @category instances\n * @since 2.0.0\n */\nexports.semigroupProduct = {\n concat: function (x, y) { return x * y; }\n};\n/**\n * `string` semigroup under concatenation.\n *\n * @example\n * import * as S from 'fp-ts/Semigroup'\n *\n * assert.deepStrictEqual(S.semigroupString.concat('a', 'b'), 'ab')\n *\n * @category instances\n * @since 2.0.0\n */\nexports.semigroupString = {\n concat: function (x, y) { return x + y; }\n};\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.semigroupVoid = {\n concat: function () { return undefined; }\n};\n/**\n * You can glue items between and stay associative.\n *\n * @example\n * import * as S from 'fp-ts/Semigroup'\n *\n * const S1 = S.getIntercalateSemigroup(' ')(S.semigroupString)\n *\n * assert.strictEqual(S1.concat('a', 'b'), 'a b')\n * assert.strictEqual(S1.concat(S1.concat('a', 'b'), 'c'), S1.concat('a', S1.concat('b', 'c')))\n *\n * @category instances\n * @since 2.5.0\n */\nfunction getIntercalateSemigroup(a) {\n return function (S) { return ({\n concat: function (x, y) { return S.concat(x, S.concat(a, y)); }\n }); };\n}\nexports.getIntercalateSemigroup = getIntercalateSemigroup;\n","\"use strict\";\n/**\n * @since 2.0.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.bindTo_ = exports.bind_ = exports.hole = exports.pipe = exports.untupled = exports.tupled = exports.absurd = exports.decrement = exports.increment = exports.tuple = exports.flow = exports.flip = exports.constVoid = exports.constUndefined = exports.constNull = exports.constFalse = exports.constTrue = exports.constant = exports.not = exports.unsafeCoerce = exports.identity = void 0;\n/**\n * @since 2.0.0\n */\nfunction identity(a) {\n return a;\n}\nexports.identity = identity;\n/**\n * @since 2.0.0\n */\nexports.unsafeCoerce = identity;\n/**\n * @since 2.0.0\n */\nfunction not(predicate) {\n return function (a) { return !predicate(a); };\n}\nexports.not = not;\n/**\n * @since 2.0.0\n */\nfunction constant(a) {\n return function () { return a; };\n}\nexports.constant = constant;\n/**\n * A thunk that returns always `true`.\n *\n * @since 2.0.0\n */\nexports.constTrue = \n/*#__PURE__*/\nconstant(true);\n/**\n * A thunk that returns always `false`.\n *\n * @since 2.0.0\n */\nexports.constFalse = \n/*#__PURE__*/\nconstant(false);\n/**\n * A thunk that returns always `null`.\n *\n * @since 2.0.0\n */\nexports.constNull = \n/*#__PURE__*/\nconstant(null);\n/**\n * A thunk that returns always `undefined`.\n *\n * @since 2.0.0\n */\nexports.constUndefined = \n/*#__PURE__*/\nconstant(undefined);\n/**\n * A thunk that returns always `void`.\n *\n * @since 2.0.0\n */\nexports.constVoid = exports.constUndefined;\n// TODO: remove in v3\n/**\n * Flips the order of the arguments of a function of two arguments.\n *\n * @since 2.0.0\n */\nfunction flip(f) {\n return function (b, a) { return f(a, b); };\n}\nexports.flip = flip;\nfunction flow(ab, bc, cd, de, ef, fg, gh, hi, ij) {\n switch (arguments.length) {\n case 1:\n return ab;\n case 2:\n return function () {\n return bc(ab.apply(this, arguments));\n };\n case 3:\n return function () {\n return cd(bc(ab.apply(this, arguments)));\n };\n case 4:\n return function () {\n return de(cd(bc(ab.apply(this, arguments))));\n };\n case 5:\n return function () {\n return ef(de(cd(bc(ab.apply(this, arguments)))));\n };\n case 6:\n return function () {\n return fg(ef(de(cd(bc(ab.apply(this, arguments))))));\n };\n case 7:\n return function () {\n return gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))));\n };\n case 8:\n return function () {\n return hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments))))))));\n };\n case 9:\n return function () {\n return ij(hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))))));\n };\n }\n return;\n}\nexports.flow = flow;\n/**\n * @since 2.0.0\n */\nfunction tuple() {\n var t = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n t[_i] = arguments[_i];\n }\n return t;\n}\nexports.tuple = tuple;\n/**\n * @since 2.0.0\n */\nfunction increment(n) {\n return n + 1;\n}\nexports.increment = increment;\n/**\n * @since 2.0.0\n */\nfunction decrement(n) {\n return n - 1;\n}\nexports.decrement = decrement;\n/**\n * @since 2.0.0\n */\nfunction absurd(_) {\n throw new Error('Called `absurd` function which should be uncallable');\n}\nexports.absurd = absurd;\n/**\n * Creates a tupled version of this function: instead of `n` arguments, it accepts a single tuple argument.\n *\n * @example\n * import { tupled } from 'fp-ts/function'\n *\n * const add = tupled((x: number, y: number): number => x + y)\n *\n * assert.strictEqual(add([1, 2]), 3)\n *\n * @since 2.4.0\n */\nfunction tupled(f) {\n return function (a) { return f.apply(void 0, a); };\n}\nexports.tupled = tupled;\n/**\n * Inverse function of `tupled`\n *\n * @since 2.4.0\n */\nfunction untupled(f) {\n return function () {\n var a = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n a[_i] = arguments[_i];\n }\n return f(a);\n };\n}\nexports.untupled = untupled;\nfunction pipe(a, ab, bc, cd, de, ef, fg, gh, hi, ij, jk, kl, lm, mn, no, op, pq, qr, rs, st) {\n switch (arguments.length) {\n case 1:\n return a;\n case 2:\n return ab(a);\n case 3:\n return bc(ab(a));\n case 4:\n return cd(bc(ab(a)));\n case 5:\n return de(cd(bc(ab(a))));\n case 6:\n return ef(de(cd(bc(ab(a)))));\n case 7:\n return fg(ef(de(cd(bc(ab(a))))));\n case 8:\n return gh(fg(ef(de(cd(bc(ab(a)))))));\n case 9:\n return hi(gh(fg(ef(de(cd(bc(ab(a))))))));\n case 10:\n return ij(hi(gh(fg(ef(de(cd(bc(ab(a)))))))));\n case 11:\n return jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a))))))))));\n case 12:\n return kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a)))))))))));\n case 13:\n return lm(kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a))))))))))));\n case 14:\n return mn(lm(kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a)))))))))))));\n case 15:\n return no(mn(lm(kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a))))))))))))));\n case 16:\n return op(no(mn(lm(kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a)))))))))))))));\n case 17:\n return pq(op(no(mn(lm(kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a))))))))))))))));\n case 18:\n return qr(pq(op(no(mn(lm(kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a)))))))))))))))));\n case 19:\n return rs(qr(pq(op(no(mn(lm(kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a))))))))))))))))));\n case 20:\n return st(rs(qr(pq(op(no(mn(lm(kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a)))))))))))))))))));\n }\n return;\n}\nexports.pipe = pipe;\n/**\n * Type hole simulation\n *\n * @since 2.7.0\n */\nexports.hole = absurd;\n/**\n * @internal\n */\nvar bind_ = function (a, name, b) {\n var _a;\n return Object.assign({}, a, (_a = {}, _a[name] = b, _a));\n};\nexports.bind_ = bind_;\n/**\n * @internal\n */\nvar bindTo_ = function (name) { return function (b) {\n var _a;\n return (_a = {}, _a[name] = b, _a);\n}; };\nexports.bindTo_ = bindTo_;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.pipeable = exports.pipe = void 0;\nvar function_1 = require(\"./function\");\n// TODO: remove module in v3\n/**\n * Use [`pipe`](https://gcanti.github.io/fp-ts/modules/function.ts.html#flow) from `function` module instead.\n *\n * @since 2.0.0\n */\nexports.pipe = function_1.pipe;\nvar isFunctor = function (I) { return typeof I.map === 'function'; };\nvar isContravariant = function (I) { return typeof I.contramap === 'function'; };\nvar isFunctorWithIndex = function (I) { return typeof I.mapWithIndex === 'function'; };\nvar isApply = function (I) { return typeof I.ap === 'function'; };\nvar isChain = function (I) { return typeof I.chain === 'function'; };\nvar isBifunctor = function (I) { return typeof I.bimap === 'function'; };\nvar isExtend = function (I) { return typeof I.extend === 'function'; };\nvar isFoldable = function (I) { return typeof I.reduce === 'function'; };\nvar isFoldableWithIndex = function (I) { return typeof I.reduceWithIndex === 'function'; };\nvar isAlt = function (I) { return typeof I.alt === 'function'; };\nvar isCompactable = function (I) { return typeof I.compact === 'function'; };\nvar isFilterable = function (I) { return typeof I.filter === 'function'; };\nvar isFilterableWithIndex = function (I) {\n return typeof I.filterWithIndex === 'function';\n};\nvar isProfunctor = function (I) { return typeof I.promap === 'function'; };\nvar isSemigroupoid = function (I) { return typeof I.compose === 'function'; };\nvar isMonadThrow = function (I) { return typeof I.throwError === 'function'; };\nfunction pipeable(I) {\n var r = {};\n if (isFunctor(I)) {\n var map = function (f) { return function (fa) { return I.map(fa, f); }; };\n r.map = map;\n }\n if (isContravariant(I)) {\n var contramap = function (f) { return function (fa) { return I.contramap(fa, f); }; };\n r.contramap = contramap;\n }\n if (isFunctorWithIndex(I)) {\n var mapWithIndex = function (f) { return function (fa) { return I.mapWithIndex(fa, f); }; };\n r.mapWithIndex = mapWithIndex;\n }\n if (isApply(I)) {\n var ap = function (fa) { return function (fab) { return I.ap(fab, fa); }; };\n var apFirst = function (fb) { return function (fa) {\n return I.ap(I.map(fa, function (a) { return function () { return a; }; }), fb);\n }; };\n r.ap = ap;\n r.apFirst = apFirst;\n r.apSecond = function (fb) { return function (fa) {\n return I.ap(I.map(fa, function () { return function (b) { return b; }; }), fb);\n }; };\n }\n if (isChain(I)) {\n var chain = function (f) { return function (ma) { return I.chain(ma, f); }; };\n var chainFirst = function (f) { return function (ma) { return I.chain(ma, function (a) { return I.map(f(a), function () { return a; }); }); }; };\n var flatten = function (mma) { return I.chain(mma, function_1.identity); };\n r.chain = chain;\n r.chainFirst = chainFirst;\n r.flatten = flatten;\n }\n if (isBifunctor(I)) {\n var bimap = function (f, g) { return function (fa) { return I.bimap(fa, f, g); }; };\n var mapLeft = function (f) { return function (fa) { return I.mapLeft(fa, f); }; };\n r.bimap = bimap;\n r.mapLeft = mapLeft;\n }\n if (isExtend(I)) {\n var extend = function (f) { return function (wa) { return I.extend(wa, f); }; };\n var duplicate = function (wa) { return I.extend(wa, function_1.identity); };\n r.extend = extend;\n r.duplicate = duplicate;\n }\n if (isFoldable(I)) {\n var reduce = function (b, f) { return function (fa) { return I.reduce(fa, b, f); }; };\n var foldMap = function (M) {\n var foldMapM = I.foldMap(M);\n return function (f) { return function (fa) { return foldMapM(fa, f); }; };\n };\n var reduceRight = function (b, f) { return function (fa) { return I.reduceRight(fa, b, f); }; };\n r.reduce = reduce;\n r.foldMap = foldMap;\n r.reduceRight = reduceRight;\n }\n if (isFoldableWithIndex(I)) {\n var reduceWithIndex = function (b, f) { return function (fa) {\n return I.reduceWithIndex(fa, b, f);\n }; };\n var foldMapWithIndex = function (M) {\n var foldMapM = I.foldMapWithIndex(M);\n return function (f) { return function (fa) { return foldMapM(fa, f); }; };\n };\n var reduceRightWithIndex = function (b, f) { return function (fa) {\n return I.reduceRightWithIndex(fa, b, f);\n }; };\n r.reduceWithIndex = reduceWithIndex;\n r.foldMapWithIndex = foldMapWithIndex;\n r.reduceRightWithIndex = reduceRightWithIndex;\n }\n if (isAlt(I)) {\n var alt = function (that) { return function (fa) { return I.alt(fa, that); }; };\n r.alt = alt;\n }\n if (isCompactable(I)) {\n r.compact = I.compact;\n r.separate = I.separate;\n }\n if (isFilterable(I)) {\n var filter = function (predicate) { return function (fa) {\n return I.filter(fa, predicate);\n }; };\n var filterMap = function (f) { return function (fa) { return I.filterMap(fa, f); }; };\n var partition = function (predicate) { return function (fa) {\n return I.partition(fa, predicate);\n }; };\n var partitionMap = function (f) { return function (fa) { return I.partitionMap(fa, f); }; };\n r.filter = filter;\n r.filterMap = filterMap;\n r.partition = partition;\n r.partitionMap = partitionMap;\n }\n if (isFilterableWithIndex(I)) {\n var filterWithIndex = function (predicateWithIndex) { return function (fa) { return I.filterWithIndex(fa, predicateWithIndex); }; };\n var filterMapWithIndex = function (f) { return function (fa) {\n return I.filterMapWithIndex(fa, f);\n }; };\n var partitionWithIndex = function (predicateWithIndex) { return function (fa) { return I.partitionWithIndex(fa, predicateWithIndex); }; };\n var partitionMapWithIndex = function (f) { return function (fa) {\n return I.partitionMapWithIndex(fa, f);\n }; };\n r.filterWithIndex = filterWithIndex;\n r.filterMapWithIndex = filterMapWithIndex;\n r.partitionWithIndex = partitionWithIndex;\n r.partitionMapWithIndex = partitionMapWithIndex;\n }\n if (isProfunctor(I)) {\n var promap = function (f, g) { return function (fa) { return I.promap(fa, f, g); }; };\n r.promap = promap;\n }\n if (isSemigroupoid(I)) {\n var compose = function (that) { return function (fa) { return I.compose(fa, that); }; };\n r.compose = compose;\n }\n if (isMonadThrow(I)) {\n var fromOption = function (onNone) { return function (ma) {\n return ma._tag === 'None' ? I.throwError(onNone()) : I.of(ma.value);\n }; };\n var fromEither = function (ma) {\n return ma._tag === 'Left' ? I.throwError(ma.left) : I.of(ma.right);\n };\n var fromPredicate = function (predicate, onFalse) { return function (a) { return (predicate(a) ? I.of(a) : I.throwError(onFalse(a))); }; };\n var filterOrElse = function (predicate, onFalse) { return function (ma) { return I.chain(ma, function (a) { return (predicate(a) ? I.of(a) : I.throwError(onFalse(a))); }); }; };\n r.fromOption = fromOption;\n r.fromEither = fromEither;\n r.fromPredicate = fromPredicate;\n r.filterOrElse = filterOrElse;\n }\n return r;\n}\nexports.pipeable = pipeable;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.reporter = exports.formatValidationErrors = exports.formatValidationError = exports.TYPE_MAX_LEN = void 0;\n/**\n * An [io-ts Reporter](https://gcanti.github.io/io-ts/modules/Reporter.ts.html#reporter-interface).\n *\n * @example\n *\n * import * as t from 'io-ts';\n * import Reporter from 'io-ts-reporters';\n *\n * const User = t.interface({ name: t.string });\n *\n * assert.deepEqual(\n * Reporter.report(User.decode({ nam: 'Jane' })),\n * ['Expecting string at name but instead got: undefined'],\n * )\n * assert.deepEqual( Reporter.report(User.decode({ name: 'Jane' })), [])\n *\n * @since 1.2.0\n */\nvar A = require(\"fp-ts/lib/Array\");\nvar E = require(\"fp-ts/lib/Either\");\nvar NEA = require(\"fp-ts/lib/NonEmptyArray\");\nvar O = require(\"fp-ts/lib/Option\");\nvar R = require(\"fp-ts/lib/Record\");\nvar pipeable_1 = require(\"fp-ts/lib/pipeable\");\nvar t = require(\"io-ts\");\nvar utils_1 = require(\"./utils\");\nvar isUnionType = function (_a) {\n var type = _a.type;\n return type instanceof t.UnionType;\n};\nvar jsToString = function (value) {\n return value === undefined ? 'undefined' : JSON.stringify(value);\n};\nvar keyPath = function (ctx) {\n // The context entry with an empty key is the original\n // type (\"default context\"), not a type error.\n return ctx\n .map(function (c) { return c.key; })\n .filter(Boolean)\n .join('.');\n};\n// The actual error is last in context\nvar getErrorFromCtx = function (validation) {\n // https://github.com/gcanti/fp-ts/pull/544/files\n return A.last(validation.context);\n};\nvar getValidationContext = function (validation) {\n // https://github.com/gcanti/fp-ts/pull/544/files\n return validation.context;\n};\n/**\n * @category internals\n * @since 1.2.1\n */\nexports.TYPE_MAX_LEN = 160; // Two lines of 80-col text\nvar truncateType = function (type, options) {\n if (options === void 0) { options = {}; }\n var _a = options.truncateLongTypes, truncateLongTypes = _a === void 0 ? true : _a;\n if (truncateLongTypes && type.length > exports.TYPE_MAX_LEN) {\n return type.slice(0, exports.TYPE_MAX_LEN - 3) + \"...\";\n }\n return type;\n};\nvar errorMessageSimple = function (expectedType, path, error, options) {\n // https://github.com/elm-lang/core/blob/18c9e84e975ed22649888bfad15d1efdb0128ab2/src/Native/Json.js#L199\n return [\n \"Expecting \" + truncateType(expectedType, options),\n path === '' ? '' : \"at \" + path,\n \"but instead got: \" + jsToString(error.value),\n error.message ? \"(\" + error.message + \")\" : ''\n ]\n .filter(Boolean)\n .join(' ');\n};\nvar errorMessageUnion = function (expectedTypes, path, value, options) {\n // https://github.com/elm-lang/core/blob/18c9e84e975ed22649888bfad15d1efdb0128ab2/src/Native/Json.js#L199\n return [\n 'Expecting one of:\\n',\n expectedTypes.map(function (type) { return \" \" + truncateType(type, options); }).join('\\n'),\n path === '' ? '\\n' : \"\\nat \" + path + \" \",\n \"but instead got: \" + jsToString(value)\n ]\n .filter(Boolean)\n .join('');\n};\n// Find the union type in the list of ContextEntry\n// The next ContextEntry should be the type of this branch of the union\nvar findExpectedType = function (ctx) {\n return pipeable_1.pipe(ctx, A.findIndex(isUnionType), O.chain(function (n) { return A.lookup(n + 1, ctx); }));\n};\nvar formatValidationErrorOfUnion = function (path, errors, options) {\n var expectedTypes = pipeable_1.pipe(errors, A.map(getValidationContext), A.map(findExpectedType), A.compact);\n var value = pipeable_1.pipe(expectedTypes, A.head, O.map(function (v) { return v.actual; }), O.getOrElse(function () { return undefined; }));\n var expected = expectedTypes.map(function (_a) {\n var type = _a.type;\n return type.name;\n });\n return expected.length > 0\n ? O.some(errorMessageUnion(expected, path, value, options))\n : O.none;\n};\nvar formatValidationCommonError = function (path, error, options) {\n return pipeable_1.pipe(error, getErrorFromCtx, O.map(function (errorContext) {\n return errorMessageSimple(errorContext.type.name, path, error, options);\n }));\n};\nvar groupByKey = NEA.groupBy(function (error) {\n return pipeable_1.pipe(error.context, utils_1.takeUntil(isUnionType), keyPath);\n});\nvar format = function (path, errors, options) {\n return NEA.tail(errors).length > 0\n ? formatValidationErrorOfUnion(path, errors, options)\n : formatValidationCommonError(path, NEA.head(errors), options);\n};\n/**\n * Format a single validation error.\n *\n * @category formatters\n * @since 1.0.0\n */\nexports.formatValidationError = function (error, options) { return formatValidationCommonError(keyPath(error.context), error, options); };\n/**\n * Format validation errors (`t.Errors`).\n *\n * @example\n * import * as E from 'fp-ts/lib/Either'\n * import * as t from 'io-ts'\n * import { formatValidationErrors } from 'io-ts-reporters'\n *\n * const result = t.string.decode(123)\n *\n * assert.deepEqual(\n * E.mapLeft(formatValidationErrors)(result),\n * E.left(['Expecting string but instead got: 123'])\n * )\n *\n * @category formatters\n * @since 1.2.0\n */\nexports.formatValidationErrors = function (errors, options) {\n return pipeable_1.pipe(errors, groupByKey, R.mapWithIndex(function (path, errors) { return format(path, errors, options); }), R.compact, R.toArray, A.map(function (_a) {\n var _key = _a[0], error = _a[1];\n return error;\n }));\n};\n/**\n * Deprecated, use the default export instead.\n *\n * @category deprecated\n * @deprecated\n * @since 1.0.0\n */\nexports.reporter = function (validation, options) {\n return pipeable_1.pipe(validation, E.mapLeft(function (errors) { return exports.formatValidationErrors(errors, options); }), E.fold(function (errors) { return errors; }, function () { return []; }));\n};\nvar prettyReporter = { report: exports.reporter };\nexports.default = prettyReporter;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.takeUntil = void 0;\n/**\n * @since 1.1.0\n */\n/* eslint-disable @typescript-eslint/array-type */\nexports.takeUntil = function (predicate) { return function (as) {\n var init = [];\n // eslint-disable-next-line unicorn/no-for-loop\n for (var i = 0; i < as.length; i++) {\n init[i] = as[i];\n if (predicate(as[i])) {\n return init;\n }\n }\n return init;\n}; };\n/* eslint-enable @typescript-eslint/array-type */\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __spreadArrays = (this && this.__spreadArrays) || function () {\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};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.partial = exports.PartialType = exports.type = exports.InterfaceType = exports.array = exports.ArrayType = exports.recursion = exports.RecursiveType = exports.Int = exports.brand = exports.RefinementType = exports.keyof = exports.KeyofType = exports.literal = exports.LiteralType = exports.void = exports.undefined = exports.null = exports.UnknownRecord = exports.AnyDictionaryType = exports.UnknownArray = exports.AnyArrayType = exports.boolean = exports.BooleanType = exports.bigint = exports.BigIntType = exports.number = exports.NumberType = exports.string = exports.StringType = exports.unknown = exports.UnknownType = exports.voidType = exports.VoidType = exports.UndefinedType = exports.nullType = exports.NullType = exports.getIndex = exports.getTags = exports.emptyTags = exports.mergeAll = exports.getDomainKeys = exports.appendContext = exports.getContextEntry = exports.getFunctionName = exports.identity = exports.Type = exports.success = exports.failure = exports.failures = void 0;\nexports.alias = exports.clean = exports.StrictType = exports.dictionary = exports.Integer = exports.refinement = exports.object = exports.ObjectType = exports.Dictionary = exports.any = exports.AnyType = exports.never = exports.NeverType = exports.getDefaultContext = exports.getValidationError = exports.interface = exports.Array = exports.taggedUnion = exports.TaggedUnionType = exports.Function = exports.FunctionType = exports.exact = exports.ExactType = exports.strict = exports.readonlyArray = exports.ReadonlyArrayType = exports.readonly = exports.ReadonlyType = exports.tuple = exports.TupleType = exports.intersection = exports.IntersectionType = exports.union = exports.UnionType = exports.record = exports.DictionaryType = void 0;\n/**\n * @since 1.0.0\n */\nvar Either_1 = require(\"fp-ts/lib/Either\");\n/**\n * @category Decode error\n * @since 1.0.0\n */\nexports.failures = Either_1.left;\n/**\n * @category Decode error\n * @since 1.0.0\n */\nvar failure = function (value, context, message) {\n return exports.failures([{ value: value, context: context, message: message }]);\n};\nexports.failure = failure;\n/**\n * @category Decode error\n * @since 1.0.0\n */\nexports.success = Either_1.right;\n/**\n * @category Codec\n * @since 1.0.0\n */\nvar Type = /** @class */ (function () {\n function Type(\n /** a unique name for this codec */\n name, \n /** a custom type guard */\n is, \n /** succeeds if a value of type I can be decoded to a value of type A */\n validate, \n /** converts a value of type A to a value of type O */\n encode) {\n this.name = name;\n this.is = is;\n this.validate = validate;\n this.encode = encode;\n this.decode = this.decode.bind(this);\n }\n /**\n * @since 1.0.0\n */\n Type.prototype.pipe = function (ab, name) {\n var _this = this;\n if (name === void 0) { name = \"pipe(\" + this.name + \", \" + ab.name + \")\"; }\n return new Type(name, ab.is, function (i, c) {\n var e = _this.validate(i, c);\n if (Either_1.isLeft(e)) {\n return e;\n }\n return ab.validate(e.right, c);\n }, this.encode === exports.identity && ab.encode === exports.identity ? exports.identity : function (b) { return _this.encode(ab.encode(b)); });\n };\n /**\n * @since 1.0.0\n */\n Type.prototype.asDecoder = function () {\n return this;\n };\n /**\n * @since 1.0.0\n */\n Type.prototype.asEncoder = function () {\n return this;\n };\n /**\n * a version of `validate` with a default context\n * @since 1.0.0\n */\n Type.prototype.decode = function (i) {\n return this.validate(i, [{ key: '', type: this, actual: i }]);\n };\n return Type;\n}());\nexports.Type = Type;\n// -------------------------------------------------------------------------------------\n// utils\n// -------------------------------------------------------------------------------------\n/**\n * @since 1.0.0\n */\nvar identity = function (a) { return a; };\nexports.identity = identity;\n/**\n * @since 1.0.0\n */\nfunction getFunctionName(f) {\n return f.displayName || f.name || \"\";\n}\nexports.getFunctionName = getFunctionName;\n/**\n * @since 1.0.0\n */\nfunction getContextEntry(key, decoder) {\n return { key: key, type: decoder };\n}\nexports.getContextEntry = getContextEntry;\n/**\n * @since 1.0.0\n */\nfunction appendContext(c, key, decoder, actual) {\n var len = c.length;\n var r = Array(len + 1);\n for (var i = 0; i < len; i++) {\n r[i] = c[i];\n }\n r[len] = { key: key, type: decoder, actual: actual };\n return r;\n}\nexports.appendContext = appendContext;\nfunction pushAll(xs, ys) {\n var l = ys.length;\n for (var i = 0; i < l; i++) {\n xs.push(ys[i]);\n }\n}\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction getNameFromProps(props) {\n return Object.keys(props)\n .map(function (k) { return k + \": \" + props[k].name; })\n .join(', ');\n}\nfunction useIdentity(codecs) {\n for (var i = 0; i < codecs.length; i++) {\n if (codecs[i].encode !== exports.identity) {\n return false;\n }\n }\n return true;\n}\nfunction getInterfaceTypeName(props) {\n return \"{ \" + getNameFromProps(props) + \" }\";\n}\nfunction getPartialTypeName(inner) {\n return \"Partial<\" + inner + \">\";\n}\nfunction enumerableRecord(keys, domain, codomain, name) {\n if (name === void 0) { name = \"{ [K in \" + domain.name + \"]: \" + codomain.name + \" }\"; }\n var len = keys.length;\n return new DictionaryType(name, function (u) { return exports.UnknownRecord.is(u) && keys.every(function (k) { return codomain.is(u[k]); }); }, function (u, c) {\n var e = exports.UnknownRecord.validate(u, c);\n if (Either_1.isLeft(e)) {\n return e;\n }\n var o = e.right;\n var a = {};\n var errors = [];\n var changed = false;\n for (var i = 0; i < len; i++) {\n var k = keys[i];\n var ok = o[k];\n var codomainResult = codomain.validate(ok, appendContext(c, k, codomain, ok));\n if (Either_1.isLeft(codomainResult)) {\n pushAll(errors, codomainResult.left);\n }\n else {\n var vok = codomainResult.right;\n changed = changed || vok !== ok;\n a[k] = vok;\n }\n }\n return errors.length > 0 ? exports.failures(errors) : exports.success((changed || Object.keys(o).length !== len ? a : o));\n }, codomain.encode === exports.identity\n ? exports.identity\n : function (a) {\n var s = {};\n for (var i = 0; i < len; i++) {\n var k = keys[i];\n s[k] = codomain.encode(a[k]);\n }\n return s;\n }, domain, codomain);\n}\n/**\n * @internal\n */\nfunction getDomainKeys(domain) {\n var _a;\n if (isLiteralC(domain)) {\n var literal_1 = domain.value;\n if (exports.string.is(literal_1)) {\n return _a = {}, _a[literal_1] = null, _a;\n }\n }\n else if (isKeyofC(domain)) {\n return domain.keys;\n }\n else if (isUnionC(domain)) {\n var keys = domain.types.map(function (type) { return getDomainKeys(type); });\n return keys.some(undefinedType.is) ? undefined : Object.assign.apply(Object, __spreadArrays([{}], keys));\n }\n return undefined;\n}\nexports.getDomainKeys = getDomainKeys;\nfunction nonEnumerableRecord(domain, codomain, name) {\n if (name === void 0) { name = \"{ [K in \" + domain.name + \"]: \" + codomain.name + \" }\"; }\n return new DictionaryType(name, function (u) {\n if (exports.UnknownRecord.is(u)) {\n return Object.keys(u).every(function (k) { return domain.is(k) && codomain.is(u[k]); });\n }\n return isAnyC(codomain) && Array.isArray(u);\n }, function (u, c) {\n if (exports.UnknownRecord.is(u)) {\n var a = {};\n var errors = [];\n var keys = Object.keys(u);\n var len = keys.length;\n var changed = false;\n for (var i = 0; i < len; i++) {\n var k = keys[i];\n var ok = u[k];\n var domainResult = domain.validate(k, appendContext(c, k, domain, k));\n if (Either_1.isLeft(domainResult)) {\n pushAll(errors, domainResult.left);\n }\n else {\n var vk = domainResult.right;\n changed = changed || vk !== k;\n k = vk;\n var codomainResult = codomain.validate(ok, appendContext(c, k, codomain, ok));\n if (Either_1.isLeft(codomainResult)) {\n pushAll(errors, codomainResult.left);\n }\n else {\n var vok = codomainResult.right;\n changed = changed || vok !== ok;\n a[k] = vok;\n }\n }\n }\n return errors.length > 0 ? exports.failures(errors) : exports.success((changed ? a : u));\n }\n if (isAnyC(codomain) && Array.isArray(u)) {\n return exports.success(u);\n }\n return exports.failure(u, c);\n }, domain.encode === exports.identity && codomain.encode === exports.identity\n ? exports.identity\n : function (a) {\n var s = {};\n var keys = Object.keys(a);\n var len = keys.length;\n for (var i = 0; i < len; i++) {\n var k = keys[i];\n s[String(domain.encode(k))] = codomain.encode(a[k]);\n }\n return s;\n }, domain, codomain);\n}\nfunction getUnionName(codecs) {\n return '(' + codecs.map(function (type) { return type.name; }).join(' | ') + ')';\n}\n/**\n * @internal\n */\nfunction mergeAll(base, us) {\n var equal = true;\n var primitive = true;\n var baseIsNotADictionary = !exports.UnknownRecord.is(base);\n for (var _i = 0, us_1 = us; _i < us_1.length; _i++) {\n var u = us_1[_i];\n if (u !== base) {\n equal = false;\n }\n if (exports.UnknownRecord.is(u)) {\n primitive = false;\n }\n }\n if (equal) {\n return base;\n }\n else if (primitive) {\n return us[us.length - 1];\n }\n var r = {};\n for (var _a = 0, us_2 = us; _a < us_2.length; _a++) {\n var u = us_2[_a];\n for (var k in u) {\n if (!r.hasOwnProperty(k) || baseIsNotADictionary || u[k] !== base[k]) {\n r[k] = u[k];\n }\n }\n }\n return r;\n}\nexports.mergeAll = mergeAll;\nfunction getProps(codec) {\n switch (codec._tag) {\n case 'RefinementType':\n case 'ReadonlyType':\n return getProps(codec.type);\n case 'InterfaceType':\n case 'StrictType':\n case 'PartialType':\n return codec.props;\n case 'IntersectionType':\n return codec.types.reduce(function (props, type) { return Object.assign(props, getProps(type)); }, {});\n }\n}\nfunction stripKeys(o, props) {\n var keys = Object.getOwnPropertyNames(o);\n var shouldStrip = false;\n var r = {};\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (!hasOwnProperty.call(props, key)) {\n shouldStrip = true;\n }\n else {\n r[key] = o[key];\n }\n }\n return shouldStrip ? r : o;\n}\nfunction getExactTypeName(codec) {\n if (isTypeC(codec)) {\n return \"{| \" + getNameFromProps(codec.props) + \" |}\";\n }\n else if (isPartialC(codec)) {\n return getPartialTypeName(\"{| \" + getNameFromProps(codec.props) + \" |}\");\n }\n return \"Exact<\" + codec.name + \">\";\n}\nfunction isNonEmpty(as) {\n return as.length > 0;\n}\n/**\n * @internal\n */\nexports.emptyTags = {};\nfunction intersect(a, b) {\n var r = [];\n for (var _i = 0, a_1 = a; _i < a_1.length; _i++) {\n var v = a_1[_i];\n if (b.indexOf(v) !== -1) {\n r.push(v);\n }\n }\n return r;\n}\nfunction mergeTags(a, b) {\n if (a === exports.emptyTags) {\n return b;\n }\n if (b === exports.emptyTags) {\n return a;\n }\n var r = Object.assign({}, a);\n for (var k in b) {\n if (a.hasOwnProperty(k)) {\n var intersection_1 = intersect(a[k], b[k]);\n if (isNonEmpty(intersection_1)) {\n r[k] = intersection_1;\n }\n else {\n r = exports.emptyTags;\n break;\n }\n }\n else {\n r[k] = b[k];\n }\n }\n return r;\n}\nfunction intersectTags(a, b) {\n if (a === exports.emptyTags || b === exports.emptyTags) {\n return exports.emptyTags;\n }\n var r = exports.emptyTags;\n for (var k in a) {\n if (b.hasOwnProperty(k)) {\n var intersection_2 = intersect(a[k], b[k]);\n if (intersection_2.length === 0) {\n if (r === exports.emptyTags) {\n r = {};\n }\n r[k] = a[k].concat(b[k]);\n }\n }\n }\n return r;\n}\n// tslint:disable-next-line: deprecation\nfunction isAnyC(codec) {\n return codec._tag === 'AnyType';\n}\nfunction isLiteralC(codec) {\n return codec._tag === 'LiteralType';\n}\nfunction isKeyofC(codec) {\n return codec._tag === 'KeyofType';\n}\nfunction isTypeC(codec) {\n return codec._tag === 'InterfaceType';\n}\nfunction isPartialC(codec) {\n return codec._tag === 'PartialType';\n}\n// tslint:disable-next-line: deprecation\nfunction isStrictC(codec) {\n return codec._tag === 'StrictType';\n}\nfunction isExactC(codec) {\n return codec._tag === 'ExactType';\n}\n// tslint:disable-next-line: deprecation\nfunction isRefinementC(codec) {\n return codec._tag === 'RefinementType';\n}\nfunction isIntersectionC(codec) {\n return codec._tag === 'IntersectionType';\n}\nfunction isUnionC(codec) {\n return codec._tag === 'UnionType';\n}\nfunction isRecursiveC(codec) {\n return codec._tag === 'RecursiveType';\n}\nvar lazyCodecs = [];\n/**\n * @internal\n */\nfunction getTags(codec) {\n if (lazyCodecs.indexOf(codec) !== -1) {\n return exports.emptyTags;\n }\n if (isTypeC(codec) || isStrictC(codec)) {\n var index = exports.emptyTags;\n // tslint:disable-next-line: forin\n for (var k in codec.props) {\n var prop = codec.props[k];\n if (isLiteralC(prop)) {\n if (index === exports.emptyTags) {\n index = {};\n }\n index[k] = [prop.value];\n }\n }\n return index;\n }\n else if (isExactC(codec) || isRefinementC(codec)) {\n return getTags(codec.type);\n }\n else if (isIntersectionC(codec)) {\n return codec.types.reduce(function (tags, codec) { return mergeTags(tags, getTags(codec)); }, exports.emptyTags);\n }\n else if (isUnionC(codec)) {\n return codec.types.slice(1).reduce(function (tags, codec) { return intersectTags(tags, getTags(codec)); }, getTags(codec.types[0]));\n }\n else if (isRecursiveC(codec)) {\n lazyCodecs.push(codec);\n var tags = getTags(codec.type);\n lazyCodecs.pop();\n return tags;\n }\n return exports.emptyTags;\n}\nexports.getTags = getTags;\n/**\n * @internal\n */\nfunction getIndex(codecs) {\n var tags = getTags(codecs[0]);\n var keys = Object.keys(tags);\n var len = codecs.length;\n var _loop_1 = function (k) {\n var all = tags[k].slice();\n var index = [tags[k]];\n for (var i = 1; i < len; i++) {\n var codec = codecs[i];\n var ctags = getTags(codec);\n var values = ctags[k];\n // tslint:disable-next-line: strict-type-predicates\n if (values === undefined) {\n return \"continue-keys\";\n }\n else {\n if (values.some(function (v) { return all.indexOf(v) !== -1; })) {\n return \"continue-keys\";\n }\n else {\n all.push.apply(all, values);\n index.push(values);\n }\n }\n }\n return { value: [k, index] };\n };\n keys: for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {\n var k = keys_1[_i];\n var state_1 = _loop_1(k);\n if (typeof state_1 === \"object\")\n return state_1.value;\n switch (state_1) {\n case \"continue-keys\": continue keys;\n }\n }\n return undefined;\n}\nexports.getIndex = getIndex;\n// -------------------------------------------------------------------------------------\n// primitives\n// -------------------------------------------------------------------------------------\n/**\n * @since 1.0.0\n */\nvar NullType = /** @class */ (function (_super) {\n __extends(NullType, _super);\n function NullType() {\n var _this = _super.call(this, 'null', function (u) { return u === null; }, function (u, c) { return (_this.is(u) ? exports.success(u) : exports.failure(u, c)); }, exports.identity) || this;\n /**\n * @since 1.0.0\n */\n _this._tag = 'NullType';\n return _this;\n }\n return NullType;\n}(Type));\nexports.NullType = NullType;\n/**\n * @category primitives\n * @since 1.0.0\n */\nexports.nullType = new NullType();\nexports.null = exports.nullType;\n/**\n * @since 1.0.0\n */\nvar UndefinedType = /** @class */ (function (_super) {\n __extends(UndefinedType, _super);\n function UndefinedType() {\n var _this = _super.call(this, 'undefined', function (u) { return u === void 0; }, function (u, c) { return (_this.is(u) ? exports.success(u) : exports.failure(u, c)); }, exports.identity) || this;\n /**\n * @since 1.0.0\n */\n _this._tag = 'UndefinedType';\n return _this;\n }\n return UndefinedType;\n}(Type));\nexports.UndefinedType = UndefinedType;\nvar undefinedType = new UndefinedType();\nexports.undefined = undefinedType;\n/**\n * @since 1.2.0\n */\nvar VoidType = /** @class */ (function (_super) {\n __extends(VoidType, _super);\n function VoidType() {\n var _this = _super.call(this, 'void', undefinedType.is, undefinedType.validate, exports.identity) || this;\n /**\n * @since 1.0.0\n */\n _this._tag = 'VoidType';\n return _this;\n }\n return VoidType;\n}(Type));\nexports.VoidType = VoidType;\n/**\n * @category primitives\n * @since 1.2.0\n */\nexports.voidType = new VoidType();\nexports.void = exports.voidType;\n/**\n * @since 1.5.0\n */\nvar UnknownType = /** @class */ (function (_super) {\n __extends(UnknownType, _super);\n function UnknownType() {\n var _this = _super.call(this, 'unknown', function (_) { return true; }, exports.success, exports.identity) || this;\n /**\n * @since 1.0.0\n */\n _this._tag = 'UnknownType';\n return _this;\n }\n return UnknownType;\n}(Type));\nexports.UnknownType = UnknownType;\n/**\n * @category primitives\n * @since 1.5.0\n */\nexports.unknown = new UnknownType();\n/**\n * @since 1.0.0\n */\nvar StringType = /** @class */ (function (_super) {\n __extends(StringType, _super);\n function StringType() {\n var _this = _super.call(this, 'string', function (u) { return typeof u === 'string'; }, function (u, c) { return (_this.is(u) ? exports.success(u) : exports.failure(u, c)); }, exports.identity) || this;\n /**\n * @since 1.0.0\n */\n _this._tag = 'StringType';\n return _this;\n }\n return StringType;\n}(Type));\nexports.StringType = StringType;\n/**\n * @category primitives\n * @since 1.0.0\n */\nexports.string = new StringType();\n/**\n * @since 1.0.0\n */\nvar NumberType = /** @class */ (function (_super) {\n __extends(NumberType, _super);\n function NumberType() {\n var _this = _super.call(this, 'number', function (u) { return typeof u === 'number'; }, function (u, c) { return (_this.is(u) ? exports.success(u) : exports.failure(u, c)); }, exports.identity) || this;\n /**\n * @since 1.0.0\n */\n _this._tag = 'NumberType';\n return _this;\n }\n return NumberType;\n}(Type));\nexports.NumberType = NumberType;\n/**\n * @category primitives\n * @since 1.0.0\n */\nexports.number = new NumberType();\n/**\n * @since 2.1.0\n */\nvar BigIntType = /** @class */ (function (_super) {\n __extends(BigIntType, _super);\n function BigIntType() {\n var _this = _super.call(this, 'bigint', \n // tslint:disable-next-line: valid-typeof\n function (u) { return typeof u === 'bigint'; }, function (u, c) { return (_this.is(u) ? exports.success(u) : exports.failure(u, c)); }, exports.identity) || this;\n /**\n * @since 1.0.0\n */\n _this._tag = 'BigIntType';\n return _this;\n }\n return BigIntType;\n}(Type));\nexports.BigIntType = BigIntType;\n/**\n * @category primitives\n * @since 2.1.0\n */\nexports.bigint = new BigIntType();\n/**\n * @since 1.0.0\n */\nvar BooleanType = /** @class */ (function (_super) {\n __extends(BooleanType, _super);\n function BooleanType() {\n var _this = _super.call(this, 'boolean', function (u) { return typeof u === 'boolean'; }, function (u, c) { return (_this.is(u) ? exports.success(u) : exports.failure(u, c)); }, exports.identity) || this;\n /**\n * @since 1.0.0\n */\n _this._tag = 'BooleanType';\n return _this;\n }\n return BooleanType;\n}(Type));\nexports.BooleanType = BooleanType;\n/**\n * @category primitives\n * @since 1.0.0\n */\nexports.boolean = new BooleanType();\n/**\n * @since 1.0.0\n */\nvar AnyArrayType = /** @class */ (function (_super) {\n __extends(AnyArrayType, _super);\n function AnyArrayType() {\n var _this = _super.call(this, 'UnknownArray', Array.isArray, function (u, c) { return (_this.is(u) ? exports.success(u) : exports.failure(u, c)); }, exports.identity) || this;\n /**\n * @since 1.0.0\n */\n _this._tag = 'AnyArrayType';\n return _this;\n }\n return AnyArrayType;\n}(Type));\nexports.AnyArrayType = AnyArrayType;\n/**\n * @category primitives\n * @since 1.7.1\n */\nexports.UnknownArray = new AnyArrayType();\nexports.Array = exports.UnknownArray;\n/**\n * @since 1.0.0\n */\nvar AnyDictionaryType = /** @class */ (function (_super) {\n __extends(AnyDictionaryType, _super);\n function AnyDictionaryType() {\n var _this = _super.call(this, 'UnknownRecord', function (u) {\n var s = Object.prototype.toString.call(u);\n return s === '[object Object]' || s === '[object Window]';\n }, function (u, c) { return (_this.is(u) ? exports.success(u) : exports.failure(u, c)); }, exports.identity) || this;\n /**\n * @since 1.0.0\n */\n _this._tag = 'AnyDictionaryType';\n return _this;\n }\n return AnyDictionaryType;\n}(Type));\nexports.AnyDictionaryType = AnyDictionaryType;\n/**\n * @category primitives\n * @since 1.7.1\n */\nexports.UnknownRecord = new AnyDictionaryType();\n/**\n * @since 1.0.0\n */\nvar LiteralType = /** @class */ (function (_super) {\n __extends(LiteralType, _super);\n function LiteralType(name, is, validate, encode, value) {\n var _this = _super.call(this, name, is, validate, encode) || this;\n _this.value = value;\n /**\n * @since 1.0.0\n */\n _this._tag = 'LiteralType';\n return _this;\n }\n return LiteralType;\n}(Type));\nexports.LiteralType = LiteralType;\n/**\n * @category constructors\n * @since 1.0.0\n */\nfunction literal(value, name) {\n if (name === void 0) { name = JSON.stringify(value); }\n var is = function (u) { return u === value; };\n return new LiteralType(name, is, function (u, c) { return (is(u) ? exports.success(value) : exports.failure(u, c)); }, exports.identity, value);\n}\nexports.literal = literal;\n/**\n * @since 1.0.0\n */\nvar KeyofType = /** @class */ (function (_super) {\n __extends(KeyofType, _super);\n function KeyofType(name, is, validate, encode, keys) {\n var _this = _super.call(this, name, is, validate, encode) || this;\n _this.keys = keys;\n /**\n * @since 1.0.0\n */\n _this._tag = 'KeyofType';\n return _this;\n }\n return KeyofType;\n}(Type));\nexports.KeyofType = KeyofType;\n/**\n * @category constructors\n * @since 1.0.0\n */\nfunction keyof(keys, name) {\n if (name === void 0) { name = Object.keys(keys)\n .map(function (k) { return JSON.stringify(k); })\n .join(' | '); }\n var is = function (u) { return exports.string.is(u) && hasOwnProperty.call(keys, u); };\n return new KeyofType(name, is, function (u, c) { return (is(u) ? exports.success(u) : exports.failure(u, c)); }, exports.identity, keys);\n}\nexports.keyof = keyof;\n// -------------------------------------------------------------------------------------\n// combinators\n// -------------------------------------------------------------------------------------\n/**\n * @since 1.0.0\n */\nvar RefinementType = /** @class */ (function (_super) {\n __extends(RefinementType, _super);\n function RefinementType(name, is, validate, encode, type, predicate) {\n var _this = _super.call(this, name, is, validate, encode) || this;\n _this.type = type;\n _this.predicate = predicate;\n /**\n * @since 1.0.0\n */\n _this._tag = 'RefinementType';\n return _this;\n }\n return RefinementType;\n}(Type));\nexports.RefinementType = RefinementType;\n/**\n * @category combinators\n * @since 1.8.1\n */\nfunction brand(codec, predicate, name) {\n // tslint:disable-next-line: deprecation\n return refinement(codec, predicate, name);\n}\nexports.brand = brand;\n/**\n * A branded codec representing an integer\n *\n * @category primitives\n * @since 1.8.1\n */\nexports.Int = brand(exports.number, function (n) { return Number.isInteger(n); }, 'Int');\n/**\n * @since 1.0.0\n */\nvar RecursiveType = /** @class */ (function (_super) {\n __extends(RecursiveType, _super);\n function RecursiveType(name, is, validate, encode, runDefinition) {\n var _this = _super.call(this, name, is, validate, encode) || this;\n _this.runDefinition = runDefinition;\n /**\n * @since 1.0.0\n */\n _this._tag = 'RecursiveType';\n return _this;\n }\n return RecursiveType;\n}(Type));\nexports.RecursiveType = RecursiveType;\nObject.defineProperty(RecursiveType.prototype, 'type', {\n get: function () {\n return this.runDefinition();\n },\n enumerable: true,\n configurable: true\n});\n/**\n * @category combinators\n * @since 1.0.0\n */\nfunction recursion(name, definition) {\n var cache;\n var runDefinition = function () {\n if (!cache) {\n cache = definition(Self);\n cache.name = name;\n }\n return cache;\n };\n var Self = new RecursiveType(name, function (u) { return runDefinition().is(u); }, function (u, c) { return runDefinition().validate(u, c); }, function (a) { return runDefinition().encode(a); }, runDefinition);\n return Self;\n}\nexports.recursion = recursion;\n/**\n * @since 1.0.0\n */\nvar ArrayType = /** @class */ (function (_super) {\n __extends(ArrayType, _super);\n function ArrayType(name, is, validate, encode, type) {\n var _this = _super.call(this, name, is, validate, encode) || this;\n _this.type = type;\n /**\n * @since 1.0.0\n */\n _this._tag = 'ArrayType';\n return _this;\n }\n return ArrayType;\n}(Type));\nexports.ArrayType = ArrayType;\n/**\n * @category combinators\n * @since 1.0.0\n */\nfunction array(item, name) {\n if (name === void 0) { name = \"Array<\" + item.name + \">\"; }\n return new ArrayType(name, function (u) { return exports.UnknownArray.is(u) && u.every(item.is); }, function (u, c) {\n var e = exports.UnknownArray.validate(u, c);\n if (Either_1.isLeft(e)) {\n return e;\n }\n var us = e.right;\n var len = us.length;\n var as = us;\n var errors = [];\n for (var i = 0; i < len; i++) {\n var ui = us[i];\n var result = item.validate(ui, appendContext(c, String(i), item, ui));\n if (Either_1.isLeft(result)) {\n pushAll(errors, result.left);\n }\n else {\n var ai = result.right;\n if (ai !== ui) {\n if (as === us) {\n as = us.slice();\n }\n as[i] = ai;\n }\n }\n }\n return errors.length > 0 ? exports.failures(errors) : exports.success(as);\n }, item.encode === exports.identity ? exports.identity : function (a) { return a.map(item.encode); }, item);\n}\nexports.array = array;\n/**\n * @since 1.0.0\n */\nvar InterfaceType = /** @class */ (function (_super) {\n __extends(InterfaceType, _super);\n function InterfaceType(name, is, validate, encode, props) {\n var _this = _super.call(this, name, is, validate, encode) || this;\n _this.props = props;\n /**\n * @since 1.0.0\n */\n _this._tag = 'InterfaceType';\n return _this;\n }\n return InterfaceType;\n}(Type));\nexports.InterfaceType = InterfaceType;\n/**\n * @category combinators\n * @since 1.0.0\n */\nfunction type(props, name) {\n if (name === void 0) { name = getInterfaceTypeName(props); }\n var keys = Object.keys(props);\n var types = keys.map(function (key) { return props[key]; });\n var len = keys.length;\n return new InterfaceType(name, function (u) {\n if (exports.UnknownRecord.is(u)) {\n for (var i = 0; i < len; i++) {\n var k = keys[i];\n var uk = u[k];\n if ((uk === undefined && !hasOwnProperty.call(u, k)) || !types[i].is(uk)) {\n return false;\n }\n }\n return true;\n }\n return false;\n }, function (u, c) {\n var e = exports.UnknownRecord.validate(u, c);\n if (Either_1.isLeft(e)) {\n return e;\n }\n var o = e.right;\n var a = o;\n var errors = [];\n for (var i = 0; i < len; i++) {\n var k = keys[i];\n var ak = a[k];\n var type_1 = types[i];\n var result = type_1.validate(ak, appendContext(c, k, type_1, ak));\n if (Either_1.isLeft(result)) {\n pushAll(errors, result.left);\n }\n else {\n var vak = result.right;\n if (vak !== ak || (vak === undefined && !hasOwnProperty.call(a, k))) {\n /* istanbul ignore next */\n if (a === o) {\n a = __assign({}, o);\n }\n a[k] = vak;\n }\n }\n }\n return errors.length > 0 ? exports.failures(errors) : exports.success(a);\n }, useIdentity(types)\n ? exports.identity\n : function (a) {\n var s = __assign({}, a);\n for (var i = 0; i < len; i++) {\n var k = keys[i];\n var encode = types[i].encode;\n if (encode !== exports.identity) {\n s[k] = encode(a[k]);\n }\n }\n return s;\n }, props);\n}\nexports.type = type;\nexports.interface = type;\n/**\n * @since 1.0.0\n */\nvar PartialType = /** @class */ (function (_super) {\n __extends(PartialType, _super);\n function PartialType(name, is, validate, encode, props) {\n var _this = _super.call(this, name, is, validate, encode) || this;\n _this.props = props;\n /**\n * @since 1.0.0\n */\n _this._tag = 'PartialType';\n return _this;\n }\n return PartialType;\n}(Type));\nexports.PartialType = PartialType;\n/**\n * @category combinators\n * @since 1.0.0\n */\nfunction partial(props, name) {\n if (name === void 0) { name = getPartialTypeName(getInterfaceTypeName(props)); }\n var keys = Object.keys(props);\n var types = keys.map(function (key) { return props[key]; });\n var len = keys.length;\n return new PartialType(name, function (u) {\n if (exports.UnknownRecord.is(u)) {\n for (var i = 0; i < len; i++) {\n var k = keys[i];\n var uk = u[k];\n if (uk !== undefined && !props[k].is(uk)) {\n return false;\n }\n }\n return true;\n }\n return false;\n }, function (u, c) {\n var e = exports.UnknownRecord.validate(u, c);\n if (Either_1.isLeft(e)) {\n return e;\n }\n var o = e.right;\n var a = o;\n var errors = [];\n for (var i = 0; i < len; i++) {\n var k = keys[i];\n var ak = a[k];\n var type_2 = props[k];\n var result = type_2.validate(ak, appendContext(c, k, type_2, ak));\n if (Either_1.isLeft(result)) {\n if (ak !== undefined) {\n pushAll(errors, result.left);\n }\n }\n else {\n var vak = result.right;\n if (vak !== ak) {\n /* istanbul ignore next */\n if (a === o) {\n a = __assign({}, o);\n }\n a[k] = vak;\n }\n }\n }\n return errors.length > 0 ? exports.failures(errors) : exports.success(a);\n }, useIdentity(types)\n ? exports.identity\n : function (a) {\n var s = __assign({}, a);\n for (var i = 0; i < len; i++) {\n var k = keys[i];\n var ak = a[k];\n if (ak !== undefined) {\n s[k] = types[i].encode(ak);\n }\n }\n return s;\n }, props);\n}\nexports.partial = partial;\n/**\n * @since 1.0.0\n */\nvar DictionaryType = /** @class */ (function (_super) {\n __extends(DictionaryType, _super);\n function DictionaryType(name, is, validate, encode, domain, codomain) {\n var _this = _super.call(this, name, is, validate, encode) || this;\n _this.domain = domain;\n _this.codomain = codomain;\n /**\n * @since 1.0.0\n */\n _this._tag = 'DictionaryType';\n return _this;\n }\n return DictionaryType;\n}(Type));\nexports.DictionaryType = DictionaryType;\n/**\n * @category combinators\n * @since 1.7.1\n */\nfunction record(domain, codomain, name) {\n var keys = getDomainKeys(domain);\n return keys\n ? enumerableRecord(Object.keys(keys), domain, codomain, name)\n : nonEnumerableRecord(domain, codomain, name);\n}\nexports.record = record;\n/**\n * @since 1.0.0\n */\nvar UnionType = /** @class */ (function (_super) {\n __extends(UnionType, _super);\n function UnionType(name, is, validate, encode, types) {\n var _this = _super.call(this, name, is, validate, encode) || this;\n _this.types = types;\n /**\n * @since 1.0.0\n */\n _this._tag = 'UnionType';\n return _this;\n }\n return UnionType;\n}(Type));\nexports.UnionType = UnionType;\n/**\n * @category combinators\n * @since 1.0.0\n */\nfunction union(codecs, name) {\n if (name === void 0) { name = getUnionName(codecs); }\n var index = getIndex(codecs);\n if (index !== undefined && codecs.length > 0) {\n var tag_1 = index[0], groups_1 = index[1];\n var len_1 = groups_1.length;\n var find_1 = function (value) {\n for (var i = 0; i < len_1; i++) {\n if (groups_1[i].indexOf(value) !== -1) {\n return i;\n }\n }\n return undefined;\n };\n // tslint:disable-next-line: deprecation\n return new TaggedUnionType(name, function (u) {\n if (exports.UnknownRecord.is(u)) {\n var i = find_1(u[tag_1]);\n return i !== undefined ? codecs[i].is(u) : false;\n }\n return false;\n }, function (u, c) {\n var e = exports.UnknownRecord.validate(u, c);\n if (Either_1.isLeft(e)) {\n return e;\n }\n var r = e.right;\n var i = find_1(r[tag_1]);\n if (i === undefined) {\n return exports.failure(u, c);\n }\n var codec = codecs[i];\n return codec.validate(r, appendContext(c, String(i), codec, r));\n }, useIdentity(codecs)\n ? exports.identity\n : function (a) {\n var i = find_1(a[tag_1]);\n if (i === undefined) {\n // https://github.com/gcanti/io-ts/pull/305\n throw new Error(\"no codec found to encode value in union codec \" + name);\n }\n else {\n return codecs[i].encode(a);\n }\n }, codecs, tag_1);\n }\n else {\n return new UnionType(name, function (u) { return codecs.some(function (type) { return type.is(u); }); }, function (u, c) {\n var errors = [];\n for (var i = 0; i < codecs.length; i++) {\n var codec = codecs[i];\n var result = codec.validate(u, appendContext(c, String(i), codec, u));\n if (Either_1.isLeft(result)) {\n pushAll(errors, result.left);\n }\n else {\n return exports.success(result.right);\n }\n }\n return exports.failures(errors);\n }, useIdentity(codecs)\n ? exports.identity\n : function (a) {\n for (var _i = 0, codecs_1 = codecs; _i < codecs_1.length; _i++) {\n var codec = codecs_1[_i];\n if (codec.is(a)) {\n return codec.encode(a);\n }\n }\n // https://github.com/gcanti/io-ts/pull/305\n throw new Error(\"no codec found to encode value in union type \" + name);\n }, codecs);\n }\n}\nexports.union = union;\n/**\n * @since 1.0.0\n */\nvar IntersectionType = /** @class */ (function (_super) {\n __extends(IntersectionType, _super);\n function IntersectionType(name, is, validate, encode, types) {\n var _this = _super.call(this, name, is, validate, encode) || this;\n _this.types = types;\n /**\n * @since 1.0.0\n */\n _this._tag = 'IntersectionType';\n return _this;\n }\n return IntersectionType;\n}(Type));\nexports.IntersectionType = IntersectionType;\nfunction intersection(codecs, name) {\n if (name === void 0) { name = \"(\" + codecs.map(function (type) { return type.name; }).join(' & ') + \")\"; }\n var len = codecs.length;\n return new IntersectionType(name, function (u) { return codecs.every(function (type) { return type.is(u); }); }, codecs.length === 0\n ? exports.success\n : function (u, c) {\n var us = [];\n var errors = [];\n for (var i = 0; i < len; i++) {\n var codec = codecs[i];\n var result = codec.validate(u, appendContext(c, String(i), codec, u));\n if (Either_1.isLeft(result)) {\n pushAll(errors, result.left);\n }\n else {\n us.push(result.right);\n }\n }\n return errors.length > 0 ? exports.failures(errors) : exports.success(mergeAll(u, us));\n }, codecs.length === 0\n ? exports.identity\n : function (a) {\n return mergeAll(a, codecs.map(function (codec) { return codec.encode(a); }));\n }, codecs);\n}\nexports.intersection = intersection;\n/**\n * @since 1.0.0\n */\nvar TupleType = /** @class */ (function (_super) {\n __extends(TupleType, _super);\n function TupleType(name, is, validate, encode, types) {\n var _this = _super.call(this, name, is, validate, encode) || this;\n _this.types = types;\n /**\n * @since 1.0.0\n */\n _this._tag = 'TupleType';\n return _this;\n }\n return TupleType;\n}(Type));\nexports.TupleType = TupleType;\nfunction tuple(codecs, name) {\n if (name === void 0) { name = \"[\" + codecs.map(function (type) { return type.name; }).join(', ') + \"]\"; }\n var len = codecs.length;\n return new TupleType(name, function (u) { return exports.UnknownArray.is(u) && u.length === len && codecs.every(function (type, i) { return type.is(u[i]); }); }, function (u, c) {\n var e = exports.UnknownArray.validate(u, c);\n if (Either_1.isLeft(e)) {\n return e;\n }\n var us = e.right;\n var as = us.length > len ? us.slice(0, len) : us; // strip additional components\n var errors = [];\n for (var i = 0; i < len; i++) {\n var a = us[i];\n var type_3 = codecs[i];\n var result = type_3.validate(a, appendContext(c, String(i), type_3, a));\n if (Either_1.isLeft(result)) {\n pushAll(errors, result.left);\n }\n else {\n var va = result.right;\n if (va !== a) {\n /* istanbul ignore next */\n if (as === us) {\n as = us.slice();\n }\n as[i] = va;\n }\n }\n }\n return errors.length > 0 ? exports.failures(errors) : exports.success(as);\n }, useIdentity(codecs) ? exports.identity : function (a) { return codecs.map(function (type, i) { return type.encode(a[i]); }); }, codecs);\n}\nexports.tuple = tuple;\n/**\n * @since 1.0.0\n */\nvar ReadonlyType = /** @class */ (function (_super) {\n __extends(ReadonlyType, _super);\n function ReadonlyType(name, is, validate, encode, type) {\n var _this = _super.call(this, name, is, validate, encode) || this;\n _this.type = type;\n /**\n * @since 1.0.0\n */\n _this._tag = 'ReadonlyType';\n return _this;\n }\n return ReadonlyType;\n}(Type));\nexports.ReadonlyType = ReadonlyType;\n/**\n * @category combinators\n * @since 1.0.0\n */\nfunction readonly(codec, name) {\n if (name === void 0) { name = \"Readonly<\" + codec.name + \">\"; }\n return new ReadonlyType(name, codec.is, codec.validate, codec.encode, codec);\n}\nexports.readonly = readonly;\n/**\n * @since 1.0.0\n */\nvar ReadonlyArrayType = /** @class */ (function (_super) {\n __extends(ReadonlyArrayType, _super);\n function ReadonlyArrayType(name, is, validate, encode, type) {\n var _this = _super.call(this, name, is, validate, encode) || this;\n _this.type = type;\n /**\n * @since 1.0.0\n */\n _this._tag = 'ReadonlyArrayType';\n return _this;\n }\n return ReadonlyArrayType;\n}(Type));\nexports.ReadonlyArrayType = ReadonlyArrayType;\n/**\n * @category combinators\n * @since 1.0.0\n */\nfunction readonlyArray(item, name) {\n if (name === void 0) { name = \"ReadonlyArray<\" + item.name + \">\"; }\n var codec = array(item);\n return new ReadonlyArrayType(name, codec.is, codec.validate, codec.encode, item);\n}\nexports.readonlyArray = readonlyArray;\n/**\n * Strips additional properties, equivalent to `exact(type(props))`.\n *\n * @category combinators\n * @since 1.0.0\n */\nvar strict = function (props, name) { return exact(type(props), name); };\nexports.strict = strict;\n/**\n * @since 1.1.0\n */\nvar ExactType = /** @class */ (function (_super) {\n __extends(ExactType, _super);\n function ExactType(name, is, validate, encode, type) {\n var _this = _super.call(this, name, is, validate, encode) || this;\n _this.type = type;\n /**\n * @since 1.0.0\n */\n _this._tag = 'ExactType';\n return _this;\n }\n return ExactType;\n}(Type));\nexports.ExactType = ExactType;\n/**\n * Strips additional properties.\n *\n * @category combinators\n * @since 1.1.0\n */\nfunction exact(codec, name) {\n if (name === void 0) { name = getExactTypeName(codec); }\n var props = getProps(codec);\n return new ExactType(name, codec.is, function (u, c) {\n var e = exports.UnknownRecord.validate(u, c);\n if (Either_1.isLeft(e)) {\n return e;\n }\n var ce = codec.validate(u, c);\n if (Either_1.isLeft(ce)) {\n return ce;\n }\n return Either_1.right(stripKeys(ce.right, props));\n }, function (a) { return codec.encode(stripKeys(a, props)); }, codec);\n}\nexports.exact = exact;\n// -------------------------------------------------------------------------------------\n// deprecated\n// -------------------------------------------------------------------------------------\n/**\n * @since 1.0.0\n * @deprecated\n */\nvar FunctionType = /** @class */ (function (_super) {\n __extends(FunctionType, _super);\n function FunctionType() {\n var _this = _super.call(this, 'Function', \n // tslint:disable-next-line:strict-type-predicates\n function (u) { return typeof u === 'function'; }, function (u, c) { return (_this.is(u) ? exports.success(u) : exports.failure(u, c)); }, exports.identity) || this;\n /**\n * @since 1.0.0\n */\n _this._tag = 'FunctionType';\n return _this;\n }\n return FunctionType;\n}(Type));\nexports.FunctionType = FunctionType;\n/**\n * @category primitives\n * @since 1.0.0\n * @deprecated\n */\n// tslint:disable-next-line: deprecation\nexports.Function = new FunctionType();\n/**\n * @since 1.3.0\n * @deprecated\n */\nvar TaggedUnionType = /** @class */ (function (_super) {\n __extends(TaggedUnionType, _super);\n function TaggedUnionType(name, \n // tslint:disable-next-line: deprecation\n is, \n // tslint:disable-next-line: deprecation\n validate, \n // tslint:disable-next-line: deprecation\n encode, codecs, tag) {\n var _this = _super.call(this, name, is, validate, encode, codecs) /* istanbul ignore next */ // <= workaround for https://github.com/Microsoft/TypeScript/issues/13455\n || this;\n _this.tag = tag;\n return _this;\n }\n return TaggedUnionType;\n}(UnionType));\nexports.TaggedUnionType = TaggedUnionType;\n/**\n * Use `union` instead.\n *\n * @category combinators\n * @since 1.3.0\n * @deprecated\n */\nvar taggedUnion = function (tag, codecs, name\n// tslint:disable-next-line: deprecation\n) {\n if (name === void 0) { name = getUnionName(codecs); }\n var U = union(codecs, name);\n // tslint:disable-next-line: deprecation\n if (U instanceof TaggedUnionType) {\n return U;\n }\n else {\n console.warn(\"[io-ts] Cannot build a tagged union for \" + name + \", returning a de-optimized union\");\n // tslint:disable-next-line: deprecation\n return new TaggedUnionType(name, U.is, U.validate, U.encode, codecs, tag);\n }\n};\nexports.taggedUnion = taggedUnion;\n/**\n * @since 1.0.0\n * @deprecated\n */\nvar getValidationError /* istanbul ignore next */ = function (value, context) { return ({\n value: value,\n context: context\n}); };\nexports.getValidationError /* istanbul ignore next */ = getValidationError;\n/**\n * @since 1.0.0\n * @deprecated\n */\nvar getDefaultContext /* istanbul ignore next */ = function (decoder) { return [\n { key: '', type: decoder }\n]; };\nexports.getDefaultContext /* istanbul ignore next */ = getDefaultContext;\n/**\n * @since 1.0.0\n * @deprecated\n */\nvar NeverType = /** @class */ (function (_super) {\n __extends(NeverType, _super);\n function NeverType() {\n var _this = _super.call(this, 'never', function (_) { return false; }, function (u, c) { return exports.failure(u, c); }, \n /* istanbul ignore next */\n function () {\n throw new Error('cannot encode never');\n }) || this;\n /**\n * @since 1.0.0\n */\n _this._tag = 'NeverType';\n return _this;\n }\n return NeverType;\n}(Type));\nexports.NeverType = NeverType;\n/**\n * @category primitives\n * @since 1.0.0\n * @deprecated\n */\n// tslint:disable-next-line: deprecation\nexports.never = new NeverType();\n/**\n * @since 1.0.0\n * @deprecated\n */\nvar AnyType = /** @class */ (function (_super) {\n __extends(AnyType, _super);\n function AnyType() {\n var _this = _super.call(this, 'any', function (_) { return true; }, exports.success, exports.identity) || this;\n /**\n * @since 1.0.0\n */\n _this._tag = 'AnyType';\n return _this;\n }\n return AnyType;\n}(Type));\nexports.AnyType = AnyType;\n/**\n * Use `unknown` instead.\n *\n * @category primitives\n * @since 1.0.0\n * @deprecated\n */\n// tslint:disable-next-line: deprecation\nexports.any = new AnyType();\n/**\n * Use `UnknownRecord` instead.\n *\n * @category primitives\n * @since 1.0.0\n * @deprecated\n */\nexports.Dictionary = exports.UnknownRecord;\n/**\n * @since 1.0.0\n * @deprecated\n */\nvar ObjectType = /** @class */ (function (_super) {\n __extends(ObjectType, _super);\n function ObjectType() {\n var _this = _super.call(this, 'object', function (u) { return u !== null && typeof u === 'object'; }, function (u, c) { return (_this.is(u) ? exports.success(u) : exports.failure(u, c)); }, exports.identity) || this;\n /**\n * @since 1.0.0\n */\n _this._tag = 'ObjectType';\n return _this;\n }\n return ObjectType;\n}(Type));\nexports.ObjectType = ObjectType;\n/**\n * Use `UnknownRecord` instead.\n *\n * @category primitives\n * @since 1.0.0\n * @deprecated\n */\n// tslint:disable-next-line: deprecation\nexports.object = new ObjectType();\n/**\n * Use `brand` instead.\n *\n * @category combinators\n * @since 1.0.0\n * @deprecated\n */\nfunction refinement(codec, predicate, name) {\n if (name === void 0) { name = \"(\" + codec.name + \" | \" + getFunctionName(predicate) + \")\"; }\n return new RefinementType(name, function (u) { return codec.is(u) && predicate(u); }, function (i, c) {\n var e = codec.validate(i, c);\n if (Either_1.isLeft(e)) {\n return e;\n }\n var a = e.right;\n return predicate(a) ? exports.success(a) : exports.failure(a, c);\n }, codec.encode, codec, predicate);\n}\nexports.refinement = refinement;\n/**\n * Use `Int` instead.\n *\n * @category primitives\n * @since 1.0.0\n * @deprecated\n */\n// tslint:disable-next-line: deprecation\nexports.Integer = refinement(exports.number, Number.isInteger, 'Integer');\n/**\n * Use `record` instead.\n *\n * @category combinators\n * @since 1.0.0\n * @deprecated\n */\nexports.dictionary = record;\n/**\n * @since 1.0.0\n * @deprecated\n */\nvar StrictType = /** @class */ (function (_super) {\n __extends(StrictType, _super);\n function StrictType(name, \n // tslint:disable-next-line: deprecation\n is, \n // tslint:disable-next-line: deprecation\n validate, \n // tslint:disable-next-line: deprecation\n encode, props) {\n var _this = _super.call(this, name, is, validate, encode) || this;\n _this.props = props;\n /**\n * @since 1.0.0\n */\n _this._tag = 'StrictType';\n return _this;\n }\n return StrictType;\n}(Type));\nexports.StrictType = StrictType;\n/**\n * Drops the codec \"kind\".\n *\n * @category combinators\n * @since 1.1.0\n * @deprecated\n */\nfunction clean(codec) {\n return codec;\n}\nexports.clean = clean;\nfunction alias(codec) {\n return function () { return codec; };\n}\nexports.alias = alias;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n/*!\n * is-plain-object \n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\n\nfunction isObject(o) {\n return Object.prototype.toString.call(o) === '[object Object]';\n}\n\nfunction isPlainObject(o) {\n var ctor,prot;\n\n if (isObject(o) === false) return false;\n\n // If has modified constructor\n ctor = o.constructor;\n if (ctor === undefined) return true;\n\n // If has modified prototype\n prot = ctor.prototype;\n if (isObject(prot) === false) return false;\n\n // If constructor does not have an Object-specific method\n if (prot.hasOwnProperty('isPrototypeOf') === false) {\n return false;\n }\n\n // Most likely a plain Object\n return true;\n}\n\nexports.isPlainObject = isPlainObject;\n","'use strict';\n\n\nvar loader = require('./lib/loader');\nvar dumper = require('./lib/dumper');\n\n\nfunction renamed(from, to) {\n return function () {\n throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' +\n 'Use yaml.' + to + ' instead, which is now safe by default.');\n };\n}\n\n\nmodule.exports.Type = require('./lib/type');\nmodule.exports.Schema = require('./lib/schema');\nmodule.exports.FAILSAFE_SCHEMA = require('./lib/schema/failsafe');\nmodule.exports.JSON_SCHEMA = require('./lib/schema/json');\nmodule.exports.CORE_SCHEMA = require('./lib/schema/core');\nmodule.exports.DEFAULT_SCHEMA = require('./lib/schema/default');\nmodule.exports.load = loader.load;\nmodule.exports.loadAll = loader.loadAll;\nmodule.exports.dump = dumper.dump;\nmodule.exports.YAMLException = require('./lib/exception');\n\n// Removed functions from JS-YAML 3.0.x\nmodule.exports.safeLoad = renamed('safeLoad', 'load');\nmodule.exports.safeLoadAll = renamed('safeLoadAll', 'loadAll');\nmodule.exports.safeDump = renamed('safeDump', 'dump');\n","'use strict';\n\n\nfunction isNothing(subject) {\n return (typeof subject === 'undefined') || (subject === null);\n}\n\n\nfunction isObject(subject) {\n return (typeof subject === 'object') && (subject !== null);\n}\n\n\nfunction toArray(sequence) {\n if (Array.isArray(sequence)) return sequence;\n else if (isNothing(sequence)) return [];\n\n return [ sequence ];\n}\n\n\nfunction extend(target, source) {\n var index, length, key, sourceKeys;\n\n if (source) {\n sourceKeys = Object.keys(source);\n\n for (index = 0, length = sourceKeys.length; index < length; index += 1) {\n key = sourceKeys[index];\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\n\nfunction repeat(string, count) {\n var result = '', cycle;\n\n for (cycle = 0; cycle < count; cycle += 1) {\n result += string;\n }\n\n return result;\n}\n\n\nfunction isNegativeZero(number) {\n return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number);\n}\n\n\nmodule.exports.isNothing = isNothing;\nmodule.exports.isObject = isObject;\nmodule.exports.toArray = toArray;\nmodule.exports.repeat = repeat;\nmodule.exports.isNegativeZero = isNegativeZero;\nmodule.exports.extend = extend;\n","'use strict';\n\n/*eslint-disable no-use-before-define*/\n\nvar common = require('./common');\nvar YAMLException = require('./exception');\nvar DEFAULT_SCHEMA = require('./schema/default');\n\nvar _toString = Object.prototype.toString;\nvar _hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar CHAR_BOM = 0xFEFF;\nvar CHAR_TAB = 0x09; /* Tab */\nvar CHAR_LINE_FEED = 0x0A; /* LF */\nvar CHAR_CARRIAGE_RETURN = 0x0D; /* CR */\nvar CHAR_SPACE = 0x20; /* Space */\nvar CHAR_EXCLAMATION = 0x21; /* ! */\nvar CHAR_DOUBLE_QUOTE = 0x22; /* \" */\nvar CHAR_SHARP = 0x23; /* # */\nvar CHAR_PERCENT = 0x25; /* % */\nvar CHAR_AMPERSAND = 0x26; /* & */\nvar CHAR_SINGLE_QUOTE = 0x27; /* ' */\nvar CHAR_ASTERISK = 0x2A; /* * */\nvar CHAR_COMMA = 0x2C; /* , */\nvar CHAR_MINUS = 0x2D; /* - */\nvar CHAR_COLON = 0x3A; /* : */\nvar CHAR_EQUALS = 0x3D; /* = */\nvar CHAR_GREATER_THAN = 0x3E; /* > */\nvar CHAR_QUESTION = 0x3F; /* ? */\nvar CHAR_COMMERCIAL_AT = 0x40; /* @ */\nvar CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */\nvar CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */\nvar CHAR_GRAVE_ACCENT = 0x60; /* ` */\nvar CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */\nvar CHAR_VERTICAL_LINE = 0x7C; /* | */\nvar CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */\n\nvar ESCAPE_SEQUENCES = {};\n\nESCAPE_SEQUENCES[0x00] = '\\\\0';\nESCAPE_SEQUENCES[0x07] = '\\\\a';\nESCAPE_SEQUENCES[0x08] = '\\\\b';\nESCAPE_SEQUENCES[0x09] = '\\\\t';\nESCAPE_SEQUENCES[0x0A] = '\\\\n';\nESCAPE_SEQUENCES[0x0B] = '\\\\v';\nESCAPE_SEQUENCES[0x0C] = '\\\\f';\nESCAPE_SEQUENCES[0x0D] = '\\\\r';\nESCAPE_SEQUENCES[0x1B] = '\\\\e';\nESCAPE_SEQUENCES[0x22] = '\\\\\"';\nESCAPE_SEQUENCES[0x5C] = '\\\\\\\\';\nESCAPE_SEQUENCES[0x85] = '\\\\N';\nESCAPE_SEQUENCES[0xA0] = '\\\\_';\nESCAPE_SEQUENCES[0x2028] = '\\\\L';\nESCAPE_SEQUENCES[0x2029] = '\\\\P';\n\nvar DEPRECATED_BOOLEANS_SYNTAX = [\n 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',\n 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'\n];\n\nvar DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\\.[0-9_]*)?$/;\n\nfunction compileStyleMap(schema, map) {\n var result, keys, index, length, tag, style, type;\n\n if (map === null) return {};\n\n result = {};\n keys = Object.keys(map);\n\n for (index = 0, length = keys.length; index < length; index += 1) {\n tag = keys[index];\n style = String(map[tag]);\n\n if (tag.slice(0, 2) === '!!') {\n tag = 'tag:yaml.org,2002:' + tag.slice(2);\n }\n type = schema.compiledTypeMap['fallback'][tag];\n\n if (type && _hasOwnProperty.call(type.styleAliases, style)) {\n style = type.styleAliases[style];\n }\n\n result[tag] = style;\n }\n\n return result;\n}\n\nfunction encodeHex(character) {\n var string, handle, length;\n\n string = character.toString(16).toUpperCase();\n\n if (character <= 0xFF) {\n handle = 'x';\n length = 2;\n } else if (character <= 0xFFFF) {\n handle = 'u';\n length = 4;\n } else if (character <= 0xFFFFFFFF) {\n handle = 'U';\n length = 8;\n } else {\n throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF');\n }\n\n return '\\\\' + handle + common.repeat('0', length - string.length) + string;\n}\n\n\nvar QUOTING_TYPE_SINGLE = 1,\n QUOTING_TYPE_DOUBLE = 2;\n\nfunction State(options) {\n this.schema = options['schema'] || DEFAULT_SCHEMA;\n this.indent = Math.max(1, (options['indent'] || 2));\n this.noArrayIndent = options['noArrayIndent'] || false;\n this.skipInvalid = options['skipInvalid'] || false;\n this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);\n this.styleMap = compileStyleMap(this.schema, options['styles'] || null);\n this.sortKeys = options['sortKeys'] || false;\n this.lineWidth = options['lineWidth'] || 80;\n this.noRefs = options['noRefs'] || false;\n this.noCompatMode = options['noCompatMode'] || false;\n this.condenseFlow = options['condenseFlow'] || false;\n this.quotingType = options['quotingType'] === '\"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE;\n this.forceQuotes = options['forceQuotes'] || false;\n this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null;\n\n this.implicitTypes = this.schema.compiledImplicit;\n this.explicitTypes = this.schema.compiledExplicit;\n\n this.tag = null;\n this.result = '';\n\n this.duplicates = [];\n this.usedDuplicates = null;\n}\n\n// Indents every line in a string. Empty lines (\\n only) are not indented.\nfunction indentString(string, spaces) {\n var ind = common.repeat(' ', spaces),\n position = 0,\n next = -1,\n result = '',\n line,\n length = string.length;\n\n while (position < length) {\n next = string.indexOf('\\n', position);\n if (next === -1) {\n line = string.slice(position);\n position = length;\n } else {\n line = string.slice(position, next + 1);\n position = next + 1;\n }\n\n if (line.length && line !== '\\n') result += ind;\n\n result += line;\n }\n\n return result;\n}\n\nfunction generateNextLine(state, level) {\n return '\\n' + common.repeat(' ', state.indent * level);\n}\n\nfunction testImplicitResolving(state, str) {\n var index, length, type;\n\n for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {\n type = state.implicitTypes[index];\n\n if (type.resolve(str)) {\n return true;\n }\n }\n\n return false;\n}\n\n// [33] s-white ::= s-space | s-tab\nfunction isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}\n\n// Returns true if the character can be printed without escaping.\n// From YAML 1.2: \"any allowed characters known to be non-printable\n// should also be escaped. [However,] This isn’t mandatory\"\n// Derived from nb-char - \\t - #x85 - #xA0 - #x2028 - #x2029.\nfunction isPrintable(c) {\n return (0x00020 <= c && c <= 0x00007E)\n || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029)\n || ((0x0E000 <= c && c <= 0x00FFFD) && c !== CHAR_BOM)\n || (0x10000 <= c && c <= 0x10FFFF);\n}\n\n// [34] ns-char ::= nb-char - s-white\n// [27] nb-char ::= c-printable - b-char - c-byte-order-mark\n// [26] b-char ::= b-line-feed | b-carriage-return\n// Including s-white (for some reason, examples doesn't match specs in this aspect)\n// ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark\nfunction isNsCharOrWhitespace(c) {\n return isPrintable(c)\n && c !== CHAR_BOM\n // - b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}\n\n// [127] ns-plain-safe(c) ::= c = flow-out ⇒ ns-plain-safe-out\n// c = flow-in ⇒ ns-plain-safe-in\n// c = block-key ⇒ ns-plain-safe-out\n// c = flow-key ⇒ ns-plain-safe-in\n// [128] ns-plain-safe-out ::= ns-char\n// [129] ns-plain-safe-in ::= ns-char - c-flow-indicator\n// [130] ns-plain-char(c) ::= ( ns-plain-safe(c) - “:” - “#” )\n// | ( /* An ns-char preceding */ “#” )\n// | ( “:” /* Followed by an ns-plain-safe(c) */ )\nfunction isPlainSafe(c, prev, inblock) {\n var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);\n var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);\n return (\n // ns-plain-safe\n inblock ? // c = flow-in\n cIsNsCharOrWhitespace\n : cIsNsCharOrWhitespace\n // - c-flow-indicator\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n )\n // ns-plain-char\n && c !== CHAR_SHARP // false on '#'\n && !(prev === CHAR_COLON && !cIsNsChar) // false on ': '\n || (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) // change to true on '[^ ]#'\n || (prev === CHAR_COLON && cIsNsChar); // change to true on ':[^ ]'\n}\n\n// Simplified test for values allowed as the first character in plain style.\nfunction isPlainSafeFirst(c) {\n // Uses a subset of ns-char - c-indicator\n // where ns-char = nb-char - s-white.\n // No support of ( ( “?” | “:” | “-” ) /* Followed by an ns-plain-safe(c)) */ ) part\n return isPrintable(c) && c !== CHAR_BOM\n && !isWhitespace(c) // - s-white\n // - (c-indicator ::=\n // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}”\n && c !== CHAR_MINUS\n && c !== CHAR_QUESTION\n && c !== CHAR_COLON\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “\"”\n && c !== CHAR_SHARP\n && c !== CHAR_AMPERSAND\n && c !== CHAR_ASTERISK\n && c !== CHAR_EXCLAMATION\n && c !== CHAR_VERTICAL_LINE\n && c !== CHAR_EQUALS\n && c !== CHAR_GREATER_THAN\n && c !== CHAR_SINGLE_QUOTE\n && c !== CHAR_DOUBLE_QUOTE\n // | “%” | “@” | “`”)\n && c !== CHAR_PERCENT\n && c !== CHAR_COMMERCIAL_AT\n && c !== CHAR_GRAVE_ACCENT;\n}\n\n// Simplified test for values allowed as the last character in plain style.\nfunction isPlainSafeLast(c) {\n // just not whitespace or colon, it will be checked to be plain character later\n return !isWhitespace(c) && c !== CHAR_COLON;\n}\n\n// Same as 'string'.codePointAt(pos), but works in older browsers.\nfunction codePointAt(string, pos) {\n var first = string.charCodeAt(pos), second;\n if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {\n second = string.charCodeAt(pos + 1);\n if (second >= 0xDC00 && second <= 0xDFFF) {\n // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n }\n }\n return first;\n}\n\n// Determines whether block indentation indicator is required.\nfunction needIndentIndicator(string) {\n var leadingSpaceRe = /^\\n* /;\n return leadingSpaceRe.test(string);\n}\n\nvar STYLE_PLAIN = 1,\n STYLE_SINGLE = 2,\n STYLE_LITERAL = 3,\n STYLE_FOLDED = 4,\n STYLE_DOUBLE = 5;\n\n// Determines which scalar styles are possible and returns the preferred style.\n// lineWidth = -1 => no limit.\n// Pre-conditions: str.length > 0.\n// Post-conditions:\n// STYLE_PLAIN or STYLE_SINGLE => no \\n are in the string.\n// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1).\n// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1).\nfunction chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth,\n testAmbiguousType, quotingType, forceQuotes, inblock) {\n\n var i;\n var char = 0;\n var prevChar = null;\n var hasLineBreak = false;\n var hasFoldableLine = false; // only checked if shouldTrackWidth\n var shouldTrackWidth = lineWidth !== -1;\n var previousLineBreak = -1; // count the first line correctly\n var plain = isPlainSafeFirst(codePointAt(string, 0))\n && isPlainSafeLast(codePointAt(string, string.length - 1));\n\n if (singleLineOnly || forceQuotes) {\n // Case: no block styles.\n // Check for disallowed characters to rule out plain and single.\n for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n char = codePointAt(string, i);\n if (!isPrintable(char)) {\n return STYLE_DOUBLE;\n }\n plain = plain && isPlainSafe(char, prevChar, inblock);\n prevChar = char;\n }\n } else {\n // Case: block styles permitted.\n for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n char = codePointAt(string, i);\n if (char === CHAR_LINE_FEED) {\n hasLineBreak = true;\n // Check if any line can be folded.\n if (shouldTrackWidth) {\n hasFoldableLine = hasFoldableLine ||\n // Foldable line = too long, and not more-indented.\n (i - previousLineBreak - 1 > lineWidth &&\n string[previousLineBreak + 1] !== ' ');\n previousLineBreak = i;\n }\n } else if (!isPrintable(char)) {\n return STYLE_DOUBLE;\n }\n plain = plain && isPlainSafe(char, prevChar, inblock);\n prevChar = char;\n }\n // in case the end is missing a \\n\n hasFoldableLine = hasFoldableLine || (shouldTrackWidth &&\n (i - previousLineBreak - 1 > lineWidth &&\n string[previousLineBreak + 1] !== ' '));\n }\n // Although every style can represent \\n without escaping, prefer block styles\n // for multiline, since they're more readable and they don't add empty lines.\n // Also prefer folding a super-long line.\n if (!hasLineBreak && !hasFoldableLine) {\n // Strings interpretable as another type have to be quoted;\n // e.g. the string 'true' vs. the boolean true.\n if (plain && !forceQuotes && !testAmbiguousType(string)) {\n return STYLE_PLAIN;\n }\n return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;\n }\n // Edge case: block indentation indicator can only have one digit.\n if (indentPerLevel > 9 && needIndentIndicator(string)) {\n return STYLE_DOUBLE;\n }\n // At this point we know block styles are valid.\n // Prefer literal style unless we want to fold.\n if (!forceQuotes) {\n return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;\n }\n return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;\n}\n\n// Note: line breaking/folding is implemented for only the folded style.\n// NB. We drop the last trailing newline (if any) of a returned block scalar\n// since the dumper adds its own newline. This always works:\n// • No ending newline => unaffected; already using strip \"-\" chomping.\n// • Ending newline => removed then restored.\n// Importantly, this keeps the \"+\" chomp indicator from gaining an extra line.\nfunction writeScalar(state, string, level, iskey, inblock) {\n state.dump = (function () {\n if (string.length === 0) {\n return state.quotingType === QUOTING_TYPE_DOUBLE ? '\"\"' : \"''\";\n }\n if (!state.noCompatMode) {\n if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) {\n return state.quotingType === QUOTING_TYPE_DOUBLE ? ('\"' + string + '\"') : (\"'\" + string + \"'\");\n }\n }\n\n var indent = state.indent * Math.max(1, level); // no 0-indent scalars\n // As indentation gets deeper, let the width decrease monotonically\n // to the lower bound min(state.lineWidth, 40).\n // Note that this implies\n // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound.\n // state.lineWidth > 40 + state.indent: width decreases until the lower bound.\n // This behaves better than a constant minimum width which disallows narrower options,\n // or an indent threshold which causes the width to suddenly increase.\n var lineWidth = state.lineWidth === -1\n ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);\n\n // Without knowing if keys are implicit/explicit, assume implicit for safety.\n var singleLineOnly = iskey\n // No block styles in flow mode.\n || (state.flowLevel > -1 && level >= state.flowLevel);\n function testAmbiguity(string) {\n return testImplicitResolving(state, string);\n }\n\n switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth,\n testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) {\n\n case STYLE_PLAIN:\n return string;\n case STYLE_SINGLE:\n return \"'\" + string.replace(/'/g, \"''\") + \"'\";\n case STYLE_LITERAL:\n return '|' + blockHeader(string, state.indent)\n + dropEndingNewline(indentString(string, indent));\n case STYLE_FOLDED:\n return '>' + blockHeader(string, state.indent)\n + dropEndingNewline(indentString(foldString(string, lineWidth), indent));\n case STYLE_DOUBLE:\n return '\"' + escapeString(string, lineWidth) + '\"';\n default:\n throw new YAMLException('impossible error: invalid scalar style');\n }\n }());\n}\n\n// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.\nfunction blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}\n\n// (See the note for writeScalar.)\nfunction dropEndingNewline(string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n}\n\n// Note: a long line without a suitable break point will exceed the width limit.\n// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0.\nfunction foldString(string, width) {\n // In folded style, $k$ consecutive newlines output as $k+1$ newlines—\n // unless they're before or after a more-indented line, or at the very\n // beginning or end, in which case $k$ maps to $k$.\n // Therefore, parse each chunk as newline(s) followed by a content line.\n var lineRe = /(\\n+)([^\\n]*)/g;\n\n // first line (possibly an empty line)\n var result = (function () {\n var nextLF = string.indexOf('\\n');\n nextLF = nextLF !== -1 ? nextLF : string.length;\n lineRe.lastIndex = nextLF;\n return foldLine(string.slice(0, nextLF), width);\n }());\n // If we haven't reached the first content line yet, don't add an extra \\n.\n var prevMoreIndented = string[0] === '\\n' || string[0] === ' ';\n var moreIndented;\n\n // rest of the lines\n var match;\n while ((match = lineRe.exec(string))) {\n var prefix = match[1], line = match[2];\n moreIndented = (line[0] === ' ');\n result += prefix\n + (!prevMoreIndented && !moreIndented && line !== ''\n ? '\\n' : '')\n + foldLine(line, width);\n prevMoreIndented = moreIndented;\n }\n\n return result;\n}\n\n// Greedy line breaking.\n// Picks the longest line under the limit each time,\n// otherwise settles for the shortest line over the limit.\n// NB. More-indented lines *cannot* be folded, as that would add an extra \\n.\nfunction foldLine(line, width) {\n if (line === '' || line[0] === ' ') return line;\n\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n var match;\n // start is an inclusive index. end, curr, and next are exclusive.\n var start = 0, end, curr = 0, next = 0;\n var result = '';\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index;\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next; // derive end <= length-2\n result += '\\n' + line.slice(start, end);\n // skip the space that was output as \\n\n start = end + 1; // derive start <= length-1\n }\n curr = next;\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n';\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n } else {\n result += line.slice(start);\n }\n\n return result.slice(1); // drop extra \\n joiner\n}\n\n// Escapes a double-quoted string.\nfunction escapeString(string) {\n var result = '';\n var char = 0;\n var escapeSeq;\n\n for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n char = codePointAt(string, i);\n escapeSeq = ESCAPE_SEQUENCES[char];\n\n if (!escapeSeq && isPrintable(char)) {\n result += string[i];\n if (char >= 0x10000) result += string[i + 1];\n } else {\n result += escapeSeq || encodeHex(char);\n }\n }\n\n return result;\n}\n\nfunction writeFlowSequence(state, level, object) {\n var _result = '',\n _tag = state.tag,\n index,\n length,\n value;\n\n for (index = 0, length = object.length; index < length; index += 1) {\n value = object[index];\n\n if (state.replacer) {\n value = state.replacer.call(object, String(index), value);\n }\n\n // Write only valid elements, put null instead of invalid elements.\n if (writeNode(state, level, value, false, false) ||\n (typeof value === 'undefined' &&\n writeNode(state, level, null, false, false))) {\n\n if (_result !== '') _result += ',' + (!state.condenseFlow ? ' ' : '');\n _result += state.dump;\n }\n }\n\n state.tag = _tag;\n state.dump = '[' + _result + ']';\n}\n\nfunction writeBlockSequence(state, level, object, compact) {\n var _result = '',\n _tag = state.tag,\n index,\n length,\n value;\n\n for (index = 0, length = object.length; index < length; index += 1) {\n value = object[index];\n\n if (state.replacer) {\n value = state.replacer.call(object, String(index), value);\n }\n\n // Write only valid elements, put null instead of invalid elements.\n if (writeNode(state, level + 1, value, true, true, false, true) ||\n (typeof value === 'undefined' &&\n writeNode(state, level + 1, null, true, true, false, true))) {\n\n if (!compact || _result !== '') {\n _result += generateNextLine(state, level);\n }\n\n if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {\n _result += '-';\n } else {\n _result += '- ';\n }\n\n _result += state.dump;\n }\n }\n\n state.tag = _tag;\n state.dump = _result || '[]'; // Empty sequence if no valid values.\n}\n\nfunction writeFlowMapping(state, level, object) {\n var _result = '',\n _tag = state.tag,\n objectKeyList = Object.keys(object),\n index,\n length,\n objectKey,\n objectValue,\n pairBuffer;\n\n for (index = 0, length = objectKeyList.length; index < length; index += 1) {\n\n pairBuffer = '';\n if (_result !== '') pairBuffer += ', ';\n\n if (state.condenseFlow) pairBuffer += '\"';\n\n objectKey = objectKeyList[index];\n objectValue = object[objectKey];\n\n if (state.replacer) {\n objectValue = state.replacer.call(object, objectKey, objectValue);\n }\n\n if (!writeNode(state, level, objectKey, false, false)) {\n continue; // Skip this pair because of invalid key;\n }\n\n if (state.dump.length > 1024) pairBuffer += '? ';\n\n pairBuffer += state.dump + (state.condenseFlow ? '\"' : '') + ':' + (state.condenseFlow ? '' : ' ');\n\n if (!writeNode(state, level, objectValue, false, false)) {\n continue; // Skip this pair because of invalid value.\n }\n\n pairBuffer += state.dump;\n\n // Both key and value are valid.\n _result += pairBuffer;\n }\n\n state.tag = _tag;\n state.dump = '{' + _result + '}';\n}\n\nfunction writeBlockMapping(state, level, object, compact) {\n var _result = '',\n _tag = state.tag,\n objectKeyList = Object.keys(object),\n index,\n length,\n objectKey,\n objectValue,\n explicitPair,\n pairBuffer;\n\n // Allow sorting keys so that the output file is deterministic\n if (state.sortKeys === true) {\n // Default sorting\n objectKeyList.sort();\n } else if (typeof state.sortKeys === 'function') {\n // Custom sort function\n objectKeyList.sort(state.sortKeys);\n } else if (state.sortKeys) {\n // Something is wrong\n throw new YAMLException('sortKeys must be a boolean or a function');\n }\n\n for (index = 0, length = objectKeyList.length; index < length; index += 1) {\n pairBuffer = '';\n\n if (!compact || _result !== '') {\n pairBuffer += generateNextLine(state, level);\n }\n\n objectKey = objectKeyList[index];\n objectValue = object[objectKey];\n\n if (state.replacer) {\n objectValue = state.replacer.call(object, objectKey, objectValue);\n }\n\n if (!writeNode(state, level + 1, objectKey, true, true, true)) {\n continue; // Skip this pair because of invalid key.\n }\n\n explicitPair = (state.tag !== null && state.tag !== '?') ||\n (state.dump && state.dump.length > 1024);\n\n if (explicitPair) {\n if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {\n pairBuffer += '?';\n } else {\n pairBuffer += '? ';\n }\n }\n\n pairBuffer += state.dump;\n\n if (explicitPair) {\n pairBuffer += generateNextLine(state, level);\n }\n\n if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {\n continue; // Skip this pair because of invalid value.\n }\n\n if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {\n pairBuffer += ':';\n } else {\n pairBuffer += ': ';\n }\n\n pairBuffer += state.dump;\n\n // Both key and value are valid.\n _result += pairBuffer;\n }\n\n state.tag = _tag;\n state.dump = _result || '{}'; // Empty mapping if no valid pairs.\n}\n\nfunction detectType(state, object, explicit) {\n var _result, typeList, index, length, type, style;\n\n typeList = explicit ? state.explicitTypes : state.implicitTypes;\n\n for (index = 0, length = typeList.length; index < length; index += 1) {\n type = typeList[index];\n\n if ((type.instanceOf || type.predicate) &&\n (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) &&\n (!type.predicate || type.predicate(object))) {\n\n if (explicit) {\n if (type.multi && type.representName) {\n state.tag = type.representName(object);\n } else {\n state.tag = type.tag;\n }\n } else {\n state.tag = '?';\n }\n\n if (type.represent) {\n style = state.styleMap[type.tag] || type.defaultStyle;\n\n if (_toString.call(type.represent) === '[object Function]') {\n _result = type.represent(object, style);\n } else if (_hasOwnProperty.call(type.represent, style)) {\n _result = type.represent[style](object, style);\n } else {\n throw new YAMLException('!<' + type.tag + '> tag resolver accepts not \"' + style + '\" style');\n }\n\n state.dump = _result;\n }\n\n return true;\n }\n }\n\n return false;\n}\n\n// Serializes `object` and writes it to global `result`.\n// Returns true on success, or false on invalid object.\n//\nfunction writeNode(state, level, object, block, compact, iskey, isblockseq) {\n state.tag = null;\n state.dump = object;\n\n if (!detectType(state, object, false)) {\n detectType(state, object, true);\n }\n\n var type = _toString.call(state.dump);\n var inblock = block;\n var tagStr;\n\n if (block) {\n block = (state.flowLevel < 0 || state.flowLevel > level);\n }\n\n var objectOrArray = type === '[object Object]' || type === '[object Array]',\n duplicateIndex,\n duplicate;\n\n if (objectOrArray) {\n duplicateIndex = state.duplicates.indexOf(object);\n duplicate = duplicateIndex !== -1;\n }\n\n if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) {\n compact = false;\n }\n\n if (duplicate && state.usedDuplicates[duplicateIndex]) {\n state.dump = '*ref_' + duplicateIndex;\n } else {\n if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {\n state.usedDuplicates[duplicateIndex] = true;\n }\n if (type === '[object Object]') {\n if (block && (Object.keys(state.dump).length !== 0)) {\n writeBlockMapping(state, level, state.dump, compact);\n if (duplicate) {\n state.dump = '&ref_' + duplicateIndex + state.dump;\n }\n } else {\n writeFlowMapping(state, level, state.dump);\n if (duplicate) {\n state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;\n }\n }\n } else if (type === '[object Array]') {\n if (block && (state.dump.length !== 0)) {\n if (state.noArrayIndent && !isblockseq && level > 0) {\n writeBlockSequence(state, level - 1, state.dump, compact);\n } else {\n writeBlockSequence(state, level, state.dump, compact);\n }\n if (duplicate) {\n state.dump = '&ref_' + duplicateIndex + state.dump;\n }\n } else {\n writeFlowSequence(state, level, state.dump);\n if (duplicate) {\n state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;\n }\n }\n } else if (type === '[object String]') {\n if (state.tag !== '?') {\n writeScalar(state, state.dump, level, iskey, inblock);\n }\n } else if (type === '[object Undefined]') {\n return false;\n } else {\n if (state.skipInvalid) return false;\n throw new YAMLException('unacceptable kind of an object to dump ' + type);\n }\n\n if (state.tag !== null && state.tag !== '?') {\n // Need to encode all characters except those allowed by the spec:\n //\n // [35] ns-dec-digit ::= [#x30-#x39] /* 0-9 */\n // [36] ns-hex-digit ::= ns-dec-digit\n // | [#x41-#x46] /* A-F */ | [#x61-#x66] /* a-f */\n // [37] ns-ascii-letter ::= [#x41-#x5A] /* A-Z */ | [#x61-#x7A] /* a-z */\n // [38] ns-word-char ::= ns-dec-digit | ns-ascii-letter | “-”\n // [39] ns-uri-char ::= “%” ns-hex-digit ns-hex-digit | ns-word-char | “#”\n // | “;” | “/” | “?” | “:” | “@” | “&” | “=” | “+” | “$” | “,”\n // | “_” | “.” | “!” | “~” | “*” | “'” | “(” | “)” | “[” | “]”\n //\n // Also need to encode '!' because it has special meaning (end of tag prefix).\n //\n tagStr = encodeURI(\n state.tag[0] === '!' ? state.tag.slice(1) : state.tag\n ).replace(/!/g, '%21');\n\n if (state.tag[0] === '!') {\n tagStr = '!' + tagStr;\n } else if (tagStr.slice(0, 18) === 'tag:yaml.org,2002:') {\n tagStr = '!!' + tagStr.slice(18);\n } else {\n tagStr = '!<' + tagStr + '>';\n }\n\n state.dump = tagStr + ' ' + state.dump;\n }\n }\n\n return true;\n}\n\nfunction getDuplicateReferences(object, state) {\n var objects = [],\n duplicatesIndexes = [],\n index,\n length;\n\n inspectNode(object, objects, duplicatesIndexes);\n\n for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {\n state.duplicates.push(objects[duplicatesIndexes[index]]);\n }\n state.usedDuplicates = new Array(length);\n}\n\nfunction inspectNode(object, objects, duplicatesIndexes) {\n var objectKeyList,\n index,\n length;\n\n if (object !== null && typeof object === 'object') {\n index = objects.indexOf(object);\n if (index !== -1) {\n if (duplicatesIndexes.indexOf(index) === -1) {\n duplicatesIndexes.push(index);\n }\n } else {\n objects.push(object);\n\n if (Array.isArray(object)) {\n for (index = 0, length = object.length; index < length; index += 1) {\n inspectNode(object[index], objects, duplicatesIndexes);\n }\n } else {\n objectKeyList = Object.keys(object);\n\n for (index = 0, length = objectKeyList.length; index < length; index += 1) {\n inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);\n }\n }\n }\n }\n}\n\nfunction dump(input, options) {\n options = options || {};\n\n var state = new State(options);\n\n if (!state.noRefs) getDuplicateReferences(input, state);\n\n var value = input;\n\n if (state.replacer) {\n value = state.replacer.call({ '': value }, '', value);\n }\n\n if (writeNode(state, 0, value, true, true)) return state.dump + '\\n';\n\n return '';\n}\n\nmodule.exports.dump = dump;\n","// YAML error class. http://stackoverflow.com/questions/8458984\n//\n'use strict';\n\n\nfunction formatError(exception, compact) {\n var where = '', message = exception.reason || '(unknown reason)';\n\n if (!exception.mark) return message;\n\n if (exception.mark.name) {\n where += 'in \"' + exception.mark.name + '\" ';\n }\n\n where += '(' + (exception.mark.line + 1) + ':' + (exception.mark.column + 1) + ')';\n\n if (!compact && exception.mark.snippet) {\n where += '\\n\\n' + exception.mark.snippet;\n }\n\n return message + ' ' + where;\n}\n\n\nfunction YAMLException(reason, mark) {\n // Super constructor\n Error.call(this);\n\n this.name = 'YAMLException';\n this.reason = reason;\n this.mark = mark;\n this.message = formatError(this, false);\n\n // Include stack trace in error object\n if (Error.captureStackTrace) {\n // Chrome and NodeJS\n Error.captureStackTrace(this, this.constructor);\n } else {\n // FF, IE 10+ and Safari 6+. Fallback for others\n this.stack = (new Error()).stack || '';\n }\n}\n\n\n// Inherit from Error\nYAMLException.prototype = Object.create(Error.prototype);\nYAMLException.prototype.constructor = YAMLException;\n\n\nYAMLException.prototype.toString = function toString(compact) {\n return this.name + ': ' + formatError(this, compact);\n};\n\n\nmodule.exports = YAMLException;\n","'use strict';\n\n/*eslint-disable max-len,no-use-before-define*/\n\nvar common = require('./common');\nvar YAMLException = require('./exception');\nvar makeSnippet = require('./snippet');\nvar DEFAULT_SCHEMA = require('./schema/default');\n\n\nvar _hasOwnProperty = Object.prototype.hasOwnProperty;\n\n\nvar CONTEXT_FLOW_IN = 1;\nvar CONTEXT_FLOW_OUT = 2;\nvar CONTEXT_BLOCK_IN = 3;\nvar CONTEXT_BLOCK_OUT = 4;\n\n\nvar CHOMPING_CLIP = 1;\nvar CHOMPING_STRIP = 2;\nvar CHOMPING_KEEP = 3;\n\n\nvar PATTERN_NON_PRINTABLE = /[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F-\\x84\\x86-\\x9F\\uFFFE\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]/;\nvar PATTERN_NON_ASCII_LINE_BREAKS = /[\\x85\\u2028\\u2029]/;\nvar PATTERN_FLOW_INDICATORS = /[,\\[\\]\\{\\}]/;\nvar PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\\-]+!)$/i;\nvar PATTERN_TAG_URI = /^(?:!|[^,\\[\\]\\{\\}])(?:%[0-9a-f]{2}|[0-9a-z\\-#;\\/\\?:@&=\\+\\$,_\\.!~\\*'\\(\\)\\[\\]])*$/i;\n\n\nfunction _class(obj) { return Object.prototype.toString.call(obj); }\n\nfunction is_EOL(c) {\n return (c === 0x0A/* LF */) || (c === 0x0D/* CR */);\n}\n\nfunction is_WHITE_SPACE(c) {\n return (c === 0x09/* Tab */) || (c === 0x20/* Space */);\n}\n\nfunction is_WS_OR_EOL(c) {\n return (c === 0x09/* Tab */) ||\n (c === 0x20/* Space */) ||\n (c === 0x0A/* LF */) ||\n (c === 0x0D/* CR */);\n}\n\nfunction is_FLOW_INDICATOR(c) {\n return c === 0x2C/* , */ ||\n c === 0x5B/* [ */ ||\n c === 0x5D/* ] */ ||\n c === 0x7B/* { */ ||\n c === 0x7D/* } */;\n}\n\nfunction fromHexCode(c) {\n var lc;\n\n if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {\n return c - 0x30;\n }\n\n /*eslint-disable no-bitwise*/\n lc = c | 0x20;\n\n if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) {\n return lc - 0x61 + 10;\n }\n\n return -1;\n}\n\nfunction escapedHexLen(c) {\n if (c === 0x78/* x */) { return 2; }\n if (c === 0x75/* u */) { return 4; }\n if (c === 0x55/* U */) { return 8; }\n return 0;\n}\n\nfunction fromDecimalCode(c) {\n if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {\n return c - 0x30;\n }\n\n return -1;\n}\n\nfunction simpleEscapeSequence(c) {\n /* eslint-disable indent */\n return (c === 0x30/* 0 */) ? '\\x00' :\n (c === 0x61/* a */) ? '\\x07' :\n (c === 0x62/* b */) ? '\\x08' :\n (c === 0x74/* t */) ? '\\x09' :\n (c === 0x09/* Tab */) ? '\\x09' :\n (c === 0x6E/* n */) ? '\\x0A' :\n (c === 0x76/* v */) ? '\\x0B' :\n (c === 0x66/* f */) ? '\\x0C' :\n (c === 0x72/* r */) ? '\\x0D' :\n (c === 0x65/* e */) ? '\\x1B' :\n (c === 0x20/* Space */) ? ' ' :\n (c === 0x22/* \" */) ? '\\x22' :\n (c === 0x2F/* / */) ? '/' :\n (c === 0x5C/* \\ */) ? '\\x5C' :\n (c === 0x4E/* N */) ? '\\x85' :\n (c === 0x5F/* _ */) ? '\\xA0' :\n (c === 0x4C/* L */) ? '\\u2028' :\n (c === 0x50/* P */) ? '\\u2029' : '';\n}\n\nfunction charFromCodepoint(c) {\n if (c <= 0xFFFF) {\n return String.fromCharCode(c);\n }\n // Encode UTF-16 surrogate pair\n // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF\n return String.fromCharCode(\n ((c - 0x010000) >> 10) + 0xD800,\n ((c - 0x010000) & 0x03FF) + 0xDC00\n );\n}\n\nvar simpleEscapeCheck = new Array(256); // integer, for fast access\nvar simpleEscapeMap = new Array(256);\nfor (var i = 0; i < 256; i++) {\n simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;\n simpleEscapeMap[i] = simpleEscapeSequence(i);\n}\n\n\nfunction State(input, options) {\n this.input = input;\n\n this.filename = options['filename'] || null;\n this.schema = options['schema'] || DEFAULT_SCHEMA;\n this.onWarning = options['onWarning'] || null;\n // (Hidden) Remove? makes the loader to expect YAML 1.1 documents\n // if such documents have no explicit %YAML directive\n this.legacy = options['legacy'] || false;\n\n this.json = options['json'] || false;\n this.listener = options['listener'] || null;\n\n this.implicitTypes = this.schema.compiledImplicit;\n this.typeMap = this.schema.compiledTypeMap;\n\n this.length = input.length;\n this.position = 0;\n this.line = 0;\n this.lineStart = 0;\n this.lineIndent = 0;\n\n // position of first leading tab in the current line,\n // used to make sure there are no tabs in the indentation\n this.firstTabInLine = -1;\n\n this.documents = [];\n\n /*\n this.version;\n this.checkLineBreaks;\n this.tagMap;\n this.anchorMap;\n this.tag;\n this.anchor;\n this.kind;\n this.result;*/\n\n}\n\n\nfunction generateError(state, message) {\n var mark = {\n name: state.filename,\n buffer: state.input.slice(0, -1), // omit trailing \\0\n position: state.position,\n line: state.line,\n column: state.position - state.lineStart\n };\n\n mark.snippet = makeSnippet(mark);\n\n return new YAMLException(message, mark);\n}\n\nfunction throwError(state, message) {\n throw generateError(state, message);\n}\n\nfunction throwWarning(state, message) {\n if (state.onWarning) {\n state.onWarning.call(null, generateError(state, message));\n }\n}\n\n\nvar directiveHandlers = {\n\n YAML: function handleYamlDirective(state, name, args) {\n\n var match, major, minor;\n\n if (state.version !== null) {\n throwError(state, 'duplication of %YAML directive');\n }\n\n if (args.length !== 1) {\n throwError(state, 'YAML directive accepts exactly one argument');\n }\n\n match = /^([0-9]+)\\.([0-9]+)$/.exec(args[0]);\n\n if (match === null) {\n throwError(state, 'ill-formed argument of the YAML directive');\n }\n\n major = parseInt(match[1], 10);\n minor = parseInt(match[2], 10);\n\n if (major !== 1) {\n throwError(state, 'unacceptable YAML version of the document');\n }\n\n state.version = args[0];\n state.checkLineBreaks = (minor < 2);\n\n if (minor !== 1 && minor !== 2) {\n throwWarning(state, 'unsupported YAML version of the document');\n }\n },\n\n TAG: function handleTagDirective(state, name, args) {\n\n var handle, prefix;\n\n if (args.length !== 2) {\n throwError(state, 'TAG directive accepts exactly two arguments');\n }\n\n handle = args[0];\n prefix = args[1];\n\n if (!PATTERN_TAG_HANDLE.test(handle)) {\n throwError(state, 'ill-formed tag handle (first argument) of the TAG directive');\n }\n\n if (_hasOwnProperty.call(state.tagMap, handle)) {\n throwError(state, 'there is a previously declared suffix for \"' + handle + '\" tag handle');\n }\n\n if (!PATTERN_TAG_URI.test(prefix)) {\n throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive');\n }\n\n try {\n prefix = decodeURIComponent(prefix);\n } catch (err) {\n throwError(state, 'tag prefix is malformed: ' + prefix);\n }\n\n state.tagMap[handle] = prefix;\n }\n};\n\n\nfunction captureSegment(state, start, end, checkJson) {\n var _position, _length, _character, _result;\n\n if (start < end) {\n _result = state.input.slice(start, end);\n\n if (checkJson) {\n for (_position = 0, _length = _result.length; _position < _length; _position += 1) {\n _character = _result.charCodeAt(_position);\n if (!(_character === 0x09 ||\n (0x20 <= _character && _character <= 0x10FFFF))) {\n throwError(state, 'expected valid JSON character');\n }\n }\n } else if (PATTERN_NON_PRINTABLE.test(_result)) {\n throwError(state, 'the stream contains non-printable characters');\n }\n\n state.result += _result;\n }\n}\n\nfunction mergeMappings(state, destination, source, overridableKeys) {\n var sourceKeys, key, index, quantity;\n\n if (!common.isObject(source)) {\n throwError(state, 'cannot merge mappings; the provided source object is unacceptable');\n }\n\n sourceKeys = Object.keys(source);\n\n for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {\n key = sourceKeys[index];\n\n if (!_hasOwnProperty.call(destination, key)) {\n destination[key] = source[key];\n overridableKeys[key] = true;\n }\n }\n}\n\nfunction storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode,\n startLine, startLineStart, startPos) {\n\n var index, quantity;\n\n // The output is a plain object here, so keys can only be strings.\n // We need to convert keyNode to a string, but doing so can hang the process\n // (deeply nested arrays that explode exponentially using aliases).\n if (Array.isArray(keyNode)) {\n keyNode = Array.prototype.slice.call(keyNode);\n\n for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {\n if (Array.isArray(keyNode[index])) {\n throwError(state, 'nested arrays are not supported inside keys');\n }\n\n if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') {\n keyNode[index] = '[object Object]';\n }\n }\n }\n\n // Avoid code execution in load() via toString property\n // (still use its own toString for arrays, timestamps,\n // and whatever user schema extensions happen to have @@toStringTag)\n if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') {\n keyNode = '[object Object]';\n }\n\n\n keyNode = String(keyNode);\n\n if (_result === null) {\n _result = {};\n }\n\n if (keyTag === 'tag:yaml.org,2002:merge') {\n if (Array.isArray(valueNode)) {\n for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {\n mergeMappings(state, _result, valueNode[index], overridableKeys);\n }\n } else {\n mergeMappings(state, _result, valueNode, overridableKeys);\n }\n } else {\n if (!state.json &&\n !_hasOwnProperty.call(overridableKeys, keyNode) &&\n _hasOwnProperty.call(_result, keyNode)) {\n state.line = startLine || state.line;\n state.lineStart = startLineStart || state.lineStart;\n state.position = startPos || state.position;\n throwError(state, 'duplicated mapping key');\n }\n\n // used for this specific key only because Object.defineProperty is slow\n if (keyNode === '__proto__') {\n Object.defineProperty(_result, keyNode, {\n configurable: true,\n enumerable: true,\n writable: true,\n value: valueNode\n });\n } else {\n _result[keyNode] = valueNode;\n }\n delete overridableKeys[keyNode];\n }\n\n return _result;\n}\n\nfunction readLineBreak(state) {\n var ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch === 0x0A/* LF */) {\n state.position++;\n } else if (ch === 0x0D/* CR */) {\n state.position++;\n if (state.input.charCodeAt(state.position) === 0x0A/* LF */) {\n state.position++;\n }\n } else {\n throwError(state, 'a line break is expected');\n }\n\n state.line += 1;\n state.lineStart = state.position;\n state.firstTabInLine = -1;\n}\n\nfunction skipSeparationSpace(state, allowComments, checkIndent) {\n var lineBreaks = 0,\n ch = state.input.charCodeAt(state.position);\n\n while (ch !== 0) {\n while (is_WHITE_SPACE(ch)) {\n if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) {\n state.firstTabInLine = state.position;\n }\n ch = state.input.charCodeAt(++state.position);\n }\n\n if (allowComments && ch === 0x23/* # */) {\n do {\n ch = state.input.charCodeAt(++state.position);\n } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0);\n }\n\n if (is_EOL(ch)) {\n readLineBreak(state);\n\n ch = state.input.charCodeAt(state.position);\n lineBreaks++;\n state.lineIndent = 0;\n\n while (ch === 0x20/* Space */) {\n state.lineIndent++;\n ch = state.input.charCodeAt(++state.position);\n }\n } else {\n break;\n }\n }\n\n if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {\n throwWarning(state, 'deficient indentation');\n }\n\n return lineBreaks;\n}\n\nfunction testDocumentSeparator(state) {\n var _position = state.position,\n ch;\n\n ch = state.input.charCodeAt(_position);\n\n // Condition state.position === state.lineStart is tested\n // in parent on each call, for efficiency. No needs to test here again.\n if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) &&\n ch === state.input.charCodeAt(_position + 1) &&\n ch === state.input.charCodeAt(_position + 2)) {\n\n _position += 3;\n\n ch = state.input.charCodeAt(_position);\n\n if (ch === 0 || is_WS_OR_EOL(ch)) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction writeFoldedLines(state, count) {\n if (count === 1) {\n state.result += ' ';\n } else if (count > 1) {\n state.result += common.repeat('\\n', count - 1);\n }\n}\n\n\nfunction readPlainScalar(state, nodeIndent, withinFlowCollection) {\n var preceding,\n following,\n captureStart,\n captureEnd,\n hasPendingContent,\n _line,\n _lineStart,\n _lineIndent,\n _kind = state.kind,\n _result = state.result,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (is_WS_OR_EOL(ch) ||\n is_FLOW_INDICATOR(ch) ||\n ch === 0x23/* # */ ||\n ch === 0x26/* & */ ||\n ch === 0x2A/* * */ ||\n ch === 0x21/* ! */ ||\n ch === 0x7C/* | */ ||\n ch === 0x3E/* > */ ||\n ch === 0x27/* ' */ ||\n ch === 0x22/* \" */ ||\n ch === 0x25/* % */ ||\n ch === 0x40/* @ */ ||\n ch === 0x60/* ` */) {\n return false;\n }\n\n if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) {\n following = state.input.charCodeAt(state.position + 1);\n\n if (is_WS_OR_EOL(following) ||\n withinFlowCollection && is_FLOW_INDICATOR(following)) {\n return false;\n }\n }\n\n state.kind = 'scalar';\n state.result = '';\n captureStart = captureEnd = state.position;\n hasPendingContent = false;\n\n while (ch !== 0) {\n if (ch === 0x3A/* : */) {\n following = state.input.charCodeAt(state.position + 1);\n\n if (is_WS_OR_EOL(following) ||\n withinFlowCollection && is_FLOW_INDICATOR(following)) {\n break;\n }\n\n } else if (ch === 0x23/* # */) {\n preceding = state.input.charCodeAt(state.position - 1);\n\n if (is_WS_OR_EOL(preceding)) {\n break;\n }\n\n } else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||\n withinFlowCollection && is_FLOW_INDICATOR(ch)) {\n break;\n\n } else if (is_EOL(ch)) {\n _line = state.line;\n _lineStart = state.lineStart;\n _lineIndent = state.lineIndent;\n skipSeparationSpace(state, false, -1);\n\n if (state.lineIndent >= nodeIndent) {\n hasPendingContent = true;\n ch = state.input.charCodeAt(state.position);\n continue;\n } else {\n state.position = captureEnd;\n state.line = _line;\n state.lineStart = _lineStart;\n state.lineIndent = _lineIndent;\n break;\n }\n }\n\n if (hasPendingContent) {\n captureSegment(state, captureStart, captureEnd, false);\n writeFoldedLines(state, state.line - _line);\n captureStart = captureEnd = state.position;\n hasPendingContent = false;\n }\n\n if (!is_WHITE_SPACE(ch)) {\n captureEnd = state.position + 1;\n }\n\n ch = state.input.charCodeAt(++state.position);\n }\n\n captureSegment(state, captureStart, captureEnd, false);\n\n if (state.result) {\n return true;\n }\n\n state.kind = _kind;\n state.result = _result;\n return false;\n}\n\nfunction readSingleQuotedScalar(state, nodeIndent) {\n var ch,\n captureStart, captureEnd;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch !== 0x27/* ' */) {\n return false;\n }\n\n state.kind = 'scalar';\n state.result = '';\n state.position++;\n captureStart = captureEnd = state.position;\n\n while ((ch = state.input.charCodeAt(state.position)) !== 0) {\n if (ch === 0x27/* ' */) {\n captureSegment(state, captureStart, state.position, true);\n ch = state.input.charCodeAt(++state.position);\n\n if (ch === 0x27/* ' */) {\n captureStart = state.position;\n state.position++;\n captureEnd = state.position;\n } else {\n return true;\n }\n\n } else if (is_EOL(ch)) {\n captureSegment(state, captureStart, captureEnd, true);\n writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));\n captureStart = captureEnd = state.position;\n\n } else if (state.position === state.lineStart && testDocumentSeparator(state)) {\n throwError(state, 'unexpected end of the document within a single quoted scalar');\n\n } else {\n state.position++;\n captureEnd = state.position;\n }\n }\n\n throwError(state, 'unexpected end of the stream within a single quoted scalar');\n}\n\nfunction readDoubleQuotedScalar(state, nodeIndent) {\n var captureStart,\n captureEnd,\n hexLength,\n hexResult,\n tmp,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch !== 0x22/* \" */) {\n return false;\n }\n\n state.kind = 'scalar';\n state.result = '';\n state.position++;\n captureStart = captureEnd = state.position;\n\n while ((ch = state.input.charCodeAt(state.position)) !== 0) {\n if (ch === 0x22/* \" */) {\n captureSegment(state, captureStart, state.position, true);\n state.position++;\n return true;\n\n } else if (ch === 0x5C/* \\ */) {\n captureSegment(state, captureStart, state.position, true);\n ch = state.input.charCodeAt(++state.position);\n\n if (is_EOL(ch)) {\n skipSeparationSpace(state, false, nodeIndent);\n\n // TODO: rework to inline fn with no type cast?\n } else if (ch < 256 && simpleEscapeCheck[ch]) {\n state.result += simpleEscapeMap[ch];\n state.position++;\n\n } else if ((tmp = escapedHexLen(ch)) > 0) {\n hexLength = tmp;\n hexResult = 0;\n\n for (; hexLength > 0; hexLength--) {\n ch = state.input.charCodeAt(++state.position);\n\n if ((tmp = fromHexCode(ch)) >= 0) {\n hexResult = (hexResult << 4) + tmp;\n\n } else {\n throwError(state, 'expected hexadecimal character');\n }\n }\n\n state.result += charFromCodepoint(hexResult);\n\n state.position++;\n\n } else {\n throwError(state, 'unknown escape sequence');\n }\n\n captureStart = captureEnd = state.position;\n\n } else if (is_EOL(ch)) {\n captureSegment(state, captureStart, captureEnd, true);\n writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));\n captureStart = captureEnd = state.position;\n\n } else if (state.position === state.lineStart && testDocumentSeparator(state)) {\n throwError(state, 'unexpected end of the document within a double quoted scalar');\n\n } else {\n state.position++;\n captureEnd = state.position;\n }\n }\n\n throwError(state, 'unexpected end of the stream within a double quoted scalar');\n}\n\nfunction readFlowCollection(state, nodeIndent) {\n var readNext = true,\n _line,\n _lineStart,\n _pos,\n _tag = state.tag,\n _result,\n _anchor = state.anchor,\n following,\n terminator,\n isPair,\n isExplicitPair,\n isMapping,\n overridableKeys = Object.create(null),\n keyNode,\n keyTag,\n valueNode,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch === 0x5B/* [ */) {\n terminator = 0x5D;/* ] */\n isMapping = false;\n _result = [];\n } else if (ch === 0x7B/* { */) {\n terminator = 0x7D;/* } */\n isMapping = true;\n _result = {};\n } else {\n return false;\n }\n\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = _result;\n }\n\n ch = state.input.charCodeAt(++state.position);\n\n while (ch !== 0) {\n skipSeparationSpace(state, true, nodeIndent);\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch === terminator) {\n state.position++;\n state.tag = _tag;\n state.anchor = _anchor;\n state.kind = isMapping ? 'mapping' : 'sequence';\n state.result = _result;\n return true;\n } else if (!readNext) {\n throwError(state, 'missed comma between flow collection entries');\n } else if (ch === 0x2C/* , */) {\n // \"flow collection entries can never be completely empty\", as per YAML 1.2, section 7.4\n throwError(state, \"expected the node content, but found ','\");\n }\n\n keyTag = keyNode = valueNode = null;\n isPair = isExplicitPair = false;\n\n if (ch === 0x3F/* ? */) {\n following = state.input.charCodeAt(state.position + 1);\n\n if (is_WS_OR_EOL(following)) {\n isPair = isExplicitPair = true;\n state.position++;\n skipSeparationSpace(state, true, nodeIndent);\n }\n }\n\n _line = state.line; // Save the current line.\n _lineStart = state.lineStart;\n _pos = state.position;\n composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);\n keyTag = state.tag;\n keyNode = state.result;\n skipSeparationSpace(state, true, nodeIndent);\n\n ch = state.input.charCodeAt(state.position);\n\n if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) {\n isPair = true;\n ch = state.input.charCodeAt(++state.position);\n skipSeparationSpace(state, true, nodeIndent);\n composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);\n valueNode = state.result;\n }\n\n if (isMapping) {\n storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);\n } else if (isPair) {\n _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));\n } else {\n _result.push(keyNode);\n }\n\n skipSeparationSpace(state, true, nodeIndent);\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch === 0x2C/* , */) {\n readNext = true;\n ch = state.input.charCodeAt(++state.position);\n } else {\n readNext = false;\n }\n }\n\n throwError(state, 'unexpected end of the stream within a flow collection');\n}\n\nfunction readBlockScalar(state, nodeIndent) {\n var captureStart,\n folding,\n chomping = CHOMPING_CLIP,\n didReadContent = false,\n detectedIndent = false,\n textIndent = nodeIndent,\n emptyLines = 0,\n atMoreIndented = false,\n tmp,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch === 0x7C/* | */) {\n folding = false;\n } else if (ch === 0x3E/* > */) {\n folding = true;\n } else {\n return false;\n }\n\n state.kind = 'scalar';\n state.result = '';\n\n while (ch !== 0) {\n ch = state.input.charCodeAt(++state.position);\n\n if (ch === 0x2B/* + */ || ch === 0x2D/* - */) {\n if (CHOMPING_CLIP === chomping) {\n chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP;\n } else {\n throwError(state, 'repeat of a chomping mode identifier');\n }\n\n } else if ((tmp = fromDecimalCode(ch)) >= 0) {\n if (tmp === 0) {\n throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one');\n } else if (!detectedIndent) {\n textIndent = nodeIndent + tmp - 1;\n detectedIndent = true;\n } else {\n throwError(state, 'repeat of an indentation width identifier');\n }\n\n } else {\n break;\n }\n }\n\n if (is_WHITE_SPACE(ch)) {\n do { ch = state.input.charCodeAt(++state.position); }\n while (is_WHITE_SPACE(ch));\n\n if (ch === 0x23/* # */) {\n do { ch = state.input.charCodeAt(++state.position); }\n while (!is_EOL(ch) && (ch !== 0));\n }\n }\n\n while (ch !== 0) {\n readLineBreak(state);\n state.lineIndent = 0;\n\n ch = state.input.charCodeAt(state.position);\n\n while ((!detectedIndent || state.lineIndent < textIndent) &&\n (ch === 0x20/* Space */)) {\n state.lineIndent++;\n ch = state.input.charCodeAt(++state.position);\n }\n\n if (!detectedIndent && state.lineIndent > textIndent) {\n textIndent = state.lineIndent;\n }\n\n if (is_EOL(ch)) {\n emptyLines++;\n continue;\n }\n\n // End of the scalar.\n if (state.lineIndent < textIndent) {\n\n // Perform the chomping.\n if (chomping === CHOMPING_KEEP) {\n state.result += common.repeat('\\n', didReadContent ? 1 + emptyLines : emptyLines);\n } else if (chomping === CHOMPING_CLIP) {\n if (didReadContent) { // i.e. only if the scalar is not empty.\n state.result += '\\n';\n }\n }\n\n // Break this `while` cycle and go to the funciton's epilogue.\n break;\n }\n\n // Folded style: use fancy rules to handle line breaks.\n if (folding) {\n\n // Lines starting with white space characters (more-indented lines) are not folded.\n if (is_WHITE_SPACE(ch)) {\n atMoreIndented = true;\n // except for the first content line (cf. Example 8.1)\n state.result += common.repeat('\\n', didReadContent ? 1 + emptyLines : emptyLines);\n\n // End of more-indented block.\n } else if (atMoreIndented) {\n atMoreIndented = false;\n state.result += common.repeat('\\n', emptyLines + 1);\n\n // Just one line break - perceive as the same line.\n } else if (emptyLines === 0) {\n if (didReadContent) { // i.e. only if we have already read some scalar content.\n state.result += ' ';\n }\n\n // Several line breaks - perceive as different lines.\n } else {\n state.result += common.repeat('\\n', emptyLines);\n }\n\n // Literal style: just add exact number of line breaks between content lines.\n } else {\n // Keep all line breaks except the header line break.\n state.result += common.repeat('\\n', didReadContent ? 1 + emptyLines : emptyLines);\n }\n\n didReadContent = true;\n detectedIndent = true;\n emptyLines = 0;\n captureStart = state.position;\n\n while (!is_EOL(ch) && (ch !== 0)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n captureSegment(state, captureStart, state.position, false);\n }\n\n return true;\n}\n\nfunction readBlockSequence(state, nodeIndent) {\n var _line,\n _tag = state.tag,\n _anchor = state.anchor,\n _result = [],\n following,\n detected = false,\n ch;\n\n // there is a leading tab before this token, so it can't be a block sequence/mapping;\n // it can still be flow sequence/mapping or a scalar\n if (state.firstTabInLine !== -1) return false;\n\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = _result;\n }\n\n ch = state.input.charCodeAt(state.position);\n\n while (ch !== 0) {\n if (state.firstTabInLine !== -1) {\n state.position = state.firstTabInLine;\n throwError(state, 'tab characters must not be used in indentation');\n }\n\n if (ch !== 0x2D/* - */) {\n break;\n }\n\n following = state.input.charCodeAt(state.position + 1);\n\n if (!is_WS_OR_EOL(following)) {\n break;\n }\n\n detected = true;\n state.position++;\n\n if (skipSeparationSpace(state, true, -1)) {\n if (state.lineIndent <= nodeIndent) {\n _result.push(null);\n ch = state.input.charCodeAt(state.position);\n continue;\n }\n }\n\n _line = state.line;\n composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);\n _result.push(state.result);\n skipSeparationSpace(state, true, -1);\n\n ch = state.input.charCodeAt(state.position);\n\n if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {\n throwError(state, 'bad indentation of a sequence entry');\n } else if (state.lineIndent < nodeIndent) {\n break;\n }\n }\n\n if (detected) {\n state.tag = _tag;\n state.anchor = _anchor;\n state.kind = 'sequence';\n state.result = _result;\n return true;\n }\n return false;\n}\n\nfunction readBlockMapping(state, nodeIndent, flowIndent) {\n var following,\n allowCompact,\n _line,\n _keyLine,\n _keyLineStart,\n _keyPos,\n _tag = state.tag,\n _anchor = state.anchor,\n _result = {},\n overridableKeys = Object.create(null),\n keyTag = null,\n keyNode = null,\n valueNode = null,\n atExplicitKey = false,\n detected = false,\n ch;\n\n // there is a leading tab before this token, so it can't be a block sequence/mapping;\n // it can still be flow sequence/mapping or a scalar\n if (state.firstTabInLine !== -1) return false;\n\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = _result;\n }\n\n ch = state.input.charCodeAt(state.position);\n\n while (ch !== 0) {\n if (!atExplicitKey && state.firstTabInLine !== -1) {\n state.position = state.firstTabInLine;\n throwError(state, 'tab characters must not be used in indentation');\n }\n\n following = state.input.charCodeAt(state.position + 1);\n _line = state.line; // Save the current line.\n\n //\n // Explicit notation case. There are two separate blocks:\n // first for the key (denoted by \"?\") and second for the value (denoted by \":\")\n //\n if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) {\n\n if (ch === 0x3F/* ? */) {\n if (atExplicitKey) {\n storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);\n keyTag = keyNode = valueNode = null;\n }\n\n detected = true;\n atExplicitKey = true;\n allowCompact = true;\n\n } else if (atExplicitKey) {\n // i.e. 0x3A/* : */ === character after the explicit key.\n atExplicitKey = false;\n allowCompact = true;\n\n } else {\n throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line');\n }\n\n state.position += 1;\n ch = following;\n\n //\n // Implicit notation case. Flow-style node as the key first, then \":\", and the value.\n //\n } else {\n _keyLine = state.line;\n _keyLineStart = state.lineStart;\n _keyPos = state.position;\n\n if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {\n // Neither implicit nor explicit notation.\n // Reading is done. Go to the epilogue.\n break;\n }\n\n if (state.line === _line) {\n ch = state.input.charCodeAt(state.position);\n\n while (is_WHITE_SPACE(ch)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n if (ch === 0x3A/* : */) {\n ch = state.input.charCodeAt(++state.position);\n\n if (!is_WS_OR_EOL(ch)) {\n throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping');\n }\n\n if (atExplicitKey) {\n storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);\n keyTag = keyNode = valueNode = null;\n }\n\n detected = true;\n atExplicitKey = false;\n allowCompact = false;\n keyTag = state.tag;\n keyNode = state.result;\n\n } else if (detected) {\n throwError(state, 'can not read an implicit mapping pair; a colon is missed');\n\n } else {\n state.tag = _tag;\n state.anchor = _anchor;\n return true; // Keep the result of `composeNode`.\n }\n\n } else if (detected) {\n throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key');\n\n } else {\n state.tag = _tag;\n state.anchor = _anchor;\n return true; // Keep the result of `composeNode`.\n }\n }\n\n //\n // Common reading code for both explicit and implicit notations.\n //\n if (state.line === _line || state.lineIndent > nodeIndent) {\n if (atExplicitKey) {\n _keyLine = state.line;\n _keyLineStart = state.lineStart;\n _keyPos = state.position;\n }\n\n if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {\n if (atExplicitKey) {\n keyNode = state.result;\n } else {\n valueNode = state.result;\n }\n }\n\n if (!atExplicitKey) {\n storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);\n keyTag = keyNode = valueNode = null;\n }\n\n skipSeparationSpace(state, true, -1);\n ch = state.input.charCodeAt(state.position);\n }\n\n if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {\n throwError(state, 'bad indentation of a mapping entry');\n } else if (state.lineIndent < nodeIndent) {\n break;\n }\n }\n\n //\n // Epilogue.\n //\n\n // Special case: last mapping's node contains only the key in explicit notation.\n if (atExplicitKey) {\n storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);\n }\n\n // Expose the resulting mapping.\n if (detected) {\n state.tag = _tag;\n state.anchor = _anchor;\n state.kind = 'mapping';\n state.result = _result;\n }\n\n return detected;\n}\n\nfunction readTagProperty(state) {\n var _position,\n isVerbatim = false,\n isNamed = false,\n tagHandle,\n tagName,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch !== 0x21/* ! */) return false;\n\n if (state.tag !== null) {\n throwError(state, 'duplication of a tag property');\n }\n\n ch = state.input.charCodeAt(++state.position);\n\n if (ch === 0x3C/* < */) {\n isVerbatim = true;\n ch = state.input.charCodeAt(++state.position);\n\n } else if (ch === 0x21/* ! */) {\n isNamed = true;\n tagHandle = '!!';\n ch = state.input.charCodeAt(++state.position);\n\n } else {\n tagHandle = '!';\n }\n\n _position = state.position;\n\n if (isVerbatim) {\n do { ch = state.input.charCodeAt(++state.position); }\n while (ch !== 0 && ch !== 0x3E/* > */);\n\n if (state.position < state.length) {\n tagName = state.input.slice(_position, state.position);\n ch = state.input.charCodeAt(++state.position);\n } else {\n throwError(state, 'unexpected end of the stream within a verbatim tag');\n }\n } else {\n while (ch !== 0 && !is_WS_OR_EOL(ch)) {\n\n if (ch === 0x21/* ! */) {\n if (!isNamed) {\n tagHandle = state.input.slice(_position - 1, state.position + 1);\n\n if (!PATTERN_TAG_HANDLE.test(tagHandle)) {\n throwError(state, 'named tag handle cannot contain such characters');\n }\n\n isNamed = true;\n _position = state.position + 1;\n } else {\n throwError(state, 'tag suffix cannot contain exclamation marks');\n }\n }\n\n ch = state.input.charCodeAt(++state.position);\n }\n\n tagName = state.input.slice(_position, state.position);\n\n if (PATTERN_FLOW_INDICATORS.test(tagName)) {\n throwError(state, 'tag suffix cannot contain flow indicator characters');\n }\n }\n\n if (tagName && !PATTERN_TAG_URI.test(tagName)) {\n throwError(state, 'tag name cannot contain such characters: ' + tagName);\n }\n\n try {\n tagName = decodeURIComponent(tagName);\n } catch (err) {\n throwError(state, 'tag name is malformed: ' + tagName);\n }\n\n if (isVerbatim) {\n state.tag = tagName;\n\n } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {\n state.tag = state.tagMap[tagHandle] + tagName;\n\n } else if (tagHandle === '!') {\n state.tag = '!' + tagName;\n\n } else if (tagHandle === '!!') {\n state.tag = 'tag:yaml.org,2002:' + tagName;\n\n } else {\n throwError(state, 'undeclared tag handle \"' + tagHandle + '\"');\n }\n\n return true;\n}\n\nfunction readAnchorProperty(state) {\n var _position,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch !== 0x26/* & */) return false;\n\n if (state.anchor !== null) {\n throwError(state, 'duplication of an anchor property');\n }\n\n ch = state.input.charCodeAt(++state.position);\n _position = state.position;\n\n while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n if (state.position === _position) {\n throwError(state, 'name of an anchor node must contain at least one character');\n }\n\n state.anchor = state.input.slice(_position, state.position);\n return true;\n}\n\nfunction readAlias(state) {\n var _position, alias,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch !== 0x2A/* * */) return false;\n\n ch = state.input.charCodeAt(++state.position);\n _position = state.position;\n\n while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n if (state.position === _position) {\n throwError(state, 'name of an alias node must contain at least one character');\n }\n\n alias = state.input.slice(_position, state.position);\n\n if (!_hasOwnProperty.call(state.anchorMap, alias)) {\n throwError(state, 'unidentified alias \"' + alias + '\"');\n }\n\n state.result = state.anchorMap[alias];\n skipSeparationSpace(state, true, -1);\n return true;\n}\n\nfunction composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {\n var allowBlockStyles,\n allowBlockScalars,\n allowBlockCollections,\n indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) {\n indentStatus = 1;\n } else if (state.lineIndent === parentIndent) {\n indentStatus = 0;\n } else if (state.lineIndent < parentIndent) {\n indentStatus = -1;\n }\n }\n }\n\n if (indentStatus === 1) {\n while (readTagProperty(state) || readAnchorProperty(state)) {\n if (skipSeparationSpace(state, true, -1)) {\n atNewLine = true;\n allowBlockCollections = allowBlockStyles;\n\n if (state.lineIndent > parentIndent) {\n indentStatus = 1;\n } else if (state.lineIndent === parentIndent) {\n indentStatus = 0;\n } else if (state.lineIndent < parentIndent) {\n indentStatus = -1;\n }\n } else {\n allowBlockCollections = false;\n }\n }\n }\n\n if (allowBlockCollections) {\n allowBlockCollections = atNewLine || allowCompact;\n }\n\n if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {\n if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {\n flowIndent = parentIndent;\n } else {\n flowIndent = parentIndent + 1;\n }\n\n blockIndent = state.position - state.lineStart;\n\n if (indentStatus === 1) {\n if (allowBlockCollections &&\n (readBlockSequence(state, blockIndent) ||\n readBlockMapping(state, blockIndent, flowIndent)) ||\n readFlowCollection(state, flowIndent)) {\n hasContent = true;\n } else {\n if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||\n readSingleQuotedScalar(state, flowIndent) ||\n readDoubleQuotedScalar(state, flowIndent)) {\n hasContent = true;\n\n } else if (readAlias(state)) {\n hasContent = true;\n\n if (state.tag !== null || state.anchor !== null) {\n throwError(state, 'alias node should not have any properties');\n }\n\n } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {\n hasContent = true;\n\n if (state.tag === null) {\n state.tag = '?';\n }\n }\n\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = state.result;\n }\n }\n } else if (indentStatus === 0) {\n // Special case: block sequences are allowed to have same indentation level as the parent.\n // http://www.yaml.org/spec/1.2/spec.html#id2799784\n hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);\n }\n }\n\n if (state.tag === null) {\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = state.result;\n }\n\n } else if (state.tag === '?') {\n // Implicit resolving is not allowed for non-scalar types, and '?'\n // non-specific tag is only automatically assigned to plain scalars.\n //\n // We only need to check kind conformity in case user explicitly assigns '?'\n // tag, for example like this: \"! [0]\"\n //\n if (state.result !== null && state.kind !== 'scalar') {\n throwError(state, 'unacceptable node kind for ! tag; it should be \"scalar\", not \"' + state.kind + '\"');\n }\n\n for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {\n type = state.implicitTypes[typeIndex];\n\n if (type.resolve(state.result)) { // `state.result` updated in resolver if matched\n state.result = type.construct(state.result);\n state.tag = type.tag;\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = state.result;\n }\n break;\n }\n }\n } else if (state.tag !== '!') {\n if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) {\n type = state.typeMap[state.kind || 'fallback'][state.tag];\n } else {\n // looking for multi type\n type = null;\n typeList = state.typeMap.multi[state.kind || 'fallback'];\n\n for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {\n if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {\n type = typeList[typeIndex];\n break;\n }\n }\n }\n\n if (!type) {\n throwError(state, 'unknown tag !<' + state.tag + '>');\n }\n\n if (state.result !== null && type.kind !== state.kind) {\n throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be \"' + type.kind + '\", not \"' + state.kind + '\"');\n }\n\n if (!type.resolve(state.result, state.tag)) { // `state.result` updated in resolver if matched\n throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag');\n } else {\n state.result = type.construct(state.result, state.tag);\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = state.result;\n }\n }\n }\n\n if (state.listener !== null) {\n state.listener('close', state);\n }\n return state.tag !== null || state.anchor !== null || hasContent;\n}\n\nfunction readDocument(state) {\n var documentStart = state.position,\n _position,\n directiveName,\n directiveArgs,\n hasDirectives = false,\n ch;\n\n state.version = null;\n state.checkLineBreaks = state.legacy;\n state.tagMap = Object.create(null);\n state.anchorMap = Object.create(null);\n\n while ((ch = state.input.charCodeAt(state.position)) !== 0) {\n skipSeparationSpace(state, true, -1);\n\n ch = state.input.charCodeAt(state.position);\n\n if (state.lineIndent > 0 || ch !== 0x25/* % */) {\n break;\n }\n\n hasDirectives = true;\n ch = state.input.charCodeAt(++state.position);\n _position = state.position;\n\n while (ch !== 0 && !is_WS_OR_EOL(ch)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n directiveName = state.input.slice(_position, state.position);\n directiveArgs = [];\n\n if (directiveName.length < 1) {\n throwError(state, 'directive name must not be less than one character in length');\n }\n\n while (ch !== 0) {\n while (is_WHITE_SPACE(ch)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n if (ch === 0x23/* # */) {\n do { ch = state.input.charCodeAt(++state.position); }\n while (ch !== 0 && !is_EOL(ch));\n break;\n }\n\n if (is_EOL(ch)) break;\n\n _position = state.position;\n\n while (ch !== 0 && !is_WS_OR_EOL(ch)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n directiveArgs.push(state.input.slice(_position, state.position));\n }\n\n if (ch !== 0) readLineBreak(state);\n\n if (_hasOwnProperty.call(directiveHandlers, directiveName)) {\n directiveHandlers[directiveName](state, directiveName, directiveArgs);\n } else {\n throwWarning(state, 'unknown document directive \"' + directiveName + '\"');\n }\n }\n\n skipSeparationSpace(state, true, -1);\n\n if (state.lineIndent === 0 &&\n state.input.charCodeAt(state.position) === 0x2D/* - */ &&\n state.input.charCodeAt(state.position + 1) === 0x2D/* - */ &&\n state.input.charCodeAt(state.position + 2) === 0x2D/* - */) {\n state.position += 3;\n skipSeparationSpace(state, true, -1);\n\n } else if (hasDirectives) {\n throwError(state, 'directives end mark is expected');\n }\n\n composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);\n skipSeparationSpace(state, true, -1);\n\n if (state.checkLineBreaks &&\n PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {\n throwWarning(state, 'non-ASCII line breaks are interpreted as content');\n }\n\n state.documents.push(state.result);\n\n if (state.position === state.lineStart && testDocumentSeparator(state)) {\n\n if (state.input.charCodeAt(state.position) === 0x2E/* . */) {\n state.position += 3;\n skipSeparationSpace(state, true, -1);\n }\n return;\n }\n\n if (state.position < (state.length - 1)) {\n throwError(state, 'end of the stream or a document separator is expected');\n } else {\n return;\n }\n}\n\n\nfunction loadDocuments(input, options) {\n input = String(input);\n options = options || {};\n\n if (input.length !== 0) {\n\n // Add tailing `\\n` if not exists\n if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ &&\n input.charCodeAt(input.length - 1) !== 0x0D/* CR */) {\n input += '\\n';\n }\n\n // Strip BOM\n if (input.charCodeAt(0) === 0xFEFF) {\n input = input.slice(1);\n }\n }\n\n var state = new State(input, options);\n\n var nullpos = input.indexOf('\\0');\n\n if (nullpos !== -1) {\n state.position = nullpos;\n throwError(state, 'null byte is not allowed in input');\n }\n\n // Use 0 as string terminator. That significantly simplifies bounds check.\n state.input += '\\0';\n\n while (state.input.charCodeAt(state.position) === 0x20/* Space */) {\n state.lineIndent += 1;\n state.position += 1;\n }\n\n while (state.position < (state.length - 1)) {\n readDocument(state);\n }\n\n return state.documents;\n}\n\n\nfunction loadAll(input, iterator, options) {\n if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') {\n options = iterator;\n iterator = null;\n }\n\n var documents = loadDocuments(input, options);\n\n if (typeof iterator !== 'function') {\n return documents;\n }\n\n for (var index = 0, length = documents.length; index < length; index += 1) {\n iterator(documents[index]);\n }\n}\n\n\nfunction load(input, options) {\n var documents = loadDocuments(input, options);\n\n if (documents.length === 0) {\n /*eslint-disable no-undefined*/\n return undefined;\n } else if (documents.length === 1) {\n return documents[0];\n }\n throw new YAMLException('expected a single document in the stream, but found more');\n}\n\n\nmodule.exports.loadAll = loadAll;\nmodule.exports.load = load;\n","'use strict';\n\n/*eslint-disable max-len*/\n\nvar YAMLException = require('./exception');\nvar Type = require('./type');\n\n\nfunction compileList(schema, name, result) {\n var exclude = [];\n\n schema[name].forEach(function (currentType) {\n result.forEach(function (previousType, previousIndex) {\n if (previousType.tag === currentType.tag &&\n previousType.kind === currentType.kind &&\n previousType.multi === currentType.multi) {\n\n exclude.push(previousIndex);\n }\n });\n\n result.push(currentType);\n });\n\n return result.filter(function (type, index) {\n return exclude.indexOf(index) === -1;\n });\n}\n\n\nfunction compileMap(/* lists... */) {\n var result = {\n scalar: {},\n sequence: {},\n mapping: {},\n fallback: {},\n multi: {\n scalar: [],\n sequence: [],\n mapping: [],\n fallback: []\n }\n }, index, length;\n\n function collectType(type) {\n if (type.multi) {\n result.multi[type.kind].push(type);\n result.multi['fallback'].push(type);\n } else {\n result[type.kind][type.tag] = result['fallback'][type.tag] = type;\n }\n }\n\n for (index = 0, length = arguments.length; index < length; index += 1) {\n arguments[index].forEach(collectType);\n }\n return result;\n}\n\n\nfunction Schema(definition) {\n return this.extend(definition);\n}\n\n\nSchema.prototype.extend = function extend(definition) {\n var implicit = [];\n var explicit = [];\n\n if (definition instanceof Type) {\n // Schema.extend(type)\n explicit.push(definition);\n\n } else if (Array.isArray(definition)) {\n // Schema.extend([ type1, type2, ... ])\n explicit = explicit.concat(definition);\n\n } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {\n // Schema.extend({ explicit: [ type1, type2, ... ], implicit: [ type1, type2, ... ] })\n if (definition.implicit) implicit = implicit.concat(definition.implicit);\n if (definition.explicit) explicit = explicit.concat(definition.explicit);\n\n } else {\n throw new YAMLException('Schema.extend argument should be a Type, [ Type ], ' +\n 'or a schema definition ({ implicit: [...], explicit: [...] })');\n }\n\n implicit.forEach(function (type) {\n if (!(type instanceof Type)) {\n throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.');\n }\n\n if (type.loadKind && type.loadKind !== 'scalar') {\n throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.');\n }\n\n if (type.multi) {\n throw new YAMLException('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.');\n }\n });\n\n explicit.forEach(function (type) {\n if (!(type instanceof Type)) {\n throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.');\n }\n });\n\n var result = Object.create(Schema.prototype);\n\n result.implicit = (this.implicit || []).concat(implicit);\n result.explicit = (this.explicit || []).concat(explicit);\n\n result.compiledImplicit = compileList(result, 'implicit', []);\n result.compiledExplicit = compileList(result, 'explicit', []);\n result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);\n\n return result;\n};\n\n\nmodule.exports = Schema;\n","// Standard YAML's Core schema.\n// http://www.yaml.org/spec/1.2/spec.html#id2804923\n//\n// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.\n// So, Core schema has no distinctions from JSON schema is JS-YAML.\n\n\n'use strict';\n\n\nmodule.exports = require('./json');\n","// JS-YAML's default schema for `safeLoad` function.\n// It is not described in the YAML specification.\n//\n// This schema is based on standard YAML's Core schema and includes most of\n// extra types described at YAML tag repository. (http://yaml.org/type/)\n\n\n'use strict';\n\n\nmodule.exports = require('./core').extend({\n implicit: [\n require('../type/timestamp'),\n require('../type/merge')\n ],\n explicit: [\n require('../type/binary'),\n require('../type/omap'),\n require('../type/pairs'),\n require('../type/set')\n ]\n});\n","// Standard YAML's Failsafe schema.\n// http://www.yaml.org/spec/1.2/spec.html#id2802346\n\n\n'use strict';\n\n\nvar Schema = require('../schema');\n\n\nmodule.exports = new Schema({\n explicit: [\n require('../type/str'),\n require('../type/seq'),\n require('../type/map')\n ]\n});\n","// Standard YAML's JSON schema.\n// http://www.yaml.org/spec/1.2/spec.html#id2803231\n//\n// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.\n// So, this schema is not such strict as defined in the YAML specification.\n// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc.\n\n\n'use strict';\n\n\nmodule.exports = require('./failsafe').extend({\n implicit: [\n require('../type/null'),\n require('../type/bool'),\n require('../type/int'),\n require('../type/float')\n ]\n});\n","'use strict';\n\n\nvar common = require('./common');\n\n\n// get snippet for a single line, respecting maxLength\nfunction getLine(buffer, lineStart, lineEnd, position, maxLineLength) {\n var head = '';\n var tail = '';\n var maxHalfLength = Math.floor(maxLineLength / 2) - 1;\n\n if (position - lineStart > maxHalfLength) {\n head = ' ... ';\n lineStart = position - maxHalfLength + head.length;\n }\n\n if (lineEnd - position > maxHalfLength) {\n tail = ' ...';\n lineEnd = position + maxHalfLength - tail.length;\n }\n\n return {\n str: head + buffer.slice(lineStart, lineEnd).replace(/\\t/g, '→') + tail,\n pos: position - lineStart + head.length // relative position\n };\n}\n\n\nfunction padStart(string, max) {\n return common.repeat(' ', max - string.length) + string;\n}\n\n\nfunction makeSnippet(mark, options) {\n options = Object.create(options || null);\n\n if (!mark.buffer) return null;\n\n if (!options.maxLength) options.maxLength = 79;\n if (typeof options.indent !== 'number') options.indent = 1;\n if (typeof options.linesBefore !== 'number') options.linesBefore = 3;\n if (typeof options.linesAfter !== 'number') options.linesAfter = 2;\n\n var re = /\\r?\\n|\\r|\\0/g;\n var lineStarts = [ 0 ];\n var lineEnds = [];\n var match;\n var foundLineNo = -1;\n\n while ((match = re.exec(mark.buffer))) {\n lineEnds.push(match.index);\n lineStarts.push(match.index + match[0].length);\n\n if (mark.position <= match.index && foundLineNo < 0) {\n foundLineNo = lineStarts.length - 2;\n }\n }\n\n if (foundLineNo < 0) foundLineNo = lineStarts.length - 1;\n\n var result = '', i, line;\n var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length;\n var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3);\n\n for (i = 1; i <= options.linesBefore; i++) {\n if (foundLineNo - i < 0) break;\n line = getLine(\n mark.buffer,\n lineStarts[foundLineNo - i],\n lineEnds[foundLineNo - i],\n mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]),\n maxLineLength\n );\n result = common.repeat(' ', options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) +\n ' | ' + line.str + '\\n' + result;\n }\n\n line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);\n result += common.repeat(' ', options.indent) + padStart((mark.line + 1).toString(), lineNoLength) +\n ' | ' + line.str + '\\n';\n result += common.repeat('-', options.indent + lineNoLength + 3 + line.pos) + '^' + '\\n';\n\n for (i = 1; i <= options.linesAfter; i++) {\n if (foundLineNo + i >= lineEnds.length) break;\n line = getLine(\n mark.buffer,\n lineStarts[foundLineNo + i],\n lineEnds[foundLineNo + i],\n mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]),\n maxLineLength\n );\n result += common.repeat(' ', options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) +\n ' | ' + line.str + '\\n';\n }\n\n return result.replace(/\\n$/, '');\n}\n\n\nmodule.exports = makeSnippet;\n","'use strict';\n\nvar YAMLException = require('./exception');\n\nvar TYPE_CONSTRUCTOR_OPTIONS = [\n 'kind',\n 'multi',\n 'resolve',\n 'construct',\n 'instanceOf',\n 'predicate',\n 'represent',\n 'representName',\n 'defaultStyle',\n 'styleAliases'\n];\n\nvar YAML_NODE_KINDS = [\n 'scalar',\n 'sequence',\n 'mapping'\n];\n\nfunction compileStyleAliases(map) {\n var result = {};\n\n if (map !== null) {\n Object.keys(map).forEach(function (style) {\n map[style].forEach(function (alias) {\n result[String(alias)] = style;\n });\n });\n }\n\n return result;\n}\n\nfunction Type(tag, options) {\n options = options || {};\n\n Object.keys(options).forEach(function (name) {\n if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {\n throw new YAMLException('Unknown option \"' + name + '\" is met in definition of \"' + tag + '\" YAML type.');\n }\n });\n\n // TODO: Add tag format check.\n this.tag = tag;\n this.kind = options['kind'] || null;\n this.resolve = options['resolve'] || function () { return true; };\n this.construct = options['construct'] || function (data) { return data; };\n this.instanceOf = options['instanceOf'] || null;\n this.predicate = options['predicate'] || null;\n this.represent = options['represent'] || null;\n this.representName = options['representName'] || null;\n this.defaultStyle = options['defaultStyle'] || null;\n this.multi = options['multi'] || false;\n this.styleAliases = compileStyleAliases(options['styleAliases'] || null);\n\n if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {\n throw new YAMLException('Unknown kind \"' + this.kind + '\" is specified for \"' + tag + '\" YAML type.');\n }\n}\n\nmodule.exports = Type;\n","'use strict';\n\n/*eslint-disable no-bitwise*/\n\n\nvar Type = require('../type');\n\n\n// [ 64, 65, 66 ] -> [ padding, CR, LF ]\nvar BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\\n\\r';\n\n\nfunction resolveYamlBinary(data) {\n if (data === null) return false;\n\n var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;\n\n // Convert one by one.\n for (idx = 0; idx < max; idx++) {\n code = map.indexOf(data.charAt(idx));\n\n // Skip CR/LF\n if (code > 64) continue;\n\n // Fail on illegal characters\n if (code < 0) return false;\n\n bitlen += 6;\n }\n\n // If there are any bits left, source was corrupted\n return (bitlen % 8) === 0;\n}\n\nfunction constructYamlBinary(data) {\n var idx, tailbits,\n input = data.replace(/[\\r\\n=]/g, ''), // remove CR/LF & padding to simplify scan\n max = input.length,\n map = BASE64_MAP,\n bits = 0,\n result = [];\n\n // Collect by 6*4 bits (3 bytes)\n\n for (idx = 0; idx < max; idx++) {\n if ((idx % 4 === 0) && idx) {\n result.push((bits >> 16) & 0xFF);\n result.push((bits >> 8) & 0xFF);\n result.push(bits & 0xFF);\n }\n\n bits = (bits << 6) | map.indexOf(input.charAt(idx));\n }\n\n // Dump tail\n\n tailbits = (max % 4) * 6;\n\n if (tailbits === 0) {\n result.push((bits >> 16) & 0xFF);\n result.push((bits >> 8) & 0xFF);\n result.push(bits & 0xFF);\n } else if (tailbits === 18) {\n result.push((bits >> 10) & 0xFF);\n result.push((bits >> 2) & 0xFF);\n } else if (tailbits === 12) {\n result.push((bits >> 4) & 0xFF);\n }\n\n return new Uint8Array(result);\n}\n\nfunction representYamlBinary(object /*, style*/) {\n var result = '', bits = 0, idx, tail,\n max = object.length,\n map = BASE64_MAP;\n\n // Convert every three bytes to 4 ASCII characters.\n\n for (idx = 0; idx < max; idx++) {\n if ((idx % 3 === 0) && idx) {\n result += map[(bits >> 18) & 0x3F];\n result += map[(bits >> 12) & 0x3F];\n result += map[(bits >> 6) & 0x3F];\n result += map[bits & 0x3F];\n }\n\n bits = (bits << 8) + object[idx];\n }\n\n // Dump tail\n\n tail = max % 3;\n\n if (tail === 0) {\n result += map[(bits >> 18) & 0x3F];\n result += map[(bits >> 12) & 0x3F];\n result += map[(bits >> 6) & 0x3F];\n result += map[bits & 0x3F];\n } else if (tail === 2) {\n result += map[(bits >> 10) & 0x3F];\n result += map[(bits >> 4) & 0x3F];\n result += map[(bits << 2) & 0x3F];\n result += map[64];\n } else if (tail === 1) {\n result += map[(bits >> 2) & 0x3F];\n result += map[(bits << 4) & 0x3F];\n result += map[64];\n result += map[64];\n }\n\n return result;\n}\n\nfunction isBinary(obj) {\n return Object.prototype.toString.call(obj) === '[object Uint8Array]';\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:binary', {\n kind: 'scalar',\n resolve: resolveYamlBinary,\n construct: constructYamlBinary,\n predicate: isBinary,\n represent: representYamlBinary\n});\n","'use strict';\n\nvar Type = require('../type');\n\nfunction resolveYamlBoolean(data) {\n if (data === null) return false;\n\n var max = data.length;\n\n return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||\n (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'));\n}\n\nfunction constructYamlBoolean(data) {\n return data === 'true' ||\n data === 'True' ||\n data === 'TRUE';\n}\n\nfunction isBoolean(object) {\n return Object.prototype.toString.call(object) === '[object Boolean]';\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:bool', {\n kind: 'scalar',\n resolve: resolveYamlBoolean,\n construct: constructYamlBoolean,\n predicate: isBoolean,\n represent: {\n lowercase: function (object) { return object ? 'true' : 'false'; },\n uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; },\n camelcase: function (object) { return object ? 'True' : 'False'; }\n },\n defaultStyle: 'lowercase'\n});\n","'use strict';\n\nvar common = require('../common');\nvar Type = require('../type');\n\nvar YAML_FLOAT_PATTERN = new RegExp(\n // 2.5e4, 2.5 and integers\n '^(?:[-+]?(?:[0-9][0-9_]*)(?:\\\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' +\n // .2e4, .2\n // special case, seems not from spec\n '|\\\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' +\n // .inf\n '|[-+]?\\\\.(?:inf|Inf|INF)' +\n // .nan\n '|\\\\.(?:nan|NaN|NAN))$');\n\nfunction resolveYamlFloat(data) {\n if (data === null) return false;\n\n if (!YAML_FLOAT_PATTERN.test(data) ||\n // Quick hack to not allow integers end with `_`\n // Probably should update regexp & check speed\n data[data.length - 1] === '_') {\n return false;\n }\n\n return true;\n}\n\nfunction constructYamlFloat(data) {\n var value, sign;\n\n value = data.replace(/_/g, '').toLowerCase();\n sign = value[0] === '-' ? -1 : 1;\n\n if ('+-'.indexOf(value[0]) >= 0) {\n value = value.slice(1);\n }\n\n if (value === '.inf') {\n return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;\n\n } else if (value === '.nan') {\n return NaN;\n }\n return sign * parseFloat(value, 10);\n}\n\n\nvar SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;\n\nfunction representYamlFloat(object, style) {\n var res;\n\n if (isNaN(object)) {\n switch (style) {\n case 'lowercase': return '.nan';\n case 'uppercase': return '.NAN';\n case 'camelcase': return '.NaN';\n }\n } else if (Number.POSITIVE_INFINITY === object) {\n switch (style) {\n case 'lowercase': return '.inf';\n case 'uppercase': return '.INF';\n case 'camelcase': return '.Inf';\n }\n } else if (Number.NEGATIVE_INFINITY === object) {\n switch (style) {\n case 'lowercase': return '-.inf';\n case 'uppercase': return '-.INF';\n case 'camelcase': return '-.Inf';\n }\n } else if (common.isNegativeZero(object)) {\n return '-0.0';\n }\n\n res = object.toString(10);\n\n // JS stringifier can build scientific format without dots: 5e-100,\n // while YAML requres dot: 5.e-100. Fix it with simple hack\n\n return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res;\n}\n\nfunction isFloat(object) {\n return (Object.prototype.toString.call(object) === '[object Number]') &&\n (object % 1 !== 0 || common.isNegativeZero(object));\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:float', {\n kind: 'scalar',\n resolve: resolveYamlFloat,\n construct: constructYamlFloat,\n predicate: isFloat,\n represent: representYamlFloat,\n defaultStyle: 'lowercase'\n});\n","'use strict';\n\nvar common = require('../common');\nvar Type = require('../type');\n\nfunction isHexCode(c) {\n return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) ||\n ((0x41/* A */ <= c) && (c <= 0x46/* F */)) ||\n ((0x61/* a */ <= c) && (c <= 0x66/* f */));\n}\n\nfunction isOctCode(c) {\n return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */));\n}\n\nfunction isDecCode(c) {\n return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */));\n}\n\nfunction resolveYamlInteger(data) {\n if (data === null) return false;\n\n var max = data.length,\n index = 0,\n hasDigits = false,\n ch;\n\n if (!max) return false;\n\n ch = data[index];\n\n // sign\n if (ch === '-' || ch === '+') {\n ch = data[++index];\n }\n\n if (ch === '0') {\n // 0\n if (index + 1 === max) return true;\n ch = data[++index];\n\n // base 2, base 8, base 16\n\n if (ch === 'b') {\n // base 2\n index++;\n\n for (; index < max; index++) {\n ch = data[index];\n if (ch === '_') continue;\n if (ch !== '0' && ch !== '1') return false;\n hasDigits = true;\n }\n return hasDigits && ch !== '_';\n }\n\n\n if (ch === 'x') {\n // base 16\n index++;\n\n for (; index < max; index++) {\n ch = data[index];\n if (ch === '_') continue;\n if (!isHexCode(data.charCodeAt(index))) return false;\n hasDigits = true;\n }\n return hasDigits && ch !== '_';\n }\n\n\n if (ch === 'o') {\n // base 8\n index++;\n\n for (; index < max; index++) {\n ch = data[index];\n if (ch === '_') continue;\n if (!isOctCode(data.charCodeAt(index))) return false;\n hasDigits = true;\n }\n return hasDigits && ch !== '_';\n }\n }\n\n // base 10 (except 0)\n\n // value should not start with `_`;\n if (ch === '_') return false;\n\n for (; index < max; index++) {\n ch = data[index];\n if (ch === '_') continue;\n if (!isDecCode(data.charCodeAt(index))) {\n return false;\n }\n hasDigits = true;\n }\n\n // Should have digits and should not end with `_`\n if (!hasDigits || ch === '_') return false;\n\n return true;\n}\n\nfunction constructYamlInteger(data) {\n var value = data, sign = 1, ch;\n\n if (value.indexOf('_') !== -1) {\n value = value.replace(/_/g, '');\n }\n\n ch = value[0];\n\n if (ch === '-' || ch === '+') {\n if (ch === '-') sign = -1;\n value = value.slice(1);\n ch = value[0];\n }\n\n if (value === '0') return 0;\n\n if (ch === '0') {\n if (value[1] === 'b') return sign * parseInt(value.slice(2), 2);\n if (value[1] === 'x') return sign * parseInt(value.slice(2), 16);\n if (value[1] === 'o') return sign * parseInt(value.slice(2), 8);\n }\n\n return sign * parseInt(value, 10);\n}\n\nfunction isInteger(object) {\n return (Object.prototype.toString.call(object)) === '[object Number]' &&\n (object % 1 === 0 && !common.isNegativeZero(object));\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:int', {\n kind: 'scalar',\n resolve: resolveYamlInteger,\n construct: constructYamlInteger,\n predicate: isInteger,\n represent: {\n binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); },\n octal: function (obj) { return obj >= 0 ? '0o' + obj.toString(8) : '-0o' + obj.toString(8).slice(1); },\n decimal: function (obj) { return obj.toString(10); },\n /* eslint-disable max-len */\n hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); }\n },\n defaultStyle: 'decimal',\n styleAliases: {\n binary: [ 2, 'bin' ],\n octal: [ 8, 'oct' ],\n decimal: [ 10, 'dec' ],\n hexadecimal: [ 16, 'hex' ]\n }\n});\n","'use strict';\n\nvar Type = require('../type');\n\nmodule.exports = new Type('tag:yaml.org,2002:map', {\n kind: 'mapping',\n construct: function (data) { return data !== null ? data : {}; }\n});\n","'use strict';\n\nvar Type = require('../type');\n\nfunction resolveYamlMerge(data) {\n return data === '<<' || data === null;\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:merge', {\n kind: 'scalar',\n resolve: resolveYamlMerge\n});\n","'use strict';\n\nvar Type = require('../type');\n\nfunction resolveYamlNull(data) {\n if (data === null) return true;\n\n var max = data.length;\n\n return (max === 1 && data === '~') ||\n (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL'));\n}\n\nfunction constructYamlNull() {\n return null;\n}\n\nfunction isNull(object) {\n return object === null;\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:null', {\n kind: 'scalar',\n resolve: resolveYamlNull,\n construct: constructYamlNull,\n predicate: isNull,\n represent: {\n canonical: function () { return '~'; },\n lowercase: function () { return 'null'; },\n uppercase: function () { return 'NULL'; },\n camelcase: function () { return 'Null'; },\n empty: function () { return ''; }\n },\n defaultStyle: 'lowercase'\n});\n","'use strict';\n\nvar Type = require('../type');\n\nvar _hasOwnProperty = Object.prototype.hasOwnProperty;\nvar _toString = Object.prototype.toString;\n\nfunction resolveYamlOmap(data) {\n if (data === null) return true;\n\n var objectKeys = [], index, length, pair, pairKey, pairHasKey,\n object = data;\n\n for (index = 0, length = object.length; index < length; index += 1) {\n pair = object[index];\n pairHasKey = false;\n\n if (_toString.call(pair) !== '[object Object]') return false;\n\n for (pairKey in pair) {\n if (_hasOwnProperty.call(pair, pairKey)) {\n if (!pairHasKey) pairHasKey = true;\n else return false;\n }\n }\n\n if (!pairHasKey) return false;\n\n if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);\n else return false;\n }\n\n return true;\n}\n\nfunction constructYamlOmap(data) {\n return data !== null ? data : [];\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:omap', {\n kind: 'sequence',\n resolve: resolveYamlOmap,\n construct: constructYamlOmap\n});\n","'use strict';\n\nvar Type = require('../type');\n\nvar _toString = Object.prototype.toString;\n\nfunction resolveYamlPairs(data) {\n if (data === null) return true;\n\n var index, length, pair, keys, result,\n object = data;\n\n result = new Array(object.length);\n\n for (index = 0, length = object.length; index < length; index += 1) {\n pair = object[index];\n\n if (_toString.call(pair) !== '[object Object]') return false;\n\n keys = Object.keys(pair);\n\n if (keys.length !== 1) return false;\n\n result[index] = [ keys[0], pair[keys[0]] ];\n }\n\n return true;\n}\n\nfunction constructYamlPairs(data) {\n if (data === null) return [];\n\n var index, length, pair, keys, result,\n object = data;\n\n result = new Array(object.length);\n\n for (index = 0, length = object.length; index < length; index += 1) {\n pair = object[index];\n\n keys = Object.keys(pair);\n\n result[index] = [ keys[0], pair[keys[0]] ];\n }\n\n return result;\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:pairs', {\n kind: 'sequence',\n resolve: resolveYamlPairs,\n construct: constructYamlPairs\n});\n","'use strict';\n\nvar Type = require('../type');\n\nmodule.exports = new Type('tag:yaml.org,2002:seq', {\n kind: 'sequence',\n construct: function (data) { return data !== null ? data : []; }\n});\n","'use strict';\n\nvar Type = require('../type');\n\nvar _hasOwnProperty = Object.prototype.hasOwnProperty;\n\nfunction resolveYamlSet(data) {\n if (data === null) return true;\n\n var key, object = data;\n\n for (key in object) {\n if (_hasOwnProperty.call(object, key)) {\n if (object[key] !== null) return false;\n }\n }\n\n return true;\n}\n\nfunction constructYamlSet(data) {\n return data !== null ? data : {};\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:set', {\n kind: 'mapping',\n resolve: resolveYamlSet,\n construct: constructYamlSet\n});\n","'use strict';\n\nvar Type = require('../type');\n\nmodule.exports = new Type('tag:yaml.org,2002:str', {\n kind: 'scalar',\n construct: function (data) { return data !== null ? data : ''; }\n});\n","'use strict';\n\nvar Type = require('../type');\n\nvar YAML_DATE_REGEXP = new RegExp(\n '^([0-9][0-9][0-9][0-9])' + // [1] year\n '-([0-9][0-9])' + // [2] month\n '-([0-9][0-9])$'); // [3] day\n\nvar YAML_TIMESTAMP_REGEXP = new RegExp(\n '^([0-9][0-9][0-9][0-9])' + // [1] year\n '-([0-9][0-9]?)' + // [2] month\n '-([0-9][0-9]?)' + // [3] day\n '(?:[Tt]|[ \\\\t]+)' + // ...\n '([0-9][0-9]?)' + // [4] hour\n ':([0-9][0-9])' + // [5] minute\n ':([0-9][0-9])' + // [6] second\n '(?:\\\\.([0-9]*))?' + // [7] fraction\n '(?:[ \\\\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour\n '(?::([0-9][0-9]))?))?$'); // [11] tz_minute\n\nfunction resolveYamlTimestamp(data) {\n if (data === null) return false;\n if (YAML_DATE_REGEXP.exec(data) !== null) return true;\n if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;\n return false;\n}\n\nfunction constructYamlTimestamp(data) {\n var match, year, month, day, hour, minute, second, fraction = 0,\n delta = null, tz_hour, tz_minute, date;\n\n match = YAML_DATE_REGEXP.exec(data);\n if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);\n\n if (match === null) throw new Error('Date resolve error');\n\n // match: [1] year [2] month [3] day\n\n year = +(match[1]);\n month = +(match[2]) - 1; // JS month starts with 0\n day = +(match[3]);\n\n if (!match[4]) { // no hour\n return new Date(Date.UTC(year, month, day));\n }\n\n // match: [4] hour [5] minute [6] second [7] fraction\n\n hour = +(match[4]);\n minute = +(match[5]);\n second = +(match[6]);\n\n if (match[7]) {\n fraction = match[7].slice(0, 3);\n while (fraction.length < 3) { // milli-seconds\n fraction += '0';\n }\n fraction = +fraction;\n }\n\n // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute\n\n if (match[9]) {\n tz_hour = +(match[10]);\n tz_minute = +(match[11] || 0);\n delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds\n if (match[9] === '-') delta = -delta;\n }\n\n date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));\n\n if (delta) date.setTime(date.getTime() - delta);\n\n return date;\n}\n\nfunction representYamlTimestamp(object /*, style*/) {\n return object.toISOString();\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:timestamp', {\n kind: 'scalar',\n resolve: resolveYamlTimestamp,\n construct: constructYamlTimestamp,\n instanceOf: Date,\n represent: representYamlTimestamp\n});\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar Stream = _interopDefault(require('stream'));\nvar http = _interopDefault(require('http'));\nvar Url = _interopDefault(require('url'));\nvar https = _interopDefault(require('https'));\nvar zlib = _interopDefault(require('zlib'));\n\n// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js\n\n// fix for \"Readable\" isn't a named export issue\nconst Readable = Stream.Readable;\n\nconst BUFFER = Symbol('buffer');\nconst TYPE = Symbol('type');\n\nclass Blob {\n\tconstructor() {\n\t\tthis[TYPE] = '';\n\n\t\tconst blobParts = arguments[0];\n\t\tconst options = arguments[1];\n\n\t\tconst buffers = [];\n\t\tlet size = 0;\n\n\t\tif (blobParts) {\n\t\t\tconst a = blobParts;\n\t\t\tconst length = Number(a.length);\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tconst element = a[i];\n\t\t\t\tlet buffer;\n\t\t\t\tif (element instanceof Buffer) {\n\t\t\t\t\tbuffer = element;\n\t\t\t\t} else if (ArrayBuffer.isView(element)) {\n\t\t\t\t\tbuffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);\n\t\t\t\t} else if (element instanceof ArrayBuffer) {\n\t\t\t\t\tbuffer = Buffer.from(element);\n\t\t\t\t} else if (element instanceof Blob) {\n\t\t\t\t\tbuffer = element[BUFFER];\n\t\t\t\t} else {\n\t\t\t\t\tbuffer = Buffer.from(typeof element === 'string' ? element : String(element));\n\t\t\t\t}\n\t\t\t\tsize += buffer.length;\n\t\t\t\tbuffers.push(buffer);\n\t\t\t}\n\t\t}\n\n\t\tthis[BUFFER] = Buffer.concat(buffers);\n\n\t\tlet type = options && options.type !== undefined && String(options.type).toLowerCase();\n\t\tif (type && !/[^\\u0020-\\u007E]/.test(type)) {\n\t\t\tthis[TYPE] = type;\n\t\t}\n\t}\n\tget size() {\n\t\treturn this[BUFFER].length;\n\t}\n\tget type() {\n\t\treturn this[TYPE];\n\t}\n\ttext() {\n\t\treturn Promise.resolve(this[BUFFER].toString());\n\t}\n\tarrayBuffer() {\n\t\tconst buf = this[BUFFER];\n\t\tconst ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\treturn Promise.resolve(ab);\n\t}\n\tstream() {\n\t\tconst readable = new Readable();\n\t\treadable._read = function () {};\n\t\treadable.push(this[BUFFER]);\n\t\treadable.push(null);\n\t\treturn readable;\n\t}\n\ttoString() {\n\t\treturn '[object Blob]';\n\t}\n\tslice() {\n\t\tconst size = this.size;\n\n\t\tconst start = arguments[0];\n\t\tconst end = arguments[1];\n\t\tlet relativeStart, relativeEnd;\n\t\tif (start === undefined) {\n\t\t\trelativeStart = 0;\n\t\t} else if (start < 0) {\n\t\t\trelativeStart = Math.max(size + start, 0);\n\t\t} else {\n\t\t\trelativeStart = Math.min(start, size);\n\t\t}\n\t\tif (end === undefined) {\n\t\t\trelativeEnd = size;\n\t\t} else if (end < 0) {\n\t\t\trelativeEnd = Math.max(size + end, 0);\n\t\t} else {\n\t\t\trelativeEnd = Math.min(end, size);\n\t\t}\n\t\tconst span = Math.max(relativeEnd - relativeStart, 0);\n\n\t\tconst buffer = this[BUFFER];\n\t\tconst slicedBuffer = buffer.slice(relativeStart, relativeStart + span);\n\t\tconst blob = new Blob([], { type: arguments[2] });\n\t\tblob[BUFFER] = slicedBuffer;\n\t\treturn blob;\n\t}\n}\n\nObject.defineProperties(Blob.prototype, {\n\tsize: { enumerable: true },\n\ttype: { enumerable: true },\n\tslice: { enumerable: true }\n});\n\nObject.defineProperty(Blob.prototype, Symbol.toStringTag, {\n\tvalue: 'Blob',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * fetch-error.js\n *\n * FetchError interface for operational errors\n */\n\n/**\n * Create FetchError instance\n *\n * @param String message Error message for human\n * @param String type Error type for machine\n * @param String systemError For Node.js system error\n * @return FetchError\n */\nfunction FetchError(message, type, systemError) {\n Error.call(this, message);\n\n this.message = message;\n this.type = type;\n\n // when err.type is `system`, err.code contains system error code\n if (systemError) {\n this.code = this.errno = systemError.code;\n }\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nFetchError.prototype = Object.create(Error.prototype);\nFetchError.prototype.constructor = FetchError;\nFetchError.prototype.name = 'FetchError';\n\nlet convert;\ntry {\n\tconvert = require('encoding').convert;\n} catch (e) {}\n\nconst INTERNALS = Symbol('Body internals');\n\n// fix an issue where \"PassThrough\" isn't a named export for node <10\nconst PassThrough = Stream.PassThrough;\n\n/**\n * Body mixin\n *\n * Ref: https://fetch.spec.whatwg.org/#body\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nfunction Body(body) {\n\tvar _this = this;\n\n\tvar _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n\t _ref$size = _ref.size;\n\n\tlet size = _ref$size === undefined ? 0 : _ref$size;\n\tvar _ref$timeout = _ref.timeout;\n\tlet timeout = _ref$timeout === undefined ? 0 : _ref$timeout;\n\n\tif (body == null) {\n\t\t// body is undefined or null\n\t\tbody = null;\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\tbody = Buffer.from(body.toString());\n\t} else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\tbody = Buffer.from(body);\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\tbody = Buffer.from(body.buffer, body.byteOffset, body.byteLength);\n\t} else if (body instanceof Stream) ; else {\n\t\t// none of the above\n\t\t// coerce to string then buffer\n\t\tbody = Buffer.from(String(body));\n\t}\n\tthis[INTERNALS] = {\n\t\tbody,\n\t\tdisturbed: false,\n\t\terror: null\n\t};\n\tthis.size = size;\n\tthis.timeout = timeout;\n\n\tif (body instanceof Stream) {\n\t\tbody.on('error', function (err) {\n\t\t\tconst error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);\n\t\t\t_this[INTERNALS].error = error;\n\t\t});\n\t}\n}\n\nBody.prototype = {\n\tget body() {\n\t\treturn this[INTERNALS].body;\n\t},\n\n\tget bodyUsed() {\n\t\treturn this[INTERNALS].disturbed;\n\t},\n\n\t/**\n * Decode response as ArrayBuffer\n *\n * @return Promise\n */\n\tarrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t},\n\n\t/**\n * Return raw response as Blob\n *\n * @return Promise\n */\n\tblob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t},\n\n\t/**\n * Decode response as json\n *\n * @return Promise\n */\n\tjson() {\n\t\tvar _this2 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\ttry {\n\t\t\t\treturn JSON.parse(buffer.toString());\n\t\t\t} catch (err) {\n\t\t\t\treturn Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n * Decode response as text\n *\n * @return Promise\n */\n\ttext() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t},\n\n\t/**\n * Decode response as buffer (non-spec api)\n *\n * @return Promise\n */\n\tbuffer() {\n\t\treturn consumeBody.call(this);\n\t},\n\n\t/**\n * Decode response as text, while automatically detecting the encoding and\n * trying to decode to UTF-8 (non-spec api)\n *\n * @return Promise\n */\n\ttextConverted() {\n\t\tvar _this3 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn convertBody(buffer, _this3.headers);\n\t\t});\n\t}\n};\n\n// In browsers, all properties are enumerable.\nObject.defineProperties(Body.prototype, {\n\tbody: { enumerable: true },\n\tbodyUsed: { enumerable: true },\n\tarrayBuffer: { enumerable: true },\n\tblob: { enumerable: true },\n\tjson: { enumerable: true },\n\ttext: { enumerable: true }\n});\n\nBody.mixIn = function (proto) {\n\tfor (const name of Object.getOwnPropertyNames(Body.prototype)) {\n\t\t// istanbul ignore else: future proof\n\t\tif (!(name in proto)) {\n\t\t\tconst desc = Object.getOwnPropertyDescriptor(Body.prototype, name);\n\t\t\tObject.defineProperty(proto, name, desc);\n\t\t}\n\t}\n};\n\n/**\n * Consume and convert an entire Body to a Buffer.\n *\n * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body\n *\n * @return Promise\n */\nfunction consumeBody() {\n\tvar _this4 = this;\n\n\tif (this[INTERNALS].disturbed) {\n\t\treturn Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));\n\t}\n\n\tthis[INTERNALS].disturbed = true;\n\n\tif (this[INTERNALS].error) {\n\t\treturn Body.Promise.reject(this[INTERNALS].error);\n\t}\n\n\tlet body = this.body;\n\n\t// body is null\n\tif (body === null) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is blob\n\tif (isBlob(body)) {\n\t\tbody = body.stream();\n\t}\n\n\t// body is buffer\n\tif (Buffer.isBuffer(body)) {\n\t\treturn Body.Promise.resolve(body);\n\t}\n\n\t// istanbul ignore if: should never happen\n\tif (!(body instanceof Stream)) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is stream\n\t// get ready to actually consume the body\n\tlet accum = [];\n\tlet accumBytes = 0;\n\tlet abort = false;\n\n\treturn new Body.Promise(function (resolve, reject) {\n\t\tlet resTimeout;\n\n\t\t// allow timeout on slow response body\n\t\tif (_this4.timeout) {\n\t\t\tresTimeout = setTimeout(function () {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));\n\t\t\t}, _this4.timeout);\n\t\t}\n\n\t\t// handle stream errors\n\t\tbody.on('error', function (err) {\n\t\t\tif (err.name === 'AbortError') {\n\t\t\t\t// if the request was aborted, reject with this Error\n\t\t\t\tabort = true;\n\t\t\t\treject(err);\n\t\t\t} else {\n\t\t\t\t// other errors, such as incorrect content-encoding\n\t\t\t\treject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\n\t\tbody.on('data', function (chunk) {\n\t\t\tif (abort || chunk === null) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (_this4.size && accumBytes + chunk.length > _this4.size) {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\taccumBytes += chunk.length;\n\t\t\taccum.push(chunk);\n\t\t});\n\n\t\tbody.on('end', function () {\n\t\t\tif (abort) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tclearTimeout(resTimeout);\n\n\t\t\ttry {\n\t\t\t\tresolve(Buffer.concat(accum, accumBytes));\n\t\t\t} catch (err) {\n\t\t\t\t// handle streams that have accumulated too much data (issue #414)\n\t\t\t\treject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Detect buffer encoding and convert to target encoding\n * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding\n *\n * @param Buffer buffer Incoming buffer\n * @param String encoding Target encoding\n * @return String\n */\nfunction convertBody(buffer, headers) {\n\tif (typeof convert !== 'function') {\n\t\tthrow new Error('The package `encoding` must be installed to use the textConverted() function');\n\t}\n\n\tconst ct = headers.get('content-type');\n\tlet charset = 'utf-8';\n\tlet res, str;\n\n\t// header\n\tif (ct) {\n\t\tres = /charset=([^;]*)/i.exec(ct);\n\t}\n\n\t// no charset in content type, peek at response body for at most 1024 bytes\n\tstr = buffer.slice(0, 1024).toString();\n\n\t// html5\n\tif (!res && str) {\n\t\tres = / 0 && arguments[0] !== undefined ? arguments[0] : undefined;\n\n\t\tthis[MAP] = Object.create(null);\n\n\t\tif (init instanceof Headers) {\n\t\t\tconst rawHeaders = init.raw();\n\t\t\tconst headerNames = Object.keys(rawHeaders);\n\n\t\t\tfor (const headerName of headerNames) {\n\t\t\t\tfor (const value of rawHeaders[headerName]) {\n\t\t\t\t\tthis.append(headerName, value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t// We don't worry about converting prop to ByteString here as append()\n\t\t// will handle it.\n\t\tif (init == null) ; else if (typeof init === 'object') {\n\t\t\tconst method = init[Symbol.iterator];\n\t\t\tif (method != null) {\n\t\t\t\tif (typeof method !== 'function') {\n\t\t\t\t\tthrow new TypeError('Header pairs must be iterable');\n\t\t\t\t}\n\n\t\t\t\t// sequence>\n\t\t\t\t// Note: per spec we have to first exhaust the lists then process them\n\t\t\t\tconst pairs = [];\n\t\t\t\tfor (const pair of init) {\n\t\t\t\t\tif (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be iterable');\n\t\t\t\t\t}\n\t\t\t\t\tpairs.push(Array.from(pair));\n\t\t\t\t}\n\n\t\t\t\tfor (const pair of pairs) {\n\t\t\t\t\tif (pair.length !== 2) {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be a name/value tuple');\n\t\t\t\t\t}\n\t\t\t\t\tthis.append(pair[0], pair[1]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// record\n\t\t\t\tfor (const key of Object.keys(init)) {\n\t\t\t\t\tconst value = init[key];\n\t\t\t\t\tthis.append(key, value);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new TypeError('Provided initializer must be an object');\n\t\t}\n\t}\n\n\t/**\n * Return combined header value given name\n *\n * @param String name Header name\n * @return Mixed\n */\n\tget(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key === undefined) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this[MAP][key].join(', ');\n\t}\n\n\t/**\n * Iterate over all headers\n *\n * @param Function callback Executed for each item with parameters (value, name, thisArg)\n * @param Boolean thisArg `this` context for callback function\n * @return Void\n */\n\tforEach(callback) {\n\t\tlet thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n\n\t\tlet pairs = getHeaders(this);\n\t\tlet i = 0;\n\t\twhile (i < pairs.length) {\n\t\t\tvar _pairs$i = pairs[i];\n\t\t\tconst name = _pairs$i[0],\n\t\t\t value = _pairs$i[1];\n\n\t\t\tcallback.call(thisArg, value, name, this);\n\t\t\tpairs = getHeaders(this);\n\t\t\ti++;\n\t\t}\n\t}\n\n\t/**\n * Overwrite header values given name\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tset(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}\n\n\t/**\n * Append a value onto existing header\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tappend(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tthis[MAP][key].push(value);\n\t\t} else {\n\t\t\tthis[MAP][name] = [value];\n\t\t}\n\t}\n\n\t/**\n * Check for header name existence\n *\n * @param String name Header name\n * @return Boolean\n */\n\thas(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}\n\n\t/**\n * Delete all header values given name\n *\n * @param String name Header name\n * @return Void\n */\n\tdelete(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tdelete this[MAP][key];\n\t\t}\n\t}\n\n\t/**\n * Return raw headers (non-spec api)\n *\n * @return Object\n */\n\traw() {\n\t\treturn this[MAP];\n\t}\n\n\t/**\n * Get an iterator on keys.\n *\n * @return Iterator\n */\n\tkeys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}\n\n\t/**\n * Get an iterator on values.\n *\n * @return Iterator\n */\n\tvalues() {\n\t\treturn createHeadersIterator(this, 'value');\n\t}\n\n\t/**\n * Get an iterator on entries.\n *\n * This is the default iterator of the Headers object.\n *\n * @return Iterator\n */\n\t[Symbol.iterator]() {\n\t\treturn createHeadersIterator(this, 'key+value');\n\t}\n}\nHeaders.prototype.entries = Headers.prototype[Symbol.iterator];\n\nObject.defineProperty(Headers.prototype, Symbol.toStringTag, {\n\tvalue: 'Headers',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Headers.prototype, {\n\tget: { enumerable: true },\n\tforEach: { enumerable: true },\n\tset: { enumerable: true },\n\tappend: { enumerable: true },\n\thas: { enumerable: true },\n\tdelete: { enumerable: true },\n\tkeys: { enumerable: true },\n\tvalues: { enumerable: true },\n\tentries: { enumerable: true }\n});\n\nfunction getHeaders(headers) {\n\tlet kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';\n\n\tconst keys = Object.keys(headers[MAP]).sort();\n\treturn keys.map(kind === 'key' ? function (k) {\n\t\treturn k.toLowerCase();\n\t} : kind === 'value' ? function (k) {\n\t\treturn headers[MAP][k].join(', ');\n\t} : function (k) {\n\t\treturn [k.toLowerCase(), headers[MAP][k].join(', ')];\n\t});\n}\n\nconst INTERNAL = Symbol('internal');\n\nfunction createHeadersIterator(target, kind) {\n\tconst iterator = Object.create(HeadersIteratorPrototype);\n\titerator[INTERNAL] = {\n\t\ttarget,\n\t\tkind,\n\t\tindex: 0\n\t};\n\treturn iterator;\n}\n\nconst HeadersIteratorPrototype = Object.setPrototypeOf({\n\tnext() {\n\t\t// istanbul ignore if\n\t\tif (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {\n\t\t\tthrow new TypeError('Value of `this` is not a HeadersIterator');\n\t\t}\n\n\t\tvar _INTERNAL = this[INTERNAL];\n\t\tconst target = _INTERNAL.target,\n\t\t kind = _INTERNAL.kind,\n\t\t index = _INTERNAL.index;\n\n\t\tconst values = getHeaders(target, kind);\n\t\tconst len = values.length;\n\t\tif (index >= len) {\n\t\t\treturn {\n\t\t\t\tvalue: undefined,\n\t\t\t\tdone: true\n\t\t\t};\n\t\t}\n\n\t\tthis[INTERNAL].index = index + 1;\n\n\t\treturn {\n\t\t\tvalue: values[index],\n\t\t\tdone: false\n\t\t};\n\t}\n}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));\n\nObject.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {\n\tvalue: 'HeadersIterator',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * Export the Headers object in a form that Node.js can consume.\n *\n * @param Headers headers\n * @return Object\n */\nfunction exportNodeCompatibleHeaders(headers) {\n\tconst obj = Object.assign({ __proto__: null }, headers[MAP]);\n\n\t// http.request() only supports string as Host header. This hack makes\n\t// specifying custom Host header possible.\n\tconst hostHeaderKey = find(headers[MAP], 'Host');\n\tif (hostHeaderKey !== undefined) {\n\t\tobj[hostHeaderKey] = obj[hostHeaderKey][0];\n\t}\n\n\treturn obj;\n}\n\n/**\n * Create a Headers object from an object of headers, ignoring those that do\n * not conform to HTTP grammar productions.\n *\n * @param Object obj Object of headers\n * @return Headers\n */\nfunction createHeadersLenient(obj) {\n\tconst headers = new Headers();\n\tfor (const name of Object.keys(obj)) {\n\t\tif (invalidTokenRegex.test(name)) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (Array.isArray(obj[name])) {\n\t\t\tfor (const val of obj[name]) {\n\t\t\t\tif (invalidHeaderCharRegex.test(val)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (headers[MAP][name] === undefined) {\n\t\t\t\t\theaders[MAP][name] = [val];\n\t\t\t\t} else {\n\t\t\t\t\theaders[MAP][name].push(val);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (!invalidHeaderCharRegex.test(obj[name])) {\n\t\t\theaders[MAP][name] = [obj[name]];\n\t\t}\n\t}\n\treturn headers;\n}\n\nconst INTERNALS$1 = Symbol('Response internals');\n\n// fix an issue where \"STATUS_CODES\" aren't a named export for node <10\nconst STATUS_CODES = http.STATUS_CODES;\n\n/**\n * Response class\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nclass Response {\n\tconstructor() {\n\t\tlet body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\t\tlet opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tBody.call(this, body, opts);\n\n\t\tconst status = opts.status || 200;\n\t\tconst headers = new Headers(opts.headers);\n\n\t\tif (body != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(body);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tthis[INTERNALS$1] = {\n\t\t\turl: opts.url,\n\t\t\tstatus,\n\t\t\tstatusText: opts.statusText || STATUS_CODES[status],\n\t\t\theaders,\n\t\t\tcounter: opts.counter\n\t\t};\n\t}\n\n\tget url() {\n\t\treturn this[INTERNALS$1].url || '';\n\t}\n\n\tget status() {\n\t\treturn this[INTERNALS$1].status;\n\t}\n\n\t/**\n * Convenience property representing if the request ended normally\n */\n\tget ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}\n\n\tget redirected() {\n\t\treturn this[INTERNALS$1].counter > 0;\n\t}\n\n\tget statusText() {\n\t\treturn this[INTERNALS$1].statusText;\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$1].headers;\n\t}\n\n\t/**\n * Clone this response\n *\n * @return Response\n */\n\tclone() {\n\t\treturn new Response(clone(this), {\n\t\t\turl: this.url,\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t\theaders: this.headers,\n\t\t\tok: this.ok,\n\t\t\tredirected: this.redirected\n\t\t});\n\t}\n}\n\nBody.mixIn(Response.prototype);\n\nObject.defineProperties(Response.prototype, {\n\turl: { enumerable: true },\n\tstatus: { enumerable: true },\n\tok: { enumerable: true },\n\tredirected: { enumerable: true },\n\tstatusText: { enumerable: true },\n\theaders: { enumerable: true },\n\tclone: { enumerable: true }\n});\n\nObject.defineProperty(Response.prototype, Symbol.toStringTag, {\n\tvalue: 'Response',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nconst INTERNALS$2 = Symbol('Request internals');\n\n// fix an issue where \"format\", \"parse\" aren't a named export for node <10\nconst parse_url = Url.parse;\nconst format_url = Url.format;\n\nconst streamDestructionSupported = 'destroy' in Stream.Readable.prototype;\n\n/**\n * Check if a value is an instance of Request.\n *\n * @param Mixed input\n * @return Boolean\n */\nfunction isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}\n\nfunction isAbortSignal(signal) {\n\tconst proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);\n\treturn !!(proto && proto.constructor.name === 'AbortSignal');\n}\n\n/**\n * Request class\n *\n * @param Mixed input Url or Request instance\n * @param Object init Custom options\n * @return Void\n */\nclass Request {\n\tconstructor(input) {\n\t\tlet init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tlet parsedURL;\n\n\t\t// normalize input\n\t\tif (!isRequest(input)) {\n\t\t\tif (input && input.href) {\n\t\t\t\t// in order to support Node.js' Url objects; though WHATWG's URL objects\n\t\t\t\t// will fall into this branch also (since their `toString()` will return\n\t\t\t\t// `href` property anyway)\n\t\t\t\tparsedURL = parse_url(input.href);\n\t\t\t} else {\n\t\t\t\t// coerce input to a string before attempting to parse\n\t\t\t\tparsedURL = parse_url(`${input}`);\n\t\t\t}\n\t\t\tinput = {};\n\t\t} else {\n\t\t\tparsedURL = parse_url(input.url);\n\t\t}\n\n\t\tlet method = init.method || input.method || 'GET';\n\t\tmethod = method.toUpperCase();\n\n\t\tif ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {\n\t\t\tthrow new TypeError('Request with GET/HEAD method cannot have body');\n\t\t}\n\n\t\tlet inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;\n\n\t\tBody.call(this, inputBody, {\n\t\t\ttimeout: init.timeout || input.timeout || 0,\n\t\t\tsize: init.size || input.size || 0\n\t\t});\n\n\t\tconst headers = new Headers(init.headers || input.headers || {});\n\n\t\tif (inputBody != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(inputBody);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tlet signal = isRequest(input) ? input.signal : null;\n\t\tif ('signal' in init) signal = init.signal;\n\n\t\tif (signal != null && !isAbortSignal(signal)) {\n\t\t\tthrow new TypeError('Expected signal to be an instanceof AbortSignal');\n\t\t}\n\n\t\tthis[INTERNALS$2] = {\n\t\t\tmethod,\n\t\t\tredirect: init.redirect || input.redirect || 'follow',\n\t\t\theaders,\n\t\t\tparsedURL,\n\t\t\tsignal\n\t\t};\n\n\t\t// node-fetch-only options\n\t\tthis.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;\n\t\tthis.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;\n\t\tthis.counter = init.counter || input.counter || 0;\n\t\tthis.agent = init.agent || input.agent;\n\t}\n\n\tget method() {\n\t\treturn this[INTERNALS$2].method;\n\t}\n\n\tget url() {\n\t\treturn format_url(this[INTERNALS$2].parsedURL);\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$2].headers;\n\t}\n\n\tget redirect() {\n\t\treturn this[INTERNALS$2].redirect;\n\t}\n\n\tget signal() {\n\t\treturn this[INTERNALS$2].signal;\n\t}\n\n\t/**\n * Clone this request\n *\n * @return Request\n */\n\tclone() {\n\t\treturn new Request(this);\n\t}\n}\n\nBody.mixIn(Request.prototype);\n\nObject.defineProperty(Request.prototype, Symbol.toStringTag, {\n\tvalue: 'Request',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Request.prototype, {\n\tmethod: { enumerable: true },\n\turl: { enumerable: true },\n\theaders: { enumerable: true },\n\tredirect: { enumerable: true },\n\tclone: { enumerable: true },\n\tsignal: { enumerable: true }\n});\n\n/**\n * Convert a Request to Node.js http request options.\n *\n * @param Request A Request instance\n * @return Object The options object to be passed to http.request\n */\nfunction getNodeRequestOptions(request) {\n\tconst parsedURL = request[INTERNALS$2].parsedURL;\n\tconst headers = new Headers(request[INTERNALS$2].headers);\n\n\t// fetch step 1.3\n\tif (!headers.has('Accept')) {\n\t\theaders.set('Accept', '*/*');\n\t}\n\n\t// Basic fetch\n\tif (!parsedURL.protocol || !parsedURL.hostname) {\n\t\tthrow new TypeError('Only absolute URLs are supported');\n\t}\n\n\tif (!/^https?:$/.test(parsedURL.protocol)) {\n\t\tthrow new TypeError('Only HTTP(S) protocols are supported');\n\t}\n\n\tif (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {\n\t\tthrow new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');\n\t}\n\n\t// HTTP-network-or-cache fetch steps 2.4-2.7\n\tlet contentLengthValue = null;\n\tif (request.body == null && /^(POST|PUT)$/i.test(request.method)) {\n\t\tcontentLengthValue = '0';\n\t}\n\tif (request.body != null) {\n\t\tconst totalBytes = getTotalBytes(request);\n\t\tif (typeof totalBytes === 'number') {\n\t\t\tcontentLengthValue = String(totalBytes);\n\t\t}\n\t}\n\tif (contentLengthValue) {\n\t\theaders.set('Content-Length', contentLengthValue);\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.11\n\tif (!headers.has('User-Agent')) {\n\t\theaders.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.15\n\tif (request.compress && !headers.has('Accept-Encoding')) {\n\t\theaders.set('Accept-Encoding', 'gzip,deflate');\n\t}\n\n\tlet agent = request.agent;\n\tif (typeof agent === 'function') {\n\t\tagent = agent(parsedURL);\n\t}\n\n\tif (!headers.has('Connection') && !agent) {\n\t\theaders.set('Connection', 'close');\n\t}\n\n\t// HTTP-network fetch step 4.2\n\t// chunked encoding is handled by Node.js\n\n\treturn Object.assign({}, parsedURL, {\n\t\tmethod: request.method,\n\t\theaders: exportNodeCompatibleHeaders(headers),\n\t\tagent\n\t});\n}\n\n/**\n * abort-error.js\n *\n * AbortError interface for cancelled requests\n */\n\n/**\n * Create AbortError instance\n *\n * @param String message Error message for human\n * @return AbortError\n */\nfunction AbortError(message) {\n Error.call(this, message);\n\n this.type = 'aborted';\n this.message = message;\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nAbortError.prototype = Object.create(Error.prototype);\nAbortError.prototype.constructor = AbortError;\nAbortError.prototype.name = 'AbortError';\n\n// fix an issue where \"PassThrough\", \"resolve\" aren't a named export for node <10\nconst PassThrough$1 = Stream.PassThrough;\nconst resolve_url = Url.resolve;\n\n/**\n * Fetch function\n *\n * @param Mixed url Absolute url or Request instance\n * @param Object opts Fetch options\n * @return Promise\n */\nfunction fetch(url, opts) {\n\n\t// allow custom promise\n\tif (!fetch.Promise) {\n\t\tthrow new Error('native promise missing, set fetch.Promise to your favorite alternative');\n\t}\n\n\tBody.Promise = fetch.Promise;\n\n\t// wrap http.request into fetch\n\treturn new fetch.Promise(function (resolve, reject) {\n\t\t// build request object\n\t\tconst request = new Request(url, opts);\n\t\tconst options = getNodeRequestOptions(request);\n\n\t\tconst send = (options.protocol === 'https:' ? https : http).request;\n\t\tconst signal = request.signal;\n\n\t\tlet response = null;\n\n\t\tconst abort = function abort() {\n\t\t\tlet error = new AbortError('The user aborted a request.');\n\t\t\treject(error);\n\t\t\tif (request.body && request.body instanceof Stream.Readable) {\n\t\t\t\trequest.body.destroy(error);\n\t\t\t}\n\t\t\tif (!response || !response.body) return;\n\t\t\tresponse.body.emit('error', error);\n\t\t};\n\n\t\tif (signal && signal.aborted) {\n\t\t\tabort();\n\t\t\treturn;\n\t\t}\n\n\t\tconst abortAndFinalize = function abortAndFinalize() {\n\t\t\tabort();\n\t\t\tfinalize();\n\t\t};\n\n\t\t// send request\n\t\tconst req = send(options);\n\t\tlet reqTimeout;\n\n\t\tif (signal) {\n\t\t\tsignal.addEventListener('abort', abortAndFinalize);\n\t\t}\n\n\t\tfunction finalize() {\n\t\t\treq.abort();\n\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\tclearTimeout(reqTimeout);\n\t\t}\n\n\t\tif (request.timeout) {\n\t\t\treq.once('socket', function (socket) {\n\t\t\t\treqTimeout = setTimeout(function () {\n\t\t\t\t\treject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));\n\t\t\t\t\tfinalize();\n\t\t\t\t}, request.timeout);\n\t\t\t});\n\t\t}\n\n\t\treq.on('error', function (err) {\n\t\t\treject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));\n\t\t\tfinalize();\n\t\t});\n\n\t\treq.on('response', function (res) {\n\t\t\tclearTimeout(reqTimeout);\n\n\t\t\tconst headers = createHeadersLenient(res.headers);\n\n\t\t\t// HTTP fetch step 5\n\t\t\tif (fetch.isRedirect(res.statusCode)) {\n\t\t\t\t// HTTP fetch step 5.2\n\t\t\t\tconst location = headers.get('Location');\n\n\t\t\t\t// HTTP fetch step 5.3\n\t\t\t\tconst locationURL = location === null ? null : resolve_url(request.url, location);\n\n\t\t\t\t// HTTP fetch step 5.5\n\t\t\t\tswitch (request.redirect) {\n\t\t\t\t\tcase 'error':\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase 'manual':\n\t\t\t\t\t\t// node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.\n\t\t\t\t\t\tif (locationURL !== null) {\n\t\t\t\t\t\t\t// handle corrupted header\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\theaders.set('Location', locationURL);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t// istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request\n\t\t\t\t\t\t\t\treject(err);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'follow':\n\t\t\t\t\t\t// HTTP-redirect fetch step 2\n\t\t\t\t\t\tif (locationURL === null) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 5\n\t\t\t\t\t\tif (request.counter >= request.follow) {\n\t\t\t\t\t\t\treject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 6 (counter increment)\n\t\t\t\t\t\t// Create a new Request object.\n\t\t\t\t\t\tconst requestOpts = {\n\t\t\t\t\t\t\theaders: new Headers(request.headers),\n\t\t\t\t\t\t\tfollow: request.follow,\n\t\t\t\t\t\t\tcounter: request.counter + 1,\n\t\t\t\t\t\t\tagent: request.agent,\n\t\t\t\t\t\t\tcompress: request.compress,\n\t\t\t\t\t\t\tmethod: request.method,\n\t\t\t\t\t\t\tbody: request.body,\n\t\t\t\t\t\t\tsignal: request.signal,\n\t\t\t\t\t\t\ttimeout: request.timeout,\n\t\t\t\t\t\t\tsize: request.size\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 9\n\t\t\t\t\t\tif (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {\n\t\t\t\t\t\t\treject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 11\n\t\t\t\t\t\tif (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {\n\t\t\t\t\t\t\trequestOpts.method = 'GET';\n\t\t\t\t\t\t\trequestOpts.body = undefined;\n\t\t\t\t\t\t\trequestOpts.headers.delete('content-length');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 15\n\t\t\t\t\t\tresolve(fetch(new Request(locationURL, requestOpts)));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// prepare response\n\t\t\tres.once('end', function () {\n\t\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\t});\n\t\t\tlet body = res.pipe(new PassThrough$1());\n\n\t\t\tconst response_options = {\n\t\t\t\turl: request.url,\n\t\t\t\tstatus: res.statusCode,\n\t\t\t\tstatusText: res.statusMessage,\n\t\t\t\theaders: headers,\n\t\t\t\tsize: request.size,\n\t\t\t\ttimeout: request.timeout,\n\t\t\t\tcounter: request.counter\n\t\t\t};\n\n\t\t\t// HTTP-network fetch step 12.1.1.3\n\t\t\tconst codings = headers.get('Content-Encoding');\n\n\t\t\t// HTTP-network fetch step 12.1.1.4: handle content codings\n\n\t\t\t// in following scenarios we ignore compression support\n\t\t\t// 1. compression support is disabled\n\t\t\t// 2. HEAD request\n\t\t\t// 3. no Content-Encoding header\n\t\t\t// 4. no content response (204)\n\t\t\t// 5. content not modified response (304)\n\t\t\tif (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For Node v6+\n\t\t\t// Be less strict when decoding compressed responses, since sometimes\n\t\t\t// servers send slightly invalid responses that are still accepted\n\t\t\t// by common browsers.\n\t\t\t// Always using Z_SYNC_FLUSH is what cURL does.\n\t\t\tconst zlibOptions = {\n\t\t\t\tflush: zlib.Z_SYNC_FLUSH,\n\t\t\t\tfinishFlush: zlib.Z_SYNC_FLUSH\n\t\t\t};\n\n\t\t\t// for gzip\n\t\t\tif (codings == 'gzip' || codings == 'x-gzip') {\n\t\t\t\tbody = body.pipe(zlib.createGunzip(zlibOptions));\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for deflate\n\t\t\tif (codings == 'deflate' || codings == 'x-deflate') {\n\t\t\t\t// handle the infamous raw deflate response from old servers\n\t\t\t\t// a hack for old IIS and Apache servers\n\t\t\t\tconst raw = res.pipe(new PassThrough$1());\n\t\t\t\traw.once('data', function (chunk) {\n\t\t\t\t\t// see http://stackoverflow.com/questions/37519828\n\t\t\t\t\tif ((chunk[0] & 0x0F) === 0x08) {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflate());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflateRaw());\n\t\t\t\t\t}\n\t\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\t\tresolve(response);\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for br\n\t\t\tif (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {\n\t\t\t\tbody = body.pipe(zlib.createBrotliDecompress());\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// otherwise, use response as-is\n\t\t\tresponse = new Response(body, response_options);\n\t\t\tresolve(response);\n\t\t});\n\n\t\twriteToStream(req, request);\n\t});\n}\n/**\n * Redirect code matching\n *\n * @param Number code Status code\n * @return Boolean\n */\nfetch.isRedirect = function (code) {\n\treturn code === 301 || code === 302 || code === 303 || code === 307 || code === 308;\n};\n\n// expose Promise\nfetch.Promise = global.Promise;\n\nmodule.exports = exports = fetch;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = exports;\nexports.Headers = Headers;\nexports.Request = Request;\nexports.Response = Response;\nexports.FetchError = FetchError;\n","var wrappy = require('wrappy')\nmodule.exports = wrappy(once)\nmodule.exports.strict = wrappy(onceStrict)\n\nonce.proto = once(function () {\n Object.defineProperty(Function.prototype, 'once', {\n value: function () {\n return once(this)\n },\n configurable: true\n })\n\n Object.defineProperty(Function.prototype, 'onceStrict', {\n value: function () {\n return onceStrict(this)\n },\n configurable: true\n })\n})\n\nfunction once (fn) {\n var f = function () {\n if (f.called) return f.value\n f.called = true\n return f.value = fn.apply(this, arguments)\n }\n f.called = false\n return f\n}\n\nfunction onceStrict (fn) {\n var f = function () {\n if (f.called)\n throw new Error(f.onceError)\n f.called = true\n return f.value = fn.apply(this, arguments)\n }\n var name = fn.name || 'Function wrapped with `once`'\n f.onceError = name + \" shouldn't be called more than once\"\n f.called = false\n return f\n}\n","module.exports = require('./lib/tunnel');\n","'use strict';\n\nvar net = require('net');\nvar tls = require('tls');\nvar http = require('http');\nvar https = require('https');\nvar events = require('events');\nvar assert = require('assert');\nvar util = require('util');\n\n\nexports.httpOverHttp = httpOverHttp;\nexports.httpsOverHttp = httpsOverHttp;\nexports.httpOverHttps = httpOverHttps;\nexports.httpsOverHttps = httpsOverHttps;\n\n\nfunction httpOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n return agent;\n}\n\nfunction httpsOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\nfunction httpOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n return agent;\n}\n\nfunction httpsOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\n\nfunction TunnelingAgent(options) {\n var self = this;\n self.options = options || {};\n self.proxyOptions = self.options.proxy || {};\n self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;\n self.requests = [];\n self.sockets = [];\n\n self.on('free', function onFree(socket, host, port, localAddress) {\n var options = toOptions(host, port, localAddress);\n for (var i = 0, len = self.requests.length; i < len; ++i) {\n var pending = self.requests[i];\n if (pending.host === options.host && pending.port === options.port) {\n // Detect the request to connect same origin server,\n // reuse the connection.\n self.requests.splice(i, 1);\n pending.request.onSocket(socket);\n return;\n }\n }\n socket.destroy();\n self.removeSocket(socket);\n });\n}\nutil.inherits(TunnelingAgent, events.EventEmitter);\n\nTunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {\n var self = this;\n var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));\n\n if (self.sockets.length >= this.maxSockets) {\n // We are over limit so we'll add it to the queue.\n self.requests.push(options);\n return;\n }\n\n // If we are under maxSockets create a new one.\n self.createSocket(options, function(socket) {\n socket.on('free', onFree);\n socket.on('close', onCloseOrRemove);\n socket.on('agentRemove', onCloseOrRemove);\n req.onSocket(socket);\n\n function onFree() {\n self.emit('free', socket, options);\n }\n\n function onCloseOrRemove(err) {\n self.removeSocket(socket);\n socket.removeListener('free', onFree);\n socket.removeListener('close', onCloseOrRemove);\n socket.removeListener('agentRemove', onCloseOrRemove);\n }\n });\n};\n\nTunnelingAgent.prototype.createSocket = function createSocket(options, cb) {\n var self = this;\n var placeholder = {};\n self.sockets.push(placeholder);\n\n var connectOptions = mergeOptions({}, self.proxyOptions, {\n method: 'CONNECT',\n path: options.host + ':' + options.port,\n agent: false,\n headers: {\n host: options.host + ':' + options.port\n }\n });\n if (options.localAddress) {\n connectOptions.localAddress = options.localAddress;\n }\n if (connectOptions.proxyAuth) {\n connectOptions.headers = connectOptions.headers || {};\n connectOptions.headers['Proxy-Authorization'] = 'Basic ' +\n new Buffer(connectOptions.proxyAuth).toString('base64');\n }\n\n debug('making CONNECT request');\n var connectReq = self.request(connectOptions);\n connectReq.useChunkedEncodingByDefault = false; // for v0.6\n connectReq.once('response', onResponse); // for v0.6\n connectReq.once('upgrade', onUpgrade); // for v0.6\n connectReq.once('connect', onConnect); // for v0.7 or later\n connectReq.once('error', onError);\n connectReq.end();\n\n function onResponse(res) {\n // Very hacky. This is necessary to avoid http-parser leaks.\n res.upgrade = true;\n }\n\n function onUpgrade(res, socket, head) {\n // Hacky.\n process.nextTick(function() {\n onConnect(res, socket, head);\n });\n }\n\n function onConnect(res, socket, head) {\n connectReq.removeAllListeners();\n socket.removeAllListeners();\n\n if (res.statusCode !== 200) {\n debug('tunneling socket could not be established, statusCode=%d',\n res.statusCode);\n socket.destroy();\n var error = new Error('tunneling socket could not be established, ' +\n 'statusCode=' + res.statusCode);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n if (head.length > 0) {\n debug('got illegal response body from proxy');\n socket.destroy();\n var error = new Error('got illegal response body from proxy');\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n debug('tunneling connection has established');\n self.sockets[self.sockets.indexOf(placeholder)] = socket;\n return cb(socket);\n }\n\n function onError(cause) {\n connectReq.removeAllListeners();\n\n debug('tunneling socket could not be established, cause=%s\\n',\n cause.message, cause.stack);\n var error = new Error('tunneling socket could not be established, ' +\n 'cause=' + cause.message);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n }\n};\n\nTunnelingAgent.prototype.removeSocket = function removeSocket(socket) {\n var pos = this.sockets.indexOf(socket)\n if (pos === -1) {\n return;\n }\n this.sockets.splice(pos, 1);\n\n var pending = this.requests.shift();\n if (pending) {\n // If we have pending requests and a socket gets closed a new one\n // needs to be created to take over in the pool for the one that closed.\n this.createSocket(pending, function(socket) {\n pending.request.onSocket(socket);\n });\n }\n};\n\nfunction createSecureSocket(options, cb) {\n var self = this;\n TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {\n var hostHeader = options.request.getHeader('host');\n var tlsOptions = mergeOptions({}, self.options, {\n socket: socket,\n servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host\n });\n\n // 0 is dummy port for v0.6\n var secureSocket = tls.connect(0, tlsOptions);\n self.sockets[self.sockets.indexOf(socket)] = secureSocket;\n cb(secureSocket);\n });\n}\n\n\nfunction toOptions(host, port, localAddress) {\n if (typeof host === 'string') { // since v0.10\n return {\n host: host,\n port: port,\n localAddress: localAddress\n };\n }\n return host; // for v0.11 or later\n}\n\nfunction mergeOptions(target) {\n for (var i = 1, len = arguments.length; i < len; ++i) {\n var overrides = arguments[i];\n if (typeof overrides === 'object') {\n var keys = Object.keys(overrides);\n for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {\n var k = keys[j];\n if (overrides[k] !== undefined) {\n target[k] = overrides[k];\n }\n }\n }\n }\n return target;\n}\n\n\nvar debug;\nif (process.env.NODE_DEBUG && /\\btunnel\\b/.test(process.env.NODE_DEBUG)) {\n debug = function() {\n var args = Array.prototype.slice.call(arguments);\n if (typeof args[0] === 'string') {\n args[0] = 'TUNNEL: ' + args[0];\n } else {\n args.unshift('TUNNEL:');\n }\n console.error.apply(console, args);\n }\n} else {\n debug = function() {};\n}\nexports.debug = debug; // for test\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction getUserAgent() {\n if (typeof navigator === \"object\" && \"userAgent\" in navigator) {\n return navigator.userAgent;\n }\n\n if (typeof process === \"object\" && \"version\" in process) {\n return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;\n }\n\n return \"\";\n}\n\nexports.getUserAgent = getUserAgent;\n//# sourceMappingURL=index.js.map\n","// Returns a wrapper function that returns a wrapped callback\n// The wrapper function should do some stuff, and return a\n// presumably different callback function.\n// This makes sure that own properties are retained, so that\n// decorations and such are not lost along the way.\nmodule.exports = wrappy\nfunction wrappy (fn, cb) {\n if (fn && cb) return wrappy(fn)(cb)\n\n if (typeof fn !== 'function')\n throw new TypeError('need wrapper function')\n\n Object.keys(fn).forEach(function (k) {\n wrapper[k] = fn[k]\n })\n\n return wrapper\n\n function wrapper() {\n var args = new Array(arguments.length)\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n var ret = fn.apply(this, args)\n var cb = args[args.length-1]\n if (typeof ret === 'function' && ret !== cb) {\n Object.keys(cb).forEach(function (k) {\n ret[k] = cb[k]\n })\n }\n return ret\n }\n}\n",null,"module.exports = require(\"assert\");;","module.exports = require(\"events\");;","module.exports = require(\"fs\");;","module.exports = require(\"http\");;","module.exports = require(\"https\");;","module.exports = require(\"net\");;","module.exports = require(\"os\");;","module.exports = require(\"path\");;","module.exports = require(\"stream\");;","module.exports = require(\"tls\");;","module.exports = require(\"url\");;","module.exports = require(\"util\");;","module.exports = require(\"zlib\");;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tif(__webpack_module_cache__[moduleId]) {\n\t\treturn __webpack_module_cache__[moduleId].exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\tvar threw = true;\n\ttry {\n\t\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\t\tthrew = false;\n\t} finally {\n\t\tif(threw) delete __webpack_module_cache__[moduleId];\n\t}\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","\n__webpack_require__.ab = __dirname + \"/\";","// module exports must be returned from runtime so entry inlining is disabled\n// startup\n// Load entry module and return exports\nreturn __webpack_require__(3109);\n"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC5FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACrLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACtOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACjGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC9GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACrNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC/DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACxKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC/EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC9OA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACxhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC/KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACvYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC7GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACrIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC3nCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACrJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACn0CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC5vCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACpJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACllBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC5qCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC/SA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACj9DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC9qBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACvzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACzcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACjWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC3PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AClKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACjKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AChpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACt8BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AChsDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC1HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACtGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC9HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AClGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC7JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACzFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AClnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC3CA;AACA;AACA;A;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACzQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AClCA;AACA;AACA;A;;;;;;ACFA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC5BA;AACA;ACDA;AACA;AACA;AACA;;A","sourceRoot":""} \ No newline at end of file +{"version":3,"file":"index.js","sources":["../webpack://oss-governance-bot/./lib/command.js","../webpack://oss-governance-bot/./lib/config.js","../webpack://oss-governance-bot/./lib/github.js","../webpack://oss-governance-bot/./lib/main.js","../webpack://oss-governance-bot/./lib/operators/capture.js","../webpack://oss-governance-bot/./lib/operators/chat-ops/assign.js","../webpack://oss-governance-bot/./lib/operators/chat-ops/close.js","../webpack://oss-governance-bot/./lib/operators/chat-ops/comment.js","../webpack://oss-governance-bot/./lib/operators/chat-ops/label.js","../webpack://oss-governance-bot/./lib/operators/chat-ops/review.js","../webpack://oss-governance-bot/./lib/operators/index.js","../webpack://oss-governance-bot/./lib/operators/label.js","../webpack://oss-governance-bot/./lib/rules/author-association.js","../webpack://oss-governance-bot/./lib/rules/ignore.js","../webpack://oss-governance-bot/./node_modules/@actions/core/lib/command.js","../webpack://oss-governance-bot/./node_modules/@actions/core/lib/core.js","../webpack://oss-governance-bot/./node_modules/@actions/core/lib/file-command.js","../webpack://oss-governance-bot/./node_modules/@actions/core/lib/utils.js","../webpack://oss-governance-bot/./node_modules/@actions/github/lib/context.js","../webpack://oss-governance-bot/./node_modules/@actions/github/lib/github.js","../webpack://oss-governance-bot/./node_modules/@actions/github/lib/internal/utils.js","../webpack://oss-governance-bot/./node_modules/@actions/github/lib/utils.js","../webpack://oss-governance-bot/./node_modules/@actions/http-client/index.js","../webpack://oss-governance-bot/./node_modules/@actions/http-client/proxy.js","../webpack://oss-governance-bot/./node_modules/@octokit/auth-token/dist-node/index.js","../webpack://oss-governance-bot/./node_modules/@octokit/core/dist-node/index.js","../webpack://oss-governance-bot/./node_modules/@octokit/endpoint/dist-node/index.js","../webpack://oss-governance-bot/./node_modules/@octokit/graphql/dist-node/index.js","../webpack://oss-governance-bot/./node_modules/@octokit/plugin-paginate-rest/dist-node/index.js","../webpack://oss-governance-bot/./node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js","../webpack://oss-governance-bot/./node_modules/@octokit/request-error/dist-node/index.js","../webpack://oss-governance-bot/./node_modules/@octokit/request/dist-node/index.js","../webpack://oss-governance-bot/./node_modules/before-after-hook/index.js","../webpack://oss-governance-bot/./node_modules/before-after-hook/lib/add.js","../webpack://oss-governance-bot/./node_modules/before-after-hook/lib/register.js","../webpack://oss-governance-bot/./node_modules/before-after-hook/lib/remove.js","../webpack://oss-governance-bot/./node_modules/deprecation/dist-node/index.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/Applicative.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/Apply.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/Array.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/Chain.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/ChainRec.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/Either.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/Eq.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/FromEither.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/Functor.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/Magma.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/NonEmptyArray.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/Option.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/Ord.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/Predicate.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/ReadonlyArray.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/ReadonlyNonEmptyArray.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/ReadonlyRecord.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/Record.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/Semigroup.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/Separated.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/Witherable.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/Zero.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/function.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/internal.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/number.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/pipeable.js","../webpack://oss-governance-bot/./node_modules/fp-ts/lib/string.js","../webpack://oss-governance-bot/./node_modules/io-ts-reporters/target/src/index.js","../webpack://oss-governance-bot/./node_modules/io-ts-reporters/target/src/utils.js","../webpack://oss-governance-bot/./node_modules/io-ts/lib/index.js","../webpack://oss-governance-bot/./node_modules/is-plain-object/dist/is-plain-object.js","../webpack://oss-governance-bot/./node_modules/js-yaml/index.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/common.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/dumper.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/exception.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/loader.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/schema.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/schema/core.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/schema/default.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/schema/failsafe.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/schema/json.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/snippet.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/type.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/type/binary.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/type/bool.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/type/float.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/type/int.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/type/map.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/type/merge.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/type/null.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/type/omap.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/type/pairs.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/type/seq.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/type/set.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/type/str.js","../webpack://oss-governance-bot/./node_modules/js-yaml/lib/type/timestamp.js","../webpack://oss-governance-bot/./node_modules/node-fetch/lib/index.js","../webpack://oss-governance-bot/./node_modules/once/once.js","../webpack://oss-governance-bot/./node_modules/tunnel/index.js","../webpack://oss-governance-bot/./node_modules/tunnel/lib/tunnel.js","../webpack://oss-governance-bot/./node_modules/universal-user-agent/dist-node/index.js","../webpack://oss-governance-bot/./node_modules/wrappy/wrappy.js","../webpack://oss-governance-bot/./node_modules/@vercel/ncc/dist/ncc/@@notfound.js","../webpack://oss-governance-bot/external \"assert\"","../webpack://oss-governance-bot/external \"events\"","../webpack://oss-governance-bot/external \"fs\"","../webpack://oss-governance-bot/external \"http\"","../webpack://oss-governance-bot/external \"https\"","../webpack://oss-governance-bot/external \"net\"","../webpack://oss-governance-bot/external \"os\"","../webpack://oss-governance-bot/external \"path\"","../webpack://oss-governance-bot/external \"stream\"","../webpack://oss-governance-bot/external \"tls\"","../webpack://oss-governance-bot/external \"url\"","../webpack://oss-governance-bot/external \"util\"","../webpack://oss-governance-bot/external \"zlib\"","../webpack://oss-governance-bot/webpack/bootstrap","../webpack://oss-governance-bot/webpack/runtime/compat","../webpack://oss-governance-bot/webpack/startup"],"sourcesContent":["\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (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};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getCommands = exports.getBody = exports.Commands = exports.ArgsCommand = exports.Command = void 0;\nconst github = __importStar(require(\"@actions/github\"));\nclass Command {\n constructor(text) {\n this.args = [];\n this.text = text;\n }\n}\nexports.Command = Command;\nclass ArgsCommand extends Command {\n constructor(text, prefix) {\n super(text);\n this.args = [];\n const postfix = this.text.split(prefix)[1];\n if (postfix) {\n this.args = postfix.trim().split(' ');\n }\n }\n}\nexports.ArgsCommand = ArgsCommand;\nclass Commands {\n constructor(commands) {\n this.commands = commands;\n }\n prefix(start) {\n return this.commands\n .filter(command => {\n return command.text.startsWith(start);\n })\n .map(value => {\n return new ArgsCommand(value.text, start + ' ');\n });\n }\n}\nexports.Commands = Commands;\nfunction getBody() {\n const payload = github.context.payload;\n const content = payload.comment || payload.pull_request || payload.issue;\n let body = (content === null || content === void 0 ? void 0 : content.body) || '';\n // Replace comments so that it's not processed\n body = body.replace('\\r', '\\n');\n body = body.replace('\\r\\n', '\\n');\n body = body.replace(//g, '');\n return body;\n}\nexports.getBody = getBody;\nfunction getCommands() {\n return getBody()\n .split('\\n')\n .map(text => { var _a; return (_a = /^\\/(.+)/.exec(text)) === null || _a === void 0 ? void 0 : _a[0]; })\n .filter((cmd) => !!cmd)\n .map(value => new Command(value));\n}\nexports.getCommands = getCommands;\nfunction default_1() {\n return __awaiter(this, void 0, void 0, function* () {\n const commands = getCommands();\n return new Commands(commands);\n });\n}\nexports.default = default_1;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (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};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getConfig = void 0;\nconst js_yaml_1 = require(\"js-yaml\");\nconst t = __importStar(require(\"io-ts\"));\nconst io_ts_reporters_1 = __importDefault(require(\"io-ts-reporters\"));\nconst Either_1 = require(\"fp-ts/Either\");\nconst github = __importStar(require(\"@actions/github\"));\nconst AuthorAssociation = t.partial({\n // Author of issue or pull_request\n author: t.boolean,\n // Author has been invited to collaborate on the repository.\n collaborator: t.boolean,\n // Author has previously committed to the repository.\n contributor: t.boolean,\n // Author has not previously committed to GitHub.\n first_timer: t.boolean,\n // Author has not previously committed to the repository.\n first_time_contributor: t.boolean,\n // Author is a placeholder for an unclaimed user.\n mannequin: t.boolean,\n // Author is a member of the organization that owns the repository.\n member: t.boolean,\n // Author has no association with the repository.\n none: t.boolean,\n // Author is the owner of the repository.\n owner: t.boolean\n});\nconst Label = t.intersection([\n t.type({\n prefix: t.string,\n list: t.array(t.string)\n }),\n t.partial({\n multiple: t.boolean,\n author_association: AuthorAssociation,\n needs: t.union([\n t.boolean,\n t.partial({\n comment: t.string,\n status: t.intersection([\n t.type({\n context: t.string\n }),\n t.partial({\n url: t.string,\n description: t.union([\n t.string,\n t.partial({\n success: t.string,\n failure: t.string\n })\n ])\n })\n ])\n })\n ])\n })\n]);\nconst Capture = t.intersection([\n t.type({\n regex: t.string,\n label: t.string\n }),\n t.partial({\n author_association: AuthorAssociation,\n ignore_case: t.boolean,\n github_release: t.boolean\n })\n]);\nconst CommentChatOps = t.intersection([\n t.type({\n cmd: t.string,\n type: t.literal('comment'),\n comment: t.string\n }),\n t.partial({\n author_association: AuthorAssociation\n })\n]);\nconst LabelChatOps = t.intersection([\n t.type({\n cmd: t.string,\n type: t.literal('label'),\n label: t.partial({\n add: t.union([t.string, t.array(t.string)]),\n remove: t.union([t.string, t.array(t.string)])\n })\n }),\n t.partial({\n author_association: AuthorAssociation\n })\n]);\nconst GenericChatOps = t.intersection([\n t.type({\n cmd: t.string,\n type: t.keyof({\n close: null,\n none: null,\n assign: null,\n review: null\n })\n }),\n t.partial({\n author_association: AuthorAssociation\n })\n]);\nconst ChatOps = t.union([GenericChatOps, LabelChatOps, CommentChatOps]);\nconst Governance = t.partial({\n labels: t.array(Label),\n captures: t.array(Capture),\n chat_ops: t.array(ChatOps)\n});\nconst Config = t.intersection([\n t.type({\n version: t.literal('v1')\n }),\n t.partial({\n issue: Governance,\n pull_request: Governance\n })\n]);\nfunction parse(content) {\n const config = js_yaml_1.load(content);\n const decoded = Config.decode(config);\n if (Either_1.isRight(decoded)) {\n return decoded.right;\n }\n else {\n throw new Error(`Config parse error:\\\\n${io_ts_reporters_1.default.report(decoded).join('\\\\n')}`);\n }\n}\n/**\n * @param client used to get governance config from\n * @param configPath location of the config file\n */\nfunction getConfig(client, configPath) {\n return __awaiter(this, void 0, void 0, function* () {\n const response = yield client.repos.getContent({\n owner: github.context.repo.owner,\n repo: github.context.repo.repo,\n ref: github.context.sha,\n path: configPath\n });\n const content = Buffer.from(response.data.content, response.data.encoding).toString();\n return parse(content);\n });\n}\nexports.getConfig = getConfig;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (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};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.hasReleaseByTag = exports.commitStatus = exports.requestReviewers = exports.assign = exports.patchIssue = exports.postComment = exports.removeLabels = exports.addLabels = exports.getLabels = exports.getBotUserId = exports.initClient = void 0;\nconst github = __importStar(require(\"@actions/github\"));\nconst core = __importStar(require(\"@actions/core\"));\nfunction initClient(token = core.getInput('github-token')) {\n return github.getOctokit(token);\n}\nexports.initClient = initClient;\nfunction getBotUserId() {\n return __awaiter(this, void 0, void 0, function* () {\n core.info('github-client: getBotUserId');\n const client = initClient();\n const user = yield client.users.getAuthenticated();\n return user.data.id;\n });\n}\nexports.getBotUserId = getBotUserId;\nfunction getNumber() {\n var _a, _b;\n return (((_a = github.context.payload.pull_request) === null || _a === void 0 ? void 0 : _a.number) || ((_b = github.context.payload.issue) === null || _b === void 0 ? void 0 : _b.number));\n}\nfunction getLabels() {\n var _a;\n const contents = github.context.payload.pull_request || github.context.payload.issue;\n return ((_a = contents === null || contents === void 0 ? void 0 : contents.labels) === null || _a === void 0 ? void 0 : _a.map(({ name }) => name)) || [];\n}\nexports.getLabels = getLabels;\nfunction addLabels(labels) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!labels.length)\n return;\n core.info('github-client: addLabels');\n const client = initClient();\n yield client.issues.addLabels({\n owner: github.context.repo.owner,\n repo: github.context.repo.repo,\n issue_number: getNumber(),\n labels: labels\n });\n });\n}\nexports.addLabels = addLabels;\nfunction removeLabels(labels) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!labels.length)\n return;\n core.info('github-client: removeLabels');\n const client = initClient();\n yield Promise.all(labels.map(name => client.issues.removeLabel({\n owner: github.context.repo.owner,\n repo: github.context.repo.repo,\n issue_number: getNumber(),\n name: name\n })));\n });\n}\nexports.removeLabels = removeLabels;\n/**\n * Comment details.\n */\nfunction getDetails() {\n const repository = github.context.payload.repository;\n const configPath = core.getInput('config-path', { required: true });\n const repoUrl = repository === null || repository === void 0 ? void 0 : repository.html_url;\n const owner = repository === null || repository === void 0 ? void 0 : repository.owner;\n const branch = repository === null || repository === void 0 ? void 0 : repository.default_branch;\n let details = '';\n details += '\\n';\n details += '
Details';\n details += '\\n\\n';\n if ((owner === null || owner === void 0 ? void 0 : owner.type) === 'Organization') {\n details += `I am a bot created to help the [${owner === null || owner === void 0 ? void 0 : owner.login}](${owner === null || owner === void 0 ? void 0 : owner.html_url}) developers manage community feedback and contributions.`;\n }\n else {\n details += `I am a bot created to help [${owner === null || owner === void 0 ? void 0 : owner.login}](${owner === null || owner === void 0 ? void 0 : owner.html_url}) manage community feedback and contributions.`;\n }\n details += ' ';\n details += `You can check out my [manifest file](${repoUrl}/blob/${branch}/${configPath}) to understand my behavior and what I can do.`;\n details += ' ';\n details +=\n 'If you want to use this for your project, you can check out the [DeFiCh/oss-governance-bot](https://github.com/DeFiCh/oss-governance-bot) repository.';\n details += '\\n\\n';\n details += '
';\n return details;\n}\nfunction getIssueUserLogin() {\n var _a, _b;\n if (github.context.payload.issue) {\n return (_a = github.context.payload.issue.user) === null || _a === void 0 ? void 0 : _a.login;\n }\n if (github.context.payload.pull_request) {\n return (_b = github.context.payload.pull_request.user) === null || _b === void 0 ? void 0 : _b.login;\n }\n}\n/**\n * Comment to post with added details.\n *\n * @param body comment\n */\nfunction postComment(body) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n core.info('github-client: postComment');\n const client = initClient();\n body = body.replace('$AUTHOR', (_a = github.context.payload.sender) === null || _a === void 0 ? void 0 : _a.login);\n body = body.replace('$ISSUE_AUTHOR', getIssueUserLogin());\n body += getDetails();\n yield client.issues.createComment({\n owner: github.context.repo.owner,\n repo: github.context.repo.repo,\n issue_number: getNumber(),\n body: body\n });\n });\n}\nexports.postComment = postComment;\nfunction patchIssue(changes) {\n return __awaiter(this, void 0, void 0, function* () {\n core.info('github-client: patchIssue');\n const client = initClient();\n yield client.issues.update(Object.assign({ owner: github.context.repo.owner, repo: github.context.repo.repo, issue_number: getNumber() }, changes));\n });\n}\nexports.patchIssue = patchIssue;\nfunction assign(assignees) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!assignees.length)\n return;\n core.info('github-client: assign');\n const client = initClient();\n yield client.issues.addAssignees({\n owner: github.context.repo.owner,\n repo: github.context.repo.repo,\n issue_number: getNumber(),\n assignees: assignees\n });\n });\n}\nexports.assign = assign;\nfunction requestReviewers(reviewers) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!reviewers.length)\n return;\n core.info('github-client: requestReviewers');\n const client = initClient();\n yield client.pulls.requestReviewers({\n owner: github.context.repo.owner,\n repo: github.context.repo.repo,\n pull_number: getNumber(),\n reviewers: reviewers\n });\n });\n}\nexports.requestReviewers = requestReviewers;\nfunction commitStatus(context, state, description, url) {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n core.info('github-client: commitStatus');\n const client = initClient();\n function sendStatus(sha) {\n return __awaiter(this, void 0, void 0, function* () {\n yield client.repos.createCommitStatus({\n owner: github.context.repo.owner,\n repo: github.context.repo.repo,\n sha: sha,\n context: context,\n state: state,\n description: description,\n target_url: url\n });\n });\n }\n if (github.context.payload.pull_request) {\n yield sendStatus((_a = github.context.payload.pull_request) === null || _a === void 0 ? void 0 : _a.head.sha);\n return;\n }\n if (github.context.payload.comment && ((_b = github.context.payload.issue) === null || _b === void 0 ? void 0 : _b.pull_request)) {\n const response = yield client.pulls.get({\n owner: github.context.repo.owner,\n repo: github.context.repo.repo,\n pull_number: getNumber()\n });\n yield sendStatus(response.data.head.sha);\n }\n });\n}\nexports.commitStatus = commitStatus;\nfunction hasReleaseByTag(tag) {\n return __awaiter(this, void 0, void 0, function* () {\n core.info('github-client: getReleaseByTag');\n const client = initClient();\n const release = client.repos.getReleaseByTag({\n owner: github.context.repo.owner,\n repo: github.context.repo.repo,\n tag: tag\n });\n return release.then(() => true).catch(() => false);\n });\n}\nexports.hasReleaseByTag = hasReleaseByTag;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (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};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.runGovernance = exports.getGovernance = void 0;\nconst core = __importStar(require(\"@actions/core\"));\nconst github = __importStar(require(\"@actions/github\"));\nconst config_1 = require(\"./config\");\nconst ignore_1 = __importDefault(require(\"./rules/ignore\"));\nconst command_1 = __importDefault(require(\"./command\"));\nconst operators_1 = __importDefault(require(\"./operators\"));\nconst github_1 = require(\"./github\");\n/**\n * @return the current governance config based on the context, it could be 'pull_request' or 'issue'.\n */\nfunction getGovernance() {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const configPath = core.getInput('config-path', { required: true });\n const config = yield config_1.getConfig(github_1.initClient(), configPath);\n if (github.context.payload.comment) {\n if ((_a = github.context.payload.issue) === null || _a === void 0 ? void 0 : _a.pull_request) {\n return config.pull_request;\n }\n if (github.context.payload.issue) {\n return config.issue;\n }\n }\n if (github.context.payload.issue) {\n return config.issue;\n }\n if (github.context.payload.pull_request) {\n return config.pull_request;\n }\n throw new Error('Could not get pull_request or issue from context');\n });\n}\nexports.getGovernance = getGovernance;\n/**\n * Get governance config, parse and run commands from context.\n */\nfunction runGovernance() {\n return __awaiter(this, void 0, void 0, function* () {\n const governance = yield getGovernance();\n core.info('main: fetched governance.yml');\n if (!governance) {\n return;\n }\n core.info('main: parsing commands');\n const commands = yield command_1.default();\n core.info('main: running operations');\n yield operators_1.default(governance, commands);\n core.info('main: completed operations');\n });\n}\nexports.runGovernance = runGovernance;\n/* eslint github/no-then: off */\nignore_1.default()\n .then((toIgnore) => __awaiter(void 0, void 0, void 0, function* () {\n if (toIgnore)\n return;\n yield runGovernance();\n}))\n .catch(error => {\n core.error(error);\n core.setFailed(error);\n});\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (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};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst command_1 = require(\"../command\");\nconst github_1 = require(\"../github\");\nfunction parseLabel(capture, array) {\n return __awaiter(this, void 0, void 0, function* () {\n let capturedText = (array[1] || '').trim();\n if (capture.github_release) {\n // Automatically parse semantic release\n capturedText = capturedText.replace(/^v/, '');\n if (!(yield github_1.hasReleaseByTag(`v${capturedText}`)) &&\n !(yield github_1.hasReleaseByTag(capturedText))) {\n return;\n }\n }\n return capture.label.replace('$CAPTURED', capturedText);\n });\n}\nfunction default_1(capture) {\n return __awaiter(this, void 0, void 0, function* () {\n const regex = new RegExp(capture.regex, `${capture.ignore_case ? 'i' : ''}`);\n for (const line of command_1.getBody().split('\\n')) {\n const array = regex.exec(line);\n if (!array) {\n continue;\n }\n const label = yield parseLabel(capture, array);\n if (label) {\n yield github_1.addLabels([label]);\n }\n }\n });\n}\nexports.default = default_1;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (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};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst github_1 = require(\"../../github\");\nfunction default_1(chatOps, commands) {\n return __awaiter(this, void 0, void 0, function* () {\n const matched = commands.prefix(chatOps.cmd);\n if (!matched.length) {\n return;\n }\n const assignees = matched\n .flatMap(value => value.args)\n .map(value => {\n value = value.trim();\n if (value.startsWith('@')) {\n return value.replace(/^@/, '');\n }\n })\n .filter(value => value);\n yield github_1.assign(assignees);\n });\n}\nexports.default = default_1;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (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};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst github_1 = require(\"../../github\");\nfunction default_1(chatOps, commands) {\n return __awaiter(this, void 0, void 0, function* () {\n const matched = commands.prefix(chatOps.cmd);\n if (!matched.length) {\n return;\n }\n yield github_1.patchIssue({\n state: 'closed'\n });\n });\n}\nexports.default = default_1;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (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};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst github_1 = require(\"../../github\");\nfunction default_1(chatOps, commands) {\n return __awaiter(this, void 0, void 0, function* () {\n const matched = commands.prefix(chatOps.cmd);\n if (!matched.length) {\n return;\n }\n yield github_1.postComment(chatOps.comment);\n });\n}\nexports.default = default_1;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (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};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst github_1 = require(\"../../github\");\nfunction default_1(chatOps, commands) {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n const matched = commands.prefix(chatOps.cmd);\n if (!matched.length) {\n return;\n }\n const add = (_a = chatOps.label) === null || _a === void 0 ? void 0 : _a.add;\n if (typeof add === 'string' && add) {\n yield github_1.addLabels([add]);\n }\n else if (Array.isArray(add)) {\n yield github_1.addLabels(add);\n }\n const remove = (_b = chatOps.label) === null || _b === void 0 ? void 0 : _b.remove;\n if (typeof remove === 'string' && remove) {\n yield github_1.removeLabels([remove]);\n }\n else if (Array.isArray(remove)) {\n yield github_1.removeLabels(remove);\n }\n });\n}\nexports.default = default_1;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (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};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst github_1 = require(\"../../github\");\nfunction default_1(chatOps, commands) {\n return __awaiter(this, void 0, void 0, function* () {\n const matched = commands.prefix(chatOps.cmd);\n if (!matched.length) {\n return;\n }\n const reviewers = matched\n .flatMap(value => value.args)\n .map(value => {\n value = value.trim();\n if (value.startsWith('@')) {\n return value.replace(/^@/, '');\n }\n })\n .filter(value => value);\n yield github_1.requestReviewers(reviewers);\n });\n}\nexports.default = default_1;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (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};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst author_association_1 = require(\"../rules/author-association\");\nconst label_1 = __importDefault(require(\"./label\"));\nconst capture_1 = __importDefault(require(\"./capture\"));\nconst close_1 = __importDefault(require(\"./chat-ops/close\"));\nconst comment_1 = __importDefault(require(\"./chat-ops/comment\"));\nconst assign_1 = __importDefault(require(\"./chat-ops/assign\"));\nconst review_1 = __importDefault(require(\"./chat-ops/review\"));\nconst label_2 = __importDefault(require(\"./chat-ops/label\"));\nconst ignore_1 = require(\"../rules/ignore\");\nconst core = __importStar(require(\"@actions/core\"));\nfunction processLabels(labels, commands) {\n return __awaiter(this, void 0, void 0, function* () {\n for (const labelOp of labels) {\n yield label_1.default(labelOp, commands);\n }\n });\n}\nfunction processCaptures(captures) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!ignore_1.isCreatedOpened()) {\n return;\n }\n for (const captureOp of captures) {\n if (author_association_1.isAuthorAssociationAllowed(captureOp.author_association)) {\n yield capture_1.default(captureOp);\n }\n }\n });\n}\nfunction processChatOps(chatOps, commands) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!ignore_1.isCreatedOpened()) {\n return;\n }\n for (const chatOp of chatOps) {\n if (!author_association_1.isAuthorAssociationAllowed(chatOp.author_association)) {\n continue;\n }\n switch (chatOp.type) {\n case 'close':\n yield close_1.default(chatOp, commands);\n break;\n case 'assign':\n yield assign_1.default(chatOp, commands);\n break;\n case 'review':\n yield review_1.default(chatOp, commands);\n break;\n case 'comment':\n yield comment_1.default(chatOp, commands);\n break;\n case 'label':\n yield label_2.default(chatOp, commands);\n break;\n }\n }\n });\n}\nfunction default_1(governance, commands) {\n var _a, _b, _c;\n return __awaiter(this, void 0, void 0, function* () {\n if ((_a = governance.captures) === null || _a === void 0 ? void 0 : _a.length) {\n core.info('operations: processing captures');\n yield processCaptures(governance.captures);\n }\n if ((_b = governance.chat_ops) === null || _b === void 0 ? void 0 : _b.length) {\n core.info('operations: processing chatops');\n yield processChatOps(governance.chat_ops, commands);\n }\n if ((_c = governance.labels) === null || _c === void 0 ? void 0 : _c.length) {\n core.info('operations: processing labels');\n yield processLabels(governance.labels, commands);\n }\n });\n}\nexports.default = default_1;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (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};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst github_1 = require(\"../github\");\nconst github = __importStar(require(\"@actions/github\"));\nconst ignore_1 = require(\"../rules/ignore\");\nconst author_association_1 = require(\"../rules/author-association\");\nclass PrefixLabelSet {\n constructor(prefix) {\n this.needs = false;\n this.labels = new Set();\n this.existing = [];\n this.prefix = prefix;\n for (const label of github_1.getLabels()) {\n if (label === `needs/${prefix}`) {\n this.existing.push(label);\n this.needs = true;\n }\n else if (label.startsWith(`${prefix}/`)) {\n this.existing.push(label);\n this.add(label);\n }\n }\n }\n remove(label) {\n this.labels.delete(label);\n }\n add(label) {\n this.labels.add(label);\n this.last = label;\n }\n setMultiple(bool) {\n if (bool) {\n return;\n }\n this.labels.clear();\n if (this.last) {\n this.labels.add(this.last);\n }\n }\n setNeeds(bool) {\n this.needs = bool && this.labels.size === 0;\n }\n persist() {\n return __awaiter(this, void 0, void 0, function* () {\n const removes = [];\n const adds = [];\n for (const string of this.existing) {\n if (!this.labels.has(string)) {\n removes.push(string);\n }\n }\n for (const label of this.labels) {\n if (!this.existing.includes(label)) {\n adds.push(label);\n }\n }\n if (this.needs) {\n if (this.existing.includes(`needs/${this.prefix}`)) {\n // don't remove\n const index = removes.indexOf(`needs/${this.prefix}`);\n if (index > -1) {\n removes.splice(index, 1);\n }\n }\n else {\n // add missing\n adds.push(`needs/${this.prefix}`);\n }\n }\n yield github_1.removeLabels(removes);\n yield github_1.addLabels(adds);\n });\n }\n}\nfunction default_1(label, commands) {\n return __awaiter(this, void 0, void 0, function* () {\n const labelSet = new PrefixLabelSet(label.prefix);\n /**\n * Check if labeled is required\n */\n function needs() {\n const needCommands = [\n ...commands.prefix(`/needs ${label.prefix}`),\n ...commands.prefix(`/need ${label.prefix}`)\n ];\n if (needCommands.length) {\n return true;\n }\n if (labelSet.needs) {\n return true;\n }\n return !!label.needs;\n }\n /**\n * Compute labels to add and remove\n * @return whether any prefixed label is present\n */\n function computeLabels() {\n const removing = commands\n .prefix(`/${label.prefix}-remove`)\n .flatMap(add => add.args.map(value => `${label.prefix}/${value}`));\n for (const value of removing) {\n labelSet.remove(value);\n }\n const adding = commands\n .prefix(`/${label.prefix}`)\n .flatMap(add => add.args\n .filter(value => label.list.includes(value))\n .map(value => `${label.prefix}/${value}`));\n for (const value of adding) {\n labelSet.add(value);\n }\n }\n if (ignore_1.isCreatedOpened() &&\n author_association_1.isAuthorAssociationAllowed(label.author_association)) {\n computeLabels();\n }\n labelSet.setMultiple(label.multiple === undefined || label.multiple);\n labelSet.setNeeds(needs());\n yield labelSet.persist();\n if (labelSet.needs) {\n yield sendComment(label);\n }\n yield sendStatus(label, !labelSet.needs);\n });\n}\nexports.default = default_1;\n/**\n * This only run on opened action so that it's not duplicated everytime a user comment.\n *\n * @param label to send comment to\n */\nfunction sendComment(label) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n if (github.context.payload.action !== 'opened') {\n return;\n }\n if (typeof label.needs === 'boolean') {\n return;\n }\n // Post comment if needs.comment is available\n const comment = (_a = label.needs) === null || _a === void 0 ? void 0 : _a.comment;\n if (comment) {\n yield github_1.postComment(comment);\n }\n });\n}\nfunction sendStatus(label, success) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof label.needs === 'boolean') {\n return;\n }\n const status = (_a = label.needs) === null || _a === void 0 ? void 0 : _a.status;\n if (!status) {\n return;\n }\n function description() {\n var _a, _b;\n if (typeof (status === null || status === void 0 ? void 0 : status.description) === 'string') {\n return status === null || status === void 0 ? void 0 : status.description;\n }\n if (success) {\n return (_a = status === null || status === void 0 ? void 0 : status.description) === null || _a === void 0 ? void 0 : _a.success;\n }\n return (_b = status === null || status === void 0 ? void 0 : status.description) === null || _b === void 0 ? void 0 : _b.failure;\n }\n function state() {\n var _a;\n if (success) {\n return 'success';\n }\n if (typeof (status === null || status === void 0 ? void 0 : status.description) === 'string') {\n return 'failure';\n }\n if (typeof ((_a = status === null || status === void 0 ? void 0 : status.description) === null || _a === void 0 ? void 0 : _a.failure) === 'string') {\n return 'failure';\n }\n return 'pending';\n }\n yield github_1.commitStatus(status.context, state(), description(), status.url);\n });\n}\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isAuthorAssociationAllowed = void 0;\nconst github = __importStar(require(\"@actions/github\"));\nfunction getAuthorAssociation() {\n const payload = github.context.payload;\n const current = payload.comment || payload.pull_request || payload.issue;\n return current === null || current === void 0 ? void 0 : current.author_association;\n}\nfunction isCommentUserIssueAuthor() {\n var _a, _b, _c, _d;\n const payload = github.context.payload;\n return ((_b = (_a = payload.comment) === null || _a === void 0 ? void 0 : _a.user) === null || _b === void 0 ? void 0 : _b.login) === ((_d = (_c = payload.issue) === null || _c === void 0 ? void 0 : _c.user) === null || _d === void 0 ? void 0 : _d.login);\n}\nfunction isAuthorAssociationAllowed(authorAssociation) {\n if (!authorAssociation) {\n return true;\n }\n if (authorAssociation.author && isCommentUserIssueAuthor()) {\n return true;\n }\n switch (getAuthorAssociation()) {\n case 'COLLABORATOR':\n return !!authorAssociation.collaborator;\n case 'CONTRIBUTOR':\n return !!authorAssociation.contributor;\n case 'FIRST_TIMER':\n return !!authorAssociation.first_timer;\n case 'FIRST_TIME_CONTRIBUTOR':\n return !!authorAssociation.first_time_contributor;\n case 'MANNEQUIN':\n return !!authorAssociation.mannequin;\n case 'MEMBER':\n return !!authorAssociation.member;\n case 'NONE':\n return !!authorAssociation.none;\n case 'OWNER':\n return !!authorAssociation.owner;\n default:\n return false;\n }\n}\nexports.isAuthorAssociationAllowed = isAuthorAssociationAllowed;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (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};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isCreatedOpened = void 0;\nconst github = __importStar(require(\"@actions/github\"));\nconst core = __importStar(require(\"@actions/core\"));\nconst github_1 = require(\"../github\");\nfunction is(eventName, actions) {\n return (github.context.eventName === eventName &&\n actions.includes(github.context.payload.action));\n}\n/**\n * Ignore labeled race condition where it get created before needs labels.\n * Not sure what is a better way to do this.\n */\nfunction ignoreLabeledRaceCondition() {\n var _a, _b, _c, _d, _e, _f, _g;\n const payload = github.context.payload;\n if (((_a = payload.sender) === null || _a === void 0 ? void 0 : _a.type) !== 'User' &&\n github.context.payload.action === 'labeled') {\n return false;\n }\n if (is('issues', ['labeled'])) {\n return (Date.parse((_b = payload.issue) === null || _b === void 0 ? void 0 : _b.created_at) + 5000 >=\n Date.parse((_c = payload.issue) === null || _c === void 0 ? void 0 : _c.updated_at));\n }\n if (is('pull_request', ['labeled'])) {\n return (Date.parse((_d = payload.pull_request) === null || _d === void 0 ? void 0 : _d.created_at) + 5000 >=\n Date.parse((_e = payload.pull_request) === null || _e === void 0 ? void 0 : _e.updated_at));\n }\n if (is('pull_request_target', ['labeled'])) {\n return (Date.parse((_f = payload.pull_request) === null || _f === void 0 ? void 0 : _f.created_at) + 5000 >=\n Date.parse((_g = payload.pull_request) === null || _g === void 0 ? void 0 : _g.updated_at));\n }\n return false;\n}\n/**\n * Ignore non 'User' to prevent infinite loop.\n */\nfunction ignoreBot() {\n var _a, _b, _c, _d;\n const payload = github.context.payload;\n core.info(`ignore: ignore bot - type:${(_a = payload.sender) === null || _a === void 0 ? void 0 : _a.type} - login:${(_b = payload.sender) === null || _b === void 0 ? void 0 : _b.login}`);\n if (((_c = payload.sender) === null || _c === void 0 ? void 0 : _c.login) === 'dependabot[bot]') {\n return false;\n }\n return ((_d = payload.sender) === null || _d === void 0 ? void 0 : _d.type) !== 'User';\n}\n/**\n * Ignores if sender is self\n */\nfunction ignoreSelf() {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const payload = github.context.payload;\n // allow fail because with 'github-token' > 'resource not accessible by integration'\n try {\n return ((_a = payload.sender) === null || _a === void 0 ? void 0 : _a.id) === (yield github_1.getBotUserId());\n }\n catch (e) {\n return false;\n }\n });\n}\n/**\n * Closed issue and pull_request should not trigger governance\n */\nfunction ignoreClosed() {\n var _a, _b;\n const payload = github.context.payload;\n if (((_a = payload === null || payload === void 0 ? void 0 : payload.pull_request) === null || _a === void 0 ? void 0 : _a.state) === 'closed') {\n return true;\n }\n if (((_b = payload === null || payload === void 0 ? void 0 : payload.issue) === null || _b === void 0 ? void 0 : _b.state) === 'closed') {\n return true;\n }\n return false;\n}\n/**\n * To prevent mistakes, this will ignore invalid workflow trigger\n */\nfunction default_1() {\n return __awaiter(this, void 0, void 0, function* () {\n if (ignoreClosed()) {\n core.info('ignore: closed');\n return true;\n }\n if (ignoreLabeledRaceCondition()) {\n core.info('ignore: labeled race condition');\n return true;\n }\n if (yield ignoreSelf()) {\n if (is('pull_request_target', ['synchronize', 'opened'])) {\n return false;\n }\n core.info('ignore: ignore self');\n return true;\n }\n if (is('issue_comment', ['created'])) {\n return ignoreBot();\n }\n if (is('pull_request', ['synchronize', 'opened'])) {\n return ignoreBot();\n }\n if (is('pull_request', ['labeled', 'unlabeled'])) {\n return false;\n }\n if (is('pull_request_target', ['synchronize', 'opened'])) {\n return ignoreBot();\n }\n if (is('pull_request_target', ['labeled', 'unlabeled'])) {\n return false;\n }\n if (is('issues', ['opened'])) {\n return ignoreBot();\n }\n if (is('issues', ['labeled', 'unlabeled'])) {\n return false;\n }\n core.info('ignore: catch all');\n return true;\n });\n}\nexports.default = default_1;\nfunction isCreatedOpened() {\n if (is('issue_comment', ['created'])) {\n return true;\n }\n if (is('pull_request', ['opened'])) {\n return true;\n }\n if (is('pull_request_target', ['opened'])) {\n return true;\n }\n if (is('issues', ['opened'])) {\n return true;\n }\n return false;\n}\nexports.isCreatedOpened = isCreatedOpened;\n","\"use strict\";\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\n/**\n * Commands\n *\n * Command Format:\n * ::name key=value,key=value::message\n *\n * Examples:\n * ::warning::This is the message\n * ::set-env name=MY_VAR::some value\n */\nfunction issueCommand(command, properties, message) {\n const cmd = new Command(command, properties, message);\n process.stdout.write(cmd.toString() + os.EOL);\n}\nexports.issueCommand = issueCommand;\nfunction issue(name, message = '') {\n issueCommand(name, {}, message);\n}\nexports.issue = issue;\nconst CMD_STRING = '::';\nclass Command {\n constructor(command, properties, message) {\n if (!command) {\n command = 'missing.command';\n }\n this.command = command;\n this.properties = properties;\n this.message = message;\n }\n toString() {\n let cmdStr = CMD_STRING + this.command;\n if (this.properties && Object.keys(this.properties).length > 0) {\n cmdStr += ' ';\n let first = true;\n for (const key in this.properties) {\n if (this.properties.hasOwnProperty(key)) {\n const val = this.properties[key];\n if (val) {\n if (first) {\n first = false;\n }\n else {\n cmdStr += ',';\n }\n cmdStr += `${key}=${escapeProperty(val)}`;\n }\n }\n }\n }\n cmdStr += `${CMD_STRING}${escapeData(this.message)}`;\n return cmdStr;\n }\n}\nfunction escapeData(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A');\n}\nfunction escapeProperty(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A')\n .replace(/:/g, '%3A')\n .replace(/,/g, '%2C');\n}\n//# sourceMappingURL=command.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (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};\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst command_1 = require(\"./command\");\nconst file_command_1 = require(\"./file-command\");\nconst utils_1 = require(\"./utils\");\nconst os = __importStar(require(\"os\"));\nconst path = __importStar(require(\"path\"));\n/**\n * The code to exit an action\n */\nvar ExitCode;\n(function (ExitCode) {\n /**\n * A code indicating that the action was successful\n */\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\n /**\n * A code indicating that the action was a failure\n */\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\n})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));\n//-----------------------------------------------------------------------\n// Variables\n//-----------------------------------------------------------------------\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction exportVariable(name, val) {\n const convertedVal = utils_1.toCommandValue(val);\n process.env[name] = convertedVal;\n const filePath = process.env['GITHUB_ENV'] || '';\n if (filePath) {\n const delimiter = '_GitHubActionsFileCommandDelimeter_';\n const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;\n file_command_1.issueCommand('ENV', commandValue);\n }\n else {\n command_1.issueCommand('set-env', { name }, convertedVal);\n }\n}\nexports.exportVariable = exportVariable;\n/**\n * Registers a secret which will get masked from logs\n * @param secret value of the secret\n */\nfunction setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}\nexports.setSecret = setSecret;\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nfunction addPath(inputPath) {\n const filePath = process.env['GITHUB_PATH'] || '';\n if (filePath) {\n file_command_1.issueCommand('PATH', inputPath);\n }\n else {\n command_1.issueCommand('add-path', {}, inputPath);\n }\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\n}\nexports.addPath = addPath;\n/**\n * Gets the value of an input. The value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nfunction getInput(name, options) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`);\n }\n return val.trim();\n}\nexports.getInput = getInput;\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}\nexports.setOutput = setOutput;\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nfunction setCommandEcho(enabled) {\n command_1.issue('echo', enabled ? 'on' : 'off');\n}\nexports.setCommandEcho = setCommandEcho;\n//-----------------------------------------------------------------------\n// Results\n//-----------------------------------------------------------------------\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nfunction setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}\nexports.setFailed = setFailed;\n//-----------------------------------------------------------------------\n// Logging Commands\n//-----------------------------------------------------------------------\n/**\n * Gets whether Actions Step Debug is on or not\n */\nfunction isDebug() {\n return process.env['RUNNER_DEBUG'] === '1';\n}\nexports.isDebug = isDebug;\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nfunction debug(message) {\n command_1.issueCommand('debug', {}, message);\n}\nexports.debug = debug;\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n */\nfunction error(message) {\n command_1.issue('error', message instanceof Error ? message.toString() : message);\n}\nexports.error = error;\n/**\n * Adds an warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n */\nfunction warning(message) {\n command_1.issue('warning', message instanceof Error ? message.toString() : message);\n}\nexports.warning = warning;\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nfunction info(message) {\n process.stdout.write(message + os.EOL);\n}\nexports.info = info;\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nfunction startGroup(name) {\n command_1.issue('group', name);\n}\nexports.startGroup = startGroup;\n/**\n * End an output group.\n */\nfunction endGroup() {\n command_1.issue('endgroup');\n}\nexports.endGroup = endGroup;\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nfunction group(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n startGroup(name);\n let result;\n try {\n result = yield fn();\n }\n finally {\n endGroup();\n }\n return result;\n });\n}\nexports.group = group;\n//-----------------------------------------------------------------------\n// Wrapper action state\n//-----------------------------------------------------------------------\n/**\n * Saves state for current action, the state can only be retrieved by this action's post job execution.\n *\n * @param name name of the state to store\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction saveState(name, value) {\n command_1.issueCommand('save-state', { name }, value);\n}\nexports.saveState = saveState;\n/**\n * Gets the value of an state set by this action's main execution.\n *\n * @param name name of the state to get\n * @returns string\n */\nfunction getState(name) {\n return process.env[`STATE_${name}`] || '';\n}\nexports.getState = getState;\n//# sourceMappingURL=core.js.map","\"use strict\";\n// For internal use, subject to change.\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst fs = __importStar(require(\"fs\"));\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\nfunction issueCommand(command, message) {\n const filePath = process.env[`GITHUB_${command}`];\n if (!filePath) {\n throw new Error(`Unable to find environment variable for file command ${command}`);\n }\n if (!fs.existsSync(filePath)) {\n throw new Error(`Missing file at path: ${filePath}`);\n }\n fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {\n encoding: 'utf8'\n });\n}\nexports.issueCommand = issueCommand;\n//# sourceMappingURL=file-command.js.map","\"use strict\";\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nfunction toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}\nexports.toCommandValue = toCommandValue;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Context = void 0;\nconst fs_1 = require(\"fs\");\nconst os_1 = require(\"os\");\nclass Context {\n /**\n * Hydrate the context from the environment\n */\n constructor() {\n this.payload = {};\n if (process.env.GITHUB_EVENT_PATH) {\n if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {\n this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));\n }\n else {\n const path = process.env.GITHUB_EVENT_PATH;\n process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);\n }\n }\n this.eventName = process.env.GITHUB_EVENT_NAME;\n this.sha = process.env.GITHUB_SHA;\n this.ref = process.env.GITHUB_REF;\n this.workflow = process.env.GITHUB_WORKFLOW;\n this.action = process.env.GITHUB_ACTION;\n this.actor = process.env.GITHUB_ACTOR;\n this.job = process.env.GITHUB_JOB;\n this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10);\n this.runId = parseInt(process.env.GITHUB_RUN_ID, 10);\n }\n get issue() {\n const payload = this.payload;\n return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });\n }\n get repo() {\n if (process.env.GITHUB_REPOSITORY) {\n const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');\n return { owner, repo };\n }\n if (this.payload.repository) {\n return {\n owner: this.payload.repository.owner.login,\n repo: this.payload.repository.name\n };\n }\n throw new Error(\"context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'\");\n }\n}\nexports.Context = Context;\n//# sourceMappingURL=context.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getOctokit = exports.context = void 0;\nconst Context = __importStar(require(\"./context\"));\nconst utils_1 = require(\"./utils\");\nexports.context = new Context.Context();\n/**\n * Returns a hydrated octokit ready to use for GitHub Actions\n *\n * @param token the repo PAT or GITHUB_TOKEN\n * @param options other options to set\n */\nfunction getOctokit(token, options) {\n return new utils_1.GitHub(utils_1.getOctokitOptions(token, options));\n}\nexports.getOctokit = getOctokit;\n//# sourceMappingURL=github.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getApiBaseUrl = exports.getProxyAgent = exports.getAuthString = void 0;\nconst httpClient = __importStar(require(\"@actions/http-client\"));\nfunction getAuthString(token, options) {\n if (!token && !options.auth) {\n throw new Error('Parameter token or opts.auth is required');\n }\n else if (token && options.auth) {\n throw new Error('Parameters token and opts.auth may not both be specified');\n }\n return typeof options.auth === 'string' ? options.auth : `token ${token}`;\n}\nexports.getAuthString = getAuthString;\nfunction getProxyAgent(destinationUrl) {\n const hc = new httpClient.HttpClient();\n return hc.getAgent(destinationUrl);\n}\nexports.getProxyAgent = getProxyAgent;\nfunction getApiBaseUrl() {\n return process.env['GITHUB_API_URL'] || 'https://api.github.com';\n}\nexports.getApiBaseUrl = getApiBaseUrl;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getOctokitOptions = exports.GitHub = exports.context = void 0;\nconst Context = __importStar(require(\"./context\"));\nconst Utils = __importStar(require(\"./internal/utils\"));\n// octokit + plugins\nconst core_1 = require(\"@octokit/core\");\nconst plugin_rest_endpoint_methods_1 = require(\"@octokit/plugin-rest-endpoint-methods\");\nconst plugin_paginate_rest_1 = require(\"@octokit/plugin-paginate-rest\");\nexports.context = new Context.Context();\nconst baseUrl = Utils.getApiBaseUrl();\nconst defaults = {\n baseUrl,\n request: {\n agent: Utils.getProxyAgent(baseUrl)\n }\n};\nexports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(defaults);\n/**\n * Convience function to correctly format Octokit Options to pass into the constructor.\n *\n * @param token the repo PAT or GITHUB_TOKEN\n * @param options other options to set\n */\nfunction getOctokitOptions(token, options) {\n const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller\n // Auth\n const auth = Utils.getAuthString(token, opts);\n if (auth) {\n opts.auth = auth;\n }\n return opts;\n}\nexports.getOctokitOptions = getOctokitOptions;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst http = require(\"http\");\nconst https = require(\"https\");\nconst pm = require(\"./proxy\");\nlet tunnel;\nvar HttpCodes;\n(function (HttpCodes) {\n HttpCodes[HttpCodes[\"OK\"] = 200] = \"OK\";\n HttpCodes[HttpCodes[\"MultipleChoices\"] = 300] = \"MultipleChoices\";\n HttpCodes[HttpCodes[\"MovedPermanently\"] = 301] = \"MovedPermanently\";\n HttpCodes[HttpCodes[\"ResourceMoved\"] = 302] = \"ResourceMoved\";\n HttpCodes[HttpCodes[\"SeeOther\"] = 303] = \"SeeOther\";\n HttpCodes[HttpCodes[\"NotModified\"] = 304] = \"NotModified\";\n HttpCodes[HttpCodes[\"UseProxy\"] = 305] = \"UseProxy\";\n HttpCodes[HttpCodes[\"SwitchProxy\"] = 306] = \"SwitchProxy\";\n HttpCodes[HttpCodes[\"TemporaryRedirect\"] = 307] = \"TemporaryRedirect\";\n HttpCodes[HttpCodes[\"PermanentRedirect\"] = 308] = \"PermanentRedirect\";\n HttpCodes[HttpCodes[\"BadRequest\"] = 400] = \"BadRequest\";\n HttpCodes[HttpCodes[\"Unauthorized\"] = 401] = \"Unauthorized\";\n HttpCodes[HttpCodes[\"PaymentRequired\"] = 402] = \"PaymentRequired\";\n HttpCodes[HttpCodes[\"Forbidden\"] = 403] = \"Forbidden\";\n HttpCodes[HttpCodes[\"NotFound\"] = 404] = \"NotFound\";\n HttpCodes[HttpCodes[\"MethodNotAllowed\"] = 405] = \"MethodNotAllowed\";\n HttpCodes[HttpCodes[\"NotAcceptable\"] = 406] = \"NotAcceptable\";\n HttpCodes[HttpCodes[\"ProxyAuthenticationRequired\"] = 407] = \"ProxyAuthenticationRequired\";\n HttpCodes[HttpCodes[\"RequestTimeout\"] = 408] = \"RequestTimeout\";\n HttpCodes[HttpCodes[\"Conflict\"] = 409] = \"Conflict\";\n HttpCodes[HttpCodes[\"Gone\"] = 410] = \"Gone\";\n HttpCodes[HttpCodes[\"TooManyRequests\"] = 429] = \"TooManyRequests\";\n HttpCodes[HttpCodes[\"InternalServerError\"] = 500] = \"InternalServerError\";\n HttpCodes[HttpCodes[\"NotImplemented\"] = 501] = \"NotImplemented\";\n HttpCodes[HttpCodes[\"BadGateway\"] = 502] = \"BadGateway\";\n HttpCodes[HttpCodes[\"ServiceUnavailable\"] = 503] = \"ServiceUnavailable\";\n HttpCodes[HttpCodes[\"GatewayTimeout\"] = 504] = \"GatewayTimeout\";\n})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));\nvar Headers;\n(function (Headers) {\n Headers[\"Accept\"] = \"accept\";\n Headers[\"ContentType\"] = \"content-type\";\n})(Headers = exports.Headers || (exports.Headers = {}));\nvar MediaTypes;\n(function (MediaTypes) {\n MediaTypes[\"ApplicationJson\"] = \"application/json\";\n})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));\n/**\n * Returns the proxy URL, depending upon the supplied url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\nfunction getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}\nexports.getProxyUrl = getProxyUrl;\nconst HttpRedirectCodes = [\n HttpCodes.MovedPermanently,\n HttpCodes.ResourceMoved,\n HttpCodes.SeeOther,\n HttpCodes.TemporaryRedirect,\n HttpCodes.PermanentRedirect\n];\nconst HttpResponseRetryCodes = [\n HttpCodes.BadGateway,\n HttpCodes.ServiceUnavailable,\n HttpCodes.GatewayTimeout\n];\nconst RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];\nconst ExponentialBackoffCeiling = 10;\nconst ExponentialBackoffTimeSlice = 5;\nclass HttpClientError extends Error {\n constructor(message, statusCode) {\n super(message);\n this.name = 'HttpClientError';\n this.statusCode = statusCode;\n Object.setPrototypeOf(this, HttpClientError.prototype);\n }\n}\nexports.HttpClientError = HttpClientError;\nclass HttpClientResponse {\n constructor(message) {\n this.message = message;\n }\n readBody() {\n return new Promise(async (resolve, reject) => {\n let output = Buffer.alloc(0);\n this.message.on('data', (chunk) => {\n output = Buffer.concat([output, chunk]);\n });\n this.message.on('end', () => {\n resolve(output.toString());\n });\n });\n }\n}\nexports.HttpClientResponse = HttpClientResponse;\nfunction isHttps(requestUrl) {\n let parsedUrl = new URL(requestUrl);\n return parsedUrl.protocol === 'https:';\n}\nexports.isHttps = isHttps;\nclass HttpClient {\n constructor(userAgent, handlers, requestOptions) {\n this._ignoreSslError = false;\n this._allowRedirects = true;\n this._allowRedirectDowngrade = false;\n this._maxRedirects = 50;\n this._allowRetries = false;\n this._maxRetries = 1;\n this._keepAlive = false;\n this._disposed = false;\n this.userAgent = userAgent;\n this.handlers = handlers || [];\n this.requestOptions = requestOptions;\n if (requestOptions) {\n if (requestOptions.ignoreSslError != null) {\n this._ignoreSslError = requestOptions.ignoreSslError;\n }\n this._socketTimeout = requestOptions.socketTimeout;\n if (requestOptions.allowRedirects != null) {\n this._allowRedirects = requestOptions.allowRedirects;\n }\n if (requestOptions.allowRedirectDowngrade != null) {\n this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;\n }\n if (requestOptions.maxRedirects != null) {\n this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);\n }\n if (requestOptions.keepAlive != null) {\n this._keepAlive = requestOptions.keepAlive;\n }\n if (requestOptions.allowRetries != null) {\n this._allowRetries = requestOptions.allowRetries;\n }\n if (requestOptions.maxRetries != null) {\n this._maxRetries = requestOptions.maxRetries;\n }\n }\n }\n options(requestUrl, additionalHeaders) {\n return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});\n }\n get(requestUrl, additionalHeaders) {\n return this.request('GET', requestUrl, null, additionalHeaders || {});\n }\n del(requestUrl, additionalHeaders) {\n return this.request('DELETE', requestUrl, null, additionalHeaders || {});\n }\n post(requestUrl, data, additionalHeaders) {\n return this.request('POST', requestUrl, data, additionalHeaders || {});\n }\n patch(requestUrl, data, additionalHeaders) {\n return this.request('PATCH', requestUrl, data, additionalHeaders || {});\n }\n put(requestUrl, data, additionalHeaders) {\n return this.request('PUT', requestUrl, data, additionalHeaders || {});\n }\n head(requestUrl, additionalHeaders) {\n return this.request('HEAD', requestUrl, null, additionalHeaders || {});\n }\n sendStream(verb, requestUrl, stream, additionalHeaders) {\n return this.request(verb, requestUrl, stream, additionalHeaders);\n }\n /**\n * Gets a typed object from an endpoint\n * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise\n */\n async getJson(requestUrl, additionalHeaders = {}) {\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n let res = await this.get(requestUrl, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n }\n async postJson(requestUrl, obj, additionalHeaders = {}) {\n let data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n let res = await this.post(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n }\n async putJson(requestUrl, obj, additionalHeaders = {}) {\n let data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n let res = await this.put(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n }\n async patchJson(requestUrl, obj, additionalHeaders = {}) {\n let data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n let res = await this.patch(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n }\n /**\n * Makes a raw http request.\n * All other methods such as get, post, patch, and request ultimately call this.\n * Prefer get, del, post and patch\n */\n async request(verb, requestUrl, data, headers) {\n if (this._disposed) {\n throw new Error('Client has already been disposed.');\n }\n let parsedUrl = new URL(requestUrl);\n let info = this._prepareRequest(verb, parsedUrl, headers);\n // Only perform retries on reads since writes may not be idempotent.\n let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1\n ? this._maxRetries + 1\n : 1;\n let numTries = 0;\n let response;\n while (numTries < maxTries) {\n response = await this.requestRaw(info, data);\n // Check if it's an authentication challenge\n if (response &&\n response.message &&\n response.message.statusCode === HttpCodes.Unauthorized) {\n let authenticationHandler;\n for (let i = 0; i < this.handlers.length; i++) {\n if (this.handlers[i].canHandleAuthentication(response)) {\n authenticationHandler = this.handlers[i];\n break;\n }\n }\n if (authenticationHandler) {\n return authenticationHandler.handleAuthentication(this, info, data);\n }\n else {\n // We have received an unauthorized response but have no handlers to handle it.\n // Let the response return to the caller.\n return response;\n }\n }\n let redirectsRemaining = this._maxRedirects;\n while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 &&\n this._allowRedirects &&\n redirectsRemaining > 0) {\n const redirectUrl = response.message.headers['location'];\n if (!redirectUrl) {\n // if there's no location to redirect to, we won't\n break;\n }\n let parsedRedirectUrl = new URL(redirectUrl);\n if (parsedUrl.protocol == 'https:' &&\n parsedUrl.protocol != parsedRedirectUrl.protocol &&\n !this._allowRedirectDowngrade) {\n throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');\n }\n // we need to finish reading the response before reassigning response\n // which will leak the open socket.\n await response.readBody();\n // strip authorization header if redirected to a different hostname\n if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {\n for (let header in headers) {\n // header names are case insensitive\n if (header.toLowerCase() === 'authorization') {\n delete headers[header];\n }\n }\n }\n // let's make the request with the new redirectUrl\n info = this._prepareRequest(verb, parsedRedirectUrl, headers);\n response = await this.requestRaw(info, data);\n redirectsRemaining--;\n }\n if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {\n // If not a retry code, return immediately instead of retrying\n return response;\n }\n numTries += 1;\n if (numTries < maxTries) {\n await response.readBody();\n await this._performExponentialBackoff(numTries);\n }\n }\n return response;\n }\n /**\n * Needs to be called if keepAlive is set to true in request options.\n */\n dispose() {\n if (this._agent) {\n this._agent.destroy();\n }\n this._disposed = true;\n }\n /**\n * Raw request.\n * @param info\n * @param data\n */\n requestRaw(info, data) {\n return new Promise((resolve, reject) => {\n let callbackForResult = function (err, res) {\n if (err) {\n reject(err);\n }\n resolve(res);\n };\n this.requestRawWithCallback(info, data, callbackForResult);\n });\n }\n /**\n * Raw request with callback.\n * @param info\n * @param data\n * @param onResult\n */\n requestRawWithCallback(info, data, onResult) {\n let socket;\n if (typeof data === 'string') {\n info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n }\n let callbackCalled = false;\n let handleResult = (err, res) => {\n if (!callbackCalled) {\n callbackCalled = true;\n onResult(err, res);\n }\n };\n let req = info.httpModule.request(info.options, (msg) => {\n let res = new HttpClientResponse(msg);\n handleResult(null, res);\n });\n req.on('socket', sock => {\n socket = sock;\n });\n // If we ever get disconnected, we want the socket to timeout eventually\n req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n if (socket) {\n socket.end();\n }\n handleResult(new Error('Request timeout: ' + info.options.path), null);\n });\n req.on('error', function (err) {\n // err has statusCode property\n // res should have headers\n handleResult(err, null);\n });\n if (data && typeof data === 'string') {\n req.write(data, 'utf8');\n }\n if (data && typeof data !== 'string') {\n data.on('close', function () {\n req.end();\n });\n data.pipe(req);\n }\n else {\n req.end();\n }\n }\n /**\n * Gets an http agent. This function is useful when you need an http agent that handles\n * routing through a proxy server - depending upon the url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\n getAgent(serverUrl) {\n let parsedUrl = new URL(serverUrl);\n return this._getAgent(parsedUrl);\n }\n _prepareRequest(method, requestUrl, headers) {\n const info = {};\n info.parsedUrl = requestUrl;\n const usingSsl = info.parsedUrl.protocol === 'https:';\n info.httpModule = usingSsl ? https : http;\n const defaultPort = usingSsl ? 443 : 80;\n info.options = {};\n info.options.host = info.parsedUrl.hostname;\n info.options.port = info.parsedUrl.port\n ? parseInt(info.parsedUrl.port)\n : defaultPort;\n info.options.path =\n (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');\n info.options.method = method;\n info.options.headers = this._mergeHeaders(headers);\n if (this.userAgent != null) {\n info.options.headers['user-agent'] = this.userAgent;\n }\n info.options.agent = this._getAgent(info.parsedUrl);\n // gives handlers an opportunity to participate\n if (this.handlers) {\n this.handlers.forEach(handler => {\n handler.prepareRequest(info.options);\n });\n }\n return info;\n }\n _mergeHeaders(headers) {\n const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n if (this.requestOptions && this.requestOptions.headers) {\n return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));\n }\n return lowercaseKeys(headers || {});\n }\n _getExistingOrDefaultHeader(additionalHeaders, header, _default) {\n const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n let clientHeader;\n if (this.requestOptions && this.requestOptions.headers) {\n clientHeader = lowercaseKeys(this.requestOptions.headers)[header];\n }\n return additionalHeaders[header] || clientHeader || _default;\n }\n _getAgent(parsedUrl) {\n let agent;\n let proxyUrl = pm.getProxyUrl(parsedUrl);\n let useProxy = proxyUrl && proxyUrl.hostname;\n if (this._keepAlive && useProxy) {\n agent = this._proxyAgent;\n }\n if (this._keepAlive && !useProxy) {\n agent = this._agent;\n }\n // if agent is already assigned use that agent.\n if (!!agent) {\n return agent;\n }\n const usingSsl = parsedUrl.protocol === 'https:';\n let maxSockets = 100;\n if (!!this.requestOptions) {\n maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;\n }\n if (useProxy) {\n // If using proxy, need tunnel\n if (!tunnel) {\n tunnel = require('tunnel');\n }\n const agentOptions = {\n maxSockets: maxSockets,\n keepAlive: this._keepAlive,\n proxy: {\n proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`,\n host: proxyUrl.hostname,\n port: proxyUrl.port\n }\n };\n let tunnelAgent;\n const overHttps = proxyUrl.protocol === 'https:';\n if (usingSsl) {\n tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;\n }\n else {\n tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;\n }\n agent = tunnelAgent(agentOptions);\n this._proxyAgent = agent;\n }\n // if reusing agent across request and tunneling agent isn't assigned create a new agent\n if (this._keepAlive && !agent) {\n const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };\n agent = usingSsl ? new https.Agent(options) : new http.Agent(options);\n this._agent = agent;\n }\n // if not using private agent and tunnel agent isn't setup then use global agent\n if (!agent) {\n agent = usingSsl ? https.globalAgent : http.globalAgent;\n }\n if (usingSsl && this._ignoreSslError) {\n // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n // we have to cast it to any and change it directly\n agent.options = Object.assign(agent.options || {}, {\n rejectUnauthorized: false\n });\n }\n return agent;\n }\n _performExponentialBackoff(retryNumber) {\n retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);\n const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);\n return new Promise(resolve => setTimeout(() => resolve(), ms));\n }\n static dateTimeDeserializer(key, value) {\n if (typeof value === 'string') {\n let a = new Date(value);\n if (!isNaN(a.valueOf())) {\n return a;\n }\n }\n return value;\n }\n async _processResponse(res, options) {\n return new Promise(async (resolve, reject) => {\n const statusCode = res.message.statusCode;\n const response = {\n statusCode: statusCode,\n result: null,\n headers: {}\n };\n // not found leads to null obj returned\n if (statusCode == HttpCodes.NotFound) {\n resolve(response);\n }\n let obj;\n let contents;\n // get the result from the body\n try {\n contents = await res.readBody();\n if (contents && contents.length > 0) {\n if (options && options.deserializeDates) {\n obj = JSON.parse(contents, HttpClient.dateTimeDeserializer);\n }\n else {\n obj = JSON.parse(contents);\n }\n response.result = obj;\n }\n response.headers = res.message.headers;\n }\n catch (err) {\n // Invalid resource (contents not json); leaving result obj null\n }\n // note that 3xx redirects are handled by the http layer.\n if (statusCode > 299) {\n let msg;\n // if exception/error in body, attempt to get better error\n if (obj && obj.message) {\n msg = obj.message;\n }\n else if (contents && contents.length > 0) {\n // it may be the case that the exception is in the body message as string\n msg = contents;\n }\n else {\n msg = 'Failed request: (' + statusCode + ')';\n }\n let err = new HttpClientError(msg, statusCode);\n err.result = response.result;\n reject(err);\n }\n else {\n resolve(response);\n }\n });\n }\n}\nexports.HttpClient = HttpClient;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction getProxyUrl(reqUrl) {\n let usingSsl = reqUrl.protocol === 'https:';\n let proxyUrl;\n if (checkBypass(reqUrl)) {\n return proxyUrl;\n }\n let proxyVar;\n if (usingSsl) {\n proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY'];\n }\n else {\n proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY'];\n }\n if (proxyVar) {\n proxyUrl = new URL(proxyVar);\n }\n return proxyUrl;\n}\nexports.getProxyUrl = getProxyUrl;\nfunction checkBypass(reqUrl) {\n if (!reqUrl.hostname) {\n return false;\n }\n let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';\n if (!noProxy) {\n return false;\n }\n // Determine the request port\n let reqPort;\n if (reqUrl.port) {\n reqPort = Number(reqUrl.port);\n }\n else if (reqUrl.protocol === 'http:') {\n reqPort = 80;\n }\n else if (reqUrl.protocol === 'https:') {\n reqPort = 443;\n }\n // Format the request hostname and hostname with port\n let upperReqHosts = [reqUrl.hostname.toUpperCase()];\n if (typeof reqPort === 'number') {\n upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);\n }\n // Compare request host against noproxy\n for (let upperNoProxyItem of noProxy\n .split(',')\n .map(x => x.trim().toUpperCase())\n .filter(x => x)) {\n if (upperReqHosts.some(x => x === upperNoProxyItem)) {\n return true;\n }\n }\n return false;\n}\nexports.checkBypass = checkBypass;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nasync function auth(token) {\n const tokenType = token.split(/\\./).length === 3 ? \"app\" : /^v\\d+\\./.test(token) ? \"installation\" : \"oauth\";\n return {\n type: \"token\",\n token: token,\n tokenType\n };\n}\n\n/**\n * Prefix token for usage in the Authorization header\n *\n * @param token OAuth token or JSON Web Token\n */\nfunction withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n\n return `token ${token}`;\n}\n\nasync function hook(token, request, route, parameters) {\n const endpoint = request.endpoint.merge(route, parameters);\n endpoint.headers.authorization = withAuthorizationPrefix(token);\n return request(endpoint);\n}\n\nconst createTokenAuth = function createTokenAuth(token) {\n if (!token) {\n throw new Error(\"[@octokit/auth-token] No token passed to createTokenAuth\");\n }\n\n if (typeof token !== \"string\") {\n throw new Error(\"[@octokit/auth-token] Token passed to createTokenAuth is not a string\");\n }\n\n token = token.replace(/^(token|bearer) +/i, \"\");\n return Object.assign(auth.bind(null, token), {\n hook: hook.bind(null, token)\n });\n};\n\nexports.createTokenAuth = createTokenAuth;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar universalUserAgent = require('universal-user-agent');\nvar beforeAfterHook = require('before-after-hook');\nvar request = require('@octokit/request');\nvar graphql = require('@octokit/graphql');\nvar authToken = require('@octokit/auth-token');\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nconst VERSION = \"3.2.5\";\n\nclass Octokit {\n constructor(options = {}) {\n const hook = new beforeAfterHook.Collection();\n const requestDefaults = {\n baseUrl: request.request.endpoint.DEFAULTS.baseUrl,\n headers: {},\n request: Object.assign({}, options.request, {\n hook: hook.bind(null, \"request\")\n }),\n mediaType: {\n previews: [],\n format: \"\"\n }\n }; // prepend default user agent with `options.userAgent` if set\n\n requestDefaults.headers[\"user-agent\"] = [options.userAgent, `octokit-core.js/${VERSION} ${universalUserAgent.getUserAgent()}`].filter(Boolean).join(\" \");\n\n if (options.baseUrl) {\n requestDefaults.baseUrl = options.baseUrl;\n }\n\n if (options.previews) {\n requestDefaults.mediaType.previews = options.previews;\n }\n\n if (options.timeZone) {\n requestDefaults.headers[\"time-zone\"] = options.timeZone;\n }\n\n this.request = request.request.defaults(requestDefaults);\n this.graphql = graphql.withCustomRequest(this.request).defaults(requestDefaults);\n this.log = Object.assign({\n debug: () => {},\n info: () => {},\n warn: console.warn.bind(console),\n error: console.error.bind(console)\n }, options.log);\n this.hook = hook; // (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance\n // is unauthenticated. The `this.auth()` method is a no-op and no request hook is registered.\n // (2) If only `options.auth` is set, use the default token authentication strategy.\n // (3) If `options.authStrategy` is set then use it and pass in `options.auth`. Always pass own request as many strategies accept a custom request instance.\n // TODO: type `options.auth` based on `options.authStrategy`.\n\n if (!options.authStrategy) {\n if (!options.auth) {\n // (1)\n this.auth = async () => ({\n type: \"unauthenticated\"\n });\n } else {\n // (2)\n const auth = authToken.createTokenAuth(options.auth); // @ts-ignore ¯\\_(ツ)_/¯\n\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n }\n } else {\n const {\n authStrategy\n } = options,\n otherOptions = _objectWithoutProperties(options, [\"authStrategy\"]);\n\n const auth = authStrategy(Object.assign({\n request: this.request,\n log: this.log,\n // we pass the current octokit instance as well as its constructor options\n // to allow for authentication strategies that return a new octokit instance\n // that shares the same internal state as the current one. The original\n // requirement for this was the \"event-octokit\" authentication strategy\n // of https://github.com/probot/octokit-auth-probot.\n octokit: this,\n octokitOptions: otherOptions\n }, options.auth)); // @ts-ignore ¯\\_(ツ)_/¯\n\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n } // apply plugins\n // https://stackoverflow.com/a/16345172\n\n\n const classConstructor = this.constructor;\n classConstructor.plugins.forEach(plugin => {\n Object.assign(this, plugin(this, options));\n });\n }\n\n static defaults(defaults) {\n const OctokitWithDefaults = class extends this {\n constructor(...args) {\n const options = args[0] || {};\n\n if (typeof defaults === \"function\") {\n super(defaults(options));\n return;\n }\n\n super(Object.assign({}, defaults, options, options.userAgent && defaults.userAgent ? {\n userAgent: `${options.userAgent} ${defaults.userAgent}`\n } : null));\n }\n\n };\n return OctokitWithDefaults;\n }\n /**\n * Attach a plugin (or many) to your Octokit instance.\n *\n * @example\n * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)\n */\n\n\n static plugin(...newPlugins) {\n var _a;\n\n const currentPlugins = this.plugins;\n const NewOctokit = (_a = class extends this {}, _a.plugins = currentPlugins.concat(newPlugins.filter(plugin => !currentPlugins.includes(plugin))), _a);\n return NewOctokit;\n }\n\n}\nOctokit.VERSION = VERSION;\nOctokit.plugins = [];\n\nexports.Octokit = Octokit;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar isPlainObject = require('is-plain-object');\nvar universalUserAgent = require('universal-user-agent');\n\nfunction lowercaseKeys(object) {\n if (!object) {\n return {};\n }\n\n return Object.keys(object).reduce((newObj, key) => {\n newObj[key.toLowerCase()] = object[key];\n return newObj;\n }, {});\n}\n\nfunction mergeDeep(defaults, options) {\n const result = Object.assign({}, defaults);\n Object.keys(options).forEach(key => {\n if (isPlainObject.isPlainObject(options[key])) {\n if (!(key in defaults)) Object.assign(result, {\n [key]: options[key]\n });else result[key] = mergeDeep(defaults[key], options[key]);\n } else {\n Object.assign(result, {\n [key]: options[key]\n });\n }\n });\n return result;\n}\n\nfunction removeUndefinedProperties(obj) {\n for (const key in obj) {\n if (obj[key] === undefined) {\n delete obj[key];\n }\n }\n\n return obj;\n}\n\nfunction merge(defaults, route, options) {\n if (typeof route === \"string\") {\n let [method, url] = route.split(\" \");\n options = Object.assign(url ? {\n method,\n url\n } : {\n url: method\n }, options);\n } else {\n options = Object.assign({}, route);\n } // lowercase header names before merging with defaults to avoid duplicates\n\n\n options.headers = lowercaseKeys(options.headers); // remove properties with undefined values before merging\n\n removeUndefinedProperties(options);\n removeUndefinedProperties(options.headers);\n const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten\n\n if (defaults && defaults.mediaType.previews.length) {\n mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);\n }\n\n mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, \"\"));\n return mergedOptions;\n}\n\nfunction addQueryParameters(url, parameters) {\n const separator = /\\?/.test(url) ? \"&\" : \"?\";\n const names = Object.keys(parameters);\n\n if (names.length === 0) {\n return url;\n }\n\n return url + separator + names.map(name => {\n if (name === \"q\") {\n return \"q=\" + parameters.q.split(\"+\").map(encodeURIComponent).join(\"+\");\n }\n\n return `${name}=${encodeURIComponent(parameters[name])}`;\n }).join(\"&\");\n}\n\nconst urlVariableRegex = /\\{[^}]+\\}/g;\n\nfunction removeNonChars(variableName) {\n return variableName.replace(/^\\W+|\\W+$/g, \"\").split(/,/);\n}\n\nfunction extractUrlVariableNames(url) {\n const matches = url.match(urlVariableRegex);\n\n if (!matches) {\n return [];\n }\n\n return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);\n}\n\nfunction omit(object, keysToOmit) {\n return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {\n obj[key] = object[key];\n return obj;\n }, {});\n}\n\n// Based on https://github.com/bramstein/url-template, licensed under BSD\n// TODO: create separate package.\n//\n// Copyright (c) 2012-2014, Bram Stein\n// All rights reserved.\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions\n// are met:\n// 1. Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// 2. Redistributions in binary form must reproduce the above copyright\n// notice, this list of conditions and the following disclaimer in the\n// documentation and/or other materials provided with the distribution.\n// 3. The name of the author may not be used to endorse or promote products\n// derived from this software without specific prior written permission.\n// THIS SOFTWARE IS PROVIDED BY THE AUTHOR \"AS IS\" AND ANY EXPRESS OR IMPLIED\n// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n// EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n/* istanbul ignore file */\nfunction encodeReserved(str) {\n return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {\n if (!/%[0-9A-Fa-f]/.test(part)) {\n part = encodeURI(part).replace(/%5B/g, \"[\").replace(/%5D/g, \"]\");\n }\n\n return part;\n }).join(\"\");\n}\n\nfunction encodeUnreserved(str) {\n return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {\n return \"%\" + c.charCodeAt(0).toString(16).toUpperCase();\n });\n}\n\nfunction encodeValue(operator, value, key) {\n value = operator === \"+\" || operator === \"#\" ? encodeReserved(value) : encodeUnreserved(value);\n\n if (key) {\n return encodeUnreserved(key) + \"=\" + value;\n } else {\n return value;\n }\n}\n\nfunction isDefined(value) {\n return value !== undefined && value !== null;\n}\n\nfunction isKeyOperator(operator) {\n return operator === \";\" || operator === \"&\" || operator === \"?\";\n}\n\nfunction getValues(context, operator, key, modifier) {\n var value = context[key],\n result = [];\n\n if (isDefined(value) && value !== \"\") {\n if (typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") {\n value = value.toString();\n\n if (modifier && modifier !== \"*\") {\n value = value.substring(0, parseInt(modifier, 10));\n }\n\n result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : \"\"));\n } else {\n if (modifier === \"*\") {\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function (value) {\n result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : \"\"));\n });\n } else {\n Object.keys(value).forEach(function (k) {\n if (isDefined(value[k])) {\n result.push(encodeValue(operator, value[k], k));\n }\n });\n }\n } else {\n const tmp = [];\n\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function (value) {\n tmp.push(encodeValue(operator, value));\n });\n } else {\n Object.keys(value).forEach(function (k) {\n if (isDefined(value[k])) {\n tmp.push(encodeUnreserved(k));\n tmp.push(encodeValue(operator, value[k].toString()));\n }\n });\n }\n\n if (isKeyOperator(operator)) {\n result.push(encodeUnreserved(key) + \"=\" + tmp.join(\",\"));\n } else if (tmp.length !== 0) {\n result.push(tmp.join(\",\"));\n }\n }\n }\n } else {\n if (operator === \";\") {\n if (isDefined(value)) {\n result.push(encodeUnreserved(key));\n }\n } else if (value === \"\" && (operator === \"&\" || operator === \"?\")) {\n result.push(encodeUnreserved(key) + \"=\");\n } else if (value === \"\") {\n result.push(\"\");\n }\n }\n\n return result;\n}\n\nfunction parseUrl(template) {\n return {\n expand: expand.bind(null, template)\n };\n}\n\nfunction expand(template, context) {\n var operators = [\"+\", \"#\", \".\", \"/\", \";\", \"?\", \"&\"];\n return template.replace(/\\{([^\\{\\}]+)\\}|([^\\{\\}]+)/g, function (_, expression, literal) {\n if (expression) {\n let operator = \"\";\n const values = [];\n\n if (operators.indexOf(expression.charAt(0)) !== -1) {\n operator = expression.charAt(0);\n expression = expression.substr(1);\n }\n\n expression.split(/,/g).forEach(function (variable) {\n var tmp = /([^:\\*]*)(?::(\\d+)|(\\*))?/.exec(variable);\n values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));\n });\n\n if (operator && operator !== \"+\") {\n var separator = \",\";\n\n if (operator === \"?\") {\n separator = \"&\";\n } else if (operator !== \"#\") {\n separator = operator;\n }\n\n return (values.length !== 0 ? operator : \"\") + values.join(separator);\n } else {\n return values.join(\",\");\n }\n } else {\n return encodeReserved(literal);\n }\n });\n}\n\nfunction parse(options) {\n // https://fetch.spec.whatwg.org/#methods\n let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible\n\n let url = (options.url || \"/\").replace(/:([a-z]\\w+)/g, \"{$1}\");\n let headers = Object.assign({}, options.headers);\n let body;\n let parameters = omit(options, [\"method\", \"baseUrl\", \"url\", \"headers\", \"request\", \"mediaType\"]); // extract variable names from URL to calculate remaining variables later\n\n const urlVariableNames = extractUrlVariableNames(url);\n url = parseUrl(url).expand(parameters);\n\n if (!/^http/.test(url)) {\n url = options.baseUrl + url;\n }\n\n const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat(\"baseUrl\");\n const remainingParameters = omit(parameters, omittedParameters);\n const isBinaryRequest = /application\\/octet-stream/i.test(headers.accept);\n\n if (!isBinaryRequest) {\n if (options.mediaType.format) {\n // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw\n headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\\/vnd(\\.\\w+)(\\.v3)?(\\.\\w+)?(\\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(\",\");\n }\n\n if (options.mediaType.previews.length) {\n const previewsFromAcceptHeader = headers.accept.match(/[\\w-]+(?=-preview)/g) || [];\n headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {\n const format = options.mediaType.format ? `.${options.mediaType.format}` : \"+json\";\n return `application/vnd.github.${preview}-preview${format}`;\n }).join(\",\");\n }\n } // for GET/HEAD requests, set URL query parameters from remaining parameters\n // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters\n\n\n if ([\"GET\", \"HEAD\"].includes(method)) {\n url = addQueryParameters(url, remainingParameters);\n } else {\n if (\"data\" in remainingParameters) {\n body = remainingParameters.data;\n } else {\n if (Object.keys(remainingParameters).length) {\n body = remainingParameters;\n } else {\n headers[\"content-length\"] = 0;\n }\n }\n } // default content-type for JSON if body is set\n\n\n if (!headers[\"content-type\"] && typeof body !== \"undefined\") {\n headers[\"content-type\"] = \"application/json; charset=utf-8\";\n } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.\n // fetch does not allow to set `content-length` header, but we can set body to an empty string\n\n\n if ([\"PATCH\", \"PUT\"].includes(method) && typeof body === \"undefined\") {\n body = \"\";\n } // Only return body/request keys if present\n\n\n return Object.assign({\n method,\n url,\n headers\n }, typeof body !== \"undefined\" ? {\n body\n } : null, options.request ? {\n request: options.request\n } : null);\n}\n\nfunction endpointWithDefaults(defaults, route, options) {\n return parse(merge(defaults, route, options));\n}\n\nfunction withDefaults(oldDefaults, newDefaults) {\n const DEFAULTS = merge(oldDefaults, newDefaults);\n const endpoint = endpointWithDefaults.bind(null, DEFAULTS);\n return Object.assign(endpoint, {\n DEFAULTS,\n defaults: withDefaults.bind(null, DEFAULTS),\n merge: merge.bind(null, DEFAULTS),\n parse\n });\n}\n\nconst VERSION = \"6.0.11\";\n\nconst userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.\n// So we use RequestParameters and add method as additional required property.\n\nconst DEFAULTS = {\n method: \"GET\",\n baseUrl: \"https://api.github.com\",\n headers: {\n accept: \"application/vnd.github.v3+json\",\n \"user-agent\": userAgent\n },\n mediaType: {\n format: \"\",\n previews: []\n }\n};\n\nconst endpoint = withDefaults(null, DEFAULTS);\n\nexports.endpoint = endpoint;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar request = require('@octokit/request');\nvar universalUserAgent = require('universal-user-agent');\n\nconst VERSION = \"4.6.0\";\n\nclass GraphqlError extends Error {\n constructor(request, response) {\n const message = response.data.errors[0].message;\n super(message);\n Object.assign(this, response.data);\n Object.assign(this, {\n headers: response.headers\n });\n this.name = \"GraphqlError\";\n this.request = request; // Maintains proper stack trace (only available on V8)\n\n /* istanbul ignore next */\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n }\n\n}\n\nconst NON_VARIABLE_OPTIONS = [\"method\", \"baseUrl\", \"url\", \"headers\", \"request\", \"query\", \"mediaType\"];\nconst GHES_V3_SUFFIX_REGEX = /\\/api\\/v3\\/?$/;\nfunction graphql(request, query, options) {\n if (typeof query === \"string\" && options && \"query\" in options) {\n return Promise.reject(new Error(`[@octokit/graphql] \"query\" cannot be used as variable name`));\n }\n\n const parsedOptions = typeof query === \"string\" ? Object.assign({\n query\n }, options) : query;\n const requestOptions = Object.keys(parsedOptions).reduce((result, key) => {\n if (NON_VARIABLE_OPTIONS.includes(key)) {\n result[key] = parsedOptions[key];\n return result;\n }\n\n if (!result.variables) {\n result.variables = {};\n }\n\n result.variables[key] = parsedOptions[key];\n return result;\n }, {}); // workaround for GitHub Enterprise baseUrl set with /api/v3 suffix\n // https://github.com/octokit/auth-app.js/issues/111#issuecomment-657610451\n\n const baseUrl = parsedOptions.baseUrl || request.endpoint.DEFAULTS.baseUrl;\n\n if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {\n requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, \"/api/graphql\");\n }\n\n return request(requestOptions).then(response => {\n if (response.data.errors) {\n const headers = {};\n\n for (const key of Object.keys(response.headers)) {\n headers[key] = response.headers[key];\n }\n\n throw new GraphqlError(requestOptions, {\n headers,\n data: response.data\n });\n }\n\n return response.data.data;\n });\n}\n\nfunction withDefaults(request$1, newDefaults) {\n const newRequest = request$1.defaults(newDefaults);\n\n const newApi = (query, options) => {\n return graphql(newRequest, query, options);\n };\n\n return Object.assign(newApi, {\n defaults: withDefaults.bind(null, newRequest),\n endpoint: request.request.endpoint\n });\n}\n\nconst graphql$1 = withDefaults(request.request, {\n headers: {\n \"user-agent\": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`\n },\n method: \"POST\",\n url: \"/graphql\"\n});\nfunction withCustomRequest(customRequest) {\n return withDefaults(customRequest, {\n method: \"POST\",\n url: \"/graphql\"\n });\n}\n\nexports.graphql = graphql$1;\nexports.withCustomRequest = withCustomRequest;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst VERSION = \"2.9.1\";\n\n/**\n * Some “list” response that can be paginated have a different response structure\n *\n * They have a `total_count` key in the response (search also has `incomplete_results`,\n * /installation/repositories also has `repository_selection`), as well as a key with\n * the list of the items which name varies from endpoint to endpoint.\n *\n * Octokit normalizes these responses so that paginated results are always returned following\n * the same structure. One challenge is that if the list response has only one page, no Link\n * header is provided, so this header alone is not sufficient to check wether a response is\n * paginated or not.\n *\n * We check if a \"total_count\" key is present in the response data, but also make sure that\n * a \"url\" property is not, as the \"Get the combined status for a specific ref\" endpoint would\n * otherwise match: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref\n */\nfunction normalizePaginatedListResponse(response) {\n const responseNeedsNormalization = \"total_count\" in response.data && !(\"url\" in response.data);\n if (!responseNeedsNormalization) return response; // keep the additional properties intact as there is currently no other way\n // to retrieve the same information.\n\n const incompleteResults = response.data.incomplete_results;\n const repositorySelection = response.data.repository_selection;\n const totalCount = response.data.total_count;\n delete response.data.incomplete_results;\n delete response.data.repository_selection;\n delete response.data.total_count;\n const namespaceKey = Object.keys(response.data)[0];\n const data = response.data[namespaceKey];\n response.data = data;\n\n if (typeof incompleteResults !== \"undefined\") {\n response.data.incomplete_results = incompleteResults;\n }\n\n if (typeof repositorySelection !== \"undefined\") {\n response.data.repository_selection = repositorySelection;\n }\n\n response.data.total_count = totalCount;\n return response;\n}\n\nfunction iterator(octokit, route, parameters) {\n const options = typeof route === \"function\" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);\n const requestMethod = typeof route === \"function\" ? route : octokit.request;\n const method = options.method;\n const headers = options.headers;\n let url = options.url;\n return {\n [Symbol.asyncIterator]: () => ({\n async next() {\n if (!url) return {\n done: true\n };\n const response = await requestMethod({\n method,\n url,\n headers\n });\n const normalizedResponse = normalizePaginatedListResponse(response); // `response.headers.link` format:\n // '; rel=\"next\", ; rel=\"last\"'\n // sets `url` to undefined if \"next\" URL is not present or `link` header is not set\n\n url = ((normalizedResponse.headers.link || \"\").match(/<([^>]+)>;\\s*rel=\"next\"/) || [])[1];\n return {\n value: normalizedResponse\n };\n }\n\n })\n };\n}\n\nfunction paginate(octokit, route, parameters, mapFn) {\n if (typeof parameters === \"function\") {\n mapFn = parameters;\n parameters = undefined;\n }\n\n return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn);\n}\n\nfunction gather(octokit, results, iterator, mapFn) {\n return iterator.next().then(result => {\n if (result.done) {\n return results;\n }\n\n let earlyExit = false;\n\n function done() {\n earlyExit = true;\n }\n\n results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data);\n\n if (earlyExit) {\n return results;\n }\n\n return gather(octokit, results, iterator, mapFn);\n });\n}\n\nconst composePaginateRest = Object.assign(paginate, {\n iterator\n});\n\n/**\n * @param octokit Octokit instance\n * @param options Options passed to Octokit constructor\n */\n\nfunction paginateRest(octokit) {\n return {\n paginate: Object.assign(paginate.bind(null, octokit), {\n iterator: iterator.bind(null, octokit)\n })\n };\n}\npaginateRest.VERSION = VERSION;\n\nexports.composePaginateRest = composePaginateRest;\nexports.paginateRest = paginateRest;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst Endpoints = {\n actions: {\n addSelectedRepoToOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\"],\n cancelWorkflowRun: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel\"],\n createOrUpdateOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}\"],\n createOrUpdateRepoSecret: [\"PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n createRegistrationTokenForOrg: [\"POST /orgs/{org}/actions/runners/registration-token\"],\n createRegistrationTokenForRepo: [\"POST /repos/{owner}/{repo}/actions/runners/registration-token\"],\n createRemoveTokenForOrg: [\"POST /orgs/{org}/actions/runners/remove-token\"],\n createRemoveTokenForRepo: [\"POST /repos/{owner}/{repo}/actions/runners/remove-token\"],\n createWorkflowDispatch: [\"POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches\"],\n deleteArtifact: [\"DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\"],\n deleteOrgSecret: [\"DELETE /orgs/{org}/actions/secrets/{secret_name}\"],\n deleteRepoSecret: [\"DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n deleteSelfHostedRunnerFromOrg: [\"DELETE /orgs/{org}/actions/runners/{runner_id}\"],\n deleteSelfHostedRunnerFromRepo: [\"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}\"],\n deleteWorkflowRun: [\"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}\"],\n deleteWorkflowRunLogs: [\"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs\"],\n disableSelectedRepositoryGithubActionsOrganization: [\"DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}\"],\n disableWorkflow: [\"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable\"],\n downloadArtifact: [\"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}\"],\n downloadJobLogsForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs\"],\n downloadWorkflowRunLogs: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs\"],\n enableSelectedRepositoryGithubActionsOrganization: [\"PUT /orgs/{org}/actions/permissions/repositories/{repository_id}\"],\n enableWorkflow: [\"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable\"],\n getAllowedActionsOrganization: [\"GET /orgs/{org}/actions/permissions/selected-actions\"],\n getAllowedActionsRepository: [\"GET /repos/{owner}/{repo}/actions/permissions/selected-actions\"],\n getArtifact: [\"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\"],\n getGithubActionsPermissionsOrganization: [\"GET /orgs/{org}/actions/permissions\"],\n getGithubActionsPermissionsRepository: [\"GET /repos/{owner}/{repo}/actions/permissions\"],\n getJobForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/jobs/{job_id}\"],\n getOrgPublicKey: [\"GET /orgs/{org}/actions/secrets/public-key\"],\n getOrgSecret: [\"GET /orgs/{org}/actions/secrets/{secret_name}\"],\n getRepoPermissions: [\"GET /repos/{owner}/{repo}/actions/permissions\", {}, {\n renamed: [\"actions\", \"getGithubActionsPermissionsRepository\"]\n }],\n getRepoPublicKey: [\"GET /repos/{owner}/{repo}/actions/secrets/public-key\"],\n getRepoSecret: [\"GET /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n getSelfHostedRunnerForOrg: [\"GET /orgs/{org}/actions/runners/{runner_id}\"],\n getSelfHostedRunnerForRepo: [\"GET /repos/{owner}/{repo}/actions/runners/{runner_id}\"],\n getWorkflow: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}\"],\n getWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}\"],\n getWorkflowRunUsage: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing\"],\n getWorkflowUsage: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing\"],\n listArtifactsForRepo: [\"GET /repos/{owner}/{repo}/actions/artifacts\"],\n listJobsForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs\"],\n listOrgSecrets: [\"GET /orgs/{org}/actions/secrets\"],\n listRepoSecrets: [\"GET /repos/{owner}/{repo}/actions/secrets\"],\n listRepoWorkflows: [\"GET /repos/{owner}/{repo}/actions/workflows\"],\n listRunnerApplicationsForOrg: [\"GET /orgs/{org}/actions/runners/downloads\"],\n listRunnerApplicationsForRepo: [\"GET /repos/{owner}/{repo}/actions/runners/downloads\"],\n listSelectedReposForOrgSecret: [\"GET /orgs/{org}/actions/secrets/{secret_name}/repositories\"],\n listSelectedRepositoriesEnabledGithubActionsOrganization: [\"GET /orgs/{org}/actions/permissions/repositories\"],\n listSelfHostedRunnersForOrg: [\"GET /orgs/{org}/actions/runners\"],\n listSelfHostedRunnersForRepo: [\"GET /repos/{owner}/{repo}/actions/runners\"],\n listWorkflowRunArtifacts: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts\"],\n listWorkflowRuns: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs\"],\n listWorkflowRunsForRepo: [\"GET /repos/{owner}/{repo}/actions/runs\"],\n reRunWorkflow: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun\"],\n removeSelectedRepoFromOrgSecret: [\"DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\"],\n setAllowedActionsOrganization: [\"PUT /orgs/{org}/actions/permissions/selected-actions\"],\n setAllowedActionsRepository: [\"PUT /repos/{owner}/{repo}/actions/permissions/selected-actions\"],\n setGithubActionsPermissionsOrganization: [\"PUT /orgs/{org}/actions/permissions\"],\n setGithubActionsPermissionsRepository: [\"PUT /repos/{owner}/{repo}/actions/permissions\"],\n setSelectedReposForOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories\"],\n setSelectedRepositoriesEnabledGithubActionsOrganization: [\"PUT /orgs/{org}/actions/permissions/repositories\"]\n },\n activity: {\n checkRepoIsStarredByAuthenticatedUser: [\"GET /user/starred/{owner}/{repo}\"],\n deleteRepoSubscription: [\"DELETE /repos/{owner}/{repo}/subscription\"],\n deleteThreadSubscription: [\"DELETE /notifications/threads/{thread_id}/subscription\"],\n getFeeds: [\"GET /feeds\"],\n getRepoSubscription: [\"GET /repos/{owner}/{repo}/subscription\"],\n getThread: [\"GET /notifications/threads/{thread_id}\"],\n getThreadSubscriptionForAuthenticatedUser: [\"GET /notifications/threads/{thread_id}/subscription\"],\n listEventsForAuthenticatedUser: [\"GET /users/{username}/events\"],\n listNotificationsForAuthenticatedUser: [\"GET /notifications\"],\n listOrgEventsForAuthenticatedUser: [\"GET /users/{username}/events/orgs/{org}\"],\n listPublicEvents: [\"GET /events\"],\n listPublicEventsForRepoNetwork: [\"GET /networks/{owner}/{repo}/events\"],\n listPublicEventsForUser: [\"GET /users/{username}/events/public\"],\n listPublicOrgEvents: [\"GET /orgs/{org}/events\"],\n listReceivedEventsForUser: [\"GET /users/{username}/received_events\"],\n listReceivedPublicEventsForUser: [\"GET /users/{username}/received_events/public\"],\n listRepoEvents: [\"GET /repos/{owner}/{repo}/events\"],\n listRepoNotificationsForAuthenticatedUser: [\"GET /repos/{owner}/{repo}/notifications\"],\n listReposStarredByAuthenticatedUser: [\"GET /user/starred\"],\n listReposStarredByUser: [\"GET /users/{username}/starred\"],\n listReposWatchedByUser: [\"GET /users/{username}/subscriptions\"],\n listStargazersForRepo: [\"GET /repos/{owner}/{repo}/stargazers\"],\n listWatchedReposForAuthenticatedUser: [\"GET /user/subscriptions\"],\n listWatchersForRepo: [\"GET /repos/{owner}/{repo}/subscribers\"],\n markNotificationsAsRead: [\"PUT /notifications\"],\n markRepoNotificationsAsRead: [\"PUT /repos/{owner}/{repo}/notifications\"],\n markThreadAsRead: [\"PATCH /notifications/threads/{thread_id}\"],\n setRepoSubscription: [\"PUT /repos/{owner}/{repo}/subscription\"],\n setThreadSubscription: [\"PUT /notifications/threads/{thread_id}/subscription\"],\n starRepoForAuthenticatedUser: [\"PUT /user/starred/{owner}/{repo}\"],\n unstarRepoForAuthenticatedUser: [\"DELETE /user/starred/{owner}/{repo}\"]\n },\n apps: {\n addRepoToInstallation: [\"PUT /user/installations/{installation_id}/repositories/{repository_id}\"],\n checkToken: [\"POST /applications/{client_id}/token\"],\n createContentAttachment: [\"POST /content_references/{content_reference_id}/attachments\", {\n mediaType: {\n previews: [\"corsair\"]\n }\n }],\n createFromManifest: [\"POST /app-manifests/{code}/conversions\"],\n createInstallationAccessToken: [\"POST /app/installations/{installation_id}/access_tokens\"],\n deleteAuthorization: [\"DELETE /applications/{client_id}/grant\"],\n deleteInstallation: [\"DELETE /app/installations/{installation_id}\"],\n deleteToken: [\"DELETE /applications/{client_id}/token\"],\n getAuthenticated: [\"GET /app\"],\n getBySlug: [\"GET /apps/{app_slug}\"],\n getInstallation: [\"GET /app/installations/{installation_id}\"],\n getOrgInstallation: [\"GET /orgs/{org}/installation\"],\n getRepoInstallation: [\"GET /repos/{owner}/{repo}/installation\"],\n getSubscriptionPlanForAccount: [\"GET /marketplace_listing/accounts/{account_id}\"],\n getSubscriptionPlanForAccountStubbed: [\"GET /marketplace_listing/stubbed/accounts/{account_id}\"],\n getUserInstallation: [\"GET /users/{username}/installation\"],\n getWebhookConfigForApp: [\"GET /app/hook/config\"],\n listAccountsForPlan: [\"GET /marketplace_listing/plans/{plan_id}/accounts\"],\n listAccountsForPlanStubbed: [\"GET /marketplace_listing/stubbed/plans/{plan_id}/accounts\"],\n listInstallationReposForAuthenticatedUser: [\"GET /user/installations/{installation_id}/repositories\"],\n listInstallations: [\"GET /app/installations\"],\n listInstallationsForAuthenticatedUser: [\"GET /user/installations\"],\n listPlans: [\"GET /marketplace_listing/plans\"],\n listPlansStubbed: [\"GET /marketplace_listing/stubbed/plans\"],\n listReposAccessibleToInstallation: [\"GET /installation/repositories\"],\n listSubscriptionsForAuthenticatedUser: [\"GET /user/marketplace_purchases\"],\n listSubscriptionsForAuthenticatedUserStubbed: [\"GET /user/marketplace_purchases/stubbed\"],\n removeRepoFromInstallation: [\"DELETE /user/installations/{installation_id}/repositories/{repository_id}\"],\n resetToken: [\"PATCH /applications/{client_id}/token\"],\n revokeInstallationAccessToken: [\"DELETE /installation/token\"],\n scopeToken: [\"POST /applications/{client_id}/token/scoped\"],\n suspendInstallation: [\"PUT /app/installations/{installation_id}/suspended\"],\n unsuspendInstallation: [\"DELETE /app/installations/{installation_id}/suspended\"],\n updateWebhookConfigForApp: [\"PATCH /app/hook/config\"]\n },\n billing: {\n getGithubActionsBillingOrg: [\"GET /orgs/{org}/settings/billing/actions\"],\n getGithubActionsBillingUser: [\"GET /users/{username}/settings/billing/actions\"],\n getGithubPackagesBillingOrg: [\"GET /orgs/{org}/settings/billing/packages\"],\n getGithubPackagesBillingUser: [\"GET /users/{username}/settings/billing/packages\"],\n getSharedStorageBillingOrg: [\"GET /orgs/{org}/settings/billing/shared-storage\"],\n getSharedStorageBillingUser: [\"GET /users/{username}/settings/billing/shared-storage\"]\n },\n checks: {\n create: [\"POST /repos/{owner}/{repo}/check-runs\"],\n createSuite: [\"POST /repos/{owner}/{repo}/check-suites\"],\n get: [\"GET /repos/{owner}/{repo}/check-runs/{check_run_id}\"],\n getSuite: [\"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}\"],\n listAnnotations: [\"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations\"],\n listForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/check-runs\"],\n listForSuite: [\"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs\"],\n listSuitesForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/check-suites\"],\n rerequestSuite: [\"POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest\"],\n setSuitesPreferences: [\"PATCH /repos/{owner}/{repo}/check-suites/preferences\"],\n update: [\"PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}\"]\n },\n codeScanning: {\n getAlert: [\"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\", {}, {\n renamedParameters: {\n alert_id: \"alert_number\"\n }\n }],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/code-scanning/alerts\"],\n listRecentAnalyses: [\"GET /repos/{owner}/{repo}/code-scanning/analyses\"],\n updateAlert: [\"PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\"],\n uploadSarif: [\"POST /repos/{owner}/{repo}/code-scanning/sarifs\"]\n },\n codesOfConduct: {\n getAllCodesOfConduct: [\"GET /codes_of_conduct\", {\n mediaType: {\n previews: [\"scarlet-witch\"]\n }\n }],\n getConductCode: [\"GET /codes_of_conduct/{key}\", {\n mediaType: {\n previews: [\"scarlet-witch\"]\n }\n }],\n getForRepo: [\"GET /repos/{owner}/{repo}/community/code_of_conduct\", {\n mediaType: {\n previews: [\"scarlet-witch\"]\n }\n }]\n },\n emojis: {\n get: [\"GET /emojis\"]\n },\n enterpriseAdmin: {\n disableSelectedOrganizationGithubActionsEnterprise: [\"DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id}\"],\n enableSelectedOrganizationGithubActionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}\"],\n getAllowedActionsEnterprise: [\"GET /enterprises/{enterprise}/actions/permissions/selected-actions\"],\n getGithubActionsPermissionsEnterprise: [\"GET /enterprises/{enterprise}/actions/permissions\"],\n listSelectedOrganizationsEnabledGithubActionsEnterprise: [\"GET /enterprises/{enterprise}/actions/permissions/organizations\"],\n setAllowedActionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions/selected-actions\"],\n setGithubActionsPermissionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions\"],\n setSelectedOrganizationsEnabledGithubActionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions/organizations\"]\n },\n gists: {\n checkIsStarred: [\"GET /gists/{gist_id}/star\"],\n create: [\"POST /gists\"],\n createComment: [\"POST /gists/{gist_id}/comments\"],\n delete: [\"DELETE /gists/{gist_id}\"],\n deleteComment: [\"DELETE /gists/{gist_id}/comments/{comment_id}\"],\n fork: [\"POST /gists/{gist_id}/forks\"],\n get: [\"GET /gists/{gist_id}\"],\n getComment: [\"GET /gists/{gist_id}/comments/{comment_id}\"],\n getRevision: [\"GET /gists/{gist_id}/{sha}\"],\n list: [\"GET /gists\"],\n listComments: [\"GET /gists/{gist_id}/comments\"],\n listCommits: [\"GET /gists/{gist_id}/commits\"],\n listForUser: [\"GET /users/{username}/gists\"],\n listForks: [\"GET /gists/{gist_id}/forks\"],\n listPublic: [\"GET /gists/public\"],\n listStarred: [\"GET /gists/starred\"],\n star: [\"PUT /gists/{gist_id}/star\"],\n unstar: [\"DELETE /gists/{gist_id}/star\"],\n update: [\"PATCH /gists/{gist_id}\"],\n updateComment: [\"PATCH /gists/{gist_id}/comments/{comment_id}\"]\n },\n git: {\n createBlob: [\"POST /repos/{owner}/{repo}/git/blobs\"],\n createCommit: [\"POST /repos/{owner}/{repo}/git/commits\"],\n createRef: [\"POST /repos/{owner}/{repo}/git/refs\"],\n createTag: [\"POST /repos/{owner}/{repo}/git/tags\"],\n createTree: [\"POST /repos/{owner}/{repo}/git/trees\"],\n deleteRef: [\"DELETE /repos/{owner}/{repo}/git/refs/{ref}\"],\n getBlob: [\"GET /repos/{owner}/{repo}/git/blobs/{file_sha}\"],\n getCommit: [\"GET /repos/{owner}/{repo}/git/commits/{commit_sha}\"],\n getRef: [\"GET /repos/{owner}/{repo}/git/ref/{ref}\"],\n getTag: [\"GET /repos/{owner}/{repo}/git/tags/{tag_sha}\"],\n getTree: [\"GET /repos/{owner}/{repo}/git/trees/{tree_sha}\"],\n listMatchingRefs: [\"GET /repos/{owner}/{repo}/git/matching-refs/{ref}\"],\n updateRef: [\"PATCH /repos/{owner}/{repo}/git/refs/{ref}\"]\n },\n gitignore: {\n getAllTemplates: [\"GET /gitignore/templates\"],\n getTemplate: [\"GET /gitignore/templates/{name}\"]\n },\n interactions: {\n getRestrictionsForAuthenticatedUser: [\"GET /user/interaction-limits\"],\n getRestrictionsForOrg: [\"GET /orgs/{org}/interaction-limits\"],\n getRestrictionsForRepo: [\"GET /repos/{owner}/{repo}/interaction-limits\"],\n getRestrictionsForYourPublicRepos: [\"GET /user/interaction-limits\", {}, {\n renamed: [\"interactions\", \"getRestrictionsForAuthenticatedUser\"]\n }],\n removeRestrictionsForAuthenticatedUser: [\"DELETE /user/interaction-limits\"],\n removeRestrictionsForOrg: [\"DELETE /orgs/{org}/interaction-limits\"],\n removeRestrictionsForRepo: [\"DELETE /repos/{owner}/{repo}/interaction-limits\"],\n removeRestrictionsForYourPublicRepos: [\"DELETE /user/interaction-limits\", {}, {\n renamed: [\"interactions\", \"removeRestrictionsForAuthenticatedUser\"]\n }],\n setRestrictionsForAuthenticatedUser: [\"PUT /user/interaction-limits\"],\n setRestrictionsForOrg: [\"PUT /orgs/{org}/interaction-limits\"],\n setRestrictionsForRepo: [\"PUT /repos/{owner}/{repo}/interaction-limits\"],\n setRestrictionsForYourPublicRepos: [\"PUT /user/interaction-limits\", {}, {\n renamed: [\"interactions\", \"setRestrictionsForAuthenticatedUser\"]\n }]\n },\n issues: {\n addAssignees: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/assignees\"],\n addLabels: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n checkUserCanBeAssigned: [\"GET /repos/{owner}/{repo}/assignees/{assignee}\"],\n create: [\"POST /repos/{owner}/{repo}/issues\"],\n createComment: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/comments\"],\n createLabel: [\"POST /repos/{owner}/{repo}/labels\"],\n createMilestone: [\"POST /repos/{owner}/{repo}/milestones\"],\n deleteComment: [\"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n deleteLabel: [\"DELETE /repos/{owner}/{repo}/labels/{name}\"],\n deleteMilestone: [\"DELETE /repos/{owner}/{repo}/milestones/{milestone_number}\"],\n get: [\"GET /repos/{owner}/{repo}/issues/{issue_number}\"],\n getComment: [\"GET /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n getEvent: [\"GET /repos/{owner}/{repo}/issues/events/{event_id}\"],\n getLabel: [\"GET /repos/{owner}/{repo}/labels/{name}\"],\n getMilestone: [\"GET /repos/{owner}/{repo}/milestones/{milestone_number}\"],\n list: [\"GET /issues\"],\n listAssignees: [\"GET /repos/{owner}/{repo}/assignees\"],\n listComments: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/comments\"],\n listCommentsForRepo: [\"GET /repos/{owner}/{repo}/issues/comments\"],\n listEvents: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/events\"],\n listEventsForRepo: [\"GET /repos/{owner}/{repo}/issues/events\"],\n listEventsForTimeline: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline\", {\n mediaType: {\n previews: [\"mockingbird\"]\n }\n }],\n listForAuthenticatedUser: [\"GET /user/issues\"],\n listForOrg: [\"GET /orgs/{org}/issues\"],\n listForRepo: [\"GET /repos/{owner}/{repo}/issues\"],\n listLabelsForMilestone: [\"GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels\"],\n listLabelsForRepo: [\"GET /repos/{owner}/{repo}/labels\"],\n listLabelsOnIssue: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n listMilestones: [\"GET /repos/{owner}/{repo}/milestones\"],\n lock: [\"PUT /repos/{owner}/{repo}/issues/{issue_number}/lock\"],\n removeAllLabels: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n removeAssignees: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees\"],\n removeLabel: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}\"],\n setLabels: [\"PUT /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n unlock: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock\"],\n update: [\"PATCH /repos/{owner}/{repo}/issues/{issue_number}\"],\n updateComment: [\"PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n updateLabel: [\"PATCH /repos/{owner}/{repo}/labels/{name}\"],\n updateMilestone: [\"PATCH /repos/{owner}/{repo}/milestones/{milestone_number}\"]\n },\n licenses: {\n get: [\"GET /licenses/{license}\"],\n getAllCommonlyUsed: [\"GET /licenses\"],\n getForRepo: [\"GET /repos/{owner}/{repo}/license\"]\n },\n markdown: {\n render: [\"POST /markdown\"],\n renderRaw: [\"POST /markdown/raw\", {\n headers: {\n \"content-type\": \"text/plain; charset=utf-8\"\n }\n }]\n },\n meta: {\n get: [\"GET /meta\"],\n getOctocat: [\"GET /octocat\"],\n getZen: [\"GET /zen\"],\n root: [\"GET /\"]\n },\n migrations: {\n cancelImport: [\"DELETE /repos/{owner}/{repo}/import\"],\n deleteArchiveForAuthenticatedUser: [\"DELETE /user/migrations/{migration_id}/archive\", {\n mediaType: {\n previews: [\"wyandotte\"]\n }\n }],\n deleteArchiveForOrg: [\"DELETE /orgs/{org}/migrations/{migration_id}/archive\", {\n mediaType: {\n previews: [\"wyandotte\"]\n }\n }],\n downloadArchiveForOrg: [\"GET /orgs/{org}/migrations/{migration_id}/archive\", {\n mediaType: {\n previews: [\"wyandotte\"]\n }\n }],\n getArchiveForAuthenticatedUser: [\"GET /user/migrations/{migration_id}/archive\", {\n mediaType: {\n previews: [\"wyandotte\"]\n }\n }],\n getCommitAuthors: [\"GET /repos/{owner}/{repo}/import/authors\"],\n getImportStatus: [\"GET /repos/{owner}/{repo}/import\"],\n getLargeFiles: [\"GET /repos/{owner}/{repo}/import/large_files\"],\n getStatusForAuthenticatedUser: [\"GET /user/migrations/{migration_id}\", {\n mediaType: {\n previews: [\"wyandotte\"]\n }\n }],\n getStatusForOrg: [\"GET /orgs/{org}/migrations/{migration_id}\", {\n mediaType: {\n previews: [\"wyandotte\"]\n }\n }],\n listForAuthenticatedUser: [\"GET /user/migrations\", {\n mediaType: {\n previews: [\"wyandotte\"]\n }\n }],\n listForOrg: [\"GET /orgs/{org}/migrations\", {\n mediaType: {\n previews: [\"wyandotte\"]\n }\n }],\n listReposForOrg: [\"GET /orgs/{org}/migrations/{migration_id}/repositories\", {\n mediaType: {\n previews: [\"wyandotte\"]\n }\n }],\n listReposForUser: [\"GET /user/migrations/{migration_id}/repositories\", {\n mediaType: {\n previews: [\"wyandotte\"]\n }\n }],\n mapCommitAuthor: [\"PATCH /repos/{owner}/{repo}/import/authors/{author_id}\"],\n setLfsPreference: [\"PATCH /repos/{owner}/{repo}/import/lfs\"],\n startForAuthenticatedUser: [\"POST /user/migrations\"],\n startForOrg: [\"POST /orgs/{org}/migrations\"],\n startImport: [\"PUT /repos/{owner}/{repo}/import\"],\n unlockRepoForAuthenticatedUser: [\"DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock\", {\n mediaType: {\n previews: [\"wyandotte\"]\n }\n }],\n unlockRepoForOrg: [\"DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock\", {\n mediaType: {\n previews: [\"wyandotte\"]\n }\n }],\n updateImport: [\"PATCH /repos/{owner}/{repo}/import\"]\n },\n orgs: {\n blockUser: [\"PUT /orgs/{org}/blocks/{username}\"],\n cancelInvitation: [\"DELETE /orgs/{org}/invitations/{invitation_id}\"],\n checkBlockedUser: [\"GET /orgs/{org}/blocks/{username}\"],\n checkMembershipForUser: [\"GET /orgs/{org}/members/{username}\"],\n checkPublicMembershipForUser: [\"GET /orgs/{org}/public_members/{username}\"],\n convertMemberToOutsideCollaborator: [\"PUT /orgs/{org}/outside_collaborators/{username}\"],\n createInvitation: [\"POST /orgs/{org}/invitations\"],\n createWebhook: [\"POST /orgs/{org}/hooks\"],\n deleteWebhook: [\"DELETE /orgs/{org}/hooks/{hook_id}\"],\n get: [\"GET /orgs/{org}\"],\n getMembershipForAuthenticatedUser: [\"GET /user/memberships/orgs/{org}\"],\n getMembershipForUser: [\"GET /orgs/{org}/memberships/{username}\"],\n getWebhook: [\"GET /orgs/{org}/hooks/{hook_id}\"],\n getWebhookConfigForOrg: [\"GET /orgs/{org}/hooks/{hook_id}/config\"],\n list: [\"GET /organizations\"],\n listAppInstallations: [\"GET /orgs/{org}/installations\"],\n listBlockedUsers: [\"GET /orgs/{org}/blocks\"],\n listFailedInvitations: [\"GET /orgs/{org}/failed_invitations\"],\n listForAuthenticatedUser: [\"GET /user/orgs\"],\n listForUser: [\"GET /users/{username}/orgs\"],\n listInvitationTeams: [\"GET /orgs/{org}/invitations/{invitation_id}/teams\"],\n listMembers: [\"GET /orgs/{org}/members\"],\n listMembershipsForAuthenticatedUser: [\"GET /user/memberships/orgs\"],\n listOutsideCollaborators: [\"GET /orgs/{org}/outside_collaborators\"],\n listPendingInvitations: [\"GET /orgs/{org}/invitations\"],\n listPublicMembers: [\"GET /orgs/{org}/public_members\"],\n listWebhooks: [\"GET /orgs/{org}/hooks\"],\n pingWebhook: [\"POST /orgs/{org}/hooks/{hook_id}/pings\"],\n removeMember: [\"DELETE /orgs/{org}/members/{username}\"],\n removeMembershipForUser: [\"DELETE /orgs/{org}/memberships/{username}\"],\n removeOutsideCollaborator: [\"DELETE /orgs/{org}/outside_collaborators/{username}\"],\n removePublicMembershipForAuthenticatedUser: [\"DELETE /orgs/{org}/public_members/{username}\"],\n setMembershipForUser: [\"PUT /orgs/{org}/memberships/{username}\"],\n setPublicMembershipForAuthenticatedUser: [\"PUT /orgs/{org}/public_members/{username}\"],\n unblockUser: [\"DELETE /orgs/{org}/blocks/{username}\"],\n update: [\"PATCH /orgs/{org}\"],\n updateMembershipForAuthenticatedUser: [\"PATCH /user/memberships/orgs/{org}\"],\n updateWebhook: [\"PATCH /orgs/{org}/hooks/{hook_id}\"],\n updateWebhookConfigForOrg: [\"PATCH /orgs/{org}/hooks/{hook_id}/config\"]\n },\n projects: {\n addCollaborator: [\"PUT /projects/{project_id}/collaborators/{username}\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n createCard: [\"POST /projects/columns/{column_id}/cards\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n createColumn: [\"POST /projects/{project_id}/columns\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n createForAuthenticatedUser: [\"POST /user/projects\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n createForOrg: [\"POST /orgs/{org}/projects\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n createForRepo: [\"POST /repos/{owner}/{repo}/projects\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n delete: [\"DELETE /projects/{project_id}\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n deleteCard: [\"DELETE /projects/columns/cards/{card_id}\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n deleteColumn: [\"DELETE /projects/columns/{column_id}\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n get: [\"GET /projects/{project_id}\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n getCard: [\"GET /projects/columns/cards/{card_id}\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n getColumn: [\"GET /projects/columns/{column_id}\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n getPermissionForUser: [\"GET /projects/{project_id}/collaborators/{username}/permission\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n listCards: [\"GET /projects/columns/{column_id}/cards\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n listCollaborators: [\"GET /projects/{project_id}/collaborators\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n listColumns: [\"GET /projects/{project_id}/columns\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n listForOrg: [\"GET /orgs/{org}/projects\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n listForRepo: [\"GET /repos/{owner}/{repo}/projects\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n listForUser: [\"GET /users/{username}/projects\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n moveCard: [\"POST /projects/columns/cards/{card_id}/moves\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n moveColumn: [\"POST /projects/columns/{column_id}/moves\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n removeCollaborator: [\"DELETE /projects/{project_id}/collaborators/{username}\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n update: [\"PATCH /projects/{project_id}\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n updateCard: [\"PATCH /projects/columns/cards/{card_id}\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n updateColumn: [\"PATCH /projects/columns/{column_id}\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }]\n },\n pulls: {\n checkIfMerged: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/merge\"],\n create: [\"POST /repos/{owner}/{repo}/pulls\"],\n createReplyForReviewComment: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies\"],\n createReview: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews\"],\n createReviewComment: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments\"],\n deletePendingReview: [\"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\"],\n deleteReviewComment: [\"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}\"],\n dismissReview: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals\"],\n get: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}\"],\n getReview: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\"],\n getReviewComment: [\"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}\"],\n list: [\"GET /repos/{owner}/{repo}/pulls\"],\n listCommentsForReview: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments\"],\n listCommits: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/commits\"],\n listFiles: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/files\"],\n listRequestedReviewers: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\"],\n listReviewComments: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments\"],\n listReviewCommentsForRepo: [\"GET /repos/{owner}/{repo}/pulls/comments\"],\n listReviews: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews\"],\n merge: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge\"],\n removeRequestedReviewers: [\"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\"],\n requestReviewers: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\"],\n submitReview: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events\"],\n update: [\"PATCH /repos/{owner}/{repo}/pulls/{pull_number}\"],\n updateBranch: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch\", {\n mediaType: {\n previews: [\"lydian\"]\n }\n }],\n updateReview: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\"],\n updateReviewComment: [\"PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}\"]\n },\n rateLimit: {\n get: [\"GET /rate_limit\"]\n },\n reactions: {\n createForCommitComment: [\"POST /repos/{owner}/{repo}/comments/{comment_id}/reactions\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n createForIssue: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/reactions\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n createForIssueComment: [\"POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n createForPullRequestReviewComment: [\"POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n createForTeamDiscussionCommentInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n createForTeamDiscussionInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n deleteForCommitComment: [\"DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n deleteForIssue: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n deleteForIssueComment: [\"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n deleteForPullRequestComment: [\"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n deleteForTeamDiscussion: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n deleteForTeamDiscussionComment: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n deleteLegacy: [\"DELETE /reactions/{reaction_id}\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }, {\n deprecated: \"octokit.reactions.deleteLegacy() is deprecated, see https://docs.github.com/v3/reactions/#delete-a-reaction-legacy\"\n }],\n listForCommitComment: [\"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n listForIssue: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/reactions\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n listForIssueComment: [\"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n listForPullRequestReviewComment: [\"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n listForTeamDiscussionCommentInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }],\n listForTeamDiscussionInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\", {\n mediaType: {\n previews: [\"squirrel-girl\"]\n }\n }]\n },\n repos: {\n acceptInvitation: [\"PATCH /user/repository_invitations/{invitation_id}\"],\n addAppAccessRestrictions: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\", {}, {\n mapToData: \"apps\"\n }],\n addCollaborator: [\"PUT /repos/{owner}/{repo}/collaborators/{username}\"],\n addStatusCheckContexts: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\", {}, {\n mapToData: \"contexts\"\n }],\n addTeamAccessRestrictions: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\", {}, {\n mapToData: \"teams\"\n }],\n addUserAccessRestrictions: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\", {}, {\n mapToData: \"users\"\n }],\n checkCollaborator: [\"GET /repos/{owner}/{repo}/collaborators/{username}\"],\n checkVulnerabilityAlerts: [\"GET /repos/{owner}/{repo}/vulnerability-alerts\", {\n mediaType: {\n previews: [\"dorian\"]\n }\n }],\n compareCommits: [\"GET /repos/{owner}/{repo}/compare/{base}...{head}\"],\n createCommitComment: [\"POST /repos/{owner}/{repo}/commits/{commit_sha}/comments\"],\n createCommitSignatureProtection: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\", {\n mediaType: {\n previews: [\"zzzax\"]\n }\n }],\n createCommitStatus: [\"POST /repos/{owner}/{repo}/statuses/{sha}\"],\n createDeployKey: [\"POST /repos/{owner}/{repo}/keys\"],\n createDeployment: [\"POST /repos/{owner}/{repo}/deployments\"],\n createDeploymentStatus: [\"POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\"],\n createDispatchEvent: [\"POST /repos/{owner}/{repo}/dispatches\"],\n createForAuthenticatedUser: [\"POST /user/repos\"],\n createFork: [\"POST /repos/{owner}/{repo}/forks\"],\n createInOrg: [\"POST /orgs/{org}/repos\"],\n createOrUpdateFileContents: [\"PUT /repos/{owner}/{repo}/contents/{path}\"],\n createPagesSite: [\"POST /repos/{owner}/{repo}/pages\", {\n mediaType: {\n previews: [\"switcheroo\"]\n }\n }],\n createRelease: [\"POST /repos/{owner}/{repo}/releases\"],\n createUsingTemplate: [\"POST /repos/{template_owner}/{template_repo}/generate\", {\n mediaType: {\n previews: [\"baptiste\"]\n }\n }],\n createWebhook: [\"POST /repos/{owner}/{repo}/hooks\"],\n declineInvitation: [\"DELETE /user/repository_invitations/{invitation_id}\"],\n delete: [\"DELETE /repos/{owner}/{repo}\"],\n deleteAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\"],\n deleteAdminBranchProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\"],\n deleteBranchProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection\"],\n deleteCommitComment: [\"DELETE /repos/{owner}/{repo}/comments/{comment_id}\"],\n deleteCommitSignatureProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\", {\n mediaType: {\n previews: [\"zzzax\"]\n }\n }],\n deleteDeployKey: [\"DELETE /repos/{owner}/{repo}/keys/{key_id}\"],\n deleteDeployment: [\"DELETE /repos/{owner}/{repo}/deployments/{deployment_id}\"],\n deleteFile: [\"DELETE /repos/{owner}/{repo}/contents/{path}\"],\n deleteInvitation: [\"DELETE /repos/{owner}/{repo}/invitations/{invitation_id}\"],\n deletePagesSite: [\"DELETE /repos/{owner}/{repo}/pages\", {\n mediaType: {\n previews: [\"switcheroo\"]\n }\n }],\n deletePullRequestReviewProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\"],\n deleteRelease: [\"DELETE /repos/{owner}/{repo}/releases/{release_id}\"],\n deleteReleaseAsset: [\"DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n deleteWebhook: [\"DELETE /repos/{owner}/{repo}/hooks/{hook_id}\"],\n disableAutomatedSecurityFixes: [\"DELETE /repos/{owner}/{repo}/automated-security-fixes\", {\n mediaType: {\n previews: [\"london\"]\n }\n }],\n disableVulnerabilityAlerts: [\"DELETE /repos/{owner}/{repo}/vulnerability-alerts\", {\n mediaType: {\n previews: [\"dorian\"]\n }\n }],\n downloadArchive: [\"GET /repos/{owner}/{repo}/zipball/{ref}\", {}, {\n renamed: [\"repos\", \"downloadZipballArchive\"]\n }],\n downloadTarballArchive: [\"GET /repos/{owner}/{repo}/tarball/{ref}\"],\n downloadZipballArchive: [\"GET /repos/{owner}/{repo}/zipball/{ref}\"],\n enableAutomatedSecurityFixes: [\"PUT /repos/{owner}/{repo}/automated-security-fixes\", {\n mediaType: {\n previews: [\"london\"]\n }\n }],\n enableVulnerabilityAlerts: [\"PUT /repos/{owner}/{repo}/vulnerability-alerts\", {\n mediaType: {\n previews: [\"dorian\"]\n }\n }],\n get: [\"GET /repos/{owner}/{repo}\"],\n getAccessRestrictions: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\"],\n getAdminBranchProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\"],\n getAllStatusCheckContexts: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\"],\n getAllTopics: [\"GET /repos/{owner}/{repo}/topics\", {\n mediaType: {\n previews: [\"mercy\"]\n }\n }],\n getAppsWithAccessToProtectedBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\"],\n getBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}\"],\n getBranchProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection\"],\n getClones: [\"GET /repos/{owner}/{repo}/traffic/clones\"],\n getCodeFrequencyStats: [\"GET /repos/{owner}/{repo}/stats/code_frequency\"],\n getCollaboratorPermissionLevel: [\"GET /repos/{owner}/{repo}/collaborators/{username}/permission\"],\n getCombinedStatusForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/status\"],\n getCommit: [\"GET /repos/{owner}/{repo}/commits/{ref}\"],\n getCommitActivityStats: [\"GET /repos/{owner}/{repo}/stats/commit_activity\"],\n getCommitComment: [\"GET /repos/{owner}/{repo}/comments/{comment_id}\"],\n getCommitSignatureProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\", {\n mediaType: {\n previews: [\"zzzax\"]\n }\n }],\n getCommunityProfileMetrics: [\"GET /repos/{owner}/{repo}/community/profile\"],\n getContent: [\"GET /repos/{owner}/{repo}/contents/{path}\"],\n getContributorsStats: [\"GET /repos/{owner}/{repo}/stats/contributors\"],\n getDeployKey: [\"GET /repos/{owner}/{repo}/keys/{key_id}\"],\n getDeployment: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}\"],\n getDeploymentStatus: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}\"],\n getLatestPagesBuild: [\"GET /repos/{owner}/{repo}/pages/builds/latest\"],\n getLatestRelease: [\"GET /repos/{owner}/{repo}/releases/latest\"],\n getPages: [\"GET /repos/{owner}/{repo}/pages\"],\n getPagesBuild: [\"GET /repos/{owner}/{repo}/pages/builds/{build_id}\"],\n getParticipationStats: [\"GET /repos/{owner}/{repo}/stats/participation\"],\n getPullRequestReviewProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\"],\n getPunchCardStats: [\"GET /repos/{owner}/{repo}/stats/punch_card\"],\n getReadme: [\"GET /repos/{owner}/{repo}/readme\"],\n getRelease: [\"GET /repos/{owner}/{repo}/releases/{release_id}\"],\n getReleaseAsset: [\"GET /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n getReleaseByTag: [\"GET /repos/{owner}/{repo}/releases/tags/{tag}\"],\n getStatusChecksProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\"],\n getTeamsWithAccessToProtectedBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\"],\n getTopPaths: [\"GET /repos/{owner}/{repo}/traffic/popular/paths\"],\n getTopReferrers: [\"GET /repos/{owner}/{repo}/traffic/popular/referrers\"],\n getUsersWithAccessToProtectedBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\"],\n getViews: [\"GET /repos/{owner}/{repo}/traffic/views\"],\n getWebhook: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}\"],\n getWebhookConfigForRepo: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}/config\"],\n listBranches: [\"GET /repos/{owner}/{repo}/branches\"],\n listBranchesForHeadCommit: [\"GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head\", {\n mediaType: {\n previews: [\"groot\"]\n }\n }],\n listCollaborators: [\"GET /repos/{owner}/{repo}/collaborators\"],\n listCommentsForCommit: [\"GET /repos/{owner}/{repo}/commits/{commit_sha}/comments\"],\n listCommitCommentsForRepo: [\"GET /repos/{owner}/{repo}/comments\"],\n listCommitStatusesForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/statuses\"],\n listCommits: [\"GET /repos/{owner}/{repo}/commits\"],\n listContributors: [\"GET /repos/{owner}/{repo}/contributors\"],\n listDeployKeys: [\"GET /repos/{owner}/{repo}/keys\"],\n listDeploymentStatuses: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\"],\n listDeployments: [\"GET /repos/{owner}/{repo}/deployments\"],\n listForAuthenticatedUser: [\"GET /user/repos\"],\n listForOrg: [\"GET /orgs/{org}/repos\"],\n listForUser: [\"GET /users/{username}/repos\"],\n listForks: [\"GET /repos/{owner}/{repo}/forks\"],\n listInvitations: [\"GET /repos/{owner}/{repo}/invitations\"],\n listInvitationsForAuthenticatedUser: [\"GET /user/repository_invitations\"],\n listLanguages: [\"GET /repos/{owner}/{repo}/languages\"],\n listPagesBuilds: [\"GET /repos/{owner}/{repo}/pages/builds\"],\n listPublic: [\"GET /repositories\"],\n listPullRequestsAssociatedWithCommit: [\"GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls\", {\n mediaType: {\n previews: [\"groot\"]\n }\n }],\n listReleaseAssets: [\"GET /repos/{owner}/{repo}/releases/{release_id}/assets\"],\n listReleases: [\"GET /repos/{owner}/{repo}/releases\"],\n listTags: [\"GET /repos/{owner}/{repo}/tags\"],\n listTeams: [\"GET /repos/{owner}/{repo}/teams\"],\n listWebhooks: [\"GET /repos/{owner}/{repo}/hooks\"],\n merge: [\"POST /repos/{owner}/{repo}/merges\"],\n pingWebhook: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/pings\"],\n removeAppAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\", {}, {\n mapToData: \"apps\"\n }],\n removeCollaborator: [\"DELETE /repos/{owner}/{repo}/collaborators/{username}\"],\n removeStatusCheckContexts: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\", {}, {\n mapToData: \"contexts\"\n }],\n removeStatusCheckProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\"],\n removeTeamAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\", {}, {\n mapToData: \"teams\"\n }],\n removeUserAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\", {}, {\n mapToData: \"users\"\n }],\n renameBranch: [\"POST /repos/{owner}/{repo}/branches/{branch}/rename\"],\n replaceAllTopics: [\"PUT /repos/{owner}/{repo}/topics\", {\n mediaType: {\n previews: [\"mercy\"]\n }\n }],\n requestPagesBuild: [\"POST /repos/{owner}/{repo}/pages/builds\"],\n setAdminBranchProtection: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\"],\n setAppAccessRestrictions: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\", {}, {\n mapToData: \"apps\"\n }],\n setStatusCheckContexts: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\", {}, {\n mapToData: \"contexts\"\n }],\n setTeamAccessRestrictions: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\", {}, {\n mapToData: \"teams\"\n }],\n setUserAccessRestrictions: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\", {}, {\n mapToData: \"users\"\n }],\n testPushWebhook: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/tests\"],\n transfer: [\"POST /repos/{owner}/{repo}/transfer\"],\n update: [\"PATCH /repos/{owner}/{repo}\"],\n updateBranchProtection: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection\"],\n updateCommitComment: [\"PATCH /repos/{owner}/{repo}/comments/{comment_id}\"],\n updateInformationAboutPagesSite: [\"PUT /repos/{owner}/{repo}/pages\"],\n updateInvitation: [\"PATCH /repos/{owner}/{repo}/invitations/{invitation_id}\"],\n updatePullRequestReviewProtection: [\"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\"],\n updateRelease: [\"PATCH /repos/{owner}/{repo}/releases/{release_id}\"],\n updateReleaseAsset: [\"PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n updateStatusCheckPotection: [\"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\", {}, {\n renamed: [\"repos\", \"updateStatusCheckProtection\"]\n }],\n updateStatusCheckProtection: [\"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\"],\n updateWebhook: [\"PATCH /repos/{owner}/{repo}/hooks/{hook_id}\"],\n updateWebhookConfigForRepo: [\"PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config\"],\n uploadReleaseAsset: [\"POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}\", {\n baseUrl: \"https://uploads.github.com\"\n }]\n },\n search: {\n code: [\"GET /search/code\"],\n commits: [\"GET /search/commits\", {\n mediaType: {\n previews: [\"cloak\"]\n }\n }],\n issuesAndPullRequests: [\"GET /search/issues\"],\n labels: [\"GET /search/labels\"],\n repos: [\"GET /search/repositories\"],\n topics: [\"GET /search/topics\", {\n mediaType: {\n previews: [\"mercy\"]\n }\n }],\n users: [\"GET /search/users\"]\n },\n secretScanning: {\n getAlert: [\"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}\"],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/secret-scanning/alerts\"],\n updateAlert: [\"PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}\"]\n },\n teams: {\n addOrUpdateMembershipForUserInOrg: [\"PUT /orgs/{org}/teams/{team_slug}/memberships/{username}\"],\n addOrUpdateProjectPermissionsInOrg: [\"PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n addOrUpdateRepoPermissionsInOrg: [\"PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\"],\n checkPermissionsForProjectInOrg: [\"GET /orgs/{org}/teams/{team_slug}/projects/{project_id}\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n checkPermissionsForRepoInOrg: [\"GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\"],\n create: [\"POST /orgs/{org}/teams\"],\n createDiscussionCommentInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\"],\n createDiscussionInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions\"],\n deleteDiscussionCommentInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\"],\n deleteDiscussionInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\"],\n deleteInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}\"],\n getByName: [\"GET /orgs/{org}/teams/{team_slug}\"],\n getDiscussionCommentInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\"],\n getDiscussionInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\"],\n getMembershipForUserInOrg: [\"GET /orgs/{org}/teams/{team_slug}/memberships/{username}\"],\n list: [\"GET /orgs/{org}/teams\"],\n listChildInOrg: [\"GET /orgs/{org}/teams/{team_slug}/teams\"],\n listDiscussionCommentsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\"],\n listDiscussionsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions\"],\n listForAuthenticatedUser: [\"GET /user/teams\"],\n listMembersInOrg: [\"GET /orgs/{org}/teams/{team_slug}/members\"],\n listPendingInvitationsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/invitations\"],\n listProjectsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/projects\", {\n mediaType: {\n previews: [\"inertia\"]\n }\n }],\n listReposInOrg: [\"GET /orgs/{org}/teams/{team_slug}/repos\"],\n removeMembershipForUserInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}\"],\n removeProjectInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}\"],\n removeRepoInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\"],\n updateDiscussionCommentInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\"],\n updateDiscussionInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\"],\n updateInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}\"]\n },\n users: {\n addEmailForAuthenticated: [\"POST /user/emails\"],\n block: [\"PUT /user/blocks/{username}\"],\n checkBlocked: [\"GET /user/blocks/{username}\"],\n checkFollowingForUser: [\"GET /users/{username}/following/{target_user}\"],\n checkPersonIsFollowedByAuthenticated: [\"GET /user/following/{username}\"],\n createGpgKeyForAuthenticated: [\"POST /user/gpg_keys\"],\n createPublicSshKeyForAuthenticated: [\"POST /user/keys\"],\n deleteEmailForAuthenticated: [\"DELETE /user/emails\"],\n deleteGpgKeyForAuthenticated: [\"DELETE /user/gpg_keys/{gpg_key_id}\"],\n deletePublicSshKeyForAuthenticated: [\"DELETE /user/keys/{key_id}\"],\n follow: [\"PUT /user/following/{username}\"],\n getAuthenticated: [\"GET /user\"],\n getByUsername: [\"GET /users/{username}\"],\n getContextForUser: [\"GET /users/{username}/hovercard\"],\n getGpgKeyForAuthenticated: [\"GET /user/gpg_keys/{gpg_key_id}\"],\n getPublicSshKeyForAuthenticated: [\"GET /user/keys/{key_id}\"],\n list: [\"GET /users\"],\n listBlockedByAuthenticated: [\"GET /user/blocks\"],\n listEmailsForAuthenticated: [\"GET /user/emails\"],\n listFollowedByAuthenticated: [\"GET /user/following\"],\n listFollowersForAuthenticatedUser: [\"GET /user/followers\"],\n listFollowersForUser: [\"GET /users/{username}/followers\"],\n listFollowingForUser: [\"GET /users/{username}/following\"],\n listGpgKeysForAuthenticated: [\"GET /user/gpg_keys\"],\n listGpgKeysForUser: [\"GET /users/{username}/gpg_keys\"],\n listPublicEmailsForAuthenticated: [\"GET /user/public_emails\"],\n listPublicKeysForUser: [\"GET /users/{username}/keys\"],\n listPublicSshKeysForAuthenticated: [\"GET /user/keys\"],\n setPrimaryEmailVisibilityForAuthenticated: [\"PATCH /user/email/visibility\"],\n unblock: [\"DELETE /user/blocks/{username}\"],\n unfollow: [\"DELETE /user/following/{username}\"],\n updateAuthenticated: [\"PATCH /user\"]\n }\n};\n\nconst VERSION = \"4.10.1\";\n\nfunction endpointsToMethods(octokit, endpointsMap) {\n const newMethods = {};\n\n for (const [scope, endpoints] of Object.entries(endpointsMap)) {\n for (const [methodName, endpoint] of Object.entries(endpoints)) {\n const [route, defaults, decorations] = endpoint;\n const [method, url] = route.split(/ /);\n const endpointDefaults = Object.assign({\n method,\n url\n }, defaults);\n\n if (!newMethods[scope]) {\n newMethods[scope] = {};\n }\n\n const scopeMethods = newMethods[scope];\n\n if (decorations) {\n scopeMethods[methodName] = decorate(octokit, scope, methodName, endpointDefaults, decorations);\n continue;\n }\n\n scopeMethods[methodName] = octokit.request.defaults(endpointDefaults);\n }\n }\n\n return newMethods;\n}\n\nfunction decorate(octokit, scope, methodName, defaults, decorations) {\n const requestWithDefaults = octokit.request.defaults(defaults);\n /* istanbul ignore next */\n\n function withDecorations(...args) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n let options = requestWithDefaults.endpoint.merge(...args); // There are currently no other decorations than `.mapToData`\n\n if (decorations.mapToData) {\n options = Object.assign({}, options, {\n data: options[decorations.mapToData],\n [decorations.mapToData]: undefined\n });\n return requestWithDefaults(options);\n }\n\n if (decorations.renamed) {\n const [newScope, newMethodName] = decorations.renamed;\n octokit.log.warn(`octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`);\n }\n\n if (decorations.deprecated) {\n octokit.log.warn(decorations.deprecated);\n }\n\n if (decorations.renamedParameters) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n const options = requestWithDefaults.endpoint.merge(...args);\n\n for (const [name, alias] of Object.entries(decorations.renamedParameters)) {\n if (name in options) {\n octokit.log.warn(`\"${name}\" parameter is deprecated for \"octokit.${scope}.${methodName}()\". Use \"${alias}\" instead`);\n\n if (!(alias in options)) {\n options[alias] = options[name];\n }\n\n delete options[name];\n }\n }\n\n return requestWithDefaults(options);\n } // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n\n\n return requestWithDefaults(...args);\n }\n\n return Object.assign(withDecorations, requestWithDefaults);\n}\n\n/**\n * This plugin is a 1:1 copy of internal @octokit/rest plugins. The primary\n * goal is to rebuild @octokit/rest on top of @octokit/core. Once that is\n * done, we will remove the registerEndpoints methods and return the methods\n * directly as with the other plugins. At that point we will also remove the\n * legacy workarounds and deprecations.\n *\n * See the plan at\n * https://github.com/octokit/plugin-rest-endpoint-methods.js/pull/1\n */\n\nfunction restEndpointMethods(octokit) {\n return endpointsToMethods(octokit, Endpoints);\n}\nrestEndpointMethods.VERSION = VERSION;\n\nexports.restEndpointMethods = restEndpointMethods;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar deprecation = require('deprecation');\nvar once = _interopDefault(require('once'));\n\nconst logOnce = once(deprecation => console.warn(deprecation));\n/**\n * Error with extra properties to help with debugging\n */\n\nclass RequestError extends Error {\n constructor(message, statusCode, options) {\n super(message); // Maintains proper stack trace (only available on V8)\n\n /* istanbul ignore next */\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = \"HttpError\";\n this.status = statusCode;\n Object.defineProperty(this, \"code\", {\n get() {\n logOnce(new deprecation.Deprecation(\"[@octokit/request-error] `error.code` is deprecated, use `error.status`.\"));\n return statusCode;\n }\n\n });\n this.headers = options.headers || {}; // redact request credentials without mutating original request options\n\n const requestCopy = Object.assign({}, options.request);\n\n if (options.request.headers.authorization) {\n requestCopy.headers = Object.assign({}, options.request.headers, {\n authorization: options.request.headers.authorization.replace(/ .*$/, \" [REDACTED]\")\n });\n }\n\n requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit\n // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications\n .replace(/\\bclient_secret=\\w+/g, \"client_secret=[REDACTED]\") // OAuth tokens can be passed as URL query parameters, although it is not recommended\n // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header\n .replace(/\\baccess_token=\\w+/g, \"access_token=[REDACTED]\");\n this.request = requestCopy;\n }\n\n}\n\nexports.RequestError = RequestError;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar endpoint = require('@octokit/endpoint');\nvar universalUserAgent = require('universal-user-agent');\nvar isPlainObject = require('is-plain-object');\nvar nodeFetch = _interopDefault(require('node-fetch'));\nvar requestError = require('@octokit/request-error');\n\nconst VERSION = \"5.4.14\";\n\nfunction getBufferResponse(response) {\n return response.arrayBuffer();\n}\n\nfunction fetchWrapper(requestOptions) {\n if (isPlainObject.isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {\n requestOptions.body = JSON.stringify(requestOptions.body);\n }\n\n let headers = {};\n let status;\n let url;\n const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;\n return fetch(requestOptions.url, Object.assign({\n method: requestOptions.method,\n body: requestOptions.body,\n headers: requestOptions.headers,\n redirect: requestOptions.redirect\n }, requestOptions.request)).then(response => {\n url = response.url;\n status = response.status;\n\n for (const keyAndValue of response.headers) {\n headers[keyAndValue[0]] = keyAndValue[1];\n }\n\n if (status === 204 || status === 205) {\n return;\n } // GitHub API returns 200 for HEAD requests\n\n\n if (requestOptions.method === \"HEAD\") {\n if (status < 400) {\n return;\n }\n\n throw new requestError.RequestError(response.statusText, status, {\n headers,\n request: requestOptions\n });\n }\n\n if (status === 304) {\n throw new requestError.RequestError(\"Not modified\", status, {\n headers,\n request: requestOptions\n });\n }\n\n if (status >= 400) {\n return response.text().then(message => {\n const error = new requestError.RequestError(message, status, {\n headers,\n request: requestOptions\n });\n\n try {\n let responseBody = JSON.parse(error.message);\n Object.assign(error, responseBody);\n let errors = responseBody.errors; // Assumption `errors` would always be in Array format\n\n error.message = error.message + \": \" + errors.map(JSON.stringify).join(\", \");\n } catch (e) {// ignore, see octokit/rest.js#684\n }\n\n throw error;\n });\n }\n\n const contentType = response.headers.get(\"content-type\");\n\n if (/application\\/json/.test(contentType)) {\n return response.json();\n }\n\n if (!contentType || /^text\\/|charset=utf-8$/.test(contentType)) {\n return response.text();\n }\n\n return getBufferResponse(response);\n }).then(data => {\n return {\n status,\n url,\n headers,\n data\n };\n }).catch(error => {\n if (error instanceof requestError.RequestError) {\n throw error;\n }\n\n throw new requestError.RequestError(error.message, 500, {\n headers,\n request: requestOptions\n });\n });\n}\n\nfunction withDefaults(oldEndpoint, newDefaults) {\n const endpoint = oldEndpoint.defaults(newDefaults);\n\n const newApi = function (route, parameters) {\n const endpointOptions = endpoint.merge(route, parameters);\n\n if (!endpointOptions.request || !endpointOptions.request.hook) {\n return fetchWrapper(endpoint.parse(endpointOptions));\n }\n\n const request = (route, parameters) => {\n return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));\n };\n\n Object.assign(request, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint)\n });\n return endpointOptions.request.hook(request, endpointOptions);\n };\n\n return Object.assign(newApi, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint)\n });\n}\n\nconst request = withDefaults(endpoint.endpoint, {\n headers: {\n \"user-agent\": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`\n }\n});\n\nexports.request = request;\n//# sourceMappingURL=index.js.map\n","var register = require('./lib/register')\nvar addHook = require('./lib/add')\nvar removeHook = require('./lib/remove')\n\n// bind with array of arguments: https://stackoverflow.com/a/21792913\nvar bind = Function.bind\nvar bindable = bind.bind(bind)\n\nfunction bindApi (hook, state, name) {\n var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])\n hook.api = { remove: removeHookRef }\n hook.remove = removeHookRef\n\n ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {\n var args = name ? [state, kind, name] : [state, kind]\n hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)\n })\n}\n\nfunction HookSingular () {\n var singularHookName = 'h'\n var singularHookState = {\n registry: {}\n }\n var singularHook = register.bind(null, singularHookState, singularHookName)\n bindApi(singularHook, singularHookState, singularHookName)\n return singularHook\n}\n\nfunction HookCollection () {\n var state = {\n registry: {}\n }\n\n var hook = register.bind(null, state)\n bindApi(hook, state)\n\n return hook\n}\n\nvar collectionHookDeprecationMessageDisplayed = false\nfunction Hook () {\n if (!collectionHookDeprecationMessageDisplayed) {\n console.warn('[before-after-hook]: \"Hook()\" repurposing warning, use \"Hook.Collection()\". Read more: https://git.io/upgrade-before-after-hook-to-1.4')\n collectionHookDeprecationMessageDisplayed = true\n }\n return HookCollection()\n}\n\nHook.Singular = HookSingular.bind()\nHook.Collection = HookCollection.bind()\n\nmodule.exports = Hook\n// expose constructors as a named property for TypeScript\nmodule.exports.Hook = Hook\nmodule.exports.Singular = Hook.Singular\nmodule.exports.Collection = Hook.Collection\n","module.exports = addHook;\n\nfunction addHook(state, kind, name, hook) {\n var orig = hook;\n if (!state.registry[name]) {\n state.registry[name] = [];\n }\n\n if (kind === \"before\") {\n hook = function (method, options) {\n return Promise.resolve()\n .then(orig.bind(null, options))\n .then(method.bind(null, options));\n };\n }\n\n if (kind === \"after\") {\n hook = function (method, options) {\n var result;\n return Promise.resolve()\n .then(method.bind(null, options))\n .then(function (result_) {\n result = result_;\n return orig(result, options);\n })\n .then(function () {\n return result;\n });\n };\n }\n\n if (kind === \"error\") {\n hook = function (method, options) {\n return Promise.resolve()\n .then(method.bind(null, options))\n .catch(function (error) {\n return orig(error, options);\n });\n };\n }\n\n state.registry[name].push({\n hook: hook,\n orig: orig,\n });\n}\n","module.exports = register;\n\nfunction register(state, name, method, options) {\n if (typeof method !== \"function\") {\n throw new Error(\"method for before hook must be a function\");\n }\n\n if (!options) {\n options = {};\n }\n\n if (Array.isArray(name)) {\n return name.reverse().reduce(function (callback, name) {\n return register.bind(null, state, name, callback, options);\n }, method)();\n }\n\n return Promise.resolve().then(function () {\n if (!state.registry[name]) {\n return method(options);\n }\n\n return state.registry[name].reduce(function (method, registered) {\n return registered.hook.bind(null, method, options);\n }, method)();\n });\n}\n","module.exports = removeHook;\n\nfunction removeHook(state, name, method) {\n if (!state.registry[name]) {\n return;\n }\n\n var index = state.registry[name]\n .map(function (registered) {\n return registered.orig;\n })\n .indexOf(method);\n\n if (index === -1) {\n return;\n }\n\n state.registry[name].splice(index, 1);\n}\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nclass Deprecation extends Error {\n constructor(message) {\n super(message); // Maintains proper stack trace (only available on V8)\n\n /* istanbul ignore next */\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = 'Deprecation';\n }\n\n}\n\nexports.Deprecation = Deprecation;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getApplicativeComposition = exports.getApplicativeMonoid = void 0;\n/**\n * The `Applicative` type class extends the `Apply` type class with a `of` function, which can be used to create values\n * of type `f a` from values of type `a`.\n *\n * Where `Apply` provides the ability to lift functions of two or more arguments to functions whose arguments are\n * wrapped using `f`, and `Functor` provides the ability to lift functions of one argument, `pure` can be seen as the\n * function which lifts functions of _zero_ arguments. That is, `Applicative` functors support a lifting operation for\n * any number of function arguments.\n *\n * Instances must satisfy the following laws in addition to the `Apply` laws:\n *\n * 1. Identity: `A.ap(A.of(a => a), fa) <-> fa`\n * 2. Homomorphism: `A.ap(A.of(ab), A.of(a)) <-> A.of(ab(a))`\n * 3. Interchange: `A.ap(fab, A.of(a)) <-> A.ap(A.of(ab => ab(a)), fab)`\n *\n * Note. `Functor`'s `map` can be derived: `A.map(x, f) = A.ap(A.of(f), x)`\n *\n * @since 2.0.0\n */\nvar Apply_1 = require(\"./Apply\");\nvar function_1 = require(\"./function\");\nvar Functor_1 = require(\"./Functor\");\nfunction getApplicativeMonoid(F) {\n var f = Apply_1.getApplySemigroup(F);\n return function (M) { return ({\n concat: f(M).concat,\n empty: F.of(M.empty)\n }); };\n}\nexports.getApplicativeMonoid = getApplicativeMonoid;\n/** @deprecated */\nfunction getApplicativeComposition(F, G) {\n var map = Functor_1.getFunctorComposition(F, G).map;\n var _ap = Apply_1.ap(F, G);\n return {\n map: map,\n of: function (a) { return F.of(G.of(a)); },\n ap: function (fgab, fga) { return function_1.pipe(fgab, _ap(fga)); }\n };\n}\nexports.getApplicativeComposition = getApplicativeComposition;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sequenceS = exports.sequenceT = exports.getApplySemigroup = exports.apS = exports.apSecond = exports.apFirst = exports.ap = void 0;\nvar function_1 = require(\"./function\");\nfunction ap(F, G) {\n return function (fa) { return function (fab) {\n return F.ap(F.map(fab, function (gab) { return function (ga) { return G.ap(gab, ga); }; }), fa);\n }; };\n}\nexports.ap = ap;\nfunction apFirst(A) {\n return function (second) { return function (first) {\n return A.ap(A.map(first, function (a) { return function () { return a; }; }), second);\n }; };\n}\nexports.apFirst = apFirst;\nfunction apSecond(A) {\n return function (second) { return function (first) {\n return A.ap(A.map(first, function () { return function (b) { return b; }; }), second);\n }; };\n}\nexports.apSecond = apSecond;\nfunction apS(F) {\n return function (name, fb) { return function (fa) {\n return F.ap(F.map(fa, function (a) { return function (b) {\n var _a;\n return Object.assign({}, a, (_a = {}, _a[name] = b, _a));\n }; }), fb);\n }; };\n}\nexports.apS = apS;\nfunction getApplySemigroup(F) {\n return function (S) { return ({\n concat: function (first, second) {\n return F.ap(F.map(first, function (x) { return function (y) { return S.concat(x, y); }; }), second);\n }\n }); };\n}\nexports.getApplySemigroup = getApplySemigroup;\nfunction curried(f, n, acc) {\n return function (x) {\n var combined = Array(acc.length + 1);\n for (var i = 0; i < acc.length; i++) {\n combined[i] = acc[i];\n }\n combined[acc.length] = x;\n return n === 0 ? f.apply(null, combined) : curried(f, n - 1, combined);\n };\n}\nvar tupleConstructors = {\n 1: function (a) { return [a]; },\n 2: function (a) { return function (b) { return [a, b]; }; },\n 3: function (a) { return function (b) { return function (c) { return [a, b, c]; }; }; },\n 4: function (a) { return function (b) { return function (c) { return function (d) { return [a, b, c, d]; }; }; }; },\n 5: function (a) { return function (b) { return function (c) { return function (d) { return function (e) { return [a, b, c, d, e]; }; }; }; }; }\n};\nfunction getTupleConstructor(len) {\n if (!tupleConstructors.hasOwnProperty(len)) {\n tupleConstructors[len] = curried(function_1.tuple, len - 1, []);\n }\n return tupleConstructors[len];\n}\nfunction sequenceT(F) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var len = args.length;\n var f = getTupleConstructor(len);\n var fas = F.map(args[0], f);\n for (var i = 1; i < len; i++) {\n fas = F.ap(fas, args[i]);\n }\n return fas;\n };\n}\nexports.sequenceT = sequenceT;\nfunction getRecordConstructor(keys) {\n var len = keys.length;\n switch (len) {\n case 1:\n return function (a) {\n var _a;\n return (_a = {}, _a[keys[0]] = a, _a);\n };\n case 2:\n return function (a) { return function (b) {\n var _a;\n return (_a = {}, _a[keys[0]] = a, _a[keys[1]] = b, _a);\n }; };\n case 3:\n return function (a) { return function (b) { return function (c) {\n var _a;\n return (_a = {}, _a[keys[0]] = a, _a[keys[1]] = b, _a[keys[2]] = c, _a);\n }; }; };\n case 4:\n return function (a) { return function (b) { return function (c) { return function (d) {\n var _a;\n return (_a = {},\n _a[keys[0]] = a,\n _a[keys[1]] = b,\n _a[keys[2]] = c,\n _a[keys[3]] = d,\n _a);\n }; }; }; };\n case 5:\n return function (a) { return function (b) { return function (c) { return function (d) { return function (e) {\n var _a;\n return (_a = {},\n _a[keys[0]] = a,\n _a[keys[1]] = b,\n _a[keys[2]] = c,\n _a[keys[3]] = d,\n _a[keys[4]] = e,\n _a);\n }; }; }; }; };\n default:\n return curried(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var r = {};\n for (var i = 0; i < len; i++) {\n r[keys[i]] = args[i];\n }\n return r;\n }, len - 1, []);\n }\n}\nfunction sequenceS(F) {\n return function (r) {\n var keys = Object.keys(r);\n var len = keys.length;\n var f = getRecordConstructor(keys);\n var fr = F.map(r[keys[0]], f);\n for (var i = 1; i < len; i++) {\n fr = F.ap(fr, r[keys[i]]);\n }\n return fr;\n };\n}\nexports.sequenceS = sequenceS;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.lefts = exports.rights = exports.reverse = exports.modifyAt = exports.deleteAt = exports.updateAt = exports.insertAt = exports.copy = exports.findLastIndex = exports.findLastMap = exports.findLast = exports.findFirstMap = exports.findFirst = exports.findIndex = exports.dropLeftWhile = exports.dropRight = exports.dropLeft = exports.spanLeft = exports.takeLeftWhile = exports.takeRight = exports.takeLeft = exports.init = exports.tail = exports.last = exports.head = exports.lookup = exports.isOutOfBound = exports.size = exports.scanRight = exports.scanLeft = exports.chainWithIndex = exports.foldRight = exports.matchRight = exports.matchRightW = exports.foldLeft = exports.matchLeft = exports.matchLeftW = exports.match = exports.matchW = exports.fromEither = exports.fromOption = exports.fromPredicate = exports.replicate = exports.makeBy = exports.appendW = exports.append = exports.prependW = exports.prepend = exports.isNonEmpty = exports.isEmpty = void 0;\nexports.traverseWithIndex = exports.sequence = exports.traverse = exports.reduceRightWithIndex = exports.reduceRight = exports.reduceWithIndex = exports.reduce = exports.foldMapWithIndex = exports.foldMap = exports.duplicate = exports.extend = exports.filterWithIndex = exports.alt = exports.altW = exports.partitionMapWithIndex = exports.partitionMap = exports.partitionWithIndex = exports.partition = exports.filter = exports.separate = exports.compact = exports.filterMap = exports.filterMapWithIndex = exports.mapWithIndex = exports.flatten = exports.chain = exports.ap = exports.map = exports.zero = exports.of = exports.difference = exports.intersection = exports.union = exports.concat = exports.concatW = exports.comprehension = exports.fromOptionK = exports.chunksOf = exports.splitAt = exports.chop = exports.sortBy = exports.uniq = exports.elem = exports.rotate = exports.intersperse = exports.prependAll = exports.unzip = exports.zip = exports.zipWith = exports.sort = void 0;\nexports.some = exports.every = exports.unsafeDeleteAt = exports.unsafeUpdateAt = exports.unsafeInsertAt = exports.fromEitherK = exports.FromEither = exports.filterE = exports.ChainRecBreadthFirst = exports.chainRecBreadthFirst = exports.ChainRecDepthFirst = exports.chainRecDepthFirst = exports.Witherable = exports.TraversableWithIndex = exports.Traversable = exports.FoldableWithIndex = exports.Foldable = exports.FilterableWithIndex = exports.Filterable = exports.Compactable = exports.Extend = exports.Alternative = exports.guard = exports.Zero = exports.Alt = exports.Unfoldable = exports.Monad = exports.chainFirst = exports.Chain = exports.Applicative = exports.apSecond = exports.apFirst = exports.Apply = exports.FunctorWithIndex = exports.Pointed = exports.flap = exports.Functor = exports.getDifferenceMagma = exports.getIntersectionSemigroup = exports.getUnionMonoid = exports.getUnionSemigroup = exports.getOrd = exports.getEq = exports.getMonoid = exports.getSemigroup = exports.getShow = exports.URI = exports.unfold = exports.wilt = exports.wither = void 0;\nexports.array = exports.prependToAll = exports.snoc = exports.cons = exports.empty = exports.range = exports.apS = exports.bind = exports.bindTo = exports.Do = exports.exists = void 0;\nvar Apply_1 = require(\"./Apply\");\nvar Chain_1 = require(\"./Chain\");\nvar FromEither_1 = require(\"./FromEither\");\nvar function_1 = require(\"./function\");\nvar Functor_1 = require(\"./Functor\");\nvar _ = __importStar(require(\"./internal\"));\nvar NEA = __importStar(require(\"./NonEmptyArray\"));\nvar RA = __importStar(require(\"./ReadonlyArray\"));\nvar Separated_1 = require(\"./Separated\");\nvar Witherable_1 = require(\"./Witherable\");\nvar Zero_1 = require(\"./Zero\");\n// -------------------------------------------------------------------------------------\n// refinements\n// -------------------------------------------------------------------------------------\n/**\n * Test whether an array is empty\n *\n * @example\n * import { isEmpty } from 'fp-ts/Array'\n *\n * assert.strictEqual(isEmpty([]), true)\n *\n * @category refinements\n * @since 2.0.0\n */\nvar isEmpty = function (as) { return as.length === 0; };\nexports.isEmpty = isEmpty;\n/**\n * Test whether an array is non empty narrowing down the type to `NonEmptyArray
`\n *\n * @category refinements\n * @since 2.0.0\n */\nexports.isNonEmpty = NEA.isNonEmpty;\n// -------------------------------------------------------------------------------------\n// constructors\n// -------------------------------------------------------------------------------------\n/**\n * Prepend an element to the front of a `Array`, creating a new `NonEmptyArray`.\n *\n * @example\n * import { prepend } from 'fp-ts/Array'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe([2, 3, 4], prepend(1)), [1, 2, 3, 4])\n *\n * @category constructors\n * @since 2.10.0\n */\nexports.prepend = NEA.prepend;\n/**\n * Less strict version of [`prepend`](#prepend).\n *\n * @category constructors\n * @since 2.11.0\n */\nexports.prependW = NEA.prependW;\n/**\n * Append an element to the end of a `Array`, creating a new `NonEmptyArray`.\n *\n * @example\n * import { append } from 'fp-ts/Array'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe([1, 2, 3], append(4)), [1, 2, 3, 4])\n *\n * @category constructors\n * @since 2.10.0\n */\nexports.append = NEA.append;\n/**\n * Less strict version of [`append`](#append).\n *\n * @category constructors\n * @since 2.11.0\n */\nexports.appendW = NEA.appendW;\n/**\n * Return a `Array` of length `n` with element `i` initialized with `f(i)`.\n *\n * **Note**. `n` is normalized to a non negative integer.\n *\n * @example\n * import { makeBy } from 'fp-ts/Array'\n *\n * const double = (n: number): number => n * 2\n * assert.deepStrictEqual(makeBy(5, double), [0, 2, 4, 6, 8])\n *\n * @category constructors\n * @since 2.0.0\n */\nvar makeBy = function (n, f) { return (n <= 0 ? [] : NEA.makeBy(f)(n)); };\nexports.makeBy = makeBy;\n/**\n * Create a `Array` containing a value repeated the specified number of times.\n *\n * **Note**. `n` is normalized to a non negative integer.\n *\n * @example\n * import { replicate } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(replicate(3, 'a'), ['a', 'a', 'a'])\n *\n * @category constructors\n * @since 2.0.0\n */\nvar replicate = function (n, a) { return exports.makeBy(n, function () { return a; }); };\nexports.replicate = replicate;\nfunction fromPredicate(predicate) {\n return function (a) { return (predicate(a) ? [a] : []); };\n}\nexports.fromPredicate = fromPredicate;\n// -------------------------------------------------------------------------------------\n// natural transformations\n// -------------------------------------------------------------------------------------\n/**\n * @category natural transformations\n * @since 2.11.0\n */\nvar fromOption = function (ma) { return (_.isNone(ma) ? [] : [ma.value]); };\nexports.fromOption = fromOption;\n/**\n * @category natural transformations\n * @since 2.11.0\n */\nvar fromEither = function (e) { return (_.isLeft(e) ? [] : [e.right]); };\nexports.fromEither = fromEither;\n// -------------------------------------------------------------------------------------\n// destructors\n// -------------------------------------------------------------------------------------\n/**\n * Less strict version of [`match`](#match).\n *\n * @category destructors\n * @since 2.11.0\n */\nvar matchW = function (onEmpty, onNonEmpty) { return function (as) {\n return exports.isNonEmpty(as) ? onNonEmpty(as) : onEmpty();\n}; };\nexports.matchW = matchW;\n/**\n * Less strict version of [`match`](#match).\n *\n * @category destructors\n * @since 2.11.0\n */\nexports.match = exports.matchW;\n/**\n * Less strict version of [`matchLeft`](#matchleft).\n *\n * @category destructors\n * @since 2.11.0\n */\nvar matchLeftW = function (onEmpty, onNonEmpty) { return function (as) { return (exports.isNonEmpty(as) ? onNonEmpty(NEA.head(as), NEA.tail(as)) : onEmpty()); }; };\nexports.matchLeftW = matchLeftW;\n/**\n * Break an `Array` into its first element and remaining elements.\n *\n * @example\n * import { matchLeft } from 'fp-ts/Array'\n *\n * const len: (as: Array) => number = matchLeft(() => 0, (_, tail) => 1 + len(tail))\n * assert.strictEqual(len([1, 2, 3]), 3)\n *\n * @category destructors\n * @since 2.10.0\n */\nexports.matchLeft = exports.matchLeftW;\n/**\n * Alias of [`matchLeft`](#matchleft).\n *\n * @category destructors\n * @since 2.0.0\n */\nexports.foldLeft = exports.matchLeft;\n/**\n * Less strict version of [`matchRight`](#matchright).\n *\n * @category destructors\n * @since 2.11.0\n */\nvar matchRightW = function (onEmpty, onNonEmpty) { return function (as) { return (exports.isNonEmpty(as) ? onNonEmpty(NEA.init(as), NEA.last(as)) : onEmpty()); }; };\nexports.matchRightW = matchRightW;\n/**\n * Break an `Array` into its initial elements and the last element.\n *\n * @category destructors\n * @since 2.10.0\n */\nexports.matchRight = exports.matchRightW;\n/**\n * Alias of [`matchRight`](#matchright).\n *\n * @category destructors\n * @since 2.0.0\n */\nexports.foldRight = exports.matchRight;\n// -------------------------------------------------------------------------------------\n// combinators\n// -------------------------------------------------------------------------------------\n/**\n * @category combinators\n * @since 2.7.0\n */\nvar chainWithIndex = function (f) { return function (as) {\n var out = [];\n for (var i = 0; i < as.length; i++) {\n out.push.apply(out, f(i, as[i]));\n }\n return out;\n}; };\nexports.chainWithIndex = chainWithIndex;\n/**\n * Same as `reduce` but it carries over the intermediate steps\n *\n * @example\n * import { scanLeft } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(scanLeft(10, (b, a: number) => b - a)([1, 2, 3]), [10, 9, 7, 4])\n *\n * @category combinators\n * @since 2.0.0\n */\nvar scanLeft = function (b, f) { return function (as) {\n var len = as.length;\n var out = new Array(len + 1);\n out[0] = b;\n for (var i = 0; i < len; i++) {\n out[i + 1] = f(out[i], as[i]);\n }\n return out;\n}; };\nexports.scanLeft = scanLeft;\n/**\n * Fold an array from the right, keeping all intermediate results instead of only the final result\n *\n * @example\n * import { scanRight } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(scanRight(10, (a: number, b) => b - a)([1, 2, 3]), [4, 5, 7, 10])\n *\n * @category combinators\n * @since 2.0.0\n */\nvar scanRight = function (b, f) { return function (as) {\n var len = as.length;\n var out = new Array(len + 1);\n out[len] = b;\n for (var i = len - 1; i >= 0; i--) {\n out[i] = f(as[i], out[i + 1]);\n }\n return out;\n}; };\nexports.scanRight = scanRight;\n/**\n * Calculate the number of elements in a `Array`.\n *\n * @since 2.10.0\n */\nvar size = function (as) { return as.length; };\nexports.size = size;\n/**\n * Test whether an array contains a particular index\n *\n * @since 2.0.0\n */\nexports.isOutOfBound = NEA.isOutOfBound;\n// TODO: remove non-curried overloading in v3\n/**\n * This function provides a safe way to read a value at a particular index from an array\n *\n * @example\n * import { lookup } from 'fp-ts/Array'\n * import { some, none } from 'fp-ts/Option'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe([1, 2, 3], lookup(1)), some(2))\n * assert.deepStrictEqual(pipe([1, 2, 3], lookup(3)), none)\n *\n * @since 2.0.0\n */\nexports.lookup = RA.lookup;\n/**\n * Get the first element in an array, or `None` if the array is empty\n *\n * @example\n * import { head } from 'fp-ts/Array'\n * import { some, none } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(head([1, 2, 3]), some(1))\n * assert.deepStrictEqual(head([]), none)\n *\n * @category destructors\n * @since 2.0.0\n */\nexports.head = RA.head;\n/**\n * Get the last element in an array, or `None` if the array is empty\n *\n * @example\n * import { last } from 'fp-ts/Array'\n * import { some, none } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(last([1, 2, 3]), some(3))\n * assert.deepStrictEqual(last([]), none)\n *\n * @category destructors\n * @since 2.0.0\n */\nexports.last = RA.last;\n/**\n * Get all but the first element of an array, creating a new array, or `None` if the array is empty\n *\n * @example\n * import { tail } from 'fp-ts/Array'\n * import { some, none } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(tail([1, 2, 3]), some([2, 3]))\n * assert.deepStrictEqual(tail([]), none)\n *\n * @category destructors\n * @since 2.0.0\n */\nvar tail = function (as) { return (exports.isNonEmpty(as) ? _.some(NEA.tail(as)) : _.none); };\nexports.tail = tail;\n/**\n * Get all but the last element of an array, creating a new array, or `None` if the array is empty\n *\n * @example\n * import { init } from 'fp-ts/Array'\n * import { some, none } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(init([1, 2, 3]), some([1, 2]))\n * assert.deepStrictEqual(init([]), none)\n *\n * @category destructors\n * @since 2.0.0\n */\nvar init = function (as) { return (exports.isNonEmpty(as) ? _.some(NEA.init(as)) : _.none); };\nexports.init = init;\n/**\n * Keep only a max number of elements from the start of an `Array`, creating a new `Array`.\n *\n * **Note**. `n` is normalized to a non negative integer.\n *\n * @example\n * import { takeLeft } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(takeLeft(2)([1, 2, 3]), [1, 2])\n *\n * @category combinators\n * @since 2.0.0\n */\nvar takeLeft = function (n) { return function (as) { return (exports.isOutOfBound(n, as) ? exports.copy(as) : as.slice(0, n)); }; };\nexports.takeLeft = takeLeft;\n/**\n * Keep only a max number of elements from the end of an `Array`, creating a new `Array`.\n *\n * **Note**. `n` is normalized to a non negative integer.\n *\n * @example\n * import { takeRight } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(takeRight(2)([1, 2, 3, 4, 5]), [4, 5])\n *\n * @category combinators\n * @since 2.0.0\n */\nvar takeRight = function (n) { return function (as) {\n return exports.isOutOfBound(n, as) ? exports.copy(as) : n === 0 ? [] : as.slice(-n);\n}; };\nexports.takeRight = takeRight;\nfunction takeLeftWhile(predicate) {\n return function (as) {\n var out = [];\n for (var _i = 0, as_1 = as; _i < as_1.length; _i++) {\n var a = as_1[_i];\n if (!predicate(a)) {\n break;\n }\n out.push(a);\n }\n return out;\n };\n}\nexports.takeLeftWhile = takeLeftWhile;\nvar spanLeftIndex = function (as, predicate) {\n var l = as.length;\n var i = 0;\n for (; i < l; i++) {\n if (!predicate(as[i])) {\n break;\n }\n }\n return i;\n};\nfunction spanLeft(predicate) {\n return function (as) {\n var _a = exports.splitAt(spanLeftIndex(as, predicate))(as), init = _a[0], rest = _a[1];\n return { init: init, rest: rest };\n };\n}\nexports.spanLeft = spanLeft;\n/**\n * Drop a max number of elements from the start of an `Array`, creating a new `Array`.\n *\n * **Note**. `n` is normalized to a non negative integer.\n *\n * @example\n * import { dropLeft } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(dropLeft(2)([1, 2, 3]), [3])\n *\n * @category combinators\n * @since 2.0.0\n */\nvar dropLeft = function (n) { return function (as) {\n return n <= 0 || exports.isEmpty(as) ? exports.copy(as) : n >= as.length ? [] : as.slice(n, as.length);\n}; };\nexports.dropLeft = dropLeft;\n/**\n * Drop a max number of elements from the end of an `Array`, creating a new `Array`.\n *\n * **Note**. `n` is normalized to a non negative integer.\n *\n * @example\n * import { dropRight } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(dropRight(2)([1, 2, 3, 4, 5]), [1, 2, 3])\n *\n * @category combinators\n * @since 2.0.0\n */\nvar dropRight = function (n) { return function (as) {\n return n <= 0 || exports.isEmpty(as) ? exports.copy(as) : n >= as.length ? [] : as.slice(0, as.length - n);\n}; };\nexports.dropRight = dropRight;\nfunction dropLeftWhile(predicate) {\n return function (as) { return as.slice(spanLeftIndex(as, predicate)); };\n}\nexports.dropLeftWhile = dropLeftWhile;\n/**\n * Find the first index for which a predicate holds\n *\n * @example\n * import { findIndex } from 'fp-ts/Array'\n * import { some, none } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(findIndex((n: number) => n === 2)([1, 2, 3]), some(1))\n * assert.deepStrictEqual(findIndex((n: number) => n === 2)([]), none)\n *\n * @since 2.0.0\n */\nexports.findIndex = RA.findIndex;\nfunction findFirst(predicate) {\n return RA.findFirst(predicate);\n}\nexports.findFirst = findFirst;\n/**\n * Find the first element returned by an option based selector function\n *\n * @example\n * import { findFirstMap } from 'fp-ts/Array'\n * import { some, none } from 'fp-ts/Option'\n *\n * interface Person {\n * readonly name: string\n * readonly age?: number\n * }\n *\n * const persons: Array = [{ name: 'John' }, { name: 'Mary', age: 45 }, { name: 'Joey', age: 28 }]\n *\n * // returns the name of the first person that has an age\n * assert.deepStrictEqual(findFirstMap((p: Person) => (p.age === undefined ? none : some(p.name)))(persons), some('Mary'))\n *\n * @category destructors\n * @since 2.0.0\n */\nexports.findFirstMap = RA.findFirstMap;\nfunction findLast(predicate) {\n return RA.findLast(predicate);\n}\nexports.findLast = findLast;\n/**\n * Find the last element returned by an option based selector function\n *\n * @example\n * import { findLastMap } from 'fp-ts/Array'\n * import { some, none } from 'fp-ts/Option'\n *\n * interface Person {\n * readonly name: string\n * readonly age?: number\n * }\n *\n * const persons: Array = [{ name: 'John' }, { name: 'Mary', age: 45 }, { name: 'Joey', age: 28 }]\n *\n * // returns the name of the last person that has an age\n * assert.deepStrictEqual(findLastMap((p: Person) => (p.age === undefined ? none : some(p.name)))(persons), some('Joey'))\n *\n * @category destructors\n * @since 2.0.0\n */\nexports.findLastMap = RA.findLastMap;\n/**\n * Returns the index of the last element of the list which matches the predicate\n *\n * @example\n * import { findLastIndex } from 'fp-ts/Array'\n * import { some, none } from 'fp-ts/Option'\n *\n * interface X {\n * readonly a: number\n * readonly b: number\n * }\n * const xs: Array = [{ a: 1, b: 0 }, { a: 1, b: 1 }]\n * assert.deepStrictEqual(findLastIndex((x: { readonly a: number }) => x.a === 1)(xs), some(1))\n * assert.deepStrictEqual(findLastIndex((x: { readonly a: number }) => x.a === 4)(xs), none)\n *\n *\n * @since 2.0.0\n */\nexports.findLastIndex = RA.findLastIndex;\n/**\n * @category combinators\n * @since 2.0.0\n */\nvar copy = function (as) { return as.slice(); };\nexports.copy = copy;\n/**\n * Insert an element at the specified index, creating a new array, or returning `None` if the index is out of bounds\n *\n * @example\n * import { insertAt } from 'fp-ts/Array'\n * import { some } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(insertAt(2, 5)([1, 2, 3, 4]), some([1, 2, 5, 3, 4]))\n *\n * @since 2.0.0\n */\nvar insertAt = function (i, a) { return function (as) {\n return i < 0 || i > as.length ? _.none : _.some(exports.unsafeInsertAt(i, a, as));\n}; };\nexports.insertAt = insertAt;\n/**\n * Change the element at the specified index, creating a new array, or returning `None` if the index is out of bounds\n *\n * @example\n * import { updateAt } from 'fp-ts/Array'\n * import { some, none } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(updateAt(1, 1)([1, 2, 3]), some([1, 1, 3]))\n * assert.deepStrictEqual(updateAt(1, 1)([]), none)\n *\n * @since 2.0.0\n */\nvar updateAt = function (i, a) { return exports.modifyAt(i, function () { return a; }); };\nexports.updateAt = updateAt;\n/**\n * Delete the element at the specified index, creating a new array, or returning `None` if the index is out of bounds\n *\n * @example\n * import { deleteAt } from 'fp-ts/Array'\n * import { some, none } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(deleteAt(0)([1, 2, 3]), some([2, 3]))\n * assert.deepStrictEqual(deleteAt(1)([]), none)\n *\n * @since 2.0.0\n */\nvar deleteAt = function (i) { return function (as) {\n return exports.isOutOfBound(i, as) ? _.none : _.some(exports.unsafeDeleteAt(i, as));\n}; };\nexports.deleteAt = deleteAt;\n/**\n * Apply a function to the element at the specified index, creating a new array, or returning `None` if the index is out\n * of bounds\n *\n * @example\n * import { modifyAt } from 'fp-ts/Array'\n * import { some, none } from 'fp-ts/Option'\n *\n * const double = (x: number): number => x * 2\n * assert.deepStrictEqual(modifyAt(1, double)([1, 2, 3]), some([1, 4, 3]))\n * assert.deepStrictEqual(modifyAt(1, double)([]), none)\n *\n * @since 2.0.0\n */\nvar modifyAt = function (i, f) { return function (as) {\n return exports.isOutOfBound(i, as) ? _.none : _.some(exports.unsafeUpdateAt(i, f(as[i]), as));\n}; };\nexports.modifyAt = modifyAt;\n/**\n * Reverse an array, creating a new array\n *\n * @example\n * import { reverse } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(reverse([1, 2, 3]), [3, 2, 1])\n *\n * @category combinators\n * @since 2.0.0\n */\nvar reverse = function (as) { return (exports.isEmpty(as) ? [] : as.slice().reverse()); };\nexports.reverse = reverse;\n/**\n * Extracts from an array of `Either` all the `Right` elements. All the `Right` elements are extracted in order\n *\n * @example\n * import { rights } from 'fp-ts/Array'\n * import { right, left } from 'fp-ts/Either'\n *\n * assert.deepStrictEqual(rights([right(1), left('foo'), right(2)]), [1, 2])\n *\n * @category combinators\n * @since 2.0.0\n */\nvar rights = function (as) {\n var r = [];\n for (var i = 0; i < as.length; i++) {\n var a = as[i];\n if (a._tag === 'Right') {\n r.push(a.right);\n }\n }\n return r;\n};\nexports.rights = rights;\n/**\n * Extracts from an array of `Either` all the `Left` elements. All the `Left` elements are extracted in order\n *\n * @example\n * import { lefts } from 'fp-ts/Array'\n * import { left, right } from 'fp-ts/Either'\n *\n * assert.deepStrictEqual(lefts([right(1), left('foo'), right(2)]), ['foo'])\n *\n * @category combinators\n * @since 2.0.0\n */\nvar lefts = function (as) {\n var r = [];\n for (var i = 0; i < as.length; i++) {\n var a = as[i];\n if (a._tag === 'Left') {\n r.push(a.left);\n }\n }\n return r;\n};\nexports.lefts = lefts;\n/**\n * Sort the elements of an array in increasing order, creating a new array\n *\n * @example\n * import { sort } from 'fp-ts/Array'\n * import * as N from 'fp-ts/number'\n *\n * assert.deepStrictEqual(sort(N.Ord)([3, 2, 1]), [1, 2, 3])\n *\n * @category combinators\n * @since 2.0.0\n */\nvar sort = function (O) { return function (as) {\n return as.length <= 1 ? exports.copy(as) : as.slice().sort(O.compare);\n}; };\nexports.sort = sort;\n/**\n * Apply a function to pairs of elements at the same index in two arrays, collecting the results in a new array. If one\n * input array is short, excess elements of the longer array are discarded.\n *\n * @example\n * import { zipWith } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(zipWith([1, 2, 3], ['a', 'b', 'c', 'd'], (n, s) => s + n), ['a1', 'b2', 'c3'])\n *\n * @category combinators\n * @since 2.0.0\n */\nvar zipWith = function (fa, fb, f) {\n var fc = [];\n var len = Math.min(fa.length, fb.length);\n for (var i = 0; i < len; i++) {\n fc[i] = f(fa[i], fb[i]);\n }\n return fc;\n};\nexports.zipWith = zipWith;\nfunction zip(as, bs) {\n if (bs === undefined) {\n return function (bs) { return zip(bs, as); };\n }\n return exports.zipWith(as, bs, function (a, b) { return [a, b]; });\n}\nexports.zip = zip;\n/**\n * The function is reverse of `zip`. Takes an array of pairs and return two corresponding arrays\n *\n * @example\n * import { unzip } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(unzip([[1, 'a'], [2, 'b'], [3, 'c']]), [[1, 2, 3], ['a', 'b', 'c']])\n *\n * @since 2.0.0\n */\nvar unzip = function (as) {\n var fa = [];\n var fb = [];\n for (var i = 0; i < as.length; i++) {\n fa[i] = as[i][0];\n fb[i] = as[i][1];\n }\n return [fa, fb];\n};\nexports.unzip = unzip;\n/**\n * Prepend an element to every member of an array\n *\n * @example\n * import { prependAll } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(prependAll(9)([1, 2, 3, 4]), [9, 1, 9, 2, 9, 3, 9, 4])\n *\n * @category combinators\n * @since 2.10.0\n */\nvar prependAll = function (middle) {\n var f = NEA.prependAll(middle);\n return function (as) { return (exports.isNonEmpty(as) ? f(as) : []); };\n};\nexports.prependAll = prependAll;\n/**\n * Places an element in between members of an array\n *\n * @example\n * import { intersperse } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(intersperse(9)([1, 2, 3, 4]), [1, 9, 2, 9, 3, 9, 4])\n *\n * @category combinators\n * @since 2.9.0\n */\nvar intersperse = function (middle) {\n var f = NEA.intersperse(middle);\n return function (as) { return (exports.isNonEmpty(as) ? f(as) : exports.copy(as)); };\n};\nexports.intersperse = intersperse;\n/**\n * Rotate a `Array` by `n` steps.\n *\n * @example\n * import { rotate } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(rotate(2)([1, 2, 3, 4, 5]), [4, 5, 1, 2, 3])\n *\n * @category combinators\n * @since 2.0.0\n */\nvar rotate = function (n) {\n var f = NEA.rotate(n);\n return function (as) { return (exports.isNonEmpty(as) ? f(as) : exports.copy(as)); };\n};\nexports.rotate = rotate;\n// TODO: remove non-curried overloading in v3\n/**\n * Test if a value is a member of an array. Takes a `Eq` as a single\n * argument which returns the function to use to search for a value of type `A` in\n * an array of type `Array`.\n *\n * @example\n * import { elem } from 'fp-ts/Array'\n * import * as N from 'fp-ts/number'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.strictEqual(pipe([1, 2, 3], elem(N.Eq)(2)), true)\n * assert.strictEqual(pipe([1, 2, 3], elem(N.Eq)(0)), false)\n *\n * @since 2.0.0\n */\nexports.elem = RA.elem;\n/**\n * Remove duplicates from an array, keeping the first occurrence of an element.\n *\n * @example\n * import { uniq } from 'fp-ts/Array'\n * import * as N from 'fp-ts/number'\n *\n * assert.deepStrictEqual(uniq(N.Eq)([1, 2, 1]), [1, 2])\n *\n * @category combinators\n * @since 2.0.0\n */\nvar uniq = function (E) {\n var f = NEA.uniq(E);\n return function (as) { return (exports.isNonEmpty(as) ? f(as) : exports.copy(as)); };\n};\nexports.uniq = uniq;\n/**\n * Sort the elements of an array in increasing order, where elements are compared using first `ords[0]`, then `ords[1]`,\n * etc...\n *\n * @example\n * import { sortBy } from 'fp-ts/Array'\n * import { contramap } from 'fp-ts/Ord'\n * import * as S from 'fp-ts/string'\n * import * as N from 'fp-ts/number'\n * import { pipe } from 'fp-ts/function'\n *\n * interface Person {\n * readonly name: string\n * readonly age: number\n * }\n * const byName = pipe(S.Ord, contramap((p: Person) => p.name))\n * const byAge = pipe(N.Ord, contramap((p: Person) => p.age))\n *\n * const sortByNameByAge = sortBy([byName, byAge])\n *\n * const persons = [{ name: 'a', age: 1 }, { name: 'b', age: 3 }, { name: 'c', age: 2 }, { name: 'b', age: 2 }]\n * assert.deepStrictEqual(sortByNameByAge(persons), [\n * { name: 'a', age: 1 },\n * { name: 'b', age: 2 },\n * { name: 'b', age: 3 },\n * { name: 'c', age: 2 }\n * ])\n *\n * @category combinators\n * @since 2.0.0\n */\nvar sortBy = function (ords) {\n var f = NEA.sortBy(ords);\n return function (as) { return (exports.isNonEmpty(as) ? f(as) : exports.copy(as)); };\n};\nexports.sortBy = sortBy;\n/**\n * A useful recursion pattern for processing an array to produce a new array, often used for \"chopping\" up the input\n * array. Typically chop is called with some function that will consume an initial prefix of the array and produce a\n * value and the rest of the array.\n *\n * @example\n * import { Eq } from 'fp-ts/Eq'\n * import * as A from 'fp-ts/Array'\n * import * as N from 'fp-ts/number'\n * import { pipe } from 'fp-ts/function'\n *\n * const group = (S: Eq): ((as: Array) => Array>) => {\n * return A.chop(as => {\n * const { init, rest } = pipe(as, A.spanLeft((a: A) => S.equals(a, as[0])))\n * return [init, rest]\n * })\n * }\n * assert.deepStrictEqual(group(N.Eq)([1, 1, 2, 3, 3, 4]), [[1, 1], [2], [3, 3], [4]])\n *\n * @category combinators\n * @since 2.0.0\n */\nvar chop = function (f) {\n var g = NEA.chop(f);\n return function (as) { return (exports.isNonEmpty(as) ? g(as) : []); };\n};\nexports.chop = chop;\n/**\n * Splits an `Array` into two pieces, the first piece has max `n` elements.\n *\n * @example\n * import { splitAt } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(splitAt(2)([1, 2, 3, 4, 5]), [[1, 2], [3, 4, 5]])\n *\n * @category combinators\n * @since 2.0.0\n */\nvar splitAt = function (n) { return function (as) {\n return n >= 1 && exports.isNonEmpty(as) ? NEA.splitAt(n)(as) : exports.isEmpty(as) ? [exports.copy(as), []] : [[], exports.copy(as)];\n}; };\nexports.splitAt = splitAt;\n/**\n * Splits an array into length-`n` pieces. The last piece will be shorter if `n` does not evenly divide the length of\n * the array. Note that `chunksOf(n)([])` is `[]`, not `[[]]`. This is intentional, and is consistent with a recursive\n * definition of `chunksOf`; it satisfies the property that\n *\n * ```ts\n * chunksOf(n)(xs).concat(chunksOf(n)(ys)) == chunksOf(n)(xs.concat(ys)))\n * ```\n *\n * whenever `n` evenly divides the length of `xs`.\n *\n * @example\n * import { chunksOf } from 'fp-ts/Array'\n *\n * assert.deepStrictEqual(chunksOf(2)([1, 2, 3, 4, 5]), [[1, 2], [3, 4], [5]])\n *\n * @category combinators\n * @since 2.0.0\n */\nvar chunksOf = function (n) {\n var f = NEA.chunksOf(n);\n return function (as) { return (exports.isNonEmpty(as) ? f(as) : []); };\n};\nexports.chunksOf = chunksOf;\n/**\n * @category combinators\n * @since 2.11.0\n */\nvar fromOptionK = function (f) { return function () {\n var a = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n a[_i] = arguments[_i];\n }\n return exports.fromOption(f.apply(void 0, a));\n}; };\nexports.fromOptionK = fromOptionK;\nfunction comprehension(input, f, g) {\n if (g === void 0) { g = function () { return true; }; }\n var go = function (scope, input) {\n return exports.isNonEmpty(input)\n ? function_1.pipe(NEA.head(input), exports.chain(function (x) { return go(function_1.pipe(scope, exports.append(x)), NEA.tail(input)); }))\n : g.apply(void 0, scope) ? [f.apply(void 0, scope)]\n : [];\n };\n return go([], input);\n}\nexports.comprehension = comprehension;\n/**\n * @category combinators\n * @since 2.11.0\n */\nvar concatW = function (second) { return function (first) {\n return exports.isEmpty(first) ? exports.copy(second) : exports.isEmpty(second) ? exports.copy(first) : first.concat(second);\n}; };\nexports.concatW = concatW;\n/**\n * @category combinators\n * @since 2.11.0\n */\nexports.concat = exports.concatW;\nfunction union(E) {\n var unionE = NEA.union(E);\n return function (first, second) {\n if (second === undefined) {\n var unionE_1 = union(E);\n return function (second) { return unionE_1(second, first); };\n }\n return exports.isNonEmpty(first) && exports.isNonEmpty(second)\n ? unionE(second)(first)\n : exports.isNonEmpty(first)\n ? exports.copy(first)\n : exports.copy(second);\n };\n}\nexports.union = union;\nfunction intersection(E) {\n var elemE = exports.elem(E);\n return function (xs, ys) {\n if (ys === undefined) {\n var intersectionE_1 = intersection(E);\n return function (ys) { return intersectionE_1(ys, xs); };\n }\n return xs.filter(function (a) { return elemE(a, ys); });\n };\n}\nexports.intersection = intersection;\nfunction difference(E) {\n var elemE = exports.elem(E);\n return function (xs, ys) {\n if (ys === undefined) {\n var differenceE_1 = difference(E);\n return function (ys) { return differenceE_1(ys, xs); };\n }\n return xs.filter(function (a) { return !elemE(a, ys); });\n };\n}\nexports.difference = difference;\n// -------------------------------------------------------------------------------------\n// non-pipeables\n// -------------------------------------------------------------------------------------\nvar _map = function (fa, f) { return function_1.pipe(fa, exports.map(f)); };\n/* istanbul ignore next */\nvar _mapWithIndex = function (fa, f) { return function_1.pipe(fa, exports.mapWithIndex(f)); };\nvar _ap = function (fab, fa) { return function_1.pipe(fab, exports.ap(fa)); };\nvar _chain = function (ma, f) { return function_1.pipe(ma, exports.chain(f)); };\n/* istanbul ignore next */\nvar _filter = function (fa, predicate) { return function_1.pipe(fa, exports.filter(predicate)); };\n/* istanbul ignore next */\nvar _filterMap = function (fa, f) { return function_1.pipe(fa, exports.filterMap(f)); };\n/* istanbul ignore next */\nvar _partition = function (fa, predicate) {\n return function_1.pipe(fa, exports.partition(predicate));\n};\n/* istanbul ignore next */\nvar _partitionMap = function (fa, f) { return function_1.pipe(fa, exports.partitionMap(f)); };\n/* istanbul ignore next */\nvar _partitionWithIndex = function (fa, predicateWithIndex) { return function_1.pipe(fa, exports.partitionWithIndex(predicateWithIndex)); };\n/* istanbul ignore next */\nvar _partitionMapWithIndex = function (fa, f) { return function_1.pipe(fa, exports.partitionMapWithIndex(f)); };\n/* istanbul ignore next */\nvar _alt = function (fa, that) { return function_1.pipe(fa, exports.alt(that)); };\nvar _reduce = function (fa, b, f) { return function_1.pipe(fa, exports.reduce(b, f)); };\n/* istanbul ignore next */\nvar _foldMap = function (M) {\n var foldMapM = exports.foldMap(M);\n return function (fa, f) { return function_1.pipe(fa, foldMapM(f)); };\n};\n/* istanbul ignore next */\nvar _reduceRight = function (fa, b, f) { return function_1.pipe(fa, exports.reduceRight(b, f)); };\n/* istanbul ignore next */\nvar _reduceWithIndex = function (fa, b, f) {\n return function_1.pipe(fa, exports.reduceWithIndex(b, f));\n};\n/* istanbul ignore next */\nvar _foldMapWithIndex = function (M) {\n var foldMapWithIndexM = exports.foldMapWithIndex(M);\n return function (fa, f) { return function_1.pipe(fa, foldMapWithIndexM(f)); };\n};\n/* istanbul ignore next */\nvar _reduceRightWithIndex = function (fa, b, f) {\n return function_1.pipe(fa, exports.reduceRightWithIndex(b, f));\n};\n/* istanbul ignore next */\nvar _filterMapWithIndex = function (fa, f) { return function_1.pipe(fa, exports.filterMapWithIndex(f)); };\n/* istanbul ignore next */\nvar _filterWithIndex = function (fa, predicateWithIndex) { return function_1.pipe(fa, exports.filterWithIndex(predicateWithIndex)); };\n/* istanbul ignore next */\nvar _extend = function (fa, f) { return function_1.pipe(fa, exports.extend(f)); };\n/* istanbul ignore next */\nvar _traverse = function (F) {\n var traverseF = exports.traverse(F);\n return function (ta, f) { return function_1.pipe(ta, traverseF(f)); };\n};\n/* istanbul ignore next */\nvar _traverseWithIndex = function (F) {\n var traverseWithIndexF = exports.traverseWithIndex(F);\n return function (ta, f) { return function_1.pipe(ta, traverseWithIndexF(f)); };\n};\nvar _chainRecDepthFirst = RA._chainRecDepthFirst;\nvar _chainRecBreadthFirst = RA._chainRecBreadthFirst;\n// -------------------------------------------------------------------------------------\n// type class members\n// -------------------------------------------------------------------------------------\n/**\n * @category Pointed\n * @since 2.0.0\n */\nexports.of = NEA.of;\n/**\n * @category Zero\n * @since 2.7.0\n */\nvar zero = function () { return []; };\nexports.zero = zero;\n/**\n * `map` can be used to turn functions `(a: A) => B` into functions `(fa: F) => F` whose argument and return types\n * use the type constructor `F` to represent some computational context.\n *\n * @category Functor\n * @since 2.0.0\n */\nvar map = function (f) { return function (fa) { return fa.map(function (a) { return f(a); }); }; };\nexports.map = map;\n/**\n * Apply a function to an argument under a type constructor.\n *\n * @category Apply\n * @since 2.0.0\n */\nvar ap = function (fa) { return exports.chain(function (f) { return function_1.pipe(fa, exports.map(f)); }); };\nexports.ap = ap;\n/**\n * Composes computations in sequence, using the return value of one computation to determine the next computation.\n *\n * @category Monad\n * @since 2.0.0\n */\nvar chain = function (f) { return function (ma) {\n return function_1.pipe(ma, exports.chainWithIndex(function (_, a) { return f(a); }));\n}; };\nexports.chain = chain;\n/**\n * Derivable from `Chain`.\n *\n * @category combinators\n * @since 2.5.0\n */\nexports.flatten = \n/*#__PURE__*/\nexports.chain(function_1.identity);\n/**\n * @category FunctorWithIndex\n * @since 2.0.0\n */\nvar mapWithIndex = function (f) { return function (fa) {\n return fa.map(function (a, i) { return f(i, a); });\n}; };\nexports.mapWithIndex = mapWithIndex;\n/**\n * @category FilterableWithIndex\n * @since 2.0.0\n */\nvar filterMapWithIndex = function (f) { return function (fa) {\n var out = [];\n for (var i = 0; i < fa.length; i++) {\n var optionB = f(i, fa[i]);\n if (_.isSome(optionB)) {\n out.push(optionB.value);\n }\n }\n return out;\n}; };\nexports.filterMapWithIndex = filterMapWithIndex;\n/**\n * @category Filterable\n * @since 2.0.0\n */\nvar filterMap = function (f) {\n return exports.filterMapWithIndex(function (_, a) { return f(a); });\n};\nexports.filterMap = filterMap;\n/**\n * @category Compactable\n * @since 2.0.0\n */\nexports.compact = \n/*#__PURE__*/\nexports.filterMap(function_1.identity);\n/**\n * @category Compactable\n * @since 2.0.0\n */\nvar separate = function (fa) {\n var left = [];\n var right = [];\n for (var _i = 0, fa_1 = fa; _i < fa_1.length; _i++) {\n var e = fa_1[_i];\n if (e._tag === 'Left') {\n left.push(e.left);\n }\n else {\n right.push(e.right);\n }\n }\n return Separated_1.separated(left, right);\n};\nexports.separate = separate;\n/**\n * @category Filterable\n * @since 2.0.0\n */\nvar filter = function (predicate) { return function (as) { return as.filter(predicate); }; };\nexports.filter = filter;\n/**\n * @category Filterable\n * @since 2.0.0\n */\nvar partition = function (predicate) {\n return exports.partitionWithIndex(function (_, a) { return predicate(a); });\n};\nexports.partition = partition;\n/**\n * @category FilterableWithIndex\n * @since 2.0.0\n */\nvar partitionWithIndex = function (predicateWithIndex) { return function (as) {\n var left = [];\n var right = [];\n for (var i = 0; i < as.length; i++) {\n var b = as[i];\n if (predicateWithIndex(i, b)) {\n right.push(b);\n }\n else {\n left.push(b);\n }\n }\n return Separated_1.separated(left, right);\n}; };\nexports.partitionWithIndex = partitionWithIndex;\n/**\n * @category Filterable\n * @since 2.0.0\n */\nvar partitionMap = function (f) { return exports.partitionMapWithIndex(function (_, a) { return f(a); }); };\nexports.partitionMap = partitionMap;\n/**\n * @category FilterableWithIndex\n * @since 2.0.0\n */\nvar partitionMapWithIndex = function (f) { return function (fa) {\n var left = [];\n var right = [];\n for (var i = 0; i < fa.length; i++) {\n var e = f(i, fa[i]);\n if (e._tag === 'Left') {\n left.push(e.left);\n }\n else {\n right.push(e.right);\n }\n }\n return Separated_1.separated(left, right);\n}; };\nexports.partitionMapWithIndex = partitionMapWithIndex;\n/**\n * Less strict version of [`alt`](#alt).\n *\n * @category Alt\n * @since 2.9.0\n */\nvar altW = function (that) { return function (fa) { return fa.concat(that()); }; };\nexports.altW = altW;\n/**\n * Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to\n * types of kind `* -> *`.\n *\n * @category Alt\n * @since 2.0.0\n */\nexports.alt = exports.altW;\n/**\n * @category FilterableWithIndex\n * @since 2.0.0\n */\nvar filterWithIndex = function (predicateWithIndex) { return function (as) {\n return as.filter(function (b, i) { return predicateWithIndex(i, b); });\n}; };\nexports.filterWithIndex = filterWithIndex;\n/**\n * @category Extend\n * @since 2.0.0\n */\nvar extend = function (f) { return function (wa) {\n return wa.map(function (_, i) { return f(wa.slice(i)); });\n}; };\nexports.extend = extend;\n/**\n * Derivable from `Extend`.\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.duplicate = \n/*#__PURE__*/\nexports.extend(function_1.identity);\n/**\n * @category Foldable\n * @since 2.0.0\n */\nexports.foldMap = RA.foldMap;\n/**\n * @category FoldableWithIndex\n * @since 2.0.0\n */\nexports.foldMapWithIndex = RA.foldMapWithIndex;\n/**\n * @category Foldable\n * @since 2.0.0\n */\nexports.reduce = RA.reduce;\n/**\n * @category FoldableWithIndex\n * @since 2.0.0\n */\nexports.reduceWithIndex = RA.reduceWithIndex;\n/**\n * @category Foldable\n * @since 2.0.0\n */\nexports.reduceRight = RA.reduceRight;\n/**\n * @category FoldableWithIndex\n * @since 2.0.0\n */\nexports.reduceRightWithIndex = RA.reduceRightWithIndex;\n/**\n * @category Traversable\n * @since 2.6.3\n */\nvar traverse = function (F) {\n var traverseWithIndexF = exports.traverseWithIndex(F);\n return function (f) { return traverseWithIndexF(function (_, a) { return f(a); }); };\n};\nexports.traverse = traverse;\n/**\n * @category Traversable\n * @since 2.6.3\n */\nvar sequence = function (F) { return function (ta) {\n return _reduce(ta, F.of(exports.zero()), function (fas, fa) {\n return F.ap(F.map(fas, function (as) { return function (a) { return function_1.pipe(as, exports.append(a)); }; }), fa);\n });\n}; };\nexports.sequence = sequence;\n/**\n * @category TraversableWithIndex\n * @since 2.6.3\n */\nvar traverseWithIndex = function (F) { return function (f) {\n return exports.reduceWithIndex(F.of(exports.zero()), function (i, fbs, a) {\n return F.ap(F.map(fbs, function (bs) { return function (b) { return function_1.pipe(bs, exports.append(b)); }; }), f(i, a));\n });\n}; };\nexports.traverseWithIndex = traverseWithIndex;\n/**\n * @category Witherable\n * @since 2.6.5\n */\nvar wither = function (F) {\n var _witherF = _wither(F);\n return function (f) { return function (fa) { return _witherF(fa, f); }; };\n};\nexports.wither = wither;\n/**\n * @category Witherable\n * @since 2.6.5\n */\nvar wilt = function (F) {\n var _wiltF = _wilt(F);\n return function (f) { return function (fa) { return _wiltF(fa, f); }; };\n};\nexports.wilt = wilt;\n/**\n * Creates an `Array` from the results of `f(b)`, where `b` is an initial value.\n * `unfold` stops when `f` returns `Option.none`.\n * @example\n * import { unfold } from 'fp-ts/Array'\n * import { some, none } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(\n * unfold(5, (n) => (n > 0 ? some([n, n - 1]) : none)),\n * [5, 4, 3, 2, 1]\n * )\n *\n * @category Unfoldable\n * @since 2.6.6\n */\nvar unfold = function (b, f) {\n var out = [];\n var bb = b;\n while (true) {\n var mt = f(bb);\n if (_.isSome(mt)) {\n var _a = mt.value, a = _a[0], b_1 = _a[1];\n out.push(a);\n bb = b_1;\n }\n else {\n break;\n }\n }\n return out;\n};\nexports.unfold = unfold;\n// -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.URI = 'Array';\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.getShow = RA.getShow;\n/**\n * @category instances\n * @since 2.10.0\n */\nvar getSemigroup = function () { return ({\n concat: function (first, second) { return first.concat(second); }\n}); };\nexports.getSemigroup = getSemigroup;\n/**\n * Returns a `Monoid` for `Array`\n *\n * @example\n * import { getMonoid } from 'fp-ts/Array'\n *\n * const M = getMonoid()\n * assert.deepStrictEqual(M.concat([1, 2], [3, 4]), [1, 2, 3, 4])\n *\n * @category instances\n * @since 2.0.0\n */\nvar getMonoid = function () { return ({\n concat: exports.getSemigroup().concat,\n empty: []\n}); };\nexports.getMonoid = getMonoid;\n/**\n * Derives an `Eq` over the `Array` of a given element type from the `Eq` of that type. The derived `Eq` defines two\n * arrays as equal if all elements of both arrays are compared equal pairwise with the given `E`. In case of arrays of\n * different lengths, the result is non equality.\n *\n * @example\n * import * as S from 'fp-ts/string'\n * import { getEq } from 'fp-ts/Array'\n *\n * const E = getEq(S.Eq)\n * assert.strictEqual(E.equals(['a', 'b'], ['a', 'b']), true)\n * assert.strictEqual(E.equals(['a'], []), false)\n *\n * @category instances\n * @since 2.0.0\n */\nexports.getEq = RA.getEq;\n/**\n * Derives an `Ord` over the `Array` of a given element type from the `Ord` of that type. The ordering between two such\n * arrays is equal to: the first non equal comparison of each arrays elements taken pairwise in increasing order, in\n * case of equality over all the pairwise elements; the longest array is considered the greatest, if both arrays have\n * the same length, the result is equality.\n *\n * @example\n * import { getOrd } from 'fp-ts/Array'\n * import * as S from 'fp-ts/string'\n *\n * const O = getOrd(S.Ord)\n * assert.strictEqual(O.compare(['b'], ['a']), 1)\n * assert.strictEqual(O.compare(['a'], ['a']), 0)\n * assert.strictEqual(O.compare(['a'], ['b']), -1)\n *\n * @category instances\n * @since 2.0.0\n */\nexports.getOrd = RA.getOrd;\n/**\n * @category instances\n * @since 2.11.0\n */\nvar getUnionSemigroup = function (E) {\n var unionE = union(E);\n return {\n concat: function (first, second) { return unionE(second)(first); }\n };\n};\nexports.getUnionSemigroup = getUnionSemigroup;\n/**\n * @category instances\n * @since 2.11.0\n */\nvar getUnionMonoid = function (E) { return ({\n concat: exports.getUnionSemigroup(E).concat,\n empty: []\n}); };\nexports.getUnionMonoid = getUnionMonoid;\n/**\n * @category instances\n * @since 2.11.0\n */\nvar getIntersectionSemigroup = function (E) {\n var intersectionE = intersection(E);\n return {\n concat: function (first, second) { return intersectionE(second)(first); }\n };\n};\nexports.getIntersectionSemigroup = getIntersectionSemigroup;\n/**\n * @category instances\n * @since 2.11.0\n */\nvar getDifferenceMagma = function (E) {\n var differenceE = difference(E);\n return {\n concat: function (first, second) { return differenceE(second)(first); }\n };\n};\nexports.getDifferenceMagma = getDifferenceMagma;\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Functor = {\n URI: exports.URI,\n map: _map\n};\n/**\n * Derivable from `Functor`.\n *\n * @category combinators\n * @since 2.10.0\n */\nexports.flap = \n/*#__PURE__*/\nFunctor_1.flap(exports.Functor);\n/**\n * @category instances\n * @since 2.10.0\n */\nexports.Pointed = {\n URI: exports.URI,\n of: exports.of\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.FunctorWithIndex = {\n URI: exports.URI,\n map: _map,\n mapWithIndex: _mapWithIndex\n};\n/**\n * @category instances\n * @since 2.10.0\n */\nexports.Apply = {\n URI: exports.URI,\n map: _map,\n ap: _ap\n};\n/**\n * Combine two effectful actions, keeping only the result of the first.\n *\n * Derivable from `Apply`.\n *\n * @category combinators\n * @since 2.5.0\n */\nexports.apFirst = \n/*#__PURE__*/\nApply_1.apFirst(exports.Apply);\n/**\n * Combine two effectful actions, keeping only the result of the second.\n *\n * Derivable from `Apply`.\n *\n * @category combinators\n * @since 2.5.0\n */\nexports.apSecond = \n/*#__PURE__*/\nApply_1.apSecond(exports.Apply);\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Applicative = {\n URI: exports.URI,\n map: _map,\n ap: _ap,\n of: exports.of\n};\n/**\n * @category instances\n * @since 2.10.0\n */\nexports.Chain = {\n URI: exports.URI,\n map: _map,\n ap: _ap,\n chain: _chain\n};\n/**\n * Composes computations in sequence, using the return value of one computation to determine the next computation and\n * keeping only the result of the first.\n *\n * Derivable from `Chain`.\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.chainFirst = \n/*#__PURE__*/\nChain_1.chainFirst(exports.Chain);\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Monad = {\n URI: exports.URI,\n map: _map,\n ap: _ap,\n of: exports.of,\n chain: _chain\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Unfoldable = {\n URI: exports.URI,\n unfold: exports.unfold\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Alt = {\n URI: exports.URI,\n map: _map,\n alt: _alt\n};\n/**\n * @category instances\n * @since 2.11.0\n */\nexports.Zero = {\n URI: exports.URI,\n zero: exports.zero\n};\n/**\n * @category constructors\n * @since 2.11.0\n */\nexports.guard = \n/*#__PURE__*/\nZero_1.guard(exports.Zero, exports.Pointed);\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Alternative = {\n URI: exports.URI,\n map: _map,\n ap: _ap,\n of: exports.of,\n alt: _alt,\n zero: exports.zero\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Extend = {\n URI: exports.URI,\n map: _map,\n extend: _extend\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Compactable = {\n URI: exports.URI,\n compact: exports.compact,\n separate: exports.separate\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Filterable = {\n URI: exports.URI,\n map: _map,\n compact: exports.compact,\n separate: exports.separate,\n filter: _filter,\n filterMap: _filterMap,\n partition: _partition,\n partitionMap: _partitionMap\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.FilterableWithIndex = {\n URI: exports.URI,\n map: _map,\n mapWithIndex: _mapWithIndex,\n compact: exports.compact,\n separate: exports.separate,\n filter: _filter,\n filterMap: _filterMap,\n partition: _partition,\n partitionMap: _partitionMap,\n partitionMapWithIndex: _partitionMapWithIndex,\n partitionWithIndex: _partitionWithIndex,\n filterMapWithIndex: _filterMapWithIndex,\n filterWithIndex: _filterWithIndex\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Foldable = {\n URI: exports.URI,\n reduce: _reduce,\n foldMap: _foldMap,\n reduceRight: _reduceRight\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.FoldableWithIndex = {\n URI: exports.URI,\n reduce: _reduce,\n foldMap: _foldMap,\n reduceRight: _reduceRight,\n reduceWithIndex: _reduceWithIndex,\n foldMapWithIndex: _foldMapWithIndex,\n reduceRightWithIndex: _reduceRightWithIndex\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Traversable = {\n URI: exports.URI,\n map: _map,\n reduce: _reduce,\n foldMap: _foldMap,\n reduceRight: _reduceRight,\n traverse: _traverse,\n sequence: exports.sequence\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.TraversableWithIndex = {\n URI: exports.URI,\n map: _map,\n mapWithIndex: _mapWithIndex,\n reduce: _reduce,\n foldMap: _foldMap,\n reduceRight: _reduceRight,\n reduceWithIndex: _reduceWithIndex,\n foldMapWithIndex: _foldMapWithIndex,\n reduceRightWithIndex: _reduceRightWithIndex,\n traverse: _traverse,\n sequence: exports.sequence,\n traverseWithIndex: _traverseWithIndex\n};\nvar _wither = Witherable_1.witherDefault(exports.Traversable, exports.Compactable);\nvar _wilt = Witherable_1.wiltDefault(exports.Traversable, exports.Compactable);\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Witherable = {\n URI: exports.URI,\n map: _map,\n compact: exports.compact,\n separate: exports.separate,\n filter: _filter,\n filterMap: _filterMap,\n partition: _partition,\n partitionMap: _partitionMap,\n reduce: _reduce,\n foldMap: _foldMap,\n reduceRight: _reduceRight,\n traverse: _traverse,\n sequence: exports.sequence,\n wither: _wither,\n wilt: _wilt\n};\n/**\n * @category ChainRec\n * @since 2.11.0\n */\nexports.chainRecDepthFirst = RA.chainRecDepthFirst;\n/**\n * @category instances\n * @since 2.11.0\n */\nexports.ChainRecDepthFirst = {\n URI: exports.URI,\n map: _map,\n ap: _ap,\n chain: _chain,\n chainRec: _chainRecDepthFirst\n};\n/**\n * @category ChainRec\n * @since 2.11.0\n */\nexports.chainRecBreadthFirst = RA.chainRecBreadthFirst;\n/**\n * @category instances\n * @since 2.11.0\n */\nexports.ChainRecBreadthFirst = {\n URI: exports.URI,\n map: _map,\n ap: _ap,\n chain: _chain,\n chainRec: _chainRecBreadthFirst\n};\n/**\n * Filter values inside a context.\n *\n * @since 2.11.0\n */\nexports.filterE = \n/*#__PURE__*/\nWitherable_1.filterE(exports.Witherable);\n/**\n * @category instances\n * @since 2.11.0\n */\nexports.FromEither = {\n URI: exports.URI,\n fromEither: exports.fromEither\n};\n/**\n * @category combinators\n * @since 2.11.0\n */\nexports.fromEitherK = \n/*#__PURE__*/\nFromEither_1.fromEitherK(exports.FromEither);\n// -------------------------------------------------------------------------------------\n// unsafe\n// -------------------------------------------------------------------------------------\n/**\n * @category unsafe\n * @since 2.0.0\n */\nexports.unsafeInsertAt = NEA.unsafeInsertAt;\n/**\n * @category unsafe\n * @since 2.0.0\n */\nvar unsafeUpdateAt = function (i, a, as) {\n return exports.isNonEmpty(as) ? NEA.unsafeUpdateAt(i, a, as) : [];\n};\nexports.unsafeUpdateAt = unsafeUpdateAt;\n/**\n * @category unsafe\n * @since 2.0.0\n */\nvar unsafeDeleteAt = function (i, as) {\n var xs = as.slice();\n xs.splice(i, 1);\n return xs;\n};\nexports.unsafeDeleteAt = unsafeDeleteAt;\n// -------------------------------------------------------------------------------------\n// utils\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.9.0\n */\nexports.every = RA.every;\n/**\n * @since 2.9.0\n */\nvar some = function (predicate) { return function (as) { return as.some(predicate); }; };\nexports.some = some;\n/**\n * Alias of [`some`](#some)\n *\n * @since 2.11.0\n */\nexports.exists = exports.some;\n// -------------------------------------------------------------------------------------\n// do notation\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.9.0\n */\nexports.Do = \n/*#__PURE__*/\nexports.of(_.emptyRecord);\n/**\n * @since 2.8.0\n */\nexports.bindTo = \n/*#__PURE__*/\nFunctor_1.bindTo(exports.Functor);\n/**\n * @since 2.8.0\n */\nexports.bind = \n/*#__PURE__*/\nChain_1.bind(exports.Chain);\n// -------------------------------------------------------------------------------------\n// pipeable sequence S\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.8.0\n */\nexports.apS = \n/*#__PURE__*/\nApply_1.apS(exports.Apply);\n// -------------------------------------------------------------------------------------\n// deprecated\n// -------------------------------------------------------------------------------------\n// tslint:disable: deprecation\n/**\n * Use `NonEmptyArray` module instead.\n *\n * @category constructors\n * @since 2.0.0\n * @deprecated\n */\nexports.range = NEA.range;\n/**\n * Use a new `[]` instead.\n *\n * @since 2.0.0\n * @deprecated\n */\nexports.empty = [];\n/**\n * Use `prepend` instead.\n *\n * @category constructors\n * @since 2.0.0\n * @deprecated\n */\nexports.cons = NEA.cons;\n/**\n * Use `append` instead.\n *\n * @category constructors\n * @since 2.0.0\n * @deprecated\n */\nexports.snoc = NEA.snoc;\n/**\n * Use `prependAll` instead\n *\n * @category combinators\n * @since 2.9.0\n * @deprecated\n */\nexports.prependToAll = exports.prependAll;\n/**\n * Use small, specific instances instead.\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nexports.array = {\n URI: exports.URI,\n compact: exports.compact,\n separate: exports.separate,\n map: _map,\n ap: _ap,\n of: exports.of,\n chain: _chain,\n filter: _filter,\n filterMap: _filterMap,\n partition: _partition,\n partitionMap: _partitionMap,\n mapWithIndex: _mapWithIndex,\n partitionMapWithIndex: _partitionMapWithIndex,\n partitionWithIndex: _partitionWithIndex,\n filterMapWithIndex: _filterMapWithIndex,\n filterWithIndex: _filterWithIndex,\n alt: _alt,\n zero: exports.zero,\n unfold: exports.unfold,\n reduce: _reduce,\n foldMap: _foldMap,\n reduceRight: _reduceRight,\n traverse: _traverse,\n sequence: exports.sequence,\n reduceWithIndex: _reduceWithIndex,\n foldMapWithIndex: _foldMapWithIndex,\n reduceRightWithIndex: _reduceRightWithIndex,\n traverseWithIndex: _traverseWithIndex,\n extend: _extend,\n wither: _wither,\n wilt: _wilt\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.bind = exports.chainFirst = void 0;\nfunction chainFirst(M) {\n return function (f) { return function (first) { return M.chain(first, function (a) { return M.map(f(a), function () { return a; }); }); }; };\n}\nexports.chainFirst = chainFirst;\nfunction bind(M) {\n return function (name, f) { return function (ma) { return M.chain(ma, function (a) { return M.map(f(a), function (b) {\n var _a;\n return Object.assign({}, a, (_a = {}, _a[name] = b, _a));\n }); }); }; };\n}\nexports.bind = bind;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.tailRec = void 0;\n/**\n * @since 2.0.0\n */\nvar tailRec = function (startWith, f) {\n var ab = f(startWith);\n while (ab._tag === 'Left') {\n ab = f(ab.left);\n }\n return ab.right;\n};\nexports.tailRec = tailRec;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fold = exports.match = exports.foldW = exports.matchW = exports.isRight = exports.isLeft = exports.fromOption = exports.fromPredicate = exports.FromEither = exports.MonadThrow = exports.throwError = exports.ChainRec = exports.Extend = exports.extend = exports.Alt = exports.alt = exports.altW = exports.Bifunctor = exports.mapLeft = exports.bimap = exports.Traversable = exports.sequence = exports.traverse = exports.Foldable = exports.reduceRight = exports.foldMap = exports.reduce = exports.Monad = exports.Chain = exports.chain = exports.chainW = exports.Applicative = exports.Apply = exports.ap = exports.apW = exports.Pointed = exports.of = exports.Functor = exports.map = exports.getAltValidation = exports.getApplicativeValidation = exports.getWitherable = exports.getFilterable = exports.getCompactable = exports.getSemigroup = exports.getEq = exports.getShow = exports.URI = exports.right = exports.left = void 0;\nexports.getValidation = exports.getValidationMonoid = exports.getValidationSemigroup = exports.getApplyMonoid = exports.getApplySemigroup = exports.either = exports.stringifyJSON = exports.parseJSON = exports.sequenceArray = exports.traverseArray = exports.traverseArrayWithIndex = exports.traverseReadonlyArrayWithIndex = exports.traverseReadonlyNonEmptyArrayWithIndex = exports.ApT = exports.apSW = exports.apS = exports.bindW = exports.bind = exports.bindTo = exports.Do = exports.exists = exports.elem = exports.toError = exports.toUnion = exports.chainNullableK = exports.fromNullableK = exports.tryCatchK = exports.tryCatch = exports.fromNullable = exports.orElse = exports.orElseW = exports.swap = exports.filterOrElseW = exports.filterOrElse = exports.chainOptionK = exports.fromOptionK = exports.duplicate = exports.flatten = exports.flattenW = exports.chainFirstW = exports.chainFirst = exports.apSecond = exports.apFirst = exports.flap = exports.getOrElse = exports.getOrElseW = void 0;\nvar Applicative_1 = require(\"./Applicative\");\nvar Apply_1 = require(\"./Apply\");\nvar Chain_1 = require(\"./Chain\");\nvar ChainRec_1 = require(\"./ChainRec\");\nvar FromEither_1 = require(\"./FromEither\");\nvar function_1 = require(\"./function\");\nvar Functor_1 = require(\"./Functor\");\nvar _ = __importStar(require(\"./internal\"));\nvar Separated_1 = require(\"./Separated\");\nvar Witherable_1 = require(\"./Witherable\");\n// -------------------------------------------------------------------------------------\n// constructors\n// -------------------------------------------------------------------------------------\n/**\n * Constructs a new `Either` holding a `Left` value. This usually represents a failure, due to the right-bias of this\n * structure.\n *\n * @category constructors\n * @since 2.0.0\n */\nexports.left = _.left;\n/**\n * Constructs a new `Either` holding a `Right` value. This usually represents a successful value due to the right bias\n * of this structure.\n *\n * @category constructors\n * @since 2.0.0\n */\nexports.right = _.right;\n// -------------------------------------------------------------------------------------\n// non-pipeables\n// -------------------------------------------------------------------------------------\nvar _map = function (fa, f) { return function_1.pipe(fa, exports.map(f)); };\nvar _ap = function (fab, fa) { return function_1.pipe(fab, exports.ap(fa)); };\n/* istanbul ignore next */\nvar _chain = function (ma, f) { return function_1.pipe(ma, exports.chain(f)); };\n/* istanbul ignore next */\nvar _reduce = function (fa, b, f) { return function_1.pipe(fa, exports.reduce(b, f)); };\n/* istanbul ignore next */\nvar _foldMap = function (M) { return function (fa, f) {\n var foldMapM = exports.foldMap(M);\n return function_1.pipe(fa, foldMapM(f));\n}; };\n/* istanbul ignore next */\nvar _reduceRight = function (fa, b, f) { return function_1.pipe(fa, exports.reduceRight(b, f)); };\nvar _traverse = function (F) {\n var traverseF = exports.traverse(F);\n return function (ta, f) { return function_1.pipe(ta, traverseF(f)); };\n};\nvar _bimap = function (fa, f, g) { return function_1.pipe(fa, exports.bimap(f, g)); };\nvar _mapLeft = function (fa, f) { return function_1.pipe(fa, exports.mapLeft(f)); };\n/* istanbul ignore next */\nvar _alt = function (fa, that) { return function_1.pipe(fa, exports.alt(that)); };\n/* istanbul ignore next */\nvar _extend = function (wa, f) { return function_1.pipe(wa, exports.extend(f)); };\nvar _chainRec = function (a, f) {\n return ChainRec_1.tailRec(f(a), function (e) {\n return exports.isLeft(e) ? exports.right(exports.left(e.left)) : exports.isLeft(e.right) ? exports.left(f(e.right.left)) : exports.right(exports.right(e.right.right));\n });\n};\n// -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.URI = 'Either';\n/**\n * @category instances\n * @since 2.0.0\n */\nvar getShow = function (SE, SA) { return ({\n show: function (ma) { return (exports.isLeft(ma) ? \"left(\" + SE.show(ma.left) + \")\" : \"right(\" + SA.show(ma.right) + \")\"); }\n}); };\nexports.getShow = getShow;\n/**\n * @category instances\n * @since 2.0.0\n */\nvar getEq = function (EL, EA) { return ({\n equals: function (x, y) {\n return x === y || (exports.isLeft(x) ? exports.isLeft(y) && EL.equals(x.left, y.left) : exports.isRight(y) && EA.equals(x.right, y.right));\n }\n}); };\nexports.getEq = getEq;\n/**\n * Semigroup returning the left-most non-`Left` value. If both operands are `Right`s then the inner values are\n * concatenated using the provided `Semigroup`\n *\n * @example\n * import { getSemigroup, left, right } from 'fp-ts/Either'\n * import { SemigroupSum } from 'fp-ts/number'\n *\n * const S = getSemigroup(SemigroupSum)\n * assert.deepStrictEqual(S.concat(left('a'), left('b')), left('a'))\n * assert.deepStrictEqual(S.concat(left('a'), right(2)), right(2))\n * assert.deepStrictEqual(S.concat(right(1), left('b')), right(1))\n * assert.deepStrictEqual(S.concat(right(1), right(2)), right(3))\n *\n * @category instances\n * @since 2.0.0\n */\nvar getSemigroup = function (S) { return ({\n concat: function (x, y) { return (exports.isLeft(y) ? x : exports.isLeft(x) ? y : exports.right(S.concat(x.right, y.right))); }\n}); };\nexports.getSemigroup = getSemigroup;\n/**\n * Builds a `Compactable` instance for `Either` given `Monoid` for the left side.\n *\n * @category instances\n * @since 2.10.0\n */\nvar getCompactable = function (M) {\n var empty = exports.left(M.empty);\n return {\n URI: exports.URI,\n _E: undefined,\n compact: function (ma) { return (exports.isLeft(ma) ? ma : ma.right._tag === 'None' ? empty : exports.right(ma.right.value)); },\n separate: function (ma) {\n return exports.isLeft(ma)\n ? Separated_1.separated(ma, ma)\n : exports.isLeft(ma.right)\n ? Separated_1.separated(exports.right(ma.right.left), empty)\n : Separated_1.separated(empty, exports.right(ma.right.right));\n }\n };\n};\nexports.getCompactable = getCompactable;\n/**\n * Builds a `Filterable` instance for `Either` given `Monoid` for the left side\n *\n * @category instances\n * @since 2.10.0\n */\nvar getFilterable = function (M) {\n var empty = exports.left(M.empty);\n var _a = exports.getCompactable(M), compact = _a.compact, separate = _a.separate;\n var filter = function (ma, predicate) {\n return exports.isLeft(ma) ? ma : predicate(ma.right) ? ma : empty;\n };\n var partition = function (ma, p) {\n return exports.isLeft(ma)\n ? Separated_1.separated(ma, ma)\n : p(ma.right)\n ? Separated_1.separated(empty, exports.right(ma.right))\n : Separated_1.separated(exports.right(ma.right), empty);\n };\n return {\n URI: exports.URI,\n _E: undefined,\n map: _map,\n compact: compact,\n separate: separate,\n filter: filter,\n filterMap: function (ma, f) {\n if (exports.isLeft(ma)) {\n return ma;\n }\n var ob = f(ma.right);\n return ob._tag === 'None' ? empty : exports.right(ob.value);\n },\n partition: partition,\n partitionMap: function (ma, f) {\n if (exports.isLeft(ma)) {\n return Separated_1.separated(ma, ma);\n }\n var e = f(ma.right);\n return exports.isLeft(e) ? Separated_1.separated(exports.right(e.left), empty) : Separated_1.separated(empty, exports.right(e.right));\n }\n };\n};\nexports.getFilterable = getFilterable;\n/**\n * Builds `Witherable` instance for `Either` given `Monoid` for the left side\n *\n * @category instances\n * @since 2.0.0\n */\nvar getWitherable = function (M) {\n var F_ = exports.getFilterable(M);\n var C = exports.getCompactable(M);\n return {\n URI: exports.URI,\n _E: undefined,\n map: _map,\n compact: F_.compact,\n separate: F_.separate,\n filter: F_.filter,\n filterMap: F_.filterMap,\n partition: F_.partition,\n partitionMap: F_.partitionMap,\n traverse: _traverse,\n sequence: exports.sequence,\n reduce: _reduce,\n foldMap: _foldMap,\n reduceRight: _reduceRight,\n wither: Witherable_1.witherDefault(exports.Traversable, C),\n wilt: Witherable_1.wiltDefault(exports.Traversable, C)\n };\n};\nexports.getWitherable = getWitherable;\n/**\n * @category instances\n * @since 2.7.0\n */\nvar getApplicativeValidation = function (SE) { return ({\n URI: exports.URI,\n _E: undefined,\n map: _map,\n ap: function (fab, fa) {\n return exports.isLeft(fab)\n ? exports.isLeft(fa)\n ? exports.left(SE.concat(fab.left, fa.left))\n : fab\n : exports.isLeft(fa)\n ? fa\n : exports.right(fab.right(fa.right));\n },\n of: exports.of\n}); };\nexports.getApplicativeValidation = getApplicativeValidation;\n/**\n * @category instances\n * @since 2.7.0\n */\nvar getAltValidation = function (SE) { return ({\n URI: exports.URI,\n _E: undefined,\n map: _map,\n alt: function (me, that) {\n if (exports.isRight(me)) {\n return me;\n }\n var ea = that();\n return exports.isLeft(ea) ? exports.left(SE.concat(me.left, ea.left)) : ea;\n }\n}); };\nexports.getAltValidation = getAltValidation;\n/**\n * @category instance operations\n * @since 2.0.0\n */\nvar map = function (f) { return function (fa) {\n return exports.isLeft(fa) ? fa : exports.right(f(fa.right));\n}; };\nexports.map = map;\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Functor = {\n URI: exports.URI,\n map: _map\n};\n/**\n * @category instance operations\n * @since 2.7.0\n */\nexports.of = exports.right;\n/**\n * @category instances\n * @since 2.10.0\n */\nexports.Pointed = {\n URI: exports.URI,\n of: exports.of\n};\n/**\n * Less strict version of [`ap`](#ap).\n *\n * @category instance operations\n * @since 2.8.0\n */\nvar apW = function (fa) { return function (fab) { return (exports.isLeft(fab) ? fab : exports.isLeft(fa) ? fa : exports.right(fab.right(fa.right))); }; };\nexports.apW = apW;\n/**\n * Apply a function to an argument under a type constructor.\n *\n * @category instance operations\n * @since 2.0.0\n */\nexports.ap = exports.apW;\n/**\n * @category instances\n * @since 2.10.0\n */\nexports.Apply = {\n URI: exports.URI,\n map: _map,\n ap: _ap\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Applicative = {\n URI: exports.URI,\n map: _map,\n ap: _ap,\n of: exports.of\n};\n/**\n * Less strict version of [`chain`](#chain).\n *\n * @category instance operations\n * @since 2.6.0\n */\nvar chainW = function (f) { return function (ma) {\n return exports.isLeft(ma) ? ma : f(ma.right);\n}; };\nexports.chainW = chainW;\n/**\n * Composes computations in sequence, using the return value of one computation to determine the next computation.\n *\n * @category instance operations\n * @since 2.0.0\n */\nexports.chain = exports.chainW;\n/**\n * @category instances\n * @since 2.10.0\n */\nexports.Chain = {\n URI: exports.URI,\n map: _map,\n ap: _ap,\n chain: _chain\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Monad = {\n URI: exports.URI,\n map: _map,\n ap: _ap,\n of: exports.of,\n chain: _chain\n};\n/**\n * Left-associative fold of a structure.\n *\n * @example\n * import { pipe } from 'fp-ts/function'\n * import * as E from 'fp-ts/Either'\n *\n * const startWith = 'prefix'\n * const concat = (a: string, b: string) => `${a}:${b}`\n *\n * assert.deepStrictEqual(\n * pipe(E.right('a'), E.reduce(startWith, concat)),\n * 'prefix:a'\n * )\n *\n * assert.deepStrictEqual(\n * pipe(E.left('e'), E.reduce(startWith, concat)),\n * 'prefix'\n * )\n *\n * @category instance operations\n * @since 2.0.0\n */\nvar reduce = function (b, f) { return function (fa) {\n return exports.isLeft(fa) ? b : f(b, fa.right);\n}; };\nexports.reduce = reduce;\n/**\n * Map each element of the structure to a monoid, and combine the results.\n *\n * @example\n * import { pipe } from 'fp-ts/function'\n * import * as E from 'fp-ts/Either'\n * import * as S from 'fp-ts/string'\n *\n * const yell = (a: string) => `${a}!`\n *\n * assert.deepStrictEqual(\n * pipe(E.right('a'), E.foldMap(S.Monoid)(yell)),\n * 'a!'\n * )\n *\n * assert.deepStrictEqual(\n * pipe(E.left('e'), E.foldMap(S.Monoid)(yell)),\n * S.Monoid.empty\n * )\n *\n * @category instance operations\n * @since 2.0.0\n */\nvar foldMap = function (M) { return function (f) { return function (fa) {\n return exports.isLeft(fa) ? M.empty : f(fa.right);\n}; }; };\nexports.foldMap = foldMap;\n/**\n * Right-associative fold of a structure.\n *\n * @example\n * import { pipe } from 'fp-ts/function'\n * import * as E from 'fp-ts/Either'\n *\n * const startWith = 'postfix'\n * const concat = (a: string, b: string) => `${a}:${b}`\n *\n * assert.deepStrictEqual(\n * pipe(E.right('a'), E.reduceRight(startWith, concat)),\n * 'a:postfix'\n * )\n *\n * assert.deepStrictEqual(\n * pipe(E.left('e'), E.reduceRight(startWith, concat)),\n * 'postfix'\n * )\n *\n * @category instance operations\n * @since 2.0.0\n */\nvar reduceRight = function (b, f) { return function (fa) {\n return exports.isLeft(fa) ? b : f(fa.right, b);\n}; };\nexports.reduceRight = reduceRight;\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Foldable = {\n URI: exports.URI,\n reduce: _reduce,\n foldMap: _foldMap,\n reduceRight: _reduceRight\n};\n/**\n * Map each element of a structure to an action, evaluate these actions from left to right, and collect the results.\n *\n * @example\n * import { pipe } from 'fp-ts/function'\n * import * as RA from 'fp-ts/ReadonlyArray'\n * import * as E from 'fp-ts/Either'\n * import * as O from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(\n * pipe(E.right(['a']), E.traverse(O.Applicative)(RA.head)),\n * O.some(E.right('a'))\n * )\n *\n * assert.deepStrictEqual(\n * pipe(E.right([]), E.traverse(O.Applicative)(RA.head)),\n * O.none\n * )\n *\n * @category instance operations\n * @since 2.6.3\n */\nvar traverse = function (F) { return function (f) { return function (ta) { return (exports.isLeft(ta) ? F.of(exports.left(ta.left)) : F.map(f(ta.right), exports.right)); }; }; };\nexports.traverse = traverse;\n/**\n * Evaluate each monadic action in the structure from left to right, and collect the results.\n *\n * @example\n * import { pipe } from 'fp-ts/function'\n * import * as E from 'fp-ts/Either'\n * import * as O from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(\n * pipe(E.right(O.some('a')), E.sequence(O.Applicative)),\n * O.some(E.right('a'))\n * )\n *\n * assert.deepStrictEqual(\n * pipe(E.right(O.none), E.sequence(O.Applicative)),\n * O.none\n * )\n *\n * @category instance operations\n * @since 2.6.3\n */\nvar sequence = function (F) { return function (ma) {\n return exports.isLeft(ma) ? F.of(exports.left(ma.left)) : F.map(ma.right, exports.right);\n}; };\nexports.sequence = sequence;\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Traversable = {\n URI: exports.URI,\n map: _map,\n reduce: _reduce,\n foldMap: _foldMap,\n reduceRight: _reduceRight,\n traverse: _traverse,\n sequence: exports.sequence\n};\n/**\n * Map a pair of functions over the two type arguments of the bifunctor.\n *\n * @category instance operations\n * @since 2.0.0\n */\nvar bimap = function (f, g) { return function (fa) { return (exports.isLeft(fa) ? exports.left(f(fa.left)) : exports.right(g(fa.right))); }; };\nexports.bimap = bimap;\n/**\n * Map a function over the first type argument of a bifunctor.\n *\n * @category instance operations\n * @since 2.0.0\n */\nvar mapLeft = function (f) { return function (fa) {\n return exports.isLeft(fa) ? exports.left(f(fa.left)) : fa;\n}; };\nexports.mapLeft = mapLeft;\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Bifunctor = {\n URI: exports.URI,\n bimap: _bimap,\n mapLeft: _mapLeft\n};\n/**\n * Less strict version of [`alt`](#alt).\n *\n * @category instance operations\n * @since 2.9.0\n */\nvar altW = function (that) { return function (fa) { return (exports.isLeft(fa) ? that() : fa); }; };\nexports.altW = altW;\n/**\n * Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to\n * types of kind `* -> *`.\n *\n * @category instance operations\n * @since 2.0.0\n */\nexports.alt = exports.altW;\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Alt = {\n URI: exports.URI,\n map: _map,\n alt: _alt\n};\n/**\n * @category instance operations\n * @since 2.0.0\n */\nvar extend = function (f) { return function (wa) {\n return exports.isLeft(wa) ? wa : exports.right(f(wa));\n}; };\nexports.extend = extend;\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Extend = {\n URI: exports.URI,\n map: _map,\n extend: _extend\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.ChainRec = {\n URI: exports.URI,\n map: _map,\n ap: _ap,\n chain: _chain,\n chainRec: _chainRec\n};\n/**\n * @category instance operations\n * @since 2.6.3\n */\nexports.throwError = exports.left;\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.MonadThrow = {\n URI: exports.URI,\n map: _map,\n ap: _ap,\n of: exports.of,\n chain: _chain,\n throwError: exports.throwError\n};\n/**\n * @category instances\n * @since 2.10.0\n */\nexports.FromEither = {\n URI: exports.URI,\n fromEither: function_1.identity\n};\n/**\n * @example\n * import { fromPredicate, left, right } from 'fp-ts/Either'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(\n * pipe(\n * 1,\n * fromPredicate(\n * (n) => n > 0,\n * () => 'error'\n * )\n * ),\n * right(1)\n * )\n * assert.deepStrictEqual(\n * pipe(\n * -1,\n * fromPredicate(\n * (n) => n > 0,\n * () => 'error'\n * )\n * ),\n * left('error')\n * )\n *\n * @category constructors\n * @since 2.0.0\n */\nexports.fromPredicate = \n/*#__PURE__*/\nFromEither_1.fromPredicate(exports.FromEither);\n// -------------------------------------------------------------------------------------\n// natural transformations\n// -------------------------------------------------------------------------------------\n/**\n * @example\n * import * as E from 'fp-ts/Either'\n * import { pipe } from 'fp-ts/function'\n * import * as O from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(\n * pipe(\n * O.some(1),\n * E.fromOption(() => 'error')\n * ),\n * E.right(1)\n * )\n * assert.deepStrictEqual(\n * pipe(\n * O.none,\n * E.fromOption(() => 'error')\n * ),\n * E.left('error')\n * )\n *\n * @category natural transformations\n * @since 2.0.0\n */\nexports.fromOption = \n/*#__PURE__*/\nFromEither_1.fromOption(exports.FromEither);\n// -------------------------------------------------------------------------------------\n// refinements\n// -------------------------------------------------------------------------------------\n/**\n * Returns `true` if the either is an instance of `Left`, `false` otherwise.\n *\n * @category refinements\n * @since 2.0.0\n */\nexports.isLeft = _.isLeft;\n/**\n * Returns `true` if the either is an instance of `Right`, `false` otherwise.\n *\n * @category refinements\n * @since 2.0.0\n */\nexports.isRight = _.isRight;\n// -------------------------------------------------------------------------------------\n// destructors\n// -------------------------------------------------------------------------------------\n/**\n * Less strict version of [`match`](#match).\n *\n * @category destructors\n * @since 2.10.0\n */\nvar matchW = function (onLeft, onRight) { return function (ma) {\n return exports.isLeft(ma) ? onLeft(ma.left) : onRight(ma.right);\n}; };\nexports.matchW = matchW;\n/**\n * Alias of [`matchW`](#matchw).\n *\n * @category destructors\n * @since 2.10.0\n */\nexports.foldW = exports.matchW;\n/**\n * Takes two functions and an `Either` value, if the value is a `Left` the inner value is applied to the first function,\n * if the value is a `Right` the inner value is applied to the second function.\n *\n * @example\n * import { match, left, right } from 'fp-ts/Either'\n * import { pipe } from 'fp-ts/function'\n *\n * function onLeft(errors: Array): string {\n * return `Errors: ${errors.join(', ')}`\n * }\n *\n * function onRight(value: number): string {\n * return `Ok: ${value}`\n * }\n *\n * assert.strictEqual(\n * pipe(\n * right(1),\n * match(onLeft, onRight)\n * ),\n * 'Ok: 1'\n * )\n * assert.strictEqual(\n * pipe(\n * left(['error 1', 'error 2']),\n * match(onLeft, onRight)\n * ),\n * 'Errors: error 1, error 2'\n * )\n *\n * @category destructors\n * @since 2.10.0\n */\nexports.match = exports.matchW;\n/**\n * Alias of [`match`](#match).\n *\n * @category destructors\n * @since 2.0.0\n */\nexports.fold = exports.match;\n/**\n * Less strict version of [`getOrElse`](#getorelse).\n *\n * @category destructors\n * @since 2.6.0\n */\nvar getOrElseW = function (onLeft) { return function (ma) {\n return exports.isLeft(ma) ? onLeft(ma.left) : ma.right;\n}; };\nexports.getOrElseW = getOrElseW;\n/**\n * Returns the wrapped value if it's a `Right` or a default value if is a `Left`.\n *\n * @example\n * import { getOrElse, left, right } from 'fp-ts/Either'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(\n * pipe(\n * right(1),\n * getOrElse(() => 0)\n * ),\n * 1\n * )\n * assert.deepStrictEqual(\n * pipe(\n * left('error'),\n * getOrElse(() => 0)\n * ),\n * 0\n * )\n *\n * @category destructors\n * @since 2.0.0\n */\nexports.getOrElse = exports.getOrElseW;\n// -------------------------------------------------------------------------------------\n// combinators\n// -------------------------------------------------------------------------------------\n/**\n * Derivable from `Functor`.\n *\n * @category combinators\n * @since 2.10.0\n */\nexports.flap = \n/*#__PURE__*/\nFunctor_1.flap(exports.Functor);\n/**\n * Combine two effectful actions, keeping only the result of the first.\n *\n * Derivable from `Apply`.\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.apFirst = \n/*#__PURE__*/\nApply_1.apFirst(exports.Apply);\n/**\n * Combine two effectful actions, keeping only the result of the second.\n *\n * Derivable from `Apply`.\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.apSecond = \n/*#__PURE__*/\nApply_1.apSecond(exports.Apply);\n/**\n * Composes computations in sequence, using the return value of one computation to determine the next computation and\n * keeping only the result of the first.\n *\n * Derivable from `Chain`.\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.chainFirst = \n/*#__PURE__*/\nChain_1.chainFirst(exports.Chain);\n/**\n * Less strict version of [`chainFirst`](#chainfirst)\n *\n * Derivable from `Chain`.\n *\n * @category combinators\n * @since 2.8.0\n */\nexports.chainFirstW = exports.chainFirst;\n/**\n * Less strict version of [`flatten`](#flatten).\n *\n * @category combinators\n * @since 2.11.0\n */\nexports.flattenW = \n/*#__PURE__*/\nexports.chainW(function_1.identity);\n/**\n * The `flatten` function is the conventional monad join operator. It is used to remove one level of monadic structure, projecting its bound argument into the outer level.\n *\n * Derivable from `Chain`.\n *\n * @example\n * import * as E from 'fp-ts/Either'\n *\n * assert.deepStrictEqual(E.flatten(E.right(E.right('a'))), E.right('a'))\n * assert.deepStrictEqual(E.flatten(E.right(E.left('e'))), E.left('e'))\n * assert.deepStrictEqual(E.flatten(E.left('e')), E.left('e'))\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.flatten = exports.flattenW;\n/**\n * Derivable from `Extend`.\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.duplicate = \n/*#__PURE__*/\nexports.extend(function_1.identity);\n/**\n * @category combinators\n * @since 2.10.0\n */\nexports.fromOptionK = \n/*#__PURE__*/\nFromEither_1.fromOptionK(exports.FromEither);\n/**\n * @category combinators\n * @since 2.11.0\n */\nexports.chainOptionK = \n/*#__PURE__*/\nFromEither_1.chainOptionK(exports.FromEither, exports.Chain);\n/**\n * @example\n * import * as E from 'fp-ts/Either'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(\n * pipe(\n * E.right(1),\n * E.filterOrElse(\n * (n) => n > 0,\n * () => 'error'\n * )\n * ),\n * E.right(1)\n * )\n * assert.deepStrictEqual(\n * pipe(\n * E.right(-1),\n * E.filterOrElse(\n * (n) => n > 0,\n * () => 'error'\n * )\n * ),\n * E.left('error')\n * )\n * assert.deepStrictEqual(\n * pipe(\n * E.left('a'),\n * E.filterOrElse(\n * (n) => n > 0,\n * () => 'error'\n * )\n * ),\n * E.left('a')\n * )\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.filterOrElse = \n/*#__PURE__*/\nFromEither_1.filterOrElse(exports.FromEither, exports.Chain);\n/**\n * Less strict version of [`filterOrElse`](#filterorelse).\n *\n * @category combinators\n * @since 2.9.0\n */\nexports.filterOrElseW = exports.filterOrElse;\n/**\n * Returns a `Right` if is a `Left` (and vice versa).\n *\n * @category combinators\n * @since 2.0.0\n */\nvar swap = function (ma) { return (exports.isLeft(ma) ? exports.right(ma.left) : exports.left(ma.right)); };\nexports.swap = swap;\n/**\n * Less strict version of [`orElse`](#orelse).\n *\n * @category combinators\n * @since 2.10.0\n */\nvar orElseW = function (onLeft) { return function (ma) {\n return exports.isLeft(ma) ? onLeft(ma.left) : ma;\n}; };\nexports.orElseW = orElseW;\n/**\n * Useful for recovering from errors.\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.orElse = exports.orElseW;\n// -------------------------------------------------------------------------------------\n// interop\n// -------------------------------------------------------------------------------------\n/**\n * Takes a default and a nullable value, if the value is not nully, turn it into a `Right`, if the value is nully use\n * the provided default as a `Left`.\n *\n * @example\n * import { fromNullable, left, right } from 'fp-ts/Either'\n *\n * const parse = fromNullable('nully')\n *\n * assert.deepStrictEqual(parse(1), right(1))\n * assert.deepStrictEqual(parse(null), left('nully'))\n *\n * @category interop\n * @since 2.0.0\n */\nvar fromNullable = function (e) { return function (a) {\n return a == null ? exports.left(e) : exports.right(a);\n}; };\nexports.fromNullable = fromNullable;\n/**\n * Constructs a new `Either` from a function that might throw.\n *\n * See also [`tryCatchK`](#trycatchk).\n *\n * @example\n * import * as E from 'fp-ts/Either'\n *\n * const unsafeHead = (as: ReadonlyArray): A => {\n * if (as.length > 0) {\n * return as[0]\n * } else {\n * throw new Error('empty array')\n * }\n * }\n *\n * const head = (as: ReadonlyArray): E.Either =>\n * E.tryCatch(() => unsafeHead(as), e => (e instanceof Error ? e : new Error('unknown error')))\n *\n * assert.deepStrictEqual(head([]), E.left(new Error('empty array')))\n * assert.deepStrictEqual(head([1, 2, 3]), E.right(1))\n *\n * @category interop\n * @since 2.0.0\n */\nvar tryCatch = function (f, onThrow) {\n try {\n return exports.right(f());\n }\n catch (e) {\n return exports.left(onThrow(e));\n }\n};\nexports.tryCatch = tryCatch;\n/**\n * Converts a function that may throw to one returning a `Either`.\n *\n * @category interop\n * @since 2.10.0\n */\nvar tryCatchK = function (f, onThrow) { return function () {\n var a = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n a[_i] = arguments[_i];\n }\n return exports.tryCatch(function () { return f.apply(void 0, a); }, onThrow);\n}; };\nexports.tryCatchK = tryCatchK;\n/**\n * @category interop\n * @since 2.9.0\n */\nvar fromNullableK = function (e) {\n var from = exports.fromNullable(e);\n return function (f) { return function_1.flow(f, from); };\n};\nexports.fromNullableK = fromNullableK;\n/**\n * @category interop\n * @since 2.9.0\n */\nvar chainNullableK = function (e) {\n var from = exports.fromNullableK(e);\n return function (f) { return exports.chain(from(f)); };\n};\nexports.chainNullableK = chainNullableK;\n/**\n * @category interop\n * @since 2.10.0\n */\nexports.toUnion = \n/*#__PURE__*/\nexports.foldW(function_1.identity, function_1.identity);\n// -------------------------------------------------------------------------------------\n// utils\n// -------------------------------------------------------------------------------------\n/**\n * Default value for the `onError` argument of `tryCatch`\n *\n * @since 2.0.0\n */\nfunction toError(e) {\n return e instanceof Error ? e : new Error(String(e));\n}\nexports.toError = toError;\n/**\n * @since 2.0.0\n */\nvar elem = function (E) { return function (a, ma) {\n return exports.isLeft(ma) ? false : E.equals(a, ma.right);\n}; };\nexports.elem = elem;\n/**\n * Returns `false` if `Left` or returns the result of the application of the given predicate to the `Right` value.\n *\n * @example\n * import { exists, left, right } from 'fp-ts/Either'\n *\n * const gt2 = exists((n: number) => n > 2)\n *\n * assert.strictEqual(gt2(left('a')), false)\n * assert.strictEqual(gt2(right(1)), false)\n * assert.strictEqual(gt2(right(3)), true)\n *\n * @since 2.0.0\n */\nvar exists = function (predicate) { return function (ma) {\n return exports.isLeft(ma) ? false : predicate(ma.right);\n}; };\nexports.exists = exists;\n// -------------------------------------------------------------------------------------\n// do notation\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.9.0\n */\nexports.Do = \n/*#__PURE__*/\nexports.of(_.emptyRecord);\n/**\n * @since 2.8.0\n */\nexports.bindTo = \n/*#__PURE__*/\nFunctor_1.bindTo(exports.Functor);\n/**\n * @since 2.8.0\n */\nexports.bind = \n/*#__PURE__*/\nChain_1.bind(exports.Chain);\n/**\n * @since 2.8.0\n */\nexports.bindW = exports.bind;\n// -------------------------------------------------------------------------------------\n// pipeable sequence S\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.8.0\n */\nexports.apS = \n/*#__PURE__*/\nApply_1.apS(exports.Apply);\n/**\n * @since 2.8.0\n */\nexports.apSW = exports.apS;\n// -------------------------------------------------------------------------------------\n// sequence T\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.11.0\n */\nexports.ApT = \n/*#__PURE__*/\nexports.of(_.emptyReadonlyArray);\n// -------------------------------------------------------------------------------------\n// array utils\n// -------------------------------------------------------------------------------------\n/**\n * Equivalent to `ReadonlyNonEmptyArray#traverseWithIndex(Applicative)`.\n *\n * @since 2.11.0\n */\nvar traverseReadonlyNonEmptyArrayWithIndex = function (f) { return function (as) {\n var e = f(0, _.head(as));\n if (exports.isLeft(e)) {\n return e;\n }\n var out = [e.right];\n for (var i = 1; i < as.length; i++) {\n var e_1 = f(i, as[i]);\n if (exports.isLeft(e_1)) {\n return e_1;\n }\n out.push(e_1.right);\n }\n return exports.right(out);\n}; };\nexports.traverseReadonlyNonEmptyArrayWithIndex = traverseReadonlyNonEmptyArrayWithIndex;\n/**\n * Equivalent to `ReadonlyArray#traverseWithIndex(Applicative)`.\n *\n * @since 2.11.0\n */\nvar traverseReadonlyArrayWithIndex = function (f) {\n var g = exports.traverseReadonlyNonEmptyArrayWithIndex(f);\n return function (as) { return (_.isNonEmpty(as) ? g(as) : exports.ApT); };\n};\nexports.traverseReadonlyArrayWithIndex = traverseReadonlyArrayWithIndex;\n/**\n * @since 2.9.0\n */\nexports.traverseArrayWithIndex = exports.traverseReadonlyArrayWithIndex;\n/**\n * @since 2.9.0\n */\nvar traverseArray = function (f) { return exports.traverseReadonlyArrayWithIndex(function (_, a) { return f(a); }); };\nexports.traverseArray = traverseArray;\n/**\n * @since 2.9.0\n */\nexports.sequenceArray = \n/*#__PURE__*/\nexports.traverseArray(function_1.identity);\n/**\n * Use [`parse`](./Json.ts.html#parse) instead.\n *\n * @category constructors\n * @since 2.0.0\n * @deprecated\n */\nfunction parseJSON(s, onError) {\n return exports.tryCatch(function () { return JSON.parse(s); }, onError);\n}\nexports.parseJSON = parseJSON;\n/**\n * Use [`stringify`](./Json.ts.html#stringify) instead.\n *\n * @category constructors\n * @since 2.0.0\n * @deprecated\n */\nvar stringifyJSON = function (u, onError) {\n return exports.tryCatch(function () {\n var s = JSON.stringify(u);\n if (typeof s !== 'string') {\n throw new Error('Converting unsupported structure to JSON');\n }\n return s;\n }, onError);\n};\nexports.stringifyJSON = stringifyJSON;\n/**\n * Use small, specific instances instead.\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nexports.either = {\n URI: exports.URI,\n map: _map,\n of: exports.of,\n ap: _ap,\n chain: _chain,\n reduce: _reduce,\n foldMap: _foldMap,\n reduceRight: _reduceRight,\n traverse: _traverse,\n sequence: exports.sequence,\n bimap: _bimap,\n mapLeft: _mapLeft,\n alt: _alt,\n extend: _extend,\n chainRec: _chainRec,\n throwError: exports.throwError\n};\n/**\n * Use [`getApplySemigroup`](./Apply.ts.html#getapplysemigroup) instead.\n *\n * Semigroup returning the left-most `Left` value. If both operands are `Right`s then the inner values\n * are concatenated using the provided `Semigroup`\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nexports.getApplySemigroup = \n/*#__PURE__*/\nApply_1.getApplySemigroup(exports.Apply);\n/**\n * Use [`getApplicativeMonoid`](./Applicative.ts.html#getapplicativemonoid) instead.\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nexports.getApplyMonoid = \n/*#__PURE__*/\nApplicative_1.getApplicativeMonoid(exports.Applicative);\n/**\n * Use [`getApplySemigroup`](./Apply.ts.html#getapplysemigroup) instead.\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nvar getValidationSemigroup = function (SE, SA) {\n return Apply_1.getApplySemigroup(exports.getApplicativeValidation(SE))(SA);\n};\nexports.getValidationSemigroup = getValidationSemigroup;\n/**\n * Use [`getApplicativeMonoid`](./Applicative.ts.html#getapplicativemonoid) instead.\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nvar getValidationMonoid = function (SE, MA) {\n return Applicative_1.getApplicativeMonoid(exports.getApplicativeValidation(SE))(MA);\n};\nexports.getValidationMonoid = getValidationMonoid;\n/**\n * Use [`getApplicativeValidation`](#getapplicativevalidation) and [`getAltValidation`](#getaltvalidation) instead.\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nfunction getValidation(SE) {\n var ap = exports.getApplicativeValidation(SE).ap;\n var alt = exports.getAltValidation(SE).alt;\n return {\n URI: exports.URI,\n _E: undefined,\n map: _map,\n of: exports.of,\n chain: _chain,\n bimap: _bimap,\n mapLeft: _mapLeft,\n reduce: _reduce,\n foldMap: _foldMap,\n reduceRight: _reduceRight,\n extend: _extend,\n traverse: _traverse,\n sequence: exports.sequence,\n chainRec: _chainRec,\n throwError: exports.throwError,\n ap: ap,\n alt: alt\n };\n}\nexports.getValidation = getValidation;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.eqDate = exports.eqNumber = exports.eqString = exports.eqBoolean = exports.eq = exports.strictEqual = exports.getStructEq = exports.getTupleEq = exports.Contravariant = exports.getMonoid = exports.getSemigroup = exports.eqStrict = exports.URI = exports.contramap = exports.tuple = exports.struct = exports.fromEquals = void 0;\nvar function_1 = require(\"./function\");\n// -------------------------------------------------------------------------------------\n// constructors\n// -------------------------------------------------------------------------------------\n/**\n * @category constructors\n * @since 2.0.0\n */\nvar fromEquals = function (equals) { return ({\n equals: function (x, y) { return x === y || equals(x, y); }\n}); };\nexports.fromEquals = fromEquals;\n// -------------------------------------------------------------------------------------\n// combinators\n// -------------------------------------------------------------------------------------\n/**\n * @category combinators\n * @since 2.10.0\n */\nvar struct = function (eqs) {\n return exports.fromEquals(function (first, second) {\n for (var key in eqs) {\n if (!eqs[key].equals(first[key], second[key])) {\n return false;\n }\n }\n return true;\n });\n};\nexports.struct = struct;\n/**\n * Given a tuple of `Eq`s returns a `Eq` for the tuple\n *\n * @example\n * import { tuple } from 'fp-ts/Eq'\n * import * as S from 'fp-ts/string'\n * import * as N from 'fp-ts/number'\n * import * as B from 'fp-ts/boolean'\n *\n * const E = tuple(S.Eq, N.Eq, B.Eq)\n * assert.strictEqual(E.equals(['a', 1, true], ['a', 1, true]), true)\n * assert.strictEqual(E.equals(['a', 1, true], ['b', 1, true]), false)\n * assert.strictEqual(E.equals(['a', 1, true], ['a', 2, true]), false)\n * assert.strictEqual(E.equals(['a', 1, true], ['a', 1, false]), false)\n *\n * @category combinators\n * @since 2.10.0\n */\nvar tuple = function () {\n var eqs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n eqs[_i] = arguments[_i];\n }\n return exports.fromEquals(function (first, second) { return eqs.every(function (E, i) { return E.equals(first[i], second[i]); }); });\n};\nexports.tuple = tuple;\n// -------------------------------------------------------------------------------------\n// non-pipeables\n// -------------------------------------------------------------------------------------\n/* istanbul ignore next */\nvar contramap_ = function (fa, f) { return function_1.pipe(fa, exports.contramap(f)); };\n// -------------------------------------------------------------------------------------\n// type class members\n// -------------------------------------------------------------------------------------\n/**\n * @category Contravariant\n * @since 2.0.0\n */\nvar contramap = function (f) { return function (fa) {\n return exports.fromEquals(function (x, y) { return fa.equals(f(x), f(y)); });\n}; };\nexports.contramap = contramap;\n// -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.URI = 'Eq';\n/**\n * @category instances\n * @since 2.5.0\n */\nexports.eqStrict = {\n equals: function (a, b) { return a === b; }\n};\nvar empty = {\n equals: function () { return true; }\n};\n/**\n * @category instances\n * @since 2.10.0\n */\nvar getSemigroup = function () { return ({\n concat: function (x, y) { return exports.fromEquals(function (a, b) { return x.equals(a, b) && y.equals(a, b); }); }\n}); };\nexports.getSemigroup = getSemigroup;\n/**\n * @category instances\n * @since 2.6.0\n */\nvar getMonoid = function () { return ({\n concat: exports.getSemigroup().concat,\n empty: empty\n}); };\nexports.getMonoid = getMonoid;\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Contravariant = {\n URI: exports.URI,\n contramap: contramap_\n};\n// -------------------------------------------------------------------------------------\n// deprecated\n// -------------------------------------------------------------------------------------\n/**\n * Use [`tuple`](#tuple) instead.\n *\n * @category combinators\n * @since 2.0.0\n * @deprecated\n */\nexports.getTupleEq = exports.tuple;\n/**\n * Use [`struct`](#struct) instead.\n *\n * @category combinators\n * @since 2.0.0\n * @deprecated\n */\nexports.getStructEq = exports.struct;\n/**\n * Use [`eqStrict`](#eqstrict) instead\n *\n * @since 2.0.0\n * @deprecated\n */\nexports.strictEqual = exports.eqStrict.equals;\n/**\n * Use small, specific instances instead.\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nexports.eq = exports.Contravariant;\n/**\n * Use [`Eq`](./boolean.ts.html#eq) instead.\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nexports.eqBoolean = exports.eqStrict;\n/**\n * Use [`Eq`](./string.ts.html#eq) instead.\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nexports.eqString = exports.eqStrict;\n/**\n * Use [`Eq`](./number.ts.html#eq) instead.\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nexports.eqNumber = exports.eqStrict;\n/**\n * Use [`Eq`](./Date.ts.html#eq) instead.\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nexports.eqDate = {\n equals: function (first, second) { return first.valueOf() === second.valueOf(); }\n};\n","\"use strict\";\n/**\n * The `FromEither` type class represents those data types which support errors.\n *\n * @since 2.10.0\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.filterOrElse = exports.chainEitherK = exports.fromEitherK = exports.chainOptionK = exports.fromOptionK = exports.fromPredicate = exports.fromOption = void 0;\nvar function_1 = require(\"./function\");\nvar _ = __importStar(require(\"./internal\"));\nfunction fromOption(F) {\n return function (onNone) { return function (ma) { return F.fromEither(_.isNone(ma) ? _.left(onNone()) : _.right(ma.value)); }; };\n}\nexports.fromOption = fromOption;\nfunction fromPredicate(F) {\n return function (predicate, onFalse) { return function (a) {\n return F.fromEither(predicate(a) ? _.right(a) : _.left(onFalse(a)));\n }; };\n}\nexports.fromPredicate = fromPredicate;\nfunction fromOptionK(F) {\n var fromOptionF = fromOption(F);\n return function (onNone) {\n var from = fromOptionF(onNone);\n return function (f) { return function_1.flow(f, from); };\n };\n}\nexports.fromOptionK = fromOptionK;\nfunction chainOptionK(F, M) {\n var fromOptionKF = fromOptionK(F);\n return function (onNone) {\n var from = fromOptionKF(onNone);\n return function (f) { return function (ma) { return M.chain(ma, from(f)); }; };\n };\n}\nexports.chainOptionK = chainOptionK;\nfunction fromEitherK(F) {\n return function (f) { return function_1.flow(f, F.fromEither); };\n}\nexports.fromEitherK = fromEitherK;\nfunction chainEitherK(F, M) {\n var fromEitherKF = fromEitherK(F);\n return function (f) { return function (ma) { return M.chain(ma, fromEitherKF(f)); }; };\n}\nexports.chainEitherK = chainEitherK;\nfunction filterOrElse(F, M) {\n return function (predicate, onFalse) { return function (ma) {\n return M.chain(ma, function (a) { return F.fromEither(predicate(a) ? _.right(a) : _.left(onFalse(a))); });\n }; };\n}\nexports.filterOrElse = filterOrElse;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getFunctorComposition = exports.bindTo = exports.flap = exports.map = void 0;\n/**\n * A `Functor` is a type constructor which supports a mapping operation `map`.\n *\n * `map` can be used to turn functions `a -> b` into functions `f a -> f b` whose argument and return types use the type\n * constructor `f` to represent some computational context.\n *\n * Instances must satisfy the following laws:\n *\n * 1. Identity: `F.map(fa, a => a) <-> fa`\n * 2. Composition: `F.map(fa, a => bc(ab(a))) <-> F.map(F.map(fa, ab), bc)`\n *\n * @since 2.0.0\n */\nvar function_1 = require(\"./function\");\nfunction map(F, G) {\n return function (f) { return function (fa) { return F.map(fa, function (ga) { return G.map(ga, f); }); }; };\n}\nexports.map = map;\nfunction flap(F) {\n return function (a) { return function (fab) { return F.map(fab, function (f) { return f(a); }); }; };\n}\nexports.flap = flap;\nfunction bindTo(F) {\n return function (name) { return function (fa) { return F.map(fa, function (a) {\n var _a;\n return (_a = {}, _a[name] = a, _a);\n }); }; };\n}\nexports.bindTo = bindTo;\n/** @deprecated */\nfunction getFunctorComposition(F, G) {\n var _map = map(F, G);\n return {\n map: function (fga, f) { return function_1.pipe(fga, _map(f)); }\n };\n}\nexports.getFunctorComposition = getFunctorComposition;\n","\"use strict\";\n/**\n * A `Magma` is a pair `(A, concat)` in which `A` is a non-empty set and `concat` is a binary operation on `A`\n *\n * See [Semigroup](https://gcanti.github.io/fp-ts/modules/Semigroup.ts.html) for some instances.\n *\n * @since 2.0.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.concatAll = exports.endo = exports.filterSecond = exports.filterFirst = exports.reverse = void 0;\n// -------------------------------------------------------------------------------------\n// combinators\n// -------------------------------------------------------------------------------------\n/**\n * The dual of a `Magma`, obtained by swapping the arguments of `concat`.\n *\n * @example\n * import { reverse, concatAll } from 'fp-ts/Magma'\n * import * as N from 'fp-ts/number'\n *\n * const subAll = concatAll(reverse(N.MagmaSub))(0)\n *\n * assert.deepStrictEqual(subAll([1, 2, 3]), 2)\n *\n * @category combinators\n * @since 2.11.0\n */\nvar reverse = function (M) { return ({\n concat: function (first, second) { return M.concat(second, first); }\n}); };\nexports.reverse = reverse;\n/**\n * @category combinators\n * @since 2.11.0\n */\nvar filterFirst = function (predicate) { return function (M) { return ({\n concat: function (first, second) { return (predicate(first) ? M.concat(first, second) : second); }\n}); }; };\nexports.filterFirst = filterFirst;\n/**\n * @category combinators\n * @since 2.11.0\n */\nvar filterSecond = function (predicate) { return function (M) { return ({\n concat: function (first, second) { return (predicate(second) ? M.concat(first, second) : first); }\n}); }; };\nexports.filterSecond = filterSecond;\n/**\n * @category combinators\n * @since 2.11.0\n */\nvar endo = function (f) { return function (M) { return ({\n concat: function (first, second) { return M.concat(f(first), f(second)); }\n}); }; };\nexports.endo = endo;\n// -------------------------------------------------------------------------------------\n// utils\n// -------------------------------------------------------------------------------------\n/**\n * Given a sequence of `as`, concat them and return the total.\n *\n * If `as` is empty, return the provided `startWith` value.\n *\n * @example\n * import { concatAll } from 'fp-ts/Magma'\n * import * as N from 'fp-ts/number'\n *\n * const subAll = concatAll(N.MagmaSub)(0)\n *\n * assert.deepStrictEqual(subAll([1, 2, 3]), -6)\n *\n * @since 2.11.0\n */\nvar concatAll = function (M) { return function (startWith) { return function (as) {\n return as.reduce(function (a, acc) { return M.concat(a, acc); }, startWith);\n}; }; };\nexports.concatAll = concatAll;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.mapWithIndex = exports.map = exports.flatten = exports.duplicate = exports.extend = exports.chain = exports.ap = exports.alt = exports.altW = exports.chunksOf = exports.splitAt = exports.chop = exports.chainWithIndex = exports.foldMap = exports.foldMapWithIndex = exports.intersperse = exports.prependAll = exports.unzip = exports.zip = exports.zipWith = exports.of = exports.copy = exports.modifyAt = exports.updateAt = exports.insertAt = exports.sort = exports.groupBy = exports.group = exports.reverse = exports.concat = exports.concatW = exports.unappend = exports.unprepend = exports.range = exports.replicate = exports.makeBy = exports.fromArray = exports.fromReadonlyNonEmptyArray = exports.rotate = exports.union = exports.sortBy = exports.uniq = exports.unsafeUpdateAt = exports.unsafeInsertAt = exports.append = exports.appendW = exports.prepend = exports.prependW = exports.isOutOfBound = exports.isNonEmpty = void 0;\nexports.filterWithIndex = exports.filter = exports.groupSort = exports.updateLast = exports.modifyLast = exports.updateHead = exports.modifyHead = exports.matchRight = exports.matchLeft = exports.concatAll = exports.max = exports.min = exports.init = exports.last = exports.tail = exports.head = exports.apS = exports.bind = exports.bindTo = exports.Do = exports.Comonad = exports.Alt = exports.TraversableWithIndex = exports.Traversable = exports.FoldableWithIndex = exports.Foldable = exports.Monad = exports.chainFirst = exports.Chain = exports.Applicative = exports.apSecond = exports.apFirst = exports.Apply = exports.FunctorWithIndex = exports.Pointed = exports.flap = exports.Functor = exports.getUnionSemigroup = exports.getEq = exports.getSemigroup = exports.getShow = exports.URI = exports.extract = exports.traverseWithIndex = exports.sequence = exports.traverse = exports.reduceRightWithIndex = exports.reduceRight = exports.reduceWithIndex = exports.reduce = void 0;\nexports.nonEmptyArray = exports.fold = exports.prependToAll = exports.snoc = exports.cons = exports.unsnoc = exports.uncons = void 0;\nvar Apply_1 = require(\"./Apply\");\nvar Chain_1 = require(\"./Chain\");\nvar function_1 = require(\"./function\");\nvar Functor_1 = require(\"./Functor\");\nvar _ = __importStar(require(\"./internal\"));\nvar Ord_1 = require(\"./Ord\");\nvar RNEA = __importStar(require(\"./ReadonlyNonEmptyArray\"));\n// -------------------------------------------------------------------------------------\n// internal\n// -------------------------------------------------------------------------------------\n/**\n * @internal\n */\nvar isNonEmpty = function (as) { return as.length > 0; };\nexports.isNonEmpty = isNonEmpty;\n/**\n * @internal\n */\nvar isOutOfBound = function (i, as) { return i < 0 || i >= as.length; };\nexports.isOutOfBound = isOutOfBound;\n/**\n * @internal\n */\nvar prependW = function (head) { return function (tail) { return __spreadArray([head], tail); }; };\nexports.prependW = prependW;\n/**\n * @internal\n */\nexports.prepend = exports.prependW;\n/**\n * @internal\n */\nvar appendW = function (end) { return function (init) { return __spreadArray(__spreadArray([], init), [end]); }; };\nexports.appendW = appendW;\n/**\n * @internal\n */\nexports.append = exports.appendW;\n/**\n * @internal\n */\nvar unsafeInsertAt = function (i, a, as) {\n if (exports.isNonEmpty(as)) {\n var xs = exports.fromReadonlyNonEmptyArray(as);\n xs.splice(i, 0, a);\n return xs;\n }\n return [a];\n};\nexports.unsafeInsertAt = unsafeInsertAt;\n/**\n * @internal\n */\nvar unsafeUpdateAt = function (i, a, as) {\n var xs = exports.fromReadonlyNonEmptyArray(as);\n xs[i] = a;\n return xs;\n};\nexports.unsafeUpdateAt = unsafeUpdateAt;\n/**\n * Remove duplicates from a `NonEmptyArray`, keeping the first occurrence of an element.\n *\n * @example\n * import { uniq } from 'fp-ts/NonEmptyArray'\n * import * as N from 'fp-ts/number'\n *\n * assert.deepStrictEqual(uniq(N.Eq)([1, 2, 1]), [1, 2])\n *\n * @category combinators\n * @since 2.11.0\n */\nvar uniq = function (E) { return function (as) {\n if (as.length === 1) {\n return exports.copy(as);\n }\n var out = [exports.head(as)];\n var rest = exports.tail(as);\n var _loop_1 = function (a) {\n if (out.every(function (o) { return !E.equals(o, a); })) {\n out.push(a);\n }\n };\n for (var _i = 0, rest_1 = rest; _i < rest_1.length; _i++) {\n var a = rest_1[_i];\n _loop_1(a);\n }\n return out;\n}; };\nexports.uniq = uniq;\n/**\n * Sort the elements of a `NonEmptyArray` in increasing order, where elements are compared using first `ords[0]`, then `ords[1]`,\n * etc...\n *\n * @example\n * import * as NEA from 'fp-ts/NonEmptyArray'\n * import { contramap } from 'fp-ts/Ord'\n * import * as S from 'fp-ts/string'\n * import * as N from 'fp-ts/number'\n * import { pipe } from 'fp-ts/function'\n *\n * interface Person {\n * name: string\n * age: number\n * }\n *\n * const byName = pipe(S.Ord, contramap((p: Person) => p.name))\n *\n * const byAge = pipe(N.Ord, contramap((p: Person) => p.age))\n *\n * const sortByNameByAge = NEA.sortBy([byName, byAge])\n *\n * const persons: NEA.NonEmptyArray = [\n * { name: 'a', age: 1 },\n * { name: 'b', age: 3 },\n * { name: 'c', age: 2 },\n * { name: 'b', age: 2 }\n * ]\n *\n * assert.deepStrictEqual(sortByNameByAge(persons), [\n * { name: 'a', age: 1 },\n * { name: 'b', age: 2 },\n * { name: 'b', age: 3 },\n * { name: 'c', age: 2 }\n * ])\n *\n * @category combinators\n * @since 2.11.0\n */\nvar sortBy = function (ords) {\n if (exports.isNonEmpty(ords)) {\n var M = Ord_1.getMonoid();\n return exports.sort(ords.reduce(M.concat, M.empty));\n }\n return exports.copy;\n};\nexports.sortBy = sortBy;\n/**\n * @category combinators\n * @since 2.11.0\n */\nvar union = function (E) {\n var uniqE = exports.uniq(E);\n return function (second) { return function (first) { return uniqE(function_1.pipe(first, concat(second))); }; };\n};\nexports.union = union;\n/**\n * Rotate a `NonEmptyArray` by `n` steps.\n *\n * @example\n * import { rotate } from 'fp-ts/NonEmptyArray'\n *\n * assert.deepStrictEqual(rotate(2)([1, 2, 3, 4, 5]), [4, 5, 1, 2, 3])\n * assert.deepStrictEqual(rotate(-2)([1, 2, 3, 4, 5]), [3, 4, 5, 1, 2])\n *\n * @category combinators\n * @since 2.11.0\n */\nvar rotate = function (n) { return function (as) {\n var len = as.length;\n var m = Math.round(n) % len;\n if (exports.isOutOfBound(Math.abs(m), as) || m === 0) {\n return exports.copy(as);\n }\n if (m < 0) {\n var _a = exports.splitAt(-m)(as), f = _a[0], s = _a[1];\n return function_1.pipe(s, concat(f));\n }\n else {\n return exports.rotate(m - len)(as);\n }\n}; };\nexports.rotate = rotate;\n// -------------------------------------------------------------------------------------\n// constructors\n// -------------------------------------------------------------------------------------\n/**\n * @category constructors\n * @since 2.10.0\n */\nexports.fromReadonlyNonEmptyArray = _.fromReadonlyNonEmptyArray;\n/**\n * Builds a `NonEmptyArray` from an `Array` returning `none` if `as` is an empty array\n *\n * @category constructors\n * @since 2.0.0\n */\nvar fromArray = function (as) { return (exports.isNonEmpty(as) ? _.some(as) : _.none); };\nexports.fromArray = fromArray;\n/**\n * Return a `NonEmptyArray` of length `n` with element `i` initialized with `f(i)`.\n *\n * **Note**. `n` is normalized to a natural number.\n *\n * @example\n * import { makeBy } from 'fp-ts/NonEmptyArray'\n * import { pipe } from 'fp-ts/function'\n *\n * const double = (n: number): number => n * 2\n * assert.deepStrictEqual(pipe(5, makeBy(double)), [0, 2, 4, 6, 8])\n *\n * @category constructors\n * @since 2.11.0\n */\nvar makeBy = function (f) { return function (n) {\n var j = Math.max(0, Math.floor(n));\n var out = [f(0)];\n for (var i = 1; i < j; i++) {\n out.push(f(i));\n }\n return out;\n}; };\nexports.makeBy = makeBy;\n/**\n * Create a `NonEmptyArray` containing a value repeated the specified number of times.\n *\n * **Note**. `n` is normalized to a natural number.\n *\n * @example\n * import { replicate } from 'fp-ts/NonEmptyArray'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe(3, replicate('a')), ['a', 'a', 'a'])\n *\n * @category constructors\n * @since 2.11.0\n */\nvar replicate = function (a) { return exports.makeBy(function () { return a; }); };\nexports.replicate = replicate;\n/**\n * Create a `NonEmptyArray` containing a range of integers, including both endpoints.\n *\n * @example\n * import { range } from 'fp-ts/NonEmptyArray'\n *\n * assert.deepStrictEqual(range(1, 5), [1, 2, 3, 4, 5])\n *\n * @category constructors\n * @since 2.11.0\n */\nvar range = function (start, end) {\n return start <= end ? exports.makeBy(function (i) { return start + i; })(end - start + 1) : [start];\n};\nexports.range = range;\n// -------------------------------------------------------------------------------------\n// destructors\n// -------------------------------------------------------------------------------------\n/**\n * Return the tuple of the `head` and the `tail`.\n *\n * @example\n * import { unprepend } from 'fp-ts/NonEmptyArray'\n *\n * assert.deepStrictEqual(unprepend([1, 2, 3]), [1, [2, 3]])\n *\n * @category destructors\n * @since 2.9.0\n */\nvar unprepend = function (as) { return [exports.head(as), exports.tail(as)]; };\nexports.unprepend = unprepend;\n/**\n * Return the tuple of the `init` and the `last`.\n *\n * @example\n * import { unappend } from 'fp-ts/NonEmptyArray'\n *\n * assert.deepStrictEqual(unappend([1, 2, 3, 4]), [[1, 2, 3], 4])\n *\n * @category destructors\n * @since 2.9.0\n */\nvar unappend = function (as) { return [exports.init(as), exports.last(as)]; };\nexports.unappend = unappend;\nfunction concatW(second) {\n return function (first) { return first.concat(second); };\n}\nexports.concatW = concatW;\nfunction concat(x, y) {\n return y ? x.concat(y) : function (y) { return y.concat(x); };\n}\nexports.concat = concat;\n/**\n * @category combinators\n * @since 2.0.0\n */\nvar reverse = function (as) { return __spreadArray([exports.last(as)], as.slice(0, -1).reverse()); };\nexports.reverse = reverse;\nfunction group(E) {\n return function (as) {\n var len = as.length;\n if (len === 0) {\n return [];\n }\n var out = [];\n var head = as[0];\n var nea = [head];\n for (var i = 1; i < len; i++) {\n var a = as[i];\n if (E.equals(a, head)) {\n nea.push(a);\n }\n else {\n out.push(nea);\n head = a;\n nea = [head];\n }\n }\n out.push(nea);\n return out;\n };\n}\nexports.group = group;\n/**\n * Splits an array into sub-non-empty-arrays stored in an object, based on the result of calling a `string`-returning\n * function on each element, and grouping the results according to values returned\n *\n * @example\n * import { groupBy } from 'fp-ts/NonEmptyArray'\n *\n * assert.deepStrictEqual(groupBy((s: string) => String(s.length))(['a', 'b', 'ab']), {\n * '1': ['a', 'b'],\n * '2': ['ab']\n * })\n *\n * @category combinators\n * @since 2.0.0\n */\nvar groupBy = function (f) { return function (as) {\n var out = {};\n for (var _i = 0, as_1 = as; _i < as_1.length; _i++) {\n var a = as_1[_i];\n var k = f(a);\n if (out.hasOwnProperty(k)) {\n out[k].push(a);\n }\n else {\n out[k] = [a];\n }\n }\n return out;\n}; };\nexports.groupBy = groupBy;\n/**\n * @category combinators\n * @since 2.0.0\n */\nvar sort = function (O) { return function (as) {\n return as.slice().sort(O.compare);\n}; };\nexports.sort = sort;\n/**\n * @category combinators\n * @since 2.0.0\n */\nvar insertAt = function (i, a) { return function (as) {\n return i < 0 || i > as.length ? _.none : _.some(exports.unsafeInsertAt(i, a, as));\n}; };\nexports.insertAt = insertAt;\n/**\n * @category combinators\n * @since 2.0.0\n */\nvar updateAt = function (i, a) {\n return exports.modifyAt(i, function () { return a; });\n};\nexports.updateAt = updateAt;\n/**\n * @category combinators\n * @since 2.0.0\n */\nvar modifyAt = function (i, f) { return function (as) {\n return exports.isOutOfBound(i, as) ? _.none : _.some(exports.unsafeUpdateAt(i, f(as[i]), as));\n}; };\nexports.modifyAt = modifyAt;\n/**\n * @category combinators\n * @since 2.0.0\n */\nexports.copy = exports.fromReadonlyNonEmptyArray;\n/**\n * @category Pointed\n * @since 2.0.0\n */\nvar of = function (a) { return [a]; };\nexports.of = of;\n/**\n * @category combinators\n * @since 2.5.1\n */\nvar zipWith = function (as, bs, f) {\n var cs = [f(as[0], bs[0])];\n var len = Math.min(as.length, bs.length);\n for (var i = 1; i < len; i++) {\n cs[i] = f(as[i], bs[i]);\n }\n return cs;\n};\nexports.zipWith = zipWith;\nfunction zip(as, bs) {\n if (bs === undefined) {\n return function (bs) { return zip(bs, as); };\n }\n return exports.zipWith(as, bs, function (a, b) { return [a, b]; });\n}\nexports.zip = zip;\n/**\n * @category combinators\n * @since 2.5.1\n */\nvar unzip = function (abs) {\n var fa = [abs[0][0]];\n var fb = [abs[0][1]];\n for (var i = 1; i < abs.length; i++) {\n fa[i] = abs[i][0];\n fb[i] = abs[i][1];\n }\n return [fa, fb];\n};\nexports.unzip = unzip;\n/**\n * Prepend an element to every member of an array\n *\n * @example\n * import { prependAll } from 'fp-ts/NonEmptyArray'\n *\n * assert.deepStrictEqual(prependAll(9)([1, 2, 3, 4]), [9, 1, 9, 2, 9, 3, 9, 4])\n *\n * @category combinators\n * @since 2.10.0\n */\nvar prependAll = function (middle) { return function (as) {\n var out = [middle, as[0]];\n for (var i = 1; i < as.length; i++) {\n out.push(middle, as[i]);\n }\n return out;\n}; };\nexports.prependAll = prependAll;\n/**\n * Places an element in between members of an array\n *\n * @example\n * import { intersperse } from 'fp-ts/NonEmptyArray'\n *\n * assert.deepStrictEqual(intersperse(9)([1, 2, 3, 4]), [1, 9, 2, 9, 3, 9, 4])\n *\n * @category combinators\n * @since 2.9.0\n */\nvar intersperse = function (middle) { return function (as) {\n var rest = exports.tail(as);\n return exports.isNonEmpty(rest) ? function_1.pipe(rest, exports.prependAll(middle), exports.prepend(exports.head(as))) : exports.copy(as);\n}; };\nexports.intersperse = intersperse;\n/**\n * @category combinators\n * @since 2.0.0\n */\nexports.foldMapWithIndex = RNEA.foldMapWithIndex;\n/**\n * @category combinators\n * @since 2.0.0\n */\nexports.foldMap = RNEA.foldMap;\n/**\n * @category combinators\n * @since 2.10.0\n */\nvar chainWithIndex = function (f) { return function (as) {\n var out = exports.fromReadonlyNonEmptyArray(f(0, exports.head(as)));\n for (var i = 1; i < as.length; i++) {\n out.push.apply(out, f(i, as[i]));\n }\n return out;\n}; };\nexports.chainWithIndex = chainWithIndex;\n/**\n * @category combinators\n * @since 2.10.0\n */\nvar chop = function (f) { return function (as) {\n var _a = f(as), b = _a[0], rest = _a[1];\n var out = [b];\n var next = rest;\n while (exports.isNonEmpty(next)) {\n var _b = f(next), b_1 = _b[0], rest_2 = _b[1];\n out.push(b_1);\n next = rest_2;\n }\n return out;\n}; };\nexports.chop = chop;\n/**\n * Splits a `NonEmptyArray` into two pieces, the first piece has max `n` elements.\n *\n * @category combinators\n * @since 2.10.0\n */\nvar splitAt = function (n) { return function (as) {\n var m = Math.max(1, n);\n return m >= as.length ? [exports.copy(as), []] : [function_1.pipe(as.slice(1, m), exports.prepend(exports.head(as))), as.slice(m)];\n}; };\nexports.splitAt = splitAt;\n/**\n * @category combinators\n * @since 2.10.0\n */\nvar chunksOf = function (n) { return exports.chop(exports.splitAt(n)); };\nexports.chunksOf = chunksOf;\n// -------------------------------------------------------------------------------------\n// non-pipeables\n// -------------------------------------------------------------------------------------\n/* istanbul ignore next */\nvar _map = function (fa, f) { return function_1.pipe(fa, exports.map(f)); };\n/* istanbul ignore next */\nvar _mapWithIndex = function (fa, f) { return function_1.pipe(fa, exports.mapWithIndex(f)); };\n/* istanbul ignore next */\nvar _ap = function (fab, fa) { return function_1.pipe(fab, exports.ap(fa)); };\n/* istanbul ignore next */\nvar _chain = function (ma, f) { return function_1.pipe(ma, exports.chain(f)); };\n/* istanbul ignore next */\nvar _extend = function (wa, f) { return function_1.pipe(wa, exports.extend(f)); };\n/* istanbul ignore next */\nvar _reduce = function (fa, b, f) { return function_1.pipe(fa, exports.reduce(b, f)); };\n/* istanbul ignore next */\nvar _foldMap = function (M) {\n var foldMapM = exports.foldMap(M);\n return function (fa, f) { return function_1.pipe(fa, foldMapM(f)); };\n};\n/* istanbul ignore next */\nvar _reduceRight = function (fa, b, f) { return function_1.pipe(fa, exports.reduceRight(b, f)); };\n/* istanbul ignore next */\nvar _traverse = function (F) {\n var traverseF = exports.traverse(F);\n return function (ta, f) { return function_1.pipe(ta, traverseF(f)); };\n};\n/* istanbul ignore next */\nvar _alt = function (fa, that) { return function_1.pipe(fa, exports.alt(that)); };\n/* istanbul ignore next */\nvar _reduceWithIndex = function (fa, b, f) {\n return function_1.pipe(fa, exports.reduceWithIndex(b, f));\n};\n/* istanbul ignore next */\nvar _foldMapWithIndex = function (M) {\n var foldMapWithIndexM = exports.foldMapWithIndex(M);\n return function (fa, f) { return function_1.pipe(fa, foldMapWithIndexM(f)); };\n};\n/* istanbul ignore next */\nvar _reduceRightWithIndex = function (fa, b, f) {\n return function_1.pipe(fa, exports.reduceRightWithIndex(b, f));\n};\n/* istanbul ignore next */\nvar _traverseWithIndex = function (F) {\n var traverseWithIndexF = exports.traverseWithIndex(F);\n return function (ta, f) { return function_1.pipe(ta, traverseWithIndexF(f)); };\n};\n// -------------------------------------------------------------------------------------\n// type class members\n// -------------------------------------------------------------------------------------\n/**\n * Less strict version of [`alt`](#alt).\n *\n * @category Alt\n * @since 2.9.0\n */\nvar altW = function (that) { return function (as) {\n return function_1.pipe(as, concatW(that()));\n}; };\nexports.altW = altW;\n/**\n * Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to\n * types of kind `* -> *`.\n *\n * @category Alt\n * @since 2.6.2\n */\nexports.alt = exports.altW;\n/**\n * Apply a function to an argument under a type constructor.\n *\n * @category Apply\n * @since 2.0.0\n */\nvar ap = function (as) {\n return exports.chain(function (f) { return function_1.pipe(as, exports.map(f)); });\n};\nexports.ap = ap;\n/**\n * Composes computations in sequence, using the return value of one computation to determine the next computation.\n *\n * @category Monad\n * @since 2.0.0\n */\nvar chain = function (f) {\n return exports.chainWithIndex(function (_, a) { return f(a); });\n};\nexports.chain = chain;\n/**\n * @category Extend\n * @since 2.0.0\n */\nvar extend = function (f) { return function (as) {\n var next = exports.tail(as);\n var out = [f(as)];\n while (exports.isNonEmpty(next)) {\n out.push(f(next));\n next = exports.tail(next);\n }\n return out;\n}; };\nexports.extend = extend;\n/**\n * Derivable from `Extend`.\n *\n * @category combinators\n * @since 2.5.0\n */\nexports.duplicate = \n/*#__PURE__*/\nexports.extend(function_1.identity);\n/**\n * Derivable from `Chain`.\n *\n * @category combinators\n * @since 2.5.0\n */\nexports.flatten = \n/*#__PURE__*/\nexports.chain(function_1.identity);\n/**\n * `map` can be used to turn functions `(a: A) => B` into functions `(fa: F) => F` whose argument and return types\n * use the type constructor `F` to represent some computational context.\n *\n * @category Functor\n * @since 2.0.0\n */\nvar map = function (f) { return exports.mapWithIndex(function (_, a) { return f(a); }); };\nexports.map = map;\n/**\n * @category FunctorWithIndex\n * @since 2.0.0\n */\nvar mapWithIndex = function (f) { return function (as) {\n var out = [f(0, exports.head(as))];\n for (var i = 1; i < as.length; i++) {\n out.push(f(i, as[i]));\n }\n return out;\n}; };\nexports.mapWithIndex = mapWithIndex;\n/**\n * @category Foldable\n * @since 2.0.0\n */\nexports.reduce = RNEA.reduce;\n/**\n * @category FoldableWithIndex\n * @since 2.0.0\n */\nexports.reduceWithIndex = RNEA.reduceWithIndex;\n/**\n * @category Foldable\n * @since 2.0.0\n */\nexports.reduceRight = RNEA.reduceRight;\n/**\n * @category FoldableWithIndex\n * @since 2.0.0\n */\nexports.reduceRightWithIndex = RNEA.reduceRightWithIndex;\n/**\n * @since 2.6.3\n */\nvar traverse = function (F) {\n var traverseWithIndexF = exports.traverseWithIndex(F);\n return function (f) { return traverseWithIndexF(function (_, a) { return f(a); }); };\n};\nexports.traverse = traverse;\n/**\n * @since 2.6.3\n */\nvar sequence = function (F) { return exports.traverseWithIndex(F)(function (_, a) { return a; }); };\nexports.sequence = sequence;\n/**\n * @since 2.6.3\n */\nvar traverseWithIndex = function (F) { return function (f) { return function (as) {\n var out = F.map(f(0, exports.head(as)), exports.of);\n for (var i = 1; i < as.length; i++) {\n out = F.ap(F.map(out, function (bs) { return function (b) { return function_1.pipe(bs, exports.append(b)); }; }), f(i, as[i]));\n }\n return out;\n}; }; };\nexports.traverseWithIndex = traverseWithIndex;\n/**\n * @since 2.7.0\n */\nexports.extract = RNEA.head;\n// -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.URI = 'NonEmptyArray';\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.getShow = RNEA.getShow;\n/**\n * Builds a `Semigroup` instance for `NonEmptyArray`\n *\n * @category instances\n * @since 2.0.0\n */\nvar getSemigroup = function () { return ({\n concat: concat\n}); };\nexports.getSemigroup = getSemigroup;\n/**\n * @example\n * import { getEq } from 'fp-ts/NonEmptyArray'\n * import * as N from 'fp-ts/number'\n *\n * const E = getEq(N.Eq)\n * assert.strictEqual(E.equals([1, 2], [1, 2]), true)\n * assert.strictEqual(E.equals([1, 2], [1, 3]), false)\n *\n * @category instances\n * @since 2.0.0\n */\nexports.getEq = RNEA.getEq;\n/**\n * @category combinators\n * @since 2.11.0\n */\nvar getUnionSemigroup = function (E) {\n var unionE = exports.union(E);\n return {\n concat: function (first, second) { return unionE(second)(first); }\n };\n};\nexports.getUnionSemigroup = getUnionSemigroup;\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Functor = {\n URI: exports.URI,\n map: _map\n};\n/**\n * Derivable from `Functor`.\n *\n * @category combinators\n * @since 2.10.0\n */\nexports.flap = \n/*#__PURE__*/\nFunctor_1.flap(exports.Functor);\n/**\n * @category instances\n * @since 2.10.0\n */\nexports.Pointed = {\n URI: exports.URI,\n of: exports.of\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.FunctorWithIndex = {\n URI: exports.URI,\n map: _map,\n mapWithIndex: _mapWithIndex\n};\n/**\n * @category instances\n * @since 2.10.0\n */\nexports.Apply = {\n URI: exports.URI,\n map: _map,\n ap: _ap\n};\n/**\n * Combine two effectful actions, keeping only the result of the first.\n *\n * Derivable from `Apply`.\n *\n * @category combinators\n * @since 2.5.0\n */\nexports.apFirst = \n/*#__PURE__*/\nApply_1.apFirst(exports.Apply);\n/**\n * Combine two effectful actions, keeping only the result of the second.\n *\n * Derivable from `Apply`.\n *\n * @category combinators\n * @since 2.5.0\n */\nexports.apSecond = \n/*#__PURE__*/\nApply_1.apSecond(exports.Apply);\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Applicative = {\n URI: exports.URI,\n map: _map,\n ap: _ap,\n of: exports.of\n};\n/**\n * @category instances\n * @since 2.10.0\n */\nexports.Chain = {\n URI: exports.URI,\n map: _map,\n ap: _ap,\n chain: _chain\n};\n/**\n * Composes computations in sequence, using the return value of one computation to determine the next computation and\n * keeping only the result of the first.\n *\n * Derivable from `Chain`.\n *\n * @category combinators\n * @since 2.5.0\n */\nexports.chainFirst = \n/*#__PURE__*/\nChain_1.chainFirst(exports.Chain);\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Monad = {\n URI: exports.URI,\n map: _map,\n ap: _ap,\n of: exports.of,\n chain: _chain\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Foldable = {\n URI: exports.URI,\n reduce: _reduce,\n foldMap: _foldMap,\n reduceRight: _reduceRight\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.FoldableWithIndex = {\n URI: exports.URI,\n reduce: _reduce,\n foldMap: _foldMap,\n reduceRight: _reduceRight,\n reduceWithIndex: _reduceWithIndex,\n foldMapWithIndex: _foldMapWithIndex,\n reduceRightWithIndex: _reduceRightWithIndex\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Traversable = {\n URI: exports.URI,\n map: _map,\n reduce: _reduce,\n foldMap: _foldMap,\n reduceRight: _reduceRight,\n traverse: _traverse,\n sequence: exports.sequence\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.TraversableWithIndex = {\n URI: exports.URI,\n map: _map,\n mapWithIndex: _mapWithIndex,\n reduce: _reduce,\n foldMap: _foldMap,\n reduceRight: _reduceRight,\n traverse: _traverse,\n sequence: exports.sequence,\n reduceWithIndex: _reduceWithIndex,\n foldMapWithIndex: _foldMapWithIndex,\n reduceRightWithIndex: _reduceRightWithIndex,\n traverseWithIndex: _traverseWithIndex\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Alt = {\n URI: exports.URI,\n map: _map,\n alt: _alt\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Comonad = {\n URI: exports.URI,\n map: _map,\n extend: _extend,\n extract: exports.extract\n};\n// -------------------------------------------------------------------------------------\n// do notation\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.9.0\n */\nexports.Do = \n/*#__PURE__*/\nexports.of(_.emptyRecord);\n/**\n * @since 2.8.0\n */\nexports.bindTo = \n/*#__PURE__*/\nFunctor_1.bindTo(exports.Functor);\n/**\n * @since 2.8.0\n */\nexports.bind = \n/*#__PURE__*/\nChain_1.bind(exports.Chain);\n// -------------------------------------------------------------------------------------\n// pipeable sequence S\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.8.0\n */\nexports.apS = \n/*#__PURE__*/\nApply_1.apS(exports.Apply);\n// -------------------------------------------------------------------------------------\n// utils\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.0.0\n */\nexports.head = RNEA.head;\n/**\n * @since 2.0.0\n */\nvar tail = function (as) { return as.slice(1); };\nexports.tail = tail;\n/**\n * @since 2.0.0\n */\nexports.last = RNEA.last;\n/**\n * Get all but the last element of a non empty array, creating a new array.\n *\n * @example\n * import { init } from 'fp-ts/NonEmptyArray'\n *\n * assert.deepStrictEqual(init([1, 2, 3]), [1, 2])\n * assert.deepStrictEqual(init([1]), [])\n *\n * @since 2.2.0\n */\nvar init = function (as) { return as.slice(0, -1); };\nexports.init = init;\n/**\n * @since 2.0.0\n */\nexports.min = RNEA.min;\n/**\n * @since 2.0.0\n */\nexports.max = RNEA.max;\n/**\n * @since 2.10.0\n */\nvar concatAll = function (S) { return function (as) { return as.reduce(S.concat); }; };\nexports.concatAll = concatAll;\n/**\n * Break an `Array` into its first element and remaining elements.\n *\n * @category destructors\n * @since 2.11.0\n */\nvar matchLeft = function (f) { return function (as) { return f(exports.head(as), exports.tail(as)); }; };\nexports.matchLeft = matchLeft;\n/**\n * Break an `Array` into its initial elements and the last element.\n *\n * @category destructors\n * @since 2.11.0\n */\nvar matchRight = function (f) { return function (as) {\n return f(exports.init(as), exports.last(as));\n}; };\nexports.matchRight = matchRight;\n/**\n * Apply a function to the head, creating a new `NonEmptyArray`.\n *\n * @since 2.11.0\n */\nvar modifyHead = function (f) { return function (as) { return __spreadArray([\n f(exports.head(as))\n], exports.tail(as)); }; };\nexports.modifyHead = modifyHead;\n/**\n * Change the head, creating a new `NonEmptyArray`.\n *\n * @category combinators\n * @since 2.11.0\n */\nvar updateHead = function (a) { return exports.modifyHead(function () { return a; }); };\nexports.updateHead = updateHead;\n/**\n * Apply a function to the last element, creating a new `NonEmptyArray`.\n *\n * @since 2.11.0\n */\nvar modifyLast = function (f) { return function (as) {\n return function_1.pipe(exports.init(as), exports.append(f(exports.last(as))));\n}; };\nexports.modifyLast = modifyLast;\n/**\n * Change the last element, creating a new `NonEmptyArray`.\n *\n * @category combinators\n * @since 2.11.0\n */\nvar updateLast = function (a) { return exports.modifyLast(function () { return a; }); };\nexports.updateLast = updateLast;\nfunction groupSort(O) {\n var sortO = exports.sort(O);\n var groupO = group(O);\n return function (as) { return (exports.isNonEmpty(as) ? groupO(sortO(as)) : []); };\n}\nexports.groupSort = groupSort;\nfunction filter(predicate) {\n return exports.filterWithIndex(function (_, a) { return predicate(a); });\n}\nexports.filter = filter;\n/**\n * Use [`filterWithIndex`](./Array.ts.html#filterwithindex) instead.\n *\n * @category combinators\n * @since 2.0.0\n * @deprecated\n */\nvar filterWithIndex = function (predicate) { return function (as) { return exports.fromArray(as.filter(function (a, i) { return predicate(i, a); })); }; };\nexports.filterWithIndex = filterWithIndex;\n/**\n * Use [`unprepend`](#unprepend) instead.\n *\n * @category destructors\n * @since 2.9.0\n * @deprecated\n */\nexports.uncons = exports.unprepend;\n/**\n * Use [`unappend`](#unappend) instead.\n *\n * @category destructors\n * @since 2.9.0\n * @deprecated\n */\nexports.unsnoc = exports.unappend;\nfunction cons(head, tail) {\n return tail === undefined ? exports.prepend(head) : function_1.pipe(tail, exports.prepend(head));\n}\nexports.cons = cons;\n/**\n * Use [`append`](./Array.ts.html#append) instead.\n *\n * @category constructors\n * @since 2.0.0\n * @deprecated\n */\nvar snoc = function (init, end) { return function_1.pipe(init, exports.append(end)); };\nexports.snoc = snoc;\n/**\n * Use [`prependAll`](#prependall) instead.\n *\n * @category combinators\n * @since 2.9.0\n * @deprecated\n */\nexports.prependToAll = exports.prependAll;\n/**\n * Use [`concatAll`](#concatall) instead.\n *\n * @since 2.5.0\n * @deprecated\n */\nexports.fold = RNEA.concatAll;\n/**\n * Use small, specific instances instead.\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nexports.nonEmptyArray = {\n URI: exports.URI,\n of: exports.of,\n map: _map,\n mapWithIndex: _mapWithIndex,\n ap: _ap,\n chain: _chain,\n extend: _extend,\n extract: exports.extract,\n reduce: _reduce,\n foldMap: _foldMap,\n reduceRight: _reduceRight,\n traverse: _traverse,\n sequence: exports.sequence,\n reduceWithIndex: _reduceWithIndex,\n foldMapWithIndex: _foldMapWithIndex,\n reduceRightWithIndex: _reduceRightWithIndex,\n traverseWithIndex: _traverseWithIndex,\n alt: _alt\n};\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fromEither = exports.MonadThrow = exports.throwError = exports.Witherable = exports.wilt = exports.wither = exports.Traversable = exports.sequence = exports.traverse = exports.Filterable = exports.partitionMap = exports.partition = exports.filterMap = exports.filter = exports.Compactable = exports.separate = exports.compact = exports.Extend = exports.extend = exports.Alternative = exports.guard = exports.Zero = exports.zero = exports.Alt = exports.alt = exports.altW = exports.Foldable = exports.reduceRight = exports.foldMap = exports.reduce = exports.Monad = exports.Chain = exports.chain = exports.Applicative = exports.Apply = exports.ap = exports.Pointed = exports.of = exports.Functor = exports.map = exports.getMonoid = exports.getOrd = exports.getEq = exports.getShow = exports.URI = exports.getRight = exports.getLeft = exports.fromPredicate = exports.some = exports.none = void 0;\nexports.getLastMonoid = exports.getFirstMonoid = exports.getApplyMonoid = exports.getApplySemigroup = exports.option = exports.mapNullable = exports.getRefinement = exports.sequenceArray = exports.traverseArray = exports.traverseArrayWithIndex = exports.traverseReadonlyArrayWithIndex = exports.traverseReadonlyNonEmptyArrayWithIndex = exports.ApT = exports.apS = exports.bind = exports.bindTo = exports.Do = exports.exists = exports.elem = exports.toUndefined = exports.toNullable = exports.chainNullableK = exports.fromNullableK = exports.tryCatchK = exports.tryCatch = exports.fromNullable = exports.chainEitherK = exports.fromEitherK = exports.duplicate = exports.chainFirst = exports.flatten = exports.apSecond = exports.apFirst = exports.flap = exports.getOrElse = exports.getOrElseW = exports.fold = exports.match = exports.foldW = exports.matchW = exports.isNone = exports.isSome = exports.FromEither = void 0;\nvar Applicative_1 = require(\"./Applicative\");\nvar Apply_1 = require(\"./Apply\");\nvar Chain_1 = require(\"./Chain\");\nvar FromEither_1 = require(\"./FromEither\");\nvar function_1 = require(\"./function\");\nvar Functor_1 = require(\"./Functor\");\nvar _ = __importStar(require(\"./internal\"));\nvar Predicate_1 = require(\"./Predicate\");\nvar Semigroup_1 = require(\"./Semigroup\");\nvar Separated_1 = require(\"./Separated\");\nvar Witherable_1 = require(\"./Witherable\");\nvar Zero_1 = require(\"./Zero\");\n// -------------------------------------------------------------------------------------\n// constructors\n// -------------------------------------------------------------------------------------\n/**\n * `None` doesn't have a constructor, instead you can use it directly as a value. Represents a missing value.\n *\n * @category constructors\n * @since 2.0.0\n */\nexports.none = _.none;\n/**\n * Constructs a `Some`. Represents an optional value that exists.\n *\n * @category constructors\n * @since 2.0.0\n */\nexports.some = _.some;\nfunction fromPredicate(predicate) {\n return function (a) { return (predicate(a) ? exports.some(a) : exports.none); };\n}\nexports.fromPredicate = fromPredicate;\n/**\n * Returns the `Left` value of an `Either` if possible.\n *\n * @example\n * import { getLeft, none, some } from 'fp-ts/Option'\n * import { right, left } from 'fp-ts/Either'\n *\n * assert.deepStrictEqual(getLeft(right(1)), none)\n * assert.deepStrictEqual(getLeft(left('a')), some('a'))\n *\n * @category constructors\n * @since 2.0.0\n */\nvar getLeft = function (ma) { return (ma._tag === 'Right' ? exports.none : exports.some(ma.left)); };\nexports.getLeft = getLeft;\n/**\n * Returns the `Right` value of an `Either` if possible.\n *\n * @example\n * import { getRight, none, some } from 'fp-ts/Option'\n * import { right, left } from 'fp-ts/Either'\n *\n * assert.deepStrictEqual(getRight(right(1)), some(1))\n * assert.deepStrictEqual(getRight(left('a')), none)\n *\n * @category constructors\n * @since 2.0.0\n */\nvar getRight = function (ma) { return (ma._tag === 'Left' ? exports.none : exports.some(ma.right)); };\nexports.getRight = getRight;\n// -------------------------------------------------------------------------------------\n// non-pipeables\n// -------------------------------------------------------------------------------------\nvar _map = function (fa, f) { return function_1.pipe(fa, exports.map(f)); };\nvar _ap = function (fab, fa) { return function_1.pipe(fab, exports.ap(fa)); };\nvar _chain = function (ma, f) { return function_1.pipe(ma, exports.chain(f)); };\nvar _reduce = function (fa, b, f) { return function_1.pipe(fa, exports.reduce(b, f)); };\nvar _foldMap = function (M) {\n var foldMapM = exports.foldMap(M);\n return function (fa, f) { return function_1.pipe(fa, foldMapM(f)); };\n};\nvar _reduceRight = function (fa, b, f) { return function_1.pipe(fa, exports.reduceRight(b, f)); };\nvar _traverse = function (F) {\n var traverseF = exports.traverse(F);\n return function (ta, f) { return function_1.pipe(ta, traverseF(f)); };\n};\n/* istanbul ignore next */\nvar _alt = function (fa, that) { return function_1.pipe(fa, exports.alt(that)); };\nvar _filter = function (fa, predicate) { return function_1.pipe(fa, exports.filter(predicate)); };\n/* istanbul ignore next */\nvar _filterMap = function (fa, f) { return function_1.pipe(fa, exports.filterMap(f)); };\n/* istanbul ignore next */\nvar _extend = function (wa, f) { return function_1.pipe(wa, exports.extend(f)); };\n/* istanbul ignore next */\nvar _partition = function (fa, predicate) {\n return function_1.pipe(fa, exports.partition(predicate));\n};\n/* istanbul ignore next */\nvar _partitionMap = function (fa, f) { return function_1.pipe(fa, exports.partitionMap(f)); };\n// -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.URI = 'Option';\n/**\n * @category instances\n * @since 2.0.0\n */\nvar getShow = function (S) { return ({\n show: function (ma) { return (exports.isNone(ma) ? 'none' : \"some(\" + S.show(ma.value) + \")\"); }\n}); };\nexports.getShow = getShow;\n/**\n * @example\n * import { none, some, getEq } from 'fp-ts/Option'\n * import * as N from 'fp-ts/number'\n *\n * const E = getEq(N.Eq)\n * assert.strictEqual(E.equals(none, none), true)\n * assert.strictEqual(E.equals(none, some(1)), false)\n * assert.strictEqual(E.equals(some(1), none), false)\n * assert.strictEqual(E.equals(some(1), some(2)), false)\n * assert.strictEqual(E.equals(some(1), some(1)), true)\n *\n * @category instances\n * @since 2.0.0\n */\nvar getEq = function (E) { return ({\n equals: function (x, y) { return x === y || (exports.isNone(x) ? exports.isNone(y) : exports.isNone(y) ? false : E.equals(x.value, y.value)); }\n}); };\nexports.getEq = getEq;\n/**\n * The `Ord` instance allows `Option` values to be compared with\n * `compare`, whenever there is an `Ord` instance for\n * the type the `Option` contains.\n *\n * `None` is considered to be less than any `Some` value.\n *\n *\n * @example\n * import { none, some, getOrd } from 'fp-ts/Option'\n * import * as N from 'fp-ts/number'\n *\n * const O = getOrd(N.Ord)\n * assert.strictEqual(O.compare(none, none), 0)\n * assert.strictEqual(O.compare(none, some(1)), -1)\n * assert.strictEqual(O.compare(some(1), none), 1)\n * assert.strictEqual(O.compare(some(1), some(2)), -1)\n * assert.strictEqual(O.compare(some(1), some(1)), 0)\n *\n * @category instances\n * @since 2.0.0\n */\nvar getOrd = function (O) { return ({\n equals: exports.getEq(O).equals,\n compare: function (x, y) { return (x === y ? 0 : exports.isSome(x) ? (exports.isSome(y) ? O.compare(x.value, y.value) : 1) : -1); }\n}); };\nexports.getOrd = getOrd;\n/**\n * Monoid returning the left-most non-`None` value. If both operands are `Some`s then the inner values are\n * concatenated using the provided `Semigroup`\n *\n * | x | y | concat(x, y) |\n * | ------- | ------- | ------------------ |\n * | none | none | none |\n * | some(a) | none | some(a) |\n * | none | some(b) | some(b) |\n * | some(a) | some(b) | some(concat(a, b)) |\n *\n * @example\n * import { getMonoid, some, none } from 'fp-ts/Option'\n * import { SemigroupSum } from 'fp-ts/number'\n *\n * const M = getMonoid(SemigroupSum)\n * assert.deepStrictEqual(M.concat(none, none), none)\n * assert.deepStrictEqual(M.concat(some(1), none), some(1))\n * assert.deepStrictEqual(M.concat(none, some(1)), some(1))\n * assert.deepStrictEqual(M.concat(some(1), some(2)), some(3))\n *\n * @category instances\n * @since 2.0.0\n */\nvar getMonoid = function (S) { return ({\n concat: function (x, y) { return (exports.isNone(x) ? y : exports.isNone(y) ? x : exports.some(S.concat(x.value, y.value))); },\n empty: exports.none\n}); };\nexports.getMonoid = getMonoid;\n/**\n * @category instance operations\n * @since 2.0.0\n */\nvar map = function (f) { return function (fa) {\n return exports.isNone(fa) ? exports.none : exports.some(f(fa.value));\n}; };\nexports.map = map;\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Functor = {\n URI: exports.URI,\n map: _map\n};\n/**\n * @category instance operations\n * @since 2.7.0\n */\nexports.of = exports.some;\n/**\n * @category instances\n * @since 2.10.0\n */\nexports.Pointed = {\n URI: exports.URI,\n of: exports.of\n};\n/**\n * @category instance operations\n * @since 2.0.0\n */\nvar ap = function (fa) { return function (fab) {\n return exports.isNone(fab) ? exports.none : exports.isNone(fa) ? exports.none : exports.some(fab.value(fa.value));\n}; };\nexports.ap = ap;\n/**\n * @category instances\n * @since 2.10.0\n */\nexports.Apply = {\n URI: exports.URI,\n map: _map,\n ap: _ap\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Applicative = {\n URI: exports.URI,\n map: _map,\n ap: _ap,\n of: exports.of\n};\n/**\n * Composes computations in sequence, using the return value of one computation to determine the next computation.\n *\n * @category instance operations\n * @since 2.0.0\n */\nvar chain = function (f) { return function (ma) {\n return exports.isNone(ma) ? exports.none : f(ma.value);\n}; };\nexports.chain = chain;\n/**\n * @category instances\n * @since 2.10.0\n */\nexports.Chain = {\n URI: exports.URI,\n map: _map,\n ap: _ap,\n chain: _chain\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Monad = {\n URI: exports.URI,\n map: _map,\n ap: _ap,\n of: exports.of,\n chain: _chain\n};\n/**\n * @category instance operations\n * @since 2.0.0\n */\nvar reduce = function (b, f) { return function (fa) {\n return exports.isNone(fa) ? b : f(b, fa.value);\n}; };\nexports.reduce = reduce;\n/**\n * @category instance operations\n * @since 2.0.0\n */\nvar foldMap = function (M) { return function (f) { return function (fa) {\n return exports.isNone(fa) ? M.empty : f(fa.value);\n}; }; };\nexports.foldMap = foldMap;\n/**\n * @category instance operations\n * @since 2.0.0\n */\nvar reduceRight = function (b, f) { return function (fa) {\n return exports.isNone(fa) ? b : f(fa.value, b);\n}; };\nexports.reduceRight = reduceRight;\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Foldable = {\n URI: exports.URI,\n reduce: _reduce,\n foldMap: _foldMap,\n reduceRight: _reduceRight\n};\n/**\n * Less strict version of [`alt`](#alt).\n *\n * @category instance operations\n * @since 2.9.0\n */\nvar altW = function (that) { return function (fa) {\n return exports.isNone(fa) ? that() : fa;\n}; };\nexports.altW = altW;\n/**\n * Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to\n * types of kind `* -> *`.\n *\n * In case of `Option` returns the left-most non-`None` value.\n *\n * @example\n * import * as O from 'fp-ts/Option'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(\n * pipe(\n * O.some('a'),\n * O.alt(() => O.some('b'))\n * ),\n * O.some('a')\n * )\n * assert.deepStrictEqual(\n * pipe(\n * O.none,\n * O.alt(() => O.some('b'))\n * ),\n * O.some('b')\n * )\n *\n * @category instance operations\n * @since 2.0.0\n */\nexports.alt = exports.altW;\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Alt = {\n URI: exports.URI,\n map: _map,\n alt: _alt\n};\n/**\n * @category instance operations\n * @since 2.7.0\n */\nvar zero = function () { return exports.none; };\nexports.zero = zero;\n/**\n * @category instances\n * @since 2.11.0\n */\nexports.Zero = {\n URI: exports.URI,\n zero: exports.zero\n};\n/**\n * @category constructors\n * @since 2.11.0\n */\nexports.guard = \n/*#__PURE__*/\nZero_1.guard(exports.Zero, exports.Pointed);\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Alternative = {\n URI: exports.URI,\n map: _map,\n ap: _ap,\n of: exports.of,\n alt: _alt,\n zero: exports.zero\n};\n/**\n * @category instance operations\n * @since 2.0.0\n */\nvar extend = function (f) { return function (wa) {\n return exports.isNone(wa) ? exports.none : exports.some(f(wa));\n}; };\nexports.extend = extend;\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Extend = {\n URI: exports.URI,\n map: _map,\n extend: _extend\n};\n/**\n * @category instance operations\n * @since 2.0.0\n */\nexports.compact = \n/*#__PURE__*/\nexports.chain(function_1.identity);\nvar defaultSeparated = \n/*#__PURE__*/\nSeparated_1.separated(exports.none, exports.none);\n/**\n * @category instance operations\n * @since 2.0.0\n */\nvar separate = function (ma) {\n return exports.isNone(ma) ? defaultSeparated : Separated_1.separated(exports.getLeft(ma.value), exports.getRight(ma.value));\n};\nexports.separate = separate;\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Compactable = {\n URI: exports.URI,\n compact: exports.compact,\n separate: exports.separate\n};\n/**\n * @category instance operations\n * @since 2.0.0\n */\nvar filter = function (predicate) { return function (fa) { return (exports.isNone(fa) ? exports.none : predicate(fa.value) ? fa : exports.none); }; };\nexports.filter = filter;\n/**\n * @category instance operations\n * @since 2.0.0\n */\nvar filterMap = function (f) { return function (fa) {\n return exports.isNone(fa) ? exports.none : f(fa.value);\n}; };\nexports.filterMap = filterMap;\n/**\n * @category instance operations\n * @since 2.0.0\n */\nvar partition = function (predicate) { return function (fa) { return Separated_1.separated(_filter(fa, Predicate_1.not(predicate)), _filter(fa, predicate)); }; };\nexports.partition = partition;\n/**\n * @category instance operations\n * @since 2.0.0\n */\nvar partitionMap = function (f) { return function_1.flow(exports.map(f), exports.separate); };\nexports.partitionMap = partitionMap;\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Filterable = {\n URI: exports.URI,\n map: _map,\n compact: exports.compact,\n separate: exports.separate,\n filter: _filter,\n filterMap: _filterMap,\n partition: _partition,\n partitionMap: _partitionMap\n};\n/**\n * @category instance operations\n * @since 2.6.3\n */\nvar traverse = function (F) { return function (f) { return function (ta) { return (exports.isNone(ta) ? F.of(exports.none) : F.map(f(ta.value), exports.some)); }; }; };\nexports.traverse = traverse;\n/**\n * @category instance operations\n * @since 2.6.3\n */\nvar sequence = function (F) { return function (ta) { return (exports.isNone(ta) ? F.of(exports.none) : F.map(ta.value, exports.some)); }; };\nexports.sequence = sequence;\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Traversable = {\n URI: exports.URI,\n map: _map,\n reduce: _reduce,\n foldMap: _foldMap,\n reduceRight: _reduceRight,\n traverse: _traverse,\n sequence: exports.sequence\n};\nvar _wither = \n/*#__PURE__*/\nWitherable_1.witherDefault(exports.Traversable, exports.Compactable);\nvar _wilt = \n/*#__PURE__*/\nWitherable_1.wiltDefault(exports.Traversable, exports.Compactable);\n/**\n * @category instance operations\n * @since 2.6.5\n */\nvar wither = function (F) {\n var _witherF = _wither(F);\n return function (f) { return function (fa) { return _witherF(fa, f); }; };\n};\nexports.wither = wither;\n/**\n * @category instance operations\n * @since 2.6.5\n */\nvar wilt = function (F) {\n var _wiltF = _wilt(F);\n return function (f) { return function (fa) { return _wiltF(fa, f); }; };\n};\nexports.wilt = wilt;\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Witherable = {\n URI: exports.URI,\n map: _map,\n reduce: _reduce,\n foldMap: _foldMap,\n reduceRight: _reduceRight,\n traverse: _traverse,\n sequence: exports.sequence,\n compact: exports.compact,\n separate: exports.separate,\n filter: _filter,\n filterMap: _filterMap,\n partition: _partition,\n partitionMap: _partitionMap,\n wither: _wither,\n wilt: _wilt\n};\n/**\n * @category instance operations\n * @since 2.7.0\n */\nvar throwError = function () { return exports.none; };\nexports.throwError = throwError;\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.MonadThrow = {\n URI: exports.URI,\n map: _map,\n ap: _ap,\n of: exports.of,\n chain: _chain,\n throwError: exports.throwError\n};\n/**\n * Transforms an `Either` to an `Option` discarding the error.\n *\n * Alias of [getRight](#getright)\n *\n * @category natural transformations\n * @since 2.0.0\n */\nexports.fromEither = exports.getRight;\n/**\n * @category instances\n * @since 2.11.0\n */\nexports.FromEither = {\n URI: exports.URI,\n fromEither: exports.fromEither\n};\n// -------------------------------------------------------------------------------------\n// refinements\n// -------------------------------------------------------------------------------------\n/**\n * Returns `true` if the option is an instance of `Some`, `false` otherwise.\n *\n * @example\n * import { some, none, isSome } from 'fp-ts/Option'\n *\n * assert.strictEqual(isSome(some(1)), true)\n * assert.strictEqual(isSome(none), false)\n *\n * @category refinements\n * @since 2.0.0\n */\nexports.isSome = _.isSome;\n/**\n * Returns `true` if the option is `None`, `false` otherwise.\n *\n * @example\n * import { some, none, isNone } from 'fp-ts/Option'\n *\n * assert.strictEqual(isNone(some(1)), false)\n * assert.strictEqual(isNone(none), true)\n *\n * @category refinements\n * @since 2.0.0\n */\nvar isNone = function (fa) { return fa._tag === 'None'; };\nexports.isNone = isNone;\n// -------------------------------------------------------------------------------------\n// destructors\n// -------------------------------------------------------------------------------------\n/**\n * Less strict version of [`match`](#match).\n *\n * @category destructors\n * @since 2.10.0\n */\nvar matchW = function (onNone, onSome) { return function (ma) {\n return exports.isNone(ma) ? onNone() : onSome(ma.value);\n}; };\nexports.matchW = matchW;\n/**\n * Alias of [`matchW`](#matchw).\n *\n * @category destructors\n * @since 2.10.0\n */\nexports.foldW = exports.matchW;\n/**\n * Takes a (lazy) default value, a function, and an `Option` value, if the `Option` value is `None` the default value is\n * returned, otherwise the function is applied to the value inside the `Some` and the result is returned.\n *\n * @example\n * import { some, none, match } from 'fp-ts/Option'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.strictEqual(\n * pipe(\n * some(1),\n * match(() => 'a none', a => `a some containing ${a}`)\n * ),\n * 'a some containing 1'\n * )\n *\n * assert.strictEqual(\n * pipe(\n * none,\n * match(() => 'a none', a => `a some containing ${a}`)\n * ),\n * 'a none'\n * )\n *\n * @category destructors\n * @since 2.10.0\n */\nexports.match = exports.matchW;\n/**\n * Alias of [`match`](#match).\n *\n * @category destructors\n * @since 2.0.0\n */\nexports.fold = exports.match;\n/**\n * Less strict version of [`getOrElse`](#getorelse).\n *\n * @category destructors\n * @since 2.6.0\n */\nvar getOrElseW = function (onNone) { return function (ma) { return (exports.isNone(ma) ? onNone() : ma.value); }; };\nexports.getOrElseW = getOrElseW;\n/**\n * Extracts the value out of the structure, if it exists. Otherwise returns the given default value\n *\n * @example\n * import { some, none, getOrElse } from 'fp-ts/Option'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.strictEqual(\n * pipe(\n * some(1),\n * getOrElse(() => 0)\n * ),\n * 1\n * )\n * assert.strictEqual(\n * pipe(\n * none,\n * getOrElse(() => 0)\n * ),\n * 0\n * )\n *\n * @category destructors\n * @since 2.0.0\n */\nexports.getOrElse = exports.getOrElseW;\n// -------------------------------------------------------------------------------------\n// combinators\n// -------------------------------------------------------------------------------------\n/**\n * Derivable from `Functor`.\n *\n * @category combinators\n * @since 2.10.0\n */\nexports.flap = \n/*#__PURE__*/\nFunctor_1.flap(exports.Functor);\n/**\n * Combine two effectful actions, keeping only the result of the first.\n *\n * Derivable from `Apply`.\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.apFirst = \n/*#__PURE__*/\nApply_1.apFirst(exports.Apply);\n/**\n * Combine two effectful actions, keeping only the result of the second.\n *\n * Derivable from `Apply`.\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.apSecond = \n/*#__PURE__*/\nApply_1.apSecond(exports.Apply);\n/**\n * Derivable from `Chain`.\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.flatten = exports.compact;\n/**\n * Composes computations in sequence, using the return value of one computation to determine the next computation and\n * keeping only the result of the first.\n *\n * Derivable from `Chain`.\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.chainFirst = \n/*#__PURE__*/\nChain_1.chainFirst(exports.Chain);\n/**\n * Derivable from `Extend`.\n *\n * @category combinators\n * @since 2.0.0\n */\nexports.duplicate = \n/*#__PURE__*/\nexports.extend(function_1.identity);\n/**\n * @category combinators\n * @since 2.11.0\n */\nexports.fromEitherK = \n/*#__PURE__*/\nFromEither_1.fromEitherK(exports.FromEither);\n/**\n * @category combinators\n * @since 2.11.0\n */\nexports.chainEitherK = \n/*#__PURE__*/\nFromEither_1.chainEitherK(exports.FromEither, exports.Chain);\n// -------------------------------------------------------------------------------------\n// interop\n// -------------------------------------------------------------------------------------\n/**\n * Constructs a new `Option` from a nullable type. If the value is `null` or `undefined`, returns `None`, otherwise\n * returns the value wrapped in a `Some`.\n *\n * @example\n * import { none, some, fromNullable } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(fromNullable(undefined), none)\n * assert.deepStrictEqual(fromNullable(null), none)\n * assert.deepStrictEqual(fromNullable(1), some(1))\n *\n * @category interop\n * @since 2.0.0\n */\nvar fromNullable = function (a) { return (a == null ? exports.none : exports.some(a)); };\nexports.fromNullable = fromNullable;\n/**\n * Transforms an exception into an `Option`. If `f` throws, returns `None`, otherwise returns the output wrapped in a\n * `Some`.\n *\n * See also [`tryCatchK`](#trycatchk).\n *\n * @example\n * import { none, some, tryCatch } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(\n * tryCatch(() => {\n * throw new Error()\n * }),\n * none\n * )\n * assert.deepStrictEqual(tryCatch(() => 1), some(1))\n *\n * @category interop\n * @since 2.0.0\n */\nvar tryCatch = function (f) {\n try {\n return exports.some(f());\n }\n catch (e) {\n return exports.none;\n }\n};\nexports.tryCatch = tryCatch;\n/**\n * Converts a function that may throw to one returning a `Option`.\n *\n * @category interop\n * @since 2.10.0\n */\nvar tryCatchK = function (f) { return function () {\n var a = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n a[_i] = arguments[_i];\n }\n return exports.tryCatch(function () { return f.apply(void 0, a); });\n}; };\nexports.tryCatchK = tryCatchK;\n/**\n * Returns a *smart constructor* from a function that returns a nullable value.\n *\n * @example\n * import { fromNullableK, none, some } from 'fp-ts/Option'\n *\n * const f = (s: string): number | undefined => {\n * const n = parseFloat(s)\n * return isNaN(n) ? undefined : n\n * }\n *\n * const g = fromNullableK(f)\n *\n * assert.deepStrictEqual(g('1'), some(1))\n * assert.deepStrictEqual(g('a'), none)\n *\n * @category interop\n * @since 2.9.0\n */\nvar fromNullableK = function (f) { return function_1.flow(f, exports.fromNullable); };\nexports.fromNullableK = fromNullableK;\n/**\n * This is `chain` + `fromNullable`, useful when working with optional values.\n *\n * @example\n * import { some, none, fromNullable, chainNullableK } from 'fp-ts/Option'\n * import { pipe } from 'fp-ts/function'\n *\n * interface Employee {\n * readonly company?: {\n * readonly address?: {\n * readonly street?: {\n * readonly name?: string\n * }\n * }\n * }\n * }\n *\n * const employee1: Employee = { company: { address: { street: { name: 'high street' } } } }\n *\n * assert.deepStrictEqual(\n * pipe(\n * fromNullable(employee1.company),\n * chainNullableK(company => company.address),\n * chainNullableK(address => address.street),\n * chainNullableK(street => street.name)\n * ),\n * some('high street')\n * )\n *\n * const employee2: Employee = { company: { address: { street: {} } } }\n *\n * assert.deepStrictEqual(\n * pipe(\n * fromNullable(employee2.company),\n * chainNullableK(company => company.address),\n * chainNullableK(address => address.street),\n * chainNullableK(street => street.name)\n * ),\n * none\n * )\n *\n * @category interop\n * @since 2.9.0\n */\nvar chainNullableK = function (f) { return function (ma) {\n return exports.isNone(ma) ? exports.none : exports.fromNullable(f(ma.value));\n}; };\nexports.chainNullableK = chainNullableK;\n/**\n * Extracts the value out of the structure, if it exists. Otherwise returns `null`.\n *\n * @example\n * import { some, none, toNullable } from 'fp-ts/Option'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.strictEqual(\n * pipe(\n * some(1),\n * toNullable\n * ),\n * 1\n * )\n * assert.strictEqual(\n * pipe(\n * none,\n * toNullable\n * ),\n * null\n * )\n *\n * @category interop\n * @since 2.0.0\n */\nexports.toNullable = \n/*#__PURE__*/\nexports.match(function_1.constNull, function_1.identity);\n/**\n * Extracts the value out of the structure, if it exists. Otherwise returns `undefined`.\n *\n * @example\n * import { some, none, toUndefined } from 'fp-ts/Option'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.strictEqual(\n * pipe(\n * some(1),\n * toUndefined\n * ),\n * 1\n * )\n * assert.strictEqual(\n * pipe(\n * none,\n * toUndefined\n * ),\n * undefined\n * )\n *\n * @category interop\n * @since 2.0.0\n */\nexports.toUndefined = \n/*#__PURE__*/\nexports.match(function_1.constUndefined, function_1.identity);\n// -------------------------------------------------------------------------------------\n// utils\n// -------------------------------------------------------------------------------------\n/**\n * Returns `true` if `ma` contains `a`\n *\n * @example\n * import { some, none, elem } from 'fp-ts/Option'\n * import * as N from 'fp-ts/number'\n *\n * assert.strictEqual(elem(N.Eq)(1, some(1)), true)\n * assert.strictEqual(elem(N.Eq)(2, some(1)), false)\n * assert.strictEqual(elem(N.Eq)(1, none), false)\n *\n * @since 2.0.0\n */\nfunction elem(E) {\n return function (a, ma) { return (exports.isNone(ma) ? false : E.equals(a, ma.value)); };\n}\nexports.elem = elem;\n/**\n * Returns `true` if the predicate is satisfied by the wrapped value\n *\n * @example\n * import { some, none, exists } from 'fp-ts/Option'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.strictEqual(\n * pipe(\n * some(1),\n * exists(n => n > 0)\n * ),\n * true\n * )\n * assert.strictEqual(\n * pipe(\n * some(1),\n * exists(n => n > 1)\n * ),\n * false\n * )\n * assert.strictEqual(\n * pipe(\n * none,\n * exists(n => n > 0)\n * ),\n * false\n * )\n *\n * @since 2.0.0\n */\nvar exists = function (predicate) { return function (ma) {\n return exports.isNone(ma) ? false : predicate(ma.value);\n}; };\nexports.exists = exists;\n// -------------------------------------------------------------------------------------\n// do notation\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.9.0\n */\nexports.Do = \n/*#__PURE__*/\nexports.of(_.emptyRecord);\n/**\n * @since 2.8.0\n */\nexports.bindTo = \n/*#__PURE__*/\nFunctor_1.bindTo(exports.Functor);\n/**\n * @since 2.8.0\n */\nexports.bind = \n/*#__PURE__*/\nChain_1.bind(exports.Chain);\n// -------------------------------------------------------------------------------------\n// pipeable sequence S\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.8.0\n */\nexports.apS = \n/*#__PURE__*/\nApply_1.apS(exports.Apply);\n// -------------------------------------------------------------------------------------\n// sequence T\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.11.0\n */\nexports.ApT = \n/*#__PURE__*/\nexports.of(_.emptyReadonlyArray);\n// -------------------------------------------------------------------------------------\n// array utils\n// -------------------------------------------------------------------------------------\n/**\n * Equivalent to `ReadonlyNonEmptyArray#traverseWithIndex(Applicative)`.\n *\n * @since 2.11.0\n */\nvar traverseReadonlyNonEmptyArrayWithIndex = function (f) { return function (as) {\n var o = f(0, _.head(as));\n if (exports.isNone(o)) {\n return exports.none;\n }\n var out = [o.value];\n for (var i = 1; i < as.length; i++) {\n var o_1 = f(i, as[i]);\n if (exports.isNone(o_1)) {\n return exports.none;\n }\n out.push(o_1.value);\n }\n return exports.some(out);\n}; };\nexports.traverseReadonlyNonEmptyArrayWithIndex = traverseReadonlyNonEmptyArrayWithIndex;\n/**\n * Equivalent to `ReadonlyArray#traverseWithIndex(Applicative)`.\n *\n * @since 2.11.0\n */\nvar traverseReadonlyArrayWithIndex = function (f) {\n var g = exports.traverseReadonlyNonEmptyArrayWithIndex(f);\n return function (as) { return (_.isNonEmpty(as) ? g(as) : exports.ApT); };\n};\nexports.traverseReadonlyArrayWithIndex = traverseReadonlyArrayWithIndex;\n/**\n * @since 2.9.0\n */\nexports.traverseArrayWithIndex = exports.traverseReadonlyArrayWithIndex;\n/**\n * @since 2.9.0\n */\nvar traverseArray = function (f) {\n return exports.traverseReadonlyArrayWithIndex(function (_, a) { return f(a); });\n};\nexports.traverseArray = traverseArray;\n/**\n * @since 2.9.0\n */\nexports.sequenceArray = \n/*#__PURE__*/\nexports.traverseArray(function_1.identity);\n// -------------------------------------------------------------------------------------\n// deprecated\n// -------------------------------------------------------------------------------------\n// tslint:disable: deprecation\n/**\n * Use `Refinement` module instead.\n *\n * @since 2.0.0\n * @deprecated\n */\nfunction getRefinement(getOption) {\n return function (a) { return exports.isSome(getOption(a)); };\n}\nexports.getRefinement = getRefinement;\n/**\n * Use [`chainNullableK`](#chainnullablek) instead.\n *\n * @category combinators\n * @since 2.0.0\n * @deprecated\n */\nexports.mapNullable = exports.chainNullableK;\n/**\n * Use small, specific instances instead.\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nexports.option = {\n URI: exports.URI,\n map: _map,\n of: exports.of,\n ap: _ap,\n chain: _chain,\n reduce: _reduce,\n foldMap: _foldMap,\n reduceRight: _reduceRight,\n traverse: _traverse,\n sequence: exports.sequence,\n zero: exports.zero,\n alt: _alt,\n extend: _extend,\n compact: exports.compact,\n separate: exports.separate,\n filter: _filter,\n filterMap: _filterMap,\n partition: _partition,\n partitionMap: _partitionMap,\n wither: _wither,\n wilt: _wilt,\n throwError: exports.throwError\n};\n/**\n * Use [`getApplySemigroup`](./Apply.ts.html#getapplysemigroup) instead.\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nexports.getApplySemigroup = \n/*#__PURE__*/\nApply_1.getApplySemigroup(exports.Apply);\n/**\n * Use [`getApplicativeMonoid`](./Applicative.ts.html#getapplicativemonoid) instead.\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nexports.getApplyMonoid = \n/*#__PURE__*/\nApplicative_1.getApplicativeMonoid(exports.Applicative);\n/**\n * Use\n *\n * ```ts\n * import { first } from 'fp-ts/Semigroup'\n * import { getMonoid } from 'fp-ts/Option'\n *\n * getMonoid(first())\n * ```\n *\n * instead.\n *\n * Monoid returning the left-most non-`None` value\n *\n * | x | y | concat(x, y) |\n * | ------- | ------- | ------------ |\n * | none | none | none |\n * | some(a) | none | some(a) |\n * | none | some(b) | some(b) |\n * | some(a) | some(b) | some(a) |\n *\n * @example\n * import { getFirstMonoid, some, none } from 'fp-ts/Option'\n *\n * const M = getFirstMonoid()\n * assert.deepStrictEqual(M.concat(none, none), none)\n * assert.deepStrictEqual(M.concat(some(1), none), some(1))\n * assert.deepStrictEqual(M.concat(none, some(2)), some(2))\n * assert.deepStrictEqual(M.concat(some(1), some(2)), some(1))\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nvar getFirstMonoid = function () { return exports.getMonoid(Semigroup_1.first()); };\nexports.getFirstMonoid = getFirstMonoid;\n/**\n * Use\n *\n * ```ts\n * import { last } from 'fp-ts/Semigroup'\n * import { getMonoid } from 'fp-ts/Option'\n *\n * getMonoid(last())\n * ```\n *\n * instead.\n *\n * Monoid returning the right-most non-`None` value\n *\n * | x | y | concat(x, y) |\n * | ------- | ------- | ------------ |\n * | none | none | none |\n * | some(a) | none | some(a) |\n * | none | some(b) | some(b) |\n * | some(a) | some(b) | some(b) |\n *\n * @example\n * import { getLastMonoid, some, none } from 'fp-ts/Option'\n *\n * const M = getLastMonoid()\n * assert.deepStrictEqual(M.concat(none, none), none)\n * assert.deepStrictEqual(M.concat(some(1), none), some(1))\n * assert.deepStrictEqual(M.concat(none, some(2)), some(2))\n * assert.deepStrictEqual(M.concat(some(1), some(2)), some(2))\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nvar getLastMonoid = function () { return exports.getMonoid(Semigroup_1.last()); };\nexports.getLastMonoid = getLastMonoid;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ordDate = exports.ordNumber = exports.ordString = exports.ordBoolean = exports.ord = exports.getDualOrd = exports.getTupleOrd = exports.between = exports.clamp = exports.max = exports.min = exports.geq = exports.leq = exports.gt = exports.lt = exports.equals = exports.trivial = exports.Contravariant = exports.getMonoid = exports.getSemigroup = exports.URI = exports.contramap = exports.reverse = exports.tuple = exports.fromCompare = exports.equalsDefault = void 0;\nvar Eq_1 = require(\"./Eq\");\nvar function_1 = require(\"./function\");\n// -------------------------------------------------------------------------------------\n// defaults\n// -------------------------------------------------------------------------------------\n/**\n * @category defaults\n * @since 2.10.0\n */\nvar equalsDefault = function (compare) { return function (first, second) {\n return first === second || compare(first, second) === 0;\n}; };\nexports.equalsDefault = equalsDefault;\n// -------------------------------------------------------------------------------------\n// constructors\n// -------------------------------------------------------------------------------------\n/**\n * @category constructors\n * @since 2.0.0\n */\nvar fromCompare = function (compare) { return ({\n equals: exports.equalsDefault(compare),\n compare: function (first, second) { return (first === second ? 0 : compare(first, second)); }\n}); };\nexports.fromCompare = fromCompare;\n// -------------------------------------------------------------------------------------\n// combinators\n// -------------------------------------------------------------------------------------\n/**\n * Given a tuple of `Ord`s returns an `Ord` for the tuple.\n *\n * @example\n * import { tuple } from 'fp-ts/Ord'\n * import * as B from 'fp-ts/boolean'\n * import * as S from 'fp-ts/string'\n * import * as N from 'fp-ts/number'\n *\n * const O = tuple(S.Ord, N.Ord, B.Ord)\n * assert.strictEqual(O.compare(['a', 1, true], ['b', 2, true]), -1)\n * assert.strictEqual(O.compare(['a', 1, true], ['a', 2, true]), -1)\n * assert.strictEqual(O.compare(['a', 1, true], ['a', 1, false]), 1)\n *\n * @category combinators\n * @since 2.10.0\n */\nvar tuple = function () {\n var ords = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n ords[_i] = arguments[_i];\n }\n return exports.fromCompare(function (first, second) {\n var i = 0;\n for (; i < ords.length - 1; i++) {\n var r = ords[i].compare(first[i], second[i]);\n if (r !== 0) {\n return r;\n }\n }\n return ords[i].compare(first[i], second[i]);\n });\n};\nexports.tuple = tuple;\n/**\n * @category combinators\n * @since 2.10.0\n */\nvar reverse = function (O) { return exports.fromCompare(function (first, second) { return O.compare(second, first); }); };\nexports.reverse = reverse;\n// -------------------------------------------------------------------------------------\n// non-pipeables\n// -------------------------------------------------------------------------------------\n/* istanbul ignore next */\nvar contramap_ = function (fa, f) { return function_1.pipe(fa, exports.contramap(f)); };\n// -------------------------------------------------------------------------------------\n// type class members\n// -------------------------------------------------------------------------------------\n/**\n * @category Contravariant\n * @since 2.0.0\n */\nvar contramap = function (f) { return function (fa) {\n return exports.fromCompare(function (first, second) { return fa.compare(f(first), f(second)); });\n}; };\nexports.contramap = contramap;\n// -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.URI = 'Ord';\n/**\n * @category instances\n * @since 2.0.0\n */\nvar getSemigroup = function () { return ({\n concat: function (first, second) {\n return exports.fromCompare(function (a, b) {\n var ox = first.compare(a, b);\n return ox !== 0 ? ox : second.compare(a, b);\n });\n }\n}); };\nexports.getSemigroup = getSemigroup;\n/**\n * Returns a `Monoid` such that:\n *\n * - its `concat(ord1, ord2)` operation will order first by `ord1`, and then by `ord2`\n * - its `empty` value is an `Ord` that always considers compared elements equal\n *\n * @example\n * import { sort } from 'fp-ts/Array'\n * import { contramap, reverse, getMonoid } from 'fp-ts/Ord'\n * import * as S from 'fp-ts/string'\n * import * as B from 'fp-ts/boolean'\n * import { pipe } from 'fp-ts/function'\n * import { concatAll } from 'fp-ts/Monoid'\n * import * as N from 'fp-ts/number'\n *\n * interface User {\n * readonly id: number\n * readonly name: string\n * readonly age: number\n * readonly rememberMe: boolean\n * }\n *\n * const byName = pipe(\n * S.Ord,\n * contramap((p: User) => p.name)\n * )\n *\n * const byAge = pipe(\n * N.Ord,\n * contramap((p: User) => p.age)\n * )\n *\n * const byRememberMe = pipe(\n * B.Ord,\n * contramap((p: User) => p.rememberMe)\n * )\n *\n * const M = getMonoid()\n *\n * const users: Array = [\n * { id: 1, name: 'Guido', age: 47, rememberMe: false },\n * { id: 2, name: 'Guido', age: 46, rememberMe: true },\n * { id: 3, name: 'Giulio', age: 44, rememberMe: false },\n * { id: 4, name: 'Giulio', age: 44, rememberMe: true }\n * ]\n *\n * // sort by name, then by age, then by `rememberMe`\n * const O1 = concatAll(M)([byName, byAge, byRememberMe])\n * assert.deepStrictEqual(sort(O1)(users), [\n * { id: 3, name: 'Giulio', age: 44, rememberMe: false },\n * { id: 4, name: 'Giulio', age: 44, rememberMe: true },\n * { id: 2, name: 'Guido', age: 46, rememberMe: true },\n * { id: 1, name: 'Guido', age: 47, rememberMe: false }\n * ])\n *\n * // now `rememberMe = true` first, then by name, then by age\n * const O2 = concatAll(M)([reverse(byRememberMe), byName, byAge])\n * assert.deepStrictEqual(sort(O2)(users), [\n * { id: 4, name: 'Giulio', age: 44, rememberMe: true },\n * { id: 2, name: 'Guido', age: 46, rememberMe: true },\n * { id: 3, name: 'Giulio', age: 44, rememberMe: false },\n * { id: 1, name: 'Guido', age: 47, rememberMe: false }\n * ])\n *\n * @category instances\n * @since 2.4.0\n */\nvar getMonoid = function () { return ({\n concat: exports.getSemigroup().concat,\n empty: exports.fromCompare(function () { return 0; })\n}); };\nexports.getMonoid = getMonoid;\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Contravariant = {\n URI: exports.URI,\n contramap: contramap_\n};\n// -------------------------------------------------------------------------------------\n// utils\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.11.0\n */\nexports.trivial = {\n equals: function_1.constTrue,\n compare: \n /*#__PURE__*/\n function_1.constant(0)\n};\n/**\n * @since 2.11.0\n */\nvar equals = function (O) { return function (second) { return function (first) {\n return first === second || O.compare(first, second) === 0;\n}; }; };\nexports.equals = equals;\n// TODO: curry in v3\n/**\n * Test whether one value is _strictly less than_ another\n *\n * @since 2.0.0\n */\nvar lt = function (O) { return function (first, second) { return O.compare(first, second) === -1; }; };\nexports.lt = lt;\n// TODO: curry in v3\n/**\n * Test whether one value is _strictly greater than_ another\n *\n * @since 2.0.0\n */\nvar gt = function (O) { return function (first, second) { return O.compare(first, second) === 1; }; };\nexports.gt = gt;\n// TODO: curry in v3\n/**\n * Test whether one value is _non-strictly less than_ another\n *\n * @since 2.0.0\n */\nvar leq = function (O) { return function (first, second) { return O.compare(first, second) !== 1; }; };\nexports.leq = leq;\n// TODO: curry in v3\n/**\n * Test whether one value is _non-strictly greater than_ another\n *\n * @since 2.0.0\n */\nvar geq = function (O) { return function (first, second) { return O.compare(first, second) !== -1; }; };\nexports.geq = geq;\n// TODO: curry in v3\n/**\n * Take the minimum of two values. If they are considered equal, the first argument is chosen\n *\n * @since 2.0.0\n */\nvar min = function (O) { return function (first, second) {\n return first === second || O.compare(first, second) < 1 ? first : second;\n}; };\nexports.min = min;\n// TODO: curry in v3\n/**\n * Take the maximum of two values. If they are considered equal, the first argument is chosen\n *\n * @since 2.0.0\n */\nvar max = function (O) { return function (first, second) {\n return first === second || O.compare(first, second) > -1 ? first : second;\n}; };\nexports.max = max;\n/**\n * Clamp a value between a minimum and a maximum\n *\n * @since 2.0.0\n */\nvar clamp = function (O) {\n var minO = exports.min(O);\n var maxO = exports.max(O);\n return function (low, hi) { return function (a) { return maxO(minO(a, hi), low); }; };\n};\nexports.clamp = clamp;\n/**\n * Test whether a value is between a minimum and a maximum (inclusive)\n *\n * @since 2.0.0\n */\nvar between = function (O) {\n var ltO = exports.lt(O);\n var gtO = exports.gt(O);\n return function (low, hi) { return function (a) { return (ltO(a, low) || gtO(a, hi) ? false : true); }; };\n};\nexports.between = between;\n// -------------------------------------------------------------------------------------\n// deprecated\n// -------------------------------------------------------------------------------------\n// tslint:disable: deprecation\n/**\n * Use [`tuple`](#tuple) instead.\n *\n * @category combinators\n * @since 2.0.0\n * @deprecated\n */\nexports.getTupleOrd = exports.tuple;\n/**\n * Use [`reverse`](#reverse) instead.\n *\n * @category combinators\n * @since 2.0.0\n * @deprecated\n */\nexports.getDualOrd = exports.reverse;\n/**\n * Use [`Contravariant`](#contravariant) instead.\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nexports.ord = exports.Contravariant;\n// default compare for primitive types\nfunction compare(first, second) {\n return first < second ? -1 : first > second ? 1 : 0;\n}\nvar strictOrd = {\n equals: Eq_1.eqStrict.equals,\n compare: compare\n};\n/**\n * Use [`Ord`](./boolean.ts.html#ord) instead.\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nexports.ordBoolean = strictOrd;\n/**\n * Use [`Ord`](./string.ts.html#ord) instead.\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nexports.ordString = strictOrd;\n/**\n * Use [`Ord`](./number.ts.html#ord) instead.\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nexports.ordNumber = strictOrd;\n/**\n * Use [`Ord`](./Date.ts.html#ord) instead.\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nexports.ordDate = \n/*#__PURE__*/\nfunction_1.pipe(exports.ordNumber, \n/*#__PURE__*/\nexports.contramap(function (date) { return date.valueOf(); }));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.and = exports.or = exports.not = exports.Contravariant = exports.getMonoidAll = exports.getSemigroupAll = exports.getMonoidAny = exports.getSemigroupAny = exports.URI = exports.contramap = void 0;\nvar function_1 = require(\"./function\");\n// -------------------------------------------------------------------------------------\n// type class members\n// -------------------------------------------------------------------------------------\nvar contramap_ = function (predicate, f) { return function_1.pipe(predicate, exports.contramap(f)); };\n/**\n * @category Contravariant\n * @since 2.11.0\n */\nvar contramap = function (f) { return function (predicate) { return function_1.flow(f, predicate); }; };\nexports.contramap = contramap;\n// -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n/**\n * @category instances\n * @since 2.11.0\n */\nexports.URI = 'Predicate';\n/**\n * @category instances\n * @since 2.11.0\n */\nvar getSemigroupAny = function () { return ({\n concat: function (first, second) { return function_1.pipe(first, exports.or(second)); }\n}); };\nexports.getSemigroupAny = getSemigroupAny;\n/**\n * @category instances\n * @since 2.11.0\n */\nvar getMonoidAny = function () { return ({\n concat: exports.getSemigroupAny().concat,\n empty: function_1.constFalse\n}); };\nexports.getMonoidAny = getMonoidAny;\n/**\n * @category instances\n * @since 2.11.0\n */\nvar getSemigroupAll = function () { return ({\n concat: function (first, second) { return function_1.pipe(first, exports.and(second)); }\n}); };\nexports.getSemigroupAll = getSemigroupAll;\n/**\n * @category instances\n * @since 2.11.0\n */\nvar getMonoidAll = function () { return ({\n concat: exports.getSemigroupAll().concat,\n empty: function_1.constTrue\n}); };\nexports.getMonoidAll = getMonoidAll;\n/**\n * @category instances\n * @since 2.11.0\n */\nexports.Contravariant = {\n URI: exports.URI,\n contramap: contramap_\n};\n// -------------------------------------------------------------------------------------\n// utils\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.11.0\n */\nvar not = function (predicate) { return function (a) { return !predicate(a); }; };\nexports.not = not;\n/**\n * @since 2.11.0\n */\nvar or = function (second) { return function (first) { return function (a) { return first(a) || second(a); }; }; };\nexports.or = or;\n/**\n * @since 2.11.0\n */\nvar and = function (second) { return function (first) { return function (a) { return first(a) && second(a); }; }; };\nexports.and = and;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sort = exports.lefts = exports.rights = exports.reverse = exports.modifyAt = exports.deleteAt = exports.updateAt = exports.insertAt = exports.findLastIndex = exports.findLastMap = exports.findLast = exports.findFirstMap = exports.findFirst = exports.findIndex = exports.dropLeftWhile = exports.dropRight = exports.dropLeft = exports.spanLeft = exports.takeLeftWhile = exports.takeRight = exports.takeLeft = exports.init = exports.tail = exports.last = exports.head = exports.lookup = exports.isOutOfBound = exports.size = exports.scanRight = exports.scanLeft = exports.chainWithIndex = exports.foldRight = exports.matchRight = exports.matchRightW = exports.foldLeft = exports.matchLeft = exports.matchLeftW = exports.match = exports.matchW = exports.fromEither = exports.fromOption = exports.fromPredicate = exports.replicate = exports.makeBy = exports.appendW = exports.append = exports.prependW = exports.prepend = exports.isNonEmpty = exports.isEmpty = void 0;\nexports.sequence = exports.traverse = exports.reduceRightWithIndex = exports.reduceRight = exports.reduceWithIndex = exports.foldMap = exports.reduce = exports.foldMapWithIndex = exports.duplicate = exports.extend = exports.filterWithIndex = exports.partitionMapWithIndex = exports.partitionMap = exports.partitionWithIndex = exports.partition = exports.compact = exports.filterMap = exports.filterMapWithIndex = exports.filter = exports.separate = exports.mapWithIndex = exports.map = exports.flatten = exports.chain = exports.ap = exports.alt = exports.altW = exports.zero = exports.of = exports._chainRecBreadthFirst = exports._chainRecDepthFirst = exports.difference = exports.intersection = exports.union = exports.concat = exports.concatW = exports.comprehension = exports.fromOptionK = exports.chunksOf = exports.splitAt = exports.chop = exports.sortBy = exports.uniq = exports.elem = exports.rotate = exports.intersperse = exports.prependAll = exports.unzip = exports.zip = exports.zipWith = void 0;\nexports.toArray = exports.unsafeDeleteAt = exports.unsafeUpdateAt = exports.unsafeInsertAt = exports.fromEitherK = exports.FromEither = exports.filterE = exports.Witherable = exports.ChainRecBreadthFirst = exports.chainRecBreadthFirst = exports.ChainRecDepthFirst = exports.chainRecDepthFirst = exports.TraversableWithIndex = exports.Traversable = exports.FoldableWithIndex = exports.Foldable = exports.FilterableWithIndex = exports.Filterable = exports.Compactable = exports.Extend = exports.Alternative = exports.guard = exports.Zero = exports.Alt = exports.Unfoldable = exports.chainFirst = exports.Monad = exports.Chain = exports.Applicative = exports.apSecond = exports.apFirst = exports.Apply = exports.FunctorWithIndex = exports.Pointed = exports.flap = exports.Functor = exports.getDifferenceMagma = exports.getIntersectionSemigroup = exports.getUnionMonoid = exports.getUnionSemigroup = exports.getOrd = exports.getEq = exports.getMonoid = exports.getSemigroup = exports.getShow = exports.URI = exports.unfold = exports.wilt = exports.wither = exports.traverseWithIndex = void 0;\nexports.readonlyArray = exports.prependToAll = exports.snoc = exports.cons = exports.range = exports.apS = exports.bind = exports.bindTo = exports.Do = exports.exists = exports.some = exports.every = exports.empty = exports.fromArray = void 0;\nvar Apply_1 = require(\"./Apply\");\nvar Chain_1 = require(\"./Chain\");\nvar Eq_1 = require(\"./Eq\");\nvar FromEither_1 = require(\"./FromEither\");\nvar function_1 = require(\"./function\");\nvar Functor_1 = require(\"./Functor\");\nvar _ = __importStar(require(\"./internal\"));\nvar N = __importStar(require(\"./number\"));\nvar Ord_1 = require(\"./Ord\");\nvar RNEA = __importStar(require(\"./ReadonlyNonEmptyArray\"));\nvar Separated_1 = require(\"./Separated\");\nvar Witherable_1 = require(\"./Witherable\");\nvar Zero_1 = require(\"./Zero\");\n// -------------------------------------------------------------------------------------\n// refinements\n// -------------------------------------------------------------------------------------\n/**\n * Test whether a `ReadonlyArray` is empty.\n *\n * @example\n * import { isEmpty } from 'fp-ts/ReadonlyArray'\n *\n * assert.strictEqual(isEmpty([]), true)\n *\n * @category refinements\n * @since 2.5.0\n */\nvar isEmpty = function (as) { return as.length === 0; };\nexports.isEmpty = isEmpty;\n/**\n * Test whether a `ReadonlyArray` is non empty.\n *\n * @category refinements\n * @since 2.5.0\n */\nexports.isNonEmpty = RNEA.isNonEmpty;\n// -------------------------------------------------------------------------------------\n// constructors\n// -------------------------------------------------------------------------------------\n/**\n * Prepend an element to the front of a `ReadonlyArray`, creating a new `ReadonlyNonEmptyArray`.\n *\n * @example\n * import { prepend } from 'fp-ts/ReadonlyArray'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe([2, 3, 4], prepend(1)), [1, 2, 3, 4])\n *\n * @category constructors\n * @since 2.10.0\n */\nexports.prepend = RNEA.prepend;\n/**\n * Less strict version of [`prepend`](#prepend).\n *\n * @category constructors\n * @since 2.11.0\n */\nexports.prependW = RNEA.prependW;\n/**\n * Append an element to the end of a `ReadonlyArray`, creating a new `ReadonlyNonEmptyArray`.\n *\n * @example\n * import { append } from 'fp-ts/ReadonlyArray'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe([1, 2, 3], append(4)), [1, 2, 3, 4])\n *\n * @category constructors\n * @since 2.10.0\n */\nexports.append = RNEA.append;\n/**\n * Less strict version of [`append`](#append).\n *\n * @category constructors\n * @since 2.11.0\n */\nexports.appendW = RNEA.appendW;\n/**\n * Return a `ReadonlyArray` of length `n` with element `i` initialized with `f(i)`.\n *\n * **Note**. `n` is normalized to a non negative integer.\n *\n * @example\n * import { makeBy } from 'fp-ts/ReadonlyArray'\n *\n * const double = (n: number): number => n * 2\n * assert.deepStrictEqual(makeBy(5, double), [0, 2, 4, 6, 8])\n *\n * @category constructors\n * @since 2.5.0\n */\nvar makeBy = function (n, f) { return (n <= 0 ? exports.empty : RNEA.makeBy(f)(n)); };\nexports.makeBy = makeBy;\n/**\n * Create a `ReadonlyArray` containing a value repeated the specified number of times.\n *\n * **Note**. `n` is normalized to a non negative integer.\n *\n * @example\n * import { replicate } from 'fp-ts/ReadonlyArray'\n *\n * assert.deepStrictEqual(replicate(3, 'a'), ['a', 'a', 'a'])\n *\n * @category constructors\n * @since 2.5.0\n */\nvar replicate = function (n, a) { return exports.makeBy(n, function () { return a; }); };\nexports.replicate = replicate;\nfunction fromPredicate(predicate) {\n return function (a) { return (predicate(a) ? [a] : exports.empty); };\n}\nexports.fromPredicate = fromPredicate;\n// -------------------------------------------------------------------------------------\n// natural transformations\n// -------------------------------------------------------------------------------------\n/**\n * @category natural transformations\n * @since 2.11.0\n */\nvar fromOption = function (ma) { return (_.isNone(ma) ? exports.empty : [ma.value]); };\nexports.fromOption = fromOption;\n/**\n * Transforms an `Either` to a `ReadonlyArray`.\n *\n * @category natural transformations\n * @since 2.11.0\n */\nvar fromEither = function (e) { return (_.isLeft(e) ? exports.empty : [e.right]); };\nexports.fromEither = fromEither;\n// -------------------------------------------------------------------------------------\n// destructors\n// -------------------------------------------------------------------------------------\n/**\n * Less strict version of [`match`](#match).\n *\n * @category destructors\n * @since 2.11.0\n */\nvar matchW = function (onEmpty, onNonEmpty) { return function (as) { return (exports.isNonEmpty(as) ? onNonEmpty(as) : onEmpty()); }; };\nexports.matchW = matchW;\n/**\n * @category destructors\n * @since 2.11.0\n */\nexports.match = exports.matchW;\n/**\n * Less strict version of [`matchLeft`](#matchleft).\n *\n * @category destructors\n * @since 2.11.0\n */\nvar matchLeftW = function (onEmpty, onNonEmpty) { return function (as) { return (exports.isNonEmpty(as) ? onNonEmpty(RNEA.head(as), RNEA.tail(as)) : onEmpty()); }; };\nexports.matchLeftW = matchLeftW;\n/**\n * Break a `ReadonlyArray` into its first element and remaining elements.\n *\n * @example\n * import { matchLeft } from 'fp-ts/ReadonlyArray'\n *\n * const len: (as: ReadonlyArray) => number = matchLeft(() => 0, (_, tail) => 1 + len(tail))\n * assert.strictEqual(len([1, 2, 3]), 3)\n *\n * @category destructors\n * @since 2.10.0\n */\nexports.matchLeft = exports.matchLeftW;\n/**\n * Alias of [`matchLeft`](#matchleft).\n *\n * @category destructors\n * @since 2.5.0\n */\nexports.foldLeft = exports.matchLeft;\n/**\n * Less strict version of [`matchRight`](#matchright).\n *\n * @category destructors\n * @since 2.11.0\n */\nvar matchRightW = function (onEmpty, onNonEmpty) { return function (as) { return (exports.isNonEmpty(as) ? onNonEmpty(RNEA.init(as), RNEA.last(as)) : onEmpty()); }; };\nexports.matchRightW = matchRightW;\n/**\n * Break a `ReadonlyArray` into its initial elements and the last element.\n *\n * @category destructors\n * @since 2.10.0\n */\nexports.matchRight = exports.matchRightW;\n/**\n * Alias of [`matchRight`](#matchright).\n *\n * @category destructors\n * @since 2.5.0\n */\nexports.foldRight = exports.matchRight;\n// -------------------------------------------------------------------------------------\n// combinators\n// -------------------------------------------------------------------------------------\n/**\n * @category combinators\n * @since 2.7.0\n */\nvar chainWithIndex = function (f) { return function (as) {\n if (exports.isEmpty(as)) {\n return exports.empty;\n }\n var out = [];\n for (var i = 0; i < as.length; i++) {\n out.push.apply(out, f(i, as[i]));\n }\n return out;\n}; };\nexports.chainWithIndex = chainWithIndex;\n/**\n * Same as `reduce` but it carries over the intermediate steps.\n *\n * @example\n * import { scanLeft } from 'fp-ts/ReadonlyArray'\n *\n * assert.deepStrictEqual(scanLeft(10, (b, a: number) => b - a)([1, 2, 3]), [10, 9, 7, 4])\n *\n * @category combinators\n * @since 2.5.0\n */\nvar scanLeft = function (b, f) { return function (as) {\n var len = as.length;\n var out = new Array(len + 1);\n out[0] = b;\n for (var i = 0; i < len; i++) {\n out[i + 1] = f(out[i], as[i]);\n }\n return out;\n}; };\nexports.scanLeft = scanLeft;\n/**\n * Fold an array from the right, keeping all intermediate results instead of only the final result\n *\n * @example\n * import { scanRight } from 'fp-ts/ReadonlyArray'\n *\n * assert.deepStrictEqual(scanRight(10, (a: number, b) => b - a)([1, 2, 3]), [4, 5, 7, 10])\n *\n * @category combinators\n * @since 2.5.0\n */\nvar scanRight = function (b, f) { return function (as) {\n var len = as.length;\n var out = new Array(len + 1);\n out[len] = b;\n for (var i = len - 1; i >= 0; i--) {\n out[i] = f(as[i], out[i + 1]);\n }\n return out;\n}; };\nexports.scanRight = scanRight;\n/**\n * Calculate the number of elements in a `ReadonlyArray`.\n *\n * @since 2.10.0\n */\nvar size = function (as) { return as.length; };\nexports.size = size;\n/**\n * Test whether an array contains a particular index\n *\n * @since 2.5.0\n */\nexports.isOutOfBound = RNEA.isOutOfBound;\nfunction lookup(i, as) {\n return as === undefined ? function (as) { return lookup(i, as); } : exports.isOutOfBound(i, as) ? _.none : _.some(as[i]);\n}\nexports.lookup = lookup;\n/**\n * Get the first element in an array, or `None` if the array is empty\n *\n * @example\n * import { head } from 'fp-ts/ReadonlyArray'\n * import { some, none } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(head([1, 2, 3]), some(1))\n * assert.deepStrictEqual(head([]), none)\n *\n * @since 2.5.0\n */\nvar head = function (as) { return (exports.isNonEmpty(as) ? _.some(RNEA.head(as)) : _.none); };\nexports.head = head;\n/**\n * Get the last element in an array, or `None` if the array is empty\n *\n * @example\n * import { last } from 'fp-ts/ReadonlyArray'\n * import { some, none } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(last([1, 2, 3]), some(3))\n * assert.deepStrictEqual(last([]), none)\n *\n * @since 2.5.0\n */\nvar last = function (as) { return (exports.isNonEmpty(as) ? _.some(RNEA.last(as)) : _.none); };\nexports.last = last;\n/**\n * Get all but the first element of an array, creating a new array, or `None` if the array is empty\n *\n * @example\n * import { tail } from 'fp-ts/ReadonlyArray'\n * import { some, none } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(tail([1, 2, 3]), some([2, 3]))\n * assert.deepStrictEqual(tail([]), none)\n *\n * @since 2.5.0\n */\nvar tail = function (as) {\n return exports.isNonEmpty(as) ? _.some(RNEA.tail(as)) : _.none;\n};\nexports.tail = tail;\n/**\n * Get all but the last element of an array, creating a new array, or `None` if the array is empty\n *\n * @example\n * import { init } from 'fp-ts/ReadonlyArray'\n * import { some, none } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(init([1, 2, 3]), some([1, 2]))\n * assert.deepStrictEqual(init([]), none)\n *\n * @since 2.5.0\n */\nvar init = function (as) {\n return exports.isNonEmpty(as) ? _.some(RNEA.init(as)) : _.none;\n};\nexports.init = init;\n/**\n * Keep only a max number of elements from the start of an `ReadonlyArray`, creating a new `ReadonlyArray`.\n *\n * **Note**. `n` is normalized to a non negative integer.\n *\n * @example\n * import * as RA from 'fp-ts/ReadonlyArray'\n * import { pipe } from 'fp-ts/function'\n *\n * const input: ReadonlyArray = [1, 2, 3]\n * assert.deepStrictEqual(pipe(input, RA.takeLeft(2)), [1, 2])\n *\n * // out of bounds\n * assert.strictEqual(pipe(input, RA.takeLeft(4)), input)\n * assert.strictEqual(pipe(input, RA.takeLeft(-1)), input)\n *\n * @category combinators\n * @since 2.5.0\n */\nvar takeLeft = function (n) { return function (as) {\n return exports.isOutOfBound(n, as) ? as : n === 0 ? exports.empty : as.slice(0, n);\n}; };\nexports.takeLeft = takeLeft;\n/**\n * Keep only a max number of elements from the end of an `ReadonlyArray`, creating a new `ReadonlyArray`.\n *\n * **Note**. `n` is normalized to a non negative integer.\n *\n * @example\n * import * as RA from 'fp-ts/ReadonlyArray'\n * import { pipe } from 'fp-ts/function'\n *\n * const input: ReadonlyArray = [1, 2, 3]\n * assert.deepStrictEqual(pipe(input, RA.takeRight(2)), [2, 3])\n *\n * // out of bounds\n * assert.strictEqual(pipe(input, RA.takeRight(4)), input)\n * assert.strictEqual(pipe(input, RA.takeRight(-1)), input)\n *\n * @category combinators\n * @since 2.5.0\n */\nvar takeRight = function (n) { return function (as) {\n return exports.isOutOfBound(n, as) ? as : n === 0 ? exports.empty : as.slice(-n);\n}; };\nexports.takeRight = takeRight;\nfunction takeLeftWhile(predicate) {\n return function (as) {\n var out = [];\n for (var _i = 0, as_1 = as; _i < as_1.length; _i++) {\n var a = as_1[_i];\n if (!predicate(a)) {\n break;\n }\n out.push(a);\n }\n var len = out.length;\n return len === as.length ? as : len === 0 ? exports.empty : out;\n };\n}\nexports.takeLeftWhile = takeLeftWhile;\nvar spanLeftIndex = function (as, predicate) {\n var l = as.length;\n var i = 0;\n for (; i < l; i++) {\n if (!predicate(as[i])) {\n break;\n }\n }\n return i;\n};\nfunction spanLeft(predicate) {\n return function (as) {\n var _a = exports.splitAt(spanLeftIndex(as, predicate))(as), init = _a[0], rest = _a[1];\n return { init: init, rest: rest };\n };\n}\nexports.spanLeft = spanLeft;\n/**\n * Drop a max number of elements from the start of an `ReadonlyArray`, creating a new `ReadonlyArray`.\n *\n * **Note**. `n` is normalized to a non negative integer.\n *\n * @example\n * import * as RA from 'fp-ts/ReadonlyArray'\n * import { pipe } from 'fp-ts/function'\n *\n * const input: ReadonlyArray = [1, 2, 3]\n * assert.deepStrictEqual(pipe(input, RA.dropLeft(2)), [3])\n * assert.strictEqual(pipe(input, RA.dropLeft(0)), input)\n * assert.strictEqual(pipe(input, RA.dropLeft(-1)), input)\n *\n * @category combinators\n * @since 2.5.0\n */\nvar dropLeft = function (n) { return function (as) {\n return n <= 0 || exports.isEmpty(as) ? as : n >= as.length ? exports.empty : as.slice(n, as.length);\n}; };\nexports.dropLeft = dropLeft;\n/**\n * Drop a max number of elements from the end of an `ReadonlyArray`, creating a new `ReadonlyArray`.\n *\n * **Note**. `n` is normalized to a non negative integer.\n *\n * @example\n * import * as RA from 'fp-ts/ReadonlyArray'\n * import { pipe } from 'fp-ts/function'\n *\n * const input: ReadonlyArray = [1, 2, 3]\n * assert.deepStrictEqual(pipe(input, RA.dropRight(2)), [1])\n * assert.strictEqual(pipe(input, RA.dropRight(0)), input)\n * assert.strictEqual(pipe(input, RA.dropRight(-1)), input)\n *\n * @category combinators\n * @since 2.5.0\n */\nvar dropRight = function (n) { return function (as) {\n return n <= 0 || exports.isEmpty(as) ? as : n >= as.length ? exports.empty : as.slice(0, as.length - n);\n}; };\nexports.dropRight = dropRight;\nfunction dropLeftWhile(predicate) {\n return function (as) {\n var i = spanLeftIndex(as, predicate);\n return i === 0 ? as : i === as.length ? exports.empty : as.slice(i);\n };\n}\nexports.dropLeftWhile = dropLeftWhile;\n/**\n * Find the first index for which a predicate holds\n *\n * @example\n * import { findIndex } from 'fp-ts/ReadonlyArray'\n * import { some, none } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(findIndex((n: number) => n === 2)([1, 2, 3]), some(1))\n * assert.deepStrictEqual(findIndex((n: number) => n === 2)([]), none)\n *\n * @since 2.5.0\n */\nvar findIndex = function (predicate) { return function (as) {\n for (var i = 0; i < as.length; i++) {\n if (predicate(as[i])) {\n return _.some(i);\n }\n }\n return _.none;\n}; };\nexports.findIndex = findIndex;\nfunction findFirst(predicate) {\n return function (as) {\n for (var i = 0; i < as.length; i++) {\n if (predicate(as[i])) {\n return _.some(as[i]);\n }\n }\n return _.none;\n };\n}\nexports.findFirst = findFirst;\n/**\n * Find the first element returned by an option based selector function\n *\n * @example\n * import { findFirstMap } from 'fp-ts/ReadonlyArray'\n * import { some, none } from 'fp-ts/Option'\n *\n * interface Person {\n * readonly name: string\n * readonly age?: number\n * }\n *\n * const persons: ReadonlyArray = [{ name: 'John' }, { name: 'Mary', age: 45 }, { name: 'Joey', age: 28 }]\n *\n * // returns the name of the first person that has an age\n * assert.deepStrictEqual(findFirstMap((p: Person) => (p.age === undefined ? none : some(p.name)))(persons), some('Mary'))\n *\n * @since 2.5.0\n */\nvar findFirstMap = function (f) { return function (as) {\n for (var i = 0; i < as.length; i++) {\n var out = f(as[i]);\n if (_.isSome(out)) {\n return out;\n }\n }\n return _.none;\n}; };\nexports.findFirstMap = findFirstMap;\nfunction findLast(predicate) {\n return function (as) {\n for (var i = as.length - 1; i >= 0; i--) {\n if (predicate(as[i])) {\n return _.some(as[i]);\n }\n }\n return _.none;\n };\n}\nexports.findLast = findLast;\n/**\n * Find the last element returned by an option based selector function\n *\n * @example\n * import { findLastMap } from 'fp-ts/ReadonlyArray'\n * import { some, none } from 'fp-ts/Option'\n *\n * interface Person {\n * readonly name: string\n * readonly age?: number\n * }\n *\n * const persons: ReadonlyArray = [{ name: 'John' }, { name: 'Mary', age: 45 }, { name: 'Joey', age: 28 }]\n *\n * // returns the name of the last person that has an age\n * assert.deepStrictEqual(findLastMap((p: Person) => (p.age === undefined ? none : some(p.name)))(persons), some('Joey'))\n *\n * @since 2.5.0\n */\nvar findLastMap = function (f) { return function (as) {\n for (var i = as.length - 1; i >= 0; i--) {\n var out = f(as[i]);\n if (_.isSome(out)) {\n return out;\n }\n }\n return _.none;\n}; };\nexports.findLastMap = findLastMap;\n/**\n * Returns the index of the last element of the list which matches the predicate\n *\n * @example\n * import { findLastIndex } from 'fp-ts/ReadonlyArray'\n * import { some, none } from 'fp-ts/Option'\n *\n * interface X {\n * readonly a: number\n * readonly b: number\n * }\n * const xs: ReadonlyArray = [{ a: 1, b: 0 }, { a: 1, b: 1 }]\n * assert.deepStrictEqual(findLastIndex((x: { readonly a: number }) => x.a === 1)(xs), some(1))\n * assert.deepStrictEqual(findLastIndex((x: { readonly a: number }) => x.a === 4)(xs), none)\n *\n *\n * @since 2.5.0\n */\nvar findLastIndex = function (predicate) { return function (as) {\n for (var i = as.length - 1; i >= 0; i--) {\n if (predicate(as[i])) {\n return _.some(i);\n }\n }\n return _.none;\n}; };\nexports.findLastIndex = findLastIndex;\n/**\n * Insert an element at the specified index, creating a new array, or returning `None` if the index is out of bounds\n *\n * @example\n * import { insertAt } from 'fp-ts/ReadonlyArray'\n * import { some } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(insertAt(2, 5)([1, 2, 3, 4]), some([1, 2, 5, 3, 4]))\n *\n * @since 2.5.0\n */\nvar insertAt = function (i, a) { return function (as) {\n return i < 0 || i > as.length ? _.none : _.some(RNEA.unsafeInsertAt(i, a, as));\n}; };\nexports.insertAt = insertAt;\n/**\n * Change the element at the specified index, creating a new array, or returning `None` if the index is out of bounds\n *\n * @example\n * import { updateAt } from 'fp-ts/ReadonlyArray'\n * import { some, none } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(updateAt(1, 1)([1, 2, 3]), some([1, 1, 3]))\n * assert.deepStrictEqual(updateAt(1, 1)([]), none)\n *\n * @since 2.5.0\n */\nvar updateAt = function (i, a) {\n return exports.modifyAt(i, function () { return a; });\n};\nexports.updateAt = updateAt;\n/**\n * Delete the element at the specified index, creating a new array, or returning `None` if the index is out of bounds\n *\n * @example\n * import { deleteAt } from 'fp-ts/ReadonlyArray'\n * import { some, none } from 'fp-ts/Option'\n *\n * assert.deepStrictEqual(deleteAt(0)([1, 2, 3]), some([2, 3]))\n * assert.deepStrictEqual(deleteAt(1)([]), none)\n *\n * @since 2.5.0\n */\nvar deleteAt = function (i) { return function (as) {\n return exports.isOutOfBound(i, as) ? _.none : _.some(exports.unsafeDeleteAt(i, as));\n}; };\nexports.deleteAt = deleteAt;\n/**\n * Apply a function to the element at the specified index, creating a new array, or returning `None` if the index is out\n * of bounds\n *\n * @example\n * import { modifyAt } from 'fp-ts/ReadonlyArray'\n * import { some, none } from 'fp-ts/Option'\n *\n * const double = (x: number): number => x * 2\n * assert.deepStrictEqual(modifyAt(1, double)([1, 2, 3]), some([1, 4, 3]))\n * assert.deepStrictEqual(modifyAt(1, double)([]), none)\n *\n * @since 2.5.0\n */\nvar modifyAt = function (i, f) { return function (as) {\n return exports.isOutOfBound(i, as) ? _.none : _.some(exports.unsafeUpdateAt(i, f(as[i]), as));\n}; };\nexports.modifyAt = modifyAt;\n/**\n * Reverse an array, creating a new array\n *\n * @example\n * import { reverse } from 'fp-ts/ReadonlyArray'\n *\n * assert.deepStrictEqual(reverse([1, 2, 3]), [3, 2, 1])\n *\n * @category combinators\n * @since 2.5.0\n */\nvar reverse = function (as) { return (as.length <= 1 ? as : as.slice().reverse()); };\nexports.reverse = reverse;\n/**\n * Extracts from an array of `Either` all the `Right` elements. All the `Right` elements are extracted in order\n *\n * @example\n * import { rights } from 'fp-ts/ReadonlyArray'\n * import { right, left } from 'fp-ts/Either'\n *\n * assert.deepStrictEqual(rights([right(1), left('foo'), right(2)]), [1, 2])\n *\n * @category combinators\n * @since 2.5.0\n */\nvar rights = function (as) {\n var r = [];\n for (var i = 0; i < as.length; i++) {\n var a = as[i];\n if (a._tag === 'Right') {\n r.push(a.right);\n }\n }\n return r;\n};\nexports.rights = rights;\n/**\n * Extracts from an array of `Either` all the `Left` elements. All the `Left` elements are extracted in order\n *\n * @example\n * import { lefts } from 'fp-ts/ReadonlyArray'\n * import { left, right } from 'fp-ts/Either'\n *\n * assert.deepStrictEqual(lefts([right(1), left('foo'), right(2)]), ['foo'])\n *\n * @category combinators\n * @since 2.5.0\n */\nvar lefts = function (as) {\n var r = [];\n for (var i = 0; i < as.length; i++) {\n var a = as[i];\n if (a._tag === 'Left') {\n r.push(a.left);\n }\n }\n return r;\n};\nexports.lefts = lefts;\n/**\n * Sort the elements of an array in increasing order, creating a new array\n *\n * @example\n * import { sort } from 'fp-ts/ReadonlyArray'\n * import * as N from 'fp-ts/number'\n *\n * assert.deepStrictEqual(sort(N.Ord)([3, 2, 1]), [1, 2, 3])\n *\n * @category combinators\n * @since 2.5.0\n */\nvar sort = function (O) { return function (as) {\n return as.length <= 1 ? as : as.slice().sort(O.compare);\n}; };\nexports.sort = sort;\n// TODO: curry and make data-last in v3\n/**\n * Apply a function to pairs of elements at the same index in two arrays, collecting the results in a new array. If one\n * input array is short, excess elements of the longer array are discarded.\n *\n * @example\n * import { zipWith } from 'fp-ts/ReadonlyArray'\n *\n * assert.deepStrictEqual(zipWith([1, 2, 3], ['a', 'b', 'c', 'd'], (n, s) => s + n), ['a1', 'b2', 'c3'])\n *\n * @category combinators\n * @since 2.5.0\n */\nvar zipWith = function (fa, fb, f) {\n var fc = [];\n var len = Math.min(fa.length, fb.length);\n for (var i = 0; i < len; i++) {\n fc[i] = f(fa[i], fb[i]);\n }\n return fc;\n};\nexports.zipWith = zipWith;\nfunction zip(as, bs) {\n if (bs === undefined) {\n return function (bs) { return zip(bs, as); };\n }\n return exports.zipWith(as, bs, function (a, b) { return [a, b]; });\n}\nexports.zip = zip;\n/**\n * The function is reverse of `zip`. Takes an array of pairs and return two corresponding arrays\n *\n * @example\n * import { unzip } from 'fp-ts/ReadonlyArray'\n *\n * assert.deepStrictEqual(unzip([[1, 'a'], [2, 'b'], [3, 'c']]), [[1, 2, 3], ['a', 'b', 'c']])\n *\n * @category combinators\n * @since 2.5.0\n */\nvar unzip = function (as) {\n var fa = [];\n var fb = [];\n for (var i = 0; i < as.length; i++) {\n fa[i] = as[i][0];\n fb[i] = as[i][1];\n }\n return [fa, fb];\n};\nexports.unzip = unzip;\n/**\n * Prepend an element to every member of an array\n *\n * @example\n * import { prependAll } from 'fp-ts/ReadonlyArray'\n *\n * assert.deepStrictEqual(prependAll(9)([1, 2, 3, 4]), [9, 1, 9, 2, 9, 3, 9, 4])\n *\n * @category combinators\n * @since 2.10.0\n */\nvar prependAll = function (middle) {\n var f = RNEA.prependAll(middle);\n return function (as) { return (exports.isNonEmpty(as) ? f(as) : as); };\n};\nexports.prependAll = prependAll;\n/**\n * Places an element in between members of an array\n *\n * @example\n * import { intersperse } from 'fp-ts/ReadonlyArray'\n *\n * assert.deepStrictEqual(intersperse(9)([1, 2, 3, 4]), [1, 9, 2, 9, 3, 9, 4])\n *\n * @category combinators\n * @since 2.9.0\n */\nvar intersperse = function (middle) {\n var f = RNEA.intersperse(middle);\n return function (as) { return (exports.isNonEmpty(as) ? f(as) : as); };\n};\nexports.intersperse = intersperse;\n/**\n * Rotate a `ReadonlyArray` by `n` steps.\n *\n * @example\n * import { rotate } from 'fp-ts/ReadonlyArray'\n *\n * assert.deepStrictEqual(rotate(2)([1, 2, 3, 4, 5]), [4, 5, 1, 2, 3])\n *\n * @category combinators\n * @since 2.5.0\n */\nvar rotate = function (n) {\n var f = RNEA.rotate(n);\n return function (as) { return (exports.isNonEmpty(as) ? f(as) : as); };\n};\nexports.rotate = rotate;\nfunction elem(E) {\n return function (a, as) {\n if (as === undefined) {\n var elemE_1 = elem(E);\n return function (as) { return elemE_1(a, as); };\n }\n var predicate = function (element) { return E.equals(element, a); };\n var i = 0;\n for (; i < as.length; i++) {\n if (predicate(as[i])) {\n return true;\n }\n }\n return false;\n };\n}\nexports.elem = elem;\n/**\n * Remove duplicates from an array, keeping the first occurrence of an element.\n *\n * @example\n * import { uniq } from 'fp-ts/ReadonlyArray'\n * import * as N from 'fp-ts/number'\n *\n * assert.deepStrictEqual(uniq(N.Eq)([1, 2, 1]), [1, 2])\n *\n * @category combinators\n * @since 2.5.0\n */\nvar uniq = function (E) {\n var f = RNEA.uniq(E);\n return function (as) { return (exports.isNonEmpty(as) ? f(as) : as); };\n};\nexports.uniq = uniq;\n/**\n * Sort the elements of an array in increasing order, where elements are compared using first `ords[0]`, then `ords[1]`,\n * etc...\n *\n * @example\n * import { sortBy } from 'fp-ts/ReadonlyArray'\n * import { contramap } from 'fp-ts/Ord'\n * import * as S from 'fp-ts/string'\n * import * as N from 'fp-ts/number'\n * import { pipe } from 'fp-ts/function'\n *\n * interface Person {\n * readonly name: string\n * readonly age: number\n * }\n * const byName = pipe(S.Ord, contramap((p: Person) => p.name))\n * const byAge = pipe(N.Ord, contramap((p: Person) => p.age))\n *\n * const sortByNameByAge = sortBy([byName, byAge])\n *\n * const persons = [{ name: 'a', age: 1 }, { name: 'b', age: 3 }, { name: 'c', age: 2 }, { name: 'b', age: 2 }]\n * assert.deepStrictEqual(sortByNameByAge(persons), [\n * { name: 'a', age: 1 },\n * { name: 'b', age: 2 },\n * { name: 'b', age: 3 },\n * { name: 'c', age: 2 }\n * ])\n *\n * @category combinators\n * @since 2.5.0\n */\nvar sortBy = function (ords) {\n var f = RNEA.sortBy(ords);\n return function (as) { return (exports.isNonEmpty(as) ? f(as) : as); };\n};\nexports.sortBy = sortBy;\n/**\n * A useful recursion pattern for processing a `ReadonlyArray` to produce a new `ReadonlyArray`, often used for \"chopping\" up the input\n * `ReadonlyArray`. Typically `chop` is called with some function that will consume an initial prefix of the `ReadonlyArray` and produce a\n * value and the tail of the `ReadonlyArray`.\n *\n * @example\n * import { Eq } from 'fp-ts/Eq'\n * import * as RA from 'fp-ts/ReadonlyArray'\n * import * as N from 'fp-ts/number'\n * import { pipe } from 'fp-ts/function'\n *\n * const group = (S: Eq): ((as: ReadonlyArray) => ReadonlyArray>) => {\n * return RA.chop(as => {\n * const { init, rest } = pipe(as, RA.spanLeft((a: A) => S.equals(a, as[0])))\n * return [init, rest]\n * })\n * }\n * assert.deepStrictEqual(group(N.Eq)([1, 1, 2, 3, 3, 4]), [[1, 1], [2], [3, 3], [4]])\n *\n * @category combinators\n * @since 2.5.0\n */\nvar chop = function (f) {\n var g = RNEA.chop(f);\n return function (as) { return (exports.isNonEmpty(as) ? g(as) : exports.empty); };\n};\nexports.chop = chop;\n/**\n * Splits a `ReadonlyArray` into two pieces, the first piece has max `n` elements.\n *\n * @example\n * import { splitAt } from 'fp-ts/ReadonlyArray'\n *\n * assert.deepStrictEqual(splitAt(2)([1, 2, 3, 4, 5]), [[1, 2], [3, 4, 5]])\n *\n * @category combinators\n * @since 2.5.0\n */\nvar splitAt = function (n) { return function (as) {\n return n >= 1 && exports.isNonEmpty(as) ? RNEA.splitAt(n)(as) : exports.isEmpty(as) ? [as, exports.empty] : [exports.empty, as];\n}; };\nexports.splitAt = splitAt;\n/**\n * Splits a `ReadonlyArray` into length-`n` pieces. The last piece will be shorter if `n` does not evenly divide the length of\n * the `ReadonlyArray`. Note that `chunksOf(n)([])` is `[]`, not `[[]]`. This is intentional, and is consistent with a recursive\n * definition of `chunksOf`; it satisfies the property that:\n *\n * ```ts\n * chunksOf(n)(xs).concat(chunksOf(n)(ys)) == chunksOf(n)(xs.concat(ys)))\n * ```\n *\n * whenever `n` evenly divides the length of `as`.\n *\n * @example\n * import { chunksOf } from 'fp-ts/ReadonlyArray'\n *\n * assert.deepStrictEqual(chunksOf(2)([1, 2, 3, 4, 5]), [[1, 2], [3, 4], [5]])\n *\n * @category combinators\n * @since 2.5.0\n */\nvar chunksOf = function (n) {\n var f = RNEA.chunksOf(n);\n return function (as) { return (exports.isNonEmpty(as) ? f(as) : exports.empty); };\n};\nexports.chunksOf = chunksOf;\n/**\n * @category combinators\n * @since 2.11.0\n */\nvar fromOptionK = function (f) { return function () {\n var a = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n a[_i] = arguments[_i];\n }\n return exports.fromOption(f.apply(void 0, a));\n}; };\nexports.fromOptionK = fromOptionK;\nfunction comprehension(input, f, g) {\n if (g === void 0) { g = function () { return true; }; }\n var go = function (scope, input) {\n return exports.isNonEmpty(input)\n ? function_1.pipe(RNEA.head(input), exports.chain(function (x) { return go(function_1.pipe(scope, exports.append(x)), RNEA.tail(input)); }))\n : g.apply(void 0, scope) ? [f.apply(void 0, scope)]\n : exports.empty;\n };\n return go(exports.empty, input);\n}\nexports.comprehension = comprehension;\n/**\n * @category combinators\n * @since 2.11.0\n */\nvar concatW = function (second) { return function (first) {\n return exports.isEmpty(first) ? second : exports.isEmpty(second) ? first : first.concat(second);\n}; };\nexports.concatW = concatW;\n/**\n * @category combinators\n * @since 2.11.0\n */\nexports.concat = exports.concatW;\nfunction union(E) {\n var unionE = RNEA.union(E);\n return function (first, second) {\n if (second === undefined) {\n var unionE_1 = union(E);\n return function (second) { return unionE_1(second, first); };\n }\n return exports.isNonEmpty(first) && exports.isNonEmpty(second) ? unionE(second)(first) : exports.isNonEmpty(first) ? first : second;\n };\n}\nexports.union = union;\nfunction intersection(E) {\n var elemE = elem(E);\n return function (xs, ys) {\n if (ys === undefined) {\n var intersectionE_1 = intersection(E);\n return function (ys) { return intersectionE_1(ys, xs); };\n }\n return xs.filter(function (a) { return elemE(a, ys); });\n };\n}\nexports.intersection = intersection;\nfunction difference(E) {\n var elemE = elem(E);\n return function (xs, ys) {\n if (ys === undefined) {\n var differenceE_1 = difference(E);\n return function (ys) { return differenceE_1(ys, xs); };\n }\n return xs.filter(function (a) { return !elemE(a, ys); });\n };\n}\nexports.difference = difference;\n// -------------------------------------------------------------------------------------\n// non-pipeables\n// -------------------------------------------------------------------------------------\nvar _map = function (fa, f) { return function_1.pipe(fa, exports.map(f)); };\nvar _mapWithIndex = function (fa, f) { return function_1.pipe(fa, exports.mapWithIndex(f)); };\nvar _ap = function (fab, fa) { return function_1.pipe(fab, exports.ap(fa)); };\nvar _chain = function (ma, f) { return function_1.pipe(ma, exports.chain(f)); };\nvar _filter = function (fa, predicate) {\n return function_1.pipe(fa, exports.filter(predicate));\n};\nvar _filterMap = function (fa, f) { return function_1.pipe(fa, exports.filterMap(f)); };\nvar _partition = function (fa, predicate) {\n return function_1.pipe(fa, exports.partition(predicate));\n};\nvar _partitionMap = function (fa, f) { return function_1.pipe(fa, exports.partitionMap(f)); };\nvar _partitionWithIndex = function (fa, predicateWithIndex) { return function_1.pipe(fa, exports.partitionWithIndex(predicateWithIndex)); };\nvar _partitionMapWithIndex = function (fa, f) { return function_1.pipe(fa, exports.partitionMapWithIndex(f)); };\nvar _alt = function (fa, that) { return function_1.pipe(fa, exports.alt(that)); };\nvar _reduce = function (fa, b, f) { return function_1.pipe(fa, exports.reduce(b, f)); };\nvar _foldMap = function (M) {\n var foldMapM = exports.foldMap(M);\n return function (fa, f) { return function_1.pipe(fa, foldMapM(f)); };\n};\nvar _reduceRight = function (fa, b, f) { return function_1.pipe(fa, exports.reduceRight(b, f)); };\nvar _reduceWithIndex = function (fa, b, f) {\n return function_1.pipe(fa, exports.reduceWithIndex(b, f));\n};\nvar _foldMapWithIndex = function (M) {\n var foldMapWithIndexM = exports.foldMapWithIndex(M);\n return function (fa, f) { return function_1.pipe(fa, foldMapWithIndexM(f)); };\n};\nvar _reduceRightWithIndex = function (fa, b, f) {\n return function_1.pipe(fa, exports.reduceRightWithIndex(b, f));\n};\nvar _filterMapWithIndex = function (fa, f) { return function_1.pipe(fa, exports.filterMapWithIndex(f)); };\nvar _filterWithIndex = function (fa, predicateWithIndex) { return function_1.pipe(fa, exports.filterWithIndex(predicateWithIndex)); };\nvar _extend = function (fa, f) { return function_1.pipe(fa, exports.extend(f)); };\nvar _traverse = function (F) {\n var traverseF = exports.traverse(F);\n return function (ta, f) { return function_1.pipe(ta, traverseF(f)); };\n};\n/* istanbul ignore next */\nvar _traverseWithIndex = function (F) {\n var traverseWithIndexF = exports.traverseWithIndex(F);\n return function (ta, f) { return function_1.pipe(ta, traverseWithIndexF(f)); };\n};\n/** @internal */\nvar _chainRecDepthFirst = function (a, f) { return function_1.pipe(a, exports.chainRecDepthFirst(f)); };\nexports._chainRecDepthFirst = _chainRecDepthFirst;\n/** @internal */\nvar _chainRecBreadthFirst = function (a, f) { return function_1.pipe(a, exports.chainRecBreadthFirst(f)); };\nexports._chainRecBreadthFirst = _chainRecBreadthFirst;\n// -------------------------------------------------------------------------------------\n// type class members\n// -------------------------------------------------------------------------------------\n/**\n * @category Pointed\n * @since 2.5.0\n */\nexports.of = RNEA.of;\n/**\n * @category Zero\n * @since 2.7.0\n */\nvar zero = function () { return exports.empty; };\nexports.zero = zero;\n/**\n * Less strict version of [`alt`](#alt).\n *\n * @category Alt\n * @since 2.9.0\n */\nvar altW = function (that) { return function (fa) {\n return fa.concat(that());\n}; };\nexports.altW = altW;\n/**\n * Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to\n * types of kind `* -> *`.\n *\n * @category Alt\n * @since 2.5.0\n */\nexports.alt = exports.altW;\n/**\n * Apply a function to an argument under a type constructor.\n *\n * @category Apply\n * @since 2.5.0\n */\nvar ap = function (fa) {\n return exports.chain(function (f) { return function_1.pipe(fa, exports.map(f)); });\n};\nexports.ap = ap;\n/**\n * Composes computations in sequence, using the return value of one computation to determine the next computation.\n *\n * @category Monad\n * @since 2.5.0\n */\nvar chain = function (f) { return function (ma) {\n return function_1.pipe(ma, exports.chainWithIndex(function (_, a) { return f(a); }));\n}; };\nexports.chain = chain;\n/**\n * Derivable from `Chain`.\n *\n * @category combinators\n * @since 2.5.0\n */\nexports.flatten = \n/*#__PURE__*/\nexports.chain(function_1.identity);\n/**\n * `map` can be used to turn functions `(a: A) => B` into functions `(fa: F) => F` whose argument and return types\n * use the type constructor `F` to represent some computational context.\n *\n * @category Functor\n * @since 2.5.0\n */\nvar map = function (f) { return function (fa) {\n return fa.map(function (a) { return f(a); });\n}; };\nexports.map = map;\n/**\n * @category FunctorWithIndex\n * @since 2.5.0\n */\nvar mapWithIndex = function (f) { return function (fa) { return fa.map(function (a, i) { return f(i, a); }); }; };\nexports.mapWithIndex = mapWithIndex;\n/**\n * @category Compactable\n * @since 2.5.0\n */\nvar separate = function (fa) {\n var left = [];\n var right = [];\n for (var _i = 0, fa_1 = fa; _i < fa_1.length; _i++) {\n var e = fa_1[_i];\n if (e._tag === 'Left') {\n left.push(e.left);\n }\n else {\n right.push(e.right);\n }\n }\n return Separated_1.separated(left, right);\n};\nexports.separate = separate;\n/**\n * @category Filterable\n * @since 2.5.0\n */\nvar filter = function (predicate) { return function (as) { return as.filter(predicate); }; };\nexports.filter = filter;\n/**\n * @category FilterableWithIndex\n * @since 2.5.0\n */\nvar filterMapWithIndex = function (f) { return function (fa) {\n var out = [];\n for (var i = 0; i < fa.length; i++) {\n var optionB = f(i, fa[i]);\n if (_.isSome(optionB)) {\n out.push(optionB.value);\n }\n }\n return out;\n}; };\nexports.filterMapWithIndex = filterMapWithIndex;\n/**\n * @category Filterable\n * @since 2.5.0\n */\nvar filterMap = function (f) {\n return exports.filterMapWithIndex(function (_, a) { return f(a); });\n};\nexports.filterMap = filterMap;\n/**\n * @category Compactable\n * @since 2.5.0\n */\nexports.compact = \n/*#__PURE__*/\nexports.filterMap(function_1.identity);\n/**\n * @category Filterable\n * @since 2.5.0\n */\nvar partition = function (predicate) {\n return exports.partitionWithIndex(function (_, a) { return predicate(a); });\n};\nexports.partition = partition;\n/**\n * @category FilterableWithIndex\n * @since 2.5.0\n */\nvar partitionWithIndex = function (predicateWithIndex) { return function (as) {\n var left = [];\n var right = [];\n for (var i = 0; i < as.length; i++) {\n var a = as[i];\n if (predicateWithIndex(i, a)) {\n right.push(a);\n }\n else {\n left.push(a);\n }\n }\n return Separated_1.separated(left, right);\n}; };\nexports.partitionWithIndex = partitionWithIndex;\n/**\n * @category Filterable\n * @since 2.5.0\n */\nvar partitionMap = function (f) {\n return exports.partitionMapWithIndex(function (_, a) { return f(a); });\n};\nexports.partitionMap = partitionMap;\n/**\n * @category FilterableWithIndex\n * @since 2.5.0\n */\nvar partitionMapWithIndex = function (f) { return function (fa) {\n var left = [];\n var right = [];\n for (var i = 0; i < fa.length; i++) {\n var e = f(i, fa[i]);\n if (e._tag === 'Left') {\n left.push(e.left);\n }\n else {\n right.push(e.right);\n }\n }\n return Separated_1.separated(left, right);\n}; };\nexports.partitionMapWithIndex = partitionMapWithIndex;\n/**\n * @category FilterableWithIndex\n * @since 2.5.0\n */\nvar filterWithIndex = function (predicateWithIndex) { return function (as) {\n return as.filter(function (a, i) { return predicateWithIndex(i, a); });\n}; };\nexports.filterWithIndex = filterWithIndex;\n/**\n * @category Extend\n * @since 2.5.0\n */\nvar extend = function (f) { return function (wa) { return wa.map(function (_, i) { return f(wa.slice(i)); }); }; };\nexports.extend = extend;\n/**\n * Derivable from `Extend`.\n *\n * @category combinators\n * @since 2.5.0\n */\nexports.duplicate = \n/*#__PURE__*/\nexports.extend(function_1.identity);\n/**\n * @category FoldableWithIndex\n * @since 2.5.0\n */\nvar foldMapWithIndex = function (M) { return function (f) { return function (fa) {\n return fa.reduce(function (b, a, i) { return M.concat(b, f(i, a)); }, M.empty);\n}; }; };\nexports.foldMapWithIndex = foldMapWithIndex;\n/**\n * @category Foldable\n * @since 2.5.0\n */\nvar reduce = function (b, f) {\n return exports.reduceWithIndex(b, function (_, b, a) { return f(b, a); });\n};\nexports.reduce = reduce;\n/**\n * @category Foldable\n * @since 2.5.0\n */\nvar foldMap = function (M) {\n var foldMapWithIndexM = exports.foldMapWithIndex(M);\n return function (f) { return foldMapWithIndexM(function (_, a) { return f(a); }); };\n};\nexports.foldMap = foldMap;\n/**\n * @category FoldableWithIndex\n * @since 2.5.0\n */\nvar reduceWithIndex = function (b, f) { return function (fa) {\n var len = fa.length;\n var out = b;\n for (var i = 0; i < len; i++) {\n out = f(i, out, fa[i]);\n }\n return out;\n}; };\nexports.reduceWithIndex = reduceWithIndex;\n/**\n * @category Foldable\n * @since 2.5.0\n */\nvar reduceRight = function (b, f) {\n return exports.reduceRightWithIndex(b, function (_, a, b) { return f(a, b); });\n};\nexports.reduceRight = reduceRight;\n/**\n * @category FoldableWithIndex\n * @since 2.5.0\n */\nvar reduceRightWithIndex = function (b, f) { return function (fa) { return fa.reduceRight(function (b, a, i) { return f(i, a, b); }, b); }; };\nexports.reduceRightWithIndex = reduceRightWithIndex;\n/**\n * @category Traversable\n * @since 2.6.3\n */\nvar traverse = function (F) {\n var traverseWithIndexF = exports.traverseWithIndex(F);\n return function (f) { return traverseWithIndexF(function (_, a) { return f(a); }); };\n};\nexports.traverse = traverse;\n/**\n * @category Traversable\n * @since 2.6.3\n */\nvar sequence = function (F) { return function (ta) {\n return _reduce(ta, F.of(exports.zero()), function (fas, fa) {\n return F.ap(F.map(fas, function (as) { return function (a) { return function_1.pipe(as, exports.append(a)); }; }), fa);\n });\n}; };\nexports.sequence = sequence;\n/**\n * @category TraversableWithIndex\n * @since 2.6.3\n */\nvar traverseWithIndex = function (F) { return function (f) {\n return exports.reduceWithIndex(F.of(exports.zero()), function (i, fbs, a) {\n return F.ap(F.map(fbs, function (bs) { return function (b) { return function_1.pipe(bs, exports.append(b)); }; }), f(i, a));\n });\n}; };\nexports.traverseWithIndex = traverseWithIndex;\n/**\n * @category Witherable\n * @since 2.6.5\n */\nvar wither = function (F) {\n var _witherF = _wither(F);\n return function (f) { return function (fa) { return _witherF(fa, f); }; };\n};\nexports.wither = wither;\n/**\n * @category Witherable\n * @since 2.6.5\n */\nvar wilt = function (F) {\n var _wiltF = _wilt(F);\n return function (f) { return function (fa) { return _wiltF(fa, f); }; };\n};\nexports.wilt = wilt;\n/**\n * @category Unfoldable\n * @since 2.6.6\n */\nvar unfold = function (b, f) {\n var out = [];\n var bb = b;\n while (true) {\n var mt = f(bb);\n if (_.isSome(mt)) {\n var _a = mt.value, a = _a[0], b_1 = _a[1];\n out.push(a);\n bb = b_1;\n }\n else {\n break;\n }\n }\n return out;\n};\nexports.unfold = unfold;\n// -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n/**\n * @category instances\n * @since 2.5.0\n */\nexports.URI = 'ReadonlyArray';\n/**\n * @category instances\n * @since 2.5.0\n */\nvar getShow = function (S) { return ({\n show: function (as) { return \"[\" + as.map(S.show).join(', ') + \"]\"; }\n}); };\nexports.getShow = getShow;\n/**\n * @category instances\n * @since 2.5.0\n */\nvar getSemigroup = function () { return ({\n concat: function (first, second) { return (exports.isEmpty(first) ? second : exports.isEmpty(second) ? first : first.concat(second)); }\n}); };\nexports.getSemigroup = getSemigroup;\n/**\n * Returns a `Monoid` for `ReadonlyArray`.\n *\n * @example\n * import { getMonoid } from 'fp-ts/ReadonlyArray'\n *\n * const M = getMonoid()\n * assert.deepStrictEqual(M.concat([1, 2], [3, 4]), [1, 2, 3, 4])\n *\n * @category instances\n * @since 2.5.0\n */\nvar getMonoid = function () { return ({\n concat: exports.getSemigroup().concat,\n empty: exports.empty\n}); };\nexports.getMonoid = getMonoid;\n/**\n * Derives an `Eq` over the `ReadonlyArray` of a given element type from the `Eq` of that type. The derived `Eq` defines two\n * arrays as equal if all elements of both arrays are compared equal pairwise with the given `E`. In case of arrays of\n * different lengths, the result is non equality.\n *\n * @example\n * import * as S from 'fp-ts/string'\n * import { getEq } from 'fp-ts/ReadonlyArray'\n *\n * const E = getEq(S.Eq)\n * assert.strictEqual(E.equals(['a', 'b'], ['a', 'b']), true)\n * assert.strictEqual(E.equals(['a'], []), false)\n *\n * @category instances\n * @since 2.5.0\n */\nvar getEq = function (E) {\n return Eq_1.fromEquals(function (xs, ys) { return xs.length === ys.length && xs.every(function (x, i) { return E.equals(x, ys[i]); }); });\n};\nexports.getEq = getEq;\n/**\n * Derives an `Ord` over the `ReadonlyArray` of a given element type from the `Ord` of that type. The ordering between two such\n * arrays is equal to: the first non equal comparison of each arrays elements taken pairwise in increasing order, in\n * case of equality over all the pairwise elements; the longest array is considered the greatest, if both arrays have\n * the same length, the result is equality.\n *\n * @example\n * import { getOrd } from 'fp-ts/ReadonlyArray'\n * import * as S from 'fp-ts/string'\n *\n * const O = getOrd(S.Ord)\n * assert.strictEqual(O.compare(['b'], ['a']), 1)\n * assert.strictEqual(O.compare(['a'], ['a']), 0)\n * assert.strictEqual(O.compare(['a'], ['b']), -1)\n *\n *\n * @category instances\n * @since 2.5.0\n */\nvar getOrd = function (O) {\n return Ord_1.fromCompare(function (a, b) {\n var aLen = a.length;\n var bLen = b.length;\n var len = Math.min(aLen, bLen);\n for (var i = 0; i < len; i++) {\n var ordering = O.compare(a[i], b[i]);\n if (ordering !== 0) {\n return ordering;\n }\n }\n return N.Ord.compare(aLen, bLen);\n });\n};\nexports.getOrd = getOrd;\n/**\n * @category instances\n * @since 2.11.0\n */\nvar getUnionSemigroup = function (E) {\n var unionE = union(E);\n return {\n concat: function (first, second) { return unionE(second)(first); }\n };\n};\nexports.getUnionSemigroup = getUnionSemigroup;\n/**\n * @category instances\n * @since 2.11.0\n */\nvar getUnionMonoid = function (E) { return ({\n concat: exports.getUnionSemigroup(E).concat,\n empty: exports.empty\n}); };\nexports.getUnionMonoid = getUnionMonoid;\n/**\n * @category instances\n * @since 2.11.0\n */\nvar getIntersectionSemigroup = function (E) {\n var intersectionE = intersection(E);\n return {\n concat: function (first, second) { return intersectionE(second)(first); }\n };\n};\nexports.getIntersectionSemigroup = getIntersectionSemigroup;\n/**\n * @category instances\n * @since 2.11.0\n */\nvar getDifferenceMagma = function (E) {\n var differenceE = difference(E);\n return {\n concat: function (first, second) { return differenceE(second)(first); }\n };\n};\nexports.getDifferenceMagma = getDifferenceMagma;\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Functor = {\n URI: exports.URI,\n map: _map\n};\n/**\n * Derivable from `Functor`.\n *\n * @category combinators\n * @since 2.10.0\n */\nexports.flap = \n/*#__PURE__*/\nFunctor_1.flap(exports.Functor);\n/**\n * @category instances\n * @since 2.10.0\n */\nexports.Pointed = {\n URI: exports.URI,\n of: exports.of\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.FunctorWithIndex = {\n URI: exports.URI,\n map: _map,\n mapWithIndex: _mapWithIndex\n};\n/**\n * @category instances\n * @since 2.10.0\n */\nexports.Apply = {\n URI: exports.URI,\n map: _map,\n ap: _ap\n};\n/**\n * Combine two effectful actions, keeping only the result of the first.\n *\n * Derivable from `Apply`.\n *\n * @category combinators\n * @since 2.5.0\n */\nexports.apFirst = \n/*#__PURE__*/\nApply_1.apFirst(exports.Apply);\n/**\n * Combine two effectful actions, keeping only the result of the second.\n *\n * Derivable from `Apply`.\n *\n * @category combinators\n * @since 2.5.0\n */\nexports.apSecond = \n/*#__PURE__*/\nApply_1.apSecond(exports.Apply);\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Applicative = {\n URI: exports.URI,\n map: _map,\n ap: _ap,\n of: exports.of\n};\n/**\n * @category instances\n * @since 2.10.0\n */\nexports.Chain = {\n URI: exports.URI,\n map: _map,\n ap: _ap,\n chain: _chain\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Monad = {\n URI: exports.URI,\n map: _map,\n ap: _ap,\n of: exports.of,\n chain: _chain\n};\n/**\n * Composes computations in sequence, using the return value of one computation to determine the next computation and\n * keeping only the result of the first.\n *\n * Derivable from `Chain`.\n *\n * @category combinators\n * @since 2.5.0\n */\nexports.chainFirst = \n/*#__PURE__*/\nChain_1.chainFirst(exports.Chain);\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Unfoldable = {\n URI: exports.URI,\n unfold: exports.unfold\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Alt = {\n URI: exports.URI,\n map: _map,\n alt: _alt\n};\n/**\n * @category instances\n * @since 2.11.0\n */\nexports.Zero = {\n URI: exports.URI,\n zero: exports.zero\n};\n/**\n * @category constructors\n * @since 2.11.0\n */\nexports.guard = \n/*#__PURE__*/\nZero_1.guard(exports.Zero, exports.Pointed);\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Alternative = {\n URI: exports.URI,\n map: _map,\n ap: _ap,\n of: exports.of,\n alt: _alt,\n zero: exports.zero\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Extend = {\n URI: exports.URI,\n map: _map,\n extend: _extend\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Compactable = {\n URI: exports.URI,\n compact: exports.compact,\n separate: exports.separate\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Filterable = {\n URI: exports.URI,\n map: _map,\n compact: exports.compact,\n separate: exports.separate,\n filter: _filter,\n filterMap: _filterMap,\n partition: _partition,\n partitionMap: _partitionMap\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.FilterableWithIndex = {\n URI: exports.URI,\n map: _map,\n mapWithIndex: _mapWithIndex,\n compact: exports.compact,\n separate: exports.separate,\n filter: _filter,\n filterMap: _filterMap,\n partition: _partition,\n partitionMap: _partitionMap,\n partitionMapWithIndex: _partitionMapWithIndex,\n partitionWithIndex: _partitionWithIndex,\n filterMapWithIndex: _filterMapWithIndex,\n filterWithIndex: _filterWithIndex\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Foldable = {\n URI: exports.URI,\n reduce: _reduce,\n foldMap: _foldMap,\n reduceRight: _reduceRight\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.FoldableWithIndex = {\n URI: exports.URI,\n reduce: _reduce,\n foldMap: _foldMap,\n reduceRight: _reduceRight,\n reduceWithIndex: _reduceWithIndex,\n foldMapWithIndex: _foldMapWithIndex,\n reduceRightWithIndex: _reduceRightWithIndex\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Traversable = {\n URI: exports.URI,\n map: _map,\n reduce: _reduce,\n foldMap: _foldMap,\n reduceRight: _reduceRight,\n traverse: _traverse,\n sequence: exports.sequence\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.TraversableWithIndex = {\n URI: exports.URI,\n map: _map,\n mapWithIndex: _mapWithIndex,\n reduce: _reduce,\n foldMap: _foldMap,\n reduceRight: _reduceRight,\n reduceWithIndex: _reduceWithIndex,\n foldMapWithIndex: _foldMapWithIndex,\n reduceRightWithIndex: _reduceRightWithIndex,\n traverse: _traverse,\n sequence: exports.sequence,\n traverseWithIndex: _traverseWithIndex\n};\n/**\n * @category ChainRec\n * @since 2.11.0\n */\nvar chainRecDepthFirst = function (f) { return function (a) {\n var todo = __spreadArray([], f(a));\n var out = [];\n while (todo.length > 0) {\n var e = todo.shift();\n if (_.isLeft(e)) {\n todo.unshift.apply(todo, f(e.left));\n }\n else {\n out.push(e.right);\n }\n }\n return out;\n}; };\nexports.chainRecDepthFirst = chainRecDepthFirst;\n/**\n * @category instances\n * @since 2.11.0\n */\nexports.ChainRecDepthFirst = {\n URI: exports.URI,\n map: _map,\n ap: _ap,\n chain: _chain,\n chainRec: exports._chainRecDepthFirst\n};\n/**\n * @category ChainRec\n * @since 2.11.0\n */\nvar chainRecBreadthFirst = function (f) { return function (a) {\n var initial = f(a);\n var todo = [];\n var out = [];\n function go(e) {\n if (_.isLeft(e)) {\n f(e.left).forEach(function (v) { return todo.push(v); });\n }\n else {\n out.push(e.right);\n }\n }\n for (var _i = 0, initial_1 = initial; _i < initial_1.length; _i++) {\n var e = initial_1[_i];\n go(e);\n }\n while (todo.length > 0) {\n go(todo.shift());\n }\n return out;\n}; };\nexports.chainRecBreadthFirst = chainRecBreadthFirst;\n/**\n * @category instances\n * @since 2.11.0\n */\nexports.ChainRecBreadthFirst = {\n URI: exports.URI,\n map: _map,\n ap: _ap,\n chain: _chain,\n chainRec: exports._chainRecBreadthFirst\n};\nvar _wither = Witherable_1.witherDefault(exports.Traversable, exports.Compactable);\nvar _wilt = Witherable_1.wiltDefault(exports.Traversable, exports.Compactable);\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Witherable = {\n URI: exports.URI,\n map: _map,\n compact: exports.compact,\n separate: exports.separate,\n filter: _filter,\n filterMap: _filterMap,\n partition: _partition,\n partitionMap: _partitionMap,\n reduce: _reduce,\n foldMap: _foldMap,\n reduceRight: _reduceRight,\n traverse: _traverse,\n sequence: exports.sequence,\n wither: _wither,\n wilt: _wilt\n};\n/**\n * Filter values inside a context.\n *\n * @example\n * import { pipe } from 'fp-ts/function'\n * import * as RA from 'fp-ts/ReadonlyArray'\n * import * as T from 'fp-ts/Task'\n *\n * const filterE = RA.filterE(T.ApplicativePar)\n * async function test() {\n * assert.deepStrictEqual(\n * await pipe(\n * [-1, 2, 3],\n * filterE((n) => T.of(n > 0))\n * )(),\n * [2, 3]\n * )\n * }\n * test()\n *\n * @since 2.11.0\n */\nexports.filterE = \n/*#__PURE__*/\nWitherable_1.filterE(exports.Witherable);\n/**\n * @category instances\n * @since 2.11.0\n */\nexports.FromEither = {\n URI: exports.URI,\n fromEither: exports.fromEither\n};\n/**\n * @category combinators\n * @since 2.11.0\n */\nexports.fromEitherK = \n/*#__PURE__*/\nFromEither_1.fromEitherK(exports.FromEither);\n// -------------------------------------------------------------------------------------\n// unsafe\n// -------------------------------------------------------------------------------------\n/**\n * @category unsafe\n * @since 2.5.0\n */\nexports.unsafeInsertAt = RNEA.unsafeInsertAt;\n/**\n * @category unsafe\n * @since 2.5.0\n */\nvar unsafeUpdateAt = function (i, a, as) {\n return exports.isNonEmpty(as) ? RNEA.unsafeUpdateAt(i, a, as) : as;\n};\nexports.unsafeUpdateAt = unsafeUpdateAt;\n/**\n * @category unsafe\n * @since 2.5.0\n */\nvar unsafeDeleteAt = function (i, as) {\n var xs = as.slice();\n xs.splice(i, 1);\n return xs;\n};\nexports.unsafeDeleteAt = unsafeDeleteAt;\n// -------------------------------------------------------------------------------------\n// interop\n// -------------------------------------------------------------------------------------\n/**\n * @category interop\n * @since 2.5.0\n */\nvar toArray = function (as) { return as.slice(); };\nexports.toArray = toArray;\n/**\n * @category interop\n * @since 2.5.0\n */\nvar fromArray = function (as) { return (exports.isEmpty(as) ? exports.empty : as.slice()); };\nexports.fromArray = fromArray;\n// -------------------------------------------------------------------------------------\n// utils\n// -------------------------------------------------------------------------------------\n/**\n * An empty array\n *\n * @since 2.5.0\n */\nexports.empty = RNEA.empty;\n/**\n * Check if a predicate holds true for every array member.\n *\n * @example\n * import { every } from 'fp-ts/ReadonlyArray'\n * import { pipe } from 'fp-ts/function'\n *\n * const isPositive = (n: number): boolean => n > 0\n *\n * assert.deepStrictEqual(pipe([1, 2, 3], every(isPositive)), true)\n * assert.deepStrictEqual(pipe([1, 2, -3], every(isPositive)), false)\n *\n * @since 2.9.0\n */\nvar every = function (predicate) { return function (as) { return as.every(predicate); }; };\nexports.every = every;\n/**\n * Check if a predicate holds true for any array member.\n *\n * @example\n * import { some } from 'fp-ts/ReadonlyArray'\n * import { pipe } from 'fp-ts/function'\n *\n * const isPositive = (n: number): boolean => n > 0\n *\n * assert.deepStrictEqual(pipe([-1, -2, 3], some(isPositive)), true)\n * assert.deepStrictEqual(pipe([-1, -2, -3], some(isPositive)), false)\n *\n * @since 2.9.0\n */\nvar some = function (predicate) { return function (as) {\n return as.some(predicate);\n}; };\nexports.some = some;\n/**\n * Alias of [`some`](#some)\n *\n * @since 2.11.0\n */\nexports.exists = exports.some;\n// -------------------------------------------------------------------------------------\n// do notation\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.9.0\n */\nexports.Do = \n/*#__PURE__*/\nexports.of(_.emptyRecord);\n/**\n * @since 2.8.0\n */\nexports.bindTo = \n/*#__PURE__*/\nFunctor_1.bindTo(exports.Functor);\n/**\n * @since 2.8.0\n */\nexports.bind = \n/*#__PURE__*/\nChain_1.bind(exports.Chain);\n// -------------------------------------------------------------------------------------\n// pipeable sequence S\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.8.0\n */\nexports.apS = \n/*#__PURE__*/\nApply_1.apS(exports.Apply);\n// -------------------------------------------------------------------------------------\n// deprecated\n// -------------------------------------------------------------------------------------\n// tslint:disable: deprecation\n/**\n * Use `ReadonlyNonEmptyArray` module instead.\n *\n * @category constructors\n * @since 2.5.0\n * @deprecated\n */\nexports.range = RNEA.range;\n/**\n * Use [`prepend`](#prepend) instead.\n *\n * @category constructors\n * @since 2.5.0\n * @deprecated\n */\nexports.cons = RNEA.cons;\n/**\n * Use [`append`](#append) instead.\n *\n * @category constructors\n * @since 2.5.0\n * @deprecated\n */\nexports.snoc = RNEA.snoc;\n/**\n * Use [`prependAll`](#prependall) instead.\n *\n * @category combinators\n * @since 2.9.0\n * @deprecated\n */\nexports.prependToAll = exports.prependAll;\n/**\n * Use small, specific instances instead.\n *\n * @category instances\n * @since 2.5.0\n * @deprecated\n */\nexports.readonlyArray = {\n URI: exports.URI,\n compact: exports.compact,\n separate: exports.separate,\n map: _map,\n ap: _ap,\n of: exports.of,\n chain: _chain,\n filter: _filter,\n filterMap: _filterMap,\n partition: _partition,\n partitionMap: _partitionMap,\n mapWithIndex: _mapWithIndex,\n partitionMapWithIndex: _partitionMapWithIndex,\n partitionWithIndex: _partitionWithIndex,\n filterMapWithIndex: _filterMapWithIndex,\n filterWithIndex: _filterWithIndex,\n alt: _alt,\n zero: exports.zero,\n unfold: exports.unfold,\n reduce: _reduce,\n foldMap: _foldMap,\n reduceRight: _reduceRight,\n traverse: _traverse,\n sequence: exports.sequence,\n reduceWithIndex: _reduceWithIndex,\n foldMapWithIndex: _foldMapWithIndex,\n reduceRightWithIndex: _reduceRightWithIndex,\n traverseWithIndex: _traverseWithIndex,\n extend: _extend,\n wither: _wither,\n wilt: _wilt\n};\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.reduceRight = exports.foldMap = exports.reduce = exports.mapWithIndex = exports.map = exports.flatten = exports.duplicate = exports.extend = exports.chain = exports.ap = exports.alt = exports.altW = exports.of = exports.chunksOf = exports.splitAt = exports.chop = exports.chainWithIndex = exports.intersperse = exports.prependAll = exports.unzip = exports.zip = exports.zipWith = exports.modifyAt = exports.updateAt = exports.sort = exports.groupBy = exports.group = exports.reverse = exports.concat = exports.concatW = exports.fromArray = exports.unappend = exports.unprepend = exports.range = exports.replicate = exports.makeBy = exports.fromReadonlyArray = exports.rotate = exports.union = exports.sortBy = exports.uniq = exports.unsafeUpdateAt = exports.unsafeInsertAt = exports.append = exports.appendW = exports.prepend = exports.prependW = exports.isOutOfBound = exports.isNonEmpty = exports.empty = void 0;\nexports.uncons = exports.filterWithIndex = exports.filter = exports.groupSort = exports.updateLast = exports.modifyLast = exports.updateHead = exports.modifyHead = exports.matchRight = exports.matchLeft = exports.concatAll = exports.max = exports.min = exports.init = exports.last = exports.tail = exports.head = exports.apS = exports.bind = exports.bindTo = exports.Do = exports.Comonad = exports.Alt = exports.TraversableWithIndex = exports.Traversable = exports.FoldableWithIndex = exports.Foldable = exports.Monad = exports.chainFirst = exports.Chain = exports.Applicative = exports.apSecond = exports.apFirst = exports.Apply = exports.FunctorWithIndex = exports.Pointed = exports.flap = exports.Functor = exports.getUnionSemigroup = exports.getEq = exports.getSemigroup = exports.getShow = exports.URI = exports.extract = exports.traverseWithIndex = exports.sequence = exports.traverse = exports.reduceRightWithIndex = exports.foldMapWithIndex = exports.reduceWithIndex = void 0;\nexports.readonlyNonEmptyArray = exports.fold = exports.prependToAll = exports.insertAt = exports.snoc = exports.cons = exports.unsnoc = void 0;\nvar Apply_1 = require(\"./Apply\");\nvar Chain_1 = require(\"./Chain\");\nvar Eq_1 = require(\"./Eq\");\nvar function_1 = require(\"./function\");\nvar Functor_1 = require(\"./Functor\");\nvar _ = __importStar(require(\"./internal\"));\nvar Ord_1 = require(\"./Ord\");\nvar Se = __importStar(require(\"./Semigroup\"));\n// -------------------------------------------------------------------------------------\n// internal\n// -------------------------------------------------------------------------------------\n/**\n * @internal\n */\nexports.empty = _.emptyReadonlyArray;\n/**\n * @internal\n */\nexports.isNonEmpty = _.isNonEmpty;\n/**\n * @internal\n */\nvar isOutOfBound = function (i, as) { return i < 0 || i >= as.length; };\nexports.isOutOfBound = isOutOfBound;\n/**\n * @internal\n */\nvar prependW = function (head) { return function (tail) { return __spreadArray([head], tail); }; };\nexports.prependW = prependW;\n/**\n * @internal\n */\nexports.prepend = exports.prependW;\n/**\n * @internal\n */\nvar appendW = function (end) { return function (init) { return __spreadArray(__spreadArray([], init), [end]); }; };\nexports.appendW = appendW;\n/**\n * @internal\n */\nexports.append = exports.appendW;\n/**\n * @internal\n */\nvar unsafeInsertAt = function (i, a, as) {\n if (exports.isNonEmpty(as)) {\n var xs = _.fromReadonlyNonEmptyArray(as);\n xs.splice(i, 0, a);\n return xs;\n }\n return [a];\n};\nexports.unsafeInsertAt = unsafeInsertAt;\n/**\n * @internal\n */\nvar unsafeUpdateAt = function (i, a, as) {\n if (as[i] === a) {\n return as;\n }\n else {\n var xs = _.fromReadonlyNonEmptyArray(as);\n xs[i] = a;\n return xs;\n }\n};\nexports.unsafeUpdateAt = unsafeUpdateAt;\n/**\n * Remove duplicates from a `ReadonlyNonEmptyArray`, keeping the first occurrence of an element.\n *\n * @example\n * import { uniq } from 'fp-ts/ReadonlyNonEmptyArray'\n * import * as N from 'fp-ts/number'\n *\n * assert.deepStrictEqual(uniq(N.Eq)([1, 2, 1]), [1, 2])\n *\n * @category combinators\n * @since 2.11.0\n */\nvar uniq = function (E) { return function (as) {\n if (as.length === 1) {\n return as;\n }\n var out = [exports.head(as)];\n var rest = exports.tail(as);\n var _loop_1 = function (a) {\n if (out.every(function (o) { return !E.equals(o, a); })) {\n out.push(a);\n }\n };\n for (var _i = 0, rest_1 = rest; _i < rest_1.length; _i++) {\n var a = rest_1[_i];\n _loop_1(a);\n }\n return out;\n}; };\nexports.uniq = uniq;\n/**\n * Sort the elements of a `ReadonlyNonEmptyArray` in increasing order, where elements are compared using first `ords[0]`, then `ords[1]`,\n * etc...\n *\n * @example\n * import * as RNEA from 'fp-ts/ReadonlyNonEmptyArray'\n * import { contramap } from 'fp-ts/Ord'\n * import * as S from 'fp-ts/string'\n * import * as N from 'fp-ts/number'\n * import { pipe } from 'fp-ts/function'\n *\n * interface Person {\n * name: string\n * age: number\n * }\n *\n * const byName = pipe(S.Ord, contramap((p: Person) => p.name))\n *\n * const byAge = pipe(N.Ord, contramap((p: Person) => p.age))\n *\n * const sortByNameByAge = RNEA.sortBy([byName, byAge])\n *\n * const persons: RNEA.ReadonlyNonEmptyArray = [\n * { name: 'a', age: 1 },\n * { name: 'b', age: 3 },\n * { name: 'c', age: 2 },\n * { name: 'b', age: 2 }\n * ]\n *\n * assert.deepStrictEqual(sortByNameByAge(persons), [\n * { name: 'a', age: 1 },\n * { name: 'b', age: 2 },\n * { name: 'b', age: 3 },\n * { name: 'c', age: 2 }\n * ])\n *\n * @category combinators\n * @since 2.11.0\n */\nvar sortBy = function (ords) {\n if (exports.isNonEmpty(ords)) {\n var M = Ord_1.getMonoid();\n return exports.sort(ords.reduce(M.concat, M.empty));\n }\n return function_1.identity;\n};\nexports.sortBy = sortBy;\n/**\n * @category combinators\n * @since 2.11.0\n */\nvar union = function (E) {\n var uniqE = exports.uniq(E);\n return function (second) { return function (first) { return uniqE(function_1.pipe(first, concat(second))); }; };\n};\nexports.union = union;\n/**\n * Rotate a `ReadonlyNonEmptyArray` by `n` steps.\n *\n * @example\n * import { rotate } from 'fp-ts/ReadonlyNonEmptyArray'\n *\n * assert.deepStrictEqual(rotate(2)([1, 2, 3, 4, 5]), [4, 5, 1, 2, 3])\n * assert.deepStrictEqual(rotate(-2)([1, 2, 3, 4, 5]), [3, 4, 5, 1, 2])\n *\n * @category combinators\n * @since 2.11.0\n */\nvar rotate = function (n) { return function (as) {\n var len = as.length;\n var m = Math.round(n) % len;\n if (exports.isOutOfBound(Math.abs(m), as) || m === 0) {\n return as;\n }\n if (m < 0) {\n var _a = exports.splitAt(-m)(as), f = _a[0], s = _a[1];\n return function_1.pipe(s, concat(f));\n }\n else {\n return exports.rotate(m - len)(as);\n }\n}; };\nexports.rotate = rotate;\n// -------------------------------------------------------------------------------------\n// constructors\n// -------------------------------------------------------------------------------------\n/**\n * Return a `ReadonlyNonEmptyArray` from a `ReadonlyArray` returning `none` if the input is empty.\n *\n * @category constructors\n * @since 2.5.0\n */\nvar fromReadonlyArray = function (as) {\n return exports.isNonEmpty(as) ? _.some(as) : _.none;\n};\nexports.fromReadonlyArray = fromReadonlyArray;\n/**\n * Return a `ReadonlyNonEmptyArray` of length `n` with element `i` initialized with `f(i)`.\n *\n * **Note**. `n` is normalized to a natural number.\n *\n * @example\n * import { makeBy } from 'fp-ts/ReadonlyNonEmptyArray'\n * import { pipe } from 'fp-ts/function'\n *\n * const double = (n: number): number => n * 2\n * assert.deepStrictEqual(pipe(5, makeBy(double)), [0, 2, 4, 6, 8])\n *\n * @category constructors\n * @since 2.11.0\n */\nvar makeBy = function (f) { return function (n) {\n var j = Math.max(0, Math.floor(n));\n var out = [f(0)];\n for (var i = 1; i < j; i++) {\n out.push(f(i));\n }\n return out;\n}; };\nexports.makeBy = makeBy;\n/**\n * Create a `ReadonlyNonEmptyArray` containing a value repeated the specified number of times.\n *\n * **Note**. `n` is normalized to a natural number.\n *\n * @example\n * import { replicate } from 'fp-ts/ReadonlyNonEmptyArray'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe(3, replicate('a')), ['a', 'a', 'a'])\n *\n * @category constructors\n * @since 2.11.0\n */\nvar replicate = function (a) { return exports.makeBy(function () { return a; }); };\nexports.replicate = replicate;\n/**\n * Create a `ReadonlyNonEmptyArray` containing a range of integers, including both endpoints.\n *\n * @example\n * import { range } from 'fp-ts/ReadonlyNonEmptyArray'\n *\n * assert.deepStrictEqual(range(1, 5), [1, 2, 3, 4, 5])\n *\n * @category constructors\n * @since 2.11.0\n */\nvar range = function (start, end) {\n return start <= end ? exports.makeBy(function (i) { return start + i; })(end - start + 1) : [start];\n};\nexports.range = range;\n// -------------------------------------------------------------------------------------\n// destructors\n// -------------------------------------------------------------------------------------\n/**\n * Return the tuple of the `head` and the `tail`.\n *\n * @example\n * import { unprepend } from 'fp-ts/ReadonlyNonEmptyArray'\n *\n * assert.deepStrictEqual(unprepend([1, 2, 3, 4]), [1, [2, 3, 4]])\n *\n * @category destructors\n * @since 2.9.0\n */\nvar unprepend = function (as) { return [exports.head(as), exports.tail(as)]; };\nexports.unprepend = unprepend;\n/**\n * Return the tuple of the `init` and the `last`.\n *\n * @example\n * import { unappend } from 'fp-ts/ReadonlyNonEmptyArray'\n *\n * assert.deepStrictEqual(unappend([1, 2, 3, 4]), [[1, 2, 3], 4])\n *\n * @category destructors\n * @since 2.9.0\n */\nvar unappend = function (as) { return [exports.init(as), exports.last(as)]; };\nexports.unappend = unappend;\n// -------------------------------------------------------------------------------------\n// interop\n// -------------------------------------------------------------------------------------\n/**\n * @category interop\n * @since 2.5.0\n */\nvar fromArray = function (as) { return exports.fromReadonlyArray(as.slice()); };\nexports.fromArray = fromArray;\nfunction concatW(second) {\n return function (first) { return first.concat(second); };\n}\nexports.concatW = concatW;\nfunction concat(x, y) {\n return y ? x.concat(y) : function (y) { return y.concat(x); };\n}\nexports.concat = concat;\n/**\n * @category combinators\n * @since 2.5.0\n */\nvar reverse = function (as) {\n return as.length === 1 ? as : __spreadArray([exports.last(as)], as.slice(0, -1).reverse());\n};\nexports.reverse = reverse;\nfunction group(E) {\n return function (as) {\n var len = as.length;\n if (len === 0) {\n return exports.empty;\n }\n var out = [];\n var head = as[0];\n var nea = [head];\n for (var i = 1; i < len; i++) {\n var a = as[i];\n if (E.equals(a, head)) {\n nea.push(a);\n }\n else {\n out.push(nea);\n head = a;\n nea = [head];\n }\n }\n out.push(nea);\n return out;\n };\n}\nexports.group = group;\n/**\n * Splits an array into sub-non-empty-arrays stored in an object, based on the result of calling a `string`-returning\n * function on each element, and grouping the results according to values returned\n *\n * @example\n * import { groupBy } from 'fp-ts/ReadonlyNonEmptyArray'\n *\n * assert.deepStrictEqual(groupBy((s: string) => String(s.length))(['a', 'b', 'ab']), {\n * '1': ['a', 'b'],\n * '2': ['ab']\n * })\n *\n * @category combinators\n * @since 2.5.0\n */\nvar groupBy = function (f) { return function (as) {\n var out = {};\n for (var _i = 0, as_1 = as; _i < as_1.length; _i++) {\n var a = as_1[_i];\n var k = f(a);\n if (out.hasOwnProperty(k)) {\n out[k].push(a);\n }\n else {\n out[k] = [a];\n }\n }\n return out;\n}; };\nexports.groupBy = groupBy;\n/**\n * @category combinators\n * @since 2.5.0\n */\nvar sort = function (O) { return function (as) {\n return as.length === 1 ? as : as.slice().sort(O.compare);\n}; };\nexports.sort = sort;\n/**\n * @category combinators\n * @since 2.5.0\n */\nvar updateAt = function (i, a) {\n return exports.modifyAt(i, function () { return a; });\n};\nexports.updateAt = updateAt;\n/**\n * @category combinators\n * @since 2.5.0\n */\nvar modifyAt = function (i, f) { return function (as) { return (exports.isOutOfBound(i, as) ? _.none : _.some(exports.unsafeUpdateAt(i, f(as[i]), as))); }; };\nexports.modifyAt = modifyAt;\n/**\n * @category combinators\n * @since 2.5.1\n */\nvar zipWith = function (as, bs, f) {\n var cs = [f(as[0], bs[0])];\n var len = Math.min(as.length, bs.length);\n for (var i = 1; i < len; i++) {\n cs[i] = f(as[i], bs[i]);\n }\n return cs;\n};\nexports.zipWith = zipWith;\nfunction zip(as, bs) {\n if (bs === undefined) {\n return function (bs) { return zip(bs, as); };\n }\n return exports.zipWith(as, bs, function (a, b) { return [a, b]; });\n}\nexports.zip = zip;\n/**\n * @category combinators\n * @since 2.5.1\n */\nvar unzip = function (abs) {\n var fa = [abs[0][0]];\n var fb = [abs[0][1]];\n for (var i = 1; i < abs.length; i++) {\n fa[i] = abs[i][0];\n fb[i] = abs[i][1];\n }\n return [fa, fb];\n};\nexports.unzip = unzip;\n/**\n * Prepend an element to every member of a `ReadonlyNonEmptyArray`.\n *\n * @example\n * import { prependAll } from 'fp-ts/ReadonlyNonEmptyArray'\n *\n * assert.deepStrictEqual(prependAll(9)([1, 2, 3, 4]), [9, 1, 9, 2, 9, 3, 9, 4])\n *\n * @category combinators\n * @since 2.10.0\n */\nvar prependAll = function (middle) { return function (as) {\n var out = [middle, as[0]];\n for (var i = 1; i < as.length; i++) {\n out.push(middle, as[i]);\n }\n return out;\n}; };\nexports.prependAll = prependAll;\n/**\n * Places an element in between members of a `ReadonlyNonEmptyArray`.\n *\n * @example\n * import { intersperse } from 'fp-ts/ReadonlyNonEmptyArray'\n *\n * assert.deepStrictEqual(intersperse(9)([1, 2, 3, 4]), [1, 9, 2, 9, 3, 9, 4])\n *\n * @category combinators\n * @since 2.9.0\n */\nvar intersperse = function (middle) { return function (as) {\n var rest = exports.tail(as);\n return exports.isNonEmpty(rest) ? function_1.pipe(rest, exports.prependAll(middle), exports.prepend(exports.head(as))) : as;\n}; };\nexports.intersperse = intersperse;\n/**\n * @category combinators\n * @since 2.10.0\n */\nvar chainWithIndex = function (f) { return function (as) {\n var out = _.fromReadonlyNonEmptyArray(f(0, exports.head(as)));\n for (var i = 1; i < as.length; i++) {\n out.push.apply(out, f(i, as[i]));\n }\n return out;\n}; };\nexports.chainWithIndex = chainWithIndex;\n/**\n * A useful recursion pattern for processing a `ReadonlyNonEmptyArray` to produce a new `ReadonlyNonEmptyArray`, often used for \"chopping\" up the input\n * `ReadonlyNonEmptyArray`. Typically `chop` is called with some function that will consume an initial prefix of the `ReadonlyNonEmptyArray` and produce a\n * value and the tail of the `ReadonlyNonEmptyArray`.\n *\n * @category combinators\n * @since 2.10.0\n */\nvar chop = function (f) { return function (as) {\n var _a = f(as), b = _a[0], rest = _a[1];\n var out = [b];\n var next = rest;\n while (exports.isNonEmpty(next)) {\n var _b = f(next), b_1 = _b[0], rest_2 = _b[1];\n out.push(b_1);\n next = rest_2;\n }\n return out;\n}; };\nexports.chop = chop;\n/**\n * Splits a `ReadonlyNonEmptyArray` into two pieces, the first piece has max `n` elements.\n *\n * @category combinators\n * @since 2.10.0\n */\nvar splitAt = function (n) { return function (as) {\n var m = Math.max(1, n);\n return m >= as.length ? [as, exports.empty] : [function_1.pipe(as.slice(1, m), exports.prepend(exports.head(as))), as.slice(m)];\n}; };\nexports.splitAt = splitAt;\n/**\n * Splits a `ReadonlyNonEmptyArray` into length-`n` pieces. The last piece will be shorter if `n` does not evenly divide the length of\n * the `ReadonlyNonEmptyArray`.\n *\n * @category combinators\n * @since 2.10.0\n */\nvar chunksOf = function (n) { return exports.chop(exports.splitAt(n)); };\nexports.chunksOf = chunksOf;\n// -------------------------------------------------------------------------------------\n// non-pipeables\n// -------------------------------------------------------------------------------------\nvar _map = function (fa, f) { return function_1.pipe(fa, exports.map(f)); };\n/* istanbul ignore next */\nvar _mapWithIndex = function (fa, f) { return function_1.pipe(fa, exports.mapWithIndex(f)); };\nvar _ap = function (fab, fa) { return function_1.pipe(fab, exports.ap(fa)); };\nvar _chain = function (ma, f) { return function_1.pipe(ma, exports.chain(f)); };\n/* istanbul ignore next */\nvar _extend = function (wa, f) { return function_1.pipe(wa, exports.extend(f)); };\n/* istanbul ignore next */\nvar _reduce = function (fa, b, f) { return function_1.pipe(fa, exports.reduce(b, f)); };\n/* istanbul ignore next */\nvar _foldMap = function (M) {\n var foldMapM = exports.foldMap(M);\n return function (fa, f) { return function_1.pipe(fa, foldMapM(f)); };\n};\n/* istanbul ignore next */\nvar _reduceRight = function (fa, b, f) { return function_1.pipe(fa, exports.reduceRight(b, f)); };\n/* istanbul ignore next */\nvar _traverse = function (F) {\n var traverseF = exports.traverse(F);\n return function (ta, f) { return function_1.pipe(ta, traverseF(f)); };\n};\n/* istanbul ignore next */\nvar _alt = function (fa, that) { return function_1.pipe(fa, exports.alt(that)); };\n/* istanbul ignore next */\nvar _reduceWithIndex = function (fa, b, f) {\n return function_1.pipe(fa, exports.reduceWithIndex(b, f));\n};\n/* istanbul ignore next */\nvar _foldMapWithIndex = function (M) {\n var foldMapWithIndexM = exports.foldMapWithIndex(M);\n return function (fa, f) { return function_1.pipe(fa, foldMapWithIndexM(f)); };\n};\n/* istanbul ignore next */\nvar _reduceRightWithIndex = function (fa, b, f) {\n return function_1.pipe(fa, exports.reduceRightWithIndex(b, f));\n};\n/* istanbul ignore next */\nvar _traverseWithIndex = function (F) {\n var traverseWithIndexF = exports.traverseWithIndex(F);\n return function (ta, f) { return function_1.pipe(ta, traverseWithIndexF(f)); };\n};\n// -------------------------------------------------------------------------------------\n// type class members\n// -------------------------------------------------------------------------------------\n/**\n * @category Pointed\n * @since 2.5.0\n */\nexports.of = _.singleton;\n/**\n * Less strict version of [`alt`](#alt).\n *\n * @category Alt\n * @since 2.9.0\n */\nvar altW = function (that) { return function (as) { return function_1.pipe(as, concatW(that())); }; };\nexports.altW = altW;\n/**\n * Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to\n * types of kind `* -> *`.\n *\n * @category Alt\n * @since 2.6.2\n */\nexports.alt = exports.altW;\n/**\n * @category Apply\n * @since 2.5.0\n */\nvar ap = function (as) { return exports.chain(function (f) { return function_1.pipe(as, exports.map(f)); }); };\nexports.ap = ap;\n/**\n * Composes computations in sequence, using the return value of one computation to determine the next computation.\n *\n * @category Monad\n * @since 2.5.0\n */\nvar chain = function (f) { return exports.chainWithIndex(function (_, a) { return f(a); }); };\nexports.chain = chain;\n/**\n * @category Extend\n * @since 2.5.0\n */\nvar extend = function (f) { return function (as) {\n var next = exports.tail(as);\n var out = [f(as)];\n while (exports.isNonEmpty(next)) {\n out.push(f(next));\n next = exports.tail(next);\n }\n return out;\n}; };\nexports.extend = extend;\n/**\n * Derivable from `Extend`.\n *\n * @category combinators\n * @since 2.5.0\n */\nexports.duplicate = \n/*#__PURE__*/\nexports.extend(function_1.identity);\n/**\n * Derivable from `Chain`.\n *\n * @category combinators\n * @since 2.5.0\n */\nexports.flatten = \n/*#__PURE__*/\nexports.chain(function_1.identity);\n/**\n * `map` can be used to turn functions `(a: A) => B` into functions `(fa: F) => F` whose argument and return types\n * use the type constructor `F` to represent some computational context.\n *\n * @category Functor\n * @since 2.5.0\n */\nvar map = function (f) {\n return exports.mapWithIndex(function (_, a) { return f(a); });\n};\nexports.map = map;\n/**\n * @category FunctorWithIndex\n * @since 2.5.0\n */\nvar mapWithIndex = function (f) { return function (as) {\n var out = [f(0, exports.head(as))];\n for (var i = 1; i < as.length; i++) {\n out.push(f(i, as[i]));\n }\n return out;\n}; };\nexports.mapWithIndex = mapWithIndex;\n/**\n * @category Foldable\n * @since 2.5.0\n */\nvar reduce = function (b, f) {\n return exports.reduceWithIndex(b, function (_, b, a) { return f(b, a); });\n};\nexports.reduce = reduce;\n/**\n * **Note**. The constraint is relaxed: a `Semigroup` instead of a `Monoid`.\n *\n * @category Foldable\n * @since 2.5.0\n */\nvar foldMap = function (S) { return function (f) { return function (as) {\n return as.slice(1).reduce(function (s, a) { return S.concat(s, f(a)); }, f(as[0]));\n}; }; };\nexports.foldMap = foldMap;\n/**\n * @category Foldable\n * @since 2.5.0\n */\nvar reduceRight = function (b, f) {\n return exports.reduceRightWithIndex(b, function (_, b, a) { return f(b, a); });\n};\nexports.reduceRight = reduceRight;\n/**\n * @category FoldableWithIndex\n * @since 2.5.0\n */\nvar reduceWithIndex = function (b, f) { return function (as) {\n return as.reduce(function (b, a, i) { return f(i, b, a); }, b);\n}; };\nexports.reduceWithIndex = reduceWithIndex;\n/**\n * **Note**. The constraint is relaxed: a `Semigroup` instead of a `Monoid`.\n *\n * @category FoldableWithIndex\n * @since 2.5.0\n */\nvar foldMapWithIndex = function (S) { return function (f) { return function (as) { return as.slice(1).reduce(function (s, a, i) { return S.concat(s, f(i + 1, a)); }, f(0, as[0])); }; }; };\nexports.foldMapWithIndex = foldMapWithIndex;\n/**\n * @category FoldableWithIndex\n * @since 2.5.0\n */\nvar reduceRightWithIndex = function (b, f) { return function (as) { return as.reduceRight(function (b, a, i) { return f(i, a, b); }, b); }; };\nexports.reduceRightWithIndex = reduceRightWithIndex;\n/**\n * @category Traversable\n * @since 2.6.3\n */\nvar traverse = function (F) {\n var traverseWithIndexF = exports.traverseWithIndex(F);\n return function (f) { return traverseWithIndexF(function (_, a) { return f(a); }); };\n};\nexports.traverse = traverse;\n/**\n * @category Traversable\n * @since 2.6.3\n */\nvar sequence = function (F) { return exports.traverseWithIndex(F)(function_1.SK); };\nexports.sequence = sequence;\n/**\n * @category TraversableWithIndex\n * @since 2.6.3\n */\nvar traverseWithIndex = function (F) { return function (f) { return function (as) {\n var out = F.map(f(0, exports.head(as)), exports.of);\n for (var i = 1; i < as.length; i++) {\n out = F.ap(F.map(out, function (bs) { return function (b) { return function_1.pipe(bs, exports.append(b)); }; }), f(i, as[i]));\n }\n return out;\n}; }; };\nexports.traverseWithIndex = traverseWithIndex;\n/**\n * @category Comonad\n * @since 2.6.3\n */\nexports.extract = _.head;\n// -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n/**\n * @category instances\n * @since 2.5.0\n */\nexports.URI = 'ReadonlyNonEmptyArray';\n/**\n * @category instances\n * @since 2.5.0\n */\nvar getShow = function (S) { return ({\n show: function (as) { return \"[\" + as.map(S.show).join(', ') + \"]\"; }\n}); };\nexports.getShow = getShow;\n/**\n * Builds a `Semigroup` instance for `ReadonlyNonEmptyArray`\n *\n * @category instances\n * @since 2.5.0\n */\nvar getSemigroup = function () { return ({\n concat: concat\n}); };\nexports.getSemigroup = getSemigroup;\n/**\n * @example\n * import { getEq } from 'fp-ts/ReadonlyNonEmptyArray'\n * import * as N from 'fp-ts/number'\n *\n * const E = getEq(N.Eq)\n * assert.strictEqual(E.equals([1, 2], [1, 2]), true)\n * assert.strictEqual(E.equals([1, 2], [1, 3]), false)\n *\n * @category instances\n * @since 2.5.0\n */\nvar getEq = function (E) {\n return Eq_1.fromEquals(function (xs, ys) { return xs.length === ys.length && xs.every(function (x, i) { return E.equals(x, ys[i]); }); });\n};\nexports.getEq = getEq;\n/**\n * @category combinators\n * @since 2.11.0\n */\nvar getUnionSemigroup = function (E) {\n var unionE = exports.union(E);\n return {\n concat: function (first, second) { return unionE(second)(first); }\n };\n};\nexports.getUnionSemigroup = getUnionSemigroup;\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Functor = {\n URI: exports.URI,\n map: _map\n};\n/**\n * Derivable from `Functor`.\n *\n * @category combinators\n * @since 2.10.0\n */\nexports.flap = \n/*#__PURE__*/\nFunctor_1.flap(exports.Functor);\n/**\n * @category instances\n * @since 2.10.0\n */\nexports.Pointed = {\n URI: exports.URI,\n of: exports.of\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.FunctorWithIndex = {\n URI: exports.URI,\n map: _map,\n mapWithIndex: _mapWithIndex\n};\n/**\n * @category instances\n * @since 2.10.0\n */\nexports.Apply = {\n URI: exports.URI,\n map: _map,\n ap: _ap\n};\n/**\n * Combine two effectful actions, keeping only the result of the first.\n *\n * Derivable from `Apply`.\n *\n * @category combinators\n * @since 2.5.0\n */\nexports.apFirst = \n/*#__PURE__*/\nApply_1.apFirst(exports.Apply);\n/**\n * Combine two effectful actions, keeping only the result of the second.\n *\n * Derivable from `Apply`.\n *\n * @category combinators\n * @since 2.5.0\n */\nexports.apSecond = \n/*#__PURE__*/\nApply_1.apSecond(exports.Apply);\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Applicative = {\n URI: exports.URI,\n map: _map,\n ap: _ap,\n of: exports.of\n};\n/**\n * @category instances\n * @since 2.10.0\n */\nexports.Chain = {\n URI: exports.URI,\n map: _map,\n ap: _ap,\n chain: _chain\n};\n/**\n * Composes computations in sequence, using the return value of one computation to determine the next computation and\n * keeping only the result of the first.\n *\n * Derivable from `Chain`.\n *\n * @category combinators\n * @since 2.5.0\n */\nexports.chainFirst = \n/*#__PURE__*/\nChain_1.chainFirst(exports.Chain);\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Monad = {\n URI: exports.URI,\n map: _map,\n ap: _ap,\n of: exports.of,\n chain: _chain\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Foldable = {\n URI: exports.URI,\n reduce: _reduce,\n foldMap: _foldMap,\n reduceRight: _reduceRight\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.FoldableWithIndex = {\n URI: exports.URI,\n reduce: _reduce,\n foldMap: _foldMap,\n reduceRight: _reduceRight,\n reduceWithIndex: _reduceWithIndex,\n foldMapWithIndex: _foldMapWithIndex,\n reduceRightWithIndex: _reduceRightWithIndex\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Traversable = {\n URI: exports.URI,\n map: _map,\n reduce: _reduce,\n foldMap: _foldMap,\n reduceRight: _reduceRight,\n traverse: _traverse,\n sequence: exports.sequence\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.TraversableWithIndex = {\n URI: exports.URI,\n map: _map,\n mapWithIndex: _mapWithIndex,\n reduce: _reduce,\n foldMap: _foldMap,\n reduceRight: _reduceRight,\n traverse: _traverse,\n sequence: exports.sequence,\n reduceWithIndex: _reduceWithIndex,\n foldMapWithIndex: _foldMapWithIndex,\n reduceRightWithIndex: _reduceRightWithIndex,\n traverseWithIndex: _traverseWithIndex\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Alt = {\n URI: exports.URI,\n map: _map,\n alt: _alt\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Comonad = {\n URI: exports.URI,\n map: _map,\n extend: _extend,\n extract: exports.extract\n};\n// -------------------------------------------------------------------------------------\n// do notation\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.9.0\n */\nexports.Do = \n/*#__PURE__*/\nexports.of(_.emptyRecord);\n/**\n * @since 2.8.0\n */\nexports.bindTo = \n/*#__PURE__*/\nFunctor_1.bindTo(exports.Functor);\n/**\n * @since 2.8.0\n */\nexports.bind = \n/*#__PURE__*/\nChain_1.bind(exports.Chain);\n// -------------------------------------------------------------------------------------\n// pipeable sequence S\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.8.0\n */\nexports.apS = \n/*#__PURE__*/\nApply_1.apS(exports.Apply);\n// -------------------------------------------------------------------------------------\n// utils\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.5.0\n */\nexports.head = exports.extract;\n/**\n * @since 2.5.0\n */\nexports.tail = _.tail;\n/**\n * @since 2.5.0\n */\nvar last = function (as) { return as[as.length - 1]; };\nexports.last = last;\n/**\n * Get all but the last element of a non empty array, creating a new array.\n *\n * @example\n * import { init } from 'fp-ts/ReadonlyNonEmptyArray'\n *\n * assert.deepStrictEqual(init([1, 2, 3]), [1, 2])\n * assert.deepStrictEqual(init([1]), [])\n *\n * @since 2.5.0\n */\nvar init = function (as) { return as.slice(0, -1); };\nexports.init = init;\n/**\n * @since 2.5.0\n */\nvar min = function (O) {\n var S = Se.min(O);\n return function (as) { return as.reduce(S.concat); };\n};\nexports.min = min;\n/**\n * @since 2.5.0\n */\nvar max = function (O) {\n var S = Se.max(O);\n return function (as) { return as.reduce(S.concat); };\n};\nexports.max = max;\n/**\n * @since 2.10.0\n */\nvar concatAll = function (S) { return function (as) { return as.reduce(S.concat); }; };\nexports.concatAll = concatAll;\n/**\n * Break a `ReadonlyArray` into its first element and remaining elements.\n *\n * @category destructors\n * @since 2.11.0\n */\nvar matchLeft = function (f) { return function (as) {\n return f(exports.head(as), exports.tail(as));\n}; };\nexports.matchLeft = matchLeft;\n/**\n * Break a `ReadonlyArray` into its initial elements and the last element.\n *\n * @category destructors\n * @since 2.11.0\n */\nvar matchRight = function (f) { return function (as) {\n return f(exports.init(as), exports.last(as));\n}; };\nexports.matchRight = matchRight;\n/**\n * Apply a function to the head, creating a new `ReadonlyNonEmptyArray`.\n *\n * @since 2.11.0\n */\nvar modifyHead = function (f) { return function (as) { return __spreadArray([\n f(exports.head(as))\n], exports.tail(as)); }; };\nexports.modifyHead = modifyHead;\n/**\n * Change the head, creating a new `ReadonlyNonEmptyArray`.\n *\n * @category combinators\n * @since 2.11.0\n */\nvar updateHead = function (a) { return exports.modifyHead(function () { return a; }); };\nexports.updateHead = updateHead;\n/**\n * Apply a function to the last element, creating a new `ReadonlyNonEmptyArray`.\n *\n * @since 2.11.0\n */\nvar modifyLast = function (f) { return function (as) {\n return function_1.pipe(exports.init(as), exports.append(f(exports.last(as))));\n}; };\nexports.modifyLast = modifyLast;\n/**\n * Change the last element, creating a new `ReadonlyNonEmptyArray`.\n *\n * @category combinators\n * @since 2.11.0\n */\nvar updateLast = function (a) { return exports.modifyLast(function () { return a; }); };\nexports.updateLast = updateLast;\nfunction groupSort(O) {\n var sortO = exports.sort(O);\n var groupO = group(O);\n return function (as) { return (exports.isNonEmpty(as) ? groupO(sortO(as)) : exports.empty); };\n}\nexports.groupSort = groupSort;\nfunction filter(predicate) {\n return exports.filterWithIndex(function (_, a) { return predicate(a); });\n}\nexports.filter = filter;\n/**\n * Use [`filterWithIndex`](./ReadonlyArray.ts.html#filterwithindex) instead.\n *\n * @category combinators\n * @since 2.5.0\n * @deprecated\n */\nvar filterWithIndex = function (predicate) { return function (as) { return exports.fromReadonlyArray(as.filter(function (a, i) { return predicate(i, a); })); }; };\nexports.filterWithIndex = filterWithIndex;\n/**\n * Use [`unprepend`](#unprepend) instead.\n *\n * @category destructors\n * @since 2.10.0\n * @deprecated\n */\nexports.uncons = exports.unprepend;\n/**\n * Use [`unappend`](#unappend) instead.\n *\n * @category destructors\n * @since 2.10.0\n * @deprecated\n */\nexports.unsnoc = exports.unappend;\nfunction cons(head, tail) {\n return tail === undefined ? exports.prepend(head) : function_1.pipe(tail, exports.prepend(head));\n}\nexports.cons = cons;\n/**\n * Use [`append`](./ReadonlyArray.ts.html#append) instead.\n *\n * @category constructors\n * @since 2.5.0\n * @deprecated\n */\nvar snoc = function (init, end) { return function_1.pipe(init, concat([end])); };\nexports.snoc = snoc;\n/**\n * Use [`insertAt`](./ReadonlyArray.ts.html#insertat) instead.\n *\n * @category combinators\n * @since 2.5.0\n * @deprecated\n */\nvar insertAt = function (i, a) { return function (as) {\n return i < 0 || i > as.length ? _.none : _.some(exports.unsafeInsertAt(i, a, as));\n}; };\nexports.insertAt = insertAt;\n/**\n * Use [`prependAll`](#prependall) instead.\n *\n * @category combinators\n * @since 2.9.0\n * @deprecated\n */\nexports.prependToAll = exports.prependAll;\n/**\n * Use [`concatAll`](#concatall) instead.\n *\n * @since 2.5.0\n * @deprecated\n */\nexports.fold = exports.concatAll;\n/**\n * Use small, specific instances instead.\n *\n * @category instances\n * @since 2.5.0\n * @deprecated\n */\nexports.readonlyNonEmptyArray = {\n URI: exports.URI,\n of: exports.of,\n map: _map,\n mapWithIndex: _mapWithIndex,\n ap: _ap,\n chain: _chain,\n extend: _extend,\n extract: exports.extract,\n reduce: _reduce,\n foldMap: _foldMap,\n reduceRight: _reduceRight,\n traverse: _traverse,\n sequence: exports.sequence,\n reduceWithIndex: _reduceWithIndex,\n foldMapWithIndex: _foldMapWithIndex,\n reduceRightWithIndex: _reduceRightWithIndex,\n traverseWithIndex: _traverseWithIndex,\n alt: _alt\n};\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._reduceWithIndex = exports._partitionMap = exports._partition = exports._filterMap = exports._filter = exports._reduceRight = exports._foldMap = exports._reduce = exports._mapWithIndex = exports._map = exports.difference = exports.intersection = exports.union = exports.elem = exports.some = exports.every = exports.fromFoldableMap = exports.fromFoldable = exports.filterWithIndex = exports.filterMapWithIndex = exports.partitionWithIndex = exports.partitionMapWithIndex = exports.wilt = exports.wither = exports.sequence = exports.traverse = exports.traverseWithIndex = exports.singleton = exports.reduceRightWithIndex = exports.foldMapWithIndex = exports.reduceWithIndex = exports.map = exports.mapWithIndex = exports.empty = exports.lookup = exports.isSubrecord = exports.pop = exports.modifyAt = exports.updateAt = exports.deleteAt = exports.has = exports.upsertAt = exports.toUnfoldable = exports.toReadonlyArray = exports.collect = exports.keys = exports.isEmpty = exports.size = exports.toRecord = exports.fromRecord = void 0;\nexports.readonlyRecord = exports.hasOwnProperty = exports.insertAt = exports.Witherable = exports.TraversableWithIndex = exports.Traversable = exports.FoldableWithIndex = exports.Foldable = exports.getDifferenceMagma = exports.getIntersectionSemigroup = exports.getUnionMonoid = exports.getUnionSemigroup = exports.getWitherable = exports.getTraversableWithIndex = exports.getTraversable = exports.FilterableWithIndex = exports.Filterable = exports.Compactable = exports.getFoldableWithIndex = exports.getFoldable = exports.FunctorWithIndex = exports.flap = exports.Functor = exports.getMonoid = exports.getEq = exports.getShow = exports.URI = exports.separate = exports.compact = exports.reduceRight = exports.foldMap = exports.reduce = exports.partitionMap = exports.partition = exports.filterMap = exports.filter = exports._sequence = exports._traverse = exports._filterWithIndex = exports._filterMapWithIndex = exports._partitionWithIndex = exports._partitionMapWithIndex = exports._reduceRightWithIndex = exports._foldMapWithIndex = void 0;\nvar Eq_1 = require(\"./Eq\");\nvar function_1 = require(\"./function\");\nvar Functor_1 = require(\"./Functor\");\nvar _ = __importStar(require(\"./internal\"));\nvar Separated_1 = require(\"./Separated\");\nvar S = __importStar(require(\"./string\"));\nvar Witherable_1 = require(\"./Witherable\");\n// -------------------------------------------------------------------------------------\n// interop\n// -------------------------------------------------------------------------------------\n/**\n * @category interop\n * @since 2.5.0\n */\nvar fromRecord = function (r) { return Object.assign({}, r); };\nexports.fromRecord = fromRecord;\n/**\n * @category interop\n * @since 2.5.0\n */\nvar toRecord = function (r) { return Object.assign({}, r); };\nexports.toRecord = toRecord;\n/**\n * Calculate the number of key/value pairs in a `ReadonlyRecord`,\n *\n * @since 2.5.0\n */\nvar size = function (r) { return Object.keys(r).length; };\nexports.size = size;\n/**\n * Test whether a `ReadonlyRecord` is empty.\n *\n * @since 2.5.0\n */\nvar isEmpty = function (r) {\n for (var k in r) {\n if (_.has.call(r, k)) {\n return false;\n }\n }\n return true;\n};\nexports.isEmpty = isEmpty;\nvar keys_ = function (O) { return function (r) {\n return Object.keys(r).sort(O.compare);\n}; };\n/**\n * @since 2.5.0\n */\nexports.keys = \n/*#__PURE__*/\nkeys_(S.Ord);\nfunction collect(O) {\n if (typeof O === 'function') {\n return collect(S.Ord)(O);\n }\n var keysO = keys_(O);\n return function (f) { return function (r) {\n var out = [];\n for (var _i = 0, _a = keysO(r); _i < _a.length; _i++) {\n var key = _a[_i];\n out.push(f(key, r[key]));\n }\n return out;\n }; };\n}\nexports.collect = collect;\n/**\n * Get a sorted `ReadonlyArray` of the key/value pairs contained in a `ReadonlyRecord`.\n *\n * @since 2.5.0\n */\nexports.toReadonlyArray = \n/*#__PURE__*/\ncollect(S.Ord)(function (k, a) { return [k, a]; });\nfunction toUnfoldable(U) {\n return function (r) {\n var sas = exports.toReadonlyArray(r);\n var len = sas.length;\n return U.unfold(0, function (b) { return (b < len ? _.some([sas[b], b + 1]) : _.none); });\n };\n}\nexports.toUnfoldable = toUnfoldable;\n/**\n * Insert or replace a key/value pair in a `ReadonlyRecord`.\n *\n * @category combinators\n * @since 2.10.0\n */\nvar upsertAt = function (k, a) { return function (r) {\n if (_.has.call(r, k) && r[k] === a) {\n return r;\n }\n var out = Object.assign({}, r);\n out[k] = a;\n return out;\n}; };\nexports.upsertAt = upsertAt;\n/**\n * Test whether or not a key exists in a `ReadonlyRecord`.\n *\n * Note. This function is not pipeable because is a `Refinement`.\n *\n * @since 2.10.0\n */\nvar has = function (k, r) { return _.has.call(r, k); };\nexports.has = has;\nfunction deleteAt(k) {\n return function (r) {\n if (!_.has.call(r, k)) {\n return r;\n }\n var out = Object.assign({}, r);\n delete out[k];\n return out;\n };\n}\nexports.deleteAt = deleteAt;\n/**\n * @since 2.5.0\n */\nvar updateAt = function (k, a) { return function (r) {\n if (!exports.has(k, r)) {\n return _.none;\n }\n if (r[k] === a) {\n return _.some(r);\n }\n var out = Object.assign({}, r);\n out[k] = a;\n return _.some(out);\n}; };\nexports.updateAt = updateAt;\n/**\n * @since 2.5.0\n */\nvar modifyAt = function (k, f) { return function (r) {\n if (!exports.has(k, r)) {\n return _.none;\n }\n var next = f(r[k]);\n if (next === r[k]) {\n return _.some(r);\n }\n var out = Object.assign({}, r);\n out[k] = next;\n return _.some(out);\n}; };\nexports.modifyAt = modifyAt;\nfunction pop(k) {\n var deleteAtk = deleteAt(k);\n return function (r) {\n var oa = lookup(k, r);\n return _.isNone(oa) ? _.none : _.some([oa.value, deleteAtk(r)]);\n };\n}\nexports.pop = pop;\nfunction isSubrecord(E) {\n return function (me, that) {\n if (that === undefined) {\n var isSubrecordE_1 = isSubrecord(E);\n return function (that) { return isSubrecordE_1(that, me); };\n }\n for (var k in me) {\n if (!_.has.call(that, k) || !E.equals(me[k], that[k])) {\n return false;\n }\n }\n return true;\n };\n}\nexports.isSubrecord = isSubrecord;\nfunction lookup(k, r) {\n if (r === undefined) {\n return function (r) { return lookup(k, r); };\n }\n return _.has.call(r, k) ? _.some(r[k]) : _.none;\n}\nexports.lookup = lookup;\n/**\n * @since 2.5.0\n */\nexports.empty = {};\nfunction mapWithIndex(f) {\n return function (r) {\n var out = {};\n for (var k in r) {\n if (_.has.call(r, k)) {\n out[k] = f(k, r[k]);\n }\n }\n return out;\n };\n}\nexports.mapWithIndex = mapWithIndex;\nfunction map(f) {\n return mapWithIndex(function (_, a) { return f(a); });\n}\nexports.map = map;\nfunction reduceWithIndex() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (args.length === 2) {\n return reduceWithIndex(S.Ord).apply(void 0, args);\n }\n var keysO = keys_(args[0]);\n return function (b, f) { return function (fa) {\n var out = b;\n var ks = keysO(fa);\n var len = ks.length;\n for (var i = 0; i < len; i++) {\n var k = ks[i];\n out = f(k, out, fa[k]);\n }\n return out;\n }; };\n}\nexports.reduceWithIndex = reduceWithIndex;\nfunction foldMapWithIndex(O) {\n if ('compare' in O) {\n var keysO_1 = keys_(O);\n return function (M) { return function (f) { return function (fa) {\n var out = M.empty;\n var ks = keysO_1(fa);\n var len = ks.length;\n for (var i = 0; i < len; i++) {\n var k = ks[i];\n out = M.concat(out, f(k, fa[k]));\n }\n return out;\n }; }; };\n }\n return foldMapWithIndex(S.Ord)(O);\n}\nexports.foldMapWithIndex = foldMapWithIndex;\nfunction reduceRightWithIndex() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (args.length === 2) {\n return reduceRightWithIndex(S.Ord).apply(void 0, args);\n }\n var keysO = keys_(args[0]);\n return function (b, f) { return function (fa) {\n var out = b;\n var ks = keysO(fa);\n var len = ks.length;\n for (var i = len - 1; i >= 0; i--) {\n var k = ks[i];\n out = f(k, fa[k], out);\n }\n return out;\n }; };\n}\nexports.reduceRightWithIndex = reduceRightWithIndex;\n/**\n * Create a `ReadonlyRecord` with one key/value pair.\n *\n * @category constructors\n * @since 2.5.0\n */\nvar singleton = function (k, a) {\n var _a;\n return (_a = {}, _a[k] = a, _a);\n};\nexports.singleton = singleton;\nfunction traverseWithIndex(F) {\n var traverseWithIndexOF = _traverseWithIndex(S.Ord)(F);\n return function (f) { return function (ta) { return traverseWithIndexOF(ta, f); }; };\n}\nexports.traverseWithIndex = traverseWithIndex;\nfunction traverse(F) {\n var traverseOF = exports._traverse(S.Ord)(F);\n return function (f) { return function (ta) { return traverseOF(ta, f); }; };\n}\nexports.traverse = traverse;\nfunction sequence(F) {\n return exports._sequence(S.Ord)(F);\n}\nexports.sequence = sequence;\n/**\n * @category Witherable\n * @since 2.6.5\n */\nvar wither = function (F) {\n var traverseF = traverse(F);\n return function (f) { return function (fa) { return F.map(function_1.pipe(fa, traverseF(f)), exports.compact); }; };\n};\nexports.wither = wither;\n/**\n * @category Witherable\n * @since 2.6.5\n */\nvar wilt = function (F) {\n var traverseF = traverse(F);\n return function (f) { return function (fa) { return F.map(function_1.pipe(fa, traverseF(f)), exports.separate); }; };\n};\nexports.wilt = wilt;\nfunction partitionMapWithIndex(f) {\n return function (r) {\n var left = {};\n var right = {};\n for (var k in r) {\n if (_.has.call(r, k)) {\n var e = f(k, r[k]);\n switch (e._tag) {\n case 'Left':\n left[k] = e.left;\n break;\n case 'Right':\n right[k] = e.right;\n break;\n }\n }\n }\n return Separated_1.separated(left, right);\n };\n}\nexports.partitionMapWithIndex = partitionMapWithIndex;\nfunction partitionWithIndex(predicateWithIndex) {\n return function (r) {\n var left = {};\n var right = {};\n for (var k in r) {\n if (_.has.call(r, k)) {\n var a = r[k];\n if (predicateWithIndex(k, a)) {\n right[k] = a;\n }\n else {\n left[k] = a;\n }\n }\n }\n return Separated_1.separated(left, right);\n };\n}\nexports.partitionWithIndex = partitionWithIndex;\nfunction filterMapWithIndex(f) {\n return function (r) {\n var out = {};\n for (var k in r) {\n if (_.has.call(r, k)) {\n var ob = f(k, r[k]);\n if (_.isSome(ob)) {\n out[k] = ob.value;\n }\n }\n }\n return out;\n };\n}\nexports.filterMapWithIndex = filterMapWithIndex;\nfunction filterWithIndex(predicateWithIndex) {\n return function (fa) {\n var out = {};\n var changed = false;\n for (var key in fa) {\n if (_.has.call(fa, key)) {\n var a = fa[key];\n if (predicateWithIndex(key, a)) {\n out[key] = a;\n }\n else {\n changed = true;\n }\n }\n }\n return changed ? out : fa;\n };\n}\nexports.filterWithIndex = filterWithIndex;\nfunction fromFoldable(M, F) {\n var fromFoldableMapM = fromFoldableMap(M, F);\n return function (fka) { return fromFoldableMapM(fka, function_1.identity); };\n}\nexports.fromFoldable = fromFoldable;\nfunction fromFoldableMap(M, F) {\n return function (ta, f) {\n return F.reduce(ta, {}, function (r, a) {\n var _a = f(a), k = _a[0], b = _a[1];\n r[k] = _.has.call(r, k) ? M.concat(r[k], b) : b;\n return r;\n });\n };\n}\nexports.fromFoldableMap = fromFoldableMap;\n/**\n * @since 2.5.0\n */\nfunction every(predicate) {\n return function (r) {\n for (var k in r) {\n if (!predicate(r[k])) {\n return false;\n }\n }\n return true;\n };\n}\nexports.every = every;\n/**\n * @since 2.5.0\n */\nfunction some(predicate) {\n return function (r) {\n for (var k in r) {\n if (predicate(r[k])) {\n return true;\n }\n }\n return false;\n };\n}\nexports.some = some;\nfunction elem(E) {\n return function (a, fa) {\n if (fa === undefined) {\n var elemE_1 = elem(E);\n return function (fa) { return elemE_1(a, fa); };\n }\n for (var k in fa) {\n if (E.equals(fa[k], a)) {\n return true;\n }\n }\n return false;\n };\n}\nexports.elem = elem;\n/**\n * @category combinators\n * @since 2.11.0\n */\nvar union = function (M) { return function (second) { return function (first) {\n if (exports.isEmpty(first)) {\n return second;\n }\n if (exports.isEmpty(second)) {\n return first;\n }\n var out = {};\n for (var k in first) {\n if (exports.has(k, second)) {\n out[k] = M.concat(first[k], second[k]);\n }\n else {\n out[k] = first[k];\n }\n }\n for (var k in second) {\n if (!exports.has(k, out)) {\n out[k] = second[k];\n }\n }\n return out;\n}; }; };\nexports.union = union;\n/**\n * @category combinators\n * @since 2.11.0\n */\nvar intersection = function (M) { return function (second) { return function (first) {\n if (exports.isEmpty(first) || exports.isEmpty(second)) {\n return exports.empty;\n }\n var out = {};\n for (var k in first) {\n if (exports.has(k, second)) {\n out[k] = M.concat(first[k], second[k]);\n }\n }\n return out;\n}; }; };\nexports.intersection = intersection;\n/**\n * @category combinators\n * @since 2.11.0\n */\nvar difference = function (second) { return function (first) {\n if (exports.isEmpty(first)) {\n return second;\n }\n if (exports.isEmpty(second)) {\n return first;\n }\n var out = {};\n for (var k in first) {\n if (!exports.has(k, second)) {\n out[k] = first[k];\n }\n }\n for (var k in second) {\n if (!exports.has(k, first)) {\n out[k] = second[k];\n }\n }\n return out;\n}; };\nexports.difference = difference;\n// -------------------------------------------------------------------------------------\n// non-pipeables\n// -------------------------------------------------------------------------------------\n/** @internal */\nvar _map = function (fa, f) { return function_1.pipe(fa, map(f)); };\nexports._map = _map;\n/** @internal */\n/* istanbul ignore next */\nvar _mapWithIndex = function (fa, f) { return function_1.pipe(fa, mapWithIndex(f)); };\nexports._mapWithIndex = _mapWithIndex;\n/** @internal */\n/* istanbul ignore next */\nvar _reduce = function (O) {\n var reduceO = reduce(O);\n return function (fa, b, f) { return function_1.pipe(fa, reduceO(b, f)); };\n};\nexports._reduce = _reduce;\n/** @internal */\nvar _foldMap = function (O) { return function (M) {\n var foldMapM = foldMap(O)(M);\n return function (fa, f) { return function_1.pipe(fa, foldMapM(f)); };\n}; };\nexports._foldMap = _foldMap;\n/** @internal */\n/* istanbul ignore next */\nvar _reduceRight = function (O) {\n var reduceRightO = reduceRight(O);\n return function (fa, b, f) { return function_1.pipe(fa, reduceRightO(b, f)); };\n};\nexports._reduceRight = _reduceRight;\n/** @internal */\n/* istanbul ignore next */\nvar _filter = function (fa, predicate) {\n return function_1.pipe(fa, exports.filter(predicate));\n};\nexports._filter = _filter;\n/** @internal */\n/* istanbul ignore next */\nvar _filterMap = function (fa, f) { return function_1.pipe(fa, exports.filterMap(f)); };\nexports._filterMap = _filterMap;\n/** @internal */\n/* istanbul ignore next */\nvar _partition = function (fa, predicate) { return function_1.pipe(fa, exports.partition(predicate)); };\nexports._partition = _partition;\n/** @internal */\n/* istanbul ignore next */\nvar _partitionMap = function (fa, f) { return function_1.pipe(fa, exports.partitionMap(f)); };\nexports._partitionMap = _partitionMap;\n/** @internal */\n/* istanbul ignore next */\nvar _reduceWithIndex = function (O) {\n var reduceWithIndexO = reduceWithIndex(O);\n return function (fa, b, f) { return function_1.pipe(fa, reduceWithIndexO(b, f)); };\n};\nexports._reduceWithIndex = _reduceWithIndex;\n/** @internal */\nvar _foldMapWithIndex = function (O) {\n var foldMapWithIndexO = foldMapWithIndex(O);\n return function (M) {\n var foldMapWithIndexM = foldMapWithIndexO(M);\n return function (fa, f) { return function_1.pipe(fa, foldMapWithIndexM(f)); };\n };\n};\nexports._foldMapWithIndex = _foldMapWithIndex;\n/** @internal */\n/* istanbul ignore next */\nvar _reduceRightWithIndex = function (O) {\n var reduceRightWithIndexO = reduceRightWithIndex(O);\n return function (fa, b, f) { return function_1.pipe(fa, reduceRightWithIndexO(b, f)); };\n};\nexports._reduceRightWithIndex = _reduceRightWithIndex;\n/** @internal */\n/* istanbul ignore next */\nvar _partitionMapWithIndex = function (fa, f) { return function_1.pipe(fa, partitionMapWithIndex(f)); };\nexports._partitionMapWithIndex = _partitionMapWithIndex;\n/** @internal */\n/* istanbul ignore next */\nvar _partitionWithIndex = function (fa, predicateWithIndex) { return function_1.pipe(fa, partitionWithIndex(predicateWithIndex)); };\nexports._partitionWithIndex = _partitionWithIndex;\n/** @internal */\n/* istanbul ignore next */\nvar _filterMapWithIndex = function (fa, f) {\n return function_1.pipe(fa, filterMapWithIndex(f));\n};\nexports._filterMapWithIndex = _filterMapWithIndex;\n/** @internal */\n/* istanbul ignore next */\nvar _filterWithIndex = function (fa, predicateWithIndex) {\n return function_1.pipe(fa, filterWithIndex(predicateWithIndex));\n};\nexports._filterWithIndex = _filterWithIndex;\n/** @internal */\nvar _traverse = function (O) {\n var traverseWithIndexO = _traverseWithIndex(O);\n return function (F) {\n var traverseWithIndexOF = traverseWithIndexO(F);\n return function (ta, f) { return traverseWithIndexOF(ta, function_1.flow(function_1.SK, f)); };\n };\n};\nexports._traverse = _traverse;\n/** @internal */\nvar _sequence = function (O) {\n var traverseO = exports._traverse(O);\n return function (F) {\n var traverseOF = traverseO(F);\n return function (ta) { return traverseOF(ta, function_1.identity); };\n };\n};\nexports._sequence = _sequence;\nvar _traverseWithIndex = function (O) { return function (F) {\n var keysO = keys_(O);\n return function (ta, f) {\n var ks = keysO(ta);\n if (ks.length === 0) {\n return F.of(exports.empty);\n }\n var fr = F.of({});\n var _loop_1 = function (key) {\n fr = F.ap(F.map(fr, function (r) { return function (b) {\n r[key] = b;\n return r;\n }; }), f(key, ta[key]));\n };\n for (var _i = 0, ks_1 = ks; _i < ks_1.length; _i++) {\n var key = ks_1[_i];\n _loop_1(key);\n }\n return fr;\n };\n}; };\n// -------------------------------------------------------------------------------------\n// type class members\n// -------------------------------------------------------------------------------------\n/**\n * @category Filterable\n * @since 2.5.0\n */\nvar filter = function (predicate) {\n return filterWithIndex(function (_, a) { return predicate(a); });\n};\nexports.filter = filter;\n/**\n * @category Filterable\n * @since 2.5.0\n */\nvar filterMap = function (f) { return filterMapWithIndex(function (_, a) { return f(a); }); };\nexports.filterMap = filterMap;\n/**\n * @category Filterable\n * @since 2.5.0\n */\nvar partition = function (predicate) {\n return partitionWithIndex(function (_, a) { return predicate(a); });\n};\nexports.partition = partition;\n/**\n * @category Filterable\n * @since 2.5.0\n */\nvar partitionMap = function (f) {\n return partitionMapWithIndex(function (_, a) { return f(a); });\n};\nexports.partitionMap = partitionMap;\nfunction reduce() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (args.length === 1) {\n var reduceWithIndexO_1 = reduceWithIndex(args[0]);\n return function (b, f) { return reduceWithIndexO_1(b, function (_, b, a) { return f(b, a); }); };\n }\n return reduce(S.Ord).apply(void 0, args);\n}\nexports.reduce = reduce;\nfunction foldMap(O) {\n if ('compare' in O) {\n var foldMapWithIndexO_1 = foldMapWithIndex(O);\n return function (M) {\n var foldMapWithIndexM = foldMapWithIndexO_1(M);\n return function (f) { return foldMapWithIndexM(function (_, a) { return f(a); }); };\n };\n }\n return foldMap(S.Ord)(O);\n}\nexports.foldMap = foldMap;\nfunction reduceRight() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (args.length === 1) {\n var reduceRightWithIndexO_1 = reduceRightWithIndex(args[0]);\n return function (b, f) { return reduceRightWithIndexO_1(b, function (_, b, a) { return f(b, a); }); };\n }\n return reduceRight(S.Ord).apply(void 0, args);\n}\nexports.reduceRight = reduceRight;\n/**\n * @category Compactable\n * @since 2.5.0\n */\nvar compact = function (r) {\n var out = {};\n for (var k in r) {\n if (_.has.call(r, k)) {\n var oa = r[k];\n if (_.isSome(oa)) {\n out[k] = oa.value;\n }\n }\n }\n return out;\n};\nexports.compact = compact;\n/**\n * @category Compactable\n * @since 2.5.0\n */\nvar separate = function (r) {\n var left = {};\n var right = {};\n for (var k in r) {\n if (_.has.call(r, k)) {\n var e = r[k];\n if (_.isLeft(e)) {\n left[k] = e.left;\n }\n else {\n right[k] = e.right;\n }\n }\n }\n return Separated_1.separated(left, right);\n};\nexports.separate = separate;\n// -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n/**\n * @category instances\n * @since 2.5.0\n */\nexports.URI = 'ReadonlyRecord';\nfunction getShow(O) {\n if ('compare' in O) {\n return function (S) { return ({\n show: function (r) {\n var elements = collect(O)(function (k, a) { return JSON.stringify(k) + \": \" + S.show(a); })(r).join(', ');\n return elements === '' ? '{}' : \"{ \" + elements + \" }\";\n }\n }); };\n }\n return getShow(S.Ord)(O);\n}\nexports.getShow = getShow;\nfunction getEq(E) {\n var isSubrecordE = isSubrecord(E);\n return Eq_1.fromEquals(function (x, y) { return isSubrecordE(x)(y) && isSubrecordE(y)(x); });\n}\nexports.getEq = getEq;\nfunction getMonoid(S) {\n return {\n concat: function (first, second) {\n if (exports.isEmpty(first)) {\n return second;\n }\n if (exports.isEmpty(second)) {\n return first;\n }\n var r = Object.assign({}, first);\n for (var k in second) {\n if (_.has.call(second, k)) {\n r[k] = _.has.call(first, k) ? S.concat(first[k], second[k]) : second[k];\n }\n }\n return r;\n },\n empty: exports.empty\n };\n}\nexports.getMonoid = getMonoid;\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Functor = {\n URI: exports.URI,\n map: exports._map\n};\n/**\n * Derivable from `Functor`.\n *\n * @category combinators\n * @since 2.10.0\n */\nexports.flap = \n/*#__PURE__*/\nFunctor_1.flap(exports.Functor);\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.FunctorWithIndex = {\n URI: exports.URI,\n map: exports._map,\n mapWithIndex: exports._mapWithIndex\n};\n/**\n * @category instances\n * @since 2.11.0\n */\nvar getFoldable = function (O) { return ({\n URI: exports.URI,\n reduce: exports._reduce(O),\n foldMap: exports._foldMap(O),\n reduceRight: exports._reduceRight(O)\n}); };\nexports.getFoldable = getFoldable;\n/**\n * @category instances\n * @since 2.11.0\n */\nvar getFoldableWithIndex = function (O) { return ({\n URI: exports.URI,\n reduce: exports._reduce(O),\n foldMap: exports._foldMap(O),\n reduceRight: exports._reduceRight(O),\n reduceWithIndex: exports._reduceWithIndex(O),\n foldMapWithIndex: exports._foldMapWithIndex(O),\n reduceRightWithIndex: exports._reduceRightWithIndex(O)\n}); };\nexports.getFoldableWithIndex = getFoldableWithIndex;\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Compactable = {\n URI: exports.URI,\n compact: exports.compact,\n separate: exports.separate\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Filterable = {\n URI: exports.URI,\n map: exports._map,\n compact: exports.compact,\n separate: exports.separate,\n filter: exports._filter,\n filterMap: exports._filterMap,\n partition: exports._partition,\n partitionMap: exports._partitionMap\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.FilterableWithIndex = {\n URI: exports.URI,\n map: exports._map,\n mapWithIndex: exports._mapWithIndex,\n compact: exports.compact,\n separate: exports.separate,\n filter: exports._filter,\n filterMap: exports._filterMap,\n partition: exports._partition,\n partitionMap: exports._partitionMap,\n filterMapWithIndex: exports._filterMapWithIndex,\n filterWithIndex: exports._filterWithIndex,\n partitionMapWithIndex: exports._partitionMapWithIndex,\n partitionWithIndex: exports._partitionWithIndex\n};\n/**\n * @category instances\n * @since 2.11.0\n */\nvar getTraversable = function (O) { return ({\n URI: exports.URI,\n map: exports._map,\n reduce: exports._reduce(O),\n foldMap: exports._foldMap(O),\n reduceRight: exports._reduceRight(O),\n traverse: exports._traverse(O),\n sequence: exports._sequence(O)\n}); };\nexports.getTraversable = getTraversable;\n/**\n * @category instances\n * @since 2.11.0\n */\nvar getTraversableWithIndex = function (O) { return ({\n URI: exports.URI,\n map: exports._map,\n mapWithIndex: exports._mapWithIndex,\n reduce: exports._reduce(O),\n foldMap: exports._foldMap(O),\n reduceRight: exports._reduceRight(O),\n reduceWithIndex: exports._reduceWithIndex(O),\n foldMapWithIndex: exports._foldMapWithIndex(O),\n reduceRightWithIndex: exports._reduceRightWithIndex(O),\n traverse: exports._traverse(O),\n sequence: exports._sequence(O),\n traverseWithIndex: _traverseWithIndex(O)\n}); };\nexports.getTraversableWithIndex = getTraversableWithIndex;\n/**\n * @category instances\n * @since 2.11.0\n */\nvar getWitherable = function (O) {\n var T = exports.getTraversable(O);\n return {\n URI: exports.URI,\n map: exports._map,\n reduce: exports._reduce(O),\n foldMap: exports._foldMap(O),\n reduceRight: exports._reduceRight(O),\n traverse: T.traverse,\n sequence: T.sequence,\n compact: exports.compact,\n separate: exports.separate,\n filter: exports._filter,\n filterMap: exports._filterMap,\n partition: exports._partition,\n partitionMap: exports._partitionMap,\n wither: Witherable_1.witherDefault(T, exports.Compactable),\n wilt: Witherable_1.wiltDefault(T, exports.Compactable)\n };\n};\nexports.getWitherable = getWitherable;\n/**\n * @category instances\n * @since 2.11.0\n */\nvar getUnionSemigroup = function (S) {\n var unionS = exports.union(S);\n return {\n concat: function (first, second) { return unionS(second)(first); }\n };\n};\nexports.getUnionSemigroup = getUnionSemigroup;\n/**\n * @category instances\n * @since 2.11.0\n */\nvar getUnionMonoid = function (S) { return ({\n concat: exports.getUnionSemigroup(S).concat,\n empty: exports.empty\n}); };\nexports.getUnionMonoid = getUnionMonoid;\n/**\n * @category instances\n * @since 2.11.0\n */\nvar getIntersectionSemigroup = function (S) {\n var intersectionS = exports.intersection(S);\n return {\n concat: function (first, second) { return intersectionS(second)(first); }\n };\n};\nexports.getIntersectionSemigroup = getIntersectionSemigroup;\n/**\n * @category instances\n * @since 2.11.0\n */\nvar getDifferenceMagma = function () { return ({\n concat: function (first, second) { return exports.difference(second)(first); }\n}); };\nexports.getDifferenceMagma = getDifferenceMagma;\n// -------------------------------------------------------------------------------------\n// deprecated\n// -------------------------------------------------------------------------------------\n// tslint:disable: deprecation\n/**\n * Use `getFoldable` instead.\n *\n * @category instances\n * @since 2.7.0\n * @deprecated\n */\nexports.Foldable = {\n URI: exports.URI,\n reduce: \n /*#__PURE__*/\n exports._reduce(S.Ord),\n foldMap: \n /*#__PURE__*/\n exports._foldMap(S.Ord),\n reduceRight: \n /*#__PURE__*/\n exports._reduceRight(S.Ord)\n};\n/**\n * Use `getFoldableWithIndex` instead.\n *\n * @category instances\n * @since 2.7.0\n * @deprecated\n */\nexports.FoldableWithIndex = {\n URI: exports.URI,\n reduce: \n /*#__PURE__*/\n exports._reduce(S.Ord),\n foldMap: \n /*#__PURE__*/\n exports._foldMap(S.Ord),\n reduceRight: \n /*#__PURE__*/\n exports._reduceRight(S.Ord),\n reduceWithIndex: \n /*#__PURE__*/\n exports._reduceWithIndex(S.Ord),\n foldMapWithIndex: \n /*#__PURE__*/\n exports._foldMapWithIndex(S.Ord),\n reduceRightWithIndex: \n /*#__PURE__*/\n exports._reduceRightWithIndex(S.Ord)\n};\n/**\n * Use `getTraversable` instead.\n *\n * @category instances\n * @since 2.7.0\n * @deprecated\n */\nexports.Traversable = {\n URI: exports.URI,\n map: exports._map,\n reduce: \n /*#__PURE__*/\n exports._reduce(S.Ord),\n foldMap: \n /*#__PURE__*/\n exports._foldMap(S.Ord),\n reduceRight: \n /*#__PURE__*/\n exports._reduceRight(S.Ord),\n traverse: \n /*#__PURE__*/\n exports._traverse(S.Ord),\n sequence: sequence\n};\n/**\n * Use `getTraversableWithIndex` instead.\n *\n * @category instances\n * @since 2.7.0\n * @deprecated\n */\nexports.TraversableWithIndex = {\n URI: exports.URI,\n map: exports._map,\n mapWithIndex: exports._mapWithIndex,\n reduce: \n /*#__PURE__*/\n exports._reduce(S.Ord),\n foldMap: \n /*#__PURE__*/\n exports._foldMap(S.Ord),\n reduceRight: \n /*#__PURE__*/\n exports._reduceRight(S.Ord),\n reduceWithIndex: \n /*#__PURE__*/\n exports._reduceWithIndex(S.Ord),\n foldMapWithIndex: \n /*#__PURE__*/\n exports._foldMapWithIndex(S.Ord),\n reduceRightWithIndex: \n /*#__PURE__*/\n exports._reduceRightWithIndex(S.Ord),\n traverse: \n /*#__PURE__*/\n exports._traverse(S.Ord),\n sequence: sequence,\n traverseWithIndex: \n /*#__PURE__*/\n _traverseWithIndex(S.Ord)\n};\nvar _wither = \n/*#__PURE__*/\nWitherable_1.witherDefault(exports.Traversable, exports.Compactable);\nvar _wilt = \n/*#__PURE__*/\nWitherable_1.wiltDefault(exports.Traversable, exports.Compactable);\n/**\n * Use `getWitherable` instead.\n *\n * @category instances\n * @since 2.7.0\n * @deprecated\n */\nexports.Witherable = {\n URI: exports.URI,\n map: exports._map,\n reduce: \n /*#__PURE__*/\n exports._reduce(S.Ord),\n foldMap: \n /*#__PURE__*/\n exports._foldMap(S.Ord),\n reduceRight: \n /*#__PURE__*/\n exports._reduceRight(S.Ord),\n traverse: \n /*#__PURE__*/\n exports._traverse(S.Ord),\n sequence: sequence,\n compact: exports.compact,\n separate: exports.separate,\n filter: exports._filter,\n filterMap: exports._filterMap,\n partition: exports._partition,\n partitionMap: exports._partitionMap,\n wither: _wither,\n wilt: _wilt\n};\n/**\n * Use [`upsertAt`](#upsertat) instead.\n *\n * @category combinators\n * @since 2.5.0\n * @deprecated\n */\nexports.insertAt = exports.upsertAt;\nfunction hasOwnProperty(k, r) {\n return _.has.call(r === undefined ? this : r, k);\n}\nexports.hasOwnProperty = hasOwnProperty;\n/**\n * Use small, specific instances instead.\n *\n * @category instances\n * @since 2.5.0\n * @deprecated\n */\nexports.readonlyRecord = {\n URI: exports.URI,\n map: exports._map,\n reduce: \n /*#__PURE__*/\n exports._reduce(S.Ord),\n foldMap: \n /*#__PURE__*/\n exports._foldMap(S.Ord),\n reduceRight: \n /*#__PURE__*/\n exports._reduceRight(S.Ord),\n traverse: \n /*#__PURE__*/\n exports._traverse(S.Ord),\n sequence: sequence,\n compact: exports.compact,\n separate: exports.separate,\n filter: exports._filter,\n filterMap: exports._filterMap,\n partition: exports._partition,\n partitionMap: exports._partitionMap,\n mapWithIndex: exports._mapWithIndex,\n reduceWithIndex: \n /*#__PURE__*/\n exports._reduceWithIndex(S.Ord),\n foldMapWithIndex: \n /*#__PURE__*/\n exports._foldMapWithIndex(S.Ord),\n reduceRightWithIndex: \n /*#__PURE__*/\n exports._reduceRightWithIndex(S.Ord),\n filterMapWithIndex: exports._filterMapWithIndex,\n filterWithIndex: exports._filterWithIndex,\n partitionMapWithIndex: exports._partitionMapWithIndex,\n partitionWithIndex: exports._partitionWithIndex,\n traverseWithIndex: \n /*#__PURE__*/\n _traverseWithIndex(S.Ord),\n wither: _wither,\n wilt: _wilt\n};\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getMonoid = exports.getEq = exports.getShow = exports.URI = exports.separate = exports.compact = exports.reduceRight = exports.foldMap = exports.reduce = exports.partitionMap = exports.partition = exports.filterMap = exports.filter = exports.difference = exports.intersection = exports.union = exports.elem = exports.some = exports.every = exports.fromFoldableMap = exports.fromFoldable = exports.filterWithIndex = exports.filterMapWithIndex = exports.partitionWithIndex = exports.partitionMapWithIndex = exports.wilt = exports.wither = exports.sequence = exports.traverse = exports.traverseWithIndex = exports.singleton = exports.reduceRightWithIndex = exports.foldMapWithIndex = exports.reduceWithIndex = exports.map = exports.mapWithIndex = exports.lookup = exports.isSubrecord = exports.pop = exports.modifyAt = exports.updateAt = exports.deleteAt = exports.has = exports.upsertAt = exports.toUnfoldable = exports.toArray = exports.collect = exports.keys = exports.isEmpty = exports.size = void 0;\nexports.record = exports.hasOwnProperty = exports.insertAt = exports.empty = exports.Witherable = exports.TraversableWithIndex = exports.Traversable = exports.FoldableWithIndex = exports.Foldable = exports.getDifferenceMagma = exports.getIntersectionSemigroup = exports.getUnionMonoid = exports.getUnionSemigroup = exports.getWitherable = exports.getTraversableWithIndex = exports.getTraversable = exports.FilterableWithIndex = exports.Filterable = exports.Compactable = exports.getFoldableWithIndex = exports.getFoldable = exports.FunctorWithIndex = exports.flap = exports.Functor = void 0;\nvar function_1 = require(\"./function\");\nvar Functor_1 = require(\"./Functor\");\nvar _ = __importStar(require(\"./internal\"));\nvar RR = __importStar(require(\"./ReadonlyRecord\"));\nvar S = __importStar(require(\"./string\"));\nvar Witherable_1 = require(\"./Witherable\");\n// -------------------------------------------------------------------------------------\n// model\n// -------------------------------------------------------------------------------------\n/**\n * Calculate the number of key/value pairs in a `Record`.\n *\n * @since 2.0.0\n */\nexports.size = RR.size;\n/**\n * Test whether a `Record` is empty.\n *\n * @since 2.0.0\n */\nexports.isEmpty = RR.isEmpty;\nvar keys_ = function (O) { return function (r) {\n return Object.keys(r).sort(O.compare);\n}; };\n/**\n * @since 2.0.0\n */\nexports.keys = \n/*#__PURE__*/\nkeys_(S.Ord);\nfunction collect(O) {\n if (typeof O === 'function') {\n return collect(S.Ord)(O);\n }\n var keysO = keys_(O);\n return function (f) { return function (r) {\n var out = [];\n for (var _i = 0, _a = keysO(r); _i < _a.length; _i++) {\n var key = _a[_i];\n out.push(f(key, r[key]));\n }\n return out;\n }; };\n}\nexports.collect = collect;\n/**\n * Get a sorted `Array` of the key/value pairs contained in a `Record`.\n *\n * @since 2.0.0\n */\nexports.toArray = \n/*#__PURE__*/\ncollect(S.Ord)(function (k, a) { return [k, a]; });\nfunction toUnfoldable(U) {\n return function (r) {\n var sas = exports.toArray(r);\n var len = sas.length;\n return U.unfold(0, function (b) { return (b < len ? _.some([sas[b], b + 1]) : _.none); });\n };\n}\nexports.toUnfoldable = toUnfoldable;\n/**\n * Insert or replace a key/value pair in a `Record`.\n *\n * @category combinators\n * @since 2.10.0\n */\nexports.upsertAt = RR.upsertAt;\n/**\n * Test whether or not a key exists in a `Record`.\n *\n * Note. This function is not pipeable because is a `Refinement`.\n *\n * @since 2.10.0\n */\nexports.has = RR.has;\nfunction deleteAt(k) {\n return function (r) {\n if (!_.has.call(r, k)) {\n return r;\n }\n var out = Object.assign({}, r);\n delete out[k];\n return out;\n };\n}\nexports.deleteAt = deleteAt;\n/**\n * @since 2.0.0\n */\nvar updateAt = function (k, a) {\n return exports.modifyAt(k, function () { return a; });\n};\nexports.updateAt = updateAt;\n/**\n * @since 2.0.0\n */\nvar modifyAt = function (k, f) { return function (r) {\n if (!exports.has(k, r)) {\n return _.none;\n }\n var out = Object.assign({}, r);\n out[k] = f(r[k]);\n return _.some(out);\n}; };\nexports.modifyAt = modifyAt;\nfunction pop(k) {\n var deleteAtk = deleteAt(k);\n return function (r) {\n var oa = exports.lookup(k, r);\n return _.isNone(oa) ? _.none : _.some([oa.value, deleteAtk(r)]);\n };\n}\nexports.pop = pop;\n// TODO: remove non-curried overloading in v3\n/**\n * Test whether one `Record` contains all of the keys and values contained in another `Record`.\n *\n * @since 2.0.0\n */\nexports.isSubrecord = RR.isSubrecord;\n// TODO: remove non-curried overloading in v3\n/**\n * Lookup the value for a key in a `Record`.\n *\n * @since 2.0.0\n */\nexports.lookup = RR.lookup;\n/**\n * Map a `Record` passing the keys to the iterating function.\n *\n * @since 2.0.0\n */\nexports.mapWithIndex = RR.mapWithIndex;\n/**\n * Map a `Record` passing the values to the iterating function.\n *\n * @since 2.0.0\n */\nexports.map = RR.map;\nfunction reduceWithIndex() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return args.length === 1 ? RR.reduceWithIndex(args[0]) : RR.reduceWithIndex(S.Ord).apply(void 0, args);\n}\nexports.reduceWithIndex = reduceWithIndex;\nfunction foldMapWithIndex(O) {\n return 'compare' in O ? RR.foldMapWithIndex(O) : RR.foldMapWithIndex(S.Ord)(O);\n}\nexports.foldMapWithIndex = foldMapWithIndex;\nfunction reduceRightWithIndex() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return args.length === 1 ? RR.reduceRightWithIndex(args[0]) : RR.reduceRightWithIndex(S.Ord).apply(void 0, args);\n}\nexports.reduceRightWithIndex = reduceRightWithIndex;\n/**\n * Create a `Record` with one key/value pair.\n *\n * @since 2.0.0\n */\nexports.singleton = RR.singleton;\nfunction traverseWithIndex(F) {\n return RR.traverseWithIndex(F);\n}\nexports.traverseWithIndex = traverseWithIndex;\nfunction traverse(F) {\n return RR.traverse(F);\n}\nexports.traverse = traverse;\nfunction sequence(F) {\n return RR.sequence(F);\n}\nexports.sequence = sequence;\n/**\n * @category Witherable\n * @since 2.6.5\n */\nvar wither = function (F) {\n var traverseF = traverse(F);\n return function (f) { return function (fa) { return F.map(function_1.pipe(fa, traverseF(f)), exports.compact); }; };\n};\nexports.wither = wither;\n/**\n * @category Witherable\n * @since 2.6.5\n */\nvar wilt = function (F) {\n var traverseF = traverse(F);\n return function (f) { return function (fa) { return F.map(function_1.pipe(fa, traverseF(f)), exports.separate); }; };\n};\nexports.wilt = wilt;\n/**\n * @since 2.0.0\n */\nexports.partitionMapWithIndex = RR.partitionMapWithIndex;\nfunction partitionWithIndex(predicateWithIndex) {\n return RR.partitionWithIndex(predicateWithIndex);\n}\nexports.partitionWithIndex = partitionWithIndex;\n/**\n * @since 2.0.0\n */\nexports.filterMapWithIndex = RR.filterMapWithIndex;\nfunction filterWithIndex(predicateWithIndex) {\n return RR.filterWithIndex(predicateWithIndex);\n}\nexports.filterWithIndex = filterWithIndex;\nfunction fromFoldable(M, F) {\n return RR.fromFoldable(M, F);\n}\nexports.fromFoldable = fromFoldable;\nfunction fromFoldableMap(M, F) {\n return RR.fromFoldableMap(M, F);\n}\nexports.fromFoldableMap = fromFoldableMap;\n/**\n * @since 2.0.0\n */\nexports.every = RR.every;\n/**\n * @since 2.0.0\n */\nexports.some = RR.some;\n// TODO: remove non-curried overloading in v3\n/**\n * @since 2.0.0\n */\nexports.elem = RR.elem;\n/**\n * @category combinators\n * @since 2.11.0\n */\nvar union = function (M) {\n var unionM = RR.union(M);\n return function (second) { return function (first) {\n if (exports.isEmpty(first)) {\n return __assign({}, second);\n }\n if (exports.isEmpty(second)) {\n return __assign({}, first);\n }\n return unionM(second)(first);\n }; };\n};\nexports.union = union;\n/**\n * @category combinators\n * @since 2.11.0\n */\nvar intersection = function (M) { return function (second) { return function (first) {\n if (exports.isEmpty(first) || exports.isEmpty(second)) {\n return {};\n }\n return RR.intersection(M)(second)(first);\n}; }; };\nexports.intersection = intersection;\n/**\n * @category combinators\n * @since 2.11.0\n */\nvar difference = function (second) { return function (first) {\n if (exports.isEmpty(first)) {\n return __assign({}, second);\n }\n if (exports.isEmpty(second)) {\n return __assign({}, first);\n }\n return RR.difference(second)(first);\n}; };\nexports.difference = difference;\n// -------------------------------------------------------------------------------------\n// non-pipeables\n// -------------------------------------------------------------------------------------\nvar _map = RR._map;\nvar _mapWithIndex = RR._mapWithIndex;\nvar _reduce = RR._reduce;\nvar _foldMap = RR._foldMap;\nvar _reduceRight = RR._reduceRight;\nvar _filter = RR._filter;\nvar _filterMap = RR._filterMap;\nvar _partition = RR._partition;\nvar _partitionMap = RR._partitionMap;\nvar _reduceWithIndex = RR._reduceWithIndex;\nvar _foldMapWithIndex = RR._foldMapWithIndex;\nvar _reduceRightWithIndex = RR._reduceRightWithIndex;\nvar _partitionMapWithIndex = RR._partitionMapWithIndex;\nvar _partitionWithIndex = RR._partitionWithIndex;\nvar _filterMapWithIndex = RR._filterMapWithIndex;\nvar _filterWithIndex = RR._filterWithIndex;\nvar _traverse = RR._traverse;\nvar _sequence = RR._sequence;\nvar _traverseWithIndex = function (O) { return function (F) {\n var keysO = keys_(O);\n return function (ta, f) {\n var ks = keysO(ta);\n if (ks.length === 0) {\n return F.of({});\n }\n var fr = F.of({});\n var _loop_1 = function (key) {\n fr = F.ap(F.map(fr, function (r) { return function (b) {\n r[key] = b;\n return r;\n }; }), f(key, ta[key]));\n };\n for (var _i = 0, ks_1 = ks; _i < ks_1.length; _i++) {\n var key = ks_1[_i];\n _loop_1(key);\n }\n return fr;\n };\n}; };\n// -------------------------------------------------------------------------------------\n// type class members\n// -------------------------------------------------------------------------------------\n/**\n * @category Filterable\n * @since 2.0.0\n */\nexports.filter = RR.filter;\n/**\n * @category Filterable\n * @since 2.0.0\n */\nexports.filterMap = RR.filterMap;\n/**\n * @category Filterable\n * @since 2.0.0\n */\nexports.partition = RR.partition;\n/**\n * @category Filterable\n * @since 2.0.0\n */\nexports.partitionMap = RR.partitionMap;\nfunction reduce() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return args.length === 1 ? RR.reduce(args[0]) : RR.reduce(S.Ord).apply(void 0, args);\n}\nexports.reduce = reduce;\nfunction foldMap(O) {\n return 'compare' in O ? RR.foldMap(O) : RR.foldMap(S.Ord)(O);\n}\nexports.foldMap = foldMap;\nfunction reduceRight() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return args.length === 1 ? RR.reduceRight(args[0]) : RR.reduceRight(S.Ord).apply(void 0, args);\n}\nexports.reduceRight = reduceRight;\n/**\n * @category Compactable\n * @since 2.0.0\n */\nexports.compact = RR.compact;\n/**\n * @category Compactable\n * @since 2.0.0\n */\nexports.separate = RR.separate;\n// -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.URI = 'Record';\nfunction getShow(O) {\n return 'compare' in O ? RR.getShow(O) : RR.getShow(S.Ord)(O);\n}\nexports.getShow = getShow;\n/**\n * @category instances\n * @since 2.0.0\n */\nexports.getEq = RR.getEq;\n/**\n * Returns a `Monoid` instance for `Record`s given a `Semigroup` instance for their values.\n *\n * @example\n * import { SemigroupSum } from 'fp-ts/number'\n * import { getMonoid } from 'fp-ts/Record'\n *\n * const M = getMonoid(SemigroupSum)\n * assert.deepStrictEqual(M.concat({ foo: 123 }, { foo: 456 }), { foo: 579 })\n *\n * @category instances\n * @since 2.0.0\n */\nexports.getMonoid = RR.getMonoid;\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Functor = {\n URI: exports.URI,\n map: _map\n};\n/**\n * Derivable from `Functor`.\n *\n * @category combinators\n * @since 2.10.0\n */\nexports.flap = \n/*#__PURE__*/\nFunctor_1.flap(exports.Functor);\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.FunctorWithIndex = {\n URI: exports.URI,\n map: _map,\n mapWithIndex: _mapWithIndex\n};\n/**\n * @category instances\n * @since 2.11.0\n */\nvar getFoldable = function (O) { return ({\n URI: exports.URI,\n reduce: _reduce(O),\n foldMap: _foldMap(O),\n reduceRight: _reduceRight(O)\n}); };\nexports.getFoldable = getFoldable;\n/**\n * @category instances\n * @since 2.11.0\n */\nvar getFoldableWithIndex = function (O) { return ({\n URI: exports.URI,\n reduce: _reduce(O),\n foldMap: _foldMap(O),\n reduceRight: _reduceRight(O),\n reduceWithIndex: _reduceWithIndex(O),\n foldMapWithIndex: _foldMapWithIndex(O),\n reduceRightWithIndex: _reduceRightWithIndex(O)\n}); };\nexports.getFoldableWithIndex = getFoldableWithIndex;\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Compactable = {\n URI: exports.URI,\n compact: exports.compact,\n separate: exports.separate\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.Filterable = {\n URI: exports.URI,\n map: _map,\n compact: exports.compact,\n separate: exports.separate,\n filter: _filter,\n filterMap: _filterMap,\n partition: _partition,\n partitionMap: _partitionMap\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexports.FilterableWithIndex = {\n URI: exports.URI,\n map: _map,\n mapWithIndex: _mapWithIndex,\n compact: exports.compact,\n separate: exports.separate,\n filter: _filter,\n filterMap: _filterMap,\n partition: _partition,\n partitionMap: _partitionMap,\n filterMapWithIndex: _filterMapWithIndex,\n filterWithIndex: _filterWithIndex,\n partitionMapWithIndex: _partitionMapWithIndex,\n partitionWithIndex: _partitionWithIndex\n};\n/**\n * @category instances\n * @since 2.11.0\n */\nvar getTraversable = function (O) { return ({\n URI: exports.URI,\n map: _map,\n reduce: _reduce(O),\n foldMap: _foldMap(O),\n reduceRight: _reduceRight(O),\n traverse: _traverse(O),\n sequence: _sequence(O)\n}); };\nexports.getTraversable = getTraversable;\n/**\n * @category instances\n * @since 2.11.0\n */\nvar getTraversableWithIndex = function (O) { return ({\n URI: exports.URI,\n map: _map,\n mapWithIndex: _mapWithIndex,\n reduce: _reduce(O),\n foldMap: _foldMap(O),\n reduceRight: _reduceRight(O),\n reduceWithIndex: _reduceWithIndex(O),\n foldMapWithIndex: _foldMapWithIndex(O),\n reduceRightWithIndex: _reduceRightWithIndex(O),\n traverse: _traverse(O),\n sequence: _sequence(O),\n traverseWithIndex: _traverseWithIndex(O)\n}); };\nexports.getTraversableWithIndex = getTraversableWithIndex;\n/**\n * @category instances\n * @since 2.11.0\n */\nvar getWitherable = function (O) {\n var T = exports.getTraversable(O);\n return {\n URI: exports.URI,\n map: _map,\n reduce: _reduce(O),\n foldMap: _foldMap(O),\n reduceRight: _reduceRight(O),\n traverse: T.traverse,\n sequence: T.sequence,\n compact: exports.compact,\n separate: exports.separate,\n filter: _filter,\n filterMap: _filterMap,\n partition: _partition,\n partitionMap: _partitionMap,\n wither: Witherable_1.witherDefault(T, exports.Compactable),\n wilt: Witherable_1.wiltDefault(T, exports.Compactable)\n };\n};\nexports.getWitherable = getWitherable;\n/**\n * @category instances\n * @since 2.11.0\n */\nvar getUnionSemigroup = function (S) {\n var unionS = exports.union(S);\n return {\n concat: function (first, second) { return unionS(second)(first); }\n };\n};\nexports.getUnionSemigroup = getUnionSemigroup;\n/**\n * @category instances\n * @since 2.11.0\n */\nvar getUnionMonoid = function (S) { return ({\n concat: exports.getUnionSemigroup(S).concat,\n empty: {}\n}); };\nexports.getUnionMonoid = getUnionMonoid;\n/**\n * @category instances\n * @since 2.11.0\n */\nvar getIntersectionSemigroup = function (S) {\n var intersectionS = exports.intersection(S);\n return {\n concat: function (first, second) { return intersectionS(second)(first); }\n };\n};\nexports.getIntersectionSemigroup = getIntersectionSemigroup;\n/**\n * @category instances\n * @since 2.11.0\n */\nvar getDifferenceMagma = function () { return ({\n concat: function (first, second) { return exports.difference(second)(first); }\n}); };\nexports.getDifferenceMagma = getDifferenceMagma;\n// -------------------------------------------------------------------------------------\n// deprecated\n// -------------------------------------------------------------------------------------\n// tslint:disable: deprecation\n/**\n * Use `getFoldable` instead.\n *\n * @category instances\n * @since 2.7.0\n * @deprecated\n */\nexports.Foldable = {\n URI: exports.URI,\n reduce: \n /*#__PURE__*/\n _reduce(S.Ord),\n foldMap: \n /*#__PURE__*/\n _foldMap(S.Ord),\n reduceRight: \n /*#__PURE__*/\n _reduceRight(S.Ord)\n};\n/**\n * Use `getFoldableWithIndex` instead.\n *\n * @category instances\n * @since 2.7.0\n * @deprecated\n */\nexports.FoldableWithIndex = {\n URI: exports.URI,\n reduce: \n /*#__PURE__*/\n _reduce(S.Ord),\n foldMap: \n /*#__PURE__*/\n _foldMap(S.Ord),\n reduceRight: \n /*#__PURE__*/\n _reduceRight(S.Ord),\n reduceWithIndex: \n /*#__PURE__*/\n _reduceWithIndex(S.Ord),\n foldMapWithIndex: \n /*#__PURE__*/\n _foldMapWithIndex(S.Ord),\n reduceRightWithIndex: \n /*#__PURE__*/\n _reduceRightWithIndex(S.Ord)\n};\n/**\n * Use `getTraversable` instead.\n *\n * @category instances\n * @since 2.7.0\n * @deprecated\n */\nexports.Traversable = {\n URI: exports.URI,\n map: _map,\n reduce: \n /*#__PURE__*/\n _reduce(S.Ord),\n foldMap: \n /*#__PURE__*/\n _foldMap(S.Ord),\n reduceRight: \n /*#__PURE__*/\n _reduceRight(S.Ord),\n traverse: \n /*#__PURE__*/\n _traverse(S.Ord),\n sequence: sequence\n};\n/**\n * Use the `getTraversableWithIndex` instead.\n *\n * @category instances\n * @since 2.7.0\n * @deprecated\n */\nexports.TraversableWithIndex = {\n URI: exports.URI,\n map: _map,\n mapWithIndex: _mapWithIndex,\n reduce: \n /*#__PURE__*/\n _reduce(S.Ord),\n foldMap: \n /*#__PURE__*/\n _foldMap(S.Ord),\n reduceRight: \n /*#__PURE__*/\n _reduceRight(S.Ord),\n reduceWithIndex: \n /*#__PURE__*/\n _reduceWithIndex(S.Ord),\n foldMapWithIndex: \n /*#__PURE__*/\n _foldMapWithIndex(S.Ord),\n reduceRightWithIndex: \n /*#__PURE__*/\n _reduceRightWithIndex(S.Ord),\n traverse: \n /*#__PURE__*/\n _traverse(S.Ord),\n sequence: sequence,\n traverseWithIndex: \n /*#__PURE__*/\n _traverseWithIndex(S.Ord)\n};\nvar _wither = \n/*#__PURE__*/\nWitherable_1.witherDefault(exports.Traversable, exports.Compactable);\nvar _wilt = \n/*#__PURE__*/\nWitherable_1.wiltDefault(exports.Traversable, exports.Compactable);\n/**\n * Use `getWitherable` instead.\n *\n * @category instances\n * @since 2.7.0\n * @deprecated\n */\nexports.Witherable = {\n URI: exports.URI,\n map: _map,\n reduce: \n /*#__PURE__*/\n _reduce(S.Ord),\n foldMap: \n /*#__PURE__*/\n _foldMap(S.Ord),\n reduceRight: \n /*#__PURE__*/\n _reduceRight(S.Ord),\n traverse: \n /*#__PURE__*/\n _traverse(S.Ord),\n sequence: sequence,\n compact: exports.compact,\n separate: exports.separate,\n filter: _filter,\n filterMap: _filterMap,\n partition: _partition,\n partitionMap: _partitionMap,\n wither: _wither,\n wilt: _wilt\n};\n/**\n * Use a new `{}` instead.\n *\n * @since 2.0.0\n * @deprecated\n */\nexports.empty = {};\n/**\n * Use [`upsertAt`](#upsertat) instead.\n *\n * @since 2.0.0\n * @deprecated\n */\nexports.insertAt = exports.upsertAt;\n/**\n * Use [`has`](#has) instead.\n *\n * @since 2.0.0\n * @deprecated\n */\nexports.hasOwnProperty = RR.hasOwnProperty;\n/**\n * Use small, specific instances instead.\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nexports.record = {\n URI: exports.URI,\n map: _map,\n reduce: \n /*#__PURE__*/\n _reduce(S.Ord),\n foldMap: \n /*#__PURE__*/\n _foldMap(S.Ord),\n reduceRight: \n /*#__PURE__*/\n _reduceRight(S.Ord),\n traverse: \n /*#__PURE__*/\n _traverse(S.Ord),\n sequence: sequence,\n compact: exports.compact,\n separate: exports.separate,\n filter: _filter,\n filterMap: _filterMap,\n partition: _partition,\n partitionMap: _partitionMap,\n mapWithIndex: _mapWithIndex,\n reduceWithIndex: \n /*#__PURE__*/\n _reduceWithIndex(S.Ord),\n foldMapWithIndex: \n /*#__PURE__*/\n _foldMapWithIndex(S.Ord),\n reduceRightWithIndex: \n /*#__PURE__*/\n _reduceRightWithIndex(S.Ord),\n filterMapWithIndex: _filterMapWithIndex,\n filterWithIndex: _filterWithIndex,\n partitionMapWithIndex: _partitionMapWithIndex,\n partitionWithIndex: _partitionWithIndex,\n traverseWithIndex: \n /*#__PURE__*/\n _traverseWithIndex(S.Ord),\n wither: _wither,\n wilt: _wilt\n};\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.semigroupProduct = exports.semigroupSum = exports.semigroupString = exports.getFunctionSemigroup = exports.semigroupAny = exports.semigroupAll = exports.fold = exports.getIntercalateSemigroup = exports.getMeetSemigroup = exports.getJoinSemigroup = exports.getDualSemigroup = exports.getStructSemigroup = exports.getTupleSemigroup = exports.getFirstSemigroup = exports.getLastSemigroup = exports.getObjectSemigroup = exports.semigroupVoid = exports.concatAll = exports.last = exports.first = exports.intercalate = exports.tuple = exports.struct = exports.reverse = exports.constant = exports.max = exports.min = void 0;\n/**\n * If a type `A` can form a `Semigroup` it has an **associative** binary operation.\n *\n * ```ts\n * interface Semigroup {\n * readonly concat: (x: A, y: A) => A\n * }\n * ```\n *\n * Associativity means the following equality must hold for any choice of `x`, `y`, and `z`.\n *\n * ```ts\n * concat(x, concat(y, z)) = concat(concat(x, y), z)\n * ```\n *\n * A common example of a semigroup is the type `string` with the operation `+`.\n *\n * ```ts\n * import { Semigroup } from 'fp-ts/Semigroup'\n *\n * const semigroupString: Semigroup = {\n * concat: (x, y) => x + y\n * }\n *\n * const x = 'x'\n * const y = 'y'\n * const z = 'z'\n *\n * semigroupString.concat(x, y) // 'xy'\n *\n * semigroupString.concat(x, semigroupString.concat(y, z)) // 'xyz'\n *\n * semigroupString.concat(semigroupString.concat(x, y), z) // 'xyz'\n * ```\n *\n * *Adapted from https://typelevel.org/cats*\n *\n * @since 2.0.0\n */\nvar function_1 = require(\"./function\");\nvar _ = __importStar(require(\"./internal\"));\nvar M = __importStar(require(\"./Magma\"));\nvar Or = __importStar(require(\"./Ord\"));\n// -------------------------------------------------------------------------------------\n// constructors\n// -------------------------------------------------------------------------------------\n/**\n * Get a semigroup where `concat` will return the minimum, based on the provided order.\n *\n * @example\n * import * as N from 'fp-ts/number'\n * import * as S from 'fp-ts/Semigroup'\n *\n * const S1 = S.min(N.Ord)\n *\n * assert.deepStrictEqual(S1.concat(1, 2), 1)\n *\n * @category constructors\n * @since 2.10.0\n */\nvar min = function (O) { return ({\n concat: Or.min(O)\n}); };\nexports.min = min;\n/**\n * Get a semigroup where `concat` will return the maximum, based on the provided order.\n *\n * @example\n * import * as N from 'fp-ts/number'\n * import * as S from 'fp-ts/Semigroup'\n *\n * const S1 = S.max(N.Ord)\n *\n * assert.deepStrictEqual(S1.concat(1, 2), 2)\n *\n * @category constructors\n * @since 2.10.0\n */\nvar max = function (O) { return ({\n concat: Or.max(O)\n}); };\nexports.max = max;\n/**\n * @category constructors\n * @since 2.10.0\n */\nvar constant = function (a) { return ({\n concat: function () { return a; }\n}); };\nexports.constant = constant;\n// -------------------------------------------------------------------------------------\n// combinators\n// -------------------------------------------------------------------------------------\n/**\n * The dual of a `Semigroup`, obtained by swapping the arguments of `concat`.\n *\n * @example\n * import { reverse } from 'fp-ts/Semigroup'\n * import * as S from 'fp-ts/string'\n *\n * assert.deepStrictEqual(reverse(S.Semigroup).concat('a', 'b'), 'ba')\n *\n * @category combinators\n * @since 2.10.0\n */\nexports.reverse = M.reverse;\n/**\n * Given a struct of semigroups returns a semigroup for the struct.\n *\n * @example\n * import { struct } from 'fp-ts/Semigroup'\n * import * as N from 'fp-ts/number'\n *\n * interface Point {\n * readonly x: number\n * readonly y: number\n * }\n *\n * const S = struct({\n * x: N.SemigroupSum,\n * y: N.SemigroupSum\n * })\n *\n * assert.deepStrictEqual(S.concat({ x: 1, y: 2 }, { x: 3, y: 4 }), { x: 4, y: 6 })\n *\n * @category combinators\n * @since 2.10.0\n */\nvar struct = function (semigroups) { return ({\n concat: function (first, second) {\n var r = {};\n for (var k in semigroups) {\n if (_.has.call(semigroups, k)) {\n r[k] = semigroups[k].concat(first[k], second[k]);\n }\n }\n return r;\n }\n}); };\nexports.struct = struct;\n/**\n * Given a tuple of semigroups returns a semigroup for the tuple.\n *\n * @example\n * import { tuple } from 'fp-ts/Semigroup'\n * import * as B from 'fp-ts/boolean'\n * import * as N from 'fp-ts/number'\n * import * as S from 'fp-ts/string'\n *\n * const S1 = tuple(S.Semigroup, N.SemigroupSum)\n * assert.deepStrictEqual(S1.concat(['a', 1], ['b', 2]), ['ab', 3])\n *\n * const S2 = tuple(S.Semigroup, N.SemigroupSum, B.SemigroupAll)\n * assert.deepStrictEqual(S2.concat(['a', 1, true], ['b', 2, false]), ['ab', 3, false])\n *\n * @category combinators\n * @since 2.10.0\n */\nvar tuple = function () {\n var semigroups = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n semigroups[_i] = arguments[_i];\n }\n return ({\n concat: function (first, second) { return semigroups.map(function (s, i) { return s.concat(first[i], second[i]); }); }\n });\n};\nexports.tuple = tuple;\n/**\n * Between each pair of elements insert `middle`.\n *\n * @example\n * import { intercalate } from 'fp-ts/Semigroup'\n * import * as S from 'fp-ts/string'\n * import { pipe } from 'fp-ts/function'\n *\n * const S1 = pipe(S.Semigroup, intercalate(' + '))\n *\n * assert.strictEqual(S1.concat('a', 'b'), 'a + b')\n *\n * @category combinators\n * @since 2.10.0\n */\nvar intercalate = function (middle) { return function (S) { return ({\n concat: function (x, y) { return S.concat(x, S.concat(middle, y)); }\n}); }; };\nexports.intercalate = intercalate;\n// -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n/**\n * Always return the first argument.\n *\n * @example\n * import * as S from 'fp-ts/Semigroup'\n *\n * assert.deepStrictEqual(S.first().concat(1, 2), 1)\n *\n * @category instances\n * @since 2.10.0\n */\nvar first = function () { return ({ concat: function_1.identity }); };\nexports.first = first;\n/**\n * Always return the last argument.\n *\n * @example\n * import * as S from 'fp-ts/Semigroup'\n *\n * assert.deepStrictEqual(S.last().concat(1, 2), 2)\n *\n * @category instances\n * @since 2.10.0\n */\nvar last = function () { return ({ concat: function (_, y) { return y; } }); };\nexports.last = last;\n// -------------------------------------------------------------------------------------\n// utils\n// -------------------------------------------------------------------------------------\n/**\n * Given a sequence of `as`, concat them and return the total.\n *\n * If `as` is empty, return the provided `startWith` value.\n *\n * @example\n * import { concatAll } from 'fp-ts/Semigroup'\n * import * as N from 'fp-ts/number'\n *\n * const sum = concatAll(N.SemigroupSum)(0)\n *\n * assert.deepStrictEqual(sum([1, 2, 3]), 6)\n * assert.deepStrictEqual(sum([]), 0)\n *\n * @since 2.10.0\n */\nexports.concatAll = M.concatAll;\n// -------------------------------------------------------------------------------------\n// deprecated\n// -------------------------------------------------------------------------------------\n/**\n * Use `void` module instead.\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nexports.semigroupVoid = exports.constant(undefined);\n/**\n * Use [`getAssignSemigroup`](./struct.ts.html#getAssignSemigroup) instead.\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nvar getObjectSemigroup = function () { return ({\n concat: function (first, second) { return Object.assign({}, first, second); }\n}); };\nexports.getObjectSemigroup = getObjectSemigroup;\n/**\n * Use [`last`](#last) instead.\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nexports.getLastSemigroup = exports.last;\n/**\n * Use [`first`](#first) instead.\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nexports.getFirstSemigroup = exports.first;\n/**\n * Use [`tuple`](#tuple) instead.\n *\n * @category combinators\n * @since 2.0.0\n * @deprecated\n */\nexports.getTupleSemigroup = exports.tuple;\n/**\n * Use [`struct`](#struct) instead.\n *\n * @category combinators\n * @since 2.0.0\n * @deprecated\n */\nexports.getStructSemigroup = exports.struct;\n/**\n * Use [`reverse`](#reverse) instead.\n *\n * @category combinators\n * @since 2.0.0\n * @deprecated\n */\nexports.getDualSemigroup = exports.reverse;\n/**\n * Use [`max`](#max) instead.\n *\n * @category constructors\n * @since 2.0.0\n * @deprecated\n */\nexports.getJoinSemigroup = exports.max;\n/**\n * Use [`min`](#min) instead.\n *\n * @category constructors\n * @since 2.0.0\n * @deprecated\n */\nexports.getMeetSemigroup = exports.min;\n/**\n * Use [`intercalate`](#intercalate) instead.\n *\n * @category combinators\n * @since 2.5.0\n * @deprecated\n */\nexports.getIntercalateSemigroup = exports.intercalate;\nfunction fold(S) {\n var concatAllS = exports.concatAll(S);\n return function (startWith, as) { return (as === undefined ? concatAllS(startWith) : concatAllS(startWith)(as)); };\n}\nexports.fold = fold;\n/**\n * Use [`SemigroupAll`](./boolean.ts.html#SemigroupAll) instead.\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nexports.semigroupAll = {\n concat: function (x, y) { return x && y; }\n};\n/**\n * Use [`SemigroupAny`](./boolean.ts.html#SemigroupAny) instead.\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nexports.semigroupAny = {\n concat: function (x, y) { return x || y; }\n};\n/**\n * Use [`getSemigroup`](./function.ts.html#getSemigroup) instead.\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nexports.getFunctionSemigroup = function_1.getSemigroup;\n/**\n * Use [`Semigroup`](./string.ts.html#Semigroup) instead.\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nexports.semigroupString = {\n concat: function (x, y) { return x + y; }\n};\n/**\n * Use [`SemigroupSum`](./number.ts.html#SemigroupSum) instead.\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nexports.semigroupSum = {\n concat: function (x, y) { return x + y; }\n};\n/**\n * Use [`SemigroupProduct`](./number.ts.html#SemigroupProduct) instead.\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\nexports.semigroupProduct = {\n concat: function (x, y) { return x * y; }\n};\n","\"use strict\";\n/**\n * ```ts\n * interface Separated {\n * readonly left: E\n * readonly right: A\n * }\n * ```\n *\n * Represents a result of separating a whole into two parts.\n *\n * @since 2.10.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.right = exports.left = exports.flap = exports.Functor = exports.Bifunctor = exports.URI = exports.bimap = exports.mapLeft = exports.map = exports.separated = void 0;\nvar function_1 = require(\"./function\");\nvar Functor_1 = require(\"./Functor\");\n// -------------------------------------------------------------------------------------\n// constructors\n// -------------------------------------------------------------------------------------\n/**\n * @category constructors\n * @since 2.10.0\n */\nvar separated = function (left, right) { return ({ left: left, right: right }); };\nexports.separated = separated;\n// -------------------------------------------------------------------------------------\n// non-pipeables\n// -------------------------------------------------------------------------------------\nvar _map = function (fa, f) { return function_1.pipe(fa, exports.map(f)); };\nvar _mapLeft = function (fa, f) { return function_1.pipe(fa, exports.mapLeft(f)); };\nvar _bimap = function (fa, g, f) { return function_1.pipe(fa, exports.bimap(g, f)); };\n// -------------------------------------------------------------------------------------\n// type class members\n// -------------------------------------------------------------------------------------\n/**\n * `map` can be used to turn functions `(a: A) => B` into functions `(fa: F) => F` whose argument and return types\n * use the type constructor `F` to represent some computational context.\n *\n * @category Functor\n * @since 2.10.0\n */\nvar map = function (f) { return function (fa) {\n return exports.separated(exports.left(fa), f(exports.right(fa)));\n}; };\nexports.map = map;\n/**\n * Map a function over the first type argument of a bifunctor.\n *\n * @category Bifunctor\n * @since 2.10.0\n */\nvar mapLeft = function (f) { return function (fa) {\n return exports.separated(f(exports.left(fa)), exports.right(fa));\n}; };\nexports.mapLeft = mapLeft;\n/**\n * Map a pair of functions over the two type arguments of the bifunctor.\n *\n * @category Bifunctor\n * @since 2.10.0\n */\nvar bimap = function (f, g) { return function (fa) {\n return exports.separated(f(exports.left(fa)), g(exports.right(fa)));\n}; };\nexports.bimap = bimap;\n// -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n/**\n * @category instances\n * @since 2.10.0\n */\nexports.URI = 'Separated';\n/**\n * @category instances\n * @since 2.10.0\n */\nexports.Bifunctor = {\n URI: exports.URI,\n mapLeft: _mapLeft,\n bimap: _bimap\n};\n/**\n * @category instances\n * @since 2.10.0\n */\nexports.Functor = {\n URI: exports.URI,\n map: _map\n};\n/**\n * Derivable from `Functor`.\n *\n * @category combinators\n * @since 2.10.0\n */\nexports.flap = \n/*#__PURE__*/\nFunctor_1.flap(exports.Functor);\n// -------------------------------------------------------------------------------------\n// utils\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.10.0\n */\nvar left = function (s) { return s.left; };\nexports.left = left;\n/**\n * @since 2.10.0\n */\nvar right = function (s) { return s.right; };\nexports.right = right;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.filterE = exports.witherDefault = exports.wiltDefault = void 0;\nvar _ = __importStar(require(\"./internal\"));\nfunction wiltDefault(T, C) {\n return function (F) {\n var traverseF = T.traverse(F);\n return function (wa, f) { return F.map(traverseF(wa, f), C.separate); };\n };\n}\nexports.wiltDefault = wiltDefault;\nfunction witherDefault(T, C) {\n return function (F) {\n var traverseF = T.traverse(F);\n return function (wa, f) { return F.map(traverseF(wa, f), C.compact); };\n };\n}\nexports.witherDefault = witherDefault;\nfunction filterE(W) {\n return function (F) {\n var witherF = W.wither(F);\n return function (predicate) { return function (ga) { return witherF(ga, function (a) { return F.map(predicate(a), function (b) { return (b ? _.some(a) : _.none); }); }); }; };\n };\n}\nexports.filterE = filterE;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.guard = void 0;\nfunction guard(F, P) {\n return function (b) { return (b ? P.of(undefined) : F.zero()); };\n}\nexports.guard = guard;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getEndomorphismMonoid = exports.not = exports.SK = exports.hole = exports.pipe = exports.untupled = exports.tupled = exports.absurd = exports.decrement = exports.increment = exports.tuple = exports.flow = exports.flip = exports.constVoid = exports.constUndefined = exports.constNull = exports.constFalse = exports.constTrue = exports.constant = exports.unsafeCoerce = exports.identity = exports.apply = exports.getRing = exports.getSemiring = exports.getMonoid = exports.getSemigroup = exports.getBooleanAlgebra = void 0;\n// -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n/**\n * @category instances\n * @since 2.10.0\n */\nvar getBooleanAlgebra = function (B) { return function () { return ({\n meet: function (x, y) { return function (a) { return B.meet(x(a), y(a)); }; },\n join: function (x, y) { return function (a) { return B.join(x(a), y(a)); }; },\n zero: function () { return B.zero; },\n one: function () { return B.one; },\n implies: function (x, y) { return function (a) { return B.implies(x(a), y(a)); }; },\n not: function (x) { return function (a) { return B.not(x(a)); }; }\n}); }; };\nexports.getBooleanAlgebra = getBooleanAlgebra;\n/**\n * Unary functions form a semigroup as long as you can provide a semigroup for the codomain.\n *\n * @example\n * import { Predicate, getSemigroup } from 'fp-ts/function'\n * import * as B from 'fp-ts/boolean'\n *\n * const f: Predicate = (n) => n <= 2\n * const g: Predicate = (n) => n >= 0\n *\n * const S1 = getSemigroup(B.SemigroupAll)()\n *\n * assert.deepStrictEqual(S1.concat(f, g)(1), true)\n * assert.deepStrictEqual(S1.concat(f, g)(3), false)\n *\n * const S2 = getSemigroup(B.SemigroupAny)()\n *\n * assert.deepStrictEqual(S2.concat(f, g)(1), true)\n * assert.deepStrictEqual(S2.concat(f, g)(3), true)\n *\n * @category instances\n * @since 2.10.0\n */\nvar getSemigroup = function (S) { return function () { return ({\n concat: function (f, g) { return function (a) { return S.concat(f(a), g(a)); }; }\n}); }; };\nexports.getSemigroup = getSemigroup;\n/**\n * Unary functions form a monoid as long as you can provide a monoid for the codomain.\n *\n * @example\n * import { Predicate } from 'fp-ts/Predicate'\n * import { getMonoid } from 'fp-ts/function'\n * import * as B from 'fp-ts/boolean'\n *\n * const f: Predicate = (n) => n <= 2\n * const g: Predicate = (n) => n >= 0\n *\n * const M1 = getMonoid(B.MonoidAll)()\n *\n * assert.deepStrictEqual(M1.concat(f, g)(1), true)\n * assert.deepStrictEqual(M1.concat(f, g)(3), false)\n *\n * const M2 = getMonoid(B.MonoidAny)()\n *\n * assert.deepStrictEqual(M2.concat(f, g)(1), true)\n * assert.deepStrictEqual(M2.concat(f, g)(3), true)\n *\n * @category instances\n * @since 2.10.0\n */\nvar getMonoid = function (M) {\n var getSemigroupM = exports.getSemigroup(M);\n return function () { return ({\n concat: getSemigroupM().concat,\n empty: function () { return M.empty; }\n }); };\n};\nexports.getMonoid = getMonoid;\n/**\n * @category instances\n * @since 2.10.0\n */\nvar getSemiring = function (S) { return ({\n add: function (f, g) { return function (x) { return S.add(f(x), g(x)); }; },\n zero: function () { return S.zero; },\n mul: function (f, g) { return function (x) { return S.mul(f(x), g(x)); }; },\n one: function () { return S.one; }\n}); };\nexports.getSemiring = getSemiring;\n/**\n * @category instances\n * @since 2.10.0\n */\nvar getRing = function (R) {\n var S = exports.getSemiring(R);\n return {\n add: S.add,\n mul: S.mul,\n one: S.one,\n zero: S.zero,\n sub: function (f, g) { return function (x) { return R.sub(f(x), g(x)); }; }\n };\n};\nexports.getRing = getRing;\n// -------------------------------------------------------------------------------------\n// utils\n// -------------------------------------------------------------------------------------\n/**\n * @since 2.11.0\n */\nvar apply = function (a) { return function (f) { return f(a); }; };\nexports.apply = apply;\n/**\n * @since 2.0.0\n */\nfunction identity(a) {\n return a;\n}\nexports.identity = identity;\n/**\n * @since 2.0.0\n */\nexports.unsafeCoerce = identity;\n/**\n * @since 2.0.0\n */\nfunction constant(a) {\n return function () { return a; };\n}\nexports.constant = constant;\n/**\n * A thunk that returns always `true`.\n *\n * @since 2.0.0\n */\nexports.constTrue = \n/*#__PURE__*/\nconstant(true);\n/**\n * A thunk that returns always `false`.\n *\n * @since 2.0.0\n */\nexports.constFalse = \n/*#__PURE__*/\nconstant(false);\n/**\n * A thunk that returns always `null`.\n *\n * @since 2.0.0\n */\nexports.constNull = \n/*#__PURE__*/\nconstant(null);\n/**\n * A thunk that returns always `undefined`.\n *\n * @since 2.0.0\n */\nexports.constUndefined = \n/*#__PURE__*/\nconstant(undefined);\n/**\n * A thunk that returns always `void`.\n *\n * @since 2.0.0\n */\nexports.constVoid = exports.constUndefined;\n/**\n * Flips the order of the arguments of a function of two arguments.\n *\n * @since 2.0.0\n */\nfunction flip(f) {\n return function (b, a) { return f(a, b); };\n}\nexports.flip = flip;\nfunction flow(ab, bc, cd, de, ef, fg, gh, hi, ij) {\n switch (arguments.length) {\n case 1:\n return ab;\n case 2:\n return function () {\n return bc(ab.apply(this, arguments));\n };\n case 3:\n return function () {\n return cd(bc(ab.apply(this, arguments)));\n };\n case 4:\n return function () {\n return de(cd(bc(ab.apply(this, arguments))));\n };\n case 5:\n return function () {\n return ef(de(cd(bc(ab.apply(this, arguments)))));\n };\n case 6:\n return function () {\n return fg(ef(de(cd(bc(ab.apply(this, arguments))))));\n };\n case 7:\n return function () {\n return gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))));\n };\n case 8:\n return function () {\n return hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments))))))));\n };\n case 9:\n return function () {\n return ij(hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))))));\n };\n }\n return;\n}\nexports.flow = flow;\n/**\n * @since 2.0.0\n */\nfunction tuple() {\n var t = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n t[_i] = arguments[_i];\n }\n return t;\n}\nexports.tuple = tuple;\n/**\n * @since 2.0.0\n */\nfunction increment(n) {\n return n + 1;\n}\nexports.increment = increment;\n/**\n * @since 2.0.0\n */\nfunction decrement(n) {\n return n - 1;\n}\nexports.decrement = decrement;\n/**\n * @since 2.0.0\n */\nfunction absurd(_) {\n throw new Error('Called `absurd` function which should be uncallable');\n}\nexports.absurd = absurd;\n/**\n * Creates a tupled version of this function: instead of `n` arguments, it accepts a single tuple argument.\n *\n * @example\n * import { tupled } from 'fp-ts/function'\n *\n * const add = tupled((x: number, y: number): number => x + y)\n *\n * assert.strictEqual(add([1, 2]), 3)\n *\n * @since 2.4.0\n */\nfunction tupled(f) {\n return function (a) { return f.apply(void 0, a); };\n}\nexports.tupled = tupled;\n/**\n * Inverse function of `tupled`\n *\n * @since 2.4.0\n */\nfunction untupled(f) {\n return function () {\n var a = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n a[_i] = arguments[_i];\n }\n return f(a);\n };\n}\nexports.untupled = untupled;\nfunction pipe(a, ab, bc, cd, de, ef, fg, gh, hi) {\n switch (arguments.length) {\n case 1:\n return a;\n case 2:\n return ab(a);\n case 3:\n return bc(ab(a));\n case 4:\n return cd(bc(ab(a)));\n case 5:\n return de(cd(bc(ab(a))));\n case 6:\n return ef(de(cd(bc(ab(a)))));\n case 7:\n return fg(ef(de(cd(bc(ab(a))))));\n case 8:\n return gh(fg(ef(de(cd(bc(ab(a)))))));\n case 9:\n return hi(gh(fg(ef(de(cd(bc(ab(a))))))));\n default:\n var ret = arguments[0];\n for (var i = 1; i < arguments.length; i++) {\n ret = arguments[i](ret);\n }\n return ret;\n }\n}\nexports.pipe = pipe;\n/**\n * Type hole simulation\n *\n * @since 2.7.0\n */\nexports.hole = absurd;\n/**\n * @since 2.11.0\n */\nvar SK = function (_, b) { return b; };\nexports.SK = SK;\n/**\n * Use `Predicate` module instead.\n *\n * @since 2.0.0\n * @deprecated\n */\nfunction not(predicate) {\n return function (a) { return !predicate(a); };\n}\nexports.not = not;\n/**\n * Use `Endomorphism` module instead.\n *\n * @category instances\n * @since 2.10.0\n * @deprecated\n */\nvar getEndomorphismMonoid = function () { return ({\n concat: function (first, second) { return flow(first, second); },\n empty: identity\n}); };\nexports.getEndomorphismMonoid = getEndomorphismMonoid;\n","\"use strict\";\nvar __spreadArray = (this && this.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fromReadonlyNonEmptyArray = exports.has = exports.emptyRecord = exports.emptyReadonlyArray = exports.tail = exports.head = exports.isNonEmpty = exports.singleton = exports.right = exports.left = exports.isRight = exports.isLeft = exports.some = exports.none = exports.isSome = exports.isNone = void 0;\n// -------------------------------------------------------------------------------------\n// Option\n// -------------------------------------------------------------------------------------\n/** @internal */\nvar isNone = function (fa) { return fa._tag === 'None'; };\nexports.isNone = isNone;\n/** @internal */\nvar isSome = function (fa) { return fa._tag === 'Some'; };\nexports.isSome = isSome;\n/** @internal */\nexports.none = { _tag: 'None' };\n/** @internal */\nvar some = function (a) { return ({ _tag: 'Some', value: a }); };\nexports.some = some;\n// -------------------------------------------------------------------------------------\n// Either\n// -------------------------------------------------------------------------------------\n/** @internal */\nvar isLeft = function (ma) { return ma._tag === 'Left'; };\nexports.isLeft = isLeft;\n/** @internal */\nvar isRight = function (ma) { return ma._tag === 'Right'; };\nexports.isRight = isRight;\n/** @internal */\nvar left = function (e) { return ({ _tag: 'Left', left: e }); };\nexports.left = left;\n/** @internal */\nvar right = function (a) { return ({ _tag: 'Right', right: a }); };\nexports.right = right;\n// -------------------------------------------------------------------------------------\n// ReadonlyNonEmptyArray\n// -------------------------------------------------------------------------------------\n/** @internal */\nvar singleton = function (a) { return [a]; };\nexports.singleton = singleton;\n/** @internal */\nvar isNonEmpty = function (as) { return as.length > 0; };\nexports.isNonEmpty = isNonEmpty;\n/** @internal */\nvar head = function (as) { return as[0]; };\nexports.head = head;\n/** @internal */\nvar tail = function (as) { return as.slice(1); };\nexports.tail = tail;\n// -------------------------------------------------------------------------------------\n// empty\n// -------------------------------------------------------------------------------------\n/** @internal */\nexports.emptyReadonlyArray = [];\n/** @internal */\nexports.emptyRecord = {};\n// -------------------------------------------------------------------------------------\n// Record\n// -------------------------------------------------------------------------------------\n/** @internal */\nexports.has = Object.prototype.hasOwnProperty;\n// -------------------------------------------------------------------------------------\n// NonEmptyArray\n// -------------------------------------------------------------------------------------\n/** @internal */\nvar fromReadonlyNonEmptyArray = function (as) { return __spreadArray([as[0]], as.slice(1)); };\nexports.fromReadonlyNonEmptyArray = fromReadonlyNonEmptyArray;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Field = exports.MonoidProduct = exports.MonoidSum = exports.SemigroupProduct = exports.SemigroupSum = exports.MagmaSub = exports.Show = exports.Bounded = exports.Ord = exports.Eq = exports.isNumber = void 0;\n// -------------------------------------------------------------------------------------\n// refinements\n// -------------------------------------------------------------------------------------\n/**\n * @category refinements\n * @since 2.11.0\n */\nvar isNumber = function (u) { return typeof u === 'number'; };\nexports.isNumber = isNumber;\n// -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n/**\n * @category instances\n * @since 2.10.0\n */\nexports.Eq = {\n equals: function (first, second) { return first === second; }\n};\n/**\n * @category instances\n * @since 2.10.0\n */\nexports.Ord = {\n equals: exports.Eq.equals,\n compare: function (first, second) { return (first < second ? -1 : first > second ? 1 : 0); }\n};\n/**\n * @category instances\n * @since 2.10.0\n */\nexports.Bounded = {\n equals: exports.Eq.equals,\n compare: exports.Ord.compare,\n top: Infinity,\n bottom: -Infinity\n};\n/**\n * @category instances\n * @since 2.10.0\n */\nexports.Show = {\n show: function (n) { return JSON.stringify(n); }\n};\n/**\n * @category instances\n * @since 2.11.0\n */\nexports.MagmaSub = {\n concat: function (first, second) { return first - second; }\n};\n/**\n * `number` semigroup under addition.\n *\n * @example\n * import { SemigroupSum } from 'fp-ts/number'\n *\n * assert.deepStrictEqual(SemigroupSum.concat(2, 3), 5)\n *\n * @category instances\n * @since 2.10.0\n */\nexports.SemigroupSum = {\n concat: function (first, second) { return first + second; }\n};\n/**\n * `number` semigroup under multiplication.\n *\n * @example\n * import { SemigroupProduct } from 'fp-ts/number'\n *\n * assert.deepStrictEqual(SemigroupProduct.concat(2, 3), 6)\n *\n * @category instances\n * @since 2.10.0\n */\nexports.SemigroupProduct = {\n concat: function (first, second) { return first * second; }\n};\n/**\n * `number` monoid under addition.\n *\n * The `empty` value is `0`.\n *\n * @example\n * import { MonoidSum } from 'fp-ts/number'\n *\n * assert.deepStrictEqual(MonoidSum.concat(2, MonoidSum.empty), 2)\n *\n * @category instances\n * @since 2.10.0\n */\nexports.MonoidSum = {\n concat: exports.SemigroupSum.concat,\n empty: 0\n};\n/**\n * `number` monoid under multiplication.\n *\n * The `empty` value is `1`.\n *\n * @example\n * import { MonoidProduct } from 'fp-ts/number'\n *\n * assert.deepStrictEqual(MonoidProduct.concat(2, MonoidProduct.empty), 2)\n *\n * @category instances\n * @since 2.10.0\n */\nexports.MonoidProduct = {\n concat: exports.SemigroupProduct.concat,\n empty: 1\n};\n/**\n * @category instances\n * @since 2.10.0\n */\nexports.Field = {\n add: exports.SemigroupSum.concat,\n zero: 0,\n mul: exports.SemigroupProduct.concat,\n one: 1,\n sub: exports.MagmaSub.concat,\n degree: function (_) { return 1; },\n div: function (first, second) { return first / second; },\n mod: function (first, second) { return first % second; }\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.pipe = exports.pipeable = void 0;\nvar function_1 = require(\"./function\");\nvar isFunctor = function (I) { return typeof I.map === 'function'; };\nvar isContravariant = function (I) { return typeof I.contramap === 'function'; };\nvar isFunctorWithIndex = function (I) { return typeof I.mapWithIndex === 'function'; };\nvar isApply = function (I) { return typeof I.ap === 'function'; };\nvar isChain = function (I) { return typeof I.chain === 'function'; };\nvar isBifunctor = function (I) { return typeof I.bimap === 'function'; };\nvar isExtend = function (I) { return typeof I.extend === 'function'; };\nvar isFoldable = function (I) { return typeof I.reduce === 'function'; };\nvar isFoldableWithIndex = function (I) { return typeof I.reduceWithIndex === 'function'; };\nvar isAlt = function (I) { return typeof I.alt === 'function'; };\nvar isCompactable = function (I) { return typeof I.compact === 'function'; };\nvar isFilterable = function (I) { return typeof I.filter === 'function'; };\nvar isFilterableWithIndex = function (I) {\n return typeof I.filterWithIndex === 'function';\n};\nvar isProfunctor = function (I) { return typeof I.promap === 'function'; };\nvar isSemigroupoid = function (I) { return typeof I.compose === 'function'; };\nvar isMonadThrow = function (I) { return typeof I.throwError === 'function'; };\n/** @deprecated */\nfunction pipeable(I) {\n var r = {};\n if (isFunctor(I)) {\n var map = function (f) { return function (fa) { return I.map(fa, f); }; };\n r.map = map;\n }\n if (isContravariant(I)) {\n var contramap = function (f) { return function (fa) { return I.contramap(fa, f); }; };\n r.contramap = contramap;\n }\n if (isFunctorWithIndex(I)) {\n var mapWithIndex = function (f) { return function (fa) { return I.mapWithIndex(fa, f); }; };\n r.mapWithIndex = mapWithIndex;\n }\n if (isApply(I)) {\n var ap = function (fa) { return function (fab) { return I.ap(fab, fa); }; };\n var apFirst = function (fb) { return function (fa) {\n return I.ap(I.map(fa, function (a) { return function () { return a; }; }), fb);\n }; };\n r.ap = ap;\n r.apFirst = apFirst;\n r.apSecond = function (fb) { return function (fa) {\n return I.ap(I.map(fa, function () { return function (b) { return b; }; }), fb);\n }; };\n }\n if (isChain(I)) {\n var chain = function (f) { return function (ma) { return I.chain(ma, f); }; };\n var chainFirst = function (f) { return function (ma) { return I.chain(ma, function (a) { return I.map(f(a), function () { return a; }); }); }; };\n var flatten = function (mma) { return I.chain(mma, function_1.identity); };\n r.chain = chain;\n r.chainFirst = chainFirst;\n r.flatten = flatten;\n }\n if (isBifunctor(I)) {\n var bimap = function (f, g) { return function (fa) { return I.bimap(fa, f, g); }; };\n var mapLeft = function (f) { return function (fa) { return I.mapLeft(fa, f); }; };\n r.bimap = bimap;\n r.mapLeft = mapLeft;\n }\n if (isExtend(I)) {\n var extend = function (f) { return function (wa) { return I.extend(wa, f); }; };\n var duplicate = function (wa) { return I.extend(wa, function_1.identity); };\n r.extend = extend;\n r.duplicate = duplicate;\n }\n if (isFoldable(I)) {\n var reduce = function (b, f) { return function (fa) { return I.reduce(fa, b, f); }; };\n var foldMap = function (M) {\n var foldMapM = I.foldMap(M);\n return function (f) { return function (fa) { return foldMapM(fa, f); }; };\n };\n var reduceRight = function (b, f) { return function (fa) { return I.reduceRight(fa, b, f); }; };\n r.reduce = reduce;\n r.foldMap = foldMap;\n r.reduceRight = reduceRight;\n }\n if (isFoldableWithIndex(I)) {\n var reduceWithIndex = function (b, f) { return function (fa) {\n return I.reduceWithIndex(fa, b, f);\n }; };\n var foldMapWithIndex = function (M) {\n var foldMapM = I.foldMapWithIndex(M);\n return function (f) { return function (fa) { return foldMapM(fa, f); }; };\n };\n var reduceRightWithIndex = function (b, f) { return function (fa) {\n return I.reduceRightWithIndex(fa, b, f);\n }; };\n r.reduceWithIndex = reduceWithIndex;\n r.foldMapWithIndex = foldMapWithIndex;\n r.reduceRightWithIndex = reduceRightWithIndex;\n }\n if (isAlt(I)) {\n var alt = function (that) { return function (fa) { return I.alt(fa, that); }; };\n r.alt = alt;\n }\n if (isCompactable(I)) {\n r.compact = I.compact;\n r.separate = I.separate;\n }\n if (isFilterable(I)) {\n var filter = function (predicate) { return function (fa) {\n return I.filter(fa, predicate);\n }; };\n var filterMap = function (f) { return function (fa) { return I.filterMap(fa, f); }; };\n var partition = function (predicate) { return function (fa) {\n return I.partition(fa, predicate);\n }; };\n var partitionMap = function (f) { return function (fa) { return I.partitionMap(fa, f); }; };\n r.filter = filter;\n r.filterMap = filterMap;\n r.partition = partition;\n r.partitionMap = partitionMap;\n }\n if (isFilterableWithIndex(I)) {\n var filterWithIndex = function (predicateWithIndex) { return function (fa) { return I.filterWithIndex(fa, predicateWithIndex); }; };\n var filterMapWithIndex = function (f) { return function (fa) {\n return I.filterMapWithIndex(fa, f);\n }; };\n var partitionWithIndex = function (predicateWithIndex) { return function (fa) { return I.partitionWithIndex(fa, predicateWithIndex); }; };\n var partitionMapWithIndex = function (f) { return function (fa) {\n return I.partitionMapWithIndex(fa, f);\n }; };\n r.filterWithIndex = filterWithIndex;\n r.filterMapWithIndex = filterMapWithIndex;\n r.partitionWithIndex = partitionWithIndex;\n r.partitionMapWithIndex = partitionMapWithIndex;\n }\n if (isProfunctor(I)) {\n var promap = function (f, g) { return function (fa) { return I.promap(fa, f, g); }; };\n r.promap = promap;\n }\n if (isSemigroupoid(I)) {\n var compose = function (that) { return function (fa) { return I.compose(fa, that); }; };\n r.compose = compose;\n }\n if (isMonadThrow(I)) {\n var fromOption = function (onNone) { return function (ma) {\n return ma._tag === 'None' ? I.throwError(onNone()) : I.of(ma.value);\n }; };\n var fromEither = function (ma) {\n return ma._tag === 'Left' ? I.throwError(ma.left) : I.of(ma.right);\n };\n var fromPredicate = function (predicate, onFalse) { return function (a) { return (predicate(a) ? I.of(a) : I.throwError(onFalse(a))); }; };\n var filterOrElse = function (predicate, onFalse) { return function (ma) { return I.chain(ma, function (a) { return (predicate(a) ? I.of(a) : I.throwError(onFalse(a))); }); }; };\n r.fromOption = fromOption;\n r.fromEither = fromEither;\n r.fromPredicate = fromPredicate;\n r.filterOrElse = filterOrElse;\n }\n return r;\n}\nexports.pipeable = pipeable;\n/**\n * Use [`pipe`](https://gcanti.github.io/fp-ts/modules/function.ts.html#flow) from `function` module instead.\n *\n * @since 2.0.0\n * @deprecated\n */\nexports.pipe = function_1.pipe;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.endsWith = exports.startsWith = exports.includes = exports.split = exports.size = exports.isEmpty = exports.empty = exports.slice = exports.trimRight = exports.trimLeft = exports.trim = exports.replace = exports.toLowerCase = exports.toUpperCase = exports.isString = exports.Show = exports.Ord = exports.Monoid = exports.Semigroup = exports.Eq = void 0;\nvar ReadonlyNonEmptyArray_1 = require(\"./ReadonlyNonEmptyArray\");\n// -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n/**\n * @example\n * import * as S from 'fp-ts/string'\n *\n * assert.deepStrictEqual(S.Eq.equals('a', 'a'), true)\n * assert.deepStrictEqual(S.Eq.equals('a', 'b'), false)\n *\n * @category instances\n * @since 2.10.0\n */\nexports.Eq = {\n equals: function (first, second) { return first === second; }\n};\n/**\n * `string` semigroup under concatenation.\n *\n * @example\n * import * as S from 'fp-ts/string'\n *\n * assert.deepStrictEqual(S.Semigroup.concat('a', 'b'), 'ab')\n *\n * @category instances\n * @since 2.10.0\n */\nexports.Semigroup = {\n concat: function (first, second) { return first + second; }\n};\n/**\n * `string` monoid under concatenation.\n *\n * The `empty` value is `''`.\n *\n * @example\n * import * as S from 'fp-ts/string'\n *\n * assert.deepStrictEqual(S.Monoid.concat('a', 'b'), 'ab')\n * assert.deepStrictEqual(S.Monoid.concat('a', S.Monoid.empty), 'a')\n *\n * @category instances\n * @since 2.10.0\n */\nexports.Monoid = {\n concat: exports.Semigroup.concat,\n empty: ''\n};\n/**\n * @example\n * import * as S from 'fp-ts/string'\n *\n * assert.deepStrictEqual(S.Ord.compare('a', 'a'), 0)\n * assert.deepStrictEqual(S.Ord.compare('a', 'b'), -1)\n * assert.deepStrictEqual(S.Ord.compare('b', 'a'), 1)\n *\n * @category instances\n * @since 2.10.0\n */\nexports.Ord = {\n equals: exports.Eq.equals,\n compare: function (first, second) { return (first < second ? -1 : first > second ? 1 : 0); }\n};\n/**\n * @example\n * import * as S from 'fp-ts/string'\n *\n * assert.deepStrictEqual(S.Show.show('a'), '\"a\"')\n *\n * @category instances\n * @since 2.10.0\n */\nexports.Show = {\n show: function (s) { return JSON.stringify(s); }\n};\n// -------------------------------------------------------------------------------------\n// refinements\n// -------------------------------------------------------------------------------------\n/**\n * @example\n * import * as S from 'fp-ts/string'\n *\n * assert.deepStrictEqual(S.isString('a'), true)\n * assert.deepStrictEqual(S.isString(1), false)\n *\n * @category refinements\n * @since 2.11.0\n */\nvar isString = function (u) { return typeof u === 'string'; };\nexports.isString = isString;\n// -------------------------------------------------------------------------------------\n// combinators\n// -------------------------------------------------------------------------------------\n/**\n * @example\n * import * as S from 'fp-ts/string'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe('a', S.toUpperCase), 'A')\n *\n * @category combinators\n * @since 2.11.0\n */\nvar toUpperCase = function (s) { return s.toUpperCase(); };\nexports.toUpperCase = toUpperCase;\n/**\n * @example\n * import * as S from 'fp-ts/string'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe('A', S.toLowerCase), 'a')\n *\n * @category combinators\n * @since 2.11.0\n */\nvar toLowerCase = function (s) { return s.toLowerCase(); };\nexports.toLowerCase = toLowerCase;\n/**\n * @example\n * import * as S from 'fp-ts/string'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe('abc', S.replace('b', 'd')), 'adc')\n *\n * @category combinators\n * @since 2.11.0\n */\nvar replace = function (searchValue, replaceValue) { return function (s) {\n return s.replace(searchValue, replaceValue);\n}; };\nexports.replace = replace;\n/**\n * @example\n * import * as S from 'fp-ts/string'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe(' a ', S.trim), 'a')\n *\n * @category combinators\n * @since 2.11.0\n */\nvar trim = function (s) { return s.trim(); };\nexports.trim = trim;\n/**\n * @example\n * import * as S from 'fp-ts/string'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe(' a ', S.trimLeft), 'a ')\n *\n * @category combinators\n * @since 2.11.0\n */\nvar trimLeft = function (s) { return s.trimLeft(); };\nexports.trimLeft = trimLeft;\n/**\n * @example\n * import * as S from 'fp-ts/string'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe(' a ', S.trimRight), ' a')\n *\n * @category combinators\n * @since 2.11.0\n */\nvar trimRight = function (s) { return s.trimRight(); };\nexports.trimRight = trimRight;\n/**\n * @example\n * import * as S from 'fp-ts/string'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe('abcd', S.slice(1, 3)), 'bc')\n *\n * @category combinators\n * @since 2.11.0\n */\nvar slice = function (start, end) { return function (s) { return s.slice(start, end); }; };\nexports.slice = slice;\n// -------------------------------------------------------------------------------------\n// utils\n// -------------------------------------------------------------------------------------\n/**\n * An empty `string`.\n *\n * @since 2.10.0\n */\nexports.empty = '';\n/**\n * Test whether a `string` is empty.\n *\n * @example\n * import * as S from 'fp-ts/string'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe('', S.isEmpty), true)\n * assert.deepStrictEqual(pipe('a', S.isEmpty), false)\n *\n * @since 2.10.0\n */\nvar isEmpty = function (s) { return s.length === 0; };\nexports.isEmpty = isEmpty;\n/**\n * Calculate the number of characters in a `string`.\n *\n * @example\n * import * as S from 'fp-ts/string'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe('abc', S.size), 3)\n *\n * @since 2.10.0\n */\nvar size = function (s) { return s.length; };\nexports.size = size;\n/**\n * @example\n * import * as S from 'fp-ts/string'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe('abc', S.split('')), ['a', 'b', 'c'])\n * assert.deepStrictEqual(pipe('', S.split('')), [''])\n *\n * @since 2.11.0\n */\nvar split = function (separator) { return function (s) {\n var out = s.split(separator);\n return ReadonlyNonEmptyArray_1.isNonEmpty(out) ? out : [s];\n}; };\nexports.split = split;\n/**\n * @example\n * import * as S from 'fp-ts/string'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe('abc', S.includes('b')), true)\n * assert.deepStrictEqual(pipe('abc', S.includes('d')), false)\n *\n * @since 2.11.0\n */\nvar includes = function (searchString, position) { return function (s) {\n return s.includes(searchString, position);\n}; };\nexports.includes = includes;\n/**\n * @example\n * import * as S from 'fp-ts/string'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe('abc', S.startsWith('a')), true)\n * assert.deepStrictEqual(pipe('bc', S.startsWith('a')), false)\n *\n * @since 2.11.0\n */\nvar startsWith = function (searchString, position) { return function (s) {\n return s.startsWith(searchString, position);\n}; };\nexports.startsWith = startsWith;\n/**\n * @example\n * import * as S from 'fp-ts/string'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe('abc', S.endsWith('c')), true)\n * assert.deepStrictEqual(pipe('ab', S.endsWith('c')), false)\n *\n * @since 2.11.0\n */\nvar endsWith = function (searchString, position) { return function (s) {\n return s.endsWith(searchString, position);\n}; };\nexports.endsWith = endsWith;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.reporter = exports.formatValidationErrors = exports.formatValidationError = exports.TYPE_MAX_LEN = void 0;\n/**\n * An [io-ts Reporter](https://gcanti.github.io/io-ts/modules/Reporter.ts.html#reporter-interface).\n *\n * @example\n *\n * import * as t from 'io-ts';\n * import Reporter from 'io-ts-reporters';\n *\n * const User = t.interface({ name: t.string });\n *\n * assert.deepEqual(\n * Reporter.report(User.decode({ nam: 'Jane' })),\n * ['Expecting string at name but instead got: undefined'],\n * )\n * assert.deepEqual( Reporter.report(User.decode({ name: 'Jane' })), [])\n *\n * @since 1.2.0\n */\nvar A = require(\"fp-ts/lib/Array\");\nvar E = require(\"fp-ts/lib/Either\");\nvar NEA = require(\"fp-ts/lib/NonEmptyArray\");\nvar O = require(\"fp-ts/lib/Option\");\nvar R = require(\"fp-ts/lib/Record\");\nvar pipeable_1 = require(\"fp-ts/lib/pipeable\");\nvar t = require(\"io-ts\");\nvar utils_1 = require(\"./utils\");\nvar isUnionType = function (_a) {\n var type = _a.type;\n return type instanceof t.UnionType;\n};\nvar jsToString = function (value) {\n return value === undefined ? 'undefined' : JSON.stringify(value);\n};\nvar keyPath = function (ctx) {\n // The context entry with an empty key is the original\n // type (\"default context\"), not a type error.\n return ctx\n .map(function (c) { return c.key; })\n .filter(Boolean)\n .join('.');\n};\n// The actual error is last in context\nvar getErrorFromCtx = function (validation) {\n // https://github.com/gcanti/fp-ts/pull/544/files\n return A.last(validation.context);\n};\nvar getValidationContext = function (validation) {\n // https://github.com/gcanti/fp-ts/pull/544/files\n return validation.context;\n};\n/**\n * @category internals\n * @since 1.2.1\n */\nexports.TYPE_MAX_LEN = 160; // Two lines of 80-col text\nvar truncateType = function (type, options) {\n if (options === void 0) { options = {}; }\n var _a = options.truncateLongTypes, truncateLongTypes = _a === void 0 ? true : _a;\n if (truncateLongTypes && type.length > exports.TYPE_MAX_LEN) {\n return type.slice(0, exports.TYPE_MAX_LEN - 3) + \"...\";\n }\n return type;\n};\nvar errorMessageSimple = function (expectedType, path, error, options) {\n // https://github.com/elm-lang/core/blob/18c9e84e975ed22649888bfad15d1efdb0128ab2/src/Native/Json.js#L199\n return [\n \"Expecting \" + truncateType(expectedType, options),\n path === '' ? '' : \"at \" + path,\n \"but instead got: \" + jsToString(error.value),\n error.message ? \"(\" + error.message + \")\" : ''\n ]\n .filter(Boolean)\n .join(' ');\n};\nvar errorMessageUnion = function (expectedTypes, path, value, options) {\n // https://github.com/elm-lang/core/blob/18c9e84e975ed22649888bfad15d1efdb0128ab2/src/Native/Json.js#L199\n return [\n 'Expecting one of:\\n',\n expectedTypes.map(function (type) { return \" \" + truncateType(type, options); }).join('\\n'),\n path === '' ? '\\n' : \"\\nat \" + path + \" \",\n \"but instead got: \" + jsToString(value)\n ]\n .filter(Boolean)\n .join('');\n};\n// Find the union type in the list of ContextEntry\n// The next ContextEntry should be the type of this branch of the union\nvar findExpectedType = function (ctx) {\n return pipeable_1.pipe(ctx, A.findIndex(isUnionType), O.chain(function (n) { return A.lookup(n + 1, ctx); }));\n};\nvar formatValidationErrorOfUnion = function (path, errors, options) {\n var expectedTypes = pipeable_1.pipe(errors, A.map(getValidationContext), A.map(findExpectedType), A.compact);\n var value = pipeable_1.pipe(expectedTypes, A.head, O.map(function (v) { return v.actual; }), O.getOrElse(function () { return undefined; }));\n var expected = expectedTypes.map(function (_a) {\n var type = _a.type;\n return type.name;\n });\n return expected.length > 0\n ? O.some(errorMessageUnion(expected, path, value, options))\n : O.none;\n};\nvar formatValidationCommonError = function (path, error, options) {\n return pipeable_1.pipe(error, getErrorFromCtx, O.map(function (errorContext) {\n return errorMessageSimple(errorContext.type.name, path, error, options);\n }));\n};\nvar groupByKey = NEA.groupBy(function (error) {\n return pipeable_1.pipe(error.context, utils_1.takeUntil(isUnionType), keyPath);\n});\nvar format = function (path, errors, options) {\n return NEA.tail(errors).length > 0\n ? formatValidationErrorOfUnion(path, errors, options)\n : formatValidationCommonError(path, NEA.head(errors), options);\n};\n/**\n * Format a single validation error.\n *\n * @category formatters\n * @since 1.0.0\n */\nexports.formatValidationError = function (error, options) { return formatValidationCommonError(keyPath(error.context), error, options); };\n/**\n * Format validation errors (`t.Errors`).\n *\n * @example\n * import * as E from 'fp-ts/lib/Either'\n * import * as t from 'io-ts'\n * import { formatValidationErrors } from 'io-ts-reporters'\n *\n * const result = t.string.decode(123)\n *\n * assert.deepEqual(\n * E.mapLeft(formatValidationErrors)(result),\n * E.left(['Expecting string but instead got: 123'])\n * )\n *\n * @category formatters\n * @since 1.2.0\n */\nexports.formatValidationErrors = function (errors, options) {\n return pipeable_1.pipe(errors, groupByKey, R.mapWithIndex(function (path, errors) { return format(path, errors, options); }), R.compact, R.toArray, A.map(function (_a) {\n var _key = _a[0], error = _a[1];\n return error;\n }));\n};\n/**\n * Deprecated, use the default export instead.\n *\n * @category deprecated\n * @deprecated\n * @since 1.0.0\n */\nexports.reporter = function (validation, options) {\n return pipeable_1.pipe(validation, E.mapLeft(function (errors) { return exports.formatValidationErrors(errors, options); }), E.fold(function (errors) { return errors; }, function () { return []; }));\n};\nvar prettyReporter = { report: exports.reporter };\nexports.default = prettyReporter;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.takeUntil = void 0;\n/**\n * @since 1.1.0\n */\n/* eslint-disable @typescript-eslint/array-type */\nexports.takeUntil = function (predicate) { return function (as) {\n var init = [];\n // eslint-disable-next-line unicorn/no-for-loop\n for (var i = 0; i < as.length; i++) {\n init[i] = as[i];\n if (predicate(as[i])) {\n return init;\n }\n }\n return init;\n}; };\n/* eslint-enable @typescript-eslint/array-type */\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __spreadArrays = (this && this.__spreadArrays) || function () {\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};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.partial = exports.PartialType = exports.type = exports.InterfaceType = exports.array = exports.ArrayType = exports.recursion = exports.RecursiveType = exports.Int = exports.brand = exports.RefinementType = exports.keyof = exports.KeyofType = exports.literal = exports.LiteralType = exports.void = exports.undefined = exports.null = exports.UnknownRecord = exports.AnyDictionaryType = exports.UnknownArray = exports.AnyArrayType = exports.boolean = exports.BooleanType = exports.bigint = exports.BigIntType = exports.number = exports.NumberType = exports.string = exports.StringType = exports.unknown = exports.UnknownType = exports.voidType = exports.VoidType = exports.UndefinedType = exports.nullType = exports.NullType = exports.getIndex = exports.getTags = exports.emptyTags = exports.mergeAll = exports.getDomainKeys = exports.appendContext = exports.getContextEntry = exports.getFunctionName = exports.identity = exports.Type = exports.success = exports.failure = exports.failures = void 0;\nexports.alias = exports.clean = exports.StrictType = exports.dictionary = exports.Integer = exports.refinement = exports.object = exports.ObjectType = exports.Dictionary = exports.any = exports.AnyType = exports.never = exports.NeverType = exports.getDefaultContext = exports.getValidationError = exports.interface = exports.Array = exports.taggedUnion = exports.TaggedUnionType = exports.Function = exports.FunctionType = exports.exact = exports.ExactType = exports.strict = exports.readonlyArray = exports.ReadonlyArrayType = exports.readonly = exports.ReadonlyType = exports.tuple = exports.TupleType = exports.intersection = exports.IntersectionType = exports.union = exports.UnionType = exports.record = exports.DictionaryType = void 0;\n/**\n * @since 1.0.0\n */\nvar Either_1 = require(\"fp-ts/lib/Either\");\n/**\n * @category Decode error\n * @since 1.0.0\n */\nexports.failures = Either_1.left;\n/**\n * @category Decode error\n * @since 1.0.0\n */\nvar failure = function (value, context, message) {\n return exports.failures([{ value: value, context: context, message: message }]);\n};\nexports.failure = failure;\n/**\n * @category Decode error\n * @since 1.0.0\n */\nexports.success = Either_1.right;\n/**\n * @category Codec\n * @since 1.0.0\n */\nvar Type = /** @class */ (function () {\n function Type(\n /** a unique name for this codec */\n name, \n /** a custom type guard */\n is, \n /** succeeds if a value of type I can be decoded to a value of type A */\n validate, \n /** converts a value of type A to a value of type O */\n encode) {\n this.name = name;\n this.is = is;\n this.validate = validate;\n this.encode = encode;\n this.decode = this.decode.bind(this);\n }\n /**\n * @since 1.0.0\n */\n Type.prototype.pipe = function (ab, name) {\n var _this = this;\n if (name === void 0) { name = \"pipe(\" + this.name + \", \" + ab.name + \")\"; }\n return new Type(name, ab.is, function (i, c) {\n var e = _this.validate(i, c);\n if (Either_1.isLeft(e)) {\n return e;\n }\n return ab.validate(e.right, c);\n }, this.encode === exports.identity && ab.encode === exports.identity ? exports.identity : function (b) { return _this.encode(ab.encode(b)); });\n };\n /**\n * @since 1.0.0\n */\n Type.prototype.asDecoder = function () {\n return this;\n };\n /**\n * @since 1.0.0\n */\n Type.prototype.asEncoder = function () {\n return this;\n };\n /**\n * a version of `validate` with a default context\n * @since 1.0.0\n */\n Type.prototype.decode = function (i) {\n return this.validate(i, [{ key: '', type: this, actual: i }]);\n };\n return Type;\n}());\nexports.Type = Type;\n// -------------------------------------------------------------------------------------\n// utils\n// -------------------------------------------------------------------------------------\n/**\n * @since 1.0.0\n */\nvar identity = function (a) { return a; };\nexports.identity = identity;\n/**\n * @since 1.0.0\n */\nfunction getFunctionName(f) {\n return f.displayName || f.name || \"\";\n}\nexports.getFunctionName = getFunctionName;\n/**\n * @since 1.0.0\n */\nfunction getContextEntry(key, decoder) {\n return { key: key, type: decoder };\n}\nexports.getContextEntry = getContextEntry;\n/**\n * @since 1.0.0\n */\nfunction appendContext(c, key, decoder, actual) {\n var len = c.length;\n var r = Array(len + 1);\n for (var i = 0; i < len; i++) {\n r[i] = c[i];\n }\n r[len] = { key: key, type: decoder, actual: actual };\n return r;\n}\nexports.appendContext = appendContext;\nfunction pushAll(xs, ys) {\n var l = ys.length;\n for (var i = 0; i < l; i++) {\n xs.push(ys[i]);\n }\n}\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction getNameFromProps(props) {\n return Object.keys(props)\n .map(function (k) { return k + \": \" + props[k].name; })\n .join(', ');\n}\nfunction useIdentity(codecs) {\n for (var i = 0; i < codecs.length; i++) {\n if (codecs[i].encode !== exports.identity) {\n return false;\n }\n }\n return true;\n}\nfunction getInterfaceTypeName(props) {\n return \"{ \" + getNameFromProps(props) + \" }\";\n}\nfunction getPartialTypeName(inner) {\n return \"Partial<\" + inner + \">\";\n}\nfunction enumerableRecord(keys, domain, codomain, name) {\n if (name === void 0) { name = \"{ [K in \" + domain.name + \"]: \" + codomain.name + \" }\"; }\n var len = keys.length;\n return new DictionaryType(name, function (u) { return exports.UnknownRecord.is(u) && keys.every(function (k) { return codomain.is(u[k]); }); }, function (u, c) {\n var e = exports.UnknownRecord.validate(u, c);\n if (Either_1.isLeft(e)) {\n return e;\n }\n var o = e.right;\n var a = {};\n var errors = [];\n var changed = false;\n for (var i = 0; i < len; i++) {\n var k = keys[i];\n var ok = o[k];\n var codomainResult = codomain.validate(ok, appendContext(c, k, codomain, ok));\n if (Either_1.isLeft(codomainResult)) {\n pushAll(errors, codomainResult.left);\n }\n else {\n var vok = codomainResult.right;\n changed = changed || vok !== ok;\n a[k] = vok;\n }\n }\n return errors.length > 0 ? exports.failures(errors) : exports.success((changed || Object.keys(o).length !== len ? a : o));\n }, codomain.encode === exports.identity\n ? exports.identity\n : function (a) {\n var s = {};\n for (var i = 0; i < len; i++) {\n var k = keys[i];\n s[k] = codomain.encode(a[k]);\n }\n return s;\n }, domain, codomain);\n}\n/**\n * @internal\n */\nfunction getDomainKeys(domain) {\n var _a;\n if (isLiteralC(domain)) {\n var literal_1 = domain.value;\n if (exports.string.is(literal_1)) {\n return _a = {}, _a[literal_1] = null, _a;\n }\n }\n else if (isKeyofC(domain)) {\n return domain.keys;\n }\n else if (isUnionC(domain)) {\n var keys = domain.types.map(function (type) { return getDomainKeys(type); });\n return keys.some(undefinedType.is) ? undefined : Object.assign.apply(Object, __spreadArrays([{}], keys));\n }\n return undefined;\n}\nexports.getDomainKeys = getDomainKeys;\nfunction nonEnumerableRecord(domain, codomain, name) {\n if (name === void 0) { name = \"{ [K in \" + domain.name + \"]: \" + codomain.name + \" }\"; }\n return new DictionaryType(name, function (u) {\n if (exports.UnknownRecord.is(u)) {\n return Object.keys(u).every(function (k) { return domain.is(k) && codomain.is(u[k]); });\n }\n return isAnyC(codomain) && Array.isArray(u);\n }, function (u, c) {\n if (exports.UnknownRecord.is(u)) {\n var a = {};\n var errors = [];\n var keys = Object.keys(u);\n var len = keys.length;\n var changed = false;\n for (var i = 0; i < len; i++) {\n var k = keys[i];\n var ok = u[k];\n var domainResult = domain.validate(k, appendContext(c, k, domain, k));\n if (Either_1.isLeft(domainResult)) {\n pushAll(errors, domainResult.left);\n }\n else {\n var vk = domainResult.right;\n changed = changed || vk !== k;\n k = vk;\n var codomainResult = codomain.validate(ok, appendContext(c, k, codomain, ok));\n if (Either_1.isLeft(codomainResult)) {\n pushAll(errors, codomainResult.left);\n }\n else {\n var vok = codomainResult.right;\n changed = changed || vok !== ok;\n a[k] = vok;\n }\n }\n }\n return errors.length > 0 ? exports.failures(errors) : exports.success((changed ? a : u));\n }\n if (isAnyC(codomain) && Array.isArray(u)) {\n return exports.success(u);\n }\n return exports.failure(u, c);\n }, domain.encode === exports.identity && codomain.encode === exports.identity\n ? exports.identity\n : function (a) {\n var s = {};\n var keys = Object.keys(a);\n var len = keys.length;\n for (var i = 0; i < len; i++) {\n var k = keys[i];\n s[String(domain.encode(k))] = codomain.encode(a[k]);\n }\n return s;\n }, domain, codomain);\n}\nfunction getUnionName(codecs) {\n return '(' + codecs.map(function (type) { return type.name; }).join(' | ') + ')';\n}\n/**\n * @internal\n */\nfunction mergeAll(base, us) {\n var equal = true;\n var primitive = true;\n var baseIsNotADictionary = !exports.UnknownRecord.is(base);\n for (var _i = 0, us_1 = us; _i < us_1.length; _i++) {\n var u = us_1[_i];\n if (u !== base) {\n equal = false;\n }\n if (exports.UnknownRecord.is(u)) {\n primitive = false;\n }\n }\n if (equal) {\n return base;\n }\n else if (primitive) {\n return us[us.length - 1];\n }\n var r = {};\n for (var _a = 0, us_2 = us; _a < us_2.length; _a++) {\n var u = us_2[_a];\n for (var k in u) {\n if (!r.hasOwnProperty(k) || baseIsNotADictionary || u[k] !== base[k]) {\n r[k] = u[k];\n }\n }\n }\n return r;\n}\nexports.mergeAll = mergeAll;\nfunction getProps(codec) {\n switch (codec._tag) {\n case 'RefinementType':\n case 'ReadonlyType':\n return getProps(codec.type);\n case 'InterfaceType':\n case 'StrictType':\n case 'PartialType':\n return codec.props;\n case 'IntersectionType':\n return codec.types.reduce(function (props, type) { return Object.assign(props, getProps(type)); }, {});\n }\n}\nfunction stripKeys(o, props) {\n var keys = Object.getOwnPropertyNames(o);\n var shouldStrip = false;\n var r = {};\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (!hasOwnProperty.call(props, key)) {\n shouldStrip = true;\n }\n else {\n r[key] = o[key];\n }\n }\n return shouldStrip ? r : o;\n}\nfunction getExactTypeName(codec) {\n if (isTypeC(codec)) {\n return \"{| \" + getNameFromProps(codec.props) + \" |}\";\n }\n else if (isPartialC(codec)) {\n return getPartialTypeName(\"{| \" + getNameFromProps(codec.props) + \" |}\");\n }\n return \"Exact<\" + codec.name + \">\";\n}\nfunction isNonEmpty(as) {\n return as.length > 0;\n}\n/**\n * @internal\n */\nexports.emptyTags = {};\nfunction intersect(a, b) {\n var r = [];\n for (var _i = 0, a_1 = a; _i < a_1.length; _i++) {\n var v = a_1[_i];\n if (b.indexOf(v) !== -1) {\n r.push(v);\n }\n }\n return r;\n}\nfunction mergeTags(a, b) {\n if (a === exports.emptyTags) {\n return b;\n }\n if (b === exports.emptyTags) {\n return a;\n }\n var r = Object.assign({}, a);\n for (var k in b) {\n if (a.hasOwnProperty(k)) {\n var intersection_1 = intersect(a[k], b[k]);\n if (isNonEmpty(intersection_1)) {\n r[k] = intersection_1;\n }\n else {\n r = exports.emptyTags;\n break;\n }\n }\n else {\n r[k] = b[k];\n }\n }\n return r;\n}\nfunction intersectTags(a, b) {\n if (a === exports.emptyTags || b === exports.emptyTags) {\n return exports.emptyTags;\n }\n var r = exports.emptyTags;\n for (var k in a) {\n if (b.hasOwnProperty(k)) {\n var intersection_2 = intersect(a[k], b[k]);\n if (intersection_2.length === 0) {\n if (r === exports.emptyTags) {\n r = {};\n }\n r[k] = a[k].concat(b[k]);\n }\n }\n }\n return r;\n}\n// tslint:disable-next-line: deprecation\nfunction isAnyC(codec) {\n return codec._tag === 'AnyType';\n}\nfunction isLiteralC(codec) {\n return codec._tag === 'LiteralType';\n}\nfunction isKeyofC(codec) {\n return codec._tag === 'KeyofType';\n}\nfunction isTypeC(codec) {\n return codec._tag === 'InterfaceType';\n}\nfunction isPartialC(codec) {\n return codec._tag === 'PartialType';\n}\n// tslint:disable-next-line: deprecation\nfunction isStrictC(codec) {\n return codec._tag === 'StrictType';\n}\nfunction isExactC(codec) {\n return codec._tag === 'ExactType';\n}\n// tslint:disable-next-line: deprecation\nfunction isRefinementC(codec) {\n return codec._tag === 'RefinementType';\n}\nfunction isIntersectionC(codec) {\n return codec._tag === 'IntersectionType';\n}\nfunction isUnionC(codec) {\n return codec._tag === 'UnionType';\n}\nfunction isRecursiveC(codec) {\n return codec._tag === 'RecursiveType';\n}\nvar lazyCodecs = [];\n/**\n * @internal\n */\nfunction getTags(codec) {\n if (lazyCodecs.indexOf(codec) !== -1) {\n return exports.emptyTags;\n }\n if (isTypeC(codec) || isStrictC(codec)) {\n var index = exports.emptyTags;\n // tslint:disable-next-line: forin\n for (var k in codec.props) {\n var prop = codec.props[k];\n if (isLiteralC(prop)) {\n if (index === exports.emptyTags) {\n index = {};\n }\n index[k] = [prop.value];\n }\n }\n return index;\n }\n else if (isExactC(codec) || isRefinementC(codec)) {\n return getTags(codec.type);\n }\n else if (isIntersectionC(codec)) {\n return codec.types.reduce(function (tags, codec) { return mergeTags(tags, getTags(codec)); }, exports.emptyTags);\n }\n else if (isUnionC(codec)) {\n return codec.types.slice(1).reduce(function (tags, codec) { return intersectTags(tags, getTags(codec)); }, getTags(codec.types[0]));\n }\n else if (isRecursiveC(codec)) {\n lazyCodecs.push(codec);\n var tags = getTags(codec.type);\n lazyCodecs.pop();\n return tags;\n }\n return exports.emptyTags;\n}\nexports.getTags = getTags;\n/**\n * @internal\n */\nfunction getIndex(codecs) {\n var tags = getTags(codecs[0]);\n var keys = Object.keys(tags);\n var len = codecs.length;\n var _loop_1 = function (k) {\n var all = tags[k].slice();\n var index = [tags[k]];\n for (var i = 1; i < len; i++) {\n var codec = codecs[i];\n var ctags = getTags(codec);\n var values = ctags[k];\n // tslint:disable-next-line: strict-type-predicates\n if (values === undefined) {\n return \"continue-keys\";\n }\n else {\n if (values.some(function (v) { return all.indexOf(v) !== -1; })) {\n return \"continue-keys\";\n }\n else {\n all.push.apply(all, values);\n index.push(values);\n }\n }\n }\n return { value: [k, index] };\n };\n keys: for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {\n var k = keys_1[_i];\n var state_1 = _loop_1(k);\n if (typeof state_1 === \"object\")\n return state_1.value;\n switch (state_1) {\n case \"continue-keys\": continue keys;\n }\n }\n return undefined;\n}\nexports.getIndex = getIndex;\n// -------------------------------------------------------------------------------------\n// primitives\n// -------------------------------------------------------------------------------------\n/**\n * @since 1.0.0\n */\nvar NullType = /** @class */ (function (_super) {\n __extends(NullType, _super);\n function NullType() {\n var _this = _super.call(this, 'null', function (u) { return u === null; }, function (u, c) { return (_this.is(u) ? exports.success(u) : exports.failure(u, c)); }, exports.identity) || this;\n /**\n * @since 1.0.0\n */\n _this._tag = 'NullType';\n return _this;\n }\n return NullType;\n}(Type));\nexports.NullType = NullType;\n/**\n * @category primitives\n * @since 1.0.0\n */\nexports.nullType = new NullType();\nexports.null = exports.nullType;\n/**\n * @since 1.0.0\n */\nvar UndefinedType = /** @class */ (function (_super) {\n __extends(UndefinedType, _super);\n function UndefinedType() {\n var _this = _super.call(this, 'undefined', function (u) { return u === void 0; }, function (u, c) { return (_this.is(u) ? exports.success(u) : exports.failure(u, c)); }, exports.identity) || this;\n /**\n * @since 1.0.0\n */\n _this._tag = 'UndefinedType';\n return _this;\n }\n return UndefinedType;\n}(Type));\nexports.UndefinedType = UndefinedType;\nvar undefinedType = new UndefinedType();\nexports.undefined = undefinedType;\n/**\n * @since 1.2.0\n */\nvar VoidType = /** @class */ (function (_super) {\n __extends(VoidType, _super);\n function VoidType() {\n var _this = _super.call(this, 'void', undefinedType.is, undefinedType.validate, exports.identity) || this;\n /**\n * @since 1.0.0\n */\n _this._tag = 'VoidType';\n return _this;\n }\n return VoidType;\n}(Type));\nexports.VoidType = VoidType;\n/**\n * @category primitives\n * @since 1.2.0\n */\nexports.voidType = new VoidType();\nexports.void = exports.voidType;\n/**\n * @since 1.5.0\n */\nvar UnknownType = /** @class */ (function (_super) {\n __extends(UnknownType, _super);\n function UnknownType() {\n var _this = _super.call(this, 'unknown', function (_) { return true; }, exports.success, exports.identity) || this;\n /**\n * @since 1.0.0\n */\n _this._tag = 'UnknownType';\n return _this;\n }\n return UnknownType;\n}(Type));\nexports.UnknownType = UnknownType;\n/**\n * @category primitives\n * @since 1.5.0\n */\nexports.unknown = new UnknownType();\n/**\n * @since 1.0.0\n */\nvar StringType = /** @class */ (function (_super) {\n __extends(StringType, _super);\n function StringType() {\n var _this = _super.call(this, 'string', function (u) { return typeof u === 'string'; }, function (u, c) { return (_this.is(u) ? exports.success(u) : exports.failure(u, c)); }, exports.identity) || this;\n /**\n * @since 1.0.0\n */\n _this._tag = 'StringType';\n return _this;\n }\n return StringType;\n}(Type));\nexports.StringType = StringType;\n/**\n * @category primitives\n * @since 1.0.0\n */\nexports.string = new StringType();\n/**\n * @since 1.0.0\n */\nvar NumberType = /** @class */ (function (_super) {\n __extends(NumberType, _super);\n function NumberType() {\n var _this = _super.call(this, 'number', function (u) { return typeof u === 'number'; }, function (u, c) { return (_this.is(u) ? exports.success(u) : exports.failure(u, c)); }, exports.identity) || this;\n /**\n * @since 1.0.0\n */\n _this._tag = 'NumberType';\n return _this;\n }\n return NumberType;\n}(Type));\nexports.NumberType = NumberType;\n/**\n * @category primitives\n * @since 1.0.0\n */\nexports.number = new NumberType();\n/**\n * @since 2.1.0\n */\nvar BigIntType = /** @class */ (function (_super) {\n __extends(BigIntType, _super);\n function BigIntType() {\n var _this = _super.call(this, 'bigint', \n // tslint:disable-next-line: valid-typeof\n function (u) { return typeof u === 'bigint'; }, function (u, c) { return (_this.is(u) ? exports.success(u) : exports.failure(u, c)); }, exports.identity) || this;\n /**\n * @since 1.0.0\n */\n _this._tag = 'BigIntType';\n return _this;\n }\n return BigIntType;\n}(Type));\nexports.BigIntType = BigIntType;\n/**\n * @category primitives\n * @since 2.1.0\n */\nexports.bigint = new BigIntType();\n/**\n * @since 1.0.0\n */\nvar BooleanType = /** @class */ (function (_super) {\n __extends(BooleanType, _super);\n function BooleanType() {\n var _this = _super.call(this, 'boolean', function (u) { return typeof u === 'boolean'; }, function (u, c) { return (_this.is(u) ? exports.success(u) : exports.failure(u, c)); }, exports.identity) || this;\n /**\n * @since 1.0.0\n */\n _this._tag = 'BooleanType';\n return _this;\n }\n return BooleanType;\n}(Type));\nexports.BooleanType = BooleanType;\n/**\n * @category primitives\n * @since 1.0.0\n */\nexports.boolean = new BooleanType();\n/**\n * @since 1.0.0\n */\nvar AnyArrayType = /** @class */ (function (_super) {\n __extends(AnyArrayType, _super);\n function AnyArrayType() {\n var _this = _super.call(this, 'UnknownArray', Array.isArray, function (u, c) { return (_this.is(u) ? exports.success(u) : exports.failure(u, c)); }, exports.identity) || this;\n /**\n * @since 1.0.0\n */\n _this._tag = 'AnyArrayType';\n return _this;\n }\n return AnyArrayType;\n}(Type));\nexports.AnyArrayType = AnyArrayType;\n/**\n * @category primitives\n * @since 1.7.1\n */\nexports.UnknownArray = new AnyArrayType();\nexports.Array = exports.UnknownArray;\n/**\n * @since 1.0.0\n */\nvar AnyDictionaryType = /** @class */ (function (_super) {\n __extends(AnyDictionaryType, _super);\n function AnyDictionaryType() {\n var _this = _super.call(this, 'UnknownRecord', function (u) {\n var s = Object.prototype.toString.call(u);\n return s === '[object Object]' || s === '[object Window]';\n }, function (u, c) { return (_this.is(u) ? exports.success(u) : exports.failure(u, c)); }, exports.identity) || this;\n /**\n * @since 1.0.0\n */\n _this._tag = 'AnyDictionaryType';\n return _this;\n }\n return AnyDictionaryType;\n}(Type));\nexports.AnyDictionaryType = AnyDictionaryType;\n/**\n * @category primitives\n * @since 1.7.1\n */\nexports.UnknownRecord = new AnyDictionaryType();\n/**\n * @since 1.0.0\n */\nvar LiteralType = /** @class */ (function (_super) {\n __extends(LiteralType, _super);\n function LiteralType(name, is, validate, encode, value) {\n var _this = _super.call(this, name, is, validate, encode) || this;\n _this.value = value;\n /**\n * @since 1.0.0\n */\n _this._tag = 'LiteralType';\n return _this;\n }\n return LiteralType;\n}(Type));\nexports.LiteralType = LiteralType;\n/**\n * @category constructors\n * @since 1.0.0\n */\nfunction literal(value, name) {\n if (name === void 0) { name = JSON.stringify(value); }\n var is = function (u) { return u === value; };\n return new LiteralType(name, is, function (u, c) { return (is(u) ? exports.success(value) : exports.failure(u, c)); }, exports.identity, value);\n}\nexports.literal = literal;\n/**\n * @since 1.0.0\n */\nvar KeyofType = /** @class */ (function (_super) {\n __extends(KeyofType, _super);\n function KeyofType(name, is, validate, encode, keys) {\n var _this = _super.call(this, name, is, validate, encode) || this;\n _this.keys = keys;\n /**\n * @since 1.0.0\n */\n _this._tag = 'KeyofType';\n return _this;\n }\n return KeyofType;\n}(Type));\nexports.KeyofType = KeyofType;\n/**\n * @category constructors\n * @since 1.0.0\n */\nfunction keyof(keys, name) {\n if (name === void 0) { name = Object.keys(keys)\n .map(function (k) { return JSON.stringify(k); })\n .join(' | '); }\n var is = function (u) { return exports.string.is(u) && hasOwnProperty.call(keys, u); };\n return new KeyofType(name, is, function (u, c) { return (is(u) ? exports.success(u) : exports.failure(u, c)); }, exports.identity, keys);\n}\nexports.keyof = keyof;\n// -------------------------------------------------------------------------------------\n// combinators\n// -------------------------------------------------------------------------------------\n/**\n * @since 1.0.0\n */\nvar RefinementType = /** @class */ (function (_super) {\n __extends(RefinementType, _super);\n function RefinementType(name, is, validate, encode, type, predicate) {\n var _this = _super.call(this, name, is, validate, encode) || this;\n _this.type = type;\n _this.predicate = predicate;\n /**\n * @since 1.0.0\n */\n _this._tag = 'RefinementType';\n return _this;\n }\n return RefinementType;\n}(Type));\nexports.RefinementType = RefinementType;\n/**\n * @category combinators\n * @since 1.8.1\n */\nfunction brand(codec, predicate, name) {\n // tslint:disable-next-line: deprecation\n return refinement(codec, predicate, name);\n}\nexports.brand = brand;\n/**\n * A branded codec representing an integer\n *\n * @category primitives\n * @since 1.8.1\n */\nexports.Int = brand(exports.number, function (n) { return Number.isInteger(n); }, 'Int');\n/**\n * @since 1.0.0\n */\nvar RecursiveType = /** @class */ (function (_super) {\n __extends(RecursiveType, _super);\n function RecursiveType(name, is, validate, encode, runDefinition) {\n var _this = _super.call(this, name, is, validate, encode) || this;\n _this.runDefinition = runDefinition;\n /**\n * @since 1.0.0\n */\n _this._tag = 'RecursiveType';\n return _this;\n }\n return RecursiveType;\n}(Type));\nexports.RecursiveType = RecursiveType;\nObject.defineProperty(RecursiveType.prototype, 'type', {\n get: function () {\n return this.runDefinition();\n },\n enumerable: true,\n configurable: true\n});\n/**\n * @category combinators\n * @since 1.0.0\n */\nfunction recursion(name, definition) {\n var cache;\n var runDefinition = function () {\n if (!cache) {\n cache = definition(Self);\n cache.name = name;\n }\n return cache;\n };\n var Self = new RecursiveType(name, function (u) { return runDefinition().is(u); }, function (u, c) { return runDefinition().validate(u, c); }, function (a) { return runDefinition().encode(a); }, runDefinition);\n return Self;\n}\nexports.recursion = recursion;\n/**\n * @since 1.0.0\n */\nvar ArrayType = /** @class */ (function (_super) {\n __extends(ArrayType, _super);\n function ArrayType(name, is, validate, encode, type) {\n var _this = _super.call(this, name, is, validate, encode) || this;\n _this.type = type;\n /**\n * @since 1.0.0\n */\n _this._tag = 'ArrayType';\n return _this;\n }\n return ArrayType;\n}(Type));\nexports.ArrayType = ArrayType;\n/**\n * @category combinators\n * @since 1.0.0\n */\nfunction array(item, name) {\n if (name === void 0) { name = \"Array<\" + item.name + \">\"; }\n return new ArrayType(name, function (u) { return exports.UnknownArray.is(u) && u.every(item.is); }, function (u, c) {\n var e = exports.UnknownArray.validate(u, c);\n if (Either_1.isLeft(e)) {\n return e;\n }\n var us = e.right;\n var len = us.length;\n var as = us;\n var errors = [];\n for (var i = 0; i < len; i++) {\n var ui = us[i];\n var result = item.validate(ui, appendContext(c, String(i), item, ui));\n if (Either_1.isLeft(result)) {\n pushAll(errors, result.left);\n }\n else {\n var ai = result.right;\n if (ai !== ui) {\n if (as === us) {\n as = us.slice();\n }\n as[i] = ai;\n }\n }\n }\n return errors.length > 0 ? exports.failures(errors) : exports.success(as);\n }, item.encode === exports.identity ? exports.identity : function (a) { return a.map(item.encode); }, item);\n}\nexports.array = array;\n/**\n * @since 1.0.0\n */\nvar InterfaceType = /** @class */ (function (_super) {\n __extends(InterfaceType, _super);\n function InterfaceType(name, is, validate, encode, props) {\n var _this = _super.call(this, name, is, validate, encode) || this;\n _this.props = props;\n /**\n * @since 1.0.0\n */\n _this._tag = 'InterfaceType';\n return _this;\n }\n return InterfaceType;\n}(Type));\nexports.InterfaceType = InterfaceType;\n/**\n * @category combinators\n * @since 1.0.0\n */\nfunction type(props, name) {\n if (name === void 0) { name = getInterfaceTypeName(props); }\n var keys = Object.keys(props);\n var types = keys.map(function (key) { return props[key]; });\n var len = keys.length;\n return new InterfaceType(name, function (u) {\n if (exports.UnknownRecord.is(u)) {\n for (var i = 0; i < len; i++) {\n var k = keys[i];\n var uk = u[k];\n if ((uk === undefined && !hasOwnProperty.call(u, k)) || !types[i].is(uk)) {\n return false;\n }\n }\n return true;\n }\n return false;\n }, function (u, c) {\n var e = exports.UnknownRecord.validate(u, c);\n if (Either_1.isLeft(e)) {\n return e;\n }\n var o = e.right;\n var a = o;\n var errors = [];\n for (var i = 0; i < len; i++) {\n var k = keys[i];\n var ak = a[k];\n var type_1 = types[i];\n var result = type_1.validate(ak, appendContext(c, k, type_1, ak));\n if (Either_1.isLeft(result)) {\n pushAll(errors, result.left);\n }\n else {\n var vak = result.right;\n if (vak !== ak || (vak === undefined && !hasOwnProperty.call(a, k))) {\n /* istanbul ignore next */\n if (a === o) {\n a = __assign({}, o);\n }\n a[k] = vak;\n }\n }\n }\n return errors.length > 0 ? exports.failures(errors) : exports.success(a);\n }, useIdentity(types)\n ? exports.identity\n : function (a) {\n var s = __assign({}, a);\n for (var i = 0; i < len; i++) {\n var k = keys[i];\n var encode = types[i].encode;\n if (encode !== exports.identity) {\n s[k] = encode(a[k]);\n }\n }\n return s;\n }, props);\n}\nexports.type = type;\nexports.interface = type;\n/**\n * @since 1.0.0\n */\nvar PartialType = /** @class */ (function (_super) {\n __extends(PartialType, _super);\n function PartialType(name, is, validate, encode, props) {\n var _this = _super.call(this, name, is, validate, encode) || this;\n _this.props = props;\n /**\n * @since 1.0.0\n */\n _this._tag = 'PartialType';\n return _this;\n }\n return PartialType;\n}(Type));\nexports.PartialType = PartialType;\n/**\n * @category combinators\n * @since 1.0.0\n */\nfunction partial(props, name) {\n if (name === void 0) { name = getPartialTypeName(getInterfaceTypeName(props)); }\n var keys = Object.keys(props);\n var types = keys.map(function (key) { return props[key]; });\n var len = keys.length;\n return new PartialType(name, function (u) {\n if (exports.UnknownRecord.is(u)) {\n for (var i = 0; i < len; i++) {\n var k = keys[i];\n var uk = u[k];\n if (uk !== undefined && !props[k].is(uk)) {\n return false;\n }\n }\n return true;\n }\n return false;\n }, function (u, c) {\n var e = exports.UnknownRecord.validate(u, c);\n if (Either_1.isLeft(e)) {\n return e;\n }\n var o = e.right;\n var a = o;\n var errors = [];\n for (var i = 0; i < len; i++) {\n var k = keys[i];\n var ak = a[k];\n var type_2 = props[k];\n var result = type_2.validate(ak, appendContext(c, k, type_2, ak));\n if (Either_1.isLeft(result)) {\n if (ak !== undefined) {\n pushAll(errors, result.left);\n }\n }\n else {\n var vak = result.right;\n if (vak !== ak) {\n /* istanbul ignore next */\n if (a === o) {\n a = __assign({}, o);\n }\n a[k] = vak;\n }\n }\n }\n return errors.length > 0 ? exports.failures(errors) : exports.success(a);\n }, useIdentity(types)\n ? exports.identity\n : function (a) {\n var s = __assign({}, a);\n for (var i = 0; i < len; i++) {\n var k = keys[i];\n var ak = a[k];\n if (ak !== undefined) {\n s[k] = types[i].encode(ak);\n }\n }\n return s;\n }, props);\n}\nexports.partial = partial;\n/**\n * @since 1.0.0\n */\nvar DictionaryType = /** @class */ (function (_super) {\n __extends(DictionaryType, _super);\n function DictionaryType(name, is, validate, encode, domain, codomain) {\n var _this = _super.call(this, name, is, validate, encode) || this;\n _this.domain = domain;\n _this.codomain = codomain;\n /**\n * @since 1.0.0\n */\n _this._tag = 'DictionaryType';\n return _this;\n }\n return DictionaryType;\n}(Type));\nexports.DictionaryType = DictionaryType;\n/**\n * @category combinators\n * @since 1.7.1\n */\nfunction record(domain, codomain, name) {\n var keys = getDomainKeys(domain);\n return keys\n ? enumerableRecord(Object.keys(keys), domain, codomain, name)\n : nonEnumerableRecord(domain, codomain, name);\n}\nexports.record = record;\n/**\n * @since 1.0.0\n */\nvar UnionType = /** @class */ (function (_super) {\n __extends(UnionType, _super);\n function UnionType(name, is, validate, encode, types) {\n var _this = _super.call(this, name, is, validate, encode) || this;\n _this.types = types;\n /**\n * @since 1.0.0\n */\n _this._tag = 'UnionType';\n return _this;\n }\n return UnionType;\n}(Type));\nexports.UnionType = UnionType;\n/**\n * @category combinators\n * @since 1.0.0\n */\nfunction union(codecs, name) {\n if (name === void 0) { name = getUnionName(codecs); }\n var index = getIndex(codecs);\n if (index !== undefined && codecs.length > 0) {\n var tag_1 = index[0], groups_1 = index[1];\n var len_1 = groups_1.length;\n var find_1 = function (value) {\n for (var i = 0; i < len_1; i++) {\n if (groups_1[i].indexOf(value) !== -1) {\n return i;\n }\n }\n return undefined;\n };\n // tslint:disable-next-line: deprecation\n return new TaggedUnionType(name, function (u) {\n if (exports.UnknownRecord.is(u)) {\n var i = find_1(u[tag_1]);\n return i !== undefined ? codecs[i].is(u) : false;\n }\n return false;\n }, function (u, c) {\n var e = exports.UnknownRecord.validate(u, c);\n if (Either_1.isLeft(e)) {\n return e;\n }\n var r = e.right;\n var i = find_1(r[tag_1]);\n if (i === undefined) {\n return exports.failure(u, c);\n }\n var codec = codecs[i];\n return codec.validate(r, appendContext(c, String(i), codec, r));\n }, useIdentity(codecs)\n ? exports.identity\n : function (a) {\n var i = find_1(a[tag_1]);\n if (i === undefined) {\n // https://github.com/gcanti/io-ts/pull/305\n throw new Error(\"no codec found to encode value in union codec \" + name);\n }\n else {\n return codecs[i].encode(a);\n }\n }, codecs, tag_1);\n }\n else {\n return new UnionType(name, function (u) { return codecs.some(function (type) { return type.is(u); }); }, function (u, c) {\n var errors = [];\n for (var i = 0; i < codecs.length; i++) {\n var codec = codecs[i];\n var result = codec.validate(u, appendContext(c, String(i), codec, u));\n if (Either_1.isLeft(result)) {\n pushAll(errors, result.left);\n }\n else {\n return exports.success(result.right);\n }\n }\n return exports.failures(errors);\n }, useIdentity(codecs)\n ? exports.identity\n : function (a) {\n for (var _i = 0, codecs_1 = codecs; _i < codecs_1.length; _i++) {\n var codec = codecs_1[_i];\n if (codec.is(a)) {\n return codec.encode(a);\n }\n }\n // https://github.com/gcanti/io-ts/pull/305\n throw new Error(\"no codec found to encode value in union type \" + name);\n }, codecs);\n }\n}\nexports.union = union;\n/**\n * @since 1.0.0\n */\nvar IntersectionType = /** @class */ (function (_super) {\n __extends(IntersectionType, _super);\n function IntersectionType(name, is, validate, encode, types) {\n var _this = _super.call(this, name, is, validate, encode) || this;\n _this.types = types;\n /**\n * @since 1.0.0\n */\n _this._tag = 'IntersectionType';\n return _this;\n }\n return IntersectionType;\n}(Type));\nexports.IntersectionType = IntersectionType;\nfunction intersection(codecs, name) {\n if (name === void 0) { name = \"(\" + codecs.map(function (type) { return type.name; }).join(' & ') + \")\"; }\n var len = codecs.length;\n return new IntersectionType(name, function (u) { return codecs.every(function (type) { return type.is(u); }); }, codecs.length === 0\n ? exports.success\n : function (u, c) {\n var us = [];\n var errors = [];\n for (var i = 0; i < len; i++) {\n var codec = codecs[i];\n var result = codec.validate(u, appendContext(c, String(i), codec, u));\n if (Either_1.isLeft(result)) {\n pushAll(errors, result.left);\n }\n else {\n us.push(result.right);\n }\n }\n return errors.length > 0 ? exports.failures(errors) : exports.success(mergeAll(u, us));\n }, codecs.length === 0\n ? exports.identity\n : function (a) {\n return mergeAll(a, codecs.map(function (codec) { return codec.encode(a); }));\n }, codecs);\n}\nexports.intersection = intersection;\n/**\n * @since 1.0.0\n */\nvar TupleType = /** @class */ (function (_super) {\n __extends(TupleType, _super);\n function TupleType(name, is, validate, encode, types) {\n var _this = _super.call(this, name, is, validate, encode) || this;\n _this.types = types;\n /**\n * @since 1.0.0\n */\n _this._tag = 'TupleType';\n return _this;\n }\n return TupleType;\n}(Type));\nexports.TupleType = TupleType;\nfunction tuple(codecs, name) {\n if (name === void 0) { name = \"[\" + codecs.map(function (type) { return type.name; }).join(', ') + \"]\"; }\n var len = codecs.length;\n return new TupleType(name, function (u) { return exports.UnknownArray.is(u) && u.length === len && codecs.every(function (type, i) { return type.is(u[i]); }); }, function (u, c) {\n var e = exports.UnknownArray.validate(u, c);\n if (Either_1.isLeft(e)) {\n return e;\n }\n var us = e.right;\n var as = us.length > len ? us.slice(0, len) : us; // strip additional components\n var errors = [];\n for (var i = 0; i < len; i++) {\n var a = us[i];\n var type_3 = codecs[i];\n var result = type_3.validate(a, appendContext(c, String(i), type_3, a));\n if (Either_1.isLeft(result)) {\n pushAll(errors, result.left);\n }\n else {\n var va = result.right;\n if (va !== a) {\n /* istanbul ignore next */\n if (as === us) {\n as = us.slice();\n }\n as[i] = va;\n }\n }\n }\n return errors.length > 0 ? exports.failures(errors) : exports.success(as);\n }, useIdentity(codecs) ? exports.identity : function (a) { return codecs.map(function (type, i) { return type.encode(a[i]); }); }, codecs);\n}\nexports.tuple = tuple;\n/**\n * @since 1.0.0\n */\nvar ReadonlyType = /** @class */ (function (_super) {\n __extends(ReadonlyType, _super);\n function ReadonlyType(name, is, validate, encode, type) {\n var _this = _super.call(this, name, is, validate, encode) || this;\n _this.type = type;\n /**\n * @since 1.0.0\n */\n _this._tag = 'ReadonlyType';\n return _this;\n }\n return ReadonlyType;\n}(Type));\nexports.ReadonlyType = ReadonlyType;\n/**\n * @category combinators\n * @since 1.0.0\n */\nfunction readonly(codec, name) {\n if (name === void 0) { name = \"Readonly<\" + codec.name + \">\"; }\n return new ReadonlyType(name, codec.is, codec.validate, codec.encode, codec);\n}\nexports.readonly = readonly;\n/**\n * @since 1.0.0\n */\nvar ReadonlyArrayType = /** @class */ (function (_super) {\n __extends(ReadonlyArrayType, _super);\n function ReadonlyArrayType(name, is, validate, encode, type) {\n var _this = _super.call(this, name, is, validate, encode) || this;\n _this.type = type;\n /**\n * @since 1.0.0\n */\n _this._tag = 'ReadonlyArrayType';\n return _this;\n }\n return ReadonlyArrayType;\n}(Type));\nexports.ReadonlyArrayType = ReadonlyArrayType;\n/**\n * @category combinators\n * @since 1.0.0\n */\nfunction readonlyArray(item, name) {\n if (name === void 0) { name = \"ReadonlyArray<\" + item.name + \">\"; }\n var codec = array(item);\n return new ReadonlyArrayType(name, codec.is, codec.validate, codec.encode, item);\n}\nexports.readonlyArray = readonlyArray;\n/**\n * Strips additional properties, equivalent to `exact(type(props))`.\n *\n * @category combinators\n * @since 1.0.0\n */\nvar strict = function (props, name) { return exact(type(props), name); };\nexports.strict = strict;\n/**\n * @since 1.1.0\n */\nvar ExactType = /** @class */ (function (_super) {\n __extends(ExactType, _super);\n function ExactType(name, is, validate, encode, type) {\n var _this = _super.call(this, name, is, validate, encode) || this;\n _this.type = type;\n /**\n * @since 1.0.0\n */\n _this._tag = 'ExactType';\n return _this;\n }\n return ExactType;\n}(Type));\nexports.ExactType = ExactType;\n/**\n * Strips additional properties.\n *\n * @category combinators\n * @since 1.1.0\n */\nfunction exact(codec, name) {\n if (name === void 0) { name = getExactTypeName(codec); }\n var props = getProps(codec);\n return new ExactType(name, codec.is, function (u, c) {\n var e = exports.UnknownRecord.validate(u, c);\n if (Either_1.isLeft(e)) {\n return e;\n }\n var ce = codec.validate(u, c);\n if (Either_1.isLeft(ce)) {\n return ce;\n }\n return Either_1.right(stripKeys(ce.right, props));\n }, function (a) { return codec.encode(stripKeys(a, props)); }, codec);\n}\nexports.exact = exact;\n// -------------------------------------------------------------------------------------\n// deprecated\n// -------------------------------------------------------------------------------------\n/**\n * @since 1.0.0\n * @deprecated\n */\nvar FunctionType = /** @class */ (function (_super) {\n __extends(FunctionType, _super);\n function FunctionType() {\n var _this = _super.call(this, 'Function', \n // tslint:disable-next-line:strict-type-predicates\n function (u) { return typeof u === 'function'; }, function (u, c) { return (_this.is(u) ? exports.success(u) : exports.failure(u, c)); }, exports.identity) || this;\n /**\n * @since 1.0.0\n */\n _this._tag = 'FunctionType';\n return _this;\n }\n return FunctionType;\n}(Type));\nexports.FunctionType = FunctionType;\n/**\n * @category primitives\n * @since 1.0.0\n * @deprecated\n */\n// tslint:disable-next-line: deprecation\nexports.Function = new FunctionType();\n/**\n * @since 1.3.0\n * @deprecated\n */\nvar TaggedUnionType = /** @class */ (function (_super) {\n __extends(TaggedUnionType, _super);\n function TaggedUnionType(name, \n // tslint:disable-next-line: deprecation\n is, \n // tslint:disable-next-line: deprecation\n validate, \n // tslint:disable-next-line: deprecation\n encode, codecs, tag) {\n var _this = _super.call(this, name, is, validate, encode, codecs) /* istanbul ignore next */ // <= workaround for https://github.com/Microsoft/TypeScript/issues/13455\n || this;\n _this.tag = tag;\n return _this;\n }\n return TaggedUnionType;\n}(UnionType));\nexports.TaggedUnionType = TaggedUnionType;\n/**\n * Use `union` instead.\n *\n * @category combinators\n * @since 1.3.0\n * @deprecated\n */\nvar taggedUnion = function (tag, codecs, name\n// tslint:disable-next-line: deprecation\n) {\n if (name === void 0) { name = getUnionName(codecs); }\n var U = union(codecs, name);\n // tslint:disable-next-line: deprecation\n if (U instanceof TaggedUnionType) {\n return U;\n }\n else {\n console.warn(\"[io-ts] Cannot build a tagged union for \" + name + \", returning a de-optimized union\");\n // tslint:disable-next-line: deprecation\n return new TaggedUnionType(name, U.is, U.validate, U.encode, codecs, tag);\n }\n};\nexports.taggedUnion = taggedUnion;\n/**\n * @since 1.0.0\n * @deprecated\n */\nvar getValidationError /* istanbul ignore next */ = function (value, context) { return ({\n value: value,\n context: context\n}); };\nexports.getValidationError /* istanbul ignore next */ = getValidationError;\n/**\n * @since 1.0.0\n * @deprecated\n */\nvar getDefaultContext /* istanbul ignore next */ = function (decoder) { return [\n { key: '', type: decoder }\n]; };\nexports.getDefaultContext /* istanbul ignore next */ = getDefaultContext;\n/**\n * @since 1.0.0\n * @deprecated\n */\nvar NeverType = /** @class */ (function (_super) {\n __extends(NeverType, _super);\n function NeverType() {\n var _this = _super.call(this, 'never', function (_) { return false; }, function (u, c) { return exports.failure(u, c); }, \n /* istanbul ignore next */\n function () {\n throw new Error('cannot encode never');\n }) || this;\n /**\n * @since 1.0.0\n */\n _this._tag = 'NeverType';\n return _this;\n }\n return NeverType;\n}(Type));\nexports.NeverType = NeverType;\n/**\n * @category primitives\n * @since 1.0.0\n * @deprecated\n */\n// tslint:disable-next-line: deprecation\nexports.never = new NeverType();\n/**\n * @since 1.0.0\n * @deprecated\n */\nvar AnyType = /** @class */ (function (_super) {\n __extends(AnyType, _super);\n function AnyType() {\n var _this = _super.call(this, 'any', function (_) { return true; }, exports.success, exports.identity) || this;\n /**\n * @since 1.0.0\n */\n _this._tag = 'AnyType';\n return _this;\n }\n return AnyType;\n}(Type));\nexports.AnyType = AnyType;\n/**\n * Use `unknown` instead.\n *\n * @category primitives\n * @since 1.0.0\n * @deprecated\n */\n// tslint:disable-next-line: deprecation\nexports.any = new AnyType();\n/**\n * Use `UnknownRecord` instead.\n *\n * @category primitives\n * @since 1.0.0\n * @deprecated\n */\nexports.Dictionary = exports.UnknownRecord;\n/**\n * @since 1.0.0\n * @deprecated\n */\nvar ObjectType = /** @class */ (function (_super) {\n __extends(ObjectType, _super);\n function ObjectType() {\n var _this = _super.call(this, 'object', function (u) { return u !== null && typeof u === 'object'; }, function (u, c) { return (_this.is(u) ? exports.success(u) : exports.failure(u, c)); }, exports.identity) || this;\n /**\n * @since 1.0.0\n */\n _this._tag = 'ObjectType';\n return _this;\n }\n return ObjectType;\n}(Type));\nexports.ObjectType = ObjectType;\n/**\n * Use `UnknownRecord` instead.\n *\n * @category primitives\n * @since 1.0.0\n * @deprecated\n */\n// tslint:disable-next-line: deprecation\nexports.object = new ObjectType();\n/**\n * Use `brand` instead.\n *\n * @category combinators\n * @since 1.0.0\n * @deprecated\n */\nfunction refinement(codec, predicate, name) {\n if (name === void 0) { name = \"(\" + codec.name + \" | \" + getFunctionName(predicate) + \")\"; }\n return new RefinementType(name, function (u) { return codec.is(u) && predicate(u); }, function (i, c) {\n var e = codec.validate(i, c);\n if (Either_1.isLeft(e)) {\n return e;\n }\n var a = e.right;\n return predicate(a) ? exports.success(a) : exports.failure(a, c);\n }, codec.encode, codec, predicate);\n}\nexports.refinement = refinement;\n/**\n * Use `Int` instead.\n *\n * @category primitives\n * @since 1.0.0\n * @deprecated\n */\n// tslint:disable-next-line: deprecation\nexports.Integer = refinement(exports.number, Number.isInteger, 'Integer');\n/**\n * Use `record` instead.\n *\n * @category combinators\n * @since 1.0.0\n * @deprecated\n */\nexports.dictionary = record;\n/**\n * @since 1.0.0\n * @deprecated\n */\nvar StrictType = /** @class */ (function (_super) {\n __extends(StrictType, _super);\n function StrictType(name, \n // tslint:disable-next-line: deprecation\n is, \n // tslint:disable-next-line: deprecation\n validate, \n // tslint:disable-next-line: deprecation\n encode, props) {\n var _this = _super.call(this, name, is, validate, encode) || this;\n _this.props = props;\n /**\n * @since 1.0.0\n */\n _this._tag = 'StrictType';\n return _this;\n }\n return StrictType;\n}(Type));\nexports.StrictType = StrictType;\n/**\n * Drops the codec \"kind\".\n *\n * @category combinators\n * @since 1.1.0\n * @deprecated\n */\nfunction clean(codec) {\n return codec;\n}\nexports.clean = clean;\nfunction alias(codec) {\n return function () { return codec; };\n}\nexports.alias = alias;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n/*!\n * is-plain-object \n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\n\nfunction isObject(o) {\n return Object.prototype.toString.call(o) === '[object Object]';\n}\n\nfunction isPlainObject(o) {\n var ctor,prot;\n\n if (isObject(o) === false) return false;\n\n // If has modified constructor\n ctor = o.constructor;\n if (ctor === undefined) return true;\n\n // If has modified prototype\n prot = ctor.prototype;\n if (isObject(prot) === false) return false;\n\n // If constructor does not have an Object-specific method\n if (prot.hasOwnProperty('isPrototypeOf') === false) {\n return false;\n }\n\n // Most likely a plain Object\n return true;\n}\n\nexports.isPlainObject = isPlainObject;\n","'use strict';\n\n\nvar loader = require('./lib/loader');\nvar dumper = require('./lib/dumper');\n\n\nfunction renamed(from, to) {\n return function () {\n throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' +\n 'Use yaml.' + to + ' instead, which is now safe by default.');\n };\n}\n\n\nmodule.exports.Type = require('./lib/type');\nmodule.exports.Schema = require('./lib/schema');\nmodule.exports.FAILSAFE_SCHEMA = require('./lib/schema/failsafe');\nmodule.exports.JSON_SCHEMA = require('./lib/schema/json');\nmodule.exports.CORE_SCHEMA = require('./lib/schema/core');\nmodule.exports.DEFAULT_SCHEMA = require('./lib/schema/default');\nmodule.exports.load = loader.load;\nmodule.exports.loadAll = loader.loadAll;\nmodule.exports.dump = dumper.dump;\nmodule.exports.YAMLException = require('./lib/exception');\n\n// Removed functions from JS-YAML 3.0.x\nmodule.exports.safeLoad = renamed('safeLoad', 'load');\nmodule.exports.safeLoadAll = renamed('safeLoadAll', 'loadAll');\nmodule.exports.safeDump = renamed('safeDump', 'dump');\n","'use strict';\n\n\nfunction isNothing(subject) {\n return (typeof subject === 'undefined') || (subject === null);\n}\n\n\nfunction isObject(subject) {\n return (typeof subject === 'object') && (subject !== null);\n}\n\n\nfunction toArray(sequence) {\n if (Array.isArray(sequence)) return sequence;\n else if (isNothing(sequence)) return [];\n\n return [ sequence ];\n}\n\n\nfunction extend(target, source) {\n var index, length, key, sourceKeys;\n\n if (source) {\n sourceKeys = Object.keys(source);\n\n for (index = 0, length = sourceKeys.length; index < length; index += 1) {\n key = sourceKeys[index];\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\n\nfunction repeat(string, count) {\n var result = '', cycle;\n\n for (cycle = 0; cycle < count; cycle += 1) {\n result += string;\n }\n\n return result;\n}\n\n\nfunction isNegativeZero(number) {\n return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number);\n}\n\n\nmodule.exports.isNothing = isNothing;\nmodule.exports.isObject = isObject;\nmodule.exports.toArray = toArray;\nmodule.exports.repeat = repeat;\nmodule.exports.isNegativeZero = isNegativeZero;\nmodule.exports.extend = extend;\n","'use strict';\n\n/*eslint-disable no-use-before-define*/\n\nvar common = require('./common');\nvar YAMLException = require('./exception');\nvar DEFAULT_SCHEMA = require('./schema/default');\n\nvar _toString = Object.prototype.toString;\nvar _hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar CHAR_BOM = 0xFEFF;\nvar CHAR_TAB = 0x09; /* Tab */\nvar CHAR_LINE_FEED = 0x0A; /* LF */\nvar CHAR_CARRIAGE_RETURN = 0x0D; /* CR */\nvar CHAR_SPACE = 0x20; /* Space */\nvar CHAR_EXCLAMATION = 0x21; /* ! */\nvar CHAR_DOUBLE_QUOTE = 0x22; /* \" */\nvar CHAR_SHARP = 0x23; /* # */\nvar CHAR_PERCENT = 0x25; /* % */\nvar CHAR_AMPERSAND = 0x26; /* & */\nvar CHAR_SINGLE_QUOTE = 0x27; /* ' */\nvar CHAR_ASTERISK = 0x2A; /* * */\nvar CHAR_COMMA = 0x2C; /* , */\nvar CHAR_MINUS = 0x2D; /* - */\nvar CHAR_COLON = 0x3A; /* : */\nvar CHAR_EQUALS = 0x3D; /* = */\nvar CHAR_GREATER_THAN = 0x3E; /* > */\nvar CHAR_QUESTION = 0x3F; /* ? */\nvar CHAR_COMMERCIAL_AT = 0x40; /* @ */\nvar CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */\nvar CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */\nvar CHAR_GRAVE_ACCENT = 0x60; /* ` */\nvar CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */\nvar CHAR_VERTICAL_LINE = 0x7C; /* | */\nvar CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */\n\nvar ESCAPE_SEQUENCES = {};\n\nESCAPE_SEQUENCES[0x00] = '\\\\0';\nESCAPE_SEQUENCES[0x07] = '\\\\a';\nESCAPE_SEQUENCES[0x08] = '\\\\b';\nESCAPE_SEQUENCES[0x09] = '\\\\t';\nESCAPE_SEQUENCES[0x0A] = '\\\\n';\nESCAPE_SEQUENCES[0x0B] = '\\\\v';\nESCAPE_SEQUENCES[0x0C] = '\\\\f';\nESCAPE_SEQUENCES[0x0D] = '\\\\r';\nESCAPE_SEQUENCES[0x1B] = '\\\\e';\nESCAPE_SEQUENCES[0x22] = '\\\\\"';\nESCAPE_SEQUENCES[0x5C] = '\\\\\\\\';\nESCAPE_SEQUENCES[0x85] = '\\\\N';\nESCAPE_SEQUENCES[0xA0] = '\\\\_';\nESCAPE_SEQUENCES[0x2028] = '\\\\L';\nESCAPE_SEQUENCES[0x2029] = '\\\\P';\n\nvar DEPRECATED_BOOLEANS_SYNTAX = [\n 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',\n 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'\n];\n\nvar DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\\.[0-9_]*)?$/;\n\nfunction compileStyleMap(schema, map) {\n var result, keys, index, length, tag, style, type;\n\n if (map === null) return {};\n\n result = {};\n keys = Object.keys(map);\n\n for (index = 0, length = keys.length; index < length; index += 1) {\n tag = keys[index];\n style = String(map[tag]);\n\n if (tag.slice(0, 2) === '!!') {\n tag = 'tag:yaml.org,2002:' + tag.slice(2);\n }\n type = schema.compiledTypeMap['fallback'][tag];\n\n if (type && _hasOwnProperty.call(type.styleAliases, style)) {\n style = type.styleAliases[style];\n }\n\n result[tag] = style;\n }\n\n return result;\n}\n\nfunction encodeHex(character) {\n var string, handle, length;\n\n string = character.toString(16).toUpperCase();\n\n if (character <= 0xFF) {\n handle = 'x';\n length = 2;\n } else if (character <= 0xFFFF) {\n handle = 'u';\n length = 4;\n } else if (character <= 0xFFFFFFFF) {\n handle = 'U';\n length = 8;\n } else {\n throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF');\n }\n\n return '\\\\' + handle + common.repeat('0', length - string.length) + string;\n}\n\n\nvar QUOTING_TYPE_SINGLE = 1,\n QUOTING_TYPE_DOUBLE = 2;\n\nfunction State(options) {\n this.schema = options['schema'] || DEFAULT_SCHEMA;\n this.indent = Math.max(1, (options['indent'] || 2));\n this.noArrayIndent = options['noArrayIndent'] || false;\n this.skipInvalid = options['skipInvalid'] || false;\n this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);\n this.styleMap = compileStyleMap(this.schema, options['styles'] || null);\n this.sortKeys = options['sortKeys'] || false;\n this.lineWidth = options['lineWidth'] || 80;\n this.noRefs = options['noRefs'] || false;\n this.noCompatMode = options['noCompatMode'] || false;\n this.condenseFlow = options['condenseFlow'] || false;\n this.quotingType = options['quotingType'] === '\"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE;\n this.forceQuotes = options['forceQuotes'] || false;\n this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null;\n\n this.implicitTypes = this.schema.compiledImplicit;\n this.explicitTypes = this.schema.compiledExplicit;\n\n this.tag = null;\n this.result = '';\n\n this.duplicates = [];\n this.usedDuplicates = null;\n}\n\n// Indents every line in a string. Empty lines (\\n only) are not indented.\nfunction indentString(string, spaces) {\n var ind = common.repeat(' ', spaces),\n position = 0,\n next = -1,\n result = '',\n line,\n length = string.length;\n\n while (position < length) {\n next = string.indexOf('\\n', position);\n if (next === -1) {\n line = string.slice(position);\n position = length;\n } else {\n line = string.slice(position, next + 1);\n position = next + 1;\n }\n\n if (line.length && line !== '\\n') result += ind;\n\n result += line;\n }\n\n return result;\n}\n\nfunction generateNextLine(state, level) {\n return '\\n' + common.repeat(' ', state.indent * level);\n}\n\nfunction testImplicitResolving(state, str) {\n var index, length, type;\n\n for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {\n type = state.implicitTypes[index];\n\n if (type.resolve(str)) {\n return true;\n }\n }\n\n return false;\n}\n\n// [33] s-white ::= s-space | s-tab\nfunction isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}\n\n// Returns true if the character can be printed without escaping.\n// From YAML 1.2: \"any allowed characters known to be non-printable\n// should also be escaped. [However,] This isn’t mandatory\"\n// Derived from nb-char - \\t - #x85 - #xA0 - #x2028 - #x2029.\nfunction isPrintable(c) {\n return (0x00020 <= c && c <= 0x00007E)\n || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029)\n || ((0x0E000 <= c && c <= 0x00FFFD) && c !== CHAR_BOM)\n || (0x10000 <= c && c <= 0x10FFFF);\n}\n\n// [34] ns-char ::= nb-char - s-white\n// [27] nb-char ::= c-printable - b-char - c-byte-order-mark\n// [26] b-char ::= b-line-feed | b-carriage-return\n// Including s-white (for some reason, examples doesn't match specs in this aspect)\n// ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark\nfunction isNsCharOrWhitespace(c) {\n return isPrintable(c)\n && c !== CHAR_BOM\n // - b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}\n\n// [127] ns-plain-safe(c) ::= c = flow-out ⇒ ns-plain-safe-out\n// c = flow-in ⇒ ns-plain-safe-in\n// c = block-key ⇒ ns-plain-safe-out\n// c = flow-key ⇒ ns-plain-safe-in\n// [128] ns-plain-safe-out ::= ns-char\n// [129] ns-plain-safe-in ::= ns-char - c-flow-indicator\n// [130] ns-plain-char(c) ::= ( ns-plain-safe(c) - “:” - “#” )\n// | ( /* An ns-char preceding */ “#” )\n// | ( “:” /* Followed by an ns-plain-safe(c) */ )\nfunction isPlainSafe(c, prev, inblock) {\n var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);\n var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);\n return (\n // ns-plain-safe\n inblock ? // c = flow-in\n cIsNsCharOrWhitespace\n : cIsNsCharOrWhitespace\n // - c-flow-indicator\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n )\n // ns-plain-char\n && c !== CHAR_SHARP // false on '#'\n && !(prev === CHAR_COLON && !cIsNsChar) // false on ': '\n || (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) // change to true on '[^ ]#'\n || (prev === CHAR_COLON && cIsNsChar); // change to true on ':[^ ]'\n}\n\n// Simplified test for values allowed as the first character in plain style.\nfunction isPlainSafeFirst(c) {\n // Uses a subset of ns-char - c-indicator\n // where ns-char = nb-char - s-white.\n // No support of ( ( “?” | “:” | “-” ) /* Followed by an ns-plain-safe(c)) */ ) part\n return isPrintable(c) && c !== CHAR_BOM\n && !isWhitespace(c) // - s-white\n // - (c-indicator ::=\n // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}”\n && c !== CHAR_MINUS\n && c !== CHAR_QUESTION\n && c !== CHAR_COLON\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “\"”\n && c !== CHAR_SHARP\n && c !== CHAR_AMPERSAND\n && c !== CHAR_ASTERISK\n && c !== CHAR_EXCLAMATION\n && c !== CHAR_VERTICAL_LINE\n && c !== CHAR_EQUALS\n && c !== CHAR_GREATER_THAN\n && c !== CHAR_SINGLE_QUOTE\n && c !== CHAR_DOUBLE_QUOTE\n // | “%” | “@” | “`”)\n && c !== CHAR_PERCENT\n && c !== CHAR_COMMERCIAL_AT\n && c !== CHAR_GRAVE_ACCENT;\n}\n\n// Simplified test for values allowed as the last character in plain style.\nfunction isPlainSafeLast(c) {\n // just not whitespace or colon, it will be checked to be plain character later\n return !isWhitespace(c) && c !== CHAR_COLON;\n}\n\n// Same as 'string'.codePointAt(pos), but works in older browsers.\nfunction codePointAt(string, pos) {\n var first = string.charCodeAt(pos), second;\n if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {\n second = string.charCodeAt(pos + 1);\n if (second >= 0xDC00 && second <= 0xDFFF) {\n // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n }\n }\n return first;\n}\n\n// Determines whether block indentation indicator is required.\nfunction needIndentIndicator(string) {\n var leadingSpaceRe = /^\\n* /;\n return leadingSpaceRe.test(string);\n}\n\nvar STYLE_PLAIN = 1,\n STYLE_SINGLE = 2,\n STYLE_LITERAL = 3,\n STYLE_FOLDED = 4,\n STYLE_DOUBLE = 5;\n\n// Determines which scalar styles are possible and returns the preferred style.\n// lineWidth = -1 => no limit.\n// Pre-conditions: str.length > 0.\n// Post-conditions:\n// STYLE_PLAIN or STYLE_SINGLE => no \\n are in the string.\n// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1).\n// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1).\nfunction chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth,\n testAmbiguousType, quotingType, forceQuotes, inblock) {\n\n var i;\n var char = 0;\n var prevChar = null;\n var hasLineBreak = false;\n var hasFoldableLine = false; // only checked if shouldTrackWidth\n var shouldTrackWidth = lineWidth !== -1;\n var previousLineBreak = -1; // count the first line correctly\n var plain = isPlainSafeFirst(codePointAt(string, 0))\n && isPlainSafeLast(codePointAt(string, string.length - 1));\n\n if (singleLineOnly || forceQuotes) {\n // Case: no block styles.\n // Check for disallowed characters to rule out plain and single.\n for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n char = codePointAt(string, i);\n if (!isPrintable(char)) {\n return STYLE_DOUBLE;\n }\n plain = plain && isPlainSafe(char, prevChar, inblock);\n prevChar = char;\n }\n } else {\n // Case: block styles permitted.\n for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n char = codePointAt(string, i);\n if (char === CHAR_LINE_FEED) {\n hasLineBreak = true;\n // Check if any line can be folded.\n if (shouldTrackWidth) {\n hasFoldableLine = hasFoldableLine ||\n // Foldable line = too long, and not more-indented.\n (i - previousLineBreak - 1 > lineWidth &&\n string[previousLineBreak + 1] !== ' ');\n previousLineBreak = i;\n }\n } else if (!isPrintable(char)) {\n return STYLE_DOUBLE;\n }\n plain = plain && isPlainSafe(char, prevChar, inblock);\n prevChar = char;\n }\n // in case the end is missing a \\n\n hasFoldableLine = hasFoldableLine || (shouldTrackWidth &&\n (i - previousLineBreak - 1 > lineWidth &&\n string[previousLineBreak + 1] !== ' '));\n }\n // Although every style can represent \\n without escaping, prefer block styles\n // for multiline, since they're more readable and they don't add empty lines.\n // Also prefer folding a super-long line.\n if (!hasLineBreak && !hasFoldableLine) {\n // Strings interpretable as another type have to be quoted;\n // e.g. the string 'true' vs. the boolean true.\n if (plain && !forceQuotes && !testAmbiguousType(string)) {\n return STYLE_PLAIN;\n }\n return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;\n }\n // Edge case: block indentation indicator can only have one digit.\n if (indentPerLevel > 9 && needIndentIndicator(string)) {\n return STYLE_DOUBLE;\n }\n // At this point we know block styles are valid.\n // Prefer literal style unless we want to fold.\n if (!forceQuotes) {\n return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;\n }\n return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;\n}\n\n// Note: line breaking/folding is implemented for only the folded style.\n// NB. We drop the last trailing newline (if any) of a returned block scalar\n// since the dumper adds its own newline. This always works:\n// • No ending newline => unaffected; already using strip \"-\" chomping.\n// • Ending newline => removed then restored.\n// Importantly, this keeps the \"+\" chomp indicator from gaining an extra line.\nfunction writeScalar(state, string, level, iskey, inblock) {\n state.dump = (function () {\n if (string.length === 0) {\n return state.quotingType === QUOTING_TYPE_DOUBLE ? '\"\"' : \"''\";\n }\n if (!state.noCompatMode) {\n if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) {\n return state.quotingType === QUOTING_TYPE_DOUBLE ? ('\"' + string + '\"') : (\"'\" + string + \"'\");\n }\n }\n\n var indent = state.indent * Math.max(1, level); // no 0-indent scalars\n // As indentation gets deeper, let the width decrease monotonically\n // to the lower bound min(state.lineWidth, 40).\n // Note that this implies\n // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound.\n // state.lineWidth > 40 + state.indent: width decreases until the lower bound.\n // This behaves better than a constant minimum width which disallows narrower options,\n // or an indent threshold which causes the width to suddenly increase.\n var lineWidth = state.lineWidth === -1\n ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);\n\n // Without knowing if keys are implicit/explicit, assume implicit for safety.\n var singleLineOnly = iskey\n // No block styles in flow mode.\n || (state.flowLevel > -1 && level >= state.flowLevel);\n function testAmbiguity(string) {\n return testImplicitResolving(state, string);\n }\n\n switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth,\n testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) {\n\n case STYLE_PLAIN:\n return string;\n case STYLE_SINGLE:\n return \"'\" + string.replace(/'/g, \"''\") + \"'\";\n case STYLE_LITERAL:\n return '|' + blockHeader(string, state.indent)\n + dropEndingNewline(indentString(string, indent));\n case STYLE_FOLDED:\n return '>' + blockHeader(string, state.indent)\n + dropEndingNewline(indentString(foldString(string, lineWidth), indent));\n case STYLE_DOUBLE:\n return '\"' + escapeString(string, lineWidth) + '\"';\n default:\n throw new YAMLException('impossible error: invalid scalar style');\n }\n }());\n}\n\n// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.\nfunction blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}\n\n// (See the note for writeScalar.)\nfunction dropEndingNewline(string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n}\n\n// Note: a long line without a suitable break point will exceed the width limit.\n// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0.\nfunction foldString(string, width) {\n // In folded style, $k$ consecutive newlines output as $k+1$ newlines—\n // unless they're before or after a more-indented line, or at the very\n // beginning or end, in which case $k$ maps to $k$.\n // Therefore, parse each chunk as newline(s) followed by a content line.\n var lineRe = /(\\n+)([^\\n]*)/g;\n\n // first line (possibly an empty line)\n var result = (function () {\n var nextLF = string.indexOf('\\n');\n nextLF = nextLF !== -1 ? nextLF : string.length;\n lineRe.lastIndex = nextLF;\n return foldLine(string.slice(0, nextLF), width);\n }());\n // If we haven't reached the first content line yet, don't add an extra \\n.\n var prevMoreIndented = string[0] === '\\n' || string[0] === ' ';\n var moreIndented;\n\n // rest of the lines\n var match;\n while ((match = lineRe.exec(string))) {\n var prefix = match[1], line = match[2];\n moreIndented = (line[0] === ' ');\n result += prefix\n + (!prevMoreIndented && !moreIndented && line !== ''\n ? '\\n' : '')\n + foldLine(line, width);\n prevMoreIndented = moreIndented;\n }\n\n return result;\n}\n\n// Greedy line breaking.\n// Picks the longest line under the limit each time,\n// otherwise settles for the shortest line over the limit.\n// NB. More-indented lines *cannot* be folded, as that would add an extra \\n.\nfunction foldLine(line, width) {\n if (line === '' || line[0] === ' ') return line;\n\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n var match;\n // start is an inclusive index. end, curr, and next are exclusive.\n var start = 0, end, curr = 0, next = 0;\n var result = '';\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index;\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next; // derive end <= length-2\n result += '\\n' + line.slice(start, end);\n // skip the space that was output as \\n\n start = end + 1; // derive start <= length-1\n }\n curr = next;\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n';\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n } else {\n result += line.slice(start);\n }\n\n return result.slice(1); // drop extra \\n joiner\n}\n\n// Escapes a double-quoted string.\nfunction escapeString(string) {\n var result = '';\n var char = 0;\n var escapeSeq;\n\n for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n char = codePointAt(string, i);\n escapeSeq = ESCAPE_SEQUENCES[char];\n\n if (!escapeSeq && isPrintable(char)) {\n result += string[i];\n if (char >= 0x10000) result += string[i + 1];\n } else {\n result += escapeSeq || encodeHex(char);\n }\n }\n\n return result;\n}\n\nfunction writeFlowSequence(state, level, object) {\n var _result = '',\n _tag = state.tag,\n index,\n length,\n value;\n\n for (index = 0, length = object.length; index < length; index += 1) {\n value = object[index];\n\n if (state.replacer) {\n value = state.replacer.call(object, String(index), value);\n }\n\n // Write only valid elements, put null instead of invalid elements.\n if (writeNode(state, level, value, false, false) ||\n (typeof value === 'undefined' &&\n writeNode(state, level, null, false, false))) {\n\n if (_result !== '') _result += ',' + (!state.condenseFlow ? ' ' : '');\n _result += state.dump;\n }\n }\n\n state.tag = _tag;\n state.dump = '[' + _result + ']';\n}\n\nfunction writeBlockSequence(state, level, object, compact) {\n var _result = '',\n _tag = state.tag,\n index,\n length,\n value;\n\n for (index = 0, length = object.length; index < length; index += 1) {\n value = object[index];\n\n if (state.replacer) {\n value = state.replacer.call(object, String(index), value);\n }\n\n // Write only valid elements, put null instead of invalid elements.\n if (writeNode(state, level + 1, value, true, true, false, true) ||\n (typeof value === 'undefined' &&\n writeNode(state, level + 1, null, true, true, false, true))) {\n\n if (!compact || _result !== '') {\n _result += generateNextLine(state, level);\n }\n\n if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {\n _result += '-';\n } else {\n _result += '- ';\n }\n\n _result += state.dump;\n }\n }\n\n state.tag = _tag;\n state.dump = _result || '[]'; // Empty sequence if no valid values.\n}\n\nfunction writeFlowMapping(state, level, object) {\n var _result = '',\n _tag = state.tag,\n objectKeyList = Object.keys(object),\n index,\n length,\n objectKey,\n objectValue,\n pairBuffer;\n\n for (index = 0, length = objectKeyList.length; index < length; index += 1) {\n\n pairBuffer = '';\n if (_result !== '') pairBuffer += ', ';\n\n if (state.condenseFlow) pairBuffer += '\"';\n\n objectKey = objectKeyList[index];\n objectValue = object[objectKey];\n\n if (state.replacer) {\n objectValue = state.replacer.call(object, objectKey, objectValue);\n }\n\n if (!writeNode(state, level, objectKey, false, false)) {\n continue; // Skip this pair because of invalid key;\n }\n\n if (state.dump.length > 1024) pairBuffer += '? ';\n\n pairBuffer += state.dump + (state.condenseFlow ? '\"' : '') + ':' + (state.condenseFlow ? '' : ' ');\n\n if (!writeNode(state, level, objectValue, false, false)) {\n continue; // Skip this pair because of invalid value.\n }\n\n pairBuffer += state.dump;\n\n // Both key and value are valid.\n _result += pairBuffer;\n }\n\n state.tag = _tag;\n state.dump = '{' + _result + '}';\n}\n\nfunction writeBlockMapping(state, level, object, compact) {\n var _result = '',\n _tag = state.tag,\n objectKeyList = Object.keys(object),\n index,\n length,\n objectKey,\n objectValue,\n explicitPair,\n pairBuffer;\n\n // Allow sorting keys so that the output file is deterministic\n if (state.sortKeys === true) {\n // Default sorting\n objectKeyList.sort();\n } else if (typeof state.sortKeys === 'function') {\n // Custom sort function\n objectKeyList.sort(state.sortKeys);\n } else if (state.sortKeys) {\n // Something is wrong\n throw new YAMLException('sortKeys must be a boolean or a function');\n }\n\n for (index = 0, length = objectKeyList.length; index < length; index += 1) {\n pairBuffer = '';\n\n if (!compact || _result !== '') {\n pairBuffer += generateNextLine(state, level);\n }\n\n objectKey = objectKeyList[index];\n objectValue = object[objectKey];\n\n if (state.replacer) {\n objectValue = state.replacer.call(object, objectKey, objectValue);\n }\n\n if (!writeNode(state, level + 1, objectKey, true, true, true)) {\n continue; // Skip this pair because of invalid key.\n }\n\n explicitPair = (state.tag !== null && state.tag !== '?') ||\n (state.dump && state.dump.length > 1024);\n\n if (explicitPair) {\n if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {\n pairBuffer += '?';\n } else {\n pairBuffer += '? ';\n }\n }\n\n pairBuffer += state.dump;\n\n if (explicitPair) {\n pairBuffer += generateNextLine(state, level);\n }\n\n if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {\n continue; // Skip this pair because of invalid value.\n }\n\n if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {\n pairBuffer += ':';\n } else {\n pairBuffer += ': ';\n }\n\n pairBuffer += state.dump;\n\n // Both key and value are valid.\n _result += pairBuffer;\n }\n\n state.tag = _tag;\n state.dump = _result || '{}'; // Empty mapping if no valid pairs.\n}\n\nfunction detectType(state, object, explicit) {\n var _result, typeList, index, length, type, style;\n\n typeList = explicit ? state.explicitTypes : state.implicitTypes;\n\n for (index = 0, length = typeList.length; index < length; index += 1) {\n type = typeList[index];\n\n if ((type.instanceOf || type.predicate) &&\n (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) &&\n (!type.predicate || type.predicate(object))) {\n\n if (explicit) {\n if (type.multi && type.representName) {\n state.tag = type.representName(object);\n } else {\n state.tag = type.tag;\n }\n } else {\n state.tag = '?';\n }\n\n if (type.represent) {\n style = state.styleMap[type.tag] || type.defaultStyle;\n\n if (_toString.call(type.represent) === '[object Function]') {\n _result = type.represent(object, style);\n } else if (_hasOwnProperty.call(type.represent, style)) {\n _result = type.represent[style](object, style);\n } else {\n throw new YAMLException('!<' + type.tag + '> tag resolver accepts not \"' + style + '\" style');\n }\n\n state.dump = _result;\n }\n\n return true;\n }\n }\n\n return false;\n}\n\n// Serializes `object` and writes it to global `result`.\n// Returns true on success, or false on invalid object.\n//\nfunction writeNode(state, level, object, block, compact, iskey, isblockseq) {\n state.tag = null;\n state.dump = object;\n\n if (!detectType(state, object, false)) {\n detectType(state, object, true);\n }\n\n var type = _toString.call(state.dump);\n var inblock = block;\n var tagStr;\n\n if (block) {\n block = (state.flowLevel < 0 || state.flowLevel > level);\n }\n\n var objectOrArray = type === '[object Object]' || type === '[object Array]',\n duplicateIndex,\n duplicate;\n\n if (objectOrArray) {\n duplicateIndex = state.duplicates.indexOf(object);\n duplicate = duplicateIndex !== -1;\n }\n\n if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) {\n compact = false;\n }\n\n if (duplicate && state.usedDuplicates[duplicateIndex]) {\n state.dump = '*ref_' + duplicateIndex;\n } else {\n if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {\n state.usedDuplicates[duplicateIndex] = true;\n }\n if (type === '[object Object]') {\n if (block && (Object.keys(state.dump).length !== 0)) {\n writeBlockMapping(state, level, state.dump, compact);\n if (duplicate) {\n state.dump = '&ref_' + duplicateIndex + state.dump;\n }\n } else {\n writeFlowMapping(state, level, state.dump);\n if (duplicate) {\n state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;\n }\n }\n } else if (type === '[object Array]') {\n if (block && (state.dump.length !== 0)) {\n if (state.noArrayIndent && !isblockseq && level > 0) {\n writeBlockSequence(state, level - 1, state.dump, compact);\n } else {\n writeBlockSequence(state, level, state.dump, compact);\n }\n if (duplicate) {\n state.dump = '&ref_' + duplicateIndex + state.dump;\n }\n } else {\n writeFlowSequence(state, level, state.dump);\n if (duplicate) {\n state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;\n }\n }\n } else if (type === '[object String]') {\n if (state.tag !== '?') {\n writeScalar(state, state.dump, level, iskey, inblock);\n }\n } else if (type === '[object Undefined]') {\n return false;\n } else {\n if (state.skipInvalid) return false;\n throw new YAMLException('unacceptable kind of an object to dump ' + type);\n }\n\n if (state.tag !== null && state.tag !== '?') {\n // Need to encode all characters except those allowed by the spec:\n //\n // [35] ns-dec-digit ::= [#x30-#x39] /* 0-9 */\n // [36] ns-hex-digit ::= ns-dec-digit\n // | [#x41-#x46] /* A-F */ | [#x61-#x66] /* a-f */\n // [37] ns-ascii-letter ::= [#x41-#x5A] /* A-Z */ | [#x61-#x7A] /* a-z */\n // [38] ns-word-char ::= ns-dec-digit | ns-ascii-letter | “-”\n // [39] ns-uri-char ::= “%” ns-hex-digit ns-hex-digit | ns-word-char | “#”\n // | “;” | “/” | “?” | “:” | “@” | “&” | “=” | “+” | “$” | “,”\n // | “_” | “.” | “!” | “~” | “*” | “'” | “(” | “)” | “[” | “]”\n //\n // Also need to encode '!' because it has special meaning (end of tag prefix).\n //\n tagStr = encodeURI(\n state.tag[0] === '!' ? state.tag.slice(1) : state.tag\n ).replace(/!/g, '%21');\n\n if (state.tag[0] === '!') {\n tagStr = '!' + tagStr;\n } else if (tagStr.slice(0, 18) === 'tag:yaml.org,2002:') {\n tagStr = '!!' + tagStr.slice(18);\n } else {\n tagStr = '!<' + tagStr + '>';\n }\n\n state.dump = tagStr + ' ' + state.dump;\n }\n }\n\n return true;\n}\n\nfunction getDuplicateReferences(object, state) {\n var objects = [],\n duplicatesIndexes = [],\n index,\n length;\n\n inspectNode(object, objects, duplicatesIndexes);\n\n for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {\n state.duplicates.push(objects[duplicatesIndexes[index]]);\n }\n state.usedDuplicates = new Array(length);\n}\n\nfunction inspectNode(object, objects, duplicatesIndexes) {\n var objectKeyList,\n index,\n length;\n\n if (object !== null && typeof object === 'object') {\n index = objects.indexOf(object);\n if (index !== -1) {\n if (duplicatesIndexes.indexOf(index) === -1) {\n duplicatesIndexes.push(index);\n }\n } else {\n objects.push(object);\n\n if (Array.isArray(object)) {\n for (index = 0, length = object.length; index < length; index += 1) {\n inspectNode(object[index], objects, duplicatesIndexes);\n }\n } else {\n objectKeyList = Object.keys(object);\n\n for (index = 0, length = objectKeyList.length; index < length; index += 1) {\n inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);\n }\n }\n }\n }\n}\n\nfunction dump(input, options) {\n options = options || {};\n\n var state = new State(options);\n\n if (!state.noRefs) getDuplicateReferences(input, state);\n\n var value = input;\n\n if (state.replacer) {\n value = state.replacer.call({ '': value }, '', value);\n }\n\n if (writeNode(state, 0, value, true, true)) return state.dump + '\\n';\n\n return '';\n}\n\nmodule.exports.dump = dump;\n","// YAML error class. http://stackoverflow.com/questions/8458984\n//\n'use strict';\n\n\nfunction formatError(exception, compact) {\n var where = '', message = exception.reason || '(unknown reason)';\n\n if (!exception.mark) return message;\n\n if (exception.mark.name) {\n where += 'in \"' + exception.mark.name + '\" ';\n }\n\n where += '(' + (exception.mark.line + 1) + ':' + (exception.mark.column + 1) + ')';\n\n if (!compact && exception.mark.snippet) {\n where += '\\n\\n' + exception.mark.snippet;\n }\n\n return message + ' ' + where;\n}\n\n\nfunction YAMLException(reason, mark) {\n // Super constructor\n Error.call(this);\n\n this.name = 'YAMLException';\n this.reason = reason;\n this.mark = mark;\n this.message = formatError(this, false);\n\n // Include stack trace in error object\n if (Error.captureStackTrace) {\n // Chrome and NodeJS\n Error.captureStackTrace(this, this.constructor);\n } else {\n // FF, IE 10+ and Safari 6+. Fallback for others\n this.stack = (new Error()).stack || '';\n }\n}\n\n\n// Inherit from Error\nYAMLException.prototype = Object.create(Error.prototype);\nYAMLException.prototype.constructor = YAMLException;\n\n\nYAMLException.prototype.toString = function toString(compact) {\n return this.name + ': ' + formatError(this, compact);\n};\n\n\nmodule.exports = YAMLException;\n","'use strict';\n\n/*eslint-disable max-len,no-use-before-define*/\n\nvar common = require('./common');\nvar YAMLException = require('./exception');\nvar makeSnippet = require('./snippet');\nvar DEFAULT_SCHEMA = require('./schema/default');\n\n\nvar _hasOwnProperty = Object.prototype.hasOwnProperty;\n\n\nvar CONTEXT_FLOW_IN = 1;\nvar CONTEXT_FLOW_OUT = 2;\nvar CONTEXT_BLOCK_IN = 3;\nvar CONTEXT_BLOCK_OUT = 4;\n\n\nvar CHOMPING_CLIP = 1;\nvar CHOMPING_STRIP = 2;\nvar CHOMPING_KEEP = 3;\n\n\nvar PATTERN_NON_PRINTABLE = /[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F-\\x84\\x86-\\x9F\\uFFFE\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]/;\nvar PATTERN_NON_ASCII_LINE_BREAKS = /[\\x85\\u2028\\u2029]/;\nvar PATTERN_FLOW_INDICATORS = /[,\\[\\]\\{\\}]/;\nvar PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\\-]+!)$/i;\nvar PATTERN_TAG_URI = /^(?:!|[^,\\[\\]\\{\\}])(?:%[0-9a-f]{2}|[0-9a-z\\-#;\\/\\?:@&=\\+\\$,_\\.!~\\*'\\(\\)\\[\\]])*$/i;\n\n\nfunction _class(obj) { return Object.prototype.toString.call(obj); }\n\nfunction is_EOL(c) {\n return (c === 0x0A/* LF */) || (c === 0x0D/* CR */);\n}\n\nfunction is_WHITE_SPACE(c) {\n return (c === 0x09/* Tab */) || (c === 0x20/* Space */);\n}\n\nfunction is_WS_OR_EOL(c) {\n return (c === 0x09/* Tab */) ||\n (c === 0x20/* Space */) ||\n (c === 0x0A/* LF */) ||\n (c === 0x0D/* CR */);\n}\n\nfunction is_FLOW_INDICATOR(c) {\n return c === 0x2C/* , */ ||\n c === 0x5B/* [ */ ||\n c === 0x5D/* ] */ ||\n c === 0x7B/* { */ ||\n c === 0x7D/* } */;\n}\n\nfunction fromHexCode(c) {\n var lc;\n\n if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {\n return c - 0x30;\n }\n\n /*eslint-disable no-bitwise*/\n lc = c | 0x20;\n\n if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) {\n return lc - 0x61 + 10;\n }\n\n return -1;\n}\n\nfunction escapedHexLen(c) {\n if (c === 0x78/* x */) { return 2; }\n if (c === 0x75/* u */) { return 4; }\n if (c === 0x55/* U */) { return 8; }\n return 0;\n}\n\nfunction fromDecimalCode(c) {\n if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {\n return c - 0x30;\n }\n\n return -1;\n}\n\nfunction simpleEscapeSequence(c) {\n /* eslint-disable indent */\n return (c === 0x30/* 0 */) ? '\\x00' :\n (c === 0x61/* a */) ? '\\x07' :\n (c === 0x62/* b */) ? '\\x08' :\n (c === 0x74/* t */) ? '\\x09' :\n (c === 0x09/* Tab */) ? '\\x09' :\n (c === 0x6E/* n */) ? '\\x0A' :\n (c === 0x76/* v */) ? '\\x0B' :\n (c === 0x66/* f */) ? '\\x0C' :\n (c === 0x72/* r */) ? '\\x0D' :\n (c === 0x65/* e */) ? '\\x1B' :\n (c === 0x20/* Space */) ? ' ' :\n (c === 0x22/* \" */) ? '\\x22' :\n (c === 0x2F/* / */) ? '/' :\n (c === 0x5C/* \\ */) ? '\\x5C' :\n (c === 0x4E/* N */) ? '\\x85' :\n (c === 0x5F/* _ */) ? '\\xA0' :\n (c === 0x4C/* L */) ? '\\u2028' :\n (c === 0x50/* P */) ? '\\u2029' : '';\n}\n\nfunction charFromCodepoint(c) {\n if (c <= 0xFFFF) {\n return String.fromCharCode(c);\n }\n // Encode UTF-16 surrogate pair\n // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF\n return String.fromCharCode(\n ((c - 0x010000) >> 10) + 0xD800,\n ((c - 0x010000) & 0x03FF) + 0xDC00\n );\n}\n\nvar simpleEscapeCheck = new Array(256); // integer, for fast access\nvar simpleEscapeMap = new Array(256);\nfor (var i = 0; i < 256; i++) {\n simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;\n simpleEscapeMap[i] = simpleEscapeSequence(i);\n}\n\n\nfunction State(input, options) {\n this.input = input;\n\n this.filename = options['filename'] || null;\n this.schema = options['schema'] || DEFAULT_SCHEMA;\n this.onWarning = options['onWarning'] || null;\n // (Hidden) Remove? makes the loader to expect YAML 1.1 documents\n // if such documents have no explicit %YAML directive\n this.legacy = options['legacy'] || false;\n\n this.json = options['json'] || false;\n this.listener = options['listener'] || null;\n\n this.implicitTypes = this.schema.compiledImplicit;\n this.typeMap = this.schema.compiledTypeMap;\n\n this.length = input.length;\n this.position = 0;\n this.line = 0;\n this.lineStart = 0;\n this.lineIndent = 0;\n\n // position of first leading tab in the current line,\n // used to make sure there are no tabs in the indentation\n this.firstTabInLine = -1;\n\n this.documents = [];\n\n /*\n this.version;\n this.checkLineBreaks;\n this.tagMap;\n this.anchorMap;\n this.tag;\n this.anchor;\n this.kind;\n this.result;*/\n\n}\n\n\nfunction generateError(state, message) {\n var mark = {\n name: state.filename,\n buffer: state.input.slice(0, -1), // omit trailing \\0\n position: state.position,\n line: state.line,\n column: state.position - state.lineStart\n };\n\n mark.snippet = makeSnippet(mark);\n\n return new YAMLException(message, mark);\n}\n\nfunction throwError(state, message) {\n throw generateError(state, message);\n}\n\nfunction throwWarning(state, message) {\n if (state.onWarning) {\n state.onWarning.call(null, generateError(state, message));\n }\n}\n\n\nvar directiveHandlers = {\n\n YAML: function handleYamlDirective(state, name, args) {\n\n var match, major, minor;\n\n if (state.version !== null) {\n throwError(state, 'duplication of %YAML directive');\n }\n\n if (args.length !== 1) {\n throwError(state, 'YAML directive accepts exactly one argument');\n }\n\n match = /^([0-9]+)\\.([0-9]+)$/.exec(args[0]);\n\n if (match === null) {\n throwError(state, 'ill-formed argument of the YAML directive');\n }\n\n major = parseInt(match[1], 10);\n minor = parseInt(match[2], 10);\n\n if (major !== 1) {\n throwError(state, 'unacceptable YAML version of the document');\n }\n\n state.version = args[0];\n state.checkLineBreaks = (minor < 2);\n\n if (minor !== 1 && minor !== 2) {\n throwWarning(state, 'unsupported YAML version of the document');\n }\n },\n\n TAG: function handleTagDirective(state, name, args) {\n\n var handle, prefix;\n\n if (args.length !== 2) {\n throwError(state, 'TAG directive accepts exactly two arguments');\n }\n\n handle = args[0];\n prefix = args[1];\n\n if (!PATTERN_TAG_HANDLE.test(handle)) {\n throwError(state, 'ill-formed tag handle (first argument) of the TAG directive');\n }\n\n if (_hasOwnProperty.call(state.tagMap, handle)) {\n throwError(state, 'there is a previously declared suffix for \"' + handle + '\" tag handle');\n }\n\n if (!PATTERN_TAG_URI.test(prefix)) {\n throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive');\n }\n\n try {\n prefix = decodeURIComponent(prefix);\n } catch (err) {\n throwError(state, 'tag prefix is malformed: ' + prefix);\n }\n\n state.tagMap[handle] = prefix;\n }\n};\n\n\nfunction captureSegment(state, start, end, checkJson) {\n var _position, _length, _character, _result;\n\n if (start < end) {\n _result = state.input.slice(start, end);\n\n if (checkJson) {\n for (_position = 0, _length = _result.length; _position < _length; _position += 1) {\n _character = _result.charCodeAt(_position);\n if (!(_character === 0x09 ||\n (0x20 <= _character && _character <= 0x10FFFF))) {\n throwError(state, 'expected valid JSON character');\n }\n }\n } else if (PATTERN_NON_PRINTABLE.test(_result)) {\n throwError(state, 'the stream contains non-printable characters');\n }\n\n state.result += _result;\n }\n}\n\nfunction mergeMappings(state, destination, source, overridableKeys) {\n var sourceKeys, key, index, quantity;\n\n if (!common.isObject(source)) {\n throwError(state, 'cannot merge mappings; the provided source object is unacceptable');\n }\n\n sourceKeys = Object.keys(source);\n\n for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {\n key = sourceKeys[index];\n\n if (!_hasOwnProperty.call(destination, key)) {\n destination[key] = source[key];\n overridableKeys[key] = true;\n }\n }\n}\n\nfunction storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode,\n startLine, startLineStart, startPos) {\n\n var index, quantity;\n\n // The output is a plain object here, so keys can only be strings.\n // We need to convert keyNode to a string, but doing so can hang the process\n // (deeply nested arrays that explode exponentially using aliases).\n if (Array.isArray(keyNode)) {\n keyNode = Array.prototype.slice.call(keyNode);\n\n for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {\n if (Array.isArray(keyNode[index])) {\n throwError(state, 'nested arrays are not supported inside keys');\n }\n\n if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') {\n keyNode[index] = '[object Object]';\n }\n }\n }\n\n // Avoid code execution in load() via toString property\n // (still use its own toString for arrays, timestamps,\n // and whatever user schema extensions happen to have @@toStringTag)\n if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') {\n keyNode = '[object Object]';\n }\n\n\n keyNode = String(keyNode);\n\n if (_result === null) {\n _result = {};\n }\n\n if (keyTag === 'tag:yaml.org,2002:merge') {\n if (Array.isArray(valueNode)) {\n for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {\n mergeMappings(state, _result, valueNode[index], overridableKeys);\n }\n } else {\n mergeMappings(state, _result, valueNode, overridableKeys);\n }\n } else {\n if (!state.json &&\n !_hasOwnProperty.call(overridableKeys, keyNode) &&\n _hasOwnProperty.call(_result, keyNode)) {\n state.line = startLine || state.line;\n state.lineStart = startLineStart || state.lineStart;\n state.position = startPos || state.position;\n throwError(state, 'duplicated mapping key');\n }\n\n // used for this specific key only because Object.defineProperty is slow\n if (keyNode === '__proto__') {\n Object.defineProperty(_result, keyNode, {\n configurable: true,\n enumerable: true,\n writable: true,\n value: valueNode\n });\n } else {\n _result[keyNode] = valueNode;\n }\n delete overridableKeys[keyNode];\n }\n\n return _result;\n}\n\nfunction readLineBreak(state) {\n var ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch === 0x0A/* LF */) {\n state.position++;\n } else if (ch === 0x0D/* CR */) {\n state.position++;\n if (state.input.charCodeAt(state.position) === 0x0A/* LF */) {\n state.position++;\n }\n } else {\n throwError(state, 'a line break is expected');\n }\n\n state.line += 1;\n state.lineStart = state.position;\n state.firstTabInLine = -1;\n}\n\nfunction skipSeparationSpace(state, allowComments, checkIndent) {\n var lineBreaks = 0,\n ch = state.input.charCodeAt(state.position);\n\n while (ch !== 0) {\n while (is_WHITE_SPACE(ch)) {\n if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) {\n state.firstTabInLine = state.position;\n }\n ch = state.input.charCodeAt(++state.position);\n }\n\n if (allowComments && ch === 0x23/* # */) {\n do {\n ch = state.input.charCodeAt(++state.position);\n } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0);\n }\n\n if (is_EOL(ch)) {\n readLineBreak(state);\n\n ch = state.input.charCodeAt(state.position);\n lineBreaks++;\n state.lineIndent = 0;\n\n while (ch === 0x20/* Space */) {\n state.lineIndent++;\n ch = state.input.charCodeAt(++state.position);\n }\n } else {\n break;\n }\n }\n\n if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {\n throwWarning(state, 'deficient indentation');\n }\n\n return lineBreaks;\n}\n\nfunction testDocumentSeparator(state) {\n var _position = state.position,\n ch;\n\n ch = state.input.charCodeAt(_position);\n\n // Condition state.position === state.lineStart is tested\n // in parent on each call, for efficiency. No needs to test here again.\n if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) &&\n ch === state.input.charCodeAt(_position + 1) &&\n ch === state.input.charCodeAt(_position + 2)) {\n\n _position += 3;\n\n ch = state.input.charCodeAt(_position);\n\n if (ch === 0 || is_WS_OR_EOL(ch)) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction writeFoldedLines(state, count) {\n if (count === 1) {\n state.result += ' ';\n } else if (count > 1) {\n state.result += common.repeat('\\n', count - 1);\n }\n}\n\n\nfunction readPlainScalar(state, nodeIndent, withinFlowCollection) {\n var preceding,\n following,\n captureStart,\n captureEnd,\n hasPendingContent,\n _line,\n _lineStart,\n _lineIndent,\n _kind = state.kind,\n _result = state.result,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (is_WS_OR_EOL(ch) ||\n is_FLOW_INDICATOR(ch) ||\n ch === 0x23/* # */ ||\n ch === 0x26/* & */ ||\n ch === 0x2A/* * */ ||\n ch === 0x21/* ! */ ||\n ch === 0x7C/* | */ ||\n ch === 0x3E/* > */ ||\n ch === 0x27/* ' */ ||\n ch === 0x22/* \" */ ||\n ch === 0x25/* % */ ||\n ch === 0x40/* @ */ ||\n ch === 0x60/* ` */) {\n return false;\n }\n\n if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) {\n following = state.input.charCodeAt(state.position + 1);\n\n if (is_WS_OR_EOL(following) ||\n withinFlowCollection && is_FLOW_INDICATOR(following)) {\n return false;\n }\n }\n\n state.kind = 'scalar';\n state.result = '';\n captureStart = captureEnd = state.position;\n hasPendingContent = false;\n\n while (ch !== 0) {\n if (ch === 0x3A/* : */) {\n following = state.input.charCodeAt(state.position + 1);\n\n if (is_WS_OR_EOL(following) ||\n withinFlowCollection && is_FLOW_INDICATOR(following)) {\n break;\n }\n\n } else if (ch === 0x23/* # */) {\n preceding = state.input.charCodeAt(state.position - 1);\n\n if (is_WS_OR_EOL(preceding)) {\n break;\n }\n\n } else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||\n withinFlowCollection && is_FLOW_INDICATOR(ch)) {\n break;\n\n } else if (is_EOL(ch)) {\n _line = state.line;\n _lineStart = state.lineStart;\n _lineIndent = state.lineIndent;\n skipSeparationSpace(state, false, -1);\n\n if (state.lineIndent >= nodeIndent) {\n hasPendingContent = true;\n ch = state.input.charCodeAt(state.position);\n continue;\n } else {\n state.position = captureEnd;\n state.line = _line;\n state.lineStart = _lineStart;\n state.lineIndent = _lineIndent;\n break;\n }\n }\n\n if (hasPendingContent) {\n captureSegment(state, captureStart, captureEnd, false);\n writeFoldedLines(state, state.line - _line);\n captureStart = captureEnd = state.position;\n hasPendingContent = false;\n }\n\n if (!is_WHITE_SPACE(ch)) {\n captureEnd = state.position + 1;\n }\n\n ch = state.input.charCodeAt(++state.position);\n }\n\n captureSegment(state, captureStart, captureEnd, false);\n\n if (state.result) {\n return true;\n }\n\n state.kind = _kind;\n state.result = _result;\n return false;\n}\n\nfunction readSingleQuotedScalar(state, nodeIndent) {\n var ch,\n captureStart, captureEnd;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch !== 0x27/* ' */) {\n return false;\n }\n\n state.kind = 'scalar';\n state.result = '';\n state.position++;\n captureStart = captureEnd = state.position;\n\n while ((ch = state.input.charCodeAt(state.position)) !== 0) {\n if (ch === 0x27/* ' */) {\n captureSegment(state, captureStart, state.position, true);\n ch = state.input.charCodeAt(++state.position);\n\n if (ch === 0x27/* ' */) {\n captureStart = state.position;\n state.position++;\n captureEnd = state.position;\n } else {\n return true;\n }\n\n } else if (is_EOL(ch)) {\n captureSegment(state, captureStart, captureEnd, true);\n writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));\n captureStart = captureEnd = state.position;\n\n } else if (state.position === state.lineStart && testDocumentSeparator(state)) {\n throwError(state, 'unexpected end of the document within a single quoted scalar');\n\n } else {\n state.position++;\n captureEnd = state.position;\n }\n }\n\n throwError(state, 'unexpected end of the stream within a single quoted scalar');\n}\n\nfunction readDoubleQuotedScalar(state, nodeIndent) {\n var captureStart,\n captureEnd,\n hexLength,\n hexResult,\n tmp,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch !== 0x22/* \" */) {\n return false;\n }\n\n state.kind = 'scalar';\n state.result = '';\n state.position++;\n captureStart = captureEnd = state.position;\n\n while ((ch = state.input.charCodeAt(state.position)) !== 0) {\n if (ch === 0x22/* \" */) {\n captureSegment(state, captureStart, state.position, true);\n state.position++;\n return true;\n\n } else if (ch === 0x5C/* \\ */) {\n captureSegment(state, captureStart, state.position, true);\n ch = state.input.charCodeAt(++state.position);\n\n if (is_EOL(ch)) {\n skipSeparationSpace(state, false, nodeIndent);\n\n // TODO: rework to inline fn with no type cast?\n } else if (ch < 256 && simpleEscapeCheck[ch]) {\n state.result += simpleEscapeMap[ch];\n state.position++;\n\n } else if ((tmp = escapedHexLen(ch)) > 0) {\n hexLength = tmp;\n hexResult = 0;\n\n for (; hexLength > 0; hexLength--) {\n ch = state.input.charCodeAt(++state.position);\n\n if ((tmp = fromHexCode(ch)) >= 0) {\n hexResult = (hexResult << 4) + tmp;\n\n } else {\n throwError(state, 'expected hexadecimal character');\n }\n }\n\n state.result += charFromCodepoint(hexResult);\n\n state.position++;\n\n } else {\n throwError(state, 'unknown escape sequence');\n }\n\n captureStart = captureEnd = state.position;\n\n } else if (is_EOL(ch)) {\n captureSegment(state, captureStart, captureEnd, true);\n writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));\n captureStart = captureEnd = state.position;\n\n } else if (state.position === state.lineStart && testDocumentSeparator(state)) {\n throwError(state, 'unexpected end of the document within a double quoted scalar');\n\n } else {\n state.position++;\n captureEnd = state.position;\n }\n }\n\n throwError(state, 'unexpected end of the stream within a double quoted scalar');\n}\n\nfunction readFlowCollection(state, nodeIndent) {\n var readNext = true,\n _line,\n _lineStart,\n _pos,\n _tag = state.tag,\n _result,\n _anchor = state.anchor,\n following,\n terminator,\n isPair,\n isExplicitPair,\n isMapping,\n overridableKeys = Object.create(null),\n keyNode,\n keyTag,\n valueNode,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch === 0x5B/* [ */) {\n terminator = 0x5D;/* ] */\n isMapping = false;\n _result = [];\n } else if (ch === 0x7B/* { */) {\n terminator = 0x7D;/* } */\n isMapping = true;\n _result = {};\n } else {\n return false;\n }\n\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = _result;\n }\n\n ch = state.input.charCodeAt(++state.position);\n\n while (ch !== 0) {\n skipSeparationSpace(state, true, nodeIndent);\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch === terminator) {\n state.position++;\n state.tag = _tag;\n state.anchor = _anchor;\n state.kind = isMapping ? 'mapping' : 'sequence';\n state.result = _result;\n return true;\n } else if (!readNext) {\n throwError(state, 'missed comma between flow collection entries');\n } else if (ch === 0x2C/* , */) {\n // \"flow collection entries can never be completely empty\", as per YAML 1.2, section 7.4\n throwError(state, \"expected the node content, but found ','\");\n }\n\n keyTag = keyNode = valueNode = null;\n isPair = isExplicitPair = false;\n\n if (ch === 0x3F/* ? */) {\n following = state.input.charCodeAt(state.position + 1);\n\n if (is_WS_OR_EOL(following)) {\n isPair = isExplicitPair = true;\n state.position++;\n skipSeparationSpace(state, true, nodeIndent);\n }\n }\n\n _line = state.line; // Save the current line.\n _lineStart = state.lineStart;\n _pos = state.position;\n composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);\n keyTag = state.tag;\n keyNode = state.result;\n skipSeparationSpace(state, true, nodeIndent);\n\n ch = state.input.charCodeAt(state.position);\n\n if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) {\n isPair = true;\n ch = state.input.charCodeAt(++state.position);\n skipSeparationSpace(state, true, nodeIndent);\n composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);\n valueNode = state.result;\n }\n\n if (isMapping) {\n storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);\n } else if (isPair) {\n _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));\n } else {\n _result.push(keyNode);\n }\n\n skipSeparationSpace(state, true, nodeIndent);\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch === 0x2C/* , */) {\n readNext = true;\n ch = state.input.charCodeAt(++state.position);\n } else {\n readNext = false;\n }\n }\n\n throwError(state, 'unexpected end of the stream within a flow collection');\n}\n\nfunction readBlockScalar(state, nodeIndent) {\n var captureStart,\n folding,\n chomping = CHOMPING_CLIP,\n didReadContent = false,\n detectedIndent = false,\n textIndent = nodeIndent,\n emptyLines = 0,\n atMoreIndented = false,\n tmp,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch === 0x7C/* | */) {\n folding = false;\n } else if (ch === 0x3E/* > */) {\n folding = true;\n } else {\n return false;\n }\n\n state.kind = 'scalar';\n state.result = '';\n\n while (ch !== 0) {\n ch = state.input.charCodeAt(++state.position);\n\n if (ch === 0x2B/* + */ || ch === 0x2D/* - */) {\n if (CHOMPING_CLIP === chomping) {\n chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP;\n } else {\n throwError(state, 'repeat of a chomping mode identifier');\n }\n\n } else if ((tmp = fromDecimalCode(ch)) >= 0) {\n if (tmp === 0) {\n throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one');\n } else if (!detectedIndent) {\n textIndent = nodeIndent + tmp - 1;\n detectedIndent = true;\n } else {\n throwError(state, 'repeat of an indentation width identifier');\n }\n\n } else {\n break;\n }\n }\n\n if (is_WHITE_SPACE(ch)) {\n do { ch = state.input.charCodeAt(++state.position); }\n while (is_WHITE_SPACE(ch));\n\n if (ch === 0x23/* # */) {\n do { ch = state.input.charCodeAt(++state.position); }\n while (!is_EOL(ch) && (ch !== 0));\n }\n }\n\n while (ch !== 0) {\n readLineBreak(state);\n state.lineIndent = 0;\n\n ch = state.input.charCodeAt(state.position);\n\n while ((!detectedIndent || state.lineIndent < textIndent) &&\n (ch === 0x20/* Space */)) {\n state.lineIndent++;\n ch = state.input.charCodeAt(++state.position);\n }\n\n if (!detectedIndent && state.lineIndent > textIndent) {\n textIndent = state.lineIndent;\n }\n\n if (is_EOL(ch)) {\n emptyLines++;\n continue;\n }\n\n // End of the scalar.\n if (state.lineIndent < textIndent) {\n\n // Perform the chomping.\n if (chomping === CHOMPING_KEEP) {\n state.result += common.repeat('\\n', didReadContent ? 1 + emptyLines : emptyLines);\n } else if (chomping === CHOMPING_CLIP) {\n if (didReadContent) { // i.e. only if the scalar is not empty.\n state.result += '\\n';\n }\n }\n\n // Break this `while` cycle and go to the funciton's epilogue.\n break;\n }\n\n // Folded style: use fancy rules to handle line breaks.\n if (folding) {\n\n // Lines starting with white space characters (more-indented lines) are not folded.\n if (is_WHITE_SPACE(ch)) {\n atMoreIndented = true;\n // except for the first content line (cf. Example 8.1)\n state.result += common.repeat('\\n', didReadContent ? 1 + emptyLines : emptyLines);\n\n // End of more-indented block.\n } else if (atMoreIndented) {\n atMoreIndented = false;\n state.result += common.repeat('\\n', emptyLines + 1);\n\n // Just one line break - perceive as the same line.\n } else if (emptyLines === 0) {\n if (didReadContent) { // i.e. only if we have already read some scalar content.\n state.result += ' ';\n }\n\n // Several line breaks - perceive as different lines.\n } else {\n state.result += common.repeat('\\n', emptyLines);\n }\n\n // Literal style: just add exact number of line breaks between content lines.\n } else {\n // Keep all line breaks except the header line break.\n state.result += common.repeat('\\n', didReadContent ? 1 + emptyLines : emptyLines);\n }\n\n didReadContent = true;\n detectedIndent = true;\n emptyLines = 0;\n captureStart = state.position;\n\n while (!is_EOL(ch) && (ch !== 0)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n captureSegment(state, captureStart, state.position, false);\n }\n\n return true;\n}\n\nfunction readBlockSequence(state, nodeIndent) {\n var _line,\n _tag = state.tag,\n _anchor = state.anchor,\n _result = [],\n following,\n detected = false,\n ch;\n\n // there is a leading tab before this token, so it can't be a block sequence/mapping;\n // it can still be flow sequence/mapping or a scalar\n if (state.firstTabInLine !== -1) return false;\n\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = _result;\n }\n\n ch = state.input.charCodeAt(state.position);\n\n while (ch !== 0) {\n if (state.firstTabInLine !== -1) {\n state.position = state.firstTabInLine;\n throwError(state, 'tab characters must not be used in indentation');\n }\n\n if (ch !== 0x2D/* - */) {\n break;\n }\n\n following = state.input.charCodeAt(state.position + 1);\n\n if (!is_WS_OR_EOL(following)) {\n break;\n }\n\n detected = true;\n state.position++;\n\n if (skipSeparationSpace(state, true, -1)) {\n if (state.lineIndent <= nodeIndent) {\n _result.push(null);\n ch = state.input.charCodeAt(state.position);\n continue;\n }\n }\n\n _line = state.line;\n composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);\n _result.push(state.result);\n skipSeparationSpace(state, true, -1);\n\n ch = state.input.charCodeAt(state.position);\n\n if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {\n throwError(state, 'bad indentation of a sequence entry');\n } else if (state.lineIndent < nodeIndent) {\n break;\n }\n }\n\n if (detected) {\n state.tag = _tag;\n state.anchor = _anchor;\n state.kind = 'sequence';\n state.result = _result;\n return true;\n }\n return false;\n}\n\nfunction readBlockMapping(state, nodeIndent, flowIndent) {\n var following,\n allowCompact,\n _line,\n _keyLine,\n _keyLineStart,\n _keyPos,\n _tag = state.tag,\n _anchor = state.anchor,\n _result = {},\n overridableKeys = Object.create(null),\n keyTag = null,\n keyNode = null,\n valueNode = null,\n atExplicitKey = false,\n detected = false,\n ch;\n\n // there is a leading tab before this token, so it can't be a block sequence/mapping;\n // it can still be flow sequence/mapping or a scalar\n if (state.firstTabInLine !== -1) return false;\n\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = _result;\n }\n\n ch = state.input.charCodeAt(state.position);\n\n while (ch !== 0) {\n if (!atExplicitKey && state.firstTabInLine !== -1) {\n state.position = state.firstTabInLine;\n throwError(state, 'tab characters must not be used in indentation');\n }\n\n following = state.input.charCodeAt(state.position + 1);\n _line = state.line; // Save the current line.\n\n //\n // Explicit notation case. There are two separate blocks:\n // first for the key (denoted by \"?\") and second for the value (denoted by \":\")\n //\n if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) {\n\n if (ch === 0x3F/* ? */) {\n if (atExplicitKey) {\n storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);\n keyTag = keyNode = valueNode = null;\n }\n\n detected = true;\n atExplicitKey = true;\n allowCompact = true;\n\n } else if (atExplicitKey) {\n // i.e. 0x3A/* : */ === character after the explicit key.\n atExplicitKey = false;\n allowCompact = true;\n\n } else {\n throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line');\n }\n\n state.position += 1;\n ch = following;\n\n //\n // Implicit notation case. Flow-style node as the key first, then \":\", and the value.\n //\n } else {\n _keyLine = state.line;\n _keyLineStart = state.lineStart;\n _keyPos = state.position;\n\n if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {\n // Neither implicit nor explicit notation.\n // Reading is done. Go to the epilogue.\n break;\n }\n\n if (state.line === _line) {\n ch = state.input.charCodeAt(state.position);\n\n while (is_WHITE_SPACE(ch)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n if (ch === 0x3A/* : */) {\n ch = state.input.charCodeAt(++state.position);\n\n if (!is_WS_OR_EOL(ch)) {\n throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping');\n }\n\n if (atExplicitKey) {\n storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);\n keyTag = keyNode = valueNode = null;\n }\n\n detected = true;\n atExplicitKey = false;\n allowCompact = false;\n keyTag = state.tag;\n keyNode = state.result;\n\n } else if (detected) {\n throwError(state, 'can not read an implicit mapping pair; a colon is missed');\n\n } else {\n state.tag = _tag;\n state.anchor = _anchor;\n return true; // Keep the result of `composeNode`.\n }\n\n } else if (detected) {\n throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key');\n\n } else {\n state.tag = _tag;\n state.anchor = _anchor;\n return true; // Keep the result of `composeNode`.\n }\n }\n\n //\n // Common reading code for both explicit and implicit notations.\n //\n if (state.line === _line || state.lineIndent > nodeIndent) {\n if (atExplicitKey) {\n _keyLine = state.line;\n _keyLineStart = state.lineStart;\n _keyPos = state.position;\n }\n\n if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {\n if (atExplicitKey) {\n keyNode = state.result;\n } else {\n valueNode = state.result;\n }\n }\n\n if (!atExplicitKey) {\n storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);\n keyTag = keyNode = valueNode = null;\n }\n\n skipSeparationSpace(state, true, -1);\n ch = state.input.charCodeAt(state.position);\n }\n\n if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {\n throwError(state, 'bad indentation of a mapping entry');\n } else if (state.lineIndent < nodeIndent) {\n break;\n }\n }\n\n //\n // Epilogue.\n //\n\n // Special case: last mapping's node contains only the key in explicit notation.\n if (atExplicitKey) {\n storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);\n }\n\n // Expose the resulting mapping.\n if (detected) {\n state.tag = _tag;\n state.anchor = _anchor;\n state.kind = 'mapping';\n state.result = _result;\n }\n\n return detected;\n}\n\nfunction readTagProperty(state) {\n var _position,\n isVerbatim = false,\n isNamed = false,\n tagHandle,\n tagName,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch !== 0x21/* ! */) return false;\n\n if (state.tag !== null) {\n throwError(state, 'duplication of a tag property');\n }\n\n ch = state.input.charCodeAt(++state.position);\n\n if (ch === 0x3C/* < */) {\n isVerbatim = true;\n ch = state.input.charCodeAt(++state.position);\n\n } else if (ch === 0x21/* ! */) {\n isNamed = true;\n tagHandle = '!!';\n ch = state.input.charCodeAt(++state.position);\n\n } else {\n tagHandle = '!';\n }\n\n _position = state.position;\n\n if (isVerbatim) {\n do { ch = state.input.charCodeAt(++state.position); }\n while (ch !== 0 && ch !== 0x3E/* > */);\n\n if (state.position < state.length) {\n tagName = state.input.slice(_position, state.position);\n ch = state.input.charCodeAt(++state.position);\n } else {\n throwError(state, 'unexpected end of the stream within a verbatim tag');\n }\n } else {\n while (ch !== 0 && !is_WS_OR_EOL(ch)) {\n\n if (ch === 0x21/* ! */) {\n if (!isNamed) {\n tagHandle = state.input.slice(_position - 1, state.position + 1);\n\n if (!PATTERN_TAG_HANDLE.test(tagHandle)) {\n throwError(state, 'named tag handle cannot contain such characters');\n }\n\n isNamed = true;\n _position = state.position + 1;\n } else {\n throwError(state, 'tag suffix cannot contain exclamation marks');\n }\n }\n\n ch = state.input.charCodeAt(++state.position);\n }\n\n tagName = state.input.slice(_position, state.position);\n\n if (PATTERN_FLOW_INDICATORS.test(tagName)) {\n throwError(state, 'tag suffix cannot contain flow indicator characters');\n }\n }\n\n if (tagName && !PATTERN_TAG_URI.test(tagName)) {\n throwError(state, 'tag name cannot contain such characters: ' + tagName);\n }\n\n try {\n tagName = decodeURIComponent(tagName);\n } catch (err) {\n throwError(state, 'tag name is malformed: ' + tagName);\n }\n\n if (isVerbatim) {\n state.tag = tagName;\n\n } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {\n state.tag = state.tagMap[tagHandle] + tagName;\n\n } else if (tagHandle === '!') {\n state.tag = '!' + tagName;\n\n } else if (tagHandle === '!!') {\n state.tag = 'tag:yaml.org,2002:' + tagName;\n\n } else {\n throwError(state, 'undeclared tag handle \"' + tagHandle + '\"');\n }\n\n return true;\n}\n\nfunction readAnchorProperty(state) {\n var _position,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch !== 0x26/* & */) return false;\n\n if (state.anchor !== null) {\n throwError(state, 'duplication of an anchor property');\n }\n\n ch = state.input.charCodeAt(++state.position);\n _position = state.position;\n\n while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n if (state.position === _position) {\n throwError(state, 'name of an anchor node must contain at least one character');\n }\n\n state.anchor = state.input.slice(_position, state.position);\n return true;\n}\n\nfunction readAlias(state) {\n var _position, alias,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch !== 0x2A/* * */) return false;\n\n ch = state.input.charCodeAt(++state.position);\n _position = state.position;\n\n while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n if (state.position === _position) {\n throwError(state, 'name of an alias node must contain at least one character');\n }\n\n alias = state.input.slice(_position, state.position);\n\n if (!_hasOwnProperty.call(state.anchorMap, alias)) {\n throwError(state, 'unidentified alias \"' + alias + '\"');\n }\n\n state.result = state.anchorMap[alias];\n skipSeparationSpace(state, true, -1);\n return true;\n}\n\nfunction composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {\n var allowBlockStyles,\n allowBlockScalars,\n allowBlockCollections,\n indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) {\n indentStatus = 1;\n } else if (state.lineIndent === parentIndent) {\n indentStatus = 0;\n } else if (state.lineIndent < parentIndent) {\n indentStatus = -1;\n }\n }\n }\n\n if (indentStatus === 1) {\n while (readTagProperty(state) || readAnchorProperty(state)) {\n if (skipSeparationSpace(state, true, -1)) {\n atNewLine = true;\n allowBlockCollections = allowBlockStyles;\n\n if (state.lineIndent > parentIndent) {\n indentStatus = 1;\n } else if (state.lineIndent === parentIndent) {\n indentStatus = 0;\n } else if (state.lineIndent < parentIndent) {\n indentStatus = -1;\n }\n } else {\n allowBlockCollections = false;\n }\n }\n }\n\n if (allowBlockCollections) {\n allowBlockCollections = atNewLine || allowCompact;\n }\n\n if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {\n if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {\n flowIndent = parentIndent;\n } else {\n flowIndent = parentIndent + 1;\n }\n\n blockIndent = state.position - state.lineStart;\n\n if (indentStatus === 1) {\n if (allowBlockCollections &&\n (readBlockSequence(state, blockIndent) ||\n readBlockMapping(state, blockIndent, flowIndent)) ||\n readFlowCollection(state, flowIndent)) {\n hasContent = true;\n } else {\n if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||\n readSingleQuotedScalar(state, flowIndent) ||\n readDoubleQuotedScalar(state, flowIndent)) {\n hasContent = true;\n\n } else if (readAlias(state)) {\n hasContent = true;\n\n if (state.tag !== null || state.anchor !== null) {\n throwError(state, 'alias node should not have any properties');\n }\n\n } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {\n hasContent = true;\n\n if (state.tag === null) {\n state.tag = '?';\n }\n }\n\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = state.result;\n }\n }\n } else if (indentStatus === 0) {\n // Special case: block sequences are allowed to have same indentation level as the parent.\n // http://www.yaml.org/spec/1.2/spec.html#id2799784\n hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);\n }\n }\n\n if (state.tag === null) {\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = state.result;\n }\n\n } else if (state.tag === '?') {\n // Implicit resolving is not allowed for non-scalar types, and '?'\n // non-specific tag is only automatically assigned to plain scalars.\n //\n // We only need to check kind conformity in case user explicitly assigns '?'\n // tag, for example like this: \"! [0]\"\n //\n if (state.result !== null && state.kind !== 'scalar') {\n throwError(state, 'unacceptable node kind for ! tag; it should be \"scalar\", not \"' + state.kind + '\"');\n }\n\n for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {\n type = state.implicitTypes[typeIndex];\n\n if (type.resolve(state.result)) { // `state.result` updated in resolver if matched\n state.result = type.construct(state.result);\n state.tag = type.tag;\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = state.result;\n }\n break;\n }\n }\n } else if (state.tag !== '!') {\n if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) {\n type = state.typeMap[state.kind || 'fallback'][state.tag];\n } else {\n // looking for multi type\n type = null;\n typeList = state.typeMap.multi[state.kind || 'fallback'];\n\n for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {\n if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {\n type = typeList[typeIndex];\n break;\n }\n }\n }\n\n if (!type) {\n throwError(state, 'unknown tag !<' + state.tag + '>');\n }\n\n if (state.result !== null && type.kind !== state.kind) {\n throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be \"' + type.kind + '\", not \"' + state.kind + '\"');\n }\n\n if (!type.resolve(state.result, state.tag)) { // `state.result` updated in resolver if matched\n throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag');\n } else {\n state.result = type.construct(state.result, state.tag);\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = state.result;\n }\n }\n }\n\n if (state.listener !== null) {\n state.listener('close', state);\n }\n return state.tag !== null || state.anchor !== null || hasContent;\n}\n\nfunction readDocument(state) {\n var documentStart = state.position,\n _position,\n directiveName,\n directiveArgs,\n hasDirectives = false,\n ch;\n\n state.version = null;\n state.checkLineBreaks = state.legacy;\n state.tagMap = Object.create(null);\n state.anchorMap = Object.create(null);\n\n while ((ch = state.input.charCodeAt(state.position)) !== 0) {\n skipSeparationSpace(state, true, -1);\n\n ch = state.input.charCodeAt(state.position);\n\n if (state.lineIndent > 0 || ch !== 0x25/* % */) {\n break;\n }\n\n hasDirectives = true;\n ch = state.input.charCodeAt(++state.position);\n _position = state.position;\n\n while (ch !== 0 && !is_WS_OR_EOL(ch)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n directiveName = state.input.slice(_position, state.position);\n directiveArgs = [];\n\n if (directiveName.length < 1) {\n throwError(state, 'directive name must not be less than one character in length');\n }\n\n while (ch !== 0) {\n while (is_WHITE_SPACE(ch)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n if (ch === 0x23/* # */) {\n do { ch = state.input.charCodeAt(++state.position); }\n while (ch !== 0 && !is_EOL(ch));\n break;\n }\n\n if (is_EOL(ch)) break;\n\n _position = state.position;\n\n while (ch !== 0 && !is_WS_OR_EOL(ch)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n directiveArgs.push(state.input.slice(_position, state.position));\n }\n\n if (ch !== 0) readLineBreak(state);\n\n if (_hasOwnProperty.call(directiveHandlers, directiveName)) {\n directiveHandlers[directiveName](state, directiveName, directiveArgs);\n } else {\n throwWarning(state, 'unknown document directive \"' + directiveName + '\"');\n }\n }\n\n skipSeparationSpace(state, true, -1);\n\n if (state.lineIndent === 0 &&\n state.input.charCodeAt(state.position) === 0x2D/* - */ &&\n state.input.charCodeAt(state.position + 1) === 0x2D/* - */ &&\n state.input.charCodeAt(state.position + 2) === 0x2D/* - */) {\n state.position += 3;\n skipSeparationSpace(state, true, -1);\n\n } else if (hasDirectives) {\n throwError(state, 'directives end mark is expected');\n }\n\n composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);\n skipSeparationSpace(state, true, -1);\n\n if (state.checkLineBreaks &&\n PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {\n throwWarning(state, 'non-ASCII line breaks are interpreted as content');\n }\n\n state.documents.push(state.result);\n\n if (state.position === state.lineStart && testDocumentSeparator(state)) {\n\n if (state.input.charCodeAt(state.position) === 0x2E/* . */) {\n state.position += 3;\n skipSeparationSpace(state, true, -1);\n }\n return;\n }\n\n if (state.position < (state.length - 1)) {\n throwError(state, 'end of the stream or a document separator is expected');\n } else {\n return;\n }\n}\n\n\nfunction loadDocuments(input, options) {\n input = String(input);\n options = options || {};\n\n if (input.length !== 0) {\n\n // Add tailing `\\n` if not exists\n if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ &&\n input.charCodeAt(input.length - 1) !== 0x0D/* CR */) {\n input += '\\n';\n }\n\n // Strip BOM\n if (input.charCodeAt(0) === 0xFEFF) {\n input = input.slice(1);\n }\n }\n\n var state = new State(input, options);\n\n var nullpos = input.indexOf('\\0');\n\n if (nullpos !== -1) {\n state.position = nullpos;\n throwError(state, 'null byte is not allowed in input');\n }\n\n // Use 0 as string terminator. That significantly simplifies bounds check.\n state.input += '\\0';\n\n while (state.input.charCodeAt(state.position) === 0x20/* Space */) {\n state.lineIndent += 1;\n state.position += 1;\n }\n\n while (state.position < (state.length - 1)) {\n readDocument(state);\n }\n\n return state.documents;\n}\n\n\nfunction loadAll(input, iterator, options) {\n if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') {\n options = iterator;\n iterator = null;\n }\n\n var documents = loadDocuments(input, options);\n\n if (typeof iterator !== 'function') {\n return documents;\n }\n\n for (var index = 0, length = documents.length; index < length; index += 1) {\n iterator(documents[index]);\n }\n}\n\n\nfunction load(input, options) {\n var documents = loadDocuments(input, options);\n\n if (documents.length === 0) {\n /*eslint-disable no-undefined*/\n return undefined;\n } else if (documents.length === 1) {\n return documents[0];\n }\n throw new YAMLException('expected a single document in the stream, but found more');\n}\n\n\nmodule.exports.loadAll = loadAll;\nmodule.exports.load = load;\n","'use strict';\n\n/*eslint-disable max-len*/\n\nvar YAMLException = require('./exception');\nvar Type = require('./type');\n\n\nfunction compileList(schema, name, result) {\n var exclude = [];\n\n schema[name].forEach(function (currentType) {\n result.forEach(function (previousType, previousIndex) {\n if (previousType.tag === currentType.tag &&\n previousType.kind === currentType.kind &&\n previousType.multi === currentType.multi) {\n\n exclude.push(previousIndex);\n }\n });\n\n result.push(currentType);\n });\n\n return result.filter(function (type, index) {\n return exclude.indexOf(index) === -1;\n });\n}\n\n\nfunction compileMap(/* lists... */) {\n var result = {\n scalar: {},\n sequence: {},\n mapping: {},\n fallback: {},\n multi: {\n scalar: [],\n sequence: [],\n mapping: [],\n fallback: []\n }\n }, index, length;\n\n function collectType(type) {\n if (type.multi) {\n result.multi[type.kind].push(type);\n result.multi['fallback'].push(type);\n } else {\n result[type.kind][type.tag] = result['fallback'][type.tag] = type;\n }\n }\n\n for (index = 0, length = arguments.length; index < length; index += 1) {\n arguments[index].forEach(collectType);\n }\n return result;\n}\n\n\nfunction Schema(definition) {\n return this.extend(definition);\n}\n\n\nSchema.prototype.extend = function extend(definition) {\n var implicit = [];\n var explicit = [];\n\n if (definition instanceof Type) {\n // Schema.extend(type)\n explicit.push(definition);\n\n } else if (Array.isArray(definition)) {\n // Schema.extend([ type1, type2, ... ])\n explicit = explicit.concat(definition);\n\n } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {\n // Schema.extend({ explicit: [ type1, type2, ... ], implicit: [ type1, type2, ... ] })\n if (definition.implicit) implicit = implicit.concat(definition.implicit);\n if (definition.explicit) explicit = explicit.concat(definition.explicit);\n\n } else {\n throw new YAMLException('Schema.extend argument should be a Type, [ Type ], ' +\n 'or a schema definition ({ implicit: [...], explicit: [...] })');\n }\n\n implicit.forEach(function (type) {\n if (!(type instanceof Type)) {\n throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.');\n }\n\n if (type.loadKind && type.loadKind !== 'scalar') {\n throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.');\n }\n\n if (type.multi) {\n throw new YAMLException('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.');\n }\n });\n\n explicit.forEach(function (type) {\n if (!(type instanceof Type)) {\n throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.');\n }\n });\n\n var result = Object.create(Schema.prototype);\n\n result.implicit = (this.implicit || []).concat(implicit);\n result.explicit = (this.explicit || []).concat(explicit);\n\n result.compiledImplicit = compileList(result, 'implicit', []);\n result.compiledExplicit = compileList(result, 'explicit', []);\n result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);\n\n return result;\n};\n\n\nmodule.exports = Schema;\n","// Standard YAML's Core schema.\n// http://www.yaml.org/spec/1.2/spec.html#id2804923\n//\n// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.\n// So, Core schema has no distinctions from JSON schema is JS-YAML.\n\n\n'use strict';\n\n\nmodule.exports = require('./json');\n","// JS-YAML's default schema for `safeLoad` function.\n// It is not described in the YAML specification.\n//\n// This schema is based on standard YAML's Core schema and includes most of\n// extra types described at YAML tag repository. (http://yaml.org/type/)\n\n\n'use strict';\n\n\nmodule.exports = require('./core').extend({\n implicit: [\n require('../type/timestamp'),\n require('../type/merge')\n ],\n explicit: [\n require('../type/binary'),\n require('../type/omap'),\n require('../type/pairs'),\n require('../type/set')\n ]\n});\n","// Standard YAML's Failsafe schema.\n// http://www.yaml.org/spec/1.2/spec.html#id2802346\n\n\n'use strict';\n\n\nvar Schema = require('../schema');\n\n\nmodule.exports = new Schema({\n explicit: [\n require('../type/str'),\n require('../type/seq'),\n require('../type/map')\n ]\n});\n","// Standard YAML's JSON schema.\n// http://www.yaml.org/spec/1.2/spec.html#id2803231\n//\n// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.\n// So, this schema is not such strict as defined in the YAML specification.\n// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc.\n\n\n'use strict';\n\n\nmodule.exports = require('./failsafe').extend({\n implicit: [\n require('../type/null'),\n require('../type/bool'),\n require('../type/int'),\n require('../type/float')\n ]\n});\n","'use strict';\n\n\nvar common = require('./common');\n\n\n// get snippet for a single line, respecting maxLength\nfunction getLine(buffer, lineStart, lineEnd, position, maxLineLength) {\n var head = '';\n var tail = '';\n var maxHalfLength = Math.floor(maxLineLength / 2) - 1;\n\n if (position - lineStart > maxHalfLength) {\n head = ' ... ';\n lineStart = position - maxHalfLength + head.length;\n }\n\n if (lineEnd - position > maxHalfLength) {\n tail = ' ...';\n lineEnd = position + maxHalfLength - tail.length;\n }\n\n return {\n str: head + buffer.slice(lineStart, lineEnd).replace(/\\t/g, '→') + tail,\n pos: position - lineStart + head.length // relative position\n };\n}\n\n\nfunction padStart(string, max) {\n return common.repeat(' ', max - string.length) + string;\n}\n\n\nfunction makeSnippet(mark, options) {\n options = Object.create(options || null);\n\n if (!mark.buffer) return null;\n\n if (!options.maxLength) options.maxLength = 79;\n if (typeof options.indent !== 'number') options.indent = 1;\n if (typeof options.linesBefore !== 'number') options.linesBefore = 3;\n if (typeof options.linesAfter !== 'number') options.linesAfter = 2;\n\n var re = /\\r?\\n|\\r|\\0/g;\n var lineStarts = [ 0 ];\n var lineEnds = [];\n var match;\n var foundLineNo = -1;\n\n while ((match = re.exec(mark.buffer))) {\n lineEnds.push(match.index);\n lineStarts.push(match.index + match[0].length);\n\n if (mark.position <= match.index && foundLineNo < 0) {\n foundLineNo = lineStarts.length - 2;\n }\n }\n\n if (foundLineNo < 0) foundLineNo = lineStarts.length - 1;\n\n var result = '', i, line;\n var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length;\n var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3);\n\n for (i = 1; i <= options.linesBefore; i++) {\n if (foundLineNo - i < 0) break;\n line = getLine(\n mark.buffer,\n lineStarts[foundLineNo - i],\n lineEnds[foundLineNo - i],\n mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]),\n maxLineLength\n );\n result = common.repeat(' ', options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) +\n ' | ' + line.str + '\\n' + result;\n }\n\n line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);\n result += common.repeat(' ', options.indent) + padStart((mark.line + 1).toString(), lineNoLength) +\n ' | ' + line.str + '\\n';\n result += common.repeat('-', options.indent + lineNoLength + 3 + line.pos) + '^' + '\\n';\n\n for (i = 1; i <= options.linesAfter; i++) {\n if (foundLineNo + i >= lineEnds.length) break;\n line = getLine(\n mark.buffer,\n lineStarts[foundLineNo + i],\n lineEnds[foundLineNo + i],\n mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]),\n maxLineLength\n );\n result += common.repeat(' ', options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) +\n ' | ' + line.str + '\\n';\n }\n\n return result.replace(/\\n$/, '');\n}\n\n\nmodule.exports = makeSnippet;\n","'use strict';\n\nvar YAMLException = require('./exception');\n\nvar TYPE_CONSTRUCTOR_OPTIONS = [\n 'kind',\n 'multi',\n 'resolve',\n 'construct',\n 'instanceOf',\n 'predicate',\n 'represent',\n 'representName',\n 'defaultStyle',\n 'styleAliases'\n];\n\nvar YAML_NODE_KINDS = [\n 'scalar',\n 'sequence',\n 'mapping'\n];\n\nfunction compileStyleAliases(map) {\n var result = {};\n\n if (map !== null) {\n Object.keys(map).forEach(function (style) {\n map[style].forEach(function (alias) {\n result[String(alias)] = style;\n });\n });\n }\n\n return result;\n}\n\nfunction Type(tag, options) {\n options = options || {};\n\n Object.keys(options).forEach(function (name) {\n if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {\n throw new YAMLException('Unknown option \"' + name + '\" is met in definition of \"' + tag + '\" YAML type.');\n }\n });\n\n // TODO: Add tag format check.\n this.tag = tag;\n this.kind = options['kind'] || null;\n this.resolve = options['resolve'] || function () { return true; };\n this.construct = options['construct'] || function (data) { return data; };\n this.instanceOf = options['instanceOf'] || null;\n this.predicate = options['predicate'] || null;\n this.represent = options['represent'] || null;\n this.representName = options['representName'] || null;\n this.defaultStyle = options['defaultStyle'] || null;\n this.multi = options['multi'] || false;\n this.styleAliases = compileStyleAliases(options['styleAliases'] || null);\n\n if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {\n throw new YAMLException('Unknown kind \"' + this.kind + '\" is specified for \"' + tag + '\" YAML type.');\n }\n}\n\nmodule.exports = Type;\n","'use strict';\n\n/*eslint-disable no-bitwise*/\n\n\nvar Type = require('../type');\n\n\n// [ 64, 65, 66 ] -> [ padding, CR, LF ]\nvar BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\\n\\r';\n\n\nfunction resolveYamlBinary(data) {\n if (data === null) return false;\n\n var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;\n\n // Convert one by one.\n for (idx = 0; idx < max; idx++) {\n code = map.indexOf(data.charAt(idx));\n\n // Skip CR/LF\n if (code > 64) continue;\n\n // Fail on illegal characters\n if (code < 0) return false;\n\n bitlen += 6;\n }\n\n // If there are any bits left, source was corrupted\n return (bitlen % 8) === 0;\n}\n\nfunction constructYamlBinary(data) {\n var idx, tailbits,\n input = data.replace(/[\\r\\n=]/g, ''), // remove CR/LF & padding to simplify scan\n max = input.length,\n map = BASE64_MAP,\n bits = 0,\n result = [];\n\n // Collect by 6*4 bits (3 bytes)\n\n for (idx = 0; idx < max; idx++) {\n if ((idx % 4 === 0) && idx) {\n result.push((bits >> 16) & 0xFF);\n result.push((bits >> 8) & 0xFF);\n result.push(bits & 0xFF);\n }\n\n bits = (bits << 6) | map.indexOf(input.charAt(idx));\n }\n\n // Dump tail\n\n tailbits = (max % 4) * 6;\n\n if (tailbits === 0) {\n result.push((bits >> 16) & 0xFF);\n result.push((bits >> 8) & 0xFF);\n result.push(bits & 0xFF);\n } else if (tailbits === 18) {\n result.push((bits >> 10) & 0xFF);\n result.push((bits >> 2) & 0xFF);\n } else if (tailbits === 12) {\n result.push((bits >> 4) & 0xFF);\n }\n\n return new Uint8Array(result);\n}\n\nfunction representYamlBinary(object /*, style*/) {\n var result = '', bits = 0, idx, tail,\n max = object.length,\n map = BASE64_MAP;\n\n // Convert every three bytes to 4 ASCII characters.\n\n for (idx = 0; idx < max; idx++) {\n if ((idx % 3 === 0) && idx) {\n result += map[(bits >> 18) & 0x3F];\n result += map[(bits >> 12) & 0x3F];\n result += map[(bits >> 6) & 0x3F];\n result += map[bits & 0x3F];\n }\n\n bits = (bits << 8) + object[idx];\n }\n\n // Dump tail\n\n tail = max % 3;\n\n if (tail === 0) {\n result += map[(bits >> 18) & 0x3F];\n result += map[(bits >> 12) & 0x3F];\n result += map[(bits >> 6) & 0x3F];\n result += map[bits & 0x3F];\n } else if (tail === 2) {\n result += map[(bits >> 10) & 0x3F];\n result += map[(bits >> 4) & 0x3F];\n result += map[(bits << 2) & 0x3F];\n result += map[64];\n } else if (tail === 1) {\n result += map[(bits >> 2) & 0x3F];\n result += map[(bits << 4) & 0x3F];\n result += map[64];\n result += map[64];\n }\n\n return result;\n}\n\nfunction isBinary(obj) {\n return Object.prototype.toString.call(obj) === '[object Uint8Array]';\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:binary', {\n kind: 'scalar',\n resolve: resolveYamlBinary,\n construct: constructYamlBinary,\n predicate: isBinary,\n represent: representYamlBinary\n});\n","'use strict';\n\nvar Type = require('../type');\n\nfunction resolveYamlBoolean(data) {\n if (data === null) return false;\n\n var max = data.length;\n\n return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||\n (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'));\n}\n\nfunction constructYamlBoolean(data) {\n return data === 'true' ||\n data === 'True' ||\n data === 'TRUE';\n}\n\nfunction isBoolean(object) {\n return Object.prototype.toString.call(object) === '[object Boolean]';\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:bool', {\n kind: 'scalar',\n resolve: resolveYamlBoolean,\n construct: constructYamlBoolean,\n predicate: isBoolean,\n represent: {\n lowercase: function (object) { return object ? 'true' : 'false'; },\n uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; },\n camelcase: function (object) { return object ? 'True' : 'False'; }\n },\n defaultStyle: 'lowercase'\n});\n","'use strict';\n\nvar common = require('../common');\nvar Type = require('../type');\n\nvar YAML_FLOAT_PATTERN = new RegExp(\n // 2.5e4, 2.5 and integers\n '^(?:[-+]?(?:[0-9][0-9_]*)(?:\\\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' +\n // .2e4, .2\n // special case, seems not from spec\n '|\\\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' +\n // .inf\n '|[-+]?\\\\.(?:inf|Inf|INF)' +\n // .nan\n '|\\\\.(?:nan|NaN|NAN))$');\n\nfunction resolveYamlFloat(data) {\n if (data === null) return false;\n\n if (!YAML_FLOAT_PATTERN.test(data) ||\n // Quick hack to not allow integers end with `_`\n // Probably should update regexp & check speed\n data[data.length - 1] === '_') {\n return false;\n }\n\n return true;\n}\n\nfunction constructYamlFloat(data) {\n var value, sign;\n\n value = data.replace(/_/g, '').toLowerCase();\n sign = value[0] === '-' ? -1 : 1;\n\n if ('+-'.indexOf(value[0]) >= 0) {\n value = value.slice(1);\n }\n\n if (value === '.inf') {\n return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;\n\n } else if (value === '.nan') {\n return NaN;\n }\n return sign * parseFloat(value, 10);\n}\n\n\nvar SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;\n\nfunction representYamlFloat(object, style) {\n var res;\n\n if (isNaN(object)) {\n switch (style) {\n case 'lowercase': return '.nan';\n case 'uppercase': return '.NAN';\n case 'camelcase': return '.NaN';\n }\n } else if (Number.POSITIVE_INFINITY === object) {\n switch (style) {\n case 'lowercase': return '.inf';\n case 'uppercase': return '.INF';\n case 'camelcase': return '.Inf';\n }\n } else if (Number.NEGATIVE_INFINITY === object) {\n switch (style) {\n case 'lowercase': return '-.inf';\n case 'uppercase': return '-.INF';\n case 'camelcase': return '-.Inf';\n }\n } else if (common.isNegativeZero(object)) {\n return '-0.0';\n }\n\n res = object.toString(10);\n\n // JS stringifier can build scientific format without dots: 5e-100,\n // while YAML requres dot: 5.e-100. Fix it with simple hack\n\n return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res;\n}\n\nfunction isFloat(object) {\n return (Object.prototype.toString.call(object) === '[object Number]') &&\n (object % 1 !== 0 || common.isNegativeZero(object));\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:float', {\n kind: 'scalar',\n resolve: resolveYamlFloat,\n construct: constructYamlFloat,\n predicate: isFloat,\n represent: representYamlFloat,\n defaultStyle: 'lowercase'\n});\n","'use strict';\n\nvar common = require('../common');\nvar Type = require('../type');\n\nfunction isHexCode(c) {\n return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) ||\n ((0x41/* A */ <= c) && (c <= 0x46/* F */)) ||\n ((0x61/* a */ <= c) && (c <= 0x66/* f */));\n}\n\nfunction isOctCode(c) {\n return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */));\n}\n\nfunction isDecCode(c) {\n return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */));\n}\n\nfunction resolveYamlInteger(data) {\n if (data === null) return false;\n\n var max = data.length,\n index = 0,\n hasDigits = false,\n ch;\n\n if (!max) return false;\n\n ch = data[index];\n\n // sign\n if (ch === '-' || ch === '+') {\n ch = data[++index];\n }\n\n if (ch === '0') {\n // 0\n if (index + 1 === max) return true;\n ch = data[++index];\n\n // base 2, base 8, base 16\n\n if (ch === 'b') {\n // base 2\n index++;\n\n for (; index < max; index++) {\n ch = data[index];\n if (ch === '_') continue;\n if (ch !== '0' && ch !== '1') return false;\n hasDigits = true;\n }\n return hasDigits && ch !== '_';\n }\n\n\n if (ch === 'x') {\n // base 16\n index++;\n\n for (; index < max; index++) {\n ch = data[index];\n if (ch === '_') continue;\n if (!isHexCode(data.charCodeAt(index))) return false;\n hasDigits = true;\n }\n return hasDigits && ch !== '_';\n }\n\n\n if (ch === 'o') {\n // base 8\n index++;\n\n for (; index < max; index++) {\n ch = data[index];\n if (ch === '_') continue;\n if (!isOctCode(data.charCodeAt(index))) return false;\n hasDigits = true;\n }\n return hasDigits && ch !== '_';\n }\n }\n\n // base 10 (except 0)\n\n // value should not start with `_`;\n if (ch === '_') return false;\n\n for (; index < max; index++) {\n ch = data[index];\n if (ch === '_') continue;\n if (!isDecCode(data.charCodeAt(index))) {\n return false;\n }\n hasDigits = true;\n }\n\n // Should have digits and should not end with `_`\n if (!hasDigits || ch === '_') return false;\n\n return true;\n}\n\nfunction constructYamlInteger(data) {\n var value = data, sign = 1, ch;\n\n if (value.indexOf('_') !== -1) {\n value = value.replace(/_/g, '');\n }\n\n ch = value[0];\n\n if (ch === '-' || ch === '+') {\n if (ch === '-') sign = -1;\n value = value.slice(1);\n ch = value[0];\n }\n\n if (value === '0') return 0;\n\n if (ch === '0') {\n if (value[1] === 'b') return sign * parseInt(value.slice(2), 2);\n if (value[1] === 'x') return sign * parseInt(value.slice(2), 16);\n if (value[1] === 'o') return sign * parseInt(value.slice(2), 8);\n }\n\n return sign * parseInt(value, 10);\n}\n\nfunction isInteger(object) {\n return (Object.prototype.toString.call(object)) === '[object Number]' &&\n (object % 1 === 0 && !common.isNegativeZero(object));\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:int', {\n kind: 'scalar',\n resolve: resolveYamlInteger,\n construct: constructYamlInteger,\n predicate: isInteger,\n represent: {\n binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); },\n octal: function (obj) { return obj >= 0 ? '0o' + obj.toString(8) : '-0o' + obj.toString(8).slice(1); },\n decimal: function (obj) { return obj.toString(10); },\n /* eslint-disable max-len */\n hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); }\n },\n defaultStyle: 'decimal',\n styleAliases: {\n binary: [ 2, 'bin' ],\n octal: [ 8, 'oct' ],\n decimal: [ 10, 'dec' ],\n hexadecimal: [ 16, 'hex' ]\n }\n});\n","'use strict';\n\nvar Type = require('../type');\n\nmodule.exports = new Type('tag:yaml.org,2002:map', {\n kind: 'mapping',\n construct: function (data) { return data !== null ? data : {}; }\n});\n","'use strict';\n\nvar Type = require('../type');\n\nfunction resolveYamlMerge(data) {\n return data === '<<' || data === null;\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:merge', {\n kind: 'scalar',\n resolve: resolveYamlMerge\n});\n","'use strict';\n\nvar Type = require('../type');\n\nfunction resolveYamlNull(data) {\n if (data === null) return true;\n\n var max = data.length;\n\n return (max === 1 && data === '~') ||\n (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL'));\n}\n\nfunction constructYamlNull() {\n return null;\n}\n\nfunction isNull(object) {\n return object === null;\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:null', {\n kind: 'scalar',\n resolve: resolveYamlNull,\n construct: constructYamlNull,\n predicate: isNull,\n represent: {\n canonical: function () { return '~'; },\n lowercase: function () { return 'null'; },\n uppercase: function () { return 'NULL'; },\n camelcase: function () { return 'Null'; },\n empty: function () { return ''; }\n },\n defaultStyle: 'lowercase'\n});\n","'use strict';\n\nvar Type = require('../type');\n\nvar _hasOwnProperty = Object.prototype.hasOwnProperty;\nvar _toString = Object.prototype.toString;\n\nfunction resolveYamlOmap(data) {\n if (data === null) return true;\n\n var objectKeys = [], index, length, pair, pairKey, pairHasKey,\n object = data;\n\n for (index = 0, length = object.length; index < length; index += 1) {\n pair = object[index];\n pairHasKey = false;\n\n if (_toString.call(pair) !== '[object Object]') return false;\n\n for (pairKey in pair) {\n if (_hasOwnProperty.call(pair, pairKey)) {\n if (!pairHasKey) pairHasKey = true;\n else return false;\n }\n }\n\n if (!pairHasKey) return false;\n\n if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);\n else return false;\n }\n\n return true;\n}\n\nfunction constructYamlOmap(data) {\n return data !== null ? data : [];\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:omap', {\n kind: 'sequence',\n resolve: resolveYamlOmap,\n construct: constructYamlOmap\n});\n","'use strict';\n\nvar Type = require('../type');\n\nvar _toString = Object.prototype.toString;\n\nfunction resolveYamlPairs(data) {\n if (data === null) return true;\n\n var index, length, pair, keys, result,\n object = data;\n\n result = new Array(object.length);\n\n for (index = 0, length = object.length; index < length; index += 1) {\n pair = object[index];\n\n if (_toString.call(pair) !== '[object Object]') return false;\n\n keys = Object.keys(pair);\n\n if (keys.length !== 1) return false;\n\n result[index] = [ keys[0], pair[keys[0]] ];\n }\n\n return true;\n}\n\nfunction constructYamlPairs(data) {\n if (data === null) return [];\n\n var index, length, pair, keys, result,\n object = data;\n\n result = new Array(object.length);\n\n for (index = 0, length = object.length; index < length; index += 1) {\n pair = object[index];\n\n keys = Object.keys(pair);\n\n result[index] = [ keys[0], pair[keys[0]] ];\n }\n\n return result;\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:pairs', {\n kind: 'sequence',\n resolve: resolveYamlPairs,\n construct: constructYamlPairs\n});\n","'use strict';\n\nvar Type = require('../type');\n\nmodule.exports = new Type('tag:yaml.org,2002:seq', {\n kind: 'sequence',\n construct: function (data) { return data !== null ? data : []; }\n});\n","'use strict';\n\nvar Type = require('../type');\n\nvar _hasOwnProperty = Object.prototype.hasOwnProperty;\n\nfunction resolveYamlSet(data) {\n if (data === null) return true;\n\n var key, object = data;\n\n for (key in object) {\n if (_hasOwnProperty.call(object, key)) {\n if (object[key] !== null) return false;\n }\n }\n\n return true;\n}\n\nfunction constructYamlSet(data) {\n return data !== null ? data : {};\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:set', {\n kind: 'mapping',\n resolve: resolveYamlSet,\n construct: constructYamlSet\n});\n","'use strict';\n\nvar Type = require('../type');\n\nmodule.exports = new Type('tag:yaml.org,2002:str', {\n kind: 'scalar',\n construct: function (data) { return data !== null ? data : ''; }\n});\n","'use strict';\n\nvar Type = require('../type');\n\nvar YAML_DATE_REGEXP = new RegExp(\n '^([0-9][0-9][0-9][0-9])' + // [1] year\n '-([0-9][0-9])' + // [2] month\n '-([0-9][0-9])$'); // [3] day\n\nvar YAML_TIMESTAMP_REGEXP = new RegExp(\n '^([0-9][0-9][0-9][0-9])' + // [1] year\n '-([0-9][0-9]?)' + // [2] month\n '-([0-9][0-9]?)' + // [3] day\n '(?:[Tt]|[ \\\\t]+)' + // ...\n '([0-9][0-9]?)' + // [4] hour\n ':([0-9][0-9])' + // [5] minute\n ':([0-9][0-9])' + // [6] second\n '(?:\\\\.([0-9]*))?' + // [7] fraction\n '(?:[ \\\\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour\n '(?::([0-9][0-9]))?))?$'); // [11] tz_minute\n\nfunction resolveYamlTimestamp(data) {\n if (data === null) return false;\n if (YAML_DATE_REGEXP.exec(data) !== null) return true;\n if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;\n return false;\n}\n\nfunction constructYamlTimestamp(data) {\n var match, year, month, day, hour, minute, second, fraction = 0,\n delta = null, tz_hour, tz_minute, date;\n\n match = YAML_DATE_REGEXP.exec(data);\n if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);\n\n if (match === null) throw new Error('Date resolve error');\n\n // match: [1] year [2] month [3] day\n\n year = +(match[1]);\n month = +(match[2]) - 1; // JS month starts with 0\n day = +(match[3]);\n\n if (!match[4]) { // no hour\n return new Date(Date.UTC(year, month, day));\n }\n\n // match: [4] hour [5] minute [6] second [7] fraction\n\n hour = +(match[4]);\n minute = +(match[5]);\n second = +(match[6]);\n\n if (match[7]) {\n fraction = match[7].slice(0, 3);\n while (fraction.length < 3) { // milli-seconds\n fraction += '0';\n }\n fraction = +fraction;\n }\n\n // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute\n\n if (match[9]) {\n tz_hour = +(match[10]);\n tz_minute = +(match[11] || 0);\n delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds\n if (match[9] === '-') delta = -delta;\n }\n\n date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));\n\n if (delta) date.setTime(date.getTime() - delta);\n\n return date;\n}\n\nfunction representYamlTimestamp(object /*, style*/) {\n return object.toISOString();\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:timestamp', {\n kind: 'scalar',\n resolve: resolveYamlTimestamp,\n construct: constructYamlTimestamp,\n instanceOf: Date,\n represent: representYamlTimestamp\n});\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar Stream = _interopDefault(require('stream'));\nvar http = _interopDefault(require('http'));\nvar Url = _interopDefault(require('url'));\nvar https = _interopDefault(require('https'));\nvar zlib = _interopDefault(require('zlib'));\n\n// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js\n\n// fix for \"Readable\" isn't a named export issue\nconst Readable = Stream.Readable;\n\nconst BUFFER = Symbol('buffer');\nconst TYPE = Symbol('type');\n\nclass Blob {\n\tconstructor() {\n\t\tthis[TYPE] = '';\n\n\t\tconst blobParts = arguments[0];\n\t\tconst options = arguments[1];\n\n\t\tconst buffers = [];\n\t\tlet size = 0;\n\n\t\tif (blobParts) {\n\t\t\tconst a = blobParts;\n\t\t\tconst length = Number(a.length);\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tconst element = a[i];\n\t\t\t\tlet buffer;\n\t\t\t\tif (element instanceof Buffer) {\n\t\t\t\t\tbuffer = element;\n\t\t\t\t} else if (ArrayBuffer.isView(element)) {\n\t\t\t\t\tbuffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);\n\t\t\t\t} else if (element instanceof ArrayBuffer) {\n\t\t\t\t\tbuffer = Buffer.from(element);\n\t\t\t\t} else if (element instanceof Blob) {\n\t\t\t\t\tbuffer = element[BUFFER];\n\t\t\t\t} else {\n\t\t\t\t\tbuffer = Buffer.from(typeof element === 'string' ? element : String(element));\n\t\t\t\t}\n\t\t\t\tsize += buffer.length;\n\t\t\t\tbuffers.push(buffer);\n\t\t\t}\n\t\t}\n\n\t\tthis[BUFFER] = Buffer.concat(buffers);\n\n\t\tlet type = options && options.type !== undefined && String(options.type).toLowerCase();\n\t\tif (type && !/[^\\u0020-\\u007E]/.test(type)) {\n\t\t\tthis[TYPE] = type;\n\t\t}\n\t}\n\tget size() {\n\t\treturn this[BUFFER].length;\n\t}\n\tget type() {\n\t\treturn this[TYPE];\n\t}\n\ttext() {\n\t\treturn Promise.resolve(this[BUFFER].toString());\n\t}\n\tarrayBuffer() {\n\t\tconst buf = this[BUFFER];\n\t\tconst ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\treturn Promise.resolve(ab);\n\t}\n\tstream() {\n\t\tconst readable = new Readable();\n\t\treadable._read = function () {};\n\t\treadable.push(this[BUFFER]);\n\t\treadable.push(null);\n\t\treturn readable;\n\t}\n\ttoString() {\n\t\treturn '[object Blob]';\n\t}\n\tslice() {\n\t\tconst size = this.size;\n\n\t\tconst start = arguments[0];\n\t\tconst end = arguments[1];\n\t\tlet relativeStart, relativeEnd;\n\t\tif (start === undefined) {\n\t\t\trelativeStart = 0;\n\t\t} else if (start < 0) {\n\t\t\trelativeStart = Math.max(size + start, 0);\n\t\t} else {\n\t\t\trelativeStart = Math.min(start, size);\n\t\t}\n\t\tif (end === undefined) {\n\t\t\trelativeEnd = size;\n\t\t} else if (end < 0) {\n\t\t\trelativeEnd = Math.max(size + end, 0);\n\t\t} else {\n\t\t\trelativeEnd = Math.min(end, size);\n\t\t}\n\t\tconst span = Math.max(relativeEnd - relativeStart, 0);\n\n\t\tconst buffer = this[BUFFER];\n\t\tconst slicedBuffer = buffer.slice(relativeStart, relativeStart + span);\n\t\tconst blob = new Blob([], { type: arguments[2] });\n\t\tblob[BUFFER] = slicedBuffer;\n\t\treturn blob;\n\t}\n}\n\nObject.defineProperties(Blob.prototype, {\n\tsize: { enumerable: true },\n\ttype: { enumerable: true },\n\tslice: { enumerable: true }\n});\n\nObject.defineProperty(Blob.prototype, Symbol.toStringTag, {\n\tvalue: 'Blob',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * fetch-error.js\n *\n * FetchError interface for operational errors\n */\n\n/**\n * Create FetchError instance\n *\n * @param String message Error message for human\n * @param String type Error type for machine\n * @param String systemError For Node.js system error\n * @return FetchError\n */\nfunction FetchError(message, type, systemError) {\n Error.call(this, message);\n\n this.message = message;\n this.type = type;\n\n // when err.type is `system`, err.code contains system error code\n if (systemError) {\n this.code = this.errno = systemError.code;\n }\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nFetchError.prototype = Object.create(Error.prototype);\nFetchError.prototype.constructor = FetchError;\nFetchError.prototype.name = 'FetchError';\n\nlet convert;\ntry {\n\tconvert = require('encoding').convert;\n} catch (e) {}\n\nconst INTERNALS = Symbol('Body internals');\n\n// fix an issue where \"PassThrough\" isn't a named export for node <10\nconst PassThrough = Stream.PassThrough;\n\n/**\n * Body mixin\n *\n * Ref: https://fetch.spec.whatwg.org/#body\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nfunction Body(body) {\n\tvar _this = this;\n\n\tvar _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n\t _ref$size = _ref.size;\n\n\tlet size = _ref$size === undefined ? 0 : _ref$size;\n\tvar _ref$timeout = _ref.timeout;\n\tlet timeout = _ref$timeout === undefined ? 0 : _ref$timeout;\n\n\tif (body == null) {\n\t\t// body is undefined or null\n\t\tbody = null;\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\tbody = Buffer.from(body.toString());\n\t} else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\tbody = Buffer.from(body);\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\tbody = Buffer.from(body.buffer, body.byteOffset, body.byteLength);\n\t} else if (body instanceof Stream) ; else {\n\t\t// none of the above\n\t\t// coerce to string then buffer\n\t\tbody = Buffer.from(String(body));\n\t}\n\tthis[INTERNALS] = {\n\t\tbody,\n\t\tdisturbed: false,\n\t\terror: null\n\t};\n\tthis.size = size;\n\tthis.timeout = timeout;\n\n\tif (body instanceof Stream) {\n\t\tbody.on('error', function (err) {\n\t\t\tconst error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);\n\t\t\t_this[INTERNALS].error = error;\n\t\t});\n\t}\n}\n\nBody.prototype = {\n\tget body() {\n\t\treturn this[INTERNALS].body;\n\t},\n\n\tget bodyUsed() {\n\t\treturn this[INTERNALS].disturbed;\n\t},\n\n\t/**\n * Decode response as ArrayBuffer\n *\n * @return Promise\n */\n\tarrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t},\n\n\t/**\n * Return raw response as Blob\n *\n * @return Promise\n */\n\tblob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t},\n\n\t/**\n * Decode response as json\n *\n * @return Promise\n */\n\tjson() {\n\t\tvar _this2 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\ttry {\n\t\t\t\treturn JSON.parse(buffer.toString());\n\t\t\t} catch (err) {\n\t\t\t\treturn Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n * Decode response as text\n *\n * @return Promise\n */\n\ttext() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t},\n\n\t/**\n * Decode response as buffer (non-spec api)\n *\n * @return Promise\n */\n\tbuffer() {\n\t\treturn consumeBody.call(this);\n\t},\n\n\t/**\n * Decode response as text, while automatically detecting the encoding and\n * trying to decode to UTF-8 (non-spec api)\n *\n * @return Promise\n */\n\ttextConverted() {\n\t\tvar _this3 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn convertBody(buffer, _this3.headers);\n\t\t});\n\t}\n};\n\n// In browsers, all properties are enumerable.\nObject.defineProperties(Body.prototype, {\n\tbody: { enumerable: true },\n\tbodyUsed: { enumerable: true },\n\tarrayBuffer: { enumerable: true },\n\tblob: { enumerable: true },\n\tjson: { enumerable: true },\n\ttext: { enumerable: true }\n});\n\nBody.mixIn = function (proto) {\n\tfor (const name of Object.getOwnPropertyNames(Body.prototype)) {\n\t\t// istanbul ignore else: future proof\n\t\tif (!(name in proto)) {\n\t\t\tconst desc = Object.getOwnPropertyDescriptor(Body.prototype, name);\n\t\t\tObject.defineProperty(proto, name, desc);\n\t\t}\n\t}\n};\n\n/**\n * Consume and convert an entire Body to a Buffer.\n *\n * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body\n *\n * @return Promise\n */\nfunction consumeBody() {\n\tvar _this4 = this;\n\n\tif (this[INTERNALS].disturbed) {\n\t\treturn Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));\n\t}\n\n\tthis[INTERNALS].disturbed = true;\n\n\tif (this[INTERNALS].error) {\n\t\treturn Body.Promise.reject(this[INTERNALS].error);\n\t}\n\n\tlet body = this.body;\n\n\t// body is null\n\tif (body === null) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is blob\n\tif (isBlob(body)) {\n\t\tbody = body.stream();\n\t}\n\n\t// body is buffer\n\tif (Buffer.isBuffer(body)) {\n\t\treturn Body.Promise.resolve(body);\n\t}\n\n\t// istanbul ignore if: should never happen\n\tif (!(body instanceof Stream)) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is stream\n\t// get ready to actually consume the body\n\tlet accum = [];\n\tlet accumBytes = 0;\n\tlet abort = false;\n\n\treturn new Body.Promise(function (resolve, reject) {\n\t\tlet resTimeout;\n\n\t\t// allow timeout on slow response body\n\t\tif (_this4.timeout) {\n\t\t\tresTimeout = setTimeout(function () {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));\n\t\t\t}, _this4.timeout);\n\t\t}\n\n\t\t// handle stream errors\n\t\tbody.on('error', function (err) {\n\t\t\tif (err.name === 'AbortError') {\n\t\t\t\t// if the request was aborted, reject with this Error\n\t\t\t\tabort = true;\n\t\t\t\treject(err);\n\t\t\t} else {\n\t\t\t\t// other errors, such as incorrect content-encoding\n\t\t\t\treject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\n\t\tbody.on('data', function (chunk) {\n\t\t\tif (abort || chunk === null) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (_this4.size && accumBytes + chunk.length > _this4.size) {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\taccumBytes += chunk.length;\n\t\t\taccum.push(chunk);\n\t\t});\n\n\t\tbody.on('end', function () {\n\t\t\tif (abort) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tclearTimeout(resTimeout);\n\n\t\t\ttry {\n\t\t\t\tresolve(Buffer.concat(accum, accumBytes));\n\t\t\t} catch (err) {\n\t\t\t\t// handle streams that have accumulated too much data (issue #414)\n\t\t\t\treject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Detect buffer encoding and convert to target encoding\n * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding\n *\n * @param Buffer buffer Incoming buffer\n * @param String encoding Target encoding\n * @return String\n */\nfunction convertBody(buffer, headers) {\n\tif (typeof convert !== 'function') {\n\t\tthrow new Error('The package `encoding` must be installed to use the textConverted() function');\n\t}\n\n\tconst ct = headers.get('content-type');\n\tlet charset = 'utf-8';\n\tlet res, str;\n\n\t// header\n\tif (ct) {\n\t\tres = /charset=([^;]*)/i.exec(ct);\n\t}\n\n\t// no charset in content type, peek at response body for at most 1024 bytes\n\tstr = buffer.slice(0, 1024).toString();\n\n\t// html5\n\tif (!res && str) {\n\t\tres = / 0 && arguments[0] !== undefined ? arguments[0] : undefined;\n\n\t\tthis[MAP] = Object.create(null);\n\n\t\tif (init instanceof Headers) {\n\t\t\tconst rawHeaders = init.raw();\n\t\t\tconst headerNames = Object.keys(rawHeaders);\n\n\t\t\tfor (const headerName of headerNames) {\n\t\t\t\tfor (const value of rawHeaders[headerName]) {\n\t\t\t\t\tthis.append(headerName, value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t// We don't worry about converting prop to ByteString here as append()\n\t\t// will handle it.\n\t\tif (init == null) ; else if (typeof init === 'object') {\n\t\t\tconst method = init[Symbol.iterator];\n\t\t\tif (method != null) {\n\t\t\t\tif (typeof method !== 'function') {\n\t\t\t\t\tthrow new TypeError('Header pairs must be iterable');\n\t\t\t\t}\n\n\t\t\t\t// sequence>\n\t\t\t\t// Note: per spec we have to first exhaust the lists then process them\n\t\t\t\tconst pairs = [];\n\t\t\t\tfor (const pair of init) {\n\t\t\t\t\tif (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be iterable');\n\t\t\t\t\t}\n\t\t\t\t\tpairs.push(Array.from(pair));\n\t\t\t\t}\n\n\t\t\t\tfor (const pair of pairs) {\n\t\t\t\t\tif (pair.length !== 2) {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be a name/value tuple');\n\t\t\t\t\t}\n\t\t\t\t\tthis.append(pair[0], pair[1]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// record\n\t\t\t\tfor (const key of Object.keys(init)) {\n\t\t\t\t\tconst value = init[key];\n\t\t\t\t\tthis.append(key, value);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new TypeError('Provided initializer must be an object');\n\t\t}\n\t}\n\n\t/**\n * Return combined header value given name\n *\n * @param String name Header name\n * @return Mixed\n */\n\tget(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key === undefined) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this[MAP][key].join(', ');\n\t}\n\n\t/**\n * Iterate over all headers\n *\n * @param Function callback Executed for each item with parameters (value, name, thisArg)\n * @param Boolean thisArg `this` context for callback function\n * @return Void\n */\n\tforEach(callback) {\n\t\tlet thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n\n\t\tlet pairs = getHeaders(this);\n\t\tlet i = 0;\n\t\twhile (i < pairs.length) {\n\t\t\tvar _pairs$i = pairs[i];\n\t\t\tconst name = _pairs$i[0],\n\t\t\t value = _pairs$i[1];\n\n\t\t\tcallback.call(thisArg, value, name, this);\n\t\t\tpairs = getHeaders(this);\n\t\t\ti++;\n\t\t}\n\t}\n\n\t/**\n * Overwrite header values given name\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tset(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}\n\n\t/**\n * Append a value onto existing header\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tappend(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tthis[MAP][key].push(value);\n\t\t} else {\n\t\t\tthis[MAP][name] = [value];\n\t\t}\n\t}\n\n\t/**\n * Check for header name existence\n *\n * @param String name Header name\n * @return Boolean\n */\n\thas(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}\n\n\t/**\n * Delete all header values given name\n *\n * @param String name Header name\n * @return Void\n */\n\tdelete(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tdelete this[MAP][key];\n\t\t}\n\t}\n\n\t/**\n * Return raw headers (non-spec api)\n *\n * @return Object\n */\n\traw() {\n\t\treturn this[MAP];\n\t}\n\n\t/**\n * Get an iterator on keys.\n *\n * @return Iterator\n */\n\tkeys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}\n\n\t/**\n * Get an iterator on values.\n *\n * @return Iterator\n */\n\tvalues() {\n\t\treturn createHeadersIterator(this, 'value');\n\t}\n\n\t/**\n * Get an iterator on entries.\n *\n * This is the default iterator of the Headers object.\n *\n * @return Iterator\n */\n\t[Symbol.iterator]() {\n\t\treturn createHeadersIterator(this, 'key+value');\n\t}\n}\nHeaders.prototype.entries = Headers.prototype[Symbol.iterator];\n\nObject.defineProperty(Headers.prototype, Symbol.toStringTag, {\n\tvalue: 'Headers',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Headers.prototype, {\n\tget: { enumerable: true },\n\tforEach: { enumerable: true },\n\tset: { enumerable: true },\n\tappend: { enumerable: true },\n\thas: { enumerable: true },\n\tdelete: { enumerable: true },\n\tkeys: { enumerable: true },\n\tvalues: { enumerable: true },\n\tentries: { enumerable: true }\n});\n\nfunction getHeaders(headers) {\n\tlet kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';\n\n\tconst keys = Object.keys(headers[MAP]).sort();\n\treturn keys.map(kind === 'key' ? function (k) {\n\t\treturn k.toLowerCase();\n\t} : kind === 'value' ? function (k) {\n\t\treturn headers[MAP][k].join(', ');\n\t} : function (k) {\n\t\treturn [k.toLowerCase(), headers[MAP][k].join(', ')];\n\t});\n}\n\nconst INTERNAL = Symbol('internal');\n\nfunction createHeadersIterator(target, kind) {\n\tconst iterator = Object.create(HeadersIteratorPrototype);\n\titerator[INTERNAL] = {\n\t\ttarget,\n\t\tkind,\n\t\tindex: 0\n\t};\n\treturn iterator;\n}\n\nconst HeadersIteratorPrototype = Object.setPrototypeOf({\n\tnext() {\n\t\t// istanbul ignore if\n\t\tif (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {\n\t\t\tthrow new TypeError('Value of `this` is not a HeadersIterator');\n\t\t}\n\n\t\tvar _INTERNAL = this[INTERNAL];\n\t\tconst target = _INTERNAL.target,\n\t\t kind = _INTERNAL.kind,\n\t\t index = _INTERNAL.index;\n\n\t\tconst values = getHeaders(target, kind);\n\t\tconst len = values.length;\n\t\tif (index >= len) {\n\t\t\treturn {\n\t\t\t\tvalue: undefined,\n\t\t\t\tdone: true\n\t\t\t};\n\t\t}\n\n\t\tthis[INTERNAL].index = index + 1;\n\n\t\treturn {\n\t\t\tvalue: values[index],\n\t\t\tdone: false\n\t\t};\n\t}\n}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));\n\nObject.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {\n\tvalue: 'HeadersIterator',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * Export the Headers object in a form that Node.js can consume.\n *\n * @param Headers headers\n * @return Object\n */\nfunction exportNodeCompatibleHeaders(headers) {\n\tconst obj = Object.assign({ __proto__: null }, headers[MAP]);\n\n\t// http.request() only supports string as Host header. This hack makes\n\t// specifying custom Host header possible.\n\tconst hostHeaderKey = find(headers[MAP], 'Host');\n\tif (hostHeaderKey !== undefined) {\n\t\tobj[hostHeaderKey] = obj[hostHeaderKey][0];\n\t}\n\n\treturn obj;\n}\n\n/**\n * Create a Headers object from an object of headers, ignoring those that do\n * not conform to HTTP grammar productions.\n *\n * @param Object obj Object of headers\n * @return Headers\n */\nfunction createHeadersLenient(obj) {\n\tconst headers = new Headers();\n\tfor (const name of Object.keys(obj)) {\n\t\tif (invalidTokenRegex.test(name)) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (Array.isArray(obj[name])) {\n\t\t\tfor (const val of obj[name]) {\n\t\t\t\tif (invalidHeaderCharRegex.test(val)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (headers[MAP][name] === undefined) {\n\t\t\t\t\theaders[MAP][name] = [val];\n\t\t\t\t} else {\n\t\t\t\t\theaders[MAP][name].push(val);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (!invalidHeaderCharRegex.test(obj[name])) {\n\t\t\theaders[MAP][name] = [obj[name]];\n\t\t}\n\t}\n\treturn headers;\n}\n\nconst INTERNALS$1 = Symbol('Response internals');\n\n// fix an issue where \"STATUS_CODES\" aren't a named export for node <10\nconst STATUS_CODES = http.STATUS_CODES;\n\n/**\n * Response class\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nclass Response {\n\tconstructor() {\n\t\tlet body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\t\tlet opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tBody.call(this, body, opts);\n\n\t\tconst status = opts.status || 200;\n\t\tconst headers = new Headers(opts.headers);\n\n\t\tif (body != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(body);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tthis[INTERNALS$1] = {\n\t\t\turl: opts.url,\n\t\t\tstatus,\n\t\t\tstatusText: opts.statusText || STATUS_CODES[status],\n\t\t\theaders,\n\t\t\tcounter: opts.counter\n\t\t};\n\t}\n\n\tget url() {\n\t\treturn this[INTERNALS$1].url || '';\n\t}\n\n\tget status() {\n\t\treturn this[INTERNALS$1].status;\n\t}\n\n\t/**\n * Convenience property representing if the request ended normally\n */\n\tget ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}\n\n\tget redirected() {\n\t\treturn this[INTERNALS$1].counter > 0;\n\t}\n\n\tget statusText() {\n\t\treturn this[INTERNALS$1].statusText;\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$1].headers;\n\t}\n\n\t/**\n * Clone this response\n *\n * @return Response\n */\n\tclone() {\n\t\treturn new Response(clone(this), {\n\t\t\turl: this.url,\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t\theaders: this.headers,\n\t\t\tok: this.ok,\n\t\t\tredirected: this.redirected\n\t\t});\n\t}\n}\n\nBody.mixIn(Response.prototype);\n\nObject.defineProperties(Response.prototype, {\n\turl: { enumerable: true },\n\tstatus: { enumerable: true },\n\tok: { enumerable: true },\n\tredirected: { enumerable: true },\n\tstatusText: { enumerable: true },\n\theaders: { enumerable: true },\n\tclone: { enumerable: true }\n});\n\nObject.defineProperty(Response.prototype, Symbol.toStringTag, {\n\tvalue: 'Response',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nconst INTERNALS$2 = Symbol('Request internals');\n\n// fix an issue where \"format\", \"parse\" aren't a named export for node <10\nconst parse_url = Url.parse;\nconst format_url = Url.format;\n\nconst streamDestructionSupported = 'destroy' in Stream.Readable.prototype;\n\n/**\n * Check if a value is an instance of Request.\n *\n * @param Mixed input\n * @return Boolean\n */\nfunction isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}\n\nfunction isAbortSignal(signal) {\n\tconst proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);\n\treturn !!(proto && proto.constructor.name === 'AbortSignal');\n}\n\n/**\n * Request class\n *\n * @param Mixed input Url or Request instance\n * @param Object init Custom options\n * @return Void\n */\nclass Request {\n\tconstructor(input) {\n\t\tlet init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tlet parsedURL;\n\n\t\t// normalize input\n\t\tif (!isRequest(input)) {\n\t\t\tif (input && input.href) {\n\t\t\t\t// in order to support Node.js' Url objects; though WHATWG's URL objects\n\t\t\t\t// will fall into this branch also (since their `toString()` will return\n\t\t\t\t// `href` property anyway)\n\t\t\t\tparsedURL = parse_url(input.href);\n\t\t\t} else {\n\t\t\t\t// coerce input to a string before attempting to parse\n\t\t\t\tparsedURL = parse_url(`${input}`);\n\t\t\t}\n\t\t\tinput = {};\n\t\t} else {\n\t\t\tparsedURL = parse_url(input.url);\n\t\t}\n\n\t\tlet method = init.method || input.method || 'GET';\n\t\tmethod = method.toUpperCase();\n\n\t\tif ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {\n\t\t\tthrow new TypeError('Request with GET/HEAD method cannot have body');\n\t\t}\n\n\t\tlet inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;\n\n\t\tBody.call(this, inputBody, {\n\t\t\ttimeout: init.timeout || input.timeout || 0,\n\t\t\tsize: init.size || input.size || 0\n\t\t});\n\n\t\tconst headers = new Headers(init.headers || input.headers || {});\n\n\t\tif (inputBody != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(inputBody);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tlet signal = isRequest(input) ? input.signal : null;\n\t\tif ('signal' in init) signal = init.signal;\n\n\t\tif (signal != null && !isAbortSignal(signal)) {\n\t\t\tthrow new TypeError('Expected signal to be an instanceof AbortSignal');\n\t\t}\n\n\t\tthis[INTERNALS$2] = {\n\t\t\tmethod,\n\t\t\tredirect: init.redirect || input.redirect || 'follow',\n\t\t\theaders,\n\t\t\tparsedURL,\n\t\t\tsignal\n\t\t};\n\n\t\t// node-fetch-only options\n\t\tthis.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;\n\t\tthis.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;\n\t\tthis.counter = init.counter || input.counter || 0;\n\t\tthis.agent = init.agent || input.agent;\n\t}\n\n\tget method() {\n\t\treturn this[INTERNALS$2].method;\n\t}\n\n\tget url() {\n\t\treturn format_url(this[INTERNALS$2].parsedURL);\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$2].headers;\n\t}\n\n\tget redirect() {\n\t\treturn this[INTERNALS$2].redirect;\n\t}\n\n\tget signal() {\n\t\treturn this[INTERNALS$2].signal;\n\t}\n\n\t/**\n * Clone this request\n *\n * @return Request\n */\n\tclone() {\n\t\treturn new Request(this);\n\t}\n}\n\nBody.mixIn(Request.prototype);\n\nObject.defineProperty(Request.prototype, Symbol.toStringTag, {\n\tvalue: 'Request',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Request.prototype, {\n\tmethod: { enumerable: true },\n\turl: { enumerable: true },\n\theaders: { enumerable: true },\n\tredirect: { enumerable: true },\n\tclone: { enumerable: true },\n\tsignal: { enumerable: true }\n});\n\n/**\n * Convert a Request to Node.js http request options.\n *\n * @param Request A Request instance\n * @return Object The options object to be passed to http.request\n */\nfunction getNodeRequestOptions(request) {\n\tconst parsedURL = request[INTERNALS$2].parsedURL;\n\tconst headers = new Headers(request[INTERNALS$2].headers);\n\n\t// fetch step 1.3\n\tif (!headers.has('Accept')) {\n\t\theaders.set('Accept', '*/*');\n\t}\n\n\t// Basic fetch\n\tif (!parsedURL.protocol || !parsedURL.hostname) {\n\t\tthrow new TypeError('Only absolute URLs are supported');\n\t}\n\n\tif (!/^https?:$/.test(parsedURL.protocol)) {\n\t\tthrow new TypeError('Only HTTP(S) protocols are supported');\n\t}\n\n\tif (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {\n\t\tthrow new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');\n\t}\n\n\t// HTTP-network-or-cache fetch steps 2.4-2.7\n\tlet contentLengthValue = null;\n\tif (request.body == null && /^(POST|PUT)$/i.test(request.method)) {\n\t\tcontentLengthValue = '0';\n\t}\n\tif (request.body != null) {\n\t\tconst totalBytes = getTotalBytes(request);\n\t\tif (typeof totalBytes === 'number') {\n\t\t\tcontentLengthValue = String(totalBytes);\n\t\t}\n\t}\n\tif (contentLengthValue) {\n\t\theaders.set('Content-Length', contentLengthValue);\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.11\n\tif (!headers.has('User-Agent')) {\n\t\theaders.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.15\n\tif (request.compress && !headers.has('Accept-Encoding')) {\n\t\theaders.set('Accept-Encoding', 'gzip,deflate');\n\t}\n\n\tlet agent = request.agent;\n\tif (typeof agent === 'function') {\n\t\tagent = agent(parsedURL);\n\t}\n\n\tif (!headers.has('Connection') && !agent) {\n\t\theaders.set('Connection', 'close');\n\t}\n\n\t// HTTP-network fetch step 4.2\n\t// chunked encoding is handled by Node.js\n\n\treturn Object.assign({}, parsedURL, {\n\t\tmethod: request.method,\n\t\theaders: exportNodeCompatibleHeaders(headers),\n\t\tagent\n\t});\n}\n\n/**\n * abort-error.js\n *\n * AbortError interface for cancelled requests\n */\n\n/**\n * Create AbortError instance\n *\n * @param String message Error message for human\n * @return AbortError\n */\nfunction AbortError(message) {\n Error.call(this, message);\n\n this.type = 'aborted';\n this.message = message;\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nAbortError.prototype = Object.create(Error.prototype);\nAbortError.prototype.constructor = AbortError;\nAbortError.prototype.name = 'AbortError';\n\n// fix an issue where \"PassThrough\", \"resolve\" aren't a named export for node <10\nconst PassThrough$1 = Stream.PassThrough;\nconst resolve_url = Url.resolve;\n\n/**\n * Fetch function\n *\n * @param Mixed url Absolute url or Request instance\n * @param Object opts Fetch options\n * @return Promise\n */\nfunction fetch(url, opts) {\n\n\t// allow custom promise\n\tif (!fetch.Promise) {\n\t\tthrow new Error('native promise missing, set fetch.Promise to your favorite alternative');\n\t}\n\n\tBody.Promise = fetch.Promise;\n\n\t// wrap http.request into fetch\n\treturn new fetch.Promise(function (resolve, reject) {\n\t\t// build request object\n\t\tconst request = new Request(url, opts);\n\t\tconst options = getNodeRequestOptions(request);\n\n\t\tconst send = (options.protocol === 'https:' ? https : http).request;\n\t\tconst signal = request.signal;\n\n\t\tlet response = null;\n\n\t\tconst abort = function abort() {\n\t\t\tlet error = new AbortError('The user aborted a request.');\n\t\t\treject(error);\n\t\t\tif (request.body && request.body instanceof Stream.Readable) {\n\t\t\t\trequest.body.destroy(error);\n\t\t\t}\n\t\t\tif (!response || !response.body) return;\n\t\t\tresponse.body.emit('error', error);\n\t\t};\n\n\t\tif (signal && signal.aborted) {\n\t\t\tabort();\n\t\t\treturn;\n\t\t}\n\n\t\tconst abortAndFinalize = function abortAndFinalize() {\n\t\t\tabort();\n\t\t\tfinalize();\n\t\t};\n\n\t\t// send request\n\t\tconst req = send(options);\n\t\tlet reqTimeout;\n\n\t\tif (signal) {\n\t\t\tsignal.addEventListener('abort', abortAndFinalize);\n\t\t}\n\n\t\tfunction finalize() {\n\t\t\treq.abort();\n\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\tclearTimeout(reqTimeout);\n\t\t}\n\n\t\tif (request.timeout) {\n\t\t\treq.once('socket', function (socket) {\n\t\t\t\treqTimeout = setTimeout(function () {\n\t\t\t\t\treject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));\n\t\t\t\t\tfinalize();\n\t\t\t\t}, request.timeout);\n\t\t\t});\n\t\t}\n\n\t\treq.on('error', function (err) {\n\t\t\treject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));\n\t\t\tfinalize();\n\t\t});\n\n\t\treq.on('response', function (res) {\n\t\t\tclearTimeout(reqTimeout);\n\n\t\t\tconst headers = createHeadersLenient(res.headers);\n\n\t\t\t// HTTP fetch step 5\n\t\t\tif (fetch.isRedirect(res.statusCode)) {\n\t\t\t\t// HTTP fetch step 5.2\n\t\t\t\tconst location = headers.get('Location');\n\n\t\t\t\t// HTTP fetch step 5.3\n\t\t\t\tconst locationURL = location === null ? null : resolve_url(request.url, location);\n\n\t\t\t\t// HTTP fetch step 5.5\n\t\t\t\tswitch (request.redirect) {\n\t\t\t\t\tcase 'error':\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase 'manual':\n\t\t\t\t\t\t// node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.\n\t\t\t\t\t\tif (locationURL !== null) {\n\t\t\t\t\t\t\t// handle corrupted header\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\theaders.set('Location', locationURL);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t// istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request\n\t\t\t\t\t\t\t\treject(err);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'follow':\n\t\t\t\t\t\t// HTTP-redirect fetch step 2\n\t\t\t\t\t\tif (locationURL === null) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 5\n\t\t\t\t\t\tif (request.counter >= request.follow) {\n\t\t\t\t\t\t\treject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 6 (counter increment)\n\t\t\t\t\t\t// Create a new Request object.\n\t\t\t\t\t\tconst requestOpts = {\n\t\t\t\t\t\t\theaders: new Headers(request.headers),\n\t\t\t\t\t\t\tfollow: request.follow,\n\t\t\t\t\t\t\tcounter: request.counter + 1,\n\t\t\t\t\t\t\tagent: request.agent,\n\t\t\t\t\t\t\tcompress: request.compress,\n\t\t\t\t\t\t\tmethod: request.method,\n\t\t\t\t\t\t\tbody: request.body,\n\t\t\t\t\t\t\tsignal: request.signal,\n\t\t\t\t\t\t\ttimeout: request.timeout,\n\t\t\t\t\t\t\tsize: request.size\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 9\n\t\t\t\t\t\tif (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {\n\t\t\t\t\t\t\treject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 11\n\t\t\t\t\t\tif (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {\n\t\t\t\t\t\t\trequestOpts.method = 'GET';\n\t\t\t\t\t\t\trequestOpts.body = undefined;\n\t\t\t\t\t\t\trequestOpts.headers.delete('content-length');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 15\n\t\t\t\t\t\tresolve(fetch(new Request(locationURL, requestOpts)));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// prepare response\n\t\t\tres.once('end', function () {\n\t\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\t});\n\t\t\tlet body = res.pipe(new PassThrough$1());\n\n\t\t\tconst response_options = {\n\t\t\t\turl: request.url,\n\t\t\t\tstatus: res.statusCode,\n\t\t\t\tstatusText: res.statusMessage,\n\t\t\t\theaders: headers,\n\t\t\t\tsize: request.size,\n\t\t\t\ttimeout: request.timeout,\n\t\t\t\tcounter: request.counter\n\t\t\t};\n\n\t\t\t// HTTP-network fetch step 12.1.1.3\n\t\t\tconst codings = headers.get('Content-Encoding');\n\n\t\t\t// HTTP-network fetch step 12.1.1.4: handle content codings\n\n\t\t\t// in following scenarios we ignore compression support\n\t\t\t// 1. compression support is disabled\n\t\t\t// 2. HEAD request\n\t\t\t// 3. no Content-Encoding header\n\t\t\t// 4. no content response (204)\n\t\t\t// 5. content not modified response (304)\n\t\t\tif (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For Node v6+\n\t\t\t// Be less strict when decoding compressed responses, since sometimes\n\t\t\t// servers send slightly invalid responses that are still accepted\n\t\t\t// by common browsers.\n\t\t\t// Always using Z_SYNC_FLUSH is what cURL does.\n\t\t\tconst zlibOptions = {\n\t\t\t\tflush: zlib.Z_SYNC_FLUSH,\n\t\t\t\tfinishFlush: zlib.Z_SYNC_FLUSH\n\t\t\t};\n\n\t\t\t// for gzip\n\t\t\tif (codings == 'gzip' || codings == 'x-gzip') {\n\t\t\t\tbody = body.pipe(zlib.createGunzip(zlibOptions));\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for deflate\n\t\t\tif (codings == 'deflate' || codings == 'x-deflate') {\n\t\t\t\t// handle the infamous raw deflate response from old servers\n\t\t\t\t// a hack for old IIS and Apache servers\n\t\t\t\tconst raw = res.pipe(new PassThrough$1());\n\t\t\t\traw.once('data', function (chunk) {\n\t\t\t\t\t// see http://stackoverflow.com/questions/37519828\n\t\t\t\t\tif ((chunk[0] & 0x0F) === 0x08) {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflate());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflateRaw());\n\t\t\t\t\t}\n\t\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\t\tresolve(response);\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for br\n\t\t\tif (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {\n\t\t\t\tbody = body.pipe(zlib.createBrotliDecompress());\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// otherwise, use response as-is\n\t\t\tresponse = new Response(body, response_options);\n\t\t\tresolve(response);\n\t\t});\n\n\t\twriteToStream(req, request);\n\t});\n}\n/**\n * Redirect code matching\n *\n * @param Number code Status code\n * @return Boolean\n */\nfetch.isRedirect = function (code) {\n\treturn code === 301 || code === 302 || code === 303 || code === 307 || code === 308;\n};\n\n// expose Promise\nfetch.Promise = global.Promise;\n\nmodule.exports = exports = fetch;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = exports;\nexports.Headers = Headers;\nexports.Request = Request;\nexports.Response = Response;\nexports.FetchError = FetchError;\n","var wrappy = require('wrappy')\nmodule.exports = wrappy(once)\nmodule.exports.strict = wrappy(onceStrict)\n\nonce.proto = once(function () {\n Object.defineProperty(Function.prototype, 'once', {\n value: function () {\n return once(this)\n },\n configurable: true\n })\n\n Object.defineProperty(Function.prototype, 'onceStrict', {\n value: function () {\n return onceStrict(this)\n },\n configurable: true\n })\n})\n\nfunction once (fn) {\n var f = function () {\n if (f.called) return f.value\n f.called = true\n return f.value = fn.apply(this, arguments)\n }\n f.called = false\n return f\n}\n\nfunction onceStrict (fn) {\n var f = function () {\n if (f.called)\n throw new Error(f.onceError)\n f.called = true\n return f.value = fn.apply(this, arguments)\n }\n var name = fn.name || 'Function wrapped with `once`'\n f.onceError = name + \" shouldn't be called more than once\"\n f.called = false\n return f\n}\n","module.exports = require('./lib/tunnel');\n","'use strict';\n\nvar net = require('net');\nvar tls = require('tls');\nvar http = require('http');\nvar https = require('https');\nvar events = require('events');\nvar assert = require('assert');\nvar util = require('util');\n\n\nexports.httpOverHttp = httpOverHttp;\nexports.httpsOverHttp = httpsOverHttp;\nexports.httpOverHttps = httpOverHttps;\nexports.httpsOverHttps = httpsOverHttps;\n\n\nfunction httpOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n return agent;\n}\n\nfunction httpsOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\nfunction httpOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n return agent;\n}\n\nfunction httpsOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\n\nfunction TunnelingAgent(options) {\n var self = this;\n self.options = options || {};\n self.proxyOptions = self.options.proxy || {};\n self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;\n self.requests = [];\n self.sockets = [];\n\n self.on('free', function onFree(socket, host, port, localAddress) {\n var options = toOptions(host, port, localAddress);\n for (var i = 0, len = self.requests.length; i < len; ++i) {\n var pending = self.requests[i];\n if (pending.host === options.host && pending.port === options.port) {\n // Detect the request to connect same origin server,\n // reuse the connection.\n self.requests.splice(i, 1);\n pending.request.onSocket(socket);\n return;\n }\n }\n socket.destroy();\n self.removeSocket(socket);\n });\n}\nutil.inherits(TunnelingAgent, events.EventEmitter);\n\nTunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {\n var self = this;\n var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));\n\n if (self.sockets.length >= this.maxSockets) {\n // We are over limit so we'll add it to the queue.\n self.requests.push(options);\n return;\n }\n\n // If we are under maxSockets create a new one.\n self.createSocket(options, function(socket) {\n socket.on('free', onFree);\n socket.on('close', onCloseOrRemove);\n socket.on('agentRemove', onCloseOrRemove);\n req.onSocket(socket);\n\n function onFree() {\n self.emit('free', socket, options);\n }\n\n function onCloseOrRemove(err) {\n self.removeSocket(socket);\n socket.removeListener('free', onFree);\n socket.removeListener('close', onCloseOrRemove);\n socket.removeListener('agentRemove', onCloseOrRemove);\n }\n });\n};\n\nTunnelingAgent.prototype.createSocket = function createSocket(options, cb) {\n var self = this;\n var placeholder = {};\n self.sockets.push(placeholder);\n\n var connectOptions = mergeOptions({}, self.proxyOptions, {\n method: 'CONNECT',\n path: options.host + ':' + options.port,\n agent: false,\n headers: {\n host: options.host + ':' + options.port\n }\n });\n if (options.localAddress) {\n connectOptions.localAddress = options.localAddress;\n }\n if (connectOptions.proxyAuth) {\n connectOptions.headers = connectOptions.headers || {};\n connectOptions.headers['Proxy-Authorization'] = 'Basic ' +\n new Buffer(connectOptions.proxyAuth).toString('base64');\n }\n\n debug('making CONNECT request');\n var connectReq = self.request(connectOptions);\n connectReq.useChunkedEncodingByDefault = false; // for v0.6\n connectReq.once('response', onResponse); // for v0.6\n connectReq.once('upgrade', onUpgrade); // for v0.6\n connectReq.once('connect', onConnect); // for v0.7 or later\n connectReq.once('error', onError);\n connectReq.end();\n\n function onResponse(res) {\n // Very hacky. This is necessary to avoid http-parser leaks.\n res.upgrade = true;\n }\n\n function onUpgrade(res, socket, head) {\n // Hacky.\n process.nextTick(function() {\n onConnect(res, socket, head);\n });\n }\n\n function onConnect(res, socket, head) {\n connectReq.removeAllListeners();\n socket.removeAllListeners();\n\n if (res.statusCode !== 200) {\n debug('tunneling socket could not be established, statusCode=%d',\n res.statusCode);\n socket.destroy();\n var error = new Error('tunneling socket could not be established, ' +\n 'statusCode=' + res.statusCode);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n if (head.length > 0) {\n debug('got illegal response body from proxy');\n socket.destroy();\n var error = new Error('got illegal response body from proxy');\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n debug('tunneling connection has established');\n self.sockets[self.sockets.indexOf(placeholder)] = socket;\n return cb(socket);\n }\n\n function onError(cause) {\n connectReq.removeAllListeners();\n\n debug('tunneling socket could not be established, cause=%s\\n',\n cause.message, cause.stack);\n var error = new Error('tunneling socket could not be established, ' +\n 'cause=' + cause.message);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n }\n};\n\nTunnelingAgent.prototype.removeSocket = function removeSocket(socket) {\n var pos = this.sockets.indexOf(socket)\n if (pos === -1) {\n return;\n }\n this.sockets.splice(pos, 1);\n\n var pending = this.requests.shift();\n if (pending) {\n // If we have pending requests and a socket gets closed a new one\n // needs to be created to take over in the pool for the one that closed.\n this.createSocket(pending, function(socket) {\n pending.request.onSocket(socket);\n });\n }\n};\n\nfunction createSecureSocket(options, cb) {\n var self = this;\n TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {\n var hostHeader = options.request.getHeader('host');\n var tlsOptions = mergeOptions({}, self.options, {\n socket: socket,\n servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host\n });\n\n // 0 is dummy port for v0.6\n var secureSocket = tls.connect(0, tlsOptions);\n self.sockets[self.sockets.indexOf(socket)] = secureSocket;\n cb(secureSocket);\n });\n}\n\n\nfunction toOptions(host, port, localAddress) {\n if (typeof host === 'string') { // since v0.10\n return {\n host: host,\n port: port,\n localAddress: localAddress\n };\n }\n return host; // for v0.11 or later\n}\n\nfunction mergeOptions(target) {\n for (var i = 1, len = arguments.length; i < len; ++i) {\n var overrides = arguments[i];\n if (typeof overrides === 'object') {\n var keys = Object.keys(overrides);\n for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {\n var k = keys[j];\n if (overrides[k] !== undefined) {\n target[k] = overrides[k];\n }\n }\n }\n }\n return target;\n}\n\n\nvar debug;\nif (process.env.NODE_DEBUG && /\\btunnel\\b/.test(process.env.NODE_DEBUG)) {\n debug = function() {\n var args = Array.prototype.slice.call(arguments);\n if (typeof args[0] === 'string') {\n args[0] = 'TUNNEL: ' + args[0];\n } else {\n args.unshift('TUNNEL:');\n }\n console.error.apply(console, args);\n }\n} else {\n debug = function() {};\n}\nexports.debug = debug; // for test\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction getUserAgent() {\n if (typeof navigator === \"object\" && \"userAgent\" in navigator) {\n return navigator.userAgent;\n }\n\n if (typeof process === \"object\" && \"version\" in process) {\n return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;\n }\n\n return \"\";\n}\n\nexports.getUserAgent = getUserAgent;\n//# sourceMappingURL=index.js.map\n","// Returns a wrapper function that returns a wrapped callback\n// The wrapper function should do some stuff, and return a\n// presumably different callback function.\n// This makes sure that own properties are retained, so that\n// decorations and such are not lost along the way.\nmodule.exports = wrappy\nfunction wrappy (fn, cb) {\n if (fn && cb) return wrappy(fn)(cb)\n\n if (typeof fn !== 'function')\n throw new TypeError('need wrapper function')\n\n Object.keys(fn).forEach(function (k) {\n wrapper[k] = fn[k]\n })\n\n return wrapper\n\n function wrapper() {\n var args = new Array(arguments.length)\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n var ret = fn.apply(this, args)\n var cb = args[args.length-1]\n if (typeof ret === 'function' && ret !== cb) {\n Object.keys(cb).forEach(function (k) {\n ret[k] = cb[k]\n })\n }\n return ret\n }\n}\n",null,"module.exports = require(\"assert\");;","module.exports = require(\"events\");;","module.exports = require(\"fs\");;","module.exports = require(\"http\");;","module.exports = require(\"https\");;","module.exports = require(\"net\");;","module.exports = require(\"os\");;","module.exports = require(\"path\");;","module.exports = require(\"stream\");;","module.exports = require(\"tls\");;","module.exports = require(\"url\");;","module.exports = require(\"util\");;","module.exports = require(\"zlib\");;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tif(__webpack_module_cache__[moduleId]) {\n\t\treturn __webpack_module_cache__[moduleId].exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\tvar threw = true;\n\ttry {\n\t\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\t\tthrew = false;\n\t} finally {\n\t\tif(threw) delete __webpack_module_cache__[moduleId];\n\t}\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","\n__webpack_require__.ab = __dirname + \"/\";","// module exports must be returned from runtime so entry inlining is disabled\n// startup\n// Load entry module and return exports\nreturn __webpack_require__(3109);\n"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC5FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACrLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACtOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACjGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC9GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACrNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC/DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACxKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC/EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC9OA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACxhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC/KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACvYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC7GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACrIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC3nCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACrJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACjJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACh8DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACrzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC3LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACvEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACjpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACtvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AClWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACnFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACrnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACjsCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC1rCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC90BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACxZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AClHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACvVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACvEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACnIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACnKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACrRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACjKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AChpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACt8BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AChsDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC1HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACtGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC9HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AClGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC7JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACzFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AClnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC3CA;AACA;AACA;A;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACzQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AClCA;AACA;AACA;A;;;;;;ACFA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC5BA;AACA;ACDA;AACA;AACA;AACA;;A","sourceRoot":""} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 445dd7c..d2121f3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@actions/core": "^1.2.6", "@actions/github": "^4.0.0", - "fp-ts": "^2.9.3", + "fp-ts": "^2.11.4", "io-ts": "^2.2.16", "io-ts-reporters": "^1.2.2", "js-yaml": "^4.0.0" @@ -3609,9 +3609,9 @@ } }, "node_modules/fp-ts": { - "version": "2.9.5", - "resolved": "https://registry.npmjs.org/fp-ts/-/fp-ts-2.9.5.tgz", - "integrity": "sha512-MiHrA5teO6t8zKArE3DdMPT/Db6v2GUt5yfWnhBTrrsVfeCJUUnV6sgFvjGNBKDmEMqVwRFkEePL7wPwqrLKKA==" + "version": "2.11.4", + "resolved": "https://registry.npmjs.org/fp-ts/-/fp-ts-2.11.4.tgz", + "integrity": "sha512-lhV7tGEbs2qoVw4vmqOovChS7CAoIYU0gdiPEF8Vc4bLZct+PAMMeXrCqRyBNEo33XOvwvAmFDEDIrHPWH2/fg==" }, "node_modules/fragment-cache": { "version": "0.2.1", @@ -11423,9 +11423,9 @@ } }, "fp-ts": { - "version": "2.9.5", - "resolved": "https://registry.npmjs.org/fp-ts/-/fp-ts-2.9.5.tgz", - "integrity": "sha512-MiHrA5teO6t8zKArE3DdMPT/Db6v2GUt5yfWnhBTrrsVfeCJUUnV6sgFvjGNBKDmEMqVwRFkEePL7wPwqrLKKA==" + "version": "2.11.4", + "resolved": "https://registry.npmjs.org/fp-ts/-/fp-ts-2.11.4.tgz", + "integrity": "sha512-lhV7tGEbs2qoVw4vmqOovChS7CAoIYU0gdiPEF8Vc4bLZct+PAMMeXrCqRyBNEo33XOvwvAmFDEDIrHPWH2/fg==" }, "fragment-cache": { "version": "0.2.1", diff --git a/package.json b/package.json index 2fad390..0ee026b 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "dependencies": { "@actions/core": "^1.2.6", "@actions/github": "^4.0.0", - "fp-ts": "^2.9.3", + "fp-ts": "^2.11.4", "io-ts": "^2.2.16", "io-ts-reporters": "^1.2.2", "js-yaml": "^4.0.0"