` 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 */\n\n\nvar map = function map(f) {\n return T.map(E.map(f));\n};\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 */\n\nexports.bimap = /*#__PURE__*/function_1.flow(E.bimap, T.map);\n/**\n * Map a function over the first type argument of a bifunctor.\n *\n * @category Bifunctor\n * @since 2.0.0\n */\n\nvar mapLeft = function mapLeft(f) {\n return T.map(E.mapLeft(f));\n};\n\nexports.mapLeft = mapLeft;\n/**\n * Less strict version of [`ap`](#ap).\n *\n * @category Apply\n * @since 2.8.0\n */\n\nvar apW = function apW(fa) {\n return function_1.flow(T.map(function (gab) {\n return function (ga) {\n return E.apW(ga)(gab);\n };\n }), T.ap(fa));\n};\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 */\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 */\n\nvar apFirst = function apFirst(fb) {\n return function_1.flow(exports.map(function (a) {\n return function () {\n return a;\n };\n }), exports.ap(fb));\n};\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 */\n\nvar apSecond = function apSecond(fb) {\n return function_1.flow(exports.map(function () {\n return function (b) {\n return b;\n };\n }), exports.ap(fb));\n};\n\nexports.apSecond = apSecond;\n/**\n * Less strict version of [`chain`](#chain).\n *\n * @category Monad\n * @since 2.6.0\n */\n\nvar chainW = function chainW(f) {\n return function (ma) {\n return function_1.pipe(ma, T.chain(E.fold(exports.left, f)));\n };\n};\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 */\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 */\n\nvar chainFirstW = function chainFirstW(f) {\n return exports.chainW(function (a) {\n return function_1.pipe(f(a), exports.map(function () {\n return a;\n }));\n });\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 */\n\nexports.chainFirst = exports.chainFirstW;\n/**\n * Derivable from `Monad`.\n *\n * @category combinators\n * @since 2.0.0\n */\n\nexports.flatten = /*#__PURE__*/exports.chain(function_1.identity);\n/**\n * Less strict version of [`alt`](#alt).\n *\n * @category Alt\n * @since 2.9.0\n */\n\nvar altW = function altW(that) {\n return function (fa) {\n return function_1.pipe(fa, T.chain(E.fold(that, exports.right)));\n };\n};\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 `TaskEither` returns `fa` if is a `Right` or the value returned by `that` otherwise.\n *\n * See also [orElse](#orElse).\n *\n * @example\n * import * as E from 'fp-ts/Either'\n * import { pipe } from 'fp-ts/function'\n * import * as TE from 'fp-ts/TaskEither'\n *\n * async function test() {\n * assert.deepStrictEqual(\n * await pipe(\n * TE.right(1),\n * TE.alt(() => TE.right(2))\n * )(),\n * E.right(1)\n * )\n * assert.deepStrictEqual(\n * await pipe(\n * TE.left('a'),\n * TE.alt(() => TE.right(2))\n * )(),\n * E.right(2)\n * )\n * assert.deepStrictEqual(\n * await pipe(\n * TE.left('a'),\n * TE.alt(() => TE.left('b'))\n * )(),\n * E.left('b')\n * )\n * }\n *\n * test()\n *\n * @category Alt\n * @since 2.0.0\n */\n\nexports.alt = exports.altW;\n/**\n * Wrap a value into the type constructor.\n *\n * Equivalent to [`right`](#right).\n *\n * @category Applicative\n * @since 2.0.0\n */\n\nexports.of = exports.right;\n/**\n * @category MonadIO\n * @since 2.7.0\n */\n\nexports.fromIO = exports.rightIO;\n/**\n * @category MonadTask\n * @since 2.7.0\n */\n\nexports.fromTask = exports.rightTask;\n/**\n * @category MonadTask\n * @since 2.7.0\n */\n\nexports.throwError = exports.left; // -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n\n/**\n * @category instances\n * @since 2.0.0\n */\n\nexports.URI = 'TaskEither';\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 * @category instances\n * @since 2.0.0\n */\n\nfunction getSemigroup(S) {\n return T.getSemigroup(E.getSemigroup(S));\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 * @category instances\n * @since 2.0.0\n */\n\nfunction getApplySemigroup(S) {\n return T.getSemigroup(E.getApplySemigroup(S));\n}\n\nexports.getApplySemigroup = getApplySemigroup;\n/**\n * @category instances\n * @since 2.0.0\n */\n\nfunction getApplyMonoid(M) {\n return {\n concat: getApplySemigroup(M).concat,\n empty: exports.right(M.empty)\n };\n}\n\nexports.getApplyMonoid = getApplyMonoid;\n/**\n * @category instances\n * @since 2.7.0\n */\n\nfunction getApplicativeTaskValidation(A, SE) {\n var AV = E.getApplicativeValidation(SE);\n\n var _ap = function ap(fga) {\n return function (fgab) {\n return A.ap(A.map(fgab, function (h) {\n return function (ga) {\n return AV.ap(h, ga);\n };\n }), fga);\n };\n };\n\n return {\n URI: exports.URI,\n _E: undefined,\n map: map_,\n ap: function ap(fab, fa) {\n return function_1.pipe(fab, _ap(fa));\n },\n of: exports.of\n };\n}\n\nexports.getApplicativeTaskValidation = getApplicativeTaskValidation;\n/**\n * @category instances\n * @since 2.7.0\n */\n\nfunction getAltTaskValidation(SE) {\n return {\n URI: exports.URI,\n _E: undefined,\n map: map_,\n alt: function alt(me, that) {\n return function_1.pipe(me, T.chain(function (e1) {\n return E.isRight(e1) ? T.of(e1) : function_1.pipe(that(), T.map(function (e2) {\n return E.isLeft(e2) ? E.left(SE.concat(e1.left, e2.left)) : e2;\n }));\n }));\n }\n };\n}\n\nexports.getAltTaskValidation = getAltTaskValidation; // TODO: remove in v3\n\n/**\n * @category instances\n * @since 2.0.0\n */\n\nfunction getTaskValidation(SE) {\n var applicativeTaskValidation = getApplicativeTaskValidation(T.ApplicativePar, SE);\n var altTaskValidation = getAltTaskValidation(SE);\n return {\n URI: exports.URI,\n _E: undefined,\n map: map_,\n ap: applicativeTaskValidation.ap,\n of: exports.of,\n chain: chain_,\n bimap: bimap_,\n mapLeft: mapLeft_,\n alt: altTaskValidation.alt,\n fromIO: exports.fromIO,\n fromTask: exports.fromTask,\n throwError: exports.throwError\n };\n}\n\nexports.getTaskValidation = getTaskValidation;\n/**\n * @category instances\n * @since 2.1.0\n */\n\nfunction getFilterable(M) {\n var W = E.getWitherable(M);\n var F = Filterable_1.getFilterableComposition(T.Monad, W);\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 };\n}\n\nexports.getFilterable = getFilterable;\n/**\n * @category instances\n * @since 2.7.0\n */\n\nexports.Functor = {\n URI: exports.URI,\n map: map_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\n\nexports.ApplicativePar = {\n URI: exports.URI,\n map: map_,\n ap: apPar_,\n of: exports.of\n};\n/**\n * @category instances\n * @since 2.7.0\n */\n\nexports.ApplicativeSeq = {\n URI: exports.URI,\n map: map_,\n ap: apSeq_,\n of: exports.of\n};\n/**\n * @category instances\n * @since 2.7.0\n */\n\nexports.Bifunctor = {\n URI: exports.URI,\n bimap: bimap_,\n mapLeft: mapLeft_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\n\nexports.Alt = {\n URI: exports.URI,\n map: map_,\n alt: alt_\n}; // TODO: remove in v3\n\n/**\n * @category instances\n * @since 2.0.0\n */\n\nexports.taskEither = {\n URI: exports.URI,\n bimap: bimap_,\n mapLeft: mapLeft_,\n map: map_,\n of: exports.of,\n ap: apPar_,\n chain: chain_,\n alt: alt_,\n fromIO: exports.fromIO,\n fromTask: exports.fromTask,\n throwError: exports.throwError\n}; // TODO: remove in v3\n\n/**\n * Like `TaskEither` but `ap` is sequential\n *\n * @category instances\n * @since 2.0.0\n */\n\nexports.taskEitherSeq = {\n URI: exports.URI,\n bimap: bimap_,\n mapLeft: mapLeft_,\n map: map_,\n of: exports.of,\n ap: apSeq_,\n chain: chain_,\n alt: alt_,\n fromIO: exports.fromIO,\n fromTask: exports.fromTask,\n throwError: exports.throwError\n};\n\nfunction taskify(f) {\n return function () {\n var args = Array.prototype.slice.call(arguments);\n return function () {\n return new Promise(function (resolve) {\n var cbResolver = function cbResolver(e, r) {\n return e != null ? resolve(E.left(e)) : resolve(E.right(r));\n };\n\n f.apply(null, args.concat(cbResolver));\n });\n };\n };\n}\n\nexports.taskify = taskify;\n/**\n * Make sure that a resource is cleaned up in the event of an exception (\\*). The release action is called regardless of\n * whether the body action throws (\\*) or returns.\n *\n * (\\*) i.e. returns a `Left`\n *\n * Derivable from `MonadThrow`.\n *\n * @since 2.0.0\n */\n\nvar bracket = function bracket(acquire, use, release) {\n return function_1.pipe(acquire, exports.chain(function (a) {\n return function_1.pipe(function_1.pipe(use(a), T.map(E.right)), exports.chain(function (e) {\n return function_1.pipe(release(a, e), exports.chain(function () {\n return E.isLeft(e) ? exports.left(e.left) : exports.of(e.right);\n }));\n }));\n }));\n};\n\nexports.bracket = bracket; // -------------------------------------------------------------------------------------\n// do notation\n// -------------------------------------------------------------------------------------\n\n/**\n * @since 2.9.0\n */\n\nexports.Do = /*#__PURE__*/exports.of({});\n/**\n * @since 2.8.0\n */\n\nvar bindTo = function bindTo(name) {\n return exports.map(function_1.bindTo_(name));\n};\n\nexports.bindTo = bindTo;\n/**\n * @since 2.8.0\n */\n\nvar bindW = function bindW(name, f) {\n return exports.chainW(function (a) {\n return function_1.pipe(f(a), exports.map(function (b) {\n return function_1.bind_(a, name, b);\n }));\n });\n};\n\nexports.bindW = bindW;\n/**\n * @since 2.8.0\n */\n\nexports.bind = exports.bindW; // -------------------------------------------------------------------------------------\n// pipeable sequence S\n// -------------------------------------------------------------------------------------\n\n/**\n * @since 2.8.0\n */\n\nvar apSW = function apSW(name, fb) {\n return function_1.flow(exports.map(function (a) {\n return function (b) {\n return function_1.bind_(a, name, b);\n };\n }), exports.apW(fb));\n};\n\nexports.apSW = apSW;\n/**\n * @since 2.8.0\n */\n\nexports.apS = exports.apSW; // -------------------------------------------------------------------------------------\n// array utils\n// -------------------------------------------------------------------------------------\n\n/**\n * @since 2.9.0\n */\n\nvar traverseArrayWithIndex = function traverseArrayWithIndex(f) {\n return function (arr) {\n return function_1.pipe(arr, T.traverseArrayWithIndex(f), T.map(E.sequenceArray));\n };\n};\n\nexports.traverseArrayWithIndex = traverseArrayWithIndex;\n/**\n * this function has the same behavior of `A.traverse(TE.taskEither)` but it's stack safe and performs better\n *\n * *this function run all tasks in parallel and does not bail out, for sequential version use `traverseSeqArray`*\n *\n * @example\n *\n * import * as TE from 'fp-ts/TaskEither'\n * import * as A from 'fp-ts/Array'\n * import { right } from 'fp-ts/Either'\n * import { pipe } from 'fp-ts/function'\n *\n * const PostRepo = {\n * findById : (id: number) => TE.of({id, title: ''})\n * }\n *\n * const findAllPosts = (ids:number[]) => pipe(ids, TE.traverseArray(PostRepo.findById))\n *\n * async function test() {\n * const ids = A.range(0, 10)\n *\n * assert.deepStrictEqual(\n * await findAllPosts(ids)(),\n * right(\n * pipe(\n * ids,\n * A.map((id) => ({ id, title: ''}))\n * )\n * )\n * )\n * }\n *\n * test()\n *\n * @since 2.9.0\n */\n\nvar traverseArray = function traverseArray(f) {\n return exports.traverseArrayWithIndex(function (_, a) {\n return f(a);\n });\n};\n\nexports.traverseArray = traverseArray;\n/**\n * this function has the same behavior of `A.sequence(TE.taskEither)` but it's stack safe and performs better\n *\n * *this function run all tasks in parallel and does not bail out, for sequential version use `sequenceSeqArray`*\n *\n * @example\n *\n * import * as TE from 'fp-ts/TaskEither'\n * import * as A from 'fp-ts/Array'\n * import { right } from 'fp-ts/Either'\n * import { pipe } from 'fp-ts/function'\n *\n * const PostRepo = {\n * findById : (id: number) => TE.of({id, title: ''})\n * }\n *\n * const findAllPosts = (ids:number[]) => pipe(ids, A.map(PostRepo.findById), TE.sequenceArray)\n *\n * async function test() {\n * const ids = A.range(0, 10)\n *\n * assert.deepStrictEqual(\n * await findAllPosts(ids)(),\n * right(\n * pipe(\n * ids,\n * A.map((id) => ({ id, title: ''}))\n * )\n * )\n * )\n * }\n *\n * test()\n *\n * @since 2.9.0\n */\n\nexports.sequenceArray = /*#__PURE__*/exports.traverseArray(function_1.identity);\n/**\n * @since 2.9.0\n */\n\nvar traverseSeqArrayWithIndex = function traverseSeqArrayWithIndex(f) {\n return function (arr) {\n return function () {\n return __awaiter(void 0, void 0, void 0, function () {\n var result, i, e;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n result = [];\n i = 0;\n _a.label = 1;\n\n case 1:\n if (!(i < arr.length)) return [3\n /*break*/\n , 4];\n return [4\n /*yield*/\n , f(i, arr[i])()];\n\n case 2:\n e = _a.sent();\n\n if (E.isLeft(e)) {\n return [2\n /*return*/\n , e];\n }\n\n result.push(e.right);\n _a.label = 3;\n\n case 3:\n i++;\n return [3\n /*break*/\n , 1];\n\n case 4:\n return [2\n /*return*/\n , E.right(result)];\n }\n });\n });\n };\n };\n};\n\nexports.traverseSeqArrayWithIndex = traverseSeqArrayWithIndex;\n/**\n * this function has the same behavior of `A.traverse(TE.taskEitherSeq)` but it's stack safe and performs better\n *\n * *this function run all tasks in sequential order and bails out on left side of either, for parallel version use `traverseArray`*\n *\n * @since 2.9.0\n */\n\nvar traverseSeqArray = function traverseSeqArray(f) {\n return exports.traverseSeqArrayWithIndex(function (_, a) {\n return f(a);\n });\n};\n\nexports.traverseSeqArray = traverseSeqArray;\n/**\n * this function has the same behavior of `A.sequence(TE.taskEitherSeq)` but it's stack safe and performs better\n *\n * *this function run all tasks in sequential order and bails out on left side of either, for parallel version use `sequenceArray`*\n *\n * @since 2.9.0\n */\n\nexports.sequenceSeqArray = /*#__PURE__*/exports.traverseSeqArray(function_1.identity);","/**\n * Implement Gatsby's Browser APIs in this file.\n *\n * See: https://www.gatsbyjs.org/docs/browser-apis/\n */\nimport * as React from \"react\"\nimport \"./src/css/style.css\"\nimport { PreviewStoreProvider } from \"gatsby-source-prismic\"\n\nexport const wrapRootElement = ({ element }) => (\n {element}\n)\n","module.exports = function (it) {\n if (typeof it != 'function') {\n throw TypeError(String(it) + ' is not a function');\n } return it;\n};\n","// `RequireObjectCoercible` abstract operation\n// https://tc39.es/ecma262/#sec-requireobjectcoercible\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n","var global = require('../internals/global');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar redefine = require('../internals/redefine');\nvar setGlobal = require('../internals/set-global');\nvar copyConstructorProperties = require('../internals/copy-constructor-properties');\nvar isForced = require('../internals/is-forced');\n\n/*\n options.target - name of the target object\n options.global - target is the global object\n options.stat - export as static methods of target\n options.proto - export as prototype methods of target\n options.real - real prototype method for the `pure` version\n options.forced - export even if the native feature is available\n options.bind - bind methods to the target, required for the `pure` version\n options.wrap - wrap constructors to preventing global pollution, required for the `pure` version\n options.unsafe - use the simple assignment of property instead of delete + defineProperty\n options.sham - add a flag to not completely full polyfills\n options.enumerable - export as enumerable property\n options.noTargetGet - prevent calling a getter on target\n*/\nmodule.exports = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var FORCED, target, key, targetProperty, sourceProperty, descriptor;\n if (GLOBAL) {\n target = global;\n } else if (STATIC) {\n target = global[TARGET] || setGlobal(TARGET, {});\n } else {\n target = (global[TARGET] || {}).prototype;\n }\n if (target) for (key in source) {\n sourceProperty = source[key];\n if (options.noTargetGet) {\n descriptor = getOwnPropertyDescriptor(target, key);\n targetProperty = descriptor && descriptor.value;\n } else targetProperty = target[key];\n FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n // contained in target\n if (!FORCED && targetProperty !== undefined) {\n if (typeof sourceProperty === typeof targetProperty) continue;\n copyConstructorProperties(sourceProperty, targetProperty);\n }\n // add a flag to not completely full polyfills\n if (options.sham || (targetProperty && targetProperty.sham)) {\n createNonEnumerableProperty(sourceProperty, 'sham', true);\n }\n // extend global\n redefine(target, key, sourceProperty, options);\n }\n};\n","var toInteger = require('../internals/to-integer');\n\nvar max = Math.max;\nvar min = Math.min;\n\n// Helper for a popular repeating case of the spec:\n// Let integer be ? ToInteger(index).\n// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).\nmodule.exports = function (index, length) {\n var integer = toInteger(index);\n return integer < 0 ? max(integer + length, 0) : min(integer, length);\n};\n","import React, { createElement } from \"react\"\nimport PropTypes from \"prop-types\"\nimport { publicLoader } from \"./loader\"\nimport { apiRunner } from \"./api-runner-browser\"\nimport { grabMatchParams } from \"./find-path\"\n\n// Renders page\nclass PageRenderer extends React.Component {\n render() {\n const props = {\n ...this.props,\n params: {\n ...grabMatchParams(this.props.location.pathname),\n ...this.props.pageResources.json.pageContext.__params,\n },\n pathContext: this.props.pageContext,\n }\n\n const [replacementElement] = apiRunner(`replaceComponentRenderer`, {\n props: this.props,\n loader: publicLoader,\n })\n\n const pageElement =\n replacementElement ||\n createElement(this.props.pageResources.component, {\n ...props,\n key: this.props.path || this.props.pageResources.page.path,\n })\n\n const wrappedPage = apiRunner(\n `wrapPageElement`,\n { element: pageElement, props },\n pageElement,\n ({ result }) => {\n return { element: result, props }\n }\n ).pop()\n\n return wrappedPage\n }\n}\n\nPageRenderer.propTypes = {\n location: PropTypes.object.isRequired,\n pageResources: PropTypes.object.isRequired,\n data: PropTypes.object,\n pageContext: PropTypes.object.isRequired,\n}\n\nexport default PageRenderer\n","var internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\nvar hiddenKeys = enumBugKeys.concat('length', 'prototype');\n\n// `Object.getOwnPropertyNames` method\n// https://tc39.es/ecma262/#sec-object.getownpropertynames\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return internalObjectKeys(O, hiddenKeys);\n};\n","import arrayWithoutHoles from \"@babel/runtime/helpers/esm/arrayWithoutHoles\";\nimport iterableToArray from \"@babel/runtime/helpers/esm/iterableToArray\";\nimport unsupportedIterableToArray from \"@babel/runtime/helpers/esm/unsupportedIterableToArray\";\nimport nonIterableSpread from \"@babel/runtime/helpers/esm/nonIterableSpread\";\nexport default function _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}","import arrayLikeToArray from \"@babel/runtime/helpers/esm/arrayLikeToArray\";\nexport default function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}","export default function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.invert = exports.monoidOrdering = exports.semigroupOrdering = exports.eqOrdering = exports.sign = void 0;\n/**\n * @since 2.0.0\n */\n\nfunction sign(n) {\n return n <= -1 ? -1 : n >= 1 ? 1 : 0;\n}\n\nexports.sign = sign;\n/**\n * @category instances\n * @since 2.0.0\n */\n\nexports.eqOrdering = {\n equals: function equals(x, y) {\n return x === y;\n }\n};\n/**\n * Use `monoidOrdering` instead\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\n\nexports.semigroupOrdering = {\n concat: function concat(x, y) {\n return x !== 0 ? x : y;\n }\n};\n/**\n * @category instances\n * @since 2.4.0\n */\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 */\n\nfunction invert(O) {\n switch (O) {\n case -1:\n return 1;\n\n case 1:\n return -1;\n\n default:\n return 0;\n }\n}\n\nexports.invert = invert;","var global = require('../internals/global');\nvar userAgent = require('../internals/engine-user-agent');\n\nvar process = global.process;\nvar versions = process && process.versions;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n version = match[0] + match[1];\n} else if (userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match) version = match[1];\n }\n}\n\nmodule.exports = version && +version;\n","import invariant from \"invariant\";\n\n////////////////////////////////////////////////////////////////////////////////\n// startsWith(string, search) - Check if `string` starts with `search`\nvar startsWith = function startsWith(string, search) {\n return string.substr(0, search.length) === search;\n};\n\n////////////////////////////////////////////////////////////////////////////////\n// pick(routes, uri)\n//\n// Ranks and picks the best route to match. Each segment gets the highest\n// amount of points, then the type of segment gets an additional amount of\n// points where\n//\n// static > dynamic > splat > root\n//\n// This way we don't have to worry about the order of our routes, let the\n// computers do it.\n//\n// A route looks like this\n//\n// { path, default, value }\n//\n// And a returned match looks like:\n//\n// { route, params, uri }\n//\n// I know, I should use TypeScript not comments for these types.\nvar pick = function pick(routes, uri) {\n var match = void 0;\n var default_ = void 0;\n\n var _uri$split = uri.split(\"?\"),\n uriPathname = _uri$split[0];\n\n var uriSegments = segmentize(uriPathname);\n var isRootUri = uriSegments[0] === \"\";\n var ranked = rankRoutes(routes);\n\n for (var i = 0, l = ranked.length; i < l; i++) {\n var missed = false;\n var route = ranked[i].route;\n\n if (route.default) {\n default_ = {\n route: route,\n params: {},\n uri: uri\n };\n continue;\n }\n\n var routeSegments = segmentize(route.path);\n var params = {};\n var max = Math.max(uriSegments.length, routeSegments.length);\n var index = 0;\n\n for (; index < max; index++) {\n var routeSegment = routeSegments[index];\n var uriSegment = uriSegments[index];\n\n if (isSplat(routeSegment)) {\n // Hit a splat, just grab the rest, and return a match\n // uri: /files/documents/work\n // route: /files/*\n var param = routeSegment.slice(1) || \"*\";\n params[param] = uriSegments.slice(index).map(decodeURIComponent).join(\"/\");\n break;\n }\n\n if (uriSegment === undefined) {\n // URI is shorter than the route, no match\n // uri: /users\n // route: /users/:userId\n missed = true;\n break;\n }\n\n var dynamicMatch = paramRe.exec(routeSegment);\n\n if (dynamicMatch && !isRootUri) {\n var matchIsNotReserved = reservedNames.indexOf(dynamicMatch[1]) === -1;\n !matchIsNotReserved ? process.env.NODE_ENV !== \"production\" ? invariant(false, \" dynamic segment \\\"\" + dynamicMatch[1] + \"\\\" is a reserved name. Please use a different name in path \\\"\" + route.path + \"\\\".\") : invariant(false) : void 0;\n var value = decodeURIComponent(uriSegment);\n params[dynamicMatch[1]] = value;\n } else if (routeSegment !== uriSegment) {\n // Current segments don't match, not dynamic, not splat, so no match\n // uri: /users/123/settings\n // route: /users/:id/profile\n missed = true;\n break;\n }\n }\n\n if (!missed) {\n match = {\n route: route,\n params: params,\n uri: \"/\" + uriSegments.slice(0, index).join(\"/\")\n };\n break;\n }\n }\n\n return match || default_ || null;\n};\n\n////////////////////////////////////////////////////////////////////////////////\n// match(path, uri) - Matches just one path to a uri, also lol\nvar match = function match(path, uri) {\n return pick([{ path: path }], uri);\n};\n\n////////////////////////////////////////////////////////////////////////////////\n// resolve(to, basepath)\n//\n// Resolves URIs as though every path is a directory, no files. Relative URIs\n// in the browser can feel awkward because not only can you be \"in a directory\"\n// you can be \"at a file\", too. For example\n//\n// browserSpecResolve('foo', '/bar/') => /bar/foo\n// browserSpecResolve('foo', '/bar') => /foo\n//\n// But on the command line of a file system, it's not as complicated, you can't\n// `cd` from a file, only directories. This way, links have to know less about\n// their current path. To go deeper you can do this:\n//\n// \n// // instead of\n// \n//\n// Just like `cd`, if you want to go deeper from the command line, you do this:\n//\n// cd deeper\n// # not\n// cd $(pwd)/deeper\n//\n// By treating every path as a directory, linking to relative paths should\n// require less contextual information and (fingers crossed) be more intuitive.\nvar resolve = function resolve(to, base) {\n // /foo/bar, /baz/qux => /foo/bar\n if (startsWith(to, \"/\")) {\n return to;\n }\n\n var _to$split = to.split(\"?\"),\n toPathname = _to$split[0],\n toQuery = _to$split[1];\n\n var _base$split = base.split(\"?\"),\n basePathname = _base$split[0];\n\n var toSegments = segmentize(toPathname);\n var baseSegments = segmentize(basePathname);\n\n // ?a=b, /users?b=c => /users?a=b\n if (toSegments[0] === \"\") {\n return addQuery(basePathname, toQuery);\n }\n\n // profile, /users/789 => /users/789/profile\n if (!startsWith(toSegments[0], \".\")) {\n var pathname = baseSegments.concat(toSegments).join(\"/\");\n return addQuery((basePathname === \"/\" ? \"\" : \"/\") + pathname, toQuery);\n }\n\n // ./ /users/123 => /users/123\n // ../ /users/123 => /users\n // ../.. /users/123 => /\n // ../../one /a/b/c/d => /a/b/one\n // .././one /a/b/c/d => /a/b/c/one\n var allSegments = baseSegments.concat(toSegments);\n var segments = [];\n for (var i = 0, l = allSegments.length; i < l; i++) {\n var segment = allSegments[i];\n if (segment === \"..\") segments.pop();else if (segment !== \".\") segments.push(segment);\n }\n\n return addQuery(\"/\" + segments.join(\"/\"), toQuery);\n};\n\n////////////////////////////////////////////////////////////////////////////////\n// insertParams(path, params)\n\nvar insertParams = function insertParams(path, params) {\n var _path$split = path.split(\"?\"),\n pathBase = _path$split[0],\n _path$split$ = _path$split[1],\n query = _path$split$ === undefined ? \"\" : _path$split$;\n\n var segments = segmentize(pathBase);\n var constructedPath = \"/\" + segments.map(function (segment) {\n var match = paramRe.exec(segment);\n return match ? params[match[1]] : segment;\n }).join(\"/\");\n var _params$location = params.location;\n _params$location = _params$location === undefined ? {} : _params$location;\n var _params$location$sear = _params$location.search,\n search = _params$location$sear === undefined ? \"\" : _params$location$sear;\n\n var searchSplit = search.split(\"?\")[1] || \"\";\n constructedPath = addQuery(constructedPath, query, searchSplit);\n return constructedPath;\n};\n\nvar validateRedirect = function validateRedirect(from, to) {\n var filter = function filter(segment) {\n return isDynamic(segment);\n };\n var fromString = segmentize(from).filter(filter).sort().join(\"/\");\n var toString = segmentize(to).filter(filter).sort().join(\"/\");\n return fromString === toString;\n};\n\n////////////////////////////////////////////////////////////////////////////////\n// Junk\nvar paramRe = /^:(.+)/;\n\nvar SEGMENT_POINTS = 4;\nvar STATIC_POINTS = 3;\nvar DYNAMIC_POINTS = 2;\nvar SPLAT_PENALTY = 1;\nvar ROOT_POINTS = 1;\n\nvar isRootSegment = function isRootSegment(segment) {\n return segment === \"\";\n};\nvar isDynamic = function isDynamic(segment) {\n return paramRe.test(segment);\n};\nvar isSplat = function isSplat(segment) {\n return segment && segment[0] === \"*\";\n};\n\nvar rankRoute = function rankRoute(route, index) {\n var score = route.default ? 0 : segmentize(route.path).reduce(function (score, segment) {\n score += SEGMENT_POINTS;\n if (isRootSegment(segment)) score += ROOT_POINTS;else if (isDynamic(segment)) score += DYNAMIC_POINTS;else if (isSplat(segment)) score -= SEGMENT_POINTS + SPLAT_PENALTY;else score += STATIC_POINTS;\n return score;\n }, 0);\n return { route: route, score: score, index: index };\n};\n\nvar rankRoutes = function rankRoutes(routes) {\n return routes.map(rankRoute).sort(function (a, b) {\n return a.score < b.score ? 1 : a.score > b.score ? -1 : a.index - b.index;\n });\n};\n\nvar segmentize = function segmentize(uri) {\n return uri\n // strip starting/ending slashes\n .replace(/(^\\/+|\\/+$)/g, \"\").split(\"/\");\n};\n\nvar addQuery = function addQuery(pathname) {\n for (var _len = arguments.length, query = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n query[_key - 1] = arguments[_key];\n }\n\n query = query.filter(function (q) {\n return q && q.length > 0;\n });\n return pathname + (query && query.length > 0 ? \"?\" + query.join(\"&\") : \"\");\n};\n\nvar reservedNames = [\"uri\", \"path\"];\n\n/**\n * Shallow compares two objects.\n * @param {Object} obj1 The first object to compare.\n * @param {Object} obj2 The second object to compare.\n */\nvar shallowCompare = function shallowCompare(obj1, obj2) {\n var obj1Keys = Object.keys(obj1);\n return obj1Keys.length === Object.keys(obj2).length && obj1Keys.every(function (key) {\n return obj2.hasOwnProperty(key) && obj1[key] === obj2[key];\n });\n};\n\n////////////////////////////////////////////////////////////////////////////////\nexport { startsWith, pick, match, resolve, insertParams, validateRedirect, shallowCompare };","module.exports = [{\n plugin: require('../node_modules/gatsby-plugin-google-gtag/gatsby-browser.js'),\n options: {\"plugins\":[],\"trackingIds\":[\"G-VP5EHVHPJ0\"]},\n },{\n plugin: require('../node_modules/gatsby-plugin-manifest/gatsby-browser.js'),\n options: {\"plugins\":[],\"name\":\"Pinsel\",\"short_name\":\"Pinsel\",\"start_url\":\"/\",\"background_color\":\"#222222\",\"theme_color\":\"#ffffff\",\"display\":\"minimal-ui\",\"icon\":\"src/images/icon.png\",\"legacy\":true,\"theme_color_in_head\":true,\"cache_busting_mode\":\"query\",\"crossOrigin\":\"anonymous\",\"include_favicon\":true,\"cacheDigest\":\"d429d8d9cf810ca899779a02ea4ecc1c\"},\n },{\n plugin: require('../node_modules/gatsby-source-prismic/gatsby-browser.js'),\n options: {\"plugins\":[],\"repositoryName\":\"yuko-web\",\"accessToken\":\"MC5Yd3NLbEJBQUFDQUFCLUw1.77-977-977-977-9KXPvv73vv70Pe--_ve-_vU9n77-977-977-977-977-9Ye-_ve-_ve-_ve-_vRnvv70aQmMfRu-_vQ\",\"fetchLinks\":[],\"schemas\":{\"global\":{\"Main\":{\"site_name\":{\"type\":\"StructuredText\",\"config\":{\"single\":\"heading1, heading2, heading3, heading4, heading5, heading6\",\"label\":\"サイト名\",\"placeholder\":\"サイト名\"}},\"site_name_sub\":{\"type\":\"StructuredText\",\"config\":{\"single\":\"heading2\",\"label\":\"サイト名副題\",\"placeholder\":\"サイト名副題\"}},\"description\":{\"type\":\"StructuredText\",\"config\":{\"single\":\"heading2\",\"label\":\"サイト概要\",\"placeholder\":\"サイト概要\"}},\"author\":{\"type\":\"StructuredText\",\"config\":{\"single\":\"heading2\",\"label\":\"サイト管理者\",\"placeholder\":\"サイト管理者\"}},\"copyright\":{\"type\":\"StructuredText\",\"config\":{\"single\":\"heading2\",\"label\":\"コピーライト\",\"placeholder\":\"フッタコピーライト\"}}}},\"top-page\":{\"Main\":{\"profile_img\":{\"type\":\"Image\",\"config\":{\"constraint\":{},\"thumbnails\":[],\"label\":\"プロフィール画像\"}},\"intro_text_heading\":{\"type\":\"StructuredText\",\"config\":{\"single\":\"heading1\",\"label\":\"イントロ紹介文: 見出し\",\"placeholder\":\"イントロ紹介文: 見出し\"}},\"intro_text_body\":{\"type\":\"StructuredText\",\"config\":{\"single\":\"paragraph\",\"label\":\"イントロ紹介文: テキスト\",\"placeholder\":\"イントロ紹介文: テキスト\"}},\"intro_side_big_img\":{\"type\":\"Image\",\"config\":{\"constraint\":{},\"thumbnails\":[],\"label\":\"イントロ紹介文横大画像\"}},\"online_lesson_heading\":{\"type\":\"StructuredText\",\"config\":{\"single\":\"heading1\",\"label\":\"オンラインレッスン: 見出し\",\"placeholder\":\"オンラインレッスン: 見出し\"}},\"online_lesson_text\":{\"type\":\"StructuredText\",\"config\":{\"single\":\"paragraph\",\"label\":\"オンラインレッスン: テキスト\",\"placeholder\":\"オンラインレッスン: テキスト\"}},\"online_lesson_img\":{\"type\":\"Image\",\"config\":{\"constraint\":{},\"thumbnails\":[],\"label\":\"オンラインレッスン: 画像\"}},\"other_service_heading\":{\"type\":\"StructuredText\",\"config\":{\"single\":\"heading1\",\"label\":\"その他のサービス: 見出し\",\"placeholder\":\"その他のサービス: 見出し\"}},\"other_service_text\":{\"type\":\"StructuredText\",\"config\":{\"single\":\"paragraph\",\"label\":\"その他のサービス: テキスト\",\"placeholder\":\"その他のサービス: テキスト\"}},\"other_service_img\":{\"type\":\"Image\",\"config\":{\"constraint\":{},\"thumbnails\":[],\"label\":\"その他のサービス: 画像\"}},\"testimonials_heading\":{\"type\":\"StructuredText\",\"config\":{\"single\":\"heading1\",\"label\":\"推薦セクション: 見出し\",\"placeholder\":\"推薦セクション: 見出し\"}},\"testimonials_text\":{\"type\":\"StructuredText\",\"config\":{\"single\":\"paragraph\",\"label\":\"推薦セクション: テキスト\",\"placeholder\":\"推薦セクション: テキスト\"}},\"testimonials_comments\":{\"type\":\"Group\",\"config\":{\"fields\":{\"image\":{\"type\":\"Image\",\"config\":{\"constraint\":{},\"thumbnails\":[],\"label\":\"写真\"}},\"text\":{\"type\":\"StructuredText\",\"config\":{\"single\":\"paragraph\",\"label\":\"コメント\",\"placeholder\":\"コメント\"}}},\"label\":\"推薦コメント\"}}}},\"online-lesson\":{\"Main\":{\"uid\":{\"type\":\"UID\",\"config\":{\"label\":\"slug\",\"placeholder\":\"slug\"}},\"order\":{\"type\":\"Number\",\"config\":{\"label\":\"記事順序\",\"placeholder\":\"記事順序\"}},\"title\":{\"type\":\"StructuredText\",\"config\":{\"single\":\"heading1, heading2, heading3, heading4, heading5, heading6\",\"label\":\"タイトル\",\"placeholder\":\"タイトル\"}},\"body\":{\"type\":\"Slices\",\"fieldset\":\"Slice zone\",\"config\":{\"labels\":{\"contents\":[]},\"choices\":{\"contents\":{\"type\":\"Slice\",\"fieldset\":\"section_block\",\"description\":\"見出しブロック\",\"icon\":\"assignment\",\"display\":\"list\",\"non-repeat\":{\"heading\":{\"type\":\"StructuredText\",\"config\":{\"single\":\"heading2\",\"label\":\"見出し\",\"placeholder\":\"見出し\"}},\"section_img\":{\"type\":\"Image\",\"config\":{\"constraint\":{},\"thumbnails\":[],\"label\":\"画像\"}},\"text\":{\"type\":\"StructuredText\",\"config\":{\"multi\":\"paragraph, preformatted, heading1, heading2, heading3, heading4, heading5, heading6, strong, em, hyperlink, image, embed, list-item, o-list-item, rtl\",\"label\":\"内容\",\"placeholder\":\"内容\"}}},\"repeat\":{}}}}}}},\"other-page\":{\"Main\":{\"uid\":{\"type\":\"UID\",\"config\":{\"label\":\"slug\",\"placeholder\":\"slug\"}},\"title\":{\"type\":\"StructuredText\",\"config\":{\"single\":\"heading1, heading2, heading3, heading4, heading5, heading6\",\"label\":\"タイトル\",\"placeholder\":\"タイトル\"}},\"body\":{\"type\":\"Slices\",\"fieldset\":\"Slice zone\",\"config\":{\"labels\":{\"section-block\":[]},\"choices\":{\"section-block\":{\"type\":\"Slice\",\"fieldset\":\"section_block\",\"description\":\"セクションブロック\",\"icon\":\"assignment\",\"display\":\"list\",\"non-repeat\":{\"heading\":{\"type\":\"StructuredText\",\"config\":{\"single\":\"heading1, heading2, heading3, heading4, heading5, heading6\",\"label\":\"見出し\",\"placeholder\":\"見出し\"}},\"section_img\":{\"type\":\"Image\",\"config\":{\"constraint\":{},\"thumbnails\":[],\"label\":\"画像\"}},\"text\":{\"type\":\"StructuredText\",\"config\":{\"multi\":\"paragraph, preformatted, heading1, heading2, heading3, heading4, heading5, heading6, strong, em, hyperlink, image, embed, list-item, o-list-item, rtl\",\"label\":\"内容\",\"placeholder\":\"内容\"}}},\"repeat\":{}}}}}}},\"other-support\":{\"Main\":{\"uid\":{\"type\":\"UID\",\"config\":{\"label\":\"slug\",\"placeholder\":\"slug\"}},\"order\":{\"type\":\"Number\",\"config\":{\"label\":\"記事順序\",\"placeholder\":\"記事順序\"}},\"title\":{\"type\":\"StructuredText\",\"config\":{\"single\":\"heading1, heading2, heading3, heading4, heading5, heading6\",\"label\":\"タイトル\",\"placeholder\":\"タイトル\"}},\"body\":{\"type\":\"Slices\",\"fieldset\":\"Slice zone\",\"config\":{\"labels\":{\"contents\":[]},\"choices\":{\"contents\":{\"type\":\"Slice\",\"fieldset\":\"section_block\",\"description\":\"見出しブロック\",\"icon\":\"assignment\",\"display\":\"list\",\"non-repeat\":{\"heading\":{\"type\":\"StructuredText\",\"config\":{\"single\":\"heading2\",\"label\":\"見出し\",\"placeholder\":\"見出し\"}},\"section_img\":{\"type\":\"Image\",\"config\":{\"constraint\":{},\"thumbnails\":[],\"label\":\"画像\"}},\"text\":{\"type\":\"StructuredText\",\"config\":{\"multi\":\"paragraph, preformatted, heading1, heading2, heading3, heading4, heading5, heading6, strong, em, hyperlink, image, embed, list-item, o-list-item, rtl\",\"label\":\"内容\",\"placeholder\":\"内容\"}}},\"repeat\":{}}}}}}}},\"lang\":\"*\",\"prismicToolbar\":true,\"imageImgixParams\":{\"auto\":\"compress,format\",\"fit\":\"max\",\"q\":50},\"imagePlaceholderImgixParams\":{\"w\":100,\"blur\":15,\"q\":50},\"typePathsFilenamePrefix\":\"prismic-typepaths---gatsby-source-prismic-yuko-site\"},\n },{\n plugin: require('../gatsby-browser.js'),\n options: {\"plugins\":[]},\n }]\n","/*!\n * domready (c) Dustin Diaz 2014 - License MIT\n * ie10 fix - Mikael Kristiansson 2019\n */\n!(function(name, definition) {\n if (typeof module != \"undefined\") module.exports = definition();\n else if (typeof define == \"function\" && typeof define.amd == \"object\")\n define(definition);\n else this[name] = definition();\n})(\"domready\", function() {\n var ie10 = false;\n if (navigator.appVersion.indexOf(\"MSIE 10\") !== -1) {\n ie10 = true;\n }\n\n var fns = [],\n listener,\n doc = typeof document === \"object\" && document,\n hack = ie10\n ? doc.documentElement.doScroll(\"left\")\n : doc.documentElement.doScroll,\n domContentLoaded = \"DOMContentLoaded\",\n loaded =\n doc && (hack ? /^loaded|^c/ : /^loaded|^i|^c/).test(doc.readyState);\n\n if (!loaded && doc)\n doc.addEventListener(\n domContentLoaded,\n (listener = function() {\n doc.removeEventListener(domContentLoaded, listener);\n loaded = 1;\n while ((listener = fns.shift())) listener();\n })\n );\n\n return function(fn) {\n loaded ? setTimeout(fn, 0) : fns.push(fn);\n };\n});\n","var getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('navigator', 'userAgent') || '';\n","import { apiRunner } from \"./api-runner-browser\"\n\nif (\n window.location.protocol !== `https:` &&\n window.location.hostname !== `localhost`\n) {\n console.error(\n `Service workers can only be used over HTTPS, or on localhost for development`\n )\n} else if (`serviceWorker` in navigator) {\n navigator.serviceWorker\n .register(`${__BASE_PATH__}/sw.js`)\n .then(function (reg) {\n reg.addEventListener(`updatefound`, () => {\n apiRunner(`onServiceWorkerUpdateFound`, { serviceWorker: reg })\n // The updatefound event implies that reg.installing is set; see\n // https://w3c.github.io/ServiceWorker/#service-worker-registration-updatefound-event\n const installingWorker = reg.installing\n console.log(`installingWorker`, installingWorker)\n installingWorker.addEventListener(`statechange`, () => {\n switch (installingWorker.state) {\n case `installed`:\n if (navigator.serviceWorker.controller) {\n // At this point, the old content will have been purged and the fresh content will\n // have been added to the cache.\n\n // We set a flag so Gatsby Link knows to refresh the page on next navigation attempt\n window.___swUpdated = true\n // We call the onServiceWorkerUpdateReady API so users can show update prompts.\n apiRunner(`onServiceWorkerUpdateReady`, { serviceWorker: reg })\n\n // If resources failed for the current page, reload.\n if (window.___failedResources) {\n console.log(`resources failed, SW updated - reloading`)\n window.location.reload()\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a \"Content is cached for offline use.\" message.\n console.log(`Content is now available offline!`)\n\n // Post to service worker that install is complete.\n // Delay to allow time for the event listener to be added --\n // otherwise fetch is called too soon and resources aren't cached.\n apiRunner(`onServiceWorkerInstalled`, { serviceWorker: reg })\n }\n break\n\n case `redundant`:\n console.error(`The installing service worker became redundant.`)\n apiRunner(`onServiceWorkerRedundant`, { serviceWorker: reg })\n break\n\n case `activated`:\n apiRunner(`onServiceWorkerActive`, { serviceWorker: reg })\n break\n }\n })\n })\n })\n .catch(function (e) {\n console.error(`Error during service worker registration:`, e)\n })\n}\n","// prefer default export if available\nconst preferDefault = m => (m && m.default) || m\n\nexports.components = {\n \"component---src-pages-404-js\": () => import(\"./../../../src/pages/404.js\" /* webpackChunkName: \"component---src-pages-404-js\" */),\n \"component---src-pages-components-js\": () => import(\"./../../../src/pages/-components.js\" /* webpackChunkName: \"component---src-pages-components-js\" */),\n \"component---src-pages-index-js\": () => import(\"./../../../src/pages/index.js\" /* webpackChunkName: \"component---src-pages-index-js\" */),\n \"component---src-pages-payments-js\": () => import(\"./../../../src/pages/payments.js\" /* webpackChunkName: \"component---src-pages-payments-js\" */),\n \"component---src-pages-preview-js\": () => import(\"./../../../src/pages/preview.js\" /* webpackChunkName: \"component---src-pages-preview-js\" */),\n \"component---src-pages-tmpl-article-js\": () => import(\"./../../../src/pages/-tmpl-article.js\" /* webpackChunkName: \"component---src-pages-tmpl-article-js\" */),\n \"component---src-pages-tmpl-top-js\": () => import(\"./../../../src/pages/-tmpl-top.js\" /* webpackChunkName: \"component---src-pages-tmpl-top-js\" */),\n \"component---src-templates-online-lesson-js\": () => import(\"./../../../src/templates/online-lesson.js\" /* webpackChunkName: \"component---src-templates-online-lesson-js\" */),\n \"component---src-templates-other-page-js\": () => import(\"./../../../src/templates/other-page.js\" /* webpackChunkName: \"component---src-templates-other-page-js\" */),\n \"component---src-templates-other-support-js\": () => import(\"./../../../src/templates/other-support.js\" /* webpackChunkName: \"component---src-templates-other-support-js\" */)\n}\n\n","require(\"core-js/modules/es.array.reduce.js\");\n\n!function (e, t) {\n \"object\" == typeof exports && \"object\" == typeof module ? module.exports = t() : \"function\" == typeof define && define.amd ? define(\"PrismicDOM\", [], t) : \"object\" == typeof exports ? exports.PrismicDOM = t() : e.PrismicDOM = t();\n}(\"undefined\" != typeof self ? self : this, function () {\n return function (e) {\n var t = {};\n\n function n(r) {\n if (t[r]) return t[r].exports;\n var o = t[r] = {\n i: r,\n l: !1,\n exports: {}\n };\n return e[r].call(o.exports, o, o.exports, n), o.l = !0, o.exports;\n }\n\n return n.m = e, n.c = t, n.d = function (e, t, r) {\n n.o(e, t) || Object.defineProperty(e, t, {\n enumerable: !0,\n get: r\n });\n }, n.r = function (e) {\n \"undefined\" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {\n value: \"Module\"\n }), Object.defineProperty(e, \"__esModule\", {\n value: !0\n });\n }, n.t = function (e, t) {\n if (1 & t && (e = n(e)), 8 & t) return e;\n if (4 & t && \"object\" == typeof e && e && e.__esModule) return e;\n var r = Object.create(null);\n if (n.r(r), Object.defineProperty(r, \"default\", {\n enumerable: !0,\n value: e\n }), 2 & t && \"string\" != typeof e) for (var o in e) {\n n.d(r, o, function (t) {\n return e[t];\n }.bind(null, o));\n }\n return r;\n }, n.n = function (e) {\n var t = e && e.__esModule ? function () {\n return e.default;\n } : function () {\n return e;\n };\n return n.d(t, \"a\", t), t;\n }, n.o = function (e, t) {\n return Object.prototype.hasOwnProperty.call(e, t);\n }, n.p = \"\", n(n.s = 1);\n }([function (e, t, n) {\n \"undefined\" != typeof self && self, e.exports = function (e) {\n var t = {};\n\n function n(r) {\n if (t[r]) return t[r].exports;\n var o = t[r] = {\n i: r,\n l: !1,\n exports: {}\n };\n return e[r].call(o.exports, o, o.exports, n), o.l = !0, o.exports;\n }\n\n return n.m = e, n.c = t, n.d = function (e, t, r) {\n n.o(e, t) || Object.defineProperty(e, t, {\n enumerable: !0,\n get: r\n });\n }, n.r = function (e) {\n \"undefined\" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {\n value: \"Module\"\n }), Object.defineProperty(e, \"__esModule\", {\n value: !0\n });\n }, n.t = function (e, t) {\n if (1 & t && (e = n(e)), 8 & t) return e;\n if (4 & t && \"object\" == typeof e && e && e.__esModule) return e;\n var r = Object.create(null);\n if (n.r(r), Object.defineProperty(r, \"default\", {\n enumerable: !0,\n value: e\n }), 2 & t && \"string\" != typeof e) for (var o in e) {\n n.d(r, o, function (t) {\n return e[t];\n }.bind(null, o));\n }\n return r;\n }, n.n = function (e) {\n var t = e && e.__esModule ? function () {\n return e.default;\n } : function () {\n return e;\n };\n return n.d(t, \"a\", t), t;\n }, n.o = function (e, t) {\n return Object.prototype.hasOwnProperty.call(e, t);\n }, n.p = \"\", n(n.s = 0);\n }([function (e, t, n) {\n e.exports = n(1);\n }, function (e, t, n) {\n var r = n(2),\n o = n(3);\n e.exports = {\n Link: r,\n Date: o\n };\n }, function (e, t, n) {\n e.exports = {\n url: function url(e, t) {\n var n = e && e.value ? e.value.document : e;\n\n if (e && [e.type, e.link_type, e._linkType, e.linkType].some(function (e) {\n return e && [\"Document\", \"Link.Document\", \"Link.document\"].includes(e);\n }) && t && \"function\" == typeof t) {\n var r = t(n);\n if (r) return r;\n }\n\n return n && n.url ? n.url : \"\";\n }\n };\n }, function (e, t) {\n e.exports = function (e) {\n if (!e) return null;\n var t = 24 == e.length ? \"\".concat(e.substring(0, 22), \":\").concat(e.substring(22, 24)) : e;\n return new Date(t);\n };\n }]);\n }, function (e, t, n) {\n e.exports = n(2);\n }, function (e, t, n) {\n var r = n(0),\n o = n(3),\n i = r.Date,\n u = r.Link;\n e.exports = {\n Date: i,\n Link: u,\n RichText: o\n };\n }, function (e, t, n) {\n var r = n(4),\n o = n(0).Link,\n i = n(5),\n u = r.Elements;\n\n function c(e, t, n, r, c) {\n switch (t) {\n case u.heading1:\n return l(\"h1\", n, c);\n\n case u.heading2:\n return l(\"h2\", n, c);\n\n case u.heading3:\n return l(\"h3\", n, c);\n\n case u.heading4:\n return l(\"h4\", n, c);\n\n case u.heading5:\n return l(\"h5\", n, c);\n\n case u.heading6:\n return l(\"h6\", n, c);\n\n case u.paragraph:\n return l(\"p\", n, c);\n\n case u.preformatted:\n return function (e) {\n return \"\").concat(i(e.text), \"
\");\n }(n);\n\n case u.strong:\n return l(\"strong\", n, c);\n\n case u.em:\n return l(\"em\", n, c);\n\n case u.listItem:\n case u.oListItem:\n return l(\"li\", n, c);\n\n case u.list:\n return l(\"ul\", n, c);\n\n case u.oList:\n return l(\"ol\", n, c);\n\n case u.image:\n return function (e, t) {\n var n = t.linkTo ? o.url(t.linkTo, e) : null,\n r = t.linkTo && t.linkTo.target ? 'target=\"'.concat(t.linkTo.target, '\" rel=\"noopener\"') : \"\",\n i = [t.label || \"\", \"block-img\"],\n u = '
');\n return '\\n \\n ').concat(n ? \"').concat(u, \"\") : u, \"\\n
\\n \");\n }(e, n);\n\n case u.embed:\n return function (e) {\n return '\\n \\n \\n \").concat(e.oembed.html, \"\\n
\\n \");\n }(n);\n\n case u.hyperlink:\n return function (e, t, n) {\n var r = t.data.target ? 'target=\"'.concat(t.data.target, '\" rel=\"noopener\"') : \"\";\n return \"').concat(n.join(\"\"), \"\");\n }(e, n, c);\n\n case u.label:\n return function (e, t) {\n return \"\").concat(t.join(\"\"), \"\");\n }(n, c);\n\n case u.span:\n return function (e) {\n return e ? i(e).replace(/\\n/g, \"
\") : \"\";\n }(r);\n\n default:\n return \"\";\n }\n }\n\n function a(e) {\n return e.label ? ' class=\"'.concat(e.label, '\"') : \"\";\n }\n\n function l(e, t, n) {\n return \"<\".concat(e).concat(a(t), \">\").concat(n.join(\"\"), \"\").concat(e, \">\");\n }\n\n e.exports = {\n asText: function asText(e, t) {\n return r.asText(e, t);\n },\n asHtml: function asHtml(e, t, n) {\n return r.serialize(e, c.bind(null, t), n).join(\"\");\n },\n Elements: u\n };\n }, function (e, t, n) {\n \"undefined\" != typeof self && self, e.exports = function (e) {\n var t = {};\n\n function n(r) {\n if (t[r]) return t[r].exports;\n var o = t[r] = {\n i: r,\n l: !1,\n exports: {}\n };\n return e[r].call(o.exports, o, o.exports, n), o.l = !0, o.exports;\n }\n\n return n.m = e, n.c = t, n.d = function (e, t, r) {\n n.o(e, t) || Object.defineProperty(e, t, {\n enumerable: !0,\n get: r\n });\n }, n.r = function (e) {\n \"undefined\" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {\n value: \"Module\"\n }), Object.defineProperty(e, \"__esModule\", {\n value: !0\n });\n }, n.t = function (e, t) {\n if (1 & t && (e = n(e)), 8 & t) return e;\n if (4 & t && \"object\" == typeof e && e && e.__esModule) return e;\n var r = Object.create(null);\n if (n.r(r), Object.defineProperty(r, \"default\", {\n enumerable: !0,\n value: e\n }), 2 & t && \"string\" != typeof e) for (var o in e) {\n n.d(r, o, function (t) {\n return e[t];\n }.bind(null, o));\n }\n return r;\n }, n.n = function (e) {\n var t = e && e.__esModule ? function () {\n return e.default;\n } : function () {\n return e;\n };\n return n.d(t, \"a\", t), t;\n }, n.o = function (e, t) {\n return Object.prototype.hasOwnProperty.call(e, t);\n }, n.p = \"\", n(n.s = 4);\n }([function (e, t, n) {\n \"use strict\";\n\n var r;\n\n function o(e, t, n) {\n return t in e ? Object.defineProperty(e, t, {\n value: n,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[t] = n, e;\n }\n\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.PRIORITIES = t.NODE_TYPES = void 0;\n var i = {\n heading1: \"heading1\",\n heading2: \"heading2\",\n heading3: \"heading3\",\n heading4: \"heading4\",\n heading5: \"heading5\",\n heading6: \"heading6\",\n paragraph: \"paragraph\",\n preformatted: \"preformatted\",\n strong: \"strong\",\n em: \"em\",\n listItem: \"list-item\",\n oListItem: \"o-list-item\",\n list: \"group-list-item\",\n oList: \"group-o-list-item\",\n image: \"image\",\n embed: \"embed\",\n hyperlink: \"hyperlink\",\n label: \"label\",\n span: \"span\"\n };\n t.NODE_TYPES = i;\n var u = (o(r = {}, i.heading1, 4), o(r, i.heading2, 4), o(r, i.heading3, 4), o(r, i.heading4, 4), o(r, i.heading5, 4), o(r, i.heading6, 4), o(r, i.paragraph, 3), o(r, i.preformatted, 5), o(r, i.strong, 6), o(r, i.em, 6), o(r, i.oList, 1), o(r, i.list, 1), o(r, i.listItem, 1), o(r, i.oListItem, 1), o(r, i.image, 1), o(r, i.embed, 1), o(r, i.hyperlink, 3), o(r, i.label, 4), o(r, i.span, 7), r);\n t.PRIORITIES = u;\n }, function (e, t, n) {\n \"use strict\";\n\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = void 0;\n var r,\n o = n(7),\n i = n(2),\n u = n(8),\n c = n(0),\n a = (r = n(3)) && r.__esModule ? r : {\n default: r\n };\n\n function l(e, t) {\n for (var n = 0; n < t.length; n++) {\n var r = t[n];\n r.enumerable = r.enumerable || !1, r.configurable = !0, \"value\" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);\n }\n }\n\n function s(e) {\n if (0 === e.length) throw new Error(\"Unable to elect node on empty list\");\n\n var t = function (e) {\n return function (e) {\n if (Array.isArray(e)) return e;\n }(e) || function (e) {\n if (Symbol.iterator in Object(e) || \"[object Arguments]\" === Object.prototype.toString.call(e)) return Array.from(e);\n }(e) || function () {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n }();\n }(e.sort(function (e, t) {\n if (e.isParentOf(t)) return -1;\n if (t.isParentOf(e)) return 1;\n var n = c.PRIORITIES[e.type] - c.PRIORITIES[t.type];\n return 0 === n ? e.text.length - t.text.length : n;\n }));\n\n return {\n elected: t[0],\n others: t.slice(1)\n };\n }\n\n function f(e, t, n) {\n if (t.length > 0) return function (e, t, n) {\n return t.reduce(function (r, o, u) {\n var c = [],\n a = 0 === u && o.start > n.lower,\n l = u === t.length - 1 && n.upper > o.end;\n\n if (a) {\n var s = new i.TextNode(n.lower, o.start, e.slice(n.lower, o.start));\n c = c.concat(s);\n } else {\n var f = t[u - 1];\n\n if (f && o.start > f.end) {\n var d = e.slice(f.end, o.start),\n p = new i.TextNode(f.end, o.start, d);\n c = c.concat(p);\n }\n }\n\n if (c = c.concat(o), l) {\n var y = new i.TextNode(o.end, n.upper, e.slice(o.end, n.upper));\n c = c.concat(y);\n }\n\n return r.concat(c);\n }, []);\n }(e, d(e, t), n);\n var r = e.slice(n.lower, n.upper);\n return [new i.TextNode(n.lower, n.upper, r)];\n }\n\n function d(e, t) {\n var n = function (e) {\n return function (e, t) {\n return t.reduce(function (e, t) {\n var n = (0, o.last)(e);\n\n if (n) {\n if (n.some(function (e) {\n return e.isParentOf(t);\n })) return (0, o.init)(e).concat([n.concat(t)]);\n var r = (0, o.last)(n);\n return r && function (e, t) {\n return e.end >= t.start;\n }(r, t) ? (0, o.init)(e).concat([n.concat(t)]) : e.concat([[t]]);\n }\n\n return [[t]];\n }, []);\n }(0, (0, o.sort)(e, function (e, t) {\n return n = t, e.start - n.start || function (e, t) {\n return e.end - t.end;\n }(e, t);\n var n;\n }));\n }((0, o.sort)(t, function (e, t) {\n return e.start - t.start;\n })).map(s),\n r = (0, o.flatten)(n.map(function (t) {\n return function (e, t) {\n var n = t.others.reduce(function (n, r) {\n var o = n.inner,\n u = n.outer,\n c = function (e, t, n) {\n return n.start < t.start ? {\n inner: i.SpanNode.slice(n, t.start, n.end, e),\n outer: i.SpanNode.slice(n, n.start, t.start, e)\n } : n.end > t.end ? {\n inner: i.SpanNode.slice(n, n.start, t.end, e),\n outer: i.SpanNode.slice(n, t.end, n.end, e)\n } : {\n inner: n\n };\n }(e, t.elected, r);\n\n return {\n inner: o.concat(c.inner),\n outer: c.outer ? u.concat(c.outer) : u\n };\n }, {\n inner: [],\n outer: []\n }),\n r = n.inner,\n o = n.outer;\n return [t.elected.setChildren(f(e, r, t.elected.boundaries()))].concat(d(e, o));\n }(e, t);\n }));\n\n return (0, o.sort)(r, function (e, t) {\n return e.start - t.start;\n });\n }\n\n var p = function () {\n function e() {\n !function (e, t) {\n if (!(e instanceof t)) throw new TypeError(\"Cannot call a class as a function\");\n }(this, e);\n }\n\n var t, n;\n return t = e, (n = [{\n key: \"fromRichText\",\n value: function value(e) {\n return {\n key: (0, a.default)(),\n children: e.reduce(function (e, t, n) {\n if (u.RichTextBlock.isEmbedBlock(t.type) || u.RichTextBlock.isImageBlock(t.type)) return e.concat(new i.BlockNode(t.type, t));\n\n var r = function (e) {\n var t = (e.spans || []).map(function (t) {\n var n = e.text.slice(t.start, t.end);\n return new i.SpanNode(t.start, t.end, t.type, n, [], t);\n }),\n n = {\n lower: 0,\n upper: e.text.length\n };\n return f(e.text, t, n);\n }(t),\n c = e[e.length - 1];\n\n if (u.RichTextBlock.isListItem(t.type) && c && c instanceof i.ListBlockNode) {\n var a = new i.ListItemBlockNode(t, r),\n l = c.addChild(a);\n return (0, o.init)(e).concat(l);\n }\n\n if (u.RichTextBlock.isOrderedListItem(t.type) && c && c instanceof i.OrderedListBlockNode) {\n var s = new i.OrderedListItemBlockNode(t, r),\n d = c.addChild(s);\n return (0, o.init)(e).concat(d);\n }\n\n if (u.RichTextBlock.isListItem(t.type)) {\n var p = new i.ListItemBlockNode(t, r),\n y = new i.ListBlockNode(u.RichTextBlock.emptyList(), [p]);\n return e.concat(y);\n }\n\n if (u.RichTextBlock.isOrderedListItem(t.type)) {\n var h = new i.OrderedListItemBlockNode(t, r),\n v = new i.OrderedListBlockNode(u.RichTextBlock.emptyOrderedList(), [h]);\n return e.concat(v);\n }\n\n return e.concat(new i.BlockNode(t.type, t, r));\n }, [])\n };\n }\n }]) && l(t, n), e;\n }();\n\n t.default = p;\n }, function (e, t, n) {\n \"use strict\";\n\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.ListBlockNode = t.OrderedListBlockNode = t.OrderedListItemBlockNode = t.ListItemBlockNode = t.BlockNode = t.TextNode = t.SpanNode = t.Node = void 0;\n var r,\n o = (r = n(3)) && r.__esModule ? r : {\n default: r\n },\n i = n(0);\n\n function u(e) {\n return (u = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (e) {\n return typeof e;\n } : function (e) {\n return e && \"function\" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? \"symbol\" : typeof e;\n })(e);\n }\n\n function c(e, t) {\n for (var n = 0; n < t.length; n++) {\n var r = t[n];\n r.enumerable = r.enumerable || !1, r.configurable = !0, \"value\" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);\n }\n }\n\n function a(e, t, n) {\n return t && c(e.prototype, t), n && c(e, n), e;\n }\n\n function l(e, t) {\n if (\"function\" != typeof t && null !== t) throw new TypeError(\"Super expression must either be null or a function\");\n e.prototype = Object.create(t && t.prototype, {\n constructor: {\n value: e,\n writable: !0,\n configurable: !0\n }\n }), t && function (e, t) {\n (Object.setPrototypeOf || function (e, t) {\n return e.__proto__ = t, e;\n })(e, t);\n }(e, t);\n }\n\n function s(e) {\n return function () {\n var t,\n n = f(e);\n\n if (function () {\n if (\"undefined\" == typeof Reflect || !Reflect.construct) return !1;\n if (Reflect.construct.sham) return !1;\n if (\"function\" == typeof Proxy) return !0;\n\n try {\n return Date.prototype.toString.call(Reflect.construct(Date, [], function () {})), !0;\n } catch (e) {\n return !1;\n }\n }()) {\n var r = f(this).constructor;\n t = Reflect.construct(n, arguments, r);\n } else t = n.apply(this, arguments);\n\n return function (e, t) {\n return !t || \"object\" !== u(t) && \"function\" != typeof t ? function (e) {\n if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return e;\n }(e) : t;\n }(this, t);\n };\n }\n\n function f(e) {\n return (f = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {\n return e.__proto__ || Object.getPrototypeOf(e);\n })(e);\n }\n\n function d(e, t) {\n if (!(e instanceof t)) throw new TypeError(\"Cannot call a class as a function\");\n }\n\n var p = function e(t, n, r) {\n d(this, e), this.key = (0, o.default)(), this.type = t, this.element = n, this.children = r;\n };\n\n t.Node = p;\n\n var y = function (e) {\n l(n, p);\n var t = s(n);\n\n function n(e, r, o, i, u, c) {\n var a;\n return d(this, n), (a = t.call(this, o, c, u)).start = e, a.end = r, a.text = i, a.children = u, a;\n }\n\n return a(n, [{\n key: \"boundaries\",\n value: function value() {\n return {\n lower: this.start,\n upper: this.end\n };\n }\n }, {\n key: \"isParentOf\",\n value: function value(e) {\n return this.start <= e.start && this.end >= e.end;\n }\n }, {\n key: \"setChildren\",\n value: function value(e) {\n return new n(this.start, this.end, this.type, this.text, e, this.element);\n }\n }], [{\n key: \"slice\",\n value: function value(e, t, r, o) {\n return new n(t, r, e.type, o.slice(t, r), e.children, e.element);\n }\n }]), n;\n }();\n\n t.SpanNode = y;\n\n var h = function (e) {\n l(n, y);\n var t = s(n);\n\n function n(e, r, o) {\n d(this, n);\n var u = {\n type: i.NODE_TYPES.span,\n start: e,\n end: r,\n text: o\n };\n return t.call(this, e, r, i.NODE_TYPES.span, o, [], u);\n }\n\n return n;\n }();\n\n t.TextNode = h;\n\n var v = function (e) {\n l(n, p);\n var t = s(n);\n\n function n(e, r) {\n var o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : [];\n return d(this, n), t.call(this, e, r, o);\n }\n\n return n;\n }();\n\n t.BlockNode = v;\n\n var m = function (e) {\n l(n, v);\n var t = s(n);\n\n function n(e, r) {\n return d(this, n), t.call(this, i.NODE_TYPES.listItem, e, r);\n }\n\n return n;\n }();\n\n t.ListItemBlockNode = m;\n\n var b = function (e) {\n l(n, v);\n var t = s(n);\n\n function n(e, r) {\n return d(this, n), t.call(this, i.NODE_TYPES.oListItem, e, r);\n }\n\n return n;\n }();\n\n t.OrderedListItemBlockNode = b;\n\n var g = function (e) {\n l(n, v);\n var t = s(n);\n\n function n(e, r) {\n return d(this, n), t.call(this, i.NODE_TYPES.oList, e, r);\n }\n\n return a(n, [{\n key: \"addChild\",\n value: function value(e) {\n var t = this.children.concat(e);\n return new n(this.element, t);\n }\n }]), n;\n }();\n\n t.OrderedListBlockNode = g;\n\n var x = function (e) {\n l(n, v);\n var t = s(n);\n\n function n(e, r) {\n return d(this, n), t.call(this, i.NODE_TYPES.list, e, r);\n }\n\n return a(n, [{\n key: \"addChild\",\n value: function value(e) {\n var t = this.children.concat(e);\n return new n(this.element, t);\n }\n }]), n;\n }();\n\n t.ListBlockNode = x;\n }, function (e, t, n) {\n \"use strict\";\n\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = function () {\n var e = new Date().getTime();\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (t) {\n var n = (e + 16 * Math.random()) % 16 | 0;\n return e = Math.floor(e / 16), (\"x\" == t ? n : 3 & n | 8).toString(16);\n });\n };\n }, function (e, t, n) {\n e.exports = n(5);\n }, function (e, t, n) {\n \"use strict\";\n\n var r = c(n(6)),\n o = c(n(1)),\n i = c(n(9)),\n u = n(0);\n\n function c(e) {\n return e && e.__esModule ? e : {\n default: e\n };\n }\n\n e.exports = {\n asText: r.default,\n asTree: o.default.fromRichText,\n serialize: i.default,\n Elements: u.NODE_TYPES\n };\n }, function (e, t, n) {\n \"use strict\";\n\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = void 0, t.default = function (e, t) {\n var n = \"string\" == typeof t ? t : \" \";\n return e.map(function (e) {\n return e.text;\n }).join(n);\n };\n }, function (e, t, n) {\n \"use strict\";\n\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.init = function (e) {\n return e.slice(0, -1);\n }, t.last = function (e) {\n return e[e.length - 1];\n }, t.flatten = function (e) {\n var t = [],\n n = !0,\n r = !1,\n o = void 0;\n\n try {\n for (var i, u = e[Symbol.iterator](); !(n = (i = u.next()).done); n = !0) {\n var c = i.value;\n Array.isArray(c) ? t.push.apply(t, c) : t.push(c);\n }\n } catch (e) {\n r = !0, o = e;\n } finally {\n try {\n n || null == u.return || u.return();\n } finally {\n if (r) throw o;\n }\n }\n\n return t;\n }, t.sort = function (e, t) {\n return function (e) {\n return function (e) {\n if (Array.isArray(e)) {\n for (var t = 0, n = new Array(e.length); t < e.length; t++) {\n n[t] = e[t];\n }\n\n return n;\n }\n }(e) || function (e) {\n if (Symbol.iterator in Object(e) || \"[object Arguments]\" === Object.prototype.toString.call(e)) return Array.from(e);\n }(e) || function () {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n }();\n }(e).sort(t);\n };\n }, function (e, t, n) {\n \"use strict\";\n\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.RichTextBlock = void 0;\n var r = n(0);\n\n function o(e, t) {\n for (var n = 0; n < t.length; n++) {\n var r = t[n];\n r.enumerable = r.enumerable || !1, r.configurable = !0, \"value\" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);\n }\n }\n\n var i = function () {\n function e(t, n, r) {\n !function (e, t) {\n if (!(e instanceof t)) throw new TypeError(\"Cannot call a class as a function\");\n }(this, e), this.type = t, this.text = n, this.spans = r;\n }\n\n var t, n;\n return t = e, (n = [{\n key: \"isEmbedBlock\",\n value: function value(e) {\n return e === r.NODE_TYPES.embed;\n }\n }, {\n key: \"isImageBlock\",\n value: function value(e) {\n return e === r.NODE_TYPES.image;\n }\n }, {\n key: \"isList\",\n value: function value(e) {\n return e === r.NODE_TYPES.list;\n }\n }, {\n key: \"isOrderedList\",\n value: function value(e) {\n return e === r.NODE_TYPES.oList;\n }\n }, {\n key: \"isListItem\",\n value: function value(e) {\n return e === r.NODE_TYPES.listItem;\n }\n }, {\n key: \"isOrderedListItem\",\n value: function value(e) {\n return e === r.NODE_TYPES.oListItem;\n }\n }, {\n key: \"emptyList\",\n value: function value() {\n return {\n type: r.NODE_TYPES.list,\n spans: [],\n text: \"\"\n };\n }\n }, {\n key: \"emptyOrderedList\",\n value: function value() {\n return {\n type: r.NODE_TYPES.oList,\n spans: [],\n text: \"\"\n };\n }\n }]) && o(t, n), e;\n }();\n\n t.RichTextBlock = i;\n }, function (e, t, n) {\n \"use strict\";\n\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = void 0;\n var r,\n o = (r = n(1)) && r.__esModule ? r : {\n default: r\n },\n i = n(2);\n\n t.default = function (e, t, n) {\n return o.default.fromRichText(e).children.map(function (e, r) {\n return function (e, t, n, r) {\n return function e(n, o) {\n var u = n instanceof i.SpanNode ? n.text : null,\n c = n.children.reduce(function (t, n, r) {\n return t.concat([e(n, r)]);\n }, []);\n return r && r(n.type, n.element, u, c, o) || t(n.type, n.element, u, c, o);\n }(e, n);\n }(e, t, r, n);\n });\n };\n }]);\n }, function (e, t, n) {\n \"use strict\";\n /*!\n * escape-html\n * Copyright(c) 2012-2013 TJ Holowaychuk\n * Copyright(c) 2015 Andreas Lubbe\n * Copyright(c) 2015 Tiancheng \"Timothy\" Gu\n * MIT Licensed\n */\n\n var r = /[\"'&<>]/;\n\n e.exports = function (e) {\n var t,\n n = \"\" + e,\n o = r.exec(n);\n if (!o) return n;\n var i = \"\",\n u = 0,\n c = 0;\n\n for (u = o.index; u < n.length; u++) {\n switch (n.charCodeAt(u)) {\n case 34:\n t = \""\";\n break;\n\n case 38:\n t = \"&\";\n break;\n\n case 39:\n t = \"'\";\n break;\n\n case 60:\n t = \"<\";\n break;\n\n case 62:\n t = \">\";\n break;\n\n default:\n continue;\n }\n\n c !== u && (i += n.substring(c, u)), c = u + 1, i += t;\n }\n\n return c !== u ? i + n.substring(c, u) : i;\n };\n }]);\n});","\"use strict\";\n/**\n * @since 2.0.0\n */\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\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 */\n\nfunction identity(a) {\n return a;\n}\n\nexports.identity = identity;\n/**\n * @since 2.0.0\n */\n\nexports.unsafeCoerce = identity;\n/**\n * @since 2.0.0\n */\n\nfunction not(predicate) {\n return function (a) {\n return !predicate(a);\n };\n}\n\nexports.not = not;\n/**\n * @since 2.0.0\n */\n\nfunction constant(a) {\n return function () {\n return a;\n };\n}\n\nexports.constant = constant;\n/**\n * A thunk that returns always `true`.\n *\n * @since 2.0.0\n */\n\nexports.constTrue = /*#__PURE__*/constant(true);\n/**\n * A thunk that returns always `false`.\n *\n * @since 2.0.0\n */\n\nexports.constFalse = /*#__PURE__*/constant(false);\n/**\n * A thunk that returns always `null`.\n *\n * @since 2.0.0\n */\n\nexports.constNull = /*#__PURE__*/constant(null);\n/**\n * A thunk that returns always `undefined`.\n *\n * @since 2.0.0\n */\n\nexports.constUndefined = /*#__PURE__*/constant(undefined);\n/**\n * A thunk that returns always `void`.\n *\n * @since 2.0.0\n */\n\nexports.constVoid = exports.constUndefined; // TODO: remove in v3\n\n/**\n * Flips the order of the arguments of a function of two arguments.\n *\n * @since 2.0.0\n */\n\nfunction flip(f) {\n return function (b, a) {\n return f(a, b);\n };\n}\n\nexports.flip = flip;\n\nfunction flow(ab, bc, cd, de, ef, fg, gh, hi, ij) {\n switch (arguments.length) {\n case 1:\n return ab;\n\n case 2:\n return function () {\n return bc(ab.apply(this, arguments));\n };\n\n case 3:\n return function () {\n return cd(bc(ab.apply(this, arguments)));\n };\n\n case 4:\n return function () {\n return de(cd(bc(ab.apply(this, arguments))));\n };\n\n case 5:\n return function () {\n return ef(de(cd(bc(ab.apply(this, arguments)))));\n };\n\n case 6:\n return function () {\n return fg(ef(de(cd(bc(ab.apply(this, arguments))))));\n };\n\n case 7:\n return function () {\n return gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))));\n };\n\n case 8:\n return function () {\n return hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments))))))));\n };\n\n case 9:\n return function () {\n return ij(hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))))));\n };\n }\n\n return;\n}\n\nexports.flow = flow;\n/**\n * @since 2.0.0\n */\n\nfunction tuple() {\n var t = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n t[_i] = arguments[_i];\n }\n\n return t;\n}\n\nexports.tuple = tuple;\n/**\n * @since 2.0.0\n */\n\nfunction increment(n) {\n return n + 1;\n}\n\nexports.increment = increment;\n/**\n * @since 2.0.0\n */\n\nfunction decrement(n) {\n return n - 1;\n}\n\nexports.decrement = decrement;\n/**\n * @since 2.0.0\n */\n\nfunction absurd(_) {\n throw new Error('Called `absurd` function which should be uncallable');\n}\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 */\n\nfunction tupled(f) {\n return function (a) {\n return f.apply(void 0, a);\n };\n}\n\nexports.tupled = tupled;\n/**\n * Inverse function of `tupled`\n *\n * @since 2.4.0\n */\n\nfunction untupled(f) {\n return function () {\n var a = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n a[_i] = arguments[_i];\n }\n\n return f(a);\n };\n}\n\nexports.untupled = untupled;\n\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\n case 2:\n return ab(a);\n\n case 3:\n return bc(ab(a));\n\n case 4:\n return cd(bc(ab(a)));\n\n case 5:\n return de(cd(bc(ab(a))));\n\n case 6:\n return ef(de(cd(bc(ab(a)))));\n\n case 7:\n return fg(ef(de(cd(bc(ab(a))))));\n\n case 8:\n return gh(fg(ef(de(cd(bc(ab(a)))))));\n\n case 9:\n return hi(gh(fg(ef(de(cd(bc(ab(a))))))));\n\n case 10:\n return ij(hi(gh(fg(ef(de(cd(bc(ab(a)))))))));\n\n case 11:\n return jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a))))))))));\n\n case 12:\n return kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a)))))))))));\n\n case 13:\n return lm(kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a))))))))))));\n\n case 14:\n return mn(lm(kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a)))))))))))));\n\n case 15:\n return no(mn(lm(kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a))))))))))))));\n\n case 16:\n return op(no(mn(lm(kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a)))))))))))))));\n\n case 17:\n return pq(op(no(mn(lm(kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a))))))))))))))));\n\n case 18:\n return qr(pq(op(no(mn(lm(kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a)))))))))))))))));\n\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\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\n return;\n}\n\nexports.pipe = pipe;\n/**\n * Type hole simulation\n *\n * @since 2.7.0\n */\n\nexports.hole = absurd;\n/**\n * @internal\n */\n\nvar bind_ = function bind_(a, name, b) {\n var _a;\n\n return Object.assign({}, a, (_a = {}, _a[name] = b, _a));\n};\n\nexports.bind_ = bind_;\n/**\n * @internal\n */\n\nvar bindTo_ = function bindTo_(name) {\n return function (b) {\n var _a;\n\n return _a = {}, _a[name] = b, _a;\n };\n};\n\nexports.bindTo_ = bindTo_;","function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nmodule.exports = _assertThisInitialized;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar invariant = function(condition, format, a, b, c, d, e, f) {\n if (process.env.NODE_ENV !== 'production') {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n }\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error(\n 'Minified exception occurred; use the non-minified dev environment ' +\n 'for the full error message and additional helpful warnings.'\n );\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(\n format.replace(/%s/g, function() { return args[argIndex++]; })\n );\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n};\n\nmodule.exports = invariant;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\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;\n\nvar function_1 = require(\"./function\"); // -------------------------------------------------------------------------------------\n// constructors\n// -------------------------------------------------------------------------------------\n\n/**\n * @category constructors\n * @since 2.0.0\n */\n\n\nfunction fromEquals(_equals) {\n return {\n equals: function equals(x, y) {\n return x === y || _equals(x, y);\n }\n };\n}\n\nexports.fromEquals = fromEquals; // -------------------------------------------------------------------------------------\n// non-pipeables\n// -------------------------------------------------------------------------------------\n\n/* istanbul ignore next */\n\nvar contramap_ = function contramap_(fa, f) {\n return function_1.pipe(fa, exports.contramap(f));\n}; // -------------------------------------------------------------------------------------\n// pipeables\n// -------------------------------------------------------------------------------------\n\n/**\n * @category Contravariant\n * @since 2.0.0\n */\n\n\nvar contramap = function contramap(f) {\n return function (fa) {\n return fromEquals(function (x, y) {\n return fa.equals(f(x), f(y));\n });\n };\n};\n\nexports.contramap = contramap; // -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n\n/**\n * @category instances\n * @since 2.0.0\n */\n\nexports.URI = 'Eq';\n/**\n * @category instances\n * @since 2.5.0\n */\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 */\n\nfunction strictEqual(a, b) {\n return a === b;\n}\n\nexports.strictEqual = strictEqual;\n/**\n * @category instances\n * @since 2.0.0\n */\n\nexports.eqString = exports.eqStrict;\n/**\n * @category instances\n * @since 2.0.0\n */\n\nexports.eqNumber = exports.eqStrict;\n/**\n * @category instances\n * @since 2.0.0\n */\n\nexports.eqBoolean = exports.eqStrict;\n/**\n * @category instances\n * @since 2.0.0\n */\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\n return true;\n });\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 */\n\nfunction getTupleEq() {\n var eqs = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n eqs[_i] = arguments[_i];\n }\n\n return fromEquals(function (x, y) {\n return eqs.every(function (E, i) {\n return E.equals(x[i], y[i]);\n });\n });\n}\n\nexports.getTupleEq = getTupleEq;\n/**\n * @category instances\n * @since 2.0.0\n */\n\nexports.eqDate = {\n equals: function equals(x, y) {\n return x.valueOf() === y.valueOf();\n }\n};\nvar empty = {\n equals: function equals() {\n return true;\n }\n};\n/**\n * @category instances\n * @since 2.6.0\n */\n\nfunction getMonoid() {\n return {\n concat: function concat(x, y) {\n return fromEquals(function (a, b) {\n return x.equals(a, b) && y.equals(a, b);\n });\n },\n empty: empty\n };\n}\n\nexports.getMonoid = getMonoid;\n/**\n * @category instances\n * @since 2.7.0\n */\n\nexports.Contravariant = {\n URI: exports.URI,\n contramap: contramap_\n}; // TODO: remove in v3\n\n/**\n * @category instances\n * @since 2.0.0\n */\n\nexports.eq = exports.Contravariant;","var global = require('../internals/global');\n\nmodule.exports = global;\n","var fails = require('../internals/fails');\nvar classof = require('../internals/classof-raw');\n\nvar split = ''.split;\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nmodule.exports = fails(function () {\n // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n // eslint-disable-next-line no-prototype-builtins\n return !Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n return classof(it) == 'String' ? split.call(it, '') : Object(it);\n} : Object;\n","var anObject = require('../internals/an-object');\nvar aFunction = require('../internals/a-function');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar SPECIES = wellKnownSymbol('species');\n\n// `SpeciesConstructor` abstract operation\n// https://tc39.es/ecma262/#sec-speciesconstructor\nmodule.exports = function (O, defaultConstructor) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aFunction(S);\n};\n","var fails = require('../internals/fails');\n\nmodule.exports = !!Object.getOwnPropertySymbols && !fails(function () {\n // Chrome 38 Symbol has incorrect toString conversion\n // eslint-disable-next-line no-undef\n return !String(Symbol());\n});\n","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;","var toIndexedObject = require('../internals/to-indexed-object');\nvar toLength = require('../internals/to-length');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.includes` method\n // https://tc39.es/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.es/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod(false)\n};\n","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nmodule.exports = _interopRequireDefault;","var toInteger = require('../internals/to-integer');\n\nvar min = Math.min;\n\n// `ToLength` abstract operation\n// https://tc39.es/ecma262/#sec-tolength\nmodule.exports = function (argument) {\n return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n};\n","var hasOwnProperty = {}.hasOwnProperty;\n\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n","// This is extracted to separate module because it's shared\n// between browser and SSR code\nexport const RouteAnnouncerProps = {\n id: `gatsby-announcer`,\n style: {\n position: `absolute`,\n top: 0,\n width: 1,\n height: 1,\n padding: 0,\n overflow: `hidden`,\n clip: `rect(0, 0, 0, 0)`,\n whiteSpace: `nowrap`,\n border: 0,\n },\n \"aria-live\": `assertive`,\n \"aria-atomic\": `true`,\n}\n","import React from \"react\"\nimport PropTypes from \"prop-types\"\nimport loader, { PageResourceStatus } from \"./loader\"\nimport redirects from \"./redirects.json\"\nimport { apiRunner } from \"./api-runner-browser\"\nimport emitter from \"./emitter\"\nimport { RouteAnnouncerProps } from \"./route-announcer-props\"\nimport { navigate as reachNavigate } from \"@reach/router\"\nimport { globalHistory } from \"@reach/router/lib/history\"\nimport { parsePath } from \"gatsby-link\"\n\n// Convert to a map for faster lookup in maybeRedirect()\nconst redirectMap = redirects.reduce((map, redirect) => {\n map[redirect.fromPath] = redirect\n return map\n}, {})\n\nfunction maybeRedirect(pathname) {\n const redirect = redirectMap[pathname]\n\n if (redirect != null) {\n if (process.env.NODE_ENV !== `production`) {\n if (!loader.isPageNotFound(pathname)) {\n console.error(\n `The route \"${pathname}\" matches both a page and a redirect; this is probably not intentional.`\n )\n }\n }\n\n window.___replace(redirect.toPath)\n return true\n } else {\n return false\n }\n}\n\nconst onPreRouteUpdate = (location, prevLocation) => {\n if (!maybeRedirect(location.pathname)) {\n apiRunner(`onPreRouteUpdate`, { location, prevLocation })\n }\n}\n\nconst onRouteUpdate = (location, prevLocation) => {\n if (!maybeRedirect(location.pathname)) {\n apiRunner(`onRouteUpdate`, { location, prevLocation })\n if (\n process.env.GATSBY_EXPERIMENTAL_QUERY_ON_DEMAND &&\n process.env.GATSBY_QUERY_ON_DEMAND_LOADING_INDICATOR === `true`\n ) {\n emitter.emit(`onRouteUpdate`, { location, prevLocation })\n }\n }\n}\n\nconst navigate = (to, options = {}) => {\n // Support forward/backward navigation with numbers\n // navigate(-2) (jumps back 2 history steps)\n // navigate(2) (jumps forward 2 history steps)\n if (typeof to === `number`) {\n globalHistory.navigate(to)\n return\n }\n\n let { pathname } = parsePath(to)\n const redirect = redirectMap[pathname]\n\n // If we're redirecting, just replace the passed in pathname\n // to the one we want to redirect to.\n if (redirect) {\n to = redirect.toPath\n pathname = parsePath(to).pathname\n }\n\n // If we had a service worker update, no matter the path, reload window and\n // reset the pathname whitelist\n if (window.___swUpdated) {\n window.location = pathname\n return\n }\n\n // Start a timer to wait for a second before transitioning and showing a\n // loader in case resources aren't around yet.\n const timeoutId = setTimeout(() => {\n emitter.emit(`onDelayedLoadPageResources`, { pathname })\n apiRunner(`onRouteUpdateDelayed`, {\n location: window.location,\n })\n }, 1000)\n\n loader.loadPage(pathname).then(pageResources => {\n // If no page resources, then refresh the page\n // Do this, rather than simply `window.location.reload()`, so that\n // pressing the back/forward buttons work - otherwise when pressing\n // back, the browser will just change the URL and expect JS to handle\n // the change, which won't always work since it might not be a Gatsby\n // page.\n if (!pageResources || pageResources.status === PageResourceStatus.Error) {\n window.history.replaceState({}, ``, location.href)\n window.location = pathname\n clearTimeout(timeoutId)\n return\n }\n\n // If the loaded page has a different compilation hash to the\n // window, then a rebuild has occurred on the server. Reload.\n if (process.env.NODE_ENV === `production` && pageResources) {\n if (\n pageResources.page.webpackCompilationHash !==\n window.___webpackCompilationHash\n ) {\n // Purge plugin-offline cache\n if (\n `serviceWorker` in navigator &&\n navigator.serviceWorker.controller !== null &&\n navigator.serviceWorker.controller.state === `activated`\n ) {\n navigator.serviceWorker.controller.postMessage({\n gatsbyApi: `clearPathResources`,\n })\n }\n\n window.location = pathname\n }\n }\n reachNavigate(to, options)\n clearTimeout(timeoutId)\n })\n}\n\nfunction shouldUpdateScroll(prevRouterProps, { location }) {\n const { pathname, hash } = location\n const results = apiRunner(`shouldUpdateScroll`, {\n prevRouterProps,\n // `pathname` for backwards compatibility\n pathname,\n routerProps: { location },\n getSavedScrollPosition: args => [\n 0,\n this._stateStorage.read(args, args.key),\n ],\n })\n if (results.length > 0) {\n // Use the latest registered shouldUpdateScroll result, this allows users to override plugin's configuration\n // @see https://github.com/gatsbyjs/gatsby/issues/12038\n return results[results.length - 1]\n }\n\n if (prevRouterProps) {\n const {\n location: { pathname: oldPathname },\n } = prevRouterProps\n if (oldPathname === pathname) {\n // Scroll to element if it exists, if it doesn't, or no hash is provided,\n // scroll to top.\n return hash ? decodeURI(hash.slice(1)) : [0, 0]\n }\n }\n return true\n}\n\nfunction init() {\n // The \"scroll-behavior\" package expects the \"action\" to be on the location\n // object so let's copy it over.\n globalHistory.listen(args => {\n args.location.action = args.action\n })\n\n window.___push = to => navigate(to, { replace: false })\n window.___replace = to => navigate(to, { replace: true })\n window.___navigate = (to, options) => navigate(to, options)\n\n // Check for initial page-load redirect\n maybeRedirect(window.location.pathname)\n}\n\nclass RouteAnnouncer extends React.Component {\n constructor(props) {\n super(props)\n this.announcementRef = React.createRef()\n }\n\n componentDidUpdate(prevProps, nextProps) {\n requestAnimationFrame(() => {\n let pageName = `new page at ${this.props.location.pathname}`\n if (document.title) {\n pageName = document.title\n }\n const pageHeadings = document.querySelectorAll(`#gatsby-focus-wrapper h1`)\n if (pageHeadings && pageHeadings.length) {\n pageName = pageHeadings[0].textContent\n }\n const newAnnouncement = `Navigated to ${pageName}`\n if (this.announcementRef.current) {\n const oldAnnouncement = this.announcementRef.current.innerText\n if (oldAnnouncement !== newAnnouncement) {\n this.announcementRef.current.innerText = newAnnouncement\n }\n }\n })\n }\n\n render() {\n return \n }\n}\n\nconst compareLocationProps = (prevLocation, nextLocation) => {\n if (prevLocation.href !== nextLocation.href) {\n return true\n }\n\n if (prevLocation?.state?.key !== nextLocation?.state?.key) {\n return true\n }\n\n return false\n}\n\n// Fire on(Pre)RouteUpdate APIs\nclass RouteUpdates extends React.Component {\n constructor(props) {\n super(props)\n onPreRouteUpdate(props.location, null)\n }\n\n componentDidMount() {\n onRouteUpdate(this.props.location, null)\n }\n\n shouldComponentUpdate(prevProps) {\n if (compareLocationProps(prevProps.location, this.props.location)) {\n onPreRouteUpdate(this.props.location, prevProps.location)\n return true\n }\n return false\n }\n\n componentDidUpdate(prevProps) {\n if (compareLocationProps(prevProps.location, this.props.location)) {\n onRouteUpdate(this.props.location, prevProps.location)\n }\n }\n\n render() {\n return (\n \n {this.props.children}\n \n \n )\n }\n}\n\nRouteUpdates.propTypes = {\n location: PropTypes.object.isRequired,\n}\n\nexport { init, shouldUpdateScroll, RouteUpdates }\n","// Pulled from react-compat\n// https://github.com/developit/preact-compat/blob/7c5de00e7c85e2ffd011bf3af02899b63f699d3a/src/index.js#L349\nfunction shallowDiffers(a, b) {\n for (var i in a) {\n if (!(i in b)) return true;\n }for (var _i in b) {\n if (a[_i] !== b[_i]) return true;\n }return false;\n}\n\nexport default (function (instance, nextProps, nextState) {\n return shallowDiffers(instance.props, nextProps) || shallowDiffers(instance.state, nextState);\n});","import React from \"react\"\nimport loader, { PageResourceStatus } from \"./loader\"\nimport shallowCompare from \"shallow-compare\"\n\nclass EnsureResources extends React.Component {\n constructor(props) {\n super()\n const { location, pageResources } = props\n this.state = {\n location: { ...location },\n pageResources: pageResources || loader.loadPageSync(location.pathname),\n }\n }\n\n static getDerivedStateFromProps({ location }, prevState) {\n if (prevState.location.href !== location.href) {\n const pageResources = loader.loadPageSync(location.pathname)\n return {\n pageResources,\n location: { ...location },\n }\n }\n\n return {\n location: { ...location },\n }\n }\n\n loadResources(rawPath) {\n loader.loadPage(rawPath).then(pageResources => {\n if (pageResources && pageResources.status !== PageResourceStatus.Error) {\n this.setState({\n location: { ...window.location },\n pageResources,\n })\n } else {\n window.history.replaceState({}, ``, location.href)\n window.location = rawPath\n }\n })\n }\n\n shouldComponentUpdate(nextProps, nextState) {\n // Always return false if we're missing resources.\n if (!nextState.pageResources) {\n this.loadResources(nextProps.location.pathname)\n return false\n }\n\n if (\n process.env.BUILD_STAGE === `develop` &&\n nextState.pageResources.stale\n ) {\n this.loadResources(nextProps.location.pathname)\n return false\n }\n\n // Check if the component or json have changed.\n if (this.state.pageResources !== nextState.pageResources) {\n return true\n }\n if (\n this.state.pageResources.component !== nextState.pageResources.component\n ) {\n return true\n }\n\n if (this.state.pageResources.json !== nextState.pageResources.json) {\n return true\n }\n // Check if location has changed on a page using internal routing\n // via matchPath configuration.\n if (\n this.state.location.key !== nextState.location.key &&\n nextState.pageResources.page &&\n (nextState.pageResources.page.matchPath ||\n nextState.pageResources.page.path)\n ) {\n return true\n }\n return shallowCompare(this, nextProps, nextState)\n }\n\n render() {\n if (process.env.NODE_ENV !== `production` && !this.state.pageResources) {\n throw new Error(\n `EnsureResources was not able to find resources for path: \"${this.props.location.pathname}\"\nThis typically means that an issue occurred building components for that path.\nRun \\`gatsby clean\\` to remove any cached elements.`\n )\n }\n\n return this.props.children(this.state)\n }\n}\n\nexport default EnsureResources\n","import { apiRunner, apiRunnerAsync } from \"./api-runner-browser\"\nimport React from \"react\"\nimport ReactDOM from \"react-dom\"\nimport { Router, navigate, Location, BaseContext } from \"@reach/router\"\nimport { ScrollContext } from \"gatsby-react-router-scroll\"\nimport domReady from \"@mikaelkristiansson/domready\"\nimport { StaticQueryContext } from \"gatsby\"\nimport {\n shouldUpdateScroll,\n init as navigationInit,\n RouteUpdates,\n} from \"./navigation\"\nimport emitter from \"./emitter\"\nimport PageRenderer from \"./page-renderer\"\nimport asyncRequires from \"$virtual/async-requires\"\nimport {\n setLoader,\n ProdLoader,\n publicLoader,\n PageResourceStatus,\n getStaticQueryResults,\n} from \"./loader\"\nimport EnsureResources from \"./ensure-resources\"\nimport stripPrefix from \"./strip-prefix\"\n\n// Generated during bootstrap\nimport matchPaths from \"$virtual/match-paths.json\"\n\nconst loader = new ProdLoader(asyncRequires, matchPaths)\nsetLoader(loader)\nloader.setApiRunner(apiRunner)\n\nwindow.asyncRequires = asyncRequires\nwindow.___emitter = emitter\nwindow.___loader = publicLoader\n\nnavigationInit()\n\napiRunnerAsync(`onClientEntry`).then(() => {\n // Let plugins register a service worker. The plugin just needs\n // to return true.\n if (apiRunner(`registerServiceWorker`).length > 0) {\n require(`./register-service-worker`)\n }\n\n // In gatsby v2 if Router is used in page using matchPaths\n // paths need to contain full path.\n // For example:\n // - page have `/app/*` matchPath\n // - inside template user needs to use `/app/xyz` as path\n // Resetting `basepath`/`baseuri` keeps current behaviour\n // to not introduce breaking change.\n // Remove this in v3\n const RouteHandler = props => (\n \n \n \n )\n\n const DataContext = React.createContext({})\n\n class GatsbyRoot extends React.Component {\n render() {\n const { children } = this.props\n return (\n \n {({ location }) => (\n \n {({ pageResources, location }) => {\n const staticQueryResults = getStaticQueryResults()\n return (\n \n \n {children}\n \n \n )\n }}\n \n )}\n \n )\n }\n }\n\n class LocationHandler extends React.Component {\n render() {\n return (\n \n {({ pageResources, location }) => (\n \n \n \n \n \n \n \n )}\n \n )\n }\n }\n\n const { pagePath, location: browserLoc } = window\n\n // Explicitly call navigate if the canonical path (window.pagePath)\n // is different to the browser path (window.location.pathname). But\n // only if NONE of the following conditions hold:\n //\n // - The url matches a client side route (page.matchPath)\n // - it's a 404 page\n // - it's the offline plugin shell (/offline-plugin-app-shell-fallback/)\n if (\n pagePath &&\n __BASE_PATH__ + pagePath !== browserLoc.pathname &&\n !(\n loader.findMatchPath(stripPrefix(browserLoc.pathname, __BASE_PATH__)) ||\n pagePath === `/404.html` ||\n pagePath.match(/^\\/404\\/?$/) ||\n pagePath.match(/^\\/offline-plugin-app-shell-fallback\\/?$/)\n )\n ) {\n navigate(__BASE_PATH__ + pagePath + browserLoc.search + browserLoc.hash, {\n replace: true,\n })\n }\n\n publicLoader.loadPage(browserLoc.pathname).then(page => {\n if (!page || page.status === PageResourceStatus.Error) {\n throw new Error(\n `page resources for ${browserLoc.pathname} not found. Not rendering React`\n )\n }\n\n window.___webpackCompilationHash = page.page.webpackCompilationHash\n\n const SiteRoot = apiRunner(\n `wrapRootElement`,\n { element: },\n ,\n ({ result }) => {\n return { element: result }\n }\n ).pop()\n\n const App = () => {SiteRoot}\n\n const renderer = apiRunner(\n `replaceHydrateFunction`,\n undefined,\n ReactDOM.hydrate\n )[0]\n\n domReady(() => {\n renderer(\n ,\n typeof window !== `undefined`\n ? document.getElementById(`___gatsby`)\n : void 0,\n () => {\n apiRunner(`onInitialClientRender`)\n }\n )\n })\n })\n})\n","var setPrototypeOf = require(\"./setPrototypeOf\");\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inheritsLoose;","var IS_PURE = require('../internals/is-pure');\nvar store = require('../internals/shared-store');\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: '3.8.3',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2021 Denis Pushkarev (zloirock.ru)'\n});\n","var getBuiltIn = require('../internals/get-built-in');\nvar getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar anObject = require('../internals/an-object');\n\n// all object keys, includes non-enumerable and symbols\nmodule.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {\n var keys = getOwnPropertyNamesModule.f(anObject(it));\n var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;\n};\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\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;\n\nvar Ordering_1 = require(\"./Ordering\");\n\nvar function_1 = require(\"./function\"); // default compare for primitive types\n\n\nfunction compare(x, y) {\n return x < y ? -1 : x > y ? 1 : 0;\n}\n\nfunction strictEqual(a, b) {\n return a === b;\n}\n/**\n * @category instances\n * @since 2.0.0\n */\n\n\nexports.ordString = {\n equals: strictEqual,\n compare: compare\n};\n/**\n * @category instances\n * @since 2.0.0\n */\n\nexports.ordNumber = {\n equals: strictEqual,\n compare: compare\n};\n/**\n * @category instances\n * @since 2.0.0\n */\n\nexports.ordBoolean = {\n equals: strictEqual,\n compare: compare\n}; // TODO: curry in v3\n\n/**\n * Test whether one value is _strictly less than_ another\n *\n * @since 2.0.0\n */\n\nfunction lt(O) {\n return function (x, y) {\n return O.compare(x, y) === -1;\n };\n}\n\nexports.lt = lt; // TODO: curry in v3\n\n/**\n * Test whether one value is _strictly greater than_ another\n *\n * @since 2.0.0\n */\n\nfunction gt(O) {\n return function (x, y) {\n return O.compare(x, y) === 1;\n };\n}\n\nexports.gt = gt; // TODO: curry in v3\n\n/**\n * Test whether one value is _non-strictly less than_ another\n *\n * @since 2.0.0\n */\n\nfunction leq(O) {\n return function (x, y) {\n return O.compare(x, y) !== 1;\n };\n}\n\nexports.leq = leq; // TODO: curry in v3\n\n/**\n * Test whether one value is _non-strictly greater than_ another\n *\n * @since 2.0.0\n */\n\nfunction geq(O) {\n return function (x, y) {\n return O.compare(x, y) !== -1;\n };\n}\n\nexports.geq = geq; // TODO: curry in v3\n\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 */\n\nfunction min(O) {\n return function (x, y) {\n return O.compare(x, y) === 1 ? y : x;\n };\n}\n\nexports.min = min; // TODO: curry in v3\n\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 */\n\nfunction max(O) {\n return function (x, y) {\n return O.compare(x, y) === -1 ? y : x;\n };\n}\n\nexports.max = max;\n/**\n * Clamp a value between a minimum and a maximum\n *\n * @since 2.0.0\n */\n\nfunction clamp(O) {\n var minO = min(O);\n var maxO = max(O);\n return function (low, hi) {\n return function (x) {\n return maxO(minO(x, hi), low);\n };\n };\n}\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 */\n\nfunction between(O) {\n var lessThanO = lt(O);\n var greaterThanO = gt(O);\n return function (low, hi) {\n return function (x) {\n return lessThanO(x, low) || greaterThanO(x, hi) ? false : true;\n };\n };\n}\n\nexports.between = between;\n/**\n * @category constructors\n * @since 2.0.0\n */\n\nfunction fromCompare(compare) {\n var optimizedCompare = function optimizedCompare(x, y) {\n return x === y ? 0 : compare(x, y);\n };\n\n return {\n equals: function equals(x, y) {\n return optimizedCompare(x, y) === 0;\n },\n compare: optimizedCompare\n };\n}\n\nexports.fromCompare = fromCompare;\n/**\n * Use `getMonoid` instead\n *\n * @category instances\n * @since 2.0.0\n * @deprecated\n */\n\nfunction getSemigroup() {\n return {\n concat: function concat(x, y) {\n return fromCompare(function (a, b) {\n return Ordering_1.monoidOrdering.concat(x.compare(a, b), y.compare(a, b));\n });\n }\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, 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 */\n\nfunction getMonoid() {\n return {\n // tslint:disable-next-line: deprecation\n concat: getSemigroup().concat,\n empty: fromCompare(function () {\n return 0;\n })\n };\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 */\n\nfunction getTupleOrd() {\n var ords = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n ords[_i] = arguments[_i];\n }\n\n var len = ords.length;\n return fromCompare(function (x, y) {\n var i = 0;\n\n for (; i < len - 1; i++) {\n var r = ords[i].compare(x[i], y[i]);\n\n if (r !== 0) {\n return r;\n }\n }\n\n return ords[i].compare(x[i], y[i]);\n });\n}\n\nexports.getTupleOrd = getTupleOrd;\n/**\n * @category combinators\n * @since 2.0.0\n */\n\nfunction getDualOrd(O) {\n return fromCompare(function (x, y) {\n return O.compare(y, x);\n });\n}\n\nexports.getDualOrd = getDualOrd; // -------------------------------------------------------------------------------------\n// non-pipeables\n// -------------------------------------------------------------------------------------\n\n/* istanbul ignore next */\n\nvar contramap_ = function contramap_(fa, f) {\n return function_1.pipe(fa, exports.contramap(f));\n}; // -------------------------------------------------------------------------------------\n// pipeables\n// -------------------------------------------------------------------------------------\n\n/**\n * @category Contravariant\n * @since 2.0.0\n */\n\n\nvar contramap = function contramap(f) {\n return function (fa) {\n return fromCompare(function (x, y) {\n return fa.compare(f(x), f(y));\n });\n };\n};\n\nexports.contramap = contramap; // -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n\n/**\n * @category instances\n * @since 2.0.0\n */\n\nexports.URI = 'Ord';\n/**\n * @category instances\n * @since 2.0.0\n */\n\nexports.ordDate = /*#__PURE__*/function_1.pipe(exports.ordNumber, /*#__PURE__*/exports.contramap(function (date) {\n return date.valueOf();\n}));\n/**\n * @category instances\n * @since 2.7.0\n */\n\nexports.Contravariant = {\n URI: exports.URI,\n contramap: contramap_\n}; // TODO: remove in v3\n\n/**\n * @category instances\n * @since 2.0.0\n */\n\nexports.ord = exports.Contravariant;","import React from \"react\"\nimport PropTypes from \"prop-types\"\nimport Link, {\n withPrefix,\n withAssetPrefix,\n navigate,\n push,\n replace,\n navigateTo,\n parsePath,\n} from \"gatsby-link\"\nimport { useScrollRestoration } from \"gatsby-react-router-scroll\"\nimport PageRenderer from \"./public-page-renderer\"\nimport loader from \"./loader\"\n\nconst prefetchPathname = loader.enqueue\n\nconst StaticQueryContext = React.createContext({})\n\nfunction StaticQueryDataRenderer({ staticQueryData, data, query, render }) {\n const finalData = data\n ? data.data\n : staticQueryData[query] && staticQueryData[query].data\n\n return (\n \n {finalData && render(finalData)}\n {!finalData && Loading (StaticQuery)
}\n \n )\n}\n\nconst StaticQuery = props => {\n const { data, query, render, children } = props\n\n return (\n \n {staticQueryData => (\n \n )}\n \n )\n}\n\nconst useStaticQuery = query => {\n if (\n typeof React.useContext !== `function` &&\n process.env.NODE_ENV === `development`\n ) {\n throw new Error(\n `You're likely using a version of React that doesn't support Hooks\\n` +\n `Please update React and ReactDOM to 16.8.0 or later to use the useStaticQuery hook.`\n )\n }\n const context = React.useContext(StaticQueryContext)\n\n // query is a stringified number like `3303882` when wrapped with graphql, If a user forgets\n // to wrap the query in a grqphql, then casting it to a Number results in `NaN` allowing us to\n // catch the misuse of the API and give proper direction\n if (isNaN(Number(query))) {\n throw new Error(`useStaticQuery was called with a string but expects to be called using \\`graphql\\`. Try this:\n\nimport { useStaticQuery, graphql } from 'gatsby';\n\nuseStaticQuery(graphql\\`${query}\\`);\n`)\n }\n\n if (context[query]?.data) {\n return context[query].data\n } else {\n throw new Error(\n `The result of this StaticQuery could not be fetched.\\n\\n` +\n `This is likely a bug in Gatsby and if refreshing the page does not fix it, ` +\n `please open an issue in https://github.com/gatsbyjs/gatsby/issues`\n )\n }\n}\n\nStaticQuery.propTypes = {\n data: PropTypes.object,\n query: PropTypes.string.isRequired,\n render: PropTypes.func,\n children: PropTypes.func,\n}\n\nfunction graphql() {\n throw new Error(\n `It appears like Gatsby is misconfigured. Gatsby related \\`graphql\\` calls ` +\n `are supposed to only be evaluated at compile time, and then compiled away. ` +\n `Unfortunately, something went wrong and the query was left in the compiled code.\\n\\n` +\n `Unless your site has a complex or custom babel/Gatsby configuration this is likely a bug in Gatsby.`\n )\n}\n\nexport {\n Link,\n withAssetPrefix,\n withPrefix,\n graphql,\n parsePath,\n navigate,\n push, // TODO replace for v3\n replace, // TODO remove replace for v3\n navigateTo, // TODO: remove navigateTo for v3\n useScrollRestoration,\n StaticQueryContext,\n StaticQuery,\n PageRenderer,\n useStaticQuery,\n prefetchPathname,\n}\n","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\n\n/* global Reflect, Promise */\nvar _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) {\n if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n }\n };\n\n return _extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n\n _extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nvar _assign = function __assign() {\n _assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n }\n\n return t;\n };\n\n return _assign.apply(this, arguments);\n};\n\nexport { _assign as __assign };\nexport function __rest(s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n}\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length,\n r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,\n d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {\n if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n }\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\nexport function __param(paramIndex, decorator) {\n return function (target, key) {\n decorator(target, key, paramIndex);\n };\n}\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\nexport function __generator(thisArg, body) {\n var _ = {\n label: 0,\n sent: function sent() {\n if (t[0] & 1) throw t[1];\n return t[1];\n },\n trys: [],\n ops: []\n },\n f,\n y,\n t,\n g;\n return g = {\n next: verb(0),\n \"throw\": verb(1),\n \"return\": verb(2)\n }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function () {\n return this;\n }), g;\n\n function verb(n) {\n return function (v) {\n return step([n, v]);\n };\n }\n\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n\n while (_) {\n try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n\n switch (op[0]) {\n case 0:\n case 1:\n t = op;\n break;\n\n case 4:\n _.label++;\n return {\n value: op[1],\n done: false\n };\n\n case 5:\n _.label++;\n y = op[1];\n op = [0];\n continue;\n\n case 7:\n op = _.ops.pop();\n\n _.trys.pop();\n\n continue;\n\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {\n _ = 0;\n continue;\n }\n\n if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {\n _.label = op[1];\n break;\n }\n\n if (op[0] === 6 && _.label < t[1]) {\n _.label = t[1];\n t = op;\n break;\n }\n\n if (t && _.label < t[2]) {\n _.label = t[2];\n\n _.ops.push(op);\n\n break;\n }\n\n if (t[2]) _.ops.pop();\n\n _.trys.pop();\n\n continue;\n }\n\n op = body.call(thisArg, _);\n } catch (e) {\n op = [6, e];\n y = 0;\n } finally {\n f = t = 0;\n }\n }\n\n if (op[0] & 5) throw op[1];\n return {\n value: op[0] ? op[1] : void 0,\n done: true\n };\n }\n}\nexport var __createBinding = Object.create ? function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, {\n enumerable: true,\n get: function get() {\n return m[k];\n }\n });\n} : function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n};\nexport function __exportStar(m, o) {\n for (var p in m) {\n if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n }\n}\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator,\n m = s && o[s],\n i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function next() {\n if (o && i >= o.length) o = void 0;\n return {\n value: o && o[i++],\n done: !o\n };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o),\n r,\n ar = [],\n e;\n\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {\n ar.push(r.value);\n }\n } catch (error) {\n e = {\n error: error\n };\n } finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n } finally {\n if (e) throw e.error;\n }\n }\n\n return ar;\n}\n/** @deprecated */\n\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++) {\n ar = ar.concat(__read(arguments[i]));\n }\n\n return ar;\n}\n/** @deprecated */\n\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) {\n s += arguments[i].length;\n }\n\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 }\n }\n\n return r;\n}\nexport function __spreadArray(to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) {\n to[j] = from[i];\n }\n\n return to;\n}\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []),\n i,\n q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () {\n return this;\n }, i;\n\n function verb(n) {\n if (g[n]) i[n] = function (v) {\n return new Promise(function (a, b) {\n q.push([n, v, a, b]) > 1 || resume(n, v);\n });\n };\n }\n\n function resume(n, v) {\n try {\n step(g[n](v));\n } catch (e) {\n settle(q[0][3], e);\n }\n }\n\n function step(r) {\n r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);\n }\n\n function fulfill(value) {\n resume(\"next\", value);\n }\n\n function reject(value) {\n resume(\"throw\", value);\n }\n\n function settle(f, v) {\n if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);\n }\n}\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) {\n throw e;\n }), verb(\"return\"), i[Symbol.iterator] = function () {\n return this;\n }, i;\n\n function verb(n, f) {\n i[n] = o[n] ? function (v) {\n return (p = !p) ? {\n value: __await(o[n](v)),\n done: n === \"return\"\n } : f ? f(v) : v;\n } : f;\n }\n}\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator],\n i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () {\n return this;\n }, i);\n\n function verb(n) {\n i[n] = o[n] && function (v) {\n return new Promise(function (resolve, reject) {\n v = o[n](v), settle(resolve, reject, v.done, v.value);\n });\n };\n }\n\n function settle(resolve, reject, d, v) {\n Promise.resolve(v).then(function (v) {\n resolve({\n value: v,\n done: d\n });\n }, reject);\n }\n}\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) {\n Object.defineProperty(cooked, \"raw\", {\n value: raw\n });\n } else {\n cooked.raw = raw;\n }\n\n return cooked;\n}\n;\n\nvar __setModuleDefault = Object.create ? function (o, v) {\n Object.defineProperty(o, \"default\", {\n enumerable: true,\n value: v\n });\n} : function (o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) {\n if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n }\n\n __setModuleDefault(result, mod);\n\n return result;\n}\nexport function __importDefault(mod) {\n return mod && mod.__esModule ? mod : {\n default: mod\n };\n}\nexport function __classPrivateFieldGet(receiver, privateMap) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to get private field on non-instance\");\n }\n\n return privateMap.get(receiver);\n}\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to set private field on non-instance\");\n }\n\n privateMap.set(receiver, value);\n return value;\n}","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\n\n/* global Reflect, Promise */\nvar _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) {\n if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n }\n };\n\n return _extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n\n _extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nvar _assign = function __assign() {\n _assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n }\n\n return t;\n };\n\n return _assign.apply(this, arguments);\n};\n\nexport { _assign as __assign };\nexport function __rest(s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n}\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length,\n r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,\n d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {\n if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n }\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\nexport function __param(paramIndex, decorator) {\n return function (target, key) {\n decorator(target, key, paramIndex);\n };\n}\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\nexport function __generator(thisArg, body) {\n var _ = {\n label: 0,\n sent: function sent() {\n if (t[0] & 1) throw t[1];\n return t[1];\n },\n trys: [],\n ops: []\n },\n f,\n y,\n t,\n g;\n return g = {\n next: verb(0),\n \"throw\": verb(1),\n \"return\": verb(2)\n }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function () {\n return this;\n }), g;\n\n function verb(n) {\n return function (v) {\n return step([n, v]);\n };\n }\n\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n\n while (_) {\n try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n\n switch (op[0]) {\n case 0:\n case 1:\n t = op;\n break;\n\n case 4:\n _.label++;\n return {\n value: op[1],\n done: false\n };\n\n case 5:\n _.label++;\n y = op[1];\n op = [0];\n continue;\n\n case 7:\n op = _.ops.pop();\n\n _.trys.pop();\n\n continue;\n\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {\n _ = 0;\n continue;\n }\n\n if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {\n _.label = op[1];\n break;\n }\n\n if (op[0] === 6 && _.label < t[1]) {\n _.label = t[1];\n t = op;\n break;\n }\n\n if (t && _.label < t[2]) {\n _.label = t[2];\n\n _.ops.push(op);\n\n break;\n }\n\n if (t[2]) _.ops.pop();\n\n _.trys.pop();\n\n continue;\n }\n\n op = body.call(thisArg, _);\n } catch (e) {\n op = [6, e];\n y = 0;\n } finally {\n f = t = 0;\n }\n }\n\n if (op[0] & 5) throw op[1];\n return {\n value: op[0] ? op[1] : void 0,\n done: true\n };\n }\n}\nexport var __createBinding = Object.create ? function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, {\n enumerable: true,\n get: function get() {\n return m[k];\n }\n });\n} : function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n};\nexport function __exportStar(m, o) {\n for (var p in m) {\n if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n }\n}\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator,\n m = s && o[s],\n i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function next() {\n if (o && i >= o.length) o = void 0;\n return {\n value: o && o[i++],\n done: !o\n };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o),\n r,\n ar = [],\n e;\n\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {\n ar.push(r.value);\n }\n } catch (error) {\n e = {\n error: error\n };\n } finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n } finally {\n if (e) throw e.error;\n }\n }\n\n return ar;\n}\n/** @deprecated */\n\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++) {\n ar = ar.concat(__read(arguments[i]));\n }\n\n return ar;\n}\n/** @deprecated */\n\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) {\n s += arguments[i].length;\n }\n\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 }\n }\n\n return r;\n}\nexport function __spreadArray(to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) {\n to[j] = from[i];\n }\n\n return to;\n}\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []),\n i,\n q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () {\n return this;\n }, i;\n\n function verb(n) {\n if (g[n]) i[n] = function (v) {\n return new Promise(function (a, b) {\n q.push([n, v, a, b]) > 1 || resume(n, v);\n });\n };\n }\n\n function resume(n, v) {\n try {\n step(g[n](v));\n } catch (e) {\n settle(q[0][3], e);\n }\n }\n\n function step(r) {\n r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);\n }\n\n function fulfill(value) {\n resume(\"next\", value);\n }\n\n function reject(value) {\n resume(\"throw\", value);\n }\n\n function settle(f, v) {\n if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);\n }\n}\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) {\n throw e;\n }), verb(\"return\"), i[Symbol.iterator] = function () {\n return this;\n }, i;\n\n function verb(n, f) {\n i[n] = o[n] ? function (v) {\n return (p = !p) ? {\n value: __await(o[n](v)),\n done: n === \"return\"\n } : f ? f(v) : v;\n } : f;\n }\n}\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator],\n i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () {\n return this;\n }, i);\n\n function verb(n) {\n i[n] = o[n] && function (v) {\n return new Promise(function (resolve, reject) {\n v = o[n](v), settle(resolve, reject, v.done, v.value);\n });\n };\n }\n\n function settle(resolve, reject, d, v) {\n Promise.resolve(v).then(function (v) {\n resolve({\n value: v,\n done: d\n });\n }, reject);\n }\n}\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) {\n Object.defineProperty(cooked, \"raw\", {\n value: raw\n });\n } else {\n cooked.raw = raw;\n }\n\n return cooked;\n}\n;\n\nvar __setModuleDefault = Object.create ? function (o, v) {\n Object.defineProperty(o, \"default\", {\n enumerable: true,\n value: v\n });\n} : function (o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) {\n if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n }\n\n __setModuleDefault(result, mod);\n\n return result;\n}\nexport function __importDefault(mod) {\n return mod && mod.__esModule ? mod : {\n default: mod\n };\n}\nexport function __classPrivateFieldGet(receiver, privateMap) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to get private field on non-instance\");\n }\n\n return privateMap.get(receiver);\n}\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to set private field on non-instance\");\n }\n\n privateMap.set(receiver, value);\n return value;\n}","/**\n * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt\n */\nvar SUPPORTED_LOCALE = {\n tr: {\n regexp: /\\u0130|\\u0049|\\u0049\\u0307/g,\n map: {\n İ: \"i\",\n I: \"\\u0131\",\n İ: \"i\"\n }\n },\n az: {\n regexp: /\\u0130/g,\n map: {\n İ: \"i\",\n I: \"\\u0131\",\n İ: \"i\"\n }\n },\n lt: {\n regexp: /\\u0049|\\u004A|\\u012E|\\u00CC|\\u00CD|\\u0128/g,\n map: {\n I: \"i\\u0307\",\n J: \"j\\u0307\",\n Į: \"\\u012F\\u0307\",\n Ì: \"i\\u0307\\u0300\",\n Í: \"i\\u0307\\u0301\",\n Ĩ: \"i\\u0307\\u0303\"\n }\n }\n};\n/**\n * Localized lower case.\n */\n\nexport function localeLowerCase(str, locale) {\n var lang = SUPPORTED_LOCALE[locale.toLowerCase()];\n if (lang) return lowerCase(str.replace(lang.regexp, function (m) {\n return lang.map[m];\n }));\n return lowerCase(str);\n}\n/**\n * Lower case as a function.\n */\n\nexport function lowerCase(str) {\n return str.toLowerCase();\n}","import \"core-js/modules/es.array.reduce.js\";\nimport { lowerCase } from \"lower-case\"; // Support camel case (\"camelCase\" -> \"camel Case\" and \"CAMELCase\" -> \"CAMEL Case\").\n\nvar DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g]; // Remove all non-word characters.\n\nvar DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;\n/**\n * Normalize the string into something other libraries can manipulate easier.\n */\n\nexport function noCase(input, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _a = options.splitRegexp,\n splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a,\n _b = options.stripRegexp,\n stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b,\n _c = options.transform,\n transform = _c === void 0 ? lowerCase : _c,\n _d = options.delimiter,\n delimiter = _d === void 0 ? \" \" : _d;\n var result = replace(replace(input, splitRegexp, \"$1\\0$2\"), stripRegexp, \"\\0\");\n var start = 0;\n var end = result.length; // Trim the delimiter from around the output string.\n\n while (result.charAt(start) === \"\\0\") {\n start++;\n }\n\n while (result.charAt(end - 1) === \"\\0\") {\n end--;\n } // Transform each token independently.\n\n\n return result.slice(start, end).split(\"\\0\").map(transform).join(delimiter);\n}\n/**\n * Replace `re` in the input string with the replacement value.\n */\n\nfunction replace(input, re, value) {\n if (re instanceof RegExp) return input.replace(re, value);\n return re.reduce(function (input, re) {\n return input.replace(re, value);\n }, input);\n}","import { __assign } from \"tslib\";\nimport { noCase } from \"no-case\";\nexport function pascalCaseTransform(input, index) {\n var firstChar = input.charAt(0);\n var lowerChars = input.substr(1).toLowerCase();\n\n if (index > 0 && firstChar >= \"0\" && firstChar <= \"9\") {\n return \"_\" + firstChar + lowerChars;\n }\n\n return \"\" + firstChar.toUpperCase() + lowerChars;\n}\nexport function pascalCaseTransformMerge(input) {\n return input.charAt(0).toUpperCase() + input.slice(1).toLowerCase();\n}\nexport function pascalCase(input, options) {\n if (options === void 0) {\n options = {};\n }\n\n return noCase(input, __assign({\n delimiter: \"\",\n transform: pascalCaseTransform\n }, options));\n}","import { __assign } from \"tslib\";\nimport { pascalCase, pascalCaseTransform, pascalCaseTransformMerge } from \"pascal-case\";\nexport function camelCaseTransform(input, index) {\n if (index === 0) return input.toLowerCase();\n return pascalCaseTransform(input, index);\n}\nexport function camelCaseTransformMerge(input, index) {\n if (index === 0) return input.toLowerCase();\n return pascalCaseTransformMerge(input);\n}\nexport function camelCase(input, options) {\n if (options === void 0) {\n options = {};\n }\n\n return pascalCase(input, __assign({\n transform: camelCaseTransform\n }, options));\n}","export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}","export default function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","import arrayWithHoles from \"@babel/runtime/helpers/esm/arrayWithHoles\";\nimport iterableToArrayLimit from \"@babel/runtime/helpers/esm/iterableToArrayLimit\";\nimport unsupportedIterableToArray from \"@babel/runtime/helpers/esm/unsupportedIterableToArray\";\nimport nonIterableRest from \"@babel/runtime/helpers/esm/nonIterableRest\";\nexport default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}","export default function _iterableToArrayLimit(arr, i) {\n if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nexport default function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}","export default function _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}","import setPrototypeOf from \"@babel/runtime/helpers/esm/setPrototypeOf\";\nimport isNativeReflectConstruct from \"@babel/runtime/helpers/esm/isNativeReflectConstruct\";\nexport default function _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n _construct = Reflect.construct;\n } else {\n _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n\n return _construct.apply(null, arguments);\n}","import getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport setPrototypeOf from \"@babel/runtime/helpers/esm/setPrototypeOf\";\nimport isNativeFunction from \"@babel/runtime/helpers/esm/isNativeFunction\";\nimport construct from \"@babel/runtime/helpers/esm/construct\";\nexport default function _wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n\n _cache.set(Class, Wrapper);\n }\n\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\n\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return setPrototypeOf(Wrapper, Class);\n };\n\n return _wrapNativeSuper(Class);\n}","export default function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}","export default function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}","import _toArray from \"/codebuild/output/src1817154758/src/yuko-site/node_modules/@babel/runtime/helpers/esm/toArray\";\nimport _slicedToArray from \"/codebuild/output/src1817154758/src/yuko-site/node_modules/@babel/runtime/helpers/esm/slicedToArray\";\nimport _toConsumableArray from \"/codebuild/output/src1817154758/src/yuko-site/node_modules/@babel/runtime/helpers/esm/toConsumableArray\";\nimport _assertThisInitialized from \"/codebuild/output/src1817154758/src/yuko-site/node_modules/@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"/codebuild/output/src1817154758/src/yuko-site/node_modules/@babel/runtime/helpers/esm/inherits\";\nimport _possibleConstructorReturn from \"/codebuild/output/src1817154758/src/yuko-site/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"/codebuild/output/src1817154758/src/yuko-site/node_modules/@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _wrapNativeSuper from \"/codebuild/output/src1817154758/src/yuko-site/node_modules/@babel/runtime/helpers/esm/wrapNativeSuper\";\nimport _classCallCheck from \"/codebuild/output/src1817154758/src/yuko-site/node_modules/@babel/runtime/helpers/esm/classCallCheck\";\nimport _regeneratorRuntime from \"/codebuild/output/src1817154758/src/yuko-site/node_modules/@babel/runtime/regenerator\";\nimport \"regenerator-runtime/runtime.js\";\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nvar _marked = /*#__PURE__*/_regeneratorRuntime.mark(toFailures),\n _marked2 = /*#__PURE__*/_regeneratorRuntime.mark(_check);\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\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/**\n * Convert a validation result to an iterable of failures.\n */\n\n\nfunction toFailures(result, context) {\n return _regeneratorRuntime.wrap(function toFailures$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!(result === true)) {\n _context.next = 4;\n break;\n }\n\n ;\n _context.next = 10;\n break;\n\n case 4:\n if (!(result === false)) {\n _context.next = 9;\n break;\n }\n\n _context.next = 7;\n return context.fail();\n\n case 7:\n _context.next = 10;\n break;\n\n case 9:\n return _context.delegateYield(result, \"t0\", 10);\n\n case 10:\n case \"end\":\n return _context.stop();\n }\n }\n }, _marked);\n}\n/**\n * Shifts (removes and returns) the first value from the `input` iterator.\n * Like `Array.prototype.shift()` but for an `Iterator`.\n */\n\n\nfunction iteratorShift(input) {\n var _input$next = input.next(),\n done = _input$next.done,\n value = _input$next.value;\n\n return done ? undefined : value;\n}\n/**\n * `Struct` objects encapsulate the schema for a specific data type (with\n * optional coercion). You can then use the `assert`, `is` or `validate` helpers\n * to validate unknown data against a struct.\n */\n\n\nvar Struct = function Struct(props) {\n _classCallCheck(this, Struct);\n\n var type = props.type,\n schema = props.schema,\n _props$coercer = props.coercer,\n coercer = _props$coercer === void 0 ? function (value) {\n return value;\n } : _props$coercer,\n _props$validator = props.validator,\n validator = _props$validator === void 0 ? function () {\n return [];\n } : _props$validator,\n _props$refiner = props.refiner,\n refiner = _props$refiner === void 0 ? function () {\n return [];\n } : _props$refiner;\n this.type = type;\n this.schema = schema;\n this.coercer = coercer;\n this.validator = validator;\n this.refiner = refiner;\n};\n/**\n * `StructError` objects are thrown (or returned) by Superstruct when its\n * validation fails. The error represents the first error encountered during\n * validation. But they also have an `error.failures` property that holds\n * information for all of the failures encountered.\n */\n\n\nvar StructError = /*#__PURE__*/function (_TypeError) {\n _inherits(StructError, _TypeError);\n\n var _super = _createSuper(StructError);\n\n function StructError(failure, moreFailures) {\n var _this;\n\n _classCallCheck(this, StructError);\n\n var path = failure.path,\n value = failure.value,\n type = failure.type,\n branch = failure.branch,\n rest = _objectWithoutProperties(failure, [\"path\", \"value\", \"type\", \"branch\"]);\n\n var message = \"Expected a value of type `\".concat(type, \"`\").concat(path.length ? \" for `\".concat(path.join('.'), \"`\") : '', \" but received `\").concat(JSON.stringify(value), \"`.\");\n var failuresResult;\n\n function failures() {\n if (!failuresResult) {\n failuresResult = [failure].concat(_toConsumableArray(moreFailures));\n }\n\n return failuresResult;\n }\n\n _this = _super.call(this, message);\n _this.value = value;\n Object.assign(_assertThisInitialized(_this), rest);\n _this.type = type;\n _this.path = path;\n _this.branch = branch;\n _this.failures = failures;\n _this.stack = new Error().stack;\n _this.__proto__ = StructError.prototype;\n return _this;\n }\n\n return StructError;\n}( /*#__PURE__*/_wrapNativeSuper(TypeError));\n/**\n * Assert that a value passes a `Struct`, throwing if it doesn't.\n */\n\n\nfunction assert(value, struct) {\n var result = validate(value, struct);\n\n if (result[0]) {\n throw result[0];\n }\n}\n/**\n * Coerce a value with the coercion logic of `Struct` and validate it.\n */\n\n\nfunction coerce(value, struct) {\n var ret = struct.coercer(value);\n assert(ret, struct);\n return ret;\n}\n/**\n * Check if a value passes a `Struct`.\n */\n\n\nfunction is(value, struct) {\n var result = validate(value, struct);\n return !result[0];\n}\n/**\n * Validate a value against a `Struct`, returning an error if invalid.\n */\n\n\nfunction validate(value, struct) {\n var coercing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (coercing) {\n value = struct.coercer(value);\n }\n\n var failures = _check(value, struct);\n\n var failure = iteratorShift(failures);\n\n if (failure) {\n var error = new StructError(failure, failures);\n return [error, undefined];\n } else {\n return [undefined, value];\n }\n}\n/**\n * Check a value against a `Struct`, returning an iterable of failures.\n */\n\n\nfunction _check(value, struct) {\n var path,\n branch,\n type,\n ctx,\n failures,\n failure,\n _args2 = arguments;\n return _regeneratorRuntime.wrap(function _check$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n path = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : [];\n branch = _args2.length > 3 && _args2[3] !== undefined ? _args2[3] : [];\n type = struct.type;\n ctx = {\n value: value,\n type: type,\n branch: branch,\n path: path,\n fail: function fail() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _objectSpread2({\n value: value,\n type: type,\n path: path,\n branch: [].concat(_toConsumableArray(branch), [value])\n }, props);\n },\n check: function check(v, s, parent, key) {\n var p = parent !== undefined ? [].concat(_toConsumableArray(path), [key]) : path;\n var b = parent !== undefined ? [].concat(_toConsumableArray(branch), [parent]) : branch;\n return _check(v, s, p, b);\n }\n };\n failures = toFailures(struct.validator(value, ctx), ctx);\n failure = iteratorShift(failures);\n\n if (!failure) {\n _context2.next = 12;\n break;\n }\n\n _context2.next = 9;\n return failure;\n\n case 9:\n return _context2.delegateYield(failures, \"t0\", 10);\n\n case 10:\n _context2.next = 13;\n break;\n\n case 12:\n return _context2.delegateYield(toFailures(struct.refiner(value, ctx), ctx), \"t1\", 13);\n\n case 13:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _marked2);\n}\n/**\n * Augment a `Struct` to add an additional coercion step to its input.\n */\n\n\nfunction coercion(struct, _coercer) {\n var fn = struct.coercer;\n return new Struct(_objectSpread2(_objectSpread2({}, struct), {}, {\n coercer: function coercer(value) {\n return fn(_coercer(value));\n }\n }));\n}\n/**\n * Augment a struct to coerce a default value for missing values.\n *\n * Note: You must use `coerce(value, Struct)` on the value before validating it\n * to have the value defaulted!\n */\n\n\nfunction defaulted(S, fallback, strict) {\n return coercion(S, function (x) {\n var f = typeof fallback === 'function' ? fallback() : fallback;\n\n if (x === undefined) {\n return f;\n }\n\n if (strict !== true && isPlainObject(x) && isPlainObject(f)) {\n var ret = _objectSpread2({}, x);\n\n var changed = false;\n\n for (var key in f) {\n if (ret[key] === undefined) {\n ret[key] = f[key];\n changed = true;\n }\n }\n\n if (changed) {\n return ret;\n }\n }\n\n return x;\n });\n}\n/**\n * Coerce a value to mask its properties to only that defined in the struct.\n */\n\n\nfunction masked(S) {\n return coercion(S, function (x) {\n if (!isPlainObject(x)) {\n return x;\n }\n\n var ret = {};\n\n for (var key in S.schema) {\n ret[key] = x[key];\n }\n\n return ret;\n });\n}\n/**\n * Check if a value is a plain object.\n */\n\n\nfunction isPlainObject(value) {\n if (Object.prototype.toString.call(value) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(value);\n return prototype === null || prototype === Object.prototype;\n}\n/**\n * Augment a string or array struct to constrain its length to zero.\n */\n\n\nfunction empty(S) {\n return refinement(S, \"\".concat(S.type, \" & Empty\"), function (value) {\n return value.length === 0;\n });\n}\n/**\n * Augment a string or array struct to constrain its length to being between a\n * minimum and maximum size.\n */\n\n\nfunction length(S, min, max) {\n return refinement(S, \"\".concat(S.type, \" & Length<\").concat(min, \",\").concat(max, \">\"), function (value) {\n return min < value.length && value.length < max;\n });\n}\n/**\n * Refine a string struct to match a specific regexp pattern.\n */\n\n\nfunction pattern(S, regexp) {\n return refinement(S, \"\".concat(S.type, \" & Pattern<\").concat(regexp.source, \">\"), function (value) {\n return regexp.test(value);\n });\n}\n/**\n * Augment a `Struct` to add an additional refinement to the validation.\n */\n\n\nfunction refinement(struct, type, _refiner) {\n var fn = struct.refiner;\n return new Struct(_objectSpread2(_objectSpread2({}, struct), {}, {\n type: type,\n refiner: /*#__PURE__*/_regeneratorRuntime.mark(function refiner(value, fail) {\n return _regeneratorRuntime.wrap(function refiner$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n return _context3.delegateYield(toFailures(fn(value, fail), fail), \"t0\", 1);\n\n case 1:\n return _context3.delegateYield(toFailures(_refiner(value, fail), fail), \"t1\", 2);\n\n case 2:\n case \"end\":\n return _context3.stop();\n }\n }\n }, refiner);\n })\n }));\n}\n/**\n * Validate any value.\n */\n\n\nfunction any() {\n return struct('any', function () {\n return true;\n });\n}\n\nfunction array(Element) {\n return new Struct({\n type: \"Array<\".concat(Element ? Element.type : 'unknown', \">\"),\n schema: Element,\n coercer: function coercer(value) {\n return Element && Array.isArray(value) ? value.map(function (v) {\n return coerce(v, Element);\n }) : value;\n },\n validator: /*#__PURE__*/_regeneratorRuntime.mark(function validator(value, ctx) {\n var _iterator, _step, _step$value, i, v;\n\n return _regeneratorRuntime.wrap(function validator$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n if (Array.isArray(value)) {\n _context4.next = 4;\n break;\n }\n\n _context4.next = 3;\n return ctx.fail();\n\n case 3:\n return _context4.abrupt(\"return\");\n\n case 4:\n if (!Element) {\n _context4.next = 21;\n break;\n }\n\n _iterator = _createForOfIteratorHelper(value.entries());\n _context4.prev = 6;\n\n _iterator.s();\n\n case 8:\n if ((_step = _iterator.n()).done) {\n _context4.next = 13;\n break;\n }\n\n _step$value = _slicedToArray(_step.value, 2), i = _step$value[0], v = _step$value[1];\n return _context4.delegateYield(ctx.check(v, Element, value, i), \"t0\", 11);\n\n case 11:\n _context4.next = 8;\n break;\n\n case 13:\n _context4.next = 18;\n break;\n\n case 15:\n _context4.prev = 15;\n _context4.t1 = _context4[\"catch\"](6);\n\n _iterator.e(_context4.t1);\n\n case 18:\n _context4.prev = 18;\n\n _iterator.f();\n\n return _context4.finish(18);\n\n case 21:\n case \"end\":\n return _context4.stop();\n }\n }\n }, validator, null, [[6, 15, 18, 21]]);\n })\n });\n}\n/**\n * Validate that boolean values.\n */\n\n\nfunction boolean() {\n return struct('boolean', function (value) {\n return typeof value === 'boolean';\n });\n}\n/**\n * Validate that `Date` values.\n *\n * Note: this also ensures that the value is *not* an invalid `Date` object,\n * which can occur when parsing a date fails but still returns a `Date`.\n */\n\n\nfunction date() {\n return struct('Date', function (value) {\n return value instanceof Date && !isNaN(value.getTime());\n });\n}\n/**\n * Validate that a value dynamically, determing which struct to use at runtime.\n */\n\n\nfunction dynamic(fn) {\n return struct('Dynamic<...>', function (value, ctx) {\n return ctx.check(value, fn(value, ctx));\n });\n}\n\nfunction enums(values) {\n return struct(\"Enum<\".concat(values.map(toLiteralString), \">\"), function (value) {\n return values.includes(value);\n });\n}\n/**\n * Validate that a value is a function.\n */\n\n\nfunction func() {\n return struct('Function', function (value) {\n return typeof value === 'function';\n });\n}\n/**\n * Validate that a value is an instance of a class.\n */\n\n\nfunction instance(Class) {\n return struct(\"InstanceOf<\".concat(Class.name, \">\"), function (value) {\n return value instanceof Class;\n });\n}\n\nfunction intersection(Structs) {\n return struct(Structs.map(function (s) {\n return s.type;\n }).join(' & '), /*#__PURE__*/_regeneratorRuntime.mark(function _callee(value, ctx) {\n var _iterator2, _step2, S;\n\n return _regeneratorRuntime.wrap(function _callee$(_context5) {\n while (1) {\n switch (_context5.prev = _context5.next) {\n case 0:\n _iterator2 = _createForOfIteratorHelper(Structs);\n _context5.prev = 1;\n\n _iterator2.s();\n\n case 3:\n if ((_step2 = _iterator2.n()).done) {\n _context5.next = 8;\n break;\n }\n\n S = _step2.value;\n return _context5.delegateYield(ctx.check(value, S), \"t0\", 6);\n\n case 6:\n _context5.next = 3;\n break;\n\n case 8:\n _context5.next = 13;\n break;\n\n case 10:\n _context5.prev = 10;\n _context5.t1 = _context5[\"catch\"](1);\n\n _iterator2.e(_context5.t1);\n\n case 13:\n _context5.prev = 13;\n\n _iterator2.f();\n\n return _context5.finish(13);\n\n case 16:\n case \"end\":\n return _context5.stop();\n }\n }\n }, _callee, null, [[1, 10, 13, 16]]);\n }));\n}\n/**\n * Validate a value lazily, by constructing the struct right before the first\n * validation. This is useful for cases where you want to have self-referential\n * structs for nested data structures.\n */\n\n\nfunction lazy(fn) {\n var S;\n return struct('Lazy<...>', function (value, ctx) {\n if (!S) {\n S = fn();\n }\n\n return ctx.check(value, S);\n });\n}\n\nfunction literal(constant) {\n return struct(\"Literal<\".concat(toLiteralString(constant), \">\"), function (value) {\n return value === constant;\n });\n}\n/**\n * Validate that a value is a map with specific key and value entries.\n */\n\n\nfunction map(Key, Value) {\n return struct(\"Map<\".concat(Key.type, \",\").concat(Value.type, \">\"), /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(value, ctx) {\n var _iterator3, _step3, _step3$value, k, v;\n\n return _regeneratorRuntime.wrap(function _callee2$(_context6) {\n while (1) {\n switch (_context6.prev = _context6.next) {\n case 0:\n if (value instanceof Map) {\n _context6.next = 4;\n break;\n }\n\n _context6.next = 3;\n return ctx.fail();\n\n case 3:\n return _context6.abrupt(\"return\");\n\n case 4:\n _iterator3 = _createForOfIteratorHelper(value.entries());\n _context6.prev = 5;\n\n _iterator3.s();\n\n case 7:\n if ((_step3 = _iterator3.n()).done) {\n _context6.next = 13;\n break;\n }\n\n _step3$value = _slicedToArray(_step3.value, 2), k = _step3$value[0], v = _step3$value[1];\n return _context6.delegateYield(ctx.check(k, Key, value, k), \"t0\", 10);\n\n case 10:\n return _context6.delegateYield(ctx.check(v, Value, value, k), \"t1\", 11);\n\n case 11:\n _context6.next = 7;\n break;\n\n case 13:\n _context6.next = 18;\n break;\n\n case 15:\n _context6.prev = 15;\n _context6.t2 = _context6[\"catch\"](5);\n\n _iterator3.e(_context6.t2);\n\n case 18:\n _context6.prev = 18;\n\n _iterator3.f();\n\n return _context6.finish(18);\n\n case 21:\n case \"end\":\n return _context6.stop();\n }\n }\n }, _callee2, null, [[5, 15, 18, 21]]);\n }));\n}\n/**\n * Validate that a value always fails.\n */\n\n\nfunction never() {\n return struct('never', function () {\n return false;\n });\n}\n/**\n * Augment a struct to make it accept `null` values.\n */\n\n\nfunction nullable(S) {\n return new Struct({\n type: \"\".concat(S.type, \" | null\"),\n schema: S.schema,\n validator: function validator(value, ctx) {\n return value === null || ctx.check(value, S);\n }\n });\n}\n/**\n * Validate that a value is a number.\n */\n\n\nfunction number() {\n return struct(\"number\", function (value) {\n return typeof value === 'number' && !isNaN(value);\n });\n}\n\nfunction object(Structs) {\n var knowns = Structs ? Object.keys(Structs) : [];\n var Never = never();\n return new Struct({\n type: Structs ? \"Object<{\".concat(knowns.join(','), \"}>\") : 'Object',\n schema: Structs ? Structs : null,\n coercer: Structs ? createObjectCoercer(Structs) : function (x) {\n return x;\n },\n validator: /*#__PURE__*/_regeneratorRuntime.mark(function validator(value, ctx) {\n var unknowns, _iterator4, _step4, key, Value, v, _iterator5, _step5, _key, _v;\n\n return _regeneratorRuntime.wrap(function validator$(_context7) {\n while (1) {\n switch (_context7.prev = _context7.next) {\n case 0:\n if (!(typeof value !== 'object' || value == null)) {\n _context7.next = 4;\n break;\n }\n\n _context7.next = 3;\n return ctx.fail();\n\n case 3:\n return _context7.abrupt(\"return\");\n\n case 4:\n if (!Structs) {\n _context7.next = 42;\n break;\n }\n\n unknowns = new Set(Object.keys(value));\n _iterator4 = _createForOfIteratorHelper(knowns);\n _context7.prev = 7;\n\n _iterator4.s();\n\n case 9:\n if ((_step4 = _iterator4.n()).done) {\n _context7.next = 17;\n break;\n }\n\n key = _step4.value;\n unknowns.delete(key);\n Value = Structs[key];\n v = value[key];\n return _context7.delegateYield(ctx.check(v, Value, value, key), \"t0\", 15);\n\n case 15:\n _context7.next = 9;\n break;\n\n case 17:\n _context7.next = 22;\n break;\n\n case 19:\n _context7.prev = 19;\n _context7.t1 = _context7[\"catch\"](7);\n\n _iterator4.e(_context7.t1);\n\n case 22:\n _context7.prev = 22;\n\n _iterator4.f();\n\n return _context7.finish(22);\n\n case 25:\n _iterator5 = _createForOfIteratorHelper(unknowns);\n _context7.prev = 26;\n\n _iterator5.s();\n\n case 28:\n if ((_step5 = _iterator5.n()).done) {\n _context7.next = 34;\n break;\n }\n\n _key = _step5.value;\n _v = value[_key];\n return _context7.delegateYield(ctx.check(_v, Never, value, _key), \"t2\", 32);\n\n case 32:\n _context7.next = 28;\n break;\n\n case 34:\n _context7.next = 39;\n break;\n\n case 36:\n _context7.prev = 36;\n _context7.t3 = _context7[\"catch\"](26);\n\n _iterator5.e(_context7.t3);\n\n case 39:\n _context7.prev = 39;\n\n _iterator5.f();\n\n return _context7.finish(39);\n\n case 42:\n case \"end\":\n return _context7.stop();\n }\n }\n }, validator, null, [[7, 19, 22, 25], [26, 36, 39, 42]]);\n })\n });\n}\n/**\n * Augment a struct to make it optionally accept `undefined` values.\n */\n\n\nfunction optional(S) {\n return new Struct({\n type: \"\".concat(S.type, \"?\"),\n schema: S.schema,\n validator: function validator(value, ctx) {\n return value === undefined || ctx.check(value, S);\n }\n });\n}\n/**\n * Validate that a partial object with specific entry values.\n */\n\n\nfunction partial(Structs) {\n if (Structs instanceof Struct) {\n Structs = Structs.schema;\n }\n\n var knowns = Object.keys(Structs);\n var Never = never();\n return new Struct({\n type: \"Partial<{\".concat(knowns.join(','), \"}>\"),\n schema: Structs,\n coercer: createObjectCoercer(Structs),\n validator: /*#__PURE__*/_regeneratorRuntime.mark(function validator(value, ctx) {\n var unknowns, _iterator6, _step6, key, Value, v, _iterator7, _step7, _key2, _v2;\n\n return _regeneratorRuntime.wrap(function validator$(_context8) {\n while (1) {\n switch (_context8.prev = _context8.next) {\n case 0:\n if (!(typeof value !== 'object' || value == null)) {\n _context8.next = 4;\n break;\n }\n\n _context8.next = 3;\n return ctx.fail();\n\n case 3:\n return _context8.abrupt(\"return\");\n\n case 4:\n unknowns = new Set(Object.keys(value));\n _iterator6 = _createForOfIteratorHelper(knowns);\n _context8.prev = 6;\n\n _iterator6.s();\n\n case 8:\n if ((_step6 = _iterator6.n()).done) {\n _context8.next = 18;\n break;\n }\n\n key = _step6.value;\n unknowns.delete(key);\n\n if (key in value) {\n _context8.next = 13;\n break;\n }\n\n return _context8.abrupt(\"continue\", 16);\n\n case 13:\n Value = Structs[key];\n v = value[key];\n return _context8.delegateYield(ctx.check(v, Value, value, key), \"t0\", 16);\n\n case 16:\n _context8.next = 8;\n break;\n\n case 18:\n _context8.next = 23;\n break;\n\n case 20:\n _context8.prev = 20;\n _context8.t1 = _context8[\"catch\"](6);\n\n _iterator6.e(_context8.t1);\n\n case 23:\n _context8.prev = 23;\n\n _iterator6.f();\n\n return _context8.finish(23);\n\n case 26:\n _iterator7 = _createForOfIteratorHelper(unknowns);\n _context8.prev = 27;\n\n _iterator7.s();\n\n case 29:\n if ((_step7 = _iterator7.n()).done) {\n _context8.next = 35;\n break;\n }\n\n _key2 = _step7.value;\n _v2 = value[_key2];\n return _context8.delegateYield(ctx.check(_v2, Never, value, _key2), \"t2\", 33);\n\n case 33:\n _context8.next = 29;\n break;\n\n case 35:\n _context8.next = 40;\n break;\n\n case 37:\n _context8.prev = 37;\n _context8.t3 = _context8[\"catch\"](27);\n\n _iterator7.e(_context8.t3);\n\n case 40:\n _context8.prev = 40;\n\n _iterator7.f();\n\n return _context8.finish(40);\n\n case 43:\n case \"end\":\n return _context8.stop();\n }\n }\n }, validator, null, [[6, 20, 23, 26], [27, 37, 40, 43]]);\n })\n });\n}\n/**\n * Validate that a value is a record with specific key and\n * value entries.\n */\n\n\nfunction record(Key, Value) {\n return struct(\"Record<\".concat(Key.type, \",\").concat(Value.type, \">\"), /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(value, ctx) {\n var k, v;\n return _regeneratorRuntime.wrap(function _callee3$(_context9) {\n while (1) {\n switch (_context9.prev = _context9.next) {\n case 0:\n if (!(typeof value !== 'object' || value == null)) {\n _context9.next = 4;\n break;\n }\n\n _context9.next = 3;\n return ctx.fail();\n\n case 3:\n return _context9.abrupt(\"return\");\n\n case 4:\n _context9.t0 = _regeneratorRuntime.keys(value);\n\n case 5:\n if ((_context9.t1 = _context9.t0()).done) {\n _context9.next = 12;\n break;\n }\n\n k = _context9.t1.value;\n v = value[k];\n return _context9.delegateYield(ctx.check(k, Key, value, k), \"t2\", 9);\n\n case 9:\n return _context9.delegateYield(ctx.check(v, Value, value, k), \"t3\", 10);\n\n case 10:\n _context9.next = 5;\n break;\n\n case 12:\n case \"end\":\n return _context9.stop();\n }\n }\n }, _callee3);\n }));\n}\n/**\n * Validate that a set of values matches a specific type.\n */\n\n\nfunction set(Element) {\n return struct(\"Set<\".concat(Element.type, \">\"), function (value, ctx) {\n if (!(value instanceof Set)) {\n return false;\n }\n\n var _iterator8 = _createForOfIteratorHelper(value),\n _step8;\n\n try {\n for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {\n var val = _step8.value;\n\n var _ctx$check = ctx.check(val, Element),\n _ctx$check2 = _slicedToArray(_ctx$check, 1),\n failure = _ctx$check2[0];\n\n if (failure) {\n return false;\n }\n }\n } catch (err) {\n _iterator8.e(err);\n } finally {\n _iterator8.f();\n }\n\n return true;\n });\n}\n/**\n * Validate that a value is a string.\n */\n\n\nfunction string() {\n return struct('string', function (value) {\n return typeof value === 'string';\n });\n}\n/**\n * Define a `Struct` instance with a type and validation function.\n */\n\n\nfunction struct(name, validator) {\n return new Struct({\n type: name,\n validator: validator,\n schema: null\n });\n}\n\nfunction tuple(Elements) {\n var Never = never();\n return struct(\"[\".concat(Elements.map(function (s) {\n return s.type;\n }).join(','), \"]\"), /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(value, ctx) {\n var _iterator9, _step9, _step9$value, _index, Element, _v3, index, v;\n\n return _regeneratorRuntime.wrap(function _callee4$(_context10) {\n while (1) {\n switch (_context10.prev = _context10.next) {\n case 0:\n if (Array.isArray(value)) {\n _context10.next = 4;\n break;\n }\n\n _context10.next = 3;\n return ctx.fail();\n\n case 3:\n return _context10.abrupt(\"return\");\n\n case 4:\n _iterator9 = _createForOfIteratorHelper(Elements.entries());\n _context10.prev = 5;\n\n _iterator9.s();\n\n case 7:\n if ((_step9 = _iterator9.n()).done) {\n _context10.next = 13;\n break;\n }\n\n _step9$value = _slicedToArray(_step9.value, 2), _index = _step9$value[0], Element = _step9$value[1];\n _v3 = value[_index];\n return _context10.delegateYield(ctx.check(_v3, Element, value, _index), \"t0\", 11);\n\n case 11:\n _context10.next = 7;\n break;\n\n case 13:\n _context10.next = 18;\n break;\n\n case 15:\n _context10.prev = 15;\n _context10.t1 = _context10[\"catch\"](5);\n\n _iterator9.e(_context10.t1);\n\n case 18:\n _context10.prev = 18;\n\n _iterator9.f();\n\n return _context10.finish(18);\n\n case 21:\n if (!(value.length > Elements.length)) {\n _context10.next = 25;\n break;\n }\n\n index = Elements.length;\n v = value[index];\n return _context10.delegateYield(ctx.check(v, Never, value, index), \"t2\", 25);\n\n case 25:\n case \"end\":\n return _context10.stop();\n }\n }\n }, _callee4, null, [[5, 15, 18, 21]]);\n }));\n}\n/**\n * Validate that a value matches a specific strutural interface, like the\n * structural typing that TypeScript uses.\n */\n\n\nfunction type(Structs) {\n var keys = Object.keys(Structs);\n return struct(\"Type<{\".concat(keys.join(','), \"}>\"), /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(value, ctx) {\n var _iterator10, _step10, key, Value, v;\n\n return _regeneratorRuntime.wrap(function _callee5$(_context11) {\n while (1) {\n switch (_context11.prev = _context11.next) {\n case 0:\n if (!(typeof value !== 'object' || value == null)) {\n _context11.next = 4;\n break;\n }\n\n _context11.next = 3;\n return ctx.fail();\n\n case 3:\n return _context11.abrupt(\"return\");\n\n case 4:\n _iterator10 = _createForOfIteratorHelper(keys);\n _context11.prev = 5;\n\n _iterator10.s();\n\n case 7:\n if ((_step10 = _iterator10.n()).done) {\n _context11.next = 14;\n break;\n }\n\n key = _step10.value;\n Value = Structs[key];\n v = value[key];\n return _context11.delegateYield(ctx.check(v, Value, value, key), \"t0\", 12);\n\n case 12:\n _context11.next = 7;\n break;\n\n case 14:\n _context11.next = 19;\n break;\n\n case 16:\n _context11.prev = 16;\n _context11.t1 = _context11[\"catch\"](5);\n\n _iterator10.e(_context11.t1);\n\n case 19:\n _context11.prev = 19;\n\n _iterator10.f();\n\n return _context11.finish(19);\n\n case 22:\n case \"end\":\n return _context11.stop();\n }\n }\n }, _callee5, null, [[5, 16, 19, 22]]);\n }));\n}\n\nfunction union(Structs) {\n return struct(\"\".concat(Structs.map(function (s) {\n return s.type;\n }).join(' | ')), /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(value, ctx) {\n var _iterator11, _step11, S, _ctx$check3, _ctx$check4, failures;\n\n return _regeneratorRuntime.wrap(function _callee6$(_context12) {\n while (1) {\n switch (_context12.prev = _context12.next) {\n case 0:\n _iterator11 = _createForOfIteratorHelper(Structs);\n _context12.prev = 1;\n\n _iterator11.s();\n\n case 3:\n if ((_step11 = _iterator11.n()).done) {\n _context12.next = 10;\n break;\n }\n\n S = _step11.value;\n _ctx$check3 = ctx.check(value, S), _ctx$check4 = _toArray(_ctx$check3), failures = _ctx$check4.slice(0);\n\n if (!(failures.length === 0)) {\n _context12.next = 8;\n break;\n }\n\n return _context12.abrupt(\"return\");\n\n case 8:\n _context12.next = 3;\n break;\n\n case 10:\n _context12.next = 15;\n break;\n\n case 12:\n _context12.prev = 12;\n _context12.t0 = _context12[\"catch\"](1);\n\n _iterator11.e(_context12.t0);\n\n case 15:\n _context12.prev = 15;\n\n _iterator11.f();\n\n return _context12.finish(15);\n\n case 18:\n _context12.next = 20;\n return ctx.fail();\n\n case 20:\n case \"end\":\n return _context12.stop();\n }\n }\n }, _callee6, null, [[1, 12, 15, 18]]);\n }));\n}\n/**\n * Convert a value to a literal string.\n */\n\n\nfunction toLiteralString(value) {\n return typeof value === 'string' ? \"\\\"\".concat(value.replace(/\"/g, '\"'), \"\\\"\") : \"\".concat(value);\n}\n/**\n * Coerce the values of an object-like struct.\n */\n\n\nfunction createObjectCoercer(Structs) {\n var knowns = Object.keys(Structs);\n return function (value) {\n if (typeof value !== 'object' || value == null) {\n return value;\n }\n\n var ret = {};\n var unknowns = new Set(Object.keys(value));\n\n var _iterator12 = _createForOfIteratorHelper(knowns),\n _step12;\n\n try {\n for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {\n var key = _step12.value;\n unknowns.delete(key);\n var Value = Structs[key];\n var v = value[key];\n ret[key] = coerce(v, Value);\n }\n } catch (err) {\n _iterator12.e(err);\n } finally {\n _iterator12.f();\n }\n\n var _iterator13 = _createForOfIteratorHelper(unknowns),\n _step13;\n\n try {\n for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {\n var _key3 = _step13.value;\n ret[_key3] = value[_key3];\n }\n } catch (err) {\n _iterator13.e(err);\n } finally {\n _iterator13.f();\n }\n\n return ret;\n };\n}\n\nexport { Struct, StructError, any, array, assert, boolean, coerce, coercion, date, defaulted, dynamic, empty, enums, func, instance, intersection, is, lazy, length, literal, map, masked, never, nullable, number, object, optional, partial, pattern, record, refinement, set, string, struct, tuple, type, union, validate };","import setPrototypeOf from \"@babel/runtime/helpers/esm/setPrototypeOf\";\nexport default function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}","import arrayWithHoles from \"@babel/runtime/helpers/esm/arrayWithHoles\";\nimport iterableToArray from \"@babel/runtime/helpers/esm/iterableToArray\";\nimport unsupportedIterableToArray from \"@babel/runtime/helpers/esm/unsupportedIterableToArray\";\nimport nonIterableRest from \"@babel/runtime/helpers/esm/nonIterableRest\";\nexport default function _toArray(arr) {\n return arrayWithHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableRest();\n}","import * as React from 'react'\nimport { pascalCase, pascalCaseTransformMerge } from 'pascal-case'\n\n/**\n * Returns a namespaced string intended for logging.\n *\n * @param message Message to namespace.\n *\n * @returns Namespaced message.\n */\nexport const msg = (message: string) => `gatsby-source-prismic - ${message}`\n\n/**\n * Maps key-value tuples of an object to new key-value tuples to create a new\n * object.\n *\n * @param fn Function that maps a key-value tuple to a new key-value tuple.\n * @param obj Object to map to a new object.\n *\n * @returns New object with mapped key-values.\n */\nexport const mapObj = (\n fn: (entry: [string, T1]) => [string, T2],\n obj: { [key: string]: T1 },\n): { [key: string]: T2 } => {\n const entries = Object.entries(obj)\n const pairs = entries.map((x) => fn(x))\n\n const result: { [key: string]: T2 } = {}\n\n for (let i = 0; i < pairs.length; i++) {\n const [k, v] = pairs[i]\n result[k] = v\n }\n\n return result\n}\n\n/**\n * Maps key-value tuples of an object to new key-value tuples to create a new\n * object. The mapper function can be async.\n *\n * @param fn Function that maps a key-value tuple to a new key-value tuple.\n * @param obj Object to map to a new object.\n *\n * @returns New object with mapped key-values.\n */\nexport const mapObjP = async (\n fn: (entry: [string, T1]) => Promise<[string, T2]>,\n obj: { [key: string]: T1 },\n): Promise<{ [key: string]: T2 }> => {\n const entries = Object.entries(obj)\n const pairs = await Promise.all(entries.map((x) => Promise.resolve(fn(x))))\n\n const result: { [key: string]: T2 } = {}\n\n for (let i = 0; i < pairs.length; i++) {\n const [k, v] = pairs[i]\n result[k] = v\n }\n\n return result\n}\n\n/**\n * Maps values of an object to new values.\n *\n * @param fn Function that maps a value and key to a new value.\n * @param obj Object to map to a new object.\n *\n * @returns New object with mapped values.\n */\nexport const mapObjVals = (\n fn: (val: T1, key: string) => T2,\n obj: { [key: string]: T1 },\n): { [key: string]: T2 } => {\n const result: { [key: string]: T2 } = {}\n\n for (const key in obj) result[key] = fn(obj[key], key)\n\n return result\n}\n\n/**\n * Maps values of an object to new values.\n *\n * @param fn Function that maps a value and key to a new value.\n * @param obj Object to map to a new object.\n *\n * @returns New object with mapped values.\n */\nexport const mapObjValsP = async (\n fn: (val: T1, key: string) => Promise,\n obj: { [key: string]: T1 },\n): Promise<{ [key: string]: T2 }> => {\n const result: { [key: string]: T2 } = {}\n\n const keys = Object.keys(obj)\n await Promise.all(\n keys.map(async (key) => {\n result[key] = await fn(obj[key], key)\n }),\n )\n\n return result\n}\n\n/**\n * Returns true if the provided object has no keys, false otherwise.\n *\n * @param obj Object to check.\n *\n * @returns `true` if `obj` has no keys, `false` otherwise.\n */\nexport const isEmptyObj = (obj: object) => {\n for (const _ in obj) return false\n return true\n}\n\n/**\n * Returns a valid GraphQL type name for a Prismic schema.\n *\n * @param apiId API ID of the schema.\n *\n * @returns Type name for the schema.\n */\nexport const buildSchemaTypeName = (apiId: string) =>\n pascalCase(`Prismic ${apiId}`, { transform: pascalCaseTransformMerge })\n\n/**\n * Determines whether the current context is the browser.\n *\n * @returns `true` if the current context is the browser, `false` otherwise.\n */\nexport const isBrowser = typeof window !== 'undefined'\n\nexport const getComponentDisplayName = (\n WrappedComponent: React.ComponentType,\n) => WrappedComponent.displayName || WrappedComponent.name || 'Component'\n\n/**\n * Separates an array in to an array of arrays\n * @param arr The array to chunk\n * @param size the maximum size for each of the resulting arrays\n */\nexport function chunk(arr: T[], size: number): Array {\n const chunks = []\n\n let i = 0\n\n while (i < arr.length) {\n const a = arr.slice(i, (i += size))\n chunks.push(a)\n }\n\n return chunks\n}\n","import { FixedObject, FluidObject } from 'gatsby-image'\nimport * as A from 'fp-ts/lib/Array'\nimport * as O from 'fp-ts/lib/Option'\nimport * as R from 'fp-ts/lib/Record'\nimport { eqNumber } from 'fp-ts/lib/Eq'\nimport { ordNumber } from 'fp-ts/lib/Ord'\nimport { pipe } from 'fp-ts/lib/pipeable'\n\nimport { ImgixUrlParams, ImgixFixedArgs, ImgixFluidArgs } from './types'\nimport {\n setURLSearchParams,\n signURL,\n semigroupImgixUrlParams,\n join,\n} from './utils'\n\nexport const DEFAULT_FIXED_WIDTH = 400\nexport const DEFAULT_FLUID_MAX_WIDTH = 800\n\n// Resolutions for `fixed` images. Same as `gatsby-plugin-sharp`.\nconst FIXED_RESOLUTIONS = [1, 1.5, 2]\n\n// Breakpoint factors for `fluid` images. Same as `gatsby-plugin-sharp`.\nconst FLUID_BREAKPOINT_FACTORS = [0.25, 0.5, 1.5, 2]\n\n// Default params for placeholder images.\nconst DEFAULT_LQIP_PARAMS: ImgixUrlParams = { w: 100, blur: 15, q: 20 }\n\nexport const buildImgixUrl = (url: string, secureUrlToken?: string) => (\n params: ImgixUrlParams,\n): string =>\n pipe(\n params,\n // TODO: Replace filterMap with map. filterMap is being used here just\n // because it fibs the types a bit.\n R.filterMap((param) =>\n param === undefined ? O.some(undefined) : O.some(String(param)),\n ),\n setURLSearchParams(url),\n signURL(O.fromNullable(secureUrlToken)),\n )\n\nconst buildImgixLqipUrl = (url: string, secureUrlToken?: string) => (\n params: ImgixUrlParams,\n): string =>\n pipe(\n semigroupImgixUrlParams.concat(DEFAULT_LQIP_PARAMS, params),\n buildImgixUrl(url, secureUrlToken),\n )\n\nconst buildImgixFixedSrcSet = (baseUrl: string, secureUrlToken?: string) => (\n params: ImgixUrlParams,\n): string =>\n pipe(\n FIXED_RESOLUTIONS,\n A.map((dpr) =>\n pipe(\n semigroupImgixUrlParams.concat(params, { dpr }),\n buildImgixUrl(baseUrl, secureUrlToken),\n (url) => `${url} ${dpr}x`,\n ),\n ),\n join(', '),\n )\n\ntype BuildImgixFixedArgs = {\n url: string\n sourceWidth: number\n sourceHeight: number\n secureUrlToken?: string\n args?: ImgixFixedArgs\n}\n\n/**\n * Builds a gatsby-image-compatible fixed image object from a base Imgix image URL.\n *\n * @returns gatsby-image-compatible fixed image object.\n */\nexport const buildImgixFixed = ({\n url,\n sourceWidth,\n sourceHeight,\n secureUrlToken,\n args = {},\n}: BuildImgixFixedArgs): FixedObject => {\n const aspectRatio = sourceWidth / sourceHeight\n\n let width: number\n let height: number\n\n if (args.width != undefined && args.height != undefined) {\n width = args.width\n height = args.height\n } else if (args.width != undefined) {\n width = args.width\n height = Math.round(width / aspectRatio)\n } else if (args.height != undefined) {\n width = Math.round(args.height * aspectRatio)\n height = args.height\n } else {\n width = DEFAULT_FIXED_WIDTH\n height = Math.round(width / aspectRatio)\n }\n\n const base64 = buildImgixLqipUrl(\n url,\n secureUrlToken,\n )({\n ...args.imgixParams,\n ...args.placeholderImgixParams,\n })\n\n const src = buildImgixUrl(\n url,\n secureUrlToken,\n )({\n ...args.imgixParams,\n w: width,\n h: height,\n })\n\n const srcSet = buildImgixFixedSrcSet(\n url,\n secureUrlToken,\n )({\n ...args.imgixParams,\n w: width,\n h: height,\n })\n\n return {\n base64,\n width,\n height,\n src,\n srcWebp: src,\n srcSet,\n srcSetWebp: srcSet,\n }\n}\n\ntype BuildFluidSrcSetArgs = {\n aspectRatio: number\n maxWidth: number\n srcSetBreakpoints?: number[]\n}\n\nconst buildImgixFluidSrcSet = (baseUrl: string, secureUrlToken?: string) => (\n params: ImgixUrlParams,\n) => ({\n aspectRatio,\n maxWidth,\n srcSetBreakpoints = FLUID_BREAKPOINT_FACTORS.map((x) => maxWidth * x),\n}: BuildFluidSrcSetArgs): string =>\n pipe(\n A.cons(maxWidth, srcSetBreakpoints),\n A.uniq(eqNumber),\n A.sort(ordNumber),\n A.map((breakpoint) =>\n pipe(\n semigroupImgixUrlParams.concat(params, {\n w: Math.round(breakpoint),\n h: Math.round(breakpoint / aspectRatio),\n }),\n buildImgixUrl(baseUrl, secureUrlToken),\n (url) => `${url} ${Math.round(breakpoint)}w`,\n ),\n ),\n join(', '),\n )\n\ntype BuildImgixFluidArgs = {\n url: string\n sourceWidth: number\n sourceHeight: number\n secureUrlToken?: string\n args?: ImgixFluidArgs\n}\n\n/**\n * Builds a gatsby-image-compatible fluid image object from a base Imgix image URL.\n *\n * @returns gatsby-image-compatible fluid image object.\n */\nexport const buildImgixFluid = ({\n url,\n sourceWidth,\n sourceHeight,\n secureUrlToken,\n args = {},\n}: BuildImgixFluidArgs): FluidObject => {\n const aspectRatio = sourceWidth / sourceHeight\n const maxWidth = args.maxWidth ?? DEFAULT_FLUID_MAX_WIDTH\n\n const base64 = buildImgixLqipUrl(\n url,\n secureUrlToken,\n )({\n ...args.imgixParams,\n ...args.placeholderImgixParams,\n })\n\n const src = buildImgixUrl(\n url,\n secureUrlToken,\n )({\n ...args.imgixParams,\n w: maxWidth,\n h: args.maxHeight,\n })\n\n const srcSet = buildImgixFluidSrcSet(\n url,\n secureUrlToken,\n )(args.imgixParams ?? {})({\n aspectRatio,\n maxWidth: maxWidth,\n srcSetBreakpoints: args.srcSetBreakpoints,\n })\n\n return {\n base64,\n aspectRatio,\n src,\n srcWebp: src,\n srcSet,\n srcSetWebp: srcSet,\n sizes: '',\n }\n}\n","export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;","import validate from './validate.js';\n\nfunction parse(uuid) {\n if (!validate(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n var v;\n var arr = new Uint8Array(16); // Parse ########-....-....-....-............\n\n arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;\n arr[1] = v >>> 16 & 0xff;\n arr[2] = v >>> 8 & 0xff;\n arr[3] = v & 0xff; // Parse ........-####-....-....-............\n\n arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;\n arr[5] = v & 0xff; // Parse ........-....-####-....-............\n\n arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;\n arr[7] = v & 0xff; // Parse ........-....-....-####-............\n\n arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;\n arr[9] = v & 0xff; // Parse ........-....-....-....-############\n // (Use \"/\" to avoid 32-bit truncation when bit-shifting high-order bytes)\n\n arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;\n arr[11] = v / 0x100000000 & 0xff;\n arr[12] = v >>> 24 & 0xff;\n arr[13] = v >>> 16 & 0xff;\n arr[14] = v >>> 8 & 0xff;\n arr[15] = v & 0xff;\n return arr;\n}\n\nexport default parse;","// Adapted from Chris Veness' SHA1 code at\n// http://www.movable-type.co.uk/scripts/sha1.html\nfunction f(s, x, y, z) {\n switch (s) {\n case 0:\n return x & y ^ ~x & z;\n\n case 1:\n return x ^ y ^ z;\n\n case 2:\n return x & y ^ x & z ^ y & z;\n\n case 3:\n return x ^ y ^ z;\n }\n}\n\nfunction ROTL(x, n) {\n return x << n | x >>> 32 - n;\n}\n\nfunction sha1(bytes) {\n var K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];\n var H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];\n\n if (typeof bytes === 'string') {\n var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape\n\n bytes = [];\n\n for (var i = 0; i < msg.length; ++i) {\n bytes.push(msg.charCodeAt(i));\n }\n } else if (!Array.isArray(bytes)) {\n // Convert Array-like to Array\n bytes = Array.prototype.slice.call(bytes);\n }\n\n bytes.push(0x80);\n var l = bytes.length / 4 + 2;\n var N = Math.ceil(l / 16);\n var M = new Array(N);\n\n for (var _i = 0; _i < N; ++_i) {\n var arr = new Uint32Array(16);\n\n for (var j = 0; j < 16; ++j) {\n arr[j] = bytes[_i * 64 + j * 4] << 24 | bytes[_i * 64 + j * 4 + 1] << 16 | bytes[_i * 64 + j * 4 + 2] << 8 | bytes[_i * 64 + j * 4 + 3];\n }\n\n M[_i] = arr;\n }\n\n M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);\n M[N - 1][14] = Math.floor(M[N - 1][14]);\n M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff;\n\n for (var _i2 = 0; _i2 < N; ++_i2) {\n var W = new Uint32Array(80);\n\n for (var t = 0; t < 16; ++t) {\n W[t] = M[_i2][t];\n }\n\n for (var _t = 16; _t < 80; ++_t) {\n W[_t] = ROTL(W[_t - 3] ^ W[_t - 8] ^ W[_t - 14] ^ W[_t - 16], 1);\n }\n\n var a = H[0];\n var b = H[1];\n var c = H[2];\n var d = H[3];\n var e = H[4];\n\n for (var _t2 = 0; _t2 < 80; ++_t2) {\n var s = Math.floor(_t2 / 20);\n var T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[_t2] >>> 0;\n e = d;\n d = c;\n c = ROTL(b, 30) >>> 0;\n b = a;\n a = T;\n }\n\n H[0] = H[0] + a >>> 0;\n H[1] = H[1] + b >>> 0;\n H[2] = H[2] + c >>> 0;\n H[3] = H[3] + d >>> 0;\n H[4] = H[4] + e >>> 0;\n }\n\n return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff];\n}\n\nexport default sha1;","import {\n PluginOptions as GatsbyPluginOptions,\n SourceNodesArgs,\n NodeInput,\n Node,\n} from 'gatsby'\nimport { FixedObject, FluidObject } from 'gatsby-image'\nimport { Document as PrismicDocument } from 'prismic-javascript/d.ts/documents'\nimport * as PrismicDOM from 'prismic-dom'\nimport { ImgixUrlParams } from 'gatsby-plugin-imgix'\n\nexport type NodeID = string\n\nexport interface NodeTree {\n [key: string]: Node\n}\n\nexport interface DocumentNodeInput extends NodeInput {\n prismicId: PrismicDocument['id']\n data: { [key: string]: NormalizedField }\n dataString: string\n dataRaw: PrismicDocument['data']\n alternate_languages: NormalizedAlternateLanguagesField\n url?: string\n}\n\nexport interface SliceNodeInput extends NodeInput {\n slice_type: string\n slice_label?: string\n primary: { [key: string]: NormalizedField }\n items: { [key: string]: NormalizedField }[]\n}\n\nexport interface DocumentsToNodesEnvironment {\n createNode: (node: NodeInput) => void\n createNodeId: (input: string) => string\n createContentDigest: (input: string | object) => string\n normalizeImageField: ImageFieldNormalizer\n normalizeLinkField: LinkFieldNormalizer\n normalizeSlicesField: SlicesFieldNormalizer\n normalizeStructuredTextField: StructuredTextFieldNormalizer\n typePaths: TypePath[]\n pluginOptions: PluginOptions\n context:\n | DocumentsToNodesEnvironmentNodeContext\n | DocumentsToNodesEnvironmentBrowserContext\n}\n\nexport interface DocumentsToNodesEnvironmentNodeContext {\n gatsbyContext: SourceNodesArgs\n}\n\nexport interface DocumentsToNodesEnvironmentBrowserContext {\n hasNodeById: (id: string) => boolean\n getNodeById: (id: string) => T & Node\n}\n\nexport interface TypePath {\n path: string[]\n type: GraphQLType | string\n}\n\nexport type FieldNormalizer = (\n apiId: string,\n field: T,\n path: TypePath['path'],\n doc: PrismicDocument,\n env: DocumentsToNodesEnvironment,\n) => N | Promise\n\nexport type ImageFieldNormalizer = FieldNormalizer<\n ImageField,\n NormalizedImageField\n>\n\nexport type LinkFieldNormalizer = FieldNormalizer<\n LinkField,\n NormalizedLinkField\n>\n\nexport type SlicesFieldNormalizer = FieldNormalizer<\n SliceIDsField,\n NormalizedSlicesField\n>\n\nexport type StructuredTextFieldNormalizer = FieldNormalizer<\n StructuredTextField,\n NormalizedStructuredTextField\n>\n\nexport type Field =\n | StructuredTextField\n | ImageField\n | SlicesField\n | GroupField\n | LinkField\n | AlternateLanguagesField\n | string\n | number\n | boolean\n | null\n\nexport type NormalizedField =\n | NormalizedStructuredTextField\n | NormalizedImageField\n | NormalizedSlicesField\n | NormalizedGroupField\n | NormalizedLinkField\n | NormalizedAlternateLanguagesField\n | Field\n\nexport type StructuredTextField = {\n type: string\n text: string\n spans: { [key: string]: unknown }\n}[]\n\nexport interface NormalizedStructuredTextField {\n html: string\n text: string\n raw: StructuredTextField\n}\n\nexport type SlicesField = Slice[]\n\ninterface Slice {\n slice_type: string\n slice_label: string | null\n items: { [key: string]: Field }[]\n primary: { [key: string]: Field }\n}\n\nexport type SliceIDsField = NodeID[]\n\nexport type NormalizedSlicesField = NodeID[]\n\nexport enum LinkFieldType {\n Any = 'Any',\n Document = 'Document',\n Media = 'Media',\n Web = 'Web',\n}\n\nexport interface LinkField {\n link_type: LinkFieldType\n isBroken: boolean\n url?: string\n target?: string\n size?: number\n id?: string\n type?: string\n tags?: string[]\n lang?: string\n slug?: string\n uid?: string\n}\n\nexport interface NormalizedLinkField extends LinkField {\n url: string\n document?: NodeID\n raw: LinkField\n}\n\nexport interface ImageField {\n alt?: string\n copyright?: string\n dimensions?: { width: number; height: number }\n url?: string\n // This should be ImageThumbnailField, but TypeScript does not let us\n // type unknown field types separatly from known without widening the type.\n [key: string]: unknown\n}\n\nexport interface NormalizedImageField extends ImageField {\n thumbnails?: { [key: string]: NormalizedImageField }\n fixed?: FixedObject\n fluid?: FluidObject\n localFile?: NodeID\n}\n\nexport type AlternateLanguagesField = LinkField[]\n\nexport type NormalizedAlternateLanguagesField = AlternateLanguagesField\n\nexport type GroupField = { [key: string]: Field }[]\n\nexport type NormalizedGroupField = { [key: string]: NormalizedField }[]\n\nexport enum FieldType {\n Boolean = 'Boolean',\n Color = 'Color',\n Date = 'Date',\n Embed = 'Embed',\n GeoPoint = 'GeoPoint',\n Group = 'Group',\n Image = 'Image',\n Link = 'Link',\n Number = 'Number',\n Select = 'Select',\n Slice = 'Slice',\n Slices = 'Slices',\n StructuredText = 'StructuredText',\n Text = 'Text',\n Timestamp = 'Timestamp',\n UID = 'UID',\n // Internal plugin-specific field not defined in the in Prismic schema.\n AlternateLanguages = 'AlternateLanguages',\n}\n\nexport enum GraphQLType {\n ID = 'ID',\n Boolean = 'Boolean',\n String = 'String',\n Float = 'Float',\n Date = 'Date',\n JSON = 'JSON',\n Link = 'PrismicLinkType',\n Image = 'PrismicImageType',\n ImageThumbnail = 'PrismicImageThumbnailType',\n ImageThumbnails = 'PrismicImageThumbnailsType',\n Embed = 'PrismicEmbedType',\n GeoPoint = 'PrismicGeoPointType',\n StructuredText = 'PrismicStructuredTextType',\n AllDocumentTypes = 'PrismicAllDocumentTypes',\n Group = 'Group',\n Slices = 'Slices',\n AlternateLanguages = 'AlternateLanguages',\n}\n\nexport interface GraphQLTypeObj {\n type: GraphQLType | string\n extensions?: { [key: string]: any }\n resolve?: Function\n}\n\ninterface BaseFieldConfigSchema {\n label?: string\n labels?: { [key: string]: string[] }\n placeholder?: string\n [key: string]: unknown\n}\n\nexport interface BaseFieldSchema {\n type: FieldType\n config: BaseFieldConfigSchema\n}\n\nexport interface ImageFieldSchema extends BaseFieldSchema {\n type: FieldType.Image\n config: ImageFieldConfigSchema\n}\n\ninterface ThumbnailSchema {\n name: string\n width?: string\n height?: string\n}\n\ninterface ImageFieldConfigSchema extends BaseFieldConfigSchema {\n constraint?: { width?: number; height?: number }\n thumbnails?: ThumbnailSchema[]\n}\n\nexport interface SlicesFieldSchema extends BaseFieldSchema {\n type: FieldType.Slices\n fieldset: string\n config: SlicesFieldConfigSchema\n}\n\ninterface SlicesFieldConfigSchema extends BaseFieldConfigSchema {\n choices: SliceChoicesSchema\n}\n\nexport interface SliceChoicesSchema {\n [sliceId: string]: SliceFieldSchema\n}\n\nenum SliceChoiceDisplay {\n List = 'list',\n Grid = 'grid',\n}\n\nexport interface SliceFieldSchema extends BaseFieldSchema {\n type: FieldType.Slice\n fieldset: string\n description: string\n icon: string\n display: SliceChoiceDisplay\n repeat?: FieldsSchema\n 'non-repeat'?: FieldsSchema\n}\n\nexport interface GroupFieldSchema extends BaseFieldSchema {\n type: FieldType.Group\n config: GroupFieldConfigSchema\n}\n\ninterface GroupFieldConfigSchema extends BaseFieldConfigSchema {\n fields: FieldsSchema\n}\n\nexport type FieldSchema =\n | BaseFieldSchema\n | ImageFieldSchema\n | SlicesFieldSchema\n | GroupFieldSchema\n | SliceFieldSchema\n\nexport interface FieldsSchema {\n [fieldId: string]: FieldSchema\n}\n\nexport interface Schema {\n [tabName: string]: {\n [fieldId: string]: FieldSchema\n }\n}\n\nexport interface Schemas {\n [schemaId: string]: Schema\n}\n\nexport type LinkResolver = (doc: object) => string\nexport type PluginLinkResolver = (input: {\n key?: string\n value?: unknown\n node: PrismicDocument\n}) => LinkResolver\n\nexport type HTMLSerializer = typeof PrismicDOM.HTMLSerializer\nexport type PluginHTMLSerializer = (input: {\n key: string\n value: unknown\n node: PrismicDocument\n}) => HTMLSerializer\n\ntype ShouldDownloadImage = (input: {\n key: string\n value: unknown\n node: PrismicDocument\n}) => boolean | Promise\n\nexport type BrowserPluginOptions = GatsbyPluginOptions &\n Pick<\n PluginOptions,\n | 'repositoryName'\n | 'accessToken'\n | 'fetchLinks'\n | 'schemas'\n | 'lang'\n | 'typePathsFilenamePrefix'\n | 'prismicToolbar'\n >\n\nexport interface PluginOptions extends GatsbyPluginOptions {\n repositoryName: string\n releaseID?: string\n accessToken?: string\n linkResolver?: PluginLinkResolver\n htmlSerializer?: PluginHTMLSerializer\n fetchLinks?: string[]\n schemas: Schemas\n lang?: string\n shouldDownloadImage?: ShouldDownloadImage\n shouldNormalizeImage?: ShouldDownloadImage\n typePathsFilenamePrefix?: string\n prismicToolbar?: boolean | 'legacy'\n imageImgixParams?: ImgixUrlParams\n imagePlaceholderImgixParams?: ImgixUrlParams\n webhookSecret?: string\n}\n\nexport interface WebhookBase {\n type: 'api-update' | 'test-trigger'\n domain: string\n apiUrl: string\n secret: string | null\n}\n\nexport interface TestWebhook extends WebhookBase {\n type: 'test-trigger'\n}\n\ninterface Operations {\n update?: T[]\n addition?: T[]\n deletion?: T[]\n}\n\nexport interface PrismicWebhook extends WebhookBase {\n type: 'api-update'\n masterRef?: string\n releases: Operations\n masks: Operations\n tags: Operations\n documents: string[]\n experiments?: Operations\n}\n\nexport interface WebhookRelease {\n id: string\n ref: string\n label: string\n documents: string[]\n}\n\nexport interface WebhookMask {\n id: string\n label: string\n}\n\nexport interface WebhookTag {\n id: string\n}\n\n// Legacy fields\ninterface WebhookExperimentVariation {\n id: string\n ref: string\n label: string\n}\ninterface WebhookExperiment {\n id: string\n name: string\n variations: WebhookExperimentVariation[]\n}\n","import v35 from './v35.js';\nimport sha1 from './sha1.js';\nvar v5 = v35('v5', 0x50, sha1);\nexport default v5;","import stringify from './stringify.js';\nimport parse from './parse.js';\n\nfunction stringToBytes(str) {\n str = unescape(encodeURIComponent(str)); // UTF8 escape\n\n var bytes = [];\n\n for (var i = 0; i < str.length; ++i) {\n bytes.push(str.charCodeAt(i));\n }\n\n return bytes;\n}\n\nexport var DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';\nexport var URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';\nexport default function (name, version, hashfunc) {\n function generateUUID(value, namespace, buf, offset) {\n if (typeof value === 'string') {\n value = stringToBytes(value);\n }\n\n if (typeof namespace === 'string') {\n namespace = parse(namespace);\n }\n\n if (namespace.length !== 16) {\n throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');\n } // Compute hash of namespace and value, Per 4.3\n // Future: Use spread syntax when supported on all platforms, e.g. `bytes =\n // hashfunc([...namespace, ... value])`\n\n\n var bytes = new Uint8Array(16 + value.length);\n bytes.set(namespace);\n bytes.set(value, namespace.length);\n bytes = hashfunc(bytes);\n bytes[6] = bytes[6] & 0x0f | version;\n bytes[8] = bytes[8] & 0x3f | 0x80;\n\n if (buf) {\n offset = offset || 0;\n\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = bytes[i];\n }\n\n return buf;\n }\n\n return stringify(bytes);\n } // Function#name is not settable on some platforms (#270)\n\n\n try {\n generateUUID.name = name; // eslint-disable-next-line no-empty\n } catch (err) {} // For CommonJS default export support\n\n\n generateUUID.DNS = DNS;\n generateUUID.URL = URL;\n return generateUUID;\n}","import * as struct from 'superstruct'\n\nimport { PluginOptions, BrowserPluginOptions } from './types'\n\nconst baseSchema = {\n repositoryName: struct.string(),\n accessToken: struct.optional(struct.string()),\n releaseID: struct.optional(struct.string()),\n schemas: struct.record(struct.string(), struct.object()),\n linkResolver: struct.defaulted(struct.func(), () => () => () => {}),\n htmlSerializer: struct.defaulted(struct.func(), () => () => () => {}),\n fetchLinks: struct.defaulted(struct.array(struct.string()), []),\n lang: struct.defaulted(struct.string(), '*'),\n typePathsFilenamePrefix: struct.defaulted(\n struct.string(),\n 'prismic-typepaths---',\n ),\n prismicToolbar: struct.defaulted(\n struct.union([struct.boolean(), struct.enums(['legacy'])]),\n false,\n ),\n imageImgixParams: struct.defaulted(\n struct.record(\n struct.string(),\n struct.optional(\n struct.union([struct.string(), struct.number(), struct.boolean()]),\n ),\n ),\n { auto: 'format,compress', fit: 'max', q: 50 },\n ),\n imagePlaceholderImgixParams: struct.defaulted(\n struct.record(\n struct.string(),\n struct.optional(\n struct.union([struct.string(), struct.number(), struct.boolean()]),\n ),\n ),\n { w: 100, blur: 15, q: 20 },\n ),\n plugins: struct.defaulted(struct.empty(struct.array()), []),\n} as const\n\nconst PluginOptions = struct.object({\n ...baseSchema,\n shouldDownloadImage: struct.defaulted(\n struct.optional(struct.func()),\n () => () => false,\n ),\n webhookSecret: struct.optional(struct.string()),\n})\n\nconst BrowserPluginOptions = struct.object({\n ...baseSchema,\n pathResolver: struct.optional(struct.func()),\n schemasDigest: struct.string(),\n})\n\nexport const validatePluginOptions = (pluginOptions: PluginOptions) => {\n const coerced = struct.coerce(pluginOptions, PluginOptions)\n struct.assert(coerced, PluginOptions)\n return (coerced as unknown) as PluginOptions\n}\n\nexport const validateBrowserOptions = (\n browserOptions: BrowserPluginOptions,\n) => {\n const coerced = struct.coerce(browserOptions, BrowserPluginOptions)\n struct.assert(coerced, BrowserPluginOptions)\n return (coerced as unknown) as BrowserPluginOptions\n}\n","export const BROWSER_STORE_KEY = '__GATSBY_SOURCE_PRISMIC__'\n\nexport const IMAGE_FIELD_KEYS = [\n 'alt',\n 'copyright',\n 'dimensions',\n 'url',\n] as const\n\nexport const API_PAGE_SIZE = 100\n\nexport const UUID_NAMESPACE = `638f7a53-c567-4eca-8fc1-b23efb1cfb2b`\n\nexport const PLACEHOLDER_NODE_TYPE_SUFFIX = '__PLACEHOLDER'\n","import { getApi } from 'prismic-javascript'\n\nimport { msg, chunk } from './utils'\nimport { API_PAGE_SIZE } from './constants'\n\nimport { SourceNodesArgs, Reporter } from 'gatsby'\nimport PrismicResolvedApi, {\n QueryOptions,\n} from 'prismic-javascript/d.ts/ResolvedApi'\nimport { Document as PrismicDocument } from 'prismic-javascript/d.ts/documents'\nimport { PluginOptions } from './types'\nimport ApiSearchResponse from 'prismic-javascript/d.ts/ApiSearchResponse'\n\nexport function toPrismicUrl(nameOrUrl: string) {\n const urlRegex = /^https?:\\/\\/([^.]+)\\.(wroom\\.(?:test|io)|prismic\\.io)/\n const addr = nameOrUrl.match(urlRegex)\n\n return addr ? addr[0] + '/api/v2' : `https://${nameOrUrl}.prismic.io/api/v2`\n}\n\nexport const createClient = async (\n repositoryName: string,\n accessToken?: string,\n) => {\n const url = toPrismicUrl(repositoryName)\n return await getApi(url, { accessToken })\n}\n\nconst pagedGet = async (\n client: PrismicResolvedApi,\n queryOptions: QueryOptions,\n page: number,\n pageSize: number,\n documents: PrismicDocument[],\n reporter: Reporter,\n): Promise => {\n reporter.verbose(msg(`fetching documents page ${page}`))\n\n const response = await client.query([], { ...queryOptions, page, pageSize })\n\n for (const doc of response.results) documents.push(doc)\n\n if (page * pageSize < response.total_results_size)\n return await pagedGet(\n client,\n queryOptions,\n page + 1,\n pageSize,\n documents,\n reporter,\n )\n\n return documents\n}\n\nexport const fetchAllDocuments = async (\n pluginOptions: PluginOptions,\n gatsbyContext: SourceNodesArgs,\n) => {\n const {\n repositoryName,\n releaseID,\n accessToken,\n fetchLinks,\n lang,\n } = pluginOptions\n const { reporter } = gatsbyContext\n\n const client = await createClient(repositoryName, accessToken)\n\n const queryOptions: QueryOptions = {}\n if (releaseID) {\n const ref = client.refs.find((r) => r.id === releaseID)\n if (ref) {\n queryOptions.ref = ref.ref\n } else {\n reporter.warn(\n msg(\n `A release with ID \"${releaseID}\" was not found. Defaulting to the master ref instead.`,\n ),\n )\n }\n }\n if (fetchLinks) queryOptions.fetchLinks = fetchLinks\n if (lang) queryOptions.lang = lang\n\n return await pagedGet(client, queryOptions, 1, API_PAGE_SIZE, [], reporter)\n}\n\nexport async function fetchDocumentsByIds(\n pluginOptions: PluginOptions,\n gatsbyContext: SourceNodesArgs,\n documents: string[],\n): Promise {\n const {\n repositoryName,\n releaseID,\n accessToken,\n fetchLinks,\n lang,\n } = pluginOptions\n\n const { reporter } = gatsbyContext\n\n const client = await createClient(repositoryName, accessToken)\n\n const queryOptions: QueryOptions = {}\n\n if (releaseID) {\n const ref = client.refs.find((r) => r.id === releaseID)\n if (ref) {\n queryOptions.ref = ref.ref\n } else {\n reporter.warn(\n msg(\n `A release with ID \"${releaseID}\" was not found. Defaulting to the master ref instead.`,\n ),\n )\n }\n }\n\n if (fetchLinks) queryOptions.fetchLinks = fetchLinks\n\n if (lang) queryOptions.lang = lang\n\n const chunks = chunk(documents, 100).map((docs) =>\n client.getByIDs(docs, queryOptions),\n )\n\n const responses: ApiSearchResponse[] = await Promise.all(chunks)\n\n return responses.flatMap((doc) => doc.results)\n}\n","import { useReducer, useEffect, useCallback, useMemo } from 'react'\nimport { set as setCookie } from 'es-cookie'\nimport { previewCookie } from 'prismic-javascript'\nimport { camelCase } from 'camel-case'\n\nimport { validateBrowserOptions } from './validateOptions'\nimport { createClient } from './api'\nimport { createEnvironment } from './environment.browser'\nimport { documentToNodes } from './documentsToNodes'\nimport { isBrowser } from './utils'\nimport { BROWSER_STORE_KEY } from './constants'\n\nimport { Node } from 'gatsby'\nimport { QueryOptions } from 'prismic-javascript/d.ts/ResolvedApi'\nimport {\n PluginOptions,\n DocumentsToNodesEnvironmentBrowserContext,\n BrowserPluginOptions,\n} from './types'\n\nexport type UsePrismicPreviewOptions = Pick<\n PluginOptions,\n | 'repositoryName'\n | 'accessToken'\n | 'linkResolver'\n | 'htmlSerializer'\n | 'fetchLinks'\n | 'lang'\n | 'typePathsFilenamePrefix'\n> & {\n pathResolver?: PluginOptions['linkResolver']\n schemasDigest?: string\n}\n\nenum ActionType {\n IS_NOT_PREVIEW = 'IS_NOT_PREVIEW',\n IS_PREVIEW = 'IS_PREVIEW',\n DOCUMENT_LOADED = 'DOCUMENT_LOADED',\n RESET = 'RESET',\n}\n\ninterface Action {\n type: ActionType\n payload?: {\n rootNode: Node\n path?: string\n }\n}\n\ninterface State {\n isPreview?: boolean\n isLoading: boolean\n previewData?: { [key: string]: Node }\n path?: string\n}\n\nconst initialState: State = {\n isPreview: undefined,\n isLoading: false,\n previewData: undefined,\n path: undefined,\n}\n\nconst reducer = (state: State, action: Action) => {\n switch (action.type) {\n case ActionType.IS_NOT_PREVIEW: {\n return { ...state, isPreview: false, isLoading: false }\n }\n\n case ActionType.IS_PREVIEW: {\n return { ...state, isPreview: true, isLoading: true }\n }\n\n case ActionType.DOCUMENT_LOADED: {\n if (!action.payload)\n return { ...state, isPreview: false, isLoading: false }\n\n const { rootNode, path } = action.payload\n const type = camelCase(rootNode.internal.type)\n const previewData = { [type]: rootNode }\n\n return { ...state, previewData, path, isPreview: true, isLoading: false }\n }\n\n case ActionType.RESET: {\n return initialState\n }\n\n default:\n throw new Error('Invalid error')\n }\n}\n\nexport const usePrismicPreview = (options: UsePrismicPreviewOptions) => {\n const [state, dispatch] = useReducer(reducer, initialState)\n\n // @ts-expect-error\n const hydratedOptions: UsePrismicPreviewOptions & {\n plugins: []\n schemas: {}\n lang: string\n typePathsFilenamePrefix: string\n schemasDigest: string\n } = useMemo(() => {\n if (!isBrowser) return options\n\n const context = window[BROWSER_STORE_KEY][options.repositoryName]\n\n if (!context)\n throw new Error(\n `Could not find plugin context for repository: \"${options.repositoryName}\". Check that a gatsby-source-plugin instance exists for that repository. `,\n )\n\n return validateBrowserOptions({\n ...context.pluginOptions,\n schemasDigest: context.schemasDigest,\n // Need to include an empty object because environment.browser.ts is\n // expecting it. We do not include the actual schemas in the browser.\n schemas: {},\n ...options,\n })\n }, [options])\n\n const { token, documentId } = useMemo(() => {\n if (!isBrowser) return {}\n\n const params = new URLSearchParams(window.location.search)\n\n return {\n token: params.get('token') ?? undefined,\n documentId: params.get('documentId') ?? undefined,\n }\n }, [isBrowser ? window.location.search : undefined])\n\n /**\n * Set the preview status as soon as possible.\n */\n useEffect(() => {\n const isPreview = Boolean(token && documentId)\n\n dispatch({\n type: isPreview ? ActionType.IS_PREVIEW : ActionType.IS_NOT_PREVIEW,\n })\n }, [token, documentId])\n\n const asyncEffect = useCallback(async () => {\n if (!state.isPreview || !token || !documentId) return\n\n setCookie(previewCookie, token)\n\n const queryOptions: QueryOptions = {}\n if (hydratedOptions.fetchLinks)\n queryOptions.fetchLinks = hydratedOptions.fetchLinks\n\n // Query Prismic's API for the document.\n const client = await createClient(\n hydratedOptions.repositoryName,\n hydratedOptions.accessToken,\n )\n const doc = await client.getByID(documentId, queryOptions)\n\n // Process the document into nodes.\n const typePathsRes = await fetch(\n `/${hydratedOptions.typePathsFilenamePrefix}${hydratedOptions.schemasDigest}.json`,\n { headers: { 'Content-Type': 'application/json' } },\n )\n const typePaths = await typePathsRes.json()\n const env = createEnvironment(\n hydratedOptions as BrowserPluginOptions,\n typePaths,\n )\n const { context } = env\n const { getNodeById } = context as DocumentsToNodesEnvironmentBrowserContext\n const rootNodeId = await documentToNodes(doc, env)\n const rootNode = getNodeById(rootNodeId)\n\n const resolvedPathResolver =\n hydratedOptions.pathResolver ?? hydratedOptions.linkResolver\n const path = resolvedPathResolver\n ? resolvedPathResolver({ node: doc })(doc)\n : undefined\n\n dispatch({ type: ActionType.DOCUMENT_LOADED, payload: { rootNode, path } })\n }, [state.isPreview])\n\n useEffect(() => {\n asyncEffect()\n }, [asyncEffect])\n\n return state\n}\n","import pick from 'lodash.pick'\nimport omit from 'lodash.omit'\n\nimport { mapObjValsP, buildSchemaTypeName } from './utils'\nimport { IMAGE_FIELD_KEYS } from './constants'\n\nimport { Document as PrismicDocument } from 'prismic-javascript/d.ts/documents'\nimport {\n DocumentsToNodesEnvironment,\n TypePath,\n Field,\n AlternateLanguagesField,\n GroupField,\n ImageField,\n LinkField,\n SlicesField,\n StructuredTextField,\n NormalizedField,\n NormalizedAlternateLanguagesField,\n LinkFieldType,\n GraphQLType,\n LinkResolver,\n DocumentNodeInput,\n SliceNodeInput,\n} from './types'\n\nconst getTypeForPath = (\n path: TypePath['path'],\n typePaths: TypePath[],\n): GraphQLType | string | undefined => {\n const stringifiedPath = JSON.stringify(path)\n const def = typePaths.find((x) => JSON.stringify(x.path) === stringifiedPath)\n\n if (!def) return\n if (/^\\[.*GroupType\\]$/.test(def.type)) return GraphQLType.Group\n if (/^\\[.*SlicesType\\]$/.test(def.type)) return GraphQLType.Slices\n\n return def.type\n}\n\nconst normalizeField = async (\n apiId: string,\n field: Field,\n path: TypePath['path'],\n doc: PrismicDocument,\n env: DocumentsToNodesEnvironment,\n): Promise => {\n const {\n createNodeId,\n createNode,\n createContentDigest,\n typePaths,\n normalizeStructuredTextField,\n normalizeLinkField,\n normalizeImageField,\n normalizeSlicesField,\n } = env\n\n const type = getTypeForPath([...path, apiId], typePaths)\n\n switch (type) {\n case GraphQLType.Image: {\n const baseObj: ImageField = pick(field as ImageField, IMAGE_FIELD_KEYS)\n const thumbsObj = omit(field as ImageField, IMAGE_FIELD_KEYS) as {\n [key: string]: ImageField\n }\n\n const base = await normalizeImageField(apiId, baseObj, path, doc, env)\n const thumbs = await mapObjValsP(\n async (thumb) =>\n await normalizeImageField(apiId, thumb, path, doc, env),\n thumbsObj,\n )\n\n return { ...base, thumbnails: thumbs }\n }\n\n case GraphQLType.StructuredText: {\n return await normalizeStructuredTextField(\n apiId,\n field as StructuredTextField,\n path,\n doc,\n env,\n )\n }\n\n case GraphQLType.Link: {\n return await normalizeLinkField(apiId, field as LinkField, path, doc, env)\n }\n\n case GraphQLType.Group: {\n return await normalizeObjs(\n field as GroupField,\n [...path, apiId],\n doc,\n env,\n )\n }\n\n case GraphQLType.Slices: {\n const sliceNodeIds = await Promise.all(\n (field as SlicesField).map(async (slice, index) => {\n const sliceNodeId = createNodeId(\n `${doc.type} ${doc.id} ${apiId} ${index}`,\n )\n\n const normalizedPrimary = await normalizeObj(\n slice.primary,\n [...path, apiId, slice.slice_type, 'primary'],\n doc,\n env,\n )\n\n const normalizedItems = await normalizeObjs(\n slice.items,\n [...path, apiId, slice.slice_type, 'items'],\n doc,\n env,\n )\n\n const node: SliceNodeInput = {\n id: sliceNodeId,\n slice_type: slice.slice_type,\n slice_label: slice.slice_label ?? undefined,\n primary: normalizedPrimary,\n items: normalizedItems,\n internal: {\n type: buildSchemaTypeName(\n `${doc.type} ${apiId} ${slice.slice_type}`,\n ),\n contentDigest: createContentDigest(slice),\n },\n }\n\n createNode(node)\n\n return node.id\n }),\n )\n\n return await normalizeSlicesField(\n apiId,\n sliceNodeIds,\n [...path, apiId],\n doc,\n env,\n )\n }\n\n // This field type is not an actual Prismic type and was assigned manually\n // in `schemasToTypeDefs.ts`.\n case GraphQLType.AlternateLanguages: {\n // Treat the array of alternate language documents as a list of link\n // fields. We need to force the link type to a Document since it is not\n // there by default.\n return await Promise.all(\n (field as AlternateLanguagesField).map(\n async (item) =>\n await normalizeLinkField(\n apiId,\n {\n ...item,\n link_type: LinkFieldType.Document,\n },\n path,\n doc,\n env,\n ),\n ),\n )\n }\n\n default: {\n return field\n }\n }\n}\n\nconst normalizeObj = (\n obj: { [key: string]: Field } = {},\n path: TypePath['path'],\n doc: PrismicDocument,\n env: DocumentsToNodesEnvironment,\n): Promise<{ [key: string]: NormalizedField }> =>\n mapObjValsP(\n (field, fieldApiId) => normalizeField(fieldApiId, field, path, doc, env),\n obj,\n )\n\nconst normalizeObjs = (\n objs: { [key: string]: Field }[] = [],\n path: TypePath['path'],\n doc: PrismicDocument,\n env: DocumentsToNodesEnvironment,\n) => Promise.all(objs.map((obj) => normalizeObj(obj, path, doc, env)))\n\nexport const documentToNodes = async (\n doc: PrismicDocument,\n env: DocumentsToNodesEnvironment,\n) => {\n const { createNode, createContentDigest, createNodeId, pluginOptions } = env\n const { linkResolver } = pluginOptions\n\n let linkResolverForDoc: LinkResolver | undefined = undefined\n if (linkResolver) linkResolverForDoc = linkResolver({ node: doc })\n\n const docNodeId = createNodeId(doc.id)\n const docUrl = linkResolverForDoc ? linkResolverForDoc(doc) : undefined\n\n const normalizedData = await normalizeObj(\n doc.data,\n [doc.type, 'data'],\n doc,\n env,\n )\n const normalizedAlernativeLanguages = (await normalizeField(\n 'alternate_languages',\n (doc.alternate_languages as unknown) as AlternateLanguagesField,\n [doc.type],\n doc,\n env,\n )) as NormalizedAlternateLanguagesField\n\n const node: DocumentNodeInput = {\n ...doc,\n id: docNodeId,\n prismicId: doc.id,\n data: normalizedData,\n dataString: JSON.stringify(doc.data),\n dataRaw: doc.data,\n alternate_languages: normalizedAlernativeLanguages,\n url: docUrl,\n internal: {\n type: buildSchemaTypeName(doc.type),\n contentDigest: createContentDigest(doc),\n },\n _previewable: doc.id,\n }\n\n createNode(node)\n\n return node.id\n}\n\nexport const documentsToNodes = async (\n docs: PrismicDocument[],\n env: DocumentsToNodesEnvironment,\n) => await Promise.all(docs.map((doc) => documentToNodes(doc, env)))\n","import {\n Link as PrismicDOMLink,\n RichText as PrismicDOMRichText,\n} from 'prismic-dom'\nimport { buildImgixFixed, buildImgixFluid } from 'gatsby-plugin-imgix'\nimport { v5 as uuidv5 } from 'uuid'\nimport md5 from 'md5'\n\nimport { createClient } from './api'\nimport { documentToNodes } from './documentsToNodes'\nimport { buildSchemaTypeName } from './utils'\nimport { UUID_NAMESPACE, PLACEHOLDER_NODE_TYPE_SUFFIX } from './constants'\n\nimport { NodeInput } from 'gatsby'\nimport { QueryOptions } from 'prismic-javascript/d.ts/ResolvedApi'\nimport {\n BrowserPluginOptions,\n DocumentsToNodesEnvironment,\n DocumentsToNodesEnvironmentBrowserContext,\n HTMLSerializer,\n ImageFieldNormalizer,\n LinkField,\n LinkFieldNormalizer,\n LinkFieldType,\n LinkResolver,\n NormalizedLinkField,\n SlicesFieldNormalizer,\n StructuredTextFieldNormalizer,\n TypePath,\n NodeID,\n} from './types'\n\ninterface UnbrokenDocumentLinkField extends LinkField {\n link_type: LinkFieldType.Document\n id: string\n isBroken: false\n}\n\nconst loadLinkFieldDocument = async (\n field: UnbrokenDocumentLinkField,\n env: DocumentsToNodesEnvironment,\n) => {\n const {\n createNode,\n createNodeId,\n createContentDigest,\n pluginOptions,\n context,\n } = env\n if (field.link_type !== LinkFieldType.Document || !field.id || field.isBroken)\n return\n\n const { hasNodeById } = context as DocumentsToNodesEnvironmentBrowserContext\n const { repositoryName, accessToken, fetchLinks } = pluginOptions\n\n const linkedDocId = createNodeId(field.id)\n\n // Skip the fetch process if the node already exists in the store.\n if (hasNodeById(linkedDocId)) return\n\n // Create a placeholder node in the store to prevent infinite recursion. This\n // placeholder will be replaced with the actual node during the\n // `documentToNodes` call.\n createNode({\n id: linkedDocId,\n internal: {\n type: buildSchemaTypeName(field.type!) + PLACEHOLDER_NODE_TYPE_SUFFIX,\n contentDigest: createContentDigest(linkedDocId),\n },\n })\n\n const queryOptions: QueryOptions = {}\n if (fetchLinks) queryOptions.fetchLinks = fetchLinks\n\n // Query Prismic's API for the document.\n const client = await createClient(repositoryName, accessToken)\n const doc = await client.getByID(field.id, queryOptions)\n\n await documentToNodes(doc, env)\n}\n\nconst normalizeImageField: ImageFieldNormalizer = async (\n _apiId,\n field,\n _path,\n _doc,\n env,\n) => {\n const { pluginOptions } = env\n\n const url = field.url\n if (!url) return field\n\n const fixed = buildImgixFixed({\n url,\n sourceWidth: field.dimensions!.width,\n sourceHeight: field.dimensions!.height,\n args: {\n imgixParams: pluginOptions.imageImgixParams,\n placeholderImgixParams: pluginOptions.imagePlaceholderImgixParams,\n },\n })\n\n const fluid = buildImgixFluid({\n url,\n sourceWidth: field.dimensions!.width,\n sourceHeight: field.dimensions!.height,\n args: {\n imgixParams: pluginOptions.imageImgixParams,\n placeholderImgixParams: pluginOptions.imagePlaceholderImgixParams,\n },\n })\n\n return { ...field, fixed, fluid }\n}\n\n// TODO: Abstract proxy handler for any `getNodeById` needs (e.g. Slices).\nconst normalizeLinkField: LinkFieldNormalizer = async (\n apiId,\n field,\n _path,\n doc,\n env,\n) => {\n const { createNodeId, pluginOptions, context } = env\n const { getNodeById } = context as DocumentsToNodesEnvironmentBrowserContext\n const { linkResolver } = pluginOptions\n\n let linkResolverForField: LinkResolver | undefined = undefined\n if (linkResolver)\n linkResolverForField = linkResolver({\n key: apiId,\n value: field,\n node: doc,\n })\n\n let linkedDocId: NodeID | undefined = undefined\n if (field && field.link_type === LinkFieldType.Document && field.id)\n linkedDocId = createNodeId(field.id)\n\n if (\n field &&\n field.link_type === LinkFieldType.Document &&\n field.id &&\n !field.isBroken\n )\n await loadLinkFieldDocument(field as UnbrokenDocumentLinkField, env)\n\n return new Proxy(\n {\n ...field,\n url: PrismicDOMLink.url(field, linkResolverForField),\n document: linkedDocId,\n raw: field,\n },\n {\n get: (obj, prop: keyof NormalizedLinkField) => {\n if (prop === 'document') {\n if (\n field &&\n field.link_type === LinkFieldType.Document &&\n !field.isBroken &&\n linkedDocId\n )\n return getNodeById(linkedDocId)\n\n return null\n }\n\n return obj[prop]\n },\n },\n )\n}\n\nconst normalizeSlicesField: SlicesFieldNormalizer = (\n _apiId,\n field,\n _path,\n _doc,\n env,\n) => {\n const { context } = env\n const {\n hasNodeById,\n getNodeById,\n } = context as DocumentsToNodesEnvironmentBrowserContext\n\n return new Proxy(field, {\n get: (obj, prop: number) => {\n const id = obj[prop]\n\n if (hasNodeById(id)) {\n const node = getNodeById(id)\n return { ...node, __typename: node.internal.type }\n }\n\n return id\n },\n })\n}\n\nconst normalizeStructuredTextField: StructuredTextFieldNormalizer = async (\n apiId,\n field,\n _path,\n doc,\n env,\n) => {\n const { pluginOptions } = env\n const { linkResolver, htmlSerializer } = pluginOptions\n\n let linkResolverForField: LinkResolver | undefined = undefined\n if (linkResolver)\n linkResolverForField = linkResolver({\n key: apiId,\n value: field,\n node: doc,\n })\n\n let htmlSerializerForField: HTMLSerializer | undefined = undefined\n if (htmlSerializer)\n htmlSerializerForField = htmlSerializer({\n key: apiId,\n value: field,\n node: doc,\n })\n\n return {\n html: PrismicDOMRichText.asHtml(\n field,\n linkResolverForField,\n htmlSerializerForField,\n ),\n text: PrismicDOMRichText.asText(field),\n raw: field,\n }\n}\n\nexport const createEnvironment = (\n pluginOptions: BrowserPluginOptions,\n typePaths: TypePath[],\n): DocumentsToNodesEnvironment => {\n const nodeStore = new Map()\n\n const createNode = (node: NodeInput) => void nodeStore.set(node.id, node)\n const createNodeId = (input: string) => uuidv5(input, UUID_NAMESPACE)\n const createContentDigest = (input: unknown) => md5(JSON.stringify(input))\n const hasNodeById = (id: string) => nodeStore.has(id)\n const getNodeById = (id: string) => nodeStore.get(id)\n\n return {\n createNode,\n createNodeId,\n createContentDigest,\n normalizeImageField,\n normalizeLinkField,\n normalizeSlicesField,\n normalizeStructuredTextField,\n typePaths,\n pluginOptions,\n context: { hasNodeById, getNodeById },\n }\n}\n","import * as React from 'react'\nimport { NodeTree } from './types'\n\nconst DEFAULT_INITIAL_PAGES = {}\nconst DEFAULT_INITIAL_ENABLED = false\n\nexport enum ActionType {\n AddPage,\n EnablePreviews,\n DisablePreviews,\n}\n\ntype Action =\n | {\n type: ActionType.AddPage\n payload: { path: string; data: NodeTree }\n }\n | { type: Exclude }\n\ninterface State {\n pages: Record\n enabled: boolean\n}\n\nconst createInitialState = (initialState?: Partial): State => ({\n pages: DEFAULT_INITIAL_PAGES,\n enabled: DEFAULT_INITIAL_ENABLED,\n ...initialState,\n})\n\nconst reducer = (state: State, action: Action): State => {\n switch (action.type) {\n case ActionType.AddPage: {\n return {\n ...state,\n pages: {\n ...state.pages,\n [action.payload.path]: action.payload.data,\n },\n enabled: true,\n }\n }\n\n case ActionType.EnablePreviews: {\n return { ...state, enabled: true }\n }\n\n case ActionType.DisablePreviews: {\n return { ...state, enabled: false }\n }\n }\n}\n\nconst PreviewStoreContext = React.createContext([\n createInitialState(),\n () => {},\n] as [State, React.Dispatch])\n\nexport type PreviewStoreProviderProps = {\n children?: React.ReactNode\n initialPages?: State['pages']\n initialEnabled?: State['enabled']\n}\n\nexport const PreviewStoreProvider = ({\n children,\n initialPages = DEFAULT_INITIAL_PAGES,\n initialEnabled = DEFAULT_INITIAL_ENABLED,\n}: PreviewStoreProviderProps) => {\n const reducerTuple = React.useReducer(\n reducer,\n createInitialState({\n pages: initialPages,\n enabled: initialEnabled,\n }),\n )\n\n return (\n \n {children}\n \n )\n}\n\nexport const usePreviewStore = () => React.useContext(PreviewStoreContext)\n","import { Node } from 'gatsby'\nimport isPlainObject from 'lodash.isplainobject'\n\nimport { NodeTree } from './types'\n\n// Root node field used to compare static data with preview data. If values are\n// equal, the preview node can be treated as an updated version of the static\n// node.\nconst PREVIEWABLE_NODE_ID_FIELD = '_previewable'\n\n// TODO: Remove in v4.0.0\n// Same as PREVIEWABLE_NODE_ID_FIELD, but the legacy version that will be phased out in v4.0.0.\nconst LEGACY_PREVIEWABLE_NODE_ID_FIELD = 'prismicId'\n\nconst traverseAndReplace = (node: any, replacementNode: Node): any => {\n if (isPlainObject(node)) {\n // If the nodes share an ID, replace it.\n if (\n node[PREVIEWABLE_NODE_ID_FIELD] ===\n replacementNode[PREVIEWABLE_NODE_ID_FIELD]\n )\n return replacementNode\n\n // TODO: Remove in v4.0.0\n if (\n node[LEGACY_PREVIEWABLE_NODE_ID_FIELD] ===\n replacementNode[LEGACY_PREVIEWABLE_NODE_ID_FIELD]\n ) {\n console.warn(\n 'Warning: Merging nested preview data using the prismicId field will be deprecated in gatsby-source-prismic v4.0.0.\\n\\nIf you are relying on this functionality, please update your GraphQL query to include the _previewable field on documents that should be previewable.',\n )\n return replacementNode\n }\n\n // We did not find the Node to replace. Iterate all properties and continue\n // to find the Node.\n const newNode: typeof node = {}\n for (const subnodeKey in node)\n newNode[subnodeKey] = traverseAndReplace(\n node[subnodeKey],\n replacementNode,\n )\n return newNode\n }\n\n // Iterate all elements in the node to find the Node.\n if (Array.isArray(node))\n return node.map((subnode) => traverseAndReplace(subnode, replacementNode))\n\n // If the node is not an object or array, it cannot be a Node.\n return node\n}\n\nexport interface MergePrismicPreviewDataArgs {\n staticData?: NodeTree\n previewData?: NodeTree\n /**\n * Determines the method with which the function merges preview data into static data.\n *\n * - `traverseAndReplace`: Traverse static data nodes and replace with preview data if IDs match.\n * - `rootReplaceOrInsert`: Replace or insert preview data at the root level.\n */\n strategy?: 'traverseAndReplace' | 'rootReplaceOrInsert'\n}\n\n/**\n * Merges preview data with static data. Different merge strategies can be used\n * for different environments.\n */\nexport const mergePrismicPreviewData = ({\n staticData,\n previewData,\n strategy = 'traverseAndReplace',\n}: MergePrismicPreviewDataArgs): NodeTree | undefined => {\n if (!staticData && !previewData) return\n if (!staticData) return previewData\n if (!previewData) return staticData\n\n switch (strategy) {\n // Unpublished previews must return data at the root to ensure it is always\n // available. If staticData and previewData share root-level keys, they are\n // merged. Otherwise, data will be sibilings.\n case 'rootReplaceOrInsert':\n return { ...staticData, ...previewData }\n\n // Traverse static data nodes and replace with preview data if IDs match.\n case 'traverseAndReplace':\n default: {\n const previewDataRootNodeKey = Object.keys(previewData)[0]\n\n // TODO: Remove in v4.0.0.\n if (\n staticData.hasOwnProperty(previewDataRootNodeKey) &&\n !staticData[previewDataRootNodeKey][PREVIEWABLE_NODE_ID_FIELD] &&\n !staticData[previewDataRootNodeKey][LEGACY_PREVIEWABLE_NODE_ID_FIELD]\n ) {\n // TODO: Add link to more details on _previewable.\n console.warn(\n 'Warning: Merging preview data implicitly will be deprecated in gatsby-source-prismic v4.0.0.\\n\\nIf you are relying on this functionality, please update your GraphQL query to include the _previewable field on documents that should be previewable.',\n )\n return { ...staticData, ...previewData }\n }\n\n return traverseAndReplace(staticData, previewData[previewDataRootNodeKey])\n }\n }\n}\n","import * as React from 'react'\nimport { PageProps } from 'gatsby'\n\nimport {\n mergePrismicPreviewData,\n MergePrismicPreviewDataArgs,\n} from './mergePrismicPreviewData'\nimport { usePreviewStore } from './usePreviewStore'\nimport { getComponentDisplayName } from './utils'\nimport { NodeTree } from './types'\n\ntype WithPreviewArgs = {\n mergeStrategy?: MergePrismicPreviewDataArgs['strategy']\n}\n\nexport const withPreview = (\n WrappedComponent: React.ComponentType,\n options?: WithPreviewArgs,\n): React.ComponentType => {\n const WithPreview = (props: TProps) => {\n const [state] = usePreviewStore()\n\n const path = props.location.pathname\n const staticData = props.data as NodeTree\n const previewData = state.pages[path]\n\n const data = React.useMemo(\n () =>\n state.enabled\n ? mergePrismicPreviewData({\n staticData,\n previewData,\n strategy: options?.mergeStrategy,\n })\n : staticData,\n [state.enabled, staticData, previewData],\n )\n\n return \n }\n WithPreview.displayName = `withPreview(${getComponentDisplayName(\n WrappedComponent,\n )})`\n\n return WithPreview\n}\n","import * as React from 'react'\nimport { navigate, PageProps } from 'gatsby'\n\nimport {\n usePrismicPreview,\n UsePrismicPreviewOptions,\n} from './usePrismicPreview'\nimport { usePreviewStore, ActionType } from './usePreviewStore'\nimport { getComponentDisplayName } from './utils'\n\nexport interface WithPreviewResolverProps {\n isPreview: boolean | undefined\n isLoading: boolean\n}\n\nexport const withPreviewResolver = (\n WrappedComponent: React.ComponentType,\n options: UsePrismicPreviewOptions,\n): React.ComponentType => {\n const WithPreviewResolver = (props: TProps) => {\n const [, dispatch] = usePreviewStore()\n\n const { isLoading, isPreview, previewData, path } = usePrismicPreview(\n options,\n )\n\n React.useEffect(() => {\n if (isPreview && previewData && path) {\n dispatch({\n type: ActionType.AddPage,\n payload: { path, data: previewData },\n })\n navigate(path)\n }\n }, [isPreview, previewData, path, dispatch])\n\n return (\n \n )\n }\n WithPreviewResolver.displayName = `withPreviewResolver(${getComponentDisplayName(\n WrappedComponent,\n )})`\n\n return WithPreviewResolver\n}\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","var classof = require('../internals/classof-raw');\nvar global = require('../internals/global');\n\nmodule.exports = classof(global.process) == 'process';\n","\"use strict\";\n\nmodule.exports = Object.assign;","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/* eslint-disable jsx-a11y/anchor-has-content */\nimport React, { useContext } from \"react\";\nimport PropTypes from \"prop-types\";\nimport invariant from \"invariant\";\nimport createContext from \"create-react-context\";\nimport { polyfill } from \"react-lifecycles-compat\";\nimport { startsWith, pick, resolve, match, insertParams, validateRedirect, shallowCompare } from \"./lib/utils\";\nimport { globalHistory, navigate, createHistory, createMemorySource } from \"./lib/history\";\n\n////////////////////////////////////////////////////////////////////////////////\n\nvar createNamedContext = function createNamedContext(name, defaultValue) {\n var Ctx = createContext(defaultValue);\n Ctx.displayName = name;\n return Ctx;\n};\n\n////////////////////////////////////////////////////////////////////////////////\n// Location Context/Provider\nvar LocationContext = createNamedContext(\"Location\");\n\n// sets up a listener if there isn't one already so apps don't need to be\n// wrapped in some top level provider\nvar Location = function Location(_ref) {\n var children = _ref.children;\n return React.createElement(\n LocationContext.Consumer,\n null,\n function (context) {\n return context ? children(context) : React.createElement(\n LocationProvider,\n null,\n children\n );\n }\n );\n};\n\nvar LocationProvider = function (_React$Component) {\n _inherits(LocationProvider, _React$Component);\n\n function LocationProvider() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, LocationProvider);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {\n context: _this.getContext(),\n refs: { unlisten: null }\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n LocationProvider.prototype.getContext = function getContext() {\n var _props$history = this.props.history,\n navigate = _props$history.navigate,\n location = _props$history.location;\n\n return { navigate: navigate, location: location };\n };\n\n LocationProvider.prototype.componentDidCatch = function componentDidCatch(error, info) {\n if (isRedirect(error)) {\n var _navigate = this.props.history.navigate;\n\n _navigate(error.uri, { replace: true });\n } else {\n throw error;\n }\n };\n\n LocationProvider.prototype.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {\n if (prevState.context.location !== this.state.context.location) {\n this.props.history._onTransitionComplete();\n }\n };\n\n LocationProvider.prototype.componentDidMount = function componentDidMount() {\n var _this2 = this;\n\n var refs = this.state.refs,\n history = this.props.history;\n\n history._onTransitionComplete();\n refs.unlisten = history.listen(function () {\n Promise.resolve().then(function () {\n // TODO: replace rAF with react deferred update API when it's ready https://github.com/facebook/react/issues/13306\n requestAnimationFrame(function () {\n if (!_this2.unmounted) {\n _this2.setState(function () {\n return { context: _this2.getContext() };\n });\n }\n });\n });\n });\n };\n\n LocationProvider.prototype.componentWillUnmount = function componentWillUnmount() {\n var refs = this.state.refs;\n\n this.unmounted = true;\n refs.unlisten();\n };\n\n LocationProvider.prototype.render = function render() {\n var context = this.state.context,\n children = this.props.children;\n\n return React.createElement(\n LocationContext.Provider,\n { value: context },\n typeof children === \"function\" ? children(context) : children || null\n );\n };\n\n return LocationProvider;\n}(React.Component);\n\n////////////////////////////////////////////////////////////////////////////////\n\n\nLocationProvider.defaultProps = {\n history: globalHistory\n};\nprocess.env.NODE_ENV !== \"production\" ? LocationProvider.propTypes = {\n history: PropTypes.object.isRequired\n} : void 0;\nvar ServerLocation = function ServerLocation(_ref2) {\n var url = _ref2.url,\n children = _ref2.children;\n\n var searchIndex = url.indexOf(\"?\");\n var searchExists = searchIndex > -1;\n var pathname = void 0;\n var search = \"\";\n var hash = \"\";\n\n if (searchExists) {\n pathname = url.substring(0, searchIndex);\n search = url.substring(searchIndex);\n } else {\n pathname = url;\n }\n\n return React.createElement(\n LocationContext.Provider,\n {\n value: {\n location: {\n pathname: pathname,\n search: search,\n hash: hash\n },\n navigate: function navigate() {\n throw new Error(\"You can't call navigate on the server.\");\n }\n }\n },\n children\n );\n};\n////////////////////////////////////////////////////////////////////////////////\n// Sets baseuri and basepath for nested routers and links\nvar BaseContext = createNamedContext(\"Base\", { baseuri: \"/\", basepath: \"/\" });\n\n////////////////////////////////////////////////////////////////////////////////\n// The main event, welcome to the show everybody.\nvar Router = function Router(props) {\n return React.createElement(\n BaseContext.Consumer,\n null,\n function (baseContext) {\n return React.createElement(\n Location,\n null,\n function (locationContext) {\n return React.createElement(RouterImpl, _extends({}, baseContext, locationContext, props));\n }\n );\n }\n );\n};\n\nvar RouterImpl = function (_React$PureComponent) {\n _inherits(RouterImpl, _React$PureComponent);\n\n function RouterImpl() {\n _classCallCheck(this, RouterImpl);\n\n return _possibleConstructorReturn(this, _React$PureComponent.apply(this, arguments));\n }\n\n RouterImpl.prototype.render = function render() {\n var _props = this.props,\n location = _props.location,\n _navigate2 = _props.navigate,\n basepath = _props.basepath,\n primary = _props.primary,\n children = _props.children,\n baseuri = _props.baseuri,\n _props$component = _props.component,\n component = _props$component === undefined ? \"div\" : _props$component,\n domProps = _objectWithoutProperties(_props, [\"location\", \"navigate\", \"basepath\", \"primary\", \"children\", \"baseuri\", \"component\"]);\n\n var routes = React.Children.toArray(children).reduce(function (array, child) {\n var routes = createRoute(basepath)(child);\n return array.concat(routes);\n }, []);\n var pathname = location.pathname;\n\n\n var match = pick(routes, pathname);\n\n if (match) {\n var params = match.params,\n uri = match.uri,\n route = match.route,\n element = match.route.value;\n\n // remove the /* from the end for child routes relative paths\n\n basepath = route.default ? basepath : route.path.replace(/\\*$/, \"\");\n\n var props = _extends({}, params, {\n uri: uri,\n location: location,\n navigate: function navigate(to, options) {\n return _navigate2(resolve(to, uri), options);\n }\n });\n\n var clone = React.cloneElement(element, props, element.props.children ? React.createElement(\n Router,\n { location: location, primary: primary },\n element.props.children\n ) : undefined);\n\n // using 'div' for < 16.3 support\n var FocusWrapper = primary ? FocusHandler : component;\n // don't pass any props to 'div'\n var wrapperProps = primary ? _extends({ uri: uri, location: location, component: component }, domProps) : domProps;\n\n return React.createElement(\n BaseContext.Provider,\n { value: { baseuri: uri, basepath: basepath } },\n React.createElement(\n FocusWrapper,\n wrapperProps,\n clone\n )\n );\n } else {\n // Not sure if we want this, would require index routes at every level\n // warning(\n // false,\n // `\\n\\nNothing matched:\\n\\t${\n // location.pathname\n // }\\n\\nPaths checked: \\n\\t${routes\n // .map(route => route.path)\n // .join(\n // \"\\n\\t\"\n // )}\\n\\nTo get rid of this warning, add a default NotFound component as child of Router:\n // \\n\\tlet NotFound = () => Not Found!
\n // \\n\\t\\n\\t \\n\\t {/* ... */}\\n\\t`\n // );\n return null;\n }\n };\n\n return RouterImpl;\n}(React.PureComponent);\n\nRouterImpl.defaultProps = {\n primary: true\n};\n\n\nvar FocusContext = createNamedContext(\"Focus\");\n\nvar FocusHandler = function FocusHandler(_ref3) {\n var uri = _ref3.uri,\n location = _ref3.location,\n component = _ref3.component,\n domProps = _objectWithoutProperties(_ref3, [\"uri\", \"location\", \"component\"]);\n\n return React.createElement(\n FocusContext.Consumer,\n null,\n function (requestFocus) {\n return React.createElement(FocusHandlerImpl, _extends({}, domProps, {\n component: component,\n requestFocus: requestFocus,\n uri: uri,\n location: location\n }));\n }\n );\n};\n\n// don't focus on initial render\nvar initialRender = true;\nvar focusHandlerCount = 0;\n\nvar FocusHandlerImpl = function (_React$Component2) {\n _inherits(FocusHandlerImpl, _React$Component2);\n\n function FocusHandlerImpl() {\n var _temp2, _this4, _ret2;\n\n _classCallCheck(this, FocusHandlerImpl);\n\n for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return _ret2 = (_temp2 = (_this4 = _possibleConstructorReturn(this, _React$Component2.call.apply(_React$Component2, [this].concat(args))), _this4), _this4.state = {}, _this4.requestFocus = function (node) {\n if (!_this4.state.shouldFocus && node) {\n node.focus();\n }\n }, _temp2), _possibleConstructorReturn(_this4, _ret2);\n }\n\n FocusHandlerImpl.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {\n var initial = prevState.uri == null;\n if (initial) {\n return _extends({\n shouldFocus: true\n }, nextProps);\n } else {\n var myURIChanged = nextProps.uri !== prevState.uri;\n var navigatedUpToMe = prevState.location.pathname !== nextProps.location.pathname && nextProps.location.pathname === nextProps.uri;\n return _extends({\n shouldFocus: myURIChanged || navigatedUpToMe\n }, nextProps);\n }\n };\n\n FocusHandlerImpl.prototype.componentDidMount = function componentDidMount() {\n focusHandlerCount++;\n this.focus();\n };\n\n FocusHandlerImpl.prototype.componentWillUnmount = function componentWillUnmount() {\n focusHandlerCount--;\n if (focusHandlerCount === 0) {\n initialRender = true;\n }\n };\n\n FocusHandlerImpl.prototype.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {\n if (prevProps.location !== this.props.location && this.state.shouldFocus) {\n this.focus();\n }\n };\n\n FocusHandlerImpl.prototype.focus = function focus() {\n if (process.env.NODE_ENV === \"test\") {\n // getting cannot read property focus of null in the tests\n // and that bit of global `initialRender` state causes problems\n // should probably figure it out!\n return;\n }\n\n var requestFocus = this.props.requestFocus;\n\n\n if (requestFocus) {\n requestFocus(this.node);\n } else {\n if (initialRender) {\n initialRender = false;\n } else if (this.node) {\n // React polyfills [autofocus] and it fires earlier than cDM,\n // so we were stealing focus away, this line prevents that.\n if (!this.node.contains(document.activeElement)) {\n this.node.focus();\n }\n }\n }\n };\n\n FocusHandlerImpl.prototype.render = function render() {\n var _this5 = this;\n\n var _props2 = this.props,\n children = _props2.children,\n style = _props2.style,\n requestFocus = _props2.requestFocus,\n _props2$component = _props2.component,\n Comp = _props2$component === undefined ? \"div\" : _props2$component,\n uri = _props2.uri,\n location = _props2.location,\n domProps = _objectWithoutProperties(_props2, [\"children\", \"style\", \"requestFocus\", \"component\", \"uri\", \"location\"]);\n\n return React.createElement(\n Comp,\n _extends({\n style: _extends({ outline: \"none\" }, style),\n tabIndex: \"-1\",\n ref: function ref(n) {\n return _this5.node = n;\n }\n }, domProps),\n React.createElement(\n FocusContext.Provider,\n { value: this.requestFocus },\n this.props.children\n )\n );\n };\n\n return FocusHandlerImpl;\n}(React.Component);\n\npolyfill(FocusHandlerImpl);\n\nvar k = function k() {};\n\n////////////////////////////////////////////////////////////////////////////////\nvar forwardRef = React.forwardRef;\n\nif (typeof forwardRef === \"undefined\") {\n forwardRef = function forwardRef(C) {\n return C;\n };\n}\n\nvar Link = forwardRef(function (_ref4, ref) {\n var innerRef = _ref4.innerRef,\n props = _objectWithoutProperties(_ref4, [\"innerRef\"]);\n\n return React.createElement(\n BaseContext.Consumer,\n null,\n function (_ref5) {\n var basepath = _ref5.basepath,\n baseuri = _ref5.baseuri;\n return React.createElement(\n Location,\n null,\n function (_ref6) {\n var location = _ref6.location,\n navigate = _ref6.navigate;\n\n var to = props.to,\n state = props.state,\n replace = props.replace,\n _props$getProps = props.getProps,\n getProps = _props$getProps === undefined ? k : _props$getProps,\n anchorProps = _objectWithoutProperties(props, [\"to\", \"state\", \"replace\", \"getProps\"]);\n\n var href = resolve(to, baseuri);\n var encodedHref = encodeURI(href);\n var isCurrent = location.pathname === encodedHref;\n var isPartiallyCurrent = startsWith(location.pathname, encodedHref);\n\n return React.createElement(\"a\", _extends({\n ref: ref || innerRef,\n \"aria-current\": isCurrent ? \"page\" : undefined\n }, anchorProps, getProps({ isCurrent: isCurrent, isPartiallyCurrent: isPartiallyCurrent, href: href, location: location }), {\n href: href,\n onClick: function onClick(event) {\n if (anchorProps.onClick) anchorProps.onClick(event);\n if (shouldNavigate(event)) {\n event.preventDefault();\n var shouldReplace = replace;\n if (typeof replace !== \"boolean\" && isCurrent) {\n var _location$state = _extends({}, location.state),\n key = _location$state.key,\n restState = _objectWithoutProperties(_location$state, [\"key\"]);\n\n shouldReplace = shallowCompare(_extends({}, state), restState);\n }\n navigate(href, {\n state: state,\n replace: shouldReplace\n });\n }\n }\n }));\n }\n );\n }\n );\n});\n\nLink.displayName = \"Link\";\n\nprocess.env.NODE_ENV !== \"production\" ? Link.propTypes = {\n to: PropTypes.string.isRequired\n} : void 0;\n\n////////////////////////////////////////////////////////////////////////////////\nfunction RedirectRequest(uri) {\n this.uri = uri;\n}\n\nvar isRedirect = function isRedirect(o) {\n return o instanceof RedirectRequest;\n};\n\nvar redirectTo = function redirectTo(to) {\n throw new RedirectRequest(to);\n};\n\nvar RedirectImpl = function (_React$Component3) {\n _inherits(RedirectImpl, _React$Component3);\n\n function RedirectImpl() {\n _classCallCheck(this, RedirectImpl);\n\n return _possibleConstructorReturn(this, _React$Component3.apply(this, arguments));\n }\n\n // Support React < 16 with this hook\n RedirectImpl.prototype.componentDidMount = function componentDidMount() {\n var _props3 = this.props,\n navigate = _props3.navigate,\n to = _props3.to,\n from = _props3.from,\n _props3$replace = _props3.replace,\n replace = _props3$replace === undefined ? true : _props3$replace,\n state = _props3.state,\n noThrow = _props3.noThrow,\n baseuri = _props3.baseuri,\n props = _objectWithoutProperties(_props3, [\"navigate\", \"to\", \"from\", \"replace\", \"state\", \"noThrow\", \"baseuri\"]);\n\n Promise.resolve().then(function () {\n var resolvedTo = resolve(to, baseuri);\n navigate(insertParams(resolvedTo, props), { replace: replace, state: state });\n });\n };\n\n RedirectImpl.prototype.render = function render() {\n var _props4 = this.props,\n navigate = _props4.navigate,\n to = _props4.to,\n from = _props4.from,\n replace = _props4.replace,\n state = _props4.state,\n noThrow = _props4.noThrow,\n baseuri = _props4.baseuri,\n props = _objectWithoutProperties(_props4, [\"navigate\", \"to\", \"from\", \"replace\", \"state\", \"noThrow\", \"baseuri\"]);\n\n var resolvedTo = resolve(to, baseuri);\n if (!noThrow) redirectTo(insertParams(resolvedTo, props));\n return null;\n };\n\n return RedirectImpl;\n}(React.Component);\n\nvar Redirect = function Redirect(props) {\n return React.createElement(\n BaseContext.Consumer,\n null,\n function (_ref7) {\n var baseuri = _ref7.baseuri;\n return React.createElement(\n Location,\n null,\n function (locationContext) {\n return React.createElement(RedirectImpl, _extends({}, locationContext, { baseuri: baseuri }, props));\n }\n );\n }\n );\n};\n\nprocess.env.NODE_ENV !== \"production\" ? Redirect.propTypes = {\n from: PropTypes.string,\n to: PropTypes.string.isRequired\n} : void 0;\n\n////////////////////////////////////////////////////////////////////////////////\nvar Match = function Match(_ref8) {\n var path = _ref8.path,\n children = _ref8.children;\n return React.createElement(\n BaseContext.Consumer,\n null,\n function (_ref9) {\n var baseuri = _ref9.baseuri;\n return React.createElement(\n Location,\n null,\n function (_ref10) {\n var navigate = _ref10.navigate,\n location = _ref10.location;\n\n var resolvedPath = resolve(path, baseuri);\n var result = match(resolvedPath, location.pathname);\n return children({\n navigate: navigate,\n location: location,\n match: result ? _extends({}, result.params, {\n uri: result.uri,\n path: path\n }) : null\n });\n }\n );\n }\n );\n};\n\n////////////////////////////////////////////////////////////////////////////////\n// Hooks\n\nvar useLocation = function useLocation() {\n var context = useContext(LocationContext);\n\n if (!context) {\n throw new Error(\"useLocation hook was used but a LocationContext.Provider was not found in the parent tree. Make sure this is used in a component that is a child of Router\");\n }\n\n return context.location;\n};\n\nvar useNavigate = function useNavigate() {\n var context = useContext(LocationContext);\n\n if (!context) {\n throw new Error(\"useNavigate hook was used but a LocationContext.Provider was not found in the parent tree. Make sure this is used in a component that is a child of Router\");\n }\n\n return context.navigate;\n};\n\nvar useParams = function useParams() {\n var context = useContext(BaseContext);\n\n if (!context) {\n throw new Error(\"useParams hook was used but a LocationContext.Provider was not found in the parent tree. Make sure this is used in a component that is a child of Router\");\n }\n\n var location = useLocation();\n\n var results = match(context.basepath, location.pathname);\n\n return results ? results.params : null;\n};\n\nvar useMatch = function useMatch(path) {\n if (!path) {\n throw new Error(\"useMatch(path: string) requires an argument of a string to match against\");\n }\n var context = useContext(BaseContext);\n\n if (!context) {\n throw new Error(\"useMatch hook was used but a LocationContext.Provider was not found in the parent tree. Make sure this is used in a component that is a child of Router\");\n }\n\n var location = useLocation();\n\n var resolvedPath = resolve(path, context.baseuri);\n var result = match(resolvedPath, location.pathname);\n return result ? _extends({}, result.params, {\n uri: result.uri,\n path: path\n }) : null;\n};\n\n////////////////////////////////////////////////////////////////////////////////\n// Junk\nvar stripSlashes = function stripSlashes(str) {\n return str.replace(/(^\\/+|\\/+$)/g, \"\");\n};\n\nvar createRoute = function createRoute(basepath) {\n return function (element) {\n if (!element) {\n return null;\n }\n\n if (element.type === React.Fragment && element.props.children) {\n return React.Children.map(element.props.children, createRoute(basepath));\n }\n !(element.props.path || element.props.default || element.type === Redirect) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \": Children of must have a `path` or `default` prop, or be a ``. None found on element type `\" + element.type + \"`\") : invariant(false) : void 0;\n\n !!(element.type === Redirect && (!element.props.from || !element.props.to)) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \" requires both \\\"from\\\" and \\\"to\\\" props when inside a .\") : invariant(false) : void 0;\n\n !!(element.type === Redirect && !validateRedirect(element.props.from, element.props.to)) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \" has mismatched dynamic segments, ensure both paths have the exact same dynamic segments.\") : invariant(false) : void 0;\n\n if (element.props.default) {\n return { value: element, default: true };\n }\n\n var elementPath = element.type === Redirect ? element.props.from : element.props.path;\n\n var path = elementPath === \"/\" ? basepath : stripSlashes(basepath) + \"/\" + stripSlashes(elementPath);\n\n return {\n value: element,\n default: element.props.default,\n path: element.props.children ? stripSlashes(path) + \"/*\" : path\n };\n };\n};\n\nvar shouldNavigate = function shouldNavigate(event) {\n return !event.defaultPrevented && event.button === 0 && !(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);\n};\n\n////////////////////////////////////////////////////////////////////////\nexport { Link, Location, LocationProvider, Match, Redirect, Router, ServerLocation, createHistory, createMemorySource, isRedirect, navigate, redirectTo, globalHistory, match as matchPath, useLocation, useNavigate, useParams, useMatch , BaseContext };","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}","(function () {\n var crypt = require('crypt'),\n utf8 = require('charenc').utf8,\n isBuffer = require('is-buffer'),\n bin = require('charenc').bin,\n // The core\n md5 = function md5(message, options) {\n // Convert to byte array\n if (message.constructor == String) {\n if (options && options.encoding === 'binary') message = bin.stringToBytes(message);else message = utf8.stringToBytes(message);\n } else if (isBuffer(message)) message = Array.prototype.slice.call(message, 0);else if (!Array.isArray(message) && message.constructor !== Uint8Array) message = message.toString(); // else, assume byte array already\n\n var m = crypt.bytesToWords(message),\n l = message.length * 8,\n a = 1732584193,\n b = -271733879,\n c = -1732584194,\n d = 271733878; // Swap endian\n\n for (var i = 0; i < m.length; i++) {\n m[i] = (m[i] << 8 | m[i] >>> 24) & 0x00FF00FF | (m[i] << 24 | m[i] >>> 8) & 0xFF00FF00;\n } // Padding\n\n\n m[l >>> 5] |= 0x80 << l % 32;\n m[(l + 64 >>> 9 << 4) + 14] = l; // Method shortcuts\n\n var FF = md5._ff,\n GG = md5._gg,\n HH = md5._hh,\n II = md5._ii;\n\n for (var i = 0; i < m.length; i += 16) {\n var aa = a,\n bb = b,\n cc = c,\n dd = d;\n a = FF(a, b, c, d, m[i + 0], 7, -680876936);\n d = FF(d, a, b, c, m[i + 1], 12, -389564586);\n c = FF(c, d, a, b, m[i + 2], 17, 606105819);\n b = FF(b, c, d, a, m[i + 3], 22, -1044525330);\n a = FF(a, b, c, d, m[i + 4], 7, -176418897);\n d = FF(d, a, b, c, m[i + 5], 12, 1200080426);\n c = FF(c, d, a, b, m[i + 6], 17, -1473231341);\n b = FF(b, c, d, a, m[i + 7], 22, -45705983);\n a = FF(a, b, c, d, m[i + 8], 7, 1770035416);\n d = FF(d, a, b, c, m[i + 9], 12, -1958414417);\n c = FF(c, d, a, b, m[i + 10], 17, -42063);\n b = FF(b, c, d, a, m[i + 11], 22, -1990404162);\n a = FF(a, b, c, d, m[i + 12], 7, 1804603682);\n d = FF(d, a, b, c, m[i + 13], 12, -40341101);\n c = FF(c, d, a, b, m[i + 14], 17, -1502002290);\n b = FF(b, c, d, a, m[i + 15], 22, 1236535329);\n a = GG(a, b, c, d, m[i + 1], 5, -165796510);\n d = GG(d, a, b, c, m[i + 6], 9, -1069501632);\n c = GG(c, d, a, b, m[i + 11], 14, 643717713);\n b = GG(b, c, d, a, m[i + 0], 20, -373897302);\n a = GG(a, b, c, d, m[i + 5], 5, -701558691);\n d = GG(d, a, b, c, m[i + 10], 9, 38016083);\n c = GG(c, d, a, b, m[i + 15], 14, -660478335);\n b = GG(b, c, d, a, m[i + 4], 20, -405537848);\n a = GG(a, b, c, d, m[i + 9], 5, 568446438);\n d = GG(d, a, b, c, m[i + 14], 9, -1019803690);\n c = GG(c, d, a, b, m[i + 3], 14, -187363961);\n b = GG(b, c, d, a, m[i + 8], 20, 1163531501);\n a = GG(a, b, c, d, m[i + 13], 5, -1444681467);\n d = GG(d, a, b, c, m[i + 2], 9, -51403784);\n c = GG(c, d, a, b, m[i + 7], 14, 1735328473);\n b = GG(b, c, d, a, m[i + 12], 20, -1926607734);\n a = HH(a, b, c, d, m[i + 5], 4, -378558);\n d = HH(d, a, b, c, m[i + 8], 11, -2022574463);\n c = HH(c, d, a, b, m[i + 11], 16, 1839030562);\n b = HH(b, c, d, a, m[i + 14], 23, -35309556);\n a = HH(a, b, c, d, m[i + 1], 4, -1530992060);\n d = HH(d, a, b, c, m[i + 4], 11, 1272893353);\n c = HH(c, d, a, b, m[i + 7], 16, -155497632);\n b = HH(b, c, d, a, m[i + 10], 23, -1094730640);\n a = HH(a, b, c, d, m[i + 13], 4, 681279174);\n d = HH(d, a, b, c, m[i + 0], 11, -358537222);\n c = HH(c, d, a, b, m[i + 3], 16, -722521979);\n b = HH(b, c, d, a, m[i + 6], 23, 76029189);\n a = HH(a, b, c, d, m[i + 9], 4, -640364487);\n d = HH(d, a, b, c, m[i + 12], 11, -421815835);\n c = HH(c, d, a, b, m[i + 15], 16, 530742520);\n b = HH(b, c, d, a, m[i + 2], 23, -995338651);\n a = II(a, b, c, d, m[i + 0], 6, -198630844);\n d = II(d, a, b, c, m[i + 7], 10, 1126891415);\n c = II(c, d, a, b, m[i + 14], 15, -1416354905);\n b = II(b, c, d, a, m[i + 5], 21, -57434055);\n a = II(a, b, c, d, m[i + 12], 6, 1700485571);\n d = II(d, a, b, c, m[i + 3], 10, -1894986606);\n c = II(c, d, a, b, m[i + 10], 15, -1051523);\n b = II(b, c, d, a, m[i + 1], 21, -2054922799);\n a = II(a, b, c, d, m[i + 8], 6, 1873313359);\n d = II(d, a, b, c, m[i + 15], 10, -30611744);\n c = II(c, d, a, b, m[i + 6], 15, -1560198380);\n b = II(b, c, d, a, m[i + 13], 21, 1309151649);\n a = II(a, b, c, d, m[i + 4], 6, -145523070);\n d = II(d, a, b, c, m[i + 11], 10, -1120210379);\n c = II(c, d, a, b, m[i + 2], 15, 718787259);\n b = II(b, c, d, a, m[i + 9], 21, -343485551);\n a = a + aa >>> 0;\n b = b + bb >>> 0;\n c = c + cc >>> 0;\n d = d + dd >>> 0;\n }\n\n return crypt.endian([a, b, c, d]);\n }; // Auxiliary functions\n\n\n md5._ff = function (a, b, c, d, x, s, t) {\n var n = a + (b & c | ~b & d) + (x >>> 0) + t;\n return (n << s | n >>> 32 - s) + b;\n };\n\n md5._gg = function (a, b, c, d, x, s, t) {\n var n = a + (b & d | c & ~d) + (x >>> 0) + t;\n return (n << s | n >>> 32 - s) + b;\n };\n\n md5._hh = function (a, b, c, d, x, s, t) {\n var n = a + (b ^ c ^ d) + (x >>> 0) + t;\n return (n << s | n >>> 32 - s) + b;\n };\n\n md5._ii = function (a, b, c, d, x, s, t) {\n var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;\n return (n << s | n >>> 32 - s) + b;\n }; // Package private blocksize\n\n\n md5._blocksize = 16;\n md5._digestsize = 16;\n\n module.exports = function (message, options) {\n if (message === undefined || message === null) throw new Error('Illegal argument ' + message);\n var digestbytes = crypt.wordsToBytes(md5(message, options));\n return options && options.asBytes ? digestbytes : options && options.asString ? bin.bytesToString(digestbytes) : crypt.bytesToHex(digestbytes);\n };\n})();","\"use strict\";\n\nvar __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\nvar __generator = this && this.__generator || function (thisArg, body) {\n var _ = {\n label: 0,\n sent: function sent() {\n if (t[0] & 1) throw t[1];\n return t[1];\n },\n trys: [],\n ops: []\n },\n f,\n y,\n t,\n g;\n return g = {\n next: verb(0),\n \"throw\": verb(1),\n \"return\": verb(2)\n }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function () {\n return this;\n }), g;\n\n function verb(n) {\n return function (v) {\n return step([n, v]);\n };\n }\n\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n\n while (_) {\n try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n\n switch (op[0]) {\n case 0:\n case 1:\n t = op;\n break;\n\n case 4:\n _.label++;\n return {\n value: op[1],\n done: false\n };\n\n case 5:\n _.label++;\n y = op[1];\n op = [0];\n continue;\n\n case 7:\n op = _.ops.pop();\n\n _.trys.pop();\n\n continue;\n\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {\n _ = 0;\n continue;\n }\n\n if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {\n _.label = op[1];\n break;\n }\n\n if (op[0] === 6 && _.label < t[1]) {\n _.label = t[1];\n t = op;\n break;\n }\n\n if (t && _.label < t[2]) {\n _.label = t[2];\n\n _.ops.push(op);\n\n break;\n }\n\n if (t[2]) _.ops.pop();\n\n _.trys.pop();\n\n continue;\n }\n\n op = body.call(thisArg, _);\n } catch (e) {\n op = [6, e];\n y = 0;\n } finally {\n f = t = 0;\n }\n }\n\n if (op[0] & 5) throw op[1];\n return {\n value: op[0] ? op[1] : void 0,\n done: true\n };\n }\n};\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.sequenceSeqArray = exports.traverseSeqArray = exports.traverseSeqArrayWithIndex = exports.sequenceArray = exports.traverseArray = exports.traverseArrayWithIndex = exports.apS = exports.bind = exports.bindTo = exports.Do = exports.never = exports.taskSeq = exports.task = exports.Monad = exports.ApplicativeSeq = exports.ApplicativePar = exports.Functor = exports.getRaceMonoid = exports.getMonoid = exports.getSemigroup = exports.URI = exports.fromTask = exports.flatten = exports.chainFirst = exports.chain = exports.of = exports.apSecond = exports.apFirst = exports.ap = exports.map = exports.chainIOK = exports.fromIOK = exports.delay = exports.fromIO = void 0;\n\nvar function_1 = require(\"./function\"); // -------------------------------------------------------------------------------------\n// constructors\n// -------------------------------------------------------------------------------------\n\n/**\n * @category constructors\n * @since 2.0.0\n */\n\n\nvar fromIO = function fromIO(ma) {\n return function () {\n return Promise.resolve(ma());\n };\n};\n\nexports.fromIO = fromIO; // -------------------------------------------------------------------------------------\n// combinators\n// -------------------------------------------------------------------------------------\n\n/**\n * Creates a task that will complete after a time delay\n *\n * @example\n * import { sequenceT } from 'fp-ts/Apply'\n * import * as T from 'fp-ts/Task'\n *\n * async function test() {\n * const log: Array = []\n * const append = (message: string): T.Task =>\n * T.fromIO(() => {\n * log.push(message)\n * })\n * const fa = append('a')\n * const fb = append('b')\n * const fc = T.delay(10)(append('c'))\n * const fd = append('d')\n * await sequenceT(T.task)(fa, fb, fc, fd)()\n * assert.deepStrictEqual(log, ['a', 'b', 'd', 'c'])\n * }\n *\n * test()\n *\n * @category combinators\n * @since 2.0.0\n */\n\nfunction delay(millis) {\n return function (ma) {\n return function () {\n return new Promise(function (resolve) {\n setTimeout(function () {\n // tslint:disable-next-line: no-floating-promises\n ma().then(resolve);\n }, millis);\n });\n };\n };\n}\n\nexports.delay = delay;\n/**\n * @category combinators\n * @since 2.4.0\n */\n\nfunction fromIOK(f) {\n return function () {\n var a = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n a[_i] = arguments[_i];\n }\n\n return exports.fromIO(f.apply(void 0, a));\n };\n}\n\nexports.fromIOK = fromIOK;\n/**\n * @category combinators\n * @since 2.4.0\n */\n\nfunction chainIOK(f) {\n return exports.chain(fromIOK(f));\n}\n\nexports.chainIOK = chainIOK; // -------------------------------------------------------------------------------------\n// non-pipeables\n// -------------------------------------------------------------------------------------\n\nvar map_ = function map_(fa, f) {\n return function_1.pipe(fa, exports.map(f));\n};\n\nvar apPar_ = function apPar_(fab, fa) {\n return function_1.pipe(fab, exports.ap(fa));\n};\n\nvar apSeq_ = function apSeq_(fab, fa) {\n return function_1.pipe(fab, exports.chain(function (f) {\n return function_1.pipe(fa, exports.map(f));\n }));\n};\n\nvar chain_ = function chain_(ma, f) {\n return function_1.pipe(ma, exports.chain(f));\n}; // -------------------------------------------------------------------------------------\n// pipeables\n// -------------------------------------------------------------------------------------\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 */\n\n\nvar map = function map(f) {\n return function (fa) {\n return function () {\n return fa().then(f);\n };\n };\n};\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 */\n\nvar ap = function ap(fa) {\n return function (fab) {\n return function () {\n return Promise.all([fab(), fa()]).then(function (_a) {\n var f = _a[0],\n a = _a[1];\n return f(a);\n });\n };\n };\n};\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 */\n\nvar apFirst = function apFirst(fb) {\n return function_1.flow(exports.map(function (a) {\n return function () {\n return a;\n };\n }), exports.ap(fb));\n};\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 */\n\nvar apSecond = function apSecond(fb) {\n return function_1.flow(exports.map(function () {\n return function (b) {\n return b;\n };\n }), exports.ap(fb));\n};\n\nexports.apSecond = apSecond;\n/**\n * Wrap a value into the type constructor.\n *\n * @category Applicative\n * @since 2.0.0\n */\n\nvar of = function of(a) {\n return function () {\n return Promise.resolve(a);\n };\n};\n\nexports.of = of;\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 */\n\nvar chain = function chain(f) {\n return function (ma) {\n return function () {\n return ma().then(function (a) {\n return f(a)();\n });\n };\n };\n};\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 */\n\nvar chainFirst = function chainFirst(f) {\n return exports.chain(function (a) {\n return function_1.pipe(f(a), exports.map(function () {\n return a;\n }));\n });\n};\n\nexports.chainFirst = chainFirst;\n/**\n * Derivable from `Monad`.\n *\n * @category combinators\n * @since 2.0.0\n */\n\nexports.flatten = /*#__PURE__*/exports.chain(function_1.identity);\n/**\n * @category MonadTask\n * @since 2.7.0\n */\n\nexports.fromTask = function_1.identity; // -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n\n/**\n * @category instances\n * @since 2.0.0\n */\n\nexports.URI = 'Task';\n/**\n * Lift a semigroup into 'Task', the inner values are concatenated using the provided `Semigroup`.\n *\n * @example\n * import * as T from 'fp-ts/Task'\n * import { semigroupString } from 'fp-ts/Semigroup'\n *\n * async function test() {\n * const S = T.getSemigroup(semigroupString)\n * const fa = T.of('a')\n * const fb = T.of('b')\n * assert.deepStrictEqual(await S.concat(fa, fb)(), 'ab')\n * }\n *\n * test()\n *\n * @category instances\n * @since 2.0.0\n */\n\nfunction getSemigroup(S) {\n return {\n concat: function concat(x, y) {\n return function () {\n return x().then(function (rx) {\n return y().then(function (ry) {\n return S.concat(rx, ry);\n });\n });\n };\n }\n };\n}\n\nexports.getSemigroup = getSemigroup;\n/**\n * Lift a monoid into 'Task', the inner values are concatenated using the provided `Monoid`.\n *\n * @category instances\n * @since 2.0.0\n */\n\nfunction getMonoid(M) {\n return {\n concat: getSemigroup(M).concat,\n empty: exports.of(M.empty)\n };\n}\n\nexports.getMonoid = getMonoid;\n/**\n * Monoid returning the first completed task.\n *\n * Note: uses `Promise.race` internally.\n *\n * @example\n * import * as T from 'fp-ts/Task'\n *\n * async function test() {\n * const S = T.getRaceMonoid()\n * const fa = T.delay(20)(T.of('a'))\n * const fb = T.delay(10)(T.of('b'))\n * assert.deepStrictEqual(await S.concat(fa, fb)(), 'b')\n * }\n *\n * test()\n *\n * @category instances\n * @since 2.0.0\n */\n\nfunction getRaceMonoid() {\n return {\n concat: function concat(x, y) {\n return function () {\n return Promise.race([x(), y()]);\n };\n },\n empty: exports.never\n };\n}\n\nexports.getRaceMonoid = getRaceMonoid;\n/**\n * @category instances\n * @since 2.7.0\n */\n\nexports.Functor = {\n URI: exports.URI,\n map: map_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\n\nexports.ApplicativePar = {\n URI: exports.URI,\n map: map_,\n ap: apPar_,\n of: exports.of\n};\n/**\n * @category instances\n * @since 2.7.0\n */\n\nexports.ApplicativeSeq = {\n URI: exports.URI,\n map: map_,\n ap: apSeq_,\n of: exports.of\n};\n/**\n * Used in TaskEither.getTaskValidation\n *\n * @internal\n */\n\nexports.Monad = {\n URI: exports.URI,\n map: map_,\n of: exports.of,\n ap: apPar_,\n chain: chain_\n}; // TODO: remove in v3\n\n/**\n * @category instances\n * @since 2.0.0\n */\n\nexports.task = {\n URI: exports.URI,\n map: map_,\n of: exports.of,\n ap: apPar_,\n chain: chain_,\n fromIO: exports.fromIO,\n fromTask: exports.fromTask\n}; // TODO: remove in v3\n\n/**\n * Like `task` but `ap` is sequential\n *\n * @category instances\n * @since 2.0.0\n */\n\nexports.taskSeq = {\n URI: exports.URI,\n map: map_,\n of: exports.of,\n ap: apSeq_,\n chain: chain_,\n fromIO: exports.fromIO,\n fromTask: exports.fromTask\n}; // -------------------------------------------------------------------------------------\n// utils\n// -------------------------------------------------------------------------------------\n\n/**\n * A `Task` that never completes.\n *\n * @since 2.0.0\n */\n\nvar never = function never() {\n return new Promise(function (_) {\n return undefined;\n });\n};\n\nexports.never = never; // -------------------------------------------------------------------------------------\n// do notation\n// -------------------------------------------------------------------------------------\n\n/**\n * @since 2.9.0\n */\n\nexports.Do = /*#__PURE__*/exports.of({});\n/**\n * @since 2.8.0\n */\n\nvar bindTo = function bindTo(name) {\n return exports.map(function_1.bindTo_(name));\n};\n\nexports.bindTo = bindTo;\n/**\n * @since 2.8.0\n */\n\nvar bind = function bind(name, f) {\n return exports.chain(function (a) {\n return function_1.pipe(f(a), exports.map(function (b) {\n return function_1.bind_(a, name, b);\n }));\n });\n};\n\nexports.bind = bind; // -------------------------------------------------------------------------------------\n// pipeable sequence S\n// -------------------------------------------------------------------------------------\n\n/**\n * @since 2.8.0\n */\n\nvar apS = function apS(name, fb) {\n return function_1.flow(exports.map(function (a) {\n return function (b) {\n return function_1.bind_(a, name, b);\n };\n }), exports.ap(fb));\n};\n\nexports.apS = apS; // -------------------------------------------------------------------------------------\n// array utils\n// -------------------------------------------------------------------------------------\n\n/**\n * @since 2.9.0\n */\n\nvar traverseArrayWithIndex = function traverseArrayWithIndex(f) {\n return function (arr) {\n return function () {\n return Promise.all(arr.map(function (x, i) {\n return f(i, x)();\n }));\n };\n };\n};\n\nexports.traverseArrayWithIndex = traverseArrayWithIndex;\n/**\n * this function map array to task using provided function and transform it to a task of array.\n *\n * this function has the same behavior of `A.traverse(T.task)` but it's stack safe.\n *\n * > **This function run all task in parallel for sequential use `traverseSeqArray` **\n *\n * @example\n * import { range } from 'fp-ts/ReadonlyArray'\n * import { pipe } from 'fp-ts/function'\n * import { of, traverseArray } from 'fp-ts/Task'\n * async function test() {\n * const arr = range(0, 10)\n * assert.deepStrictEqual(await pipe(arr, traverseArray(of))(), arr)\n * }\n *\n * test()\n *\n * @since 2.9.0\n */\n\nvar traverseArray = function traverseArray(f) {\n return exports.traverseArrayWithIndex(function (_, a) {\n return f(a);\n });\n};\n\nexports.traverseArray = traverseArray;\n/**\n * this function works like `Promise.all` it will get an array of tasks and return a task of array.\n *\n * this function has the same behavior of `A.sequence(T.task)` but it's stack safe.\n *\n * > **This function run all task in parallel for sequential use `sequenceSeqArray` **\n *\n * @example\n * import * as RA from 'fp-ts/ReadonlyArray'\n * import { pipe } from 'fp-ts/function'\n * import { of, sequenceArray } from 'fp-ts/Task'\n *\n * async function test() {\n * const arr = RA.range(1, 10)\n * assert.deepStrictEqual(await pipe(arr, RA.map(of), sequenceArray)(), arr)\n * }\n *\n * test()\n *\n * @since 2.9.0\n */\n\nvar sequenceArray = function sequenceArray(arr) {\n return function () {\n return Promise.all(arr.map(function (x) {\n return x();\n }));\n };\n};\n\nexports.sequenceArray = sequenceArray;\n/**\n * @since 2.9.0\n */\n\nvar traverseSeqArrayWithIndex = function traverseSeqArrayWithIndex(f) {\n return function (arr) {\n return function () {\n return __awaiter(void 0, void 0, void 0, function () {\n var result, i, r;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n result = [];\n i = 0;\n _a.label = 1;\n\n case 1:\n if (!(i < arr.length)) return [3\n /*break*/\n , 4];\n return [4\n /*yield*/\n , f(i, arr[i])()];\n\n case 2:\n r = _a.sent();\n result.push(r);\n _a.label = 3;\n\n case 3:\n i++;\n return [3\n /*break*/\n , 1];\n\n case 4:\n return [2\n /*return*/\n , result];\n }\n });\n });\n };\n };\n};\n\nexports.traverseSeqArrayWithIndex = traverseSeqArrayWithIndex;\n/**\n * runs an action for every element in array then run task sequential, and accumulates the results in the array.\n *\n * this function has the same behavior of `A.traverse(T.taskSeq)` but it's stack safe.\n *\n * > **This function run all task sequentially for parallel use `traverseArray` **\n *\n *\n * @since 2.9.0\n */\n\nvar traverseSeqArray = function traverseSeqArray(f) {\n return exports.traverseSeqArrayWithIndex(function (_, a) {\n return f(a);\n });\n};\n\nexports.traverseSeqArray = traverseSeqArray;\n/**\n * run tasks in array sequential and give a task of array\n *\n * this function has the same behavior of `A.sequence(T.taskSeq)` but it's stack safe.\n *\n * > **This function run all task sequentially for parallel use `sequenceArray` **\n *\n * @since 2.9.0\n */\n\nexports.sequenceSeqArray = /*#__PURE__*/exports.traverseSeqArray(function_1.identity);","var NATIVE_WEAK_MAP = require('../internals/native-weak-map');\nvar global = require('../internals/global');\nvar isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar objectHas = require('../internals/has');\nvar shared = require('../internals/shared-store');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar WeakMap = global.WeakMap;\nvar set, get, has;\n\nvar enforce = function (it) {\n return has(it) ? get(it) : set(it, {});\n};\n\nvar getterFor = function (TYPE) {\n return function (it) {\n var state;\n if (!isObject(it) || (state = get(it)).type !== TYPE) {\n throw TypeError('Incompatible receiver, ' + TYPE + ' required');\n } return state;\n };\n};\n\nif (NATIVE_WEAK_MAP) {\n var store = shared.state || (shared.state = new WeakMap());\n var wmget = store.get;\n var wmhas = store.has;\n var wmset = store.set;\n set = function (it, metadata) {\n metadata.facade = it;\n wmset.call(store, it, metadata);\n return metadata;\n };\n get = function (it) {\n return wmget.call(store, it) || {};\n };\n has = function (it) {\n return wmhas.call(store, it);\n };\n} else {\n var STATE = sharedKey('state');\n hiddenKeys[STATE] = true;\n set = function (it, metadata) {\n metadata.facade = it;\n createNonEnumerableProperty(it, STATE, metadata);\n return metadata;\n };\n get = function (it) {\n return objectHas(it, STATE) ? it[STATE] : {};\n };\n has = function (it) {\n return objectHas(it, STATE);\n };\n}\n\nmodule.exports = {\n set: set,\n get: get,\n has: has,\n enforce: enforce,\n getterFor: getterFor\n};\n","var global = require('../internals/global');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar has = require('../internals/has');\nvar setGlobal = require('../internals/set-global');\nvar inspectSource = require('../internals/inspect-source');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar getInternalState = InternalStateModule.get;\nvar enforceInternalState = InternalStateModule.enforce;\nvar TEMPLATE = String(String).split('String');\n\n(module.exports = function (O, key, value, options) {\n var unsafe = options ? !!options.unsafe : false;\n var simple = options ? !!options.enumerable : false;\n var noTargetGet = options ? !!options.noTargetGet : false;\n var state;\n if (typeof value == 'function') {\n if (typeof key == 'string' && !has(value, 'name')) {\n createNonEnumerableProperty(value, 'name', key);\n }\n state = enforceInternalState(value);\n if (!state.source) {\n state.source = TEMPLATE.join(typeof key == 'string' ? key : '');\n }\n }\n if (O === global) {\n if (simple) O[key] = value;\n else setGlobal(key, value);\n return;\n } else if (!unsafe) {\n delete O[key];\n } else if (!noTargetGet && O[key]) {\n simple = true;\n }\n if (simple) O[key] = value;\n else createNonEnumerableProperty(O, key, value);\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, 'toString', function toString() {\n return typeof this == 'function' && getInternalState(this).source || inspectSource(this);\n});\n","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;","/**\n * Remove a prefix from a string. Return the input string if the given prefix\n * isn't found.\n */\n\nexport default function stripPrefix(str, prefix = ``) {\n if (!prefix) {\n return str\n }\n\n if (str === prefix) {\n return `/`\n }\n\n if (str.startsWith(`${prefix}/`)) {\n return str.slice(prefix.length)\n }\n\n return str\n}\n","\"use strict\";\n\nexports.__esModule = true;\nexports.parsePath = parsePath;\n\nfunction parsePath(path) {\n var pathname = path || \"/\";\n var search = \"\";\n var hash = \"\";\n var hashIndex = pathname.indexOf(\"#\");\n\n if (hashIndex !== -1) {\n hash = pathname.substr(hashIndex);\n pathname = pathname.substr(0, hashIndex);\n }\n\n var searchIndex = pathname.indexOf(\"?\");\n\n if (searchIndex !== -1) {\n search = pathname.substr(searchIndex);\n pathname = pathname.substr(0, searchIndex);\n }\n\n return {\n pathname: pathname,\n search: search === \"?\" ? \"\" : search,\n hash: hash === \"#\" ? \"\" : hash\n };\n}","exports.f = Object.getOwnPropertySymbols;\n","import setPrototypeOf from \"@babel/runtime/helpers/esm/setPrototypeOf\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","// IE8- don't enum bug keys\nmodule.exports = [\n 'constructor',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toLocaleString',\n 'toString',\n 'valueOf'\n];\n","const support = function (feature) {\n if (typeof document === `undefined`) {\n return false\n }\n const fakeLink = document.createElement(`link`)\n try {\n if (fakeLink.relList && typeof fakeLink.relList.supports === `function`) {\n return fakeLink.relList.supports(feature)\n }\n } catch (err) {\n return false\n }\n return false\n}\n\nconst linkPrefetchStrategy = function (url, options) {\n return new Promise((resolve, reject) => {\n if (typeof document === `undefined`) {\n reject()\n return\n }\n\n const link = document.createElement(`link`)\n link.setAttribute(`rel`, `prefetch`)\n link.setAttribute(`href`, url)\n\n Object.keys(options).forEach(key => {\n link.setAttribute(key, options[key])\n })\n\n link.onload = resolve\n link.onerror = reject\n\n const parentElement =\n document.getElementsByTagName(`head`)[0] ||\n document.getElementsByName(`script`)[0].parentNode\n parentElement.appendChild(link)\n })\n}\n\nconst xhrPrefetchStrategy = function (url) {\n return new Promise((resolve, reject) => {\n const req = new XMLHttpRequest()\n req.open(`GET`, url, true)\n\n req.onload = () => {\n if (req.status === 200) {\n resolve()\n } else {\n reject()\n }\n }\n\n req.send(null)\n })\n}\n\nconst supportedPrefetchStrategy = support(`prefetch`)\n ? linkPrefetchStrategy\n : xhrPrefetchStrategy\n\nconst preFetched = {}\n\nconst prefetch = function (url, options) {\n return new Promise(resolve => {\n if (preFetched[url]) {\n resolve()\n return\n }\n\n supportedPrefetchStrategy(url, options)\n .then(() => {\n resolve()\n preFetched[url] = true\n })\n .catch(() => {}) // 404s are logged to the console anyway\n })\n}\n\nexport default prefetch\n","import prefetchHelper from \"./prefetch\"\nimport emitter from \"./emitter\"\nimport { setMatchPaths, findPath, findMatchPath } from \"./find-path\"\n\n/**\n * Available resource loading statuses\n */\nexport const PageResourceStatus = {\n /**\n * At least one of critical resources failed to load\n */\n Error: `error`,\n /**\n * Resources loaded successfully\n */\n Success: `success`,\n}\n\nconst preferDefault = m => (m && m.default) || m\n\nconst stripSurroundingSlashes = s => {\n s = s[0] === `/` ? s.slice(1) : s\n s = s.endsWith(`/`) ? s.slice(0, -1) : s\n return s\n}\n\nconst createPageDataUrl = path => {\n const fixedPath = path === `/` ? `index` : stripSurroundingSlashes(path)\n return `${__PATH_PREFIX__}/page-data/${fixedPath}/page-data.json`\n}\n\nfunction doFetch(url, method = `GET`) {\n return new Promise((resolve, reject) => {\n const req = new XMLHttpRequest()\n req.open(method, url, true)\n req.onreadystatechange = () => {\n if (req.readyState == 4) {\n resolve(req)\n }\n }\n req.send(null)\n })\n}\n\nconst doesConnectionSupportPrefetch = () => {\n if (\n `connection` in navigator &&\n typeof navigator.connection !== `undefined`\n ) {\n if ((navigator.connection.effectiveType || ``).includes(`2g`)) {\n return false\n }\n if (navigator.connection.saveData) {\n return false\n }\n }\n return true\n}\n\nconst toPageResources = (pageData, component = null) => {\n const page = {\n componentChunkName: pageData.componentChunkName,\n path: pageData.path,\n webpackCompilationHash: pageData.webpackCompilationHash,\n matchPath: pageData.matchPath,\n staticQueryHashes: pageData.staticQueryHashes,\n }\n\n return {\n component,\n json: pageData.result,\n page,\n }\n}\n\nexport class BaseLoader {\n constructor(loadComponent, matchPaths) {\n // Map of pagePath -> Page. Where Page is an object with: {\n // status: PageResourceStatus.Success || PageResourceStatus.Error,\n // payload: PageResources, // undefined if PageResourceStatus.Error\n // }\n // PageResources is {\n // component,\n // json: pageData.result,\n // page: {\n // componentChunkName,\n // path,\n // webpackCompilationHash,\n // staticQueryHashes\n // },\n // staticQueryResults\n // }\n this.pageDb = new Map()\n this.inFlightDb = new Map()\n this.staticQueryDb = {}\n this.pageDataDb = new Map()\n this.prefetchTriggered = new Set()\n this.prefetchCompleted = new Set()\n this.loadComponent = loadComponent\n setMatchPaths(matchPaths)\n }\n\n inFlightNetworkRequests = new Map()\n\n memoizedGet(url) {\n let inFlightPromise = this.inFlightNetworkRequests.get(url)\n\n if (!inFlightPromise) {\n inFlightPromise = doFetch(url, `GET`)\n this.inFlightNetworkRequests.set(url, inFlightPromise)\n }\n\n // Prefer duplication with then + catch over .finally to prevent problems in ie11 + firefox\n return inFlightPromise\n .then(response => {\n this.inFlightNetworkRequests.delete(url)\n return response\n })\n .catch(err => {\n this.inFlightNetworkRequests.delete(url)\n throw err\n })\n }\n\n setApiRunner(apiRunner) {\n this.apiRunner = apiRunner\n this.prefetchDisabled = apiRunner(`disableCorePrefetching`).some(a => a)\n }\n\n fetchPageDataJson(loadObj) {\n const { pagePath, retries = 0 } = loadObj\n const url = createPageDataUrl(pagePath)\n return this.memoizedGet(url).then(req => {\n const { status, responseText } = req\n\n // Handle 200\n if (status === 200) {\n try {\n const jsonPayload = JSON.parse(responseText)\n if (jsonPayload.path === undefined) {\n throw new Error(`not a valid pageData response`)\n }\n\n return Object.assign(loadObj, {\n status: PageResourceStatus.Success,\n payload: jsonPayload,\n })\n } catch (err) {\n // continue regardless of error\n }\n }\n\n // Handle 404\n if (status === 404 || status === 200) {\n // If the request was for a 404 page and it doesn't exist, we're done\n if (pagePath === `/404.html`) {\n return Object.assign(loadObj, {\n status: PageResourceStatus.Error,\n })\n }\n\n // Need some code here to cache the 404 request. In case\n // multiple loadPageDataJsons result in 404s\n return this.fetchPageDataJson(\n Object.assign(loadObj, { pagePath: `/404.html`, notFound: true })\n )\n }\n\n // handle 500 response (Unrecoverable)\n if (status === 500) {\n return Object.assign(loadObj, {\n status: PageResourceStatus.Error,\n })\n }\n\n // Handle everything else, including status === 0, and 503s. Should retry\n if (retries < 3) {\n return this.fetchPageDataJson(\n Object.assign(loadObj, { retries: retries + 1 })\n )\n }\n\n // Retried 3 times already, result is an error.\n return Object.assign(loadObj, {\n status: PageResourceStatus.Error,\n })\n })\n }\n\n loadPageDataJson(rawPath) {\n const pagePath = findPath(rawPath)\n if (this.pageDataDb.has(pagePath)) {\n const pageData = this.pageDataDb.get(pagePath)\n if (process.env.BUILD_STAGE !== `develop` || !pageData.stale) {\n return Promise.resolve(pageData)\n }\n }\n\n return this.fetchPageDataJson({ pagePath }).then(pageData => {\n this.pageDataDb.set(pagePath, pageData)\n\n return pageData\n })\n }\n\n findMatchPath(rawPath) {\n return findMatchPath(rawPath)\n }\n\n // TODO check all uses of this and whether they use undefined for page resources not exist\n loadPage(rawPath) {\n const pagePath = findPath(rawPath)\n if (this.pageDb.has(pagePath)) {\n const page = this.pageDb.get(pagePath)\n if (process.env.BUILD_STAGE !== `develop` || !page.payload.stale) {\n return Promise.resolve(page.payload)\n }\n }\n\n if (this.inFlightDb.has(pagePath)) {\n return this.inFlightDb.get(pagePath)\n }\n\n const inFlightPromise = Promise.all([\n this.loadAppData(),\n this.loadPageDataJson(pagePath),\n ]).then(allData => {\n const result = allData[1]\n if (result.status === PageResourceStatus.Error) {\n return {\n status: PageResourceStatus.Error,\n }\n }\n\n let pageData = result.payload\n const { componentChunkName, staticQueryHashes = [] } = pageData\n\n const finalResult = {}\n\n const componentChunkPromise = this.loadComponent(componentChunkName).then(\n component => {\n finalResult.createdAt = new Date()\n let pageResources\n if (!component) {\n finalResult.status = PageResourceStatus.Error\n } else {\n finalResult.status = PageResourceStatus.Success\n if (result.notFound === true) {\n finalResult.notFound = true\n }\n pageData = Object.assign(pageData, {\n webpackCompilationHash: allData[0]\n ? allData[0].webpackCompilationHash\n : ``,\n })\n pageResources = toPageResources(pageData, component)\n }\n // undefined if final result is an error\n return pageResources\n }\n )\n\n const staticQueryBatchPromise = Promise.all(\n staticQueryHashes.map(staticQueryHash => {\n // Check for cache in case this static query result has already been loaded\n if (this.staticQueryDb[staticQueryHash]) {\n const jsonPayload = this.staticQueryDb[staticQueryHash]\n return { staticQueryHash, jsonPayload }\n }\n\n return this.memoizedGet(\n `${__PATH_PREFIX__}/page-data/sq/d/${staticQueryHash}.json`\n ).then(req => {\n const jsonPayload = JSON.parse(req.responseText)\n return { staticQueryHash, jsonPayload }\n })\n })\n ).then(staticQueryResults => {\n const staticQueryResultsMap = {}\n\n staticQueryResults.forEach(({ staticQueryHash, jsonPayload }) => {\n staticQueryResultsMap[staticQueryHash] = jsonPayload\n this.staticQueryDb[staticQueryHash] = jsonPayload\n })\n\n return staticQueryResultsMap\n })\n\n return Promise.all([componentChunkPromise, staticQueryBatchPromise]).then(\n ([pageResources, staticQueryResults]) => {\n let payload\n if (pageResources) {\n payload = { ...pageResources, staticQueryResults }\n finalResult.payload = payload\n emitter.emit(`onPostLoadPageResources`, {\n page: payload,\n pageResources: payload,\n })\n }\n\n this.pageDb.set(pagePath, finalResult)\n\n return payload\n }\n )\n })\n\n inFlightPromise\n .then(response => {\n this.inFlightDb.delete(pagePath)\n })\n .catch(error => {\n this.inFlightDb.delete(pagePath)\n throw error\n })\n\n this.inFlightDb.set(pagePath, inFlightPromise)\n\n return inFlightPromise\n }\n\n // returns undefined if loading page ran into errors\n loadPageSync(rawPath) {\n const pagePath = findPath(rawPath)\n if (this.pageDb.has(pagePath)) {\n const pageData = this.pageDb.get(pagePath).payload\n return pageData\n }\n return undefined\n }\n\n shouldPrefetch(pagePath) {\n // Skip prefetching if we know user is on slow or constrained connection\n if (!doesConnectionSupportPrefetch()) {\n return false\n }\n\n // Check if the page exists.\n if (this.pageDb.has(pagePath)) {\n return false\n }\n\n return true\n }\n\n prefetch(pagePath) {\n if (!this.shouldPrefetch(pagePath)) {\n return false\n }\n\n // Tell plugins with custom prefetching logic that they should start\n // prefetching this path.\n if (!this.prefetchTriggered.has(pagePath)) {\n this.apiRunner(`onPrefetchPathname`, { pathname: pagePath })\n this.prefetchTriggered.add(pagePath)\n }\n\n // If a plugin has disabled core prefetching, stop now.\n if (this.prefetchDisabled) {\n return false\n }\n\n const realPath = findPath(pagePath)\n // Todo make doPrefetch logic cacheable\n // eslint-disable-next-line consistent-return\n this.doPrefetch(realPath).then(() => {\n if (!this.prefetchCompleted.has(pagePath)) {\n this.apiRunner(`onPostPrefetchPathname`, { pathname: pagePath })\n this.prefetchCompleted.add(pagePath)\n }\n })\n\n return true\n }\n\n doPrefetch(pagePath) {\n const pageDataUrl = createPageDataUrl(pagePath)\n return prefetchHelper(pageDataUrl, {\n crossOrigin: `anonymous`,\n as: `fetch`,\n }).then(() =>\n // This was just prefetched, so will return a response from\n // the cache instead of making another request to the server\n this.loadPageDataJson(pagePath)\n )\n }\n\n hovering(rawPath) {\n this.loadPage(rawPath)\n }\n\n getResourceURLsForPathname(rawPath) {\n const pagePath = findPath(rawPath)\n const page = this.pageDataDb.get(pagePath)\n if (page) {\n const pageResources = toPageResources(page.payload)\n\n return [\n ...createComponentUrls(pageResources.page.componentChunkName),\n createPageDataUrl(pagePath),\n ]\n } else {\n return null\n }\n }\n\n isPageNotFound(rawPath) {\n const pagePath = findPath(rawPath)\n const page = this.pageDb.get(pagePath)\n return !page || page.notFound\n }\n\n loadAppData(retries = 0) {\n return this.memoizedGet(`${__PATH_PREFIX__}/page-data/app-data.json`).then(\n req => {\n const { status, responseText } = req\n\n let appData\n\n if (status !== 200 && retries < 3) {\n // Retry 3 times incase of non-200 responses\n return this.loadAppData(retries + 1)\n }\n\n // Handle 200\n if (status === 200) {\n try {\n const jsonPayload = JSON.parse(responseText)\n if (jsonPayload.webpackCompilationHash === undefined) {\n throw new Error(`not a valid app-data response`)\n }\n\n appData = jsonPayload\n } catch (err) {\n // continue regardless of error\n }\n }\n\n return appData\n }\n )\n }\n}\n\nconst createComponentUrls = componentChunkName =>\n (window.___chunkMapping[componentChunkName] || []).map(\n chunk => __PATH_PREFIX__ + chunk\n )\n\nexport class ProdLoader extends BaseLoader {\n constructor(asyncRequires, matchPaths) {\n const loadComponent = chunkName =>\n asyncRequires.components[chunkName]\n ? asyncRequires.components[chunkName]()\n .then(preferDefault)\n // loader will handle the case when component is null\n .catch(() => null)\n : Promise.resolve()\n\n super(loadComponent, matchPaths)\n }\n\n doPrefetch(pagePath) {\n return super.doPrefetch(pagePath).then(result => {\n if (result.status !== PageResourceStatus.Success) {\n return Promise.resolve()\n }\n const pageData = result.payload\n const chunkName = pageData.componentChunkName\n const componentUrls = createComponentUrls(chunkName)\n return Promise.all(componentUrls.map(prefetchHelper)).then(() => pageData)\n })\n }\n\n loadPageDataJson(rawPath) {\n return super.loadPageDataJson(rawPath).then(data => {\n if (data.notFound) {\n // check if html file exist using HEAD request:\n // if it does we should navigate to it instead of showing 404\n return doFetch(rawPath, `HEAD`).then(req => {\n if (req.status === 200) {\n // page (.html file) actually exist (or we asked for 404 )\n // returning page resources status as errored to trigger\n // regular browser navigation to given page\n return {\n status: PageResourceStatus.Error,\n }\n }\n\n // if HEAD request wasn't 200, return notFound result\n // and show 404 page\n return data\n })\n }\n return data\n })\n }\n}\n\nlet instance\n\nexport const setLoader = _loader => {\n instance = _loader\n}\n\nexport const publicLoader = {\n // Deprecated methods. As far as we're aware, these are only used by\n // core gatsby and the offline plugin, however there's a very small\n // chance they're called by others.\n getResourcesForPathname: rawPath => {\n console.warn(\n `Warning: getResourcesForPathname is deprecated. Use loadPage instead`\n )\n return instance.i.loadPage(rawPath)\n },\n getResourcesForPathnameSync: rawPath => {\n console.warn(\n `Warning: getResourcesForPathnameSync is deprecated. Use loadPageSync instead`\n )\n return instance.i.loadPageSync(rawPath)\n },\n enqueue: rawPath => instance.prefetch(rawPath),\n\n // Real methods\n getResourceURLsForPathname: rawPath =>\n instance.getResourceURLsForPathname(rawPath),\n loadPage: rawPath => instance.loadPage(rawPath),\n loadPageSync: rawPath => instance.loadPageSync(rawPath),\n prefetch: rawPath => instance.prefetch(rawPath),\n isPageNotFound: rawPath => instance.isPageNotFound(rawPath),\n hovering: rawPath => instance.hovering(rawPath),\n loadAppData: () => instance.loadAppData(),\n}\n\nexport default publicLoader\n\nexport function getStaticQueryResults() {\n if (instance) {\n return instance.staticQueryDb\n } else {\n return {}\n }\n}\n","var requireObjectCoercible = require('../internals/require-object-coercible');\n\n// `ToObject` abstract operation\n// https://tc39.es/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return Object(requireObjectCoercible(argument));\n};\n","var global = require('../internals/global');\nvar inspectSource = require('../internals/inspect-source');\n\nvar WeakMap = global.WeakMap;\n\nmodule.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));\n","\"use strict\";\n\nrequire(\"core-js/modules/es.array.reduce.js\");\n\nrequire(\"core-js/modules/es.array.reduce-right.js\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.pipeable = exports.pipe = void 0;\n\nvar function_1 = require(\"./function\"); // TODO: remove module in v3\n\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 */\n\n\nexports.pipe = function_1.pipe;\n\nvar isFunctor = function isFunctor(I) {\n return typeof I.map === 'function';\n};\n\nvar isContravariant = function isContravariant(I) {\n return typeof I.contramap === 'function';\n};\n\nvar isFunctorWithIndex = function isFunctorWithIndex(I) {\n return typeof I.mapWithIndex === 'function';\n};\n\nvar isApply = function isApply(I) {\n return typeof I.ap === 'function';\n};\n\nvar isChain = function isChain(I) {\n return typeof I.chain === 'function';\n};\n\nvar isBifunctor = function isBifunctor(I) {\n return typeof I.bimap === 'function';\n};\n\nvar isExtend = function isExtend(I) {\n return typeof I.extend === 'function';\n};\n\nvar isFoldable = function isFoldable(I) {\n return typeof I.reduce === 'function';\n};\n\nvar isFoldableWithIndex = function isFoldableWithIndex(I) {\n return typeof I.reduceWithIndex === 'function';\n};\n\nvar isAlt = function isAlt(I) {\n return typeof I.alt === 'function';\n};\n\nvar isCompactable = function isCompactable(I) {\n return typeof I.compact === 'function';\n};\n\nvar isFilterable = function isFilterable(I) {\n return typeof I.filter === 'function';\n};\n\nvar isFilterableWithIndex = function isFilterableWithIndex(I) {\n return typeof I.filterWithIndex === 'function';\n};\n\nvar isProfunctor = function isProfunctor(I) {\n return typeof I.promap === 'function';\n};\n\nvar isSemigroupoid = function isSemigroupoid(I) {\n return typeof I.compose === 'function';\n};\n\nvar isMonadThrow = function isMonadThrow(I) {\n return typeof I.throwError === 'function';\n};\n\nfunction pipeable(I) {\n var r = {};\n\n if (isFunctor(I)) {\n var map = function map(f) {\n return function (fa) {\n return I.map(fa, f);\n };\n };\n\n r.map = map;\n }\n\n if (isContravariant(I)) {\n var contramap = function contramap(f) {\n return function (fa) {\n return I.contramap(fa, f);\n };\n };\n\n r.contramap = contramap;\n }\n\n if (isFunctorWithIndex(I)) {\n var mapWithIndex = function mapWithIndex(f) {\n return function (fa) {\n return I.mapWithIndex(fa, f);\n };\n };\n\n r.mapWithIndex = mapWithIndex;\n }\n\n if (isApply(I)) {\n var ap = function ap(fa) {\n return function (fab) {\n return I.ap(fab, fa);\n };\n };\n\n var apFirst = function apFirst(fb) {\n return function (fa) {\n return I.ap(I.map(fa, function (a) {\n return function () {\n return a;\n };\n }), fb);\n };\n };\n\n r.ap = ap;\n r.apFirst = apFirst;\n\n r.apSecond = function (fb) {\n return function (fa) {\n return I.ap(I.map(fa, function () {\n return function (b) {\n return b;\n };\n }), fb);\n };\n };\n }\n\n if (isChain(I)) {\n var chain = function chain(f) {\n return function (ma) {\n return I.chain(ma, f);\n };\n };\n\n var chainFirst = function chainFirst(f) {\n return function (ma) {\n return I.chain(ma, function (a) {\n return I.map(f(a), function () {\n return a;\n });\n });\n };\n };\n\n var flatten = function flatten(mma) {\n return I.chain(mma, function_1.identity);\n };\n\n r.chain = chain;\n r.chainFirst = chainFirst;\n r.flatten = flatten;\n }\n\n if (isBifunctor(I)) {\n var bimap = function bimap(f, g) {\n return function (fa) {\n return I.bimap(fa, f, g);\n };\n };\n\n var mapLeft = function mapLeft(f) {\n return function (fa) {\n return I.mapLeft(fa, f);\n };\n };\n\n r.bimap = bimap;\n r.mapLeft = mapLeft;\n }\n\n if (isExtend(I)) {\n var extend = function extend(f) {\n return function (wa) {\n return I.extend(wa, f);\n };\n };\n\n var duplicate = function duplicate(wa) {\n return I.extend(wa, function_1.identity);\n };\n\n r.extend = extend;\n r.duplicate = duplicate;\n }\n\n if (isFoldable(I)) {\n var reduce = function reduce(b, f) {\n return function (fa) {\n return I.reduce(fa, b, f);\n };\n };\n\n var foldMap = function foldMap(M) {\n var foldMapM = I.foldMap(M);\n return function (f) {\n return function (fa) {\n return foldMapM(fa, f);\n };\n };\n };\n\n var reduceRight = function reduceRight(b, f) {\n return function (fa) {\n return I.reduceRight(fa, b, f);\n };\n };\n\n r.reduce = reduce;\n r.foldMap = foldMap;\n r.reduceRight = reduceRight;\n }\n\n if (isFoldableWithIndex(I)) {\n var reduceWithIndex = function reduceWithIndex(b, f) {\n return function (fa) {\n return I.reduceWithIndex(fa, b, f);\n };\n };\n\n var foldMapWithIndex = function foldMapWithIndex(M) {\n var foldMapM = I.foldMapWithIndex(M);\n return function (f) {\n return function (fa) {\n return foldMapM(fa, f);\n };\n };\n };\n\n var reduceRightWithIndex = function reduceRightWithIndex(b, f) {\n return function (fa) {\n return I.reduceRightWithIndex(fa, b, f);\n };\n };\n\n r.reduceWithIndex = reduceWithIndex;\n r.foldMapWithIndex = foldMapWithIndex;\n r.reduceRightWithIndex = reduceRightWithIndex;\n }\n\n if (isAlt(I)) {\n var alt = function alt(that) {\n return function (fa) {\n return I.alt(fa, that);\n };\n };\n\n r.alt = alt;\n }\n\n if (isCompactable(I)) {\n r.compact = I.compact;\n r.separate = I.separate;\n }\n\n if (isFilterable(I)) {\n var filter = function filter(predicate) {\n return function (fa) {\n return I.filter(fa, predicate);\n };\n };\n\n var filterMap = function filterMap(f) {\n return function (fa) {\n return I.filterMap(fa, f);\n };\n };\n\n var partition = function partition(predicate) {\n return function (fa) {\n return I.partition(fa, predicate);\n };\n };\n\n var partitionMap = function partitionMap(f) {\n return function (fa) {\n return I.partitionMap(fa, f);\n };\n };\n\n r.filter = filter;\n r.filterMap = filterMap;\n r.partition = partition;\n r.partitionMap = partitionMap;\n }\n\n if (isFilterableWithIndex(I)) {\n var filterWithIndex = function filterWithIndex(predicateWithIndex) {\n return function (fa) {\n return I.filterWithIndex(fa, predicateWithIndex);\n };\n };\n\n var filterMapWithIndex = function filterMapWithIndex(f) {\n return function (fa) {\n return I.filterMapWithIndex(fa, f);\n };\n };\n\n var partitionWithIndex = function partitionWithIndex(predicateWithIndex) {\n return function (fa) {\n return I.partitionWithIndex(fa, predicateWithIndex);\n };\n };\n\n var partitionMapWithIndex = function partitionMapWithIndex(f) {\n return function (fa) {\n return I.partitionMapWithIndex(fa, f);\n };\n };\n\n r.filterWithIndex = filterWithIndex;\n r.filterMapWithIndex = filterMapWithIndex;\n r.partitionWithIndex = partitionWithIndex;\n r.partitionMapWithIndex = partitionMapWithIndex;\n }\n\n if (isProfunctor(I)) {\n var promap = function promap(f, g) {\n return function (fa) {\n return I.promap(fa, f, g);\n };\n };\n\n r.promap = promap;\n }\n\n if (isSemigroupoid(I)) {\n var compose = function compose(that) {\n return function (fa) {\n return I.compose(fa, that);\n };\n };\n\n r.compose = compose;\n }\n\n if (isMonadThrow(I)) {\n var fromOption = function fromOption(onNone) {\n return function (ma) {\n return ma._tag === 'None' ? I.throwError(onNone()) : I.of(ma.value);\n };\n };\n\n var fromEither = function fromEither(ma) {\n return ma._tag === 'Left' ? I.throwError(ma.left) : I.of(ma.right);\n };\n\n var fromPredicate = function fromPredicate(predicate, onFalse) {\n return function (a) {\n return predicate(a) ? I.of(a) : I.throwError(onFalse(a));\n };\n };\n\n var filterOrElse = function filterOrElse(predicate, onFalse) {\n return function (ma) {\n return I.chain(ma, function (a) {\n return predicate(a) ? I.of(a) : I.throwError(onFalse(a));\n });\n };\n };\n\n r.fromOption = fromOption;\n r.fromEither = fromEither;\n r.fromPredicate = fromPredicate;\n r.filterOrElse = filterOrElse;\n }\n\n return r;\n}\n\nexports.pipeable = pipeable;","var fails = require('../internals/fails');\n\n// Detect IE8's incomplete defineProperty implementation\nmodule.exports = !fails(function () {\n return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;\n});\n","var isObject = require('../internals/is-object');\n\nmodule.exports = function (it) {\n if (!isObject(it)) {\n throw TypeError(String(it) + ' is not an object');\n } return it;\n};\n","\"use strict\";\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports.ScrollContainer = void 0;\n\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\n\nvar _inheritsLoose2 = _interopRequireDefault(require(\"@babel/runtime/helpers/inheritsLoose\"));\n\nvar React = _interopRequireWildcard(require(\"react\"));\n\nvar _reactDom = _interopRequireDefault(require(\"react-dom\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _scrollHandler = require(\"./scroll-handler\");\n\nvar _router = require(\"@reach/router\");\n\n// TODO: In Gatsby v3, this file should be removed.\n// We are deprecating this in V2 in favor of useScrollRestoration\nvar propTypes = {\n scrollKey: _propTypes.default.string.isRequired,\n shouldUpdateScroll: _propTypes.default.func,\n children: _propTypes.default.element.isRequired\n};\nvar hasNotWarnedDeprecation = true;\n\nvar ScrollContainerImplementation = /*#__PURE__*/function (_React$Component) {\n (0, _inheritsLoose2.default)(ScrollContainerImplementation, _React$Component);\n\n function ScrollContainerImplementation(props) {\n var _this;\n\n _this = _React$Component.call(this, props) || this;\n\n if (process.env.NODE_ENV !== \"production\" && hasNotWarnedDeprecation) {\n hasNotWarnedDeprecation = false;\n console.log(\"Deprecation Warning:\\n\\n Gatsby is deprecated in Gatsby v2 and will be removed in Gatsby v3.\\n Update to the React hook alternative useScrollRestoration, like this:.\\n \\n ```\\n import React from 'react';\\n import { useScrollRestoration } from 'gatsby-react-router-scroll';\\n\\n function Component() {\\n const scrollRestoration = useScrollRestoration('\" + _this.props.scrollKey + \"');\\n\\n return ;\\n }\\n ```\\n \");\n }\n\n return _this;\n }\n\n var _proto = ScrollContainerImplementation.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n var _this2 = this;\n\n // eslint-disable-next-line react/no-find-dom-node\n var node = _reactDom.default.findDOMNode(this);\n\n var _this$props = this.props,\n location = _this$props.location,\n scrollKey = _this$props.scrollKey;\n if (!node) return;\n node.addEventListener(\"scroll\", function () {\n _this2.props.context.save(location, scrollKey, node.scrollTop);\n });\n var position = this.props.context.read(location, scrollKey);\n node.scrollTo(0, position || 0);\n };\n\n _proto.render = function render() {\n return this.props.children;\n };\n\n return ScrollContainerImplementation;\n}(React.Component);\n\nvar ScrollContainer = function ScrollContainer(props) {\n return /*#__PURE__*/React.createElement(_router.Location, null, function (_ref) {\n var location = _ref.location;\n return /*#__PURE__*/React.createElement(_scrollHandler.ScrollContext.Consumer, null, function (context) {\n return /*#__PURE__*/React.createElement(ScrollContainerImplementation, (0, _extends2.default)({}, props, {\n context: context,\n location: location\n }));\n });\n });\n};\n\nexports.ScrollContainer = ScrollContainer;\nScrollContainer.propTypes = propTypes;","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getFilterableComposition = void 0;\n/**\n * `Filterable` represents data structures which can be _partitioned_/_filtered_.\n *\n * Adapted from https://github.com/LiamGoodacre/purescript-filterable/blob/master/src/Data/Filterable.purs\n *\n * @since 2.0.0\n */\n\nvar Compactable_1 = require(\"./Compactable\");\n\nvar Option_1 = require(\"./Option\");\n\nfunction getFilterableComposition(F, G) {\n var CC = Compactable_1.getCompactableComposition(F, G);\n var FC = {\n map: CC.map,\n compact: CC.compact,\n separate: CC.separate,\n partitionMap: function partitionMap(fga, f) {\n var left = FC.filterMap(fga, function (a) {\n return Option_1.getLeft(f(a));\n });\n var right = FC.filterMap(fga, function (a) {\n return Option_1.getRight(f(a));\n });\n return {\n left: left,\n right: right\n };\n },\n partition: function partition(fga, p) {\n var left = FC.filter(fga, function (a) {\n return !p(a);\n });\n var right = FC.filter(fga, p);\n return {\n left: left,\n right: right\n };\n },\n filterMap: function filterMap(fga, f) {\n return F.map(fga, function (ga) {\n return G.filterMap(ga, f);\n });\n },\n filter: function filter(fga, f) {\n return F.map(fga, function (ga) {\n return G.filter(ga, f);\n });\n }\n };\n return FC;\n}\n\nexports.getFilterableComposition = getFilterableComposition;","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n MAX_SAFE_INTEGER = 9007199254740991;\n/** `Object#toString` result references. */\n\nvar argsTag = '[object Arguments]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n symbolTag = '[object Symbol]';\n/** Detect free variable `global` from Node.js. */\n\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n/** Detect free variable `self`. */\n\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n/** Used as a reference to the global object. */\n\nvar root = freeGlobal || freeSelf || Function('return this')();\n/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\n\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0:\n return func.call(thisArg);\n\n case 1:\n return func.call(thisArg, args[0]);\n\n case 2:\n return func.call(thisArg, args[0], args[1]);\n\n case 3:\n return func.call(thisArg, args[0], args[1], args[2]);\n }\n\n return func.apply(thisArg, args);\n}\n/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n\n\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array ? array.length : 0,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n\n return result;\n}\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\n\n\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n\n return array;\n}\n/** Used for built-in method references. */\n\n\nvar objectProto = Object.prototype;\n/** Used to check objects for own properties. */\n\nvar hasOwnProperty = objectProto.hasOwnProperty;\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\n\nvar objectToString = objectProto.toString;\n/** Built-in value references. */\n\nvar Symbol = root.Symbol,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n/* Built-in method references for those with the same name as other `lodash` methods. */\n\nvar nativeMax = Math.max;\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\n\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n\n return result;\n}\n/**\n * The base implementation of `_.pick` without support for individual\n * property identifiers.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} props The property identifiers to pick.\n * @returns {Object} Returns the new object.\n */\n\n\nfunction basePick(object, props) {\n object = Object(object);\n return basePickBy(object, props, function (value, key) {\n return key in object;\n });\n}\n/**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} props The property identifiers to pick from.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\n\n\nfunction basePickBy(object, props, predicate) {\n var index = -1,\n length = props.length,\n result = {};\n\n while (++index < length) {\n var key = props[index],\n value = object[key];\n\n if (predicate(value, key)) {\n result[key] = value;\n }\n }\n\n return result;\n}\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\n\n\nfunction baseRest(func, start) {\n start = nativeMax(start === undefined ? func.length - 1 : start, 0);\n return function () {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n\n index = -1;\n var otherArgs = Array(start + 1);\n\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n\n otherArgs[start] = array;\n return apply(func, this, otherArgs);\n };\n}\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\n\n\nfunction isFlattenable(value) {\n return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\n\n\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n\n var result = value + '';\n return result == '0' && 1 / value == -INFINITY ? '-0' : result;\n}\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\n\n\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\n\n\nvar isArray = Array.isArray;\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\n\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\n\n\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\n\n\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\n\n\nfunction isLength(value) {\n return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\n\n\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\n\n\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\n\n\nfunction isSymbol(value) {\n return typeof value == 'symbol' || isObjectLike(value) && objectToString.call(value) == symbolTag;\n}\n/**\n * Creates an object composed of the picked `object` properties.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [props] The property identifiers to pick.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pick(object, ['a', 'c']);\n * // => { 'a': 1, 'c': 3 }\n */\n\n\nvar pick = baseRest(function (object, props) {\n return object == null ? {} : basePick(object, arrayMap(baseFlatten(props, 1), toKey));\n});\nmodule.exports = pick;","var store = require('../internals/shared-store');\n\nvar functionToString = Function.toString;\n\n// this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper\nif (typeof store.inspectSource != 'function') {\n store.inspectSource = function (it) {\n return functionToString.call(it);\n };\n}\n\nmodule.exports = store.inspectSource;\n","import md5 from 'md5'\nimport omit from 'lodash.omit'\n\nimport { BROWSER_STORE_KEY } from './constants'\n\nimport { GatsbyBrowser } from 'gatsby'\nimport { BrowserPluginOptions } from './types'\n\ndeclare global {\n interface Window {\n [BROWSER_STORE_KEY]: BrowserPluginOptionsStore\n // Used for the legacy Prismic Toolbar script.\n prismic?: {\n endpoint?: string\n }\n }\n}\n\nexport interface BrowserPluginOptionsStore {\n [key: string]: {\n pluginOptions: BrowserPluginOptions\n schemasDigest: string\n }\n}\n\nexport const onClientEntry: GatsbyBrowser['onClientEntry'] = (\n _gatsbyContext,\n pluginOptions: BrowserPluginOptions,\n) => {\n if (pluginOptions.prismicToolbar === 'legacy')\n // The legacy Prismic Toolbar script requires setting the endpoint globally\n // to window.\n window.prismic = {\n endpoint: `https://${pluginOptions.repositoryName}.cdn.prismic.io/api/v2`,\n }\n\n window[BROWSER_STORE_KEY] = Object.assign({}, window[BROWSER_STORE_KEY], {\n [pluginOptions.repositoryName]: {\n pluginOptions: omit(pluginOptions, ['schemas', 'plugins']),\n schemasDigest: md5(JSON.stringify(pluginOptions.schemas)),\n },\n })\n}\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getCompactableComposition = void 0;\n\nvar Functor_1 = require(\"./Functor\");\n\nvar Option_1 = require(\"./Option\");\n\nfunction getCompactableComposition(F, G) {\n var FC = Functor_1.getFunctorComposition(F, G);\n var CC = {\n map: FC.map,\n compact: function compact(fga) {\n return F.map(fga, G.compact);\n },\n separate: function separate(fge) {\n var left = CC.compact(FC.map(fge, Option_1.getLeft));\n var right = CC.compact(FC.map(fge, Option_1.getRight));\n return {\n left: left,\n right: right\n };\n }\n };\n return CC;\n}\n\nexports.getCompactableComposition = getCompactableComposition;","\"use strict\";\n\nrequire(\"core-js/modules/es.array.reduce.js\");\n\nrequire(\"core-js/modules/es.array.reduce-right.js\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\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;\n\nvar function_1 = require(\"./function\"); // -------------------------------------------------------------------------------------\n// guards\n// -------------------------------------------------------------------------------------\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 */\n\n\nvar isSome = function isSome(fa) {\n return fa._tag === 'Some';\n};\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 guards\n * @since 2.0.0\n */\n\nvar isNone = function isNone(fa) {\n return fa._tag === 'None';\n};\n\nexports.isNone = isNone; // -------------------------------------------------------------------------------------\n// constructors\n// -------------------------------------------------------------------------------------\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 */\n\nexports.none = {\n _tag: 'None'\n};\n/**\n * Constructs a `Some`. Represents an optional value that exists.\n *\n * @category constructors\n * @since 2.0.0\n */\n\nvar some = function some(a) {\n return {\n _tag: 'Some',\n value: a\n };\n};\n\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 */\n\nfunction fromNullable(a) {\n return a == null ? exports.none : exports.some(a);\n}\n\nexports.fromNullable = fromNullable;\n\nfunction fromPredicate(predicate) {\n return function (a) {\n return predicate(a) ? exports.some(a) : exports.none;\n };\n}\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 */\n\nfunction tryCatch(f) {\n try {\n return exports.some(f());\n } catch (e) {\n return exports.none;\n }\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 */\n\nfunction getLeft(ma) {\n return ma._tag === 'Right' ? exports.none : exports.some(ma.left);\n}\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 */\n\nfunction getRight(ma) {\n return ma._tag === 'Left' ? exports.none : exports.some(ma.right);\n}\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 */\n\nexports.fromEither = getRight; // -------------------------------------------------------------------------------------\n// destructors\n// -------------------------------------------------------------------------------------\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 */\n\nfunction fold(onNone, onSome) {\n return function (ma) {\n return exports.isNone(ma) ? onNone() : onSome(ma.value);\n };\n}\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 */\n\nfunction toNullable(ma) {\n return exports.isNone(ma) ? null : ma.value;\n}\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 */\n\nfunction toUndefined(ma) {\n return exports.isNone(ma) ? undefined : ma.value;\n}\n\nexports.toUndefined = toUndefined;\n/**\n * Less strict version of [`getOrElse`](#getOrElse).\n *\n * @category destructors\n * @since 2.6.0\n */\n\nvar getOrElseW = function getOrElseW(onNone) {\n return function (ma) {\n return exports.isNone(ma) ? onNone() : ma.value;\n };\n};\n\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 */\n\nexports.getOrElse = exports.getOrElseW; // -------------------------------------------------------------------------------------\n// combinators\n// -------------------------------------------------------------------------------------\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 */\n\nfunction fromNullableK(f) {\n return function () {\n var a = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n a[_i] = arguments[_i];\n }\n\n return fromNullable(f.apply(void 0, a));\n };\n}\n\nexports.fromNullableK = fromNullableK;\n/**\n * @category combinators\n * @since 2.0.0\n * @deprecated\n */\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 */\n\nfunction chainNullableK(f) {\n return function (ma) {\n return exports.isNone(ma) ? exports.none : fromNullable(f(ma.value));\n };\n}\n\nexports.chainNullableK = chainNullableK; // -------------------------------------------------------------------------------------\n// non-pipeables\n// -------------------------------------------------------------------------------------\n\nvar map_ = function map_(fa, f) {\n return function_1.pipe(fa, exports.map(f));\n};\n\nvar ap_ = function ap_(fab, fa) {\n return function_1.pipe(fab, exports.ap(fa));\n};\n\nvar chain_ = function chain_(ma, f) {\n return function_1.pipe(ma, exports.chain(f));\n};\n\nvar reduce_ = function reduce_(fa, b, f) {\n return function_1.pipe(fa, exports.reduce(b, f));\n};\n\nvar foldMap_ = function foldMap_(M) {\n var foldMapM = exports.foldMap(M);\n return function (fa, f) {\n return function_1.pipe(fa, foldMapM(f));\n };\n};\n\nvar reduceRight_ = function reduceRight_(fa, b, f) {\n return function_1.pipe(fa, exports.reduceRight(b, f));\n};\n\nvar traverse_ = function traverse_(F) {\n var traverseF = exports.traverse(F);\n return function (ta, f) {\n return function_1.pipe(ta, traverseF(f));\n };\n};\n/* istanbul ignore next */\n\n\nvar alt_ = function alt_(fa, that) {\n return function_1.pipe(fa, exports.alt(that));\n};\n\nvar filter_ = function filter_(fa, predicate) {\n return function_1.pipe(fa, exports.filter(predicate));\n};\n/* istanbul ignore next */\n\n\nvar filterMap_ = function filterMap_(fa, f) {\n return function_1.pipe(fa, exports.filterMap(f));\n};\n/* istanbul ignore next */\n\n\nvar extend_ = function extend_(wa, f) {\n return function_1.pipe(wa, exports.extend(f));\n};\n/* istanbul ignore next */\n\n\nvar partition_ = function partition_(fa, predicate) {\n return function_1.pipe(fa, exports.partition(predicate));\n};\n/* istanbul ignore next */\n\n\nvar partitionMap_ = function partitionMap_(fa, f) {\n return function_1.pipe(fa, exports.partitionMap(f));\n};\n/* istanbul ignore next */\n\n\nvar wither_ = function wither_(F) {\n var witherF = exports.wither(F);\n return function (fa, f) {\n return function_1.pipe(fa, witherF(f));\n };\n};\n/* istanbul ignore next */\n\n\nvar wilt_ = function wilt_(F) {\n var wiltF = exports.wilt(F);\n return function (fa, f) {\n return function_1.pipe(fa, wiltF(f));\n };\n}; // -------------------------------------------------------------------------------------\n// pipeables\n// -------------------------------------------------------------------------------------\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 */\n\n\nvar map = function map(f) {\n return function (fa) {\n return exports.isNone(fa) ? exports.none : exports.some(f(fa.value));\n };\n};\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 */\n\nvar ap = function ap(fa) {\n return function (fab) {\n return exports.isNone(fab) ? exports.none : exports.isNone(fa) ? exports.none : exports.some(fab.value(fa.value));\n };\n};\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 */\n\nvar apFirst = function apFirst(fb) {\n return function_1.flow(exports.map(function (a) {\n return function () {\n return a;\n };\n }), exports.ap(fb));\n};\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 */\n\nvar apSecond = function apSecond(fb) {\n return function_1.flow(exports.map(function () {\n return function (b) {\n return b;\n };\n }), exports.ap(fb));\n};\n\nexports.apSecond = apSecond;\n/**\n * Wrap a value into the type constructor.\n *\n * @category Applicative\n * @since 2.7.0\n */\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 */\n\nvar chain = function chain(f) {\n return function (ma) {\n return exports.isNone(ma) ? exports.none : f(ma.value);\n };\n};\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 */\n\nvar chainFirst = function chainFirst(f) {\n return exports.chain(function (a) {\n return function_1.pipe(f(a), exports.map(function () {\n return a;\n }));\n });\n};\n\nexports.chainFirst = chainFirst;\n/**\n * Derivable from `Monad`.\n *\n * @category combinators\n * @since 2.0.0\n */\n\nexports.flatten = /*#__PURE__*/exports.chain(function_1.identity);\n/**\n * Less strict version of [`alt`](#alt).\n *\n * @category Alt\n * @since 2.9.0\n */\n\nvar altW = function altW(that) {\n return function (fa) {\n return exports.isNone(fa) ? that() : fa;\n };\n};\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 */\n\nexports.alt = exports.altW;\n/**\n * @category Alternative\n * @since 2.7.0\n */\n\nvar zero = function zero() {\n return exports.none;\n};\n\nexports.zero = zero;\n/**\n * @category MonadThrow\n * @since 2.7.0\n */\n\nvar throwError = function throwError() {\n return exports.none;\n};\n\nexports.throwError = throwError;\n/**\n * @category Extend\n * @since 2.0.0\n */\n\nvar extend = function extend(f) {\n return function (wa) {\n return exports.isNone(wa) ? exports.none : exports.some(f(wa));\n };\n};\n\nexports.extend = extend;\n/**\n * Derivable from `Extend`.\n *\n * @category combinators\n * @since 2.0.0\n */\n\nexports.duplicate = /*#__PURE__*/exports.extend(function_1.identity);\n/**\n * @category Foldable\n * @since 2.0.0\n */\n\nvar reduce = function reduce(b, f) {\n return function (fa) {\n return exports.isNone(fa) ? b : f(b, fa.value);\n };\n};\n\nexports.reduce = reduce;\n/**\n * @category Foldable\n * @since 2.0.0\n */\n\nvar foldMap = function foldMap(M) {\n return function (f) {\n return function (fa) {\n return exports.isNone(fa) ? M.empty : f(fa.value);\n };\n };\n};\n\nexports.foldMap = foldMap;\n/**\n * @category Foldable\n * @since 2.0.0\n */\n\nvar reduceRight = function reduceRight(b, f) {\n return function (fa) {\n return exports.isNone(fa) ? b : f(fa.value, b);\n };\n};\n\nexports.reduceRight = reduceRight;\n/**\n * @category Compactable\n * @since 2.0.0\n */\n\nexports.compact = exports.flatten;\nvar defaultSeparate = {\n left: exports.none,\n right: exports.none\n};\n/**\n * @category Compactable\n * @since 2.0.0\n */\n\nvar separate = function separate(ma) {\n var o = function_1.pipe(ma, exports.map(function (e) {\n return {\n left: getLeft(e),\n right: getRight(e)\n };\n }));\n return exports.isNone(o) ? defaultSeparate : o.value;\n};\n\nexports.separate = separate;\n/**\n * @category Filterable\n * @since 2.0.0\n */\n\nvar filter = function filter(predicate) {\n return function (fa) {\n return exports.isNone(fa) ? exports.none : predicate(fa.value) ? fa : exports.none;\n };\n};\n\nexports.filter = filter;\n/**\n * @category Filterable\n * @since 2.0.0\n */\n\nvar filterMap = function filterMap(f) {\n return function (fa) {\n return exports.isNone(fa) ? exports.none : f(fa.value);\n };\n};\n\nexports.filterMap = filterMap;\n/**\n * @category Filterable\n * @since 2.0.0\n */\n\nvar partition = function partition(predicate) {\n return function (fa) {\n return {\n left: filter_(fa, function (a) {\n return !predicate(a);\n }),\n right: filter_(fa, predicate)\n };\n };\n};\n\nexports.partition = partition;\n/**\n * @category Filterable\n * @since 2.0.0\n */\n\nvar partitionMap = function partitionMap(f) {\n return function_1.flow(exports.map(f), exports.separate);\n};\n\nexports.partitionMap = partitionMap;\n/**\n * @category Traversable\n * @since 2.6.3\n */\n\nvar traverse = function traverse(F) {\n return function (f) {\n return function (ta) {\n return exports.isNone(ta) ? F.of(exports.none) : F.map(f(ta.value), exports.some);\n };\n };\n};\n\nexports.traverse = traverse;\n/**\n * @category Traversable\n * @since 2.6.3\n */\n\nvar sequence = function sequence(F) {\n return function (ta) {\n return exports.isNone(ta) ? F.of(exports.none) : F.map(ta.value, exports.some);\n };\n};\n\nexports.sequence = sequence;\n/**\n * @category Witherable\n * @since 2.6.5\n */\n\nvar wither = function wither(F) {\n return function (f) {\n return function (fa) {\n return exports.isNone(fa) ? F.of(exports.none) : f(fa.value);\n };\n };\n};\n\nexports.wither = wither;\n/**\n * @category Witherable\n * @since 2.6.5\n */\n\nvar wilt = function wilt(F) {\n return function (f) {\n return function (fa) {\n return exports.isNone(fa) ? F.of({\n left: exports.none,\n right: exports.none\n }) : F.map(f(fa.value), function (e) {\n return {\n left: getLeft(e),\n right: getRight(e)\n };\n });\n };\n };\n};\n\nexports.wilt = wilt; // -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n\n/**\n * @category instances\n * @since 2.0.0\n */\n\nexports.URI = 'Option';\n/**\n * @category instances\n * @since 2.0.0\n */\n\nfunction getShow(S) {\n return {\n show: function show(ma) {\n return exports.isNone(ma) ? 'none' : \"some(\" + S.show(ma.value) + \")\";\n }\n };\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 */\n\nfunction getEq(E) {\n return {\n equals: function equals(x, y) {\n return x === y || (exports.isNone(x) ? exports.isNone(y) : exports.isNone(y) ? false : E.equals(x.value, y.value));\n }\n };\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 */\n\nfunction getOrd(O) {\n return {\n equals: getEq(O).equals,\n compare: function compare(x, y) {\n return x === y ? 0 : exports.isSome(x) ? exports.isSome(y) ? O.compare(x.value, y.value) : 1 : -1;\n }\n };\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 */\n\nfunction getApplySemigroup(S) {\n return {\n concat: function concat(x, y) {\n return exports.isSome(x) && exports.isSome(y) ? exports.some(S.concat(x.value, y.value)) : exports.none;\n }\n };\n}\n\nexports.getApplySemigroup = getApplySemigroup;\n/**\n * @category instances\n * @since 2.0.0\n */\n\nfunction getApplyMonoid(M) {\n return {\n concat: getApplySemigroup(M).concat,\n empty: exports.some(M.empty)\n };\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 */\n\nfunction getFirstMonoid() {\n return {\n concat: function concat(x, y) {\n return exports.isNone(x) ? y : x;\n },\n empty: exports.none\n };\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 */\n\nfunction getLastMonoid() {\n return {\n concat: function concat(x, y) {\n return exports.isNone(y) ? x : y;\n },\n empty: exports.none\n };\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 */\n\nfunction getMonoid(S) {\n return {\n concat: function concat(x, y) {\n return exports.isNone(x) ? y : exports.isNone(y) ? x : exports.some(S.concat(x.value, y.value));\n },\n empty: exports.none\n };\n}\n\nexports.getMonoid = getMonoid;\n/**\n * @category instances\n * @since 2.7.0\n */\n\nexports.Functor = {\n URI: exports.URI,\n map: map_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\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 */\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 */\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 */\n\nexports.Alt = {\n URI: exports.URI,\n map: map_,\n alt: alt_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\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 */\n\nexports.Extend = {\n URI: exports.URI,\n map: map_,\n extend: extend_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\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 */\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 */\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 */\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 */\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}; // TODO: remove in v3\n\n/**\n * @category instances\n * @since 2.0.0\n */\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// utils\n// -------------------------------------------------------------------------------------\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 */\n\nfunction elem(E) {\n return function (a, ma) {\n return exports.isNone(ma) ? false : E.equals(a, ma.value);\n };\n}\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 */\n\nfunction exists(predicate) {\n return function (ma) {\n return exports.isNone(ma) ? false : predicate(ma.value);\n };\n}\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 */\n\nfunction getRefinement(getOption) {\n return function (a) {\n return exports.isSome(getOption(a));\n };\n}\n\nexports.getRefinement = getRefinement; // -------------------------------------------------------------------------------------\n// do notation\n// -------------------------------------------------------------------------------------\n\n/**\n * @since 2.9.0\n */\n\nexports.Do = /*#__PURE__*/exports.of({});\n/**\n * @since 2.8.0\n */\n\nvar bindTo = function bindTo(name) {\n return exports.map(function_1.bindTo_(name));\n};\n\nexports.bindTo = bindTo;\n/**\n * @since 2.8.0\n */\n\nvar bind = function bind(name, f) {\n return exports.chain(function (a) {\n return function_1.pipe(f(a), exports.map(function (b) {\n return function_1.bind_(a, name, b);\n }));\n });\n};\n\nexports.bind = bind; // -------------------------------------------------------------------------------------\n// pipeable sequence S\n// -------------------------------------------------------------------------------------\n\n/**\n * @since 2.8.0\n */\n\nvar apS = function apS(name, fb) {\n return function_1.flow(exports.map(function (a) {\n return function (b) {\n return function_1.bind_(a, name, b);\n };\n }), exports.ap(fb));\n};\n\nexports.apS = apS; // -------------------------------------------------------------------------------------\n// array utils\n// -------------------------------------------------------------------------------------\n\n/**\n *\n * @since 2.9.0\n */\n\nvar traverseArrayWithIndex = function traverseArrayWithIndex(f) {\n return function (arr) {\n // tslint:disable-next-line: readonly-array\n var result = [];\n\n for (var i = 0; i < arr.length; i++) {\n var b = f(i, arr[i]);\n\n if (exports.isNone(b)) {\n return exports.none;\n }\n\n result.push(b.value);\n }\n\n return exports.some(result);\n };\n};\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 */\n\nvar traverseArray = function traverseArray(f) {\n return exports.traverseArrayWithIndex(function (_, a) {\n return f(a);\n });\n};\n\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 */\n\nexports.sequenceArray = /*#__PURE__*/exports.traverseArray(function_1.identity);","var id = 0;\nvar postfix = Math.random();\n\nmodule.exports = function (key) {\n return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","var fails = require('../internals/fails');\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value == POLYFILL ? true\n : value == NATIVE ? false\n : typeof detection == 'function' ? fails(detection)\n : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","const preferDefault = m => (m && m.default) || m\n\nif (process.env.BUILD_STAGE === `develop`) {\n module.exports = preferDefault(require(`./public-page-renderer-dev`))\n} else if (process.env.BUILD_STAGE === `build-javascript`) {\n module.exports = preferDefault(require(`./public-page-renderer-prod`))\n} else {\n module.exports = () => null\n}\n","var DESCRIPTORS = require('../internals/descriptors');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\nvar anObject = require('../internals/an-object');\nvar toPrimitive = require('../internals/to-primitive');\n\nvar nativeDefineProperty = Object.defineProperty;\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return nativeDefineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","var charenc = {\n // UTF-8 encoding\n utf8: {\n // Convert a string to a byte array\n stringToBytes: function stringToBytes(str) {\n return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));\n },\n // Convert a byte array to a string\n bytesToString: function bytesToString(bytes) {\n return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));\n }\n },\n // Binary encoding\n bin: {\n // Convert a string to a byte array\n stringToBytes: function stringToBytes(str) {\n for (var bytes = [], i = 0; i < str.length; i++) {\n bytes.push(str.charCodeAt(i) & 0xFF);\n }\n\n return bytes;\n },\n // Convert a byte array to a string\n bytesToString: function bytesToString(bytes) {\n for (var str = [], i = 0; i < bytes.length; i++) {\n str.push(String.fromCharCode(bytes[i]));\n }\n\n return str.join('');\n }\n }\n};\nmodule.exports = charenc;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nvar _gatsby = require(\"gatsby\");\n\nvar _getManifestPathname = _interopRequireDefault(require(\"./get-manifest-pathname\"));\n\n/* global __MANIFEST_PLUGIN_HAS_LOCALISATION__ */\n// when we don't have localisation in our manifest, we tree shake everything away\nif (__MANIFEST_PLUGIN_HAS_LOCALISATION__) {\n exports.onRouteUpdate = function (_ref, pluginOptions) {\n var location = _ref.location;\n var localize = pluginOptions.localize;\n var manifestFilename = (0, _getManifestPathname.default)(location.pathname, localize);\n var manifestEl = document.head.querySelector(\"link[rel=\\\"manifest\\\"]\");\n\n if (manifestEl) {\n manifestEl.setAttribute(\"href\", (0, _gatsby.withPrefix)(manifestFilename));\n }\n };\n}","/*\n Why commonjs and not ES imports/exports?\n\n This module is used to alias `create-react-context` package, but drop the the actual implementation part\n because Gatsby requires version of react that has implementatoin baked in.\n \n Package source is using ES modules:\n - https://github.com/jamiebuilds/create-react-context/blob/v0.3.0/src/index.js\n \n But to build this package `babel-plugin-add-module-exports` is used ( https://www.npmjs.com/package/babel-plugin-add-module-exports).\n Which result in both `module.exports` and `exports.default` being set to same thing.\n\n We don't use that babel plugin so we only have `exports.default`.\n\n This cause problems in various 3rd party react components that rely on `module.exports` being set.\n See https://github.com/gatsbyjs/gatsby/issues/23645 for example of it.\n \n Instead of adding same babel plugin we mimic output here. Adding babel plugin just for this would:\n a) unnecesairly slow down compilation for all other files (if we just apply it everywhere)\n b) or complicate babel-loader configuration with overwrite specifically for this file\n*/\n\nconst { createContext } = require(`react`)\n\nmodule.exports = createContext\nmodule.exports.default = createContext\n","module.exports = require(\"regenerator-runtime\");\n","\"use strict\"; // ref: https://github.com/tc39/proposal-global\n\nvar getGlobal = function getGlobal() {\n // the only reliable means to get the global object is\n // `Function('return this')()`\n // However, this causes CSP violations in Chrome apps.\n if (typeof self !== 'undefined') {\n return self;\n }\n\n if (typeof window !== 'undefined') {\n return window;\n }\n\n if (typeof global !== 'undefined') {\n return global;\n }\n\n throw new Error('unable to locate global object');\n};\n\nvar global = getGlobal();\nmodule.exports = exports = global.fetch; // Needed for TypeScript and Webpack.\n\nif (global.fetch) {\n exports.default = global.fetch.bind(global);\n}\n\nexports.Headers = global.Headers;\nexports.Request = global.Request;\nexports.Response = global.Response;","\"use strict\";\n\nrequire(\"core-js/modules/es.array.reduce.js\");\n\nrequire(\"core-js/modules/es.array.reduce-right.js\");\n\nvar __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, {\n enumerable: true,\n get: function get() {\n return m[k];\n }\n });\n} : function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nvar __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {\n Object.defineProperty(o, \"default\", {\n enumerable: true,\n value: v\n });\n} : function (o, v) {\n o[\"default\"] = v;\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) {\n if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n }\n\n __setModuleDefault(result, mod);\n\n return result;\n};\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\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;\n\nvar function_1 = require(\"./function\");\n\nvar O = __importStar(require(\"./Option\"));\n\nvar Ord_1 = require(\"./Ord\"); // -------------------------------------------------------------------------------------\n// model\n// -------------------------------------------------------------------------------------\n\n/**\n * @category constructors\n * @since 2.5.0\n */\n// tslint:disable-next-line: readonly-array\n\n\nfunction fromArray(as) {\n var l = as.length;\n\n if (l === 0) {\n return exports.empty;\n }\n\n var ras = Array(l);\n\n for (var i = 0; i < l; i++) {\n ras[i] = as[i];\n }\n\n return ras;\n}\n\nexports.fromArray = fromArray;\n/**\n * @category destructors\n * @since 2.5.0\n */\n// tslint:disable-next-line: readonly-array\n\nfunction toArray(ras) {\n var l = ras.length;\n var as = Array(l);\n\n for (var i = 0; i < l; i++) {\n as[i] = ras[i];\n }\n\n return as;\n}\n\nexports.toArray = toArray;\n/**\n * @category instances\n * @since 2.5.0\n */\n\nfunction getShow(S) {\n return {\n show: function show(as) {\n return \"[\" + as.map(S.show).join(', ') + \"]\";\n }\n };\n}\n\nexports.getShow = getShow;\n\nvar concat = function concat(x, y) {\n var lenx = x.length;\n\n if (lenx === 0) {\n return y;\n }\n\n var leny = y.length;\n\n if (leny === 0) {\n return x;\n }\n\n var r = Array(lenx + leny);\n\n for (var i = 0; i < lenx; i++) {\n r[i] = x[i];\n }\n\n for (var i = 0; i < leny; i++) {\n r[i + lenx] = y[i];\n }\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 */\n\n\nfunction getMonoid() {\n return {\n concat: concat,\n empty: exports.empty\n };\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 */\n\nfunction getEq(E) {\n return {\n equals: function equals(xs, ys) {\n return xs === ys || xs.length === ys.length && xs.every(function (x, i) {\n return E.equals(x, ys[i]);\n });\n }\n };\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 */\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\n for (var i = 0; i < len; i++) {\n var ordering = O.compare(a[i], b[i]);\n\n if (ordering !== 0) {\n return ordering;\n }\n }\n\n return Ord_1.ordNumber.compare(aLen, bLen);\n });\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 */\n\nfunction makeBy(n, f) {\n // tslint:disable-next-line: readonly-array\n var r = [];\n\n for (var i = 0; i < n; i++) {\n r.push(f(i));\n }\n\n return r;\n}\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 */\n\nfunction range(start, end) {\n return makeBy(end - start + 1, function (i) {\n return start + i;\n });\n}\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 */\n\nfunction replicate(n, a) {\n return makeBy(n, function () {\n return a;\n });\n}\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 */\n\nfunction flatten(mma) {\n var rLen = 0;\n var len = mma.length;\n\n for (var i = 0; i < len; i++) {\n rLen += mma[i].length;\n }\n\n var r = Array(rLen);\n var start = 0;\n\n for (var i = 0; i < len; i++) {\n var arr = mma[i];\n var l = arr.length;\n\n for (var j = 0; j < l; j++) {\n r[j + start] = arr[j];\n }\n\n start += l;\n }\n\n return r;\n}\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 */\n\nfunction foldLeft(onEmpty, onCons) {\n return function (as) {\n return isEmpty(as) ? onEmpty() : onCons(as[0], as.slice(1));\n };\n}\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 */\n\nfunction foldRight(onEmpty, onCons) {\n return function (as) {\n return isEmpty(as) ? onEmpty() : onCons(as.slice(0, as.length - 1), as[as.length - 1]);\n };\n}\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 */\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\n for (var i = 0; i < l; i++) {\n r[i + 1] = f(r[i], as[i]);\n }\n\n return r;\n };\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 */\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\n for (var i = l - 1; i >= 0; i--) {\n r[i] = f(as[i], r[i + 1]);\n }\n\n return r;\n };\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 */\n\nfunction isEmpty(as) {\n return as.length === 0;\n}\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 */\n\nfunction isNonEmpty(as) {\n return as.length > 0;\n}\n\nexports.isNonEmpty = isNonEmpty;\n/**\n * Test whether an array contains a particular index\n *\n * @since 2.5.0\n */\n\nfunction isOutOfBound(i, as) {\n return i < 0 || i >= as.length;\n}\n\nexports.isOutOfBound = isOutOfBound;\n\nfunction lookup(i, as) {\n return as === undefined ? function (as) {\n return lookup(i, as);\n } : isOutOfBound(i, as) ? O.none : O.some(as[i]);\n}\n\nexports.lookup = lookup;\n\nfunction cons(head, tail) {\n if (tail === undefined) {\n return function (tail) {\n return cons(head, tail);\n };\n }\n\n var len = tail.length;\n var r = Array(len + 1);\n\n for (var i = 0; i < len; i++) {\n r[i + 1] = tail[i];\n }\n\n r[0] = head;\n return r;\n}\n\nexports.cons = cons; // TODO: curry and make data-last in v3\n\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 */\n\nfunction snoc(init, end) {\n var len = init.length;\n var r = Array(len + 1);\n\n for (var i = 0; i < len; i++) {\n r[i] = init[i];\n }\n\n r[len] = end;\n return r;\n}\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 */\n\nfunction head(as) {\n return isEmpty(as) ? O.none : O.some(as[0]);\n}\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 */\n\nfunction last(as) {\n return lookup(as.length - 1, as);\n}\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 */\n\nfunction tail(as) {\n return isEmpty(as) ? O.none : O.some(as.slice(1));\n}\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 */\n\nfunction init(as) {\n var len = as.length;\n return len === 0 ? O.none : O.some(as.slice(0, len - 1));\n}\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 */\n\nfunction takeLeft(n) {\n return function (as) {\n return as.slice(0, n);\n };\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 */\n\nfunction takeRight(n) {\n return function (as) {\n return n === 0 ? exports.empty : as.slice(-n);\n };\n}\n\nexports.takeRight = takeRight;\n\nfunction takeLeftWhile(predicate) {\n return function (as) {\n var i = spanIndexUncurry(as, predicate);\n var init = Array(i);\n\n for (var j = 0; j < i; j++) {\n init[j] = as[j];\n }\n\n return init;\n };\n}\n\nexports.takeLeftWhile = takeLeftWhile;\n\nvar spanIndexUncurry = function spanIndexUncurry(as, predicate) {\n var l = as.length;\n var i = 0;\n\n for (; i < l; i++) {\n if (!predicate(as[i])) {\n break;\n }\n }\n\n return i;\n};\n\nfunction spanLeft(predicate) {\n return function (as) {\n var i = spanIndexUncurry(as, predicate);\n var init = Array(i);\n\n for (var j = 0; j < i; j++) {\n init[j] = as[j];\n }\n\n var l = as.length;\n var rest = Array(l - i);\n\n for (var j = i; j < l; j++) {\n rest[j - i] = as[j];\n }\n\n return {\n init: init,\n rest: rest\n };\n };\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 */\n\nfunction dropLeft(n) {\n return function (as) {\n return as.slice(n, as.length);\n };\n}\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 */\n\nfunction dropRight(n) {\n return function (as) {\n return as.slice(0, as.length - n);\n };\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 */\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\n for (var j = i; j < l; j++) {\n rest[j - i] = as[j];\n }\n\n return rest;\n };\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 */\n\nfunction findIndex(predicate) {\n return function (as) {\n var len = as.length;\n\n for (var i = 0; i < len; i++) {\n if (predicate(as[i])) {\n return O.some(i);\n }\n }\n\n return O.none;\n };\n}\n\nexports.findIndex = findIndex;\n\nfunction findFirst(predicate) {\n return function (as) {\n var len = as.length;\n\n for (var i = 0; i < len; i++) {\n if (predicate(as[i])) {\n return O.some(as[i]);\n }\n }\n\n return O.none;\n };\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 */\n\nfunction findFirstMap(f) {\n return function (as) {\n var len = as.length;\n\n for (var i = 0; i < len; i++) {\n var v = f(as[i]);\n\n if (O.isSome(v)) {\n return v;\n }\n }\n\n return O.none;\n };\n}\n\nexports.findFirstMap = findFirstMap;\n\nfunction findLast(predicate) {\n return function (as) {\n var len = as.length;\n\n for (var i = len - 1; i >= 0; i--) {\n if (predicate(as[i])) {\n return O.some(as[i]);\n }\n }\n\n return O.none;\n };\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 */\n\nfunction findLastMap(f) {\n return function (as) {\n var len = as.length;\n\n for (var i = len - 1; i >= 0; i--) {\n var v = f(as[i]);\n\n if (O.isSome(v)) {\n return v;\n }\n }\n\n return O.none;\n };\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 */\n\nfunction findLastIndex(predicate) {\n return function (as) {\n var len = as.length;\n\n for (var i = len - 1; i >= 0; i--) {\n if (predicate(as[i])) {\n return O.some(i);\n }\n }\n\n return O.none;\n };\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 */\n\nfunction insertAt(i, a) {\n return function (as) {\n return i < 0 || i > as.length ? O.none : O.some(unsafeInsertAt(i, a, as));\n };\n}\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 */\n\nfunction updateAt(i, a) {\n return function (as) {\n return isOutOfBound(i, as) ? O.none : O.some(unsafeUpdateAt(i, a, as));\n };\n}\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 */\n\nfunction deleteAt(i) {\n return function (as) {\n return isOutOfBound(i, as) ? O.none : O.some(unsafeDeleteAt(i, as));\n };\n}\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 */\n\nfunction modifyAt(i, f) {\n return function (as) {\n return isOutOfBound(i, as) ? O.none : O.some(unsafeUpdateAt(i, f(as[i]), as));\n };\n}\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 */\n\nfunction reverse(as) {\n if (isEmpty(as)) {\n return as;\n }\n\n return as.slice().reverse();\n}\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 */\n\nfunction rights(as) {\n // tslint:disable-next-line: readonly-array\n var r = [];\n var len = as.length;\n\n for (var i = 0; i < len; i++) {\n var a = as[i];\n\n if (a._tag === 'Right') {\n r.push(a.right);\n }\n }\n\n return r;\n}\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 */\n\nfunction lefts(as) {\n // tslint:disable-next-line: readonly-array\n var r = [];\n var len = as.length;\n\n for (var i = 0; i < len; i++) {\n var a = as[i];\n\n if (a._tag === 'Left') {\n r.push(a.left);\n }\n }\n\n return r;\n}\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 */\n\nvar sort = function sort(O) {\n return function (as) {\n return as.length <= 1 ? as : as.slice().sort(O.compare);\n };\n};\n\nexports.sort = sort; // TODO: curry and make data-last in v3\n\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 */\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\n for (var i = 0; i < len; i++) {\n fc[i] = f(fa[i], fb[i]);\n }\n\n return fc;\n}\n\nexports.zipWith = zipWith;\n\nfunction zip(as, bs) {\n if (bs === undefined) {\n return function (bs) {\n return zip(bs, as);\n };\n }\n\n return zipWith(as, bs, function (a, b) {\n return [a, b];\n });\n}\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 */\n\nfunction unzip(as) {\n // tslint:disable-next-line: readonly-array\n var fa = []; // tslint:disable-next-line: readonly-array\n\n var fb = [];\n\n for (var i = 0; i < as.length; i++) {\n fa[i] = as[i][0];\n fb[i] = as[i][1];\n }\n\n return [fa, fb];\n}\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 */\n\nvar prependToAll = function prependToAll(e) {\n return function (xs) {\n // tslint:disable-next-line: readonly-array\n var ys = [];\n\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\n return ys;\n };\n};\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 */\n\nfunction intersperse(e) {\n return function (as) {\n var length = as.length;\n\n if (length === 0) {\n return as;\n }\n\n return cons(as[0], exports.prependToAll(e)(as.slice(1, as.length)));\n };\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 */\n\nfunction rotate(n) {\n return function (as) {\n var len = as.length;\n\n if (n === 0 || len <= 1 || len === Math.abs(n)) {\n return as;\n } else if (n < 0) {\n return rotate(len + n)(as);\n } else {\n return as.slice(-n).concat(as.slice(0, len - n));\n }\n };\n}\n\nexports.rotate = rotate;\n\nfunction elem(E) {\n return function (a, as) {\n if (as === undefined) {\n var elemE_1 = elem(E);\n return function (as) {\n return elemE_1(a, as);\n };\n }\n\n var predicate = function predicate(element) {\n return E.equals(element, a);\n };\n\n var i = 0;\n var len = as.length;\n\n for (; i < len; i++) {\n if (predicate(as[i])) {\n return true;\n }\n }\n\n return false;\n };\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 */\n\nfunction uniq(E) {\n var elemS = elem(E);\n return function (as) {\n var len = as.length;\n\n if (len <= 1) {\n return as;\n } // tslint:disable-next-line: readonly-array\n\n\n var r = [];\n var i = 0;\n\n for (; i < len; i++) {\n var a = as[i];\n\n if (!elemS(a, r)) {\n r.push(a);\n }\n }\n\n return len === r.length ? as : r;\n };\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 */\n\nfunction sortBy(ords) {\n var M = Ord_1.getMonoid();\n return exports.sort(ords.reduce(M.concat, M.empty));\n}\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 */\n\nvar chop = function chop(f) {\n return function (as) {\n // tslint:disable-next-line: readonly-array\n var result = [];\n var cs = as;\n\n while (isNonEmpty(cs)) {\n var _a = f(cs),\n b = _a[0],\n c = _a[1];\n\n result.push(b);\n cs = c;\n }\n\n return result;\n };\n};\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 */\n\nfunction splitAt(n) {\n return function (as) {\n return [as.slice(0, n), as.slice(n)];\n };\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 */\n\nfunction chunksOf(n) {\n var f = exports.chop(splitAt(n));\n return function (as) {\n return as.length === 0 ? exports.empty : isOutOfBound(n - 1, as) ? [as] : f(as);\n };\n}\n\nexports.chunksOf = chunksOf;\n\nfunction comprehension(input, f, g) {\n if (g === void 0) {\n g = function g() {\n return true;\n };\n }\n\n var go = function go(scope, input) {\n if (input.length === 0) {\n return g.apply(void 0, scope) ? [f.apply(void 0, scope)] : exports.empty;\n } else {\n return chain_(input[0], function (x) {\n return go(snoc(scope, x), input.slice(1));\n });\n }\n };\n\n return go(exports.empty, input);\n}\n\nexports.comprehension = comprehension;\n\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) {\n return unionE_1(ys, xs);\n };\n }\n\n return concat(xs, ys.filter(function (a) {\n return !elemE(a, xs);\n }));\n };\n}\n\nexports.union = union;\n\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) {\n return intersectionE_1(ys, xs);\n };\n }\n\n return xs.filter(function (a) {\n return elemE(a, ys);\n });\n };\n}\n\nexports.intersection = intersection;\n\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) {\n return differenceE_1(ys, xs);\n };\n }\n\n return xs.filter(function (a) {\n return !elemE(a, ys);\n });\n };\n}\n\nexports.difference = difference;\n/**\n * Wrap a value into the type constructor.\n *\n * @category Applicative\n * @since 2.5.0\n */\n\nvar of = function of(a) {\n return [a];\n};\n\nexports.of = of;\n/**\n * @category Alternative\n * @since 2.7.0\n */\n\nvar zero = function zero() {\n return exports.empty;\n};\n\nexports.zero = zero; // -------------------------------------------------------------------------------------\n// non-pipeables\n// -------------------------------------------------------------------------------------\n\nvar map_ = function map_(fa, f) {\n return function_1.pipe(fa, exports.map(f));\n};\n\nvar mapWithIndex_ = function mapWithIndex_(fa, f) {\n return function_1.pipe(fa, exports.mapWithIndex(f));\n};\n\nvar ap_ = function ap_(fab, fa) {\n return function_1.pipe(fab, exports.ap(fa));\n};\n\nvar chain_ = function chain_(ma, f) {\n return function_1.pipe(ma, exports.chain(f));\n};\n\nvar filter_ = function filter_(fa, predicate) {\n return function_1.pipe(fa, exports.filter(predicate));\n};\n\nvar filterMap_ = function filterMap_(fa, f) {\n return function_1.pipe(fa, exports.filterMap(f));\n};\n\nvar partitionWithIndex_ = function partitionWithIndex_(fa, predicateWithIndex) {\n return function_1.pipe(fa, exports.partitionWithIndex(predicateWithIndex));\n};\n\nvar partition_ = function partition_(fa, predicate) {\n return function_1.pipe(fa, exports.partition(predicate));\n};\n\nvar partitionMap_ = function partitionMap_(fa, f) {\n return function_1.pipe(fa, exports.partitionMap(f));\n};\n\nvar partitionMapWithIndex_ = function partitionMapWithIndex_(fa, f) {\n return function_1.pipe(fa, exports.partitionMapWithIndex(f));\n};\n\nvar alt_ = function alt_(fa, that) {\n return function_1.pipe(fa, exports.alt(that));\n};\n\nvar reduce_ = function reduce_(fa, b, f) {\n return function_1.pipe(fa, exports.reduce(b, f));\n};\n\nvar foldMap_ = function foldMap_(M) {\n var foldMapM = exports.foldMap(M);\n return function (fa, f) {\n return function_1.pipe(fa, foldMapM(f));\n };\n};\n\nvar reduceRight_ = function reduceRight_(fa, b, f) {\n return function_1.pipe(fa, exports.reduceRight(b, f));\n};\n\nvar reduceWithIndex_ = function reduceWithIndex_(fa, b, f) {\n var l = fa.length;\n var r = b;\n\n for (var i = 0; i < l; i++) {\n r = f(i, r, fa[i]);\n }\n\n return r;\n};\n\nvar foldMapWithIndex_ = function foldMapWithIndex_(M) {\n return function (fa, f) {\n return fa.reduce(function (b, a, i) {\n return M.concat(b, f(i, a));\n }, M.empty);\n };\n};\n\nvar reduceRightWithIndex_ = function reduceRightWithIndex_(fa, b, f) {\n return function_1.pipe(fa, exports.reduceRightWithIndex(b, f));\n};\n\nvar filterMapWithIndex_ = function filterMapWithIndex_(fa, f) {\n return function_1.pipe(fa, exports.filterMapWithIndex(f));\n};\n\nvar filterWithIndex_ = function filterWithIndex_(fa, predicateWithIndex) {\n return function_1.pipe(fa, exports.filterWithIndex(predicateWithIndex));\n};\n\nvar extend_ = function extend_(fa, f) {\n return function_1.pipe(fa, exports.extend(f));\n};\n\nvar traverse_ = function traverse_(F) {\n var traverseF = exports.traverse(F);\n return function (ta, f) {\n return function_1.pipe(ta, traverseF(f));\n };\n};\n/* istanbul ignore next */\n\n\nvar traverseWithIndex_ = function traverseWithIndex_(F) {\n var traverseWithIndexF = exports.traverseWithIndex(F);\n return function (ta, f) {\n return function_1.pipe(ta, traverseWithIndexF(f));\n };\n};\n/* istanbul ignore next */\n\n\nvar wither_ = function wither_(F) {\n var witherF = exports.wither(F);\n return function (fa, f) {\n return function_1.pipe(fa, witherF(f));\n };\n};\n/* istanbul ignore next */\n\n\nvar wilt_ = function wilt_(F) {\n var wiltF = exports.wilt(F);\n return function (fa, f) {\n return function_1.pipe(fa, wiltF(f));\n };\n}; // -------------------------------------------------------------------------------------\n// pipeables\n// -------------------------------------------------------------------------------------\n\n/**\n * Less strict version of [`alt`](#alt).\n *\n * @category Alt\n * @since 2.9.0\n */\n\n\nvar altW = function altW(that) {\n return function (fa) {\n return concat(fa, that());\n };\n};\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 */\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 */\n\nvar ap = function ap(fa) {\n return exports.chain(function (f) {\n return function_1.pipe(fa, exports.map(f));\n });\n};\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 */\n\nvar apFirst = function apFirst(fb) {\n return function_1.flow(exports.map(function (a) {\n return function () {\n return a;\n };\n }), exports.ap(fb));\n};\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 */\n\nvar apSecond = function apSecond(fb) {\n return function_1.flow(exports.map(function () {\n return function (b) {\n return b;\n };\n }), exports.ap(fb));\n};\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 */\n\nvar chain = function chain(f) {\n return function (ma) {\n return function_1.pipe(ma, exports.chainWithIndex(function (_, a) {\n return f(a);\n }));\n };\n};\n\nexports.chain = chain;\n/**\n * @since 2.7.0\n */\n\nvar chainWithIndex = function chainWithIndex(f) {\n return function (ma) {\n var outLen = 0;\n var l = ma.length;\n var temp = new Array(l);\n\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\n var out = Array(outLen);\n var start = 0;\n\n for (var i = 0; i < l; i++) {\n var arr = temp[i];\n var l_1 = arr.length;\n\n for (var j = 0; j < l_1; j++) {\n out[j + start] = arr[j];\n }\n\n start += l_1;\n }\n\n return out;\n };\n};\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 */\n\nvar chainFirst = function chainFirst(f) {\n return exports.chain(function (a) {\n return function_1.pipe(f(a), exports.map(function () {\n return a;\n }));\n });\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 */\n\nvar map = function map(f) {\n return function (fa) {\n return fa.map(function (a) {\n return f(a);\n });\n };\n};\n\nexports.map = map;\n/**\n * @category FunctorWithIndex\n * @since 2.5.0\n */\n\nvar mapWithIndex = function mapWithIndex(f) {\n return function (fa) {\n return fa.map(function (a, i) {\n return f(i, a);\n });\n };\n};\n\nexports.mapWithIndex = mapWithIndex;\n/**\n * @category Compactable\n * @since 2.5.0\n */\n\nvar separate = function separate(fa) {\n // tslint:disable-next-line: readonly-array\n var left = []; // tslint:disable-next-line: readonly-array\n\n var right = [];\n\n for (var _i = 0, fa_1 = fa; _i < fa_1.length; _i++) {\n var e = fa_1[_i];\n\n if (e._tag === 'Left') {\n left.push(e.left);\n } else {\n right.push(e.right);\n }\n }\n\n return {\n left: left,\n right: right\n };\n};\n\nexports.separate = separate;\n/**\n * @category Filterable\n * @since 2.5.0\n */\n\nvar filter = function filter(predicate) {\n return function (fa) {\n return fa.filter(predicate);\n };\n};\n\nexports.filter = filter;\n/**\n * @category FilterableWithIndex\n * @since 2.5.0\n */\n\nvar filterMapWithIndex = function filterMapWithIndex(f) {\n return function (fa) {\n // tslint:disable-next-line: readonly-array\n var result = [];\n\n for (var i = 0; i < fa.length; i++) {\n var optionB = f(i, fa[i]);\n\n if (O.isSome(optionB)) {\n result.push(optionB.value);\n }\n }\n\n return result;\n };\n};\n\nexports.filterMapWithIndex = filterMapWithIndex;\n/**\n * @category Filterable\n * @since 2.5.0\n */\n\nvar filterMap = function filterMap(f) {\n return exports.filterMapWithIndex(function (_, a) {\n return f(a);\n });\n};\n\nexports.filterMap = filterMap;\n/**\n * @category Compactable\n * @since 2.5.0\n */\n\nexports.compact = /*#__PURE__*/exports.filterMap(function_1.identity);\n/**\n * @category Filterable\n * @since 2.5.0\n */\n\nvar partition = function partition(predicate) {\n return exports.partitionWithIndex(function (_, a) {\n return predicate(a);\n });\n};\n\nexports.partition = partition;\n/**\n * @category FilterableWithIndex\n * @since 2.5.0\n */\n\nvar partitionWithIndex = function partitionWithIndex(predicateWithIndex) {\n return function (fa) {\n // tslint:disable-next-line: readonly-array\n var left = []; // tslint:disable-next-line: readonly-array\n\n var right = [];\n\n for (var i = 0; i < fa.length; i++) {\n var a = fa[i];\n\n if (predicateWithIndex(i, a)) {\n right.push(a);\n } else {\n left.push(a);\n }\n }\n\n return {\n left: left,\n right: right\n };\n };\n};\n\nexports.partitionWithIndex = partitionWithIndex;\n/**\n * @category Filterable\n * @since 2.5.0\n */\n\nvar partitionMap = function partitionMap(f) {\n return exports.partitionMapWithIndex(function (_, a) {\n return f(a);\n });\n};\n\nexports.partitionMap = partitionMap;\n/**\n * @category FilterableWithIndex\n * @since 2.5.0\n */\n\nvar partitionMapWithIndex = function partitionMapWithIndex(f) {\n return function (fa) {\n // tslint:disable-next-line: readonly-array\n var left = []; // tslint:disable-next-line: readonly-array\n\n var right = [];\n\n for (var i = 0; i < fa.length; i++) {\n var e = f(i, fa[i]);\n\n if (e._tag === 'Left') {\n left.push(e.left);\n } else {\n right.push(e.right);\n }\n }\n\n return {\n left: left,\n right: right\n };\n };\n};\n\nexports.partitionMapWithIndex = partitionMapWithIndex;\n/**\n * @category FilterableWithIndex\n * @since 2.5.0\n */\n\nvar filterWithIndex = function filterWithIndex(predicateWithIndex) {\n return function (fa) {\n return fa.filter(function (a, i) {\n return predicateWithIndex(i, a);\n });\n };\n};\n\nexports.filterWithIndex = filterWithIndex;\n/**\n * @category Extend\n * @since 2.5.0\n */\n\nvar extend = function extend(f) {\n return function (wa) {\n return wa.map(function (_, i, as) {\n return f(as.slice(i));\n });\n };\n};\n\nexports.extend = extend;\n/**\n * Derivable from `Extend`.\n *\n * @category combinators\n * @since 2.5.0\n */\n\nexports.duplicate = /*#__PURE__*/exports.extend(function_1.identity);\n/**\n * @category FoldableWithIndex\n * @since 2.5.0\n */\n\nvar foldMapWithIndex = function foldMapWithIndex(M) {\n var foldMapWithIndexM = foldMapWithIndex_(M);\n return function (f) {\n return function (fa) {\n return foldMapWithIndexM(fa, f);\n };\n };\n};\n\nexports.foldMapWithIndex = foldMapWithIndex;\n/**\n * @category Foldable\n * @since 2.5.0\n */\n\nvar reduce = function reduce(b, f) {\n return exports.reduceWithIndex(b, function (_, b, a) {\n return f(b, a);\n });\n};\n\nexports.reduce = reduce;\n/**\n * @category Foldable\n * @since 2.5.0\n */\n\nvar foldMap = function foldMap(M) {\n var foldMapWithIndexM = exports.foldMapWithIndex(M);\n return function (f) {\n return foldMapWithIndexM(function (_, a) {\n return f(a);\n });\n };\n};\n\nexports.foldMap = foldMap;\n/**\n * @category FoldableWithIndex\n * @since 2.5.0\n */\n\nvar reduceWithIndex = function reduceWithIndex(b, f) {\n return function (fa) {\n return reduceWithIndex_(fa, b, f);\n };\n};\n\nexports.reduceWithIndex = reduceWithIndex;\n/**\n * @category Foldable\n * @since 2.5.0\n */\n\nvar reduceRight = function reduceRight(b, f) {\n return exports.reduceRightWithIndex(b, function (_, a, b) {\n return f(a, b);\n });\n};\n\nexports.reduceRight = reduceRight;\n/**\n * @category FoldableWithIndex\n * @since 2.5.0\n */\n\nvar reduceRightWithIndex = function reduceRightWithIndex(b, f) {\n return function (fa) {\n return fa.reduceRight(function (b, a, i) {\n return f(i, a, b);\n }, b);\n };\n};\n\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 */\n\nvar traverse = function traverse(F) {\n var traverseWithIndexF = exports.traverseWithIndex(F);\n return function (f) {\n return traverseWithIndexF(function (_, a) {\n return f(a);\n });\n };\n};\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 */\n\nvar sequence = function sequence(F) {\n return function (ta) {\n return reduce_(ta, F.of(exports.zero()), function (fas, fa) {\n return F.ap(F.map(fas, function (as) {\n return function (a) {\n return snoc(as, a);\n };\n }), fa);\n });\n };\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 */\n\nvar traverseWithIndex = function traverseWithIndex(F) {\n return function (f) {\n return exports.reduceWithIndex(F.of(exports.zero()), function (i, fbs, a) {\n return F.ap(F.map(fbs, function (bs) {\n return function (b) {\n return snoc(bs, b);\n };\n }), f(i, a));\n });\n };\n};\n\nexports.traverseWithIndex = traverseWithIndex;\n/**\n * @category Witherable\n * @since 2.6.5\n */\n\nvar wither = function wither(F) {\n var traverseF = exports.traverse(F);\n return function (f) {\n return function (fa) {\n return F.map(function_1.pipe(fa, traverseF(f)), exports.compact);\n };\n };\n};\n\nexports.wither = wither;\n/**\n * @category Witherable\n * @since 2.6.5\n */\n\nvar wilt = function wilt(F) {\n var traverseF = exports.traverse(F);\n return function (f) {\n return function (fa) {\n return F.map(function_1.pipe(fa, traverseF(f)), exports.separate);\n };\n };\n};\n\nexports.wilt = wilt;\n/**\n * @category Unfoldable\n * @since 2.6.6\n */\n\nvar unfold = function unfold(b, f) {\n // tslint:disable-next-line: readonly-array\n var ret = [];\n var bb = b;\n\n while (true) {\n var mt = f(bb);\n\n if (O.isSome(mt)) {\n var _a = mt.value,\n a = _a[0],\n b_1 = _a[1];\n ret.push(a);\n bb = b_1;\n } else {\n break;\n }\n }\n\n return ret;\n};\n\nexports.unfold = unfold; // -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n\n/**\n * @category instances\n * @since 2.5.0\n */\n\nexports.URI = 'ReadonlyArray';\n/**\n * @category instances\n * @since 2.7.0\n */\n\nexports.Functor = {\n URI: exports.URI,\n map: map_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\n\nexports.FunctorWithIndex = {\n URI: exports.URI,\n map: map_,\n mapWithIndex: mapWithIndex_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\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 */\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 */\n\nexports.Unfoldable = {\n URI: exports.URI,\n unfold: exports.unfold\n};\n/**\n * @category instances\n * @since 2.7.0\n */\n\nexports.Alt = {\n URI: exports.URI,\n map: map_,\n alt: alt_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\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 */\n\nexports.Extend = {\n URI: exports.URI,\n map: map_,\n extend: extend_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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}; // TODO: remove in v3\n\n/**\n * @category instances\n * @since 2.5.0\n */\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// unsafe\n// -------------------------------------------------------------------------------------\n\n/**\n * @category unsafe\n * @since 2.5.0\n */\n\nfunction unsafeInsertAt(i, a, as) {\n var xs = as.slice();\n xs.splice(i, 0, a);\n return xs;\n}\n\nexports.unsafeInsertAt = unsafeInsertAt;\n/**\n * @category unsafe\n * @since 2.5.0\n */\n\nfunction unsafeUpdateAt(i, a, as) {\n if (as[i] === a) {\n return as;\n } else {\n var xs = as.slice();\n xs[i] = a;\n return xs;\n }\n}\n\nexports.unsafeUpdateAt = unsafeUpdateAt;\n/**\n * @category unsafe\n * @since 2.5.0\n */\n\nfunction unsafeDeleteAt(i, as) {\n var xs = as.slice();\n xs.splice(i, 1);\n return xs;\n}\n\nexports.unsafeDeleteAt = unsafeDeleteAt; // -------------------------------------------------------------------------------------\n// utils\n// -------------------------------------------------------------------------------------\n\n/**\n * An empty array\n *\n * @since 2.5.0\n */\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 */\n\nvar every = function every(predicate) {\n return function (as) {\n return as.every(predicate);\n };\n};\n\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 */\n\nvar some = function some(predicate) {\n return function (as) {\n return as.some(predicate);\n };\n};\n\nexports.some = some; // -------------------------------------------------------------------------------------\n// do notation\n// -------------------------------------------------------------------------------------\n\n/**\n * @since 2.9.0\n */\n\nexports.Do = /*#__PURE__*/exports.of({});\n/**\n * @since 2.8.0\n */\n\nvar bindTo = function bindTo(name) {\n return exports.map(function_1.bindTo_(name));\n};\n\nexports.bindTo = bindTo;\n/**\n * @since 2.8.0\n */\n\nvar bind = function bind(name, f) {\n return exports.chain(function (a) {\n return function_1.pipe(f(a), exports.map(function (b) {\n return function_1.bind_(a, name, b);\n }));\n });\n};\n\nexports.bind = bind; // -------------------------------------------------------------------------------------\n// pipeable sequence S\n// -------------------------------------------------------------------------------------\n\n/**\n * @since 2.8.0\n */\n\nvar apS = function apS(name, fb) {\n return function_1.flow(exports.map(function (a) {\n return function (b) {\n return function_1.bind_(a, name, b);\n };\n }), exports.ap(fb));\n};\n\nexports.apS = apS;","\"use strict\";\n\nrequire(\"core-js/modules/es.array.reduce.js\");\n\nrequire(\"core-js/modules/es.array.reduce-right.js\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\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;\n\nvar Eq_1 = require(\"./Eq\");\n\nvar function_1 = require(\"./function\");\n\nvar Option_1 = require(\"./Option\");\n/**\n * @category constructors\n * @since 2.5.0\n */\n\n\nfunction fromRecord(r) {\n return Object.assign({}, r);\n}\n\nexports.fromRecord = fromRecord;\n/**\n * @category destructors\n * @since 2.5.0\n */\n\nfunction toRecord(r) {\n return Object.assign({}, r);\n}\n\nexports.toRecord = toRecord;\n/**\n * @category instances\n * @since 2.5.0\n */\n\nfunction getShow(S) {\n return {\n show: function show(r) {\n var elements = collect(function (k, a) {\n return JSON.stringify(k) + \": \" + S.show(a);\n })(r).join(', ');\n return elements === '' ? '{}' : \"{ \" + elements + \" }\";\n }\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 */\n\nfunction size(r) {\n return Object.keys(r).length;\n}\n\nexports.size = size;\n/**\n * Test whether a record is empty\n *\n * @since 2.5.0\n */\n\nfunction isEmpty(r) {\n return Object.keys(r).length === 0;\n}\n\nexports.isEmpty = isEmpty;\n/**\n * @since 2.5.0\n */\n\nfunction keys(r) {\n return Object.keys(r).sort();\n}\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 */\n\nfunction collect(f) {\n return function (r) {\n // tslint:disable-next-line: readonly-array\n var out = [];\n\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\n return out;\n };\n}\n\nexports.collect = collect;\n/**\n * @category destructors\n * @since 2.5.0\n */\n\nexports.toReadonlyArray = /*#__PURE__*/collect(function (k, a) {\n return [k, a];\n});\n\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) {\n return b < len ? Option_1.some([arr[b], b + 1]) : Option_1.none;\n });\n };\n}\n\nexports.toUnfoldable = toUnfoldable;\n\nfunction insertAt(k, a) {\n return function (r) {\n if (r[k] === a) {\n return r;\n }\n\n var out = Object.assign({}, r);\n out[k] = a;\n return out;\n };\n}\n\nexports.insertAt = insertAt;\nvar _hasOwnProperty = Object.prototype.hasOwnProperty;\n\nfunction hasOwnProperty(k, r) {\n return _hasOwnProperty.call(r === undefined ? this : r, k);\n}\n\nexports.hasOwnProperty = hasOwnProperty;\n\nfunction deleteAt(k) {\n return function (r) {\n if (!_hasOwnProperty.call(r, k)) {\n return r;\n }\n\n var out = Object.assign({}, r);\n delete out[k];\n return out;\n };\n}\n\nexports.deleteAt = deleteAt;\n/**\n * @since 2.5.0\n */\n\nfunction updateAt(k, a) {\n return function (r) {\n if (!hasOwnProperty(k, r)) {\n return Option_1.none;\n }\n\n if (r[k] === a) {\n return Option_1.some(r);\n }\n\n var out = Object.assign({}, r);\n out[k] = a;\n return Option_1.some(out);\n };\n}\n\nexports.updateAt = updateAt;\n/**\n * @since 2.5.0\n */\n\nfunction modifyAt(k, f) {\n return function (r) {\n if (!hasOwnProperty(k, r)) {\n return Option_1.none;\n }\n\n var out = Object.assign({}, r);\n out[k] = f(r[k]);\n return Option_1.some(out);\n };\n}\n\nexports.modifyAt = modifyAt;\n\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}\n\nexports.pop = pop;\n\nfunction isSubrecord(E) {\n return function (me, that) {\n if (that === undefined) {\n var isSubrecordE_1 = isSubrecord(E);\n return function (that) {\n return isSubrecordE_1(that, me);\n };\n }\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\n return true;\n };\n}\n\nexports.isSubrecord = isSubrecord;\n\nfunction getEq(E) {\n var isSubrecordE = isSubrecord(E);\n return Eq_1.fromEquals(function (x, y) {\n return isSubrecordE(x)(y) && isSubrecordE(y)(x);\n });\n}\n\nexports.getEq = getEq;\n\nfunction getMonoid(S) {\n return {\n concat: function concat(x, y) {\n if (x === exports.empty) {\n return y;\n }\n\n if (y === exports.empty) {\n return x;\n }\n\n var keys = Object.keys(y);\n var len = keys.length;\n\n if (len === 0) {\n return x;\n }\n\n var r = Object.assign({}, x);\n\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\n return r;\n },\n empty: exports.empty\n };\n}\n\nexports.getMonoid = getMonoid;\n\nfunction lookup(k, r) {\n if (r === undefined) {\n return function (r) {\n return lookup(k, r);\n };\n }\n\n return _hasOwnProperty.call(r, k) ? Option_1.some(r[k]) : Option_1.none;\n}\n\nexports.lookup = lookup;\n/**\n * @since 2.5.0\n */\n\nexports.empty = {};\n\nfunction mapWithIndex(f) {\n return function (fa) {\n var out = {};\n var keys = Object.keys(fa);\n\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\n return out;\n };\n}\n\nexports.mapWithIndex = mapWithIndex;\n\nfunction map(f) {\n return mapWithIndex(function (_, a) {\n return f(a);\n });\n}\n\nexports.map = map;\n\nfunction reduceWithIndex(b, f) {\n return function (fa) {\n var out = b;\n var ks = keys(fa);\n var len = ks.length;\n\n for (var i = 0; i < len; i++) {\n var k = ks[i];\n out = f(k, out, fa[k]);\n }\n\n return out;\n };\n}\n\nexports.reduceWithIndex = reduceWithIndex;\n\nfunction foldMapWithIndex(M) {\n return function (f) {\n return function (fa) {\n var out = M.empty;\n var ks = keys(fa);\n var len = ks.length;\n\n for (var i = 0; i < len; i++) {\n var k = ks[i];\n out = M.concat(out, f(k, fa[k]));\n }\n\n return out;\n };\n };\n}\n\nexports.foldMapWithIndex = foldMapWithIndex;\n\nfunction reduceRightWithIndex(b, f) {\n return function (fa) {\n var out = b;\n var ks = keys(fa);\n var len = ks.length;\n\n for (var i = len - 1; i >= 0; i--) {\n var k = ks[i];\n out = f(k, fa[k], out);\n }\n\n return out;\n };\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 */\n\nfunction singleton(k, a) {\n var _a;\n\n return _a = {}, _a[k] = a, _a;\n}\n\nexports.singleton = singleton;\n\nfunction traverseWithIndex(F) {\n return function (f) {\n return function (ta) {\n var ks = keys(ta);\n\n if (ks.length === 0) {\n return F.of(exports.empty);\n }\n\n var fr = F.of({});\n\n var _loop_1 = function _loop_1(key) {\n fr = F.ap(F.map(fr, function (r) {\n return function (b) {\n r[key] = b;\n return r;\n };\n }), f(key, ta[key]));\n };\n\n for (var _i = 0, ks_1 = ks; _i < ks_1.length; _i++) {\n var key = ks_1[_i];\n\n _loop_1(key);\n }\n\n return fr;\n };\n };\n}\n\nexports.traverseWithIndex = traverseWithIndex;\n\nfunction traverse(F) {\n var traverseWithIndexF = traverseWithIndex(F);\n return function (f) {\n return traverseWithIndexF(function (_, a) {\n return f(a);\n });\n };\n}\n\nexports.traverse = traverse;\n\nfunction sequence(F) {\n return traverseWithIndex(F)(function (_, a) {\n return a;\n });\n}\n\nexports.sequence = sequence;\n/**\n * @category Witherable\n * @since 2.6.5\n */\n\nvar wither = function wither(F) {\n var traverseF = traverse(F);\n return function (f) {\n return function (fa) {\n return F.map(function_1.pipe(fa, traverseF(f)), exports.compact);\n };\n };\n};\n\nexports.wither = wither;\n/**\n * @category Witherable\n * @since 2.6.5\n */\n\nvar wilt = function wilt(F) {\n var traverseF = traverse(F);\n return function (f) {\n return function (fa) {\n return F.map(function_1.pipe(fa, traverseF(f)), exports.separate);\n };\n };\n};\n\nexports.wilt = wilt;\n\nfunction partitionMapWithIndex(f) {\n return function (fa) {\n var left = {};\n var right = {};\n var keys = Object.keys(fa);\n\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\n switch (e._tag) {\n case 'Left':\n left[key] = e.left;\n break;\n\n case 'Right':\n right[key] = e.right;\n break;\n }\n }\n\n return {\n left: left,\n right: right\n };\n };\n}\n\nexports.partitionMapWithIndex = partitionMapWithIndex;\n\nfunction partitionWithIndex(predicateWithIndex) {\n return function (fa) {\n var left = {};\n var right = {};\n var keys = Object.keys(fa);\n\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\n if (predicateWithIndex(key, a)) {\n right[key] = a;\n } else {\n left[key] = a;\n }\n }\n\n return {\n left: left,\n right: right\n };\n };\n}\n\nexports.partitionWithIndex = partitionWithIndex;\n\nfunction filterMapWithIndex(f) {\n return function (fa) {\n var r = {};\n var keys = Object.keys(fa);\n\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\n if (Option_1.isSome(optionB)) {\n r[key] = optionB.value;\n }\n }\n\n return r;\n };\n}\n\nexports.filterMapWithIndex = filterMapWithIndex;\n\nfunction filterWithIndex(predicateWithIndex) {\n return function (fa) {\n var out = {};\n var changed = false;\n\n for (var key in fa) {\n if (_hasOwnProperty.call(fa, key)) {\n var a = fa[key];\n\n if (predicateWithIndex(key, a)) {\n out[key] = a;\n } else {\n changed = true;\n }\n }\n }\n\n return changed ? out : fa;\n };\n}\n\nexports.filterWithIndex = filterWithIndex;\n\nfunction fromFoldable(M, F) {\n var fromFoldableMapM = fromFoldableMap(M, F);\n return function (fka) {\n return fromFoldableMapM(fka, function_1.identity);\n };\n}\n\nexports.fromFoldable = fromFoldable;\n\nfunction fromFoldableMap(M, F) {\n return function (ta, f) {\n return F.reduce(ta, {}, function (r, a) {\n var _a = f(a),\n k = _a[0],\n b = _a[1];\n\n r[k] = _hasOwnProperty.call(r, k) ? M.concat(r[k], b) : b;\n return r;\n });\n };\n}\n\nexports.fromFoldableMap = fromFoldableMap;\n/**\n * @since 2.5.0\n */\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\n return true;\n };\n}\n\nexports.every = every;\n/**\n * @since 2.5.0\n */\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\n return false;\n };\n}\n\nexports.some = some;\n\nfunction elem(E) {\n return function (a, fa) {\n if (fa === undefined) {\n var elemE_1 = elem(E);\n return function (fa) {\n return elemE_1(a, fa);\n };\n }\n\n for (var k in fa) {\n if (E.equals(fa[k], a)) {\n return true;\n }\n }\n\n return false;\n };\n}\n\nexports.elem = elem; // -------------------------------------------------------------------------------------\n// non-pipeables\n// -------------------------------------------------------------------------------------\n\nvar map_ = function map_(fa, f) {\n return function_1.pipe(fa, map(f));\n};\n/* istanbul ignore next */\n\n\nvar mapWithIndex_ = function mapWithIndex_(fa, f) {\n return function_1.pipe(fa, mapWithIndex(f));\n};\n/* istanbul ignore next */\n\n\nvar reduce_ = function reduce_(fa, b, f) {\n return function_1.pipe(fa, exports.reduce(b, f));\n};\n/* istanbul ignore next */\n\n\nvar foldMap_ = function foldMap_(M) {\n var foldMapM = exports.foldMap(M);\n return function (fa, f) {\n return function_1.pipe(fa, foldMapM(f));\n };\n};\n/* istanbul ignore next */\n\n\nvar reduceRight_ = function reduceRight_(fa, b, f) {\n return function_1.pipe(fa, exports.reduceRight(b, f));\n};\n/* istanbul ignore next */\n\n\nvar traverse_ = function traverse_(F) {\n var traverseF = traverse(F);\n return function (ta, f) {\n return function_1.pipe(ta, traverseF(f));\n };\n};\n/* istanbul ignore next */\n\n\nvar filter_ = function filter_(fa, predicate) {\n return function_1.pipe(fa, exports.filter(predicate));\n};\n/* istanbul ignore next */\n\n\nvar filterMap_ = function filterMap_(fa, f) {\n return function_1.pipe(fa, exports.filterMap(f));\n};\n/* istanbul ignore next */\n\n\nvar partition_ = function partition_(fa, predicate) {\n return function_1.pipe(fa, exports.partition(predicate));\n};\n/* istanbul ignore next */\n\n\nvar partitionMap_ = function partitionMap_(fa, f) {\n return function_1.pipe(fa, exports.partitionMap(f));\n};\n/* istanbul ignore next */\n\n\nvar reduceWithIndex_ = function reduceWithIndex_(fa, b, f) {\n return function_1.pipe(fa, reduceWithIndex(b, f));\n};\n/* istanbul ignore next */\n\n\nvar foldMapWithIndex_ = function foldMapWithIndex_(M) {\n var foldMapWithIndexM = foldMapWithIndex(M);\n return function (fa, f) {\n return function_1.pipe(fa, foldMapWithIndexM(f));\n };\n};\n/* istanbul ignore next */\n\n\nvar reduceRightWithIndex_ = function reduceRightWithIndex_(fa, b, f) {\n return function_1.pipe(fa, reduceRightWithIndex(b, f));\n};\n/* istanbul ignore next */\n\n\nvar partitionMapWithIndex_ = function partitionMapWithIndex_(fa, f) {\n return function_1.pipe(fa, partitionMapWithIndex(f));\n};\n/* istanbul ignore next */\n\n\nvar partitionWithIndex_ = function partitionWithIndex_(fa, predicateWithIndex) {\n return function_1.pipe(fa, partitionWithIndex(predicateWithIndex));\n};\n/* istanbul ignore next */\n\n\nvar filterMapWithIndex_ = function filterMapWithIndex_(fa, f) {\n return function_1.pipe(fa, filterMapWithIndex(f));\n};\n/* istanbul ignore next */\n\n\nvar filterWithIndex_ = function filterWithIndex_(fa, predicateWithIndex) {\n return function_1.pipe(fa, filterWithIndex(predicateWithIndex));\n};\n/* istanbul ignore next */\n\n\nvar traverseWithIndex_ = function traverseWithIndex_(F) {\n var traverseWithIndexF = traverseWithIndex(F);\n return function (ta, f) {\n return function_1.pipe(ta, traverseWithIndexF(f));\n };\n};\n/* istanbul ignore next */\n\n\nvar wither_ = function wither_(F) {\n var witherF = exports.wither(F);\n return function (fa, f) {\n return function_1.pipe(fa, witherF(f));\n };\n};\n/* istanbul ignore next */\n\n\nvar wilt_ = function wilt_(F) {\n var wiltF = exports.wilt(F);\n return function (fa, f) {\n return function_1.pipe(fa, wiltF(f));\n };\n}; // -------------------------------------------------------------------------------------\n// pipeables\n// -------------------------------------------------------------------------------------\n\n/**\n * @category Filterable\n * @since 2.5.0\n */\n\n\nvar filter = function filter(predicate) {\n return filterWithIndex(function (_, a) {\n return predicate(a);\n });\n};\n\nexports.filter = filter;\n/**\n * @category Filterable\n * @since 2.5.0\n */\n\nvar filterMap = function filterMap(f) {\n return filterMapWithIndex(function (_, a) {\n return f(a);\n });\n};\n\nexports.filterMap = filterMap;\n/**\n * @category Filterable\n * @since 2.5.0\n */\n\nvar partition = function partition(predicate) {\n return partitionWithIndex(function (_, a) {\n return predicate(a);\n });\n};\n\nexports.partition = partition;\n/**\n * @category Filterable\n * @since 2.5.0\n */\n\nvar partitionMap = function partitionMap(f) {\n return partitionMapWithIndex(function (_, a) {\n return f(a);\n });\n};\n\nexports.partitionMap = partitionMap;\n/**\n * @category Foldable\n * @since 2.5.0\n */\n\nvar reduce = function reduce(b, f) {\n return reduceWithIndex(b, function (_, b, a) {\n return f(b, a);\n });\n};\n\nexports.reduce = reduce;\n/**\n * @category Foldable\n * @since 2.5.0\n */\n\nvar foldMap = function foldMap(M) {\n var foldMapWithIndexM = foldMapWithIndex(M);\n return function (f) {\n return foldMapWithIndexM(function (_, a) {\n return f(a);\n });\n };\n};\n\nexports.foldMap = foldMap;\n/**\n * @category Foldable\n * @since 2.5.0\n */\n\nvar reduceRight = function reduceRight(b, f) {\n return reduceRightWithIndex(b, function (_, a, b) {\n return f(a, b);\n });\n};\n\nexports.reduceRight = reduceRight;\n/**\n * @category Compactable\n * @since 2.5.0\n */\n\nvar compact = function compact(fa) {\n var r = {};\n var keys = Object.keys(fa);\n\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\n if (Option_1.isSome(optionA)) {\n r[key] = optionA.value;\n }\n }\n\n return r;\n};\n\nexports.compact = compact;\n/**\n * @category Compactable\n * @since 2.5.0\n */\n\nvar separate = function separate(fa) {\n var left = {};\n var right = {};\n var keys = Object.keys(fa);\n\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\n switch (e._tag) {\n case 'Left':\n left[key] = e.left;\n break;\n\n case 'Right':\n right[key] = e.right;\n break;\n }\n }\n\n return {\n left: left,\n right: right\n };\n};\n\nexports.separate = separate; // -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n\n/**\n * @category instances\n * @since 2.5.0\n */\n\nexports.URI = 'ReadonlyRecord';\n/**\n * @category instances\n * @since 2.7.0\n */\n\nexports.Functor = {\n URI: exports.URI,\n map: map_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\n\nexports.FunctorWithIndex = {\n URI: exports.URI,\n map: map_,\n mapWithIndex: mapWithIndex_\n};\n/**\n * @category instances\n * @since 2.7.0\n */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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}; // TODO: remove in v3\n\n/**\n * @category instances\n * @since 2.5.0\n */\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};","'use strict';\nvar $ = require('../internals/export');\nvar IS_PURE = require('../internals/is-pure');\nvar NativePromise = require('../internals/native-promise-constructor');\nvar fails = require('../internals/fails');\nvar getBuiltIn = require('../internals/get-built-in');\nvar speciesConstructor = require('../internals/species-constructor');\nvar promiseResolve = require('../internals/promise-resolve');\nvar redefine = require('../internals/redefine');\n\n// Safari bug https://bugs.webkit.org/show_bug.cgi?id=200829\nvar NON_GENERIC = !!NativePromise && fails(function () {\n NativePromise.prototype['finally'].call({ then: function () { /* empty */ } }, function () { /* empty */ });\n});\n\n// `Promise.prototype.finally` method\n// https://tc39.es/ecma262/#sec-promise.prototype.finally\n$({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {\n 'finally': function (onFinally) {\n var C = speciesConstructor(this, getBuiltIn('Promise'));\n var isFunction = typeof onFinally == 'function';\n return this.then(\n isFunction ? function (x) {\n return promiseResolve(C, onFinally()).then(function () { return x; });\n } : onFinally,\n isFunction ? function (e) {\n return promiseResolve(C, onFinally()).then(function () { throw e; });\n } : onFinally\n );\n }\n});\n\n// patch native Promise.prototype for native async functions\nif (!IS_PURE && typeof NativePromise == 'function' && !NativePromise.prototype['finally']) {\n redefine(NativePromise.prototype, 'finally', getBuiltIn('Promise').prototype['finally']);\n}\n","function _extends() {\n module.exports = _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nmodule.exports = _extends;","'use strict';\nvar fails = require('../internals/fails');\n\nmodule.exports = function (METHOD_NAME, argument) {\n var method = [][METHOD_NAME];\n return !!method && fails(function () {\n // eslint-disable-next-line no-useless-call,no-throw-literal\n method.call(null, argument || function () { throw 1; }, 1);\n });\n};\n","var ceil = Math.ceil;\nvar floor = Math.floor;\n\n// `ToInteger` abstract operation\n// https://tc39.es/ecma262/#sec-tointeger\nmodule.exports = function (argument) {\n return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar has = require('../internals/has');\n\nvar defineProperty = Object.defineProperty;\nvar cache = {};\n\nvar thrower = function (it) { throw it; };\n\nmodule.exports = function (METHOD_NAME, options) {\n if (has(cache, METHOD_NAME)) return cache[METHOD_NAME];\n if (!options) options = {};\n var method = [][METHOD_NAME];\n var ACCESSORS = has(options, 'ACCESSORS') ? options.ACCESSORS : false;\n var argument0 = has(options, 0) ? options[0] : thrower;\n var argument1 = has(options, 1) ? options[1] : undefined;\n\n return cache[METHOD_NAME] = !!method && !fails(function () {\n if (ACCESSORS && !DESCRIPTORS) return true;\n var O = { length: -1 };\n\n if (ACCESSORS) defineProperty(O, 1, { enumerable: true, get: thrower });\n else O[1] = 1;\n\n method.call(O, argument0, argument1);\n });\n};\n","import React from \"react\"\nimport PropTypes from \"prop-types\"\n\nimport loader from \"./loader\"\nimport InternalPageRenderer from \"./page-renderer\"\n\nconst ProdPageRenderer = ({ location }) => {\n const pageResources = loader.loadPageSync(location.pathname)\n if (!pageResources) {\n return null\n }\n return React.createElement(InternalPageRenderer, {\n location,\n pageResources,\n ...pageResources.json,\n })\n}\n\nProdPageRenderer.propTypes = {\n location: PropTypes.shape({\n pathname: PropTypes.string.isRequired,\n }).isRequired,\n}\n\nexport default ProdPageRenderer\n","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","var global = require('../internals/global');\nvar shared = require('../internals/shared');\nvar has = require('../internals/has');\nvar uid = require('../internals/uid');\nvar NATIVE_SYMBOL = require('../internals/native-symbol');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar WellKnownSymbolsStore = shared('wks');\nvar Symbol = global.Symbol;\nvar createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;\n\nmodule.exports = function (name) {\n if (!has(WellKnownSymbolsStore, name)) {\n if (NATIVE_SYMBOL && has(Symbol, name)) WellKnownSymbolsStore[name] = Symbol[name];\n else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);\n } return WellKnownSymbolsStore[name];\n};\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getFunctorComposition = void 0;\n\nfunction getFunctorComposition(F, G) {\n return {\n map: function map(fa, f) {\n return F.map(fa, function (ga) {\n return G.map(ga, f);\n });\n }\n };\n}\n\nexports.getFunctorComposition = getFunctorComposition;","var isObject = require('../internals/is-object');\n\n// `ToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-toprimitive\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (input, PREFERRED_STRING) {\n if (!isObject(input)) return input;\n var fn, val;\n if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;\n if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;\n if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","\"use strict\";\n\nrequire(\"core-js/modules/es.array.reduce.js\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\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 */\n\nvar function_1 = require(\"./function\");\n\nvar Ord_1 = require(\"./Ord\");\n\nfunction fold(S) {\n return function (startWith, as) {\n if (as === undefined) {\n var foldS_1 = fold(S);\n return function (as) {\n return foldS_1(startWith, as);\n };\n }\n\n return as.reduce(S.concat, startWith);\n };\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 */\n\nfunction getFirstSemigroup() {\n return {\n concat: function_1.identity\n };\n}\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 */\n\nfunction getLastSemigroup() {\n return {\n concat: function concat(_, y) {\n return y;\n }\n };\n}\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 */\n\nfunction getTupleSemigroup() {\n var semigroups = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n semigroups[_i] = arguments[_i];\n }\n\n return {\n concat: function concat(x, y) {\n return semigroups.map(function (s, i) {\n return s.concat(x[i], y[i]);\n });\n }\n };\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 */\n\nfunction getDualSemigroup(S) {\n return {\n concat: function concat(x, y) {\n return S.concat(y, x);\n }\n };\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 */\n\nfunction getFunctionSemigroup(S) {\n return function () {\n return {\n concat: function concat(f, g) {\n return function (a) {\n return S.concat(f(a), g(a));\n };\n }\n };\n };\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 */\n\nfunction getStructSemigroup(semigroups) {\n return {\n concat: function concat(x, y) {\n var r = {};\n\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\n return r;\n }\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 */\n\nfunction getMeetSemigroup(O) {\n return {\n concat: Ord_1.min(O)\n };\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 */\n\nfunction getJoinSemigroup(O) {\n return {\n concat: Ord_1.max(O)\n };\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 */\n\nfunction getObjectSemigroup() {\n return {\n concat: function concat(x, y) {\n return Object.assign({}, x, y);\n }\n };\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 */\n\nexports.semigroupAll = {\n concat: function concat(x, y) {\n return x && y;\n }\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 */\n\nexports.semigroupAny = {\n concat: function concat(x, y) {\n return x || y;\n }\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 */\n\nexports.semigroupSum = {\n concat: function concat(x, y) {\n return x + y;\n }\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 */\n\nexports.semigroupProduct = {\n concat: function concat(x, y) {\n return x * y;\n }\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 */\n\nexports.semigroupString = {\n concat: function concat(x, y) {\n return x + y;\n }\n};\n/**\n * @category instances\n * @since 2.0.0\n */\n\nexports.semigroupVoid = {\n concat: function concat() {\n return undefined;\n }\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 */\n\nfunction getIntercalateSemigroup(a) {\n return function (S) {\n return {\n concat: function concat(x, y) {\n return S.concat(x, S.concat(a, y));\n }\n };\n };\n}\n\nexports.getIntercalateSemigroup = getIntercalateSemigroup;","module.exports = false;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.tailRec = void 0;\n/**\n * @since 2.0.0\n */\n\nfunction tailRec(a, f) {\n var v = f(a);\n\n while (v._tag === 'Left') {\n v = f(v.left);\n }\n\n return v.right;\n}\n\nexports.tailRec = tailRec;","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n","var global = require('../internals/global');\nvar setGlobal = require('../internals/set-global');\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || setGlobal(SHARED, {});\n\nmodule.exports = store;\n","const plugins = require(`./api-runner-browser-plugins`)\nconst {\n getResourcesForPathname,\n getResourcesForPathnameSync,\n getResourceURLsForPathname,\n loadPage,\n loadPageSync,\n} = require(`./loader`).publicLoader\n\nexports.apiRunner = (api, args = {}, defaultReturn, argTransform) => {\n // Hooks for gatsby-cypress's API handler\n if (process.env.CYPRESS_SUPPORT) {\n if (window.___apiHandler) {\n window.___apiHandler(api)\n } else if (window.___resolvedAPIs) {\n window.___resolvedAPIs.push(api)\n } else {\n window.___resolvedAPIs = [api]\n }\n }\n\n let results = plugins.map(plugin => {\n if (!plugin.plugin[api]) {\n return undefined\n }\n\n // Deprecated April 2019. Use `loadPageSync` instead\n args.getResourcesForPathnameSync = getResourcesForPathnameSync\n // Deprecated April 2019. Use `loadPage` instead\n args.getResourcesForPathname = getResourcesForPathname\n args.getResourceURLsForPathname = getResourceURLsForPathname\n args.loadPage = loadPage\n args.loadPageSync = loadPageSync\n\n const result = plugin.plugin[api](args, plugin.options)\n if (result && argTransform) {\n args = argTransform({ args, result, plugin })\n }\n return result\n })\n\n // Filter out undefined results.\n results = results.filter(result => typeof result !== `undefined`)\n\n if (results.length > 0) {\n return results\n } else if (defaultReturn) {\n return [defaultReturn]\n } else {\n return []\n }\n}\n\nexports.apiRunnerAsync = (api, args, defaultReturn) =>\n plugins.reduce(\n (previous, next) =>\n next.plugin[api]\n ? previous.then(() => next.plugin[api](args, next.options))\n : previous,\n Promise.resolve()\n )\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","require(\"core-js/modules/es.array.reduce.js\");\n\nrequire(\"core-js/modules/es.promise.finally.js\");\n\n!function (t, e) {\n \"object\" == typeof exports && \"object\" == typeof module ? module.exports = e(require(\"cross-fetch/polyfill\")) : \"function\" == typeof define && define.amd ? define(\"PrismicJS\", [\"cross-fetch/polyfill\"], e) : \"object\" == typeof exports ? exports.PrismicJS = e(require(\"cross-fetch/polyfill\")) : t.PrismicJS = e(t[\"cross-fetch/polyfill\"]);\n}(\"undefined\" != typeof self ? self : this, function (t) {\n return function (t) {\n var e = {};\n\n function n(r) {\n if (e[r]) return e[r].exports;\n var o = e[r] = {\n i: r,\n l: !1,\n exports: {}\n };\n return t[r].call(o.exports, o, o.exports, n), o.l = !0, o.exports;\n }\n\n return n.m = t, n.c = e, n.d = function (t, e, r) {\n n.o(t, e) || Object.defineProperty(t, e, {\n enumerable: !0,\n get: r\n });\n }, n.r = function (t) {\n \"undefined\" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, {\n value: \"Module\"\n }), Object.defineProperty(t, \"__esModule\", {\n value: !0\n });\n }, n.t = function (t, e) {\n if (1 & e && (t = n(t)), 8 & e) return t;\n if (4 & e && \"object\" == typeof t && t && t.__esModule) return t;\n var r = Object.create(null);\n if (n.r(r), Object.defineProperty(r, \"default\", {\n enumerable: !0,\n value: t\n }), 2 & e && \"string\" != typeof t) for (var o in t) {\n n.d(r, o, function (e) {\n return t[e];\n }.bind(null, o));\n }\n return r;\n }, n.n = function (t) {\n var e = t && t.__esModule ? function () {\n return t.default;\n } : function () {\n return t;\n };\n return n.d(e, \"a\", e), e;\n }, n.o = function (t, e) {\n return Object.prototype.hasOwnProperty.call(t, e);\n }, n.p = \"\", n(n.s = 20);\n }([function (t, e, n) {\n \"use strict\";\n\n e.a = function (t) {\n var e = this.constructor;\n return this.then(function (n) {\n return e.resolve(t()).then(function () {\n return n;\n });\n }, function (n) {\n return e.resolve(t()).then(function () {\n return e.reject(n);\n });\n });\n };\n }, function (t, e, n) {\n \"use strict\";\n\n e.__esModule = !0, e.createPreviewResolver = function (t, e, n) {\n return {\n token: t,\n documentId: e,\n resolve: function resolve(r, o, i) {\n return e && n ? n(e, {\n ref: t\n }).then(function (t) {\n if (t) {\n var e = r(t);\n return i && i(null, e), e;\n }\n\n return i && i(null, o), o;\n }) : Promise.resolve(o);\n }\n };\n };\n }, function (t, e, n) {\n \"use strict\";\n\n var r = this && this.__assign || Object.assign || function (t) {\n for (var e, n = 1, r = arguments.length; n < r; n++) {\n for (var o in e = arguments[n]) {\n Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);\n }\n }\n\n return t;\n };\n\n e.__esModule = !0;\n var o = n(5),\n i = n(4),\n u = n(6),\n a = n(12),\n s = n(1);\n e.PREVIEW_COOKIE = \"io.prismic.preview\", e.EXPERIMENT_COOKIE = \"io.prismic.experiment\";\n\n var f = function () {\n function t(t, e, n) {\n this.data = t, this.masterRef = t.refs.filter(function (t) {\n return t.isMasterRef;\n })[0], this.experiments = new o.Experiments(t.experiments), this.bookmarks = t.bookmarks, this.httpClient = e, this.options = n, this.refs = t.refs, this.tags = t.tags, this.types = t.types, this.languages = t.languages;\n }\n\n return t.prototype.form = function (t) {\n var e = this.data.forms[t];\n return e ? new i.SearchForm(e, this.httpClient) : null;\n }, t.prototype.everything = function () {\n var t = this.form(\"everything\");\n if (!t) throw new Error(\"Missing everything form\");\n return t;\n }, t.prototype.master = function () {\n return this.masterRef.ref;\n }, t.prototype.ref = function (t) {\n var e = this.data.refs.filter(function (e) {\n return e.label === t;\n })[0];\n return e ? e.ref : null;\n }, t.prototype.currentExperiment = function () {\n return this.experiments.current();\n }, t.prototype.query = function (t, n, r) {\n void 0 === r && (r = function r() {});\n var o = \"function\" == typeof n ? {\n options: {},\n callback: n\n } : {\n options: n || {},\n callback: r\n },\n i = o.options,\n u = o.callback,\n s = this.everything();\n\n for (var f in i) {\n s = s.set(f, i[f]);\n }\n\n if (!i.ref) {\n var c = \"\";\n this.options.req ? c = this.options.req.headers.cookie || \"\" : \"undefined\" != typeof window && window.document && (c = window.document.cookie || \"\");\n var l = a.default.parse(c),\n p = l[e.PREVIEW_COOKIE],\n h = this.experiments.refFromCookie(l[e.EXPERIMENT_COOKIE]);\n s = s.ref(p || h || this.masterRef.ref);\n }\n\n return t && s.query(t), s.submit(u);\n }, t.prototype.queryFirst = function (t, e, n) {\n var o = \"function\" == typeof e ? {\n options: {},\n callback: e\n } : {\n options: r({}, e) || {},\n callback: n || function () {}\n },\n i = o.options,\n u = o.callback;\n return i.page = 1, i.pageSize = 1, this.query(t, i).then(function (t) {\n var e = t && t.results && t.results[0];\n return u(null, e), e;\n }).catch(function (t) {\n throw u(t), t;\n });\n }, t.prototype.getByID = function (t, e, n) {\n var o = e ? r({}, e) : {};\n return o.lang || (o.lang = \"*\"), this.queryFirst(u.default.at(\"document.id\", t), o, n);\n }, t.prototype.getByIDs = function (t, e, n) {\n var o = e ? r({}, e) : {};\n return o.lang || (o.lang = \"*\"), this.query(u.default.in(\"document.id\", t), o, n);\n }, t.prototype.getByUID = function (t, e, n, o) {\n var i = n ? r({}, n) : {};\n if (\"*\" === i.lang) throw new Error(\"FORDIDDEN. You can't use getByUID with *, use the predicates instead.\");\n return i.page || (i.page = 1), this.queryFirst(u.default.at(\"my.\" + t + \".uid\", e), i, o);\n }, t.prototype.getSingle = function (t, e, n) {\n var o = e ? r({}, e) : {};\n return this.queryFirst(u.default.at(\"document.type\", t), o, n);\n }, t.prototype.getBookmark = function (t, e, n) {\n var r = this.data.bookmarks[t];\n return r ? this.getByID(r, e, n) : Promise.reject(\"Error retrieving bookmarked id\");\n }, t.prototype.getPreviewResolver = function (t, e) {\n return s.createPreviewResolver(t, e, this.getByID.bind(this));\n }, t.prototype.previewSession = function (t, e, n, r) {\n var o = this;\n return console.warn(\"previewSession function is deprecated in favor of getPreviewResolver function.\"), new Promise(function (i, u) {\n o.httpClient.request(t, function (a, s) {\n if (a) r && r(a), u(a);else if (s) {\n if (s.mainDocument) return o.getByID(s.mainDocument, {\n ref: t\n }).then(function (t) {\n if (t) {\n var o = e(t);\n r && r(null, o), i(o);\n } else r && r(null, n), i(n);\n }).catch(u);\n r && r(null, n), i(n);\n }\n });\n });\n }, t;\n }();\n\n e.default = f;\n }, function (t, e, n) {\n \"use strict\";\n\n e.__esModule = !0;\n var r = n(2),\n o = n(11);\n\n function i(t) {\n return t.indexOf(\"?\") > -1 ? \"&\" : \"?\";\n }\n\n var u = function () {\n function t(t, e) {\n if (this.options = e || {}, this.url = t, this.options.accessToken) {\n var n = \"access_token=\" + this.options.accessToken;\n this.url += i(t) + n;\n }\n\n this.options.routes && (this.url += i(t) + \"routes=\" + encodeURIComponent(JSON.stringify(this.options.routes))), this.apiDataTTL = this.options.apiDataTTL || 5, this.httpClient = new o.default(this.options.requestHandler, this.options.apiCache, this.options.proxyAgent, this.options.timeoutInMs);\n }\n\n return t.prototype.get = function (t) {\n var e = this;\n return this.httpClient.cachedRequest(this.url, {\n ttl: this.apiDataTTL\n }).then(function (n) {\n var o = new r.default(n, e.httpClient, e.options);\n return t && t(null, o), o;\n }).catch(function (e) {\n throw t && t(e), e;\n });\n }, t;\n }();\n\n e.default = u;\n }, function (t, e, n) {\n \"use strict\";\n\n e.__esModule = !0;\n\n var r = function () {\n function t(t, e) {\n this.id = t, this.api = e, this.fields = {};\n }\n\n return t.prototype.set = function (t, e) {\n return this.fields[t] = e, this;\n }, t.prototype.ref = function (t) {\n return this.set(\"ref\", t);\n }, t.prototype.query = function (t) {\n return this.set(\"q\", t);\n }, t.prototype.pageSize = function (t) {\n return this.set(\"pageSize\", t);\n }, t.prototype.fetch = function (t) {\n return console.warn(\"Warning: Using Fetch is deprecated. Use the property `graphQuery` instead.\"), this.set(\"fetch\", t);\n }, t.prototype.fetchLinks = function (t) {\n return console.warn(\"Warning: Using FetchLinks is deprecated. Use the property `graphQuery` instead.\"), this.set(\"fetchLinks\", t);\n }, t.prototype.graphQuery = function (t) {\n return this.set(\"graphQuery\", t);\n }, t.prototype.lang = function (t) {\n return this.set(\"lang\", t);\n }, t.prototype.page = function (t) {\n return this.set(\"page\", t);\n }, t.prototype.after = function (t) {\n return this.set(\"after\", t);\n }, t.prototype.orderings = function (t) {\n return this.set(\"orderings\", t);\n }, t.prototype.url = function () {\n var e = this;\n return this.api.get().then(function (n) {\n return t.toSearchForm(e, n).url();\n });\n }, t.prototype.submit = function (e) {\n var n = this;\n return this.api.get().then(function (r) {\n return t.toSearchForm(n, r).submit(e);\n });\n }, t.toSearchForm = function (t, e) {\n var n = e.form(t.id);\n if (n) return Object.keys(t.fields).reduce(function (e, n) {\n var r = t.fields[n];\n return \"q\" === n ? e.query(r) : \"pageSize\" === n ? e.pageSize(r) : \"fetch\" === n ? e.fetch(r) : \"fetchLinks\" === n ? e.fetchLinks(r) : \"graphQuery\" === n ? e.graphQuery(r) : \"lang\" === n ? e.lang(r) : \"page\" === n ? e.page(r) : \"after\" === n ? e.after(r) : \"orderings\" === n ? e.orderings(r) : e.set(n, r);\n }, n);\n throw new Error(\"Unable to access to form \" + t.id);\n }, t;\n }();\n\n e.LazySearchForm = r;\n\n var o = function () {\n function t(t, e) {\n for (var n in this.httpClient = e, this.form = t, this.data = {}, t.fields) {\n t.fields[n].default && (this.data[n] = [t.fields[n].default]);\n }\n }\n\n return t.prototype.set = function (t, e) {\n var n = this.form.fields[t];\n if (!n) throw new Error(\"Unknown field \" + t);\n var r = \"\" === e || void 0 === e ? null : e,\n o = this.data[t] || [];\n return o = n.multiple ? r ? o.concat([r]) : o : r ? [r] : o, this.data[t] = o, this;\n }, t.prototype.ref = function (t) {\n return this.set(\"ref\", t);\n }, t.prototype.query = function (t) {\n if (\"string\" == typeof t) return this.query([t]);\n if (Array.isArray(t)) return this.set(\"q\", \"[\" + t.join(\"\") + \"]\");\n throw new Error(\"Invalid query : \" + t);\n }, t.prototype.pageSize = function (t) {\n return this.set(\"pageSize\", t);\n }, t.prototype.fetch = function (t) {\n console.warn(\"Warning: Using Fetch is deprecated. Use the property `graphQuery` instead.\");\n var e = Array.isArray(t) ? t.join(\",\") : t;\n return this.set(\"fetch\", e);\n }, t.prototype.fetchLinks = function (t) {\n console.warn(\"Warning: Using FetchLinks is deprecated. Use the property `graphQuery` instead.\");\n var e = Array.isArray(t) ? t.join(\",\") : t;\n return this.set(\"fetchLinks\", e);\n }, t.prototype.graphQuery = function (t) {\n return this.set(\"graphQuery\", t);\n }, t.prototype.lang = function (t) {\n return this.set(\"lang\", t);\n }, t.prototype.page = function (t) {\n return this.set(\"page\", t);\n }, t.prototype.after = function (t) {\n return this.set(\"after\", t);\n }, t.prototype.orderings = function (t) {\n return t ? this.set(\"orderings\", \"[\" + t.join(\",\") + \"]\") : this;\n }, t.prototype.url = function () {\n var t = this.form.action;\n\n if (this.data) {\n var e = t.indexOf(\"?\") > -1 ? \"&\" : \"?\";\n\n for (var n in this.data) {\n if (this.data.hasOwnProperty(n)) {\n var r = this.data[n];\n if (r) for (var o = 0; o < r.length; o++) {\n t += e + n + \"=\" + encodeURIComponent(r[o]), e = \"&\";\n }\n }\n }\n }\n\n return t;\n }, t.prototype.submit = function (t) {\n return this.httpClient.cachedRequest(this.url()).then(function (e) {\n return t && t(null, e), e;\n }).catch(function (e) {\n throw t && t(e), e;\n });\n }, t;\n }();\n\n e.SearchForm = o;\n }, function (t, e, n) {\n \"use strict\";\n\n e.__esModule = !0;\n\n var r = function () {\n function t(t) {\n this.data = {}, this.data = t;\n }\n\n return t.prototype.id = function () {\n return this.data.id;\n }, t.prototype.ref = function () {\n return this.data.ref;\n }, t.prototype.label = function () {\n return this.data.label;\n }, t;\n }();\n\n e.Variation = r;\n\n var o = function () {\n function t(t) {\n this.data = {}, this.data = t, this.variations = (t.variations || []).map(function (t) {\n return new r(t);\n });\n }\n\n return t.prototype.id = function () {\n return this.data.id;\n }, t.prototype.googleId = function () {\n return this.data.googleId;\n }, t.prototype.name = function () {\n return this.data.name;\n }, t;\n }();\n\n e.Experiment = o;\n\n var i = function () {\n function t(t) {\n t && (this.drafts = (t.drafts || []).map(function (t) {\n return new o(t);\n }), this.running = (t.running || []).map(function (t) {\n return new o(t);\n }));\n }\n\n return t.prototype.current = function () {\n return this.running.length > 0 ? this.running[0] : null;\n }, t.prototype.refFromCookie = function (t) {\n if (!t || \"\" === t.trim()) return null;\n var e = t.trim().split(\" \");\n if (e.length < 2) return null;\n var n = e[0],\n r = parseInt(e[1], 10),\n o = this.running.filter(function (t) {\n return t.googleId() === n && t.variations.length > r;\n })[0];\n return o ? o.variations[r].ref() : null;\n }, t;\n }();\n\n e.Experiments = i;\n }, function (t, e, n) {\n \"use strict\";\n\n e.__esModule = !0;\n var r = \"at\",\n o = \"not\",\n i = \"missing\",\n u = \"has\",\n a = \"any\",\n s = \"in\",\n f = \"fulltext\",\n c = \"similar\",\n l = \"number.gt\",\n p = \"number.lt\",\n h = \"number.inRange\",\n d = \"date.before\",\n y = \"date.after\",\n m = \"date.between\",\n g = \"date.day-of-month\",\n v = \"date.day-of-month-after\",\n w = \"date.day-of-month-before\",\n b = \"date.day-of-week\",\n _ = \"date.day-of-week-after\",\n k = \"date.day-of-week-before\",\n I = \"date.month\",\n T = \"date.month-before\",\n E = \"date.month-after\",\n O = \"date.year\",\n A = \"date.hour\",\n x = \"date.hour-before\",\n M = \"date.hour-after\",\n P = \"geopoint.near\";\n\n function j(t) {\n if (\"string\" == typeof t) return '\"' + t + '\"';\n if (\"number\" == typeof t) return t.toString();\n if (t instanceof Date) return t.getTime().toString();\n if (Array.isArray(t)) return \"[\" + t.map(function (t) {\n return j(t);\n }).join(\",\") + \"]\";\n if (\"boolean\" == typeof t) return t.toString();\n throw new Error(\"Unable to encode \" + t + \" of type \" + typeof t);\n }\n\n var q = {\n near: function near(t, e, n, r) {\n return \"[\" + P + \"(\" + t + \", \" + e + \", \" + n + \", \" + r + \")]\";\n }\n },\n R = {\n before: function before(t, e) {\n return \"[\" + d + \"(\" + t + \", \" + j(e) + \")]\";\n },\n after: function after(t, e) {\n return \"[\" + y + \"(\" + t + \", \" + j(e) + \")]\";\n },\n between: function between(t, e, n) {\n return \"[\" + m + \"(\" + t + \", \" + j(e) + \", \" + j(n) + \")]\";\n },\n dayOfMonth: function dayOfMonth(t, e) {\n return \"[\" + g + \"(\" + t + \", \" + e + \")]\";\n },\n dayOfMonthAfter: function dayOfMonthAfter(t, e) {\n return \"[\" + v + \"(\" + t + \", \" + e + \")]\";\n },\n dayOfMonthBefore: function dayOfMonthBefore(t, e) {\n return \"[\" + w + \"(\" + t + \", \" + e + \")]\";\n },\n dayOfWeek: function dayOfWeek(t, e) {\n return \"[\" + b + \"(\" + t + \", \" + j(e) + \")]\";\n },\n dayOfWeekAfter: function dayOfWeekAfter(t, e) {\n return \"[\" + _ + \"(\" + t + \", \" + j(e) + \")]\";\n },\n dayOfWeekBefore: function dayOfWeekBefore(t, e) {\n return \"[\" + k + \"(\" + t + \", \" + j(e) + \")]\";\n },\n month: function month(t, e) {\n return \"[\" + I + \"(\" + t + \", \" + j(e) + \")]\";\n },\n monthBefore: function monthBefore(t, e) {\n return \"[\" + T + \"(\" + t + \", \" + j(e) + \")]\";\n },\n monthAfter: function monthAfter(t, e) {\n return \"[\" + E + \"(\" + t + \", \" + j(e) + \")]\";\n },\n year: function year(t, e) {\n return \"[\" + O + \"(\" + t + \", \" + e + \")]\";\n },\n hour: function hour(t, e) {\n return \"[\" + A + \"(\" + t + \", \" + e + \")]\";\n },\n hourBefore: function hourBefore(t, e) {\n return \"[\" + x + \"(\" + t + \", \" + e + \")]\";\n },\n hourAfter: function hourAfter(t, e) {\n return \"[\" + M + \"(\" + t + \", \" + e + \")]\";\n }\n },\n S = {\n gt: function gt(t, e) {\n return \"[\" + l + \"(\" + t + \", \" + e + \")]\";\n },\n lt: function lt(t, e) {\n return \"[\" + p + \"(\" + t + \", \" + e + \")]\";\n },\n inRange: function inRange(t, e, n) {\n return \"[\" + h + \"(\" + t + \", \" + e + \", \" + n + \")]\";\n }\n };\n e.default = {\n at: function at(t, e) {\n return \"[\" + r + \"(\" + t + \", \" + j(e) + \")]\";\n },\n not: function not(t, e) {\n return \"[\" + o + \"(\" + t + \", \" + j(e) + \")]\";\n },\n missing: function missing(t) {\n return \"[\" + i + \"(\" + t + \")]\";\n },\n has: function has(t) {\n return \"[\" + u + \"(\" + t + \")]\";\n },\n any: function any(t, e) {\n return \"[\" + a + \"(\" + t + \", \" + j(e) + \")]\";\n },\n in: function _in(t, e) {\n return \"[\" + s + \"(\" + t + \", \" + j(e) + \")]\";\n },\n fulltext: function fulltext(t, e) {\n return \"[\" + f + \"(\" + t + \", \" + j(e) + \")]\";\n },\n similar: function similar(t, e) {\n return \"[\" + c + '(\"' + t + '\", ' + e + \")]\";\n },\n date: R,\n dateBefore: R.before,\n dateAfter: R.after,\n dateBetween: R.between,\n dayOfMonth: R.dayOfMonth,\n dayOfMonthAfter: R.dayOfMonthAfter,\n dayOfMonthBefore: R.dayOfMonthBefore,\n dayOfWeek: R.dayOfWeek,\n dayOfWeekAfter: R.dayOfWeekAfter,\n dayOfWeekBefore: R.dayOfWeekBefore,\n month: R.month,\n monthBefore: R.monthBefore,\n monthAfter: R.monthAfter,\n year: R.year,\n hour: R.hour,\n hourBefore: R.hourBefore,\n hourAfter: R.hourAfter,\n number: S,\n gt: S.gt,\n lt: S.lt,\n inRange: S.inRange,\n near: q.near,\n geopoint: q\n };\n }, function (t, e, n) {\n \"use strict\";\n\n (function (t) {\n var r = n(0),\n o = setTimeout;\n\n function i() {}\n\n function u(t) {\n if (!(this instanceof u)) throw new TypeError(\"Promises must be constructed via new\");\n if (\"function\" != typeof t) throw new TypeError(\"not a function\");\n this._state = 0, this._handled = !1, this._value = void 0, this._deferreds = [], l(t, this);\n }\n\n function a(t, e) {\n for (; 3 === t._state;) {\n t = t._value;\n }\n\n 0 !== t._state ? (t._handled = !0, u._immediateFn(function () {\n var n = 1 === t._state ? e.onFulfilled : e.onRejected;\n\n if (null !== n) {\n var r;\n\n try {\n r = n(t._value);\n } catch (t) {\n return void f(e.promise, t);\n }\n\n s(e.promise, r);\n } else (1 === t._state ? s : f)(e.promise, t._value);\n })) : t._deferreds.push(e);\n }\n\n function s(t, e) {\n try {\n if (e === t) throw new TypeError(\"A promise cannot be resolved with itself.\");\n\n if (e && (\"object\" == typeof e || \"function\" == typeof e)) {\n var n = e.then;\n if (e instanceof u) return t._state = 3, t._value = e, void c(t);\n if (\"function\" == typeof n) return void l(function (t, e) {\n return function () {\n t.apply(e, arguments);\n };\n }(n, e), t);\n }\n\n t._state = 1, t._value = e, c(t);\n } catch (e) {\n f(t, e);\n }\n }\n\n function f(t, e) {\n t._state = 2, t._value = e, c(t);\n }\n\n function c(t) {\n 2 === t._state && 0 === t._deferreds.length && u._immediateFn(function () {\n t._handled || u._unhandledRejectionFn(t._value);\n });\n\n for (var e = 0, n = t._deferreds.length; e < n; e++) {\n a(t, t._deferreds[e]);\n }\n\n t._deferreds = null;\n }\n\n function l(t, e) {\n var n = !1;\n\n try {\n t(function (t) {\n n || (n = !0, s(e, t));\n }, function (t) {\n n || (n = !0, f(e, t));\n });\n } catch (t) {\n if (n) return;\n n = !0, f(e, t);\n }\n }\n\n u.prototype.catch = function (t) {\n return this.then(null, t);\n }, u.prototype.then = function (t, e) {\n var n = new this.constructor(i);\n return a(this, new function (t, e, n) {\n this.onFulfilled = \"function\" == typeof t ? t : null, this.onRejected = \"function\" == typeof e ? e : null, this.promise = n;\n }(t, e, n)), n;\n }, u.prototype.finally = r.a, u.all = function (t) {\n return new u(function (e, n) {\n if (!t || void 0 === t.length) throw new TypeError(\"Promise.all accepts an array\");\n var r = Array.prototype.slice.call(t);\n if (0 === r.length) return e([]);\n var o = r.length;\n\n function i(t, u) {\n try {\n if (u && (\"object\" == typeof u || \"function\" == typeof u)) {\n var a = u.then;\n if (\"function\" == typeof a) return void a.call(u, function (e) {\n i(t, e);\n }, n);\n }\n\n r[t] = u, 0 == --o && e(r);\n } catch (t) {\n n(t);\n }\n }\n\n for (var u = 0; u < r.length; u++) {\n i(u, r[u]);\n }\n });\n }, u.resolve = function (t) {\n return t && \"object\" == typeof t && t.constructor === u ? t : new u(function (e) {\n e(t);\n });\n }, u.reject = function (t) {\n return new u(function (e, n) {\n n(t);\n });\n }, u.race = function (t) {\n return new u(function (e, n) {\n for (var r = 0, o = t.length; r < o; r++) {\n t[r].then(e, n);\n }\n });\n }, u._immediateFn = \"function\" == typeof t && function (e) {\n t(e);\n } || function (t) {\n o(t, 0);\n }, u._unhandledRejectionFn = function (t) {\n \"undefined\" != typeof console && console && console.warn(\"Possible Unhandled Promise Rejection:\", t);\n }, e.a = u;\n }).call(this, n(18).setImmediate);\n }, function (t, e, n) {\n \"use strict\";\n\n e.__esModule = !0;\n\n var r = function () {\n function t(t) {\n this.options = t || {};\n }\n\n return t.prototype.request = function (t, e) {\n !function (t, e, n) {\n var r,\n o = {\n headers: {\n Accept: \"application/json\"\n }\n };\n e && e.proxyAgent && (o.agent = e.proxyAgent);\n var i = fetch(t, o);\n (e.timeoutInMs ? Promise.race([i, new Promise(function (n, o) {\n r = setTimeout(function () {\n return o(new Error(t + \" response timeout\"));\n }, e.timeoutInMs);\n })]) : i).then(function (e) {\n return clearTimeout(r), ~~(e.status / 100 != 2) ? e.text().then(function () {\n var n = new Error(\"Unexpected status code [\" + e.status + \"] on URL \" + t);\n throw n.status = e.status, n;\n }) : e.json().then(function (t) {\n var r = e.headers.get(\"cache-control\"),\n o = r ? /max-age=(\\d+)/.exec(r) : null,\n i = o ? parseInt(o[1], 10) : void 0;\n n(null, t, e, i);\n });\n }).catch(function (t) {\n clearTimeout(r), n(t);\n });\n }(t, this.options, e);\n }, t;\n }();\n\n e.DefaultRequestHandler = r;\n }, function (t, e, n) {\n \"use strict\";\n\n function r(t) {\n this.size = 0, this.limit = t, this._keymap = {};\n }\n\n e.__esModule = !0, e.MakeLRUCache = function (t) {\n return new r(t);\n }, r.prototype.put = function (t, e) {\n var n = {\n key: t,\n value: e\n };\n if (this._keymap[t] = n, this.tail ? (this.tail.newer = n, n.older = this.tail) : this.head = n, this.tail = n, this.size === this.limit) return this.shift();\n this.size++;\n }, r.prototype.shift = function () {\n var t = this.head;\n return t && (this.head.newer ? (this.head = this.head.newer, this.head.older = void 0) : this.head = void 0, t.newer = t.older = void 0, delete this._keymap[t.key]), console.log(\"purging \", t.key), t;\n }, r.prototype.get = function (t, e) {\n var n = this._keymap[t];\n if (void 0 !== n) return n === this.tail ? e ? n : n.value : (n.newer && (n === this.head && (this.head = n.newer), n.newer.older = n.older), n.older && (n.older.newer = n.newer), n.newer = void 0, n.older = this.tail, this.tail && (this.tail.newer = n), this.tail = n, e ? n : n.value);\n }, r.prototype.find = function (t) {\n return this._keymap[t];\n }, r.prototype.set = function (t, e) {\n var n,\n r = this.get(t, !0);\n return r ? (n = r.value, r.value = e) : (n = this.put(t, e)) && (n = n.value), n;\n }, r.prototype.remove = function (t) {\n var e = this._keymap[t];\n if (e) return delete this._keymap[e.key], e.newer && e.older ? (e.older.newer = e.newer, e.newer.older = e.older) : e.newer ? (e.newer.older = void 0, this.head = e.newer) : e.older ? (e.older.newer = void 0, this.tail = e.older) : this.head = this.tail = void 0, this.size--, e.value;\n }, r.prototype.removeAll = function () {\n this.head = this.tail = void 0, this.size = 0, this._keymap = {};\n }, \"function\" == typeof Object.keys ? r.prototype.keys = function () {\n return Object.keys(this._keymap);\n } : r.prototype.keys = function () {\n var t = [];\n\n for (var e in this._keymap) {\n t.push(e);\n }\n\n return t;\n }, r.prototype.forEach = function (t, e, n) {\n var r;\n if (!0 === e ? (n = !0, e = void 0) : \"object\" != typeof e && (e = this), n) for (r = this.tail; r;) {\n t.call(e, r.key, r.value, this), r = r.older;\n } else for (r = this.head; r;) {\n t.call(e, r.key, r.value, this), r = r.newer;\n }\n }, r.prototype.toString = function () {\n for (var t = \"\", e = this.head; e;) {\n t += String(e.key) + \":\" + e.value, (e = e.newer) && (t += \" < \");\n }\n\n return t;\n };\n }, function (t, e, n) {\n \"use strict\";\n\n e.__esModule = !0;\n\n var r = n(9),\n o = function () {\n function t(t) {\n void 0 === t && (t = 1e3), this.lru = r.MakeLRUCache(t);\n }\n\n return t.prototype.isExpired = function (t) {\n var e = this.lru.get(t, !1);\n return !!e && 0 !== e.expiredIn && e.expiredIn < Date.now();\n }, t.prototype.get = function (t, e) {\n var n = this.lru.get(t, !1);\n n && !this.isExpired(t) ? e(null, n.data) : e && e(null);\n }, t.prototype.set = function (t, e, n, r) {\n this.lru.remove(t), this.lru.put(t, {\n data: e,\n expiredIn: n ? Date.now() + 1e3 * n : 0\n }), r && r(null);\n }, t.prototype.remove = function (t, e) {\n this.lru.remove(t), e && e(null);\n }, t.prototype.clear = function (t) {\n this.lru.removeAll(), t && t(null);\n }, t;\n }();\n\n e.DefaultApiCache = o;\n }, function (t, e, n) {\n \"use strict\";\n\n e.__esModule = !0;\n\n var r = n(10),\n o = n(8),\n i = function () {\n function t(t, e, n, i) {\n this.requestHandler = t || new o.DefaultRequestHandler({\n proxyAgent: n,\n timeoutInMs: i\n }), this.cache = e || new r.DefaultApiCache();\n }\n\n return t.prototype.request = function (t, e) {\n this.requestHandler.request(t, function (t, n, r, o) {\n t ? e && e(t, null, r, o) : n && e && e(null, n, r, o);\n });\n }, t.prototype.cachedRequest = function (t, e) {\n var n = this,\n r = e || {};\n return new Promise(function (e, o) {\n !function (e) {\n var o = r.cacheKey || t;\n n.cache.get(o, function (i, u) {\n i || u ? e(i, u) : n.request(t, function (t, i, u, a) {\n if (t) e(t, null);else {\n var s = a || r.ttl;\n s && n.cache.set(o, i, s, e), e(null, i);\n }\n });\n });\n }(function (t, n) {\n t && o(t), n && e(n);\n });\n });\n }, t;\n }();\n\n e.default = i;\n }, function (t, e, n) {\n \"use strict\";\n\n e.__esModule = !0;\n var r = decodeURIComponent;\n e.default = {\n parse: function parse(t, e) {\n if (\"string\" != typeof t) throw new TypeError(\"argument str must be a string\");\n var n = {},\n o = e || {},\n i = t.split(/; */),\n u = o.decode || r;\n return i.forEach(function (t) {\n var e = t.indexOf(\"=\");\n\n if (!(e < 0)) {\n var r = t.substr(0, e).trim(),\n o = t.substr(++e, t.length).trim();\n '\"' == o[0] && (o = o.slice(1, -1)), void 0 == n[r] && (n[r] = function (t, e) {\n try {\n return e(t);\n } catch (e) {\n return t;\n }\n }(o, u));\n }\n }), n;\n }\n };\n }, function (t, e, n) {\n \"use strict\";\n\n e.__esModule = !0;\n\n var r = n(4),\n o = n(3),\n i = n(1),\n u = function () {\n function t(t, e) {\n this.api = new o.default(t, e);\n }\n\n return t.prototype.getApi = function () {\n return this.api.get();\n }, t.prototype.everything = function () {\n return this.form(\"everything\");\n }, t.prototype.form = function (t) {\n return new r.LazySearchForm(t, this.api);\n }, t.prototype.query = function (t, e, n) {\n return this.getApi().then(function (r) {\n return r.query(t, e, n);\n });\n }, t.prototype.queryFirst = function (t, e, n) {\n return this.getApi().then(function (r) {\n return r.queryFirst(t, e, n);\n });\n }, t.prototype.getByID = function (t, e, n) {\n return this.getApi().then(function (r) {\n return r.getByID(t, e, n);\n });\n }, t.prototype.getByIDs = function (t, e, n) {\n return this.getApi().then(function (r) {\n return r.getByIDs(t, e, n);\n });\n }, t.prototype.getByUID = function (t, e, n, r) {\n return this.getApi().then(function (o) {\n return o.getByUID(t, e, n, r);\n });\n }, t.prototype.getSingle = function (t, e, n) {\n return this.getApi().then(function (r) {\n return r.getSingle(t, e, n);\n });\n }, t.prototype.getBookmark = function (t, e, n) {\n return this.getApi().then(function (r) {\n return r.getBookmark(t, e, n);\n });\n }, t.prototype.previewSession = function (t, e, n, r) {\n return this.getApi().then(function (o) {\n return o.previewSession(t, e, n, r);\n });\n }, t.prototype.getPreviewResolver = function (t, e) {\n var n = this;\n return i.createPreviewResolver(t, e, function (t) {\n return n.getApi().then(function (e) {\n return e.getByID(t);\n });\n });\n }, t.getApi = function (t, e) {\n return new o.default(t, e).get();\n }, t;\n }();\n\n e.DefaultClient = u;\n }, function (t, e, n) {\n \"use strict\";\n\n var r,\n o = n(6),\n i = n(5),\n u = n(13),\n a = n(3),\n s = n(2);\n !function (t) {\n function e(t, e) {\n return u.DefaultClient.getApi(t, e);\n }\n\n t.experimentCookie = s.EXPERIMENT_COOKIE, t.previewCookie = s.PREVIEW_COOKIE, t.Predicates = o.default, t.Experiments = i.Experiments, t.Api = a.default, t.client = function (t, e) {\n return new u.DefaultClient(t, e);\n }, t.getApi = e, t.api = function (t, n) {\n return e(t, n);\n };\n }(r || (r = {})), t.exports = r;\n }, function (e, n) {\n e.exports = t;\n }, function (t, e) {\n var n,\n r,\n o = t.exports = {};\n\n function i() {\n throw new Error(\"setTimeout has not been defined\");\n }\n\n function u() {\n throw new Error(\"clearTimeout has not been defined\");\n }\n\n function a(t) {\n if (n === setTimeout) return setTimeout(t, 0);\n if ((n === i || !n) && setTimeout) return n = setTimeout, setTimeout(t, 0);\n\n try {\n return n(t, 0);\n } catch (e) {\n try {\n return n.call(null, t, 0);\n } catch (e) {\n return n.call(this, t, 0);\n }\n }\n }\n\n !function () {\n try {\n n = \"function\" == typeof setTimeout ? setTimeout : i;\n } catch (t) {\n n = i;\n }\n\n try {\n r = \"function\" == typeof clearTimeout ? clearTimeout : u;\n } catch (t) {\n r = u;\n }\n }();\n var s,\n f = [],\n c = !1,\n l = -1;\n\n function p() {\n c && s && (c = !1, s.length ? f = s.concat(f) : l = -1, f.length && h());\n }\n\n function h() {\n if (!c) {\n var t = a(p);\n c = !0;\n\n for (var e = f.length; e;) {\n for (s = f, f = []; ++l < e;) {\n s && s[l].run();\n }\n\n l = -1, e = f.length;\n }\n\n s = null, c = !1, function (t) {\n if (r === clearTimeout) return clearTimeout(t);\n if ((r === u || !r) && clearTimeout) return r = clearTimeout, clearTimeout(t);\n\n try {\n r(t);\n } catch (e) {\n try {\n return r.call(null, t);\n } catch (e) {\n return r.call(this, t);\n }\n }\n }(t);\n }\n }\n\n function d(t, e) {\n this.fun = t, this.array = e;\n }\n\n function y() {}\n\n o.nextTick = function (t) {\n var e = new Array(arguments.length - 1);\n if (arguments.length > 1) for (var n = 1; n < arguments.length; n++) {\n e[n - 1] = arguments[n];\n }\n f.push(new d(t, e)), 1 !== f.length || c || a(h);\n }, d.prototype.run = function () {\n this.fun.apply(null, this.array);\n }, o.title = \"browser\", o.browser = !0, o.env = {}, o.argv = [], o.version = \"\", o.versions = {}, o.on = y, o.addListener = y, o.once = y, o.off = y, o.removeListener = y, o.removeAllListeners = y, o.emit = y, o.prependListener = y, o.prependOnceListener = y, o.listeners = function (t) {\n return [];\n }, o.binding = function (t) {\n throw new Error(\"process.binding is not supported\");\n }, o.cwd = function () {\n return \"/\";\n }, o.chdir = function (t) {\n throw new Error(\"process.chdir is not supported\");\n }, o.umask = function () {\n return 0;\n };\n }, function (t, e, n) {\n (function (t) {\n !function (e, n) {\n \"use strict\";\n\n if (!e.setImmediate) {\n var r,\n o = 1,\n i = {},\n u = !1,\n a = e.document,\n s = Object.getPrototypeOf && Object.getPrototypeOf(e);\n s = s && s.setTimeout ? s : e, \"[object process]\" === {}.toString.call(e.process) ? r = function r(e) {\n t.nextTick(function () {\n c(e);\n });\n } : function () {\n if (e.postMessage && !e.importScripts) {\n var t = !0,\n n = e.onmessage;\n return e.onmessage = function () {\n t = !1;\n }, e.postMessage(\"\", \"*\"), e.onmessage = n, t;\n }\n }() ? function () {\n var t = \"setImmediate$\" + Math.random() + \"$\",\n n = function n(_n) {\n _n.source === e && \"string\" == typeof _n.data && 0 === _n.data.indexOf(t) && c(+_n.data.slice(t.length));\n };\n\n e.addEventListener ? e.addEventListener(\"message\", n, !1) : e.attachEvent(\"onmessage\", n), r = function r(n) {\n e.postMessage(t + n, \"*\");\n };\n }() : e.MessageChannel ? function () {\n var t = new MessageChannel();\n t.port1.onmessage = function (t) {\n c(t.data);\n }, r = function r(e) {\n t.port2.postMessage(e);\n };\n }() : a && \"onreadystatechange\" in a.createElement(\"script\") ? function () {\n var t = a.documentElement;\n\n r = function r(e) {\n var n = a.createElement(\"script\");\n n.onreadystatechange = function () {\n c(e), n.onreadystatechange = null, t.removeChild(n), n = null;\n }, t.appendChild(n);\n };\n }() : r = function r(t) {\n setTimeout(c, 0, t);\n }, s.setImmediate = function (t) {\n \"function\" != typeof t && (t = new Function(\"\" + t));\n\n for (var e = new Array(arguments.length - 1), n = 0; n < e.length; n++) {\n e[n] = arguments[n + 1];\n }\n\n var u = {\n callback: t,\n args: e\n };\n return i[o] = u, r(o), o++;\n }, s.clearImmediate = f;\n }\n\n function f(t) {\n delete i[t];\n }\n\n function c(t) {\n if (u) setTimeout(c, 0, t);else {\n var e = i[t];\n\n if (e) {\n u = !0;\n\n try {\n !function (t) {\n var e = t.callback,\n r = t.args;\n\n switch (r.length) {\n case 0:\n e();\n break;\n\n case 1:\n e(r[0]);\n break;\n\n case 2:\n e(r[0], r[1]);\n break;\n\n case 3:\n e(r[0], r[1], r[2]);\n break;\n\n default:\n e.apply(n, r);\n }\n }(e);\n } finally {\n f(t), u = !1;\n }\n }\n }\n }\n }(\"undefined\" == typeof self ? \"undefined\" == typeof global ? this : global : self);\n }).call(this, n(16));\n }, function (t, e, n) {\n var r = \"undefined\" != typeof global && global || \"undefined\" != typeof self && self || window,\n o = Function.prototype.apply;\n\n function i(t, e) {\n this._id = t, this._clearFn = e;\n }\n\n e.setTimeout = function () {\n return new i(o.call(setTimeout, r, arguments), clearTimeout);\n }, e.setInterval = function () {\n return new i(o.call(setInterval, r, arguments), clearInterval);\n }, e.clearTimeout = e.clearInterval = function (t) {\n t && t.close();\n }, i.prototype.unref = i.prototype.ref = function () {}, i.prototype.close = function () {\n this._clearFn.call(r, this._id);\n }, e.enroll = function (t, e) {\n clearTimeout(t._idleTimeoutId), t._idleTimeout = e;\n }, e.unenroll = function (t) {\n clearTimeout(t._idleTimeoutId), t._idleTimeout = -1;\n }, e._unrefActive = e.active = function (t) {\n clearTimeout(t._idleTimeoutId);\n var e = t._idleTimeout;\n e >= 0 && (t._idleTimeoutId = setTimeout(function () {\n t._onTimeout && t._onTimeout();\n }, e));\n }, n(17), e.setImmediate = \"undefined\" != typeof self && self.setImmediate || \"undefined\" != typeof global && global.setImmediate || this && this.setImmediate, e.clearImmediate = \"undefined\" != typeof self && self.clearImmediate || \"undefined\" != typeof global && global.clearImmediate || this && this.clearImmediate;\n }, function (t, e, n) {\n \"use strict\";\n\n n.r(e);\n\n var r = n(7),\n o = n(0),\n i = function () {\n if (\"undefined\" != typeof self) return self;\n if (\"undefined\" != typeof window) return window;\n if (\"undefined\" != typeof global) return global;\n throw new Error(\"unable to locate global object\");\n }();\n\n i.Promise ? i.Promise.prototype.finally || (i.Promise.prototype.finally = o.a) : i.Promise = r.a;\n }, function (t, e, n) {\n n(19), n(15), t.exports = n(14);\n }]);\n});","var has = require('../internals/has');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar indexOf = require('../internals/array-includes').indexOf;\nvar hiddenKeys = require('../internals/hidden-keys');\n\nmodule.exports = function (object, names) {\n var O = toIndexedObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~indexOf(result, key) || result.push(key);\n }\n return result;\n};\n","var global = require('../internals/global');\nvar isObject = require('../internals/is-object');\n\nvar document = global.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\n\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n\n return result;\n}\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\n\n\nfunction overArg(func, transform) {\n return function (arg) {\n return func(transform(arg));\n };\n}\n/** Used for built-in method references. */\n\n\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n/** Used to resolve the decompiled source of functions. */\n\nvar funcToString = funcProto.toString;\n/** Used to check objects for own properties. */\n\nvar hasOwnProperty = objectProto.hasOwnProperty;\n/** Used to infer the `Object` constructor. */\n\nvar objectCtorString = funcToString.call(Object);\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\n\nvar objectToString = objectProto.toString;\n/** Built-in value references. */\n\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\n\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\n\n\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || objectToString.call(value) != objectTag || isHostObject(value)) {\n return false;\n }\n\n var proto = getPrototype(value);\n\n if (proto === null) {\n return true;\n }\n\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;\n}\n\nmodule.exports = isPlainObject;","var anObject = require('../internals/an-object');\nvar isObject = require('../internals/is-object');\nvar newPromiseCapability = require('../internals/new-promise-capability');\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n","(function (self) {\n if (self.fetch) {\n return;\n }\n\n var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob: 'FileReader' in self && 'Blob' in self && function () {\n try {\n new Blob();\n return true;\n } catch (e) {\n return false;\n }\n }(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n };\n\n if (support.arrayBuffer) {\n var viewClasses = ['[object Int8Array]', '[object Uint8Array]', '[object Uint8ClampedArray]', '[object Int16Array]', '[object Uint16Array]', '[object Int32Array]', '[object Uint32Array]', '[object Float32Array]', '[object Float64Array]'];\n\n var isDataView = function isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj);\n };\n\n var isArrayBufferView = ArrayBuffer.isView || function (obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1;\n };\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name);\n }\n\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name');\n }\n\n return name.toLowerCase();\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value);\n }\n\n return value;\n } // Build a destructive iterator for the value list\n\n\n function iteratorFor(items) {\n var iterator = {\n next: function next() {\n var value = items.shift();\n return {\n done: value === undefined,\n value: value\n };\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function () {\n return iterator;\n };\n }\n\n return iterator;\n }\n\n function Headers(headers) {\n this.map = {};\n\n if (headers instanceof Headers) {\n headers.forEach(function (value, name) {\n this.append(name, value);\n }, this);\n } else if (Array.isArray(headers)) {\n headers.forEach(function (header) {\n this.append(header[0], header[1]);\n }, this);\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function (name) {\n this.append(name, headers[name]);\n }, this);\n }\n }\n\n Headers.prototype.append = function (name, value) {\n name = normalizeName(name);\n value = normalizeValue(value);\n var oldValue = this.map[name];\n this.map[name] = oldValue ? oldValue + ',' + value : value;\n };\n\n Headers.prototype['delete'] = function (name) {\n delete this.map[normalizeName(name)];\n };\n\n Headers.prototype.get = function (name) {\n name = normalizeName(name);\n return this.has(name) ? this.map[name] : null;\n };\n\n Headers.prototype.has = function (name) {\n return this.map.hasOwnProperty(normalizeName(name));\n };\n\n Headers.prototype.set = function (name, value) {\n this.map[normalizeName(name)] = normalizeValue(value);\n };\n\n Headers.prototype.forEach = function (callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this);\n }\n }\n };\n\n Headers.prototype.keys = function () {\n var items = [];\n this.forEach(function (value, name) {\n items.push(name);\n });\n return iteratorFor(items);\n };\n\n Headers.prototype.values = function () {\n var items = [];\n this.forEach(function (value) {\n items.push(value);\n });\n return iteratorFor(items);\n };\n\n Headers.prototype.entries = function () {\n var items = [];\n this.forEach(function (value, name) {\n items.push([name, value]);\n });\n return iteratorFor(items);\n };\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries;\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'));\n }\n\n body.bodyUsed = true;\n }\n\n function fileReaderReady(reader) {\n return new Promise(function (resolve, reject) {\n reader.onload = function () {\n resolve(reader.result);\n };\n\n reader.onerror = function () {\n reject(reader.error);\n };\n });\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsArrayBuffer(blob);\n return promise;\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsText(blob);\n return promise;\n }\n\n function readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf);\n var chars = new Array(view.length);\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i]);\n }\n\n return chars.join('');\n }\n\n function bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0);\n } else {\n var view = new Uint8Array(buf.byteLength);\n view.set(new Uint8Array(buf));\n return view.buffer;\n }\n }\n\n function Body() {\n this.bodyUsed = false;\n\n this._initBody = function (body) {\n this._bodyInit = body;\n\n if (!body) {\n this._bodyText = '';\n } else if (typeof body === 'string') {\n this._bodyText = body;\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body;\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body;\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString();\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer); // IE 10-11 can't handle a DataView body.\n\n this._bodyInit = new Blob([this._bodyArrayBuffer]);\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body);\n } else {\n throw new Error('unsupported BodyInit type');\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8');\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type);\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');\n }\n }\n };\n\n if (support.blob) {\n this.blob = function () {\n var rejected = consumed(this);\n\n if (rejected) {\n return rejected;\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob);\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]));\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob');\n } else {\n return Promise.resolve(new Blob([this._bodyText]));\n }\n };\n\n this.arrayBuffer = function () {\n if (this._bodyArrayBuffer) {\n return consumed(this) || Promise.resolve(this._bodyArrayBuffer);\n } else {\n return this.blob().then(readBlobAsArrayBuffer);\n }\n };\n }\n\n this.text = function () {\n var rejected = consumed(this);\n\n if (rejected) {\n return rejected;\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob);\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer));\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text');\n } else {\n return Promise.resolve(this._bodyText);\n }\n };\n\n if (support.formData) {\n this.formData = function () {\n return this.text().then(decode);\n };\n }\n\n this.json = function () {\n return this.text().then(JSON.parse);\n };\n\n return this;\n } // HTTP methods whose capitalization should be normalized\n\n\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase();\n return methods.indexOf(upcased) > -1 ? upcased : method;\n }\n\n function Request(input, options) {\n options = options || {};\n var body = options.body;\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read');\n }\n\n this.url = input.url;\n this.credentials = input.credentials;\n\n if (!options.headers) {\n this.headers = new Headers(input.headers);\n }\n\n this.method = input.method;\n this.mode = input.mode;\n\n if (!body && input._bodyInit != null) {\n body = input._bodyInit;\n input.bodyUsed = true;\n }\n } else {\n this.url = String(input);\n }\n\n this.credentials = options.credentials || this.credentials || 'omit';\n\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers);\n }\n\n this.method = normalizeMethod(options.method || this.method || 'GET');\n this.mode = options.mode || this.mode || null;\n this.referrer = null;\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests');\n }\n\n this._initBody(body);\n }\n\n Request.prototype.clone = function () {\n return new Request(this, {\n body: this._bodyInit\n });\n };\n\n function decode(body) {\n var form = new FormData();\n body.trim().split('&').forEach(function (bytes) {\n if (bytes) {\n var split = bytes.split('=');\n var name = split.shift().replace(/\\+/g, ' ');\n var value = split.join('=').replace(/\\+/g, ' ');\n form.append(decodeURIComponent(name), decodeURIComponent(value));\n }\n });\n return form;\n }\n\n function parseHeaders(rawHeaders) {\n var headers = new Headers(); // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ');\n preProcessedHeaders.split(/\\r?\\n/).forEach(function (line) {\n var parts = line.split(':');\n var key = parts.shift().trim();\n\n if (key) {\n var value = parts.join(':').trim();\n headers.append(key, value);\n }\n });\n return headers;\n }\n\n Body.call(Request.prototype);\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {};\n }\n\n this.type = 'default';\n this.status = options.status === undefined ? 200 : options.status;\n this.ok = this.status >= 200 && this.status < 300;\n this.statusText = 'statusText' in options ? options.statusText : 'OK';\n this.headers = new Headers(options.headers);\n this.url = options.url || '';\n\n this._initBody(bodyInit);\n }\n\n Body.call(Response.prototype);\n\n Response.prototype.clone = function () {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n });\n };\n\n Response.error = function () {\n var response = new Response(null, {\n status: 0,\n statusText: ''\n });\n response.type = 'error';\n return response;\n };\n\n var redirectStatuses = [301, 302, 303, 307, 308];\n\n Response.redirect = function (url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code');\n }\n\n return new Response(null, {\n status: status,\n headers: {\n location: url\n }\n });\n };\n\n self.Headers = Headers;\n self.Request = Request;\n self.Response = Response;\n\n self.fetch = function (input, init) {\n return new Promise(function (resolve, reject) {\n var request = new Request(input, init);\n var xhr = new XMLHttpRequest();\n\n xhr.onload = function () {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n };\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n resolve(new Response(body, options));\n };\n\n xhr.onerror = function () {\n reject(new TypeError('Network request failed'));\n };\n\n xhr.ontimeout = function () {\n reject(new TypeError('Network request failed'));\n };\n\n xhr.open(request.method, request.url, true);\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true;\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false;\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob';\n }\n\n request.headers.forEach(function (value, name) {\n xhr.setRequestHeader(name, value);\n });\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);\n });\n };\n\n self.fetch.polyfill = true;\n})(typeof self !== 'undefined' ? self : this);","var global = require('../internals/global');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\nmodule.exports = function (key, value) {\n try {\n createNonEnumerableProperty(global, key, value);\n } catch (error) {\n global[key] = value;\n } return value;\n};\n"],"sourceRoot":""}