{"version":3,"file":"index.esm-B_knDhh3.js","names":["INFINITY","Symbol","nativeMax","FUNC_ERROR_TEXT","hasOwnProperty","debounce","escape","config","isFile","hasFiles","qs","page","cloneDeep2","isEqual2","get2","get3","set3","cloneDeep3","get4","Axios","debounce","mergeConfig","router2","cloneDeep2","router3","reactive2","router4","h2","defineComponent2","defineComponent3","config2","ref2","computed2","isEqual2","UseFormUtils2","h3","defineComponent4","escape","defineComponent5","ref3","computed3","h4","defineComponent6","ref4","computed4","isUrlMethodPair2","mergeDataIntoQueryString2","h5","defineComponent7","h6","coreConfig"],"sources":["../../../node_modules/lodash-es/isSymbol.js","../../../node_modules/lodash-es/_arrayMap.js","../../../node_modules/lodash-es/_baseToString.js","../../../node_modules/lodash-es/_trimmedEndIndex.js","../../../node_modules/lodash-es/_baseTrim.js","../../../node_modules/lodash-es/toNumber.js","../../../node_modules/lodash-es/identity.js","../../../node_modules/lodash-es/_apply.js","../../../node_modules/lodash-es/_shortOut.js","../../../node_modules/lodash-es/constant.js","../../../node_modules/lodash-es/_baseSetToString.js","../../../node_modules/lodash-es/_setToString.js","../../../node_modules/lodash-es/_overRest.js","../../../node_modules/lodash-es/_baseRest.js","../../../node_modules/lodash-es/_isIterateeCall.js","../../../node_modules/lodash-es/_createAssigner.js","../../../node_modules/lodash-es/_isKey.js","../../../node_modules/lodash-es/memoize.js","../../../node_modules/lodash-es/_memoizeCapped.js","../../../node_modules/lodash-es/_stringToPath.js","../../../node_modules/lodash-es/toString.js","../../../node_modules/lodash-es/_castPath.js","../../../node_modules/lodash-es/_toKey.js","../../../node_modules/lodash-es/_baseGet.js","../../../node_modules/lodash-es/get.js","../../../node_modules/lodash-es/isPlainObject.js","../../../node_modules/lodash-es/_basePropertyOf.js","../../../node_modules/lodash-es/_hasPath.js","../../../node_modules/lodash-es/_createBaseFor.js","../../../node_modules/lodash-es/_baseFor.js","../../../node_modules/lodash-es/now.js","../../../node_modules/lodash-es/debounce.js","../../../node_modules/lodash-es/_assignMergeValue.js","../../../node_modules/lodash-es/isArrayLikeObject.js","../../../node_modules/lodash-es/_safeGet.js","../../../node_modules/lodash-es/toPlainObject.js","../../../node_modules/lodash-es/_baseMergeDeep.js","../../../node_modules/lodash-es/_baseMerge.js","../../../node_modules/lodash-es/_escapeHtmlChar.js","../../../node_modules/lodash-es/escape.js","../../../node_modules/lodash-es/_baseHas.js","../../../node_modules/lodash-es/has.js","../../../node_modules/lodash-es/merge.js","../../../node_modules/lodash-es/_baseSet.js","../../../node_modules/lodash-es/set.js","../../../node_modules/es-errors/type.js","../../../__vite-browser-external","../../../node_modules/object-inspect/index.js","../../../node_modules/side-channel-list/index.js","../../../node_modules/es-object-atoms/index.js","../../../node_modules/es-errors/index.js","../../../node_modules/es-errors/eval.js","../../../node_modules/es-errors/range.js","../../../node_modules/es-errors/ref.js","../../../node_modules/es-errors/syntax.js","../../../node_modules/es-errors/uri.js","../../../node_modules/math-intrinsics/abs.js","../../../node_modules/math-intrinsics/floor.js","../../../node_modules/math-intrinsics/max.js","../../../node_modules/math-intrinsics/min.js","../../../node_modules/math-intrinsics/pow.js","../../../node_modules/math-intrinsics/round.js","../../../node_modules/math-intrinsics/isNaN.js","../../../node_modules/math-intrinsics/sign.js","../../../node_modules/gopd/gOPD.js","../../../node_modules/gopd/index.js","../../../node_modules/es-define-property/index.js","../../../node_modules/has-symbols/shams.js","../../../node_modules/has-symbols/index.js","../../../node_modules/get-proto/Reflect.getPrototypeOf.js","../../../node_modules/get-proto/Object.getPrototypeOf.js","../../../node_modules/function-bind/implementation.js","../../../node_modules/function-bind/index.js","../../../node_modules/call-bind-apply-helpers/functionCall.js","../../../node_modules/call-bind-apply-helpers/functionApply.js","../../../node_modules/call-bind-apply-helpers/reflectApply.js","../../../node_modules/call-bind-apply-helpers/actualApply.js","../../../node_modules/call-bind-apply-helpers/index.js","../../../node_modules/dunder-proto/get.js","../../../node_modules/get-proto/index.js","../../../node_modules/async-function/index.js","../../../node_modules/generator-function/index.js","../../../node_modules/async-generator-function/index.js","../../../node_modules/hasown/index.js","../../../node_modules/get-intrinsic/index.js","../../../node_modules/call-bound/index.js","../../../node_modules/side-channel-map/index.js","../../../node_modules/side-channel-weakmap/index.js","../../../node_modules/side-channel/index.js","../../../node_modules/qs/lib/formats.js","../../../node_modules/qs/lib/utils.js","../../../node_modules/qs/lib/stringify.js","../../../node_modules/qs/lib/parse.js","../../../node_modules/qs/lib/index.js","../../../node_modules/@inertiajs/core/dist/index.esm.js","../../../node_modules/laravel-precognition/dist/client.js","../../../node_modules/laravel-precognition/dist/validator.js","../../../node_modules/@inertiajs/vue3/dist/index.esm.js"],"sourcesContent":["import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\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 */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nexport default isSymbol;\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 */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nexport default arrayMap;\n","import Symbol from './_Symbol.js';\nimport arrayMap from './_arrayMap.js';\nimport isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nexport default baseToString;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nexport default trimmedEndIndex;\n","import trimmedEndIndex from './_trimmedEndIndex.js';\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nexport default baseTrim;\n","import baseTrim from './_baseTrim.js';\nimport isObject from './isObject.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nexport default toNumber;\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nexport default identity;\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 */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nexport default apply;\n","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nexport default shortOut;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nexport default constant;\n","import constant from './constant.js';\nimport defineProperty from './_defineProperty.js';\nimport identity from './identity.js';\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nexport default baseSetToString;\n","import baseSetToString from './_baseSetToString.js';\nimport shortOut from './_shortOut.js';\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nexport default setToString;\n","import apply from './_apply.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\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 * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\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 index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nexport default overRest;\n","import identity from './identity.js';\nimport overRest from './_overRest.js';\nimport setToString from './_setToString.js';\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 */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nexport default baseRest;\n","import eq from './eq.js';\nimport isArrayLike from './isArrayLike.js';\nimport isIndex from './_isIndex.js';\nimport isObject from './isObject.js';\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nexport default isIterateeCall;\n","import baseRest from './_baseRest.js';\nimport isIterateeCall from './_isIterateeCall.js';\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nexport default createAssigner;\n","import isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\nexport default isKey;\n","import MapCache from './_MapCache.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nexport default memoize;\n","import memoize from './memoize.js';\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nexport default memoizeCapped;\n","import memoizeCapped from './_memoizeCapped.js';\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nexport default stringToPath;\n","import baseToString from './_baseToString.js';\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nexport default toString;\n","import isArray from './isArray.js';\nimport isKey from './_isKey.js';\nimport stringToPath from './_stringToPath.js';\nimport toString from './toString.js';\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nexport default castPath;\n","import isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\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 */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nexport default toKey;\n","import castPath from './_castPath.js';\nimport toKey from './_toKey.js';\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\n\nexport default baseGet;\n","import baseGet from './_baseGet.js';\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nexport default get;\n","import baseGetTag from './_baseGetTag.js';\nimport getPrototype from './_getPrototype.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(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 */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nexport default isPlainObject;\n","/**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n}\n\nexport default basePropertyOf;\n","import castPath from './_castPath.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isIndex from './_isIndex.js';\nimport isLength from './isLength.js';\nimport toKey from './_toKey.js';\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n}\n\nexport default hasPath;\n","/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nexport default createBaseFor;\n","import createBaseFor from './_createBaseFor.js';\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nexport default baseFor;\n","import root from './_root.js';\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nexport default now;\n","import isObject from './isObject.js';\nimport now from './now.js';\nimport toNumber from './toNumber.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nexport default debounce;\n","import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignMergeValue;\n","import isArrayLike from './isArrayLike.js';\nimport isObjectLike from './isObjectLike.js';\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 */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nexport default isArrayLikeObject;\n","/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\nexport default safeGet;\n","import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\nexport default toPlainObject;\n","import assignMergeValue from './_assignMergeValue.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\nimport copyArray from './_copyArray.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isArrayLikeObject from './isArrayLikeObject.js';\nimport isBuffer from './isBuffer.js';\nimport isFunction from './isFunction.js';\nimport isObject from './isObject.js';\nimport isPlainObject from './isPlainObject.js';\nimport isTypedArray from './isTypedArray.js';\nimport safeGet from './_safeGet.js';\nimport toPlainObject from './toPlainObject.js';\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\nexport default baseMergeDeep;\n","import Stack from './_Stack.js';\nimport assignMergeValue from './_assignMergeValue.js';\nimport baseFor from './_baseFor.js';\nimport baseMergeDeep from './_baseMergeDeep.js';\nimport isObject from './isObject.js';\nimport keysIn from './keysIn.js';\nimport safeGet from './_safeGet.js';\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\nexport default baseMerge;\n","import basePropertyOf from './_basePropertyOf.js';\n\n/** Used to map characters to HTML entities. */\nvar htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\n\n/**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\nvar escapeHtmlChar = basePropertyOf(htmlEscapes);\n\nexport default escapeHtmlChar;\n","import escapeHtmlChar from './_escapeHtmlChar.js';\nimport toString from './toString.js';\n\n/** Used to match HTML entities and HTML characters. */\nvar reUnescapedHtml = /[&<>\"']/g,\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n/**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value. See\n * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * When working with HTML you should always\n * [quote attribute values](http://wonko.com/post/html-escaping) to reduce\n * XSS vectors.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\nfunction escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n}\n\nexport default escape;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n}\n\nexport default baseHas;\n","import baseHas from './_baseHas.js';\nimport hasPath from './_hasPath.js';\n\n/**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\nfunction has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n}\n\nexport default has;\n","import baseMerge from './_baseMerge.js';\nimport createAssigner from './_createAssigner.js';\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n});\n\nexport default merge;\n","import assignValue from './_assignValue.js';\nimport castPath from './_castPath.js';\nimport isIndex from './_isIndex.js';\nimport isObject from './isObject.js';\nimport toKey from './_toKey.js';\n\n/**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\nfunction baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n}\n\nexport default baseSet;\n","import baseSet from './_baseSet.js';\n\n/**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\nfunction set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n}\n\nexport default set;\n","'use strict';\n\n/** @type {import('./type')} */\nmodule.exports = TypeError;\n","module.exports = {}","var hasMap = typeof Map === 'function' && Map.prototype;\nvar mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;\nvar mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;\nvar mapForEach = hasMap && Map.prototype.forEach;\nvar hasSet = typeof Set === 'function' && Set.prototype;\nvar setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;\nvar setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;\nvar setForEach = hasSet && Set.prototype.forEach;\nvar hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;\nvar weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;\nvar hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;\nvar weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;\nvar hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;\nvar weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;\nvar booleanValueOf = Boolean.prototype.valueOf;\nvar objectToString = Object.prototype.toString;\nvar functionToString = Function.prototype.toString;\nvar $match = String.prototype.match;\nvar $slice = String.prototype.slice;\nvar $replace = String.prototype.replace;\nvar $toUpperCase = String.prototype.toUpperCase;\nvar $toLowerCase = String.prototype.toLowerCase;\nvar $test = RegExp.prototype.test;\nvar $concat = Array.prototype.concat;\nvar $join = Array.prototype.join;\nvar $arrSlice = Array.prototype.slice;\nvar $floor = Math.floor;\nvar bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;\nvar gOPS = Object.getOwnPropertySymbols;\nvar symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;\nvar hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';\n// ie, `has-tostringtag/shams\nvar toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')\n ? Symbol.toStringTag\n : null;\nvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\nvar gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (\n [].__proto__ === Array.prototype // eslint-disable-line no-proto\n ? function (O) {\n return O.__proto__; // eslint-disable-line no-proto\n }\n : null\n);\n\nfunction addNumericSeparator(num, str) {\n if (\n num === Infinity\n || num === -Infinity\n || num !== num\n || (num && num > -1000 && num < 1000)\n || $test.call(/e/, str)\n ) {\n return str;\n }\n var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;\n if (typeof num === 'number') {\n var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)\n if (int !== num) {\n var intStr = String(int);\n var dec = $slice.call(str, intStr.length + 1);\n return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');\n }\n }\n return $replace.call(str, sepRegex, '$&_');\n}\n\nvar utilInspect = require('./util.inspect');\nvar inspectCustom = utilInspect.custom;\nvar inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;\n\nvar quotes = {\n __proto__: null,\n 'double': '\"',\n single: \"'\"\n};\nvar quoteREs = {\n __proto__: null,\n 'double': /([\"\\\\])/g,\n single: /(['\\\\])/g\n};\n\nmodule.exports = function inspect_(obj, options, depth, seen) {\n var opts = options || {};\n\n if (has(opts, 'quoteStyle') && !has(quotes, opts.quoteStyle)) {\n throw new TypeError('option \"quoteStyle\" must be \"single\" or \"double\"');\n }\n if (\n has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'\n ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity\n : opts.maxStringLength !== null\n )\n ) {\n throw new TypeError('option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`');\n }\n var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;\n if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {\n throw new TypeError('option \"customInspect\", if provided, must be `true`, `false`, or `\\'symbol\\'`');\n }\n\n if (\n has(opts, 'indent')\n && opts.indent !== null\n && opts.indent !== '\\t'\n && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)\n ) {\n throw new TypeError('option \"indent\" must be \"\\\\t\", an integer > 0, or `null`');\n }\n if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {\n throw new TypeError('option \"numericSeparator\", if provided, must be `true` or `false`');\n }\n var numericSeparator = opts.numericSeparator;\n\n if (typeof obj === 'undefined') {\n return 'undefined';\n }\n if (obj === null) {\n return 'null';\n }\n if (typeof obj === 'boolean') {\n return obj ? 'true' : 'false';\n }\n\n if (typeof obj === 'string') {\n return inspectString(obj, opts);\n }\n if (typeof obj === 'number') {\n if (obj === 0) {\n return Infinity / obj > 0 ? '0' : '-0';\n }\n var str = String(obj);\n return numericSeparator ? addNumericSeparator(obj, str) : str;\n }\n if (typeof obj === 'bigint') {\n var bigIntStr = String(obj) + 'n';\n return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;\n }\n\n var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;\n if (typeof depth === 'undefined') { depth = 0; }\n if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {\n return isArray(obj) ? '[Array]' : '[Object]';\n }\n\n var indent = getIndent(opts, depth);\n\n if (typeof seen === 'undefined') {\n seen = [];\n } else if (indexOf(seen, obj) >= 0) {\n return '[Circular]';\n }\n\n function inspect(value, from, noIndent) {\n if (from) {\n seen = $arrSlice.call(seen);\n seen.push(from);\n }\n if (noIndent) {\n var newOpts = {\n depth: opts.depth\n };\n if (has(opts, 'quoteStyle')) {\n newOpts.quoteStyle = opts.quoteStyle;\n }\n return inspect_(value, newOpts, depth + 1, seen);\n }\n return inspect_(value, opts, depth + 1, seen);\n }\n\n if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable\n var name = nameOf(obj);\n var keys = arrObjKeys(obj, inspect);\n return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');\n }\n if (isSymbol(obj)) {\n var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\\(.*\\))_[^)]*$/, '$1') : symToString.call(obj);\n return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;\n }\n if (isElement(obj)) {\n var s = '<' + $toLowerCase.call(String(obj.nodeName));\n var attrs = obj.attributes || [];\n for (var i = 0; i < attrs.length; i++) {\n s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);\n }\n s += '>';\n if (obj.childNodes && obj.childNodes.length) { s += '...'; }\n s += '';\n return s;\n }\n if (isArray(obj)) {\n if (obj.length === 0) { return '[]'; }\n var xs = arrObjKeys(obj, inspect);\n if (indent && !singleLineValues(xs)) {\n return '[' + indentedJoin(xs, indent) + ']';\n }\n return '[ ' + $join.call(xs, ', ') + ' ]';\n }\n if (isError(obj)) {\n var parts = arrObjKeys(obj, inspect);\n if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {\n return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';\n }\n if (parts.length === 0) { return '[' + String(obj) + ']'; }\n return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';\n }\n if (typeof obj === 'object' && customInspect) {\n if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {\n return utilInspect(obj, { depth: maxDepth - depth });\n } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {\n return obj.inspect();\n }\n }\n if (isMap(obj)) {\n var mapParts = [];\n if (mapForEach) {\n mapForEach.call(obj, function (value, key) {\n mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));\n });\n }\n return collectionOf('Map', mapSize.call(obj), mapParts, indent);\n }\n if (isSet(obj)) {\n var setParts = [];\n if (setForEach) {\n setForEach.call(obj, function (value) {\n setParts.push(inspect(value, obj));\n });\n }\n return collectionOf('Set', setSize.call(obj), setParts, indent);\n }\n if (isWeakMap(obj)) {\n return weakCollectionOf('WeakMap');\n }\n if (isWeakSet(obj)) {\n return weakCollectionOf('WeakSet');\n }\n if (isWeakRef(obj)) {\n return weakCollectionOf('WeakRef');\n }\n if (isNumber(obj)) {\n return markBoxed(inspect(Number(obj)));\n }\n if (isBigInt(obj)) {\n return markBoxed(inspect(bigIntValueOf.call(obj)));\n }\n if (isBoolean(obj)) {\n return markBoxed(booleanValueOf.call(obj));\n }\n if (isString(obj)) {\n return markBoxed(inspect(String(obj)));\n }\n // note: in IE 8, sometimes `global !== window` but both are the prototypes of each other\n /* eslint-env browser */\n if (typeof window !== 'undefined' && obj === window) {\n return '{ [object Window] }';\n }\n if (\n (typeof globalThis !== 'undefined' && obj === globalThis)\n || (typeof global !== 'undefined' && obj === global)\n ) {\n return '{ [object globalThis] }';\n }\n if (!isDate(obj) && !isRegExp(obj)) {\n var ys = arrObjKeys(obj, inspect);\n var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;\n var protoTag = obj instanceof Object ? '' : 'null prototype';\n var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';\n var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';\n var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');\n if (ys.length === 0) { return tag + '{}'; }\n if (indent) {\n return tag + '{' + indentedJoin(ys, indent) + '}';\n }\n return tag + '{ ' + $join.call(ys, ', ') + ' }';\n }\n return String(obj);\n};\n\nfunction wrapQuotes(s, defaultStyle, opts) {\n var style = opts.quoteStyle || defaultStyle;\n var quoteChar = quotes[style];\n return quoteChar + s + quoteChar;\n}\n\nfunction quote(s) {\n return $replace.call(String(s), /\"/g, '"');\n}\n\nfunction canTrustToString(obj) {\n return !toStringTag || !(typeof obj === 'object' && (toStringTag in obj || typeof obj[toStringTag] !== 'undefined'));\n}\nfunction isArray(obj) { return toStr(obj) === '[object Array]' && canTrustToString(obj); }\nfunction isDate(obj) { return toStr(obj) === '[object Date]' && canTrustToString(obj); }\nfunction isRegExp(obj) { return toStr(obj) === '[object RegExp]' && canTrustToString(obj); }\nfunction isError(obj) { return toStr(obj) === '[object Error]' && canTrustToString(obj); }\nfunction isString(obj) { return toStr(obj) === '[object String]' && canTrustToString(obj); }\nfunction isNumber(obj) { return toStr(obj) === '[object Number]' && canTrustToString(obj); }\nfunction isBoolean(obj) { return toStr(obj) === '[object Boolean]' && canTrustToString(obj); }\n\n// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives\nfunction isSymbol(obj) {\n if (hasShammedSymbols) {\n return obj && typeof obj === 'object' && obj instanceof Symbol;\n }\n if (typeof obj === 'symbol') {\n return true;\n }\n if (!obj || typeof obj !== 'object' || !symToString) {\n return false;\n }\n try {\n symToString.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isBigInt(obj) {\n if (!obj || typeof obj !== 'object' || !bigIntValueOf) {\n return false;\n }\n try {\n bigIntValueOf.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nvar hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };\nfunction has(obj, key) {\n return hasOwn.call(obj, key);\n}\n\nfunction toStr(obj) {\n return objectToString.call(obj);\n}\n\nfunction nameOf(f) {\n if (f.name) { return f.name; }\n var m = $match.call(functionToString.call(f), /^function\\s*([\\w$]+)/);\n if (m) { return m[1]; }\n return null;\n}\n\nfunction indexOf(xs, x) {\n if (xs.indexOf) { return xs.indexOf(x); }\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) { return i; }\n }\n return -1;\n}\n\nfunction isMap(x) {\n if (!mapSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n mapSize.call(x);\n try {\n setSize.call(x);\n } catch (s) {\n return true;\n }\n return x instanceof Map; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakMap(x) {\n if (!weakMapHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakMapHas.call(x, weakMapHas);\n try {\n weakSetHas.call(x, weakSetHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakMap; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakRef(x) {\n if (!weakRefDeref || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakRefDeref.call(x);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isSet(x) {\n if (!setSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n setSize.call(x);\n try {\n mapSize.call(x);\n } catch (m) {\n return true;\n }\n return x instanceof Set; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakSet(x) {\n if (!weakSetHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakSetHas.call(x, weakSetHas);\n try {\n weakMapHas.call(x, weakMapHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakSet; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isElement(x) {\n if (!x || typeof x !== 'object') { return false; }\n if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {\n return true;\n }\n return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';\n}\n\nfunction inspectString(str, opts) {\n if (str.length > opts.maxStringLength) {\n var remaining = str.length - opts.maxStringLength;\n var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');\n return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;\n }\n var quoteRE = quoteREs[opts.quoteStyle || 'single'];\n quoteRE.lastIndex = 0;\n // eslint-disable-next-line no-control-regex\n var s = $replace.call($replace.call(str, quoteRE, '\\\\$1'), /[\\x00-\\x1f]/g, lowbyte);\n return wrapQuotes(s, 'single', opts);\n}\n\nfunction lowbyte(c) {\n var n = c.charCodeAt(0);\n var x = {\n 8: 'b',\n 9: 't',\n 10: 'n',\n 12: 'f',\n 13: 'r'\n }[n];\n if (x) { return '\\\\' + x; }\n return '\\\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));\n}\n\nfunction markBoxed(str) {\n return 'Object(' + str + ')';\n}\n\nfunction weakCollectionOf(type) {\n return type + ' { ? }';\n}\n\nfunction collectionOf(type, size, entries, indent) {\n var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');\n return type + ' (' + size + ') {' + joinedEntries + '}';\n}\n\nfunction singleLineValues(xs) {\n for (var i = 0; i < xs.length; i++) {\n if (indexOf(xs[i], '\\n') >= 0) {\n return false;\n }\n }\n return true;\n}\n\nfunction getIndent(opts, depth) {\n var baseIndent;\n if (opts.indent === '\\t') {\n baseIndent = '\\t';\n } else if (typeof opts.indent === 'number' && opts.indent > 0) {\n baseIndent = $join.call(Array(opts.indent + 1), ' ');\n } else {\n return null;\n }\n return {\n base: baseIndent,\n prev: $join.call(Array(depth + 1), baseIndent)\n };\n}\n\nfunction indentedJoin(xs, indent) {\n if (xs.length === 0) { return ''; }\n var lineJoiner = '\\n' + indent.prev + indent.base;\n return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\\n' + indent.prev;\n}\n\nfunction arrObjKeys(obj, inspect) {\n var isArr = isArray(obj);\n var xs = [];\n if (isArr) {\n xs.length = obj.length;\n for (var i = 0; i < obj.length; i++) {\n xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';\n }\n }\n var syms = typeof gOPS === 'function' ? gOPS(obj) : [];\n var symMap;\n if (hasShammedSymbols) {\n symMap = {};\n for (var k = 0; k < syms.length; k++) {\n symMap['$' + syms[k]] = syms[k];\n }\n }\n\n for (var key in obj) { // eslint-disable-line no-restricted-syntax\n if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {\n // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section\n continue; // eslint-disable-line no-restricted-syntax, no-continue\n } else if ($test.call(/[^\\w$]/, key)) {\n xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));\n } else {\n xs.push(key + ': ' + inspect(obj[key], obj));\n }\n }\n if (typeof gOPS === 'function') {\n for (var j = 0; j < syms.length; j++) {\n if (isEnumerable.call(obj, syms[j])) {\n xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));\n }\n }\n }\n return xs;\n}\n","'use strict';\n\nvar inspect = require('object-inspect');\n\nvar $TypeError = require('es-errors/type');\n\n/*\n* This function traverses the list returning the node corresponding to the given key.\n*\n* That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list.\n* By doing so, all the recently used nodes can be accessed relatively quickly.\n*/\n/** @type {import('./list.d.ts').listGetNode} */\n// eslint-disable-next-line consistent-return\nvar listGetNode = function (list, key, isDelete) {\n\t/** @type {typeof list | NonNullable<(typeof list)['next']>} */\n\tvar prev = list;\n\t/** @type {(typeof list)['next']} */\n\tvar curr;\n\t// eslint-disable-next-line eqeqeq\n\tfor (; (curr = prev.next) != null; prev = curr) {\n\t\tif (curr.key === key) {\n\t\t\tprev.next = curr.next;\n\t\t\tif (!isDelete) {\n\t\t\t\t// eslint-disable-next-line no-extra-parens\n\t\t\t\tcurr.next = /** @type {NonNullable} */ (list.next);\n\t\t\t\tlist.next = curr; // eslint-disable-line no-param-reassign\n\t\t\t}\n\t\t\treturn curr;\n\t\t}\n\t}\n};\n\n/** @type {import('./list.d.ts').listGet} */\nvar listGet = function (objects, key) {\n\tif (!objects) {\n\t\treturn void undefined;\n\t}\n\tvar node = listGetNode(objects, key);\n\treturn node && node.value;\n};\n/** @type {import('./list.d.ts').listSet} */\nvar listSet = function (objects, key, value) {\n\tvar node = listGetNode(objects, key);\n\tif (node) {\n\t\tnode.value = value;\n\t} else {\n\t\t// Prepend the new node to the beginning of the list\n\t\tobjects.next = /** @type {import('./list.d.ts').ListNode} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens\n\t\t\tkey: key,\n\t\t\tnext: objects.next,\n\t\t\tvalue: value\n\t\t});\n\t}\n};\n/** @type {import('./list.d.ts').listHas} */\nvar listHas = function (objects, key) {\n\tif (!objects) {\n\t\treturn false;\n\t}\n\treturn !!listGetNode(objects, key);\n};\n/** @type {import('./list.d.ts').listDelete} */\n// eslint-disable-next-line consistent-return\nvar listDelete = function (objects, key) {\n\tif (objects) {\n\t\treturn listGetNode(objects, key, true);\n\t}\n};\n\n/** @type {import('.')} */\nmodule.exports = function getSideChannelList() {\n\t/** @typedef {ReturnType} Channel */\n\t/** @typedef {Parameters[0]} K */\n\t/** @typedef {Parameters[1]} V */\n\n\t/** @type {import('./list.d.ts').RootNode | undefined} */ var $o;\n\n\t/** @type {Channel} */\n\tvar channel = {\n\t\tassert: function (key) {\n\t\t\tif (!channel.has(key)) {\n\t\t\t\tthrow new $TypeError('Side channel does not contain ' + inspect(key));\n\t\t\t}\n\t\t},\n\t\t'delete': function (key) {\n\t\t\tvar deletedNode = listDelete($o, key);\n\t\t\tif (deletedNode && $o && !$o.next) {\n\t\t\t\t$o = void undefined;\n\t\t\t}\n\t\t\treturn !!deletedNode;\n\t\t},\n\t\tget: function (key) {\n\t\t\treturn listGet($o, key);\n\t\t},\n\t\thas: function (key) {\n\t\t\treturn listHas($o, key);\n\t\t},\n\t\tset: function (key, value) {\n\t\t\tif (!$o) {\n\t\t\t\t// Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head\n\t\t\t\t$o = {\n\t\t\t\t\tnext: void undefined\n\t\t\t\t};\n\t\t\t}\n\t\t\t// eslint-disable-next-line no-extra-parens\n\t\t\tlistSet(/** @type {NonNullable} */ ($o), key, value);\n\t\t}\n\t};\n\treturn channel;\n};\n","'use strict';\n\n/** @type {import('.')} */\nmodule.exports = Object;\n","'use strict';\n\n/** @type {import('.')} */\nmodule.exports = Error;\n","'use strict';\n\n/** @type {import('./eval')} */\nmodule.exports = EvalError;\n","'use strict';\n\n/** @type {import('./range')} */\nmodule.exports = RangeError;\n","'use strict';\n\n/** @type {import('./ref')} */\nmodule.exports = ReferenceError;\n","'use strict';\n\n/** @type {import('./syntax')} */\nmodule.exports = SyntaxError;\n","'use strict';\n\n/** @type {import('./uri')} */\nmodule.exports = URIError;\n","'use strict';\n\n/** @type {import('./abs')} */\nmodule.exports = Math.abs;\n","'use strict';\n\n/** @type {import('./floor')} */\nmodule.exports = Math.floor;\n","'use strict';\n\n/** @type {import('./max')} */\nmodule.exports = Math.max;\n","'use strict';\n\n/** @type {import('./min')} */\nmodule.exports = Math.min;\n","'use strict';\n\n/** @type {import('./pow')} */\nmodule.exports = Math.pow;\n","'use strict';\n\n/** @type {import('./round')} */\nmodule.exports = Math.round;\n","'use strict';\n\n/** @type {import('./isNaN')} */\nmodule.exports = Number.isNaN || function isNaN(a) {\n\treturn a !== a;\n};\n","'use strict';\n\nvar $isNaN = require('./isNaN');\n\n/** @type {import('./sign')} */\nmodule.exports = function sign(number) {\n\tif ($isNaN(number) || number === 0) {\n\t\treturn number;\n\t}\n\treturn number < 0 ? -1 : +1;\n};\n","'use strict';\n\n/** @type {import('./gOPD')} */\nmodule.exports = Object.getOwnPropertyDescriptor;\n","'use strict';\n\n/** @type {import('.')} */\nvar $gOPD = require('./gOPD');\n\nif ($gOPD) {\n\ttry {\n\t\t$gOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\t$gOPD = null;\n\t}\n}\n\nmodule.exports = $gOPD;\n","'use strict';\n\n/** @type {import('.')} */\nvar $defineProperty = Object.defineProperty || false;\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = false;\n\t}\n}\n\nmodule.exports = $defineProperty;\n","'use strict';\n\n/** @type {import('./shams')} */\n/* eslint complexity: [2, 18], max-statements: [2, 33] */\nmodule.exports = function hasSymbols() {\n\tif (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }\n\tif (typeof Symbol.iterator === 'symbol') { return true; }\n\n\t/** @type {{ [k in symbol]?: unknown }} */\n\tvar obj = {};\n\tvar sym = Symbol('test');\n\tvar symObj = Object(sym);\n\tif (typeof sym === 'string') { return false; }\n\n\tif (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }\n\tif (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }\n\n\t// temp disabled per https://github.com/ljharb/object.assign/issues/17\n\t// if (sym instanceof Symbol) { return false; }\n\t// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n\t// if (!(symObj instanceof Symbol)) { return false; }\n\n\t// if (typeof Symbol.prototype.toString !== 'function') { return false; }\n\t// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n\n\tvar symVal = 42;\n\tobj[sym] = symVal;\n\tfor (var _ in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n\tif (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }\n\n\tif (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }\n\n\tvar syms = Object.getOwnPropertySymbols(obj);\n\tif (syms.length !== 1 || syms[0] !== sym) { return false; }\n\n\tif (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }\n\n\tif (typeof Object.getOwnPropertyDescriptor === 'function') {\n\t\t// eslint-disable-next-line no-extra-parens\n\t\tvar descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(obj, sym));\n\t\tif (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }\n\t}\n\n\treturn true;\n};\n","'use strict';\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = require('./shams');\n\n/** @type {import('.')} */\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n","'use strict';\n\n/** @type {import('./Reflect.getPrototypeOf')} */\nmodule.exports = (typeof Reflect !== 'undefined' && Reflect.getPrototypeOf) || null;\n","'use strict';\n\nvar $Object = require('es-object-atoms');\n\n/** @type {import('./Object.getPrototypeOf')} */\nmodule.exports = $Object.getPrototypeOf || null;\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar toStr = Object.prototype.toString;\nvar max = Math.max;\nvar funcType = '[object Function]';\n\nvar concatty = function concatty(a, b) {\n var arr = [];\n\n for (var i = 0; i < a.length; i += 1) {\n arr[i] = a[i];\n }\n for (var j = 0; j < b.length; j += 1) {\n arr[j + a.length] = b[j];\n }\n\n return arr;\n};\n\nvar slicy = function slicy(arrLike, offset) {\n var arr = [];\n for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {\n arr[j] = arrLike[i];\n }\n return arr;\n};\n\nvar joiny = function (arr, joiner) {\n var str = '';\n for (var i = 0; i < arr.length; i += 1) {\n str += arr[i];\n if (i + 1 < arr.length) {\n str += joiner;\n }\n }\n return str;\n};\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.apply(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slicy(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n concatty(args, arguments)\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n }\n return target.apply(\n that,\n concatty(args, arguments)\n );\n\n };\n\n var boundLength = max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs[i] = '$' + i;\n }\n\n bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n","'use strict';\n\n/** @type {import('./functionCall')} */\nmodule.exports = Function.prototype.call;\n","'use strict';\n\n/** @type {import('./functionApply')} */\nmodule.exports = Function.prototype.apply;\n","'use strict';\n\n/** @type {import('./reflectApply')} */\nmodule.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply;\n","'use strict';\n\nvar bind = require('function-bind');\n\nvar $apply = require('./functionApply');\nvar $call = require('./functionCall');\nvar $reflectApply = require('./reflectApply');\n\n/** @type {import('./actualApply')} */\nmodule.exports = $reflectApply || bind.call($call, $apply);\n","'use strict';\n\nvar bind = require('function-bind');\nvar $TypeError = require('es-errors/type');\n\nvar $call = require('./functionCall');\nvar $actualApply = require('./actualApply');\n\n/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */\nmodule.exports = function callBindBasic(args) {\n\tif (args.length < 1 || typeof args[0] !== 'function') {\n\t\tthrow new $TypeError('a function is required');\n\t}\n\treturn $actualApply(bind, $call, args);\n};\n","'use strict';\n\nvar callBind = require('call-bind-apply-helpers');\nvar gOPD = require('gopd');\n\nvar hasProtoAccessor;\ntry {\n\t// eslint-disable-next-line no-extra-parens, no-proto\n\thasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype;\n} catch (e) {\n\tif (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') {\n\t\tthrow e;\n\t}\n}\n\n// eslint-disable-next-line no-extra-parens\nvar desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__'));\n\nvar $Object = Object;\nvar $getPrototypeOf = $Object.getPrototypeOf;\n\n/** @type {import('./get')} */\nmodule.exports = desc && typeof desc.get === 'function'\n\t? callBind([desc.get])\n\t: typeof $getPrototypeOf === 'function'\n\t\t? /** @type {import('./get')} */ function getDunder(value) {\n\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\treturn $getPrototypeOf(value == null ? value : $Object(value));\n\t\t}\n\t\t: false;\n","'use strict';\n\nvar reflectGetProto = require('./Reflect.getPrototypeOf');\nvar originalGetProto = require('./Object.getPrototypeOf');\n\nvar getDunderProto = require('dunder-proto/get');\n\n/** @type {import('.')} */\nmodule.exports = reflectGetProto\n\t? function getProto(O) {\n\t\t// @ts-expect-error TS can't narrow inside a closure, for some reason\n\t\treturn reflectGetProto(O);\n\t}\n\t: originalGetProto\n\t\t? function getProto(O) {\n\t\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\t\tthrow new TypeError('getProto: not an object');\n\t\t\t}\n\t\t\t// @ts-expect-error TS can't narrow inside a closure, for some reason\n\t\t\treturn originalGetProto(O);\n\t\t}\n\t\t: getDunderProto\n\t\t\t? function getProto(O) {\n\t\t\t\t// @ts-expect-error TS can't narrow inside a closure, for some reason\n\t\t\t\treturn getDunderProto(O);\n\t\t\t}\n\t\t\t: null;\n","'use strict';\n\n// eslint-disable-next-line no-extra-parens, no-empty-function\nconst cached = /** @type {import('.').AsyncFunctionConstructor} */ (async function () {}.constructor);\n\n/** @type {import('.')} */\nmodule.exports = () => cached;\n\n","'use strict';\n\n// eslint-disable-next-line no-extra-parens, no-empty-function\nconst cached = /** @type {GeneratorFunctionConstructor} */ (function* () {}.constructor);\n\n/** @type {import('.')} */\nmodule.exports = () => cached;\n\n","'use strict';\n\n// eslint-disable-next-line no-extra-parens, no-empty-function\nconst cached = /** @type {import('.').AsyncGeneratorFunctionConstructor} */ (async function* () {}.constructor);\n\n/** @type {import('.')} */\nmodule.exports = () => cached;\n\n","'use strict';\n\nvar call = Function.prototype.call;\nvar $hasOwn = Object.prototype.hasOwnProperty;\nvar bind = require('function-bind');\n\n/** @type {import('.')} */\nmodule.exports = bind.call(call, $hasOwn);\n","'use strict';\n\nvar undefined;\n\nvar $Object = require('es-object-atoms');\n\nvar $Error = require('es-errors');\nvar $EvalError = require('es-errors/eval');\nvar $RangeError = require('es-errors/range');\nvar $ReferenceError = require('es-errors/ref');\nvar $SyntaxError = require('es-errors/syntax');\nvar $TypeError = require('es-errors/type');\nvar $URIError = require('es-errors/uri');\n\nvar abs = require('math-intrinsics/abs');\nvar floor = require('math-intrinsics/floor');\nvar max = require('math-intrinsics/max');\nvar min = require('math-intrinsics/min');\nvar pow = require('math-intrinsics/pow');\nvar round = require('math-intrinsics/round');\nvar sign = require('math-intrinsics/sign');\n\nvar $gOPD = require('gopd');\nvar $defineProperty = require('es-define-property');\n\nvar throwTypeError = function () {\n\tthrow new $TypeError();\n};\nvar ThrowTypeError = $gOPD\n\t? (function () {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n\t\t\targuments.callee; // IE 8 does not throw here\n\t\t\treturn throwTypeError;\n\t\t} catch (calleeThrows) {\n\t\t\ttry {\n\t\t\t\t// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n\t\t\t\treturn $gOPD(arguments, 'callee').get;\n\t\t\t} catch (gOPDthrows) {\n\t\t\t\treturn throwTypeError;\n\t\t\t}\n\t\t}\n\t}())\n\t: throwTypeError;\n\nvar hasSymbols = require('has-symbols')();\n\nvar getProto = require('get-proto');\nvar $ObjectGPO = require('get-proto/Object.getPrototypeOf');\nvar $ReflectGPO = require('get-proto/Reflect.getPrototypeOf');\n\nvar $apply = require('call-bind-apply-helpers/functionApply');\nvar $call = require('call-bind-apply-helpers/functionCall');\n\nvar needsEval = {};\n\nvar TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t__proto__: null,\n\t'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,\n\t'%Array%': Array,\n\t'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,\n\t'%AsyncFromSyncIteratorPrototype%': undefined,\n\t'%AsyncFunction%': needsEval,\n\t'%AsyncGenerator%': needsEval,\n\t'%AsyncGeneratorFunction%': needsEval,\n\t'%AsyncIteratorPrototype%': needsEval,\n\t'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,\n\t'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,\n\t'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,\n\t'%Boolean%': Boolean,\n\t'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'%Date%': Date,\n\t'%decodeURI%': decodeURI,\n\t'%decodeURIComponent%': decodeURIComponent,\n\t'%encodeURI%': encodeURI,\n\t'%encodeURIComponent%': encodeURIComponent,\n\t'%Error%': $Error,\n\t'%eval%': eval, // eslint-disable-line no-eval\n\t'%EvalError%': $EvalError,\n\t'%Float16Array%': typeof Float16Array === 'undefined' ? undefined : Float16Array,\n\t'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,\n\t'%Function%': Function,\n\t'%GeneratorFunction%': needsEval,\n\t'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'%isFinite%': isFinite,\n\t'%isNaN%': isNaN,\n\t'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'%JSON%': typeof JSON === 'object' ? JSON : undefined,\n\t'%Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'%Math%': Math,\n\t'%Number%': Number,\n\t'%Object%': $Object,\n\t'%Object.getOwnPropertyDescriptor%': $gOPD,\n\t'%parseFloat%': parseFloat,\n\t'%parseInt%': parseInt,\n\t'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'%RangeError%': $RangeError,\n\t'%ReferenceError%': $ReferenceError,\n\t'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'%RegExp%': RegExp,\n\t'%Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'%String%': String,\n\t'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,\n\t'%Symbol%': hasSymbols ? Symbol : undefined,\n\t'%SyntaxError%': $SyntaxError,\n\t'%ThrowTypeError%': ThrowTypeError,\n\t'%TypedArray%': TypedArray,\n\t'%TypeError%': $TypeError,\n\t'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'%URIError%': $URIError,\n\t'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,\n\t'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet,\n\n\t'%Function.prototype.call%': $call,\n\t'%Function.prototype.apply%': $apply,\n\t'%Object.defineProperty%': $defineProperty,\n\t'%Object.getPrototypeOf%': $ObjectGPO,\n\t'%Math.abs%': abs,\n\t'%Math.floor%': floor,\n\t'%Math.max%': max,\n\t'%Math.min%': min,\n\t'%Math.pow%': pow,\n\t'%Math.round%': round,\n\t'%Math.sign%': sign,\n\t'%Reflect.getPrototypeOf%': $ReflectGPO\n};\n\nif (getProto) {\n\ttry {\n\t\tnull.error; // eslint-disable-line no-unused-expressions\n\t} catch (e) {\n\t\t// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229\n\t\tvar errorProto = getProto(getProto(e));\n\t\tINTRINSICS['%Error.prototype%'] = errorProto;\n\t}\n}\n\nvar getAsyncFunction = require('async-function');\nvar getGeneratorFunction = require('generator-function');\nvar getAsyncGeneratorFunction = require('async-generator-function');\n\nvar doEval = function doEval(name) {\n\tvar value;\n\tif (name === '%AsyncFunction%') {\n\t\tvalue = getAsyncFunction() || void undefined;\n\t} else if (name === '%GeneratorFunction%') {\n\t\tvalue = getGeneratorFunction() || void undefined;\n\t} else if (name === '%AsyncGeneratorFunction%') {\n\t\tvalue = getAsyncGeneratorFunction() || void undefined;\n\t} else if (name === '%AsyncGenerator%') {\n\t\tvar fn = doEval('%AsyncGeneratorFunction%');\n\t\tif (fn) {\n\t\t\tvalue = fn.prototype;\n\t\t}\n\t} else if (name === '%AsyncIteratorPrototype%') {\n\t\tvar gen = doEval('%AsyncGenerator%');\n\t\tif (gen && getProto) {\n\t\t\tvalue = getProto(gen.prototype);\n\t\t}\n\t}\n\n\tINTRINSICS[name] = value;\n\n\treturn value;\n};\n\nvar LEGACY_ALIASES = {\n\t__proto__: null,\n\t'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],\n\t'%ArrayPrototype%': ['Array', 'prototype'],\n\t'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],\n\t'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],\n\t'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],\n\t'%ArrayProto_values%': ['Array', 'prototype', 'values'],\n\t'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],\n\t'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],\n\t'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],\n\t'%BooleanPrototype%': ['Boolean', 'prototype'],\n\t'%DataViewPrototype%': ['DataView', 'prototype'],\n\t'%DatePrototype%': ['Date', 'prototype'],\n\t'%ErrorPrototype%': ['Error', 'prototype'],\n\t'%EvalErrorPrototype%': ['EvalError', 'prototype'],\n\t'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],\n\t'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],\n\t'%FunctionPrototype%': ['Function', 'prototype'],\n\t'%Generator%': ['GeneratorFunction', 'prototype'],\n\t'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],\n\t'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],\n\t'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],\n\t'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],\n\t'%JSONParse%': ['JSON', 'parse'],\n\t'%JSONStringify%': ['JSON', 'stringify'],\n\t'%MapPrototype%': ['Map', 'prototype'],\n\t'%NumberPrototype%': ['Number', 'prototype'],\n\t'%ObjectPrototype%': ['Object', 'prototype'],\n\t'%ObjProto_toString%': ['Object', 'prototype', 'toString'],\n\t'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],\n\t'%PromisePrototype%': ['Promise', 'prototype'],\n\t'%PromiseProto_then%': ['Promise', 'prototype', 'then'],\n\t'%Promise_all%': ['Promise', 'all'],\n\t'%Promise_reject%': ['Promise', 'reject'],\n\t'%Promise_resolve%': ['Promise', 'resolve'],\n\t'%RangeErrorPrototype%': ['RangeError', 'prototype'],\n\t'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],\n\t'%RegExpPrototype%': ['RegExp', 'prototype'],\n\t'%SetPrototype%': ['Set', 'prototype'],\n\t'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],\n\t'%StringPrototype%': ['String', 'prototype'],\n\t'%SymbolPrototype%': ['Symbol', 'prototype'],\n\t'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],\n\t'%TypedArrayPrototype%': ['TypedArray', 'prototype'],\n\t'%TypeErrorPrototype%': ['TypeError', 'prototype'],\n\t'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],\n\t'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],\n\t'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],\n\t'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],\n\t'%URIErrorPrototype%': ['URIError', 'prototype'],\n\t'%WeakMapPrototype%': ['WeakMap', 'prototype'],\n\t'%WeakSetPrototype%': ['WeakSet', 'prototype']\n};\n\nvar bind = require('function-bind');\nvar hasOwn = require('hasown');\nvar $concat = bind.call($call, Array.prototype.concat);\nvar $spliceApply = bind.call($apply, Array.prototype.splice);\nvar $replace = bind.call($call, String.prototype.replace);\nvar $strSlice = bind.call($call, String.prototype.slice);\nvar $exec = bind.call($call, RegExp.prototype.exec);\n\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */\nvar rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */\nvar stringToPath = function stringToPath(string) {\n\tvar first = $strSlice(string, 0, 1);\n\tvar last = $strSlice(string, -1);\n\tif (first === '%' && last !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected closing `%`');\n\t} else if (last === '%' && first !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected opening `%`');\n\t}\n\tvar result = [];\n\t$replace(string, rePropName, function (match, number, quote, subString) {\n\t\tresult[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;\n\t});\n\treturn result;\n};\n/* end adaptation */\n\nvar getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n\tvar intrinsicName = name;\n\tvar alias;\n\tif (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n\t\talias = LEGACY_ALIASES[intrinsicName];\n\t\tintrinsicName = '%' + alias[0] + '%';\n\t}\n\n\tif (hasOwn(INTRINSICS, intrinsicName)) {\n\t\tvar value = INTRINSICS[intrinsicName];\n\t\tif (value === needsEval) {\n\t\t\tvalue = doEval(intrinsicName);\n\t\t}\n\t\tif (typeof value === 'undefined' && !allowMissing) {\n\t\t\tthrow new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t\t}\n\n\t\treturn {\n\t\t\talias: alias,\n\t\t\tname: intrinsicName,\n\t\t\tvalue: value\n\t\t};\n\t}\n\n\tthrow new $SyntaxError('intrinsic ' + name + ' does not exist!');\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (typeof name !== 'string' || name.length === 0) {\n\t\tthrow new $TypeError('intrinsic name must be a non-empty string');\n\t}\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new $TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tif ($exec(/^%?[^%]*%?$/, name) === null) {\n\t\tthrow new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');\n\t}\n\tvar parts = stringToPath(name);\n\tvar intrinsicBaseName = parts.length > 0 ? parts[0] : '';\n\n\tvar intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);\n\tvar intrinsicRealName = intrinsic.name;\n\tvar value = intrinsic.value;\n\tvar skipFurtherCaching = false;\n\n\tvar alias = intrinsic.alias;\n\tif (alias) {\n\t\tintrinsicBaseName = alias[0];\n\t\t$spliceApply(parts, $concat([0, 1], alias));\n\t}\n\n\tfor (var i = 1, isOwn = true; i < parts.length; i += 1) {\n\t\tvar part = parts[i];\n\t\tvar first = $strSlice(part, 0, 1);\n\t\tvar last = $strSlice(part, -1);\n\t\tif (\n\t\t\t(\n\t\t\t\t(first === '\"' || first === \"'\" || first === '`')\n\t\t\t\t|| (last === '\"' || last === \"'\" || last === '`')\n\t\t\t)\n\t\t\t&& first !== last\n\t\t) {\n\t\t\tthrow new $SyntaxError('property names with quotes must have matching quotes');\n\t\t}\n\t\tif (part === 'constructor' || !isOwn) {\n\t\t\tskipFurtherCaching = true;\n\t\t}\n\n\t\tintrinsicBaseName += '.' + part;\n\t\tintrinsicRealName = '%' + intrinsicBaseName + '%';\n\n\t\tif (hasOwn(INTRINSICS, intrinsicRealName)) {\n\t\t\tvalue = INTRINSICS[intrinsicRealName];\n\t\t} else if (value != null) {\n\t\t\tif (!(part in value)) {\n\t\t\t\tif (!allowMissing) {\n\t\t\t\t\tthrow new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');\n\t\t\t\t}\n\t\t\t\treturn void undefined;\n\t\t\t}\n\t\t\tif ($gOPD && (i + 1) >= parts.length) {\n\t\t\t\tvar desc = $gOPD(value, part);\n\t\t\t\tisOwn = !!desc;\n\n\t\t\t\t// By convention, when a data property is converted to an accessor\n\t\t\t\t// property to emulate a data property that does not suffer from\n\t\t\t\t// the override mistake, that accessor's getter is marked with\n\t\t\t\t// an `originalValue` property. Here, when we detect this, we\n\t\t\t\t// uphold the illusion by pretending to see that original data\n\t\t\t\t// property, i.e., returning the value rather than the getter\n\t\t\t\t// itself.\n\t\t\t\tif (isOwn && 'get' in desc && !('originalValue' in desc.get)) {\n\t\t\t\t\tvalue = desc.get;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = value[part];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tisOwn = hasOwn(value, part);\n\t\t\t\tvalue = value[part];\n\t\t\t}\n\n\t\t\tif (isOwn && !skipFurtherCaching) {\n\t\t\t\tINTRINSICS[intrinsicRealName] = value;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar callBindBasic = require('call-bind-apply-helpers');\n\n/** @type {(thisArg: string, searchString: string, position?: number) => number} */\nvar $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]);\n\n/** @type {import('.')} */\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\t/* eslint no-extra-parens: 0 */\n\n\tvar intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */ (GetIntrinsic(name, !!allowMissing));\n\tif (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {\n\t\treturn callBindBasic(/** @type {const} */ ([intrinsic]));\n\t}\n\treturn intrinsic;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar callBound = require('call-bound');\nvar inspect = require('object-inspect');\n\nvar $TypeError = require('es-errors/type');\nvar $Map = GetIntrinsic('%Map%', true);\n\n/** @type {(thisArg: Map, key: K) => V} */\nvar $mapGet = callBound('Map.prototype.get', true);\n/** @type {(thisArg: Map, key: K, value: V) => void} */\nvar $mapSet = callBound('Map.prototype.set', true);\n/** @type {(thisArg: Map, key: K) => boolean} */\nvar $mapHas = callBound('Map.prototype.has', true);\n/** @type {(thisArg: Map, key: K) => boolean} */\nvar $mapDelete = callBound('Map.prototype.delete', true);\n/** @type {(thisArg: Map) => number} */\nvar $mapSize = callBound('Map.prototype.size', true);\n\n/** @type {import('.')} */\nmodule.exports = !!$Map && /** @type {Exclude} */ function getSideChannelMap() {\n\t/** @typedef {ReturnType} Channel */\n\t/** @typedef {Parameters[0]} K */\n\t/** @typedef {Parameters[1]} V */\n\n\t/** @type {Map | undefined} */ var $m;\n\n\t/** @type {Channel} */\n\tvar channel = {\n\t\tassert: function (key) {\n\t\t\tif (!channel.has(key)) {\n\t\t\t\tthrow new $TypeError('Side channel does not contain ' + inspect(key));\n\t\t\t}\n\t\t},\n\t\t'delete': function (key) {\n\t\t\tif ($m) {\n\t\t\t\tvar result = $mapDelete($m, key);\n\t\t\t\tif ($mapSize($m) === 0) {\n\t\t\t\t\t$m = void undefined;\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\tget: function (key) { // eslint-disable-line consistent-return\n\t\t\tif ($m) {\n\t\t\t\treturn $mapGet($m, key);\n\t\t\t}\n\t\t},\n\t\thas: function (key) {\n\t\t\tif ($m) {\n\t\t\t\treturn $mapHas($m, key);\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\tset: function (key, value) {\n\t\t\tif (!$m) {\n\t\t\t\t// @ts-expect-error TS can't handle narrowing a variable inside a closure\n\t\t\t\t$m = new $Map();\n\t\t\t}\n\t\t\t$mapSet($m, key, value);\n\t\t}\n\t};\n\n\t// @ts-expect-error TODO: figure out why TS is erroring here\n\treturn channel;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar callBound = require('call-bound');\nvar inspect = require('object-inspect');\nvar getSideChannelMap = require('side-channel-map');\n\nvar $TypeError = require('es-errors/type');\nvar $WeakMap = GetIntrinsic('%WeakMap%', true);\n\n/** @type {(thisArg: WeakMap, key: K) => V} */\nvar $weakMapGet = callBound('WeakMap.prototype.get', true);\n/** @type {(thisArg: WeakMap, key: K, value: V) => void} */\nvar $weakMapSet = callBound('WeakMap.prototype.set', true);\n/** @type {(thisArg: WeakMap, key: K) => boolean} */\nvar $weakMapHas = callBound('WeakMap.prototype.has', true);\n/** @type {(thisArg: WeakMap, key: K) => boolean} */\nvar $weakMapDelete = callBound('WeakMap.prototype.delete', true);\n\n/** @type {import('.')} */\nmodule.exports = $WeakMap\n\t? /** @type {Exclude} */ function getSideChannelWeakMap() {\n\t\t/** @typedef {ReturnType} Channel */\n\t\t/** @typedef {Parameters[0]} K */\n\t\t/** @typedef {Parameters[1]} V */\n\n\t\t/** @type {WeakMap | undefined} */ var $wm;\n\t\t/** @type {Channel | undefined} */ var $m;\n\n\t\t/** @type {Channel} */\n\t\tvar channel = {\n\t\t\tassert: function (key) {\n\t\t\t\tif (!channel.has(key)) {\n\t\t\t\t\tthrow new $TypeError('Side channel does not contain ' + inspect(key));\n\t\t\t\t}\n\t\t\t},\n\t\t\t'delete': function (key) {\n\t\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\t\tif ($wm) {\n\t\t\t\t\t\treturn $weakMapDelete($wm, key);\n\t\t\t\t\t}\n\t\t\t\t} else if (getSideChannelMap) {\n\t\t\t\t\tif ($m) {\n\t\t\t\t\t\treturn $m['delete'](key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\tget: function (key) {\n\t\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\t\tif ($wm) {\n\t\t\t\t\t\treturn $weakMapGet($wm, key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn $m && $m.get(key);\n\t\t\t},\n\t\t\thas: function (key) {\n\t\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\t\tif ($wm) {\n\t\t\t\t\t\treturn $weakMapHas($wm, key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn !!$m && $m.has(key);\n\t\t\t},\n\t\t\tset: function (key, value) {\n\t\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\t\tif (!$wm) {\n\t\t\t\t\t\t$wm = new $WeakMap();\n\t\t\t\t\t}\n\t\t\t\t\t$weakMapSet($wm, key, value);\n\t\t\t\t} else if (getSideChannelMap) {\n\t\t\t\t\tif (!$m) {\n\t\t\t\t\t\t$m = getSideChannelMap();\n\t\t\t\t\t}\n\t\t\t\t\t// eslint-disable-next-line no-extra-parens\n\t\t\t\t\t/** @type {NonNullable} */ ($m).set(key, value);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t// @ts-expect-error TODO: figure out why this is erroring\n\t\treturn channel;\n\t}\n\t: getSideChannelMap;\n","'use strict';\n\nvar $TypeError = require('es-errors/type');\nvar inspect = require('object-inspect');\nvar getSideChannelList = require('side-channel-list');\nvar getSideChannelMap = require('side-channel-map');\nvar getSideChannelWeakMap = require('side-channel-weakmap');\n\nvar makeChannel = getSideChannelWeakMap || getSideChannelMap || getSideChannelList;\n\n/** @type {import('.')} */\nmodule.exports = function getSideChannel() {\n\t/** @typedef {ReturnType} Channel */\n\n\t/** @type {Channel | undefined} */ var $channelData;\n\n\t/** @type {Channel} */\n\tvar channel = {\n\t\tassert: function (key) {\n\t\t\tif (!channel.has(key)) {\n\t\t\t\tvar keyDesc = key && Object(key) === key\n\t\t\t\t\t? 'the given object key'\n\t\t\t\t\t: inspect(key);\n\t\t\t\tthrow new $TypeError('Side channel does not contain ' + keyDesc);\n\t\t\t}\n\t\t},\n\t\t'delete': function (key) {\n\t\t\treturn !!$channelData && $channelData['delete'](key);\n\t\t},\n\t\tget: function (key) {\n\t\t\treturn $channelData && $channelData.get(key);\n\t\t},\n\t\thas: function (key) {\n\t\t\treturn !!$channelData && $channelData.has(key);\n\t\t},\n\t\tset: function (key, value) {\n\t\t\tif (!$channelData) {\n\t\t\t\t$channelData = makeChannel();\n\t\t\t}\n\n\t\t\t$channelData.set(key, value);\n\t\t}\n\t};\n\n\treturn channel;\n};\n","'use strict';\n\nvar replace = String.prototype.replace;\nvar percentTwenties = /%20/g;\n\nvar Format = {\n RFC1738: 'RFC1738',\n RFC3986: 'RFC3986'\n};\n\nmodule.exports = {\n 'default': Format.RFC3986,\n formatters: {\n RFC1738: function (value) {\n return replace.call(value, percentTwenties, '+');\n },\n RFC3986: function (value) {\n return String(value);\n }\n },\n RFC1738: Format.RFC1738,\n RFC3986: Format.RFC3986\n};\n","'use strict';\n\nvar formats = require('./formats');\nvar getSideChannel = require('side-channel');\nvar defineProperty = require('es-define-property');\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\n// Track objects created from arrayLimit overflow using side-channel\n// Stores the current max numeric index for O(1) lookup\nvar overflowChannel = getSideChannel();\n\nvar markOverflow = function markOverflow(obj, maxIndex) {\n overflowChannel.set(obj, maxIndex);\n return obj;\n};\n\nvar isOverflow = function isOverflow(obj) {\n return overflowChannel.has(obj);\n};\n\nvar getMaxIndex = function getMaxIndex(obj) {\n return overflowChannel.get(obj);\n};\n\nvar setMaxIndex = function setMaxIndex(obj, maxIndex) {\n overflowChannel.set(obj, maxIndex);\n};\n\nvar hexTable = (function () {\n var array = [];\n for (var i = 0; i < 256; ++i) {\n array[array.length] = '%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase();\n }\n\n return array;\n}());\n\nvar compactQueue = function compactQueue(queue) {\n while (queue.length > 1) {\n var item = queue.pop();\n var obj = item.obj[item.prop];\n\n if (isArray(obj)) {\n var compacted = [];\n\n for (var j = 0; j < obj.length; ++j) {\n if (typeof obj[j] !== 'undefined') {\n compacted[compacted.length] = obj[j];\n }\n }\n\n item.obj[item.prop] = compacted;\n }\n }\n};\n\nvar arrayToObject = function arrayToObject(source, options) {\n var obj = options && options.plainObjects ? { __proto__: null } : {};\n for (var i = 0; i < source.length; ++i) {\n if (typeof source[i] !== 'undefined') {\n obj[i] = source[i];\n }\n }\n\n return obj;\n};\n\nvar setProperty = function setProperty(obj, key, value) {\n if (key === '__proto__' && defineProperty) {\n defineProperty(obj, key, {\n configurable: true,\n enumerable: true,\n value: value,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n};\n\nvar merge = function merge(target, source, options) {\n /* eslint no-param-reassign: 0 */\n if (!source) {\n return target;\n }\n\n if (typeof source !== 'object' && typeof source !== 'function') {\n if (isArray(target)) {\n var nextIndex = target.length;\n if (options && typeof options.arrayLimit === 'number' && nextIndex >= options.arrayLimit) {\n if (options.throwOnLimitExceeded) {\n throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');\n }\n return markOverflow(arrayToObject(target.concat(source), options), nextIndex);\n }\n target[nextIndex] = source;\n } else if (target && typeof target === 'object') {\n if (isOverflow(target)) {\n // Add at next numeric index for overflow objects\n var newIndex = getMaxIndex(target) + 1;\n target[newIndex] = source;\n setMaxIndex(target, newIndex);\n } else if (options && options.strictMerge) {\n return [target, source];\n } else if (\n (options && (options.plainObjects || options.allowPrototypes))\n || !has.call(Object.prototype, source)\n ) {\n target[source] = true;\n }\n } else {\n return [target, source];\n }\n\n return target;\n }\n\n if (!target || typeof target !== 'object') {\n if (isOverflow(source)) {\n // Create new object with target at 0, source values shifted by 1\n var sourceKeys = Object.keys(source);\n var result = options && options.plainObjects\n ? { __proto__: null, 0: target }\n : { 0: target };\n for (var m = 0; m < sourceKeys.length; m++) {\n var oldKey = parseInt(sourceKeys[m], 10);\n result[oldKey + 1] = source[sourceKeys[m]];\n }\n return markOverflow(result, getMaxIndex(source) + 1);\n }\n var combined = [target].concat(source);\n if (options && typeof options.arrayLimit === 'number' && combined.length > options.arrayLimit) {\n if (options.throwOnLimitExceeded) {\n throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');\n }\n return markOverflow(arrayToObject(combined, options), combined.length - 1);\n }\n return combined;\n }\n\n var mergeTarget = target;\n if (isArray(target) && !isArray(source)) {\n mergeTarget = arrayToObject(target, options);\n }\n\n if (isArray(target) && isArray(source)) {\n source.forEach(function (item, i) {\n if (has.call(target, i)) {\n var targetItem = target[i];\n if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {\n target[i] = merge(targetItem, item, options);\n } else {\n target[target.length] = item;\n }\n } else {\n target[i] = item;\n }\n });\n if (options && typeof options.arrayLimit === 'number' && target.length > options.arrayLimit) {\n if (options.throwOnLimitExceeded) {\n throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');\n }\n return markOverflow(arrayToObject(target, options), target.length - 1);\n }\n return target;\n }\n\n return Object.keys(source).reduce(function (acc, key) {\n var value = source[key];\n\n if (has.call(acc, key)) {\n setProperty(acc, key, merge(acc[key], value, options));\n } else {\n setProperty(acc, key, value);\n }\n\n if (isOverflow(source) && !isOverflow(acc)) {\n markOverflow(acc, getMaxIndex(source));\n }\n if (isOverflow(acc)) {\n var keyNum = parseInt(key, 10);\n if (String(keyNum) === key && keyNum >= 0 && keyNum > getMaxIndex(acc)) {\n setMaxIndex(acc, keyNum);\n }\n }\n\n return acc;\n }, mergeTarget);\n};\n\nvar assign = function assignSingleSource(target, source) {\n return Object.keys(source).reduce(function (acc, key) {\n setProperty(acc, key, source[key]);\n return acc;\n }, target);\n};\n\nvar decode = function (str, defaultDecoder, charset) {\n var strWithoutPlus = str.replace(/\\+/g, ' ');\n if (charset === 'iso-8859-1') {\n // unescape never throws, no try...catch needed:\n return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);\n }\n // utf-8\n try {\n return decodeURIComponent(strWithoutPlus);\n } catch (e) {\n return strWithoutPlus;\n }\n};\n\nvar limit = 1024;\n\n/* eslint operator-linebreak: [2, \"before\"] */\n\nvar encode = function encode(str, defaultEncoder, charset, kind, format) {\n // This code was originally written by Brian White (mscdex) for the io.js core querystring library.\n // It has been adapted here for stricter adherence to RFC 3986\n if (str.length === 0) {\n return str;\n }\n\n var string = str;\n if (typeof str === 'symbol') {\n string = Symbol.prototype.toString.call(str);\n } else if (typeof str !== 'string') {\n string = String(str);\n }\n\n if (charset === 'iso-8859-1') {\n return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {\n return '%26%23' + parseInt($0.slice(2), 16) + '%3B';\n });\n }\n\n var out = '';\n for (var j = 0; j < string.length; j += limit) {\n var segment = string.length >= limit ? string.slice(j, j + limit) : string;\n if (j + limit < string.length) {\n var last = segment.charCodeAt(segment.length - 1);\n if (last >= 0xD800 && last <= 0xDBFF) {\n segment = segment.slice(0, -1);\n j -= 1;\n }\n }\n var arr = [];\n\n for (var i = 0; i < segment.length; ++i) {\n var c = segment.charCodeAt(i);\n if (\n c === 0x2D // -\n || c === 0x2E // .\n || c === 0x5F // _\n || c === 0x7E // ~\n || (c >= 0x30 && c <= 0x39) // 0-9\n || (c >= 0x41 && c <= 0x5A) // a-z\n || (c >= 0x61 && c <= 0x7A) // A-Z\n || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )\n ) {\n arr[arr.length] = segment.charAt(i);\n continue;\n }\n\n if (c < 0x80) {\n arr[arr.length] = hexTable[c];\n continue;\n }\n\n if (c < 0x800) {\n arr[arr.length] = hexTable[0xC0 | (c >> 6)]\n + hexTable[0x80 | (c & 0x3F)];\n continue;\n }\n\n if (c < 0xD800 || c >= 0xE000) {\n arr[arr.length] = hexTable[0xE0 | (c >> 12)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n continue;\n }\n\n i += 1;\n c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF));\n\n arr[arr.length] = hexTable[0xF0 | (c >> 18)]\n + hexTable[0x80 | ((c >> 12) & 0x3F)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n }\n\n out += arr.join('');\n }\n\n return out;\n};\n\nvar compact = function compact(value) {\n var queue = [{ obj: { o: value }, prop: 'o' }];\n var refs = getSideChannel();\n\n for (var i = 0; i < queue.length; ++i) {\n var item = queue[i];\n var obj = item.obj[item.prop];\n\n var keys = Object.keys(obj);\n for (var j = 0; j < keys.length; ++j) {\n var key = keys[j];\n var val = obj[key];\n if (typeof val === 'object' && val !== null && !refs.has(val)) {\n queue[queue.length] = { obj: obj, prop: key };\n refs.set(val, true);\n }\n }\n }\n\n compactQueue(queue);\n\n return value;\n};\n\nvar isRegExp = function isRegExp(obj) {\n return Object.prototype.toString.call(obj) === '[object RegExp]';\n};\n\nvar isBuffer = function isBuffer(obj) {\n if (!obj || typeof obj !== 'object') {\n return false;\n }\n\n return !!(obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj));\n};\n\nvar combine = function combine(a, b, arrayLimit, plainObjects, throwOnLimitExceeded) {\n // If 'a' is already an overflow object, add to it\n if (isOverflow(a)) {\n if (throwOnLimitExceeded) {\n throw new RangeError('Array limit exceeded. Only ' + arrayLimit + ' element' + (arrayLimit === 1 ? '' : 's') + ' allowed in an array.');\n }\n // spread `b` one level, matching the `[].concat(a, b)` used below, so a\n // collection appended to an already-overflowed object is flattened\n // rather than nested under a single index\n var bValues = isArray(b) ? b : [b];\n var newIndex = getMaxIndex(a);\n for (var i = 0; i < bValues.length; ++i) {\n newIndex += 1;\n a[newIndex] = bValues[i];\n }\n setMaxIndex(a, newIndex);\n return a;\n }\n\n var result = [].concat(a, b);\n if (result.length > arrayLimit) {\n if (throwOnLimitExceeded) {\n throw new RangeError('Array limit exceeded. Only ' + arrayLimit + ' element' + (arrayLimit === 1 ? '' : 's') + ' allowed in an array.');\n }\n return markOverflow(arrayToObject(result, { plainObjects: plainObjects }), result.length - 1);\n }\n return result;\n};\n\nvar maybeMap = function maybeMap(val, fn) {\n if (isArray(val)) {\n var mapped = [];\n for (var i = 0; i < val.length; i += 1) {\n mapped[mapped.length] = fn(val[i]);\n }\n return mapped;\n }\n return fn(val);\n};\n\nmodule.exports = {\n arrayToObject: arrayToObject,\n assign: assign,\n combine: combine,\n compact: compact,\n decode: decode,\n encode: encode,\n isBuffer: isBuffer,\n isOverflow: isOverflow,\n isRegExp: isRegExp,\n markOverflow: markOverflow,\n maybeMap: maybeMap,\n merge: merge\n};\n","'use strict';\n\nvar getSideChannel = require('side-channel');\nvar utils = require('./utils');\nvar formats = require('./formats');\nvar has = Object.prototype.hasOwnProperty;\n\nvar arrayPrefixGenerators = {\n brackets: function brackets(prefix) {\n return prefix + '[]';\n },\n comma: 'comma',\n indices: function indices(prefix, key) {\n return prefix + '[' + key + ']';\n },\n repeat: function repeat(prefix) {\n return prefix;\n }\n};\n\nvar isArray = Array.isArray;\nvar push = Array.prototype.push;\nvar pushToArray = function (arr, valueOrArray) {\n push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);\n};\n\nvar toISO = Date.prototype.toISOString;\n\nvar defaultFormat = formats['default'];\nvar defaults = {\n addQueryPrefix: false,\n allowDots: false,\n allowEmptyArrays: false,\n arrayFormat: 'indices',\n charset: 'utf-8',\n charsetSentinel: false,\n commaRoundTrip: false,\n delimiter: '&',\n depth: Infinity,\n encode: true,\n encodeDotInKeys: false,\n encoder: utils.encode,\n encodeValuesOnly: false,\n filter: void undefined,\n format: defaultFormat,\n formatter: formats.formatters[defaultFormat],\n // deprecated\n indices: false,\n serializeDate: function serializeDate(date) {\n return toISO.call(date);\n },\n skipNulls: false,\n strictNullHandling: false\n};\n\nvar isNonNullishPrimitive = function isNonNullishPrimitive(v) {\n return typeof v === 'string'\n || typeof v === 'number'\n || typeof v === 'boolean'\n || typeof v === 'symbol'\n || typeof v === 'bigint';\n};\n\nvar sentinel = {};\n\nvar stringify = function stringify(\n object,\n prefix,\n generateArrayPrefix,\n commaRoundTrip,\n allowEmptyArrays,\n strictNullHandling,\n skipNulls,\n encodeDotInKeys,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n format,\n formatter,\n encodeValuesOnly,\n charset,\n sideChannel,\n depth,\n currentDepth\n) {\n var obj = object;\n\n if (currentDepth > depth) {\n throw new RangeError('Input depth exceeded depth option of ' + depth);\n }\n\n var tmpSc = sideChannel;\n var step = 0;\n var findFlag = false;\n while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {\n // Where object last appeared in the ref tree\n var pos = tmpSc.get(object);\n step += 1;\n if (typeof pos !== 'undefined') {\n if (pos === step) {\n throw new RangeError('Cyclic object value');\n } else {\n findFlag = true; // Break while\n }\n }\n if (typeof tmpSc.get(sentinel) === 'undefined') {\n step = 0;\n }\n }\n\n obj = typeof filter === 'function' ? filter(prefix, obj) : obj;\n\n if (obj instanceof Date) {\n obj = serializeDate(obj);\n } else if (generateArrayPrefix === 'comma' && isArray(obj)) {\n obj = utils.maybeMap(obj, function (value) {\n if (value instanceof Date) {\n return serializeDate(value);\n }\n return value;\n });\n }\n\n if (obj === null) {\n if (strictNullHandling) {\n return formatter(encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix);\n }\n\n obj = '';\n }\n\n if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {\n if (encoder) {\n var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);\n return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];\n }\n return [formatter(prefix) + '=' + formatter(String(obj))];\n }\n\n var values = [];\n\n if (typeof obj === 'undefined') {\n return values;\n }\n\n var objKeys;\n if (generateArrayPrefix === 'comma' && isArray(obj)) {\n // we need to join elements in\n if (encodeValuesOnly && encoder) {\n obj = utils.maybeMap(obj, function (v) {\n return v == null ? v : encoder(v);\n });\n }\n objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];\n } else if (isArray(filter)) {\n objKeys = filter;\n } else {\n var keys = Object.keys(obj);\n objKeys = sort ? keys.sort(sort) : keys;\n }\n\n var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\\./g, '%2E') : String(prefix);\n\n var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix;\n\n if (allowEmptyArrays && isArray(obj) && obj.length === 0 && Object.keys(obj).length === 0) {\n return adjustedPrefix + '[]';\n }\n\n for (var j = 0; j < objKeys.length; ++j) {\n var key = objKeys[j];\n var value = typeof key === 'object' && key && typeof key.value !== 'undefined'\n ? key.value\n : obj[key];\n\n if (skipNulls && value === null) {\n continue;\n }\n\n var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\\./g, '%2E') : String(key);\n var keyPrefix = isArray(obj)\n ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix\n : adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']');\n\n sideChannel.set(object, step);\n var valueSideChannel = getSideChannel();\n valueSideChannel.set(sentinel, sideChannel);\n pushToArray(values, stringify(\n value,\n keyPrefix,\n generateArrayPrefix,\n commaRoundTrip,\n allowEmptyArrays,\n strictNullHandling,\n skipNulls,\n encodeDotInKeys,\n generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n format,\n formatter,\n encodeValuesOnly,\n charset,\n valueSideChannel,\n depth,\n currentDepth + 1\n ));\n }\n\n return values;\n};\n\nvar normalizeStringifyOptions = function normalizeStringifyOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {\n throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');\n }\n\n if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') {\n throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided');\n }\n\n if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {\n throw new TypeError('Encoder has to be a function.');\n }\n\n var charset = opts.charset || defaults.charset;\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n\n var format = formats['default'];\n if (typeof opts.format !== 'undefined') {\n if (!has.call(formats.formatters, opts.format)) {\n throw new TypeError('Unknown format option provided.');\n }\n format = opts.format;\n }\n var formatter = formats.formatters[format];\n\n var filter = defaults.filter;\n if (typeof opts.filter === 'function' || isArray(opts.filter)) {\n filter = opts.filter;\n }\n\n var arrayFormat;\n if (opts.arrayFormat in arrayPrefixGenerators) {\n arrayFormat = opts.arrayFormat;\n } else if ('indices' in opts) {\n arrayFormat = opts.indices ? 'indices' : 'repeat';\n } else {\n arrayFormat = defaults.arrayFormat;\n }\n\n if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {\n throw new TypeError('`commaRoundTrip` must be a boolean, or absent');\n }\n\n var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;\n\n return {\n addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,\n allowDots: allowDots,\n allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,\n arrayFormat: arrayFormat,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n commaRoundTrip: !!opts.commaRoundTrip,\n delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,\n depth: typeof opts.depth === 'number' ? opts.depth : defaults.depth,\n encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,\n encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys,\n encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,\n encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,\n filter: filter,\n format: format,\n formatter: formatter,\n serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,\n skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,\n sort: typeof opts.sort === 'function' ? opts.sort : null,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (object, opts) {\n var obj = object;\n var options = normalizeStringifyOptions(opts);\n\n var objKeys;\n var filter;\n\n if (typeof options.filter === 'function') {\n filter = options.filter;\n obj = filter('', obj);\n } else if (isArray(options.filter)) {\n filter = options.filter;\n objKeys = filter;\n }\n\n var keys = [];\n\n if (typeof obj !== 'object' || obj === null) {\n return '';\n }\n\n var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];\n var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip;\n\n if (!objKeys) {\n objKeys = Object.keys(obj);\n }\n\n if (options.sort) {\n objKeys.sort(options.sort);\n }\n\n var sideChannel = getSideChannel();\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n\n if (typeof key === 'undefined' || key === null) {\n continue;\n }\n\n var value = obj[key];\n\n if (options.skipNulls && value === null) {\n continue;\n }\n\n var encodedKey = options.encodeDotInKeys ? String(key).replace(/\\./g, '%2E') : String(key);\n\n pushToArray(keys, stringify(\n value,\n encodedKey,\n generateArrayPrefix,\n commaRoundTrip,\n options.allowEmptyArrays,\n options.strictNullHandling,\n options.skipNulls,\n options.encodeDotInKeys,\n options.encode ? options.encoder : null,\n options.filter,\n options.sort,\n options.allowDots,\n options.serializeDate,\n options.format,\n options.formatter,\n options.encodeValuesOnly,\n options.charset,\n sideChannel,\n options.depth,\n 0\n ));\n }\n\n var joined = keys.join(options.delimiter);\n var prefix = options.addQueryPrefix === true ? '?' : '';\n\n if (options.charsetSentinel) {\n if (options.charset === 'iso-8859-1') {\n // encodeURIComponent('✓'), the \"numeric entity\" representation of a checkmark\n prefix += 'utf8=%26%2310003%3B' + options.delimiter;\n } else {\n // encodeURIComponent('✓')\n prefix += 'utf8=%E2%9C%93' + options.delimiter;\n }\n }\n\n return joined.length > 0 ? prefix + joined : '';\n};\n","'use strict';\n\nvar utils = require('./utils');\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar defaults = {\n allowDots: false,\n allowEmptyArrays: false,\n allowPrototypes: false,\n allowSparse: false,\n arrayLimit: 20,\n charset: 'utf-8',\n charsetSentinel: false,\n comma: false,\n decodeDotInKeys: false,\n decoder: utils.decode,\n delimiter: '&',\n depth: 5,\n duplicates: 'combine',\n ignoreQueryPrefix: false,\n interpretNumericEntities: false,\n parameterLimit: 1000,\n parseArrays: true,\n plainObjects: false,\n strictDepth: false,\n strictMerge: true,\n strictNullHandling: false,\n throwOnLimitExceeded: false\n};\n\nvar interpretNumericEntities = function (str) {\n return str.replace(/&#(\\d+);/g, function ($0, numberStr) {\n return String.fromCharCode(parseInt(numberStr, 10));\n });\n};\n\nvar parseArrayValue = function (val, options, currentArrayLength) {\n if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {\n if (options.throwOnLimitExceeded) {\n var commaCount = 0;\n var commaIndex = val.indexOf(',');\n while (commaIndex > -1) {\n commaCount += 1;\n if (commaCount >= options.arrayLimit) {\n throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');\n }\n commaIndex = val.indexOf(',', commaIndex + 1);\n }\n }\n return val.split(',');\n }\n\n if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) {\n throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');\n }\n\n return val;\n};\n\n// This is what browsers will submit when the ✓ character occurs in an\n// application/x-www-form-urlencoded body and the encoding of the page containing\n// the form is iso-8859-1, or when the submitted form has an accept-charset\n// attribute of iso-8859-1. Presumably also with other charsets that do not contain\n// the ✓ character, such as us-ascii.\nvar isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')\n\n// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.\nvar charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')\n\nvar parseValues = function parseQueryStringValues(str, options) {\n var obj = { __proto__: null };\n\n var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\\?/, '') : str;\n cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']');\n\n var limit = options.parameterLimit === Infinity ? void undefined : options.parameterLimit;\n var parts = cleanStr.split(\n options.delimiter,\n options.throwOnLimitExceeded && typeof limit !== 'undefined' ? limit + 1 : limit\n );\n\n if (options.throwOnLimitExceeded && typeof limit !== 'undefined' && parts.length > limit) {\n throw new RangeError('Parameter limit exceeded. Only ' + limit + ' parameter' + (limit === 1 ? '' : 's') + ' allowed.');\n }\n\n var skipIndex = -1; // Keep track of where the utf8 sentinel was found\n var i;\n\n var charset = options.charset;\n if (options.charsetSentinel) {\n for (i = 0; i < parts.length; ++i) {\n if (parts[i].indexOf('utf8=') === 0) {\n if (parts[i] === charsetSentinel) {\n charset = 'utf-8';\n } else if (parts[i] === isoSentinel) {\n charset = 'iso-8859-1';\n }\n skipIndex = i;\n i = parts.length; // The eslint settings do not allow break;\n }\n }\n }\n\n for (i = 0; i < parts.length; ++i) {\n if (i === skipIndex) {\n continue;\n }\n var part = parts[i];\n\n var bracketEqualsPos = part.indexOf(']=');\n var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;\n\n var key;\n var val;\n if (pos === -1) {\n key = options.decoder(part, defaults.decoder, charset, 'key');\n val = options.strictNullHandling ? null : '';\n } else {\n key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');\n\n if (key !== null) {\n val = utils.maybeMap(\n parseArrayValue(\n part.slice(pos + 1),\n options,\n isArray(obj[key]) ? obj[key].length : 0\n ),\n function (encodedVal) {\n return options.decoder(encodedVal, defaults.decoder, charset, 'value');\n }\n );\n }\n }\n\n if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {\n val = interpretNumericEntities(String(val));\n }\n\n if (part.indexOf('[]=') > -1) {\n val = isArray(val) ? [val] : val;\n }\n\n if (options.comma && isArray(val) && val.length > options.arrayLimit) {\n val = utils.combine([], val, options.arrayLimit, options.plainObjects, options.throwOnLimitExceeded);\n }\n\n if (key !== null) {\n var existing = has.call(obj, key);\n if (existing && (options.duplicates === 'combine' || part.indexOf('[]=') > -1)) {\n obj[key] = utils.combine(\n obj[key],\n val,\n options.arrayLimit,\n options.plainObjects,\n options.throwOnLimitExceeded\n );\n } else if (!existing || options.duplicates === 'last') {\n obj[key] = val;\n }\n }\n }\n\n return obj;\n};\n\nvar parseObject = function (chain, val, options, valuesParsed) {\n var currentArrayLength = 0;\n if (chain.length > 0 && chain[chain.length - 1] === '[]') {\n var parentKey = chain.slice(0, -1).join('');\n currentArrayLength = Array.isArray(val) && val[parentKey] ? val[parentKey].length : 0;\n }\n\n var leaf = valuesParsed ? val : parseArrayValue(val, options, currentArrayLength);\n\n for (var i = chain.length - 1; i >= 0; --i) {\n var obj;\n var root = chain[i];\n\n if (root === '[]' && options.parseArrays) {\n if (utils.isOverflow(leaf)) {\n // leaf is already an overflow object, preserve it\n obj = leaf;\n } else {\n obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null))\n ? []\n : utils.combine(\n [],\n leaf,\n options.arrayLimit,\n options.plainObjects,\n options.throwOnLimitExceeded\n );\n }\n } else {\n obj = options.plainObjects ? { __proto__: null } : {};\n var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;\n var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot;\n var index = parseInt(decodedRoot, 10);\n var isValidArrayIndex = !isNaN(index)\n && root !== decodedRoot\n && String(index) === decodedRoot\n && index >= 0\n && options.parseArrays;\n if (!options.parseArrays && decodedRoot === '') {\n obj = { 0: leaf };\n } else if (isValidArrayIndex && index < options.arrayLimit) {\n obj = [];\n obj[index] = leaf;\n } else if (isValidArrayIndex && options.throwOnLimitExceeded) {\n throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');\n } else if (isValidArrayIndex) {\n obj[index] = leaf;\n utils.markOverflow(obj, index);\n } else if (decodedRoot !== '__proto__') {\n obj[decodedRoot] = leaf;\n }\n }\n\n leaf = obj;\n }\n\n return leaf;\n};\n\n// Split a key like \"a[b][c[]]\" into ['a', '[b]', '[c[]]'] while preserving\n// qs parse semantics for depth/prototype guards.\nvar splitKeyIntoSegments = function splitKeyIntoSegments(originalKey, options) {\n var key = options.allowDots ? originalKey.replace(/\\.([^.[]+)/g, '[$1]') : originalKey;\n\n // depth <= 0 keeps the whole key as one segment\n if (options.depth <= 0) {\n if (!options.plainObjects && has.call(Object.prototype, key)) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n\n return [key];\n }\n\n var segments = [];\n\n // parent before the first '[' (may be empty if key starts with '[')\n var first = key.indexOf('[');\n var parent = first >= 0 ? key.slice(0, first) : key;\n if (parent) {\n if (!options.plainObjects && has.call(Object.prototype, parent)) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n\n segments[segments.length] = parent;\n }\n\n var n = key.length;\n var open = first;\n var collected = 0;\n\n while (open >= 0 && collected < options.depth) {\n var level = 1;\n var i = open + 1;\n var close = -1;\n\n // balance nested '[' and ']' inside this bracket group using a nesting level counter\n while (i < n && close < 0) {\n var cu = key.charCodeAt(i);\n if (cu === 0x5B) { // '['\n level += 1;\n } else if (cu === 0x5D) { // ']'\n level -= 1;\n if (level === 0) {\n close = i; // found matching close; loop will exit by condition\n }\n }\n i += 1;\n }\n\n if (close < 0) {\n // Unterminated group: wrap the raw remainder in one bracket pair so it stays\n // a single literal segment (e.g. \"[[]b\" -> \"[[]b]\"); we do not infer missing ']'.\n segments[segments.length] = '[' + key.slice(open) + ']';\n return segments;\n }\n\n var seg = key.slice(open, close + 1);\n // prototype guard for the content of this group\n var content = seg.slice(1, -1);\n if (!options.plainObjects && has.call(Object.prototype, content) && !options.allowPrototypes) {\n return;\n }\n\n segments[segments.length] = seg;\n collected += 1;\n\n // find the next '[' after this balanced group\n open = key.indexOf('[', close + 1);\n }\n\n if (open >= 0) {\n if (options.strictDepth === true) {\n throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');\n }\n\n segments[segments.length] = '[' + key.slice(open) + ']';\n }\n\n return segments;\n};\n\nvar parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {\n if (!givenKey) {\n return;\n }\n\n var keys = splitKeyIntoSegments(givenKey, options);\n\n if (!keys) {\n return;\n }\n\n return parseObject(keys, val, options, valuesParsed);\n};\n\nvar normalizeParseOptions = function normalizeParseOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {\n throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');\n }\n\n if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') {\n throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided');\n }\n\n if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') {\n throw new TypeError('Decoder has to be a function.');\n }\n\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n\n if (typeof opts.throwOnLimitExceeded !== 'undefined' && typeof opts.throwOnLimitExceeded !== 'boolean') {\n throw new TypeError('`throwOnLimitExceeded` option must be a boolean');\n }\n\n var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;\n\n var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates;\n\n if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') {\n throw new TypeError('The duplicates option must be either combine, first, or last');\n }\n\n var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;\n\n return {\n allowDots: allowDots,\n allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,\n allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,\n allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,\n arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,\n decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys,\n decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,\n delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,\n // eslint-disable-next-line no-implicit-coercion, no-extra-parens\n depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,\n duplicates: duplicates,\n ignoreQueryPrefix: opts.ignoreQueryPrefix === true,\n interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,\n parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,\n parseArrays: opts.parseArrays !== false,\n plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,\n strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth,\n strictMerge: typeof opts.strictMerge === 'boolean' ? !!opts.strictMerge : defaults.strictMerge,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling,\n throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === 'boolean' ? opts.throwOnLimitExceeded : false\n };\n};\n\nmodule.exports = function (str, opts) {\n var options = normalizeParseOptions(opts);\n\n if (str === '' || str === null || typeof str === 'undefined') {\n return options.plainObjects ? { __proto__: null } : {};\n }\n\n var tempObj = typeof str === 'string' ? parseValues(str, options) : str;\n var obj = options.plainObjects ? { __proto__: null } : {};\n\n // Iterate over the keys and setup the new object\n\n var keys = Object.keys(tempObj);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');\n obj = utils.merge(obj, newObj, options);\n }\n\n if (options.allowSparse === true) {\n return obj;\n }\n\n return utils.compact(obj);\n};\n","'use strict';\n\nvar stringify = require('./stringify');\nvar parse = require('./parse');\nvar formats = require('./formats');\n\nmodule.exports = {\n formats: formats,\n parse: parse,\n stringify: stringify\n};\n","// src/router.ts\nimport { cloneDeep as cloneDeep3, get as get3, set as set3 } from \"lodash-es\";\n\n// src/config.ts\nimport { get, has, set } from \"lodash-es\";\nvar Config = class {\n constructor(defaults) {\n this.config = {};\n this.defaults = defaults;\n }\n extend(defaults) {\n if (defaults) {\n this.defaults = { ...this.defaults, ...defaults };\n }\n return this;\n }\n replace(newConfig) {\n this.config = newConfig;\n }\n get(key) {\n return has(this.config, key) ? get(this.config, key) : get(this.defaults, key);\n }\n set(keyOrValues, value) {\n if (typeof keyOrValues === \"string\") {\n set(this.config, keyOrValues, value);\n } else {\n Object.entries(keyOrValues).forEach(([key, val]) => {\n set(this.config, key, val);\n });\n }\n }\n};\nvar config = new Config({\n form: {\n recentlySuccessfulDuration: 2e3,\n forceIndicesArrayFormatInFormData: true,\n withAllErrors: false\n },\n future: {\n preserveEqualProps: false,\n useDataInertiaHeadAttribute: false,\n useDialogForErrorModal: false,\n useScriptElementForInitialPage: false\n },\n prefetch: {\n cacheFor: 3e4,\n hoverDelay: 75\n }\n});\n\n// src/debounce.ts\nfunction debounce(fn, delay) {\n let timeoutID;\n return function(...args) {\n clearTimeout(timeoutID);\n timeoutID = setTimeout(() => fn.apply(this, args), delay);\n };\n}\n\n// src/events.ts\nfunction fireEvent(name, options) {\n return document.dispatchEvent(new CustomEvent(`inertia:${name}`, options));\n}\nvar fireBeforeEvent = (visit) => {\n return fireEvent(\"before\", { cancelable: true, detail: { visit } });\n};\nvar fireErrorEvent = (errors) => {\n return fireEvent(\"error\", { detail: { errors } });\n};\nvar fireExceptionEvent = (exception) => {\n return fireEvent(\"exception\", { cancelable: true, detail: { exception } });\n};\nvar fireFinishEvent = (visit) => {\n return fireEvent(\"finish\", { detail: { visit } });\n};\nvar fireInvalidEvent = (response) => {\n return fireEvent(\"invalid\", { cancelable: true, detail: { response } });\n};\nvar fireBeforeUpdateEvent = (page2) => {\n return fireEvent(\"beforeUpdate\", { detail: { page: page2 } });\n};\nvar fireNavigateEvent = (page2) => {\n return fireEvent(\"navigate\", { detail: { page: page2 } });\n};\nvar fireProgressEvent = (progress3) => {\n return fireEvent(\"progress\", { detail: { progress: progress3 } });\n};\nvar fireStartEvent = (visit) => {\n return fireEvent(\"start\", { detail: { visit } });\n};\nvar fireSuccessEvent = (page2) => {\n return fireEvent(\"success\", { detail: { page: page2 } });\n};\nvar firePrefetchedEvent = (response, visit) => {\n return fireEvent(\"prefetched\", { detail: { fetchedAt: Date.now(), response: response.data, visit } });\n};\nvar firePrefetchingEvent = (visit) => {\n return fireEvent(\"prefetching\", { detail: { visit } });\n};\nvar fireFlashEvent = (flash) => {\n return fireEvent(\"flash\", { detail: { flash } });\n};\n\n// src/history.ts\nimport { cloneDeep as cloneDeep2, isEqual } from \"lodash-es\";\n\n// src/sessionStorage.ts\nvar SessionStorage = class {\n static set(key, value) {\n if (typeof window !== \"undefined\") {\n window.sessionStorage.setItem(key, JSON.stringify(value));\n }\n }\n static get(key) {\n if (typeof window !== \"undefined\") {\n return JSON.parse(window.sessionStorage.getItem(key) || \"null\");\n }\n }\n static merge(key, value) {\n const existing = this.get(key);\n if (existing === null) {\n this.set(key, value);\n } else {\n this.set(key, { ...existing, ...value });\n }\n }\n static remove(key) {\n if (typeof window !== \"undefined\") {\n window.sessionStorage.removeItem(key);\n }\n }\n static removeNested(key, nestedKey) {\n const existing = this.get(key);\n if (existing !== null) {\n delete existing[nestedKey];\n this.set(key, existing);\n }\n }\n static exists(key) {\n try {\n return this.get(key) !== null;\n } catch (error) {\n return false;\n }\n }\n static clear() {\n if (typeof window !== \"undefined\") {\n window.sessionStorage.clear();\n }\n }\n};\nSessionStorage.locationVisitKey = \"inertiaLocationVisit\";\n\n// src/encryption.ts\nvar encryptHistory = async (data) => {\n if (typeof window === \"undefined\") {\n throw new Error(\"Unable to encrypt history\");\n }\n const iv = getIv();\n const storedKey = await getKeyFromSessionStorage();\n const key = await getOrCreateKey(storedKey);\n if (!key) {\n throw new Error(\"Unable to encrypt history\");\n }\n const encrypted = await encryptData(iv, key, data);\n return encrypted;\n};\nvar historySessionStorageKeys = {\n key: \"historyKey\",\n iv: \"historyIv\"\n};\nvar decryptHistory = async (data) => {\n const iv = getIv();\n const storedKey = await getKeyFromSessionStorage();\n if (!storedKey) {\n throw new Error(\"Unable to decrypt history\");\n }\n return await decryptData(iv, storedKey, data);\n};\nvar encryptData = async (iv, key, data) => {\n if (typeof window === \"undefined\") {\n throw new Error(\"Unable to encrypt history\");\n }\n if (typeof window.crypto.subtle === \"undefined\") {\n console.warn(\"Encryption is not supported in this environment. SSL is required.\");\n return Promise.resolve(data);\n }\n const textEncoder = new TextEncoder();\n const str = JSON.stringify(data);\n const encoded = new Uint8Array(str.length * 3);\n const result = textEncoder.encodeInto(str, encoded);\n return window.crypto.subtle.encrypt(\n {\n name: \"AES-GCM\",\n iv\n },\n key,\n encoded.subarray(0, result.written)\n );\n};\nvar decryptData = async (iv, key, data) => {\n if (typeof window.crypto.subtle === \"undefined\") {\n console.warn(\"Decryption is not supported in this environment. SSL is required.\");\n return Promise.resolve(data);\n }\n const decrypted = await window.crypto.subtle.decrypt(\n {\n name: \"AES-GCM\",\n iv\n },\n key,\n data\n );\n return JSON.parse(new TextDecoder().decode(decrypted));\n};\nvar getIv = () => {\n const ivString = SessionStorage.get(historySessionStorageKeys.iv);\n if (ivString) {\n return new Uint8Array(ivString);\n }\n const iv = window.crypto.getRandomValues(new Uint8Array(12));\n SessionStorage.set(historySessionStorageKeys.iv, Array.from(iv));\n return iv;\n};\nvar createKey = async () => {\n if (typeof window.crypto.subtle === \"undefined\") {\n console.warn(\"Encryption is not supported in this environment. SSL is required.\");\n return Promise.resolve(null);\n }\n return window.crypto.subtle.generateKey(\n {\n name: \"AES-GCM\",\n length: 256\n },\n true,\n [\"encrypt\", \"decrypt\"]\n );\n};\nvar saveKey = async (key) => {\n if (typeof window.crypto.subtle === \"undefined\") {\n console.warn(\"Encryption is not supported in this environment. SSL is required.\");\n return Promise.resolve();\n }\n const keyData = await window.crypto.subtle.exportKey(\"raw\", key);\n SessionStorage.set(historySessionStorageKeys.key, Array.from(new Uint8Array(keyData)));\n};\nvar getOrCreateKey = async (key) => {\n if (key) {\n return key;\n }\n const newKey = await createKey();\n if (!newKey) {\n return null;\n }\n await saveKey(newKey);\n return newKey;\n};\nvar getKeyFromSessionStorage = async () => {\n const stringKey = SessionStorage.get(historySessionStorageKeys.key);\n if (!stringKey) {\n return null;\n }\n const key = await window.crypto.subtle.importKey(\n \"raw\",\n new Uint8Array(stringKey),\n {\n name: \"AES-GCM\",\n length: 256\n },\n true,\n [\"encrypt\", \"decrypt\"]\n );\n return key;\n};\n\n// src/prefetched.ts\nimport { cloneDeep } from \"lodash-es\";\n\n// src/objectUtils.ts\nvar stripTopLevelUndefined = (obj) => {\n const result = {};\n for (const key of Object.keys(obj)) {\n if (obj[key] !== void 0) {\n result[key] = obj[key];\n }\n }\n return result;\n};\nvar objectsAreEqual = (obj1, obj2, excludeKeys) => {\n if (obj1 === obj2) {\n return true;\n }\n for (const key in obj1) {\n if (excludeKeys.includes(key)) {\n continue;\n }\n if (obj1[key] === obj2[key]) {\n continue;\n }\n if (!compareValues(obj1[key], obj2[key])) {\n return false;\n }\n }\n for (const key in obj2) {\n if (excludeKeys.includes(key)) {\n continue;\n }\n if (!(key in obj1)) {\n return false;\n }\n }\n return true;\n};\nvar compareValues = (value1, value2) => {\n switch (typeof value1) {\n case \"object\":\n return objectsAreEqual(value1, value2, []);\n case \"function\":\n return value1.toString() === value2.toString();\n default:\n return value1 === value2;\n }\n};\n\n// src/time.ts\nvar conversionMap = {\n ms: 1,\n s: 1e3,\n m: 1e3 * 60,\n h: 1e3 * 60 * 60,\n d: 1e3 * 60 * 60 * 24\n};\nvar timeToMs = (time) => {\n if (typeof time === \"number\") {\n return time;\n }\n for (const [unit, conversion] of Object.entries(conversionMap)) {\n if (time.endsWith(unit)) {\n return parseFloat(time) * conversion;\n }\n }\n return parseInt(time);\n};\n\n// src/prefetched.ts\nvar PrefetchedRequests = class {\n constructor() {\n this.cached = [];\n this.inFlightRequests = [];\n this.removalTimers = [];\n this.currentUseId = null;\n }\n add(params, sendFunc, { cacheFor, cacheTags }) {\n const inFlight = this.findInFlight(params);\n if (inFlight) {\n return Promise.resolve();\n }\n const existing = this.findCached(params);\n if (!params.fresh && existing && existing.staleTimestamp > Date.now()) {\n return Promise.resolve();\n }\n const [stale, prefetchExpiresIn] = this.extractStaleValues(cacheFor);\n const promise = new Promise((resolve, reject) => {\n sendFunc({\n ...params,\n onCancel: () => {\n this.remove(params);\n params.onCancel();\n reject();\n },\n onError: (error) => {\n this.remove(params);\n params.onError(error);\n reject();\n },\n onPrefetching(visitParams) {\n params.onPrefetching(visitParams);\n },\n onPrefetched(response, visit) {\n params.onPrefetched(response, visit);\n },\n onPrefetchResponse(response) {\n resolve(response);\n },\n onPrefetchError(error) {\n prefetchedRequests.removeFromInFlight(params);\n reject(error);\n }\n });\n }).then((response) => {\n this.remove(params);\n const pageResponse = response.getPageResponse();\n page.mergeOncePropsIntoResponse(pageResponse);\n this.cached.push({\n params: { ...params },\n staleTimestamp: Date.now() + stale,\n expiresAt: Date.now() + prefetchExpiresIn,\n response: promise,\n singleUse: prefetchExpiresIn === 0,\n timestamp: Date.now(),\n inFlight: false,\n tags: Array.isArray(cacheTags) ? cacheTags : [cacheTags]\n });\n const oncePropExpiresIn = this.getShortestOncePropTtl(pageResponse);\n this.scheduleForRemoval(\n params,\n oncePropExpiresIn ? Math.min(prefetchExpiresIn, oncePropExpiresIn) : prefetchExpiresIn\n );\n this.removeFromInFlight(params);\n response.handlePrefetch();\n return response;\n });\n this.inFlightRequests.push({\n params: { ...params },\n response: promise,\n staleTimestamp: null,\n inFlight: true\n });\n return promise;\n }\n removeAll() {\n this.cached = [];\n this.removalTimers.forEach((removalTimer) => {\n clearTimeout(removalTimer.timer);\n });\n this.removalTimers = [];\n }\n removeByTags(tags) {\n this.cached = this.cached.filter((prefetched) => {\n return !prefetched.tags.some((tag) => tags.includes(tag));\n });\n }\n remove(params) {\n this.cached = this.cached.filter((prefetched) => {\n return !this.paramsAreEqual(prefetched.params, params);\n });\n this.clearTimer(params);\n }\n removeFromInFlight(params) {\n this.inFlightRequests = this.inFlightRequests.filter((prefetching) => {\n return !this.paramsAreEqual(prefetching.params, params);\n });\n }\n extractStaleValues(cacheFor) {\n const [stale, expires] = this.cacheForToStaleAndExpires(cacheFor);\n return [timeToMs(stale), timeToMs(expires)];\n }\n cacheForToStaleAndExpires(cacheFor) {\n if (!Array.isArray(cacheFor)) {\n return [cacheFor, cacheFor];\n }\n switch (cacheFor.length) {\n case 0:\n return [0, 0];\n case 1:\n return [cacheFor[0], cacheFor[0]];\n default:\n return [cacheFor[0], cacheFor[1]];\n }\n }\n clearTimer(params) {\n const timer = this.removalTimers.find((removalTimer) => {\n return this.paramsAreEqual(removalTimer.params, params);\n });\n if (timer) {\n clearTimeout(timer.timer);\n this.removalTimers = this.removalTimers.filter((removalTimer) => removalTimer !== timer);\n }\n }\n scheduleForRemoval(params, expiresIn) {\n if (typeof window === \"undefined\") {\n return;\n }\n this.clearTimer(params);\n if (expiresIn > 0) {\n const timer = window.setTimeout(() => this.remove(params), expiresIn);\n this.removalTimers.push({\n params,\n timer\n });\n }\n }\n get(params) {\n return this.findCached(params) || this.findInFlight(params);\n }\n use(prefetched, params) {\n const id = `${params.url.pathname}-${Date.now()}-${Math.random().toString(36).substring(7)}`;\n this.currentUseId = id;\n return prefetched.response.then((response) => {\n if (this.currentUseId !== id) {\n return;\n }\n response.mergeParams({ ...params, onPrefetched: () => {\n } });\n this.removeSingleUseItems(params);\n return response.handle();\n });\n }\n removeSingleUseItems(params) {\n this.cached = this.cached.filter((prefetched) => {\n if (!this.paramsAreEqual(prefetched.params, params)) {\n return true;\n }\n return !prefetched.singleUse;\n });\n }\n findCached(params) {\n return this.cached.find((prefetched) => {\n return this.paramsAreEqual(prefetched.params, params);\n }) || null;\n }\n findInFlight(params) {\n return this.inFlightRequests.find((prefetched) => {\n return this.paramsAreEqual(prefetched.params, params);\n }) || null;\n }\n withoutPurposePrefetchHeader(params) {\n const newParams = cloneDeep(params);\n if (newParams.headers[\"Purpose\"] === \"prefetch\") {\n delete newParams.headers[\"Purpose\"];\n }\n return newParams;\n }\n paramsAreEqual(params1, params2) {\n return objectsAreEqual(\n this.withoutPurposePrefetchHeader(params1),\n this.withoutPurposePrefetchHeader(params2),\n [\n \"showProgress\",\n \"replace\",\n \"prefetch\",\n \"preserveScroll\",\n \"preserveState\",\n \"onBefore\",\n \"onBeforeUpdate\",\n \"onStart\",\n \"onProgress\",\n \"onFinish\",\n \"onCancel\",\n \"onSuccess\",\n \"onError\",\n \"onFlash\",\n \"onPrefetched\",\n \"onCancelToken\",\n \"onPrefetching\",\n \"async\",\n \"viewTransition\"\n ]\n );\n }\n updateCachedOncePropsFromCurrentPage() {\n this.cached.forEach((prefetched) => {\n prefetched.response.then((response) => {\n const pageResponse = response.getPageResponse();\n page.mergeOncePropsIntoResponse(pageResponse, { force: true });\n for (const [group, deferredProps] of Object.entries(pageResponse.deferredProps ?? {})) {\n const remaining = deferredProps.filter((prop) => pageResponse.props[prop] === void 0);\n if (remaining.length > 0) {\n pageResponse.deferredProps[group] = remaining;\n } else {\n delete pageResponse.deferredProps[group];\n }\n }\n const oncePropExpiresIn = this.getShortestOncePropTtl(pageResponse);\n if (oncePropExpiresIn === null) {\n return;\n }\n const prefetchExpiresIn = prefetched.expiresAt - Date.now();\n const expiresIn = Math.min(prefetchExpiresIn, oncePropExpiresIn);\n if (expiresIn > 0) {\n this.scheduleForRemoval(prefetched.params, expiresIn);\n } else {\n this.remove(prefetched.params);\n }\n });\n });\n }\n getShortestOncePropTtl(page2) {\n const expiryTimestamps = Object.values(page2.onceProps ?? {}).map((onceProp) => onceProp.expiresAt).filter((expiresAt) => !!expiresAt);\n if (expiryTimestamps.length === 0) {\n return null;\n }\n return Math.min(...expiryTimestamps) - Date.now();\n }\n};\nvar prefetchedRequests = new PrefetchedRequests();\n\n// src/domUtils.ts\nvar elementInViewport = (el) => {\n if (el.offsetParent === null) {\n return false;\n }\n const rect = el.getBoundingClientRect();\n const verticallyVisible = rect.top < window.innerHeight && rect.bottom >= 0;\n const horizontallyVisible = rect.left < window.innerWidth && rect.right >= 0;\n return verticallyVisible && horizontallyVisible;\n};\nvar getScrollableParent = (element) => {\n const allowsVerticalScroll = (el) => {\n const computedStyle = window.getComputedStyle(el);\n if ([\"scroll\", \"overlay\"].includes(computedStyle.overflowY)) {\n return true;\n }\n if (computedStyle.overflowY !== \"auto\") {\n return false;\n }\n if ([\"visible\", \"clip\"].includes(computedStyle.overflowX)) {\n return true;\n }\n return hasDimensionConstraint(computedStyle.maxHeight, el.style.height) || isConstrainedByLayout(el, \"height\");\n };\n const allowsHorizontalScroll = (el) => {\n const computedStyle = window.getComputedStyle(el);\n if ([\"scroll\", \"overlay\"].includes(computedStyle.overflowX)) {\n return true;\n }\n if (computedStyle.overflowX !== \"auto\") {\n return false;\n }\n if ([\"visible\", \"clip\"].includes(computedStyle.overflowY)) {\n return true;\n }\n return hasDimensionConstraint(computedStyle.maxWidth, el.style.width) || isConstrainedByLayout(el, \"width\");\n };\n const hasDimensionConstraint = (computedMaxDimension, inlineStyleDimension) => {\n if (computedMaxDimension && computedMaxDimension !== \"none\" && computedMaxDimension !== \"0px\") {\n return true;\n }\n if (inlineStyleDimension && inlineStyleDimension !== \"auto\" && inlineStyleDimension !== \"0\") {\n return true;\n }\n return false;\n };\n const isConstrainedByLayout = (el, dimension) => {\n const parent2 = el.parentElement;\n if (!parent2) {\n return false;\n }\n const parentStyle = window.getComputedStyle(parent2);\n if ([\"flex\", \"inline-flex\"].includes(parentStyle.display)) {\n const isColumnLayout = [\"column\", \"column-reverse\"].includes(parentStyle.flexDirection);\n return dimension === \"height\" ? isColumnLayout : !isColumnLayout;\n }\n return [\"grid\", \"inline-grid\"].includes(parentStyle.display);\n };\n let parent = element?.parentElement;\n while (parent) {\n const allowsScroll = allowsVerticalScroll(parent) || allowsHorizontalScroll(parent);\n if (window.getComputedStyle(parent).display !== \"contents\" && allowsScroll) {\n return parent;\n }\n parent = parent.parentElement;\n }\n return null;\n};\nvar getElementsInViewportFromCollection = (elements, referenceElement) => {\n if (!referenceElement) {\n return elements.filter((element) => elementInViewport(element));\n }\n const referenceIndex = elements.indexOf(referenceElement);\n const upwardElements = [];\n const downwardElements = [];\n for (let i = referenceIndex; i >= 0; i--) {\n const element = elements[i];\n if (elementInViewport(element)) {\n upwardElements.push(element);\n } else {\n break;\n }\n }\n for (let i = referenceIndex + 1; i < elements.length; i++) {\n const element = elements[i];\n if (elementInViewport(element)) {\n downwardElements.push(element);\n } else {\n break;\n }\n }\n return [...upwardElements.reverse(), ...downwardElements];\n};\nvar requestAnimationFrame = (cb, times = 1) => {\n window.requestAnimationFrame(() => {\n if (times > 1) {\n requestAnimationFrame(cb, times - 1);\n } else {\n cb();\n }\n });\n};\nvar getInitialPageFromDOM = (id, useScriptElement = false) => {\n if (typeof window === \"undefined\") {\n return null;\n }\n if (!useScriptElement) {\n const el = document.getElementById(id);\n if (el?.dataset.page) {\n return JSON.parse(el.dataset.page);\n }\n }\n const scriptEl = document.querySelector(`script[data-page=\"${id}\"][type=\"application/json\"]`);\n if (scriptEl?.textContent) {\n return JSON.parse(scriptEl.textContent);\n }\n return null;\n};\n\n// src/scroll.ts\nvar isServer = typeof window === \"undefined\";\nvar isFirefox = !isServer && /Firefox/i.test(window.navigator.userAgent);\nvar Scroll = class {\n static save() {\n history.saveScrollPositions(this.getScrollRegions());\n }\n static getScrollRegions() {\n return Array.from(this.regions()).map((region) => ({\n top: region.scrollTop,\n left: region.scrollLeft\n }));\n }\n static regions() {\n return document.querySelectorAll(\"[scroll-region]\");\n }\n static scrollToTop() {\n if (isFirefox && getComputedStyle(document.documentElement).scrollBehavior === \"smooth\") {\n return requestAnimationFrame(() => window.scrollTo(0, 0), 2);\n }\n window.scrollTo(0, 0);\n }\n static reset() {\n const anchorHash = isServer ? null : window.location.hash;\n if (!anchorHash) {\n this.scrollToTop();\n }\n this.regions().forEach((region) => {\n if (typeof region.scrollTo === \"function\") {\n region.scrollTo(0, 0);\n } else {\n region.scrollTop = 0;\n region.scrollLeft = 0;\n }\n });\n this.save();\n this.scrollToAnchor();\n }\n static scrollToAnchor() {\n const anchorHash = isServer ? null : window.location.hash;\n if (anchorHash) {\n setTimeout(() => {\n const anchorElement = document.getElementById(anchorHash.slice(1));\n anchorElement ? anchorElement.scrollIntoView() : this.scrollToTop();\n });\n }\n }\n static restore(scrollRegions) {\n if (isServer) {\n return;\n }\n window.requestAnimationFrame(() => {\n this.restoreDocument();\n this.restoreScrollRegions(scrollRegions);\n });\n }\n static restoreScrollRegions(scrollRegions) {\n if (isServer) {\n return;\n }\n this.regions().forEach((region, index) => {\n const scrollPosition = scrollRegions[index];\n if (!scrollPosition) {\n return;\n }\n if (typeof region.scrollTo === \"function\") {\n region.scrollTo(scrollPosition.left, scrollPosition.top);\n } else {\n region.scrollTop = scrollPosition.top;\n region.scrollLeft = scrollPosition.left;\n }\n });\n }\n static restoreDocument() {\n const scrollPosition = history.getDocumentScrollPosition();\n window.scrollTo(scrollPosition.left, scrollPosition.top);\n }\n static onScroll(event) {\n const target = event.target;\n if (typeof target.hasAttribute === \"function\" && target.hasAttribute(\"scroll-region\")) {\n this.save();\n }\n }\n static onWindowScroll() {\n history.saveDocumentScrollPosition({\n top: window.scrollY,\n left: window.scrollX\n });\n }\n};\n\n// src/url.ts\nimport * as qs from \"qs\";\n\n// src/files.ts\nvar isFile = (value) => typeof File !== \"undefined\" && value instanceof File || value instanceof Blob || typeof FileList !== \"undefined\" && value instanceof FileList && value.length > 0;\nfunction hasFiles(data) {\n return isFile(data) || data instanceof FormData && Array.from(data.values()).some((value) => hasFiles(value)) || typeof data === \"object\" && data !== null && Object.values(data).some((value) => hasFiles(value));\n}\n\n// src/formData.ts\nvar isFormData = (value) => value instanceof FormData;\nfunction objectToFormData(source, form = new FormData(), parentKey = null, queryStringArrayFormat = \"brackets\") {\n source = source || {};\n for (const key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n append(form, composeKey(parentKey, key, \"indices\"), source[key], queryStringArrayFormat);\n }\n }\n return form;\n}\nfunction composeKey(parent, key, format) {\n if (!parent) {\n return key;\n }\n return format === \"brackets\" ? `${parent}[]` : `${parent}[${key}]`;\n}\nfunction append(form, key, value, format) {\n if (Array.isArray(value)) {\n return Array.from(value.keys()).forEach(\n (index) => append(form, composeKey(key, index.toString(), format), value[index], format)\n );\n } else if (value instanceof Date) {\n return form.append(key, value.toISOString());\n } else if (value instanceof File) {\n return form.append(key, value, value.name);\n } else if (value instanceof Blob) {\n return form.append(key, value);\n } else if (typeof value === \"boolean\") {\n return form.append(key, value ? \"1\" : \"0\");\n } else if (typeof value === \"string\") {\n return form.append(key, value);\n } else if (typeof value === \"number\") {\n return form.append(key, `${value}`);\n } else if (value === null || value === void 0) {\n return form.append(key, \"\");\n }\n objectToFormData(value, form, key, format);\n}\n\n// src/url.ts\nfunction hrefToUrl(href) {\n return new URL(href.toString(), typeof window === \"undefined\" ? void 0 : window.location.toString());\n}\nvar transformUrlAndData = (href, data, method, forceFormData, queryStringArrayFormat) => {\n let url = typeof href === \"string\" ? hrefToUrl(href) : href;\n if ((hasFiles(data) || forceFormData) && !isFormData(data)) {\n if (config.get(\"form.forceIndicesArrayFormatInFormData\")) {\n queryStringArrayFormat = \"indices\";\n }\n data = objectToFormData(data, new FormData(), null, queryStringArrayFormat);\n }\n if (isFormData(data)) {\n return [url, data];\n }\n const [_href, _data] = mergeDataIntoQueryString(method, url, data, queryStringArrayFormat);\n return [hrefToUrl(_href), _data];\n};\nfunction mergeDataIntoQueryString(method, href, data, qsArrayFormat = \"brackets\") {\n const hasDataForQueryString = method === \"get\" && !isFormData(data) && Object.keys(data).length > 0;\n const hasHost = urlHasProtocol(href.toString());\n const hasAbsolutePath = hasHost || href.toString().startsWith(\"/\") || href.toString() === \"\";\n const hasRelativePath = !hasAbsolutePath && !href.toString().startsWith(\"#\") && !href.toString().startsWith(\"?\");\n const hasRelativePathWithDotPrefix = /^[.]{1,2}([/]|$)/.test(href.toString());\n const hasSearch = href.toString().includes(\"?\") || hasDataForQueryString;\n const hasHash = href.toString().includes(\"#\");\n const url = new URL(href.toString(), typeof window === \"undefined\" ? \"http://localhost\" : window.location.toString());\n if (hasDataForQueryString) {\n const hasIndices = /\\[\\d+\\]/.test(decodeURIComponent(url.search));\n const parseOptions = { ignoreQueryPrefix: true, allowSparse: true };\n url.search = qs.stringify(\n { ...qs.parse(url.search, parseOptions), ...data },\n {\n encodeValuesOnly: true,\n arrayFormat: hasIndices ? \"indices\" : qsArrayFormat\n }\n );\n }\n return [\n [\n hasHost ? `${url.protocol}//${url.host}` : \"\",\n hasAbsolutePath ? url.pathname : \"\",\n hasRelativePath ? url.pathname.substring(hasRelativePathWithDotPrefix ? 0 : 1) : \"\",\n hasSearch ? url.search : \"\",\n hasHash ? url.hash : \"\"\n ].join(\"\"),\n hasDataForQueryString ? {} : data\n ];\n}\nfunction urlWithoutHash(url) {\n url = new URL(url.href);\n url.hash = \"\";\n return url;\n}\nvar setHashIfSameUrl = (originUrl, destinationUrl) => {\n if (originUrl.hash && !destinationUrl.hash && urlWithoutHash(originUrl).href === destinationUrl.href) {\n destinationUrl.hash = originUrl.hash;\n }\n};\nvar isSameUrlWithoutHash = (url1, url2) => {\n return urlWithoutHash(url1).href === urlWithoutHash(url2).href;\n};\nvar isSameUrlWithoutQueryOrHash = (url1, url2) => {\n return url1.origin === url2.origin && url1.pathname === url2.pathname;\n};\nfunction isUrlMethodPair(href) {\n return href !== null && typeof href === \"object\" && href !== void 0 && \"url\" in href && \"method\" in href;\n}\nfunction urlHasProtocol(url) {\n return /^([a-z][a-z0-9+.-]*:)?\\/\\/[^/]/i.test(url);\n}\nfunction urlToString(url, absolute) {\n const urlObj = typeof url === \"string\" ? hrefToUrl(url) : url;\n return absolute ? `${urlObj.protocol}//${urlObj.host}${urlObj.pathname}${urlObj.search}${urlObj.hash}` : `${urlObj.pathname}${urlObj.search}${urlObj.hash}`;\n}\n\n// src/page.ts\nvar CurrentPage = class {\n constructor() {\n this.componentId = {};\n this.listeners = [];\n this.isFirstPageLoad = true;\n this.cleared = false;\n this.pendingDeferredProps = null;\n this.historyQuotaExceeded = false;\n }\n init({\n initialPage,\n swapComponent,\n resolveComponent,\n onFlash\n }) {\n this.page = { ...initialPage, flash: initialPage.flash ?? {} };\n this.swapComponent = swapComponent;\n this.resolveComponent = resolveComponent;\n this.onFlashCallback = onFlash;\n eventHandler.on(\"historyQuotaExceeded\", () => {\n this.historyQuotaExceeded = true;\n });\n return this;\n }\n set(page2, {\n replace = false,\n preserveScroll = false,\n preserveState = false,\n viewTransition = false\n } = {}) {\n if (Object.keys(page2.deferredProps || {}).length) {\n this.pendingDeferredProps = {\n deferredProps: page2.deferredProps,\n component: page2.component,\n url: page2.url\n };\n if (page2.initialDeferredProps === void 0) {\n page2.initialDeferredProps = page2.deferredProps;\n }\n }\n this.componentId = {};\n const componentId = this.componentId;\n if (page2.clearHistory) {\n history.clear();\n }\n return this.resolve(page2.component).then((component) => {\n if (componentId !== this.componentId) {\n return;\n }\n page2.rememberedState ?? (page2.rememberedState = {});\n const isServer3 = typeof window === \"undefined\";\n const location = !isServer3 ? window.location : new URL(page2.url);\n const scrollRegions = !isServer3 && preserveScroll ? Scroll.getScrollRegions() : [];\n replace = replace || isSameUrlWithoutHash(hrefToUrl(page2.url), location);\n const pageForHistory = { ...page2, flash: {} };\n return new Promise(\n (resolve) => replace ? history.replaceState(pageForHistory, resolve) : history.pushState(pageForHistory, resolve)\n ).then(() => {\n const isNewComponent = !this.isTheSame(page2);\n if (!isNewComponent && Object.keys(page2.props.errors || {}).length > 0) {\n viewTransition = false;\n }\n this.page = page2;\n this.cleared = false;\n if (this.hasOnceProps()) {\n prefetchedRequests.updateCachedOncePropsFromCurrentPage();\n }\n if (isNewComponent) {\n this.fireEventsFor(\"newComponent\");\n }\n if (this.isFirstPageLoad) {\n this.fireEventsFor(\"firstLoad\");\n }\n this.isFirstPageLoad = false;\n if (this.historyQuotaExceeded) {\n this.historyQuotaExceeded = false;\n return;\n }\n return this.swap({\n component,\n page: page2,\n preserveState,\n viewTransition\n }).then(() => {\n if (preserveScroll) {\n window.requestAnimationFrame(() => Scroll.restoreScrollRegions(scrollRegions));\n } else {\n Scroll.reset();\n }\n if (this.pendingDeferredProps && this.pendingDeferredProps.component === page2.component && this.pendingDeferredProps.url === page2.url) {\n eventHandler.fireInternalEvent(\"loadDeferredProps\", this.pendingDeferredProps.deferredProps);\n }\n this.pendingDeferredProps = null;\n if (!replace) {\n fireNavigateEvent(page2);\n }\n });\n });\n });\n }\n setQuietly(page2, {\n preserveState = false\n } = {}) {\n return this.resolve(page2.component).then((component) => {\n this.page = page2;\n this.cleared = false;\n history.setCurrent(page2);\n return this.swap({ component, page: page2, preserveState, viewTransition: false });\n });\n }\n clear() {\n this.cleared = true;\n }\n isCleared() {\n return this.cleared;\n }\n get() {\n return this.page;\n }\n getWithoutFlashData() {\n return { ...this.page, flash: {} };\n }\n hasOnceProps() {\n return Object.keys(this.page.onceProps ?? {}).length > 0;\n }\n merge(data) {\n this.page = { ...this.page, ...data };\n }\n setFlash(flash) {\n this.page = { ...this.page, flash };\n this.onFlashCallback?.(flash);\n }\n setUrlHash(hash) {\n if (!this.page.url.includes(hash)) {\n this.page.url += hash;\n }\n }\n remember(data) {\n this.page.rememberedState = data;\n }\n swap({\n component,\n page: page2,\n preserveState,\n viewTransition\n }) {\n const doSwap = () => this.swapComponent({ component, page: page2, preserveState });\n if (!viewTransition || !document?.startViewTransition || document.visibilityState === \"hidden\") {\n return doSwap();\n }\n const viewTransitionCallback = typeof viewTransition === \"boolean\" ? () => null : viewTransition;\n return new Promise((resolve) => {\n const transitionResult = document.startViewTransition(() => doSwap().then(resolve));\n transitionResult.ready.catch(() => {\n });\n viewTransitionCallback(transitionResult);\n });\n }\n resolve(component) {\n return Promise.resolve(this.resolveComponent(component));\n }\n isTheSame(page2) {\n return this.page.component === page2.component;\n }\n on(event, callback) {\n this.listeners.push({ event, callback });\n return () => {\n this.listeners = this.listeners.filter((listener) => listener.event !== event && listener.callback !== callback);\n };\n }\n fireEventsFor(event) {\n this.listeners.filter((listener) => listener.event === event).forEach((listener) => listener.callback());\n }\n mergeOncePropsIntoResponse(response, { force = false } = {}) {\n Object.entries(response.onceProps ?? {}).forEach(([key, onceProp]) => {\n const existingOnceProp = this.page.onceProps?.[key];\n if (existingOnceProp === void 0) {\n return;\n }\n if (force || response.props[onceProp.prop] === void 0) {\n response.props[onceProp.prop] = this.page.props[existingOnceProp.prop];\n response.onceProps[key].expiresAt = existingOnceProp.expiresAt;\n }\n });\n }\n};\nvar page = new CurrentPage();\n\n// src/queue.ts\nvar Queue = class {\n constructor() {\n this.items = [];\n this.processingPromise = null;\n }\n add(item) {\n this.items.push(item);\n return this.process();\n }\n process() {\n this.processingPromise ?? (this.processingPromise = this.processNext().finally(() => {\n this.processingPromise = null;\n }));\n return this.processingPromise;\n }\n processNext() {\n const next = this.items.shift();\n if (next) {\n return Promise.resolve(next()).then(() => this.processNext());\n }\n return Promise.resolve();\n }\n};\n\n// src/history.ts\nvar isServer2 = typeof window === \"undefined\";\nvar queue = new Queue();\nvar isChromeIOS = !isServer2 && /CriOS/.test(window.navigator.userAgent);\nvar History = class {\n constructor() {\n this.rememberedState = \"rememberedState\";\n this.scrollRegions = \"scrollRegions\";\n this.preserveUrl = false;\n this.current = {};\n // We need initialState for `restore`\n this.initialState = null;\n }\n remember(data, key) {\n this.replaceState({\n ...page.getWithoutFlashData(),\n rememberedState: {\n ...page.get()?.rememberedState ?? {},\n [key]: data\n }\n });\n }\n restore(key) {\n if (!isServer2) {\n return this.current[this.rememberedState]?.[key] !== void 0 ? this.current[this.rememberedState]?.[key] : this.initialState?.[this.rememberedState]?.[key];\n }\n }\n pushState(page2, cb = null) {\n if (isServer2) {\n return;\n }\n if (this.preserveUrl) {\n cb && cb();\n return;\n }\n this.current = page2;\n queue.add(() => {\n return this.getPageData(page2).then((data) => {\n const doPush = () => this.doPushState({ page: data }, page2.url).then(() => cb?.());\n if (isChromeIOS) {\n return new Promise((resolve) => {\n setTimeout(() => doPush().then(resolve));\n });\n }\n return doPush();\n });\n });\n }\n clonePageProps(page2) {\n try {\n structuredClone(page2.props);\n return page2;\n } catch {\n return {\n ...page2,\n props: cloneDeep2(page2.props)\n };\n }\n }\n getPageData(page2) {\n const pageWithClonedProps = this.clonePageProps(page2);\n return new Promise((resolve) => {\n return page2.encryptHistory ? encryptHistory(pageWithClonedProps).then(resolve) : resolve(pageWithClonedProps);\n });\n }\n processQueue() {\n return queue.process();\n }\n decrypt(page2 = null) {\n if (isServer2) {\n return Promise.resolve(page2 ?? page.get());\n }\n const pageData = page2 ?? window.history.state?.page;\n return this.decryptPageData(pageData).then((data) => {\n if (!data) {\n throw new Error(\"Unable to decrypt history\");\n }\n if (this.initialState === null) {\n this.initialState = data ?? void 0;\n } else {\n this.current = data ?? {};\n }\n return data;\n });\n }\n decryptPageData(pageData) {\n return pageData instanceof ArrayBuffer ? decryptHistory(pageData) : Promise.resolve(pageData);\n }\n saveScrollPositions(scrollRegions) {\n queue.add(() => {\n return Promise.resolve().then(() => {\n if (!window.history.state?.page) {\n return;\n }\n if (isEqual(this.getScrollRegions(), scrollRegions)) {\n return;\n }\n return this.doReplaceState({\n page: window.history.state.page,\n scrollRegions\n });\n });\n });\n }\n saveDocumentScrollPosition(scrollRegion) {\n queue.add(() => {\n return Promise.resolve().then(() => {\n if (!window.history.state?.page) {\n return;\n }\n if (isEqual(this.getDocumentScrollPosition(), scrollRegion)) {\n return;\n }\n return this.doReplaceState({\n page: window.history.state.page,\n documentScrollPosition: scrollRegion\n });\n });\n });\n }\n getScrollRegions() {\n return window.history.state?.scrollRegions || [];\n }\n getDocumentScrollPosition() {\n return window.history.state?.documentScrollPosition || { top: 0, left: 0 };\n }\n replaceState(page2, cb = null) {\n if (isEqual(this.current, page2)) {\n cb && cb();\n return;\n }\n const { flash, ...pageWithoutFlash } = page2;\n page.merge(pageWithoutFlash);\n if (isServer2) {\n return;\n }\n if (this.preserveUrl) {\n cb && cb();\n return;\n }\n this.current = page2;\n queue.add(() => {\n return this.getPageData(page2).then((data) => {\n const doReplace = () => this.doReplaceState({ page: data }, page2.url).then(() => cb?.());\n if (isChromeIOS) {\n return new Promise((resolve) => {\n setTimeout(() => doReplace().then(resolve));\n });\n }\n return doReplace();\n });\n });\n }\n isHistoryThrottleError(error) {\n return error instanceof Error && error.name === \"SecurityError\" && (error.message.includes(\"history.pushState\") || error.message.includes(\"history.replaceState\"));\n }\n isQuotaExceededError(error) {\n return error instanceof Error && error.name === \"QuotaExceededError\";\n }\n withThrottleProtection(cb) {\n return Promise.resolve().then(() => {\n try {\n return cb();\n } catch (error) {\n if (!this.isHistoryThrottleError(error)) {\n throw error;\n }\n console.error(error.message);\n }\n });\n }\n doReplaceState(data, url) {\n return this.withThrottleProtection(() => {\n window.history.replaceState(\n {\n ...data,\n scrollRegions: data.scrollRegions ?? window.history.state?.scrollRegions,\n documentScrollPosition: data.documentScrollPosition ?? window.history.state?.documentScrollPosition\n },\n \"\",\n url\n );\n });\n }\n doPushState(data, url) {\n return this.withThrottleProtection(() => {\n try {\n window.history.pushState(data, \"\", url);\n } catch (error) {\n if (!this.isQuotaExceededError(error)) {\n throw error;\n }\n eventHandler.fireInternalEvent(\"historyQuotaExceeded\", url);\n }\n });\n }\n getState(key, defaultValue) {\n return this.current?.[key] ?? defaultValue;\n }\n deleteState(key) {\n if (this.current[key] !== void 0) {\n delete this.current[key];\n this.replaceState(this.current);\n }\n }\n clearInitialState(key) {\n if (this.initialState && this.initialState[key] !== void 0) {\n delete this.initialState[key];\n }\n }\n browserHasHistoryEntry() {\n return !isServer2 && !!window.history.state?.page;\n }\n clear() {\n SessionStorage.remove(historySessionStorageKeys.key);\n SessionStorage.remove(historySessionStorageKeys.iv);\n }\n setCurrent(page2) {\n this.current = page2;\n }\n isValidState(state) {\n return !!state.page;\n }\n getAllState() {\n return this.current;\n }\n};\nif (typeof window !== \"undefined\" && window.history.scrollRestoration) {\n window.history.scrollRestoration = \"manual\";\n}\nvar history = new History();\n\n// src/eventHandler.ts\nvar EventHandler = class {\n constructor() {\n this.internalListeners = [];\n }\n init() {\n if (typeof window !== \"undefined\") {\n window.addEventListener(\"popstate\", this.handlePopstateEvent.bind(this));\n window.addEventListener(\"pageshow\", this.handlePageshowEvent.bind(this));\n window.addEventListener(\"scroll\", debounce(Scroll.onWindowScroll.bind(Scroll), 100), true);\n }\n if (typeof document !== \"undefined\") {\n document.addEventListener(\"scroll\", debounce(Scroll.onScroll.bind(Scroll), 100), true);\n }\n }\n onGlobalEvent(type, callback) {\n const listener = ((event) => {\n const response = callback(event);\n if (event.cancelable && !event.defaultPrevented && response === false) {\n event.preventDefault();\n }\n });\n return this.registerListener(`inertia:${type}`, listener);\n }\n on(event, callback) {\n this.internalListeners.push({ event, listener: callback });\n return () => {\n this.internalListeners = this.internalListeners.filter((listener) => listener.listener !== callback);\n };\n }\n onMissingHistoryItem() {\n page.clear();\n this.fireInternalEvent(\"missingHistoryItem\");\n }\n fireInternalEvent(event, ...args) {\n this.internalListeners.filter((listener) => listener.event === event).forEach((listener) => listener.listener(...args));\n }\n registerListener(type, listener) {\n document.addEventListener(type, listener);\n return () => document.removeEventListener(type, listener);\n }\n // bfcache restores pages without firing `popstate`, so we use `pageshow` to\n // re-validate encrypted history entries after `clearHistory` removed the keys.\n // https://web.dev/articles/bfcache\n handlePageshowEvent(event) {\n if (event.persisted) {\n history.decrypt().catch(() => this.onMissingHistoryItem());\n }\n }\n handlePopstateEvent(event) {\n const state = event.state || null;\n if (state === null) {\n const url = hrefToUrl(page.get().url);\n url.hash = window.location.hash;\n history.replaceState({ ...page.getWithoutFlashData(), url: url.href });\n Scroll.reset();\n return;\n }\n if (!history.isValidState(state)) {\n return this.onMissingHistoryItem();\n }\n history.decrypt(state.page).then((data) => {\n if (page.get().version !== data.version) {\n this.onMissingHistoryItem();\n return;\n }\n router.cancelAll({ prefetch: false });\n page.setQuietly(data, { preserveState: false }).then(() => {\n Scroll.restore(history.getScrollRegions());\n fireNavigateEvent(page.get());\n const pendingDeferred = {};\n const pageProps = page.get().props;\n for (const [group, props] of Object.entries(data.initialDeferredProps ?? data.deferredProps ?? {})) {\n const missing = props.filter((prop) => pageProps[prop] === void 0);\n if (missing.length > 0) {\n pendingDeferred[group] = missing;\n }\n }\n if (Object.keys(pendingDeferred).length > 0) {\n this.fireInternalEvent(\"loadDeferredProps\", pendingDeferred);\n }\n });\n }).catch(() => {\n this.onMissingHistoryItem();\n });\n }\n};\nvar eventHandler = new EventHandler();\n\n// src/navigationType.ts\nvar NavigationType = class {\n constructor() {\n this.type = this.resolveType();\n }\n resolveType() {\n if (typeof window === \"undefined\") {\n return \"navigate\";\n }\n if (window.performance && window.performance.getEntriesByType && window.performance.getEntriesByType(\"navigation\").length > 0) {\n return window.performance.getEntriesByType(\"navigation\")[0].type;\n }\n return \"navigate\";\n }\n get() {\n return this.type;\n }\n isBackForward() {\n return this.type === \"back_forward\";\n }\n isReload() {\n return this.type === \"reload\";\n }\n};\nvar navigationType = new NavigationType();\n\n// src/initialVisit.ts\nvar InitialVisit = class {\n static handle() {\n this.clearRememberedStateOnReload();\n const scenarios = [this.handleBackForward, this.handleLocation, this.handleDefault];\n scenarios.find((handler) => handler.bind(this)());\n }\n static clearRememberedStateOnReload() {\n if (navigationType.isReload()) {\n history.deleteState(history.rememberedState);\n history.clearInitialState(history.rememberedState);\n }\n }\n static handleBackForward() {\n if (!navigationType.isBackForward() || !history.browserHasHistoryEntry()) {\n return false;\n }\n const scrollRegions = history.getScrollRegions();\n history.decrypt().then((data) => {\n page.set(data, { preserveScroll: true, preserveState: true }).then(() => {\n Scroll.restore(scrollRegions);\n fireNavigateEvent(page.get());\n });\n }).catch(() => {\n eventHandler.onMissingHistoryItem();\n });\n return true;\n }\n /**\n * @link https://inertiajs.com/redirects#external-redirects\n */\n static handleLocation() {\n if (!SessionStorage.exists(SessionStorage.locationVisitKey)) {\n return false;\n }\n const locationVisit = SessionStorage.get(SessionStorage.locationVisitKey) || {};\n SessionStorage.remove(SessionStorage.locationVisitKey);\n if (typeof window !== \"undefined\") {\n page.setUrlHash(window.location.hash);\n }\n history.decrypt(page.get()).then(() => {\n const rememberedState = history.getState(history.rememberedState, {});\n const scrollRegions = history.getScrollRegions();\n page.remember(rememberedState);\n page.set(page.get(), {\n preserveScroll: locationVisit.preserveScroll,\n preserveState: true\n }).then(() => {\n if (locationVisit.preserveScroll) {\n Scroll.restore(scrollRegions);\n }\n fireNavigateEvent(page.get());\n });\n }).catch(() => {\n eventHandler.onMissingHistoryItem();\n });\n return true;\n }\n static handleDefault() {\n if (typeof window !== \"undefined\") {\n page.setUrlHash(window.location.hash);\n }\n page.set(page.get(), { preserveScroll: true, preserveState: true }).then(() => {\n if (navigationType.isReload()) {\n Scroll.restore(history.getScrollRegions());\n } else {\n Scroll.scrollToAnchor();\n }\n const page2 = page.get();\n fireNavigateEvent(page2);\n const flash = page2.flash;\n if (Object.keys(flash).length > 0) {\n queueMicrotask(() => fireFlashEvent(flash));\n }\n });\n }\n};\n\n// src/poll.ts\nvar Poll = class {\n constructor(interval, cb, options) {\n this.intervalId = null;\n this.timeoutId = null;\n this.throttle = false;\n this.keepAlive = false;\n this.cbCount = 0;\n this.inFlight = false;\n this.currentCancel = null;\n this.stopped = true;\n this.instanceId = 0;\n this.keepAlive = options.keepAlive ?? false;\n this.mode = options.mode ?? \"overlap\";\n this.cb = cb;\n this.interval = interval;\n if (options.autoStart ?? true) {\n this.start();\n }\n }\n stop() {\n this.stopped = true;\n this.instanceId++;\n this.inFlight = false;\n this.currentCancel = null;\n if (this.intervalId) {\n clearInterval(this.intervalId);\n this.intervalId = null;\n }\n if (this.timeoutId) {\n clearTimeout(this.timeoutId);\n this.timeoutId = null;\n }\n }\n start() {\n if (typeof window === \"undefined\") {\n return;\n }\n this.stop();\n this.stopped = false;\n if (this.mode === \"rest\") {\n this.scheduleNext();\n return;\n }\n this.intervalId = window.setInterval(() => this.tick(), this.interval);\n }\n isInBackground(hidden) {\n this.throttle = this.keepAlive ? false : hidden;\n if (this.throttle) {\n this.cbCount = 0;\n }\n }\n scheduleNext() {\n if (this.stopped) {\n return;\n }\n this.timeoutId = window.setTimeout(() => {\n this.timeoutId = null;\n this.tick();\n }, this.interval);\n }\n tick() {\n if (!this.throttle || this.cbCount % 10 === 0) {\n this.fire();\n } else if (this.mode === \"rest\") {\n this.scheduleNext();\n }\n if (this.throttle) {\n this.cbCount++;\n }\n }\n fire() {\n if (this.inFlight && this.mode === \"cancel\") {\n this.currentCancel?.();\n }\n const instance = this.instanceId;\n this.cb({\n onStart: (cancel) => {\n if (instance !== this.instanceId) {\n return;\n }\n this.inFlight = true;\n this.currentCancel = cancel;\n },\n onFinish: () => {\n if (instance !== this.instanceId) {\n return;\n }\n this.inFlight = false;\n this.currentCancel = null;\n if (this.mode === \"rest\") {\n this.scheduleNext();\n }\n }\n });\n }\n};\n\n// src/polls.ts\nvar Polls = class {\n constructor() {\n this.polls = [];\n this.setupVisibilityListener();\n }\n get count() {\n return this.polls.length;\n }\n add(interval, cb, options) {\n const poll = new Poll(interval, cb, options);\n this.polls.push(poll);\n return {\n stop: () => poll.stop(),\n start: () => poll.start(),\n destroy: () => {\n poll.stop();\n this.polls = this.polls.filter((p) => p !== poll);\n }\n };\n }\n clear() {\n this.polls.forEach((poll) => poll.stop());\n this.polls = [];\n }\n setupVisibilityListener() {\n if (typeof document === \"undefined\") {\n return;\n }\n document.addEventListener(\n \"visibilitychange\",\n () => {\n this.polls.forEach((poll) => poll.isInBackground(document.hidden));\n },\n false\n );\n }\n};\nvar polls = new Polls();\n\n// src/request.ts\nimport { default as axios } from \"axios\";\n\n// src/requestParams.ts\nvar RequestParams = class _RequestParams {\n constructor(params) {\n this.callbacks = [];\n if (!params.prefetch) {\n this.params = params;\n } else {\n const wrappedCallbacks = {\n onBefore: this.wrapCallback(params, \"onBefore\"),\n onBeforeUpdate: this.wrapCallback(params, \"onBeforeUpdate\"),\n onStart: this.wrapCallback(params, \"onStart\"),\n onProgress: this.wrapCallback(params, \"onProgress\"),\n onFinish: this.wrapCallback(params, \"onFinish\"),\n onCancel: this.wrapCallback(params, \"onCancel\"),\n onSuccess: this.wrapCallback(params, \"onSuccess\"),\n onError: this.wrapCallback(params, \"onError\"),\n onFlash: this.wrapCallback(params, \"onFlash\"),\n onCancelToken: this.wrapCallback(params, \"onCancelToken\"),\n onPrefetched: this.wrapCallback(params, \"onPrefetched\"),\n onPrefetching: this.wrapCallback(params, \"onPrefetching\")\n };\n this.params = {\n ...params,\n ...wrappedCallbacks,\n onPrefetchResponse: params.onPrefetchResponse || (() => {\n }),\n onPrefetchError: params.onPrefetchError || (() => {\n })\n };\n }\n }\n static create(params) {\n return new _RequestParams(params);\n }\n data() {\n return this.params.method === \"get\" ? null : this.params.data;\n }\n queryParams() {\n return this.params.method === \"get\" ? this.params.data : {};\n }\n isPartial() {\n return this.params.only.length > 0 || this.params.except.length > 0 || this.params.reset.length > 0;\n }\n isPrefetch() {\n return this.params.prefetch === true;\n }\n isDeferredPropsRequest() {\n return this.params.deferredProps === true;\n }\n onCancelToken(cb) {\n this.params.onCancelToken({\n cancel: cb\n });\n }\n markAsFinished() {\n this.params.completed = true;\n this.params.cancelled = false;\n this.params.interrupted = false;\n }\n markAsCancelled({ cancelled = true, interrupted = false }) {\n this.params.onCancel();\n this.params.completed = false;\n this.params.cancelled = cancelled;\n this.params.interrupted = interrupted;\n }\n wasCancelledAtAll() {\n return this.params.cancelled || this.params.interrupted;\n }\n onFinish() {\n this.params.onFinish(this.params);\n }\n onStart() {\n this.params.onStart(this.params);\n }\n onPrefetching() {\n this.params.onPrefetching(this.params);\n }\n onPrefetchResponse(response) {\n if (this.params.onPrefetchResponse) {\n this.params.onPrefetchResponse(response);\n }\n }\n onPrefetchError(error) {\n if (this.params.onPrefetchError) {\n this.params.onPrefetchError(error);\n }\n }\n all() {\n return this.params;\n }\n headers() {\n const headers = {\n ...this.params.headers\n };\n if (this.isPartial()) {\n headers[\"X-Inertia-Partial-Component\"] = page.get().component;\n }\n const only = this.params.only.concat(this.params.reset);\n if (only.length > 0) {\n headers[\"X-Inertia-Partial-Data\"] = only.join(\",\");\n }\n if (this.params.except.length > 0) {\n headers[\"X-Inertia-Partial-Except\"] = this.params.except.join(\",\");\n }\n if (this.params.reset.length > 0) {\n headers[\"X-Inertia-Reset\"] = this.params.reset.join(\",\");\n }\n if (this.params.errorBag && this.params.errorBag.length > 0) {\n headers[\"X-Inertia-Error-Bag\"] = this.params.errorBag;\n }\n return headers;\n }\n setPreserveOptions(page2) {\n this.params.preserveScroll = _RequestParams.resolvePreserveOption(this.params.preserveScroll, page2);\n this.params.preserveState = _RequestParams.resolvePreserveOption(this.params.preserveState, page2);\n }\n runCallbacks() {\n this.callbacks.forEach(({ name, args }) => {\n this.params[name](...args);\n });\n }\n merge(toMerge) {\n this.params = {\n ...this.params,\n ...toMerge\n };\n }\n wrapCallback(params, name) {\n return (...args) => {\n this.recordCallback(name, args);\n params[name](...args);\n };\n }\n recordCallback(name, args) {\n this.callbacks.push({ name, args });\n }\n static resolvePreserveOption(value, page2) {\n if (typeof value === \"function\") {\n return value(page2);\n }\n if (value === \"errors\") {\n return Object.keys(page2.props.errors || {}).length > 0;\n }\n return value;\n }\n};\n\n// src/response.ts\nimport { get as get2, isEqual as isEqual2, set as set2 } from \"lodash-es\";\n\n// src/modal.ts\nvar modal_default = {\n modal: null,\n listener: null,\n previousBodyOverflow: null,\n createIframeAndPage(html) {\n if (typeof html === \"object\") {\n html = `All Inertia requests must receive a valid Inertia response, however a plain JSON response was received.
${JSON.stringify(\n html\n )}`;\n }\n const page2 = document.createElement(\"html\");\n page2.innerHTML = html;\n page2.querySelectorAll(\"a\").forEach((a) => a.setAttribute(\"target\", \"_top\"));\n const iframe = document.createElement(\"iframe\");\n iframe.style.backgroundColor = \"white\";\n iframe.style.borderRadius = \"5px\";\n iframe.style.width = \"100%\";\n iframe.style.height = \"100%\";\n iframe.setAttribute(\"sandbox\", \"allow-scripts\");\n return { iframe, page: page2 };\n },\n show(html) {\n const { iframe, page: page2 } = this.createIframeAndPage(html);\n this.modal = document.createElement(\"div\");\n this.modal.style.position = \"fixed\";\n this.modal.style.width = \"100vw\";\n this.modal.style.height = \"100vh\";\n this.modal.style.padding = \"50px\";\n this.modal.style.boxSizing = \"border-box\";\n this.modal.style.backgroundColor = \"rgba(0, 0, 0, .6)\";\n this.modal.style.zIndex = 2e5;\n this.modal.addEventListener(\"click\", () => this.hide());\n this.modal.appendChild(iframe);\n document.body.prepend(this.modal);\n this.previousBodyOverflow = document.body.style.overflow;\n document.body.style.overflow = \"hidden\";\n iframe.srcdoc = page2.outerHTML;\n this.listener = this.hideOnEscape.bind(this);\n document.addEventListener(\"keydown\", this.listener);\n },\n hide() {\n this.modal.outerHTML = \"\";\n this.modal = null;\n document.body.style.overflow = this.previousBodyOverflow ?? \"\";\n this.previousBodyOverflow = null;\n document.removeEventListener(\"keydown\", this.listener);\n },\n hideOnEscape(event) {\n if (event.keyCode === 27) {\n this.hide();\n }\n }\n};\n\n// src/dialog.ts\nvar dialog_default = {\n show(html) {\n const { iframe, page: page2 } = modal_default.createIframeAndPage(html);\n iframe.style.boxSizing = \"border-box\";\n iframe.style.display = \"block\";\n const dialog = document.createElement(\"dialog\");\n dialog.id = \"inertia-error-dialog\";\n Object.assign(dialog.style, {\n width: \"calc(100vw - 100px)\",\n height: \"calc(100vh - 100px)\",\n padding: \"0\",\n margin: \"auto\",\n border: \"none\",\n backgroundColor: \"transparent\"\n });\n const dialogStyleElement = document.createElement(\"style\");\n dialogStyleElement.textContent = `\n dialog#inertia-error-dialog::backdrop {\n background-color: rgba(0, 0, 0, 0.6);\n }\n\n dialog#inertia-error-dialog:focus {\n outline: none;\n }\n `;\n document.head.appendChild(dialogStyleElement);\n dialog.addEventListener(\"click\", (event) => {\n if (event.target === dialog) {\n dialog.close();\n }\n });\n dialog.addEventListener(\"close\", () => {\n dialogStyleElement.remove();\n dialog.remove();\n });\n dialog.appendChild(iframe);\n document.body.prepend(dialog);\n dialog.showModal();\n dialog.focus();\n iframe.srcdoc = page2.outerHTML;\n }\n};\n\n// src/response.ts\nvar queue2 = new Queue();\nvar Response = class _Response {\n constructor(requestParams, response, originatingPage) {\n this.requestParams = requestParams;\n this.response = response;\n this.originatingPage = originatingPage;\n this.wasPrefetched = false;\n }\n static create(params, response, originatingPage) {\n return new _Response(params, response, originatingPage);\n }\n async handlePrefetch() {\n if (isSameUrlWithoutHash(this.requestParams.all().url, window.location)) {\n this.handle();\n }\n }\n async handle() {\n return queue2.add(() => this.process());\n }\n async process() {\n if (this.requestParams.all().prefetch) {\n this.wasPrefetched = true;\n this.requestParams.all().prefetch = false;\n this.requestParams.all().onPrefetched(this.response, this.requestParams.all());\n firePrefetchedEvent(this.response, this.requestParams.all());\n return Promise.resolve();\n }\n this.requestParams.runCallbacks();\n if (!this.isInertiaResponse()) {\n return this.handleNonInertiaResponse();\n }\n await history.processQueue();\n history.preserveUrl = this.requestParams.all().preserveUrl;\n await this.setPage();\n const errors = page.get().props.errors || {};\n if (Object.keys(errors).length > 0) {\n const scopedErrors = this.getScopedErrors(errors);\n fireErrorEvent(scopedErrors);\n return this.requestParams.all().onError(scopedErrors);\n }\n router.flushByCacheTags(this.requestParams.all().invalidateCacheTags || []);\n if (!this.wasPrefetched) {\n router.flush(page.get().url);\n }\n const { flash } = page.get();\n if (Object.keys(flash).length > 0 && !this.requestParams.isDeferredPropsRequest()) {\n fireFlashEvent(flash);\n this.requestParams.all().onFlash(flash);\n }\n fireSuccessEvent(page.get());\n await this.requestParams.all().onSuccess(page.get());\n history.preserveUrl = false;\n }\n mergeParams(params) {\n this.requestParams.merge(params);\n }\n getPageResponse() {\n const data = this.getDataFromResponse(this.response.data);\n if (typeof data === \"object\") {\n return this.response.data = { ...data, flash: data.flash ?? {} };\n }\n return this.response.data = data;\n }\n async handleNonInertiaResponse() {\n if (this.isLocationVisit()) {\n const locationUrl = hrefToUrl(this.getHeader(\"x-inertia-location\"));\n setHashIfSameUrl(this.requestParams.all().url, locationUrl);\n return this.locationVisit(locationUrl);\n }\n const response = {\n ...this.response,\n data: this.getDataFromResponse(this.response.data)\n };\n if (fireInvalidEvent(response)) {\n return config.get(\"future.useDialogForErrorModal\") ? dialog_default.show(response.data) : modal_default.show(response.data);\n }\n }\n isInertiaResponse() {\n return this.hasHeader(\"x-inertia\");\n }\n hasStatus(status2) {\n return this.response.status === status2;\n }\n getHeader(header) {\n return this.response.headers[header];\n }\n hasHeader(header) {\n return this.getHeader(header) !== void 0;\n }\n isLocationVisit() {\n return this.hasStatus(409) && this.hasHeader(\"x-inertia-location\");\n }\n /**\n * @link https://inertiajs.com/redirects#external-redirects\n */\n locationVisit(url) {\n try {\n SessionStorage.set(SessionStorage.locationVisitKey, {\n preserveScroll: this.requestParams.all().preserveScroll === true\n });\n if (typeof window === \"undefined\") {\n return;\n }\n if (isSameUrlWithoutHash(window.location, url)) {\n window.location.reload();\n } else {\n window.location.href = url.href;\n }\n } catch (error) {\n return false;\n }\n }\n async setPage() {\n const pageResponse = this.getPageResponse();\n if (!this.shouldSetPage(pageResponse)) {\n return Promise.resolve();\n }\n this.mergeProps(pageResponse);\n page.mergeOncePropsIntoResponse(pageResponse);\n this.preserveEqualProps(pageResponse);\n await this.setRememberedState(pageResponse);\n this.requestParams.setPreserveOptions(pageResponse);\n pageResponse.url = history.preserveUrl ? page.get().url : this.pageUrl(pageResponse);\n this.requestParams.all().onBeforeUpdate(pageResponse);\n fireBeforeUpdateEvent(pageResponse);\n return page.set(pageResponse, {\n replace: this.requestParams.all().replace,\n preserveScroll: this.requestParams.all().preserveScroll,\n preserveState: this.requestParams.all().preserveState,\n viewTransition: this.requestParams.all().viewTransition\n });\n }\n getDataFromResponse(response) {\n if (typeof response !== \"string\") {\n return response;\n }\n try {\n return JSON.parse(response);\n } catch (error) {\n return response;\n }\n }\n shouldSetPage(pageResponse) {\n if (!this.requestParams.all().async) {\n return true;\n }\n if (this.originatingPage.component !== pageResponse.component) {\n return true;\n }\n if (this.originatingPage.component !== page.get().component) {\n return false;\n }\n const originatingUrl = hrefToUrl(this.originatingPage.url);\n const currentPageUrl = hrefToUrl(page.get().url);\n return originatingUrl.origin === currentPageUrl.origin && originatingUrl.pathname === currentPageUrl.pathname;\n }\n pageUrl(pageResponse) {\n const responseUrl = hrefToUrl(pageResponse.url);\n setHashIfSameUrl(this.requestParams.all().url, responseUrl);\n return responseUrl.pathname + responseUrl.search + responseUrl.hash;\n }\n preserveEqualProps(pageResponse) {\n if (pageResponse.component !== page.get().component || config.get(\"future.preserveEqualProps\") !== true) {\n return;\n }\n const currentPageProps = page.get().props;\n Object.entries(pageResponse.props).forEach(([key, value]) => {\n if (isEqual2(value, currentPageProps[key])) {\n pageResponse.props[key] = currentPageProps[key];\n }\n });\n }\n mergeProps(pageResponse) {\n if (!this.requestParams.isPartial() || pageResponse.component !== page.get().component) {\n return;\n }\n const propsToAppend = pageResponse.mergeProps || [];\n const propsToPrepend = pageResponse.prependProps || [];\n const propsToDeepMerge = pageResponse.deepMergeProps || [];\n const matchPropsOn = pageResponse.matchPropsOn || [];\n const mergeProp = (prop, shouldAppend) => {\n const currentProp = get2(page.get().props, prop);\n const incomingProp = get2(pageResponse.props, prop);\n if (Array.isArray(incomingProp)) {\n const newArray = this.mergeOrMatchItems(\n currentProp || [],\n incomingProp,\n prop,\n matchPropsOn,\n shouldAppend\n );\n set2(pageResponse.props, prop, newArray);\n } else if (typeof incomingProp === \"object\" && incomingProp !== null) {\n const newObject = {\n ...currentProp || {},\n ...incomingProp\n };\n set2(pageResponse.props, prop, newObject);\n }\n };\n propsToAppend.forEach((prop) => mergeProp(prop, true));\n propsToPrepend.forEach((prop) => mergeProp(prop, false));\n propsToDeepMerge.forEach((prop) => {\n const currentProp = page.get().props[prop];\n const incomingProp = pageResponse.props[prop];\n const deepMerge = (target, source, matchProp) => {\n if (Array.isArray(source)) {\n return this.mergeOrMatchItems(target, source, matchProp, matchPropsOn);\n }\n if (typeof source === \"object\" && source !== null) {\n return Object.keys(source).reduce(\n (acc, key) => {\n acc[key] = deepMerge(target ? target[key] : void 0, source[key], `${matchProp}.${key}`);\n return acc;\n },\n { ...target }\n );\n }\n return source;\n };\n pageResponse.props[prop] = deepMerge(currentProp, incomingProp, prop);\n });\n pageResponse.props = { ...page.get().props, ...pageResponse.props };\n if (this.requestParams.isDeferredPropsRequest()) {\n const currentErrors = page.get().props.errors;\n if (currentErrors && Object.keys(currentErrors).length > 0) {\n pageResponse.props.errors = currentErrors;\n }\n }\n if (page.get().scrollProps) {\n pageResponse.scrollProps = {\n ...page.get().scrollProps || {},\n ...pageResponse.scrollProps || {}\n };\n }\n if (page.hasOnceProps()) {\n pageResponse.onceProps = {\n ...page.get().onceProps || {},\n ...pageResponse.onceProps || {}\n };\n }\n if (this.requestParams.isDeferredPropsRequest()) {\n pageResponse.flash = { ...page.get().flash };\n }\n const currentOriginalDeferred = page.get().initialDeferredProps;\n if (currentOriginalDeferred && Object.keys(currentOriginalDeferred).length > 0) {\n pageResponse.initialDeferredProps = currentOriginalDeferred;\n }\n }\n mergeOrMatchItems(existingItems, newItems, matchProp, matchPropsOn, shouldAppend = true) {\n const items = Array.isArray(existingItems) ? existingItems : [];\n const matchingKey = matchPropsOn.find((key) => {\n const keyPath = key.split(\".\").slice(0, -1).join(\".\");\n return keyPath === matchProp;\n });\n if (!matchingKey) {\n return shouldAppend ? [...items, ...newItems] : [...newItems, ...items];\n }\n const uniqueProperty = matchingKey.split(\".\").pop() || \"\";\n const newItemsMap = /* @__PURE__ */ new Map();\n newItems.forEach((item) => {\n if (this.hasUniqueProperty(item, uniqueProperty)) {\n newItemsMap.set(item[uniqueProperty], item);\n }\n });\n return shouldAppend ? this.appendWithMatching(items, newItems, newItemsMap, uniqueProperty) : this.prependWithMatching(items, newItems, newItemsMap, uniqueProperty);\n }\n appendWithMatching(existingItems, newItems, newItemsMap, uniqueProperty) {\n const updatedExisting = existingItems.map((item) => {\n if (this.hasUniqueProperty(item, uniqueProperty) && newItemsMap.has(item[uniqueProperty])) {\n return newItemsMap.get(item[uniqueProperty]);\n }\n return item;\n });\n const newItemsToAdd = newItems.filter((item) => {\n if (!this.hasUniqueProperty(item, uniqueProperty)) {\n return true;\n }\n return !existingItems.some(\n (existing) => this.hasUniqueProperty(existing, uniqueProperty) && existing[uniqueProperty] === item[uniqueProperty]\n );\n });\n return [...updatedExisting, ...newItemsToAdd];\n }\n prependWithMatching(existingItems, newItems, newItemsMap, uniqueProperty) {\n const untouchedExisting = existingItems.filter((item) => {\n if (this.hasUniqueProperty(item, uniqueProperty)) {\n return !newItemsMap.has(item[uniqueProperty]);\n }\n return true;\n });\n return [...newItems, ...untouchedExisting];\n }\n hasUniqueProperty(item, property) {\n return item && typeof item === \"object\" && property in item;\n }\n async setRememberedState(pageResponse) {\n const rememberedState = await history.getState(history.rememberedState, {});\n if (this.requestParams.all().preserveState && rememberedState && pageResponse.component === page.get().component) {\n pageResponse.rememberedState = rememberedState;\n }\n }\n getScopedErrors(errors) {\n if (!this.requestParams.all().errorBag) {\n return errors;\n }\n return errors[this.requestParams.all().errorBag || \"\"] || {};\n }\n};\n\n// src/request.ts\nvar Request = class _Request {\n constructor(params, page2) {\n this.page = page2;\n this.requestHasFinished = false;\n this.requestParams = RequestParams.create(params);\n this.cancelToken = new AbortController();\n }\n static create(params, page2) {\n return new _Request(params, page2);\n }\n isPrefetch() {\n return this.requestParams.isPrefetch();\n }\n async send() {\n this.requestParams.onCancelToken(() => this.cancel({ cancelled: true }));\n fireStartEvent(this.requestParams.all());\n this.requestParams.onStart();\n if (this.requestParams.all().prefetch) {\n this.requestParams.onPrefetching();\n firePrefetchingEvent(this.requestParams.all());\n }\n const originallyPrefetch = this.requestParams.all().prefetch;\n return axios({\n method: this.requestParams.all().method,\n url: urlWithoutHash(this.requestParams.all().url).href,\n data: this.requestParams.data(),\n params: this.requestParams.queryParams(),\n signal: this.cancelToken.signal,\n headers: this.getHeaders(),\n onUploadProgress: this.onProgress.bind(this),\n // Why text? This allows us to delay JSON.parse until we're ready to use the response,\n // helps with performance particularly on large responses + history encryption\n responseType: \"text\"\n }).then((response) => {\n this.response = Response.create(this.requestParams, response, this.page);\n return this.response.handle();\n }).catch((error) => {\n if (error?.response) {\n this.response = Response.create(this.requestParams, error.response, this.page);\n return this.response.handle();\n }\n return Promise.reject(error);\n }).catch((error) => {\n if (axios.isCancel(error)) {\n return;\n }\n if (fireExceptionEvent(error)) {\n if (originallyPrefetch) {\n this.requestParams.onPrefetchError(error);\n }\n return Promise.reject(error);\n }\n }).finally(() => {\n this.finish();\n if (originallyPrefetch && this.response) {\n this.requestParams.onPrefetchResponse(this.response);\n }\n });\n }\n finish() {\n if (this.requestParams.wasCancelledAtAll()) {\n return;\n }\n this.requestParams.markAsFinished();\n this.fireFinishEvents();\n }\n fireFinishEvents() {\n if (this.requestHasFinished) {\n return;\n }\n this.requestHasFinished = true;\n fireFinishEvent(this.requestParams.all());\n this.requestParams.onFinish();\n }\n cancel({ cancelled = false, interrupted = false }) {\n if (this.requestHasFinished) {\n return;\n }\n this.cancelToken.abort();\n this.requestParams.markAsCancelled({ cancelled, interrupted });\n this.fireFinishEvents();\n }\n onProgress(progress3) {\n if (this.requestParams.data() instanceof FormData) {\n progress3.percentage = progress3.progress ? Math.round(progress3.progress * 100) : 0;\n fireProgressEvent(progress3);\n this.requestParams.all().onProgress(progress3);\n }\n }\n getHeaders() {\n const headers = {\n ...this.requestParams.headers(),\n Accept: \"text/html, application/xhtml+xml\",\n \"X-Requested-With\": \"XMLHttpRequest\",\n \"X-Inertia\": true\n };\n const page2 = page.get();\n if (page2.version) {\n headers[\"X-Inertia-Version\"] = page2.version;\n }\n const onceProps = Object.entries(page2.onceProps || {}).filter(([, onceProp]) => {\n if (page2.props[onceProp.prop] === void 0) {\n return false;\n }\n return !onceProp.expiresAt || onceProp.expiresAt > Date.now();\n }).map(([key]) => key);\n if (onceProps.length > 0) {\n headers[\"X-Inertia-Except-Once-Props\"] = onceProps.join(\",\");\n }\n return headers;\n }\n};\n\n// src/requestStream.ts\nvar RequestStream = class {\n constructor({ maxConcurrent, interruptible }) {\n this.requests = [];\n this.maxConcurrent = maxConcurrent;\n this.interruptible = interruptible;\n }\n send(request) {\n this.requests.push(request);\n request.send().finally(() => {\n this.requests = this.requests.filter((r) => r !== request);\n });\n }\n interruptInFlight() {\n this.cancel({ interrupted: true }, false);\n }\n cancelInFlight({ prefetch = true } = {}) {\n this.requests.filter((request) => prefetch || !request.isPrefetch()).forEach((request) => request.cancel({ cancelled: true }));\n }\n cancel({ cancelled = false, interrupted = false } = {}, force = false) {\n if (!force && !this.shouldCancel()) {\n return;\n }\n const request = this.requests.shift();\n request?.cancel({ cancelled, interrupted });\n }\n shouldCancel() {\n return this.interruptible && this.requests.length >= this.maxConcurrent;\n }\n};\n\n// src/router.ts\nvar Router = class {\n constructor() {\n this.syncRequestStream = new RequestStream({\n maxConcurrent: 1,\n interruptible: true\n });\n this.asyncRequestStream = new RequestStream({\n maxConcurrent: Infinity,\n interruptible: false\n });\n this.clientVisitQueue = new Queue();\n }\n init({\n initialPage,\n resolveComponent,\n swapComponent,\n onFlash\n }) {\n page.init({\n initialPage,\n resolveComponent,\n swapComponent,\n onFlash\n });\n InitialVisit.handle();\n eventHandler.init();\n eventHandler.on(\"missingHistoryItem\", () => {\n if (typeof window !== \"undefined\") {\n this.visit(window.location.href, { preserveState: true, preserveScroll: true, replace: true });\n }\n });\n eventHandler.on(\"loadDeferredProps\", (deferredProps) => {\n this.loadDeferredProps(deferredProps);\n });\n eventHandler.on(\"historyQuotaExceeded\", (url) => {\n window.location.href = url;\n });\n }\n get(url, data = {}, options = {}) {\n return this.visit(url, { ...options, method: \"get\", data });\n }\n post(url, data = {}, options = {}) {\n return this.visit(url, { preserveState: true, ...options, method: \"post\", data });\n }\n put(url, data = {}, options = {}) {\n return this.visit(url, { preserveState: true, ...options, method: \"put\", data });\n }\n patch(url, data = {}, options = {}) {\n return this.visit(url, { preserveState: true, ...options, method: \"patch\", data });\n }\n delete(url, options = {}) {\n return this.visit(url, { preserveState: true, ...options, method: \"delete\" });\n }\n reload(options = {}) {\n return this.doReload(options);\n }\n doReload(options = {}) {\n if (typeof window === \"undefined\") {\n return;\n }\n return this.visit(window.location.href, {\n ...options,\n preserveScroll: true,\n preserveState: true,\n async: true,\n headers: {\n ...options.headers || {},\n \"Cache-Control\": \"no-cache\"\n }\n });\n }\n remember(data, key = \"default\") {\n history.remember(data, key);\n }\n restore(key = \"default\") {\n return history.restore(key);\n }\n on(type, callback) {\n if (typeof window === \"undefined\") {\n return () => {\n };\n }\n return eventHandler.onGlobalEvent(type, callback);\n }\n /**\n * @deprecated Use cancelAll() instead.\n */\n cancel() {\n this.syncRequestStream.cancelInFlight();\n }\n get activePolls() {\n return polls.count;\n }\n cancelAll({ async = true, prefetch = true, sync = true } = {}) {\n if (async) {\n this.asyncRequestStream.cancelInFlight({ prefetch });\n }\n if (sync) {\n this.syncRequestStream.cancelInFlight();\n }\n }\n poll(interval, requestOptions = {}, options = {}) {\n return polls.add(\n interval,\n ({ onStart, onFinish }) => {\n const resolved = typeof requestOptions === \"function\" ? requestOptions() : requestOptions;\n this.reload({\n ...resolved,\n onCancelToken: (token) => {\n onStart(token.cancel);\n resolved.onCancelToken?.(token);\n },\n onFinish: (visit) => {\n onFinish();\n resolved.onFinish?.(visit);\n }\n });\n },\n {\n autoStart: options.autoStart ?? true,\n keepAlive: options.keepAlive ?? false,\n mode: options.mode\n }\n );\n }\n visit(href, options = {}) {\n const visit = this.getPendingVisit(href, {\n ...options,\n showProgress: options.showProgress ?? !options.async\n });\n const events = this.getVisitEvents(options);\n if (events.onBefore(visit) === false || !fireBeforeEvent(visit)) {\n return;\n }\n const currentPageUrl = hrefToUrl(page.get().url);\n const isPartialReload = visit.only.length > 0 || visit.except.length > 0 || visit.reset.length > 0;\n const isSamePage = isPartialReload ? isSameUrlWithoutQueryOrHash(visit.url, currentPageUrl) : isSameUrlWithoutHash(visit.url, currentPageUrl);\n if (!isSamePage) {\n this.asyncRequestStream.cancelInFlight({ prefetch: false });\n }\n if (!visit.async) {\n this.syncRequestStream.interruptInFlight();\n }\n if (!page.isCleared() && !visit.preserveUrl) {\n Scroll.save();\n }\n const requestParams = {\n ...visit,\n ...events\n };\n const prefetched = prefetchedRequests.get(requestParams);\n if (prefetched) {\n progress.reveal(prefetched.inFlight);\n prefetchedRequests.use(prefetched, requestParams);\n } else {\n progress.reveal(true);\n const requestStream = visit.async ? this.asyncRequestStream : this.syncRequestStream;\n requestStream.send(Request.create(requestParams, page.get()));\n }\n }\n getCached(href, options = {}) {\n return prefetchedRequests.findCached(this.getPrefetchParams(href, options));\n }\n flush(href, options = {}) {\n prefetchedRequests.remove(this.getPrefetchParams(href, options));\n }\n flushAll() {\n prefetchedRequests.removeAll();\n }\n flushByCacheTags(tags) {\n prefetchedRequests.removeByTags(Array.isArray(tags) ? tags : [tags]);\n }\n getPrefetching(href, options = {}) {\n return prefetchedRequests.findInFlight(this.getPrefetchParams(href, options));\n }\n prefetch(href, options = {}, prefetchOptions = {}) {\n const method = options.method ?? (isUrlMethodPair(href) ? href.method : \"get\");\n if (method !== \"get\") {\n throw new Error(\"Prefetch requests must use the GET method\");\n }\n const visit = this.getPendingVisit(href, {\n ...options,\n async: true,\n showProgress: false,\n prefetch: true,\n viewTransition: false\n });\n const visitUrl = visit.url.origin + visit.url.pathname + visit.url.search;\n const currentUrl = window.location.origin + window.location.pathname + window.location.search;\n if (visitUrl === currentUrl) {\n return;\n }\n const events = this.getVisitEvents(options);\n if (events.onBefore(visit) === false || !fireBeforeEvent(visit)) {\n return;\n }\n progress.hide();\n this.asyncRequestStream.interruptInFlight();\n const requestParams = {\n ...visit,\n ...events\n };\n const ensureCurrentPageIsSet = () => {\n return new Promise((resolve) => {\n const checkIfPageIsDefined = () => {\n if (page.get()) {\n resolve();\n } else {\n setTimeout(checkIfPageIsDefined, 50);\n }\n };\n checkIfPageIsDefined();\n });\n };\n ensureCurrentPageIsSet().then(() => {\n prefetchedRequests.add(\n requestParams,\n (params) => {\n this.asyncRequestStream.send(Request.create(params, page.get()));\n },\n {\n cacheFor: config.get(\"prefetch.cacheFor\"),\n cacheTags: [],\n ...prefetchOptions\n }\n );\n });\n }\n clearHistory() {\n history.clear();\n }\n decryptHistory() {\n return history.decrypt();\n }\n resolveComponent(component) {\n return page.resolve(component);\n }\n replace(params) {\n this.clientVisit(params, { replace: true });\n }\n replaceProp(name, value, options) {\n this.replace({\n preserveScroll: true,\n preserveState: true,\n props(currentProps) {\n const newValue = typeof value === \"function\" ? value(get3(currentProps, name), currentProps) : value;\n return set3(cloneDeep3(currentProps), name, newValue);\n },\n ...options || {}\n });\n }\n appendToProp(name, value, options) {\n this.replaceProp(\n name,\n (currentValue, currentProps) => {\n const newValue = typeof value === \"function\" ? value(currentValue, currentProps) : value;\n if (!Array.isArray(currentValue)) {\n currentValue = currentValue !== void 0 ? [currentValue] : [];\n }\n return [...currentValue, newValue];\n },\n options\n );\n }\n prependToProp(name, value, options) {\n this.replaceProp(\n name,\n (currentValue, currentProps) => {\n const newValue = typeof value === \"function\" ? value(currentValue, currentProps) : value;\n if (!Array.isArray(currentValue)) {\n currentValue = currentValue !== void 0 ? [currentValue] : [];\n }\n return [newValue, ...currentValue];\n },\n options\n );\n }\n push(params) {\n this.clientVisit(params);\n }\n flash(keyOrData, value) {\n const current = page.get().flash;\n let flash;\n if (typeof keyOrData === \"function\") {\n flash = keyOrData(current);\n } else if (typeof keyOrData === \"string\") {\n flash = { ...current, [keyOrData]: value };\n } else if (keyOrData && Object.keys(keyOrData).length) {\n flash = { ...current, ...keyOrData };\n } else {\n return;\n }\n page.setFlash(flash);\n if (Object.keys(flash).length) {\n fireFlashEvent(flash);\n }\n }\n clientVisit(params, { replace = false } = {}) {\n this.clientVisitQueue.add(() => this.performClientVisit(params, { replace }));\n }\n performClientVisit(params, { replace = false } = {}) {\n const current = page.get();\n const onceProps = typeof params.props === \"function\" ? Object.fromEntries(\n Object.values(current.onceProps ?? {}).map((onceProp) => [onceProp.prop, current.props[onceProp.prop]])\n ) : {};\n const props = typeof params.props === \"function\" ? params.props(current.props, onceProps) : params.props ?? current.props;\n const flash = typeof params.flash === \"function\" ? params.flash(current.flash) : params.flash;\n const { viewTransition, onError, onFinish, onFlash, onSuccess, ...pageParams } = params;\n const page2 = {\n ...current,\n ...pageParams,\n flash: flash ?? {},\n props\n };\n const preserveScroll = RequestParams.resolvePreserveOption(params.preserveScroll ?? false, page2);\n const preserveState = RequestParams.resolvePreserveOption(params.preserveState ?? false, page2);\n return page.set(page2, {\n replace,\n preserveScroll,\n preserveState,\n viewTransition\n }).then(() => {\n const currentFlash = page.get().flash;\n if (Object.keys(currentFlash).length > 0) {\n fireFlashEvent(currentFlash);\n onFlash?.(currentFlash);\n }\n const errors = page.get().props.errors || {};\n if (Object.keys(errors).length === 0) {\n onSuccess?.(page.get());\n return;\n }\n const scopedErrors = params.errorBag ? errors[params.errorBag || \"\"] || {} : errors;\n onError?.(scopedErrors);\n }).finally(() => onFinish?.(params));\n }\n getPrefetchParams(href, options) {\n return {\n ...this.getPendingVisit(href, {\n ...options,\n async: true,\n showProgress: false,\n prefetch: true,\n viewTransition: false\n }),\n ...this.getVisitEvents(options)\n };\n }\n getPendingVisit(href, options, pendingVisitOptions = {}) {\n if (isUrlMethodPair(href)) {\n const urlMethodPair = href;\n href = urlMethodPair.url;\n options.method = options.method ?? urlMethodPair.method;\n }\n const defaultVisitOptionsCallback = config.get(\"visitOptions\");\n const configuredOptions = defaultVisitOptionsCallback ? defaultVisitOptionsCallback(href.toString(), cloneDeep3(options)) || {} : {};\n const mergedOptions = {\n method: \"get\",\n data: {},\n replace: false,\n preserveScroll: false,\n preserveState: false,\n only: [],\n except: [],\n headers: {},\n errorBag: \"\",\n forceFormData: false,\n queryStringArrayFormat: \"brackets\",\n async: false,\n showProgress: true,\n fresh: false,\n reset: [],\n preserveUrl: false,\n prefetch: false,\n invalidateCacheTags: [],\n viewTransition: false,\n ...stripTopLevelUndefined(options),\n ...stripTopLevelUndefined(configuredOptions)\n };\n const [url, _data] = transformUrlAndData(\n href,\n mergedOptions.data,\n mergedOptions.method,\n mergedOptions.forceFormData,\n mergedOptions.queryStringArrayFormat\n );\n const visit = {\n cancelled: false,\n completed: false,\n interrupted: false,\n ...mergedOptions,\n ...pendingVisitOptions,\n url,\n data: _data\n };\n if (visit.prefetch) {\n visit.headers[\"Purpose\"] = \"prefetch\";\n }\n return visit;\n }\n getVisitEvents(options) {\n return {\n onCancelToken: options.onCancelToken || (() => {\n }),\n onBefore: options.onBefore || (() => {\n }),\n onBeforeUpdate: options.onBeforeUpdate || (() => {\n }),\n onStart: options.onStart || (() => {\n }),\n onProgress: options.onProgress || (() => {\n }),\n onFinish: options.onFinish || (() => {\n }),\n onCancel: options.onCancel || (() => {\n }),\n onSuccess: options.onSuccess || (() => {\n }),\n onError: options.onError || (() => {\n }),\n onFlash: options.onFlash || (() => {\n }),\n onPrefetched: options.onPrefetched || (() => {\n }),\n onPrefetching: options.onPrefetching || (() => {\n })\n };\n }\n loadDeferredProps(deferred) {\n if (deferred) {\n Object.entries(deferred).forEach(([_, group]) => {\n this.doReload({ only: group, deferredProps: true });\n });\n }\n }\n};\n\n// src/useFormUtils.ts\nvar UseFormUtils = class {\n /**\n * Creates a callback that returns a UrlMethodPair.\n *\n * createWayfinderCallback(urlMethodPair)\n * createWayfinderCallback(method, url)\n * createWayfinderCallback(() => urlMethodPair)\n * createWayfinderCallback(() => method, () => url)\n */\n static createWayfinderCallback(...args) {\n return () => {\n if (args.length === 1) {\n return isUrlMethodPair(args[0]) ? args[0] : args[0]();\n }\n return {\n method: typeof args[0] === \"function\" ? args[0]() : args[0],\n url: typeof args[1] === \"function\" ? args[1]() : args[1]\n };\n };\n }\n /**\n * Parses all useForm() arguments into { rememberKey, data, precognitionEndpoint }.\n *\n * useForm()\n * useForm(data)\n * useForm(rememberKey, data)\n * useForm(method, url, data)\n * useForm(urlMethodPair, data)\n *\n */\n static parseUseFormArguments(...args) {\n if (args.length === 0) {\n return {\n rememberKey: null,\n data: {},\n precognitionEndpoint: null\n };\n }\n if (args.length === 1) {\n return {\n rememberKey: null,\n data: args[0],\n precognitionEndpoint: null\n };\n }\n if (args.length === 2) {\n if (typeof args[0] === \"string\") {\n return {\n rememberKey: args[0],\n data: args[1],\n precognitionEndpoint: null\n };\n }\n return {\n rememberKey: null,\n data: args[1],\n precognitionEndpoint: this.createWayfinderCallback(args[0])\n };\n }\n return {\n rememberKey: null,\n data: args[2],\n precognitionEndpoint: this.createWayfinderCallback(args[0], args[1])\n };\n }\n /**\n * Parses all submission arguments into { method, url, options }.\n * It uses the Precognition endpoint if no explicit method/url are provided.\n *\n * form.submit(method, url)\n * form.submit(method, url, options)\n * form.submit(urlMethodPair)\n * form.submit(urlMethodPair, options)\n * form.submit()\n * form.submit(options)\n */\n static parseSubmitArguments(args, precognitionEndpoint) {\n if (args.length === 3 || args.length === 2 && typeof args[0] === \"string\") {\n return { method: args[0], url: args[1], options: args[2] ?? {} };\n }\n if (isUrlMethodPair(args[0])) {\n return { ...args[0], options: args[1] ?? {} };\n }\n return { ...precognitionEndpoint(), options: args[0] ?? {} };\n }\n /**\n * Merges headers into the Precognition validate() arguments.\n */\n static mergeHeadersForValidation(field, config2, headers) {\n const merge = (config3) => {\n config3.headers = {\n ...headers ?? {},\n ...config3.headers ?? {}\n };\n return config3;\n };\n if (field && typeof field === \"object\" && !(\"target\" in field)) {\n field = merge(field);\n } else if (config2 && typeof config2 === \"object\") {\n config2 = merge(config2);\n } else if (typeof field === \"string\") {\n config2 = merge(config2 ?? {});\n } else {\n field = merge(field ?? {});\n }\n return [field, config2];\n }\n};\n\n// src/formObject.ts\nimport { get as get4, set as set4 } from \"lodash-es\";\nfunction undotKey(key) {\n if (!key.includes(\".\")) {\n return key;\n }\n const transformSegment = (segment) => {\n if (segment.startsWith(\"[\") && segment.endsWith(\"]\")) {\n return segment;\n }\n return segment.split(\".\").reduce((result, part, index) => index === 0 ? part : `${result}[${part}]`);\n };\n return key.replace(/\\\\\\./g, \"__ESCAPED_DOT__\").split(/(\\[[^\\]]*\\])/).filter(Boolean).map(transformSegment).join(\"\").replace(/__ESCAPED_DOT__/g, \".\");\n}\nfunction parseKey(key) {\n const path = [];\n const pattern = /([^\\[\\]]+)|\\[(\\d*)\\]/g;\n let match;\n while ((match = pattern.exec(key)) !== null) {\n if (match[1] !== void 0) {\n path.push(match[1]);\n } else if (match[2] !== void 0) {\n path.push(match[2] === \"\" ? \"\" : Number(match[2]));\n }\n }\n return path;\n}\nfunction setNestedObject(obj, path, value) {\n let current = obj;\n for (let i = 0; i < path.length - 1; i++) {\n if (!(path[i] in current)) {\n current[path[i]] = {};\n }\n current = current[path[i]];\n }\n current[path[path.length - 1]] = value;\n}\nfunction objectHasSequentialNumericKeys(value) {\n const keys = Object.keys(value);\n const numericKeys = keys.filter((k) => /^\\d+$/.test(k)).map(Number).sort((a, b) => a - b);\n return keys.length === numericKeys.length && numericKeys.length > 0 && numericKeys[0] === 0 && numericKeys.every((n, i) => n === i);\n}\nfunction convertSequentialObjectsToArrays(value) {\n if (Array.isArray(value)) {\n return value.map(convertSequentialObjectsToArrays);\n }\n if (typeof value !== \"object\" || value === null || isFile(value)) {\n return value;\n }\n if (objectHasSequentialNumericKeys(value)) {\n const result2 = [];\n for (let i = 0; i < Object.keys(value).length; i++) {\n result2[i] = convertSequentialObjectsToArrays(value[i]);\n }\n return result2;\n }\n const result = {};\n for (const key in value) {\n result[key] = convertSequentialObjectsToArrays(value[key]);\n }\n return result;\n}\nfunction formDataToObject(source) {\n const form = {};\n for (const [key, value] of source.entries()) {\n if (value instanceof File && value.size === 0 && value.name === \"\") {\n continue;\n }\n const path = parseKey(undotKey(key));\n if (path[path.length - 1] === \"\") {\n const arrayPath = path.slice(0, -1);\n const existing = get4(form, arrayPath);\n if (Array.isArray(existing)) {\n existing.push(value);\n } else if (existing && typeof existing === \"object\" && !isFile(existing)) {\n const numericKeys = Object.keys(existing).filter((k) => /^\\d+$/.test(k)).map(Number).sort((a, b) => a - b);\n set4(form, arrayPath, numericKeys.length > 0 ? [...numericKeys.map((k) => existing[k]), value] : [value]);\n } else {\n set4(form, arrayPath, [value]);\n }\n continue;\n }\n setNestedObject(form, path.map(String), value);\n }\n return convertSequentialObjectsToArrays(form);\n}\n\n// src/head.ts\nvar Renderer = {\n preferredAttribute() {\n return config.get(\"future.useDataInertiaHeadAttribute\") ? \"data-inertia\" : \"inertia\";\n },\n buildDOMElement(tag) {\n const template = document.createElement(\"template\");\n template.innerHTML = tag;\n const node = template.content.firstChild;\n if (!tag.startsWith(\"