📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
footer to remix
Maksim Mrug91c253a1c999
diff --git a/app/components/Footer/index.tsx b/app/components/Footer/index.tsxindex 7820556eb..2b542aa71 100644--- a/app/components/Footer/index.tsx+++ b/app/components/Footer/index.tsx@@ -1,6 +1,5 @@import React, { memo } from 'react'-import { Link } from 'react-router-dom'-import { HashLink } from 'react-router-hash-link'+import { Link } from '@remix-run/react'import { useTranslation } from 'react-i18next'import _map from 'lodash/map'import Flag from 'react-flagkit'@@ -10,8 +9,8 @@ import {isSelfhosted, DONATE_URL, FIREFOX_ADDON_URL, CHROME_EXTENSION_URL, GITHUB_URL,LINKEDIN_URL, STATUSPAGE_URL, TWITTER_URL, BLOG_URL, UTM_GENERATOR_URL, SWETRIX_VS_GOOGLE,SWETRIX_VS_CLOUDFLARE, DOCS_URL, SWETRIX_VS_SIMPLE_ANALYTICS, DISCORD_URL, CAPTCHA_URL,-} from 'redux/constants'-import routes from 'routes'+} from '~/constants'+import links from '~/links'const navigation = {support: [@@ -19,7 +18,7 @@ const navigation = {key: stringhref: stringinternal: boolean- } => (authenticated ? { key: 'billing', href: routes.billing, internal: true } : { key: 'pricing', href: `${routes.main}#pricing`, internal: true }),+ } => (authenticated ? { key: 'billing', href: links.billing, internal: true } : { key: 'pricing', href: `${links.main}#pricing`, internal: true }),(): {key: stringhref: string@@ -29,13 +28,13 @@ const navigation = {key: stringhref: stringinternal: boolean- } => ({ key: 'contact', href: routes.contact, internal: true }),+ } => ({ key: 'contact', href: links.contact, internal: true }),],company: [- { key: 'about', href: routes.about, internal: true },- { key: 'changelog', href: routes.changelog, internal: true },- { key: 'open', href: routes.open, internal: true },- { key: 'press', href: routes.press, internal: true },+ { key: 'about', href: links.about, internal: true },+ { key: 'changelog', href: links.changelog, internal: true },+ { key: 'open', href: links.open, internal: true },+ { key: 'press', href: links.press, internal: true },{ key: 'status', href: STATUSPAGE_URL },{ key: 'donate', href: DONATE_URL },{ key: 'blog', href: BLOG_URL },@@ -43,9 +42,9 @@ const navigation = {{ key: 'utm', href: UTM_GENERATOR_URL },],legal: [- { key: 'privacy', href: routes.privacy },- { key: 'terms', href: routes.terms },- { key: 'cookie', href: routes.cookiePolicy },+ { key: 'privacy', href: links.privacy },+ { key: 'terms', href: links.terms },+ { key: 'cookie', href: links.cookiePolicy },],comparisons: [{ value: 'Google Analytics', href: SWETRIX_VS_GOOGLE },@@ -120,7 +119,7 @@ const SelfHostedFooter = () => {<div className='max-w-7xl mx-auto py-8 px-4 overflow-hidden sm:px-6 lg:px-8'><nav className='-mx-5 -my-2 flex flex-wrap justify-center' aria-label='Footer'><div className='px-5 py-2'>- <Link to={routes.contact} className='text-base text-gray-300 hover:text-white'>+ <Link to={links.contact} className='text-base text-gray-300 hover:text-white'>{t('footer.contact')}</Link></div>@@ -135,7 +134,7 @@ const SelfHostedFooter = () => {</a></div><div className='px-5 py-2'>- <Link to={routes.about} className='text-base text-gray-300 hover:text-white'>+ <Link to={links.about} className='text-base text-gray-300 hover:text-white'>{t('footer.about')}</Link></div>@@ -162,22 +161,22 @@ const Footer = ({ minimal, authenticated }: {<div className='max-w-7xl mx-auto py-8 px-4 overflow-hidden sm:px-6 lg:px-8'><nav className='-mx-5 -my-2 flex flex-wrap justify-center' aria-label='Footer'><div className='px-5 py-2'>- <Link to={routes.contact} className='text-base text-gray-300 hover:text-white'>+ <Link to={links.contact} className='text-base text-gray-300 hover:text-white'>{t('footer.contact')}</Link></div><div className='px-5 py-2'>- <Link to={routes.privacy} className='text-base text-gray-300 hover:text-white'>+ <Link to={links.privacy} className='text-base text-gray-300 hover:text-white'>{t('footer.pp')}</Link></div><div className='px-5 py-2'>- <Link to={routes.terms} className='text-base text-gray-300 hover:text-white'>+ <Link to={links.terms} className='text-base text-gray-300 hover:text-white'>{t('footer.tos')}</Link></div><div className='px-5 py-2'>- <Link to={routes.about} className='text-base text-gray-300 hover:text-white'>+ <Link to={links.about} className='text-base text-gray-300 hover:text-white'>{t('footer.about')}</Link></div>@@ -266,9 +265,9 @@ const Footer = ({ minimal, authenticated }: {return (<li key={key}>{internal ? (- <HashLink to={href} className='text-base text-gray-300 hover:text-white'>+ <Link to={href} className='text-base text-gray-300 hover:text-white'>{t(`footer.${key}`)}- </HashLink>+ </Link>) : (<a href={href} className='text-base text-gray-300 hover:text-white' target='_blank' rel='noopener noreferrer' aria-label={`${t(`footer.${key}`)} (opens in a new tab)`}>{t(`footer.${key}`)}diff --git a/app/links/index.ts b/app/links/index.tsnew file mode 100644index 000000000..6666ce850--- /dev/null+++ b/app/links/index.ts@@ -0,0 +1,37 @@+const routes = Object.freeze({+ signin: '/login',+ signup: '/signup',+ reset_password: '/recovery',+ new_password_form: '/password-reset/:id',+ confirm_share: '/share/:id',+ confirm_subcription: '/projects/:id/subscribers/invite',+ main: '/',+ dashboard: '/dashboard',+ user_settings: '/settings',+ verify: '/verify/:id',+ change_email: '/change-email/:id',+ new_project: '/projects/new',+ new_captcha: '/captchas/new',+ project_settings: '/projects/settings/:id',+ captcha_settings: '/captchas/settings/:id',+ project: '/projects/:id',+ captcha: '/captchas/:id',+ features: '/features',+ billing: '/billing',+ privacy: '/privacy',+ cookiePolicy: '/cookie-policy',+ terms: '/terms',+ contact: '/contact',+ changelog: '/changelog',+ about: '/about',+ create_alert: '/projects/:pid/alerts/create',+ alert_settings: '/projects/:pid/alerts/settings/:id',+ press: '/press',+ transfer_confirm: '/project/transfer/confirm',+ transfer_reject: '/project/transfer/cancel',+ socialised: '/socialised',+ project_protected_password: '/projects/:id/password',+ open: '/open',+})++export default routesdiff --git a/app/root.tsx b/app/root.tsxindex 71467535c..9cfeeffb8 100644--- a/app/root.tsx+++ b/app/root.tsx@@ -8,6 +8,7 @@ import {ScrollRestoration,} from '@remix-run/react'import tailwindCss from './css/tailwind.css'+import Footer from './components/Footer'export const links: LinksFunction = () => [{ rel: 'stylesheet', href: tailwindCss },@@ -27,6 +28,7 @@ export default function App() {<ScrollRestoration /><Scripts />{process.env.NODE_ENV === 'development' && <LiveReload />}+ <Footer /></body></html>)diff --git a/package-lock.json b/package-lock.jsonindex 8e2e5735d..93a401d70 100644--- a/package-lock.json+++ b/package-lock.json@@ -44,6 +44,7 @@"react-i18next": "^12.2.2","react-outside-click-handler": "^1.3.0","react-qr-code": "^2.0.11",+ "react-router-hash-link": "^2.4.3","react-select": "^5.7.2","react-snowfall": "^1.2.1","react-timezone-select": "^2.1.1",@@ -12783,6 +12784,18 @@"react-dom": ">=16.8"}},+ "node_modules/react-router-hash-link": {+ "version": "2.4.3",+ "resolved": "https://registry.npmjs.org/react-router-hash-link/-/react-router-hash-link-2.4.3.tgz",+ "integrity": "sha512-NU7GWc265m92xh/aYD79Vr1W+zAIXDWp3L2YZOYP4rCqPnJ6LI6vh3+rKgkidtYijozHclaEQTAHaAaMWPVI4A==",+ "dependencies": {+ "prop-types": "^15.7.2"+ },+ "peerDependencies": {+ "react": ">=15",+ "react-router-dom": ">=4"+ }+ },"node_modules/react-select": {"version": "5.7.3","resolved": "https://registry.npmjs.org/react-select/-/react-select-5.7.3.tgz",@@ -24239,6 +24252,14 @@"react-router": "6.11.2"}},+ "react-router-hash-link": {+ "version": "2.4.3",+ "resolved": "https://registry.npmjs.org/react-router-hash-link/-/react-router-hash-link-2.4.3.tgz",+ "integrity": "sha512-NU7GWc265m92xh/aYD79Vr1W+zAIXDWp3L2YZOYP4rCqPnJ6LI6vh3+rKgkidtYijozHclaEQTAHaAaMWPVI4A==",+ "requires": {+ "prop-types": "^15.7.2"+ }+ },"react-select": {"version": "5.7.3","resolved": "https://registry.npmjs.org/react-select/-/react-select-5.7.3.tgz",diff --git a/package.json b/package.jsonindex d1a685fa1..03acea949 100644--- a/package.json+++ b/package.json@@ -50,6 +50,7 @@"react-i18next": "^12.2.2","react-outside-click-handler": "^1.3.0","react-qr-code": "^2.0.11",+ "react-router-hash-link": "^2.4.3","react-select": "^5.7.2","react-snowfall": "^1.2.1","react-timezone-select": "^2.1.1",@@ -80,19 +81,11 @@"import/no-named-as-default": "off","import/no-named-as-default-member": "off","import/prefer-default-export": "off",+ "import/no-unresolved": "off","no-param-reassign": "off","@typescript-eslint/camelcase": "off","camelcase": "off",- "import/extensions": [- "error",- "ignorePackages",- {- "js": "never",- "jsx": "never",- "ts": "never",- "tsx": "never"- }- ],+ "import/extensions": "off","jsx-a11y/click-events-have-key-events": "off","jsx-a11y/control-has-associated-label": "off","jsx-a11y/label-has-for": "off",diff --git a/public/build/_shared/chunk-NLQNPAAV.js b/public/build/_shared/chunk-NLQNPAAV.jsdeleted file mode 100644index 9bb0401e9..000000000--- a/public/build/_shared/chunk-NLQNPAAV.js+++ /dev/null@@ -1,4787 +0,0 @@-var __create = Object.create;-var __defProp = Object.defineProperty;-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;-var __getOwnPropNames = Object.getOwnPropertyNames;-var __getProtoOf = Object.getPrototypeOf;-var __hasOwnProp = Object.prototype.hasOwnProperty;-var __esm = (fn, res) => function __init() {- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;-};-var __commonJS = (cb, mod) => function __require() {- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;-};-var __copyProps = (to, from, except, desc) => {- if (from && typeof from === "object" || typeof from === "function") {- for (let key of __getOwnPropNames(from))- if (!__hasOwnProp.call(to, key) && key !== except)- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });- }- return to;-};-var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(- // If the importer is in node compatibility mode or this is not an ESM- // file that has been converted to a CommonJS file using a Babel-- // compatible transform (i.e. "__esModule" has not been set), then set- // "default" to the CommonJS "module.exports" for node compatibility.- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,- mod-));--// node_modules/esbuild-plugin-polyfill-node/polyfills/global.js-var init_global = __esm({- "node_modules/esbuild-plugin-polyfill-node/polyfills/global.js"() {- }-});--// node_modules/esbuild-plugin-polyfill-node/polyfills/__dirname.js-var init_dirname = __esm({- "node_modules/esbuild-plugin-polyfill-node/polyfills/__dirname.js"() {- }-});--// node_modules/esbuild-plugin-polyfill-node/polyfills/__filename.js-var init_filename = __esm({- "node_modules/esbuild-plugin-polyfill-node/polyfills/__filename.js"() {- }-});--// node_modules/@jspm/core/nodelibs/browser/buffer.js-function dew$2() {- if (_dewExec$2)- return exports$3;- _dewExec$2 = true;- exports$3.byteLength = byteLength;- exports$3.toByteArray = toByteArray;- exports$3.fromByteArray = fromByteArray;- var lookup = [];- var revLookup = [];- var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array;- var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";- for (var i = 0, len = code.length; i < len; ++i) {- lookup[i] = code[i];- revLookup[code.charCodeAt(i)] = i;- }- revLookup["-".charCodeAt(0)] = 62;- revLookup["_".charCodeAt(0)] = 63;- function getLens(b64) {- var len2 = b64.length;- if (len2 % 4 > 0) {- throw new Error("Invalid string. Length must be a multiple of 4");- }- var validLen = b64.indexOf("=");- if (validLen === -1)- validLen = len2;- var placeHoldersLen = validLen === len2 ? 0 : 4 - validLen % 4;- return [validLen, placeHoldersLen];- }- function byteLength(b64) {- var lens = getLens(b64);- var validLen = lens[0];- var placeHoldersLen = lens[1];- return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;- }- function _byteLength(b64, validLen, placeHoldersLen) {- return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;- }- function toByteArray(b64) {- var tmp;- var lens = getLens(b64);- var validLen = lens[0];- var placeHoldersLen = lens[1];- var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));- var curByte = 0;- var len2 = placeHoldersLen > 0 ? validLen - 4 : validLen;- var i2;- for (i2 = 0; i2 < len2; i2 += 4) {- tmp = revLookup[b64.charCodeAt(i2)] << 18 | revLookup[b64.charCodeAt(i2 + 1)] << 12 | revLookup[b64.charCodeAt(i2 + 2)] << 6 | revLookup[b64.charCodeAt(i2 + 3)];- arr[curByte++] = tmp >> 16 & 255;- arr[curByte++] = tmp >> 8 & 255;- arr[curByte++] = tmp & 255;- }- if (placeHoldersLen === 2) {- tmp = revLookup[b64.charCodeAt(i2)] << 2 | revLookup[b64.charCodeAt(i2 + 1)] >> 4;- arr[curByte++] = tmp & 255;- }- if (placeHoldersLen === 1) {- tmp = revLookup[b64.charCodeAt(i2)] << 10 | revLookup[b64.charCodeAt(i2 + 1)] << 4 | revLookup[b64.charCodeAt(i2 + 2)] >> 2;- arr[curByte++] = tmp >> 8 & 255;- arr[curByte++] = tmp & 255;- }- return arr;- }- function tripletToBase64(num) {- return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63];- }- function encodeChunk(uint8, start, end) {- var tmp;- var output = [];- for (var i2 = start; i2 < end; i2 += 3) {- tmp = (uint8[i2] << 16 & 16711680) + (uint8[i2 + 1] << 8 & 65280) + (uint8[i2 + 2] & 255);- output.push(tripletToBase64(tmp));- }- return output.join("");- }- function fromByteArray(uint8) {- var tmp;- var len2 = uint8.length;- var extraBytes = len2 % 3;- var parts = [];- var maxChunkLength = 16383;- for (var i2 = 0, len22 = len2 - extraBytes; i2 < len22; i2 += maxChunkLength) {- parts.push(encodeChunk(uint8, i2, i2 + maxChunkLength > len22 ? len22 : i2 + maxChunkLength));- }- if (extraBytes === 1) {- tmp = uint8[len2 - 1];- parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "==");- } else if (extraBytes === 2) {- tmp = (uint8[len2 - 2] << 8) + uint8[len2 - 1];- parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "=");- }- return parts.join("");- }- return exports$3;-}-function dew$1() {- if (_dewExec$1)- return exports$2;- _dewExec$1 = true;- exports$2.read = function(buffer, offset, isLE, mLen, nBytes) {- var e, m;- var eLen = nBytes * 8 - mLen - 1;- var eMax = (1 << eLen) - 1;- var eBias = eMax >> 1;- var nBits = -7;- var i = isLE ? nBytes - 1 : 0;- var d = isLE ? -1 : 1;- var s = buffer[offset + i];- i += d;- e = s & (1 << -nBits) - 1;- s >>= -nBits;- nBits += eLen;- for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {- }- m = e & (1 << -nBits) - 1;- e >>= -nBits;- nBits += mLen;- for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {- }- if (e === 0) {- e = 1 - eBias;- } else if (e === eMax) {- return m ? NaN : (s ? -1 : 1) * Infinity;- } else {- m = m + Math.pow(2, mLen);- e = e - eBias;- }- return (s ? -1 : 1) * m * Math.pow(2, e - mLen);- };- exports$2.write = function(buffer, value, offset, isLE, mLen, nBytes) {- var e, m, c;- var eLen = nBytes * 8 - mLen - 1;- var eMax = (1 << eLen) - 1;- var eBias = eMax >> 1;- var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;- var i = isLE ? 0 : nBytes - 1;- var d = isLE ? 1 : -1;- var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;- value = Math.abs(value);- if (isNaN(value) || value === Infinity) {- m = isNaN(value) ? 1 : 0;- e = eMax;- } else {- e = Math.floor(Math.log(value) / Math.LN2);- if (value * (c = Math.pow(2, -e)) < 1) {- e--;- c *= 2;- }- if (e + eBias >= 1) {- value += rt / c;- } else {- value += rt * Math.pow(2, 1 - eBias);- }- if (value * c >= 2) {- e++;- c /= 2;- }- if (e + eBias >= eMax) {- m = 0;- e = eMax;- } else if (e + eBias >= 1) {- m = (value * c - 1) * Math.pow(2, mLen);- e = e + eBias;- } else {- m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);- e = 0;- }- }- for (; mLen >= 8; buffer[offset + i] = m & 255, i += d, m /= 256, mLen -= 8) {- }- e = e << mLen | m;- eLen += mLen;- for (; eLen > 0; buffer[offset + i] = e & 255, i += d, e /= 256, eLen -= 8) {- }- buffer[offset + i - d] |= s * 128;- };- return exports$2;-}-function dew() {- if (_dewExec)- return exports$1;- _dewExec = true;- const base64 = dew$2();- const ieee754 = dew$1();- const customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null;- exports$1.Buffer = Buffer3;- exports$1.SlowBuffer = SlowBuffer;- exports$1.INSPECT_MAX_BYTES = 50;- const K_MAX_LENGTH = 2147483647;- exports$1.kMaxLength = K_MAX_LENGTH;- Buffer3.TYPED_ARRAY_SUPPORT = typedArraySupport();- if (!Buffer3.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && typeof console.error === "function") {- console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");- }- function typedArraySupport() {- try {- const arr = new Uint8Array(1);- const proto = {- foo: function() {- return 42;- }- };- Object.setPrototypeOf(proto, Uint8Array.prototype);- Object.setPrototypeOf(arr, proto);- return arr.foo() === 42;- } catch (e) {- return false;- }- }- Object.defineProperty(Buffer3.prototype, "parent", {- enumerable: true,- get: function() {- if (!Buffer3.isBuffer(this))- return void 0;- return this.buffer;- }- });- Object.defineProperty(Buffer3.prototype, "offset", {- enumerable: true,- get: function() {- if (!Buffer3.isBuffer(this))- return void 0;- return this.byteOffset;- }- });- function createBuffer(length) {- if (length > K_MAX_LENGTH) {- throw new RangeError('The value "' + length + '" is invalid for option "size"');- }- const buf = new Uint8Array(length);- Object.setPrototypeOf(buf, Buffer3.prototype);- return buf;- }- function Buffer3(arg, encodingOrOffset, length) {- if (typeof arg === "number") {- if (typeof encodingOrOffset === "string") {- throw new TypeError('The "string" argument must be of type string. Received type number');- }- return allocUnsafe(arg);- }- return from(arg, encodingOrOffset, length);- }- Buffer3.poolSize = 8192;- function from(value, encodingOrOffset, length) {- if (typeof value === "string") {- return fromString(value, encodingOrOffset);- }- if (ArrayBuffer.isView(value)) {- return fromArrayView(value);- }- if (value == null) {- throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value);- }- if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) {- return fromArrayBuffer(value, encodingOrOffset, length);- }- if (typeof SharedArrayBuffer !== "undefined" && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) {- return fromArrayBuffer(value, encodingOrOffset, length);- }- if (typeof value === "number") {- throw new TypeError('The "value" argument must not be of type number. Received type number');- }- const valueOf = value.valueOf && value.valueOf();- if (valueOf != null && valueOf !== value) {- return Buffer3.from(valueOf, encodingOrOffset, length);- }- const b = fromObject(value);- if (b)- return b;- if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") {- return Buffer3.from(value[Symbol.toPrimitive]("string"), encodingOrOffset, length);- }- throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value);- }- Buffer3.from = function(value, encodingOrOffset, length) {- return from(value, encodingOrOffset, length);- };- Object.setPrototypeOf(Buffer3.prototype, Uint8Array.prototype);- Object.setPrototypeOf(Buffer3, Uint8Array);- function assertSize(size) {- if (typeof size !== "number") {- throw new TypeError('"size" argument must be of type number');- } else if (size < 0) {- throw new RangeError('The value "' + size + '" is invalid for option "size"');- }- }- function alloc(size, fill, encoding) {- assertSize(size);- if (size <= 0) {- return createBuffer(size);- }- if (fill !== void 0) {- return typeof encoding === "string" ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill);- }- return createBuffer(size);- }- Buffer3.alloc = function(size, fill, encoding) {- return alloc(size, fill, encoding);- };- function allocUnsafe(size) {- assertSize(size);- return createBuffer(size < 0 ? 0 : checked(size) | 0);- }- Buffer3.allocUnsafe = function(size) {- return allocUnsafe(size);- };- Buffer3.allocUnsafeSlow = function(size) {- return allocUnsafe(size);- };- function fromString(string, encoding) {- if (typeof encoding !== "string" || encoding === "") {- encoding = "utf8";- }- if (!Buffer3.isEncoding(encoding)) {- throw new TypeError("Unknown encoding: " + encoding);- }- const length = byteLength(string, encoding) | 0;- let buf = createBuffer(length);- const actual = buf.write(string, encoding);- if (actual !== length) {- buf = buf.slice(0, actual);- }- return buf;- }- function fromArrayLike(array) {- const length = array.length < 0 ? 0 : checked(array.length) | 0;- const buf = createBuffer(length);- for (let i = 0; i < length; i += 1) {- buf[i] = array[i] & 255;- }- return buf;- }- function fromArrayView(arrayView) {- if (isInstance(arrayView, Uint8Array)) {- const copy = new Uint8Array(arrayView);- return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength);- }- return fromArrayLike(arrayView);- }- function fromArrayBuffer(array, byteOffset, length) {- if (byteOffset < 0 || array.byteLength < byteOffset) {- throw new RangeError('"offset" is outside of buffer bounds');- }- if (array.byteLength < byteOffset + (length || 0)) {- throw new RangeError('"length" is outside of buffer bounds');- }- let buf;- if (byteOffset === void 0 && length === void 0) {- buf = new Uint8Array(array);- } else if (length === void 0) {- buf = new Uint8Array(array, byteOffset);- } else {- buf = new Uint8Array(array, byteOffset, length);- }- Object.setPrototypeOf(buf, Buffer3.prototype);- return buf;- }- function fromObject(obj) {- if (Buffer3.isBuffer(obj)) {- const len = checked(obj.length) | 0;- const buf = createBuffer(len);- if (buf.length === 0) {- return buf;- }- obj.copy(buf, 0, 0, len);- return buf;- }- if (obj.length !== void 0) {- if (typeof obj.length !== "number" || numberIsNaN(obj.length)) {- return createBuffer(0);- }- return fromArrayLike(obj);- }- if (obj.type === "Buffer" && Array.isArray(obj.data)) {- return fromArrayLike(obj.data);- }- }- function checked(length) {- if (length >= K_MAX_LENGTH) {- throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + K_MAX_LENGTH.toString(16) + " bytes");- }- return length | 0;- }- function SlowBuffer(length) {- if (+length != length) {- length = 0;- }- return Buffer3.alloc(+length);- }- Buffer3.isBuffer = function isBuffer(b) {- return b != null && b._isBuffer === true && b !== Buffer3.prototype;- };- Buffer3.compare = function compare(a, b) {- if (isInstance(a, Uint8Array))- a = Buffer3.from(a, a.offset, a.byteLength);- if (isInstance(b, Uint8Array))- b = Buffer3.from(b, b.offset, b.byteLength);- if (!Buffer3.isBuffer(a) || !Buffer3.isBuffer(b)) {- throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');- }- if (a === b)- return 0;- let x = a.length;- let y = b.length;- for (let i = 0, len = Math.min(x, y); i < len; ++i) {- if (a[i] !== b[i]) {- x = a[i];- y = b[i];- break;- }- }- if (x < y)- return -1;- if (y < x)- return 1;- return 0;- };- Buffer3.isEncoding = function isEncoding(encoding) {- switch (String(encoding).toLowerCase()) {- case "hex":- case "utf8":- case "utf-8":- case "ascii":- case "latin1":- case "binary":- case "base64":- case "ucs2":- case "ucs-2":- case "utf16le":- case "utf-16le":- return true;- default:- return false;- }- };- Buffer3.concat = function concat(list, length) {- if (!Array.isArray(list)) {- throw new TypeError('"list" argument must be an Array of Buffers');- }- if (list.length === 0) {- return Buffer3.alloc(0);- }- let i;- if (length === void 0) {- length = 0;- for (i = 0; i < list.length; ++i) {- length += list[i].length;- }- }- const buffer = Buffer3.allocUnsafe(length);- let pos = 0;- for (i = 0; i < list.length; ++i) {- let buf = list[i];- if (isInstance(buf, Uint8Array)) {- if (pos + buf.length > buffer.length) {- if (!Buffer3.isBuffer(buf))- buf = Buffer3.from(buf);- buf.copy(buffer, pos);- } else {- Uint8Array.prototype.set.call(buffer, buf, pos);- }- } else if (!Buffer3.isBuffer(buf)) {- throw new TypeError('"list" argument must be an Array of Buffers');- } else {- buf.copy(buffer, pos);- }- pos += buf.length;- }- return buffer;- };- function byteLength(string, encoding) {- if (Buffer3.isBuffer(string)) {- return string.length;- }- if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {- return string.byteLength;- }- if (typeof string !== "string") {- throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof string);- }- const len = string.length;- const mustMatch = arguments.length > 2 && arguments[2] === true;- if (!mustMatch && len === 0)- return 0;- let loweredCase = false;- for (; ; ) {- switch (encoding) {- case "ascii":- case "latin1":- case "binary":- return len;- case "utf8":- case "utf-8":- return utf8ToBytes(string).length;- case "ucs2":- case "ucs-2":- case "utf16le":- case "utf-16le":- return len * 2;- case "hex":- return len >>> 1;- case "base64":- return base64ToBytes(string).length;- default:- if (loweredCase) {- return mustMatch ? -1 : utf8ToBytes(string).length;- }- encoding = ("" + encoding).toLowerCase();- loweredCase = true;- }- }- }- Buffer3.byteLength = byteLength;- function slowToString(encoding, start, end) {- let loweredCase = false;- if (start === void 0 || start < 0) {- start = 0;- }- if (start > this.length) {- return "";- }- if (end === void 0 || end > this.length) {- end = this.length;- }- if (end <= 0) {- return "";- }- end >>>= 0;- start >>>= 0;- if (end <= start) {- return "";- }- if (!encoding)- encoding = "utf8";- while (true) {- switch (encoding) {- case "hex":- return hexSlice(this, start, end);- case "utf8":- case "utf-8":- return utf8Slice(this, start, end);- case "ascii":- return asciiSlice(this, start, end);- case "latin1":- case "binary":- return latin1Slice(this, start, end);- case "base64":- return base64Slice(this, start, end);- case "ucs2":- case "ucs-2":- case "utf16le":- case "utf-16le":- return utf16leSlice(this, start, end);- default:- if (loweredCase)- throw new TypeError("Unknown encoding: " + encoding);- encoding = (encoding + "").toLowerCase();- loweredCase = true;- }- }- }- Buffer3.prototype._isBuffer = true;- function swap(b, n, m) {- const i = b[n];- b[n] = b[m];- b[m] = i;- }- Buffer3.prototype.swap16 = function swap16() {- const len = this.length;- if (len % 2 !== 0) {- throw new RangeError("Buffer size must be a multiple of 16-bits");- }- for (let i = 0; i < len; i += 2) {- swap(this, i, i + 1);- }- return this;- };- Buffer3.prototype.swap32 = function swap32() {- const len = this.length;- if (len % 4 !== 0) {- throw new RangeError("Buffer size must be a multiple of 32-bits");- }- for (let i = 0; i < len; i += 4) {- swap(this, i, i + 3);- swap(this, i + 1, i + 2);- }- return this;- };- Buffer3.prototype.swap64 = function swap64() {- const len = this.length;- if (len % 8 !== 0) {- throw new RangeError("Buffer size must be a multiple of 64-bits");- }- for (let i = 0; i < len; i += 8) {- swap(this, i, i + 7);- swap(this, i + 1, i + 6);- swap(this, i + 2, i + 5);- swap(this, i + 3, i + 4);- }- return this;- };- Buffer3.prototype.toString = function toString() {- const length = this.length;- if (length === 0)- return "";- if (arguments.length === 0)- return utf8Slice(this, 0, length);- return slowToString.apply(this, arguments);- };- Buffer3.prototype.toLocaleString = Buffer3.prototype.toString;- Buffer3.prototype.equals = function equals(b) {- if (!Buffer3.isBuffer(b))- throw new TypeError("Argument must be a Buffer");- if (this === b)- return true;- return Buffer3.compare(this, b) === 0;- };- Buffer3.prototype.inspect = function inspect() {- let str = "";- const max = exports$1.INSPECT_MAX_BYTES;- str = this.toString("hex", 0, max).replace(/(.{2})/g, "$1 ").trim();- if (this.length > max)- str += " ... ";- return "<Buffer " + str + ">";- };- if (customInspectSymbol) {- Buffer3.prototype[customInspectSymbol] = Buffer3.prototype.inspect;- }- Buffer3.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {- if (isInstance(target, Uint8Array)) {- target = Buffer3.from(target, target.offset, target.byteLength);- }- if (!Buffer3.isBuffer(target)) {- throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof target);- }- if (start === void 0) {- start = 0;- }- if (end === void 0) {- end = target ? target.length : 0;- }- if (thisStart === void 0) {- thisStart = 0;- }- if (thisEnd === void 0) {- thisEnd = this.length;- }- if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {- throw new RangeError("out of range index");- }- if (thisStart >= thisEnd && start >= end) {- return 0;- }- if (thisStart >= thisEnd) {- return -1;- }- if (start >= end) {- return 1;- }- start >>>= 0;- end >>>= 0;- thisStart >>>= 0;- thisEnd >>>= 0;- if (this === target)- return 0;- let x = thisEnd - thisStart;- let y = end - start;- const len = Math.min(x, y);- const thisCopy = this.slice(thisStart, thisEnd);- const targetCopy = target.slice(start, end);- for (let i = 0; i < len; ++i) {- if (thisCopy[i] !== targetCopy[i]) {- x = thisCopy[i];- y = targetCopy[i];- break;- }- }- if (x < y)- return -1;- if (y < x)- return 1;- return 0;- };- function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {- if (buffer.length === 0)- return -1;- if (typeof byteOffset === "string") {- encoding = byteOffset;- byteOffset = 0;- } else if (byteOffset > 2147483647) {- byteOffset = 2147483647;- } else if (byteOffset < -2147483648) {- byteOffset = -2147483648;- }- byteOffset = +byteOffset;- if (numberIsNaN(byteOffset)) {- byteOffset = dir ? 0 : buffer.length - 1;- }- if (byteOffset < 0)- byteOffset = buffer.length + byteOffset;- if (byteOffset >= buffer.length) {- if (dir)- return -1;- else- byteOffset = buffer.length - 1;- } else if (byteOffset < 0) {- if (dir)- byteOffset = 0;- else- return -1;- }- if (typeof val === "string") {- val = Buffer3.from(val, encoding);- }- if (Buffer3.isBuffer(val)) {- if (val.length === 0) {- return -1;- }- return arrayIndexOf(buffer, val, byteOffset, encoding, dir);- } else if (typeof val === "number") {- val = val & 255;- if (typeof Uint8Array.prototype.indexOf === "function") {- if (dir) {- return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);- } else {- return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);- }- }- return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);- }- throw new TypeError("val must be string, number or Buffer");- }- function arrayIndexOf(arr, val, byteOffset, encoding, dir) {- let indexSize = 1;- let arrLength = arr.length;- let valLength = val.length;- if (encoding !== void 0) {- encoding = String(encoding).toLowerCase();- if (encoding === "ucs2" || encoding === "ucs-2" || encoding === "utf16le" || encoding === "utf-16le") {- if (arr.length < 2 || val.length < 2) {- return -1;- }- indexSize = 2;- arrLength /= 2;- valLength /= 2;- byteOffset /= 2;- }- }- function read(buf, i2) {- if (indexSize === 1) {- return buf[i2];- } else {- return buf.readUInt16BE(i2 * indexSize);- }- }- let i;- if (dir) {- let foundIndex = -1;- for (i = byteOffset; i < arrLength; i++) {- if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {- if (foundIndex === -1)- foundIndex = i;- if (i - foundIndex + 1 === valLength)- return foundIndex * indexSize;- } else {- if (foundIndex !== -1)- i -= i - foundIndex;- foundIndex = -1;- }- }- } else {- if (byteOffset + valLength > arrLength)- byteOffset = arrLength - valLength;- for (i = byteOffset; i >= 0; i--) {- let found = true;- for (let j = 0; j < valLength; j++) {- if (read(arr, i + j) !== read(val, j)) {- found = false;- break;- }- }- if (found)- return i;- }- }- return -1;- }- Buffer3.prototype.includes = function includes(val, byteOffset, encoding) {- return this.indexOf(val, byteOffset, encoding) !== -1;- };- Buffer3.prototype.indexOf = function indexOf(val, byteOffset, encoding) {- return bidirectionalIndexOf(this, val, byteOffset, encoding, true);- };- Buffer3.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {- return bidirectionalIndexOf(this, val, byteOffset, encoding, false);- };- function hexWrite(buf, string, offset, length) {- offset = Number(offset) || 0;- const remaining = buf.length - offset;- if (!length) {- length = remaining;- } else {- length = Number(length);- if (length > remaining) {- length = remaining;- }- }- const strLen = string.length;- if (length > strLen / 2) {- length = strLen / 2;- }- let i;- for (i = 0; i < length; ++i) {- const parsed = parseInt(string.substr(i * 2, 2), 16);- if (numberIsNaN(parsed))- return i;- buf[offset + i] = parsed;- }- return i;- }- function utf8Write(buf, string, offset, length) {- return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);- }- function asciiWrite(buf, string, offset, length) {- return blitBuffer(asciiToBytes(string), buf, offset, length);- }- function base64Write(buf, string, offset, length) {- return blitBuffer(base64ToBytes(string), buf, offset, length);- }- function ucs2Write(buf, string, offset, length) {- return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);- }- Buffer3.prototype.write = function write(string, offset, length, encoding) {- if (offset === void 0) {- encoding = "utf8";- length = this.length;- offset = 0;- } else if (length === void 0 && typeof offset === "string") {- encoding = offset;- length = this.length;- offset = 0;- } else if (isFinite(offset)) {- offset = offset >>> 0;- if (isFinite(length)) {- length = length >>> 0;- if (encoding === void 0)- encoding = "utf8";- } else {- encoding = length;- length = void 0;- }- } else {- throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");- }- const remaining = this.length - offset;- if (length === void 0 || length > remaining)- length = remaining;- if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) {- throw new RangeError("Attempt to write outside buffer bounds");- }- if (!encoding)- encoding = "utf8";- let loweredCase = false;- for (; ; ) {- switch (encoding) {- case "hex":- return hexWrite(this, string, offset, length);- case "utf8":- case "utf-8":- return utf8Write(this, string, offset, length);- case "ascii":- case "latin1":- case "binary":- return asciiWrite(this, string, offset, length);- case "base64":- return base64Write(this, string, offset, length);- case "ucs2":- case "ucs-2":- case "utf16le":- case "utf-16le":- return ucs2Write(this, string, offset, length);- default:- if (loweredCase)- throw new TypeError("Unknown encoding: " + encoding);- encoding = ("" + encoding).toLowerCase();- loweredCase = true;- }- }- };- Buffer3.prototype.toJSON = function toJSON() {- return {- type: "Buffer",- data: Array.prototype.slice.call(this._arr || this, 0)- };- };- function base64Slice(buf, start, end) {- if (start === 0 && end === buf.length) {- return base64.fromByteArray(buf);- } else {- return base64.fromByteArray(buf.slice(start, end));- }- }- function utf8Slice(buf, start, end) {- end = Math.min(buf.length, end);- const res = [];- let i = start;- while (i < end) {- const firstByte = buf[i];- let codePoint = null;- let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1;- if (i + bytesPerSequence <= end) {- let secondByte, thirdByte, fourthByte, tempCodePoint;- switch (bytesPerSequence) {- case 1:- if (firstByte < 128) {- codePoint = firstByte;- }- break;- case 2:- secondByte = buf[i + 1];- if ((secondByte & 192) === 128) {- tempCodePoint = (firstByte & 31) << 6 | secondByte & 63;- if (tempCodePoint > 127) {- codePoint = tempCodePoint;- }- }- break;- case 3:- secondByte = buf[i + 1];- thirdByte = buf[i + 2];- if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) {- tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63;- if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) {- codePoint = tempCodePoint;- }- }- break;- case 4:- secondByte = buf[i + 1];- thirdByte = buf[i + 2];- fourthByte = buf[i + 3];- if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) {- tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63;- if (tempCodePoint > 65535 && tempCodePoint < 1114112) {- codePoint = tempCodePoint;- }- }- }- }- if (codePoint === null) {- codePoint = 65533;- bytesPerSequence = 1;- } else if (codePoint > 65535) {- codePoint -= 65536;- res.push(codePoint >>> 10 & 1023 | 55296);- codePoint = 56320 | codePoint & 1023;- }- res.push(codePoint);- i += bytesPerSequence;- }- return decodeCodePointsArray(res);- }- const MAX_ARGUMENTS_LENGTH = 4096;- function decodeCodePointsArray(codePoints) {- const len = codePoints.length;- if (len <= MAX_ARGUMENTS_LENGTH) {- return String.fromCharCode.apply(String, codePoints);- }- let res = "";- let i = 0;- while (i < len) {- res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH));- }- return res;- }- function asciiSlice(buf, start, end) {- let ret = "";- end = Math.min(buf.length, end);- for (let i = start; i < end; ++i) {- ret += String.fromCharCode(buf[i] & 127);- }- return ret;- }- function latin1Slice(buf, start, end) {- let ret = "";- end = Math.min(buf.length, end);- for (let i = start; i < end; ++i) {- ret += String.fromCharCode(buf[i]);- }- return ret;- }- function hexSlice(buf, start, end) {- const len = buf.length;- if (!start || start < 0)- start = 0;- if (!end || end < 0 || end > len)- end = len;- let out = "";- for (let i = start; i < end; ++i) {- out += hexSliceLookupTable[buf[i]];- }- return out;- }- function utf16leSlice(buf, start, end) {- const bytes = buf.slice(start, end);- let res = "";- for (let i = 0; i < bytes.length - 1; i += 2) {- res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);- }- return res;- }- Buffer3.prototype.slice = function slice(start, end) {- const len = this.length;- start = ~~start;- end = end === void 0 ? len : ~~end;- if (start < 0) {- start += len;- if (start < 0)- start = 0;- } else if (start > len) {- start = len;- }- if (end < 0) {- end += len;- if (end < 0)- end = 0;- } else if (end > len) {- end = len;- }- if (end < start)- end = start;- const newBuf = this.subarray(start, end);- Object.setPrototypeOf(newBuf, Buffer3.prototype);- return newBuf;- };- function checkOffset(offset, ext, length) {- if (offset % 1 !== 0 || offset < 0)- throw new RangeError("offset is not uint");- if (offset + ext > length)- throw new RangeError("Trying to access beyond buffer length");- }- Buffer3.prototype.readUintLE = Buffer3.prototype.readUIntLE = function readUIntLE(offset, byteLength2, noAssert) {- offset = offset >>> 0;- byteLength2 = byteLength2 >>> 0;- if (!noAssert)- checkOffset(offset, byteLength2, this.length);- let val = this[offset];- let mul = 1;- let i = 0;- while (++i < byteLength2 && (mul *= 256)) {- val += this[offset + i] * mul;- }- return val;- };- Buffer3.prototype.readUintBE = Buffer3.prototype.readUIntBE = function readUIntBE(offset, byteLength2, noAssert) {- offset = offset >>> 0;- byteLength2 = byteLength2 >>> 0;- if (!noAssert) {- checkOffset(offset, byteLength2, this.length);- }- let val = this[offset + --byteLength2];- let mul = 1;- while (byteLength2 > 0 && (mul *= 256)) {- val += this[offset + --byteLength2] * mul;- }- return val;- };- Buffer3.prototype.readUint8 = Buffer3.prototype.readUInt8 = function readUInt8(offset, noAssert) {- offset = offset >>> 0;- if (!noAssert)- checkOffset(offset, 1, this.length);- return this[offset];- };- Buffer3.prototype.readUint16LE = Buffer3.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {- offset = offset >>> 0;- if (!noAssert)- checkOffset(offset, 2, this.length);- return this[offset] | this[offset + 1] << 8;- };- Buffer3.prototype.readUint16BE = Buffer3.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {- offset = offset >>> 0;- if (!noAssert)- checkOffset(offset, 2, this.length);- return this[offset] << 8 | this[offset + 1];- };- Buffer3.prototype.readUint32LE = Buffer3.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {- offset = offset >>> 0;- if (!noAssert)- checkOffset(offset, 4, this.length);- return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216;- };- Buffer3.prototype.readUint32BE = Buffer3.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {- offset = offset >>> 0;- if (!noAssert)- checkOffset(offset, 4, this.length);- return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);- };- Buffer3.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE(offset) {- offset = offset >>> 0;- validateNumber(offset, "offset");- const first = this[offset];- const last = this[offset + 7];- if (first === void 0 || last === void 0) {- boundsError(offset, this.length - 8);- }- const lo = first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24;- const hi = this[++offset] + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + last * 2 ** 24;- return BigInt(lo) + (BigInt(hi) << BigInt(32));- });- Buffer3.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE(offset) {- offset = offset >>> 0;- validateNumber(offset, "offset");- const first = this[offset];- const last = this[offset + 7];- if (first === void 0 || last === void 0) {- boundsError(offset, this.length - 8);- }- const hi = first * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset];- const lo = this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last;- return (BigInt(hi) << BigInt(32)) + BigInt(lo);- });- Buffer3.prototype.readIntLE = function readIntLE(offset, byteLength2, noAssert) {- offset = offset >>> 0;- byteLength2 = byteLength2 >>> 0;- if (!noAssert)- checkOffset(offset, byteLength2, this.length);- let val = this[offset];- let mul = 1;- let i = 0;- while (++i < byteLength2 && (mul *= 256)) {- val += this[offset + i] * mul;- }- mul *= 128;- if (val >= mul)- val -= Math.pow(2, 8 * byteLength2);- return val;- };- Buffer3.prototype.readIntBE = function readIntBE(offset, byteLength2, noAssert) {- offset = offset >>> 0;- byteLength2 = byteLength2 >>> 0;- if (!noAssert)- checkOffset(offset, byteLength2, this.length);- let i = byteLength2;- let mul = 1;- let val = this[offset + --i];- while (i > 0 && (mul *= 256)) {- val += this[offset + --i] * mul;- }- mul *= 128;- if (val >= mul)- val -= Math.pow(2, 8 * byteLength2);- return val;- };- Buffer3.prototype.readInt8 = function readInt8(offset, noAssert) {- offset = offset >>> 0;- if (!noAssert)- checkOffset(offset, 1, this.length);- if (!(this[offset] & 128))- return this[offset];- return (255 - this[offset] + 1) * -1;- };- Buffer3.prototype.readInt16LE = function readInt16LE(offset, noAssert) {- offset = offset >>> 0;- if (!noAssert)- checkOffset(offset, 2, this.length);- const val = this[offset] | this[offset + 1] << 8;- return val & 32768 ? val | 4294901760 : val;- };- Buffer3.prototype.readInt16BE = function readInt16BE(offset, noAssert) {- offset = offset >>> 0;- if (!noAssert)- checkOffset(offset, 2, this.length);- const val = this[offset + 1] | this[offset] << 8;- return val & 32768 ? val | 4294901760 : val;- };- Buffer3.prototype.readInt32LE = function readInt32LE(offset, noAssert) {- offset = offset >>> 0;- if (!noAssert)- checkOffset(offset, 4, this.length);- return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;- };- Buffer3.prototype.readInt32BE = function readInt32BE(offset, noAssert) {- offset = offset >>> 0;- if (!noAssert)- checkOffset(offset, 4, this.length);- return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];- };- Buffer3.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE(offset) {- offset = offset >>> 0;- validateNumber(offset, "offset");- const first = this[offset];- const last = this[offset + 7];- if (first === void 0 || last === void 0) {- boundsError(offset, this.length - 8);- }- const val = this[offset + 4] + this[offset + 5] * 2 ** 8 + this[offset + 6] * 2 ** 16 + (last << 24);- return (BigInt(val) << BigInt(32)) + BigInt(first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24);- });- Buffer3.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE(offset) {- offset = offset >>> 0;- validateNumber(offset, "offset");- const first = this[offset];- const last = this[offset + 7];- if (first === void 0 || last === void 0) {- boundsError(offset, this.length - 8);- }- const val = (first << 24) + // Overflow- this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset];- return (BigInt(val) << BigInt(32)) + BigInt(this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last);- });- Buffer3.prototype.readFloatLE = function readFloatLE(offset, noAssert) {- offset = offset >>> 0;- if (!noAssert)- checkOffset(offset, 4, this.length);- return ieee754.read(this, offset, true, 23, 4);- };- Buffer3.prototype.readFloatBE = function readFloatBE(offset, noAssert) {- offset = offset >>> 0;- if (!noAssert)- checkOffset(offset, 4, this.length);- return ieee754.read(this, offset, false, 23, 4);- };- Buffer3.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {- offset = offset >>> 0;- if (!noAssert)- checkOffset(offset, 8, this.length);- return ieee754.read(this, offset, true, 52, 8);- };- Buffer3.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {- offset = offset >>> 0;- if (!noAssert)- checkOffset(offset, 8, this.length);- return ieee754.read(this, offset, false, 52, 8);- };- function checkInt(buf, value, offset, ext, max, min) {- if (!Buffer3.isBuffer(buf))- throw new TypeError('"buffer" argument must be a Buffer instance');- if (value > max || value < min)- throw new RangeError('"value" argument is out of bounds');- if (offset + ext > buf.length)- throw new RangeError("Index out of range");- }- Buffer3.prototype.writeUintLE = Buffer3.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength2, noAssert) {- value = +value;- offset = offset >>> 0;- byteLength2 = byteLength2 >>> 0;- if (!noAssert) {- const maxBytes = Math.pow(2, 8 * byteLength2) - 1;- checkInt(this, value, offset, byteLength2, maxBytes, 0);- }- let mul = 1;- let i = 0;- this[offset] = value & 255;- while (++i < byteLength2 && (mul *= 256)) {- this[offset + i] = value / mul & 255;- }- return offset + byteLength2;- };- Buffer3.prototype.writeUintBE = Buffer3.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength2, noAssert) {- value = +value;- offset = offset >>> 0;- byteLength2 = byteLength2 >>> 0;- if (!noAssert) {- const maxBytes = Math.pow(2, 8 * byteLength2) - 1;- checkInt(this, value, offset, byteLength2, maxBytes, 0);- }- let i = byteLength2 - 1;- let mul = 1;- this[offset + i] = value & 255;- while (--i >= 0 && (mul *= 256)) {- this[offset + i] = value / mul & 255;- }- return offset + byteLength2;- };- Buffer3.prototype.writeUint8 = Buffer3.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {- value = +value;- offset = offset >>> 0;- if (!noAssert)- checkInt(this, value, offset, 1, 255, 0);- this[offset] = value & 255;- return offset + 1;- };- Buffer3.prototype.writeUint16LE = Buffer3.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {- value = +value;- offset = offset >>> 0;- if (!noAssert)- checkInt(this, value, offset, 2, 65535, 0);- this[offset] = value & 255;- this[offset + 1] = value >>> 8;- return offset + 2;- };- Buffer3.prototype.writeUint16BE = Buffer3.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {- value = +value;- offset = offset >>> 0;- if (!noAssert)- checkInt(this, value, offset, 2, 65535, 0);- this[offset] = value >>> 8;- this[offset + 1] = value & 255;- return offset + 2;- };- Buffer3.prototype.writeUint32LE = Buffer3.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {- value = +value;- offset = offset >>> 0;- if (!noAssert)- checkInt(this, value, offset, 4, 4294967295, 0);- this[offset + 3] = value >>> 24;- this[offset + 2] = value >>> 16;- this[offset + 1] = value >>> 8;- this[offset] = value & 255;- return offset + 4;- };- Buffer3.prototype.writeUint32BE = Buffer3.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {- value = +value;- offset = offset >>> 0;- if (!noAssert)- checkInt(this, value, offset, 4, 4294967295, 0);- this[offset] = value >>> 24;- this[offset + 1] = value >>> 16;- this[offset + 2] = value >>> 8;- this[offset + 3] = value & 255;- return offset + 4;- };- function wrtBigUInt64LE(buf, value, offset, min, max) {- checkIntBI(value, min, max, buf, offset, 7);- let lo = Number(value & BigInt(4294967295));- buf[offset++] = lo;- lo = lo >> 8;- buf[offset++] = lo;- lo = lo >> 8;- buf[offset++] = lo;- lo = lo >> 8;- buf[offset++] = lo;- let hi = Number(value >> BigInt(32) & BigInt(4294967295));- buf[offset++] = hi;- hi = hi >> 8;- buf[offset++] = hi;- hi = hi >> 8;- buf[offset++] = hi;- hi = hi >> 8;- buf[offset++] = hi;- return offset;- }- function wrtBigUInt64BE(buf, value, offset, min, max) {- checkIntBI(value, min, max, buf, offset, 7);- let lo = Number(value & BigInt(4294967295));- buf[offset + 7] = lo;- lo = lo >> 8;- buf[offset + 6] = lo;- lo = lo >> 8;- buf[offset + 5] = lo;- lo = lo >> 8;- buf[offset + 4] = lo;- let hi = Number(value >> BigInt(32) & BigInt(4294967295));- buf[offset + 3] = hi;- hi = hi >> 8;- buf[offset + 2] = hi;- hi = hi >> 8;- buf[offset + 1] = hi;- hi = hi >> 8;- buf[offset] = hi;- return offset + 8;- }- Buffer3.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE(value, offset = 0) {- return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff"));- });- Buffer3.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE(value, offset = 0) {- return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff"));- });- Buffer3.prototype.writeIntLE = function writeIntLE(value, offset, byteLength2, noAssert) {- value = +value;- offset = offset >>> 0;- if (!noAssert) {- const limit = Math.pow(2, 8 * byteLength2 - 1);- checkInt(this, value, offset, byteLength2, limit - 1, -limit);- }- let i = 0;- let mul = 1;- let sub = 0;- this[offset] = value & 255;- while (++i < byteLength2 && (mul *= 256)) {- if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {- sub = 1;- }- this[offset + i] = (value / mul >> 0) - sub & 255;- }- return offset + byteLength2;- };- Buffer3.prototype.writeIntBE = function writeIntBE(value, offset, byteLength2, noAssert) {- value = +value;- offset = offset >>> 0;- if (!noAssert) {- const limit = Math.pow(2, 8 * byteLength2 - 1);- checkInt(this, value, offset, byteLength2, limit - 1, -limit);- }- let i = byteLength2 - 1;- let mul = 1;- let sub = 0;- this[offset + i] = value & 255;- while (--i >= 0 && (mul *= 256)) {- if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {- sub = 1;- }- this[offset + i] = (value / mul >> 0) - sub & 255;- }- return offset + byteLength2;- };- Buffer3.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {- value = +value;- offset = offset >>> 0;- if (!noAssert)- checkInt(this, value, offset, 1, 127, -128);- if (value < 0)- value = 255 + value + 1;- this[offset] = value & 255;- return offset + 1;- };- Buffer3.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {- value = +value;- offset = offset >>> 0;- if (!noAssert)- checkInt(this, value, offset, 2, 32767, -32768);- this[offset] = value & 255;- this[offset + 1] = value >>> 8;- return offset + 2;- };- Buffer3.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {- value = +value;- offset = offset >>> 0;- if (!noAssert)- checkInt(this, value, offset, 2, 32767, -32768);- this[offset] = value >>> 8;- this[offset + 1] = value & 255;- return offset + 2;- };- Buffer3.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {- value = +value;- offset = offset >>> 0;- if (!noAssert)- checkInt(this, value, offset, 4, 2147483647, -2147483648);- this[offset] = value & 255;- this[offset + 1] = value >>> 8;- this[offset + 2] = value >>> 16;- this[offset + 3] = value >>> 24;- return offset + 4;- };- Buffer3.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {- value = +value;- offset = offset >>> 0;- if (!noAssert)- checkInt(this, value, offset, 4, 2147483647, -2147483648);- if (value < 0)- value = 4294967295 + value + 1;- this[offset] = value >>> 24;- this[offset + 1] = value >>> 16;- this[offset + 2] = value >>> 8;- this[offset + 3] = value & 255;- return offset + 4;- };- Buffer3.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE(value, offset = 0) {- return wrtBigUInt64LE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));- });- Buffer3.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE(value, offset = 0) {- return wrtBigUInt64BE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));- });- function checkIEEE754(buf, value, offset, ext, max, min) {- if (offset + ext > buf.length)- throw new RangeError("Index out of range");- if (offset < 0)- throw new RangeError("Index out of range");- }- function writeFloat(buf, value, offset, littleEndian, noAssert) {- value = +value;- offset = offset >>> 0;- if (!noAssert) {- checkIEEE754(buf, value, offset, 4);- }- ieee754.write(buf, value, offset, littleEndian, 23, 4);- return offset + 4;- }- Buffer3.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {- return writeFloat(this, value, offset, true, noAssert);- };- Buffer3.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {- return writeFloat(this, value, offset, false, noAssert);- };- function writeDouble(buf, value, offset, littleEndian, noAssert) {- value = +value;- offset = offset >>> 0;- if (!noAssert) {- checkIEEE754(buf, value, offset, 8);- }- ieee754.write(buf, value, offset, littleEndian, 52, 8);- return offset + 8;- }- Buffer3.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {- return writeDouble(this, value, offset, true, noAssert);- };- Buffer3.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {- return writeDouble(this, value, offset, false, noAssert);- };- Buffer3.prototype.copy = function copy(target, targetStart, start, end) {- if (!Buffer3.isBuffer(target))- throw new TypeError("argument should be a Buffer");- if (!start)- start = 0;- if (!end && end !== 0)- end = this.length;- if (targetStart >= target.length)- targetStart = target.length;- if (!targetStart)- targetStart = 0;- if (end > 0 && end < start)- end = start;- if (end === start)- return 0;- if (target.length === 0 || this.length === 0)- return 0;- if (targetStart < 0) {- throw new RangeError("targetStart out of bounds");- }- if (start < 0 || start >= this.length)- throw new RangeError("Index out of range");- if (end < 0)- throw new RangeError("sourceEnd out of bounds");- if (end > this.length)- end = this.length;- if (target.length - targetStart < end - start) {- end = target.length - targetStart + start;- }- const len = end - start;- if (this === target && typeof Uint8Array.prototype.copyWithin === "function") {- this.copyWithin(targetStart, start, end);- } else {- Uint8Array.prototype.set.call(target, this.subarray(start, end), targetStart);- }- return len;- };- Buffer3.prototype.fill = function fill(val, start, end, encoding) {- if (typeof val === "string") {- if (typeof start === "string") {- encoding = start;- start = 0;- end = this.length;- } else if (typeof end === "string") {- encoding = end;- end = this.length;- }- if (encoding !== void 0 && typeof encoding !== "string") {- throw new TypeError("encoding must be a string");- }- if (typeof encoding === "string" && !Buffer3.isEncoding(encoding)) {- throw new TypeError("Unknown encoding: " + encoding);- }- if (val.length === 1) {- const code = val.charCodeAt(0);- if (encoding === "utf8" && code < 128 || encoding === "latin1") {- val = code;- }- }- } else if (typeof val === "number") {- val = val & 255;- } else if (typeof val === "boolean") {- val = Number(val);- }- if (start < 0 || this.length < start || this.length < end) {- throw new RangeError("Out of range index");- }- if (end <= start) {- return this;- }- start = start >>> 0;- end = end === void 0 ? this.length : end >>> 0;- if (!val)- val = 0;- let i;- if (typeof val === "number") {- for (i = start; i < end; ++i) {- this[i] = val;- }- } else {- const bytes = Buffer3.isBuffer(val) ? val : Buffer3.from(val, encoding);- const len = bytes.length;- if (len === 0) {- throw new TypeError('The value "' + val + '" is invalid for argument "value"');- }- for (i = 0; i < end - start; ++i) {- this[i + start] = bytes[i % len];- }- }- return this;- };- const errors = {};- function E(sym, getMessage, Base) {- errors[sym] = class NodeError extends Base {- constructor() {- super();- Object.defineProperty(this, "message", {- value: getMessage.apply(this, arguments),- writable: true,- configurable: true- });- this.name = `${this.name} [${sym}]`;- this.stack;- delete this.name;- }- get code() {- return sym;- }- set code(value) {- Object.defineProperty(this, "code", {- configurable: true,- enumerable: true,- value,- writable: true- });- }- toString() {- return `${this.name} [${sym}]: ${this.message}`;- }- };- }- E("ERR_BUFFER_OUT_OF_BOUNDS", function(name) {- if (name) {- return `${name} is outside of buffer bounds`;- }- return "Attempt to access memory outside buffer bounds";- }, RangeError);- E("ERR_INVALID_ARG_TYPE", function(name, actual) {- return `The "${name}" argument must be of type number. Received type ${typeof actual}`;- }, TypeError);- E("ERR_OUT_OF_RANGE", function(str, range, input) {- let msg = `The value of "${str}" is out of range.`;- let received = input;- if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {- received = addNumericalSeparator(String(input));- } else if (typeof input === "bigint") {- received = String(input);- if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {- received = addNumericalSeparator(received);- }- received += "n";- }- msg += ` It must be ${range}. Received ${received}`;- return msg;- }, RangeError);- function addNumericalSeparator(val) {- let res = "";- let i = val.length;- const start = val[0] === "-" ? 1 : 0;- for (; i >= start + 4; i -= 3) {- res = `_${val.slice(i - 3, i)}${res}`;- }- return `${val.slice(0, i)}${res}`;- }- function checkBounds(buf, offset, byteLength2) {- validateNumber(offset, "offset");- if (buf[offset] === void 0 || buf[offset + byteLength2] === void 0) {- boundsError(offset, buf.length - (byteLength2 + 1));- }- }- function checkIntBI(value, min, max, buf, offset, byteLength2) {- if (value > max || value < min) {- const n = typeof min === "bigint" ? "n" : "";- let range;- if (byteLength2 > 3) {- if (min === 0 || min === BigInt(0)) {- range = `>= 0${n} and < 2${n} ** ${(byteLength2 + 1) * 8}${n}`;- } else {- range = `>= -(2${n} ** ${(byteLength2 + 1) * 8 - 1}${n}) and < 2 ** ${(byteLength2 + 1) * 8 - 1}${n}`;- }- } else {- range = `>= ${min}${n} and <= ${max}${n}`;- }- throw new errors.ERR_OUT_OF_RANGE("value", range, value);- }- checkBounds(buf, offset, byteLength2);- }- function validateNumber(value, name) {- if (typeof value !== "number") {- throw new errors.ERR_INVALID_ARG_TYPE(name, "number", value);- }- }- function boundsError(value, length, type) {- if (Math.floor(value) !== value) {- validateNumber(value, type);- throw new errors.ERR_OUT_OF_RANGE(type || "offset", "an integer", value);- }- if (length < 0) {- throw new errors.ERR_BUFFER_OUT_OF_BOUNDS();- }- throw new errors.ERR_OUT_OF_RANGE(type || "offset", `>= ${type ? 1 : 0} and <= ${length}`, value);- }- const INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g;- function base64clean(str) {- str = str.split("=")[0];- str = str.trim().replace(INVALID_BASE64_RE, "");- if (str.length < 2)- return "";- while (str.length % 4 !== 0) {- str = str + "=";- }- return str;- }- function utf8ToBytes(string, units) {- units = units || Infinity;- let codePoint;- const length = string.length;- let leadSurrogate = null;- const bytes = [];- for (let i = 0; i < length; ++i) {- codePoint = string.charCodeAt(i);- if (codePoint > 55295 && codePoint < 57344) {- if (!leadSurrogate) {- if (codePoint > 56319) {- if ((units -= 3) > -1)- bytes.push(239, 191, 189);- continue;- } else if (i + 1 === length) {- if ((units -= 3) > -1)- bytes.push(239, 191, 189);- continue;- }- leadSurrogate = codePoint;- continue;- }- if (codePoint < 56320) {- if ((units -= 3) > -1)- bytes.push(239, 191, 189);- leadSurrogate = codePoint;- continue;- }- codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536;- } else if (leadSurrogate) {- if ((units -= 3) > -1)- bytes.push(239, 191, 189);- }- leadSurrogate = null;- if (codePoint < 128) {- if ((units -= 1) < 0)- break;- bytes.push(codePoint);- } else if (codePoint < 2048) {- if ((units -= 2) < 0)- break;- bytes.push(codePoint >> 6 | 192, codePoint & 63 | 128);- } else if (codePoint < 65536) {- if ((units -= 3) < 0)- break;- bytes.push(codePoint >> 12 | 224, codePoint >> 6 & 63 | 128, codePoint & 63 | 128);- } else if (codePoint < 1114112) {- if ((units -= 4) < 0)- break;- bytes.push(codePoint >> 18 | 240, codePoint >> 12 & 63 | 128, codePoint >> 6 & 63 | 128, codePoint & 63 | 128);- } else {- throw new Error("Invalid code point");- }- }- return bytes;- }- function asciiToBytes(str) {- const byteArray = [];- for (let i = 0; i < str.length; ++i) {- byteArray.push(str.charCodeAt(i) & 255);- }- return byteArray;- }- function utf16leToBytes(str, units) {- let c, hi, lo;- const byteArray = [];- for (let i = 0; i < str.length; ++i) {- if ((units -= 2) < 0)- break;- c = str.charCodeAt(i);- hi = c >> 8;- lo = c % 256;- byteArray.push(lo);- byteArray.push(hi);- }- return byteArray;- }- function base64ToBytes(str) {- return base64.toByteArray(base64clean(str));- }- function blitBuffer(src, dst, offset, length) {- let i;- for (i = 0; i < length; ++i) {- if (i + offset >= dst.length || i >= src.length)- break;- dst[i + offset] = src[i];- }- return i;- }- function isInstance(obj, type) {- return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name;- }- function numberIsNaN(obj) {- return obj !== obj;- }- const hexSliceLookupTable = function() {- const alphabet = "0123456789abcdef";- const table = new Array(256);- for (let i = 0; i < 16; ++i) {- const i16 = i * 16;- for (let j = 0; j < 16; ++j) {- table[i16 + j] = alphabet[i] + alphabet[j];- }- }- return table;- }();- function defineBigIntMethod(fn) {- return typeof BigInt === "undefined" ? BufferBigIntNotDefined : fn;- }- function BufferBigIntNotDefined() {- throw new Error("BigInt not supported");- }- return exports$1;-}-var exports$3, _dewExec$2, exports$2, _dewExec$1, exports$1, _dewExec, exports, Buffer2, INSPECT_MAX_BYTES, kMaxLength;-var init_buffer = __esm({- "node_modules/@jspm/core/nodelibs/browser/buffer.js"() {- init_global();- init_dirname();- init_filename();- init_buffer2();- init_process2();- exports$3 = {};- _dewExec$2 = false;- exports$2 = {};- _dewExec$1 = false;- exports$1 = {};- _dewExec = false;- exports = dew();- exports["Buffer"];- exports["SlowBuffer"];- exports["INSPECT_MAX_BYTES"];- exports["kMaxLength"];- Buffer2 = exports.Buffer;- INSPECT_MAX_BYTES = exports.INSPECT_MAX_BYTES;- kMaxLength = exports.kMaxLength;- }-});--// node_modules/esbuild-plugin-polyfill-node/polyfills/buffer.js-var init_buffer2 = __esm({- "node_modules/esbuild-plugin-polyfill-node/polyfills/buffer.js"() {- init_buffer();- }-});--// node_modules/@jspm/core/nodelibs/browser/process.js-function Item(fun, array) {- this.fun = fun;- this.array = array;-}-function hrtime(previousTimestamp) {- var baseNow = Math.floor((Date.now() - _performance.now()) * 1e-3);- var clocktime = _performance.now() * 1e-3;- var seconds = Math.floor(clocktime) + baseNow;- var nanoseconds = Math.floor(clocktime % 1 * 1e9);- if (previousTimestamp) {- seconds = seconds - previousTimestamp[0];- nanoseconds = nanoseconds - previousTimestamp[1];- if (nanoseconds < 0) {- seconds--;- nanoseconds += nanoPerSec;- }- }- return [seconds, nanoseconds];-}-var env, _performance, nowOffset, nanoPerSec;-var init_process = __esm({- "node_modules/@jspm/core/nodelibs/browser/process.js"() {- init_global();- init_dirname();- init_filename();- init_buffer2();- init_process2();- Item.prototype.run = function() {- this.fun.apply(null, this.array);- };- env = {- PATH: "/usr/bin",- LANG: navigator.language + ".UTF-8",- PWD: "/",- HOME: "/home",- TMP: "/tmp"- };- _performance = {- now: typeof performance !== "undefined" ? performance.now.bind(performance) : void 0,- timing: typeof performance !== "undefined" ? performance.timing : void 0- };- if (_performance.now === void 0) {- nowOffset = Date.now();- if (_performance.timing && _performance.timing.navigationStart) {- nowOffset = _performance.timing.navigationStart;- }- _performance.now = () => Date.now() - nowOffset;- }- nanoPerSec = 1e9;- hrtime.bigint = function(time) {- var diff = hrtime(time);- if (typeof BigInt === "undefined") {- return diff[0] * nanoPerSec + diff[1];- }- return BigInt(diff[0] * nanoPerSec) + BigInt(diff[1]);- };- }-});--// node_modules/esbuild-plugin-polyfill-node/polyfills/process.js-var init_process2 = __esm({- "node_modules/esbuild-plugin-polyfill-node/polyfills/process.js"() {- init_process();- }-});--// node_modules/react/cjs/react.development.js-var require_react_development = __commonJS({- "node_modules/react/cjs/react.development.js"(exports2, module) {- "use strict";- init_global();- init_dirname();- init_filename();- init_buffer2();- init_process2();- if (true) {- (function() {- "use strict";- if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());- }- var ReactVersion = "18.2.0";- var REACT_ELEMENT_TYPE = Symbol.for("react.element");- var REACT_PORTAL_TYPE = Symbol.for("react.portal");- var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");- var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");- var REACT_PROFILER_TYPE = Symbol.for("react.profiler");- var REACT_PROVIDER_TYPE = Symbol.for("react.provider");- var REACT_CONTEXT_TYPE = Symbol.for("react.context");- var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");- var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");- var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");- var REACT_MEMO_TYPE = Symbol.for("react.memo");- var REACT_LAZY_TYPE = Symbol.for("react.lazy");- var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");- var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;- var FAUX_ITERATOR_SYMBOL = "@@iterator";- function getIteratorFn(maybeIterable) {- if (maybeIterable === null || typeof maybeIterable !== "object") {- return null;- }- var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];- if (typeof maybeIterator === "function") {- return maybeIterator;- }- return null;- }- var ReactCurrentDispatcher = {- /**- * @internal- * @type {ReactComponent}- */- current: null- };- var ReactCurrentBatchConfig = {- transition: null- };- var ReactCurrentActQueue = {- current: null,- // Used to reproduce behavior of `batchedUpdates` in legacy mode.- isBatchingLegacy: false,- didScheduleLegacyUpdate: false- };- var ReactCurrentOwner = {- /**- * @internal- * @type {ReactComponent}- */- current: null- };- var ReactDebugCurrentFrame = {};- var currentExtraStackFrame = null;- function setExtraStackFrame(stack) {- {- currentExtraStackFrame = stack;- }- }- {- ReactDebugCurrentFrame.setExtraStackFrame = function(stack) {- {- currentExtraStackFrame = stack;- }- };- ReactDebugCurrentFrame.getCurrentStack = null;- ReactDebugCurrentFrame.getStackAddendum = function() {- var stack = "";- if (currentExtraStackFrame) {- stack += currentExtraStackFrame;- }- var impl = ReactDebugCurrentFrame.getCurrentStack;- if (impl) {- stack += impl() || "";- }- return stack;- };- }- var enableScopeAPI = false;- var enableCacheElement = false;- var enableTransitionTracing = false;- var enableLegacyHidden = false;- var enableDebugTracing = false;- var ReactSharedInternals = {- ReactCurrentDispatcher,- ReactCurrentBatchConfig,- ReactCurrentOwner- };- {- ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;- ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;- }- function warn(format) {- {- {- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {- args[_key - 1] = arguments[_key];- }- printWarning("warn", format, args);- }- }- }- function error(format) {- {- {- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {- args[_key2 - 1] = arguments[_key2];- }- printWarning("error", format, args);- }- }- }- function printWarning(level, format, args) {- {- var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;- var stack = ReactDebugCurrentFrame2.getStackAddendum();- if (stack !== "") {- format += "%s";- args = args.concat([stack]);- }- var argsWithFormat = args.map(function(item) {- return String(item);- });- argsWithFormat.unshift("Warning: " + format);- Function.prototype.apply.call(console[level], console, argsWithFormat);- }- }- var didWarnStateUpdateForUnmountedComponent = {};- function warnNoop(publicInstance, callerName) {- {- var _constructor = publicInstance.constructor;- var componentName = _constructor && (_constructor.displayName || _constructor.name) || "ReactClass";- var warningKey = componentName + "." + callerName;- if (didWarnStateUpdateForUnmountedComponent[warningKey]) {- return;- }- error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", callerName, componentName);- didWarnStateUpdateForUnmountedComponent[warningKey] = true;- }- }- var ReactNoopUpdateQueue = {- /**- * Checks whether or not this composite component is mounted.- * @param {ReactClass} publicInstance The instance we want to test.- * @return {boolean} True if mounted, false otherwise.- * @protected- * @final- */- isMounted: function(publicInstance) {- return false;- },- /**- * Forces an update. This should only be invoked when it is known with- * certainty that we are **not** in a DOM transaction.- *- * You may want to call this when you know that some deeper aspect of the- * component's state has changed but `setState` was not called.- *- * This will not invoke `shouldComponentUpdate`, but it will invoke- * `componentWillUpdate` and `componentDidUpdate`.- *- * @param {ReactClass} publicInstance The instance that should rerender.- * @param {?function} callback Called after component is updated.- * @param {?string} callerName name of the calling function in the public API.- * @internal- */- enqueueForceUpdate: function(publicInstance, callback, callerName) {- warnNoop(publicInstance, "forceUpdate");- },- /**- * Replaces all of the state. Always use this or `setState` to mutate state.- * You should treat `this.state` as immutable.- *- * There is no guarantee that `this.state` will be immediately updated, so- * accessing `this.state` after calling this method may return the old value.- *- * @param {ReactClass} publicInstance The instance that should rerender.- * @param {object} completeState Next state.- * @param {?function} callback Called after component is updated.- * @param {?string} callerName name of the calling function in the public API.- * @internal- */- enqueueReplaceState: function(publicInstance, completeState, callback, callerName) {- warnNoop(publicInstance, "replaceState");- },- /**- * Sets a subset of the state. This only exists because _pendingState is- * internal. This provides a merging strategy that is not available to deep- * properties which is confusing. TODO: Expose pendingState or don't use it- * during the merge.- *- * @param {ReactClass} publicInstance The instance that should rerender.- * @param {object} partialState Next partial state to be merged with state.- * @param {?function} callback Called after component is updated.- * @param {?string} Name of the calling function in the public API.- * @internal- */- enqueueSetState: function(publicInstance, partialState, callback, callerName) {- warnNoop(publicInstance, "setState");- }- };- var assign = Object.assign;- var emptyObject = {};- {- Object.freeze(emptyObject);- }- function Component(props, context, updater) {- this.props = props;- this.context = context;- this.refs = emptyObject;- this.updater = updater || ReactNoopUpdateQueue;- }- Component.prototype.isReactComponent = {};- Component.prototype.setState = function(partialState, callback) {- if (typeof partialState !== "object" && typeof partialState !== "function" && partialState != null) {- throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");- }- this.updater.enqueueSetState(this, partialState, callback, "setState");- };- Component.prototype.forceUpdate = function(callback) {- this.updater.enqueueForceUpdate(this, callback, "forceUpdate");- };- {- var deprecatedAPIs = {- isMounted: ["isMounted", "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],- replaceState: ["replaceState", "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]- };- var defineDeprecationWarning = function(methodName, info) {- Object.defineProperty(Component.prototype, methodName, {- get: function() {- warn("%s(...) is deprecated in plain JavaScript React classes. %s", info[0], info[1]);- return void 0;- }- });- };- for (var fnName in deprecatedAPIs) {- if (deprecatedAPIs.hasOwnProperty(fnName)) {- defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);- }- }- }- function ComponentDummy() {- }- ComponentDummy.prototype = Component.prototype;- function PureComponent(props, context, updater) {- this.props = props;- this.context = context;- this.refs = emptyObject;- this.updater = updater || ReactNoopUpdateQueue;- }- var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();- pureComponentPrototype.constructor = PureComponent;- assign(pureComponentPrototype, Component.prototype);- pureComponentPrototype.isPureReactComponent = true;- function createRef() {- var refObject = {- current: null- };- {- Object.seal(refObject);- }- return refObject;- }- var isArrayImpl = Array.isArray;- function isArray(a) {- return isArrayImpl(a);- }- function typeName(value) {- {- var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;- var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";- return type;- }- }- function willCoercionThrow(value) {- {- try {- testStringCoercion(value);- return false;- } catch (e) {- return true;- }- }- }- function testStringCoercion(value) {- return "" + value;- }- function checkKeyStringCoercion(value) {- {- if (willCoercionThrow(value)) {- error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));- return testStringCoercion(value);- }- }- }- function getWrappedName(outerType, innerType, wrapperName) {- var displayName = outerType.displayName;- if (displayName) {- return displayName;- }- var functionName = innerType.displayName || innerType.name || "";- return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;- }- function getContextName(type) {- return type.displayName || "Context";- }- function getComponentNameFromType(type) {- if (type == null) {- return null;- }- {- if (typeof type.tag === "number") {- error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");- }- }- if (typeof type === "function") {- return type.displayName || type.name || null;- }- if (typeof type === "string") {- return type;- }- switch (type) {- case REACT_FRAGMENT_TYPE:- return "Fragment";- case REACT_PORTAL_TYPE:- return "Portal";- case REACT_PROFILER_TYPE:- return "Profiler";- case REACT_STRICT_MODE_TYPE:- return "StrictMode";- case REACT_SUSPENSE_TYPE:- return "Suspense";- case REACT_SUSPENSE_LIST_TYPE:- return "SuspenseList";- }- if (typeof type === "object") {- switch (type.$$typeof) {- case REACT_CONTEXT_TYPE:- var context = type;- return getContextName(context) + ".Consumer";- case REACT_PROVIDER_TYPE:- var provider = type;- return getContextName(provider._context) + ".Provider";- case REACT_FORWARD_REF_TYPE:- return getWrappedName(type, type.render, "ForwardRef");- case REACT_MEMO_TYPE:- var outerName = type.displayName || null;- if (outerName !== null) {- return outerName;- }- return getComponentNameFromType(type.type) || "Memo";- case REACT_LAZY_TYPE: {- var lazyComponent = type;- var payload = lazyComponent._payload;- var init = lazyComponent._init;- try {- return getComponentNameFromType(init(payload));- } catch (x) {- return null;- }- }- }- }- return null;- }- var hasOwnProperty = Object.prototype.hasOwnProperty;- var RESERVED_PROPS = {- key: true,- ref: true,- __self: true,- __source: true- };- var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;- {- didWarnAboutStringRefs = {};- }- function hasValidRef(config) {- {- if (hasOwnProperty.call(config, "ref")) {- var getter = Object.getOwnPropertyDescriptor(config, "ref").get;- if (getter && getter.isReactWarning) {- return false;- }- }- }- return config.ref !== void 0;- }- function hasValidKey(config) {- {- if (hasOwnProperty.call(config, "key")) {- var getter = Object.getOwnPropertyDescriptor(config, "key").get;- if (getter && getter.isReactWarning) {- return false;- }- }- }- return config.key !== void 0;- }- function defineKeyPropWarningGetter(props, displayName) {- var warnAboutAccessingKey = function() {- {- if (!specialPropKeyWarningShown) {- specialPropKeyWarningShown = true;- error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);- }- }- };- warnAboutAccessingKey.isReactWarning = true;- Object.defineProperty(props, "key", {- get: warnAboutAccessingKey,- configurable: true- });- }- function defineRefPropWarningGetter(props, displayName) {- var warnAboutAccessingRef = function() {- {- if (!specialPropRefWarningShown) {- specialPropRefWarningShown = true;- error("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);- }- }- };- warnAboutAccessingRef.isReactWarning = true;- Object.defineProperty(props, "ref", {- get: warnAboutAccessingRef,- configurable: true- });- }- function warnIfStringRefCannotBeAutoConverted(config) {- {- if (typeof config.ref === "string" && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {- var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);- if (!didWarnAboutStringRefs[componentName]) {- error('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref);- didWarnAboutStringRefs[componentName] = true;- }- }- }- }- var ReactElement = function(type, key, ref, self, source, owner, props) {- var element = {- // This tag allows us to uniquely identify this as a React Element- $$typeof: REACT_ELEMENT_TYPE,- // Built-in properties that belong on the element- type,- key,- ref,- props,- // Record the component responsible for creating this element.- _owner: owner- };- {- element._store = {};- Object.defineProperty(element._store, "validated", {- configurable: false,- enumerable: false,- writable: true,- value: false- });- Object.defineProperty(element, "_self", {- configurable: false,- enumerable: false,- writable: false,- value: self- });- Object.defineProperty(element, "_source", {- configurable: false,- enumerable: false,- writable: false,- value: source- });- if (Object.freeze) {- Object.freeze(element.props);- Object.freeze(element);- }- }- return element;- };- function createElement(type, config, children) {- var propName;- var props = {};- var key = null;- var ref = null;- var self = null;- var source = null;- if (config != null) {- if (hasValidRef(config)) {- ref = config.ref;- {- warnIfStringRefCannotBeAutoConverted(config);- }- }- if (hasValidKey(config)) {- {- checkKeyStringCoercion(config.key);- }- key = "" + config.key;- }- self = config.__self === void 0 ? null : config.__self;- source = config.__source === void 0 ? null : config.__source;- for (propName in config) {- if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {- props[propName] = config[propName];- }- }- }- var childrenLength = arguments.length - 2;- if (childrenLength === 1) {- props.children = children;- } else if (childrenLength > 1) {- var childArray = Array(childrenLength);- for (var i = 0; i < childrenLength; i++) {- childArray[i] = arguments[i + 2];- }- {- if (Object.freeze) {- Object.freeze(childArray);- }- }- props.children = childArray;- }- if (type && type.defaultProps) {- var defaultProps = type.defaultProps;- for (propName in defaultProps) {- if (props[propName] === void 0) {- props[propName] = defaultProps[propName];- }- }- }- {- if (key || ref) {- var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;- if (key) {- defineKeyPropWarningGetter(props, displayName);- }- if (ref) {- defineRefPropWarningGetter(props, displayName);- }- }- }- return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);- }- function cloneAndReplaceKey(oldElement, newKey) {- var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);- return newElement;- }- function cloneElement(element, config, children) {- if (element === null || element === void 0) {- throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");- }- var propName;- var props = assign({}, element.props);- var key = element.key;- var ref = element.ref;- var self = element._self;- var source = element._source;- var owner = element._owner;- if (config != null) {- if (hasValidRef(config)) {- ref = config.ref;- owner = ReactCurrentOwner.current;- }- if (hasValidKey(config)) {- {- checkKeyStringCoercion(config.key);- }- key = "" + config.key;- }- var defaultProps;- if (element.type && element.type.defaultProps) {- defaultProps = element.type.defaultProps;- }- for (propName in config) {- if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {- if (config[propName] === void 0 && defaultProps !== void 0) {- props[propName] = defaultProps[propName];- } else {- props[propName] = config[propName];- }- }- }- }- var childrenLength = arguments.length - 2;- if (childrenLength === 1) {- props.children = children;- } else if (childrenLength > 1) {- var childArray = Array(childrenLength);- for (var i = 0; i < childrenLength; i++) {- childArray[i] = arguments[i + 2];- }- props.children = childArray;- }- return ReactElement(element.type, key, ref, self, source, owner, props);- }- function isValidElement(object) {- return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;- }- var SEPARATOR = ".";- var SUBSEPARATOR = ":";- function escape(key) {- var escapeRegex = /[=:]/g;- var escaperLookup = {- "=": "=0",- ":": "=2"- };- var escapedString = key.replace(escapeRegex, function(match) {- return escaperLookup[match];- });- return "$" + escapedString;- }- var didWarnAboutMaps = false;- var userProvidedKeyEscapeRegex = /\/+/g;- function escapeUserProvidedKey(text) {- return text.replace(userProvidedKeyEscapeRegex, "$&/");- }- function getElementKey(element, index) {- if (typeof element === "object" && element !== null && element.key != null) {- {- checkKeyStringCoercion(element.key);- }- return escape("" + element.key);- }- return index.toString(36);- }- function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {- var type = typeof children;- if (type === "undefined" || type === "boolean") {- children = null;- }- var invokeCallback = false;- if (children === null) {- invokeCallback = true;- } else {- switch (type) {- case "string":- case "number":- invokeCallback = true;- break;- case "object":- switch (children.$$typeof) {- case REACT_ELEMENT_TYPE:- case REACT_PORTAL_TYPE:- invokeCallback = true;- }- }- }- if (invokeCallback) {- var _child = children;- var mappedChild = callback(_child);- var childKey = nameSoFar === "" ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;- if (isArray(mappedChild)) {- var escapedChildKey = "";- if (childKey != null) {- escapedChildKey = escapeUserProvidedKey(childKey) + "/";- }- mapIntoArray(mappedChild, array, escapedChildKey, "", function(c) {- return c;- });- } else if (mappedChild != null) {- if (isValidElement(mappedChild)) {- {- if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {- checkKeyStringCoercion(mappedChild.key);- }- }- mappedChild = cloneAndReplaceKey(- mappedChild,- // Keep both the (mapped) and old keys if they differ, just as- // traverseAllChildren used to do for objects as children- escapedPrefix + // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key- (mappedChild.key && (!_child || _child.key !== mappedChild.key) ? (- // $FlowFixMe Flow incorrectly thinks existing element's key can be a number- // eslint-disable-next-line react-internal/safe-string-coercion- escapeUserProvidedKey("" + mappedChild.key) + "/"- ) : "") + childKey- );- }- array.push(mappedChild);- }- return 1;- }- var child;- var nextName;- var subtreeCount = 0;- var nextNamePrefix = nameSoFar === "" ? SEPARATOR : nameSoFar + SUBSEPARATOR;- if (isArray(children)) {- for (var i = 0; i < children.length; i++) {- child = children[i];- nextName = nextNamePrefix + getElementKey(child, i);- subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);- }- } else {- var iteratorFn = getIteratorFn(children);- if (typeof iteratorFn === "function") {- var iterableChildren = children;- {- if (iteratorFn === iterableChildren.entries) {- if (!didWarnAboutMaps) {- warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead.");- }- didWarnAboutMaps = true;- }- }- var iterator = iteratorFn.call(iterableChildren);- var step;- var ii = 0;- while (!(step = iterator.next()).done) {- child = step.value;- nextName = nextNamePrefix + getElementKey(child, ii++);- subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);- }- } else if (type === "object") {- var childrenString = String(children);- throw new Error("Objects are not valid as a React child (found: " + (childrenString === "[object Object]" ? "object with keys {" + Object.keys(children).join(", ") + "}" : childrenString) + "). If you meant to render a collection of children, use an array instead.");- }- }- return subtreeCount;- }- function mapChildren(children, func, context) {- if (children == null) {- return children;- }- var result = [];- var count = 0;- mapIntoArray(children, result, "", "", function(child) {- return func.call(context, child, count++);- });- return result;- }- function countChildren(children) {- var n = 0;- mapChildren(children, function() {- n++;- });- return n;- }- function forEachChildren(children, forEachFunc, forEachContext) {- mapChildren(children, function() {- forEachFunc.apply(this, arguments);- }, forEachContext);- }- function toArray(children) {- return mapChildren(children, function(child) {- return child;- }) || [];- }- function onlyChild(children) {- if (!isValidElement(children)) {- throw new Error("React.Children.only expected to receive a single React element child.");- }- return children;- }- function createContext(defaultValue) {- var context = {- $$typeof: REACT_CONTEXT_TYPE,- // As a workaround to support multiple concurrent renderers, we categorize- // some renderers as primary and others as secondary. We only expect- // there to be two concurrent renderers at most: React Native (primary) and- // Fabric (secondary); React DOM (primary) and React ART (secondary).- // Secondary renderers store their context values on separate fields.- _currentValue: defaultValue,- _currentValue2: defaultValue,- // Used to track how many concurrent renderers this context currently- // supports within in a single renderer. Such as parallel server rendering.- _threadCount: 0,- // These are circular- Provider: null,- Consumer: null,- // Add these to use same hidden class in VM as ServerContext- _defaultValue: null,- _globalName: null- };- context.Provider = {- $$typeof: REACT_PROVIDER_TYPE,- _context: context- };- var hasWarnedAboutUsingNestedContextConsumers = false;- var hasWarnedAboutUsingConsumerProvider = false;- var hasWarnedAboutDisplayNameOnConsumer = false;- {- var Consumer = {- $$typeof: REACT_CONTEXT_TYPE,- _context: context- };- Object.defineProperties(Consumer, {- Provider: {- get: function() {- if (!hasWarnedAboutUsingConsumerProvider) {- hasWarnedAboutUsingConsumerProvider = true;- error("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?");- }- return context.Provider;- },- set: function(_Provider) {- context.Provider = _Provider;- }- },- _currentValue: {- get: function() {- return context._currentValue;- },- set: function(_currentValue) {- context._currentValue = _currentValue;- }- },- _currentValue2: {- get: function() {- return context._currentValue2;- },- set: function(_currentValue2) {- context._currentValue2 = _currentValue2;- }- },- _threadCount: {- get: function() {- return context._threadCount;- },- set: function(_threadCount) {- context._threadCount = _threadCount;- }- },- Consumer: {- get: function() {- if (!hasWarnedAboutUsingNestedContextConsumers) {- hasWarnedAboutUsingNestedContextConsumers = true;- error("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?");- }- return context.Consumer;- }- },- displayName: {- get: function() {- return context.displayName;- },- set: function(displayName) {- if (!hasWarnedAboutDisplayNameOnConsumer) {- warn("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.", displayName);- hasWarnedAboutDisplayNameOnConsumer = true;- }- }- }- });- context.Consumer = Consumer;- }- {- context._currentRenderer = null;- context._currentRenderer2 = null;- }- return context;- }- var Uninitialized = -1;- var Pending = 0;- var Resolved = 1;- var Rejected = 2;- function lazyInitializer(payload) {- if (payload._status === Uninitialized) {- var ctor = payload._result;- var thenable = ctor();- thenable.then(function(moduleObject2) {- if (payload._status === Pending || payload._status === Uninitialized) {- var resolved = payload;- resolved._status = Resolved;- resolved._result = moduleObject2;- }- }, function(error2) {- if (payload._status === Pending || payload._status === Uninitialized) {- var rejected = payload;- rejected._status = Rejected;- rejected._result = error2;- }- });- if (payload._status === Uninitialized) {- var pending = payload;- pending._status = Pending;- pending._result = thenable;- }- }- if (payload._status === Resolved) {- var moduleObject = payload._result;- {- if (moduleObject === void 0) {- error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?", moduleObject);- }- }- {- if (!("default" in moduleObject)) {- error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))", moduleObject);- }- }- return moduleObject.default;- } else {- throw payload._result;- }- }- function lazy(ctor) {- var payload = {- // We use these fields to store the result.- _status: Uninitialized,- _result: ctor- };- var lazyType = {- $$typeof: REACT_LAZY_TYPE,- _payload: payload,- _init: lazyInitializer- };- {- var defaultProps;- var propTypes;- Object.defineProperties(lazyType, {- defaultProps: {- configurable: true,- get: function() {- return defaultProps;- },- set: function(newDefaultProps) {- error("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it.");- defaultProps = newDefaultProps;- Object.defineProperty(lazyType, "defaultProps", {- enumerable: true- });- }- },- propTypes: {- configurable: true,- get: function() {- return propTypes;- },- set: function(newPropTypes) {- error("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it.");- propTypes = newPropTypes;- Object.defineProperty(lazyType, "propTypes", {- enumerable: true- });- }- }- });- }- return lazyType;- }- function forwardRef(render) {- {- if (render != null && render.$$typeof === REACT_MEMO_TYPE) {- error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).");- } else if (typeof render !== "function") {- error("forwardRef requires a render function but was given %s.", render === null ? "null" : typeof render);- } else {- if (render.length !== 0 && render.length !== 2) {- error("forwardRef render functions accept exactly two parameters: props and ref. %s", render.length === 1 ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined.");- }- }- if (render != null) {- if (render.defaultProps != null || render.propTypes != null) {- error("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");- }- }- }- var elementType = {- $$typeof: REACT_FORWARD_REF_TYPE,- render- };- {- var ownName;- Object.defineProperty(elementType, "displayName", {- enumerable: false,- configurable: true,- get: function() {- return ownName;- },- set: function(name) {- ownName = name;- if (!render.name && !render.displayName) {- render.displayName = name;- }- }- });- }- return elementType;- }- var REACT_MODULE_REFERENCE;- {- REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");- }- function isValidElementType(type) {- if (typeof type === "string" || typeof type === "function") {- return true;- }- if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {- return true;- }- if (typeof type === "object" && type !== null) {- if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object- // types supported by any Flight configuration anywhere since- // we don't know which Flight build this will end up being used- // with.- type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {- return true;- }- }- return false;- }- function memo(type, compare) {- {- if (!isValidElementType(type)) {- error("memo: The first argument must be a component. Instead received: %s", type === null ? "null" : typeof type);- }- }- var elementType = {- $$typeof: REACT_MEMO_TYPE,- type,- compare: compare === void 0 ? null : compare- };- {- var ownName;- Object.defineProperty(elementType, "displayName", {- enumerable: false,- configurable: true,- get: function() {- return ownName;- },- set: function(name) {- ownName = name;- if (!type.name && !type.displayName) {- type.displayName = name;- }- }- });- }- return elementType;- }- function resolveDispatcher() {- var dispatcher = ReactCurrentDispatcher.current;- {- if (dispatcher === null) {- error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.");- }- }- return dispatcher;- }- function useContext(Context) {- var dispatcher = resolveDispatcher();- {- if (Context._context !== void 0) {- var realContext = Context._context;- if (realContext.Consumer === Context) {- error("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?");- } else if (realContext.Provider === Context) {- error("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?");- }- }- }- return dispatcher.useContext(Context);- }- function useState(initialState) {- var dispatcher = resolveDispatcher();- return dispatcher.useState(initialState);- }- function useReducer(reducer, initialArg, init) {- var dispatcher = resolveDispatcher();- return dispatcher.useReducer(reducer, initialArg, init);- }- function useRef(initialValue) {- var dispatcher = resolveDispatcher();- return dispatcher.useRef(initialValue);- }- function useEffect(create, deps) {- var dispatcher = resolveDispatcher();- return dispatcher.useEffect(create, deps);- }- function useInsertionEffect(create, deps) {- var dispatcher = resolveDispatcher();- return dispatcher.useInsertionEffect(create, deps);- }- function useLayoutEffect(create, deps) {- var dispatcher = resolveDispatcher();- return dispatcher.useLayoutEffect(create, deps);- }- function useCallback(callback, deps) {- var dispatcher = resolveDispatcher();- return dispatcher.useCallback(callback, deps);- }- function useMemo(create, deps) {- var dispatcher = resolveDispatcher();- return dispatcher.useMemo(create, deps);- }- function useImperativeHandle(ref, create, deps) {- var dispatcher = resolveDispatcher();- return dispatcher.useImperativeHandle(ref, create, deps);- }- function useDebugValue(value, formatterFn) {- {- var dispatcher = resolveDispatcher();- return dispatcher.useDebugValue(value, formatterFn);- }- }- function useTransition() {- var dispatcher = resolveDispatcher();- return dispatcher.useTransition();- }- function useDeferredValue(value) {- var dispatcher = resolveDispatcher();- return dispatcher.useDeferredValue(value);- }- function useId() {- var dispatcher = resolveDispatcher();- return dispatcher.useId();- }- function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {- var dispatcher = resolveDispatcher();- return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);- }- var disabledDepth = 0;- var prevLog;- var prevInfo;- var prevWarn;- var prevError;- var prevGroup;- var prevGroupCollapsed;- var prevGroupEnd;- function disabledLog() {- }- disabledLog.__reactDisabledLog = true;- function disableLogs() {- {- if (disabledDepth === 0) {- prevLog = console.log;- prevInfo = console.info;- prevWarn = console.warn;- prevError = console.error;- prevGroup = console.group;- prevGroupCollapsed = console.groupCollapsed;- prevGroupEnd = console.groupEnd;- var props = {- configurable: true,- enumerable: true,- value: disabledLog,- writable: true- };- Object.defineProperties(console, {- info: props,- log: props,- warn: props,- error: props,- group: props,- groupCollapsed: props,- groupEnd: props- });- }- disabledDepth++;- }- }- function reenableLogs() {- {- disabledDepth--;- if (disabledDepth === 0) {- var props = {- configurable: true,- enumerable: true,- writable: true- };- Object.defineProperties(console, {- log: assign({}, props, {- value: prevLog- }),- info: assign({}, props, {- value: prevInfo- }),- warn: assign({}, props, {- value: prevWarn- }),- error: assign({}, props, {- value: prevError- }),- group: assign({}, props, {- value: prevGroup- }),- groupCollapsed: assign({}, props, {- value: prevGroupCollapsed- }),- groupEnd: assign({}, props, {- value: prevGroupEnd- })- });- }- if (disabledDepth < 0) {- error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");- }- }- }- var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;- var prefix;- function describeBuiltInComponentFrame(name, source, ownerFn) {- {- if (prefix === void 0) {- try {- throw Error();- } catch (x) {- var match = x.stack.trim().match(/\n( *(at )?)/);- prefix = match && match[1] || "";- }- }- return "\n" + prefix + name;- }- }- var reentry = false;- var componentFrameCache;- {- var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;- componentFrameCache = new PossiblyWeakMap();- }- function describeNativeComponentFrame(fn, construct) {- if (!fn || reentry) {- return "";- }- {- var frame = componentFrameCache.get(fn);- if (frame !== void 0) {- return frame;- }- }- var control;- reentry = true;- var previousPrepareStackTrace = Error.prepareStackTrace;- Error.prepareStackTrace = void 0;- var previousDispatcher;- {- previousDispatcher = ReactCurrentDispatcher$1.current;- ReactCurrentDispatcher$1.current = null;- disableLogs();- }- try {- if (construct) {- var Fake = function() {- throw Error();- };- Object.defineProperty(Fake.prototype, "props", {- set: function() {- throw Error();- }- });- if (typeof Reflect === "object" && Reflect.construct) {- try {- Reflect.construct(Fake, []);- } catch (x) {- control = x;- }- Reflect.construct(fn, [], Fake);- } else {- try {- Fake.call();- } catch (x) {- control = x;- }- fn.call(Fake.prototype);- }- } else {- try {- throw Error();- } catch (x) {- control = x;- }- fn();- }- } catch (sample) {- if (sample && control && typeof sample.stack === "string") {- var sampleLines = sample.stack.split("\n");- var controlLines = control.stack.split("\n");- var s = sampleLines.length - 1;- var c = controlLines.length - 1;- while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {- c--;- }- for (; s >= 1 && c >= 0; s--, c--) {- if (sampleLines[s] !== controlLines[c]) {- if (s !== 1 || c !== 1) {- do {- s--;- c--;- if (c < 0 || sampleLines[s] !== controlLines[c]) {- var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");- if (fn.displayName && _frame.includes("<anonymous>")) {- _frame = _frame.replace("<anonymous>", fn.displayName);- }- {- if (typeof fn === "function") {- componentFrameCache.set(fn, _frame);- }- }- return _frame;- }- } while (s >= 1 && c >= 0);- }- break;- }- }- }- } finally {- reentry = false;- {- ReactCurrentDispatcher$1.current = previousDispatcher;- reenableLogs();- }- Error.prepareStackTrace = previousPrepareStackTrace;- }- var name = fn ? fn.displayName || fn.name : "";- var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";- {- if (typeof fn === "function") {- componentFrameCache.set(fn, syntheticFrame);- }- }- return syntheticFrame;- }- function describeFunctionComponentFrame(fn, source, ownerFn) {- {- return describeNativeComponentFrame(fn, false);- }- }- function shouldConstruct(Component2) {- var prototype = Component2.prototype;- return !!(prototype && prototype.isReactComponent);- }- function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {- if (type == null) {- return "";- }- if (typeof type === "function") {- {- return describeNativeComponentFrame(type, shouldConstruct(type));- }- }- if (typeof type === "string") {- return describeBuiltInComponentFrame(type);- }- switch (type) {- case REACT_SUSPENSE_TYPE:- return describeBuiltInComponentFrame("Suspense");- case REACT_SUSPENSE_LIST_TYPE:- return describeBuiltInComponentFrame("SuspenseList");- }- if (typeof type === "object") {- switch (type.$$typeof) {- case REACT_FORWARD_REF_TYPE:- return describeFunctionComponentFrame(type.render);- case REACT_MEMO_TYPE:- return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);- case REACT_LAZY_TYPE: {- var lazyComponent = type;- var payload = lazyComponent._payload;- var init = lazyComponent._init;- try {- return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);- } catch (x) {- }- }- }- }- return "";- }- var loggedTypeFailures = {};- var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;- function setCurrentlyValidatingElement(element) {- {- if (element) {- var owner = element._owner;- var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);- ReactDebugCurrentFrame$1.setExtraStackFrame(stack);- } else {- ReactDebugCurrentFrame$1.setExtraStackFrame(null);- }- }- }- function checkPropTypes(typeSpecs, values, location, componentName, element) {- {- var has = Function.call.bind(hasOwnProperty);- for (var typeSpecName in typeSpecs) {- if (has(typeSpecs, typeSpecName)) {- var error$1 = void 0;- try {- if (typeof typeSpecs[typeSpecName] !== "function") {- var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");- err.name = "Invariant Violation";- throw err;- }- error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");- } catch (ex) {- error$1 = ex;- }- if (error$1 && !(error$1 instanceof Error)) {- setCurrentlyValidatingElement(element);- error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1);- setCurrentlyValidatingElement(null);- }- if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {- loggedTypeFailures[error$1.message] = true;- setCurrentlyValidatingElement(element);- error("Failed %s type: %s", location, error$1.message);- setCurrentlyValidatingElement(null);- }- }- }- }- }- function setCurrentlyValidatingElement$1(element) {- {- if (element) {- var owner = element._owner;- var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);- setExtraStackFrame(stack);- } else {- setExtraStackFrame(null);- }- }- }- var propTypesMisspellWarningShown;- {- propTypesMisspellWarningShown = false;- }- function getDeclarationErrorAddendum() {- if (ReactCurrentOwner.current) {- var name = getComponentNameFromType(ReactCurrentOwner.current.type);- if (name) {- return "\n\nCheck the render method of `" + name + "`.";- }- }- return "";- }- function getSourceInfoErrorAddendum(source) {- if (source !== void 0) {- var fileName = source.fileName.replace(/^.*[\\\/]/, "");- var lineNumber = source.lineNumber;- return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";- }- return "";- }- function getSourceInfoErrorAddendumForProps(elementProps) {- if (elementProps !== null && elementProps !== void 0) {- return getSourceInfoErrorAddendum(elementProps.__source);- }- return "";- }- var ownerHasKeyUseWarning = {};- function getCurrentComponentErrorInfo(parentType) {- var info = getDeclarationErrorAddendum();- if (!info) {- var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;- if (parentName) {- info = "\n\nCheck the top-level render call using <" + parentName + ">.";- }- }- return info;- }- function validateExplicitKey(element, parentType) {- if (!element._store || element._store.validated || element.key != null) {- return;- }- element._store.validated = true;- var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);- if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {- return;- }- ownerHasKeyUseWarning[currentComponentErrorInfo] = true;- var childOwner = "";- if (element && element._owner && element._owner !== ReactCurrentOwner.current) {- childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";- }- {- setCurrentlyValidatingElement$1(element);- error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);- setCurrentlyValidatingElement$1(null);- }- }- function validateChildKeys(node, parentType) {- if (typeof node !== "object") {- return;- }- if (isArray(node)) {- for (var i = 0; i < node.length; i++) {- var child = node[i];- if (isValidElement(child)) {- validateExplicitKey(child, parentType);- }- }- } else if (isValidElement(node)) {- if (node._store) {- node._store.validated = true;- }- } else if (node) {- var iteratorFn = getIteratorFn(node);- if (typeof iteratorFn === "function") {- if (iteratorFn !== node.entries) {- var iterator = iteratorFn.call(node);- var step;- while (!(step = iterator.next()).done) {- if (isValidElement(step.value)) {- validateExplicitKey(step.value, parentType);- }- }- }- }- }- }- function validatePropTypes(element) {- {- var type = element.type;- if (type === null || type === void 0 || typeof type === "string") {- return;- }- var propTypes;- if (typeof type === "function") {- propTypes = type.propTypes;- } else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.- // Inner props are checked in the reconciler.- type.$$typeof === REACT_MEMO_TYPE)) {- propTypes = type.propTypes;- } else {- return;- }- if (propTypes) {- var name = getComponentNameFromType(type);- checkPropTypes(propTypes, element.props, "prop", name, element);- } else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {- propTypesMisspellWarningShown = true;- var _name = getComponentNameFromType(type);- error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");- }- if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {- error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");- }- }- }- function validateFragmentProps(fragment) {- {- var keys = Object.keys(fragment.props);- for (var i = 0; i < keys.length; i++) {- var key = keys[i];- if (key !== "children" && key !== "key") {- setCurrentlyValidatingElement$1(fragment);- error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);- setCurrentlyValidatingElement$1(null);- break;- }- }- if (fragment.ref !== null) {- setCurrentlyValidatingElement$1(fragment);- error("Invalid attribute `ref` supplied to `React.Fragment`.");- setCurrentlyValidatingElement$1(null);- }- }- }- function createElementWithValidation(type, props, children) {- var validType = isValidElementType(type);- if (!validType) {- var info = "";- if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {- info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";- }- var sourceInfo = getSourceInfoErrorAddendumForProps(props);- if (sourceInfo) {- info += sourceInfo;- } else {- info += getDeclarationErrorAddendum();- }- var typeString;- if (type === null) {- typeString = "null";- } else if (isArray(type)) {- typeString = "array";- } else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {- typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";- info = " Did you accidentally export a JSX literal instead of a component?";- } else {- typeString = typeof type;- }- {- error("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info);- }- }- var element = createElement.apply(this, arguments);- if (element == null) {- return element;- }- if (validType) {- for (var i = 2; i < arguments.length; i++) {- validateChildKeys(arguments[i], type);- }- }- if (type === REACT_FRAGMENT_TYPE) {- validateFragmentProps(element);- } else {- validatePropTypes(element);- }- return element;- }- var didWarnAboutDeprecatedCreateFactory = false;- function createFactoryWithValidation(type) {- var validatedFactory = createElementWithValidation.bind(null, type);- validatedFactory.type = type;- {- if (!didWarnAboutDeprecatedCreateFactory) {- didWarnAboutDeprecatedCreateFactory = true;- warn("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.");- }- Object.defineProperty(validatedFactory, "type", {- enumerable: false,- get: function() {- warn("Factory.type is deprecated. Access the class directly before passing it to createFactory.");- Object.defineProperty(this, "type", {- value: type- });- return type;- }- });- }- return validatedFactory;- }- function cloneElementWithValidation(element, props, children) {- var newElement = cloneElement.apply(this, arguments);- for (var i = 2; i < arguments.length; i++) {- validateChildKeys(arguments[i], newElement.type);- }- validatePropTypes(newElement);- return newElement;- }- function startTransition(scope, options) {- var prevTransition = ReactCurrentBatchConfig.transition;- ReactCurrentBatchConfig.transition = {};- var currentTransition = ReactCurrentBatchConfig.transition;- {- ReactCurrentBatchConfig.transition._updatedFibers = /* @__PURE__ */ new Set();- }- try {- scope();- } finally {- ReactCurrentBatchConfig.transition = prevTransition;- {- if (prevTransition === null && currentTransition._updatedFibers) {- var updatedFibersCount = currentTransition._updatedFibers.size;- if (updatedFibersCount > 10) {- warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.");- }- currentTransition._updatedFibers.clear();- }- }- }- }- var didWarnAboutMessageChannel = false;- var enqueueTaskImpl = null;- function enqueueTask(task) {- if (enqueueTaskImpl === null) {- try {- var requireString = ("require" + Math.random()).slice(0, 7);- var nodeRequire = module && module[requireString];- enqueueTaskImpl = nodeRequire.call(module, "timers").setImmediate;- } catch (_err) {- enqueueTaskImpl = function(callback) {- {- if (didWarnAboutMessageChannel === false) {- didWarnAboutMessageChannel = true;- if (typeof MessageChannel === "undefined") {- error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning.");- }- }- }- var channel = new MessageChannel();- channel.port1.onmessage = callback;- channel.port2.postMessage(void 0);- };- }- }- return enqueueTaskImpl(task);- }- var actScopeDepth = 0;- var didWarnNoAwaitAct = false;- function act(callback) {- {- var prevActScopeDepth = actScopeDepth;- actScopeDepth++;- if (ReactCurrentActQueue.current === null) {- ReactCurrentActQueue.current = [];- }- var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy;- var result;- try {- ReactCurrentActQueue.isBatchingLegacy = true;- result = callback();- if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) {- var queue = ReactCurrentActQueue.current;- if (queue !== null) {- ReactCurrentActQueue.didScheduleLegacyUpdate = false;- flushActQueue(queue);- }- }- } catch (error2) {- popActScope(prevActScopeDepth);- throw error2;- } finally {- ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;- }- if (result !== null && typeof result === "object" && typeof result.then === "function") {- var thenableResult = result;- var wasAwaited = false;- var thenable = {- then: function(resolve, reject) {- wasAwaited = true;- thenableResult.then(function(returnValue2) {- popActScope(prevActScopeDepth);- if (actScopeDepth === 0) {- recursivelyFlushAsyncActWork(returnValue2, resolve, reject);- } else {- resolve(returnValue2);- }- }, function(error2) {- popActScope(prevActScopeDepth);- reject(error2);- });- }- };- {- if (!didWarnNoAwaitAct && typeof Promise !== "undefined") {- Promise.resolve().then(function() {- }).then(function() {- if (!wasAwaited) {- didWarnNoAwaitAct = true;- error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);");- }- });- }- }- return thenable;- } else {- var returnValue = result;- popActScope(prevActScopeDepth);- if (actScopeDepth === 0) {- var _queue = ReactCurrentActQueue.current;- if (_queue !== null) {- flushActQueue(_queue);- ReactCurrentActQueue.current = null;- }- var _thenable = {- then: function(resolve, reject) {- if (ReactCurrentActQueue.current === null) {- ReactCurrentActQueue.current = [];- recursivelyFlushAsyncActWork(returnValue, resolve, reject);- } else {- resolve(returnValue);- }- }- };- return _thenable;- } else {- var _thenable2 = {- then: function(resolve, reject) {- resolve(returnValue);- }- };- return _thenable2;- }- }- }- }- function popActScope(prevActScopeDepth) {- {- if (prevActScopeDepth !== actScopeDepth - 1) {- error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. ");- }- actScopeDepth = prevActScopeDepth;- }- }- function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {- {- var queue = ReactCurrentActQueue.current;- if (queue !== null) {- try {- flushActQueue(queue);- enqueueTask(function() {- if (queue.length === 0) {- ReactCurrentActQueue.current = null;- resolve(returnValue);- } else {- recursivelyFlushAsyncActWork(returnValue, resolve, reject);- }- });- } catch (error2) {- reject(error2);- }- } else {- resolve(returnValue);- }- }- }- var isFlushing = false;- function flushActQueue(queue) {- {- if (!isFlushing) {- isFlushing = true;- var i = 0;- try {- for (; i < queue.length; i++) {- var callback = queue[i];- do {- callback = callback(true);- } while (callback !== null);- }- queue.length = 0;- } catch (error2) {- queue = queue.slice(i + 1);- throw error2;- } finally {- isFlushing = false;- }- }- }- }- var createElement$1 = createElementWithValidation;- var cloneElement$1 = cloneElementWithValidation;- var createFactory = createFactoryWithValidation;- var Children = {- map: mapChildren,- forEach: forEachChildren,- count: countChildren,- toArray,- only: onlyChild- };- exports2.Children = Children;- exports2.Component = Component;- exports2.Fragment = REACT_FRAGMENT_TYPE;- exports2.Profiler = REACT_PROFILER_TYPE;- exports2.PureComponent = PureComponent;- exports2.StrictMode = REACT_STRICT_MODE_TYPE;- exports2.Suspense = REACT_SUSPENSE_TYPE;- exports2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;- exports2.cloneElement = cloneElement$1;- exports2.createContext = createContext;- exports2.createElement = createElement$1;- exports2.createFactory = createFactory;- exports2.createRef = createRef;- exports2.forwardRef = forwardRef;- exports2.isValidElement = isValidElement;- exports2.lazy = lazy;- exports2.memo = memo;- exports2.startTransition = startTransition;- exports2.unstable_act = act;- exports2.useCallback = useCallback;- exports2.useContext = useContext;- exports2.useDebugValue = useDebugValue;- exports2.useDeferredValue = useDeferredValue;- exports2.useEffect = useEffect;- exports2.useId = useId;- exports2.useImperativeHandle = useImperativeHandle;- exports2.useInsertionEffect = useInsertionEffect;- exports2.useLayoutEffect = useLayoutEffect;- exports2.useMemo = useMemo;- exports2.useReducer = useReducer;- exports2.useRef = useRef;- exports2.useState = useState;- exports2.useSyncExternalStore = useSyncExternalStore;- exports2.useTransition = useTransition;- exports2.version = ReactVersion;- if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());- }- })();- }- }-});--// node_modules/react/index.js-var require_react = __commonJS({- "node_modules/react/index.js"(exports2, module) {- "use strict";- init_global();- init_dirname();- init_filename();- init_buffer2();- init_process2();- if (false) {- module.exports = null;- } else {- module.exports = require_react_development();- }- }-});--// node_modules/react/cjs/react-jsx-dev-runtime.development.js-var require_react_jsx_dev_runtime_development = __commonJS({- "node_modules/react/cjs/react-jsx-dev-runtime.development.js"(exports2) {- "use strict";- init_global();- init_dirname();- init_filename();- init_buffer2();- init_process2();- if (true) {- (function() {- "use strict";- var React = require_react();- var REACT_ELEMENT_TYPE = Symbol.for("react.element");- var REACT_PORTAL_TYPE = Symbol.for("react.portal");- var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");- var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");- var REACT_PROFILER_TYPE = Symbol.for("react.profiler");- var REACT_PROVIDER_TYPE = Symbol.for("react.provider");- var REACT_CONTEXT_TYPE = Symbol.for("react.context");- var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");- var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");- var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");- var REACT_MEMO_TYPE = Symbol.for("react.memo");- var REACT_LAZY_TYPE = Symbol.for("react.lazy");- var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");- var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;- var FAUX_ITERATOR_SYMBOL = "@@iterator";- function getIteratorFn(maybeIterable) {- if (maybeIterable === null || typeof maybeIterable !== "object") {- return null;- }- var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];- if (typeof maybeIterator === "function") {- return maybeIterator;- }- return null;- }- var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;- function error(format) {- {- {- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {- args[_key2 - 1] = arguments[_key2];- }- printWarning("error", format, args);- }- }- }- function printWarning(level, format, args) {- {- var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;- var stack = ReactDebugCurrentFrame2.getStackAddendum();- if (stack !== "") {- format += "%s";- args = args.concat([stack]);- }- var argsWithFormat = args.map(function(item) {- return String(item);- });- argsWithFormat.unshift("Warning: " + format);- Function.prototype.apply.call(console[level], console, argsWithFormat);- }- }- var enableScopeAPI = false;- var enableCacheElement = false;- var enableTransitionTracing = false;- var enableLegacyHidden = false;- var enableDebugTracing = false;- var REACT_MODULE_REFERENCE;- {- REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");- }- function isValidElementType(type) {- if (typeof type === "string" || typeof type === "function") {- return true;- }- if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {- return true;- }- if (typeof type === "object" && type !== null) {- if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object- // types supported by any Flight configuration anywhere since- // we don't know which Flight build this will end up being used- // with.- type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {- return true;- }- }- return false;- }- function getWrappedName(outerType, innerType, wrapperName) {- var displayName = outerType.displayName;- if (displayName) {- return displayName;- }- var functionName = innerType.displayName || innerType.name || "";- return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;- }- function getContextName(type) {- return type.displayName || "Context";- }- function getComponentNameFromType(type) {- if (type == null) {- return null;- }- {- if (typeof type.tag === "number") {- error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");- }- }- if (typeof type === "function") {- return type.displayName || type.name || null;- }- if (typeof type === "string") {- return type;- }- switch (type) {- case REACT_FRAGMENT_TYPE:- return "Fragment";- case REACT_PORTAL_TYPE:- return "Portal";- case REACT_PROFILER_TYPE:- return "Profiler";- case REACT_STRICT_MODE_TYPE:- return "StrictMode";- case REACT_SUSPENSE_TYPE:- return "Suspense";- case REACT_SUSPENSE_LIST_TYPE:- return "SuspenseList";- }- if (typeof type === "object") {- switch (type.$$typeof) {- case REACT_CONTEXT_TYPE:- var context = type;- return getContextName(context) + ".Consumer";- case REACT_PROVIDER_TYPE:- var provider = type;- return getContextName(provider._context) + ".Provider";- case REACT_FORWARD_REF_TYPE:- return getWrappedName(type, type.render, "ForwardRef");- case REACT_MEMO_TYPE:- var outerName = type.displayName || null;- if (outerName !== null) {- return outerName;- }- return getComponentNameFromType(type.type) || "Memo";- case REACT_LAZY_TYPE: {- var lazyComponent = type;- var payload = lazyComponent._payload;- var init = lazyComponent._init;- try {- return getComponentNameFromType(init(payload));- } catch (x) {- return null;- }- }- }- }- return null;- }- var assign = Object.assign;- var disabledDepth = 0;- var prevLog;- var prevInfo;- var prevWarn;- var prevError;- var prevGroup;- var prevGroupCollapsed;- var prevGroupEnd;- function disabledLog() {- }- disabledLog.__reactDisabledLog = true;- function disableLogs() {- {- if (disabledDepth === 0) {- prevLog = console.log;- prevInfo = console.info;- prevWarn = console.warn;- prevError = console.error;- prevGroup = console.group;- prevGroupCollapsed = console.groupCollapsed;- prevGroupEnd = console.groupEnd;- var props = {- configurable: true,- enumerable: true,- value: disabledLog,- writable: true- };- Object.defineProperties(console, {- info: props,- log: props,- warn: props,- error: props,- group: props,- groupCollapsed: props,- groupEnd: props- });- }- disabledDepth++;- }- }- function reenableLogs() {- {- disabledDepth--;- if (disabledDepth === 0) {- var props = {- configurable: true,- enumerable: true,- writable: true- };- Object.defineProperties(console, {- log: assign({}, props, {- value: prevLog- }),- info: assign({}, props, {- value: prevInfo- }),- warn: assign({}, props, {- value: prevWarn- }),- error: assign({}, props, {- value: prevError- }),- group: assign({}, props, {- value: prevGroup- }),- groupCollapsed: assign({}, props, {- value: prevGroupCollapsed- }),- groupEnd: assign({}, props, {- value: prevGroupEnd- })- });- }- if (disabledDepth < 0) {- error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");- }- }- }- var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;- var prefix;- function describeBuiltInComponentFrame(name, source, ownerFn) {- {- if (prefix === void 0) {- try {- throw Error();- } catch (x) {- var match = x.stack.trim().match(/\n( *(at )?)/);- prefix = match && match[1] || "";- }- }- return "\n" + prefix + name;- }- }- var reentry = false;- var componentFrameCache;- {- var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;- componentFrameCache = new PossiblyWeakMap();- }- function describeNativeComponentFrame(fn, construct) {- if (!fn || reentry) {- return "";- }- {- var frame = componentFrameCache.get(fn);- if (frame !== void 0) {- return frame;- }- }- var control;- reentry = true;- var previousPrepareStackTrace = Error.prepareStackTrace;- Error.prepareStackTrace = void 0;- var previousDispatcher;- {- previousDispatcher = ReactCurrentDispatcher.current;- ReactCurrentDispatcher.current = null;- disableLogs();- }- try {- if (construct) {- var Fake = function() {- throw Error();- };- Object.defineProperty(Fake.prototype, "props", {- set: function() {- throw Error();- }- });- if (typeof Reflect === "object" && Reflect.construct) {- try {- Reflect.construct(Fake, []);- } catch (x) {- control = x;- }- Reflect.construct(fn, [], Fake);- } else {- try {- Fake.call();- } catch (x) {- control = x;- }- fn.call(Fake.prototype);- }- } else {- try {- throw Error();- } catch (x) {- control = x;- }- fn();- }- } catch (sample) {- if (sample && control && typeof sample.stack === "string") {- var sampleLines = sample.stack.split("\n");- var controlLines = control.stack.split("\n");- var s = sampleLines.length - 1;- var c = controlLines.length - 1;- while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {- c--;- }- for (; s >= 1 && c >= 0; s--, c--) {- if (sampleLines[s] !== controlLines[c]) {- if (s !== 1 || c !== 1) {- do {- s--;- c--;- if (c < 0 || sampleLines[s] !== controlLines[c]) {- var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");- if (fn.displayName && _frame.includes("<anonymous>")) {- _frame = _frame.replace("<anonymous>", fn.displayName);- }- {- if (typeof fn === "function") {- componentFrameCache.set(fn, _frame);- }- }- return _frame;- }- } while (s >= 1 && c >= 0);- }- break;- }- }- }- } finally {- reentry = false;- {- ReactCurrentDispatcher.current = previousDispatcher;- reenableLogs();- }- Error.prepareStackTrace = previousPrepareStackTrace;- }- var name = fn ? fn.displayName || fn.name : "";- var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";- {- if (typeof fn === "function") {- componentFrameCache.set(fn, syntheticFrame);- }- }- return syntheticFrame;- }- function describeFunctionComponentFrame(fn, source, ownerFn) {- {- return describeNativeComponentFrame(fn, false);- }- }- function shouldConstruct(Component) {- var prototype = Component.prototype;- return !!(prototype && prototype.isReactComponent);- }- function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {- if (type == null) {- return "";- }- if (typeof type === "function") {- {- return describeNativeComponentFrame(type, shouldConstruct(type));- }- }- if (typeof type === "string") {- return describeBuiltInComponentFrame(type);- }- switch (type) {- case REACT_SUSPENSE_TYPE:- return describeBuiltInComponentFrame("Suspense");- case REACT_SUSPENSE_LIST_TYPE:- return describeBuiltInComponentFrame("SuspenseList");- }- if (typeof type === "object") {- switch (type.$$typeof) {- case REACT_FORWARD_REF_TYPE:- return describeFunctionComponentFrame(type.render);- case REACT_MEMO_TYPE:- return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);- case REACT_LAZY_TYPE: {- var lazyComponent = type;- var payload = lazyComponent._payload;- var init = lazyComponent._init;- try {- return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);- } catch (x) {- }- }- }- }- return "";- }- var hasOwnProperty = Object.prototype.hasOwnProperty;- var loggedTypeFailures = {};- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;- function setCurrentlyValidatingElement(element) {- {- if (element) {- var owner = element._owner;- var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);- ReactDebugCurrentFrame.setExtraStackFrame(stack);- } else {- ReactDebugCurrentFrame.setExtraStackFrame(null);- }- }- }- function checkPropTypes(typeSpecs, values, location, componentName, element) {- {- var has = Function.call.bind(hasOwnProperty);- for (var typeSpecName in typeSpecs) {- if (has(typeSpecs, typeSpecName)) {- var error$1 = void 0;- try {- if (typeof typeSpecs[typeSpecName] !== "function") {- var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");- err.name = "Invariant Violation";- throw err;- }- error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");- } catch (ex) {- error$1 = ex;- }- if (error$1 && !(error$1 instanceof Error)) {- setCurrentlyValidatingElement(element);- error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1);- setCurrentlyValidatingElement(null);- }- if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {- loggedTypeFailures[error$1.message] = true;- setCurrentlyValidatingElement(element);- error("Failed %s type: %s", location, error$1.message);- setCurrentlyValidatingElement(null);- }- }- }- }- }- var isArrayImpl = Array.isArray;- function isArray(a) {- return isArrayImpl(a);- }- function typeName(value) {- {- var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;- var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";- return type;- }- }- function willCoercionThrow(value) {- {- try {- testStringCoercion(value);- return false;- } catch (e) {- return true;- }- }- }- function testStringCoercion(value) {- return "" + value;- }- function checkKeyStringCoercion(value) {- {- if (willCoercionThrow(value)) {- error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));- return testStringCoercion(value);- }- }- }- var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;- var RESERVED_PROPS = {- key: true,- ref: true,- __self: true,- __source: true- };- var specialPropKeyWarningShown;- var specialPropRefWarningShown;- var didWarnAboutStringRefs;- {- didWarnAboutStringRefs = {};- }- function hasValidRef(config) {- {- if (hasOwnProperty.call(config, "ref")) {- var getter = Object.getOwnPropertyDescriptor(config, "ref").get;- if (getter && getter.isReactWarning) {- return false;- }- }- }- return config.ref !== void 0;- }- function hasValidKey(config) {- {- if (hasOwnProperty.call(config, "key")) {- var getter = Object.getOwnPropertyDescriptor(config, "key").get;- if (getter && getter.isReactWarning) {- return false;- }- }- }- return config.key !== void 0;- }- function warnIfStringRefCannotBeAutoConverted(config, self) {- {- if (typeof config.ref === "string" && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {- var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);- if (!didWarnAboutStringRefs[componentName]) {- error('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);- didWarnAboutStringRefs[componentName] = true;- }- }- }- }- function defineKeyPropWarningGetter(props, displayName) {- {- var warnAboutAccessingKey = function() {- if (!specialPropKeyWarningShown) {- specialPropKeyWarningShown = true;- error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);- }- };- warnAboutAccessingKey.isReactWarning = true;- Object.defineProperty(props, "key", {- get: warnAboutAccessingKey,- configurable: true- });- }- }- function defineRefPropWarningGetter(props, displayName) {- {- var warnAboutAccessingRef = function() {- if (!specialPropRefWarningShown) {- specialPropRefWarningShown = true;- error("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);- }- };- warnAboutAccessingRef.isReactWarning = true;- Object.defineProperty(props, "ref", {- get: warnAboutAccessingRef,- configurable: true- });- }- }- var ReactElement = function(type, key, ref, self, source, owner, props) {- var element = {- // This tag allows us to uniquely identify this as a React Element- $$typeof: REACT_ELEMENT_TYPE,- // Built-in properties that belong on the element- type,- key,- ref,- props,- // Record the component responsible for creating this element.- _owner: owner- };- {- element._store = {};- Object.defineProperty(element._store, "validated", {- configurable: false,- enumerable: false,- writable: true,- value: false- });- Object.defineProperty(element, "_self", {- configurable: false,- enumerable: false,- writable: false,- value: self- });- Object.defineProperty(element, "_source", {- configurable: false,- enumerable: false,- writable: false,- value: source- });- if (Object.freeze) {- Object.freeze(element.props);- Object.freeze(element);- }- }- return element;- };- function jsxDEV(type, config, maybeKey, source, self) {- {- var propName;- var props = {};- var key = null;- var ref = null;- if (maybeKey !== void 0) {- {- checkKeyStringCoercion(maybeKey);- }- key = "" + maybeKey;- }- if (hasValidKey(config)) {- {- checkKeyStringCoercion(config.key);- }- key = "" + config.key;- }- if (hasValidRef(config)) {- ref = config.ref;- warnIfStringRefCannotBeAutoConverted(config, self);- }- for (propName in config) {- if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {- props[propName] = config[propName];- }- }- if (type && type.defaultProps) {- var defaultProps = type.defaultProps;- for (propName in defaultProps) {- if (props[propName] === void 0) {- props[propName] = defaultProps[propName];- }- }- }- if (key || ref) {- var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;- if (key) {- defineKeyPropWarningGetter(props, displayName);- }- if (ref) {- defineRefPropWarningGetter(props, displayName);- }- }- return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);- }- }- var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;- var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;- function setCurrentlyValidatingElement$1(element) {- {- if (element) {- var owner = element._owner;- var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);- ReactDebugCurrentFrame$1.setExtraStackFrame(stack);- } else {- ReactDebugCurrentFrame$1.setExtraStackFrame(null);- }- }- }- var propTypesMisspellWarningShown;- {- propTypesMisspellWarningShown = false;- }- function isValidElement(object) {- {- return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;- }- }- function getDeclarationErrorAddendum() {- {- if (ReactCurrentOwner$1.current) {- var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);- if (name) {- return "\n\nCheck the render method of `" + name + "`.";- }- }- return "";- }- }- function getSourceInfoErrorAddendum(source) {- {- if (source !== void 0) {- var fileName = source.fileName.replace(/^.*[\\\/]/, "");- var lineNumber = source.lineNumber;- return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";- }- return "";- }- }- var ownerHasKeyUseWarning = {};- function getCurrentComponentErrorInfo(parentType) {- {- var info = getDeclarationErrorAddendum();- if (!info) {- var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;- if (parentName) {- info = "\n\nCheck the top-level render call using <" + parentName + ">.";- }- }- return info;- }- }- function validateExplicitKey(element, parentType) {- {- if (!element._store || element._store.validated || element.key != null) {- return;- }- element._store.validated = true;- var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);- if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {- return;- }- ownerHasKeyUseWarning[currentComponentErrorInfo] = true;- var childOwner = "";- if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {- childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";- }- setCurrentlyValidatingElement$1(element);- error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);- setCurrentlyValidatingElement$1(null);- }- }- function validateChildKeys(node, parentType) {- {- if (typeof node !== "object") {- return;- }- if (isArray(node)) {- for (var i = 0; i < node.length; i++) {- var child = node[i];- if (isValidElement(child)) {- validateExplicitKey(child, parentType);- }- }- } else if (isValidElement(node)) {- if (node._store) {- node._store.validated = true;- }- } else if (node) {- var iteratorFn = getIteratorFn(node);- if (typeof iteratorFn === "function") {- if (iteratorFn !== node.entries) {- var iterator = iteratorFn.call(node);- var step;- while (!(step = iterator.next()).done) {- if (isValidElement(step.value)) {- validateExplicitKey(step.value, parentType);- }- }- }- }- }- }- }- function validatePropTypes(element) {- {- var type = element.type;- if (type === null || type === void 0 || typeof type === "string") {- return;- }- var propTypes;- if (typeof type === "function") {- propTypes = type.propTypes;- } else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.- // Inner props are checked in the reconciler.- type.$$typeof === REACT_MEMO_TYPE)) {- propTypes = type.propTypes;- } else {- return;- }- if (propTypes) {- var name = getComponentNameFromType(type);- checkPropTypes(propTypes, element.props, "prop", name, element);- } else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {- propTypesMisspellWarningShown = true;- var _name = getComponentNameFromType(type);- error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");- }- if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {- error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");- }- }- }- function validateFragmentProps(fragment) {- {- var keys = Object.keys(fragment.props);- for (var i = 0; i < keys.length; i++) {- var key = keys[i];- if (key !== "children" && key !== "key") {- setCurrentlyValidatingElement$1(fragment);- error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);- setCurrentlyValidatingElement$1(null);- break;- }- }- if (fragment.ref !== null) {- setCurrentlyValidatingElement$1(fragment);- error("Invalid attribute `ref` supplied to `React.Fragment`.");- setCurrentlyValidatingElement$1(null);- }- }- }- function jsxWithValidation(type, props, key, isStaticChildren, source, self) {- {- var validType = isValidElementType(type);- if (!validType) {- var info = "";- if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {- info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";- }- var sourceInfo = getSourceInfoErrorAddendum(source);- if (sourceInfo) {- info += sourceInfo;- } else {- info += getDeclarationErrorAddendum();- }- var typeString;- if (type === null) {- typeString = "null";- } else if (isArray(type)) {- typeString = "array";- } else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {- typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";- info = " Did you accidentally export a JSX literal instead of a component?";- } else {- typeString = typeof type;- }- error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info);- }- var element = jsxDEV(type, props, key, source, self);- if (element == null) {- return element;- }- if (validType) {- var children = props.children;- if (children !== void 0) {- if (isStaticChildren) {- if (isArray(children)) {- for (var i = 0; i < children.length; i++) {- validateChildKeys(children[i], type);- }- if (Object.freeze) {- Object.freeze(children);- }- } else {- error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");- }- } else {- validateChildKeys(children, type);- }- }- }- if (type === REACT_FRAGMENT_TYPE) {- validateFragmentProps(element);- } else {- validatePropTypes(element);- }- return element;- }- }- var jsxDEV$1 = jsxWithValidation;- exports2.Fragment = REACT_FRAGMENT_TYPE;- exports2.jsxDEV = jsxDEV$1;- })();- }- }-});--// node_modules/react/jsx-dev-runtime.js-var require_jsx_dev_runtime = __commonJS({- "node_modules/react/jsx-dev-runtime.js"(exports2, module) {- "use strict";- init_global();- init_dirname();- init_filename();- init_buffer2();- init_process2();- if (false) {- module.exports = null;- } else {- module.exports = require_react_jsx_dev_runtime_development();- }- }-});--export {- __esm,- __commonJS,- __toESM,- init_global,- init_dirname,- init_filename,- init_process2 as init_process,- init_buffer2 as init_buffer,- require_react,- require_jsx_dev_runtime-};-/*! Bundled license information:--@jspm/core/nodelibs/browser/buffer.js:- (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)--react/cjs/react.development.js:- (**- * @license React- * react.development.js- *- * Copyright (c) Facebook, Inc. and its affiliates.- *- * This source code is licensed under the MIT license found in the- * LICENSE file in the root directory of this source tree.- *)--react/cjs/react-jsx-dev-runtime.development.js:- (**- * @license React- * react-jsx-dev-runtime.development.js- *- * Copyright (c) Facebook, Inc. and its affiliates.- *- * This source code is licensed under the MIT license found in the- * LICENSE file in the root directory of this source tree.- *)-*/-//# sourceMappingURL=/build/_shared/chunk-NLQNPAAV.js.mapdiff --git a/public/build/_shared/chunk-NLQNPAAV.js.map b/public/build/_shared/chunk-NLQNPAAV.js.mapdeleted file mode 100644index 869a18801..000000000--- a/public/build/_shared/chunk-NLQNPAAV.js.map+++ /dev/null@@ -1,7 +0,0 @@-{- "version": 3,- "sources": ["../../../node_modules/esbuild-plugin-polyfill-node/polyfills/global.js", "../../../node_modules/esbuild-plugin-polyfill-node/polyfills/__dirname.js", "../../../node_modules/esbuild-plugin-polyfill-node/polyfills/__filename.js", "../../../node_modules/@jspm/core/nodelibs/browser/buffer.js", "../../../node_modules/esbuild-plugin-polyfill-node/polyfills/buffer.js", "../../../node_modules/@jspm/core/nodelibs/browser/process.js", "../../../node_modules/esbuild-plugin-polyfill-node/polyfills/process.js", "../../../node_modules/react/cjs/react.development.js", "../../../node_modules/react/index.js", "../../../node_modules/react/cjs/react-jsx-dev-runtime.development.js", "../../../node_modules/react/jsx-dev-runtime.js"],- "sourcesContent": ["const global = globalThis;\nexport { global };\n", "export const __dirname = \"/\";\n", "export const __filename = \"/index.js\";\n", "var exports$3 = {},\n _dewExec$2 = false;\nfunction dew$2() {\n if (_dewExec$2) return exports$3;\n _dewExec$2 = true;\n exports$3.byteLength = byteLength;\n exports$3.toByteArray = toByteArray;\n exports$3.fromByteArray = fromByteArray;\n var lookup = [];\n var revLookup = [];\n var Arr = typeof Uint8Array !== \"undefined\" ? Uint8Array : Array;\n var code = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\n for (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i];\n revLookup[code.charCodeAt(i)] = i;\n } // Support decoding URL-safe base64 strings, as Node.js does.\n // See: https://en.wikipedia.org/wiki/Base64#URL_applications\n\n\n revLookup[\"-\".charCodeAt(0)] = 62;\n revLookup[\"_\".charCodeAt(0)] = 63;\n\n function getLens(b64) {\n var len = b64.length;\n\n if (len % 4 > 0) {\n throw new Error(\"Invalid string. Length must be a multiple of 4\");\n } // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n\n\n var validLen = b64.indexOf(\"=\");\n if (validLen === -1) validLen = len;\n var placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4;\n return [validLen, placeHoldersLen];\n } // base64 is 4/3 + up to two characters of the original data\n\n\n function byteLength(b64) {\n var lens = getLens(b64);\n var validLen = lens[0];\n var placeHoldersLen = lens[1];\n return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;\n }\n\n function _byteLength(b64, validLen, placeHoldersLen) {\n return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;\n }\n\n function toByteArray(b64) {\n var tmp;\n var lens = getLens(b64);\n var validLen = lens[0];\n var placeHoldersLen = lens[1];\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));\n var curByte = 0; // if there are placeholders, only get up to the last complete 4 chars\n\n var len = placeHoldersLen > 0 ? validLen - 4 : validLen;\n var i;\n\n for (i = 0; i < len; i += 4) {\n tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)];\n arr[curByte++] = tmp >> 16 & 255;\n arr[curByte++] = tmp >> 8 & 255;\n arr[curByte++] = tmp & 255;\n }\n\n if (placeHoldersLen === 2) {\n tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4;\n arr[curByte++] = tmp & 255;\n }\n\n if (placeHoldersLen === 1) {\n tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2;\n arr[curByte++] = tmp >> 8 & 255;\n arr[curByte++] = tmp & 255;\n }\n\n return arr;\n }\n\n function tripletToBase64(num) {\n return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63];\n }\n\n function encodeChunk(uint8, start, end) {\n var tmp;\n var output = [];\n\n for (var i = start; i < end; i += 3) {\n tmp = (uint8[i] << 16 & 16711680) + (uint8[i + 1] << 8 & 65280) + (uint8[i + 2] & 255);\n output.push(tripletToBase64(tmp));\n }\n\n return output.join(\"\");\n }\n\n function fromByteArray(uint8) {\n var tmp;\n var len = uint8.length;\n var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes\n\n var parts = [];\n var maxChunkLength = 16383; // must be multiple of 3\n // go through the array every three bytes, we'll deal with trailing stuff later\n\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));\n } // pad the end with zeros, but make sure to not forget the extra bytes\n\n\n if (extraBytes === 1) {\n tmp = uint8[len - 1];\n parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 63] + \"==\");\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1];\n parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + \"=\");\n }\n\n return parts.join(\"\");\n }\n\n return exports$3;\n}\n\nvar exports$2 = {},\n _dewExec$1 = false;\nfunction dew$1() {\n if (_dewExec$1) return exports$2;\n _dewExec$1 = true;\n\n /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */\n exports$2.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m;\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var nBits = -7;\n var i = isLE ? nBytes - 1 : 0;\n var d = isLE ? -1 : 1;\n var s = buffer[offset + i];\n i += d;\n e = s & (1 << -nBits) - 1;\n s >>= -nBits;\n nBits += eLen;\n\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & (1 << -nBits) - 1;\n e >>= -nBits;\n nBits += mLen;\n\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias;\n } else if (e === eMax) {\n return m ? NaN : (s ? -1 : 1) * Infinity;\n } else {\n m = m + Math.pow(2, mLen);\n e = e - eBias;\n }\n\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen);\n };\n\n exports$2.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c;\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;\n var i = isLE ? 0 : nBytes - 1;\n var d = isLE ? 1 : -1;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n value = Math.abs(value);\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0;\n e = eMax;\n } else {\n e = Math.floor(Math.log(value) / Math.LN2);\n\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * Math.pow(2, 1 - eBias);\n }\n\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * Math.pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);\n e = 0;\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 255, i += d, m /= 256, mLen -= 8) {}\n\n e = e << mLen | m;\n eLen += mLen;\n\n for (; eLen > 0; buffer[offset + i] = e & 255, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128;\n };\n\n return exports$2;\n}\n\nvar exports$1 = {},\n _dewExec = false;\nfunction dew() {\n if (_dewExec) return exports$1;\n _dewExec = true;\n\n const base64 = dew$2();\n\n const ieee754 = dew$1();\n\n const customInspectSymbol = typeof Symbol === \"function\" && typeof Symbol[\"for\"] === \"function\" ? Symbol[\"for\"](\"nodejs.util.inspect.custom\") // eslint-disable-line dot-notation\n : null;\n exports$1.Buffer = Buffer;\n exports$1.SlowBuffer = SlowBuffer;\n exports$1.INSPECT_MAX_BYTES = 50;\n const K_MAX_LENGTH = 2147483647;\n exports$1.kMaxLength = K_MAX_LENGTH;\n /**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\n\n Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport();\n\n if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== \"undefined\" && typeof console.error === \"function\") {\n console.error(\"This browser lacks typed array (Uint8Array) support which is required by \" + \"`buffer` v5.x. Use `buffer` v4.x if you require old browser support.\");\n }\n\n function typedArraySupport() {\n // Can typed array instances can be augmented?\n try {\n const arr = new Uint8Array(1);\n const proto = {\n foo: function () {\n return 42;\n }\n };\n Object.setPrototypeOf(proto, Uint8Array.prototype);\n Object.setPrototypeOf(arr, proto);\n return arr.foo() === 42;\n } catch (e) {\n return false;\n }\n }\n\n Object.defineProperty(Buffer.prototype, \"parent\", {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined;\n return this.buffer;\n }\n });\n Object.defineProperty(Buffer.prototype, \"offset\", {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined;\n return this.byteOffset;\n }\n });\n\n function createBuffer(length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError(\"The value \\\"\" + length + \"\\\" is invalid for option \\\"size\\\"\");\n } // Return an augmented `Uint8Array` instance\n\n\n const buf = new Uint8Array(length);\n Object.setPrototypeOf(buf, Buffer.prototype);\n return buf;\n }\n /**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\n\n function Buffer(arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === \"number\") {\n if (typeof encodingOrOffset === \"string\") {\n throw new TypeError(\"The \\\"string\\\" argument must be of type string. Received type number\");\n }\n\n return allocUnsafe(arg);\n }\n\n return from(arg, encodingOrOffset, length);\n }\n\n Buffer.poolSize = 8192; // not used by this implementation\n\n function from(value, encodingOrOffset, length) {\n if (typeof value === \"string\") {\n return fromString(value, encodingOrOffset);\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value);\n }\n\n if (value == null) {\n throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, \" + \"or Array-like Object. Received type \" + typeof value);\n }\n\n if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) {\n return fromArrayBuffer(value, encodingOrOffset, length);\n }\n\n if (typeof SharedArrayBuffer !== \"undefined\" && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length);\n }\n\n if (typeof value === \"number\") {\n throw new TypeError(\"The \\\"value\\\" argument must not be of type number. Received type number\");\n }\n\n const valueOf = value.valueOf && value.valueOf();\n\n if (valueOf != null && valueOf !== value) {\n return Buffer.from(valueOf, encodingOrOffset, length);\n }\n\n const b = fromObject(value);\n if (b) return b;\n\n if (typeof Symbol !== \"undefined\" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === \"function\") {\n return Buffer.from(value[Symbol.toPrimitive](\"string\"), encodingOrOffset, length);\n }\n\n throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, \" + \"or Array-like Object. Received type \" + typeof value);\n }\n /**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\n\n\n Buffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length);\n }; // Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n // https://github.com/feross/buffer/pull/148\n\n\n Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype);\n Object.setPrototypeOf(Buffer, Uint8Array);\n\n function assertSize(size) {\n if (typeof size !== \"number\") {\n throw new TypeError(\"\\\"size\\\" argument must be of type number\");\n } else if (size < 0) {\n throw new RangeError(\"The value \\\"\" + size + \"\\\" is invalid for option \\\"size\\\"\");\n }\n }\n\n function alloc(size, fill, encoding) {\n assertSize(size);\n\n if (size <= 0) {\n return createBuffer(size);\n }\n\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpreted as a start offset.\n return typeof encoding === \"string\" ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill);\n }\n\n return createBuffer(size);\n }\n /**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\n\n\n Buffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding);\n };\n\n function allocUnsafe(size) {\n assertSize(size);\n return createBuffer(size < 0 ? 0 : checked(size) | 0);\n }\n /**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\n\n\n Buffer.allocUnsafe = function (size) {\n return allocUnsafe(size);\n };\n /**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\n\n\n Buffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size);\n };\n\n function fromString(string, encoding) {\n if (typeof encoding !== \"string\" || encoding === \"\") {\n encoding = \"utf8\";\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError(\"Unknown encoding: \" + encoding);\n }\n\n const length = byteLength(string, encoding) | 0;\n let buf = createBuffer(length);\n const actual = buf.write(string, encoding);\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual);\n }\n\n return buf;\n }\n\n function fromArrayLike(array) {\n const length = array.length < 0 ? 0 : checked(array.length) | 0;\n const buf = createBuffer(length);\n\n for (let i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255;\n }\n\n return buf;\n }\n\n function fromArrayView(arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n const copy = new Uint8Array(arrayView);\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength);\n }\n\n return fromArrayLike(arrayView);\n }\n\n function fromArrayBuffer(array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError(\"\\\"offset\\\" is outside of buffer bounds\");\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError(\"\\\"length\\\" is outside of buffer bounds\");\n }\n\n let buf;\n\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array);\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset);\n } else {\n buf = new Uint8Array(array, byteOffset, length);\n } // Return an augmented `Uint8Array` instance\n\n\n Object.setPrototypeOf(buf, Buffer.prototype);\n return buf;\n }\n\n function fromObject(obj) {\n if (Buffer.isBuffer(obj)) {\n const len = checked(obj.length) | 0;\n const buf = createBuffer(len);\n\n if (buf.length === 0) {\n return buf;\n }\n\n obj.copy(buf, 0, 0, len);\n return buf;\n }\n\n if (obj.length !== undefined) {\n if (typeof obj.length !== \"number\" || numberIsNaN(obj.length)) {\n return createBuffer(0);\n }\n\n return fromArrayLike(obj);\n }\n\n if (obj.type === \"Buffer\" && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data);\n }\n }\n\n function checked(length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError(\"Attempt to allocate Buffer larger than maximum \" + \"size: 0x\" + K_MAX_LENGTH.toString(16) + \" bytes\");\n }\n\n return length | 0;\n }\n\n function SlowBuffer(length) {\n if (+length != length) {\n // eslint-disable-line eqeqeq\n length = 0;\n }\n\n return Buffer.alloc(+length);\n }\n\n Buffer.isBuffer = function isBuffer(b) {\n return b != null && b._isBuffer === true && b !== Buffer.prototype; // so Buffer.isBuffer(Buffer.prototype) will be false\n };\n\n Buffer.compare = function compare(a, b) {\n if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength);\n if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength);\n\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError(\"The \\\"buf1\\\", \\\"buf2\\\" arguments must be one of type Buffer or Uint8Array\");\n }\n\n if (a === b) return 0;\n let x = a.length;\n let y = b.length;\n\n for (let i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) return -1;\n if (y < x) return 1;\n return 0;\n };\n\n Buffer.isEncoding = function isEncoding(encoding) {\n switch (String(encoding).toLowerCase()) {\n case \"hex\":\n case \"utf8\":\n case \"utf-8\":\n case \"ascii\":\n case \"latin1\":\n case \"binary\":\n case \"base64\":\n case \"ucs2\":\n case \"ucs-2\":\n case \"utf16le\":\n case \"utf-16le\":\n return true;\n\n default:\n return false;\n }\n };\n\n Buffer.concat = function concat(list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError(\"\\\"list\\\" argument must be an Array of Buffers\");\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0);\n }\n\n let i;\n\n if (length === undefined) {\n length = 0;\n\n for (i = 0; i < list.length; ++i) {\n length += list[i].length;\n }\n }\n\n const buffer = Buffer.allocUnsafe(length);\n let pos = 0;\n\n for (i = 0; i < list.length; ++i) {\n let buf = list[i];\n\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf);\n buf.copy(buffer, pos);\n } else {\n Uint8Array.prototype.set.call(buffer, buf, pos);\n }\n } else if (!Buffer.isBuffer(buf)) {\n throw new TypeError(\"\\\"list\\\" argument must be an Array of Buffers\");\n } else {\n buf.copy(buffer, pos);\n }\n\n pos += buf.length;\n }\n\n return buffer;\n };\n\n function byteLength(string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length;\n }\n\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength;\n }\n\n if (typeof string !== \"string\") {\n throw new TypeError(\"The \\\"string\\\" argument must be one of type string, Buffer, or ArrayBuffer. \" + \"Received type \" + typeof string);\n }\n\n const len = string.length;\n const mustMatch = arguments.length > 2 && arguments[2] === true;\n if (!mustMatch && len === 0) return 0; // Use a for loop to avoid recursion\n\n let loweredCase = false;\n\n for (;;) {\n switch (encoding) {\n case \"ascii\":\n case \"latin1\":\n case \"binary\":\n return len;\n\n case \"utf8\":\n case \"utf-8\":\n return utf8ToBytes(string).length;\n\n case \"ucs2\":\n case \"ucs-2\":\n case \"utf16le\":\n case \"utf-16le\":\n return len * 2;\n\n case \"hex\":\n return len >>> 1;\n\n case \"base64\":\n return base64ToBytes(string).length;\n\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length; // assume utf8\n }\n\n encoding = (\"\" + encoding).toLowerCase();\n loweredCase = true;\n }\n }\n }\n\n Buffer.byteLength = byteLength;\n\n function slowToString(encoding, start, end) {\n let loweredCase = false; // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n\n if (start === undefined || start < 0) {\n start = 0;\n } // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n\n\n if (start > this.length) {\n return \"\";\n }\n\n if (end === undefined || end > this.length) {\n end = this.length;\n }\n\n if (end <= 0) {\n return \"\";\n } // Force coercion to uint32. This will also coerce falsey/NaN values to 0.\n\n\n end >>>= 0;\n start >>>= 0;\n\n if (end <= start) {\n return \"\";\n }\n\n if (!encoding) encoding = \"utf8\";\n\n while (true) {\n switch (encoding) {\n case \"hex\":\n return hexSlice(this, start, end);\n\n case \"utf8\":\n case \"utf-8\":\n return utf8Slice(this, start, end);\n\n case \"ascii\":\n return asciiSlice(this, start, end);\n\n case \"latin1\":\n case \"binary\":\n return latin1Slice(this, start, end);\n\n case \"base64\":\n return base64Slice(this, start, end);\n\n case \"ucs2\":\n case \"ucs-2\":\n case \"utf16le\":\n case \"utf-16le\":\n return utf16leSlice(this, start, end);\n\n default:\n if (loweredCase) throw new TypeError(\"Unknown encoding: \" + encoding);\n encoding = (encoding + \"\").toLowerCase();\n loweredCase = true;\n }\n }\n } // This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n // to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n // reliably in a browserify context because there could be multiple different\n // copies of the 'buffer' package in use. This method works even for Buffer\n // instances that were created from another copy of the `buffer` package.\n // See: https://github.com/feross/buffer/issues/154\n\n\n Buffer.prototype._isBuffer = true;\n\n function swap(b, n, m) {\n const i = b[n];\n b[n] = b[m];\n b[m] = i;\n }\n\n Buffer.prototype.swap16 = function swap16() {\n const len = this.length;\n\n if (len % 2 !== 0) {\n throw new RangeError(\"Buffer size must be a multiple of 16-bits\");\n }\n\n for (let i = 0; i < len; i += 2) {\n swap(this, i, i + 1);\n }\n\n return this;\n };\n\n Buffer.prototype.swap32 = function swap32() {\n const len = this.length;\n\n if (len % 4 !== 0) {\n throw new RangeError(\"Buffer size must be a multiple of 32-bits\");\n }\n\n for (let i = 0; i < len; i += 4) {\n swap(this, i, i + 3);\n swap(this, i + 1, i + 2);\n }\n\n return this;\n };\n\n Buffer.prototype.swap64 = function swap64() {\n const len = this.length;\n\n if (len % 8 !== 0) {\n throw new RangeError(\"Buffer size must be a multiple of 64-bits\");\n }\n\n for (let i = 0; i < len; i += 8) {\n swap(this, i, i + 7);\n swap(this, i + 1, i + 6);\n swap(this, i + 2, i + 5);\n swap(this, i + 3, i + 4);\n }\n\n return this;\n };\n\n Buffer.prototype.toString = function toString() {\n const length = this.length;\n if (length === 0) return \"\";\n if (arguments.length === 0) return utf8Slice(this, 0, length);\n return slowToString.apply(this, arguments);\n };\n\n Buffer.prototype.toLocaleString = Buffer.prototype.toString;\n\n Buffer.prototype.equals = function equals(b) {\n if (!Buffer.isBuffer(b)) throw new TypeError(\"Argument must be a Buffer\");\n if (this === b) return true;\n return Buffer.compare(this, b) === 0;\n };\n\n Buffer.prototype.inspect = function inspect() {\n let str = \"\";\n const max = exports$1.INSPECT_MAX_BYTES;\n str = this.toString(\"hex\", 0, max).replace(/(.{2})/g, \"$1 \").trim();\n if (this.length > max) str += \" ... \";\n return \"<Buffer \" + str + \">\";\n };\n\n if (customInspectSymbol) {\n Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect;\n }\n\n Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer.from(target, target.offset, target.byteLength);\n }\n\n if (!Buffer.isBuffer(target)) {\n throw new TypeError(\"The \\\"target\\\" argument must be one of type Buffer or Uint8Array. \" + \"Received type \" + typeof target);\n }\n\n if (start === undefined) {\n start = 0;\n }\n\n if (end === undefined) {\n end = target ? target.length : 0;\n }\n\n if (thisStart === undefined) {\n thisStart = 0;\n }\n\n if (thisEnd === undefined) {\n thisEnd = this.length;\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError(\"out of range index\");\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0;\n }\n\n if (thisStart >= thisEnd) {\n return -1;\n }\n\n if (start >= end) {\n return 1;\n }\n\n start >>>= 0;\n end >>>= 0;\n thisStart >>>= 0;\n thisEnd >>>= 0;\n if (this === target) return 0;\n let x = thisEnd - thisStart;\n let y = end - start;\n const len = Math.min(x, y);\n const thisCopy = this.slice(thisStart, thisEnd);\n const targetCopy = target.slice(start, end);\n\n for (let i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i];\n y = targetCopy[i];\n break;\n }\n }\n\n if (x < y) return -1;\n if (y < x) return 1;\n return 0;\n }; // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n // OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n //\n // Arguments:\n // - buffer - a Buffer to search\n // - val - a string, Buffer, or number\n // - byteOffset - an index into `buffer`; will be clamped to an int32\n // - encoding - an optional encoding, relevant is val is a string\n // - dir - true for indexOf, false for lastIndexOf\n\n\n function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1; // Normalize byteOffset\n\n if (typeof byteOffset === \"string\") {\n encoding = byteOffset;\n byteOffset = 0;\n } else if (byteOffset > 2147483647) {\n byteOffset = 2147483647;\n } else if (byteOffset < -2147483648) {\n byteOffset = -2147483648;\n }\n\n byteOffset = +byteOffset; // Coerce to Number.\n\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : buffer.length - 1;\n } // Normalize byteOffset: negative offsets start from the end of the buffer\n\n\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset;\n\n if (byteOffset >= buffer.length) {\n if (dir) return -1;else byteOffset = buffer.length - 1;\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0;else return -1;\n } // Normalize val\n\n\n if (typeof val === \"string\") {\n val = Buffer.from(val, encoding);\n } // Finally, search either indexOf (if dir is true) or lastIndexOf\n\n\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1;\n }\n\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir);\n } else if (typeof val === \"number\") {\n val = val & 255; // Search for a byte value [0-255]\n\n if (typeof Uint8Array.prototype.indexOf === \"function\") {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);\n }\n }\n\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);\n }\n\n throw new TypeError(\"val must be string, number or Buffer\");\n }\n\n function arrayIndexOf(arr, val, byteOffset, encoding, dir) {\n let indexSize = 1;\n let arrLength = arr.length;\n let valLength = val.length;\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase();\n\n if (encoding === \"ucs2\" || encoding === \"ucs-2\" || encoding === \"utf16le\" || encoding === \"utf-16le\") {\n if (arr.length < 2 || val.length < 2) {\n return -1;\n }\n\n indexSize = 2;\n arrLength /= 2;\n valLength /= 2;\n byteOffset /= 2;\n }\n }\n\n function read(buf, i) {\n if (indexSize === 1) {\n return buf[i];\n } else {\n return buf.readUInt16BE(i * indexSize);\n }\n }\n\n let i;\n\n if (dir) {\n let foundIndex = -1;\n\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i;\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize;\n } else {\n if (foundIndex !== -1) i -= i - foundIndex;\n foundIndex = -1;\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;\n\n for (i = byteOffset; i >= 0; i--) {\n let found = true;\n\n for (let j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false;\n break;\n }\n }\n\n if (found) return i;\n }\n }\n\n return -1;\n }\n\n Buffer.prototype.includes = function includes(val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1;\n };\n\n Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true);\n };\n\n Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false);\n };\n\n function hexWrite(buf, string, offset, length) {\n offset = Number(offset) || 0;\n const remaining = buf.length - offset;\n\n if (!length) {\n length = remaining;\n } else {\n length = Number(length);\n\n if (length > remaining) {\n length = remaining;\n }\n }\n\n const strLen = string.length;\n\n if (length > strLen / 2) {\n length = strLen / 2;\n }\n\n let i;\n\n for (i = 0; i < length; ++i) {\n const parsed = parseInt(string.substr(i * 2, 2), 16);\n if (numberIsNaN(parsed)) return i;\n buf[offset + i] = parsed;\n }\n\n return i;\n }\n\n function utf8Write(buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);\n }\n\n function asciiWrite(buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length);\n }\n\n function base64Write(buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length);\n }\n\n function ucs2Write(buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);\n }\n\n Buffer.prototype.write = function write(string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = \"utf8\";\n length = this.length;\n offset = 0; // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === \"string\") {\n encoding = offset;\n length = this.length;\n offset = 0; // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0;\n\n if (isFinite(length)) {\n length = length >>> 0;\n if (encoding === undefined) encoding = \"utf8\";\n } else {\n encoding = length;\n length = undefined;\n }\n } else {\n throw new Error(\"Buffer.write(string, encoding, offset[, length]) is no longer supported\");\n }\n\n const remaining = this.length - offset;\n if (length === undefined || length > remaining) length = remaining;\n\n if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) {\n throw new RangeError(\"Attempt to write outside buffer bounds\");\n }\n\n if (!encoding) encoding = \"utf8\";\n let loweredCase = false;\n\n for (;;) {\n switch (encoding) {\n case \"hex\":\n return hexWrite(this, string, offset, length);\n\n case \"utf8\":\n case \"utf-8\":\n return utf8Write(this, string, offset, length);\n\n case \"ascii\":\n case \"latin1\":\n case \"binary\":\n return asciiWrite(this, string, offset, length);\n\n case \"base64\":\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length);\n\n case \"ucs2\":\n case \"ucs-2\":\n case \"utf16le\":\n case \"utf-16le\":\n return ucs2Write(this, string, offset, length);\n\n default:\n if (loweredCase) throw new TypeError(\"Unknown encoding: \" + encoding);\n encoding = (\"\" + encoding).toLowerCase();\n loweredCase = true;\n }\n }\n };\n\n Buffer.prototype.toJSON = function toJSON() {\n return {\n type: \"Buffer\",\n data: Array.prototype.slice.call(this._arr || this, 0)\n };\n };\n\n function base64Slice(buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf);\n } else {\n return base64.fromByteArray(buf.slice(start, end));\n }\n }\n\n function utf8Slice(buf, start, end) {\n end = Math.min(buf.length, end);\n const res = [];\n let i = start;\n\n while (i < end) {\n const firstByte = buf[i];\n let codePoint = null;\n let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1;\n\n if (i + bytesPerSequence <= end) {\n let secondByte, thirdByte, fourthByte, tempCodePoint;\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 128) {\n codePoint = firstByte;\n }\n\n break;\n\n case 2:\n secondByte = buf[i + 1];\n\n if ((secondByte & 192) === 128) {\n tempCodePoint = (firstByte & 31) << 6 | secondByte & 63;\n\n if (tempCodePoint > 127) {\n codePoint = tempCodePoint;\n }\n }\n\n break;\n\n case 3:\n secondByte = buf[i + 1];\n thirdByte = buf[i + 2];\n\n if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) {\n tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63;\n\n if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) {\n codePoint = tempCodePoint;\n }\n }\n\n break;\n\n case 4:\n secondByte = buf[i + 1];\n thirdByte = buf[i + 2];\n fourthByte = buf[i + 3];\n\n if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) {\n tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63;\n\n if (tempCodePoint > 65535 && tempCodePoint < 1114112) {\n codePoint = tempCodePoint;\n }\n }\n\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 65533;\n bytesPerSequence = 1;\n } else if (codePoint > 65535) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 65536;\n res.push(codePoint >>> 10 & 1023 | 55296);\n codePoint = 56320 | codePoint & 1023;\n }\n\n res.push(codePoint);\n i += bytesPerSequence;\n }\n\n return decodeCodePointsArray(res);\n } // Based on http://stackoverflow.com/a/22747272/680742, the browser with\n // the lowest limit is Chrome, with 0x10000 args.\n // We go 1 magnitude less, for safety\n\n\n const MAX_ARGUMENTS_LENGTH = 4096;\n\n function decodeCodePointsArray(codePoints) {\n const len = codePoints.length;\n\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints); // avoid extra slice()\n } // Decode in chunks to avoid \"call stack size exceeded\".\n\n\n let res = \"\";\n let i = 0;\n\n while (i < len) {\n res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH));\n }\n\n return res;\n }\n\n function asciiSlice(buf, start, end) {\n let ret = \"\";\n end = Math.min(buf.length, end);\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 127);\n }\n\n return ret;\n }\n\n function latin1Slice(buf, start, end) {\n let ret = \"\";\n end = Math.min(buf.length, end);\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i]);\n }\n\n return ret;\n }\n\n function hexSlice(buf, start, end) {\n const len = buf.length;\n if (!start || start < 0) start = 0;\n if (!end || end < 0 || end > len) end = len;\n let out = \"\";\n\n for (let i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]];\n }\n\n return out;\n }\n\n function utf16leSlice(buf, start, end) {\n const bytes = buf.slice(start, end);\n let res = \"\"; // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)\n\n for (let i = 0; i < bytes.length - 1; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);\n }\n\n return res;\n }\n\n Buffer.prototype.slice = function slice(start, end) {\n const len = this.length;\n start = ~~start;\n end = end === undefined ? len : ~~end;\n\n if (start < 0) {\n start += len;\n if (start < 0) start = 0;\n } else if (start > len) {\n start = len;\n }\n\n if (end < 0) {\n end += len;\n if (end < 0) end = 0;\n } else if (end > len) {\n end = len;\n }\n\n if (end < start) end = start;\n const newBuf = this.subarray(start, end); // Return an augmented `Uint8Array` instance\n\n Object.setPrototypeOf(newBuf, Buffer.prototype);\n return newBuf;\n };\n /*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\n\n\n function checkOffset(offset, ext, length) {\n if (offset % 1 !== 0 || offset < 0) throw new RangeError(\"offset is not uint\");\n if (offset + ext > length) throw new RangeError(\"Trying to access beyond buffer length\");\n }\n\n Buffer.prototype.readUintLE = Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) {\n offset = offset >>> 0;\n byteLength = byteLength >>> 0;\n if (!noAssert) checkOffset(offset, byteLength, this.length);\n let val = this[offset];\n let mul = 1;\n let i = 0;\n\n while (++i < byteLength && (mul *= 256)) {\n val += this[offset + i] * mul;\n }\n\n return val;\n };\n\n Buffer.prototype.readUintBE = Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) {\n offset = offset >>> 0;\n byteLength = byteLength >>> 0;\n\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length);\n }\n\n let val = this[offset + --byteLength];\n let mul = 1;\n\n while (byteLength > 0 && (mul *= 256)) {\n val += this[offset + --byteLength] * mul;\n }\n\n return val;\n };\n\n Buffer.prototype.readUint8 = Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 1, this.length);\n return this[offset];\n };\n\n Buffer.prototype.readUint16LE = Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 2, this.length);\n return this[offset] | this[offset + 1] << 8;\n };\n\n Buffer.prototype.readUint16BE = Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 2, this.length);\n return this[offset] << 8 | this[offset + 1];\n };\n\n Buffer.prototype.readUint32LE = Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216;\n };\n\n Buffer.prototype.readUint32BE = Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);\n };\n\n Buffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE(offset) {\n offset = offset >>> 0;\n validateNumber(offset, \"offset\");\n const first = this[offset];\n const last = this[offset + 7];\n\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8);\n }\n\n const lo = first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24;\n const hi = this[++offset] + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + last * 2 ** 24;\n return BigInt(lo) + (BigInt(hi) << BigInt(32));\n });\n Buffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE(offset) {\n offset = offset >>> 0;\n validateNumber(offset, \"offset\");\n const first = this[offset];\n const last = this[offset + 7];\n\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8);\n }\n\n const hi = first * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset];\n const lo = this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last;\n return (BigInt(hi) << BigInt(32)) + BigInt(lo);\n });\n\n Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) {\n offset = offset >>> 0;\n byteLength = byteLength >>> 0;\n if (!noAssert) checkOffset(offset, byteLength, this.length);\n let val = this[offset];\n let mul = 1;\n let i = 0;\n\n while (++i < byteLength && (mul *= 256)) {\n val += this[offset + i] * mul;\n }\n\n mul *= 128;\n if (val >= mul) val -= Math.pow(2, 8 * byteLength);\n return val;\n };\n\n Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) {\n offset = offset >>> 0;\n byteLength = byteLength >>> 0;\n if (!noAssert) checkOffset(offset, byteLength, this.length);\n let i = byteLength;\n let mul = 1;\n let val = this[offset + --i];\n\n while (i > 0 && (mul *= 256)) {\n val += this[offset + --i] * mul;\n }\n\n mul *= 128;\n if (val >= mul) val -= Math.pow(2, 8 * byteLength);\n return val;\n };\n\n Buffer.prototype.readInt8 = function readInt8(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 1, this.length);\n if (!(this[offset] & 128)) return this[offset];\n return (255 - this[offset] + 1) * -1;\n };\n\n Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 2, this.length);\n const val = this[offset] | this[offset + 1] << 8;\n return val & 32768 ? val | 4294901760 : val;\n };\n\n Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 2, this.length);\n const val = this[offset + 1] | this[offset] << 8;\n return val & 32768 ? val | 4294901760 : val;\n };\n\n Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;\n };\n\n Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];\n };\n\n Buffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE(offset) {\n offset = offset >>> 0;\n validateNumber(offset, \"offset\");\n const first = this[offset];\n const last = this[offset + 7];\n\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8);\n }\n\n const val = this[offset + 4] + this[offset + 5] * 2 ** 8 + this[offset + 6] * 2 ** 16 + (last << 24); // Overflow\n\n return (BigInt(val) << BigInt(32)) + BigInt(first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24);\n });\n Buffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE(offset) {\n offset = offset >>> 0;\n validateNumber(offset, \"offset\");\n const first = this[offset];\n const last = this[offset + 7];\n\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8);\n }\n\n const val = (first << 24) + // Overflow\n this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset];\n return (BigInt(val) << BigInt(32)) + BigInt(this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last);\n });\n\n Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return ieee754.read(this, offset, true, 23, 4);\n };\n\n Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return ieee754.read(this, offset, false, 23, 4);\n };\n\n Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 8, this.length);\n return ieee754.read(this, offset, true, 52, 8);\n };\n\n Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 8, this.length);\n return ieee754.read(this, offset, false, 52, 8);\n };\n\n function checkInt(buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError(\"\\\"buffer\\\" argument must be a Buffer instance\");\n if (value > max || value < min) throw new RangeError(\"\\\"value\\\" argument is out of bounds\");\n if (offset + ext > buf.length) throw new RangeError(\"Index out of range\");\n }\n\n Buffer.prototype.writeUintLE = Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset >>> 0;\n byteLength = byteLength >>> 0;\n\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1;\n checkInt(this, value, offset, byteLength, maxBytes, 0);\n }\n\n let mul = 1;\n let i = 0;\n this[offset] = value & 255;\n\n while (++i < byteLength && (mul *= 256)) {\n this[offset + i] = value / mul & 255;\n }\n\n return offset + byteLength;\n };\n\n Buffer.prototype.writeUintBE = Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset >>> 0;\n byteLength = byteLength >>> 0;\n\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1;\n checkInt(this, value, offset, byteLength, maxBytes, 0);\n }\n\n let i = byteLength - 1;\n let mul = 1;\n this[offset + i] = value & 255;\n\n while (--i >= 0 && (mul *= 256)) {\n this[offset + i] = value / mul & 255;\n }\n\n return offset + byteLength;\n };\n\n Buffer.prototype.writeUint8 = Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 1, 255, 0);\n this[offset] = value & 255;\n return offset + 1;\n };\n\n Buffer.prototype.writeUint16LE = Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);\n this[offset] = value & 255;\n this[offset + 1] = value >>> 8;\n return offset + 2;\n };\n\n Buffer.prototype.writeUint16BE = Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);\n this[offset] = value >>> 8;\n this[offset + 1] = value & 255;\n return offset + 2;\n };\n\n Buffer.prototype.writeUint32LE = Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);\n this[offset + 3] = value >>> 24;\n this[offset + 2] = value >>> 16;\n this[offset + 1] = value >>> 8;\n this[offset] = value & 255;\n return offset + 4;\n };\n\n Buffer.prototype.writeUint32BE = Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);\n this[offset] = value >>> 24;\n this[offset + 1] = value >>> 16;\n this[offset + 2] = value >>> 8;\n this[offset + 3] = value & 255;\n return offset + 4;\n };\n\n function wrtBigUInt64LE(buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7);\n let lo = Number(value & BigInt(4294967295));\n buf[offset++] = lo;\n lo = lo >> 8;\n buf[offset++] = lo;\n lo = lo >> 8;\n buf[offset++] = lo;\n lo = lo >> 8;\n buf[offset++] = lo;\n let hi = Number(value >> BigInt(32) & BigInt(4294967295));\n buf[offset++] = hi;\n hi = hi >> 8;\n buf[offset++] = hi;\n hi = hi >> 8;\n buf[offset++] = hi;\n hi = hi >> 8;\n buf[offset++] = hi;\n return offset;\n }\n\n function wrtBigUInt64BE(buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7);\n let lo = Number(value & BigInt(4294967295));\n buf[offset + 7] = lo;\n lo = lo >> 8;\n buf[offset + 6] = lo;\n lo = lo >> 8;\n buf[offset + 5] = lo;\n lo = lo >> 8;\n buf[offset + 4] = lo;\n let hi = Number(value >> BigInt(32) & BigInt(4294967295));\n buf[offset + 3] = hi;\n hi = hi >> 8;\n buf[offset + 2] = hi;\n hi = hi >> 8;\n buf[offset + 1] = hi;\n hi = hi >> 8;\n buf[offset] = hi;\n return offset + 8;\n }\n\n Buffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE(value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt(\"0xffffffffffffffff\"));\n });\n Buffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE(value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt(\"0xffffffffffffffff\"));\n });\n\n Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset >>> 0;\n\n if (!noAssert) {\n const limit = Math.pow(2, 8 * byteLength - 1);\n checkInt(this, value, offset, byteLength, limit - 1, -limit);\n }\n\n let i = 0;\n let mul = 1;\n let sub = 0;\n this[offset] = value & 255;\n\n while (++i < byteLength && (mul *= 256)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1;\n }\n\n this[offset + i] = (value / mul >> 0) - sub & 255;\n }\n\n return offset + byteLength;\n };\n\n Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset >>> 0;\n\n if (!noAssert) {\n const limit = Math.pow(2, 8 * byteLength - 1);\n checkInt(this, value, offset, byteLength, limit - 1, -limit);\n }\n\n let i = byteLength - 1;\n let mul = 1;\n let sub = 0;\n this[offset + i] = value & 255;\n\n while (--i >= 0 && (mul *= 256)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1;\n }\n\n this[offset + i] = (value / mul >> 0) - sub & 255;\n }\n\n return offset + byteLength;\n };\n\n Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 1, 127, -128);\n if (value < 0) value = 255 + value + 1;\n this[offset] = value & 255;\n return offset + 1;\n };\n\n Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);\n this[offset] = value & 255;\n this[offset + 1] = value >>> 8;\n return offset + 2;\n };\n\n Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);\n this[offset] = value >>> 8;\n this[offset + 1] = value & 255;\n return offset + 2;\n };\n\n Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);\n this[offset] = value & 255;\n this[offset + 1] = value >>> 8;\n this[offset + 2] = value >>> 16;\n this[offset + 3] = value >>> 24;\n return offset + 4;\n };\n\n Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);\n if (value < 0) value = 4294967295 + value + 1;\n this[offset] = value >>> 24;\n this[offset + 1] = value >>> 16;\n this[offset + 2] = value >>> 8;\n this[offset + 3] = value & 255;\n return offset + 4;\n };\n\n Buffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE(value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, -BigInt(\"0x8000000000000000\"), BigInt(\"0x7fffffffffffffff\"));\n });\n Buffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE(value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, -BigInt(\"0x8000000000000000\"), BigInt(\"0x7fffffffffffffff\"));\n });\n\n function checkIEEE754(buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError(\"Index out of range\");\n if (offset < 0) throw new RangeError(\"Index out of range\");\n }\n\n function writeFloat(buf, value, offset, littleEndian, noAssert) {\n value = +value;\n offset = offset >>> 0;\n\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4);\n }\n\n ieee754.write(buf, value, offset, littleEndian, 23, 4);\n return offset + 4;\n }\n\n Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert);\n };\n\n Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert);\n };\n\n function writeDouble(buf, value, offset, littleEndian, noAssert) {\n value = +value;\n offset = offset >>> 0;\n\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8);\n }\n\n ieee754.write(buf, value, offset, littleEndian, 52, 8);\n return offset + 8;\n }\n\n Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert);\n };\n\n Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert);\n }; // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\n\n\n Buffer.prototype.copy = function copy(target, targetStart, start, end) {\n if (!Buffer.isBuffer(target)) throw new TypeError(\"argument should be a Buffer\");\n if (!start) start = 0;\n if (!end && end !== 0) end = this.length;\n if (targetStart >= target.length) targetStart = target.length;\n if (!targetStart) targetStart = 0;\n if (end > 0 && end < start) end = start; // Copy 0 bytes; we're done\n\n if (end === start) return 0;\n if (target.length === 0 || this.length === 0) return 0; // Fatal error conditions\n\n if (targetStart < 0) {\n throw new RangeError(\"targetStart out of bounds\");\n }\n\n if (start < 0 || start >= this.length) throw new RangeError(\"Index out of range\");\n if (end < 0) throw new RangeError(\"sourceEnd out of bounds\"); // Are we oob?\n\n if (end > this.length) end = this.length;\n\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start;\n }\n\n const len = end - start;\n\n if (this === target && typeof Uint8Array.prototype.copyWithin === \"function\") {\n // Use built-in when available, missing from IE11\n this.copyWithin(targetStart, start, end);\n } else {\n Uint8Array.prototype.set.call(target, this.subarray(start, end), targetStart);\n }\n\n return len;\n }; // Usage:\n // buffer.fill(number[, offset[, end]])\n // buffer.fill(buffer[, offset[, end]])\n // buffer.fill(string[, offset[, end]][, encoding])\n\n\n Buffer.prototype.fill = function fill(val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === \"string\") {\n if (typeof start === \"string\") {\n encoding = start;\n start = 0;\n end = this.length;\n } else if (typeof end === \"string\") {\n encoding = end;\n end = this.length;\n }\n\n if (encoding !== undefined && typeof encoding !== \"string\") {\n throw new TypeError(\"encoding must be a string\");\n }\n\n if (typeof encoding === \"string\" && !Buffer.isEncoding(encoding)) {\n throw new TypeError(\"Unknown encoding: \" + encoding);\n }\n\n if (val.length === 1) {\n const code = val.charCodeAt(0);\n\n if (encoding === \"utf8\" && code < 128 || encoding === \"latin1\") {\n // Fast path: If `val` fits into a single byte, use that numeric value.\n val = code;\n }\n }\n } else if (typeof val === \"number\") {\n val = val & 255;\n } else if (typeof val === \"boolean\") {\n val = Number(val);\n } // Invalid ranges are not set to a default, so can range check early.\n\n\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError(\"Out of range index\");\n }\n\n if (end <= start) {\n return this;\n }\n\n start = start >>> 0;\n end = end === undefined ? this.length : end >>> 0;\n if (!val) val = 0;\n let i;\n\n if (typeof val === \"number\") {\n for (i = start; i < end; ++i) {\n this[i] = val;\n }\n } else {\n const bytes = Buffer.isBuffer(val) ? val : Buffer.from(val, encoding);\n const len = bytes.length;\n\n if (len === 0) {\n throw new TypeError(\"The value \\\"\" + val + \"\\\" is invalid for argument \\\"value\\\"\");\n }\n\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len];\n }\n }\n\n return this;\n }; // CUSTOM ERRORS\n // =============\n // Simplified versions from Node, changed for Buffer-only usage\n\n\n const errors = {};\n\n function E(sym, getMessage, Base) {\n errors[sym] = class NodeError extends Base {\n constructor() {\n super();\n Object.defineProperty(this, \"message\", {\n value: getMessage.apply(this, arguments),\n writable: true,\n configurable: true\n }); // Add the error code to the name to include it in the stack trace.\n\n this.name = `${this.name} [${sym}]`; // Access the stack to generate the error message including the error code\n // from the name.\n\n this.stack; // eslint-disable-line no-unused-expressions\n // Reset the name to the actual name.\n\n delete this.name;\n }\n\n get code() {\n return sym;\n }\n\n set code(value) {\n Object.defineProperty(this, \"code\", {\n configurable: true,\n enumerable: true,\n value,\n writable: true\n });\n }\n\n toString() {\n return `${this.name} [${sym}]: ${this.message}`;\n }\n\n };\n }\n\n E(\"ERR_BUFFER_OUT_OF_BOUNDS\", function (name) {\n if (name) {\n return `${name} is outside of buffer bounds`;\n }\n\n return \"Attempt to access memory outside buffer bounds\";\n }, RangeError);\n E(\"ERR_INVALID_ARG_TYPE\", function (name, actual) {\n return `The \"${name}\" argument must be of type number. Received type ${typeof actual}`;\n }, TypeError);\n E(\"ERR_OUT_OF_RANGE\", function (str, range, input) {\n let msg = `The value of \"${str}\" is out of range.`;\n let received = input;\n\n if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {\n received = addNumericalSeparator(String(input));\n } else if (typeof input === \"bigint\") {\n received = String(input);\n\n if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {\n received = addNumericalSeparator(received);\n }\n\n received += \"n\";\n }\n\n msg += ` It must be ${range}. Received ${received}`;\n return msg;\n }, RangeError);\n\n function addNumericalSeparator(val) {\n let res = \"\";\n let i = val.length;\n const start = val[0] === \"-\" ? 1 : 0;\n\n for (; i >= start + 4; i -= 3) {\n res = `_${val.slice(i - 3, i)}${res}`;\n }\n\n return `${val.slice(0, i)}${res}`;\n } // CHECK FUNCTIONS\n // ===============\n\n\n function checkBounds(buf, offset, byteLength) {\n validateNumber(offset, \"offset\");\n\n if (buf[offset] === undefined || buf[offset + byteLength] === undefined) {\n boundsError(offset, buf.length - (byteLength + 1));\n }\n }\n\n function checkIntBI(value, min, max, buf, offset, byteLength) {\n if (value > max || value < min) {\n const n = typeof min === \"bigint\" ? \"n\" : \"\";\n let range;\n\n if (byteLength > 3) {\n if (min === 0 || min === BigInt(0)) {\n range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`;\n } else {\n range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` + `${(byteLength + 1) * 8 - 1}${n}`;\n }\n } else {\n range = `>= ${min}${n} and <= ${max}${n}`;\n }\n\n throw new errors.ERR_OUT_OF_RANGE(\"value\", range, value);\n }\n\n checkBounds(buf, offset, byteLength);\n }\n\n function validateNumber(value, name) {\n if (typeof value !== \"number\") {\n throw new errors.ERR_INVALID_ARG_TYPE(name, \"number\", value);\n }\n }\n\n function boundsError(value, length, type) {\n if (Math.floor(value) !== value) {\n validateNumber(value, type);\n throw new errors.ERR_OUT_OF_RANGE(type || \"offset\", \"an integer\", value);\n }\n\n if (length < 0) {\n throw new errors.ERR_BUFFER_OUT_OF_BOUNDS();\n }\n\n throw new errors.ERR_OUT_OF_RANGE(type || \"offset\", `>= ${type ? 1 : 0} and <= ${length}`, value);\n } // HELPER FUNCTIONS\n // ================\n\n\n const INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g;\n\n function base64clean(str) {\n // Node takes equal signs as end of the Base64 encoding\n str = str.split(\"=\")[0]; // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n\n str = str.trim().replace(INVALID_BASE64_RE, \"\"); // Node converts strings with length < 2 to ''\n\n if (str.length < 2) return \"\"; // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n\n while (str.length % 4 !== 0) {\n str = str + \"=\";\n }\n\n return str;\n }\n\n function utf8ToBytes(string, units) {\n units = units || Infinity;\n let codePoint;\n const length = string.length;\n let leadSurrogate = null;\n const bytes = [];\n\n for (let i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i); // is surrogate component\n\n if (codePoint > 55295 && codePoint < 57344) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 56319) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(239, 191, 189);\n continue;\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(239, 191, 189);\n continue;\n } // valid lead\n\n\n leadSurrogate = codePoint;\n continue;\n } // 2 leads in a row\n\n\n if (codePoint < 56320) {\n if ((units -= 3) > -1) bytes.push(239, 191, 189);\n leadSurrogate = codePoint;\n continue;\n } // valid surrogate pair\n\n\n codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536;\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(239, 191, 189);\n }\n\n leadSurrogate = null; // encode utf8\n\n if (codePoint < 128) {\n if ((units -= 1) < 0) break;\n bytes.push(codePoint);\n } else if (codePoint < 2048) {\n if ((units -= 2) < 0) break;\n bytes.push(codePoint >> 6 | 192, codePoint & 63 | 128);\n } else if (codePoint < 65536) {\n if ((units -= 3) < 0) break;\n bytes.push(codePoint >> 12 | 224, codePoint >> 6 & 63 | 128, codePoint & 63 | 128);\n } else if (codePoint < 1114112) {\n if ((units -= 4) < 0) break;\n bytes.push(codePoint >> 18 | 240, codePoint >> 12 & 63 | 128, codePoint >> 6 & 63 | 128, codePoint & 63 | 128);\n } else {\n throw new Error(\"Invalid code point\");\n }\n }\n\n return bytes;\n }\n\n function asciiToBytes(str) {\n const byteArray = [];\n\n for (let i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 255);\n }\n\n return byteArray;\n }\n\n function utf16leToBytes(str, units) {\n let c, hi, lo;\n const byteArray = [];\n\n for (let i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break;\n c = str.charCodeAt(i);\n hi = c >> 8;\n lo = c % 256;\n byteArray.push(lo);\n byteArray.push(hi);\n }\n\n return byteArray;\n }\n\n function base64ToBytes(str) {\n return base64.toByteArray(base64clean(str));\n }\n\n function blitBuffer(src, dst, offset, length) {\n let i;\n\n for (i = 0; i < length; ++i) {\n if (i + offset >= dst.length || i >= src.length) break;\n dst[i + offset] = src[i];\n }\n\n return i;\n } // ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n // the `instanceof` check but they should be treated as of that type.\n // See: https://github.com/feross/buffer/issues/166\n\n\n function isInstance(obj, type) {\n return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name;\n }\n\n function numberIsNaN(obj) {\n // For IE11 support\n return obj !== obj; // eslint-disable-line no-self-compare\n } // Create lookup table for `toString('hex')`\n // See: https://github.com/feross/buffer/issues/219\n\n\n const hexSliceLookupTable = function () {\n const alphabet = \"0123456789abcdef\";\n const table = new Array(256);\n\n for (let i = 0; i < 16; ++i) {\n const i16 = i * 16;\n\n for (let j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j];\n }\n }\n\n return table;\n }(); // Return not function with Error if BigInt not supported\n\n\n function defineBigIntMethod(fn) {\n return typeof BigInt === \"undefined\" ? BufferBigIntNotDefined : fn;\n }\n\n function BufferBigIntNotDefined() {\n throw new Error(\"BigInt not supported\");\n }\n\n return exports$1;\n}\n\nconst exports = dew();\nexports['Buffer']; exports['SlowBuffer']; exports['INSPECT_MAX_BYTES']; exports['kMaxLength'];\n\nvar Buffer = exports.Buffer;\r\nvar INSPECT_MAX_BYTES = exports.INSPECT_MAX_BYTES;\r\nvar kMaxLength = exports.kMaxLength;\n\nexport { Buffer, INSPECT_MAX_BYTES, exports as default, kMaxLength };\n", "export { Buffer } from \"buffer\";\n", "function unimplemented(name) {\r\n throw new Error('Node.js process ' + name + ' is not supported by JSPM core outside of Node.js');\r\n}\r\n\r\nvar queue = [];\r\nvar draining = false;\r\nvar currentQueue;\r\nvar queueIndex = -1;\r\n\r\nfunction cleanUpNextTick() {\r\n if (!draining || !currentQueue)\r\n return;\r\n draining = false;\r\n if (currentQueue.length) {\r\n queue = currentQueue.concat(queue);\r\n }\r\n else {\r\n queueIndex = -1;\r\n }\r\n if (queue.length)\r\n drainQueue();\r\n}\r\n\r\nfunction drainQueue() {\r\n if (draining)\r\n return;\r\n var timeout = setTimeout(cleanUpNextTick, 0);\r\n draining = true;\r\n\r\n var len = queue.length;\r\n while(len) {\r\n currentQueue = queue;\r\n queue = [];\r\n while (++queueIndex < len) {\r\n if (currentQueue)\r\n currentQueue[queueIndex].run();\r\n }\r\n queueIndex = -1;\r\n len = queue.length;\r\n }\r\n currentQueue = null;\r\n draining = false;\r\n clearTimeout(timeout);\r\n}\r\n\r\nfunction nextTick (fun) {\r\n var args = new Array(arguments.length - 1);\r\n if (arguments.length > 1) {\r\n for (var i = 1; i < arguments.length; i++)\r\n args[i - 1] = arguments[i];\r\n }\r\n queue.push(new Item(fun, args));\r\n if (queue.length === 1 && !draining)\r\n setTimeout(drainQueue, 0);\r\n}\r\n// v8 likes predictible objects\r\nfunction Item(fun, array) {\r\n this.fun = fun;\r\n this.array = array;\r\n}\r\nItem.prototype.run = function () {\r\n this.fun.apply(null, this.array);\r\n};\r\n\r\nvar title = 'browser';\r\nvar arch = 'x64';\r\nvar platform = 'browser';\r\nvar env = {\r\n PATH: '/usr/bin',\r\n LANG: navigator.language + '.UTF-8',\r\n PWD: '/',\r\n HOME: '/home',\r\n TMP: '/tmp',\r\n};\r\nvar argv = ['/usr/bin/node'];\r\nvar execArgv = [];\r\nvar version = 'v16.8.0';\r\nvar versions = {};\r\n\r\nvar emitWarning = function(message, type) {\r\n console.warn((type ? (type + ': ') : '') + message);\r\n};\r\n\r\nvar binding = function(name) { unimplemented('binding'); };\r\n\r\nvar umask = function(mask) { return 0; };\r\n\r\nvar cwd = function() { return '/'; };\r\nvar chdir = function(dir) {};\r\n\r\nvar release = {\r\n name: 'node',\r\n sourceUrl: '',\r\n headersUrl: '',\r\n libUrl: '',\r\n};\r\n\r\nfunction noop() {}\r\n\r\nvar _rawDebug = noop;\r\nvar moduleLoadList = [];\r\nfunction _linkedBinding(name) { unimplemented('_linkedBinding'); }\r\nvar domain = {};\r\nvar _exiting = false;\r\nvar config = {};\r\nfunction dlopen(name) { unimplemented('dlopen'); }\r\nfunction _getActiveRequests() { return []; }\r\nfunction _getActiveHandles() { return []; }\r\nvar reallyExit = noop;\r\nvar _kill = noop;\r\nvar cpuUsage = function() { return {}; };\r\nvar resourceUsage = cpuUsage;\r\nvar memoryUsage = cpuUsage;\r\nvar kill = noop;\r\nvar exit = noop;\r\nvar openStdin = noop;\r\nvar allowedNodeEnvironmentFlags = {};\r\nfunction assert(condition, message) {\r\n if (!condition) throw new Error(message || 'assertion error');\r\n}\r\nvar features = {\r\n inspector: false,\r\n debug: false,\r\n uv: false,\r\n ipv6: false,\r\n tls_alpn: false,\r\n tls_sni: false,\r\n tls_ocsp: false,\r\n tls: false,\r\n cached_builtins: true,\r\n};\r\nvar _fatalExceptions = noop;\r\nvar setUncaughtExceptionCaptureCallback = noop;\r\nfunction hasUncaughtExceptionCaptureCallback() { return false; }var _tickCallback = noop;\r\nvar _debugProcess = noop;\r\nvar _debugEnd = noop;\r\nvar _startProfilerIdleNotifier = noop;\r\nvar _stopProfilerIdleNotifier = noop;\r\nvar stdout = undefined;\r\nvar stderr = undefined;\r\nvar stdin = undefined;\r\nvar abort = noop;\r\nvar pid = 2;\r\nvar ppid = 1;\r\nvar execPath = '/bin/usr/node';\r\nvar debugPort = 9229;\r\nvar argv0 = 'node';\r\nvar _preload_modules = [];\r\nvar setSourceMapsEnabled = noop;\r\n\r\nvar _performance = {\r\n now: typeof performance !== 'undefined' ? performance.now.bind(performance) : undefined,\r\n timing: typeof performance !== 'undefined' ? performance.timing : undefined,\r\n};\r\nif (_performance.now === undefined) {\r\n var nowOffset = Date.now();\r\n\r\n if (_performance.timing && _performance.timing.navigationStart) {\r\n nowOffset = _performance.timing.navigationStart;\r\n }\r\n _performance.now = () => Date.now() - nowOffset;\r\n}\r\n\r\nfunction uptime() {\r\n return _performance.now() / 1000;\r\n}\r\n\r\nvar nanoPerSec = 1000000000;\r\nfunction hrtime(previousTimestamp) {\r\n var baseNow = Math.floor((Date.now() - _performance.now()) * 1e-3);\r\n var clocktime = _performance.now() * 1e-3;\r\n var seconds = Math.floor(clocktime) + baseNow;\r\n var nanoseconds = Math.floor((clocktime % 1) * 1e9);\r\n if (previousTimestamp) {\r\n seconds = seconds - previousTimestamp[0];\r\n nanoseconds = nanoseconds - previousTimestamp[1];\r\n if (nanoseconds < 0) {\r\n seconds--;\r\n nanoseconds += nanoPerSec;\r\n }\r\n }\r\n return [seconds, nanoseconds];\r\n}hrtime.bigint = function(time) {\r\n var diff = hrtime(time);\r\n if (typeof BigInt === 'undefined') {\r\n return diff[0] * nanoPerSec + diff[1];\r\n }\r\n return BigInt(diff[0] * nanoPerSec) + BigInt(diff[1]);\r\n};\r\n\r\nvar _maxListeners = 10;\r\nvar _events = {};\r\nvar _eventsCount = 0;\r\nfunction on () { return process }var addListener = on;\r\nvar once = on;\r\nvar off = on;\r\nvar removeListener = on;\r\nvar removeAllListeners = on;\r\nvar emit = noop;\r\nvar prependListener = on;\r\nvar prependOnceListener = on;\r\nfunction listeners (name) { return []; }\r\nvar process = {\r\n version,\r\n versions,\r\n arch,\r\n platform,\r\n release,\r\n _rawDebug,\r\n moduleLoadList,\r\n binding,\r\n _linkedBinding,\r\n _events,\r\n _eventsCount,\r\n _maxListeners,\r\n on,\r\n addListener,\r\n once,\r\n off,\r\n removeListener,\r\n removeAllListeners,\r\n emit,\r\n prependListener,\r\n prependOnceListener,\r\n listeners,\r\n domain,\r\n _exiting,\r\n config,\r\n dlopen,\r\n uptime,\r\n _getActiveRequests,\r\n _getActiveHandles,\r\n reallyExit,\r\n _kill,\r\n cpuUsage,\r\n resourceUsage,\r\n memoryUsage,\r\n kill,\r\n exit,\r\n openStdin,\r\n allowedNodeEnvironmentFlags,\r\n assert,\r\n features,\r\n _fatalExceptions,\r\n setUncaughtExceptionCaptureCallback,\r\n hasUncaughtExceptionCaptureCallback,\r\n emitWarning,\r\n nextTick,\r\n _tickCallback,\r\n _debugProcess,\r\n _debugEnd,\r\n _startProfilerIdleNotifier,\r\n _stopProfilerIdleNotifier,\r\n stdout,\r\n stdin,\r\n stderr,\r\n abort,\r\n umask,\r\n chdir,\r\n cwd,\r\n env,\r\n title,\r\n argv,\r\n execArgv,\r\n pid,\r\n ppid,\r\n execPath,\r\n debugPort,\r\n hrtime,\r\n argv0,\r\n _preload_modules,\r\n setSourceMapsEnabled,\r\n};\n\nexport { _debugEnd, _debugProcess, _events, _eventsCount, _exiting, _fatalExceptions, _getActiveHandles, _getActiveRequests, _kill, _linkedBinding, _maxListeners, _preload_modules, _rawDebug, _startProfilerIdleNotifier, _stopProfilerIdleNotifier, _tickCallback, abort, addListener, allowedNodeEnvironmentFlags, arch, argv, argv0, assert, binding, chdir, config, cpuUsage, cwd, debugPort, process as default, dlopen, domain, emit, emitWarning, env, execArgv, execPath, exit, features, hasUncaughtExceptionCaptureCallback, hrtime, kill, listeners, memoryUsage, moduleLoadList, nextTick, off, on, once, openStdin, pid, platform, ppid, prependListener, prependOnceListener, reallyExit, release, removeAllListeners, removeListener, resourceUsage, setSourceMapsEnabled, setUncaughtExceptionCaptureCallback, stderr, stdin, stdout, title, umask, uptime, version, versions };\n", "export * as process from \"process\";\n", "/**\n * @license React\n * react.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n\n 'use strict';\n\n/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());\n}\n var ReactVersion = '18.2.0';\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\n/**\n * Keeps track of the current dispatcher.\n */\nvar ReactCurrentDispatcher = {\n /**\n * @internal\n * @type {ReactComponent}\n */\n current: null\n};\n\n/**\n * Keeps track of the current batch's configuration such as how long an update\n * should suspend for if it needs to.\n */\nvar ReactCurrentBatchConfig = {\n transition: null\n};\n\nvar ReactCurrentActQueue = {\n current: null,\n // Used to reproduce behavior of `batchedUpdates` in legacy mode.\n isBatchingLegacy: false,\n didScheduleLegacyUpdate: false\n};\n\n/**\n * Keeps track of the current owner.\n *\n * The current owner is the component who should own any components that are\n * currently being constructed.\n */\nvar ReactCurrentOwner = {\n /**\n * @internal\n * @type {ReactComponent}\n */\n current: null\n};\n\nvar ReactDebugCurrentFrame = {};\nvar currentExtraStackFrame = null;\nfunction setExtraStackFrame(stack) {\n {\n currentExtraStackFrame = stack;\n }\n}\n\n{\n ReactDebugCurrentFrame.setExtraStackFrame = function (stack) {\n {\n currentExtraStackFrame = stack;\n }\n }; // Stack implementation injected by the current renderer.\n\n\n ReactDebugCurrentFrame.getCurrentStack = null;\n\n ReactDebugCurrentFrame.getStackAddendum = function () {\n var stack = ''; // Add an extra top frame while an element is being validated\n\n if (currentExtraStackFrame) {\n stack += currentExtraStackFrame;\n } // Delegate to the injected renderer-specific implementation\n\n\n var impl = ReactDebugCurrentFrame.getCurrentStack;\n\n if (impl) {\n stack += impl() || '';\n }\n\n return stack;\n };\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar ReactSharedInternals = {\n ReactCurrentDispatcher: ReactCurrentDispatcher,\n ReactCurrentBatchConfig: ReactCurrentBatchConfig,\n ReactCurrentOwner: ReactCurrentOwner\n};\n\n{\n ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;\n ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;\n}\n\n// by calls to these methods by a Babel plugin.\n//\n// In PROD (or in packages without access to React internals),\n// they are left as they are instead.\n\nfunction warn(format) {\n {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }\n}\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\nvar didWarnStateUpdateForUnmountedComponent = {};\n\nfunction warnNoop(publicInstance, callerName) {\n {\n var _constructor = publicInstance.constructor;\n var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';\n var warningKey = componentName + \".\" + callerName;\n\n if (didWarnStateUpdateForUnmountedComponent[warningKey]) {\n return;\n }\n\n error(\"Can't call %s on a component that is not yet mounted. \" + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);\n\n didWarnStateUpdateForUnmountedComponent[warningKey] = true;\n }\n}\n/**\n * This is the abstract API for an update queue.\n */\n\n\nvar ReactNoopUpdateQueue = {\n /**\n * Checks whether or not this composite component is mounted.\n * @param {ReactClass} publicInstance The instance we want to test.\n * @return {boolean} True if mounted, false otherwise.\n * @protected\n * @final\n */\n isMounted: function (publicInstance) {\n return false;\n },\n\n /**\n * Forces an update. This should only be invoked when it is known with\n * certainty that we are **not** in a DOM transaction.\n *\n * You may want to call this when you know that some deeper aspect of the\n * component's state has changed but `setState` was not called.\n *\n * This will not invoke `shouldComponentUpdate`, but it will invoke\n * `componentWillUpdate` and `componentDidUpdate`.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {?function} callback Called after component is updated.\n * @param {?string} callerName name of the calling function in the public API.\n * @internal\n */\n enqueueForceUpdate: function (publicInstance, callback, callerName) {\n warnNoop(publicInstance, 'forceUpdate');\n },\n\n /**\n * Replaces all of the state. Always use this or `setState` to mutate state.\n * You should treat `this.state` as immutable.\n *\n * There is no guarantee that `this.state` will be immediately updated, so\n * accessing `this.state` after calling this method may return the old value.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {object} completeState Next state.\n * @param {?function} callback Called after component is updated.\n * @param {?string} callerName name of the calling function in the public API.\n * @internal\n */\n enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {\n warnNoop(publicInstance, 'replaceState');\n },\n\n /**\n * Sets a subset of the state. This only exists because _pendingState is\n * internal. This provides a merging strategy that is not available to deep\n * properties which is confusing. TODO: Expose pendingState or don't use it\n * during the merge.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {object} partialState Next partial state to be merged with state.\n * @param {?function} callback Called after component is updated.\n * @param {?string} Name of the calling function in the public API.\n * @internal\n */\n enqueueSetState: function (publicInstance, partialState, callback, callerName) {\n warnNoop(publicInstance, 'setState');\n }\n};\n\nvar assign = Object.assign;\n\nvar emptyObject = {};\n\n{\n Object.freeze(emptyObject);\n}\n/**\n * Base class helpers for the updating state of a component.\n */\n\n\nfunction Component(props, context, updater) {\n this.props = props;\n this.context = context; // If a component has string refs, we will assign a different object later.\n\n this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the\n // renderer.\n\n this.updater = updater || ReactNoopUpdateQueue;\n}\n\nComponent.prototype.isReactComponent = {};\n/**\n * Sets a subset of the state. Always use this to mutate\n * state. You should treat `this.state` as immutable.\n *\n * There is no guarantee that `this.state` will be immediately updated, so\n * accessing `this.state` after calling this method may return the old value.\n *\n * There is no guarantee that calls to `setState` will run synchronously,\n * as they may eventually be batched together. You can provide an optional\n * callback that will be executed when the call to setState is actually\n * completed.\n *\n * When a function is provided to setState, it will be called at some point in\n * the future (not synchronously). It will be called with the up to date\n * component arguments (state, props, context). These values can be different\n * from this.* because your function may be called after receiveProps but before\n * shouldComponentUpdate, and this new state, props, and context will not yet be\n * assigned to this.\n *\n * @param {object|function} partialState Next partial state or function to\n * produce next partial state to be merged with current state.\n * @param {?function} callback Called after state is updated.\n * @final\n * @protected\n */\n\nComponent.prototype.setState = function (partialState, callback) {\n if (typeof partialState !== 'object' && typeof partialState !== 'function' && partialState != null) {\n throw new Error('setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.');\n }\n\n this.updater.enqueueSetState(this, partialState, callback, 'setState');\n};\n/**\n * Forces an update. This should only be invoked when it is known with\n * certainty that we are **not** in a DOM transaction.\n *\n * You may want to call this when you know that some deeper aspect of the\n * component's state has changed but `setState` was not called.\n *\n * This will not invoke `shouldComponentUpdate`, but it will invoke\n * `componentWillUpdate` and `componentDidUpdate`.\n *\n * @param {?function} callback Called after update is complete.\n * @final\n * @protected\n */\n\n\nComponent.prototype.forceUpdate = function (callback) {\n this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');\n};\n/**\n * Deprecated APIs. These APIs used to exist on classic React classes but since\n * we would like to deprecate them, we're not going to move them over to this\n * modern base class. Instead, we define a getter that warns if it's accessed.\n */\n\n\n{\n var deprecatedAPIs = {\n isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],\n replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']\n };\n\n var defineDeprecationWarning = function (methodName, info) {\n Object.defineProperty(Component.prototype, methodName, {\n get: function () {\n warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);\n\n return undefined;\n }\n });\n };\n\n for (var fnName in deprecatedAPIs) {\n if (deprecatedAPIs.hasOwnProperty(fnName)) {\n defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);\n }\n }\n}\n\nfunction ComponentDummy() {}\n\nComponentDummy.prototype = Component.prototype;\n/**\n * Convenience component with default shallow equality check for sCU.\n */\n\nfunction PureComponent(props, context, updater) {\n this.props = props;\n this.context = context; // If a component has string refs, we will assign a different object later.\n\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n}\n\nvar pureComponentPrototype = PureComponent.prototype = new ComponentDummy();\npureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.\n\nassign(pureComponentPrototype, Component.prototype);\npureComponentPrototype.isPureReactComponent = true;\n\n// an immutable object with a single mutable value\nfunction createRef() {\n var refObject = {\n current: null\n };\n\n {\n Object.seal(refObject);\n }\n\n return refObject;\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n var warnAboutAccessingKey = function () {\n {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n var warnAboutAccessingRef = function () {\n {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * Create and return a new ReactElement of the given type.\n * See https://reactjs.org/docs/react-api.html#createelement\n */\n\nfunction createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}\nfunction cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n}\n/**\n * Clone and return a new ReactElement using element as the starting point.\n * See https://reactjs.org/docs/react-api.html#cloneelement\n */\n\nfunction cloneElement(element, config, children) {\n if (element === null || element === undefined) {\n throw new Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n\n var propName; // Original props are copied\n\n var props = assign({}, element.props); // Reserved names are extracted\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\nfunction isValidElement(object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n}\n\nvar SEPARATOR = '.';\nvar SUBSEPARATOR = ':';\n/**\n * Escape and wrap key so it is safe to use as a reactid\n *\n * @param {string} key to be escaped.\n * @return {string} the escaped key.\n */\n\nfunction escape(key) {\n var escapeRegex = /[=:]/g;\n var escaperLookup = {\n '=': '=0',\n ':': '=2'\n };\n var escapedString = key.replace(escapeRegex, function (match) {\n return escaperLookup[match];\n });\n return '$' + escapedString;\n}\n/**\n * TODO: Test that a single child and an array with one item have the same key\n * pattern.\n */\n\n\nvar didWarnAboutMaps = false;\nvar userProvidedKeyEscapeRegex = /\\/+/g;\n\nfunction escapeUserProvidedKey(text) {\n return text.replace(userProvidedKeyEscapeRegex, '$&/');\n}\n/**\n * Generate a key string that identifies a element within a set.\n *\n * @param {*} element A element that could contain a manual key.\n * @param {number} index Index that is used if a manual key is not provided.\n * @return {string}\n */\n\n\nfunction getElementKey(element, index) {\n // Do some typechecking here since we call this blindly. We want to ensure\n // that we don't block potential future ES APIs.\n if (typeof element === 'object' && element !== null && element.key != null) {\n // Explicit key\n {\n checkKeyStringCoercion(element.key);\n }\n\n return escape('' + element.key);\n } // Implicit key determined by the index in the set\n\n\n return index.toString(36);\n}\n\nfunction mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {\n var type = typeof children;\n\n if (type === 'undefined' || type === 'boolean') {\n // All of the above are perceived as null.\n children = null;\n }\n\n var invokeCallback = false;\n\n if (children === null) {\n invokeCallback = true;\n } else {\n switch (type) {\n case 'string':\n case 'number':\n invokeCallback = true;\n break;\n\n case 'object':\n switch (children.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n invokeCallback = true;\n }\n\n }\n }\n\n if (invokeCallback) {\n var _child = children;\n var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array\n // so that it's consistent if the number of children grows:\n\n var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;\n\n if (isArray(mappedChild)) {\n var escapedChildKey = '';\n\n if (childKey != null) {\n escapedChildKey = escapeUserProvidedKey(childKey) + '/';\n }\n\n mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) {\n return c;\n });\n } else if (mappedChild != null) {\n if (isValidElement(mappedChild)) {\n {\n // The `if` statement here prevents auto-disabling of the safe\n // coercion ESLint rule, so we must manually disable it below.\n // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key\n if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {\n checkKeyStringCoercion(mappedChild.key);\n }\n }\n\n mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as\n // traverseAllChildren used to do for objects as children\n escapedPrefix + ( // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key\n mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // $FlowFixMe Flow incorrectly thinks existing element's key can be a number\n // eslint-disable-next-line react-internal/safe-string-coercion\n escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey);\n }\n\n array.push(mappedChild);\n }\n\n return 1;\n }\n\n var child;\n var nextName;\n var subtreeCount = 0; // Count of children found in the current subtree.\n\n var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;\n\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n child = children[i];\n nextName = nextNamePrefix + getElementKey(child, i);\n subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);\n }\n } else {\n var iteratorFn = getIteratorFn(children);\n\n if (typeof iteratorFn === 'function') {\n var iterableChildren = children;\n\n {\n // Warn about using Maps as children\n if (iteratorFn === iterableChildren.entries) {\n if (!didWarnAboutMaps) {\n warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');\n }\n\n didWarnAboutMaps = true;\n }\n }\n\n var iterator = iteratorFn.call(iterableChildren);\n var step;\n var ii = 0;\n\n while (!(step = iterator.next()).done) {\n child = step.value;\n nextName = nextNamePrefix + getElementKey(child, ii++);\n subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);\n }\n } else if (type === 'object') {\n // eslint-disable-next-line react-internal/safe-string-coercion\n var childrenString = String(children);\n throw new Error(\"Objects are not valid as a React child (found: \" + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + \"). \" + 'If you meant to render a collection of children, use an array ' + 'instead.');\n }\n }\n\n return subtreeCount;\n}\n\n/**\n * Maps children that are typically specified as `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrenmap\n *\n * The provided mapFunction(child, index) will be called for each\n * leaf child.\n *\n * @param {?*} children Children tree container.\n * @param {function(*, int)} func The map function.\n * @param {*} context Context for mapFunction.\n * @return {object} Object containing the ordered map of results.\n */\nfunction mapChildren(children, func, context) {\n if (children == null) {\n return children;\n }\n\n var result = [];\n var count = 0;\n mapIntoArray(children, result, '', '', function (child) {\n return func.call(context, child, count++);\n });\n return result;\n}\n/**\n * Count the number of children that are typically specified as\n * `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrencount\n *\n * @param {?*} children Children tree container.\n * @return {number} The number of children.\n */\n\n\nfunction countChildren(children) {\n var n = 0;\n mapChildren(children, function () {\n n++; // Don't return anything\n });\n return n;\n}\n\n/**\n * Iterates through children that are typically specified as `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrenforeach\n *\n * The provided forEachFunc(child, index) will be called for each\n * leaf child.\n *\n * @param {?*} children Children tree container.\n * @param {function(*, int)} forEachFunc\n * @param {*} forEachContext Context for forEachContext.\n */\nfunction forEachChildren(children, forEachFunc, forEachContext) {\n mapChildren(children, function () {\n forEachFunc.apply(this, arguments); // Don't return anything.\n }, forEachContext);\n}\n/**\n * Flatten a children object (typically specified as `props.children`) and\n * return an array with appropriately re-keyed children.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrentoarray\n */\n\n\nfunction toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}\n/**\n * Returns the first child in a collection of children and verifies that there\n * is only one child in the collection.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrenonly\n *\n * The current implementation of this function assumes that a single child gets\n * passed without a wrapper, but the purpose of this helper function is to\n * abstract away the particular structure of children.\n *\n * @param {?object} children Child collection structure.\n * @return {ReactElement} The first and only `ReactElement` contained in the\n * structure.\n */\n\n\nfunction onlyChild(children) {\n if (!isValidElement(children)) {\n throw new Error('React.Children.only expected to receive a single React element child.');\n }\n\n return children;\n}\n\nfunction createContext(defaultValue) {\n // TODO: Second argument used to be an optional `calculateChangedBits`\n // function. Warn to reserve for future use?\n var context = {\n $$typeof: REACT_CONTEXT_TYPE,\n // As a workaround to support multiple concurrent renderers, we categorize\n // some renderers as primary and others as secondary. We only expect\n // there to be two concurrent renderers at most: React Native (primary) and\n // Fabric (secondary); React DOM (primary) and React ART (secondary).\n // Secondary renderers store their context values on separate fields.\n _currentValue: defaultValue,\n _currentValue2: defaultValue,\n // Used to track how many concurrent renderers this context currently\n // supports within in a single renderer. Such as parallel server rendering.\n _threadCount: 0,\n // These are circular\n Provider: null,\n Consumer: null,\n // Add these to use same hidden class in VM as ServerContext\n _defaultValue: null,\n _globalName: null\n };\n context.Provider = {\n $$typeof: REACT_PROVIDER_TYPE,\n _context: context\n };\n var hasWarnedAboutUsingNestedContextConsumers = false;\n var hasWarnedAboutUsingConsumerProvider = false;\n var hasWarnedAboutDisplayNameOnConsumer = false;\n\n {\n // A separate object, but proxies back to the original context object for\n // backwards compatibility. It has a different $$typeof, so we can properly\n // warn for the incorrect usage of Context as a Consumer.\n var Consumer = {\n $$typeof: REACT_CONTEXT_TYPE,\n _context: context\n }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here\n\n Object.defineProperties(Consumer, {\n Provider: {\n get: function () {\n if (!hasWarnedAboutUsingConsumerProvider) {\n hasWarnedAboutUsingConsumerProvider = true;\n\n error('Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');\n }\n\n return context.Provider;\n },\n set: function (_Provider) {\n context.Provider = _Provider;\n }\n },\n _currentValue: {\n get: function () {\n return context._currentValue;\n },\n set: function (_currentValue) {\n context._currentValue = _currentValue;\n }\n },\n _currentValue2: {\n get: function () {\n return context._currentValue2;\n },\n set: function (_currentValue2) {\n context._currentValue2 = _currentValue2;\n }\n },\n _threadCount: {\n get: function () {\n return context._threadCount;\n },\n set: function (_threadCount) {\n context._threadCount = _threadCount;\n }\n },\n Consumer: {\n get: function () {\n if (!hasWarnedAboutUsingNestedContextConsumers) {\n hasWarnedAboutUsingNestedContextConsumers = true;\n\n error('Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');\n }\n\n return context.Consumer;\n }\n },\n displayName: {\n get: function () {\n return context.displayName;\n },\n set: function (displayName) {\n if (!hasWarnedAboutDisplayNameOnConsumer) {\n warn('Setting `displayName` on Context.Consumer has no effect. ' + \"You should set it directly on the context with Context.displayName = '%s'.\", displayName);\n\n hasWarnedAboutDisplayNameOnConsumer = true;\n }\n }\n }\n }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty\n\n context.Consumer = Consumer;\n }\n\n {\n context._currentRenderer = null;\n context._currentRenderer2 = null;\n }\n\n return context;\n}\n\nvar Uninitialized = -1;\nvar Pending = 0;\nvar Resolved = 1;\nvar Rejected = 2;\n\nfunction lazyInitializer(payload) {\n if (payload._status === Uninitialized) {\n var ctor = payload._result;\n var thenable = ctor(); // Transition to the next state.\n // This might throw either because it's missing or throws. If so, we treat it\n // as still uninitialized and try again next time. Which is the same as what\n // happens if the ctor or any wrappers processing the ctor throws. This might\n // end up fixing it if the resolution was a concurrency bug.\n\n thenable.then(function (moduleObject) {\n if (payload._status === Pending || payload._status === Uninitialized) {\n // Transition to the next state.\n var resolved = payload;\n resolved._status = Resolved;\n resolved._result = moduleObject;\n }\n }, function (error) {\n if (payload._status === Pending || payload._status === Uninitialized) {\n // Transition to the next state.\n var rejected = payload;\n rejected._status = Rejected;\n rejected._result = error;\n }\n });\n\n if (payload._status === Uninitialized) {\n // In case, we're still uninitialized, then we're waiting for the thenable\n // to resolve. Set it as pending in the meantime.\n var pending = payload;\n pending._status = Pending;\n pending._result = thenable;\n }\n }\n\n if (payload._status === Resolved) {\n var moduleObject = payload._result;\n\n {\n if (moduleObject === undefined) {\n error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\\n\\nYour code should look like: \\n ' + // Break up imports to avoid accidentally parsing them as dependencies.\n 'const MyComponent = lazy(() => imp' + \"ort('./MyComponent'))\\n\\n\" + 'Did you accidentally put curly braces around the import?', moduleObject);\n }\n }\n\n {\n if (!('default' in moduleObject)) {\n error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\\n\\nYour code should look like: \\n ' + // Break up imports to avoid accidentally parsing them as dependencies.\n 'const MyComponent = lazy(() => imp' + \"ort('./MyComponent'))\", moduleObject);\n }\n }\n\n return moduleObject.default;\n } else {\n throw payload._result;\n }\n}\n\nfunction lazy(ctor) {\n var payload = {\n // We use these fields to store the result.\n _status: Uninitialized,\n _result: ctor\n };\n var lazyType = {\n $$typeof: REACT_LAZY_TYPE,\n _payload: payload,\n _init: lazyInitializer\n };\n\n {\n // In production, this would just set it on the object.\n var defaultProps;\n var propTypes; // $FlowFixMe\n\n Object.defineProperties(lazyType, {\n defaultProps: {\n configurable: true,\n get: function () {\n return defaultProps;\n },\n set: function (newDefaultProps) {\n error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');\n\n defaultProps = newDefaultProps; // Match production behavior more closely:\n // $FlowFixMe\n\n Object.defineProperty(lazyType, 'defaultProps', {\n enumerable: true\n });\n }\n },\n propTypes: {\n configurable: true,\n get: function () {\n return propTypes;\n },\n set: function (newPropTypes) {\n error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');\n\n propTypes = newPropTypes; // Match production behavior more closely:\n // $FlowFixMe\n\n Object.defineProperty(lazyType, 'propTypes', {\n enumerable: true\n });\n }\n }\n });\n }\n\n return lazyType;\n}\n\nfunction forwardRef(render) {\n {\n if (render != null && render.$$typeof === REACT_MEMO_TYPE) {\n error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');\n } else if (typeof render !== 'function') {\n error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);\n } else {\n if (render.length !== 0 && render.length !== 2) {\n error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.');\n }\n }\n\n if (render != null) {\n if (render.defaultProps != null || render.propTypes != null) {\n error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');\n }\n }\n }\n\n var elementType = {\n $$typeof: REACT_FORWARD_REF_TYPE,\n render: render\n };\n\n {\n var ownName;\n Object.defineProperty(elementType, 'displayName', {\n enumerable: false,\n configurable: true,\n get: function () {\n return ownName;\n },\n set: function (name) {\n ownName = name; // The inner component shouldn't inherit this display name in most cases,\n // because the component may be used elsewhere.\n // But it's nice for anonymous functions to inherit the name,\n // so that our component-stack generation logic will display their frames.\n // An anonymous function generally suggests a pattern like:\n // React.forwardRef((props, ref) => {...});\n // This kind of inner function is not used elsewhere so the side effect is okay.\n\n if (!render.name && !render.displayName) {\n render.displayName = name;\n }\n }\n });\n }\n\n return elementType;\n}\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction memo(type, compare) {\n {\n if (!isValidElementType(type)) {\n error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);\n }\n }\n\n var elementType = {\n $$typeof: REACT_MEMO_TYPE,\n type: type,\n compare: compare === undefined ? null : compare\n };\n\n {\n var ownName;\n Object.defineProperty(elementType, 'displayName', {\n enumerable: false,\n configurable: true,\n get: function () {\n return ownName;\n },\n set: function (name) {\n ownName = name; // The inner component shouldn't inherit this display name in most cases,\n // because the component may be used elsewhere.\n // But it's nice for anonymous functions to inherit the name,\n // so that our component-stack generation logic will display their frames.\n // An anonymous function generally suggests a pattern like:\n // React.memo((props) => {...});\n // This kind of inner function is not used elsewhere so the side effect is okay.\n\n if (!type.name && !type.displayName) {\n type.displayName = name;\n }\n }\n });\n }\n\n return elementType;\n}\n\nfunction resolveDispatcher() {\n var dispatcher = ReactCurrentDispatcher.current;\n\n {\n if (dispatcher === null) {\n error('Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for' + ' one of the following reasons:\\n' + '1. You might have mismatching versions of React and the renderer (such as React DOM)\\n' + '2. You might be breaking the Rules of Hooks\\n' + '3. You might have more than one copy of React in the same app\\n' + 'See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.');\n }\n } // Will result in a null access error if accessed outside render phase. We\n // intentionally don't throw our own error because this is in a hot path.\n // Also helps ensure this is inlined.\n\n\n return dispatcher;\n}\nfunction useContext(Context) {\n var dispatcher = resolveDispatcher();\n\n {\n // TODO: add a more generic warning for invalid values.\n if (Context._context !== undefined) {\n var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs\n // and nobody should be using this in existing code.\n\n if (realContext.Consumer === Context) {\n error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');\n } else if (realContext.Provider === Context) {\n error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');\n }\n }\n }\n\n return dispatcher.useContext(Context);\n}\nfunction useState(initialState) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useState(initialState);\n}\nfunction useReducer(reducer, initialArg, init) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useReducer(reducer, initialArg, init);\n}\nfunction useRef(initialValue) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useRef(initialValue);\n}\nfunction useEffect(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useEffect(create, deps);\n}\nfunction useInsertionEffect(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useInsertionEffect(create, deps);\n}\nfunction useLayoutEffect(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useLayoutEffect(create, deps);\n}\nfunction useCallback(callback, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useCallback(callback, deps);\n}\nfunction useMemo(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useMemo(create, deps);\n}\nfunction useImperativeHandle(ref, create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useImperativeHandle(ref, create, deps);\n}\nfunction useDebugValue(value, formatterFn) {\n {\n var dispatcher = resolveDispatcher();\n return dispatcher.useDebugValue(value, formatterFn);\n }\n}\nfunction useTransition() {\n var dispatcher = resolveDispatcher();\n return dispatcher.useTransition();\n}\nfunction useDeferredValue(value) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useDeferredValue(value);\n}\nfunction useId() {\n var dispatcher = resolveDispatcher();\n return dispatcher.useId();\n}\nfunction useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n}\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher$1.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"<anonymous>\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('<anonymous>')) {\n _frame = _frame.replace('<anonymous>', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher$1.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n setExtraStackFrame(stack);\n } else {\n setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n\nfunction getDeclarationErrorAddendum() {\n if (ReactCurrentOwner.current) {\n var name = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n}\n\nfunction getSourceInfoErrorAddendumForProps(elementProps) {\n if (elementProps !== null && elementProps !== undefined) {\n return getSourceInfoErrorAddendum(elementProps.__source);\n }\n\n return '';\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n {\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\nfunction createElementWithValidation(type, props, children) {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendumForProps(props);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n {\n error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n }\n\n var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n for (var i = 2; i < arguments.length; i++) {\n validateChildKeys(arguments[i], type);\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n}\nvar didWarnAboutDeprecatedCreateFactory = false;\nfunction createFactoryWithValidation(type) {\n var validatedFactory = createElementWithValidation.bind(null, type);\n validatedFactory.type = type;\n\n {\n if (!didWarnAboutDeprecatedCreateFactory) {\n didWarnAboutDeprecatedCreateFactory = true;\n\n warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');\n } // Legacy hook: remove it\n\n\n Object.defineProperty(validatedFactory, 'type', {\n enumerable: false,\n get: function () {\n warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');\n\n Object.defineProperty(this, 'type', {\n value: type\n });\n return type;\n }\n });\n }\n\n return validatedFactory;\n}\nfunction cloneElementWithValidation(element, props, children) {\n var newElement = cloneElement.apply(this, arguments);\n\n for (var i = 2; i < arguments.length; i++) {\n validateChildKeys(arguments[i], newElement.type);\n }\n\n validatePropTypes(newElement);\n return newElement;\n}\n\nfunction startTransition(scope, options) {\n var prevTransition = ReactCurrentBatchConfig.transition;\n ReactCurrentBatchConfig.transition = {};\n var currentTransition = ReactCurrentBatchConfig.transition;\n\n {\n ReactCurrentBatchConfig.transition._updatedFibers = new Set();\n }\n\n try {\n scope();\n } finally {\n ReactCurrentBatchConfig.transition = prevTransition;\n\n {\n if (prevTransition === null && currentTransition._updatedFibers) {\n var updatedFibersCount = currentTransition._updatedFibers.size;\n\n if (updatedFibersCount > 10) {\n warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');\n }\n\n currentTransition._updatedFibers.clear();\n }\n }\n }\n}\n\nvar didWarnAboutMessageChannel = false;\nvar enqueueTaskImpl = null;\nfunction enqueueTask(task) {\n if (enqueueTaskImpl === null) {\n try {\n // read require off the module object to get around the bundlers.\n // we don't want them to detect a require and bundle a Node polyfill.\n var requireString = ('require' + Math.random()).slice(0, 7);\n var nodeRequire = module && module[requireString]; // assuming we're in node, let's try to get node's\n // version of setImmediate, bypassing fake timers if any.\n\n enqueueTaskImpl = nodeRequire.call(module, 'timers').setImmediate;\n } catch (_err) {\n // we're in a browser\n // we can't use regular timers because they may still be faked\n // so we try MessageChannel+postMessage instead\n enqueueTaskImpl = function (callback) {\n {\n if (didWarnAboutMessageChannel === false) {\n didWarnAboutMessageChannel = true;\n\n if (typeof MessageChannel === 'undefined') {\n error('This browser does not have a MessageChannel implementation, ' + 'so enqueuing tasks via await act(async () => ...) will fail. ' + 'Please file an issue at https://github.com/facebook/react/issues ' + 'if you encounter this warning.');\n }\n }\n }\n\n var channel = new MessageChannel();\n channel.port1.onmessage = callback;\n channel.port2.postMessage(undefined);\n };\n }\n }\n\n return enqueueTaskImpl(task);\n}\n\nvar actScopeDepth = 0;\nvar didWarnNoAwaitAct = false;\nfunction act(callback) {\n {\n // `act` calls can be nested, so we track the depth. This represents the\n // number of `act` scopes on the stack.\n var prevActScopeDepth = actScopeDepth;\n actScopeDepth++;\n\n if (ReactCurrentActQueue.current === null) {\n // This is the outermost `act` scope. Initialize the queue. The reconciler\n // will detect the queue and use it instead of Scheduler.\n ReactCurrentActQueue.current = [];\n }\n\n var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy;\n var result;\n\n try {\n // Used to reproduce behavior of `batchedUpdates` in legacy mode. Only\n // set to `true` while the given callback is executed, not for updates\n // triggered during an async event, because this is how the legacy\n // implementation of `act` behaved.\n ReactCurrentActQueue.isBatchingLegacy = true;\n result = callback(); // Replicate behavior of original `act` implementation in legacy mode,\n // which flushed updates immediately after the scope function exits, even\n // if it's an async function.\n\n if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) {\n var queue = ReactCurrentActQueue.current;\n\n if (queue !== null) {\n ReactCurrentActQueue.didScheduleLegacyUpdate = false;\n flushActQueue(queue);\n }\n }\n } catch (error) {\n popActScope(prevActScopeDepth);\n throw error;\n } finally {\n ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;\n }\n\n if (result !== null && typeof result === 'object' && typeof result.then === 'function') {\n var thenableResult = result; // The callback is an async function (i.e. returned a promise). Wait\n // for it to resolve before exiting the current scope.\n\n var wasAwaited = false;\n var thenable = {\n then: function (resolve, reject) {\n wasAwaited = true;\n thenableResult.then(function (returnValue) {\n popActScope(prevActScopeDepth);\n\n if (actScopeDepth === 0) {\n // We've exited the outermost act scope. Recursively flush the\n // queue until there's no remaining work.\n recursivelyFlushAsyncActWork(returnValue, resolve, reject);\n } else {\n resolve(returnValue);\n }\n }, function (error) {\n // The callback threw an error.\n popActScope(prevActScopeDepth);\n reject(error);\n });\n }\n };\n\n {\n if (!didWarnNoAwaitAct && typeof Promise !== 'undefined') {\n // eslint-disable-next-line no-undef\n Promise.resolve().then(function () {}).then(function () {\n if (!wasAwaited) {\n didWarnNoAwaitAct = true;\n\n error('You called act(async () => ...) without await. ' + 'This could lead to unexpected testing behaviour, ' + 'interleaving multiple act calls and mixing their ' + 'scopes. ' + 'You should - await act(async () => ...);');\n }\n });\n }\n }\n\n return thenable;\n } else {\n var returnValue = result; // The callback is not an async function. Exit the current scope\n // immediately, without awaiting.\n\n popActScope(prevActScopeDepth);\n\n if (actScopeDepth === 0) {\n // Exiting the outermost act scope. Flush the queue.\n var _queue = ReactCurrentActQueue.current;\n\n if (_queue !== null) {\n flushActQueue(_queue);\n ReactCurrentActQueue.current = null;\n } // Return a thenable. If the user awaits it, we'll flush again in\n // case additional work was scheduled by a microtask.\n\n\n var _thenable = {\n then: function (resolve, reject) {\n // Confirm we haven't re-entered another `act` scope, in case\n // the user does something weird like await the thenable\n // multiple times.\n if (ReactCurrentActQueue.current === null) {\n // Recursively flush the queue until there's no remaining work.\n ReactCurrentActQueue.current = [];\n recursivelyFlushAsyncActWork(returnValue, resolve, reject);\n } else {\n resolve(returnValue);\n }\n }\n };\n return _thenable;\n } else {\n // Since we're inside a nested `act` scope, the returned thenable\n // immediately resolves. The outer scope will flush the queue.\n var _thenable2 = {\n then: function (resolve, reject) {\n resolve(returnValue);\n }\n };\n return _thenable2;\n }\n }\n }\n}\n\nfunction popActScope(prevActScopeDepth) {\n {\n if (prevActScopeDepth !== actScopeDepth - 1) {\n error('You seem to have overlapping act() calls, this is not supported. ' + 'Be sure to await previous act() calls before making a new one. ');\n }\n\n actScopeDepth = prevActScopeDepth;\n }\n}\n\nfunction recursivelyFlushAsyncActWork(returnValue, resolve, reject) {\n {\n var queue = ReactCurrentActQueue.current;\n\n if (queue !== null) {\n try {\n flushActQueue(queue);\n enqueueTask(function () {\n if (queue.length === 0) {\n // No additional work was scheduled. Finish.\n ReactCurrentActQueue.current = null;\n resolve(returnValue);\n } else {\n // Keep flushing work until there's none left.\n recursivelyFlushAsyncActWork(returnValue, resolve, reject);\n }\n });\n } catch (error) {\n reject(error);\n }\n } else {\n resolve(returnValue);\n }\n }\n}\n\nvar isFlushing = false;\n\nfunction flushActQueue(queue) {\n {\n if (!isFlushing) {\n // Prevent re-entrance.\n isFlushing = true;\n var i = 0;\n\n try {\n for (; i < queue.length; i++) {\n var callback = queue[i];\n\n do {\n callback = callback(true);\n } while (callback !== null);\n }\n\n queue.length = 0;\n } catch (error) {\n // If something throws, leave the remaining callbacks on the queue.\n queue = queue.slice(i + 1);\n throw error;\n } finally {\n isFlushing = false;\n }\n }\n }\n}\n\nvar createElement$1 = createElementWithValidation ;\nvar cloneElement$1 = cloneElementWithValidation ;\nvar createFactory = createFactoryWithValidation ;\nvar Children = {\n map: mapChildren,\n forEach: forEachChildren,\n count: countChildren,\n toArray: toArray,\n only: onlyChild\n};\n\nexports.Children = Children;\nexports.Component = Component;\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.Profiler = REACT_PROFILER_TYPE;\nexports.PureComponent = PureComponent;\nexports.StrictMode = REACT_STRICT_MODE_TYPE;\nexports.Suspense = REACT_SUSPENSE_TYPE;\nexports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;\nexports.cloneElement = cloneElement$1;\nexports.createContext = createContext;\nexports.createElement = createElement$1;\nexports.createFactory = createFactory;\nexports.createRef = createRef;\nexports.forwardRef = forwardRef;\nexports.isValidElement = isValidElement;\nexports.lazy = lazy;\nexports.memo = memo;\nexports.startTransition = startTransition;\nexports.unstable_act = act;\nexports.useCallback = useCallback;\nexports.useContext = useContext;\nexports.useDebugValue = useDebugValue;\nexports.useDeferredValue = useDeferredValue;\nexports.useEffect = useEffect;\nexports.useId = useId;\nexports.useImperativeHandle = useImperativeHandle;\nexports.useInsertionEffect = useInsertionEffect;\nexports.useLayoutEffect = useLayoutEffect;\nexports.useMemo = useMemo;\nexports.useReducer = useReducer;\nexports.useRef = useRef;\nexports.useState = useState;\nexports.useSyncExternalStore = useSyncExternalStore;\nexports.useTransition = useTransition;\nexports.version = ReactVersion;\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());\n}\n \n })();\n}\n", "'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react.production.min.js');\n} else {\n module.exports = require('./cjs/react.development.js');\n}\n", "/**\n * @license React\n * react-jsx-dev-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"<anonymous>\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('<anonymous>')) {\n _frame = _frame.replace('<anonymous>', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie. <div {...props} key=\"Hi\" />\n // or <div key=\"Hi\" {...props} /> ). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n // <div {...props} key=\"Hi\" />, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n\nvar jsxDEV$1 = jsxWithValidation ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsxDEV = jsxDEV$1;\n })();\n}\n", "'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-dev-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-dev-runtime.development.js');\n}\n"],- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;;;ACEA,SAAS,QAAQ;AACf,MAAI;AAAY,WAAO;AACvB,eAAa;AACb,YAAU,aAAa;AACvB,YAAU,cAAc;AACxB,YAAU,gBAAgB;AAC1B,MAAI,SAAS,CAAC;AACd,MAAI,YAAY,CAAC;AACjB,MAAI,MAAM,OAAO,eAAe,cAAc,aAAa;AAC3D,MAAI,OAAO;AAEX,WAAS,IAAI,GAAG,MAAM,KAAK,QAAQ,IAAI,KAAK,EAAE,GAAG;AAC/C,WAAO,CAAC,IAAI,KAAK,CAAC;AAClB,cAAU,KAAK,WAAW,CAAC,CAAC,IAAI;AAAA,EAClC;AAIA,YAAU,IAAI,WAAW,CAAC,CAAC,IAAI;AAC/B,YAAU,IAAI,WAAW,CAAC,CAAC,IAAI;AAE/B,WAAS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C;AAAA,IAAAC;AAEA,QAAI,OAAuC;AACzC,aAAO,UAAU;AAAA,IACnB,OAAO;AACL,aAAO,UAAU;AAAA,IACnB;AAAA;AAAA;",- "names": ["len", "i", "len2", "Buffer", "byteLength", "init_buffer", "init_process", "init_buffer", "init_buffer", "init_process", "init_process", "exports", "init_buffer", "init_process", "ReactDebugCurrentFrame", "moduleObject", "error", "Component", "returnValue", "exports", "init_buffer", "init_process", "exports", "init_buffer", "init_process", "ReactDebugCurrentFrame", "exports", "init_buffer", "init_process"]-}diff --git a/public/build/_shared/chunk-QEVHFCZ7.js b/public/build/_shared/chunk-QEVHFCZ7.jsdeleted file mode 100644index 84627a0ad..000000000--- a/public/build/_shared/chunk-QEVHFCZ7.js+++ /dev/null@@ -1,5847 +0,0 @@-import {- __esm,- __toESM,- init_buffer,- init_dirname,- init_filename,- init_global,- init_process,- require_react-} from "/build/_shared/chunk-NLQNPAAV.js";--// node_modules/@remix-run/router/dist/router.js-function _extends() {- _extends = Object.assign ? Object.assign.bind() : function(target) {- for (var i = 1; i < arguments.length; i++) {- var source = arguments[i];- for (var key in source) {- if (Object.prototype.hasOwnProperty.call(source, key)) {- target[key] = source[key];- }- }- }- return target;- };- return _extends.apply(this, arguments);-}-function createBrowserHistory(options) {- if (options === void 0) {- options = {};- }- function createBrowserLocation(window2, globalHistory) {- let {- pathname,- search,- hash- } = window2.location;- return createLocation(- "",- {- pathname,- search,- hash- },- // state defaults to `null` because `window.history.state` does- globalHistory.state && globalHistory.state.usr || null,- globalHistory.state && globalHistory.state.key || "default"- );- }- function createBrowserHref(window2, to) {- return typeof to === "string" ? to : createPath(to);- }- return getUrlBasedHistory(createBrowserLocation, createBrowserHref, null, options);-}-function invariant(value, message) {- if (value === false || value === null || typeof value === "undefined") {- throw new Error(message);- }-}-function warning(cond, message) {- if (!cond) {- if (typeof console !== "undefined")- console.warn(message);- try {- throw new Error(message);- } catch (e) {- }- }-}-function createKey() {- return Math.random().toString(36).substr(2, 8);-}-function getHistoryState(location, index) {- return {- usr: location.state,- key: location.key,- idx: index- };-}-function createLocation(current, to, state, key) {- if (state === void 0) {- state = null;- }- let location = _extends({- pathname: typeof current === "string" ? current : current.pathname,- search: "",- hash: ""- }, typeof to === "string" ? parsePath(to) : to, {- state,- // TODO: This could be cleaned up. push/replace should probably just take- // full Locations now and avoid the need to run through this flow at all- // But that's a pretty big refactor to the current test suite so going to- // keep as is for the time being and just let any incoming keys take precedence- key: to && to.key || key || createKey()- });- return location;-}-function createPath(_ref) {- let {- pathname = "/",- search = "",- hash = ""- } = _ref;- if (search && search !== "?")- pathname += search.charAt(0) === "?" ? search : "?" + search;- if (hash && hash !== "#")- pathname += hash.charAt(0) === "#" ? hash : "#" + hash;- return pathname;-}-function parsePath(path) {- let parsedPath = {};- if (path) {- let hashIndex = path.indexOf("#");- if (hashIndex >= 0) {- parsedPath.hash = path.substr(hashIndex);- path = path.substr(0, hashIndex);- }- let searchIndex = path.indexOf("?");- if (searchIndex >= 0) {- parsedPath.search = path.substr(searchIndex);- path = path.substr(0, searchIndex);- }- if (path) {- parsedPath.pathname = path;- }- }- return parsedPath;-}-function getUrlBasedHistory(getLocation, createHref, validateLocation, options) {- if (options === void 0) {- options = {};- }- let {- window: window2 = document.defaultView,- v5Compat = false- } = options;- let globalHistory = window2.history;- let action = Action.Pop;- let listener = null;- let index = getIndex();- if (index == null) {- index = 0;- globalHistory.replaceState(_extends({}, globalHistory.state, {- idx: index- }), "");- }- function getIndex() {- let state = globalHistory.state || {- idx: null- };- return state.idx;- }- function handlePop() {- action = Action.Pop;- let nextIndex = getIndex();- let delta = nextIndex == null ? null : nextIndex - index;- index = nextIndex;- if (listener) {- listener({- action,- location: history.location,- delta- });- }- }- function push(to, state) {- action = Action.Push;- let location = createLocation(history.location, to, state);- if (validateLocation)- validateLocation(location, to);- index = getIndex() + 1;- let historyState = getHistoryState(location, index);- let url = history.createHref(location);- try {- globalHistory.pushState(historyState, "", url);- } catch (error) {- window2.location.assign(url);- }- if (v5Compat && listener) {- listener({- action,- location: history.location,- delta: 1- });- }- }- function replace(to, state) {- action = Action.Replace;- let location = createLocation(history.location, to, state);- if (validateLocation)- validateLocation(location, to);- index = getIndex();- let historyState = getHistoryState(location, index);- let url = history.createHref(location);- globalHistory.replaceState(historyState, "", url);- if (v5Compat && listener) {- listener({- action,- location: history.location,- delta: 0- });- }- }- function createURL(to) {- let base = window2.location.origin !== "null" ? window2.location.origin : window2.location.href;- let href = typeof to === "string" ? to : createPath(to);- invariant(base, "No window.location.(origin|href) available to create URL for href: " + href);- return new URL(href, base);- }- let history = {- get action() {- return action;- },- get location() {- return getLocation(window2, globalHistory);- },- listen(fn) {- if (listener) {- throw new Error("A history only accepts one active listener");- }- window2.addEventListener(PopStateEventType, handlePop);- listener = fn;- return () => {- window2.removeEventListener(PopStateEventType, handlePop);- listener = null;- };- },- createHref(to) {- return createHref(window2, to);- },- createURL,- encodeLocation(to) {- let url = createURL(to);- return {- pathname: url.pathname,- search: url.search,- hash: url.hash- };- },- push,- replace,- go(n) {- return globalHistory.go(n);- }- };- return history;-}-function isIndexRoute(route) {- return route.index === true;-}-function convertRoutesToDataRoutes(routes, mapRouteProperties2, parentPath, manifest) {- if (parentPath === void 0) {- parentPath = [];- }- if (manifest === void 0) {- manifest = {};- }- return routes.map((route, index) => {- let treePath = [...parentPath, index];- let id = typeof route.id === "string" ? route.id : treePath.join("-");- invariant(route.index !== true || !route.children, "Cannot specify children on an index route");- invariant(!manifest[id], 'Found a route id collision on id "' + id + `". Route id's must be globally unique within Data Router usages`);- if (isIndexRoute(route)) {- let indexRoute = _extends({}, route, mapRouteProperties2(route), {- id- });- manifest[id] = indexRoute;- return indexRoute;- } else {- let pathOrLayoutRoute = _extends({}, route, mapRouteProperties2(route), {- id,- children: void 0- });- manifest[id] = pathOrLayoutRoute;- if (route.children) {- pathOrLayoutRoute.children = convertRoutesToDataRoutes(route.children, mapRouteProperties2, treePath, manifest);- }- return pathOrLayoutRoute;- }- });-}-function matchRoutes(routes, locationArg, basename) {- if (basename === void 0) {- basename = "/";- }- let location = typeof locationArg === "string" ? parsePath(locationArg) : locationArg;- let pathname = stripBasename(location.pathname || "/", basename);- if (pathname == null) {- return null;- }- let branches = flattenRoutes(routes);- rankRouteBranches(branches);- let matches = null;- for (let i = 0; matches == null && i < branches.length; ++i) {- matches = matchRouteBranch(- branches[i],- // Incoming pathnames are generally encoded from either window.location- // or from router.navigate, but we want to match against the unencoded- // paths in the route definitions. Memory router locations won't be- // encoded here but there also shouldn't be anything to decode so this- // should be a safe operation. This avoids needing matchRoutes to be- // history-aware.- safelyDecodeURI(pathname)- );- }- return matches;-}-function flattenRoutes(routes, branches, parentsMeta, parentPath) {- if (branches === void 0) {- branches = [];- }- if (parentsMeta === void 0) {- parentsMeta = [];- }- if (parentPath === void 0) {- parentPath = "";- }- let flattenRoute = (route, index, relativePath) => {- let meta = {- relativePath: relativePath === void 0 ? route.path || "" : relativePath,- caseSensitive: route.caseSensitive === true,- childrenIndex: index,- route- };- if (meta.relativePath.startsWith("/")) {- invariant(meta.relativePath.startsWith(parentPath), 'Absolute route path "' + meta.relativePath + '" nested under path ' + ('"' + parentPath + '" is not valid. An absolute child route path ') + "must start with the combined path of all its parent routes.");- meta.relativePath = meta.relativePath.slice(parentPath.length);- }- let path = joinPaths([parentPath, meta.relativePath]);- let routesMeta = parentsMeta.concat(meta);- if (route.children && route.children.length > 0) {- invariant(- // Our types know better, but runtime JS may not!- // @ts-expect-error- route.index !== true,- "Index routes must not have child routes. Please remove " + ('all child routes from route path "' + path + '".')- );- flattenRoutes(route.children, branches, routesMeta, path);- }- if (route.path == null && !route.index) {- return;- }- branches.push({- path,- score: computeScore(path, route.index),- routesMeta- });- };- routes.forEach((route, index) => {- var _route$path;- if (route.path === "" || !((_route$path = route.path) != null && _route$path.includes("?"))) {- flattenRoute(route, index);- } else {- for (let exploded of explodeOptionalSegments(route.path)) {- flattenRoute(route, index, exploded);- }- }- });- return branches;-}-function explodeOptionalSegments(path) {- let segments = path.split("/");- if (segments.length === 0)- return [];- let [first, ...rest] = segments;- let isOptional = first.endsWith("?");- let required = first.replace(/\?$/, "");- if (rest.length === 0) {- return isOptional ? [required, ""] : [required];- }- let restExploded = explodeOptionalSegments(rest.join("/"));- let result = [];- result.push(...restExploded.map((subpath) => subpath === "" ? required : [required, subpath].join("/")));- if (isOptional) {- result.push(...restExploded);- }- return result.map((exploded) => path.startsWith("/") && exploded === "" ? "/" : exploded);-}-function rankRouteBranches(branches) {- branches.sort((a, b) => a.score !== b.score ? b.score - a.score : compareIndexes(a.routesMeta.map((meta) => meta.childrenIndex), b.routesMeta.map((meta) => meta.childrenIndex)));-}-function computeScore(path, index) {- let segments = path.split("/");- let initialScore = segments.length;- if (segments.some(isSplat)) {- initialScore += splatPenalty;- }- if (index) {- initialScore += indexRouteValue;- }- return segments.filter((s) => !isSplat(s)).reduce((score, segment) => score + (paramRe.test(segment) ? dynamicSegmentValue : segment === "" ? emptySegmentValue : staticSegmentValue), initialScore);-}-function compareIndexes(a, b) {- let siblings = a.length === b.length && a.slice(0, -1).every((n, i) => n === b[i]);- return siblings ? (- // If two routes are siblings, we should try to match the earlier sibling- // first. This allows people to have fine-grained control over the matching- // behavior by simply putting routes with identical paths in the order they- // want them tried.- a[a.length - 1] - b[b.length - 1]- ) : (- // Otherwise, it doesn't really make sense to rank non-siblings by index,- // so they sort equally.- 0- );-}-function matchRouteBranch(branch, pathname) {- let {- routesMeta- } = branch;- let matchedParams = {};- let matchedPathname = "/";- let matches = [];- for (let i = 0; i < routesMeta.length; ++i) {- let meta = routesMeta[i];- let end = i === routesMeta.length - 1;- let remainingPathname = matchedPathname === "/" ? pathname : pathname.slice(matchedPathname.length) || "/";- let match = matchPath({- path: meta.relativePath,- caseSensitive: meta.caseSensitive,- end- }, remainingPathname);- if (!match)- return null;- Object.assign(matchedParams, match.params);- let route = meta.route;- matches.push({- // TODO: Can this as be avoided?- params: matchedParams,- pathname: joinPaths([matchedPathname, match.pathname]),- pathnameBase: normalizePathname(joinPaths([matchedPathname, match.pathnameBase])),- route- });- if (match.pathnameBase !== "/") {- matchedPathname = joinPaths([matchedPathname, match.pathnameBase]);- }- }- return matches;-}-function matchPath(pattern, pathname) {- if (typeof pattern === "string") {- pattern = {- path: pattern,- caseSensitive: false,- end: true- };- }- let [matcher, paramNames] = compilePath(pattern.path, pattern.caseSensitive, pattern.end);- let match = pathname.match(matcher);- if (!match)- return null;- let matchedPathname = match[0];- let pathnameBase = matchedPathname.replace(/(.)\/+$/, "$1");- let captureGroups = match.slice(1);- let params = paramNames.reduce((memo, paramName, index) => {- if (paramName === "*") {- let splatValue = captureGroups[index] || "";- pathnameBase = matchedPathname.slice(0, matchedPathname.length - splatValue.length).replace(/(.)\/+$/, "$1");- }- memo[paramName] = safelyDecodeURIComponent(captureGroups[index] || "", paramName);- return memo;- }, {});- return {- params,- pathname: matchedPathname,- pathnameBase,- pattern- };-}-function compilePath(path, caseSensitive, end) {- if (caseSensitive === void 0) {- caseSensitive = false;- }- if (end === void 0) {- end = true;- }- warning(path === "*" || !path.endsWith("*") || path.endsWith("/*"), 'Route path "' + path + '" will be treated as if it were ' + ('"' + path.replace(/\*$/, "/*") + '" because the `*` character must ') + "always follow a `/` in the pattern. To get rid of this warning, " + ('please change the route path to "' + path.replace(/\*$/, "/*") + '".'));- let paramNames = [];- let regexpSource = "^" + path.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^$?{}|()[\]]/g, "\\$&").replace(/\/:(\w+)/g, (_, paramName) => {- paramNames.push(paramName);- return "/([^\\/]+)";- });- if (path.endsWith("*")) {- paramNames.push("*");- regexpSource += path === "*" || path === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$";- } else if (end) {- regexpSource += "\\/*$";- } else if (path !== "" && path !== "/") {- regexpSource += "(?:(?=\\/|$))";- } else- ;- let matcher = new RegExp(regexpSource, caseSensitive ? void 0 : "i");- return [matcher, paramNames];-}-function safelyDecodeURI(value) {- try {- return decodeURI(value);- } catch (error) {- warning(false, 'The URL path "' + value + '" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent ' + ("encoding (" + error + ")."));- return value;- }-}-function safelyDecodeURIComponent(value, paramName) {- try {- return decodeURIComponent(value);- } catch (error) {- warning(false, 'The value for the URL param "' + paramName + '" will not be decoded because' + (' the string "' + value + '" is a malformed URL segment. This is probably') + (" due to a bad percent encoding (" + error + ")."));- return value;- }-}-function stripBasename(pathname, basename) {- if (basename === "/")- return pathname;- if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) {- return null;- }- let startIndex = basename.endsWith("/") ? basename.length - 1 : basename.length;- let nextChar = pathname.charAt(startIndex);- if (nextChar && nextChar !== "/") {- return null;- }- return pathname.slice(startIndex) || "/";-}-function resolvePath(to, fromPathname) {- if (fromPathname === void 0) {- fromPathname = "/";- }- let {- pathname: toPathname,- search = "",- hash = ""- } = typeof to === "string" ? parsePath(to) : to;- let pathname = toPathname ? toPathname.startsWith("/") ? toPathname : resolvePathname(toPathname, fromPathname) : fromPathname;- return {- pathname,- search: normalizeSearch(search),- hash: normalizeHash(hash)- };-}-function resolvePathname(relativePath, fromPathname) {- let segments = fromPathname.replace(/\/+$/, "").split("/");- let relativeSegments = relativePath.split("/");- relativeSegments.forEach((segment) => {- if (segment === "..") {- if (segments.length > 1)- segments.pop();- } else if (segment !== ".") {- segments.push(segment);- }- });- return segments.length > 1 ? segments.join("/") : "/";-}-function getInvalidPathError(char, field, dest, path) {- return "Cannot include a '" + char + "' character in a manually specified " + ("`to." + field + "` field [" + JSON.stringify(path) + "]. Please separate it out to the ") + ("`to." + dest + "` field. Alternatively you may provide the full path as ") + 'a string in <Link to="..."> and the router will parse it for you.';-}-function getPathContributingMatches(matches) {- return matches.filter((match, index) => index === 0 || match.route.path && match.route.path.length > 0);-}-function resolveTo(toArg, routePathnames, locationPathname, isPathRelative) {- if (isPathRelative === void 0) {- isPathRelative = false;- }- let to;- if (typeof toArg === "string") {- to = parsePath(toArg);- } else {- to = _extends({}, toArg);- invariant(!to.pathname || !to.pathname.includes("?"), getInvalidPathError("?", "pathname", "search", to));- invariant(!to.pathname || !to.pathname.includes("#"), getInvalidPathError("#", "pathname", "hash", to));- invariant(!to.search || !to.search.includes("#"), getInvalidPathError("#", "search", "hash", to));- }- let isEmptyPath = toArg === "" || to.pathname === "";- let toPathname = isEmptyPath ? "/" : to.pathname;- let from;- if (isPathRelative || toPathname == null) {- from = locationPathname;- } else {- let routePathnameIndex = routePathnames.length - 1;- if (toPathname.startsWith("..")) {- let toSegments = toPathname.split("/");- while (toSegments[0] === "..") {- toSegments.shift();- routePathnameIndex -= 1;- }- to.pathname = toSegments.join("/");- }- from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : "/";- }- let path = resolvePath(to, from);- let hasExplicitTrailingSlash = toPathname && toPathname !== "/" && toPathname.endsWith("/");- let hasCurrentTrailingSlash = (isEmptyPath || toPathname === ".") && locationPathname.endsWith("/");- if (!path.pathname.endsWith("/") && (hasExplicitTrailingSlash || hasCurrentTrailingSlash)) {- path.pathname += "/";- }- return path;-}-function isTrackedPromise(value) {- return value instanceof Promise && value._tracked === true;-}-function unwrapTrackedPromise(value) {- if (!isTrackedPromise(value)) {- return value;- }- if (value._error) {- throw value._error;- }- return value._data;-}-function isRouteErrorResponse(error) {- return error != null && typeof error.status === "number" && typeof error.statusText === "string" && typeof error.internal === "boolean" && "data" in error;-}-function createRouter(init) {- invariant(init.routes.length > 0, "You must provide a non-empty routes array to createRouter");- let mapRouteProperties2;- if (init.mapRouteProperties) {- mapRouteProperties2 = init.mapRouteProperties;- } else if (init.detectErrorBoundary) {- let detectErrorBoundary = init.detectErrorBoundary;- mapRouteProperties2 = (route) => ({- hasErrorBoundary: detectErrorBoundary(route)- });- } else {- mapRouteProperties2 = defaultMapRouteProperties;- }- let manifest = {};- let dataRoutes = convertRoutesToDataRoutes(init.routes, mapRouteProperties2, void 0, manifest);- let inFlightDataRoutes;- let basename = init.basename || "/";- let future = _extends({- v7_normalizeFormMethod: false,- v7_prependBasename: false- }, init.future);- let unlistenHistory = null;- let subscribers = /* @__PURE__ */ new Set();- let savedScrollPositions2 = null;- let getScrollRestorationKey = null;- let getScrollPosition = null;- let initialScrollRestored = init.hydrationData != null;- let initialMatches = matchRoutes(dataRoutes, init.history.location, basename);- let initialErrors = null;- if (initialMatches == null) {- let error = getInternalRouterError(404, {- pathname: init.history.location.pathname- });- let {- matches,- route- } = getShortCircuitMatches(dataRoutes);- initialMatches = matches;- initialErrors = {- [route.id]: error- };- }- let initialized = (- // All initialMatches need to be loaded before we're ready. If we have lazy- // functions around still then we'll need to run them in initialize()- !initialMatches.some((m) => m.route.lazy) && // And we have to either have no loaders or have been provided hydrationData- (!initialMatches.some((m) => m.route.loader) || init.hydrationData != null)- );- let router2;- let state = {- historyAction: init.history.action,- location: init.history.location,- matches: initialMatches,- initialized,- navigation: IDLE_NAVIGATION,- // Don't restore on initial updateState() if we were SSR'd- restoreScrollPosition: init.hydrationData != null ? false : null,- preventScrollReset: false,- revalidation: "idle",- loaderData: init.hydrationData && init.hydrationData.loaderData || {},- actionData: init.hydrationData && init.hydrationData.actionData || null,- errors: init.hydrationData && init.hydrationData.errors || initialErrors,- fetchers: /* @__PURE__ */ new Map(),- blockers: /* @__PURE__ */ new Map()- };- let pendingAction = Action.Pop;- let pendingPreventScrollReset = false;- let pendingNavigationController;- let isUninterruptedRevalidation = false;- let isRevalidationRequired = false;- let cancelledDeferredRoutes = [];- let cancelledFetcherLoads = [];- let fetchControllers = /* @__PURE__ */ new Map();- let incrementingLoadId = 0;- let pendingNavigationLoadId = -1;- let fetchReloadIds = /* @__PURE__ */ new Map();- let fetchRedirectIds = /* @__PURE__ */ new Set();- let fetchLoadMatches = /* @__PURE__ */ new Map();- let activeDeferreds = /* @__PURE__ */ new Map();- let blockerFunctions = /* @__PURE__ */ new Map();- let ignoreNextHistoryUpdate = false;- function initialize() {- unlistenHistory = init.history.listen((_ref) => {- let {- action: historyAction,- location,- delta- } = _ref;- if (ignoreNextHistoryUpdate) {- ignoreNextHistoryUpdate = false;- return;- }- warning(blockerFunctions.size === 0 || delta != null, "You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");- let blockerKey = shouldBlockNavigation({- currentLocation: state.location,- nextLocation: location,- historyAction- });- if (blockerKey && delta != null) {- ignoreNextHistoryUpdate = true;- init.history.go(delta * -1);- updateBlocker(blockerKey, {- state: "blocked",- location,- proceed() {- updateBlocker(blockerKey, {- state: "proceeding",- proceed: void 0,- reset: void 0,- location- });- init.history.go(delta);- },- reset() {- deleteBlocker(blockerKey);- updateState({- blockers: new Map(router2.state.blockers)- });- }- });- return;- }- return startNavigation(historyAction, location);- });- if (!state.initialized) {- startNavigation(Action.Pop, state.location);- }- return router2;- }- function dispose() {- if (unlistenHistory) {- unlistenHistory();- }- subscribers.clear();- pendingNavigationController && pendingNavigationController.abort();- state.fetchers.forEach((_, key) => deleteFetcher(key));- state.blockers.forEach((_, key) => deleteBlocker(key));- }- function subscribe(fn) {- subscribers.add(fn);- return () => subscribers.delete(fn);- }- function updateState(newState) {- state = _extends({}, state, newState);- subscribers.forEach((subscriber) => subscriber(state));- }- function completeNavigation(location, newState) {- var _location$state, _location$state2;- let isActionReload = state.actionData != null && state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && state.navigation.state === "loading" && ((_location$state = location.state) == null ? void 0 : _location$state._isRedirect) !== true;- let actionData;- if (newState.actionData) {- if (Object.keys(newState.actionData).length > 0) {- actionData = newState.actionData;- } else {- actionData = null;- }- } else if (isActionReload) {- actionData = state.actionData;- } else {- actionData = null;- }- let loaderData = newState.loaderData ? mergeLoaderData(state.loaderData, newState.loaderData, newState.matches || [], newState.errors) : state.loaderData;- for (let [key] of blockerFunctions) {- deleteBlocker(key);- }- let preventScrollReset = pendingPreventScrollReset === true || state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && ((_location$state2 = location.state) == null ? void 0 : _location$state2._isRedirect) !== true;- if (inFlightDataRoutes) {- dataRoutes = inFlightDataRoutes;- inFlightDataRoutes = void 0;- }- updateState(_extends({}, newState, {- actionData,- loaderData,- historyAction: pendingAction,- location,- initialized: true,- navigation: IDLE_NAVIGATION,- revalidation: "idle",- restoreScrollPosition: getSavedScrollPosition(location, newState.matches || state.matches),- preventScrollReset,- blockers: new Map(state.blockers)- }));- if (isUninterruptedRevalidation)- ;- else if (pendingAction === Action.Pop)- ;- else if (pendingAction === Action.Push) {- init.history.push(location, location.state);- } else if (pendingAction === Action.Replace) {- init.history.replace(location, location.state);- }- pendingAction = Action.Pop;- pendingPreventScrollReset = false;- isUninterruptedRevalidation = false;- isRevalidationRequired = false;- cancelledDeferredRoutes = [];- cancelledFetcherLoads = [];- }- async function navigate(to, opts) {- if (typeof to === "number") {- init.history.go(to);- return;- }- let normalizedPath = normalizeTo(state.location, state.matches, basename, future.v7_prependBasename, to, opts == null ? void 0 : opts.fromRouteId, opts == null ? void 0 : opts.relative);- let {- path,- submission,- error- } = normalizeNavigateOptions(future.v7_normalizeFormMethod, false, normalizedPath, opts);- let currentLocation = state.location;- let nextLocation = createLocation(state.location, path, opts && opts.state);- nextLocation = _extends({}, nextLocation, init.history.encodeLocation(nextLocation));- let userReplace = opts && opts.replace != null ? opts.replace : void 0;- let historyAction = Action.Push;- if (userReplace === true) {- historyAction = Action.Replace;- } else if (userReplace === false)- ;- else if (submission != null && isMutationMethod(submission.formMethod) && submission.formAction === state.location.pathname + state.location.search) {- historyAction = Action.Replace;- }- let preventScrollReset = opts && "preventScrollReset" in opts ? opts.preventScrollReset === true : void 0;- let blockerKey = shouldBlockNavigation({- currentLocation,- nextLocation,- historyAction- });- if (blockerKey) {- updateBlocker(blockerKey, {- state: "blocked",- location: nextLocation,- proceed() {- updateBlocker(blockerKey, {- state: "proceeding",- proceed: void 0,- reset: void 0,- location: nextLocation- });- navigate(to, opts);- },- reset() {- deleteBlocker(blockerKey);- updateState({- blockers: new Map(state.blockers)- });- }- });- return;- }- return await startNavigation(historyAction, nextLocation, {- submission,- // Send through the formData serialization error if we have one so we can- // render at the right error boundary after we match routes- pendingError: error,- preventScrollReset,- replace: opts && opts.replace- });- }- function revalidate() {- interruptActiveLoads();- updateState({- revalidation: "loading"- });- if (state.navigation.state === "submitting") {- return;- }- if (state.navigation.state === "idle") {- startNavigation(state.historyAction, state.location, {- startUninterruptedRevalidation: true- });- return;- }- startNavigation(pendingAction || state.historyAction, state.navigation.location, {- overrideNavigation: state.navigation- });- }- async function startNavigation(historyAction, location, opts) {- pendingNavigationController && pendingNavigationController.abort();- pendingNavigationController = null;- pendingAction = historyAction;- isUninterruptedRevalidation = (opts && opts.startUninterruptedRevalidation) === true;- saveScrollPosition(state.location, state.matches);- pendingPreventScrollReset = (opts && opts.preventScrollReset) === true;- let routesToUse = inFlightDataRoutes || dataRoutes;- let loadingNavigation = opts && opts.overrideNavigation;- let matches = matchRoutes(routesToUse, location, basename);- if (!matches) {- let error = getInternalRouterError(404, {- pathname: location.pathname- });- let {- matches: notFoundMatches,- route- } = getShortCircuitMatches(routesToUse);- cancelActiveDeferreds();- completeNavigation(location, {- matches: notFoundMatches,- loaderData: {},- errors: {- [route.id]: error- }- });- return;- }- if (state.initialized && isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {- completeNavigation(location, {- matches- });- return;- }- pendingNavigationController = new AbortController();- let request = createClientSideRequest(init.history, location, pendingNavigationController.signal, opts && opts.submission);- let pendingActionData;- let pendingError;- if (opts && opts.pendingError) {- pendingError = {- [findNearestBoundary(matches).route.id]: opts.pendingError- };- } else if (opts && opts.submission && isMutationMethod(opts.submission.formMethod)) {- let actionOutput = await handleAction(request, location, opts.submission, matches, {- replace: opts.replace- });- if (actionOutput.shortCircuited) {- return;- }- pendingActionData = actionOutput.pendingActionData;- pendingError = actionOutput.pendingActionError;- let navigation = _extends({- state: "loading",- location- }, opts.submission);- loadingNavigation = navigation;- request = new Request(request.url, {- signal: request.signal- });- }- let {- shortCircuited,- loaderData,- errors- } = await handleLoaders(request, location, matches, loadingNavigation, opts && opts.submission, opts && opts.fetcherSubmission, opts && opts.replace, pendingActionData, pendingError);- if (shortCircuited) {- return;- }- pendingNavigationController = null;- completeNavigation(location, _extends({- matches- }, pendingActionData ? {- actionData: pendingActionData- } : {}, {- loaderData,- errors- }));- }- async function handleAction(request, location, submission, matches, opts) {- interruptActiveLoads();- let navigation = _extends({- state: "submitting",- location- }, submission);- updateState({- navigation- });- let result;- let actionMatch = getTargetMatch(matches, location);- if (!actionMatch.route.action && !actionMatch.route.lazy) {- result = {- type: ResultType.error,- error: getInternalRouterError(405, {- method: request.method,- pathname: location.pathname,- routeId: actionMatch.route.id- })- };- } else {- result = await callLoaderOrAction("action", request, actionMatch, matches, manifest, mapRouteProperties2, basename);- if (request.signal.aborted) {- return {- shortCircuited: true- };- }- }- if (isRedirectResult(result)) {- let replace;- if (opts && opts.replace != null) {- replace = opts.replace;- } else {- replace = result.location === state.location.pathname + state.location.search;- }- await startRedirectNavigation(state, result, {- submission,- replace- });- return {- shortCircuited: true- };- }- if (isErrorResult(result)) {- let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id);- if ((opts && opts.replace) !== true) {- pendingAction = Action.Push;- }- return {- // Send back an empty object we can use to clear out any prior actionData- pendingActionData: {},- pendingActionError: {- [boundaryMatch.route.id]: result.error- }- };- }- if (isDeferredResult(result)) {- throw getInternalRouterError(400, {- type: "defer-action"- });- }- return {- pendingActionData: {- [actionMatch.route.id]: result.data- }- };- }- async function handleLoaders(request, location, matches, overrideNavigation, submission, fetcherSubmission, replace, pendingActionData, pendingError) {- let loadingNavigation = overrideNavigation;- if (!loadingNavigation) {- let navigation = _extends({- state: "loading",- location,- formMethod: void 0,- formAction: void 0,- formEncType: void 0,- formData: void 0- }, submission);- loadingNavigation = navigation;- }- let activeSubmission = submission || fetcherSubmission ? submission || fetcherSubmission : loadingNavigation.formMethod && loadingNavigation.formAction && loadingNavigation.formData && loadingNavigation.formEncType ? {- formMethod: loadingNavigation.formMethod,- formAction: loadingNavigation.formAction,- formData: loadingNavigation.formData,- formEncType: loadingNavigation.formEncType- } : void 0;- let routesToUse = inFlightDataRoutes || dataRoutes;- let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(init.history, state, matches, activeSubmission, location, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, fetchLoadMatches, routesToUse, basename, pendingActionData, pendingError);- cancelActiveDeferreds((routeId) => !(matches && matches.some((m) => m.route.id === routeId)) || matchesToLoad && matchesToLoad.some((m) => m.route.id === routeId));- if (matchesToLoad.length === 0 && revalidatingFetchers.length === 0) {- let updatedFetchers2 = markFetchRedirectsDone();- completeNavigation(location, _extends({- matches,- loaderData: {},- // Commit pending error if we're short circuiting- errors: pendingError || null- }, pendingActionData ? {- actionData: pendingActionData- } : {}, updatedFetchers2 ? {- fetchers: new Map(state.fetchers)- } : {}));- return {- shortCircuited: true- };- }- if (!isUninterruptedRevalidation) {- revalidatingFetchers.forEach((rf) => {- let fetcher = state.fetchers.get(rf.key);- let revalidatingFetcher = {- state: "loading",- data: fetcher && fetcher.data,- formMethod: void 0,- formAction: void 0,- formEncType: void 0,- formData: void 0,- " _hasFetcherDoneAnything ": true- };- state.fetchers.set(rf.key, revalidatingFetcher);- });- let actionData = pendingActionData || state.actionData;- updateState(_extends({- navigation: loadingNavigation- }, actionData ? Object.keys(actionData).length === 0 ? {- actionData: null- } : {- actionData- } : {}, revalidatingFetchers.length > 0 ? {- fetchers: new Map(state.fetchers)- } : {}));- }- pendingNavigationLoadId = ++incrementingLoadId;- revalidatingFetchers.forEach((rf) => {- if (rf.controller) {- fetchControllers.set(rf.key, rf.controller);- }- });- let abortPendingFetchRevalidations = () => revalidatingFetchers.forEach((f) => abortFetcher(f.key));- if (pendingNavigationController) {- pendingNavigationController.signal.addEventListener("abort", abortPendingFetchRevalidations);- }- let {- results,- loaderResults,- fetcherResults- } = await callLoadersAndMaybeResolveData(state.matches, matches, matchesToLoad, revalidatingFetchers, request);- if (request.signal.aborted) {- return {- shortCircuited: true- };- }- if (pendingNavigationController) {- pendingNavigationController.signal.removeEventListener("abort", abortPendingFetchRevalidations);- }- revalidatingFetchers.forEach((rf) => fetchControllers.delete(rf.key));- let redirect3 = findRedirect(results);- if (redirect3) {- await startRedirectNavigation(state, redirect3, {- replace- });- return {- shortCircuited: true- };- }- let {- loaderData,- errors- } = processLoaderData(state, matches, matchesToLoad, loaderResults, pendingError, revalidatingFetchers, fetcherResults, activeDeferreds);- activeDeferreds.forEach((deferredData, routeId) => {- deferredData.subscribe((aborted) => {- if (aborted || deferredData.done) {- activeDeferreds.delete(routeId);- }- });- });- let updatedFetchers = markFetchRedirectsDone();- let didAbortFetchLoads = abortStaleFetchLoads(pendingNavigationLoadId);- let shouldUpdateFetchers = updatedFetchers || didAbortFetchLoads || revalidatingFetchers.length > 0;- return _extends({- loaderData,- errors- }, shouldUpdateFetchers ? {- fetchers: new Map(state.fetchers)- } : {});- }- function getFetcher(key) {- return state.fetchers.get(key) || IDLE_FETCHER;- }- function fetch2(key, routeId, href, opts) {- if (isServer) {- throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");- }- if (fetchControllers.has(key))- abortFetcher(key);- let routesToUse = inFlightDataRoutes || dataRoutes;- let normalizedPath = normalizeTo(state.location, state.matches, basename, future.v7_prependBasename, href, routeId, opts == null ? void 0 : opts.relative);- let matches = matchRoutes(routesToUse, normalizedPath, basename);- if (!matches) {- setFetcherError(key, routeId, getInternalRouterError(404, {- pathname: normalizedPath- }));- return;- }- let {- path,- submission- } = normalizeNavigateOptions(future.v7_normalizeFormMethod, true, normalizedPath, opts);- let match = getTargetMatch(matches, path);- pendingPreventScrollReset = (opts && opts.preventScrollReset) === true;- if (submission && isMutationMethod(submission.formMethod)) {- handleFetcherAction(key, routeId, path, match, matches, submission);- return;- }- fetchLoadMatches.set(key, {- routeId,- path- });- handleFetcherLoader(key, routeId, path, match, matches, submission);- }- async function handleFetcherAction(key, routeId, path, match, requestMatches, submission) {- interruptActiveLoads();- fetchLoadMatches.delete(key);- if (!match.route.action && !match.route.lazy) {- let error = getInternalRouterError(405, {- method: submission.formMethod,- pathname: path,- routeId- });- setFetcherError(key, routeId, error);- return;- }- let existingFetcher = state.fetchers.get(key);- let fetcher = _extends({- state: "submitting"- }, submission, {- data: existingFetcher && existingFetcher.data,- " _hasFetcherDoneAnything ": true- });- state.fetchers.set(key, fetcher);- updateState({- fetchers: new Map(state.fetchers)- });- let abortController = new AbortController();- let fetchRequest = createClientSideRequest(init.history, path, abortController.signal, submission);- fetchControllers.set(key, abortController);- let actionResult = await callLoaderOrAction("action", fetchRequest, match, requestMatches, manifest, mapRouteProperties2, basename);- if (fetchRequest.signal.aborted) {- if (fetchControllers.get(key) === abortController) {- fetchControllers.delete(key);- }- return;- }- if (isRedirectResult(actionResult)) {- fetchControllers.delete(key);- fetchRedirectIds.add(key);- let loadingFetcher = _extends({- state: "loading"- }, submission, {- data: void 0,- " _hasFetcherDoneAnything ": true- });- state.fetchers.set(key, loadingFetcher);- updateState({- fetchers: new Map(state.fetchers)- });- return startRedirectNavigation(state, actionResult, {- submission,- isFetchActionRedirect: true- });- }- if (isErrorResult(actionResult)) {- setFetcherError(key, routeId, actionResult.error);- return;- }- if (isDeferredResult(actionResult)) {- throw getInternalRouterError(400, {- type: "defer-action"- });- }- let nextLocation = state.navigation.location || state.location;- let revalidationRequest = createClientSideRequest(init.history, nextLocation, abortController.signal);- let routesToUse = inFlightDataRoutes || dataRoutes;- let matches = state.navigation.state !== "idle" ? matchRoutes(routesToUse, state.navigation.location, basename) : state.matches;- invariant(matches, "Didn't find any matches after fetcher action");- let loadId = ++incrementingLoadId;- fetchReloadIds.set(key, loadId);- let loadFetcher = _extends({- state: "loading",- data: actionResult.data- }, submission, {- " _hasFetcherDoneAnything ": true- });- state.fetchers.set(key, loadFetcher);- let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(- init.history,- state,- matches,- submission,- nextLocation,- isRevalidationRequired,- cancelledDeferredRoutes,- cancelledFetcherLoads,- fetchLoadMatches,- routesToUse,- basename,- {- [match.route.id]: actionResult.data- },- void 0- // No need to send through errors since we short circuit above- );- revalidatingFetchers.filter((rf) => rf.key !== key).forEach((rf) => {- let staleKey = rf.key;- let existingFetcher2 = state.fetchers.get(staleKey);- let revalidatingFetcher = {- state: "loading",- data: existingFetcher2 && existingFetcher2.data,- formMethod: void 0,- formAction: void 0,- formEncType: void 0,- formData: void 0,- " _hasFetcherDoneAnything ": true- };- state.fetchers.set(staleKey, revalidatingFetcher);- if (rf.controller) {- fetchControllers.set(staleKey, rf.controller);- }- });- updateState({- fetchers: new Map(state.fetchers)- });- let abortPendingFetchRevalidations = () => revalidatingFetchers.forEach((rf) => abortFetcher(rf.key));- abortController.signal.addEventListener("abort", abortPendingFetchRevalidations);- let {- results,- loaderResults,- fetcherResults- } = await callLoadersAndMaybeResolveData(state.matches, matches, matchesToLoad, revalidatingFetchers, revalidationRequest);- if (abortController.signal.aborted) {- return;- }- abortController.signal.removeEventListener("abort", abortPendingFetchRevalidations);- fetchReloadIds.delete(key);- fetchControllers.delete(key);- revalidatingFetchers.forEach((r) => fetchControllers.delete(r.key));- let redirect3 = findRedirect(results);- if (redirect3) {- return startRedirectNavigation(state, redirect3);- }- let {- loaderData,- errors- } = processLoaderData(state, state.matches, matchesToLoad, loaderResults, void 0, revalidatingFetchers, fetcherResults, activeDeferreds);- let doneFetcher = {- state: "idle",- data: actionResult.data,- formMethod: void 0,- formAction: void 0,- formEncType: void 0,- formData: void 0,- " _hasFetcherDoneAnything ": true- };- state.fetchers.set(key, doneFetcher);- let didAbortFetchLoads = abortStaleFetchLoads(loadId);- if (state.navigation.state === "loading" && loadId > pendingNavigationLoadId) {- invariant(pendingAction, "Expected pending action");- pendingNavigationController && pendingNavigationController.abort();- completeNavigation(state.navigation.location, {- matches,- loaderData,- errors,- fetchers: new Map(state.fetchers)- });- } else {- updateState(_extends({- errors,- loaderData: mergeLoaderData(state.loaderData, loaderData, matches, errors)- }, didAbortFetchLoads ? {- fetchers: new Map(state.fetchers)- } : {}));- isRevalidationRequired = false;- }- }- async function handleFetcherLoader(key, routeId, path, match, matches, submission) {- let existingFetcher = state.fetchers.get(key);- let loadingFetcher = _extends({- state: "loading",- formMethod: void 0,- formAction: void 0,- formEncType: void 0,- formData: void 0- }, submission, {- data: existingFetcher && existingFetcher.data,- " _hasFetcherDoneAnything ": true- });- state.fetchers.set(key, loadingFetcher);- updateState({- fetchers: new Map(state.fetchers)- });- let abortController = new AbortController();- let fetchRequest = createClientSideRequest(init.history, path, abortController.signal);- fetchControllers.set(key, abortController);- let result = await callLoaderOrAction("loader", fetchRequest, match, matches, manifest, mapRouteProperties2, basename);- if (isDeferredResult(result)) {- result = await resolveDeferredData(result, fetchRequest.signal, true) || result;- }- if (fetchControllers.get(key) === abortController) {- fetchControllers.delete(key);- }- if (fetchRequest.signal.aborted) {- return;- }- if (isRedirectResult(result)) {- fetchRedirectIds.add(key);- await startRedirectNavigation(state, result);- return;- }- if (isErrorResult(result)) {- let boundaryMatch = findNearestBoundary(state.matches, routeId);- state.fetchers.delete(key);- updateState({- fetchers: new Map(state.fetchers),- errors: {- [boundaryMatch.route.id]: result.error- }- });- return;- }- invariant(!isDeferredResult(result), "Unhandled fetcher deferred data");- let doneFetcher = {- state: "idle",- data: result.data,- formMethod: void 0,- formAction: void 0,- formEncType: void 0,- formData: void 0,- " _hasFetcherDoneAnything ": true- };- state.fetchers.set(key, doneFetcher);- updateState({- fetchers: new Map(state.fetchers)- });- }- async function startRedirectNavigation(state2, redirect3, _temp) {- var _window;- let {- submission,- replace,- isFetchActionRedirect- } = _temp === void 0 ? {} : _temp;- if (redirect3.revalidate) {- isRevalidationRequired = true;- }- let redirectLocation = createLocation(- state2.location,- redirect3.location,- // TODO: This can be removed once we get rid of useTransition in Remix v2- _extends({- _isRedirect: true- }, isFetchActionRedirect ? {- _isFetchActionRedirect: true- } : {})- );- invariant(redirectLocation, "Expected a location on the redirect navigation");- if (ABSOLUTE_URL_REGEX.test(redirect3.location) && isBrowser && typeof ((_window = window) == null ? void 0 : _window.location) !== "undefined") {- let url = init.history.createURL(redirect3.location);- let isDifferentBasename = stripBasename(url.pathname, basename) == null;- if (window.location.origin !== url.origin || isDifferentBasename) {- if (replace) {- window.location.replace(redirect3.location);- } else {- window.location.assign(redirect3.location);- }- return;- }- }- pendingNavigationController = null;- let redirectHistoryAction = replace === true ? Action.Replace : Action.Push;- let {- formMethod,- formAction,- formEncType,- formData- } = state2.navigation;- if (!submission && formMethod && formAction && formData && formEncType) {- submission = {- formMethod,- formAction,- formEncType,- formData- };- }- if (redirectPreserveMethodStatusCodes.has(redirect3.status) && submission && isMutationMethod(submission.formMethod)) {- await startNavigation(redirectHistoryAction, redirectLocation, {- submission: _extends({}, submission, {- formAction: redirect3.location- }),- // Preserve this flag across redirects- preventScrollReset: pendingPreventScrollReset- });- } else if (isFetchActionRedirect) {- await startNavigation(redirectHistoryAction, redirectLocation, {- overrideNavigation: {- state: "loading",- location: redirectLocation,- formMethod: void 0,- formAction: void 0,- formEncType: void 0,- formData: void 0- },- fetcherSubmission: submission,- // Preserve this flag across redirects- preventScrollReset: pendingPreventScrollReset- });- } else {- await startNavigation(redirectHistoryAction, redirectLocation, {- overrideNavigation: {- state: "loading",- location: redirectLocation,- formMethod: submission ? submission.formMethod : void 0,- formAction: submission ? submission.formAction : void 0,- formEncType: submission ? submission.formEncType : void 0,- formData: submission ? submission.formData : void 0- },- // Preserve this flag across redirects- preventScrollReset: pendingPreventScrollReset- });- }- }- async function callLoadersAndMaybeResolveData(currentMatches, matches, matchesToLoad, fetchersToLoad, request) {- let results = await Promise.all([...matchesToLoad.map((match) => callLoaderOrAction("loader", request, match, matches, manifest, mapRouteProperties2, basename)), ...fetchersToLoad.map((f) => {- if (f.matches && f.match && f.controller) {- return callLoaderOrAction("loader", createClientSideRequest(init.history, f.path, f.controller.signal), f.match, f.matches, manifest, mapRouteProperties2, basename);- } else {- let error = {- type: ResultType.error,- error: getInternalRouterError(404, {- pathname: f.path- })- };- return error;- }- })]);- let loaderResults = results.slice(0, matchesToLoad.length);- let fetcherResults = results.slice(matchesToLoad.length);- await Promise.all([resolveDeferredResults(currentMatches, matchesToLoad, loaderResults, loaderResults.map(() => request.signal), false, state.loaderData), resolveDeferredResults(currentMatches, fetchersToLoad.map((f) => f.match), fetcherResults, fetchersToLoad.map((f) => f.controller ? f.controller.signal : null), true)]);- return {- results,- loaderResults,- fetcherResults- };- }- function interruptActiveLoads() {- isRevalidationRequired = true;- cancelledDeferredRoutes.push(...cancelActiveDeferreds());- fetchLoadMatches.forEach((_, key) => {- if (fetchControllers.has(key)) {- cancelledFetcherLoads.push(key);- abortFetcher(key);- }- });- }- function setFetcherError(key, routeId, error) {- let boundaryMatch = findNearestBoundary(state.matches, routeId);- deleteFetcher(key);- updateState({- errors: {- [boundaryMatch.route.id]: error- },- fetchers: new Map(state.fetchers)- });- }- function deleteFetcher(key) {- if (fetchControllers.has(key))- abortFetcher(key);- fetchLoadMatches.delete(key);- fetchReloadIds.delete(key);- fetchRedirectIds.delete(key);- state.fetchers.delete(key);- }- function abortFetcher(key) {- let controller = fetchControllers.get(key);- invariant(controller, "Expected fetch controller: " + key);- controller.abort();- fetchControllers.delete(key);- }- function markFetchersDone(keys) {- for (let key of keys) {- let fetcher = getFetcher(key);- let doneFetcher = {- state: "idle",- data: fetcher.data,- formMethod: void 0,- formAction: void 0,- formEncType: void 0,- formData: void 0,- " _hasFetcherDoneAnything ": true- };- state.fetchers.set(key, doneFetcher);- }- }- function markFetchRedirectsDone() {- let doneKeys = [];- let updatedFetchers = false;- for (let key of fetchRedirectIds) {- let fetcher = state.fetchers.get(key);- invariant(fetcher, "Expected fetcher: " + key);- if (fetcher.state === "loading") {- fetchRedirectIds.delete(key);- doneKeys.push(key);- updatedFetchers = true;- }- }- markFetchersDone(doneKeys);- return updatedFetchers;- }- function abortStaleFetchLoads(landedId) {- let yeetedKeys = [];- for (let [key, id] of fetchReloadIds) {- if (id < landedId) {- let fetcher = state.fetchers.get(key);- invariant(fetcher, "Expected fetcher: " + key);- if (fetcher.state === "loading") {- abortFetcher(key);- fetchReloadIds.delete(key);- yeetedKeys.push(key);- }- }- }- markFetchersDone(yeetedKeys);- return yeetedKeys.length > 0;- }- function getBlocker(key, fn) {- let blocker = state.blockers.get(key) || IDLE_BLOCKER;- if (blockerFunctions.get(key) !== fn) {- blockerFunctions.set(key, fn);- }- return blocker;- }- function deleteBlocker(key) {- state.blockers.delete(key);- blockerFunctions.delete(key);- }- function updateBlocker(key, newBlocker) {- let blocker = state.blockers.get(key) || IDLE_BLOCKER;- invariant(blocker.state === "unblocked" && newBlocker.state === "blocked" || blocker.state === "blocked" && newBlocker.state === "blocked" || blocker.state === "blocked" && newBlocker.state === "proceeding" || blocker.state === "blocked" && newBlocker.state === "unblocked" || blocker.state === "proceeding" && newBlocker.state === "unblocked", "Invalid blocker state transition: " + blocker.state + " -> " + newBlocker.state);- state.blockers.set(key, newBlocker);- updateState({- blockers: new Map(state.blockers)- });- }- function shouldBlockNavigation(_ref2) {- let {- currentLocation,- nextLocation,- historyAction- } = _ref2;- if (blockerFunctions.size === 0) {- return;- }- if (blockerFunctions.size > 1) {- warning(false, "A router only supports one blocker at a time");- }- let entries = Array.from(blockerFunctions.entries());- let [blockerKey, blockerFunction] = entries[entries.length - 1];- let blocker = state.blockers.get(blockerKey);- if (blocker && blocker.state === "proceeding") {- return;- }- if (blockerFunction({- currentLocation,- nextLocation,- historyAction- })) {- return blockerKey;- }- }- function cancelActiveDeferreds(predicate) {- let cancelledRouteIds = [];- activeDeferreds.forEach((dfd, routeId) => {- if (!predicate || predicate(routeId)) {- dfd.cancel();- cancelledRouteIds.push(routeId);- activeDeferreds.delete(routeId);- }- });- return cancelledRouteIds;- }- function enableScrollRestoration(positions, getPosition, getKey) {- savedScrollPositions2 = positions;- getScrollPosition = getPosition;- getScrollRestorationKey = getKey || ((location) => location.key);- if (!initialScrollRestored && state.navigation === IDLE_NAVIGATION) {- initialScrollRestored = true;- let y = getSavedScrollPosition(state.location, state.matches);- if (y != null) {- updateState({- restoreScrollPosition: y- });- }- }- return () => {- savedScrollPositions2 = null;- getScrollPosition = null;- getScrollRestorationKey = null;- };- }- function saveScrollPosition(location, matches) {- if (savedScrollPositions2 && getScrollRestorationKey && getScrollPosition) {- let userMatches = matches.map((m) => createUseMatchesMatch(m, state.loaderData));- let key = getScrollRestorationKey(location, userMatches) || location.key;- savedScrollPositions2[key] = getScrollPosition();- }- }- function getSavedScrollPosition(location, matches) {- if (savedScrollPositions2 && getScrollRestorationKey && getScrollPosition) {- let userMatches = matches.map((m) => createUseMatchesMatch(m, state.loaderData));- let key = getScrollRestorationKey(location, userMatches) || location.key;- let y = savedScrollPositions2[key];- if (typeof y === "number") {- return y;- }- }- return null;- }- function _internalSetRoutes(newRoutes) {- manifest = {};- inFlightDataRoutes = convertRoutesToDataRoutes(newRoutes, mapRouteProperties2, void 0, manifest);- }- router2 = {- get basename() {- return basename;- },- get state() {- return state;- },- get routes() {- return dataRoutes;- },- initialize,- subscribe,- enableScrollRestoration,- navigate,- fetch: fetch2,- revalidate,- // Passthrough to history-aware createHref used by useHref so we get proper- // hash-aware URLs in DOM paths- createHref: (to) => init.history.createHref(to),- encodeLocation: (to) => init.history.encodeLocation(to),- getFetcher,- deleteFetcher,- dispose,- getBlocker,- deleteBlocker,- _internalFetchControllers: fetchControllers,- _internalActiveDeferreds: activeDeferreds,- // TODO: Remove setRoutes, it's temporary to avoid dealing with- // updating the tree while validating the update algorithm.- _internalSetRoutes- };- return router2;-}-function isSubmissionNavigation(opts) {- return opts != null && "formData" in opts;-}-function normalizeTo(location, matches, basename, prependBasename, to, fromRouteId, relative) {- let contextualMatches;- let activeRouteMatch;- if (fromRouteId != null && relative !== "path") {- contextualMatches = [];- for (let match of matches) {- contextualMatches.push(match);- if (match.route.id === fromRouteId) {- activeRouteMatch = match;- break;- }- }- } else {- contextualMatches = matches;- activeRouteMatch = matches[matches.length - 1];- }- let path = resolveTo(to ? to : ".", getPathContributingMatches(contextualMatches).map((m) => m.pathnameBase), stripBasename(location.pathname, basename) || location.pathname, relative === "path");- if (to == null) {- path.search = location.search;- path.hash = location.hash;- }- if ((to == null || to === "" || to === ".") && activeRouteMatch && activeRouteMatch.route.index && !hasNakedIndexQuery(path.search)) {- path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index";- }- if (prependBasename && basename !== "/") {- path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]);- }- return createPath(path);-}-function normalizeNavigateOptions(normalizeFormMethod, isFetcher, path, opts) {- if (!opts || !isSubmissionNavigation(opts)) {- return {- path- };- }- if (opts.formMethod && !isValidMethod(opts.formMethod)) {- return {- path,- error: getInternalRouterError(405, {- method: opts.formMethod- })- };- }- let submission;- if (opts.formData) {- let formMethod = opts.formMethod || "get";- submission = {- formMethod: normalizeFormMethod ? formMethod.toUpperCase() : formMethod.toLowerCase(),- formAction: stripHashFromPath(path),- formEncType: opts && opts.formEncType || "application/x-www-form-urlencoded",- formData: opts.formData- };- if (isMutationMethod(submission.formMethod)) {- return {- path,- submission- };- }- }- let parsedPath = parsePath(path);- let searchParams = convertFormDataToSearchParams(opts.formData);- if (isFetcher && parsedPath.search && hasNakedIndexQuery(parsedPath.search)) {- searchParams.append("index", "");- }- parsedPath.search = "?" + searchParams;- return {- path: createPath(parsedPath),- submission- };-}-function getLoaderMatchesUntilBoundary(matches, boundaryId) {- let boundaryMatches = matches;- if (boundaryId) {- let index = matches.findIndex((m) => m.route.id === boundaryId);- if (index >= 0) {- boundaryMatches = matches.slice(0, index);- }- }- return boundaryMatches;-}-function getMatchesToLoad(history, state, matches, submission, location, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, fetchLoadMatches, routesToUse, basename, pendingActionData, pendingError) {- let actionResult = pendingError ? Object.values(pendingError)[0] : pendingActionData ? Object.values(pendingActionData)[0] : void 0;- let currentUrl = history.createURL(state.location);- let nextUrl = history.createURL(location);- let boundaryId = pendingError ? Object.keys(pendingError)[0] : void 0;- let boundaryMatches = getLoaderMatchesUntilBoundary(matches, boundaryId);- let navigationMatches = boundaryMatches.filter((match, index) => {- if (match.route.lazy) {- return true;- }- if (match.route.loader == null) {- return false;- }- if (isNewLoader(state.loaderData, state.matches[index], match) || cancelledDeferredRoutes.some((id) => id === match.route.id)) {- return true;- }- let currentRouteMatch = state.matches[index];- let nextRouteMatch = match;- return shouldRevalidateLoader(match, _extends({- currentUrl,- currentParams: currentRouteMatch.params,- nextUrl,- nextParams: nextRouteMatch.params- }, submission, {- actionResult,- defaultShouldRevalidate: (- // Forced revalidation due to submission, useRevalidator, or X-Remix-Revalidate- isRevalidationRequired || // Clicked the same link, resubmitted a GET form- currentUrl.pathname + currentUrl.search === nextUrl.pathname + nextUrl.search || // Search params affect all loaders- currentUrl.search !== nextUrl.search || isNewRouteInstance(currentRouteMatch, nextRouteMatch)- )- }));- });- let revalidatingFetchers = [];- fetchLoadMatches.forEach((f, key) => {- if (!matches.some((m) => m.route.id === f.routeId)) {- return;- }- let fetcherMatches = matchRoutes(routesToUse, f.path, basename);- if (!fetcherMatches) {- revalidatingFetchers.push({- key,- routeId: f.routeId,- path: f.path,- matches: null,- match: null,- controller: null- });- return;- }- let fetcherMatch = getTargetMatch(fetcherMatches, f.path);- if (cancelledFetcherLoads.includes(key)) {- revalidatingFetchers.push({- key,- routeId: f.routeId,- path: f.path,- matches: fetcherMatches,- match: fetcherMatch,- controller: new AbortController()- });- return;- }- let shouldRevalidate = shouldRevalidateLoader(fetcherMatch, _extends({- currentUrl,- currentParams: state.matches[state.matches.length - 1].params,- nextUrl,- nextParams: matches[matches.length - 1].params- }, submission, {- actionResult,- // Forced revalidation due to submission, useRevalidator, or X-Remix-Revalidate- defaultShouldRevalidate: isRevalidationRequired- }));- if (shouldRevalidate) {- revalidatingFetchers.push({- key,- routeId: f.routeId,- path: f.path,- matches: fetcherMatches,- match: fetcherMatch,- controller: new AbortController()- });- }- });- return [navigationMatches, revalidatingFetchers];-}-function isNewLoader(currentLoaderData, currentMatch, match) {- let isNew = (- // [a] -> [a, b]- !currentMatch || // [a, b] -> [a, c]- match.route.id !== currentMatch.route.id- );- let isMissingData = currentLoaderData[match.route.id] === void 0;- return isNew || isMissingData;-}-function isNewRouteInstance(currentMatch, match) {- let currentPath = currentMatch.route.path;- return (- // param change for this match, /users/123 -> /users/456- currentMatch.pathname !== match.pathname || // splat param changed, which is not present in match.path- // e.g. /files/images/avatar.jpg -> files/finances.xls- currentPath != null && currentPath.endsWith("*") && currentMatch.params["*"] !== match.params["*"]- );-}-function shouldRevalidateLoader(loaderMatch, arg) {- if (loaderMatch.route.shouldRevalidate) {- let routeChoice = loaderMatch.route.shouldRevalidate(arg);- if (typeof routeChoice === "boolean") {- return routeChoice;- }- }- return arg.defaultShouldRevalidate;-}-async function loadLazyRouteModule(route, mapRouteProperties2, manifest) {- if (!route.lazy) {- return;- }- let lazyRoute = await route.lazy();- if (!route.lazy) {- return;- }- let routeToUpdate = manifest[route.id];- invariant(routeToUpdate, "No route found in manifest");- let routeUpdates = {};- for (let lazyRouteProperty in lazyRoute) {- let staticRouteValue = routeToUpdate[lazyRouteProperty];- let isPropertyStaticallyDefined = staticRouteValue !== void 0 && // This property isn't static since it should always be updated based- // on the route updates- lazyRouteProperty !== "hasErrorBoundary";- warning(!isPropertyStaticallyDefined, 'Route "' + routeToUpdate.id + '" has a static property "' + lazyRouteProperty + '" defined but its lazy function is also returning a value for this property. ' + ('The lazy route property "' + lazyRouteProperty + '" will be ignored.'));- if (!isPropertyStaticallyDefined && !immutableRouteKeys.has(lazyRouteProperty)) {- routeUpdates[lazyRouteProperty] = lazyRoute[lazyRouteProperty];- }- }- Object.assign(routeToUpdate, routeUpdates);- Object.assign(routeToUpdate, _extends({}, mapRouteProperties2(routeToUpdate), {- lazy: void 0- }));-}-async function callLoaderOrAction(type, request, match, matches, manifest, mapRouteProperties2, basename, isStaticRequest, isRouteRequest, requestContext) {- if (isStaticRequest === void 0) {- isStaticRequest = false;- }- if (isRouteRequest === void 0) {- isRouteRequest = false;- }- let resultType;- let result;- let onReject;- let runHandler = (handler) => {- let reject;- let abortPromise = new Promise((_, r) => reject = r);- onReject = () => reject();- request.signal.addEventListener("abort", onReject);- return Promise.race([handler({- request,- params: match.params,- context: requestContext- }), abortPromise]);- };- try {- let handler = match.route[type];- if (match.route.lazy) {- if (handler) {- let values = await Promise.all([runHandler(handler), loadLazyRouteModule(match.route, mapRouteProperties2, manifest)]);- result = values[0];- } else {- await loadLazyRouteModule(match.route, mapRouteProperties2, manifest);- handler = match.route[type];- if (handler) {- result = await runHandler(handler);- } else if (type === "action") {- let url = new URL(request.url);- let pathname = url.pathname + url.search;- throw getInternalRouterError(405, {- method: request.method,- pathname,- routeId: match.route.id- });- } else {- return {- type: ResultType.data,- data: void 0- };- }- }- } else if (!handler) {- let url = new URL(request.url);- let pathname = url.pathname + url.search;- throw getInternalRouterError(404, {- pathname- });- } else {- result = await runHandler(handler);- }- invariant(result !== void 0, "You defined " + (type === "action" ? "an action" : "a loader") + " for route " + ('"' + match.route.id + "\" but didn't return anything from your `" + type + "` ") + "function. Please return a value or `null`.");- } catch (e) {- resultType = ResultType.error;- result = e;- } finally {- if (onReject) {- request.signal.removeEventListener("abort", onReject);- }- }- if (isResponse(result)) {- let status = result.status;- if (redirectStatusCodes.has(status)) {- let location = result.headers.get("Location");- invariant(location, "Redirects returned/thrown from loaders/actions must have a Location header");- if (!ABSOLUTE_URL_REGEX.test(location)) {- location = normalizeTo(new URL(request.url), matches.slice(0, matches.indexOf(match) + 1), basename, true, location);- } else if (!isStaticRequest) {- let currentUrl = new URL(request.url);- let url = location.startsWith("//") ? new URL(currentUrl.protocol + location) : new URL(location);- let isSameBasename = stripBasename(url.pathname, basename) != null;- if (url.origin === currentUrl.origin && isSameBasename) {- location = url.pathname + url.search + url.hash;- }- }- if (isStaticRequest) {- result.headers.set("Location", location);- throw result;- }- return {- type: ResultType.redirect,- status,- location,- revalidate: result.headers.get("X-Remix-Revalidate") !== null- };- }- if (isRouteRequest) {- throw {- type: resultType || ResultType.data,- response: result- };- }- let data;- let contentType = result.headers.get("Content-Type");- if (contentType && /\bapplication\/json\b/.test(contentType)) {- data = await result.json();- } else {- data = await result.text();- }- if (resultType === ResultType.error) {- return {- type: resultType,- error: new ErrorResponse(status, result.statusText, data),- headers: result.headers- };- }- return {- type: ResultType.data,- data,- statusCode: result.status,- headers: result.headers- };- }- if (resultType === ResultType.error) {- return {- type: resultType,- error: result- };- }- if (isDeferredData(result)) {- var _result$init, _result$init2;- return {- type: ResultType.deferred,- deferredData: result,- statusCode: (_result$init = result.init) == null ? void 0 : _result$init.status,- headers: ((_result$init2 = result.init) == null ? void 0 : _result$init2.headers) && new Headers(result.init.headers)- };- }- return {- type: ResultType.data,- data: result- };-}-function createClientSideRequest(history, location, signal, submission) {- let url = history.createURL(stripHashFromPath(location)).toString();- let init = {- signal- };- if (submission && isMutationMethod(submission.formMethod)) {- let {- formMethod,- formEncType,- formData- } = submission;- init.method = formMethod.toUpperCase();- init.body = formEncType === "application/x-www-form-urlencoded" ? convertFormDataToSearchParams(formData) : formData;- }- return new Request(url, init);-}-function convertFormDataToSearchParams(formData) {- let searchParams = new URLSearchParams();- for (let [key, value] of formData.entries()) {- searchParams.append(key, value instanceof File ? value.name : value);- }- return searchParams;-}-function processRouteLoaderData(matches, matchesToLoad, results, pendingError, activeDeferreds) {- let loaderData = {};- let errors = null;- let statusCode;- let foundError = false;- let loaderHeaders = {};- results.forEach((result, index) => {- let id = matchesToLoad[index].route.id;- invariant(!isRedirectResult(result), "Cannot handle redirect results in processLoaderData");- if (isErrorResult(result)) {- let boundaryMatch = findNearestBoundary(matches, id);- let error = result.error;- if (pendingError) {- error = Object.values(pendingError)[0];- pendingError = void 0;- }- errors = errors || {};- if (errors[boundaryMatch.route.id] == null) {- errors[boundaryMatch.route.id] = error;- }- loaderData[id] = void 0;- if (!foundError) {- foundError = true;- statusCode = isRouteErrorResponse(result.error) ? result.error.status : 500;- }- if (result.headers) {- loaderHeaders[id] = result.headers;- }- } else {- if (isDeferredResult(result)) {- activeDeferreds.set(id, result.deferredData);- loaderData[id] = result.deferredData.data;- } else {- loaderData[id] = result.data;- }- if (result.statusCode != null && result.statusCode !== 200 && !foundError) {- statusCode = result.statusCode;- }- if (result.headers) {- loaderHeaders[id] = result.headers;- }- }- });- if (pendingError) {- errors = pendingError;- loaderData[Object.keys(pendingError)[0]] = void 0;- }- return {- loaderData,- errors,- statusCode: statusCode || 200,- loaderHeaders- };-}-function processLoaderData(state, matches, matchesToLoad, results, pendingError, revalidatingFetchers, fetcherResults, activeDeferreds) {- let {- loaderData,- errors- } = processRouteLoaderData(matches, matchesToLoad, results, pendingError, activeDeferreds);- for (let index = 0; index < revalidatingFetchers.length; index++) {- let {- key,- match,- controller- } = revalidatingFetchers[index];- invariant(fetcherResults !== void 0 && fetcherResults[index] !== void 0, "Did not find corresponding fetcher result");- let result = fetcherResults[index];- if (controller && controller.signal.aborted) {- continue;- } else if (isErrorResult(result)) {- let boundaryMatch = findNearestBoundary(state.matches, match == null ? void 0 : match.route.id);- if (!(errors && errors[boundaryMatch.route.id])) {- errors = _extends({}, errors, {- [boundaryMatch.route.id]: result.error- });- }- state.fetchers.delete(key);- } else if (isRedirectResult(result)) {- invariant(false, "Unhandled fetcher revalidation redirect");- } else if (isDeferredResult(result)) {- invariant(false, "Unhandled fetcher deferred data");- } else {- let doneFetcher = {- state: "idle",- data: result.data,- formMethod: void 0,- formAction: void 0,- formEncType: void 0,- formData: void 0,- " _hasFetcherDoneAnything ": true- };- state.fetchers.set(key, doneFetcher);- }- }- return {- loaderData,- errors- };-}-function mergeLoaderData(loaderData, newLoaderData, matches, errors) {- let mergedLoaderData = _extends({}, newLoaderData);- for (let match of matches) {- let id = match.route.id;- if (newLoaderData.hasOwnProperty(id)) {- if (newLoaderData[id] !== void 0) {- mergedLoaderData[id] = newLoaderData[id];- }- } else if (loaderData[id] !== void 0 && match.route.loader) {- mergedLoaderData[id] = loaderData[id];- }- if (errors && errors.hasOwnProperty(id)) {- break;- }- }- return mergedLoaderData;-}-function findNearestBoundary(matches, routeId) {- let eligibleMatches = routeId ? matches.slice(0, matches.findIndex((m) => m.route.id === routeId) + 1) : [...matches];- return eligibleMatches.reverse().find((m) => m.route.hasErrorBoundary === true) || matches[0];-}-function getShortCircuitMatches(routes) {- let route = routes.find((r) => r.index || !r.path || r.path === "/") || {- id: "__shim-error-route__"- };- return {- matches: [{- params: {},- pathname: "",- pathnameBase: "",- route- }],- route- };-}-function getInternalRouterError(status, _temp4) {- let {- pathname,- routeId,- method,- type- } = _temp4 === void 0 ? {} : _temp4;- let statusText = "Unknown Server Error";- let errorMessage = "Unknown @remix-run/router error";- if (status === 400) {- statusText = "Bad Request";- if (method && pathname && routeId) {- errorMessage = "You made a " + method + ' request to "' + pathname + '" but ' + ('did not provide a `loader` for route "' + routeId + '", ') + "so there is no way to handle the request.";- } else if (type === "defer-action") {- errorMessage = "defer() is not supported in actions";- }- } else if (status === 403) {- statusText = "Forbidden";- errorMessage = 'Route "' + routeId + '" does not match URL "' + pathname + '"';- } else if (status === 404) {- statusText = "Not Found";- errorMessage = 'No route matches URL "' + pathname + '"';- } else if (status === 405) {- statusText = "Method Not Allowed";- if (method && pathname && routeId) {- errorMessage = "You made a " + method.toUpperCase() + ' request to "' + pathname + '" but ' + ('did not provide an `action` for route "' + routeId + '", ') + "so there is no way to handle the request.";- } else if (method) {- errorMessage = 'Invalid request method "' + method.toUpperCase() + '"';- }- }- return new ErrorResponse(status || 500, statusText, new Error(errorMessage), true);-}-function findRedirect(results) {- for (let i = results.length - 1; i >= 0; i--) {- let result = results[i];- if (isRedirectResult(result)) {- return result;- }- }-}-function stripHashFromPath(path) {- let parsedPath = typeof path === "string" ? parsePath(path) : path;- return createPath(_extends({}, parsedPath, {- hash: ""- }));-}-function isHashChangeOnly(a, b) {- if (a.pathname !== b.pathname || a.search !== b.search) {- return false;- }- if (a.hash === "") {- return b.hash !== "";- } else if (a.hash === b.hash) {- return true;- } else if (b.hash !== "") {- return true;- }- return false;-}-function isDeferredResult(result) {- return result.type === ResultType.deferred;-}-function isErrorResult(result) {- return result.type === ResultType.error;-}-function isRedirectResult(result) {- return (result && result.type) === ResultType.redirect;-}-function isDeferredData(value) {- let deferred = value;- return deferred && typeof deferred === "object" && typeof deferred.data === "object" && typeof deferred.subscribe === "function" && typeof deferred.cancel === "function" && typeof deferred.resolveData === "function";-}-function isResponse(value) {- return value != null && typeof value.status === "number" && typeof value.statusText === "string" && typeof value.headers === "object" && typeof value.body !== "undefined";-}-function isValidMethod(method) {- return validRequestMethods.has(method.toLowerCase());-}-function isMutationMethod(method) {- return validMutationMethods.has(method.toLowerCase());-}-async function resolveDeferredResults(currentMatches, matchesToLoad, results, signals, isFetcher, currentLoaderData) {- for (let index = 0; index < results.length; index++) {- let result = results[index];- let match = matchesToLoad[index];- if (!match) {- continue;- }- let currentMatch = currentMatches.find((m) => m.route.id === match.route.id);- let isRevalidatingLoader = currentMatch != null && !isNewRouteInstance(currentMatch, match) && (currentLoaderData && currentLoaderData[match.route.id]) !== void 0;- if (isDeferredResult(result) && (isFetcher || isRevalidatingLoader)) {- let signal = signals[index];- invariant(signal, "Expected an AbortSignal for revalidating fetcher deferred result");- await resolveDeferredData(result, signal, isFetcher).then((result2) => {- if (result2) {- results[index] = result2 || results[index];- }- });- }- }-}-async function resolveDeferredData(result, signal, unwrap) {- if (unwrap === void 0) {- unwrap = false;- }- let aborted = await result.deferredData.resolveData(signal);- if (aborted) {- return;- }- if (unwrap) {- try {- return {- type: ResultType.data,- data: result.deferredData.unwrappedData- };- } catch (e) {- return {- type: ResultType.error,- error: e- };- }- }- return {- type: ResultType.data,- data: result.deferredData.data- };-}-function hasNakedIndexQuery(search) {- return new URLSearchParams(search).getAll("index").some((v) => v === "");-}-function createUseMatchesMatch(match, loaderData) {- let {- route,- pathname,- params- } = match;- return {- id: route.id,- pathname,- params,- data: loaderData[route.id],- handle: route.handle- };-}-function getTargetMatch(matches, location) {- let search = typeof location === "string" ? parsePath(location).search : location.search;- if (matches[matches.length - 1].route.index && hasNakedIndexQuery(search || "")) {- return matches[matches.length - 1];- }- let pathMatches = getPathContributingMatches(matches);- return pathMatches[pathMatches.length - 1];-}-var Action, PopStateEventType, ResultType, immutableRouteKeys, paramRe, dynamicSegmentValue, indexRouteValue, emptySegmentValue, staticSegmentValue, splatPenalty, isSplat, joinPaths, normalizePathname, normalizeSearch, normalizeHash, AbortedDeferredError, DeferredData, redirect, ErrorResponse, validMutationMethodsArr, validMutationMethods, validRequestMethodsArr, validRequestMethods, redirectStatusCodes, redirectPreserveMethodStatusCodes, IDLE_NAVIGATION, IDLE_FETCHER, IDLE_BLOCKER, ABSOLUTE_URL_REGEX, isBrowser, isServer, defaultMapRouteProperties, UNSAFE_DEFERRED_SYMBOL;-var init_router = __esm({- "node_modules/@remix-run/router/dist/router.js"() {- init_global();- init_dirname();- init_filename();- init_buffer();- init_process();- (function(Action2) {- Action2["Pop"] = "POP";- Action2["Push"] = "PUSH";- Action2["Replace"] = "REPLACE";- })(Action || (Action = {}));- PopStateEventType = "popstate";- (function(ResultType2) {- ResultType2["data"] = "data";- ResultType2["deferred"] = "deferred";- ResultType2["redirect"] = "redirect";- ResultType2["error"] = "error";- })(ResultType || (ResultType = {}));- immutableRouteKeys = /* @__PURE__ */ new Set(["lazy", "caseSensitive", "path", "id", "index", "children"]);- paramRe = /^:\w+$/;- dynamicSegmentValue = 3;- indexRouteValue = 2;- emptySegmentValue = 1;- staticSegmentValue = 10;- splatPenalty = -2;- isSplat = (s) => s === "*";- joinPaths = (paths) => paths.join("/").replace(/\/\/+/g, "/");- normalizePathname = (pathname) => pathname.replace(/\/+$/, "").replace(/^\/*/, "/");- normalizeSearch = (search) => !search || search === "?" ? "" : search.startsWith("?") ? search : "?" + search;- normalizeHash = (hash) => !hash || hash === "#" ? "" : hash.startsWith("#") ? hash : "#" + hash;- AbortedDeferredError = class extends Error {- };- DeferredData = class {- constructor(data, responseInit) {- this.pendingKeysSet = /* @__PURE__ */ new Set();- this.subscribers = /* @__PURE__ */ new Set();- this.deferredKeys = [];- invariant(data && typeof data === "object" && !Array.isArray(data), "defer() only accepts plain objects");- let reject;- this.abortPromise = new Promise((_, r) => reject = r);- this.controller = new AbortController();- let onAbort = () => reject(new AbortedDeferredError("Deferred data aborted"));- this.unlistenAbortSignal = () => this.controller.signal.removeEventListener("abort", onAbort);- this.controller.signal.addEventListener("abort", onAbort);- this.data = Object.entries(data).reduce((acc, _ref) => {- let [key, value] = _ref;- return Object.assign(acc, {- [key]: this.trackPromise(key, value)- });- }, {});- if (this.done) {- this.unlistenAbortSignal();- }- this.init = responseInit;- }- trackPromise(key, value) {- if (!(value instanceof Promise)) {- return value;- }- this.deferredKeys.push(key);- this.pendingKeysSet.add(key);- let promise = Promise.race([value, this.abortPromise]).then((data) => this.onSettle(promise, key, null, data), (error) => this.onSettle(promise, key, error));- promise.catch(() => {- });- Object.defineProperty(promise, "_tracked", {- get: () => true- });- return promise;- }- onSettle(promise, key, error, data) {- if (this.controller.signal.aborted && error instanceof AbortedDeferredError) {- this.unlistenAbortSignal();- Object.defineProperty(promise, "_error", {- get: () => error- });- return Promise.reject(error);- }- this.pendingKeysSet.delete(key);- if (this.done) {- this.unlistenAbortSignal();- }- if (error) {- Object.defineProperty(promise, "_error", {- get: () => error- });- this.emit(false, key);- return Promise.reject(error);- }- Object.defineProperty(promise, "_data", {- get: () => data- });- this.emit(false, key);- return data;- }- emit(aborted, settledKey) {- this.subscribers.forEach((subscriber) => subscriber(aborted, settledKey));- }- subscribe(fn) {- this.subscribers.add(fn);- return () => this.subscribers.delete(fn);- }- cancel() {- this.controller.abort();- this.pendingKeysSet.forEach((v, k) => this.pendingKeysSet.delete(k));- this.emit(true);- }- async resolveData(signal) {- let aborted = false;- if (!this.done) {- let onAbort = () => this.cancel();- signal.addEventListener("abort", onAbort);- aborted = await new Promise((resolve) => {- this.subscribe((aborted2) => {- signal.removeEventListener("abort", onAbort);- if (aborted2 || this.done) {- resolve(aborted2);- }- });- });- }- return aborted;- }- get done() {- return this.pendingKeysSet.size === 0;- }- get unwrappedData() {- invariant(this.data !== null && this.done, "Can only unwrap data on initialized and settled deferreds");- return Object.entries(this.data).reduce((acc, _ref2) => {- let [key, value] = _ref2;- return Object.assign(acc, {- [key]: unwrapTrackedPromise(value)- });- }, {});- }- get pendingKeys() {- return Array.from(this.pendingKeysSet);- }- };- redirect = function redirect2(url, init) {- if (init === void 0) {- init = 302;- }- let responseInit = init;- if (typeof responseInit === "number") {- responseInit = {- status: responseInit- };- } else if (typeof responseInit.status === "undefined") {- responseInit.status = 302;- }- let headers = new Headers(responseInit.headers);- headers.set("Location", url);- return new Response(null, _extends({}, responseInit, {- headers- }));- };- ErrorResponse = class {- constructor(status, statusText, data, internal) {- if (internal === void 0) {- internal = false;- }- this.status = status;- this.statusText = statusText || "";- this.internal = internal;- if (data instanceof Error) {- this.data = data.toString();- this.error = data;- } else {- this.data = data;- }- }- };- validMutationMethodsArr = ["post", "put", "patch", "delete"];- validMutationMethods = new Set(validMutationMethodsArr);- validRequestMethodsArr = ["get", ...validMutationMethodsArr];- validRequestMethods = new Set(validRequestMethodsArr);- redirectStatusCodes = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);- redirectPreserveMethodStatusCodes = /* @__PURE__ */ new Set([307, 308]);- IDLE_NAVIGATION = {- state: "idle",- location: void 0,- formMethod: void 0,- formAction: void 0,- formEncType: void 0,- formData: void 0- };- IDLE_FETCHER = {- state: "idle",- data: void 0,- formMethod: void 0,- formAction: void 0,- formEncType: void 0,- formData: void 0- };- IDLE_BLOCKER = {- state: "unblocked",- proceed: void 0,- reset: void 0,- location: void 0- };- ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;- isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";- isServer = !isBrowser;- defaultMapRouteProperties = (route) => ({- hasErrorBoundary: Boolean(route.hasErrorBoundary)- });- UNSAFE_DEFERRED_SYMBOL = Symbol("deferred");- }-});--// node_modules/react-router/dist/index.js-function _extends2() {- _extends2 = Object.assign ? Object.assign.bind() : function(target) {- for (var i = 1; i < arguments.length; i++) {- var source = arguments[i];- for (var key in source) {- if (Object.prototype.hasOwnProperty.call(source, key)) {- target[key] = source[key];- }- }- }- return target;- };- return _extends2.apply(this, arguments);-}-function useHref(to, _temp) {- let {- relative- } = _temp === void 0 ? {} : _temp;- !useInRouterContext() ? true ? invariant(- false,- // TODO: This error is probably because they somehow have 2 versions of the- // router loaded. We can help them understand how to avoid that.- "useHref() may be used only in the context of a <Router> component."- ) : invariant(false) : void 0;- let {- basename,- navigator- } = React.useContext(NavigationContext);- let {- hash,- pathname,- search- } = useResolvedPath(to, {- relative- });- let joinedPathname = pathname;- if (basename !== "/") {- joinedPathname = pathname === "/" ? basename : joinPaths([basename, pathname]);- }- return navigator.createHref({- pathname: joinedPathname,- search,- hash- });-}-function useInRouterContext() {- return React.useContext(LocationContext) != null;-}-function useLocation() {- !useInRouterContext() ? true ? invariant(- false,- // TODO: This error is probably because they somehow have 2 versions of the- // router loaded. We can help them understand how to avoid that.- "useLocation() may be used only in the context of a <Router> component."- ) : invariant(false) : void 0;- return React.useContext(LocationContext).location;-}-function useIsomorphicLayoutEffect(cb) {- let isStatic = React.useContext(NavigationContext).static;- if (!isStatic) {- React.useLayoutEffect(cb);- }-}-function useNavigate() {- let {- isDataRoute- } = React.useContext(RouteContext);- return isDataRoute ? useNavigateStable() : useNavigateUnstable();-}-function useNavigateUnstable() {- !useInRouterContext() ? true ? invariant(- false,- // TODO: This error is probably because they somehow have 2 versions of the- // router loaded. We can help them understand how to avoid that.- "useNavigate() may be used only in the context of a <Router> component."- ) : invariant(false) : void 0;- let dataRouterContext = React.useContext(DataRouterContext);- let {- basename,- navigator- } = React.useContext(NavigationContext);- let {- matches- } = React.useContext(RouteContext);- let {- pathname: locationPathname- } = useLocation();- let routePathnamesJson = JSON.stringify(getPathContributingMatches(matches).map((match) => match.pathnameBase));- let activeRef = React.useRef(false);- useIsomorphicLayoutEffect(() => {- activeRef.current = true;- });- let navigate = React.useCallback(function(to, options) {- if (options === void 0) {- options = {};- }- true ? warning(activeRef.current, navigateEffectWarning) : void 0;- if (!activeRef.current)- return;- if (typeof to === "number") {- navigator.go(to);- return;- }- let path = resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, options.relative === "path");- if (dataRouterContext == null && basename !== "/") {- path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]);- }- (!!options.replace ? navigator.replace : navigator.push)(path, options.state, options);- }, [basename, navigator, routePathnamesJson, locationPathname, dataRouterContext]);- return navigate;-}-function useOutlet(context) {- let outlet = React.useContext(RouteContext).outlet;- if (outlet) {- return /* @__PURE__ */ React.createElement(OutletContext.Provider, {- value: context- }, outlet);- }- return outlet;-}-function useResolvedPath(to, _temp2) {- let {- relative- } = _temp2 === void 0 ? {} : _temp2;- let {- matches- } = React.useContext(RouteContext);- let {- pathname: locationPathname- } = useLocation();- let routePathnamesJson = JSON.stringify(getPathContributingMatches(matches).map((match) => match.pathnameBase));- return React.useMemo(() => resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, relative === "path"), [to, routePathnamesJson, locationPathname, relative]);-}-function useRoutesImpl(routes, locationArg, dataRouterState) {- !useInRouterContext() ? true ? invariant(- false,- // TODO: This error is probably because they somehow have 2 versions of the- // router loaded. We can help them understand how to avoid that.- "useRoutes() may be used only in the context of a <Router> component."- ) : invariant(false) : void 0;- let {- navigator- } = React.useContext(NavigationContext);- let {- matches: parentMatches- } = React.useContext(RouteContext);- let routeMatch = parentMatches[parentMatches.length - 1];- let parentParams = routeMatch ? routeMatch.params : {};- let parentPathname = routeMatch ? routeMatch.pathname : "/";- let parentPathnameBase = routeMatch ? routeMatch.pathnameBase : "/";- let parentRoute = routeMatch && routeMatch.route;- if (true) {- let parentPath = parentRoute && parentRoute.path || "";- warningOnce(parentPathname, !parentRoute || parentPath.endsWith("*"), "You rendered descendant <Routes> (or called `useRoutes()`) at " + ('"' + parentPathname + '" (under <Route path="' + parentPath + '">) but the ') + `parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.--` + ('Please change the parent <Route path="' + parentPath + '"> to <Route ') + ('path="' + (parentPath === "/" ? "*" : parentPath + "/*") + '">.'));- }- let locationFromContext = useLocation();- let location;- if (locationArg) {- var _parsedLocationArg$pa;- let parsedLocationArg = typeof locationArg === "string" ? parsePath(locationArg) : locationArg;- !(parentPathnameBase === "/" || ((_parsedLocationArg$pa = parsedLocationArg.pathname) == null ? void 0 : _parsedLocationArg$pa.startsWith(parentPathnameBase))) ? true ? invariant(false, "When overriding the location using `<Routes location>` or `useRoutes(routes, location)`, the location pathname must begin with the portion of the URL pathname that was " + ('matched by all parent routes. The current pathname base is "' + parentPathnameBase + '" ') + ('but pathname "' + parsedLocationArg.pathname + '" was given in the `location` prop.')) : invariant(false) : void 0;- location = parsedLocationArg;- } else {- location = locationFromContext;- }- let pathname = location.pathname || "/";- let remainingPathname = parentPathnameBase === "/" ? pathname : pathname.slice(parentPathnameBase.length) || "/";- let matches = matchRoutes(routes, {- pathname: remainingPathname- });- if (true) {- true ? warning(parentRoute || matches != null, 'No routes matched location "' + location.pathname + location.search + location.hash + '" ') : void 0;- true ? warning(matches == null || matches[matches.length - 1].route.element !== void 0 || matches[matches.length - 1].route.Component !== void 0, 'Matched leaf route at location "' + location.pathname + location.search + location.hash + '" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.') : void 0;- }- let renderedMatches = _renderMatches(matches && matches.map((match) => Object.assign({}, match, {- params: Object.assign({}, parentParams, match.params),- pathname: joinPaths([- parentPathnameBase,- // Re-encode pathnames that were decoded inside matchRoutes- navigator.encodeLocation ? navigator.encodeLocation(match.pathname).pathname : match.pathname- ]),- pathnameBase: match.pathnameBase === "/" ? parentPathnameBase : joinPaths([- parentPathnameBase,- // Re-encode pathnames that were decoded inside matchRoutes- navigator.encodeLocation ? navigator.encodeLocation(match.pathnameBase).pathname : match.pathnameBase- ])- })), parentMatches, dataRouterState);- if (locationArg && renderedMatches) {- return /* @__PURE__ */ React.createElement(LocationContext.Provider, {- value: {- location: _extends2({- pathname: "/",- search: "",- hash: "",- state: null,- key: "default"- }, location),- navigationType: Action.Pop- }- }, renderedMatches);- }- return renderedMatches;-}-function DefaultErrorComponent() {- let error = useRouteError();- let message = isRouteErrorResponse(error) ? error.status + " " + error.statusText : error instanceof Error ? error.message : JSON.stringify(error);- let stack = error instanceof Error ? error.stack : null;- let lightgrey = "rgba(200,200,200, 0.5)";- let preStyles = {- padding: "0.5rem",- backgroundColor: lightgrey- };- let codeStyles = {- padding: "2px 4px",- backgroundColor: lightgrey- };- let devInfo = null;- if (true) {- console.error("Error handled by React Router default ErrorBoundary:", error);- devInfo = /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", null, "\u{1F4BF} Hey developer \u{1F44B}"), /* @__PURE__ */ React.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ React.createElement("code", {- style: codeStyles- }, "ErrorBoundary"), " or", " ", /* @__PURE__ */ React.createElement("code", {- style: codeStyles- }, "errorElement"), " prop on your route."));- }- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ React.createElement("h3", {- style: {- fontStyle: "italic"- }- }, message), stack ? /* @__PURE__ */ React.createElement("pre", {- style: preStyles- }, stack) : null, devInfo);-}-function RenderedRoute(_ref) {- let {- routeContext,- match,- children- } = _ref;- let dataRouterContext = React.useContext(DataRouterContext);- if (dataRouterContext && dataRouterContext.static && dataRouterContext.staticContext && (match.route.errorElement || match.route.ErrorBoundary)) {- dataRouterContext.staticContext._deepestRenderedBoundaryId = match.route.id;- }- return /* @__PURE__ */ React.createElement(RouteContext.Provider, {- value: routeContext- }, children);-}-function _renderMatches(matches, parentMatches, dataRouterState) {- var _dataRouterState2;- if (parentMatches === void 0) {- parentMatches = [];- }- if (dataRouterState === void 0) {- dataRouterState = null;- }- if (matches == null) {- var _dataRouterState;- if ((_dataRouterState = dataRouterState) != null && _dataRouterState.errors) {- matches = dataRouterState.matches;- } else {- return null;- }- }- let renderedMatches = matches;- let errors = (_dataRouterState2 = dataRouterState) == null ? void 0 : _dataRouterState2.errors;- if (errors != null) {- let errorIndex = renderedMatches.findIndex((m) => m.route.id && (errors == null ? void 0 : errors[m.route.id]));- !(errorIndex >= 0) ? true ? invariant(false, "Could not find a matching route for errors on route IDs: " + Object.keys(errors).join(",")) : invariant(false) : void 0;- renderedMatches = renderedMatches.slice(0, Math.min(renderedMatches.length, errorIndex + 1));- }- return renderedMatches.reduceRight((outlet, match, index) => {- let error = match.route.id ? errors == null ? void 0 : errors[match.route.id] : null;- let errorElement = null;- if (dataRouterState) {- errorElement = match.route.errorElement || defaultErrorElement;- }- let matches2 = parentMatches.concat(renderedMatches.slice(0, index + 1));- let getChildren = () => {- let children;- if (error) {- children = errorElement;- } else if (match.route.Component) {- children = /* @__PURE__ */ React.createElement(match.route.Component, null);- } else if (match.route.element) {- children = match.route.element;- } else {- children = outlet;- }- return /* @__PURE__ */ React.createElement(RenderedRoute, {- match,- routeContext: {- outlet,- matches: matches2,- isDataRoute: dataRouterState != null- },- children- });- };- return dataRouterState && (match.route.ErrorBoundary || match.route.errorElement || index === 0) ? /* @__PURE__ */ React.createElement(RenderErrorBoundary, {- location: dataRouterState.location,- revalidation: dataRouterState.revalidation,- component: errorElement,- error,- children: getChildren(),- routeContext: {- outlet: null,- matches: matches2,- isDataRoute: true- }- }) : getChildren();- }, null);-}-function getDataRouterConsoleError(hookName) {- return hookName + " must be used within a data router. See https://reactrouter.com/routers/picking-a-router.";-}-function useDataRouterContext(hookName) {- let ctx = React.useContext(DataRouterContext);- !ctx ? true ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;- return ctx;-}-function useDataRouterState(hookName) {- let state = React.useContext(DataRouterStateContext);- !state ? true ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;- return state;-}-function useRouteContext(hookName) {- let route = React.useContext(RouteContext);- !route ? true ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;- return route;-}-function useCurrentRouteId(hookName) {- let route = useRouteContext(hookName);- let thisRoute = route.matches[route.matches.length - 1];- !thisRoute.route.id ? true ? invariant(false, hookName + ' can only be used on routes that contain a unique "id"') : invariant(false) : void 0;- return thisRoute.route.id;-}-function useRouteId() {- return useCurrentRouteId(DataRouterStateHook.UseRouteId);-}-function useNavigation() {- let state = useDataRouterState(DataRouterStateHook.UseNavigation);- return state.navigation;-}-function useMatches() {- let {- matches,- loaderData- } = useDataRouterState(DataRouterStateHook.UseMatches);- return React.useMemo(() => matches.map((match) => {- let {- pathname,- params- } = match;- return {- id: match.route.id,- pathname,- params,- data: loaderData[match.route.id],- handle: match.route.handle- };- }), [matches, loaderData]);-}-function useRouteError() {- var _state$errors;- let error = React.useContext(RouteErrorContext);- let state = useDataRouterState(DataRouterStateHook.UseRouteError);- let routeId = useCurrentRouteId(DataRouterStateHook.UseRouteError);- if (error) {- return error;- }- return (_state$errors = state.errors) == null ? void 0 : _state$errors[routeId];-}-function useAsyncValue() {- let value = React.useContext(AwaitContext);- return value == null ? void 0 : value._data;-}-function useAsyncError() {- let value = React.useContext(AwaitContext);- return value == null ? void 0 : value._error;-}-function useNavigateStable() {- let {- router: router2- } = useDataRouterContext(DataRouterHook.UseNavigateStable);- let id = useCurrentRouteId(DataRouterStateHook.UseNavigateStable);- let activeRef = React.useRef(false);- useIsomorphicLayoutEffect(() => {- activeRef.current = true;- });- let navigate = React.useCallback(function(to, options) {- if (options === void 0) {- options = {};- }- true ? warning(activeRef.current, navigateEffectWarning) : void 0;- if (!activeRef.current)- return;- if (typeof to === "number") {- router2.navigate(to);- } else {- router2.navigate(to, _extends2({- fromRouteId: id- }, options));- }- }, [router2, id]);- return navigate;-}-function warningOnce(key, cond, message) {- if (!cond && !alreadyWarned[key]) {- alreadyWarned[key] = true;- true ? warning(false, message) : void 0;- }-}-function RouterProvider(_ref) {- let {- fallbackElement,- router: router2- } = _ref;- let [state, setState] = React.useState(router2.state);- React.useLayoutEffect(() => router2.subscribe(setState), [router2, setState]);- let navigator = React.useMemo(() => {- return {- createHref: router2.createHref,- encodeLocation: router2.encodeLocation,- go: (n) => router2.navigate(n),- push: (to, state2, opts) => router2.navigate(to, {- state: state2,- preventScrollReset: opts == null ? void 0 : opts.preventScrollReset- }),- replace: (to, state2, opts) => router2.navigate(to, {- replace: true,- state: state2,- preventScrollReset: opts == null ? void 0 : opts.preventScrollReset- })- };- }, [router2]);- let basename = router2.basename || "/";- let dataRouterContext = React.useMemo(() => ({- router: router2,- navigator,- static: false,- basename- }), [router2, navigator, basename]);- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(DataRouterContext.Provider, {- value: dataRouterContext- }, /* @__PURE__ */ React.createElement(DataRouterStateContext.Provider, {- value: state- }, /* @__PURE__ */ React.createElement(Router, {- basename: router2.basename,- location: router2.state.location,- navigationType: router2.state.historyAction,- navigator- }, router2.state.initialized ? /* @__PURE__ */ React.createElement(DataRoutes, {- routes: router2.routes,- state- }) : fallbackElement))), null);-}-function DataRoutes(_ref2) {- let {- routes,- state- } = _ref2;- return useRoutesImpl(routes, void 0, state);-}-function Outlet(props) {- return useOutlet(props.context);-}-function Router(_ref5) {- let {- basename: basenameProp = "/",- children = null,- location: locationProp,- navigationType = Action.Pop,- navigator,- static: staticProp = false- } = _ref5;- !!useInRouterContext() ? true ? invariant(false, "You cannot render a <Router> inside another <Router>. You should never have more than one in your app.") : invariant(false) : void 0;- let basename = basenameProp.replace(/^\/*/, "/");- let navigationContext = React.useMemo(() => ({- basename,- navigator,- static: staticProp- }), [basename, navigator, staticProp]);- if (typeof locationProp === "string") {- locationProp = parsePath(locationProp);- }- let {- pathname = "/",- search = "",- hash = "",- state = null,- key = "default"- } = locationProp;- let locationContext = React.useMemo(() => {- let trailingPathname = stripBasename(pathname, basename);- if (trailingPathname == null) {- return null;- }- return {- location: {- pathname: trailingPathname,- search,- hash,- state,- key- },- navigationType- };- }, [basename, pathname, search, hash, state, key, navigationType]);- true ? warning(locationContext != null, '<Router basename="' + basename + '"> is not able to match the URL ' + ('"' + pathname + search + hash + '" because it does not start with the ') + "basename, so the <Router> won't render anything.") : void 0;- if (locationContext == null) {- return null;- }- return /* @__PURE__ */ React.createElement(NavigationContext.Provider, {- value: navigationContext- }, /* @__PURE__ */ React.createElement(LocationContext.Provider, {- children,- value: locationContext- }));-}-function Await(_ref7) {- let {- children,- errorElement,- resolve- } = _ref7;- return /* @__PURE__ */ React.createElement(AwaitErrorBoundary, {- resolve,- errorElement- }, /* @__PURE__ */ React.createElement(ResolveAwait, null, children));-}-function ResolveAwait(_ref8) {- let {- children- } = _ref8;- let data = useAsyncValue();- let toRender = typeof children === "function" ? children(data) : children;- return /* @__PURE__ */ React.createElement(React.Fragment, null, toRender);-}-function mapRouteProperties(route) {- let updates = {- // Note: this check also occurs in createRoutesFromChildren so update- // there if you change this -- please and thank you!- hasErrorBoundary: route.ErrorBoundary != null || route.errorElement != null- };- if (route.Component) {- if (true) {- if (route.element) {- true ? warning(false, "You should not include both `Component` and `element` on your route - `Component` will be used.") : void 0;- }- }- Object.assign(updates, {- element: /* @__PURE__ */ React.createElement(route.Component),- Component: void 0- });- }- if (route.ErrorBoundary) {- if (true) {- if (route.errorElement) {- true ? warning(false, "You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used.") : void 0;- }- }- Object.assign(updates, {- errorElement: /* @__PURE__ */ React.createElement(route.ErrorBoundary),- ErrorBoundary: void 0- });- }- return updates;-}-var React, DataRouterContext, DataRouterStateContext, AwaitContext, NavigationContext, LocationContext, RouteContext, RouteErrorContext, navigateEffectWarning, OutletContext, defaultErrorElement, RenderErrorBoundary, DataRouterHook, DataRouterStateHook, alreadyWarned, AwaitRenderStatus, neverSettledPromise, AwaitErrorBoundary;-var init_dist = __esm({- "node_modules/react-router/dist/index.js"() {- init_global();- init_dirname();- init_filename();- init_buffer();- init_process();- React = __toESM(require_react());- init_router();- init_router();- DataRouterContext = /* @__PURE__ */ React.createContext(null);- if (true) {- DataRouterContext.displayName = "DataRouter";- }- DataRouterStateContext = /* @__PURE__ */ React.createContext(null);- if (true) {- DataRouterStateContext.displayName = "DataRouterState";- }- AwaitContext = /* @__PURE__ */ React.createContext(null);- if (true) {- AwaitContext.displayName = "Await";- }- NavigationContext = /* @__PURE__ */ React.createContext(null);- if (true) {- NavigationContext.displayName = "Navigation";- }- LocationContext = /* @__PURE__ */ React.createContext(null);- if (true) {- LocationContext.displayName = "Location";- }- RouteContext = /* @__PURE__ */ React.createContext({- outlet: null,- matches: [],- isDataRoute: false- });- if (true) {- RouteContext.displayName = "Route";- }- RouteErrorContext = /* @__PURE__ */ React.createContext(null);- if (true) {- RouteErrorContext.displayName = "RouteError";- }- navigateEffectWarning = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";- OutletContext = /* @__PURE__ */ React.createContext(null);- defaultErrorElement = /* @__PURE__ */ React.createElement(DefaultErrorComponent, null);- RenderErrorBoundary = class extends React.Component {- constructor(props) {- super(props);- this.state = {- location: props.location,- revalidation: props.revalidation,- error: props.error- };- }- static getDerivedStateFromError(error) {- return {- error- };- }- static getDerivedStateFromProps(props, state) {- if (state.location !== props.location || state.revalidation !== "idle" && props.revalidation === "idle") {- return {- error: props.error,- location: props.location,- revalidation: props.revalidation- };- }- return {- error: props.error || state.error,- location: state.location,- revalidation: props.revalidation || state.revalidation- };- }- componentDidCatch(error, errorInfo) {- console.error("React Router caught the following error during render", error, errorInfo);- }- render() {- return this.state.error ? /* @__PURE__ */ React.createElement(RouteContext.Provider, {- value: this.props.routeContext- }, /* @__PURE__ */ React.createElement(RouteErrorContext.Provider, {- value: this.state.error,- children: this.props.component- })) : this.props.children;- }- };- (function(DataRouterHook3) {- DataRouterHook3["UseBlocker"] = "useBlocker";- DataRouterHook3["UseRevalidator"] = "useRevalidator";- DataRouterHook3["UseNavigateStable"] = "useNavigate";- })(DataRouterHook || (DataRouterHook = {}));- (function(DataRouterStateHook3) {- DataRouterStateHook3["UseBlocker"] = "useBlocker";- DataRouterStateHook3["UseLoaderData"] = "useLoaderData";- DataRouterStateHook3["UseActionData"] = "useActionData";- DataRouterStateHook3["UseRouteError"] = "useRouteError";- DataRouterStateHook3["UseNavigation"] = "useNavigation";- DataRouterStateHook3["UseRouteLoaderData"] = "useRouteLoaderData";- DataRouterStateHook3["UseMatches"] = "useMatches";- DataRouterStateHook3["UseRevalidator"] = "useRevalidator";- DataRouterStateHook3["UseNavigateStable"] = "useNavigate";- DataRouterStateHook3["UseRouteId"] = "useRouteId";- })(DataRouterStateHook || (DataRouterStateHook = {}));- alreadyWarned = {};- (function(AwaitRenderStatus2) {- AwaitRenderStatus2[AwaitRenderStatus2["pending"] = 0] = "pending";- AwaitRenderStatus2[AwaitRenderStatus2["success"] = 1] = "success";- AwaitRenderStatus2[AwaitRenderStatus2["error"] = 2] = "error";- })(AwaitRenderStatus || (AwaitRenderStatus = {}));- neverSettledPromise = new Promise(() => {- });- AwaitErrorBoundary = class extends React.Component {- constructor(props) {- super(props);- this.state = {- error: null- };- }- static getDerivedStateFromError(error) {- return {- error- };- }- componentDidCatch(error, errorInfo) {- console.error("<Await> caught the following error during render", error, errorInfo);- }- render() {- let {- children,- errorElement,- resolve- } = this.props;- let promise = null;- let status = AwaitRenderStatus.pending;- if (!(resolve instanceof Promise)) {- status = AwaitRenderStatus.success;- promise = Promise.resolve();- Object.defineProperty(promise, "_tracked", {- get: () => true- });- Object.defineProperty(promise, "_data", {- get: () => resolve- });- } else if (this.state.error) {- status = AwaitRenderStatus.error;- let renderError = this.state.error;- promise = Promise.reject().catch(() => {- });- Object.defineProperty(promise, "_tracked", {- get: () => true- });- Object.defineProperty(promise, "_error", {- get: () => renderError- });- } else if (resolve._tracked) {- promise = resolve;- status = promise._error !== void 0 ? AwaitRenderStatus.error : promise._data !== void 0 ? AwaitRenderStatus.success : AwaitRenderStatus.pending;- } else {- status = AwaitRenderStatus.pending;- Object.defineProperty(resolve, "_tracked", {- get: () => true- });- promise = resolve.then((data) => Object.defineProperty(resolve, "_data", {- get: () => data- }), (error) => Object.defineProperty(resolve, "_error", {- get: () => error- }));- }- if (status === AwaitRenderStatus.error && promise._error instanceof AbortedDeferredError) {- throw neverSettledPromise;- }- if (status === AwaitRenderStatus.error && !errorElement) {- throw promise._error;- }- if (status === AwaitRenderStatus.error) {- return /* @__PURE__ */ React.createElement(AwaitContext.Provider, {- value: promise,- children: errorElement- });- }- if (status === AwaitRenderStatus.success) {- return /* @__PURE__ */ React.createElement(AwaitContext.Provider, {- value: promise,- children- });- }- throw promise;- }- };- }-});--// node_modules/react-router-dom/dist/index.js-function _extends3() {- _extends3 = Object.assign ? Object.assign.bind() : function(target) {- for (var i = 1; i < arguments.length; i++) {- var source = arguments[i];- for (var key in source) {- if (Object.prototype.hasOwnProperty.call(source, key)) {- target[key] = source[key];- }- }- }- return target;- };- return _extends3.apply(this, arguments);-}-function _objectWithoutPropertiesLoose(source, excluded) {- if (source == null)- return {};- var target = {};- var sourceKeys = Object.keys(source);- var key, i;- for (i = 0; i < sourceKeys.length; i++) {- key = sourceKeys[i];- if (excluded.indexOf(key) >= 0)- continue;- target[key] = source[key];- }- return target;-}-function isHtmlElement(object) {- return object != null && typeof object.tagName === "string";-}-function isButtonElement(object) {- return isHtmlElement(object) && object.tagName.toLowerCase() === "button";-}-function isFormElement(object) {- return isHtmlElement(object) && object.tagName.toLowerCase() === "form";-}-function isInputElement(object) {- return isHtmlElement(object) && object.tagName.toLowerCase() === "input";-}-function isModifiedEvent(event) {- return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);-}-function shouldProcessLinkClick(event, target) {- return event.button === 0 && // Ignore everything but left clicks- (!target || target === "_self") && // Let browser handle "target=_blank" etc.- !isModifiedEvent(event);-}-function getFormSubmissionInfo(target, options, basename) {- let method;- let action = null;- let encType;- let formData;- if (isFormElement(target)) {- let submissionTrigger = options.submissionTrigger;- if (options.action) {- action = options.action;- } else {- let attr = target.getAttribute("action");- action = attr ? stripBasename(attr, basename) : null;- }- method = options.method || target.getAttribute("method") || defaultMethod;- encType = options.encType || target.getAttribute("enctype") || defaultEncType;- formData = new FormData(target);- if (submissionTrigger && submissionTrigger.name) {- formData.append(submissionTrigger.name, submissionTrigger.value);- }- } else if (isButtonElement(target) || isInputElement(target) && (target.type === "submit" || target.type === "image")) {- let form = target.form;- if (form == null) {- throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');- }- if (options.action) {- action = options.action;- } else {- let attr = target.getAttribute("formaction") || form.getAttribute("action");- action = attr ? stripBasename(attr, basename) : null;- }- method = options.method || target.getAttribute("formmethod") || form.getAttribute("method") || defaultMethod;- encType = options.encType || target.getAttribute("formenctype") || form.getAttribute("enctype") || defaultEncType;- formData = new FormData(form);- if (target.name) {- formData.append(target.name, target.value);- }- } else if (isHtmlElement(target)) {- throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');- } else {- method = options.method || defaultMethod;- action = options.action || null;- encType = options.encType || defaultEncType;- if (target instanceof FormData) {- formData = target;- } else {- formData = new FormData();- if (target instanceof URLSearchParams) {- for (let [name, value] of target) {- formData.append(name, value);- }- } else if (target != null) {- for (let name of Object.keys(target)) {- formData.append(name, target[name]);- }- }- }- }- return {- action,- method: method.toLowerCase(),- encType,- formData- };-}-function createBrowserRouter(routes, opts) {- return createRouter({- basename: opts == null ? void 0 : opts.basename,- future: _extends3({}, opts == null ? void 0 : opts.future, {- v7_prependBasename: true- }),- history: createBrowserHistory({- window: opts == null ? void 0 : opts.window- }),- hydrationData: (opts == null ? void 0 : opts.hydrationData) || parseHydrationData(),- routes,- mapRouteProperties- }).initialize();-}-function parseHydrationData() {- var _window;- let state = (_window = window) == null ? void 0 : _window.__staticRouterHydrationData;- if (state && state.errors) {- state = _extends3({}, state, {- errors: deserializeErrors(state.errors)- });- }- return state;-}-function deserializeErrors(errors) {- if (!errors)- return null;- let entries = Object.entries(errors);- let serialized = {};- for (let [key, val] of entries) {- if (val && val.__type === "RouteErrorResponse") {- serialized[key] = new ErrorResponse(val.status, val.statusText, val.data, val.internal === true);- } else if (val && val.__type === "Error") {- let error = new Error(val.message);- error.stack = "";- serialized[key] = error;- } else {- serialized[key] = val;- }- }- return serialized;-}-function HistoryRouter(_ref3) {- let {- basename,- children,- history- } = _ref3;- const [state, setState] = React2.useState({- action: history.action,- location: history.location- });- React2.useLayoutEffect(() => history.listen(setState), [history]);- return /* @__PURE__ */ React2.createElement(Router, {- basename,- children,- location: state.location,- navigationType: state.action,- navigator: history- });-}-function ScrollRestoration(_ref7) {- let {- getKey,- storageKey- } = _ref7;- useScrollRestoration({- getKey,- storageKey- });- return null;-}-function getDataRouterConsoleError2(hookName) {- return hookName + " must be used within a data router. See https://reactrouter.com/routers/picking-a-router.";-}-function useDataRouterContext2(hookName) {- let ctx = React2.useContext(DataRouterContext);- !ctx ? true ? invariant(false, getDataRouterConsoleError2(hookName)) : invariant(false) : void 0;- return ctx;-}-function useDataRouterState2(hookName) {- let state = React2.useContext(DataRouterStateContext);- !state ? true ? invariant(false, getDataRouterConsoleError2(hookName)) : invariant(false) : void 0;- return state;-}-function useLinkClickHandler(to, _temp) {- let {- target,- replace: replaceProp,- state,- preventScrollReset,- relative- } = _temp === void 0 ? {} : _temp;- let navigate = useNavigate();- let location = useLocation();- let path = useResolvedPath(to, {- relative- });- return React2.useCallback((event) => {- if (shouldProcessLinkClick(event, target)) {- event.preventDefault();- let replace = replaceProp !== void 0 ? replaceProp : createPath(location) === createPath(path);- navigate(to, {- replace,- state,- preventScrollReset,- relative- });- }- }, [location, navigate, path, replaceProp, state, target, to, preventScrollReset, relative]);-}-function useSubmitImpl(fetcherKey, fetcherRouteId) {- let {- router: router2- } = useDataRouterContext2(DataRouterHook2.UseSubmitImpl);- let {- basename- } = React2.useContext(NavigationContext);- let currentRouteId = useRouteId();- return React2.useCallback(function(target, options) {- if (options === void 0) {- options = {};- }- if (typeof document === "undefined") {- throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.");- }- let {- action,- method,- encType,- formData- } = getFormSubmissionInfo(target, options, basename);- let opts = {- preventScrollReset: options.preventScrollReset,- formData,- formMethod: method,- formEncType: encType- };- if (fetcherKey) {- !(fetcherRouteId != null) ? true ? invariant(false, "No routeId available for useFetcher()") : invariant(false) : void 0;- router2.fetch(fetcherKey, fetcherRouteId, action, opts);- } else {- router2.navigate(action, _extends3({}, opts, {- replace: options.replace,- fromRouteId: currentRouteId- }));- }- }, [router2, basename, fetcherKey, fetcherRouteId, currentRouteId]);-}-function useFormAction(action, _temp2) {- let {- relative- } = _temp2 === void 0 ? {} : _temp2;- let {- basename- } = React2.useContext(NavigationContext);- let routeContext = React2.useContext(RouteContext);- !routeContext ? true ? invariant(false, "useFormAction must be used inside a RouteContext") : invariant(false) : void 0;- let [match] = routeContext.matches.slice(-1);- let path = _extends3({}, useResolvedPath(action ? action : ".", {- relative- }));- let location = useLocation();- if (action == null) {- path.search = location.search;- path.hash = location.hash;- if (match.route.index) {- let params = new URLSearchParams(path.search);- params.delete("index");- path.search = params.toString() ? "?" + params.toString() : "";- }- }- if ((!action || action === ".") && match.route.index) {- path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index";- }- if (basename !== "/") {- path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]);- }- return createPath(path);-}-function useScrollRestoration(_temp3) {- let {- getKey,- storageKey- } = _temp3 === void 0 ? {} : _temp3;- let {- router: router2- } = useDataRouterContext2(DataRouterHook2.UseScrollRestoration);- let {- restoreScrollPosition,- preventScrollReset- } = useDataRouterState2(DataRouterStateHook2.UseScrollRestoration);- let location = useLocation();- let matches = useMatches();- let navigation = useNavigation();- React2.useEffect(() => {- window.history.scrollRestoration = "manual";- return () => {- window.history.scrollRestoration = "auto";- };- }, []);- usePageHide(React2.useCallback(() => {- if (navigation.state === "idle") {- let key = (getKey ? getKey(location, matches) : null) || location.key;- savedScrollPositions[key] = window.scrollY;- }- sessionStorage.setItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY, JSON.stringify(savedScrollPositions));- window.history.scrollRestoration = "auto";- }, [storageKey, getKey, navigation.state, location, matches]));- if (typeof document !== "undefined") {- React2.useLayoutEffect(() => {- try {- let sessionPositions = sessionStorage.getItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY);- if (sessionPositions) {- savedScrollPositions = JSON.parse(sessionPositions);- }- } catch (e) {- }- }, [storageKey]);- React2.useLayoutEffect(() => {- let disableScrollRestoration = router2 == null ? void 0 : router2.enableScrollRestoration(savedScrollPositions, () => window.scrollY, getKey);- return () => disableScrollRestoration && disableScrollRestoration();- }, [router2, getKey]);- React2.useLayoutEffect(() => {- if (restoreScrollPosition === false) {- return;- }- if (typeof restoreScrollPosition === "number") {- window.scrollTo(0, restoreScrollPosition);- return;- }- if (location.hash) {- let el = document.getElementById(location.hash.slice(1));- if (el) {- el.scrollIntoView();- return;- }- }- if (preventScrollReset === true) {- return;- }- window.scrollTo(0, 0);- }, [location, restoreScrollPosition, preventScrollReset]);- }-}-function usePageHide(callback, options) {- let {- capture- } = options || {};- React2.useEffect(() => {- let opts = capture != null ? {- capture- } : void 0;- window.addEventListener("pagehide", callback, opts);- return () => {- window.removeEventListener("pagehide", callback, opts);- };- }, [callback, capture]);-}-var React2, defaultMethod, defaultEncType, _excluded, _excluded2, _excluded3, isBrowser2, ABSOLUTE_URL_REGEX2, Link, NavLink, Form, FormImpl, DataRouterHook2, DataRouterStateHook2, SCROLL_RESTORATION_STORAGE_KEY, savedScrollPositions;-var init_dist2 = __esm({- "node_modules/react-router-dom/dist/index.js"() {- init_global();- init_dirname();- init_filename();- init_buffer();- init_process();- React2 = __toESM(require_react());- init_dist();- init_dist();- init_router();- defaultMethod = "get";- defaultEncType = "application/x-www-form-urlencoded";- _excluded = ["onClick", "relative", "reloadDocument", "replace", "state", "target", "to", "preventScrollReset"];- _excluded2 = ["aria-current", "caseSensitive", "className", "end", "style", "to", "children"];- _excluded3 = ["reloadDocument", "replace", "method", "action", "onSubmit", "fetcherKey", "routeId", "relative", "preventScrollReset"];- if (true) {- HistoryRouter.displayName = "unstable_HistoryRouter";- }- isBrowser2 = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";- ABSOLUTE_URL_REGEX2 = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;- Link = /* @__PURE__ */ React2.forwardRef(function LinkWithRef(_ref4, ref) {- let {- onClick,- relative,- reloadDocument,- replace,- state,- target,- to,- preventScrollReset- } = _ref4, rest = _objectWithoutPropertiesLoose(_ref4, _excluded);- let {- basename- } = React2.useContext(NavigationContext);- let absoluteHref;- let isExternal = false;- if (typeof to === "string" && ABSOLUTE_URL_REGEX2.test(to)) {- absoluteHref = to;- if (isBrowser2) {- try {- let currentUrl = new URL(window.location.href);- let targetUrl = to.startsWith("//") ? new URL(currentUrl.protocol + to) : new URL(to);- let path = stripBasename(targetUrl.pathname, basename);- if (targetUrl.origin === currentUrl.origin && path != null) {- to = path + targetUrl.search + targetUrl.hash;- } else {- isExternal = true;- }- } catch (e) {- true ? warning(false, '<Link to="' + to + '"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.') : void 0;- }- }- }- let href = useHref(to, {- relative- });- let internalOnClick = useLinkClickHandler(to, {- replace,- state,- target,- preventScrollReset,- relative- });- function handleClick(event) {- if (onClick)- onClick(event);- if (!event.defaultPrevented) {- internalOnClick(event);- }- }- return (- // eslint-disable-next-line jsx-a11y/anchor-has-content- /* @__PURE__ */ React2.createElement("a", _extends3({}, rest, {- href: absoluteHref || href,- onClick: isExternal || reloadDocument ? onClick : handleClick,- ref,- target- }))- );- });- if (true) {- Link.displayName = "Link";- }- NavLink = /* @__PURE__ */ React2.forwardRef(function NavLinkWithRef(_ref5, ref) {- let {- "aria-current": ariaCurrentProp = "page",- caseSensitive = false,- className: classNameProp = "",- end = false,- style: styleProp,- to,- children- } = _ref5, rest = _objectWithoutPropertiesLoose(_ref5, _excluded2);- let path = useResolvedPath(to, {- relative: rest.relative- });- let location = useLocation();- let routerState = React2.useContext(DataRouterStateContext);- let {- navigator- } = React2.useContext(NavigationContext);- let toPathname = navigator.encodeLocation ? navigator.encodeLocation(path).pathname : path.pathname;- let locationPathname = location.pathname;- let nextLocationPathname = routerState && routerState.navigation && routerState.navigation.location ? routerState.navigation.location.pathname : null;- if (!caseSensitive) {- locationPathname = locationPathname.toLowerCase();- nextLocationPathname = nextLocationPathname ? nextLocationPathname.toLowerCase() : null;- toPathname = toPathname.toLowerCase();- }- let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(toPathname.length) === "/";- let isPending = nextLocationPathname != null && (nextLocationPathname === toPathname || !end && nextLocationPathname.startsWith(toPathname) && nextLocationPathname.charAt(toPathname.length) === "/");- let ariaCurrent = isActive ? ariaCurrentProp : void 0;- let className;- if (typeof classNameProp === "function") {- className = classNameProp({- isActive,- isPending- });- } else {- className = [classNameProp, isActive ? "active" : null, isPending ? "pending" : null].filter(Boolean).join(" ");- }- let style = typeof styleProp === "function" ? styleProp({- isActive,- isPending- }) : styleProp;- return /* @__PURE__ */ React2.createElement(Link, _extends3({}, rest, {- "aria-current": ariaCurrent,- className,- ref,- style,- to- }), typeof children === "function" ? children({- isActive,- isPending- }) : children);- });- if (true) {- NavLink.displayName = "NavLink";- }- Form = /* @__PURE__ */ React2.forwardRef((props, ref) => {- return /* @__PURE__ */ React2.createElement(FormImpl, _extends3({}, props, {- ref- }));- });- if (true) {- Form.displayName = "Form";- }- FormImpl = /* @__PURE__ */ React2.forwardRef((_ref6, forwardedRef) => {- let {- reloadDocument,- replace,- method = defaultMethod,- action,- onSubmit,- fetcherKey,- routeId,- relative,- preventScrollReset- } = _ref6, props = _objectWithoutPropertiesLoose(_ref6, _excluded3);- let submit = useSubmitImpl(fetcherKey, routeId);- let formMethod = method.toLowerCase() === "get" ? "get" : "post";- let formAction = useFormAction(action, {- relative- });- let submitHandler = (event) => {- onSubmit && onSubmit(event);- if (event.defaultPrevented)- return;- event.preventDefault();- let submitter = event.nativeEvent.submitter;- let submitMethod = (submitter == null ? void 0 : submitter.getAttribute("formmethod")) || method;- submit(submitter || event.currentTarget, {- method: submitMethod,- replace,- relative,- preventScrollReset- });- };- return /* @__PURE__ */ React2.createElement("form", _extends3({- ref: forwardedRef,- method: formMethod,- action: formAction,- onSubmit: reloadDocument ? onSubmit : submitHandler- }, props));- });- if (true) {- FormImpl.displayName = "FormImpl";- }- if (true) {- ScrollRestoration.displayName = "ScrollRestoration";- }- (function(DataRouterHook3) {- DataRouterHook3["UseScrollRestoration"] = "useScrollRestoration";- DataRouterHook3["UseSubmitImpl"] = "useSubmitImpl";- DataRouterHook3["UseFetcher"] = "useFetcher";- })(DataRouterHook2 || (DataRouterHook2 = {}));- (function(DataRouterStateHook3) {- DataRouterStateHook3["UseFetchers"] = "useFetchers";- DataRouterStateHook3["UseScrollRestoration"] = "useScrollRestoration";- })(DataRouterStateHook2 || (DataRouterStateHook2 = {}));- SCROLL_RESTORATION_STORAGE_KEY = "react-router-scroll-positions";- savedScrollPositions = {};- }-});--// node_modules/@remix-run/react/dist/esm/browser.js-init_global();-init_dirname();-init_filename();-init_buffer();-init_process();-var React5 = __toESM(require_react());-init_dist2();--// node_modules/@remix-run/react/dist/esm/components.js-init_global();-init_dirname();-init_filename();-init_buffer();-init_process();--// node_modules/@remix-run/react/dist/esm/_virtual/_rollupPluginBabelHelpers.js-init_global();-init_dirname();-init_filename();-init_buffer();-init_process();-function _extends4() {- _extends4 = Object.assign ? Object.assign.bind() : function(target) {- for (var i = 1; i < arguments.length; i++) {- var source = arguments[i];- for (var key in source) {- if (Object.prototype.hasOwnProperty.call(source, key)) {- target[key] = source[key];- }- }- }- return target;- };- return _extends4.apply(this, arguments);-}--// node_modules/@remix-run/react/dist/esm/components.js-var React3 = __toESM(require_react());-init_dist2();--// node_modules/@remix-run/react/dist/esm/errorBoundaries.js-init_global();-init_dirname();-init_filename();-init_buffer();-init_process();-var import_react = __toESM(require_react());-init_dist2();-var RemixErrorBoundary = class extends import_react.default.Component {- constructor(props) {- super(props);- this.state = {- error: props.error || null,- location: props.location- };- }- static getDerivedStateFromError(error) {- return {- error- };- }- static getDerivedStateFromProps(props, state) {- if (state.location !== props.location) {- return {- error: props.error || null,- location: props.location- };- }- return {- error: props.error || state.error,- location: state.location- };- }- render() {- if (this.state.error) {- return /* @__PURE__ */ import_react.default.createElement(this.props.component, {- error: this.state.error- });- } else {- return this.props.children;- }- }-};-function RemixRootDefaultErrorBoundary({- error-}) {- console.error(error);- return /* @__PURE__ */ import_react.default.createElement("html", {- lang: "en"- }, /* @__PURE__ */ import_react.default.createElement("head", null, /* @__PURE__ */ import_react.default.createElement("meta", {- charSet: "utf-8"- }), /* @__PURE__ */ import_react.default.createElement("meta", {- name: "viewport",- content: "width=device-width, initial-scale=1, viewport-fit=cover"- }), /* @__PURE__ */ import_react.default.createElement("title", null, "Application Error!")), /* @__PURE__ */ import_react.default.createElement("body", null, /* @__PURE__ */ import_react.default.createElement("main", {- style: {- fontFamily: "system-ui, sans-serif",- padding: "2rem"- }- }, /* @__PURE__ */ import_react.default.createElement("h1", {- style: {- fontSize: "24px"- }- }, "Application Error"), /* @__PURE__ */ import_react.default.createElement("pre", {- style: {- padding: "2rem",- background: "hsla(10, 50%, 50%, 0.1)",- color: "red",- overflow: "auto"- }- }, error.stack)), /* @__PURE__ */ import_react.default.createElement("script", {- dangerouslySetInnerHTML: {- __html: `- console.log(- "\u{1F4BF} Hey developer\u{1F44B}. You can provide a way better UX than this when your app throws errors. Check out https://remix.run/guides/errors for more information."- );- `- }- })));-}-function V2_RemixRootDefaultErrorBoundary() {- let error = useRouteError();- if (isRouteErrorResponse(error)) {- return /* @__PURE__ */ import_react.default.createElement(RemixRootDefaultCatchBoundaryImpl, {- caught: error- });- } else if (error instanceof Error) {- return /* @__PURE__ */ import_react.default.createElement(RemixRootDefaultErrorBoundary, {- error- });- } else {- let errorString = error == null ? "Unknown Error" : typeof error === "object" && "toString" in error ? error.toString() : JSON.stringify(error);- return /* @__PURE__ */ import_react.default.createElement(RemixRootDefaultErrorBoundary, {- error: new Error(errorString)- });- }-}-var RemixCatchContext = /* @__PURE__ */ import_react.default.createContext(void 0);-function useCatch() {- return (0, import_react.useContext)(RemixCatchContext);-}-function RemixCatchBoundary({- catch: catchVal,- component: Component2,- children-}) {- if (catchVal) {- return /* @__PURE__ */ import_react.default.createElement(RemixCatchContext.Provider, {- value: catchVal- }, /* @__PURE__ */ import_react.default.createElement(Component2, null));- }- return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, children);-}-function RemixRootDefaultCatchBoundary() {- let caught = useCatch();- return /* @__PURE__ */ import_react.default.createElement(RemixRootDefaultCatchBoundaryImpl, {- caught- });-}-function RemixRootDefaultCatchBoundaryImpl({- caught-}) {- return /* @__PURE__ */ import_react.default.createElement("html", {- lang: "en"- }, /* @__PURE__ */ import_react.default.createElement("head", null, /* @__PURE__ */ import_react.default.createElement("meta", {- charSet: "utf-8"- }), /* @__PURE__ */ import_react.default.createElement("meta", {- name: "viewport",- content: "width=device-width, initial-scale=1, viewport-fit=cover"- }), /* @__PURE__ */ import_react.default.createElement("title", null, "Unhandled Thrown Response!")), /* @__PURE__ */ import_react.default.createElement("body", null, /* @__PURE__ */ import_react.default.createElement("h1", {- style: {- fontFamily: "system-ui, sans-serif",- padding: "2rem"- }- }, caught.status, " ", caught.statusText), /* @__PURE__ */ import_react.default.createElement("script", {- dangerouslySetInnerHTML: {- __html: `- console.log(- "\u{1F4BF} Hey developer\u{1F44B}. You can provide a way better UX than this when your app throws 404s (and other responses). Check out https://remix.run/guides/not-found for more information."- );- `- }- })));-}--// node_modules/@remix-run/react/dist/esm/invariant.js-init_global();-init_dirname();-init_filename();-init_buffer();-init_process();-function invariant2(value, message) {- if (value === false || value === null || typeof value === "undefined") {- throw new Error(message);- }-}--// node_modules/@remix-run/react/dist/esm/links.js-init_global();-init_dirname();-init_filename();-init_buffer();-init_process();-init_dist2();--// node_modules/@remix-run/react/dist/esm/routeModules.js-init_global();-init_dirname();-init_filename();-init_buffer();-init_process();-async function loadRouteModule(route, routeModulesCache) {- if (route.id in routeModulesCache) {- return routeModulesCache[route.id];- }- try {- let routeModule = await import(- /* webpackIgnore: true */- route.module- );- routeModulesCache[route.id] = routeModule;- return routeModule;- } catch (error) {- window.location.reload();- return new Promise(() => {- });- }-}--// node_modules/@remix-run/react/dist/esm/links.js-function getLinksForMatches(matches, routeModules, manifest) {- let descriptors = matches.map((match) => {- var _module$links;- let module = routeModules[match.route.id];- return ((_module$links = module.links) === null || _module$links === void 0 ? void 0 : _module$links.call(module)) || [];- }).flat(1);- let preloads = getCurrentPageModulePreloadHrefs(matches, manifest);- return dedupe(descriptors, preloads);-}-async function prefetchStyleLinks(routeModule) {- if (!routeModule.links)- return;- let descriptors = routeModule.links();- if (!descriptors)- return;- let styleLinks = [];- for (let descriptor of descriptors) {- if (!isPageLinkDescriptor(descriptor) && descriptor.rel === "stylesheet") {- styleLinks.push({- ...descriptor,- rel: "preload",- as: "style"- });- }- }- let matchingLinks = styleLinks.filter((link) => !link.media || window.matchMedia(link.media).matches);- await Promise.all(matchingLinks.map(prefetchStyleLink));-}-async function prefetchStyleLink(descriptor) {- return new Promise((resolve) => {- let link = document.createElement("link");- Object.assign(link, descriptor);- function removeLink() {- if (document.head.contains(link)) {- document.head.removeChild(link);- }- }- link.onload = () => {- removeLink();- resolve();- };- link.onerror = () => {- removeLink();- resolve();- };- document.head.appendChild(link);- });-}-function isPageLinkDescriptor(object) {- return object != null && typeof object.page === "string";-}-function isHtmlLinkDescriptor(object) {- if (object == null)- return false;- if (object.href == null) {- return object.rel === "preload" && (typeof object.imageSrcSet === "string" || typeof object.imagesrcset === "string") && (typeof object.imageSizes === "string" || typeof object.imagesizes === "string");- }- return typeof object.rel === "string" && typeof object.href === "string";-}-async function getStylesheetPrefetchLinks(matches, manifest, routeModules) {- let links = await Promise.all(matches.map(async (match) => {- let mod = await loadRouteModule(manifest.routes[match.route.id], routeModules);- return mod.links ? mod.links() : [];- }));- return links.flat(1).filter(isHtmlLinkDescriptor).filter((link) => link.rel === "stylesheet" || link.rel === "preload").map((link) => link.rel === "preload" ? {- ...link,- rel: "prefetch"- } : {- ...link,- rel: "prefetch",- as: "style"- });-}-function getNewMatchesForLinks(page, nextMatches, currentMatches, manifest, location, mode) {- let path = parsePathPatch(page);- let isNew = (match, index) => {- if (!currentMatches[index])- return true;- return match.route.id !== currentMatches[index].route.id;- };- let matchPathChanged = (match, index) => {- var _currentMatches$index;- return (- // param change, /users/123 -> /users/456- currentMatches[index].pathname !== match.pathname || // splat param changed, which is not present in match.path- // e.g. /files/images/avatar.jpg -> files/finances.xls- ((_currentMatches$index = currentMatches[index].route.path) === null || _currentMatches$index === void 0 ? void 0 : _currentMatches$index.endsWith("*")) && currentMatches[index].params["*"] !== match.params["*"]- );- };- let newMatches = mode === "data" && location.search !== path.search ? (- // this is really similar to stuff in transition.ts, maybe somebody smarter- // than me (or in less of a hurry) can share some of it. You're the best.- nextMatches.filter((match, index) => {- let manifestRoute = manifest.routes[match.route.id];- if (!manifestRoute.hasLoader) {- return false;- }- if (isNew(match, index) || matchPathChanged(match, index)) {- return true;- }- if (match.route.shouldRevalidate) {- var _currentMatches$;- let routeChoice = match.route.shouldRevalidate({- currentUrl: new URL(location.pathname + location.search + location.hash, window.origin),- currentParams: ((_currentMatches$ = currentMatches[0]) === null || _currentMatches$ === void 0 ? void 0 : _currentMatches$.params) || {},- nextUrl: new URL(page, window.origin),- nextParams: match.params,- defaultShouldRevalidate: true- });- if (typeof routeChoice === "boolean") {- return routeChoice;- }- }- return true;- })- ) : nextMatches.filter((match, index) => {- let manifestRoute = manifest.routes[match.route.id];- return (mode === "assets" || manifestRoute.hasLoader) && (isNew(match, index) || matchPathChanged(match, index));- });- return newMatches;-}-function getDataLinkHrefs(page, matches, manifest) {- let path = parsePathPatch(page);- return dedupeHrefs(matches.filter((match) => manifest.routes[match.route.id].hasLoader).map((match) => {- let {- pathname,- search- } = path;- let searchParams = new URLSearchParams(search);- searchParams.set("_data", match.route.id);- return `${pathname}?${searchParams}`;- }));-}-function getModuleLinkHrefs(matches, manifestPatch) {- return dedupeHrefs(matches.map((match) => {- let route = manifestPatch.routes[match.route.id];- let hrefs = [route.module];- if (route.imports) {- hrefs = hrefs.concat(route.imports);- }- return hrefs;- }).flat(1));-}-function getCurrentPageModulePreloadHrefs(matches, manifest) {- return dedupeHrefs(matches.map((match) => {- let route = manifest.routes[match.route.id];- let hrefs = [route.module];- if (route.imports) {- hrefs = hrefs.concat(route.imports);- }- return hrefs;- }).flat(1));-}-function dedupeHrefs(hrefs) {- return [...new Set(hrefs)];-}-function dedupe(descriptors, preloads) {- let set = /* @__PURE__ */ new Set();- let preloadsSet = new Set(preloads);- return descriptors.reduce((deduped, descriptor) => {- let alreadyModulePreload = !isPageLinkDescriptor(descriptor) && descriptor.as === "script" && descriptor.href && preloadsSet.has(descriptor.href);- if (alreadyModulePreload) {- return deduped;- }- let str = JSON.stringify(descriptor);- if (!set.has(str)) {- set.add(str);- deduped.push(descriptor);- }- return deduped;- }, []);-}-function parsePathPatch(href) {- let path = parsePath(href);- if (path.search === void 0)- path.search = "";- return path;-}--// node_modules/@remix-run/react/dist/esm/markup.js-init_global();-init_dirname();-init_filename();-init_buffer();-init_process();-var ESCAPE_LOOKUP = {- "&": "\\u0026",- ">": "\\u003e",- "<": "\\u003c",- "\u2028": "\\u2028",- "\u2029": "\\u2029"-};-var ESCAPE_REGEX = /[&><\u2028\u2029]/g;-function escapeHtml(html) {- return html.replace(ESCAPE_REGEX, (match) => ESCAPE_LOOKUP[match]);-}-function createHtml(html) {- return {- __html: html- };-}--// node_modules/@remix-run/react/dist/esm/warnings.js-init_global();-init_dirname();-init_filename();-init_buffer();-init_process();-var alreadyWarned2 = {};-function logDeprecationOnce(message, key = message) {- if (!alreadyWarned2[key]) {- alreadyWarned2[key] = true;- console.warn(message);- }-}--// node_modules/@remix-run/react/dist/esm/components.js-function useDataRouterContext3() {- let context = React3.useContext(DataRouterContext);- invariant2(context, "You must render this element inside a <DataRouterContext.Provider> element");- return context;-}-function useDataRouterStateContext() {- let context = React3.useContext(DataRouterStateContext);- invariant2(context, "You must render this element inside a <DataRouterStateContext.Provider> element");- return context;-}-var RemixContext = /* @__PURE__ */ React3.createContext(void 0);-RemixContext.displayName = "Remix";-function useRemixContext() {- let context = React3.useContext(RemixContext);- invariant2(context, "You must render this element inside a <Remix> element");- return context;-}-function RemixRoute({- id-}) {- let {- routeModules,- future- } = useRemixContext();- invariant2(routeModules, "Cannot initialize 'routeModules'. This normally occurs when you have server code in your client modules.\nCheck this link for more details:\nhttps://remix.run/pages/gotchas#server-code-in-client-bundles");- let {- default: Component2,- ErrorBoundary,- CatchBoundary- } = routeModules[id];- if (!Component2 && (ErrorBoundary || !future.v2_errorBoundary && CatchBoundary)) {- Component2 = Outlet;- }- invariant2(Component2, `Route "${id}" has no component! Please go add a \`default\` export in the route module file.-If you were trying to navigate or submit to a resource route, use \`<a>\` instead of \`<Link>\` or \`<Form reloadDocument>\`.`);- return /* @__PURE__ */ React3.createElement(Component2, null);-}-function RemixRouteError({- id-}) {- let {- future,- routeModules- } = useRemixContext();- invariant2(routeModules, "Cannot initialize 'routeModules'. This normally occurs when you have server code in your client modules.\nCheck this link for more details:\nhttps://remix.run/pages/gotchas#server-code-in-client-bundles");- let error = useRouteError();- let {- CatchBoundary,- ErrorBoundary- } = routeModules[id];- if (future.v2_errorBoundary) {- if (id === "root") {- ErrorBoundary || (ErrorBoundary = V2_RemixRootDefaultErrorBoundary);- }- if (ErrorBoundary) {- return /* @__PURE__ */ React3.createElement(ErrorBoundary, null);- }- throw error;- }- if (id === "root") {- CatchBoundary || (CatchBoundary = RemixRootDefaultCatchBoundary);- ErrorBoundary || (ErrorBoundary = RemixRootDefaultErrorBoundary);- }- if (isRouteErrorResponse(error)) {- let tError = error;- if ((tError === null || tError === void 0 ? void 0 : tError.error) instanceof Error && tError.status !== 404 && ErrorBoundary) {- return /* @__PURE__ */ React3.createElement(ErrorBoundary, {- error: tError.error- });- }- if (CatchBoundary) {- return /* @__PURE__ */ React3.createElement(RemixCatchBoundary, {- component: CatchBoundary,- catch: error- });- }- }- if (error instanceof Error && ErrorBoundary) {- return /* @__PURE__ */ React3.createElement(ErrorBoundary, {- error- });- }- throw error;-}-function usePrefetchBehavior(prefetch, theirElementProps) {- let [maybePrefetch, setMaybePrefetch] = React3.useState(false);- let [shouldPrefetch, setShouldPrefetch] = React3.useState(false);- let {- onFocus,- onBlur,- onMouseEnter,- onMouseLeave,- onTouchStart- } = theirElementProps;- React3.useEffect(() => {- if (prefetch === "render") {- setShouldPrefetch(true);- }- }, [prefetch]);- let setIntent = () => {- if (prefetch === "intent") {- setMaybePrefetch(true);- }- };- let cancelIntent = () => {- if (prefetch === "intent") {- setMaybePrefetch(false);- setShouldPrefetch(false);- }- };- React3.useEffect(() => {- if (maybePrefetch) {- let id = setTimeout(() => {- setShouldPrefetch(true);- }, 100);- return () => {- clearTimeout(id);- };- }- }, [maybePrefetch]);- return [shouldPrefetch, {- onFocus: composeEventHandlers(onFocus, setIntent),- onBlur: composeEventHandlers(onBlur, cancelIntent),- onMouseEnter: composeEventHandlers(onMouseEnter, setIntent),- onMouseLeave: composeEventHandlers(onMouseLeave, cancelIntent),- onTouchStart: composeEventHandlers(onTouchStart, setIntent)- }];-}-var ABSOLUTE_URL_REGEX3 = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;-var NavLink2 = /* @__PURE__ */ React3.forwardRef(({- to,- prefetch = "none",- ...props-}, forwardedRef) => {- let isAbsolute = typeof to === "string" && ABSOLUTE_URL_REGEX3.test(to);- let href = useHref(to);- let [shouldPrefetch, prefetchHandlers] = usePrefetchBehavior(prefetch, props);- return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(NavLink, _extends4({- ref: forwardedRef,- to- }, props, prefetchHandlers)), shouldPrefetch && !isAbsolute ? /* @__PURE__ */ React3.createElement(PrefetchPageLinks, {- page: href- }) : null);-});-NavLink2.displayName = "NavLink";-var Link2 = /* @__PURE__ */ React3.forwardRef(({- to,- prefetch = "none",- ...props-}, forwardedRef) => {- let isAbsolute = typeof to === "string" && ABSOLUTE_URL_REGEX3.test(to);- let href = useHref(to);- let [shouldPrefetch, prefetchHandlers] = usePrefetchBehavior(prefetch, props);- return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(Link, _extends4({- ref: forwardedRef,- to- }, props, prefetchHandlers)), shouldPrefetch && !isAbsolute ? /* @__PURE__ */ React3.createElement(PrefetchPageLinks, {- page: href- }) : null);-});-Link2.displayName = "Link";-function composeEventHandlers(theirHandler, ourHandler) {- return (event) => {- theirHandler && theirHandler(event);- if (!event.defaultPrevented) {- ourHandler(event);- }- };-}-var linksWarning = "\u26A0\uFE0F REMIX FUTURE CHANGE: The behavior of links `imagesizes` and `imagesrcset` will be changing in v2. Only the React camel case versions will be valid. Please change to `imageSizes` and `imageSrcSet`.For instructions on making this change see https://remix.run/docs/en/v1.15.0/pages/v2#links-imagesizes-and-imagesrcset";-function Links() {- let {- manifest,- routeModules- } = useRemixContext();- let {- errors,- matches: routerMatches- } = useDataRouterStateContext();- let matches = errors ? routerMatches.slice(0, routerMatches.findIndex((m) => errors[m.route.id]) + 1) : routerMatches;- let links = React3.useMemo(() => getLinksForMatches(matches, routeModules, manifest), [matches, routeModules, manifest]);- React3.useEffect(() => {- if (links.some((link) => "imagesizes" in link || "imagesrcset" in link)) {- logDeprecationOnce(linksWarning);- }- }, [links]);- return /* @__PURE__ */ React3.createElement(React3.Fragment, null, links.map((link) => {- if (isPageLinkDescriptor(link)) {- return /* @__PURE__ */ React3.createElement(PrefetchPageLinks, _extends4({- key: link.page- }, link));- }- let imageSrcSet = null;- if ("useId" in React3) {- if (link.imagesrcset) {- link.imageSrcSet = imageSrcSet = link.imagesrcset;- delete link.imagesrcset;- }- if (link.imagesizes) {- link.imageSizes = link.imagesizes;- delete link.imagesizes;- }- } else {- if (link.imageSrcSet) {- link.imagesrcset = imageSrcSet = link.imageSrcSet;- delete link.imageSrcSet;- }- if (link.imageSizes) {- link.imagesizes = link.imageSizes;- delete link.imageSizes;- }- }- return /* @__PURE__ */ React3.createElement("link", _extends4({- key: link.rel + (link.href || "") + (imageSrcSet || "")- }, link));- }));-}-function PrefetchPageLinks({- page,- ...dataLinkProps-}) {- let {- router: router2- } = useDataRouterContext3();- let matches = React3.useMemo(() => matchRoutes(router2.routes, page), [router2.routes, page]);- if (!matches) {- console.warn(`Tried to prefetch ${page} but no routes matched.`);- return null;- }- return /* @__PURE__ */ React3.createElement(PrefetchPageLinksImpl, _extends4({- page,- matches- }, dataLinkProps));-}-function usePrefetchedStylesheets(matches) {- let {- manifest,- routeModules- } = useRemixContext();- let [styleLinks, setStyleLinks] = React3.useState([]);- React3.useEffect(() => {- let interrupted = false;- getStylesheetPrefetchLinks(matches, manifest, routeModules).then((links) => {- if (!interrupted)- setStyleLinks(links);- });- return () => {- interrupted = true;- };- }, [matches, manifest, routeModules]);- return styleLinks;-}-function PrefetchPageLinksImpl({- page,- matches: nextMatches,- ...linkProps-}) {- let location = useLocation();- let {- manifest- } = useRemixContext();- let {- matches- } = useDataRouterStateContext();- let newMatchesForData = React3.useMemo(() => getNewMatchesForLinks(page, nextMatches, matches, manifest, location, "data"), [page, nextMatches, matches, manifest, location]);- let newMatchesForAssets = React3.useMemo(() => getNewMatchesForLinks(page, nextMatches, matches, manifest, location, "assets"), [page, nextMatches, matches, manifest, location]);- let dataHrefs = React3.useMemo(() => getDataLinkHrefs(page, newMatchesForData, manifest), [newMatchesForData, page, manifest]);- let moduleHrefs = React3.useMemo(() => getModuleLinkHrefs(newMatchesForAssets, manifest), [newMatchesForAssets, manifest]);- let styleLinks = usePrefetchedStylesheets(newMatchesForAssets);- return /* @__PURE__ */ React3.createElement(React3.Fragment, null, dataHrefs.map((href) => /* @__PURE__ */ React3.createElement("link", _extends4({- key: href,- rel: "prefetch",- as: "fetch",- href- }, linkProps))), moduleHrefs.map((href) => /* @__PURE__ */ React3.createElement("link", _extends4({- key: href,- rel: "modulepreload",- href- }, linkProps))), styleLinks.map((link) => (- // these don't spread `linkProps` because they are full link descriptors- // already with their own props- /* @__PURE__ */ React3.createElement("link", _extends4({- key: link.href- }, link))- )));-}-function V1Meta() {- let {- routeModules- } = useRemixContext();- let {- errors,- matches: routerMatches,- loaderData- } = useDataRouterStateContext();- let location = useLocation();- let matches = errors ? routerMatches.slice(0, routerMatches.findIndex((m) => errors[m.route.id]) + 1) : routerMatches;- let meta = {};- let parentsData = {};- for (let match of matches) {- let routeId = match.route.id;- let data = loaderData[routeId];- let params = match.params;- let routeModule = routeModules[routeId];- if (routeModule.meta) {- let routeMeta = typeof routeModule.meta === "function" ? routeModule.meta({- data,- parentsData,- params,- location- }) : routeModule.meta;- if (routeMeta && Array.isArray(routeMeta)) {- throw new Error(- "The route at " + match.route.path + " returns an array. This is only supported with the `v2_meta` future flag in the Remix config. Either set the flag to `true` or update the route's meta function to return an object.\n\nTo reference the v1 meta function API, see https://remix.run/route/meta"- // TODO: Add link to the docs once they are written- // + "\n\nTo reference future flags and the v2 meta API, see https://remix.run/file-conventions/remix-config#future-v2-meta."- );- }- Object.assign(meta, routeMeta);- }- parentsData[routeId] = data;- }- return /* @__PURE__ */ React3.createElement(React3.Fragment, null, Object.entries(meta).map(([name, value]) => {- if (!value) {- return null;- }- if (["charset", "charSet"].includes(name)) {- return /* @__PURE__ */ React3.createElement("meta", {- key: "charSet",- charSet: value- });- }- if (name === "title") {- return /* @__PURE__ */ React3.createElement("title", {- key: "title"- }, String(value));- }- let isOpenGraphTag = /^(og|music|video|article|book|profile|fb):.+$/.test(name);- return [value].flat().map((content) => {- if (isOpenGraphTag) {- return /* @__PURE__ */ React3.createElement("meta", {- property: name,- content,- key: name + content- });- }- if (typeof content === "string") {- return /* @__PURE__ */ React3.createElement("meta", {- name,- content,- key: name + content- });- }- return /* @__PURE__ */ React3.createElement("meta", _extends4({- key: name + JSON.stringify(content)- }, content));- });- }));-}-function V2Meta() {- let {- routeModules- } = useRemixContext();- let {- errors,- matches: routerMatches,- loaderData- } = useDataRouterStateContext();- let location = useLocation();- let _matches = errors ? routerMatches.slice(0, routerMatches.findIndex((m) => errors[m.route.id]) + 1) : routerMatches;- let meta = [];- let leafMeta = null;- let matches = [];- for (let i = 0; i < _matches.length; i++) {- let _match = _matches[i];- let routeId = _match.route.id;- let data = loaderData[routeId];- let params = _match.params;- let routeModule = routeModules[routeId];- let routeMeta = [];- let match = {- id: routeId,- data,- meta: [],- params: _match.params,- pathname: _match.pathname,- handle: _match.route.handle,- // TODO: Remove in v2. Only leaving it for now because we used it in- // examples and there's no reason to crash someone's build for one line.- // They'll get a TS error from the type updates anyway.- // @ts-expect-error- get route() {- console.warn("The meta function in " + _match.route.path + " accesses the `route` property on `matches`. This is deprecated and will be removed in Remix version 2. See");- return _match.route;- }- };- matches[i] = match;- if (routeModule !== null && routeModule !== void 0 && routeModule.meta) {- routeMeta = typeof routeModule.meta === "function" ? routeModule.meta({- data,- params,- location,- matches- }) : Array.isArray(routeModule.meta) ? [...routeModule.meta] : routeModule.meta;- } else if (leafMeta) {- routeMeta = [...leafMeta];- }- routeMeta = routeMeta || [];- if (!Array.isArray(routeMeta)) {- throw new Error("The `v2_meta` API is enabled in the Remix config, but the route at " + _match.route.path + " returns an invalid value. In v2, all route meta functions must return an array of meta objects.\n\nTo reference the v1 meta function API, see https://remix.run/route/meta");- }- match.meta = routeMeta;- matches[i] = match;- meta = [...routeMeta];- leafMeta = meta;- }- return /* @__PURE__ */ React3.createElement(React3.Fragment, null, meta.flat().map((metaProps) => {- if (!metaProps) {- return null;- }- if ("tagName" in metaProps) {- let tagName = metaProps.tagName;- delete metaProps.tagName;- if (!isValidMetaTag(tagName)) {- console.warn(`A meta object uses an invalid tagName: ${tagName}. Expected either 'link' or 'meta'`);- return null;- }- let Comp = tagName;- return /* @__PURE__ */ React3.createElement(Comp, _extends4({- key: JSON.stringify(metaProps)- }, metaProps));- }- if ("title" in metaProps) {- return /* @__PURE__ */ React3.createElement("title", {- key: "title"- }, String(metaProps.title));- }- if ("charset" in metaProps) {- metaProps.charSet ?? (metaProps.charSet = metaProps.charset);- delete metaProps.charset;- }- if ("charSet" in metaProps && metaProps.charSet != null) {- return typeof metaProps.charSet === "string" ? /* @__PURE__ */ React3.createElement("meta", {- key: "charSet",- charSet: metaProps.charSet- }) : null;- }- if ("script:ld+json" in metaProps) {- let json2 = null;- try {- json2 = JSON.stringify(metaProps["script:ld+json"]);- } catch (err) {- }- return json2 != null && /* @__PURE__ */ React3.createElement("script", {- key: "script:ld+json",- type: "application/ld+json",- dangerouslySetInnerHTML: {- __html: JSON.stringify(metaProps["script:ld+json"])- }- });- }- return /* @__PURE__ */ React3.createElement("meta", _extends4({- key: JSON.stringify(metaProps)- }, metaProps));- }));-}-function isValidMetaTag(tagName) {- return typeof tagName === "string" && /^(meta|link)$/.test(tagName);-}-function Meta() {- let {- future- } = useRemixContext();- return future !== null && future !== void 0 && future.v2_meta ? /* @__PURE__ */ React3.createElement(V2Meta, null) : /* @__PURE__ */ React3.createElement(V1Meta, null);-}-function Await2(props) {- return /* @__PURE__ */ React3.createElement(Await, props);-}-var isHydrated = false;-function Scripts(props) {- let {- manifest,- serverHandoffString,- abortDelay- } = useRemixContext();- let {- router: router2,- static: isStatic,- staticContext- } = useDataRouterContext3();- let {- matches- } = useDataRouterStateContext();- let navigation = useNavigation();- React3.useEffect(() => {- isHydrated = true;- }, []);- let deferredScripts = [];- let initialScripts = React3.useMemo(() => {- var _manifest$hmr;- let contextScript = staticContext ? `window.__remixContext = ${serverHandoffString};` : " ";- let activeDeferreds = staticContext === null || staticContext === void 0 ? void 0 : staticContext.activeDeferreds;- contextScript += !activeDeferreds ? "" : ["__remixContext.p = function(v,e,p,x) {", " if (typeof e !== 'undefined') {", true ? " x=new Error(e.message);\n x.stack=e.stack;" : ' x=new Error("Unexpected Server Error");\n x.stack=undefined;', " p=Promise.reject(x);", " } else {", " p=Promise.resolve(v);", " }", " return p;", "};", "__remixContext.n = function(i,k) {", " __remixContext.t = __remixContext.t || {};", " __remixContext.t[i] = __remixContext.t[i] || {};", " let p = new Promise((r, e) => {__remixContext.t[i][k] = {r:(v)=>{r(v);},e:(v)=>{e(v);}};});", typeof abortDelay === "number" ? `setTimeout(() => {if(typeof p._error !== "undefined" || typeof p._data !== "undefined"){return;} __remixContext.t[i][k].e(new Error("Server timeout."))}, ${abortDelay});` : "", " return p;", "};", "__remixContext.r = function(i,k,v,e,p,x) {", " p = __remixContext.t[i][k];", " if (typeof e !== 'undefined') {", true ? " x=new Error(e.message);\n x.stack=e.stack;" : ' x=new Error("Unexpected Server Error");\n x.stack=undefined;', " p.e(x);", " } else {", " p.r(v);", " }", "};"].join("\n") + Object.entries(activeDeferreds).map(([routeId, deferredData]) => {- let pendingKeys = new Set(deferredData.pendingKeys);- let promiseKeyValues = deferredData.deferredKeys.map((key) => {- if (pendingKeys.has(key)) {- deferredScripts.push(/* @__PURE__ */ React3.createElement(DeferredHydrationScript, {- key: `${routeId} | ${key}`,- deferredData,- routeId,- dataKey: key- }));- return `${JSON.stringify(key)}:__remixContext.n(${JSON.stringify(routeId)}, ${JSON.stringify(key)})`;- } else {- let trackedPromise = deferredData.data[key];- if (typeof trackedPromise._error !== "undefined") {- let toSerialize = true ? {- message: trackedPromise._error.message,- stack: trackedPromise._error.stack- } : {- message: "Unexpected Server Error",- stack: void 0- };- return `${JSON.stringify(key)}:__remixContext.p(!1, ${escapeHtml(JSON.stringify(toSerialize))})`;- } else {- if (typeof trackedPromise._data === "undefined") {- throw new Error(`The deferred data for ${key} was not resolved, did you forget to return data from a deferred promise?`);- }- return `${JSON.stringify(key)}:__remixContext.p(${escapeHtml(JSON.stringify(trackedPromise._data))})`;- }- }- }).join(",\n");- return `Object.assign(__remixContext.state.loaderData[${JSON.stringify(routeId)}], {${promiseKeyValues}});`;- }).join("\n") + (deferredScripts.length > 0 ? `__remixContext.a=${deferredScripts.length};` : "");- let routeModulesScript = !isStatic ? " " : `${(_manifest$hmr = manifest.hmr) !== null && _manifest$hmr !== void 0 && _manifest$hmr.runtime ? `import ${JSON.stringify(manifest.hmr.runtime)};` : ""}import ${JSON.stringify(manifest.url)};-${matches.map((match, index) => `import * as route${index} from ${JSON.stringify(manifest.routes[match.route.id].module)};`).join("\n")}-window.__remixRouteModules = {${matches.map((match, index) => `${JSON.stringify(match.route.id)}:route${index}`).join(",")}};--import(${JSON.stringify(manifest.entry.module)});`;- return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement("script", _extends4({}, props, {- suppressHydrationWarning: true,- dangerouslySetInnerHTML: createHtml(contextScript),- type: void 0- })), /* @__PURE__ */ React3.createElement("script", _extends4({}, props, {- suppressHydrationWarning: true,- dangerouslySetInnerHTML: createHtml(routeModulesScript),- type: "module",- async: true- })));- }, []);- if (!isStatic && typeof __remixContext === "object" && __remixContext.a) {- for (let i = 0; i < __remixContext.a; i++) {- deferredScripts.push(/* @__PURE__ */ React3.createElement(DeferredHydrationScript, {- key: i- }));- }- }- let nextMatches = React3.useMemo(() => {- if (navigation.location) {- let matches2 = matchRoutes(router2.routes, navigation.location);- invariant2(matches2, `No routes match path "${navigation.location.pathname}"`);- return matches2;- }- return [];- }, [navigation.location, router2.routes]);- let routePreloads = matches.concat(nextMatches).map((match) => {- let route = manifest.routes[match.route.id];- return (route.imports || []).concat([route.module]);- }).flat(1);- let preloads = isHydrated ? [] : manifest.entry.imports.concat(routePreloads);- return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement("link", {- rel: "modulepreload",- href: manifest.url,- crossOrigin: props.crossOrigin- }), /* @__PURE__ */ React3.createElement("link", {- rel: "modulepreload",- href: manifest.entry.module,- crossOrigin: props.crossOrigin- }), dedupe2(preloads).map((path) => /* @__PURE__ */ React3.createElement("link", {- key: path,- rel: "modulepreload",- href: path,- crossOrigin: props.crossOrigin- })), !isHydrated && initialScripts, !isHydrated && deferredScripts);-}-function DeferredHydrationScript({- dataKey,- deferredData,- routeId-}) {- if (typeof document === "undefined" && deferredData && dataKey && routeId) {- invariant2(deferredData.pendingKeys.includes(dataKey), `Deferred data for route ${routeId} with key ${dataKey} was not pending but tried to render a script for it.`);- }- return /* @__PURE__ */ React3.createElement(React3.Suspense, {- fallback: (- // This makes absolutely no sense. The server renders null as a fallback,- // but when hydrating, we need to render a script tag to avoid a hydration issue.- // To reproduce a hydration mismatch, just render null as a fallback.- typeof document === "undefined" && deferredData && dataKey && routeId ? null : /* @__PURE__ */ React3.createElement("script", {- async: true,- suppressHydrationWarning: true,- dangerouslySetInnerHTML: {- __html: " "- }- })- )- }, typeof document === "undefined" && deferredData && dataKey && routeId ? /* @__PURE__ */ React3.createElement(Await2, {- resolve: deferredData.data[dataKey],- errorElement: /* @__PURE__ */ React3.createElement(ErrorDeferredHydrationScript, {- dataKey,- routeId- }),- children: (data) => /* @__PURE__ */ React3.createElement("script", {- async: true,- suppressHydrationWarning: true,- dangerouslySetInnerHTML: {- __html: `__remixContext.r(${JSON.stringify(routeId)}, ${JSON.stringify(dataKey)}, ${escapeHtml(JSON.stringify(data))});`- }- })- }) : /* @__PURE__ */ React3.createElement("script", {- async: true,- suppressHydrationWarning: true,- dangerouslySetInnerHTML: {- __html: " "- }- }));-}-function ErrorDeferredHydrationScript({- dataKey,- routeId-}) {- let error = useAsyncError();- let toSerialize = true ? {- message: error.message,- stack: error.stack- } : {- message: "Unexpected Server Error",- stack: void 0- };- return /* @__PURE__ */ React3.createElement("script", {- suppressHydrationWarning: true,- dangerouslySetInnerHTML: {- __html: `__remixContext.r(${JSON.stringify(routeId)}, ${JSON.stringify(dataKey)}, !1, ${escapeHtml(JSON.stringify(toSerialize))});`- }- });-}-function dedupe2(array) {- return [...new Set(array)];-}-function useMatches2() {- let {- routeModules- } = useRemixContext();- let matches = useMatches();- return React3.useMemo(() => matches.map((match) => {- let remixMatch = {- id: match.id,- pathname: match.pathname,- params: match.params,- data: match.data,- // Need to grab handle here since we don't have it at client-side route- // creation time- handle: routeModules[match.id].handle- };- return remixMatch;- }), [matches, routeModules]);-}-var LiveReload = false ? () => null : function LiveReload2({- // TODO: remove REMIX_DEV_SERVER_WS_PORT in v2- port = Number(8002),- timeoutMs = 1e3,- nonce = void 0-}) {- let js = String.raw;- return /* @__PURE__ */ React3.createElement("script", {- nonce,- suppressHydrationWarning: true,- dangerouslySetInnerHTML: {- __html: js`- function remixLiveReloadConnect(config) {- let protocol = location.protocol === "https:" ? "wss:" : "ws:";- let host = location.hostname;- let port = (window.__remixContext && window.__remixContext.dev && window.__remixContext.dev.websocketPort) || ${String(port)};- let socketPath = protocol + "//" + host + ":" + port + "/socket";- let ws = new WebSocket(socketPath);- ws.onmessage = async (message) => {- let event = JSON.parse(message.data);- if (event.type === "LOG") {- console.log(event.message);- }- if (event.type === "RELOAD") {- console.log("💿 Reloading window ...");- window.location.reload();- }- if (event.type === "HMR") {- if (!window.__hmr__ || !window.__hmr__.contexts) {- console.log("💿 [HMR] No HMR context, reloading window ...");- window.location.reload();- return;- }- if (!event.updates || !event.updates.length) return;- let updateAccepted = false;- let needsRevalidation = new Set();- for (let update of event.updates) {- console.log("[HMR] " + update.reason + " [" + update.id +"]")- if (update.revalidate) {- needsRevalidation.add(update.routeId);- console.log("[HMR] Revalidating [" + update.routeId + "]");- }- let imported = await import(update.url + '?t=' + event.assetsManifest.hmr.timestamp);- if (window.__hmr__.contexts[update.id]) {- let accepted = window.__hmr__.contexts[update.id].emit(- imported- );- if (accepted) {- console.log("[HMR] Updated accepted by", update.id);- updateAccepted = true;- }- }- }- if (event.assetsManifest && window.__hmr__.contexts["remix:manifest"]) {- let accepted = window.__hmr__.contexts["remix:manifest"].emit(- { needsRevalidation, assetsManifest: event.assetsManifest }- );- if (accepted) {- console.log("[HMR] Updated accepted by", "remix:manifest");- updateAccepted = true;- }- }- if (!updateAccepted) {- console.log("[HMR] Updated rejected, reloading...");- window.location.reload();- }- }- };- ws.onopen = () => {- if (config && typeof config.onOpen === "function") {- config.onOpen();- }- };- ws.onclose = (event) => {- if (event.code === 1006) {- console.log("Remix dev asset server web socket closed. Reconnecting...");- setTimeout(- () =>- remixLiveReloadConnect({- onOpen: () => window.location.reload(),- }),- ${String(timeoutMs)}- );- }- };- ws.onerror = (error) => {- console.log("Remix dev asset server web socket error:");- console.error(error);- };- }- remixLiveReloadConnect();- `- }- });-};--// node_modules/@remix-run/react/dist/esm/errors.js-init_global();-init_dirname();-init_filename();-init_buffer();-init_process();-init_router();-function deserializeErrors2(errors) {- if (!errors)- return null;- let entries = Object.entries(errors);- let serialized = {};- for (let [key, val] of entries) {- if (val && val.__type === "RouteErrorResponse") {- serialized[key] = new ErrorResponse(val.status, val.statusText, val.data, val.internal === true);- } else if (val && val.__type === "Error") {- let error = new Error(val.message);- error.stack = val.stack;- serialized[key] = error;- } else {- serialized[key] = val;- }- }- return serialized;-}--// node_modules/@remix-run/react/dist/esm/routes.js-init_global();-init_dirname();-init_filename();-init_buffer();-init_process();-var React4 = __toESM(require_react());-init_dist2();--// node_modules/@remix-run/react/dist/esm/data.js-init_global();-init_dirname();-init_filename();-init_buffer();-init_process();-init_router();-function isCatchResponse(response) {- return response instanceof Response && response.headers.get("X-Remix-Catch") != null;-}-function isErrorResponse(response) {- return response instanceof Response && response.headers.get("X-Remix-Error") != null;-}-function isRedirectResponse(response) {- return response instanceof Response && response.headers.get("X-Remix-Redirect") != null;-}-function isDeferredResponse(response) {- var _response$headers$get;- return response instanceof Response && !!((_response$headers$get = response.headers.get("Content-Type")) !== null && _response$headers$get !== void 0 && _response$headers$get.match(/text\/remix-deferred/));-}-async function fetchData(request, routeId) {- let url = new URL(request.url);- url.searchParams.set("_data", routeId);- let init = {- signal: request.signal- };- if (request.method !== "GET") {- init.method = request.method;- let contentType = request.headers.get("Content-Type");- init.body = // Check between word boundaries instead of startsWith() due to the last- // paragraph of https://httpwg.org/specs/rfc9110.html#field.content-type- contentType && /\bapplication\/x-www-form-urlencoded\b/.test(contentType) ? new URLSearchParams(await request.text()) : await request.formData();- }- let response = await fetch(url.href, init);- if (isErrorResponse(response)) {- let data = await response.json();- let error = new Error(data.message);- error.stack = data.stack;- return error;- }- return response;-}-var DEFERRED_VALUE_PLACEHOLDER_PREFIX = "__deferred_promise:";-async function parseDeferredReadableStream(stream) {- if (!stream) {- throw new Error("parseDeferredReadableStream requires stream argument");- }- let deferredData;- let deferredResolvers = {};- try {- let sectionReader = readStreamSections(stream);- let initialSectionResult = await sectionReader.next();- let initialSection = initialSectionResult.value;- if (!initialSection)- throw new Error("no critical data");- let criticalData = JSON.parse(initialSection);- if (typeof criticalData === "object" && criticalData !== null) {- for (let [eventKey, value] of Object.entries(criticalData)) {- if (typeof value !== "string" || !value.startsWith(DEFERRED_VALUE_PLACEHOLDER_PREFIX)) {- continue;- }- deferredData = deferredData || {};- deferredData[eventKey] = new Promise((resolve, reject) => {- deferredResolvers[eventKey] = {- resolve: (value2) => {- resolve(value2);- delete deferredResolvers[eventKey];- },- reject: (error) => {- reject(error);- delete deferredResolvers[eventKey];- }- };- });- }- }- (async () => {- try {- for await (let section of sectionReader) {- let [event, ...sectionDataStrings] = section.split(":");- let sectionDataString = sectionDataStrings.join(":");- let data = JSON.parse(sectionDataString);- if (event === "data") {- for (let [key, value] of Object.entries(data)) {- if (deferredResolvers[key]) {- deferredResolvers[key].resolve(value);- }- }- } else if (event === "error") {- for (let [key, value] of Object.entries(data)) {- let err = new Error(value.message);- err.stack = value.stack;- if (deferredResolvers[key]) {- deferredResolvers[key].reject(err);- }- }- }- }- for (let [key, resolver] of Object.entries(deferredResolvers)) {- resolver.reject(new AbortedDeferredError(`Deferred ${key} will never be resolved`));- }- } catch (error) {- for (let resolver of Object.values(deferredResolvers)) {- resolver.reject(error);- }- }- })();- return new DeferredData({- ...criticalData,- ...deferredData- });- } catch (error) {- for (let resolver of Object.values(deferredResolvers)) {- resolver.reject(error);- }- throw error;- }-}-async function* readStreamSections(stream) {- let reader = stream.getReader();- let buffer = [];- let sections = [];- let closed = false;- let encoder = new TextEncoder();- let decoder = new TextDecoder();- let readStreamSection = async () => {- if (sections.length > 0)- return sections.shift();- while (!closed && sections.length === 0) {- let chunk = await reader.read();- if (chunk.done) {- closed = true;- break;- }- buffer.push(chunk.value);- try {- let bufferedString = decoder.decode(mergeArrays(...buffer));- let splitSections = bufferedString.split("\n\n");- if (splitSections.length >= 2) {- sections.push(...splitSections.slice(0, -1));- buffer = [encoder.encode(splitSections.slice(-1).join("\n\n"))];- }- if (sections.length > 0) {- break;- }- } catch {- continue;- }- }- if (sections.length > 0) {- return sections.shift();- }- if (buffer.length > 0) {- let bufferedString = decoder.decode(mergeArrays(...buffer));- sections = bufferedString.split("\n\n").filter((s) => s);- buffer = [];- }- return sections.shift();- };- let section = await readStreamSection();- while (section) {- yield section;- section = await readStreamSection();- }-}-function mergeArrays(...arrays) {- let out = new Uint8Array(arrays.reduce((total, arr) => total + arr.length, 0));- let offset = 0;- for (let arr of arrays) {- out.set(arr, offset);- offset += arr.length;- }- return out;-}--// node_modules/@remix-run/react/dist/esm/routes.js-function groupRoutesByParentId(manifest) {- let routes = {};- Object.values(manifest).forEach((route) => {- let parentId = route.parentId || "";- if (!routes[parentId]) {- routes[parentId] = [];- }- routes[parentId].push(route);- });- return routes;-}-function createClientRoutesWithHMRRevalidationOptOut(needsRevalidation, manifest, routeModulesCache, future) {- return createClientRoutes(manifest, routeModulesCache, future, "", groupRoutesByParentId(manifest), needsRevalidation);-}-function createClientRoutes(manifest, routeModulesCache, future, parentId = "", routesByParentId = groupRoutesByParentId(manifest), needsRevalidation) {- return (routesByParentId[parentId] || []).map((route) => {- let hasErrorBoundary = future.v2_errorBoundary === true ? route.id === "root" || route.hasErrorBoundary : route.id === "root" || route.hasCatchBoundary || route.hasErrorBoundary;- let dataRoute = {- caseSensitive: route.caseSensitive,- element: /* @__PURE__ */ React4.createElement(RemixRoute, {- id: route.id- }),- errorElement: hasErrorBoundary ? /* @__PURE__ */ React4.createElement(RemixRouteError, {- id: route.id- }) : void 0,- id: route.id,- index: route.index,- path: route.path,- // handle gets added in via useMatches since we aren't guaranteed to- // have the route module available here- handle: void 0,- loader: createDataFunction(route, routeModulesCache, false),- action: createDataFunction(route, routeModulesCache, true),- shouldRevalidate: createShouldRevalidate(route, routeModulesCache, needsRevalidation)- };- let children = createClientRoutes(manifest, routeModulesCache, future, route.id, routesByParentId, needsRevalidation);- if (children.length > 0)- dataRoute.children = children;- return dataRoute;- });-}-function createShouldRevalidate(route, routeModules, needsRevalidation) {- let handledRevalidation = false;- return function(arg) {- let module = routeModules[route.id];- invariant2(module, `Expected route module to be loaded for ${route.id}`);- if (needsRevalidation !== void 0 && !handledRevalidation) {- handledRevalidation = true;- return needsRevalidation.has(route.id);- }- if (module.shouldRevalidate) {- return module.shouldRevalidate(arg);- }- return arg.defaultShouldRevalidate;- };-}-async function loadRouteModuleWithBlockingLinks(route, routeModules) {- let routeModule = await loadRouteModule(route, routeModules);- await prefetchStyleLinks(routeModule);- return routeModule;-}-function createDataFunction(route, routeModules, isAction) {- return async ({- request- }) => {- let routeModulePromise = loadRouteModuleWithBlockingLinks(route, routeModules);- try {- if (isAction && !route.hasAction) {- let msg = `Route "${route.id}" does not have an action, but you are trying to submit to it. To fix this, please add an \`action\` function to the route`;- console.error(msg);- throw new Error(msg);- } else if (!isAction && !route.hasLoader) {- return null;- }- let result = await fetchData(request, route.id);- if (result instanceof Error) {- throw result;- }- if (isRedirectResponse(result)) {- throw getRedirect(result);- }- if (isCatchResponse(result)) {- throw result;- }- if (isDeferredResponse(result) && result.body) {- return await parseDeferredReadableStream(result.body);- }- return result;- } finally {- await routeModulePromise;- }- };-}-function getRedirect(response) {- let status = parseInt(response.headers.get("X-Remix-Status"), 10) || 302;- let url = response.headers.get("X-Remix-Redirect");- let headers = {};- let revalidate = response.headers.get("X-Remix-Revalidate");- if (revalidate) {- headers["X-Remix-Revalidate"] = revalidate;- }- return redirect(url, {- status,- headers- });-}--// node_modules/@remix-run/react/dist/esm/browser.js-var router;-var hmrAbortController;-if (import.meta && import.meta.hot) {- import.meta.hot.accept("remix:manifest", async ({- assetsManifest,- needsRevalidation- }) => {- let routeIds = [...new Set(router.state.matches.map((m) => m.route.id).concat(Object.keys(window.__remixRouteModules)))];- if (hmrAbortController) {- hmrAbortController.abort();- }- hmrAbortController = new AbortController();- let signal = hmrAbortController.signal;- let newRouteModules = Object.assign({}, window.__remixRouteModules, Object.fromEntries((await Promise.all(routeIds.map(async (id) => {- var _assetsManifest$hmr, _window$__remixRouteM, _window$__remixRouteM2, _window$__remixRouteM3;- if (!assetsManifest.routes[id]) {- return null;- }- let imported = await import(assetsManifest.routes[id].module + `?t=${(_assetsManifest$hmr = assetsManifest.hmr) === null || _assetsManifest$hmr === void 0 ? void 0 : _assetsManifest$hmr.timestamp}`);- return [id, {- ...imported,- // react-refresh takes care of updating these in-place,- // if we don't preserve existing values we'll loose state.- default: imported.default ? ((_window$__remixRouteM = window.__remixRouteModules[id]) === null || _window$__remixRouteM === void 0 ? void 0 : _window$__remixRouteM.default) ?? imported.default : imported.default,- CatchBoundary: imported.CatchBoundary ? ((_window$__remixRouteM2 = window.__remixRouteModules[id]) === null || _window$__remixRouteM2 === void 0 ? void 0 : _window$__remixRouteM2.CatchBoundary) ?? imported.CatchBoundary : imported.CatchBoundary,- ErrorBoundary: imported.ErrorBoundary ? ((_window$__remixRouteM3 = window.__remixRouteModules[id]) === null || _window$__remixRouteM3 === void 0 ? void 0 : _window$__remixRouteM3.ErrorBoundary) ?? imported.ErrorBoundary : imported.ErrorBoundary- }];- }))).filter(Boolean)));- Object.assign(window.__remixRouteModules, newRouteModules);- let routes = createClientRoutesWithHMRRevalidationOptOut(needsRevalidation, assetsManifest.routes, window.__remixRouteModules, window.__remixContext.future);- router._internalSetRoutes(routes);- let unsub = router.subscribe((state) => {- if (state.revalidation === "idle") {- unsub();- if (signal.aborted)- return;- setTimeout(() => {- Object.assign(window.__remixManifest, assetsManifest);- window.$RefreshRuntime$.performReactRefresh();- }, 1);- }- });- router.revalidate();- });-}-function RemixBrowser(_props) {- if (!router) {- let routes = createClientRoutes(window.__remixManifest.routes, window.__remixRouteModules, window.__remixContext.future);- let hydrationData = window.__remixContext.state;- if (hydrationData && hydrationData.errors) {- hydrationData = {- ...hydrationData,- errors: deserializeErrors2(hydrationData.errors)- };- }- router = createBrowserRouter(routes, {- hydrationData,- future: {- // Pass through the Remix future flag to avoid a v1 breaking change in- // useNavigation() - users can control the casing via the flag in v1.- // useFetcher still always uppercases in the back-compat layer in v1.- // In v2 we can just always pass true here and remove the back-compat- // layer- v7_normalizeFormMethod: window.__remixContext.future.v2_normalizeFormMethod- }- });- }- let [location, setLocation] = React5.useState(router.state.location);- React5.useLayoutEffect(() => {- return router.subscribe((newState) => {- if (newState.location !== location) {- setLocation(newState.location);- }- });- }, [location]);- return /* @__PURE__ */ React5.createElement(RemixContext.Provider, {- value: {- manifest: window.__remixManifest,- routeModules: window.__remixRouteModules,- future: window.__remixContext.future- }- }, /* @__PURE__ */ React5.createElement(RemixErrorBoundary, {- location,- component: RemixRootDefaultErrorBoundary- }, /* @__PURE__ */ React5.createElement(RouterProvider, {- router,- fallbackElement: null- })));-}--// node_modules/@remix-run/react/dist/esm/index.js-init_global();-init_dirname();-init_filename();-init_buffer();-init_process();-init_dist2();--// node_modules/@remix-run/react/dist/esm/scroll-restoration.js-init_global();-init_dirname();-init_filename();-init_buffer();-init_process();-var React6 = __toESM(require_react());-init_dist2();-var STORAGE_KEY = "positions";-function ScrollRestoration2({- getKey,- ...props-}) {- let location = useLocation();- let matches = useMatches2();- useScrollRestoration({- getKey,- storageKey: STORAGE_KEY- });- let key = React6.useMemo(- () => {- if (!getKey)- return null;- let userKey = getKey(location, matches);- return userKey !== location.key ? userKey : null;- },- // Nah, we only need this the first time for the SSR render- // eslint-disable-next-line react-hooks/exhaustive-deps- []- );- let restoreScroll = ((STORAGE_KEY2, restoreKey) => {- if (!window.history.state || !window.history.state.key) {- let key2 = Math.random().toString(32).slice(2);- window.history.replaceState({- key: key2- }, "");- }- try {- let positions = JSON.parse(sessionStorage.getItem(STORAGE_KEY2) || "{}");- let storedY = positions[restoreKey || window.history.state.key];- if (typeof storedY === "number") {- window.scrollTo(0, storedY);- }- } catch (error) {- console.error(error);- sessionStorage.removeItem(STORAGE_KEY2);- }- }).toString();- return /* @__PURE__ */ React6.createElement("script", _extends4({}, props, {- suppressHydrationWarning: true,- dangerouslySetInnerHTML: {- __html: `(${restoreScroll})(${JSON.stringify(STORAGE_KEY)}, ${JSON.stringify(key)})`- }- }));-}--export {- Outlet,- Links,- Meta,- Scripts,- LiveReload,- RemixBrowser,- ScrollRestoration2 as ScrollRestoration-};-/*! Bundled license information:--@remix-run/router/dist/router.js:- (**- * @remix-run/router v1.6.2- *- * Copyright (c) Remix Software Inc.- *- * This source code is licensed under the MIT license found in the- * LICENSE.md file in the root directory of this source tree.- *- * @license MIT- *)--react-router/dist/index.js:- (**- * React Router v6.11.2- *- * Copyright (c) Remix Software Inc.- *- * This source code is licensed under the MIT license found in the- * LICENSE.md file in the root directory of this source tree.- *- * @license MIT- *)--react-router-dom/dist/index.js:- (**- * React Router DOM v6.11.2- *- * Copyright (c) Remix Software Inc.- *- * This source code is licensed under the MIT license found in the- * LICENSE.md file in the root directory of this source tree.- *- * @license MIT- *)--@remix-run/react/dist/esm/_virtual/_rollupPluginBabelHelpers.js:- (**- * @remix-run/react v1.16.1- *- * Copyright (c) Remix Software Inc.- *- * This source code is licensed under the MIT license found in the- * LICENSE.md file in the root directory of this source tree.- *- * @license MIT- *)--@remix-run/react/dist/esm/errorBoundaries.js:- (**- * @remix-run/react v1.16.1- *- * Copyright (c) Remix Software Inc.- *- * This source code is licensed under the MIT license found in the- * LICENSE.md file in the root directory of this source tree.- *- * @license MIT- *)--@remix-run/react/dist/esm/invariant.js:- (**- * @remix-run/react v1.16.1- *- * Copyright (c) Remix Software Inc.- *- * This source code is licensed under the MIT license found in the- * LICENSE.md file in the root directory of this source tree.- *- * @license MIT- *)--@remix-run/react/dist/esm/routeModules.js:- (**- * @remix-run/react v1.16.1- *- * Copyright (c) Remix Software Inc.- *- * This source code is licensed under the MIT license found in the- * LICENSE.md file in the root directory of this source tree.- *- * @license MIT- *)--@remix-run/react/dist/esm/links.js:- (**- * @remix-run/react v1.16.1- *- * Copyright (c) Remix Software Inc.- *- * This source code is licensed under the MIT license found in the- * LICENSE.md file in the root directory of this source tree.- *- * @license MIT- *)--@remix-run/react/dist/esm/markup.js:- (**- * @remix-run/react v1.16.1- *- * Copyright (c) Remix Software Inc.- *- * This source code is licensed under the MIT license found in the- * LICENSE.md file in the root directory of this source tree.- *- * @license MIT- *)--@remix-run/react/dist/esm/warnings.js:- (**- * @remix-run/react v1.16.1- *- * Copyright (c) Remix Software Inc.- *- * This source code is licensed under the MIT license found in the- * LICENSE.md file in the root directory of this source tree.- *- * @license MIT- *)--@remix-run/react/dist/esm/components.js:- (**- * @remix-run/react v1.16.1- *- * Copyright (c) Remix Software Inc.- *- * This source code is licensed under the MIT license found in the- * LICENSE.md file in the root directory of this source tree.- *- * @license MIT- *)--@remix-run/react/dist/esm/errors.js:- (**- * @remix-run/react v1.16.1- *- * Copyright (c) Remix Software Inc.- *- * This source code is licensed under the MIT license found in the- * LICENSE.md file in the root directory of this source tree.- *- * @license MIT- *)--@remix-run/react/dist/esm/data.js:- (**- * @remix-run/react v1.16.1- *- * Copyright (c) Remix Software Inc.- *- * This source code is licensed under the MIT license found in the- * LICENSE.md file in the root directory of this source tree.- *- * @license MIT- *)--@remix-run/react/dist/esm/routes.js:- (**- * @remix-run/react v1.16.1- *- * Copyright (c) Remix Software Inc.- *- * This source code is licensed under the MIT license found in the- * LICENSE.md file in the root directory of this source tree.- *- * @license MIT- *)--@remix-run/react/dist/esm/browser.js:- (**- * @remix-run/react v1.16.1- *- * Copyright (c) Remix Software Inc.- *- * This source code is licensed under the MIT license found in the- * LICENSE.md file in the root directory of this source tree.- *- * @license MIT- *)--@remix-run/react/dist/esm/scroll-restoration.js:- (**- * @remix-run/react v1.16.1- *- * Copyright (c) Remix Software Inc.- *- * This source code is licensed under the MIT license found in the- * LICENSE.md file in the root directory of this source tree.- *- * @license MIT- *)--@remix-run/react/dist/esm/index.js:- (**- * @remix-run/react v1.16.1- *- * Copyright (c) Remix Software Inc.- *- * This source code is licensed under the MIT license found in the- * LICENSE.md file in the root directory of this source tree.- *- * @license MIT- *)-*/-//# sourceMappingURL=/build/_shared/chunk-QEVHFCZ7.js.mapdiff --git a/public/build/_shared/chunk-QEVHFCZ7.js.map b/public/build/_shared/chunk-QEVHFCZ7.js.mapdeleted file mode 100644index 0075804a2..000000000--- a/public/build/_shared/chunk-QEVHFCZ7.js.map+++ /dev/null@@ -1,7 +0,0 @@-{- "version": 3,- "sources": ["../../../node_modules/@remix-run/router/history.ts", "../../../node_modules/@remix-run/router/utils.ts", "../../../node_modules/@remix-run/router/router.ts", "../../../node_modules/react-router/lib/context.ts", "../../../node_modules/react-router/lib/hooks.tsx", "../../../node_modules/react-router/lib/components.tsx", "../../../node_modules/react-router/index.ts", "../../../node_modules/react-router-dom/dom.ts", "../../../node_modules/react-router-dom/index.tsx", "../../../node_modules/@remix-run/react/dist/esm/browser.js", "../../../node_modules/@remix-run/react/dist/esm/components.js", "../../../node_modules/@remix-run/react/dist/esm/_virtual/_rollupPluginBabelHelpers.js", "../../../node_modules/@remix-run/react/dist/esm/errorBoundaries.js", "../../../node_modules/@remix-run/react/dist/esm/invariant.js", "../../../node_modules/@remix-run/react/dist/esm/links.js", "../../../node_modules/@remix-run/react/dist/esm/routeModules.js", "../../../node_modules/@remix-run/react/dist/esm/markup.js", "../../../node_modules/@remix-run/react/dist/esm/warnings.js", "../../../node_modules/@remix-run/react/dist/esm/errors.js", "../../../node_modules/@remix-run/react/dist/esm/routes.js", "../../../node_modules/@remix-run/react/dist/esm/data.js", "../../../node_modules/@remix-run/react/dist/esm/index.js", "../../../node_modules/@remix-run/react/dist/esm/scroll-restoration.js"],- "sourcesContent": ["////////////////////////////////////////////////////////////////////////////////\n//#region Types and Constants\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Actions represent the type of change to a location value.\n */\nexport enum Action {\n /**\n * A POP indicates a change to an arbitrary index in the history stack, such\n * as a back or forward navigation. It does not describe the direction of the\n * navigation, only that the current index changed.\n *\n * Note: This is the default action for newly created history objects.\n */\n Pop = \"POP\",\n\n /**\n * A PUSH indicates a new entry being added to the history stack, such as when\n * a link is clicked and a new page loads. When this happens, all subsequent\n * entries in the stack are lost.\n */\n Push = \"PUSH\",\n\n /**\n * A REPLACE indicates the entry at the current index in the history stack\n * being replaced by a new one.\n */\n Replace = \"REPLACE\",\n}\n\n/**\n * The pathname, search, and hash values of a URL.\n */\nexport interface Path {\n /**\n * A URL pathname, beginning with a /.\n */\n pathname: string;\n\n /**\n * A URL search string, beginning with a ?.\n */\n search: string;\n\n /**\n * A URL fragment identifier, beginning with a #.\n */\n hash: string;\n}\n\n/**\n * An entry in a history stack. A location contains information about the\n * URL path, as well as possibly some arbitrary state and a key.\n */\nexport interface Location extends Path {\n /**\n * A value of arbitrary data associated with this location.\n */\n state: any;\n\n /**\n * A unique string associated with this location. May be used to safely store\n * and retrieve data in some other storage API, like `localStorage`.\n *\n * Note: This value is always \"default\" on the initial location.\n */\n key: string;\n}\n\n/**\n * A change to the current location.\n */\nexport interface Update {\n /**\n * The action that triggered the change.\n */\n action: Action;\n\n /**\n * The new location.\n */\n location: Location;\n\n /**\n * The delta between this location and the former location in the history stack\n */\n delta: number | null;\n}\n\n/**\n * A function that receives notifications about location changes.\n */\nexport interface Listener {\n (update: Update): void;\n}\n\n/**\n * Describes a location that is the destination of some navigation, either via\n * `history.push` or `history.replace`. May be either a URL or the pieces of a\n * URL path.\n */\nexport type To = string | Partial<Path>;\n\n/**\n * A history is an interface to the navigation stack. The history serves as the\n * source of truth for the current location, as well as provides a set of\n * methods that may be used to change it.\n *\n * It is similar to the DOM's `window.history` object, but with a smaller, more\n * focused API.\n */\nexport interface History {\n /**\n * The last action that modified the current location. This will always be\n * Action.Pop when a history instance is first created. This value is mutable.\n */\n readonly action: Action;\n\n /**\n * The current location. This value is mutable.\n */\n readonly location: Location;\n\n /**\n * Returns a valid href for the given `to` value that may be used as\n * the value of an <a href> attribute.\n *\n * @param to - The destination URL\n */\n createHref(to: To): string;\n\n /**\n * Returns a URL for the given `to` value\n *\n * @param to - The destination URL\n */\n createURL(to: To): URL;\n\n /**\n * Encode a location the same way window.history would do (no-op for memory\n * history) so we ensure our PUSH/REPLACE navigations for data routers\n * behave the same as POP\n *\n * @param to Unencoded path\n */\n encodeLocation(to: To): Path;\n\n /**\n * Pushes a new location onto the history stack, increasing its length by one.\n * If there were any entries in the stack after the current one, they are\n * lost.\n *\n * @param to - The new URL\n * @param state - Data to associate with the new location\n */\n push(to: To, state?: any): void;\n\n /**\n * Replaces the current location in the history stack with a new one. The\n * location that was replaced will no longer be available.\n *\n * @param to - The new URL\n * @param state - Data to associate with the new location\n */\n replace(to: To, state?: any): void;\n\n /**\n * Navigates `n` entries backward/forward in the history stack relative to the\n * current index. For example, a \"back\" navigation would use go(-1).\n *\n * @param delta - The delta in the stack index\n */\n go(delta: number): void;\n\n /**\n * Sets up a listener that will be called whenever the current location\n * changes.\n *\n * @param listener - A function that will be called when the location changes\n * @returns unlisten - A function that may be used to stop listening\n */\n listen(listener: Listener): () => void;\n}\n\ntype HistoryState = {\n usr: any;\n key?: string;\n idx: number;\n};\n\nconst PopStateEventType = \"popstate\";\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Memory History\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * A user-supplied object that describes a location. Used when providing\n * entries to `createMemoryHistory` via its `initialEntries` option.\n */\nexport type InitialEntry = string | Partial<Location>;\n\nexport type MemoryHistoryOptions = {\n initialEntries?: InitialEntry[];\n initialIndex?: number;\n v5Compat?: boolean;\n};\n\n/**\n * A memory history stores locations in memory. This is useful in stateful\n * environments where there is no web browser, such as node tests or React\n * Native.\n */\nexport interface MemoryHistory extends History {\n /**\n * The current index in the history stack.\n */\n readonly index: number;\n}\n\n/**\n * Memory history stores the current location in memory. It is designed for use\n * in stateful non-browser environments like tests and React Native.\n */\nexport function createMemoryHistory(\n options: MemoryHistoryOptions = {}\n): MemoryHistory {\n let { initialEntries = [\"/\"], initialIndex, v5Compat = false } = options;\n let entries: Location[]; // Declare so we can access from createMemoryLocation\n entries = initialEntries.map((entry, index) =>\n createMemoryLocation(\n entry,\n typeof entry === \"string\" ? null : entry.state,\n index === 0 ? \"default\" : undefined\n )\n );\n let index = clampIndex(\n initialIndex == null ? entries.length - 1 : initialIndex\n );\n let action = Action.Pop;\n let listener: Listener | null = null;\n\n function clampIndex(n: number): number {\n return Math.min(Math.max(n, 0), entries.length - 1);\n }\n function getCurrentLocation(): Location {\n return entries[index];\n }\n function createMemoryLocation(\n to: To,\n state: any = null,\n key?: string\n ): Location {\n let location = createLocation(\n entries ? getCurrentLocation().pathname : \"/\",\n to,\n state,\n key\n );\n warning(\n location.pathname.charAt(0) === \"/\",\n `relative pathnames are not supported in memory history: ${JSON.stringify(\n to\n )}`\n );\n return location;\n }\n\n function createHref(to: To) {\n return typeof to === \"string\" ? to : createPath(to);\n }\n\n let history: MemoryHistory = {\n get index() {\n return index;\n },\n get action() {\n return action;\n },\n get location() {\n return getCurrentLocation();\n },\n createHref,\n createURL(to) {\n return new URL(createHref(to), \"http://localhost\");\n },\n encodeLocation(to: To) {\n let path = typeof to === \"string\" ? parsePath(to) : to;\n return {\n pathname: path.pathname || \"\",\n search: path.search || \"\",\n hash: path.hash || \"\",\n };\n },\n push(to, state) {\n action = Action.Push;\n let nextLocation = createMemoryLocation(to, state);\n index += 1;\n entries.splice(index, entries.length, nextLocation);\n if (v5Compat && listener) {\n listener({ action, location: nextLocation, delta: 1 });\n }\n },\n replace(to, state) {\n action = Action.Replace;\n let nextLocation = createMemoryLocation(to, state);\n entries[index] = nextLocation;\n if (v5Compat && listener) {\n listener({ action, location: nextLocation, delta: 0 });\n }\n },\n go(delta) {\n action = Action.Pop;\n let nextIndex = clampIndex(index + delta);\n let nextLocation = entries[nextIndex];\n index = nextIndex;\n if (listener) {\n listener({ action, location: nextLocation, delta });\n }\n },\n listen(fn: Listener) {\n listener = fn;\n return () => {\n listener = null;\n };\n },\n };\n\n return history;\n}\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Browser History\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * A browser history stores the current location in regular URLs in a web\n * browser environment. This is the standard for most web apps and provides the\n * cleanest URLs the browser's address bar.\n *\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#browserhistory\n */\nexport interface BrowserHistory extends UrlHistory {}\n\nexport type BrowserHistoryOptions = UrlHistoryOptions;\n\n/**\n * Browser history stores the location in regular URLs. This is the standard for\n * most web apps, but it requires some configuration on the server to ensure you\n * serve the same app at multiple URLs.\n *\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createbrowserhistory\n */\nexport function createBrowserHistory(\n options: BrowserHistoryOptions = {}\n): BrowserHistory {\n function createBrowserLocation(\n window: Window,\n globalHistory: Window[\"history\"]\n ) {\n let { pathname, search, hash } = window.location;\n return createLocation(\n \"\",\n { pathname, search, hash },\n // state defaults to `null` because `window.history.state` does\n (globalHistory.state && globalHistory.state.usr) || null,\n (globalHistory.state && globalHistory.state.key) || \"default\"\n );\n }\n\n function createBrowserHref(window: Window, to: To) {\n return typeof to === \"string\" ? to : createPath(to);\n }\n\n return getUrlBasedHistory(\n createBrowserLocation,\n createBrowserHref,\n null,\n options\n );\n}\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Hash History\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * A hash history stores the current location in the fragment identifier portion\n * of the URL in a web browser environment.\n *\n * This is ideal for apps that do not control the server for some reason\n * (because the fragment identifier is never sent to the server), including some\n * shared hosting environments that do not provide fine-grained controls over\n * which pages are served at which URLs.\n *\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#hashhistory\n */\nexport interface HashHistory extends UrlHistory {}\n\nexport type HashHistoryOptions = UrlHistoryOptions;\n\n/**\n * Hash history stores the location in window.location.hash. This makes it ideal\n * for situations where you don't want to send the location to the server for\n * some reason, either because you do cannot configure it or the URL space is\n * reserved for something else.\n *\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createhashhistory\n */\nexport function createHashHistory(\n options: HashHistoryOptions = {}\n): HashHistory {\n function createHashLocation(\n window: Window,\n globalHistory: Window[\"history\"]\n ) {\n let {\n pathname = \"/\",\n search = \"\",\n hash = \"\",\n } = parsePath(window.location.hash.substr(1));\n return createLocation(\n \"\",\n { pathname, search, hash },\n // state defaults to `null` because `window.history.state` does\n (globalHistory.state && globalHistory.state.usr) || null,\n (globalHistory.state && globalHistory.state.key) || \"default\"\n );\n }\n\n function createHashHref(window: Window, to: To) {\n let base = window.document.querySelector(\"base\");\n let href = \"\";\n\n if (base && base.getAttribute(\"href\")) {\n let url = window.location.href;\n let hashIndex = url.indexOf(\"#\");\n href = hashIndex === -1 ? url : url.slice(0, hashIndex);\n }\n\n return href + \"#\" + (typeof to === \"string\" ? to : createPath(to));\n }\n\n function validateHashLocation(location: Location, to: To) {\n warning(\n location.pathname.charAt(0) === \"/\",\n `relative pathnames are not supported in hash history.push(${JSON.stringify(\n to\n )})`\n );\n }\n\n return getUrlBasedHistory(\n createHashLocation,\n createHashHref,\n validateHashLocation,\n options\n );\n}\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region UTILS\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n */\nexport function invariant(value: boolean, message?: string): asserts value;\nexport function invariant<T>(\n value: T | null | undefined,\n message?: string\n): asserts value is T;\nexport function invariant(value: any, message?: string) {\n if (value === false || value === null || typeof value === \"undefined\") {\n throw new Error(message);\n }\n}\n\nexport function warning(cond: any, message: string) {\n if (!cond) {\n // eslint-disable-next-line no-console\n if (typeof console !== \"undefined\") console.warn(message);\n\n try {\n // Welcome to debugging history!\n //\n // This error is thrown as a convenience so you can more easily\n // find the source for a warning that appears in the console by\n // enabling \"pause on exceptions\" in your JavaScript debugger.\n throw new Error(message);\n // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n}\n\nfunction createKey() {\n return Math.random().toString(36).substr(2, 8);\n}\n\n/**\n * For browser-based histories, we combine the state and key into an object\n */\nfunction getHistoryState(location: Location, index: number): HistoryState {\n return {\n usr: location.state,\n key: location.key,\n idx: index,\n };\n}\n\n/**\n * Creates a Location object with a unique key from the given Path\n */\nexport function createLocation(\n current: string | Location,\n to: To,\n state: any = null,\n key?: string\n): Readonly<Location> {\n let location: Readonly<Location> = {\n pathname: typeof current === \"string\" ? current : current.pathname,\n search: \"\",\n hash: \"\",\n ...(typeof to === \"string\" ? parsePath(to) : to),\n state,\n // TODO: This could be cleaned up. push/replace should probably just take\n // full Locations now and avoid the need to run through this flow at all\n // But that's a pretty big refactor to the current test suite so going to\n // keep as is for the time being and just let any incoming keys take precedence\n key: (to && (to as Location).key) || key || createKey(),\n };\n return location;\n}\n\n/**\n * Creates a string URL path from the given pathname, search, and hash components.\n */\nexport function createPath({\n pathname = \"/\",\n search = \"\",\n hash = \"\",\n}: Partial<Path>) {\n if (search && search !== \"?\")\n pathname += search.charAt(0) === \"?\" ? search : \"?\" + search;\n if (hash && hash !== \"#\")\n pathname += hash.charAt(0) === \"#\" ? hash : \"#\" + hash;\n return pathname;\n}\n\n/**\n * Parses a string URL path into its separate pathname, search, and hash components.\n */\nexport function parsePath(path: string): Partial<Path> {\n let parsedPath: Partial<Path> = {};\n\n if (path) {\n let hashIndex = path.indexOf(\"#\");\n if (hashIndex >= 0) {\n parsedPath.hash = path.substr(hashIndex);\n path = path.substr(0, hashIndex);\n }\n\n let searchIndex = path.indexOf(\"?\");\n if (searchIndex >= 0) {\n parsedPath.search = path.substr(searchIndex);\n path = path.substr(0, searchIndex);\n }\n\n if (path) {\n parsedPath.pathname = path;\n }\n }\n\n return parsedPath;\n}\n\nexport interface UrlHistory extends History {}\n\nexport type UrlHistoryOptions = {\n window?: Window;\n v5Compat?: boolean;\n};\n\nfunction getUrlBasedHistory(\n getLocation: (window: Window, globalHistory: Window[\"history\"]) => Location,\n createHref: (window: Window, to: To) => string,\n validateLocation: ((location: Location, to: To) => void) | null,\n options: UrlHistoryOptions = {}\n): UrlHistory {\n let { window = document.defaultView!, v5Compat = false } = options;\n let globalHistory = window.history;\n let action = Action.Pop;\n let listener: Listener | null = null;\n\n let index = getIndex()!;\n // Index should only be null when we initialize. If not, it's because the\n // user called history.pushState or history.replaceState directly, in which\n // case we should log a warning as it will result in bugs.\n if (index == null) {\n index = 0;\n globalHistory.replaceState({ ...globalHistory.state, idx: index }, \"\");\n }\n\n function getIndex(): number {\n let state = globalHistory.state || { idx: null };\n return state.idx;\n }\n\n function handlePop() {\n action = Action.Pop;\n let nextIndex = getIndex();\n let delta = nextIndex == null ? null : nextIndex - index;\n index = nextIndex;\n if (listener) {\n listener({ action, location: history.location, delta });\n }\n }\n\n function push(to: To, state?: any) {\n action = Action.Push;\n let location = createLocation(history.location, to, state);\n if (validateLocation) validateLocation(location, to);\n\n index = getIndex() + 1;\n let historyState = getHistoryState(location, index);\n let url = history.createHref(location);\n\n // try...catch because iOS limits us to 100 pushState calls :/\n try {\n globalHistory.pushState(historyState, \"\", url);\n } catch (error) {\n // They are going to lose state here, but there is no real\n // way to warn them about it since the page will refresh...\n window.location.assign(url);\n }\n\n if (v5Compat && listener) {\n listener({ action, location: history.location, delta: 1 });\n }\n }\n\n function replace(to: To, state?: any) {\n action = Action.Replace;\n let location = createLocation(history.location, to, state);\n if (validateLocation) validateLocation(location, to);\n\n index = getIndex();\n let historyState = getHistoryState(location, index);\n let url = history.createHref(location);\n globalHistory.replaceState(historyState, \"\", url);\n\n if (v5Compat && listener) {\n listener({ action, location: history.location, delta: 0 });\n }\n }\n\n function createURL(to: To): URL {\n // window.location.origin is \"null\" (the literal string value) in Firefox\n // under certain conditions, notably when serving from a local HTML file\n // See https://bugzilla.mozilla.org/show_bug.cgi?id=878297\n let base =\n window.location.origin !== \"null\"\n ? window.location.origin\n : window.location.href;\n\n let href = typeof to === \"string\" ? to : createPath(to);\n invariant(\n base,\n `No window.location.(origin|href) available to create URL for href: ${href}`\n );\n return new URL(href, base);\n }\n\n let history: History = {\n get action() {\n return action;\n },\n get location() {\n return getLocation(window, globalHistory);\n },\n listen(fn: Listener) {\n if (listener) {\n throw new Error(\"A history only accepts one active listener\");\n }\n window.addEventListener(PopStateEventType, handlePop);\n listener = fn;\n\n return () => {\n window.removeEventListener(PopStateEventType, handlePop);\n listener = null;\n };\n },\n createHref(to) {\n return createHref(window, to);\n },\n createURL,\n encodeLocation(to) {\n // Encode a Location the same way window.location would\n let url = createURL(to);\n return {\n pathname: url.pathname,\n search: url.search,\n hash: url.hash,\n };\n },\n push,\n replace,\n go(n) {\n return globalHistory.go(n);\n },\n };\n\n return history;\n}\n\n//#endregion\n", "import type { Location, Path, To } from \"./history\";\nimport { warning, invariant, parsePath } from \"./history\";\n\n/**\n * Map of routeId -> data returned from a loader/action/error\n */\nexport interface RouteData {\n [routeId: string]: any;\n}\n\nexport enum ResultType {\n data = \"data\",\n deferred = \"deferred\",\n redirect = \"redirect\",\n error = \"error\",\n}\n\n/**\n * Successful result from a loader or action\n */\nexport interface SuccessResult {\n type: ResultType.data;\n data: any;\n statusCode?: number;\n headers?: Headers;\n}\n\n/**\n * Successful defer() result from a loader or action\n */\nexport interface DeferredResult {\n type: ResultType.deferred;\n deferredData: DeferredData;\n statusCode?: number;\n headers?: Headers;\n}\n\n/**\n * Redirect result from a loader or action\n */\nexport interface RedirectResult {\n type: ResultType.redirect;\n status: number;\n location: string;\n revalidate: boolean;\n}\n\n/**\n * Unsuccessful result from a loader or action\n */\nexport interface ErrorResult {\n type: ResultType.error;\n error: any;\n headers?: Headers;\n}\n\n/**\n * Result from a loader or action - potentially successful or unsuccessful\n */\nexport type DataResult =\n | SuccessResult\n | DeferredResult\n | RedirectResult\n | ErrorResult;\n\ntype LowerCaseFormMethod = \"get\" | \"post\" | \"put\" | \"patch\" | \"delete\";\ntype UpperCaseFormMethod = Uppercase<LowerCaseFormMethod>;\n\n/**\n * Users can specify either lowercase or uppercase form methods on <Form>,\n * useSubmit(), <fetcher.Form>, etc.\n */\nexport type HTMLFormMethod = LowerCaseFormMethod | UpperCaseFormMethod;\n\n/**\n * Active navigation/fetcher form methods are exposed in lowercase on the\n * RouterState\n */\nexport type FormMethod = LowerCaseFormMethod;\nexport type MutationFormMethod = Exclude<FormMethod, \"get\">;\n\n/**\n * In v7, active navigation/fetcher form methods are exposed in uppercase on the\n * RouterState. This is to align with the normalization done via fetch().\n */\nexport type V7_FormMethod = UpperCaseFormMethod;\nexport type V7_MutationFormMethod = Exclude<V7_FormMethod, \"GET\">;\n\nexport type FormEncType =\n | \"application/x-www-form-urlencoded\"\n | \"multipart/form-data\";\n\n/**\n * @private\n * Internal interface to pass around for action submissions, not intended for\n * external consumption\n */\nexport interface Submission {\n formMethod: FormMethod | V7_FormMethod;\n formAction: string;\n formEncType: FormEncType;\n formData: FormData;\n}\n\n/**\n * @private\n * Arguments passed to route loader/action functions. Same for now but we keep\n * this as a private implementation detail in case they diverge in the future.\n */\ninterface DataFunctionArgs {\n request: Request;\n params: Params;\n context?: any;\n}\n\n/**\n * Arguments passed to loader functions\n */\nexport interface LoaderFunctionArgs extends DataFunctionArgs {}\n\n/**\n * Arguments passed to action functions\n */\nexport interface ActionFunctionArgs extends DataFunctionArgs {}\n\n/**\n * Loaders and actions can return anything except `undefined` (`null` is a\n * valid return value if there is no data to return). Responses are preferred\n * and will ease any future migration to Remix\n */\ntype DataFunctionValue = Response | NonNullable<unknown> | null;\n\n/**\n * Route loader function signature\n */\nexport interface LoaderFunction {\n (args: LoaderFunctionArgs): Promise<DataFunctionValue> | DataFunctionValue;\n}\n\n/**\n * Route action function signature\n */\nexport interface ActionFunction {\n (args: ActionFunctionArgs): Promise<DataFunctionValue> | DataFunctionValue;\n}\n\n/**\n * Route shouldRevalidate function signature. This runs after any submission\n * (navigation or fetcher), so we flatten the navigation/fetcher submission\n * onto the arguments. It shouldn't matter whether it came from a navigation\n * or a fetcher, what really matters is the URLs and the formData since loaders\n * have to re-run based on the data models that were potentially mutated.\n */\nexport interface ShouldRevalidateFunction {\n (args: {\n currentUrl: URL;\n currentParams: AgnosticDataRouteMatch[\"params\"];\n nextUrl: URL;\n nextParams: AgnosticDataRouteMatch[\"params\"];\n formMethod?: Submission[\"formMethod\"];\n formAction?: Submission[\"formAction\"];\n formEncType?: Submission[\"formEncType\"];\n formData?: Submission[\"formData\"];\n actionResult?: DataResult;\n defaultShouldRevalidate: boolean;\n }): boolean;\n}\n\n/**\n * Function provided by the framework-aware layers to set `hasErrorBoundary`\n * from the framework-aware `errorElement` prop\n *\n * @deprecated Use `mapRouteProperties` instead\n */\nexport interface DetectErrorBoundaryFunction {\n (route: AgnosticRouteObject): boolean;\n}\n\n/**\n * Function provided by the framework-aware layers to set any framework-specific\n * properties from framework-agnostic properties\n */\nexport interface MapRoutePropertiesFunction {\n (route: AgnosticRouteObject): {\n hasErrorBoundary: boolean;\n } & Record<string, any>;\n}\n\n/**\n * Keys we cannot change from within a lazy() function. We spread all other keys\n * onto the route. Either they're meaningful to the router, or they'll get\n * ignored.\n */\nexport type ImmutableRouteKey =\n | \"lazy\"\n | \"caseSensitive\"\n | \"path\"\n | \"id\"\n | \"index\"\n | \"children\";\n\nexport const immutableRouteKeys = new Set<ImmutableRouteKey>([\n \"lazy\",\n \"caseSensitive\",\n \"path\",\n \"id\",\n \"index\",\n \"children\",\n]);\n\n/**\n * lazy() function to load a route definition, which can add non-matching\n * related properties to a route\n */\nexport interface LazyRouteFunction<R extends AgnosticRouteObject> {\n (): Promise<Omit<R, ImmutableRouteKey>>;\n}\n\n/**\n * Base RouteObject with common props shared by all types of routes\n */\ntype AgnosticBaseRouteObject = {\n caseSensitive?: boolean;\n path?: string;\n id?: string;\n loader?: LoaderFunction;\n action?: ActionFunction;\n hasErrorBoundary?: boolean;\n shouldRevalidate?: ShouldRevalidateFunction;\n handle?: any;\n lazy?: LazyRouteFunction<AgnosticBaseRouteObject>;\n};\n\n/**\n * Index routes must not have children\n */\nexport type AgnosticIndexRouteObject = AgnosticBaseRouteObject & {\n children?: undefined;\n index: true;\n};\n\n/**\n * Non-index routes may have children, but cannot have index\n */\nexport type AgnosticNonIndexRouteObject = AgnosticBaseRouteObject & {\n children?: AgnosticRouteObject[];\n index?: false;\n};\n\n/**\n * A route object represents a logical route, with (optionally) its child\n * routes organized in a tree-like structure.\n */\nexport type AgnosticRouteObject =\n | AgnosticIndexRouteObject\n | AgnosticNonIndexRouteObject;\n\nexport type AgnosticDataIndexRouteObject = AgnosticIndexRouteObject & {\n id: string;\n};\n\nexport type AgnosticDataNonIndexRouteObject = AgnosticNonIndexRouteObject & {\n children?: AgnosticDataRouteObject[];\n id: string;\n};\n\n/**\n * A data route object, which is just a RouteObject with a required unique ID\n */\nexport type AgnosticDataRouteObject =\n | AgnosticDataIndexRouteObject\n | AgnosticDataNonIndexRouteObject;\n\nexport type RouteManifest = Record<string, AgnosticDataRouteObject | undefined>;\n\n// Recursive helper for finding path parameters in the absence of wildcards\ntype _PathParam<Path extends string> =\n // split path into individual path segments\n Path extends `${infer L}/${infer R}`\n ? _PathParam<L> | _PathParam<R>\n : // find params after `:`\n Path extends `:${infer Param}`\n ? Param extends `${infer Optional}?`\n ? Optional\n : Param\n : // otherwise, there aren't any params present\n never;\n\n/**\n * Examples:\n * \"/a/b/*\" -> \"*\"\n * \":a\" -> \"a\"\n * \"/a/:b\" -> \"b\"\n * \"/a/blahblahblah:b\" -> \"b\"\n * \"/:a/:b\" -> \"a\" | \"b\"\n * \"/:a/b/:c/*\" -> \"a\" | \"c\" | \"*\"\n */\ntype PathParam<Path extends string> =\n // check if path is just a wildcard\n Path extends \"*\" | \"/*\"\n ? \"*\"\n : // look for wildcard at the end of the path\n Path extends `${infer Rest}/*`\n ? \"*\" | _PathParam<Rest>\n : // look for params in the absence of wildcards\n _PathParam<Path>;\n\n// Attempt to parse the given string segment. If it fails, then just return the\n// plain string type as a default fallback. Otherwise return the union of the\n// parsed string literals that were referenced as dynamic segments in the route.\nexport type ParamParseKey<Segment extends string> =\n // if could not find path params, fallback to `string`\n [PathParam<Segment>] extends [never] ? string : PathParam<Segment>;\n\n/**\n * The parameters that were parsed from the URL path.\n */\nexport type Params<Key extends string = string> = {\n readonly [key in Key]: string | undefined;\n};\n\n/**\n * A RouteMatch contains info about how a route matched a URL.\n */\nexport interface AgnosticRouteMatch<\n ParamKey extends string = string,\n RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject\n> {\n /**\n * The names and values of dynamic parameters in the URL.\n */\n params: Params<ParamKey>;\n /**\n * The portion of the URL pathname that was matched.\n */\n pathname: string;\n /**\n * The portion of the URL pathname that was matched before child routes.\n */\n pathnameBase: string;\n /**\n * The route object that was used to match.\n */\n route: RouteObjectType;\n}\n\nexport interface AgnosticDataRouteMatch\n extends AgnosticRouteMatch<string, AgnosticDataRouteObject> {}\n\nfunction isIndexRoute(\n route: AgnosticRouteObject\n): route is AgnosticIndexRouteObject {\n return route.index === true;\n}\n\n// Walk the route tree generating unique IDs where necessary so we are working\n// solely with AgnosticDataRouteObject's within the Router\nexport function convertRoutesToDataRoutes(\n routes: AgnosticRouteObject[],\n mapRouteProperties: MapRoutePropertiesFunction,\n parentPath: number[] = [],\n manifest: RouteManifest = {}\n): AgnosticDataRouteObject[] {\n return routes.map((route, index) => {\n let treePath = [...parentPath, index];\n let id = typeof route.id === \"string\" ? route.id : treePath.join(\"-\");\n invariant(\n route.index !== true || !route.children,\n `Cannot specify children on an index route`\n );\n invariant(\n !manifest[id],\n `Found a route id collision on id \"${id}\". Route ` +\n \"id's must be globally unique within Data Router usages\"\n );\n\n if (isIndexRoute(route)) {\n let indexRoute: AgnosticDataIndexRouteObject = {\n ...route,\n ...mapRouteProperties(route),\n id,\n };\n manifest[id] = indexRoute;\n return indexRoute;\n } else {\n let pathOrLayoutRoute: AgnosticDataNonIndexRouteObject = {\n ...route,\n ...mapRouteProperties(route),\n id,\n children: undefined,\n };\n manifest[id] = pathOrLayoutRoute;\n\n if (route.children) {\n pathOrLayoutRoute.children = convertRoutesToDataRoutes(\n route.children,\n mapRouteProperties,\n treePath,\n manifest\n );\n }\n\n return pathOrLayoutRoute;\n }\n });\n}\n\n/**\n * Matches the given routes to a location and returns the match data.\n *\n * @see https://reactrouter.com/utils/match-routes\n */\nexport function matchRoutes<\n RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject\n>(\n routes: RouteObjectType[],\n locationArg: Partial<Location> | string,\n basename = \"/\"\n): AgnosticRouteMatch<string, RouteObjectType>[] | null {\n let location =\n typeof locationArg === \"string\" ? parsePath(locationArg) : locationArg;\n\n let pathname = stripBasename(location.pathname || \"/\", basename);\n\n if (pathname == null) {\n return null;\n }\n\n let branches = flattenRoutes(routes);\n rankRouteBranches(branches);\n\n let matches = null;\n for (let i = 0; matches == null && i < branches.length; ++i) {\n matches = matchRouteBranch<string, RouteObjectType>(\n branches[i],\n // Incoming pathnames are generally encoded from either window.location\n // or from router.navigate, but we want to match against the unencoded\n // paths in the route definitions. Memory router locations won't be\n // encoded here but there also shouldn't be anything to decode so this\n // should be a safe operation. This avoids needing matchRoutes to be\n // history-aware.\n safelyDecodeURI(pathname)\n );\n }\n\n return matches;\n}\n\ninterface RouteMeta<\n RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject\n> {\n relativePath: string;\n caseSensitive: boolean;\n childrenIndex: number;\n route: RouteObjectType;\n}\n\ninterface RouteBranch<\n RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject\n> {\n path: string;\n score: number;\n routesMeta: RouteMeta<RouteObjectType>[];\n}\n\nfunction flattenRoutes<\n RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject\n>(\n routes: RouteObjectType[],\n branches: RouteBranch<RouteObjectType>[] = [],\n parentsMeta: RouteMeta<RouteObjectType>[] = [],\n parentPath = \"\"\n): RouteBranch<RouteObjectType>[] {\n let flattenRoute = (\n route: RouteObjectType,\n index: number,\n relativePath?: string\n ) => {\n let meta: RouteMeta<RouteObjectType> = {\n relativePath:\n relativePath === undefined ? route.path || \"\" : relativePath,\n caseSensitive: route.caseSensitive === true,\n childrenIndex: index,\n route,\n };\n\n if (meta.relativePath.startsWith(\"/\")) {\n invariant(\n meta.relativePath.startsWith(parentPath),\n `Absolute route path \"${meta.relativePath}\" nested under path ` +\n `\"${parentPath}\" is not valid. An absolute child route path ` +\n `must start with the combined path of all its parent routes.`\n );\n\n meta.relativePath = meta.relativePath.slice(parentPath.length);\n }\n\n let path = joinPaths([parentPath, meta.relativePath]);\n let routesMeta = parentsMeta.concat(meta);\n\n // Add the children before adding this route to the array so we traverse the\n // route tree depth-first and child routes appear before their parents in\n // the \"flattened\" version.\n if (route.children && route.children.length > 0) {\n invariant(\n // Our types know better, but runtime JS may not!\n // @ts-expect-error\n route.index !== true,\n `Index routes must not have child routes. Please remove ` +\n `all child routes from route path \"${path}\".`\n );\n\n flattenRoutes(route.children, branches, routesMeta, path);\n }\n\n // Routes without a path shouldn't ever match by themselves unless they are\n // index routes, so don't add them to the list of possible branches.\n if (route.path == null && !route.index) {\n return;\n }\n\n branches.push({\n path,\n score: computeScore(path, route.index),\n routesMeta,\n });\n };\n routes.forEach((route, index) => {\n // coarse-grain check for optional params\n if (route.path === \"\" || !route.path?.includes(\"?\")) {\n flattenRoute(route, index);\n } else {\n for (let exploded of explodeOptionalSegments(route.path)) {\n flattenRoute(route, index, exploded);\n }\n }\n });\n\n return branches;\n}\n\n/**\n * Computes all combinations of optional path segments for a given path,\n * excluding combinations that are ambiguous and of lower priority.\n *\n * For example, `/one/:two?/three/:four?/:five?` explodes to:\n * - `/one/three`\n * - `/one/:two/three`\n * - `/one/three/:four`\n * - `/one/three/:five`\n * - `/one/:two/three/:four`\n * - `/one/:two/three/:five`\n * - `/one/three/:four/:five`\n * - `/one/:two/three/:four/:five`\n */\nfunction explodeOptionalSegments(path: string): string[] {\n let segments = path.split(\"/\");\n if (segments.length === 0) return [];\n\n let [first, ...rest] = segments;\n\n // Optional path segments are denoted by a trailing `?`\n let isOptional = first.endsWith(\"?\");\n // Compute the corresponding required segment: `foo?` -> `foo`\n let required = first.replace(/\\?$/, \"\");\n\n if (rest.length === 0) {\n // Intepret empty string as omitting an optional segment\n // `[\"one\", \"\", \"three\"]` corresponds to omitting `:two` from `/one/:two?/three` -> `/one/three`\n return isOptional ? [required, \"\"] : [required];\n }\n\n let restExploded = explodeOptionalSegments(rest.join(\"/\"));\n\n let result: string[] = [];\n\n // All child paths with the prefix. Do this for all children before the\n // optional version for all children so we get consistent ordering where the\n // parent optional aspect is preferred as required. Otherwise, we can get\n // child sections interspersed where deeper optional segments are higher than\n // parent optional segments, where for example, /:two would explodes _earlier_\n // then /:one. By always including the parent as required _for all children_\n // first, we avoid this issue\n result.push(\n ...restExploded.map((subpath) =>\n subpath === \"\" ? required : [required, subpath].join(\"/\")\n )\n );\n\n // Then if this is an optional value, add all child versions without\n if (isOptional) {\n result.push(...restExploded);\n }\n\n // for absolute paths, ensure `/` instead of empty segment\n return result.map((exploded) =>\n path.startsWith(\"/\") && exploded === \"\" ? \"/\" : exploded\n );\n}\n\nfunction rankRouteBranches(branches: RouteBranch[]): void {\n branches.sort((a, b) =>\n a.score !== b.score\n ? b.score - a.score // Higher score first\n : compareIndexes(\n a.routesMeta.map((meta) => meta.childrenIndex),\n b.routesMeta.map((meta) => meta.childrenIndex)\n )\n );\n}\n\nconst paramRe = /^:\\w+$/;\nconst dynamicSegmentValue = 3;\nconst indexRouteValue = 2;\nconst emptySegmentValue = 1;\nconst staticSegmentValue = 10;\nconst splatPenalty = -2;\nconst isSplat = (s: string) => s === \"*\";\n\nfunction computeScore(path: string, index: boolean | undefined): number {\n let segments = path.split(\"/\");\n let initialScore = segments.length;\n if (segments.some(isSplat)) {\n initialScore += splatPenalty;\n }\n\n if (index) {\n initialScore += indexRouteValue;\n }\n\n return segments\n .filter((s) => !isSplat(s))\n .reduce(\n (score, segment) =>\n score +\n (paramRe.test(segment)\n ? dynamicSegmentValue\n : segment === \"\"\n ? emptySegmentValue\n : staticSegmentValue),\n initialScore\n );\n}\n\nfunction compareIndexes(a: number[], b: number[]): number {\n let siblings =\n a.length === b.length && a.slice(0, -1).every((n, i) => n === b[i]);\n\n return siblings\n ? // If two routes are siblings, we should try to match the earlier sibling\n // first. This allows people to have fine-grained control over the matching\n // behavior by simply putting routes with identical paths in the order they\n // want them tried.\n a[a.length - 1] - b[b.length - 1]\n : // Otherwise, it doesn't really make sense to rank non-siblings by index,\n // so they sort equally.\n 0;\n}\n\nfunction matchRouteBranch<\n ParamKey extends string = string,\n RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject\n>(\n branch: RouteBranch<RouteObjectType>,\n pathname: string\n): AgnosticRouteMatch<ParamKey, RouteObjectType>[] | null {\n let { routesMeta } = branch;\n\n let matchedParams = {};\n let matchedPathname = \"/\";\n let matches: AgnosticRouteMatch<ParamKey, RouteObjectType>[] = [];\n for (let i = 0; i < routesMeta.length; ++i) {\n let meta = routesMeta[i];\n let end = i === routesMeta.length - 1;\n let remainingPathname =\n matchedPathname === \"/\"\n ? pathname\n : pathname.slice(matchedPathname.length) || \"/\";\n let match = matchPath(\n { path: meta.relativePath, caseSensitive: meta.caseSensitive, end },\n remainingPathname\n );\n\n if (!match) return null;\n\n Object.assign(matchedParams, match.params);\n\n let route = meta.route;\n\n matches.push({\n // TODO: Can this as be avoided?\n params: matchedParams as Params<ParamKey>,\n pathname: joinPaths([matchedPathname, match.pathname]),\n pathnameBase: normalizePathname(\n joinPaths([matchedPathname, match.pathnameBase])\n ),\n route,\n });\n\n if (match.pathnameBase !== \"/\") {\n matchedPathname = joinPaths([matchedPathname, match.pathnameBase]);\n }\n }\n\n return matches;\n}\n\n/**\n * Returns a path with params interpolated.\n *\n * @see https://reactrouter.com/utils/generate-path\n */\nexport function generatePath<Path extends string>(\n originalPath: Path,\n params: {\n [key in PathParam<Path>]: string | null;\n } = {} as any\n): string {\n let path: string = originalPath;\n if (path.endsWith(\"*\") && path !== \"*\" && !path.endsWith(\"/*\")) {\n warning(\n false,\n `Route path \"${path}\" will be treated as if it were ` +\n `\"${path.replace(/\\*$/, \"/*\")}\" because the \\`*\\` character must ` +\n `always follow a \\`/\\` in the pattern. To get rid of this warning, ` +\n `please change the route path to \"${path.replace(/\\*$/, \"/*\")}\".`\n );\n path = path.replace(/\\*$/, \"/*\") as Path;\n }\n\n // ensure `/` is added at the beginning if the path is absolute\n const prefix = path.startsWith(\"/\") ? \"/\" : \"\";\n\n const segments = path\n .split(/\\/+/)\n .map((segment, index, array) => {\n const isLastSegment = index === array.length - 1;\n\n // only apply the splat if it's the last segment\n if (isLastSegment && segment === \"*\") {\n const star = \"*\" as PathParam<Path>;\n const starParam = params[star];\n\n // Apply the splat\n return starParam;\n }\n\n const keyMatch = segment.match(/^:(\\w+)(\\??)$/);\n if (keyMatch) {\n const [, key, optional] = keyMatch;\n let param = params[key as PathParam<Path>];\n\n if (optional === \"?\") {\n return param == null ? \"\" : param;\n }\n\n if (param == null) {\n invariant(false, `Missing \":${key}\" param`);\n }\n\n return param;\n }\n\n // Remove any optional markers from optional static segments\n return segment.replace(/\\?$/g, \"\");\n })\n // Remove empty segments\n .filter((segment) => !!segment);\n\n return prefix + segments.join(\"/\");\n}\n\n/**\n * A PathPattern is used to match on some portion of a URL pathname.\n */\nexport interface PathPattern<Path extends string = string> {\n /**\n * A string to match against a URL pathname. May contain `:id`-style segments\n * to indicate placeholders for dynamic parameters. May also end with `/*` to\n * indicate matching the rest of the URL pathname.\n */\n path: Path;\n /**\n * Should be `true` if the static portions of the `path` should be matched in\n * the same case.\n */\n caseSensitive?: boolean;\n /**\n * Should be `true` if this pattern should match the entire URL pathname.\n */\n end?: boolean;\n}\n\n/**\n * A PathMatch contains info about how a PathPattern matched on a URL pathname.\n */\nexport interface PathMatch<ParamKey extends string = string> {\n /**\n * The names and values of dynamic parameters in the URL.\n */\n params: Params<ParamKey>;\n /**\n * The portion of the URL pathname that was matched.\n */\n pathname: string;\n /**\n * The portion of the URL pathname that was matched before child routes.\n */\n pathnameBase: string;\n /**\n * The pattern that was used to match.\n */\n pattern: PathPattern;\n}\n\ntype Mutable<T> = {\n -readonly [P in keyof T]: T[P];\n};\n\n/**\n * Performs pattern matching on a URL pathname and returns information about\n * the match.\n *\n * @see https://reactrouter.com/utils/match-path\n */\nexport function matchPath<\n ParamKey extends ParamParseKey<Path>,\n Path extends string\n>(\n pattern: PathPattern<Path> | Path,\n pathname: string\n): PathMatch<ParamKey> | null {\n if (typeof pattern === \"string\") {\n pattern = { path: pattern, caseSensitive: false, end: true };\n }\n\n let [matcher, paramNames] = compilePath(\n pattern.path,\n pattern.caseSensitive,\n pattern.end\n );\n\n let match = pathname.match(matcher);\n if (!match) return null;\n\n let matchedPathname = match[0];\n let pathnameBase = matchedPathname.replace(/(.)\\/+$/, \"$1\");\n let captureGroups = match.slice(1);\n let params: Params = paramNames.reduce<Mutable<Params>>(\n (memo, paramName, index) => {\n // We need to compute the pathnameBase here using the raw splat value\n // instead of using params[\"*\"] later because it will be decoded then\n if (paramName === \"*\") {\n let splatValue = captureGroups[index] || \"\";\n pathnameBase = matchedPathname\n .slice(0, matchedPathname.length - splatValue.length)\n .replace(/(.)\\/+$/, \"$1\");\n }\n\n memo[paramName] = safelyDecodeURIComponent(\n captureGroups[index] || \"\",\n paramName\n );\n return memo;\n },\n {}\n );\n\n return {\n params,\n pathname: matchedPathname,\n pathnameBase,\n pattern,\n };\n}\n\nfunction compilePath(\n path: string,\n caseSensitive = false,\n end = true\n): [RegExp, string[]] {\n warning(\n path === \"*\" || !path.endsWith(\"*\") || path.endsWith(\"/*\"),\n `Route path \"${path}\" will be treated as if it were ` +\n `\"${path.replace(/\\*$/, \"/*\")}\" because the \\`*\\` character must ` +\n `always follow a \\`/\\` in the pattern. To get rid of this warning, ` +\n `please change the route path to \"${path.replace(/\\*$/, \"/*\")}\".`\n );\n\n let paramNames: string[] = [];\n let regexpSource =\n \"^\" +\n path\n .replace(/\\/*\\*?$/, \"\") // Ignore trailing / and /*, we'll handle it below\n .replace(/^\\/*/, \"/\") // Make sure it has a leading /\n .replace(/[\\\\.*+^$?{}|()[\\]]/g, \"\\\\$&\") // Escape special regex chars\n .replace(/\\/:(\\w+)/g, (_: string, paramName: string) => {\n paramNames.push(paramName);\n return \"/([^\\\\/]+)\";\n });\n\n if (path.endsWith(\"*\")) {\n paramNames.push(\"*\");\n regexpSource +=\n path === \"*\" || path === \"/*\"\n ? \"(.*)$\" // Already matched the initial /, just match the rest\n : \"(?:\\\\/(.+)|\\\\/*)$\"; // Don't include the / in params[\"*\"]\n } else if (end) {\n // When matching to the end, ignore trailing slashes\n regexpSource += \"\\\\/*$\";\n } else if (path !== \"\" && path !== \"/\") {\n // If our path is non-empty and contains anything beyond an initial slash,\n // then we have _some_ form of path in our regex so we should expect to\n // match only if we find the end of this path segment. Look for an optional\n // non-captured trailing slash (to match a portion of the URL) or the end\n // of the path (if we've matched to the end). We used to do this with a\n // word boundary but that gives false positives on routes like\n // /user-preferences since `-` counts as a word boundary.\n regexpSource += \"(?:(?=\\\\/|$))\";\n } else {\n // Nothing to match for \"\" or \"/\"\n }\n\n let matcher = new RegExp(regexpSource, caseSensitive ? undefined : \"i\");\n\n return [matcher, paramNames];\n}\n\nfunction safelyDecodeURI(value: string) {\n try {\n return decodeURI(value);\n } catch (error) {\n warning(\n false,\n `The URL path \"${value}\" could not be decoded because it is is a ` +\n `malformed URL segment. This is probably due to a bad percent ` +\n `encoding (${error}).`\n );\n\n return value;\n }\n}\n\nfunction safelyDecodeURIComponent(value: string, paramName: string) {\n try {\n return decodeURIComponent(value);\n } catch (error) {\n warning(\n false,\n `The value for the URL param \"${paramName}\" will not be decoded because` +\n ` the string \"${value}\" is a malformed URL segment. This is probably` +\n ` due to a bad percent encoding (${error}).`\n );\n\n return value;\n }\n}\n\n/**\n * @private\n */\nexport function stripBasename(\n pathname: string,\n basename: string\n): string | null {\n if (basename === \"/\") return pathname;\n\n if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) {\n return null;\n }\n\n // We want to leave trailing slash behavior in the user's control, so if they\n // specify a basename with a trailing slash, we should support it\n let startIndex = basename.endsWith(\"/\")\n ? basename.length - 1\n : basename.length;\n let nextChar = pathname.charAt(startIndex);\n if (nextChar && nextChar !== \"/\") {\n // pathname does not start with basename/\n return null;\n }\n\n return pathname.slice(startIndex) || \"/\";\n}\n\n/**\n * Returns a resolved path object relative to the given pathname.\n *\n * @see https://reactrouter.com/utils/resolve-path\n */\nexport function resolvePath(to: To, fromPathname = \"/\"): Path {\n let {\n pathname: toPathname,\n search = \"\",\n hash = \"\",\n } = typeof to === \"string\" ? parsePath(to) : to;\n\n let pathname = toPathname\n ? toPathname.startsWith(\"/\")\n ? toPathname\n : resolvePathname(toPathname, fromPathname)\n : fromPathname;\n\n return {\n pathname,\n search: normalizeSearch(search),\n hash: normalizeHash(hash),\n };\n}\n\nfunction resolvePathname(relativePath: string, fromPathname: string): string {\n let segments = fromPathname.replace(/\\/+$/, \"\").split(\"/\");\n let relativeSegments = relativePath.split(\"/\");\n\n relativeSegments.forEach((segment) => {\n if (segment === \"..\") {\n // Keep the root \"\" segment so the pathname starts at /\n if (segments.length > 1) segments.pop();\n } else if (segment !== \".\") {\n segments.push(segment);\n }\n });\n\n return segments.length > 1 ? segments.join(\"/\") : \"/\";\n}\n\nfunction getInvalidPathError(\n char: string,\n field: string,\n dest: string,\n path: Partial<Path>\n) {\n return (\n `Cannot include a '${char}' character in a manually specified ` +\n `\\`to.${field}\\` field [${JSON.stringify(\n path\n )}]. Please separate it out to the ` +\n `\\`to.${dest}\\` field. Alternatively you may provide the full path as ` +\n `a string in <Link to=\"...\"> and the router will parse it for you.`\n );\n}\n\n/**\n * @private\n *\n * When processing relative navigation we want to ignore ancestor routes that\n * do not contribute to the path, such that index/pathless layout routes don't\n * interfere.\n *\n * For example, when moving a route element into an index route and/or a\n * pathless layout route, relative link behavior contained within should stay\n * the same. Both of the following examples should link back to the root:\n *\n * <Route path=\"/\">\n * <Route path=\"accounts\" element={<Link to=\"..\"}>\n * </Route>\n *\n * <Route path=\"/\">\n * <Route path=\"accounts\">\n * <Route element={<AccountsLayout />}> // <-- Does not contribute\n * <Route index element={<Link to=\"..\"} /> // <-- Does not contribute\n * </Route\n * </Route>\n * </Route>\n */\nexport function getPathContributingMatches<\n T extends AgnosticRouteMatch = AgnosticRouteMatch\n>(matches: T[]) {\n return matches.filter(\n (match, index) =>\n index === 0 || (match.route.path && match.route.path.length > 0)\n );\n}\n\n/**\n * @private\n */\nexport function resolveTo(\n toArg: To,\n routePathnames: string[],\n locationPathname: string,\n isPathRelative = false\n): Path {\n let to: Partial<Path>;\n if (typeof toArg === \"string\") {\n to = parsePath(toArg);\n } else {\n to = { ...toArg };\n\n invariant(\n !to.pathname || !to.pathname.includes(\"?\"),\n getInvalidPathError(\"?\", \"pathname\", \"search\", to)\n );\n invariant(\n !to.pathname || !to.pathname.includes(\"#\"),\n getInvalidPathError(\"#\", \"pathname\", \"hash\", to)\n );\n invariant(\n !to.search || !to.search.includes(\"#\"),\n getInvalidPathError(\"#\", \"search\", \"hash\", to)\n );\n }\n\n let isEmptyPath = toArg === \"\" || to.pathname === \"\";\n let toPathname = isEmptyPath ? \"/\" : to.pathname;\n\n let from: string;\n\n // Routing is relative to the current pathname if explicitly requested.\n //\n // If a pathname is explicitly provided in `to`, it should be relative to the\n // route context. This is explained in `Note on `<Link to>` values` in our\n // migration guide from v5 as a means of disambiguation between `to` values\n // that begin with `/` and those that do not. However, this is problematic for\n // `to` values that do not provide a pathname. `to` can simply be a search or\n // hash string, in which case we should assume that the navigation is relative\n // to the current location's pathname and *not* the route pathname.\n if (isPathRelative || toPathname == null) {\n from = locationPathname;\n } else {\n let routePathnameIndex = routePathnames.length - 1;\n\n if (toPathname.startsWith(\"..\")) {\n let toSegments = toPathname.split(\"/\");\n\n // Each leading .. segment means \"go up one route\" instead of \"go up one\n // URL segment\". This is a key difference from how <a href> works and a\n // major reason we call this a \"to\" value instead of a \"href\".\n while (toSegments[0] === \"..\") {\n toSegments.shift();\n routePathnameIndex -= 1;\n }\n\n to.pathname = toSegments.join(\"/\");\n }\n\n // If there are more \"..\" segments than parent routes, resolve relative to\n // the root / URL.\n from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : \"/\";\n }\n\n let path = resolvePath(to, from);\n\n // Ensure the pathname has a trailing slash if the original \"to\" had one\n let hasExplicitTrailingSlash =\n toPathname && toPathname !== \"/\" && toPathname.endsWith(\"/\");\n // Or if this was a link to the current path which has a trailing slash\n let hasCurrentTrailingSlash =\n (isEmptyPath || toPathname === \".\") && locationPathname.endsWith(\"/\");\n if (\n !path.pathname.endsWith(\"/\") &&\n (hasExplicitTrailingSlash || hasCurrentTrailingSlash)\n ) {\n path.pathname += \"/\";\n }\n\n return path;\n}\n\n/**\n * @private\n */\nexport function getToPathname(to: To): string | undefined {\n // Empty strings should be treated the same as / paths\n return to === \"\" || (to as Path).pathname === \"\"\n ? \"/\"\n : typeof to === \"string\"\n ? parsePath(to).pathname\n : to.pathname;\n}\n\n/**\n * @private\n */\nexport const joinPaths = (paths: string[]): string =>\n paths.join(\"/\").replace(/\\/\\/+/g, \"/\");\n\n/**\n * @private\n */\nexport const normalizePathname = (pathname: string): string =>\n pathname.replace(/\\/+$/, \"\").replace(/^\\/*/, \"/\");\n\n/**\n * @private\n */\nexport const normalizeSearch = (search: string): string =>\n !search || search === \"?\"\n ? \"\"\n : search.startsWith(\"?\")\n ? search\n : \"?\" + search;\n\n/**\n * @private\n */\nexport const normalizeHash = (hash: string): string =>\n !hash || hash === \"#\" ? \"\" : hash.startsWith(\"#\") ? hash : \"#\" + hash;\n\nexport type JsonFunction = <Data>(\n data: Data,\n init?: number | ResponseInit\n) => Response;\n\n/**\n * This is a shortcut for creating `application/json` responses. Converts `data`\n * to JSON and sets the `Content-Type` header.\n */\nexport const json: JsonFunction = (data, init = {}) => {\n let responseInit = typeof init === \"number\" ? { status: init } : init;\n\n let headers = new Headers(responseInit.headers);\n if (!headers.has(\"Content-Type\")) {\n headers.set(\"Content-Type\", \"application/json; charset=utf-8\");\n }\n\n return new Response(JSON.stringify(data), {\n ...responseInit,\n headers,\n });\n};\n\nexport interface TrackedPromise extends Promise<any> {\n _tracked?: boolean;\n _data?: any;\n _error?: any;\n}\n\nexport class AbortedDeferredError extends Error {}\n\nexport class DeferredData {\n private pendingKeysSet: Set<string> = new Set<string>();\n private controller: AbortController;\n private abortPromise: Promise<void>;\n private unlistenAbortSignal: () => void;\n private subscribers: Set<(aborted: boolean, settledKey?: string) => void> =\n new Set();\n data: Record<string, unknown>;\n init?: ResponseInit;\n deferredKeys: string[] = [];\n\n constructor(data: Record<string, unknown>, responseInit?: ResponseInit) {\n invariant(\n data && typeof data === \"object\" && !Array.isArray(data),\n \"defer() only accepts plain objects\"\n );\n\n // Set up an AbortController + Promise we can race against to exit early\n // cancellation\n let reject: (e: AbortedDeferredError) => void;\n this.abortPromise = new Promise((_, r) => (reject = r));\n this.controller = new AbortController();\n let onAbort = () =>\n reject(new AbortedDeferredError(\"Deferred data aborted\"));\n this.unlistenAbortSignal = () =>\n this.controller.signal.removeEventListener(\"abort\", onAbort);\n this.controller.signal.addEventListener(\"abort\", onAbort);\n\n this.data = Object.entries(data).reduce(\n (acc, [key, value]) =>\n Object.assign(acc, {\n [key]: this.trackPromise(key, value),\n }),\n {}\n );\n\n if (this.done) {\n // All incoming values were resolved\n this.unlistenAbortSignal();\n }\n\n this.init = responseInit;\n }\n\n private trackPromise(\n key: string,\n value: Promise<unknown> | unknown\n ): TrackedPromise | unknown {\n if (!(value instanceof Promise)) {\n return value;\n }\n\n this.deferredKeys.push(key);\n this.pendingKeysSet.add(key);\n\n // We store a little wrapper promise that will be extended with\n // _data/_error props upon resolve/reject\n let promise: TrackedPromise = Promise.race([value, this.abortPromise]).then(\n (data) => this.onSettle(promise, key, null, data as unknown),\n (error) => this.onSettle(promise, key, error as unknown)\n );\n\n // Register rejection listeners to avoid uncaught promise rejections on\n // errors or aborted deferred values\n promise.catch(() => {});\n\n Object.defineProperty(promise, \"_tracked\", { get: () => true });\n return promise;\n }\n\n private onSettle(\n promise: TrackedPromise,\n key: string,\n error: unknown,\n data?: unknown\n ): unknown {\n if (\n this.controller.signal.aborted &&\n error instanceof AbortedDeferredError\n ) {\n this.unlistenAbortSignal();\n Object.defineProperty(promise, \"_error\", { get: () => error });\n return Promise.reject(error);\n }\n\n this.pendingKeysSet.delete(key);\n\n if (this.done) {\n // Nothing left to abort!\n this.unlistenAbortSignal();\n }\n\n if (error) {\n Object.defineProperty(promise, \"_error\", { get: () => error });\n this.emit(false, key);\n return Promise.reject(error);\n }\n\n Object.defineProperty(promise, \"_data\", { get: () => data });\n this.emit(false, key);\n return data;\n }\n\n private emit(aborted: boolean, settledKey?: string) {\n this.subscribers.forEach((subscriber) => subscriber(aborted, settledKey));\n }\n\n subscribe(fn: (aborted: boolean, settledKey?: string) => void) {\n this.subscribers.add(fn);\n return () => this.subscribers.delete(fn);\n }\n\n cancel() {\n this.controller.abort();\n this.pendingKeysSet.forEach((v, k) => this.pendingKeysSet.delete(k));\n this.emit(true);\n }\n\n async resolveData(signal: AbortSignal) {\n let aborted = false;\n if (!this.done) {\n let onAbort = () => this.cancel();\n signal.addEventListener(\"abort\", onAbort);\n aborted = await new Promise((resolve) => {\n this.subscribe((aborted) => {\n signal.removeEventListener(\"abort\", onAbort);\n if (aborted || this.done) {\n resolve(aborted);\n }\n });\n });\n }\n return aborted;\n }\n\n get done() {\n return this.pendingKeysSet.size === 0;\n }\n\n get unwrappedData() {\n invariant(\n this.data !== null && this.done,\n \"Can only unwrap data on initialized and settled deferreds\"\n );\n\n return Object.entries(this.data).reduce(\n (acc, [key, value]) =>\n Object.assign(acc, {\n [key]: unwrapTrackedPromise(value),\n }),\n {}\n );\n }\n\n get pendingKeys() {\n return Array.from(this.pendingKeysSet);\n }\n}\n\nfunction isTrackedPromise(value: any): value is TrackedPromise {\n return (\n value instanceof Promise && (value as TrackedPromise)._tracked === true\n );\n}\n\nfunction unwrapTrackedPromise(value: any) {\n if (!isTrackedPromise(value)) {\n return value;\n }\n\n if (value._error) {\n throw value._error;\n }\n return value._data;\n}\n\nexport type DeferFunction = (\n data: Record<string, unknown>,\n init?: number | ResponseInit\n) => DeferredData;\n\nexport const defer: DeferFunction = (data, init = {}) => {\n let responseInit = typeof init === \"number\" ? { status: init } : init;\n\n return new DeferredData(data, responseInit);\n};\n\nexport type RedirectFunction = (\n url: string,\n init?: number | ResponseInit\n) => Response;\n\n/**\n * A redirect response. Sets the status code and the `Location` header.\n * Defaults to \"302 Found\".\n */\nexport const redirect: RedirectFunction = (url, init = 302) => {\n let responseInit = init;\n if (typeof responseInit === \"number\") {\n responseInit = { status: responseInit };\n } else if (typeof responseInit.status === \"undefined\") {\n responseInit.status = 302;\n }\n\n let headers = new Headers(responseInit.headers);\n headers.set(\"Location\", url);\n\n return new Response(null, {\n ...responseInit,\n headers,\n });\n};\n\n/**\n * @private\n * Utility class we use to hold auto-unwrapped 4xx/5xx Response bodies\n */\nexport class ErrorResponse {\n status: number;\n statusText: string;\n data: any;\n error?: Error;\n internal: boolean;\n\n constructor(\n status: number,\n statusText: string | undefined,\n data: any,\n internal = false\n ) {\n this.status = status;\n this.statusText = statusText || \"\";\n this.internal = internal;\n if (data instanceof Error) {\n this.data = data.toString();\n this.error = data;\n } else {\n this.data = data;\n }\n }\n}\n\n/**\n * Check if the given error is an ErrorResponse generated from a 4xx/5xx\n * Response thrown from an action/loader\n */\nexport function isRouteErrorResponse(error: any): error is ErrorResponse {\n return (\n error != null &&\n typeof error.status === \"number\" &&\n typeof error.statusText === \"string\" &&\n typeof error.internal === \"boolean\" &&\n \"data\" in error\n );\n}\n", "import type { History, Location, Path, To } from \"./history\";\nimport {\n Action as HistoryAction,\n createLocation,\n createPath,\n invariant,\n parsePath,\n warning,\n} from \"./history\";\nimport type {\n DataResult,\n DeferredData,\n AgnosticDataRouteMatch,\n AgnosticDataRouteObject,\n DeferredResult,\n ErrorResult,\n FormEncType,\n FormMethod,\n DetectErrorBoundaryFunction,\n RedirectResult,\n RouteData,\n AgnosticRouteObject,\n Submission,\n SuccessResult,\n AgnosticRouteMatch,\n ShouldRevalidateFunction,\n RouteManifest,\n ImmutableRouteKey,\n ActionFunction,\n LoaderFunction,\n V7_MutationFormMethod,\n V7_FormMethod,\n HTMLFormMethod,\n MutationFormMethod,\n MapRoutePropertiesFunction,\n} from \"./utils\";\nimport {\n ErrorResponse,\n ResultType,\n convertRoutesToDataRoutes,\n getPathContributingMatches,\n immutableRouteKeys,\n isRouteErrorResponse,\n joinPaths,\n matchRoutes,\n resolveTo,\n stripBasename,\n} from \"./utils\";\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Types and Constants\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * A Router instance manages all navigation and data loading/mutations\n */\nexport interface Router {\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Return the basename for the router\n */\n get basename(): RouterInit[\"basename\"];\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Return the current state of the router\n */\n get state(): RouterState;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Return the routes for this router instance\n */\n get routes(): AgnosticDataRouteObject[];\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Initialize the router, including adding history listeners and kicking off\n * initial data fetches. Returns a function to cleanup listeners and abort\n * any in-progress loads\n */\n initialize(): Router;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Subscribe to router.state updates\n *\n * @param fn function to call with the new state\n */\n subscribe(fn: RouterSubscriber): () => void;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Enable scroll restoration behavior in the router\n *\n * @param savedScrollPositions Object that will manage positions, in case\n * it's being restored from sessionStorage\n * @param getScrollPosition Function to get the active Y scroll position\n * @param getKey Function to get the key to use for restoration\n */\n enableScrollRestoration(\n savedScrollPositions: Record<string, number>,\n getScrollPosition: GetScrollPositionFunction,\n getKey?: GetScrollRestorationKeyFunction\n ): () => void;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Navigate forward/backward in the history stack\n * @param to Delta to move in the history stack\n */\n navigate(to: number): Promise<void>;\n\n /**\n * Navigate to the given path\n * @param to Path to navigate to\n * @param opts Navigation options (method, submission, etc.)\n */\n navigate(to: To | null, opts?: RouterNavigateOptions): Promise<void>;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Trigger a fetcher load/submission\n *\n * @param key Fetcher key\n * @param routeId Route that owns the fetcher\n * @param href href to fetch\n * @param opts Fetcher options, (method, submission, etc.)\n */\n fetch(\n key: string,\n routeId: string,\n href: string | null,\n opts?: RouterNavigateOptions\n ): void;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Trigger a revalidation of all current route loaders and fetcher loads\n */\n revalidate(): void;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Utility function to create an href for the given location\n * @param location\n */\n createHref(location: Location | URL): string;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Utility function to URL encode a destination path according to the internal\n * history implementation\n * @param to\n */\n encodeLocation(to: To): Path;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Get/create a fetcher for the given key\n * @param key\n */\n getFetcher<TData = any>(key?: string): Fetcher<TData>;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Delete the fetcher for a given key\n * @param key\n */\n deleteFetcher(key?: string): void;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Cleanup listeners and abort any in-progress loads\n */\n dispose(): void;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Get a navigation blocker\n * @param key The identifier for the blocker\n * @param fn The blocker function implementation\n */\n getBlocker(key: string, fn: BlockerFunction): Blocker;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Delete a navigation blocker\n * @param key The identifier for the blocker\n */\n deleteBlocker(key: string): void;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * HMR needs to pass in-flight route updates to React Router\n * TODO: Replace this with granular route update APIs (addRoute, updateRoute, deleteRoute)\n */\n _internalSetRoutes(routes: AgnosticRouteObject[]): void;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Internal fetch AbortControllers accessed by unit tests\n */\n _internalFetchControllers: Map<string, AbortController>;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Internal pending DeferredData instances accessed by unit tests\n */\n _internalActiveDeferreds: Map<string, DeferredData>;\n}\n\n/**\n * State maintained internally by the router. During a navigation, all states\n * reflect the the \"old\" location unless otherwise noted.\n */\nexport interface RouterState {\n /**\n * The action of the most recent navigation\n */\n historyAction: HistoryAction;\n\n /**\n * The current location reflected by the router\n */\n location: Location;\n\n /**\n * The current set of route matches\n */\n matches: AgnosticDataRouteMatch[];\n\n /**\n * Tracks whether we've completed our initial data load\n */\n initialized: boolean;\n\n /**\n * Current scroll position we should start at for a new view\n * - number -> scroll position to restore to\n * - false -> do not restore scroll at all (used during submissions)\n * - null -> don't have a saved position, scroll to hash or top of page\n */\n restoreScrollPosition: number | false | null;\n\n /**\n * Indicate whether this navigation should skip resetting the scroll position\n * if we are unable to restore the scroll position\n */\n preventScrollReset: boolean;\n\n /**\n * Tracks the state of the current navigation\n */\n navigation: Navigation;\n\n /**\n * Tracks any in-progress revalidations\n */\n revalidation: RevalidationState;\n\n /**\n * Data from the loaders for the current matches\n */\n loaderData: RouteData;\n\n /**\n * Data from the action for the current matches\n */\n actionData: RouteData | null;\n\n /**\n * Errors caught from loaders for the current matches\n */\n errors: RouteData | null;\n\n /**\n * Map of current fetchers\n */\n fetchers: Map<string, Fetcher>;\n\n /**\n * Map of current blockers\n */\n blockers: Map<string, Blocker>;\n}\n\n/**\n * Data that can be passed into hydrate a Router from SSR\n */\nexport type HydrationState = Partial<\n Pick<RouterState, \"loaderData\" | \"actionData\" | \"errors\">\n>;\n\n/**\n * Future flags to toggle new feature behavior\n */\nexport interface FutureConfig {\n v7_normalizeFormMethod: boolean;\n v7_prependBasename: boolean;\n}\n\n/**\n * Initialization options for createRouter\n */\nexport interface RouterInit {\n routes: AgnosticRouteObject[];\n history: History;\n basename?: string;\n /**\n * @deprecated Use `mapRouteProperties` instead\n */\n detectErrorBoundary?: DetectErrorBoundaryFunction;\n mapRouteProperties?: MapRoutePropertiesFunction;\n future?: Partial<FutureConfig>;\n hydrationData?: HydrationState;\n}\n\n/**\n * State returned from a server-side query() call\n */\nexport interface StaticHandlerContext {\n basename: Router[\"basename\"];\n location: RouterState[\"location\"];\n matches: RouterState[\"matches\"];\n loaderData: RouterState[\"loaderData\"];\n actionData: RouterState[\"actionData\"];\n errors: RouterState[\"errors\"];\n statusCode: number;\n loaderHeaders: Record<string, Headers>;\n actionHeaders: Record<string, Headers>;\n activeDeferreds: Record<string, DeferredData> | null;\n _deepestRenderedBoundaryId?: string | null;\n}\n\n/**\n * A StaticHandler instance manages a singular SSR navigation/fetch event\n */\nexport interface StaticHandler {\n dataRoutes: AgnosticDataRouteObject[];\n query(\n request: Request,\n opts?: { requestContext?: unknown }\n ): Promise<StaticHandlerContext | Response>;\n queryRoute(\n request: Request,\n opts?: { routeId?: string; requestContext?: unknown }\n ): Promise<any>;\n}\n\n/**\n * Subscriber function signature for changes to router state\n */\nexport interface RouterSubscriber {\n (state: RouterState): void;\n}\n\ninterface UseMatchesMatch {\n id: string;\n pathname: string;\n params: AgnosticRouteMatch[\"params\"];\n data: unknown;\n handle: unknown;\n}\n\n/**\n * Function signature for determining the key to be used in scroll restoration\n * for a given location\n */\nexport interface GetScrollRestorationKeyFunction {\n (location: Location, matches: UseMatchesMatch[]): string | null;\n}\n\n/**\n * Function signature for determining the current scroll position\n */\nexport interface GetScrollPositionFunction {\n (): number;\n}\n\nexport type RelativeRoutingType = \"route\" | \"path\";\n\ntype BaseNavigateOptions = {\n replace?: boolean;\n state?: any;\n preventScrollReset?: boolean;\n relative?: RelativeRoutingType;\n fromRouteId?: string;\n};\n\n/**\n * Options for a navigate() call for a Link navigation\n */\ntype LinkNavigateOptions = BaseNavigateOptions;\n\n/**\n * Options for a navigate() call for a Form navigation\n */\ntype SubmissionNavigateOptions = BaseNavigateOptions & {\n formMethod?: HTMLFormMethod;\n formEncType?: FormEncType;\n formData: FormData;\n};\n\n/**\n * Options to pass to navigate() for either a Link or Form navigation\n */\nexport type RouterNavigateOptions =\n | LinkNavigateOptions\n | SubmissionNavigateOptions;\n\n/**\n * Options to pass to fetch()\n */\nexport type RouterFetchOptions =\n | Omit<LinkNavigateOptions, \"replace\">\n | Omit<SubmissionNavigateOptions, \"replace\">;\n\n/**\n * Potential states for state.navigation\n */\nexport type NavigationStates = {\n Idle: {\n state: \"idle\";\n location: undefined;\n formMethod: undefined;\n formAction: undefined;\n formEncType: undefined;\n formData: undefined;\n };\n Loading: {\n state: \"loading\";\n location: Location;\n formMethod: FormMethod | V7_FormMethod | undefined;\n formAction: string | undefined;\n formEncType: FormEncType | undefined;\n formData: FormData | undefined;\n };\n Submitting: {\n state: \"submitting\";\n location: Location;\n formMethod: FormMethod | V7_FormMethod;\n formAction: string;\n formEncType: FormEncType;\n formData: FormData;\n };\n};\n\nexport type Navigation = NavigationStates[keyof NavigationStates];\n\nexport type RevalidationState = \"idle\" | \"loading\";\n\n/**\n * Potential states for fetchers\n */\ntype FetcherStates<TData = any> = {\n Idle: {\n state: \"idle\";\n formMethod: undefined;\n formAction: undefined;\n formEncType: undefined;\n formData: undefined;\n data: TData | undefined;\n \" _hasFetcherDoneAnything \"?: boolean;\n };\n Loading: {\n state: \"loading\";\n formMethod: FormMethod | V7_FormMethod | undefined;\n formAction: string | undefined;\n formEncType: FormEncType | undefined;\n formData: FormData | undefined;\n data: TData | undefined;\n \" _hasFetcherDoneAnything \"?: boolean;\n };\n Submitting: {\n state: \"submitting\";\n formMethod: FormMethod | V7_FormMethod;\n formAction: string;\n formEncType: FormEncType;\n formData: FormData;\n data: TData | undefined;\n \" _hasFetcherDoneAnything \"?: boolean;\n };\n};\n\nexport type Fetcher<TData = any> =\n FetcherStates<TData>[keyof FetcherStates<TData>];\n\ninterface BlockerBlocked {\n state: \"blocked\";\n reset(): void;\n proceed(): void;\n location: Location;\n}\n\ninterface BlockerUnblocked {\n state: \"unblocked\";\n reset: undefined;\n proceed: undefined;\n location: undefined;\n}\n\ninterface BlockerProceeding {\n state: \"proceeding\";\n reset: undefined;\n proceed: undefined;\n location: Location;\n}\n\nexport type Blocker = BlockerUnblocked | BlockerBlocked | BlockerProceeding;\n\nexport type BlockerFunction = (args: {\n currentLocation: Location;\n nextLocation: Location;\n historyAction: HistoryAction;\n}) => boolean;\n\ninterface ShortCircuitable {\n /**\n * startNavigation does not need to complete the navigation because we\n * redirected or got interrupted\n */\n shortCircuited?: boolean;\n}\n\ninterface HandleActionResult extends ShortCircuitable {\n /**\n * Error thrown from the current action, keyed by the route containing the\n * error boundary to render the error. To be committed to the state after\n * loaders have completed\n */\n pendingActionError?: RouteData;\n /**\n * Data returned from the current action, keyed by the route owning the action.\n * To be committed to the state after loaders have completed\n */\n pendingActionData?: RouteData;\n}\n\ninterface HandleLoadersResult extends ShortCircuitable {\n /**\n * loaderData returned from the current set of loaders\n */\n loaderData?: RouterState[\"loaderData\"];\n /**\n * errors thrown from the current set of loaders\n */\n errors?: RouterState[\"errors\"];\n}\n\n/**\n * Cached info for active fetcher.load() instances so they can participate\n * in revalidation\n */\ninterface FetchLoadMatch {\n routeId: string;\n path: string;\n}\n\n/**\n * Identified fetcher.load() calls that need to be revalidated\n */\ninterface RevalidatingFetcher extends FetchLoadMatch {\n key: string;\n match: AgnosticDataRouteMatch | null;\n matches: AgnosticDataRouteMatch[] | null;\n controller: AbortController | null;\n}\n\n/**\n * Wrapper object to allow us to throw any response out from callLoaderOrAction\n * for queryRouter while preserving whether or not it was thrown or returned\n * from the loader/action\n */\ninterface QueryRouteResponse {\n type: ResultType.data | ResultType.error;\n response: Response;\n}\n\nconst validMutationMethodsArr: MutationFormMethod[] = [\n \"post\",\n \"put\",\n \"patch\",\n \"delete\",\n];\nconst validMutationMethods = new Set<MutationFormMethod>(\n validMutationMethodsArr\n);\n\nconst validRequestMethodsArr: FormMethod[] = [\n \"get\",\n ...validMutationMethodsArr,\n];\nconst validRequestMethods = new Set<FormMethod>(validRequestMethodsArr);\n\nconst redirectStatusCodes = new Set([301, 302, 303, 307, 308]);\nconst redirectPreserveMethodStatusCodes = new Set([307, 308]);\n\nexport const IDLE_NAVIGATION: NavigationStates[\"Idle\"] = {\n state: \"idle\",\n location: undefined,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n};\n\nexport const IDLE_FETCHER: FetcherStates[\"Idle\"] = {\n state: \"idle\",\n data: undefined,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n};\n\nexport const IDLE_BLOCKER: BlockerUnblocked = {\n state: \"unblocked\",\n proceed: undefined,\n reset: undefined,\n location: undefined,\n};\n\nconst ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i;\n\nconst isBrowser =\n typeof window !== \"undefined\" &&\n typeof window.document !== \"undefined\" &&\n typeof window.document.createElement !== \"undefined\";\nconst isServer = !isBrowser;\n\nconst defaultMapRouteProperties: MapRoutePropertiesFunction = (route) => ({\n hasErrorBoundary: Boolean(route.hasErrorBoundary),\n});\n\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region createRouter\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Create a router and listen to history POP navigations\n */\nexport function createRouter(init: RouterInit): Router {\n invariant(\n init.routes.length > 0,\n \"You must provide a non-empty routes array to createRouter\"\n );\n\n let mapRouteProperties: MapRoutePropertiesFunction;\n if (init.mapRouteProperties) {\n mapRouteProperties = init.mapRouteProperties;\n } else if (init.detectErrorBoundary) {\n // If they are still using the deprecated version, wrap it with the new API\n let detectErrorBoundary = init.detectErrorBoundary;\n mapRouteProperties = (route) => ({\n hasErrorBoundary: detectErrorBoundary(route),\n });\n } else {\n mapRouteProperties = defaultMapRouteProperties;\n }\n\n // Routes keyed by ID\n let manifest: RouteManifest = {};\n // Routes in tree format for matching\n let dataRoutes = convertRoutesToDataRoutes(\n init.routes,\n mapRouteProperties,\n undefined,\n manifest\n );\n let inFlightDataRoutes: AgnosticDataRouteObject[] | undefined;\n let basename = init.basename || \"/\";\n // Config driven behavior flags\n let future: FutureConfig = {\n v7_normalizeFormMethod: false,\n v7_prependBasename: false,\n ...init.future,\n };\n // Cleanup function for history\n let unlistenHistory: (() => void) | null = null;\n // Externally-provided functions to call on all state changes\n let subscribers = new Set<RouterSubscriber>();\n // Externally-provided object to hold scroll restoration locations during routing\n let savedScrollPositions: Record<string, number> | null = null;\n // Externally-provided function to get scroll restoration keys\n let getScrollRestorationKey: GetScrollRestorationKeyFunction | null = null;\n // Externally-provided function to get current scroll position\n let getScrollPosition: GetScrollPositionFunction | null = null;\n // One-time flag to control the initial hydration scroll restoration. Because\n // we don't get the saved positions from <ScrollRestoration /> until _after_\n // the initial render, we need to manually trigger a separate updateState to\n // send along the restoreScrollPosition\n // Set to true if we have `hydrationData` since we assume we were SSR'd and that\n // SSR did the initial scroll restoration.\n let initialScrollRestored = init.hydrationData != null;\n\n let initialMatches = matchRoutes(dataRoutes, init.history.location, basename);\n let initialErrors: RouteData | null = null;\n\n if (initialMatches == null) {\n // If we do not match a user-provided-route, fall back to the root\n // to allow the error boundary to take over\n let error = getInternalRouterError(404, {\n pathname: init.history.location.pathname,\n });\n let { matches, route } = getShortCircuitMatches(dataRoutes);\n initialMatches = matches;\n initialErrors = { [route.id]: error };\n }\n\n let initialized =\n // All initialMatches need to be loaded before we're ready. If we have lazy\n // functions around still then we'll need to run them in initialize()\n !initialMatches.some((m) => m.route.lazy) &&\n // And we have to either have no loaders or have been provided hydrationData\n (!initialMatches.some((m) => m.route.loader) || init.hydrationData != null);\n\n let router: Router;\n let state: RouterState = {\n historyAction: init.history.action,\n location: init.history.location,\n matches: initialMatches,\n initialized,\n navigation: IDLE_NAVIGATION,\n // Don't restore on initial updateState() if we were SSR'd\n restoreScrollPosition: init.hydrationData != null ? false : null,\n preventScrollReset: false,\n revalidation: \"idle\",\n loaderData: (init.hydrationData && init.hydrationData.loaderData) || {},\n actionData: (init.hydrationData && init.hydrationData.actionData) || null,\n errors: (init.hydrationData && init.hydrationData.errors) || initialErrors,\n fetchers: new Map(),\n blockers: new Map(),\n };\n\n // -- Stateful internal variables to manage navigations --\n // Current navigation in progress (to be committed in completeNavigation)\n let pendingAction: HistoryAction = HistoryAction.Pop;\n\n // Should the current navigation prevent the scroll reset if scroll cannot\n // be restored?\n let pendingPreventScrollReset = false;\n\n // AbortController for the active navigation\n let pendingNavigationController: AbortController | null;\n\n // We use this to avoid touching history in completeNavigation if a\n // revalidation is entirely uninterrupted\n let isUninterruptedRevalidation = false;\n\n // Use this internal flag to force revalidation of all loaders:\n // - submissions (completed or interrupted)\n // - useRevalidator()\n // - X-Remix-Revalidate (from redirect)\n let isRevalidationRequired = false;\n\n // Use this internal array to capture routes that require revalidation due\n // to a cancelled deferred on action submission\n let cancelledDeferredRoutes: string[] = [];\n\n // Use this internal array to capture fetcher loads that were cancelled by an\n // action navigation and require revalidation\n let cancelledFetcherLoads: string[] = [];\n\n // AbortControllers for any in-flight fetchers\n let fetchControllers = new Map<string, AbortController>();\n\n // Track loads based on the order in which they started\n let incrementingLoadId = 0;\n\n // Track the outstanding pending navigation data load to be compared against\n // the globally incrementing load when a fetcher load lands after a completed\n // navigation\n let pendingNavigationLoadId = -1;\n\n // Fetchers that triggered data reloads as a result of their actions\n let fetchReloadIds = new Map<string, number>();\n\n // Fetchers that triggered redirect navigations\n let fetchRedirectIds = new Set<string>();\n\n // Most recent href/match for fetcher.load calls for fetchers\n let fetchLoadMatches = new Map<string, FetchLoadMatch>();\n\n // Store DeferredData instances for active route matches. When a\n // route loader returns defer() we stick one in here. Then, when a nested\n // promise resolves we update loaderData. If a new navigation starts we\n // cancel active deferreds for eliminated routes.\n let activeDeferreds = new Map<string, DeferredData>();\n\n // Store blocker functions in a separate Map outside of router state since\n // we don't need to update UI state if they change\n let blockerFunctions = new Map<string, BlockerFunction>();\n\n // Flag to ignore the next history update, so we can revert the URL change on\n // a POP navigation that was blocked by the user without touching router state\n let ignoreNextHistoryUpdate = false;\n\n // Initialize the router, all side effects should be kicked off from here.\n // Implemented as a Fluent API for ease of:\n // let router = createRouter(init).initialize();\n function initialize() {\n // If history informs us of a POP navigation, start the navigation but do not update\n // state. We'll update our own state once the navigation completes\n unlistenHistory = init.history.listen(\n ({ action: historyAction, location, delta }) => {\n // Ignore this event if it was just us resetting the URL from a\n // blocked POP navigation\n if (ignoreNextHistoryUpdate) {\n ignoreNextHistoryUpdate = false;\n return;\n }\n\n warning(\n blockerFunctions.size === 0 || delta != null,\n \"You are trying to use a blocker on a POP navigation to a location \" +\n \"that was not created by @remix-run/router. This will fail silently in \" +\n \"production. This can happen if you are navigating outside the router \" +\n \"via `window.history.pushState`/`window.location.hash` instead of using \" +\n \"router navigation APIs. This can also happen if you are using \" +\n \"createHashRouter and the user manually changes the URL.\"\n );\n\n let blockerKey = shouldBlockNavigation({\n currentLocation: state.location,\n nextLocation: location,\n historyAction,\n });\n\n if (blockerKey && delta != null) {\n // Restore the URL to match the current UI, but don't update router state\n ignoreNextHistoryUpdate = true;\n init.history.go(delta * -1);\n\n // Put the blocker into a blocked state\n updateBlocker(blockerKey, {\n state: \"blocked\",\n location,\n proceed() {\n updateBlocker(blockerKey!, {\n state: \"proceeding\",\n proceed: undefined,\n reset: undefined,\n location,\n });\n // Re-do the same POP navigation we just blocked\n init.history.go(delta);\n },\n reset() {\n deleteBlocker(blockerKey!);\n updateState({ blockers: new Map(router.state.blockers) });\n },\n });\n return;\n }\n\n return startNavigation(historyAction, location);\n }\n );\n\n // Kick off initial data load if needed. Use Pop to avoid modifying history\n // Note we don't do any handling of lazy here. For SPA's it'll get handled\n // in the normal navigation flow. For SSR it's expected that lazy modules are\n // resolved prior to router creation since we can't go into a fallbackElement\n // UI for SSR'd apps\n if (!state.initialized) {\n startNavigation(HistoryAction.Pop, state.location);\n }\n\n return router;\n }\n\n // Clean up a router and it's side effects\n function dispose() {\n if (unlistenHistory) {\n unlistenHistory();\n }\n subscribers.clear();\n pendingNavigationController && pendingNavigationController.abort();\n state.fetchers.forEach((_, key) => deleteFetcher(key));\n state.blockers.forEach((_, key) => deleteBlocker(key));\n }\n\n // Subscribe to state updates for the router\n function subscribe(fn: RouterSubscriber) {\n subscribers.add(fn);\n return () => subscribers.delete(fn);\n }\n\n // Update our state and notify the calling context of the change\n function updateState(newState: Partial<RouterState>): void {\n state = {\n ...state,\n ...newState,\n };\n subscribers.forEach((subscriber) => subscriber(state));\n }\n\n // Complete a navigation returning the state.navigation back to the IDLE_NAVIGATION\n // and setting state.[historyAction/location/matches] to the new route.\n // - Location is a required param\n // - Navigation will always be set to IDLE_NAVIGATION\n // - Can pass any other state in newState\n function completeNavigation(\n location: Location,\n newState: Partial<Omit<RouterState, \"action\" | \"location\" | \"navigation\">>\n ): void {\n // Deduce if we're in a loading/actionReload state:\n // - We have committed actionData in the store\n // - The current navigation was a mutation submission\n // - We're past the submitting state and into the loading state\n // - The location being loaded is not the result of a redirect\n let isActionReload =\n state.actionData != null &&\n state.navigation.formMethod != null &&\n isMutationMethod(state.navigation.formMethod) &&\n state.navigation.state === \"loading\" &&\n location.state?._isRedirect !== true;\n\n let actionData: RouteData | null;\n if (newState.actionData) {\n if (Object.keys(newState.actionData).length > 0) {\n actionData = newState.actionData;\n } else {\n // Empty actionData -> clear prior actionData due to an action error\n actionData = null;\n }\n } else if (isActionReload) {\n // Keep the current data if we're wrapping up the action reload\n actionData = state.actionData;\n } else {\n // Clear actionData on any other completed navigations\n actionData = null;\n }\n\n // Always preserve any existing loaderData from re-used routes\n let loaderData = newState.loaderData\n ? mergeLoaderData(\n state.loaderData,\n newState.loaderData,\n newState.matches || [],\n newState.errors\n )\n : state.loaderData;\n\n // On a successful navigation we can assume we got through all blockers\n // so we can start fresh\n for (let [key] of blockerFunctions) {\n deleteBlocker(key);\n }\n\n // Always respect the user flag. Otherwise don't reset on mutation\n // submission navigations unless they redirect\n let preventScrollReset =\n pendingPreventScrollReset === true ||\n (state.navigation.formMethod != null &&\n isMutationMethod(state.navigation.formMethod) &&\n location.state?._isRedirect !== true);\n\n if (inFlightDataRoutes) {\n dataRoutes = inFlightDataRoutes;\n inFlightDataRoutes = undefined;\n }\n\n updateState({\n ...newState, // matches, errors, fetchers go through as-is\n actionData,\n loaderData,\n historyAction: pendingAction,\n location,\n initialized: true,\n navigation: IDLE_NAVIGATION,\n revalidation: \"idle\",\n restoreScrollPosition: getSavedScrollPosition(\n location,\n newState.matches || state.matches\n ),\n preventScrollReset,\n blockers: new Map(state.blockers),\n });\n\n if (isUninterruptedRevalidation) {\n // If this was an uninterrupted revalidation then do not touch history\n } else if (pendingAction === HistoryAction.Pop) {\n // Do nothing for POP - URL has already been updated\n } else if (pendingAction === HistoryAction.Push) {\n init.history.push(location, location.state);\n } else if (pendingAction === HistoryAction.Replace) {\n init.history.replace(location, location.state);\n }\n\n // Reset stateful navigation vars\n pendingAction = HistoryAction.Pop;\n pendingPreventScrollReset = false;\n isUninterruptedRevalidation = false;\n isRevalidationRequired = false;\n cancelledDeferredRoutes = [];\n cancelledFetcherLoads = [];\n }\n\n // Trigger a navigation event, which can either be a numerical POP or a PUSH\n // replace with an optional submission\n async function navigate(\n to: number | To | null,\n opts?: RouterNavigateOptions\n ): Promise<void> {\n if (typeof to === \"number\") {\n init.history.go(to);\n return;\n }\n\n let normalizedPath = normalizeTo(\n state.location,\n state.matches,\n basename,\n future.v7_prependBasename,\n to,\n opts?.fromRouteId,\n opts?.relative\n );\n let { path, submission, error } = normalizeNavigateOptions(\n future.v7_normalizeFormMethod,\n false,\n normalizedPath,\n opts\n );\n\n let currentLocation = state.location;\n let nextLocation = createLocation(state.location, path, opts && opts.state);\n\n // When using navigate as a PUSH/REPLACE we aren't reading an already-encoded\n // URL from window.location, so we need to encode it here so the behavior\n // remains the same as POP and non-data-router usages. new URL() does all\n // the same encoding we'd get from a history.pushState/window.location read\n // without having to touch history\n nextLocation = {\n ...nextLocation,\n ...init.history.encodeLocation(nextLocation),\n };\n\n let userReplace = opts && opts.replace != null ? opts.replace : undefined;\n\n let historyAction = HistoryAction.Push;\n\n if (userReplace === true) {\n historyAction = HistoryAction.Replace;\n } else if (userReplace === false) {\n // no-op\n } else if (\n submission != null &&\n isMutationMethod(submission.formMethod) &&\n submission.formAction === state.location.pathname + state.location.search\n ) {\n // By default on submissions to the current location we REPLACE so that\n // users don't have to double-click the back button to get to the prior\n // location. If the user redirects to a different location from the\n // action/loader this will be ignored and the redirect will be a PUSH\n historyAction = HistoryAction.Replace;\n }\n\n let preventScrollReset =\n opts && \"preventScrollReset\" in opts\n ? opts.preventScrollReset === true\n : undefined;\n\n let blockerKey = shouldBlockNavigation({\n currentLocation,\n nextLocation,\n historyAction,\n });\n if (blockerKey) {\n // Put the blocker into a blocked state\n updateBlocker(blockerKey, {\n state: \"blocked\",\n location: nextLocation,\n proceed() {\n updateBlocker(blockerKey!, {\n state: \"proceeding\",\n proceed: undefined,\n reset: undefined,\n location: nextLocation,\n });\n // Send the same navigation through\n navigate(to, opts);\n },\n reset() {\n deleteBlocker(blockerKey!);\n updateState({ blockers: new Map(state.blockers) });\n },\n });\n return;\n }\n\n return await startNavigation(historyAction, nextLocation, {\n submission,\n // Send through the formData serialization error if we have one so we can\n // render at the right error boundary after we match routes\n pendingError: error,\n preventScrollReset,\n replace: opts && opts.replace,\n });\n }\n\n // Revalidate all current loaders. If a navigation is in progress or if this\n // is interrupted by a navigation, allow this to \"succeed\" by calling all\n // loaders during the next loader round\n function revalidate() {\n interruptActiveLoads();\n updateState({ revalidation: \"loading\" });\n\n // If we're currently submitting an action, we don't need to start a new\n // navigation, we'll just let the follow up loader execution call all loaders\n if (state.navigation.state === \"submitting\") {\n return;\n }\n\n // If we're currently in an idle state, start a new navigation for the current\n // action/location and mark it as uninterrupted, which will skip the history\n // update in completeNavigation\n if (state.navigation.state === \"idle\") {\n startNavigation(state.historyAction, state.location, {\n startUninterruptedRevalidation: true,\n });\n return;\n }\n\n // Otherwise, if we're currently in a loading state, just start a new\n // navigation to the navigation.location but do not trigger an uninterrupted\n // revalidation so that history correctly updates once the navigation completes\n startNavigation(\n pendingAction || state.historyAction,\n state.navigation.location,\n { overrideNavigation: state.navigation }\n );\n }\n\n // Start a navigation to the given action/location. Can optionally provide a\n // overrideNavigation which will override the normalLoad in the case of a redirect\n // navigation\n async function startNavigation(\n historyAction: HistoryAction,\n location: Location,\n opts?: {\n submission?: Submission;\n fetcherSubmission?: Submission;\n overrideNavigation?: Navigation;\n pendingError?: ErrorResponse;\n startUninterruptedRevalidation?: boolean;\n preventScrollReset?: boolean;\n replace?: boolean;\n }\n ): Promise<void> {\n // Abort any in-progress navigations and start a new one. Unset any ongoing\n // uninterrupted revalidations unless told otherwise, since we want this\n // new navigation to update history normally\n pendingNavigationController && pendingNavigationController.abort();\n pendingNavigationController = null;\n pendingAction = historyAction;\n isUninterruptedRevalidation =\n (opts && opts.startUninterruptedRevalidation) === true;\n\n // Save the current scroll position every time we start a new navigation,\n // and track whether we should reset scroll on completion\n saveScrollPosition(state.location, state.matches);\n pendingPreventScrollReset = (opts && opts.preventScrollReset) === true;\n\n let routesToUse = inFlightDataRoutes || dataRoutes;\n let loadingNavigation = opts && opts.overrideNavigation;\n let matches = matchRoutes(routesToUse, location, basename);\n\n // Short circuit with a 404 on the root error boundary if we match nothing\n if (!matches) {\n let error = getInternalRouterError(404, { pathname: location.pathname });\n let { matches: notFoundMatches, route } =\n getShortCircuitMatches(routesToUse);\n // Cancel all pending deferred on 404s since we don't keep any routes\n cancelActiveDeferreds();\n completeNavigation(location, {\n matches: notFoundMatches,\n loaderData: {},\n errors: {\n [route.id]: error,\n },\n });\n return;\n }\n\n // Short circuit if it's only a hash change and not a mutation submission.\n // Ignore on initial page loads because since the initial load will always\n // be \"same hash\".\n // For example, on /page#hash and submit a <Form method=\"post\"> which will\n // default to a navigation to /page\n if (\n state.initialized &&\n isHashChangeOnly(state.location, location) &&\n !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))\n ) {\n completeNavigation(location, { matches });\n return;\n }\n\n // Create a controller/Request for this navigation\n pendingNavigationController = new AbortController();\n let request = createClientSideRequest(\n init.history,\n location,\n pendingNavigationController.signal,\n opts && opts.submission\n );\n let pendingActionData: RouteData | undefined;\n let pendingError: RouteData | undefined;\n\n if (opts && opts.pendingError) {\n // If we have a pendingError, it means the user attempted a GET submission\n // with binary FormData so assign here and skip to handleLoaders. That\n // way we handle calling loaders above the boundary etc. It's not really\n // different from an actionError in that sense.\n pendingError = {\n [findNearestBoundary(matches).route.id]: opts.pendingError,\n };\n } else if (\n opts &&\n opts.submission &&\n isMutationMethod(opts.submission.formMethod)\n ) {\n // Call action if we received an action submission\n let actionOutput = await handleAction(\n request,\n location,\n opts.submission,\n matches,\n { replace: opts.replace }\n );\n\n if (actionOutput.shortCircuited) {\n return;\n }\n\n pendingActionData = actionOutput.pendingActionData;\n pendingError = actionOutput.pendingActionError;\n\n let navigation: NavigationStates[\"Loading\"] = {\n state: \"loading\",\n location,\n ...opts.submission,\n };\n loadingNavigation = navigation;\n\n // Create a GET request for the loaders\n request = new Request(request.url, { signal: request.signal });\n }\n\n // Call loaders\n let { shortCircuited, loaderData, errors } = await handleLoaders(\n request,\n location,\n matches,\n loadingNavigation,\n opts && opts.submission,\n opts && opts.fetcherSubmission,\n opts && opts.replace,\n pendingActionData,\n pendingError\n );\n\n if (shortCircuited) {\n return;\n }\n\n // Clean up now that the action/loaders have completed. Don't clean up if\n // we short circuited because pendingNavigationController will have already\n // been assigned to a new controller for the next navigation\n pendingNavigationController = null;\n\n completeNavigation(location, {\n matches,\n ...(pendingActionData ? { actionData: pendingActionData } : {}),\n loaderData,\n errors,\n });\n }\n\n // Call the action matched by the leaf route for this navigation and handle\n // redirects/errors\n async function handleAction(\n request: Request,\n location: Location,\n submission: Submission,\n matches: AgnosticDataRouteMatch[],\n opts?: { replace?: boolean }\n ): Promise<HandleActionResult> {\n interruptActiveLoads();\n\n // Put us in a submitting state\n let navigation: NavigationStates[\"Submitting\"] = {\n state: \"submitting\",\n location,\n ...submission,\n };\n updateState({ navigation });\n\n // Call our action and get the result\n let result: DataResult;\n let actionMatch = getTargetMatch(matches, location);\n\n if (!actionMatch.route.action && !actionMatch.route.lazy) {\n result = {\n type: ResultType.error,\n error: getInternalRouterError(405, {\n method: request.method,\n pathname: location.pathname,\n routeId: actionMatch.route.id,\n }),\n };\n } else {\n result = await callLoaderOrAction(\n \"action\",\n request,\n actionMatch,\n matches,\n manifest,\n mapRouteProperties,\n basename\n );\n\n if (request.signal.aborted) {\n return { shortCircuited: true };\n }\n }\n\n if (isRedirectResult(result)) {\n let replace: boolean;\n if (opts && opts.replace != null) {\n replace = opts.replace;\n } else {\n // If the user didn't explicity indicate replace behavior, replace if\n // we redirected to the exact same location we're currently at to avoid\n // double back-buttons\n replace =\n result.location === state.location.pathname + state.location.search;\n }\n await startRedirectNavigation(state, result, { submission, replace });\n return { shortCircuited: true };\n }\n\n if (isErrorResult(result)) {\n // Store off the pending error - we use it to determine which loaders\n // to call and will commit it when we complete the navigation\n let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id);\n\n // By default, all submissions are REPLACE navigations, but if the\n // action threw an error that'll be rendered in an errorElement, we fall\n // back to PUSH so that the user can use the back button to get back to\n // the pre-submission form location to try again\n if ((opts && opts.replace) !== true) {\n pendingAction = HistoryAction.Push;\n }\n\n return {\n // Send back an empty object we can use to clear out any prior actionData\n pendingActionData: {},\n pendingActionError: { [boundaryMatch.route.id]: result.error },\n };\n }\n\n if (isDeferredResult(result)) {\n throw getInternalRouterError(400, { type: \"defer-action\" });\n }\n\n return {\n pendingActionData: { [actionMatch.route.id]: result.data },\n };\n }\n\n // Call all applicable loaders for the given matches, handling redirects,\n // errors, etc.\n async function handleLoaders(\n request: Request,\n location: Location,\n matches: AgnosticDataRouteMatch[],\n overrideNavigation?: Navigation,\n submission?: Submission,\n fetcherSubmission?: Submission,\n replace?: boolean,\n pendingActionData?: RouteData,\n pendingError?: RouteData\n ): Promise<HandleLoadersResult> {\n // Figure out the right navigation we want to use for data loading\n let loadingNavigation = overrideNavigation;\n if (!loadingNavigation) {\n let navigation: NavigationStates[\"Loading\"] = {\n state: \"loading\",\n location,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n ...submission,\n };\n loadingNavigation = navigation;\n }\n\n // If this was a redirect from an action we don't have a \"submission\" but\n // we have it on the loading navigation so use that if available\n let activeSubmission =\n submission || fetcherSubmission\n ? submission || fetcherSubmission\n : loadingNavigation.formMethod &&\n loadingNavigation.formAction &&\n loadingNavigation.formData &&\n loadingNavigation.formEncType\n ? {\n formMethod: loadingNavigation.formMethod,\n formAction: loadingNavigation.formAction,\n formData: loadingNavigation.formData,\n formEncType: loadingNavigation.formEncType,\n }\n : undefined;\n\n let routesToUse = inFlightDataRoutes || dataRoutes;\n let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(\n init.history,\n state,\n matches,\n activeSubmission,\n location,\n isRevalidationRequired,\n cancelledDeferredRoutes,\n cancelledFetcherLoads,\n fetchLoadMatches,\n routesToUse,\n basename,\n pendingActionData,\n pendingError\n );\n\n // Cancel pending deferreds for no-longer-matched routes or routes we're\n // about to reload. Note that if this is an action reload we would have\n // already cancelled all pending deferreds so this would be a no-op\n cancelActiveDeferreds(\n (routeId) =>\n !(matches && matches.some((m) => m.route.id === routeId)) ||\n (matchesToLoad && matchesToLoad.some((m) => m.route.id === routeId))\n );\n\n // Short circuit if we have no loaders to run\n if (matchesToLoad.length === 0 && revalidatingFetchers.length === 0) {\n let updatedFetchers = markFetchRedirectsDone();\n completeNavigation(location, {\n matches,\n loaderData: {},\n // Commit pending error if we're short circuiting\n errors: pendingError || null,\n ...(pendingActionData ? { actionData: pendingActionData } : {}),\n ...(updatedFetchers ? { fetchers: new Map(state.fetchers) } : {}),\n });\n return { shortCircuited: true };\n }\n\n // If this is an uninterrupted revalidation, we remain in our current idle\n // state. If not, we need to switch to our loading state and load data,\n // preserving any new action data or existing action data (in the case of\n // a revalidation interrupting an actionReload)\n if (!isUninterruptedRevalidation) {\n revalidatingFetchers.forEach((rf) => {\n let fetcher = state.fetchers.get(rf.key);\n let revalidatingFetcher: FetcherStates[\"Loading\"] = {\n state: \"loading\",\n data: fetcher && fetcher.data,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n \" _hasFetcherDoneAnything \": true,\n };\n state.fetchers.set(rf.key, revalidatingFetcher);\n });\n let actionData = pendingActionData || state.actionData;\n updateState({\n navigation: loadingNavigation,\n ...(actionData\n ? Object.keys(actionData).length === 0\n ? { actionData: null }\n : { actionData }\n : {}),\n ...(revalidatingFetchers.length > 0\n ? { fetchers: new Map(state.fetchers) }\n : {}),\n });\n }\n\n pendingNavigationLoadId = ++incrementingLoadId;\n revalidatingFetchers.forEach((rf) => {\n if (rf.controller) {\n // Fetchers use an independent AbortController so that aborting a fetcher\n // (via deleteFetcher) does not abort the triggering navigation that\n // triggered the revalidation\n fetchControllers.set(rf.key, rf.controller);\n }\n });\n\n // Proxy navigation abort through to revalidation fetchers\n let abortPendingFetchRevalidations = () =>\n revalidatingFetchers.forEach((f) => abortFetcher(f.key));\n if (pendingNavigationController) {\n pendingNavigationController.signal.addEventListener(\n \"abort\",\n abortPendingFetchRevalidations\n );\n }\n\n let { results, loaderResults, fetcherResults } =\n await callLoadersAndMaybeResolveData(\n state.matches,\n matches,\n matchesToLoad,\n revalidatingFetchers,\n request\n );\n\n if (request.signal.aborted) {\n return { shortCircuited: true };\n }\n\n // Clean up _after_ loaders have completed. Don't clean up if we short\n // circuited because fetchControllers would have been aborted and\n // reassigned to new controllers for the next navigation\n if (pendingNavigationController) {\n pendingNavigationController.signal.removeEventListener(\n \"abort\",\n abortPendingFetchRevalidations\n );\n }\n revalidatingFetchers.forEach((rf) => fetchControllers.delete(rf.key));\n\n // If any loaders returned a redirect Response, start a new REPLACE navigation\n let redirect = findRedirect(results);\n if (redirect) {\n await startRedirectNavigation(state, redirect, { replace });\n return { shortCircuited: true };\n }\n\n // Process and commit output from loaders\n let { loaderData, errors } = processLoaderData(\n state,\n matches,\n matchesToLoad,\n loaderResults,\n pendingError,\n revalidatingFetchers,\n fetcherResults,\n activeDeferreds\n );\n\n // Wire up subscribers to update loaderData as promises settle\n activeDeferreds.forEach((deferredData, routeId) => {\n deferredData.subscribe((aborted) => {\n // Note: No need to updateState here since the TrackedPromise on\n // loaderData is stable across resolve/reject\n // Remove this instance if we were aborted or if promises have settled\n if (aborted || deferredData.done) {\n activeDeferreds.delete(routeId);\n }\n });\n });\n\n let updatedFetchers = markFetchRedirectsDone();\n let didAbortFetchLoads = abortStaleFetchLoads(pendingNavigationLoadId);\n let shouldUpdateFetchers =\n updatedFetchers || didAbortFetchLoads || revalidatingFetchers.length > 0;\n\n return {\n loaderData,\n errors,\n ...(shouldUpdateFetchers ? { fetchers: new Map(state.fetchers) } : {}),\n };\n }\n\n function getFetcher<TData = any>(key: string): Fetcher<TData> {\n return state.fetchers.get(key) || IDLE_FETCHER;\n }\n\n // Trigger a fetcher load/submit for the given fetcher key\n function fetch(\n key: string,\n routeId: string,\n href: string | null,\n opts?: RouterFetchOptions\n ) {\n if (isServer) {\n throw new Error(\n \"router.fetch() was called during the server render, but it shouldn't be. \" +\n \"You are likely calling a useFetcher() method in the body of your component. \" +\n \"Try moving it to a useEffect or a callback.\"\n );\n }\n\n if (fetchControllers.has(key)) abortFetcher(key);\n\n let routesToUse = inFlightDataRoutes || dataRoutes;\n let normalizedPath = normalizeTo(\n state.location,\n state.matches,\n basename,\n future.v7_prependBasename,\n href,\n routeId,\n opts?.relative\n );\n let matches = matchRoutes(routesToUse, normalizedPath, basename);\n\n if (!matches) {\n setFetcherError(\n key,\n routeId,\n getInternalRouterError(404, { pathname: normalizedPath })\n );\n return;\n }\n\n let { path, submission } = normalizeNavigateOptions(\n future.v7_normalizeFormMethod,\n true,\n normalizedPath,\n opts\n );\n let match = getTargetMatch(matches, path);\n\n pendingPreventScrollReset = (opts && opts.preventScrollReset) === true;\n\n if (submission && isMutationMethod(submission.formMethod)) {\n handleFetcherAction(key, routeId, path, match, matches, submission);\n return;\n }\n\n // Store off the match so we can call it's shouldRevalidate on subsequent\n // revalidations\n fetchLoadMatches.set(key, { routeId, path });\n handleFetcherLoader(key, routeId, path, match, matches, submission);\n }\n\n // Call the action for the matched fetcher.submit(), and then handle redirects,\n // errors, and revalidation\n async function handleFetcherAction(\n key: string,\n routeId: string,\n path: string,\n match: AgnosticDataRouteMatch,\n requestMatches: AgnosticDataRouteMatch[],\n submission: Submission\n ) {\n interruptActiveLoads();\n fetchLoadMatches.delete(key);\n\n if (!match.route.action && !match.route.lazy) {\n let error = getInternalRouterError(405, {\n method: submission.formMethod,\n pathname: path,\n routeId: routeId,\n });\n setFetcherError(key, routeId, error);\n return;\n }\n\n // Put this fetcher into it's submitting state\n let existingFetcher = state.fetchers.get(key);\n let fetcher: FetcherStates[\"Submitting\"] = {\n state: \"submitting\",\n ...submission,\n data: existingFetcher && existingFetcher.data,\n \" _hasFetcherDoneAnything \": true,\n };\n state.fetchers.set(key, fetcher);\n updateState({ fetchers: new Map(state.fetchers) });\n\n // Call the action for the fetcher\n let abortController = new AbortController();\n let fetchRequest = createClientSideRequest(\n init.history,\n path,\n abortController.signal,\n submission\n );\n fetchControllers.set(key, abortController);\n\n let actionResult = await callLoaderOrAction(\n \"action\",\n fetchRequest,\n match,\n requestMatches,\n manifest,\n mapRouteProperties,\n basename\n );\n\n if (fetchRequest.signal.aborted) {\n // We can delete this so long as we weren't aborted by ou our own fetcher\n // re-submit which would have put _new_ controller is in fetchControllers\n if (fetchControllers.get(key) === abortController) {\n fetchControllers.delete(key);\n }\n return;\n }\n\n if (isRedirectResult(actionResult)) {\n fetchControllers.delete(key);\n fetchRedirectIds.add(key);\n let loadingFetcher: FetcherStates[\"Loading\"] = {\n state: \"loading\",\n ...submission,\n data: undefined,\n \" _hasFetcherDoneAnything \": true,\n };\n state.fetchers.set(key, loadingFetcher);\n updateState({ fetchers: new Map(state.fetchers) });\n\n return startRedirectNavigation(state, actionResult, {\n submission,\n isFetchActionRedirect: true,\n });\n }\n\n // Process any non-redirect errors thrown\n if (isErrorResult(actionResult)) {\n setFetcherError(key, routeId, actionResult.error);\n return;\n }\n\n if (isDeferredResult(actionResult)) {\n throw getInternalRouterError(400, { type: \"defer-action\" });\n }\n\n // Start the data load for current matches, or the next location if we're\n // in the middle of a navigation\n let nextLocation = state.navigation.location || state.location;\n let revalidationRequest = createClientSideRequest(\n init.history,\n\n nextLocation,\n abortController.signal\n );\n let routesToUse = inFlightDataRoutes || dataRoutes;\n let matches =\n state.navigation.state !== \"idle\"\n ? matchRoutes(routesToUse, state.navigation.location, basename)\n : state.matches;\n\n invariant(matches, \"Didn't find any matches after fetcher action\");\n\n let loadId = ++incrementingLoadId;\n fetchReloadIds.set(key, loadId);\n\n let loadFetcher: FetcherStates[\"Loading\"] = {\n state: \"loading\",\n data: actionResult.data,\n ...submission,\n \" _hasFetcherDoneAnything \": true,\n };\n state.fetchers.set(key, loadFetcher);\n\n let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(\n init.history,\n state,\n matches,\n submission,\n nextLocation,\n isRevalidationRequired,\n cancelledDeferredRoutes,\n cancelledFetcherLoads,\n fetchLoadMatches,\n routesToUse,\n basename,\n { [match.route.id]: actionResult.data },\n undefined // No need to send through errors since we short circuit above\n );\n\n // Put all revalidating fetchers into the loading state, except for the\n // current fetcher which we want to keep in it's current loading state which\n // contains it's action submission info + action data\n revalidatingFetchers\n .filter((rf) => rf.key !== key)\n .forEach((rf) => {\n let staleKey = rf.key;\n let existingFetcher = state.fetchers.get(staleKey);\n let revalidatingFetcher: FetcherStates[\"Loading\"] = {\n state: \"loading\",\n data: existingFetcher && existingFetcher.data,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n \" _hasFetcherDoneAnything \": true,\n };\n state.fetchers.set(staleKey, revalidatingFetcher);\n if (rf.controller) {\n fetchControllers.set(staleKey, rf.controller);\n }\n });\n\n updateState({ fetchers: new Map(state.fetchers) });\n\n let abortPendingFetchRevalidations = () =>\n revalidatingFetchers.forEach((rf) => abortFetcher(rf.key));\n\n abortController.signal.addEventListener(\n \"abort\",\n abortPendingFetchRevalidations\n );\n\n let { results, loaderResults, fetcherResults } =\n await callLoadersAndMaybeResolveData(\n state.matches,\n matches,\n matchesToLoad,\n revalidatingFetchers,\n revalidationRequest\n );\n\n if (abortController.signal.aborted) {\n return;\n }\n\n abortController.signal.removeEventListener(\n \"abort\",\n abortPendingFetchRevalidations\n );\n\n fetchReloadIds.delete(key);\n fetchControllers.delete(key);\n revalidatingFetchers.forEach((r) => fetchControllers.delete(r.key));\n\n let redirect = findRedirect(results);\n if (redirect) {\n return startRedirectNavigation(state, redirect);\n }\n\n // Process and commit output from loaders\n let { loaderData, errors } = processLoaderData(\n state,\n state.matches,\n matchesToLoad,\n loaderResults,\n undefined,\n revalidatingFetchers,\n fetcherResults,\n activeDeferreds\n );\n\n let doneFetcher: FetcherStates[\"Idle\"] = {\n state: \"idle\",\n data: actionResult.data,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n \" _hasFetcherDoneAnything \": true,\n };\n state.fetchers.set(key, doneFetcher);\n\n let didAbortFetchLoads = abortStaleFetchLoads(loadId);\n\n // If we are currently in a navigation loading state and this fetcher is\n // more recent than the navigation, we want the newer data so abort the\n // navigation and complete it with the fetcher data\n if (\n state.navigation.state === \"loading\" &&\n loadId > pendingNavigationLoadId\n ) {\n invariant(pendingAction, \"Expected pending action\");\n pendingNavigationController && pendingNavigationController.abort();\n\n completeNavigation(state.navigation.location, {\n matches,\n loaderData,\n errors,\n fetchers: new Map(state.fetchers),\n });\n } else {\n // otherwise just update with the fetcher data, preserving any existing\n // loaderData for loaders that did not need to reload. We have to\n // manually merge here since we aren't going through completeNavigation\n updateState({\n errors,\n loaderData: mergeLoaderData(\n state.loaderData,\n loaderData,\n matches,\n errors\n ),\n ...(didAbortFetchLoads ? { fetchers: new Map(state.fetchers) } : {}),\n });\n isRevalidationRequired = false;\n }\n }\n\n // Call the matched loader for fetcher.load(), handling redirects, errors, etc.\n async function handleFetcherLoader(\n key: string,\n routeId: string,\n path: string,\n match: AgnosticDataRouteMatch,\n matches: AgnosticDataRouteMatch[],\n submission?: Submission\n ) {\n let existingFetcher = state.fetchers.get(key);\n // Put this fetcher into it's loading state\n let loadingFetcher: FetcherStates[\"Loading\"] = {\n state: \"loading\",\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n ...submission,\n data: existingFetcher && existingFetcher.data,\n \" _hasFetcherDoneAnything \": true,\n };\n state.fetchers.set(key, loadingFetcher);\n updateState({ fetchers: new Map(state.fetchers) });\n\n // Call the loader for this fetcher route match\n let abortController = new AbortController();\n let fetchRequest = createClientSideRequest(\n init.history,\n path,\n abortController.signal\n );\n fetchControllers.set(key, abortController);\n\n let result: DataResult = await callLoaderOrAction(\n \"loader\",\n fetchRequest,\n match,\n matches,\n manifest,\n mapRouteProperties,\n basename\n );\n\n // Deferred isn't supported for fetcher loads, await everything and treat it\n // as a normal load. resolveDeferredData will return undefined if this\n // fetcher gets aborted, so we just leave result untouched and short circuit\n // below if that happens\n if (isDeferredResult(result)) {\n result =\n (await resolveDeferredData(result, fetchRequest.signal, true)) ||\n result;\n }\n\n // We can delete this so long as we weren't aborted by our our own fetcher\n // re-load which would have put _new_ controller is in fetchControllers\n if (fetchControllers.get(key) === abortController) {\n fetchControllers.delete(key);\n }\n\n if (fetchRequest.signal.aborted) {\n return;\n }\n\n // If the loader threw a redirect Response, start a new REPLACE navigation\n if (isRedirectResult(result)) {\n fetchRedirectIds.add(key);\n await startRedirectNavigation(state, result);\n return;\n }\n\n // Process any non-redirect errors thrown\n if (isErrorResult(result)) {\n let boundaryMatch = findNearestBoundary(state.matches, routeId);\n state.fetchers.delete(key);\n // TODO: In remix, this would reset to IDLE_NAVIGATION if it was a catch -\n // do we need to behave any differently with our non-redirect errors?\n // What if it was a non-redirect Response?\n updateState({\n fetchers: new Map(state.fetchers),\n errors: {\n [boundaryMatch.route.id]: result.error,\n },\n });\n return;\n }\n\n invariant(!isDeferredResult(result), \"Unhandled fetcher deferred data\");\n\n // Put the fetcher back into an idle state\n let doneFetcher: FetcherStates[\"Idle\"] = {\n state: \"idle\",\n data: result.data,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n \" _hasFetcherDoneAnything \": true,\n };\n state.fetchers.set(key, doneFetcher);\n updateState({ fetchers: new Map(state.fetchers) });\n }\n\n /**\n * Utility function to handle redirects returned from an action or loader.\n * Normally, a redirect \"replaces\" the navigation that triggered it. So, for\n * example:\n *\n * - user is on /a\n * - user clicks a link to /b\n * - loader for /b redirects to /c\n *\n * In a non-JS app the browser would track the in-flight navigation to /b and\n * then replace it with /c when it encountered the redirect response. In\n * the end it would only ever update the URL bar with /c.\n *\n * In client-side routing using pushState/replaceState, we aim to emulate\n * this behavior and we also do not update history until the end of the\n * navigation (including processed redirects). This means that we never\n * actually touch history until we've processed redirects, so we just use\n * the history action from the original navigation (PUSH or REPLACE).\n */\n async function startRedirectNavigation(\n state: RouterState,\n redirect: RedirectResult,\n {\n submission,\n replace,\n isFetchActionRedirect,\n }: {\n submission?: Submission;\n replace?: boolean;\n isFetchActionRedirect?: boolean;\n } = {}\n ) {\n if (redirect.revalidate) {\n isRevalidationRequired = true;\n }\n\n let redirectLocation = createLocation(\n state.location,\n redirect.location,\n // TODO: This can be removed once we get rid of useTransition in Remix v2\n {\n _isRedirect: true,\n ...(isFetchActionRedirect ? { _isFetchActionRedirect: true } : {}),\n }\n );\n invariant(\n redirectLocation,\n \"Expected a location on the redirect navigation\"\n );\n // Check if this an absolute external redirect that goes to a new origin\n if (\n ABSOLUTE_URL_REGEX.test(redirect.location) &&\n isBrowser &&\n typeof window?.location !== \"undefined\"\n ) {\n let url = init.history.createURL(redirect.location);\n let isDifferentBasename = stripBasename(url.pathname, basename) == null;\n\n if (window.location.origin !== url.origin || isDifferentBasename) {\n if (replace) {\n window.location.replace(redirect.location);\n } else {\n window.location.assign(redirect.location);\n }\n return;\n }\n }\n\n // There's no need to abort on redirects, since we don't detect the\n // redirect until the action/loaders have settled\n pendingNavigationController = null;\n\n let redirectHistoryAction =\n replace === true ? HistoryAction.Replace : HistoryAction.Push;\n\n // Use the incoming submission if provided, fallback on the active one in\n // state.navigation\n let { formMethod, formAction, formEncType, formData } = state.navigation;\n if (!submission && formMethod && formAction && formData && formEncType) {\n submission = {\n formMethod,\n formAction,\n formEncType,\n formData,\n };\n }\n\n // If this was a 307/308 submission we want to preserve the HTTP method and\n // re-submit the GET/POST/PUT/PATCH/DELETE as a submission navigation to the\n // redirected location\n if (\n redirectPreserveMethodStatusCodes.has(redirect.status) &&\n submission &&\n isMutationMethod(submission.formMethod)\n ) {\n await startNavigation(redirectHistoryAction, redirectLocation, {\n submission: {\n ...submission,\n formAction: redirect.location,\n },\n // Preserve this flag across redirects\n preventScrollReset: pendingPreventScrollReset,\n });\n } else if (isFetchActionRedirect) {\n // For a fetch action redirect, we kick off a new loading navigation\n // without the fetcher submission, but we send it along for shouldRevalidate\n await startNavigation(redirectHistoryAction, redirectLocation, {\n overrideNavigation: {\n state: \"loading\",\n location: redirectLocation,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n },\n fetcherSubmission: submission,\n // Preserve this flag across redirects\n preventScrollReset: pendingPreventScrollReset,\n });\n } else {\n // Otherwise, we kick off a new loading navigation, preserving the\n // submission info for the duration of this navigation\n await startNavigation(redirectHistoryAction, redirectLocation, {\n overrideNavigation: {\n state: \"loading\",\n location: redirectLocation,\n formMethod: submission ? submission.formMethod : undefined,\n formAction: submission ? submission.formAction : undefined,\n formEncType: submission ? submission.formEncType : undefined,\n formData: submission ? submission.formData : undefined,\n },\n // Preserve this flag across redirects\n preventScrollReset: pendingPreventScrollReset,\n });\n }\n }\n\n async function callLoadersAndMaybeResolveData(\n currentMatches: AgnosticDataRouteMatch[],\n matches: AgnosticDataRouteMatch[],\n matchesToLoad: AgnosticDataRouteMatch[],\n fetchersToLoad: RevalidatingFetcher[],\n request: Request\n ) {\n // Call all navigation loaders and revalidating fetcher loaders in parallel,\n // then slice off the results into separate arrays so we can handle them\n // accordingly\n let results = await Promise.all([\n ...matchesToLoad.map((match) =>\n callLoaderOrAction(\n \"loader\",\n request,\n match,\n matches,\n manifest,\n mapRouteProperties,\n basename\n )\n ),\n ...fetchersToLoad.map((f) => {\n if (f.matches && f.match && f.controller) {\n return callLoaderOrAction(\n \"loader\",\n createClientSideRequest(init.history, f.path, f.controller.signal),\n f.match,\n f.matches,\n manifest,\n mapRouteProperties,\n basename\n );\n } else {\n let error: ErrorResult = {\n type: ResultType.error,\n error: getInternalRouterError(404, { pathname: f.path }),\n };\n return error;\n }\n }),\n ]);\n let loaderResults = results.slice(0, matchesToLoad.length);\n let fetcherResults = results.slice(matchesToLoad.length);\n\n await Promise.all([\n resolveDeferredResults(\n currentMatches,\n matchesToLoad,\n loaderResults,\n loaderResults.map(() => request.signal),\n false,\n state.loaderData\n ),\n resolveDeferredResults(\n currentMatches,\n fetchersToLoad.map((f) => f.match),\n fetcherResults,\n fetchersToLoad.map((f) => (f.controller ? f.controller.signal : null)),\n true\n ),\n ]);\n\n return { results, loaderResults, fetcherResults };\n }\n\n function interruptActiveLoads() {\n // Every interruption triggers a revalidation\n isRevalidationRequired = true;\n\n // Cancel pending route-level deferreds and mark cancelled routes for\n // revalidation\n cancelledDeferredRoutes.push(...cancelActiveDeferreds());\n\n // Abort in-flight fetcher loads\n fetchLoadMatches.forEach((_, key) => {\n if (fetchControllers.has(key)) {\n cancelledFetcherLoads.push(key);\n abortFetcher(key);\n }\n });\n }\n\n function setFetcherError(key: string, routeId: string, error: any) {\n let boundaryMatch = findNearestBoundary(state.matches, routeId);\n deleteFetcher(key);\n updateState({\n errors: {\n [boundaryMatch.route.id]: error,\n },\n fetchers: new Map(state.fetchers),\n });\n }\n\n function deleteFetcher(key: string): void {\n if (fetchControllers.has(key)) abortFetcher(key);\n fetchLoadMatches.delete(key);\n fetchReloadIds.delete(key);\n fetchRedirectIds.delete(key);\n state.fetchers.delete(key);\n }\n\n function abortFetcher(key: string) {\n let controller = fetchControllers.get(key);\n invariant(controller, `Expected fetch controller: ${key}`);\n controller.abort();\n fetchControllers.delete(key);\n }\n\n function markFetchersDone(keys: string[]) {\n for (let key of keys) {\n let fetcher = getFetcher(key);\n let doneFetcher: FetcherStates[\"Idle\"] = {\n state: \"idle\",\n data: fetcher.data,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n \" _hasFetcherDoneAnything \": true,\n };\n state.fetchers.set(key, doneFetcher);\n }\n }\n\n function markFetchRedirectsDone(): boolean {\n let doneKeys = [];\n let updatedFetchers = false;\n for (let key of fetchRedirectIds) {\n let fetcher = state.fetchers.get(key);\n invariant(fetcher, `Expected fetcher: ${key}`);\n if (fetcher.state === \"loading\") {\n fetchRedirectIds.delete(key);\n doneKeys.push(key);\n updatedFetchers = true;\n }\n }\n markFetchersDone(doneKeys);\n return updatedFetchers;\n }\n\n function abortStaleFetchLoads(landedId: number): boolean {\n let yeetedKeys = [];\n for (let [key, id] of fetchReloadIds) {\n if (id < landedId) {\n let fetcher = state.fetchers.get(key);\n invariant(fetcher, `Expected fetcher: ${key}`);\n if (fetcher.state === \"loading\") {\n abortFetcher(key);\n fetchReloadIds.delete(key);\n yeetedKeys.push(key);\n }\n }\n }\n markFetchersDone(yeetedKeys);\n return yeetedKeys.length > 0;\n }\n\n function getBlocker(key: string, fn: BlockerFunction) {\n let blocker: Blocker = state.blockers.get(key) || IDLE_BLOCKER;\n\n if (blockerFunctions.get(key) !== fn) {\n blockerFunctions.set(key, fn);\n }\n\n return blocker;\n }\n\n function deleteBlocker(key: string) {\n state.blockers.delete(key);\n blockerFunctions.delete(key);\n }\n\n // Utility function to update blockers, ensuring valid state transitions\n function updateBlocker(key: string, newBlocker: Blocker) {\n let blocker = state.blockers.get(key) || IDLE_BLOCKER;\n\n // Poor mans state machine :)\n // https://mermaid.live/edit#pako:eNqVkc9OwzAMxl8l8nnjAYrEtDIOHEBIgwvKJTReGy3_lDpIqO27k6awMG0XcrLlnz87nwdonESogKXXBuE79rq75XZO3-yHds0RJVuv70YrPlUrCEe2HfrORS3rubqZfuhtpg5C9wk5tZ4VKcRUq88q9Z8RS0-48cE1iHJkL0ugbHuFLus9L6spZy8nX9MP2CNdomVaposqu3fGayT8T8-jJQwhepo_UtpgBQaDEUom04dZhAN1aJBDlUKJBxE1ceB2Smj0Mln-IBW5AFU2dwUiktt_2Qaq2dBfaKdEup85UV7Yd-dKjlnkabl2Pvr0DTkTreM\n invariant(\n (blocker.state === \"unblocked\" && newBlocker.state === \"blocked\") ||\n (blocker.state === \"blocked\" && newBlocker.state === \"blocked\") ||\n (blocker.state === \"blocked\" && newBlocker.state === \"proceeding\") ||\n (blocker.state === \"blocked\" && newBlocker.state === \"unblocked\") ||\n (blocker.state === \"proceeding\" && newBlocker.state === \"unblocked\"),\n `Invalid blocker state transition: ${blocker.state} -> ${newBlocker.state}`\n );\n\n state.blockers.set(key, newBlocker);\n updateState({ blockers: new Map(state.blockers) });\n }\n\n function shouldBlockNavigation({\n currentLocation,\n nextLocation,\n historyAction,\n }: {\n currentLocation: Location;\n nextLocation: Location;\n historyAction: HistoryAction;\n }): string | undefined {\n if (blockerFunctions.size === 0) {\n return;\n }\n\n // We ony support a single active blocker at the moment since we don't have\n // any compelling use cases for multi-blocker yet\n if (blockerFunctions.size > 1) {\n warning(false, \"A router only supports one blocker at a time\");\n }\n\n let entries = Array.from(blockerFunctions.entries());\n let [blockerKey, blockerFunction] = entries[entries.length - 1];\n let blocker = state.blockers.get(blockerKey);\n\n if (blocker && blocker.state === \"proceeding\") {\n // If the blocker is currently proceeding, we don't need to re-check\n // it and can let this navigation continue\n return;\n }\n\n // At this point, we know we're unblocked/blocked so we need to check the\n // user-provided blocker function\n if (blockerFunction({ currentLocation, nextLocation, historyAction })) {\n return blockerKey;\n }\n }\n\n function cancelActiveDeferreds(\n predicate?: (routeId: string) => boolean\n ): string[] {\n let cancelledRouteIds: string[] = [];\n activeDeferreds.forEach((dfd, routeId) => {\n if (!predicate || predicate(routeId)) {\n // Cancel the deferred - but do not remove from activeDeferreds here -\n // we rely on the subscribers to do that so our tests can assert proper\n // cleanup via _internalActiveDeferreds\n dfd.cancel();\n cancelledRouteIds.push(routeId);\n activeDeferreds.delete(routeId);\n }\n });\n return cancelledRouteIds;\n }\n\n // Opt in to capturing and reporting scroll positions during navigations,\n // used by the <ScrollRestoration> component\n function enableScrollRestoration(\n positions: Record<string, number>,\n getPosition: GetScrollPositionFunction,\n getKey?: GetScrollRestorationKeyFunction\n ) {\n savedScrollPositions = positions;\n getScrollPosition = getPosition;\n getScrollRestorationKey = getKey || ((location) => location.key);\n\n // Perform initial hydration scroll restoration, since we miss the boat on\n // the initial updateState() because we've not yet rendered <ScrollRestoration/>\n // and therefore have no savedScrollPositions available\n if (!initialScrollRestored && state.navigation === IDLE_NAVIGATION) {\n initialScrollRestored = true;\n let y = getSavedScrollPosition(state.location, state.matches);\n if (y != null) {\n updateState({ restoreScrollPosition: y });\n }\n }\n\n return () => {\n savedScrollPositions = null;\n getScrollPosition = null;\n getScrollRestorationKey = null;\n };\n }\n\n function saveScrollPosition(\n location: Location,\n matches: AgnosticDataRouteMatch[]\n ): void {\n if (savedScrollPositions && getScrollRestorationKey && getScrollPosition) {\n let userMatches = matches.map((m) =>\n createUseMatchesMatch(m, state.loaderData)\n );\n let key = getScrollRestorationKey(location, userMatches) || location.key;\n savedScrollPositions[key] = getScrollPosition();\n }\n }\n\n function getSavedScrollPosition(\n location: Location,\n matches: AgnosticDataRouteMatch[]\n ): number | null {\n if (savedScrollPositions && getScrollRestorationKey && getScrollPosition) {\n let userMatches = matches.map((m) =>\n createUseMatchesMatch(m, state.loaderData)\n );\n let key = getScrollRestorationKey(location, userMatches) || location.key;\n let y = savedScrollPositions[key];\n if (typeof y === \"number\") {\n return y;\n }\n }\n return null;\n }\n\n function _internalSetRoutes(newRoutes: AgnosticDataRouteObject[]) {\n manifest = {};\n inFlightDataRoutes = convertRoutesToDataRoutes(\n newRoutes,\n mapRouteProperties,\n undefined,\n manifest\n );\n }\n\n router = {\n get basename() {\n return basename;\n },\n get state() {\n return state;\n },\n get routes() {\n return dataRoutes;\n },\n initialize,\n subscribe,\n enableScrollRestoration,\n navigate,\n fetch,\n revalidate,\n // Passthrough to history-aware createHref used by useHref so we get proper\n // hash-aware URLs in DOM paths\n createHref: (to: To) => init.history.createHref(to),\n encodeLocation: (to: To) => init.history.encodeLocation(to),\n getFetcher,\n deleteFetcher,\n dispose,\n getBlocker,\n deleteBlocker,\n _internalFetchControllers: fetchControllers,\n _internalActiveDeferreds: activeDeferreds,\n // TODO: Remove setRoutes, it's temporary to avoid dealing with\n // updating the tree while validating the update algorithm.\n _internalSetRoutes,\n };\n\n return router;\n}\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region createStaticHandler\n////////////////////////////////////////////////////////////////////////////////\n\nexport const UNSAFE_DEFERRED_SYMBOL = Symbol(\"deferred\");\n\nexport interface CreateStaticHandlerOptions {\n basename?: string;\n /**\n * @deprecated Use `mapRouteProperties` instead\n */\n detectErrorBoundary?: DetectErrorBoundaryFunction;\n mapRouteProperties?: MapRoutePropertiesFunction;\n}\n\nexport function createStaticHandler(\n routes: AgnosticRouteObject[],\n opts?: CreateStaticHandlerOptions\n): StaticHandler {\n invariant(\n routes.length > 0,\n \"You must provide a non-empty routes array to createStaticHandler\"\n );\n\n let manifest: RouteManifest = {};\n let basename = (opts ? opts.basename : null) || \"/\";\n let mapRouteProperties: MapRoutePropertiesFunction;\n if (opts?.mapRouteProperties) {\n mapRouteProperties = opts.mapRouteProperties;\n } else if (opts?.detectErrorBoundary) {\n // If they are still using the deprecated version, wrap it with the new API\n let detectErrorBoundary = opts.detectErrorBoundary;\n mapRouteProperties = (route) => ({\n hasErrorBoundary: detectErrorBoundary(route),\n });\n } else {\n mapRouteProperties = defaultMapRouteProperties;\n }\n\n let dataRoutes = convertRoutesToDataRoutes(\n routes,\n mapRouteProperties,\n undefined,\n manifest\n );\n\n /**\n * The query() method is intended for document requests, in which we want to\n * call an optional action and potentially multiple loaders for all nested\n * routes. It returns a StaticHandlerContext object, which is very similar\n * to the router state (location, loaderData, actionData, errors, etc.) and\n * also adds SSR-specific information such as the statusCode and headers\n * from action/loaders Responses.\n *\n * It _should_ never throw and should report all errors through the\n * returned context.errors object, properly associating errors to their error\n * boundary. Additionally, it tracks _deepestRenderedBoundaryId which can be\n * used to emulate React error boundaries during SSr by performing a second\n * pass only down to the boundaryId.\n *\n * The one exception where we do not return a StaticHandlerContext is when a\n * redirect response is returned or thrown from any action/loader. We\n * propagate that out and return the raw Response so the HTTP server can\n * return it directly.\n */\n async function query(\n request: Request,\n { requestContext }: { requestContext?: unknown } = {}\n ): Promise<StaticHandlerContext | Response> {\n let url = new URL(request.url);\n let method = request.method;\n let location = createLocation(\"\", createPath(url), null, \"default\");\n let matches = matchRoutes(dataRoutes, location, basename);\n\n // SSR supports HEAD requests while SPA doesn't\n if (!isValidMethod(method) && method !== \"HEAD\") {\n let error = getInternalRouterError(405, { method });\n let { matches: methodNotAllowedMatches, route } =\n getShortCircuitMatches(dataRoutes);\n return {\n basename,\n location,\n matches: methodNotAllowedMatches,\n loaderData: {},\n actionData: null,\n errors: {\n [route.id]: error,\n },\n statusCode: error.status,\n loaderHeaders: {},\n actionHeaders: {},\n activeDeferreds: null,\n };\n } else if (!matches) {\n let error = getInternalRouterError(404, { pathname: location.pathname });\n let { matches: notFoundMatches, route } =\n getShortCircuitMatches(dataRoutes);\n return {\n basename,\n location,\n matches: notFoundMatches,\n loaderData: {},\n actionData: null,\n errors: {\n [route.id]: error,\n },\n statusCode: error.status,\n loaderHeaders: {},\n actionHeaders: {},\n activeDeferreds: null,\n };\n }\n\n let result = await queryImpl(request, location, matches, requestContext);\n if (isResponse(result)) {\n return result;\n }\n\n // When returning StaticHandlerContext, we patch back in the location here\n // since we need it for React Context. But this helps keep our submit and\n // loadRouteData operating on a Request instead of a Location\n return { location, basename, ...result };\n }\n\n /**\n * The queryRoute() method is intended for targeted route requests, either\n * for fetch ?_data requests or resource route requests. In this case, we\n * are only ever calling a single action or loader, and we are returning the\n * returned value directly. In most cases, this will be a Response returned\n * from the action/loader, but it may be a primitive or other value as well -\n * and in such cases the calling context should handle that accordingly.\n *\n * We do respect the throw/return differentiation, so if an action/loader\n * throws, then this method will throw the value. This is important so we\n * can do proper boundary identification in Remix where a thrown Response\n * must go to the Catch Boundary but a returned Response is happy-path.\n *\n * One thing to note is that any Router-initiated Errors that make sense\n * to associate with a status code will be thrown as an ErrorResponse\n * instance which include the raw Error, such that the calling context can\n * serialize the error as they see fit while including the proper response\n * code. Examples here are 404 and 405 errors that occur prior to reaching\n * any user-defined loaders.\n */\n async function queryRoute(\n request: Request,\n {\n routeId,\n requestContext,\n }: { requestContext?: unknown; routeId?: string } = {}\n ): Promise<any> {\n let url = new URL(request.url);\n let method = request.method;\n let location = createLocation(\"\", createPath(url), null, \"default\");\n let matches = matchRoutes(dataRoutes, location, basename);\n\n // SSR supports HEAD requests while SPA doesn't\n if (!isValidMethod(method) && method !== \"HEAD\" && method !== \"OPTIONS\") {\n throw getInternalRouterError(405, { method });\n } else if (!matches) {\n throw getInternalRouterError(404, { pathname: location.pathname });\n }\n\n let match = routeId\n ? matches.find((m) => m.route.id === routeId)\n : getTargetMatch(matches, location);\n\n if (routeId && !match) {\n throw getInternalRouterError(403, {\n pathname: location.pathname,\n routeId,\n });\n } else if (!match) {\n // This should never hit I don't think?\n throw getInternalRouterError(404, { pathname: location.pathname });\n }\n\n let result = await queryImpl(\n request,\n location,\n matches,\n requestContext,\n match\n );\n if (isResponse(result)) {\n return result;\n }\n\n let error = result.errors ? Object.values(result.errors)[0] : undefined;\n if (error !== undefined) {\n // If we got back result.errors, that means the loader/action threw\n // _something_ that wasn't a Response, but it's not guaranteed/required\n // to be an `instanceof Error` either, so we have to use throw here to\n // preserve the \"error\" state outside of queryImpl.\n throw error;\n }\n\n // Pick off the right state value to return\n if (result.actionData) {\n return Object.values(result.actionData)[0];\n }\n\n if (result.loaderData) {\n let data = Object.values(result.loaderData)[0];\n if (result.activeDeferreds?.[match.route.id]) {\n data[UNSAFE_DEFERRED_SYMBOL] = result.activeDeferreds[match.route.id];\n }\n return data;\n }\n\n return undefined;\n }\n\n async function queryImpl(\n request: Request,\n location: Location,\n matches: AgnosticDataRouteMatch[],\n requestContext: unknown,\n routeMatch?: AgnosticDataRouteMatch\n ): Promise<Omit<StaticHandlerContext, \"location\" | \"basename\"> | Response> {\n invariant(\n request.signal,\n \"query()/queryRoute() requests must contain an AbortController signal\"\n );\n\n try {\n if (isMutationMethod(request.method.toLowerCase())) {\n let result = await submit(\n request,\n matches,\n routeMatch || getTargetMatch(matches, location),\n requestContext,\n routeMatch != null\n );\n return result;\n }\n\n let result = await loadRouteData(\n request,\n matches,\n requestContext,\n routeMatch\n );\n return isResponse(result)\n ? result\n : {\n ...result,\n actionData: null,\n actionHeaders: {},\n };\n } catch (e) {\n // If the user threw/returned a Response in callLoaderOrAction, we throw\n // it to bail out and then return or throw here based on whether the user\n // returned or threw\n if (isQueryRouteResponse(e)) {\n if (e.type === ResultType.error && !isRedirectResponse(e.response)) {\n throw e.response;\n }\n return e.response;\n }\n // Redirects are always returned since they don't propagate to catch\n // boundaries\n if (isRedirectResponse(e)) {\n return e;\n }\n throw e;\n }\n }\n\n async function submit(\n request: Request,\n matches: AgnosticDataRouteMatch[],\n actionMatch: AgnosticDataRouteMatch,\n requestContext: unknown,\n isRouteRequest: boolean\n ): Promise<Omit<StaticHandlerContext, \"location\" | \"basename\"> | Response> {\n let result: DataResult;\n\n if (!actionMatch.route.action && !actionMatch.route.lazy) {\n let error = getInternalRouterError(405, {\n method: request.method,\n pathname: new URL(request.url).pathname,\n routeId: actionMatch.route.id,\n });\n if (isRouteRequest) {\n throw error;\n }\n result = {\n type: ResultType.error,\n error,\n };\n } else {\n result = await callLoaderOrAction(\n \"action\",\n request,\n actionMatch,\n matches,\n manifest,\n mapRouteProperties,\n basename,\n true,\n isRouteRequest,\n requestContext\n );\n\n if (request.signal.aborted) {\n let method = isRouteRequest ? \"queryRoute\" : \"query\";\n throw new Error(`${method}() call aborted`);\n }\n }\n\n if (isRedirectResult(result)) {\n // Uhhhh - this should never happen, we should always throw these from\n // callLoaderOrAction, but the type narrowing here keeps TS happy and we\n // can get back on the \"throw all redirect responses\" train here should\n // this ever happen :/\n throw new Response(null, {\n status: result.status,\n headers: {\n Location: result.location,\n },\n });\n }\n\n if (isDeferredResult(result)) {\n let error = getInternalRouterError(400, { type: \"defer-action\" });\n if (isRouteRequest) {\n throw error;\n }\n result = {\n type: ResultType.error,\n error,\n };\n }\n\n if (isRouteRequest) {\n // Note: This should only be non-Response values if we get here, since\n // isRouteRequest should throw any Response received in callLoaderOrAction\n if (isErrorResult(result)) {\n throw result.error;\n }\n\n return {\n matches: [actionMatch],\n loaderData: {},\n actionData: { [actionMatch.route.id]: result.data },\n errors: null,\n // Note: statusCode + headers are unused here since queryRoute will\n // return the raw Response or value\n statusCode: 200,\n loaderHeaders: {},\n actionHeaders: {},\n activeDeferreds: null,\n };\n }\n\n if (isErrorResult(result)) {\n // Store off the pending error - we use it to determine which loaders\n // to call and will commit it when we complete the navigation\n let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id);\n let context = await loadRouteData(\n request,\n matches,\n requestContext,\n undefined,\n {\n [boundaryMatch.route.id]: result.error,\n }\n );\n\n // action status codes take precedence over loader status codes\n return {\n ...context,\n statusCode: isRouteErrorResponse(result.error)\n ? result.error.status\n : 500,\n actionData: null,\n actionHeaders: {\n ...(result.headers ? { [actionMatch.route.id]: result.headers } : {}),\n },\n };\n }\n\n // Create a GET request for the loaders\n let loaderRequest = new Request(request.url, {\n headers: request.headers,\n redirect: request.redirect,\n signal: request.signal,\n });\n let context = await loadRouteData(loaderRequest, matches, requestContext);\n\n return {\n ...context,\n // action status codes take precedence over loader status codes\n ...(result.statusCode ? { statusCode: result.statusCode } : {}),\n actionData: {\n [actionMatch.route.id]: result.data,\n },\n actionHeaders: {\n ...(result.headers ? { [actionMatch.route.id]: result.headers } : {}),\n },\n };\n }\n\n async function loadRouteData(\n request: Request,\n matches: AgnosticDataRouteMatch[],\n requestContext: unknown,\n routeMatch?: AgnosticDataRouteMatch,\n pendingActionError?: RouteData\n ): Promise<\n | Omit<\n StaticHandlerContext,\n \"location\" | \"basename\" | \"actionData\" | \"actionHeaders\"\n >\n | Response\n > {\n let isRouteRequest = routeMatch != null;\n\n // Short circuit if we have no loaders to run (queryRoute())\n if (\n isRouteRequest &&\n !routeMatch?.route.loader &&\n !routeMatch?.route.lazy\n ) {\n throw getInternalRouterError(400, {\n method: request.method,\n pathname: new URL(request.url).pathname,\n routeId: routeMatch?.route.id,\n });\n }\n\n let requestMatches = routeMatch\n ? [routeMatch]\n : getLoaderMatchesUntilBoundary(\n matches,\n Object.keys(pendingActionError || {})[0]\n );\n let matchesToLoad = requestMatches.filter(\n (m) => m.route.loader || m.route.lazy\n );\n\n // Short circuit if we have no loaders to run (query())\n if (matchesToLoad.length === 0) {\n return {\n matches,\n // Add a null for all matched routes for proper revalidation on the client\n loaderData: matches.reduce(\n (acc, m) => Object.assign(acc, { [m.route.id]: null }),\n {}\n ),\n errors: pendingActionError || null,\n statusCode: 200,\n loaderHeaders: {},\n activeDeferreds: null,\n };\n }\n\n let results = await Promise.all([\n ...matchesToLoad.map((match) =>\n callLoaderOrAction(\n \"loader\",\n request,\n match,\n matches,\n manifest,\n mapRouteProperties,\n basename,\n true,\n isRouteRequest,\n requestContext\n )\n ),\n ]);\n\n if (request.signal.aborted) {\n let method = isRouteRequest ? \"queryRoute\" : \"query\";\n throw new Error(`${method}() call aborted`);\n }\n\n // Process and commit output from loaders\n let activeDeferreds = new Map<string, DeferredData>();\n let context = processRouteLoaderData(\n matches,\n matchesToLoad,\n results,\n pendingActionError,\n activeDeferreds\n );\n\n // Add a null for any non-loader matches for proper revalidation on the client\n let executedLoaders = new Set<string>(\n matchesToLoad.map((match) => match.route.id)\n );\n matches.forEach((match) => {\n if (!executedLoaders.has(match.route.id)) {\n context.loaderData[match.route.id] = null;\n }\n });\n\n return {\n ...context,\n matches,\n activeDeferreds:\n activeDeferreds.size > 0\n ? Object.fromEntries(activeDeferreds.entries())\n : null,\n };\n }\n\n return {\n dataRoutes,\n query,\n queryRoute,\n };\n}\n\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Helpers\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Given an existing StaticHandlerContext and an error thrown at render time,\n * provide an updated StaticHandlerContext suitable for a second SSR render\n */\nexport function getStaticContextFromError(\n routes: AgnosticDataRouteObject[],\n context: StaticHandlerContext,\n error: any\n) {\n let newContext: StaticHandlerContext = {\n ...context,\n statusCode: 500,\n errors: {\n [context._deepestRenderedBoundaryId || routes[0].id]: error,\n },\n };\n return newContext;\n}\n\nfunction isSubmissionNavigation(\n opts: RouterNavigateOptions\n): opts is SubmissionNavigateOptions {\n return opts != null && \"formData\" in opts;\n}\n\nfunction normalizeTo(\n location: Path,\n matches: AgnosticDataRouteMatch[],\n basename: string,\n prependBasename: boolean,\n to: To | null,\n fromRouteId?: string,\n relative?: RelativeRoutingType\n) {\n let contextualMatches: AgnosticDataRouteMatch[];\n let activeRouteMatch: AgnosticDataRouteMatch | undefined;\n if (fromRouteId != null && relative !== \"path\") {\n // Grab matches up to the calling route so our route-relative logic is\n // relative to the correct source route. When using relative:path,\n // fromRouteId is ignored since that is always relative to the current\n // location path\n contextualMatches = [];\n for (let match of matches) {\n contextualMatches.push(match);\n if (match.route.id === fromRouteId) {\n activeRouteMatch = match;\n break;\n }\n }\n } else {\n contextualMatches = matches;\n activeRouteMatch = matches[matches.length - 1];\n }\n\n // Resolve the relative path\n let path = resolveTo(\n to ? to : \".\",\n getPathContributingMatches(contextualMatches).map((m) => m.pathnameBase),\n stripBasename(location.pathname, basename) || location.pathname,\n relative === \"path\"\n );\n\n // When `to` is not specified we inherit search/hash from the current\n // location, unlike when to=\".\" and we just inherit the path.\n // See https://github.com/remix-run/remix/issues/927\n if (to == null) {\n path.search = location.search;\n path.hash = location.hash;\n }\n\n // Add an ?index param for matched index routes if we don't already have one\n if (\n (to == null || to === \"\" || to === \".\") &&\n activeRouteMatch &&\n activeRouteMatch.route.index &&\n !hasNakedIndexQuery(path.search)\n ) {\n path.search = path.search\n ? path.search.replace(/^\\?/, \"?index&\")\n : \"?index\";\n }\n\n // If we're operating within a basename, prepend it to the pathname. If\n // this is a root navigation, then just use the raw basename which allows\n // the basename to have full control over the presence of a trailing slash\n // on root actions\n if (prependBasename && basename !== \"/\") {\n path.pathname =\n path.pathname === \"/\" ? basename : joinPaths([basename, path.pathname]);\n }\n\n return createPath(path);\n}\n\n// Normalize navigation options by converting formMethod=GET formData objects to\n// URLSearchParams so they behave identically to links with query params\nfunction normalizeNavigateOptions(\n normalizeFormMethod: boolean,\n isFetcher: boolean,\n path: string,\n opts?: RouterNavigateOptions\n): {\n path: string;\n submission?: Submission;\n error?: ErrorResponse;\n} {\n // Return location verbatim on non-submission navigations\n if (!opts || !isSubmissionNavigation(opts)) {\n return { path };\n }\n\n if (opts.formMethod && !isValidMethod(opts.formMethod)) {\n return {\n path,\n error: getInternalRouterError(405, { method: opts.formMethod }),\n };\n }\n\n // Create a Submission on non-GET navigations\n let submission: Submission | undefined;\n if (opts.formData) {\n let formMethod = opts.formMethod || \"get\";\n submission = {\n formMethod: normalizeFormMethod\n ? (formMethod.toUpperCase() as V7_FormMethod)\n : (formMethod.toLowerCase() as FormMethod),\n formAction: stripHashFromPath(path),\n formEncType:\n (opts && opts.formEncType) || \"application/x-www-form-urlencoded\",\n formData: opts.formData,\n };\n\n if (isMutationMethod(submission.formMethod)) {\n return { path, submission };\n }\n }\n\n // Flatten submission onto URLSearchParams for GET submissions\n let parsedPath = parsePath(path);\n let searchParams = convertFormDataToSearchParams(opts.formData);\n // On GET navigation submissions we can drop the ?index param from the\n // resulting location since all loaders will run. But fetcher GET submissions\n // only run a single loader so we need to preserve any incoming ?index params\n if (isFetcher && parsedPath.search && hasNakedIndexQuery(parsedPath.search)) {\n searchParams.append(\"index\", \"\");\n }\n parsedPath.search = `?${searchParams}`;\n\n return { path: createPath(parsedPath), submission };\n}\n\n// Filter out all routes below any caught error as they aren't going to\n// render so we don't need to load them\nfunction getLoaderMatchesUntilBoundary(\n matches: AgnosticDataRouteMatch[],\n boundaryId?: string\n) {\n let boundaryMatches = matches;\n if (boundaryId) {\n let index = matches.findIndex((m) => m.route.id === boundaryId);\n if (index >= 0) {\n boundaryMatches = matches.slice(0, index);\n }\n }\n return boundaryMatches;\n}\n\nfunction getMatchesToLoad(\n history: History,\n state: RouterState,\n matches: AgnosticDataRouteMatch[],\n submission: Submission | undefined,\n location: Location,\n isRevalidationRequired: boolean,\n cancelledDeferredRoutes: string[],\n cancelledFetcherLoads: string[],\n fetchLoadMatches: Map<string, FetchLoadMatch>,\n routesToUse: AgnosticDataRouteObject[],\n basename: string | undefined,\n pendingActionData?: RouteData,\n pendingError?: RouteData\n): [AgnosticDataRouteMatch[], RevalidatingFetcher[]] {\n let actionResult = pendingError\n ? Object.values(pendingError)[0]\n : pendingActionData\n ? Object.values(pendingActionData)[0]\n : undefined;\n\n let currentUrl = history.createURL(state.location);\n let nextUrl = history.createURL(location);\n\n // Pick navigation matches that are net-new or qualify for revalidation\n let boundaryId = pendingError ? Object.keys(pendingError)[0] : undefined;\n let boundaryMatches = getLoaderMatchesUntilBoundary(matches, boundaryId);\n\n let navigationMatches = boundaryMatches.filter((match, index) => {\n if (match.route.lazy) {\n // We haven't loaded this route yet so we don't know if it's got a loader!\n return true;\n }\n if (match.route.loader == null) {\n return false;\n }\n\n // Always call the loader on new route instances and pending defer cancellations\n if (\n isNewLoader(state.loaderData, state.matches[index], match) ||\n cancelledDeferredRoutes.some((id) => id === match.route.id)\n ) {\n return true;\n }\n\n // This is the default implementation for when we revalidate. If the route\n // provides it's own implementation, then we give them full control but\n // provide this value so they can leverage it if needed after they check\n // their own specific use cases\n let currentRouteMatch = state.matches[index];\n let nextRouteMatch = match;\n\n return shouldRevalidateLoader(match, {\n currentUrl,\n currentParams: currentRouteMatch.params,\n nextUrl,\n nextParams: nextRouteMatch.params,\n ...submission,\n actionResult,\n defaultShouldRevalidate:\n // Forced revalidation due to submission, useRevalidator, or X-Remix-Revalidate\n isRevalidationRequired ||\n // Clicked the same link, resubmitted a GET form\n currentUrl.pathname + currentUrl.search ===\n nextUrl.pathname + nextUrl.search ||\n // Search params affect all loaders\n currentUrl.search !== nextUrl.search ||\n isNewRouteInstance(currentRouteMatch, nextRouteMatch),\n });\n });\n\n // Pick fetcher.loads that need to be revalidated\n let revalidatingFetchers: RevalidatingFetcher[] = [];\n fetchLoadMatches.forEach((f, key) => {\n // Don't revalidate if fetcher won't be present in the subsequent render\n if (!matches.some((m) => m.route.id === f.routeId)) {\n return;\n }\n\n let fetcherMatches = matchRoutes(routesToUse, f.path, basename);\n\n // If the fetcher path no longer matches, push it in with null matches so\n // we can trigger a 404 in callLoadersAndMaybeResolveData\n if (!fetcherMatches) {\n revalidatingFetchers.push({\n key,\n routeId: f.routeId,\n path: f.path,\n matches: null,\n match: null,\n controller: null,\n });\n return;\n }\n\n let fetcherMatch = getTargetMatch(fetcherMatches, f.path);\n\n if (cancelledFetcherLoads.includes(key)) {\n revalidatingFetchers.push({\n key,\n routeId: f.routeId,\n path: f.path,\n matches: fetcherMatches,\n match: fetcherMatch,\n controller: new AbortController(),\n });\n return;\n }\n\n // Revalidating fetchers are decoupled from the route matches since they\n // hit a static href, so they _always_ check shouldRevalidate and the\n // default is strictly if a revalidation is explicitly required (action\n // submissions, useRevalidator, X-Remix-Revalidate).\n let shouldRevalidate = shouldRevalidateLoader(fetcherMatch, {\n currentUrl,\n currentParams: state.matches[state.matches.length - 1].params,\n nextUrl,\n nextParams: matches[matches.length - 1].params,\n ...submission,\n actionResult,\n // Forced revalidation due to submission, useRevalidator, or X-Remix-Revalidate\n defaultShouldRevalidate: isRevalidationRequired,\n });\n if (shouldRevalidate) {\n revalidatingFetchers.push({\n key,\n routeId: f.routeId,\n path: f.path,\n matches: fetcherMatches,\n match: fetcherMatch,\n controller: new AbortController(),\n });\n }\n });\n\n return [navigationMatches, revalidatingFetchers];\n}\n\nfunction isNewLoader(\n currentLoaderData: RouteData,\n currentMatch: AgnosticDataRouteMatch,\n match: AgnosticDataRouteMatch\n) {\n let isNew =\n // [a] -> [a, b]\n !currentMatch ||\n // [a, b] -> [a, c]\n match.route.id !== currentMatch.route.id;\n\n // Handle the case that we don't have data for a re-used route, potentially\n // from a prior error or from a cancelled pending deferred\n let isMissingData = currentLoaderData[match.route.id] === undefined;\n\n // Always load if this is a net-new route or we don't yet have data\n return isNew || isMissingData;\n}\n\nfunction isNewRouteInstance(\n currentMatch: AgnosticDataRouteMatch,\n match: AgnosticDataRouteMatch\n) {\n let currentPath = currentMatch.route.path;\n return (\n // param change for this match, /users/123 -> /users/456\n currentMatch.pathname !== match.pathname ||\n // splat param changed, which is not present in match.path\n // e.g. /files/images/avatar.jpg -> files/finances.xls\n (currentPath != null &&\n currentPath.endsWith(\"*\") &&\n currentMatch.params[\"*\"] !== match.params[\"*\"])\n );\n}\n\nfunction shouldRevalidateLoader(\n loaderMatch: AgnosticDataRouteMatch,\n arg: Parameters<ShouldRevalidateFunction>[0]\n) {\n if (loaderMatch.route.shouldRevalidate) {\n let routeChoice = loaderMatch.route.shouldRevalidate(arg);\n if (typeof routeChoice === \"boolean\") {\n return routeChoice;\n }\n }\n\n return arg.defaultShouldRevalidate;\n}\n\n/**\n * Execute route.lazy() methods to lazily load route modules (loader, action,\n * shouldRevalidate) and update the routeManifest in place which shares objects\n * with dataRoutes so those get updated as well.\n */\nasync function loadLazyRouteModule(\n route: AgnosticDataRouteObject,\n mapRouteProperties: MapRoutePropertiesFunction,\n manifest: RouteManifest\n) {\n if (!route.lazy) {\n return;\n }\n\n let lazyRoute = await route.lazy();\n\n // If the lazy route function was executed and removed by another parallel\n // call then we can return - first lazy() to finish wins because the return\n // value of lazy is expected to be static\n if (!route.lazy) {\n return;\n }\n\n let routeToUpdate = manifest[route.id];\n invariant(routeToUpdate, \"No route found in manifest\");\n\n // Update the route in place. This should be safe because there's no way\n // we could yet be sitting on this route as we can't get there without\n // resolving lazy() first.\n //\n // This is different than the HMR \"update\" use-case where we may actively be\n // on the route being updated. The main concern boils down to \"does this\n // mutation affect any ongoing navigations or any current state.matches\n // values?\". If not, it should be safe to update in place.\n let routeUpdates: Record<string, any> = {};\n for (let lazyRouteProperty in lazyRoute) {\n let staticRouteValue =\n routeToUpdate[lazyRouteProperty as keyof typeof routeToUpdate];\n\n let isPropertyStaticallyDefined =\n staticRouteValue !== undefined &&\n // This property isn't static since it should always be updated based\n // on the route updates\n lazyRouteProperty !== \"hasErrorBoundary\";\n\n warning(\n !isPropertyStaticallyDefined,\n `Route \"${routeToUpdate.id}\" has a static property \"${lazyRouteProperty}\" ` +\n `defined but its lazy function is also returning a value for this property. ` +\n `The lazy route property \"${lazyRouteProperty}\" will be ignored.`\n );\n\n if (\n !isPropertyStaticallyDefined &&\n !immutableRouteKeys.has(lazyRouteProperty as ImmutableRouteKey)\n ) {\n routeUpdates[lazyRouteProperty] =\n lazyRoute[lazyRouteProperty as keyof typeof lazyRoute];\n }\n }\n\n // Mutate the route with the provided updates. Do this first so we pass\n // the updated version to mapRouteProperties\n Object.assign(routeToUpdate, routeUpdates);\n\n // Mutate the `hasErrorBoundary` property on the route based on the route\n // updates and remove the `lazy` function so we don't resolve the lazy\n // route again.\n Object.assign(routeToUpdate, {\n // To keep things framework agnostic, we use the provided\n // `mapRouteProperties` (or wrapped `detectErrorBoundary`) function to\n // set the framework-aware properties (`element`/`hasErrorBoundary`) since\n // the logic will differ between frameworks.\n ...mapRouteProperties(routeToUpdate),\n lazy: undefined,\n });\n}\n\nasync function callLoaderOrAction(\n type: \"loader\" | \"action\",\n request: Request,\n match: AgnosticDataRouteMatch,\n matches: AgnosticDataRouteMatch[],\n manifest: RouteManifest,\n mapRouteProperties: MapRoutePropertiesFunction,\n basename: string,\n isStaticRequest: boolean = false,\n isRouteRequest: boolean = false,\n requestContext?: unknown\n): Promise<DataResult> {\n let resultType;\n let result;\n let onReject: (() => void) | undefined;\n\n let runHandler = (handler: ActionFunction | LoaderFunction) => {\n // Setup a promise we can race against so that abort signals short circuit\n let reject: () => void;\n let abortPromise = new Promise((_, r) => (reject = r));\n onReject = () => reject();\n request.signal.addEventListener(\"abort\", onReject);\n return Promise.race([\n handler({ request, params: match.params, context: requestContext }),\n abortPromise,\n ]);\n };\n\n try {\n let handler = match.route[type];\n\n if (match.route.lazy) {\n if (handler) {\n // Run statically defined handler in parallel with lazy()\n let values = await Promise.all([\n runHandler(handler),\n loadLazyRouteModule(match.route, mapRouteProperties, manifest),\n ]);\n result = values[0];\n } else {\n // Load lazy route module, then run any returned handler\n await loadLazyRouteModule(match.route, mapRouteProperties, manifest);\n\n handler = match.route[type];\n if (handler) {\n // Handler still run even if we got interrupted to maintain consistency\n // with un-abortable behavior of handler execution on non-lazy or\n // previously-lazy-loaded routes\n result = await runHandler(handler);\n } else if (type === \"action\") {\n let url = new URL(request.url);\n let pathname = url.pathname + url.search;\n throw getInternalRouterError(405, {\n method: request.method,\n pathname,\n routeId: match.route.id,\n });\n } else {\n // lazy() route has no loader to run. Short circuit here so we don't\n // hit the invariant below that errors on returning undefined.\n return { type: ResultType.data, data: undefined };\n }\n }\n } else if (!handler) {\n let url = new URL(request.url);\n let pathname = url.pathname + url.search;\n throw getInternalRouterError(404, {\n pathname,\n });\n } else {\n result = await runHandler(handler);\n }\n\n invariant(\n result !== undefined,\n `You defined ${type === \"action\" ? \"an action\" : \"a loader\"} for route ` +\n `\"${match.route.id}\" but didn't return anything from your \\`${type}\\` ` +\n `function. Please return a value or \\`null\\`.`\n );\n } catch (e) {\n resultType = ResultType.error;\n result = e;\n } finally {\n if (onReject) {\n request.signal.removeEventListener(\"abort\", onReject);\n }\n }\n\n if (isResponse(result)) {\n let status = result.status;\n\n // Process redirects\n if (redirectStatusCodes.has(status)) {\n let location = result.headers.get(\"Location\");\n invariant(\n location,\n \"Redirects returned/thrown from loaders/actions must have a Location header\"\n );\n\n // Support relative routing in internal redirects\n if (!ABSOLUTE_URL_REGEX.test(location)) {\n location = normalizeTo(\n new URL(request.url),\n matches.slice(0, matches.indexOf(match) + 1),\n basename,\n true,\n location\n );\n } else if (!isStaticRequest) {\n // Strip off the protocol+origin for same-origin + same-basename absolute\n // redirects. If this is a static request, we can let it go back to the\n // browser as-is\n let currentUrl = new URL(request.url);\n let url = location.startsWith(\"//\")\n ? new URL(currentUrl.protocol + location)\n : new URL(location);\n let isSameBasename = stripBasename(url.pathname, basename) != null;\n if (url.origin === currentUrl.origin && isSameBasename) {\n location = url.pathname + url.search + url.hash;\n }\n }\n\n // Don't process redirects in the router during static requests requests.\n // Instead, throw the Response and let the server handle it with an HTTP\n // redirect. We also update the Location header in place in this flow so\n // basename and relative routing is taken into account\n if (isStaticRequest) {\n result.headers.set(\"Location\", location);\n throw result;\n }\n\n return {\n type: ResultType.redirect,\n status,\n location,\n revalidate: result.headers.get(\"X-Remix-Revalidate\") !== null,\n };\n }\n\n // For SSR single-route requests, we want to hand Responses back directly\n // without unwrapping. We do this with the QueryRouteResponse wrapper\n // interface so we can know whether it was returned or thrown\n if (isRouteRequest) {\n // eslint-disable-next-line no-throw-literal\n throw {\n type: resultType || ResultType.data,\n response: result,\n };\n }\n\n let data: any;\n let contentType = result.headers.get(\"Content-Type\");\n // Check between word boundaries instead of startsWith() due to the last\n // paragraph of https://httpwg.org/specs/rfc9110.html#field.content-type\n if (contentType && /\\bapplication\\/json\\b/.test(contentType)) {\n data = await result.json();\n } else {\n data = await result.text();\n }\n\n if (resultType === ResultType.error) {\n return {\n type: resultType,\n error: new ErrorResponse(status, result.statusText, data),\n headers: result.headers,\n };\n }\n\n return {\n type: ResultType.data,\n data,\n statusCode: result.status,\n headers: result.headers,\n };\n }\n\n if (resultType === ResultType.error) {\n return { type: resultType, error: result };\n }\n\n if (isDeferredData(result)) {\n return {\n type: ResultType.deferred,\n deferredData: result,\n statusCode: result.init?.status,\n headers: result.init?.headers && new Headers(result.init.headers),\n };\n }\n\n return { type: ResultType.data, data: result };\n}\n\n// Utility method for creating the Request instances for loaders/actions during\n// client-side navigations and fetches. During SSR we will always have a\n// Request instance from the static handler (query/queryRoute)\nfunction createClientSideRequest(\n history: History,\n location: string | Location,\n signal: AbortSignal,\n submission?: Submission\n): Request {\n let url = history.createURL(stripHashFromPath(location)).toString();\n let init: RequestInit = { signal };\n\n if (submission && isMutationMethod(submission.formMethod)) {\n let { formMethod, formEncType, formData } = submission;\n // Didn't think we needed this but it turns out unlike other methods, patch\n // won't be properly normalized to uppercase and results in a 405 error.\n // See: https://fetch.spec.whatwg.org/#concept-method\n init.method = formMethod.toUpperCase();\n init.body =\n formEncType === \"application/x-www-form-urlencoded\"\n ? convertFormDataToSearchParams(formData)\n : formData;\n }\n\n // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request)\n return new Request(url, init);\n}\n\nfunction convertFormDataToSearchParams(formData: FormData): URLSearchParams {\n let searchParams = new URLSearchParams();\n\n for (let [key, value] of formData.entries()) {\n // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#converting-an-entry-list-to-a-list-of-name-value-pairs\n searchParams.append(key, value instanceof File ? value.name : value);\n }\n\n return searchParams;\n}\n\nfunction processRouteLoaderData(\n matches: AgnosticDataRouteMatch[],\n matchesToLoad: AgnosticDataRouteMatch[],\n results: DataResult[],\n pendingError: RouteData | undefined,\n activeDeferreds: Map<string, DeferredData>\n): {\n loaderData: RouterState[\"loaderData\"];\n errors: RouterState[\"errors\"] | null;\n statusCode: number;\n loaderHeaders: Record<string, Headers>;\n} {\n // Fill in loaderData/errors from our loaders\n let loaderData: RouterState[\"loaderData\"] = {};\n let errors: RouterState[\"errors\"] | null = null;\n let statusCode: number | undefined;\n let foundError = false;\n let loaderHeaders: Record<string, Headers> = {};\n\n // Process loader results into state.loaderData/state.errors\n results.forEach((result, index) => {\n let id = matchesToLoad[index].route.id;\n invariant(\n !isRedirectResult(result),\n \"Cannot handle redirect results in processLoaderData\"\n );\n if (isErrorResult(result)) {\n // Look upwards from the matched route for the closest ancestor\n // error boundary, defaulting to the root match\n let boundaryMatch = findNearestBoundary(matches, id);\n let error = result.error;\n // If we have a pending action error, we report it at the highest-route\n // that throws a loader error, and then clear it out to indicate that\n // it was consumed\n if (pendingError) {\n error = Object.values(pendingError)[0];\n pendingError = undefined;\n }\n\n errors = errors || {};\n\n // Prefer higher error values if lower errors bubble to the same boundary\n if (errors[boundaryMatch.route.id] == null) {\n errors[boundaryMatch.route.id] = error;\n }\n\n // Clear our any prior loaderData for the throwing route\n loaderData[id] = undefined;\n\n // Once we find our first (highest) error, we set the status code and\n // prevent deeper status codes from overriding\n if (!foundError) {\n foundError = true;\n statusCode = isRouteErrorResponse(result.error)\n ? result.error.status\n : 500;\n }\n if (result.headers) {\n loaderHeaders[id] = result.headers;\n }\n } else {\n if (isDeferredResult(result)) {\n activeDeferreds.set(id, result.deferredData);\n loaderData[id] = result.deferredData.data;\n } else {\n loaderData[id] = result.data;\n }\n\n // Error status codes always override success status codes, but if all\n // loaders are successful we take the deepest status code.\n if (\n result.statusCode != null &&\n result.statusCode !== 200 &&\n !foundError\n ) {\n statusCode = result.statusCode;\n }\n if (result.headers) {\n loaderHeaders[id] = result.headers;\n }\n }\n });\n\n // If we didn't consume the pending action error (i.e., all loaders\n // resolved), then consume it here. Also clear out any loaderData for the\n // throwing route\n if (pendingError) {\n errors = pendingError;\n loaderData[Object.keys(pendingError)[0]] = undefined;\n }\n\n return {\n loaderData,\n errors,\n statusCode: statusCode || 200,\n loaderHeaders,\n };\n}\n\nfunction processLoaderData(\n state: RouterState,\n matches: AgnosticDataRouteMatch[],\n matchesToLoad: AgnosticDataRouteMatch[],\n results: DataResult[],\n pendingError: RouteData | undefined,\n revalidatingFetchers: RevalidatingFetcher[],\n fetcherResults: DataResult[],\n activeDeferreds: Map<string, DeferredData>\n): {\n loaderData: RouterState[\"loaderData\"];\n errors?: RouterState[\"errors\"];\n} {\n let { loaderData, errors } = processRouteLoaderData(\n matches,\n matchesToLoad,\n results,\n pendingError,\n activeDeferreds\n );\n\n // Process results from our revalidating fetchers\n for (let index = 0; index < revalidatingFetchers.length; index++) {\n let { key, match, controller } = revalidatingFetchers[index];\n invariant(\n fetcherResults !== undefined && fetcherResults[index] !== undefined,\n \"Did not find corresponding fetcher result\"\n );\n let result = fetcherResults[index];\n\n // Process fetcher non-redirect errors\n if (controller && controller.signal.aborted) {\n // Nothing to do for aborted fetchers\n continue;\n } else if (isErrorResult(result)) {\n let boundaryMatch = findNearestBoundary(state.matches, match?.route.id);\n if (!(errors && errors[boundaryMatch.route.id])) {\n errors = {\n ...errors,\n [boundaryMatch.route.id]: result.error,\n };\n }\n state.fetchers.delete(key);\n } else if (isRedirectResult(result)) {\n // Should never get here, redirects should get processed above, but we\n // keep this to type narrow to a success result in the else\n invariant(false, \"Unhandled fetcher revalidation redirect\");\n } else if (isDeferredResult(result)) {\n // Should never get here, deferred data should be awaited for fetchers\n // in resolveDeferredResults\n invariant(false, \"Unhandled fetcher deferred data\");\n } else {\n let doneFetcher: FetcherStates[\"Idle\"] = {\n state: \"idle\",\n data: result.data,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n \" _hasFetcherDoneAnything \": true,\n };\n state.fetchers.set(key, doneFetcher);\n }\n }\n\n return { loaderData, errors };\n}\n\nfunction mergeLoaderData(\n loaderData: RouteData,\n newLoaderData: RouteData,\n matches: AgnosticDataRouteMatch[],\n errors: RouteData | null | undefined\n): RouteData {\n let mergedLoaderData = { ...newLoaderData };\n for (let match of matches) {\n let id = match.route.id;\n if (newLoaderData.hasOwnProperty(id)) {\n if (newLoaderData[id] !== undefined) {\n mergedLoaderData[id] = newLoaderData[id];\n } else {\n // No-op - this is so we ignore existing data if we have a key in the\n // incoming object with an undefined value, which is how we unset a prior\n // loaderData if we encounter a loader error\n }\n } else if (loaderData[id] !== undefined && match.route.loader) {\n // Preserve existing keys not included in newLoaderData and where a loader\n // wasn't removed by HMR\n mergedLoaderData[id] = loaderData[id];\n }\n\n if (errors && errors.hasOwnProperty(id)) {\n // Don't keep any loader data below the boundary\n break;\n }\n }\n return mergedLoaderData;\n}\n\n// Find the nearest error boundary, looking upwards from the leaf route (or the\n// route specified by routeId) for the closest ancestor error boundary,\n// defaulting to the root match\nfunction findNearestBoundary(\n matches: AgnosticDataRouteMatch[],\n routeId?: string\n): AgnosticDataRouteMatch {\n let eligibleMatches = routeId\n ? matches.slice(0, matches.findIndex((m) => m.route.id === routeId) + 1)\n : [...matches];\n return (\n eligibleMatches.reverse().find((m) => m.route.hasErrorBoundary === true) ||\n matches[0]\n );\n}\n\nfunction getShortCircuitMatches(routes: AgnosticDataRouteObject[]): {\n matches: AgnosticDataRouteMatch[];\n route: AgnosticDataRouteObject;\n} {\n // Prefer a root layout route if present, otherwise shim in a route object\n let route = routes.find((r) => r.index || !r.path || r.path === \"/\") || {\n id: `__shim-error-route__`,\n };\n\n return {\n matches: [\n {\n params: {},\n pathname: \"\",\n pathnameBase: \"\",\n route,\n },\n ],\n route,\n };\n}\n\nfunction getInternalRouterError(\n status: number,\n {\n pathname,\n routeId,\n method,\n type,\n }: {\n pathname?: string;\n routeId?: string;\n method?: string;\n type?: \"defer-action\";\n } = {}\n) {\n let statusText = \"Unknown Server Error\";\n let errorMessage = \"Unknown @remix-run/router error\";\n\n if (status === 400) {\n statusText = \"Bad Request\";\n if (method && pathname && routeId) {\n errorMessage =\n `You made a ${method} request to \"${pathname}\" but ` +\n `did not provide a \\`loader\\` for route \"${routeId}\", ` +\n `so there is no way to handle the request.`;\n } else if (type === \"defer-action\") {\n errorMessage = \"defer() is not supported in actions\";\n }\n } else if (status === 403) {\n statusText = \"Forbidden\";\n errorMessage = `Route \"${routeId}\" does not match URL \"${pathname}\"`;\n } else if (status === 404) {\n statusText = \"Not Found\";\n errorMessage = `No route matches URL \"${pathname}\"`;\n } else if (status === 405) {\n statusText = \"Method Not Allowed\";\n if (method && pathname && routeId) {\n errorMessage =\n `You made a ${method.toUpperCase()} request to \"${pathname}\" but ` +\n `did not provide an \\`action\\` for route \"${routeId}\", ` +\n `so there is no way to handle the request.`;\n } else if (method) {\n errorMessage = `Invalid request method \"${method.toUpperCase()}\"`;\n }\n }\n\n return new ErrorResponse(\n status || 500,\n statusText,\n new Error(errorMessage),\n true\n );\n}\n\n// Find any returned redirect errors, starting from the lowest match\nfunction findRedirect(results: DataResult[]): RedirectResult | undefined {\n for (let i = results.length - 1; i >= 0; i--) {\n let result = results[i];\n if (isRedirectResult(result)) {\n return result;\n }\n }\n}\n\nfunction stripHashFromPath(path: To) {\n let parsedPath = typeof path === \"string\" ? parsePath(path) : path;\n return createPath({ ...parsedPath, hash: \"\" });\n}\n\nfunction isHashChangeOnly(a: Location, b: Location): boolean {\n if (a.pathname !== b.pathname || a.search !== b.search) {\n return false;\n }\n\n if (a.hash === \"\") {\n // /page -> /page#hash\n return b.hash !== \"\";\n } else if (a.hash === b.hash) {\n // /page#hash -> /page#hash\n return true;\n } else if (b.hash !== \"\") {\n // /page#hash -> /page#other\n return true;\n }\n\n // If the hash is removed the browser will re-perform a request to the server\n // /page#hash -> /page\n return false;\n}\n\nfunction isDeferredResult(result: DataResult): result is DeferredResult {\n return result.type === ResultType.deferred;\n}\n\nfunction isErrorResult(result: DataResult): result is ErrorResult {\n return result.type === ResultType.error;\n}\n\nfunction isRedirectResult(result?: DataResult): result is RedirectResult {\n return (result && result.type) === ResultType.redirect;\n}\n\nexport function isDeferredData(value: any): value is DeferredData {\n let deferred: DeferredData = value;\n return (\n deferred &&\n typeof deferred === \"object\" &&\n typeof deferred.data === \"object\" &&\n typeof deferred.subscribe === \"function\" &&\n typeof deferred.cancel === \"function\" &&\n typeof deferred.resolveData === \"function\"\n );\n}\n\nfunction isResponse(value: any): value is Response {\n return (\n value != null &&\n typeof value.status === \"number\" &&\n typeof value.statusText === \"string\" &&\n typeof value.headers === \"object\" &&\n typeof value.body !== \"undefined\"\n );\n}\n\nfunction isRedirectResponse(result: any): result is Response {\n if (!isResponse(result)) {\n return false;\n }\n\n let status = result.status;\n let location = result.headers.get(\"Location\");\n return status >= 300 && status <= 399 && location != null;\n}\n\nfunction isQueryRouteResponse(obj: any): obj is QueryRouteResponse {\n return (\n obj &&\n isResponse(obj.response) &&\n (obj.type === ResultType.data || ResultType.error)\n );\n}\n\nfunction isValidMethod(method: string): method is FormMethod | V7_FormMethod {\n return validRequestMethods.has(method.toLowerCase() as FormMethod);\n}\n\nfunction isMutationMethod(\n method: string\n): method is MutationFormMethod | V7_MutationFormMethod {\n return validMutationMethods.has(method.toLowerCase() as MutationFormMethod);\n}\n\nasync function resolveDeferredResults(\n currentMatches: AgnosticDataRouteMatch[],\n matchesToLoad: (AgnosticDataRouteMatch | null)[],\n results: DataResult[],\n signals: (AbortSignal | null)[],\n isFetcher: boolean,\n currentLoaderData?: RouteData\n) {\n for (let index = 0; index < results.length; index++) {\n let result = results[index];\n let match = matchesToLoad[index];\n // If we don't have a match, then we can have a deferred result to do\n // anything with. This is for revalidating fetchers where the route was\n // removed during HMR\n if (!match) {\n continue;\n }\n\n let currentMatch = currentMatches.find(\n (m) => m.route.id === match!.route.id\n );\n let isRevalidatingLoader =\n currentMatch != null &&\n !isNewRouteInstance(currentMatch, match) &&\n (currentLoaderData && currentLoaderData[match.route.id]) !== undefined;\n\n if (isDeferredResult(result) && (isFetcher || isRevalidatingLoader)) {\n // Note: we do not have to touch activeDeferreds here since we race them\n // against the signal in resolveDeferredData and they'll get aborted\n // there if needed\n let signal = signals[index];\n invariant(\n signal,\n \"Expected an AbortSignal for revalidating fetcher deferred result\"\n );\n await resolveDeferredData(result, signal, isFetcher).then((result) => {\n if (result) {\n results[index] = result || results[index];\n }\n });\n }\n }\n}\n\nasync function resolveDeferredData(\n result: DeferredResult,\n signal: AbortSignal,\n unwrap = false\n): Promise<SuccessResult | ErrorResult | undefined> {\n let aborted = await result.deferredData.resolveData(signal);\n if (aborted) {\n return;\n }\n\n if (unwrap) {\n try {\n return {\n type: ResultType.data,\n data: result.deferredData.unwrappedData,\n };\n } catch (e) {\n // Handle any TrackedPromise._error values encountered while unwrapping\n return {\n type: ResultType.error,\n error: e,\n };\n }\n }\n\n return {\n type: ResultType.data,\n data: result.deferredData.data,\n };\n}\n\nfunction hasNakedIndexQuery(search: string): boolean {\n return new URLSearchParams(search).getAll(\"index\").some((v) => v === \"\");\n}\n\n// Note: This should match the format exported by useMatches, so if you change\n// this please also change that :) Eventually we'll DRY this up\nfunction createUseMatchesMatch(\n match: AgnosticDataRouteMatch,\n loaderData: RouteData\n): UseMatchesMatch {\n let { route, pathname, params } = match;\n return {\n id: route.id,\n pathname,\n params,\n data: loaderData[route.id] as unknown,\n handle: route.handle as unknown,\n };\n}\n\nfunction getTargetMatch(\n matches: AgnosticDataRouteMatch[],\n location: Location | string\n) {\n let search =\n typeof location === \"string\" ? parsePath(location).search : location.search;\n if (\n matches[matches.length - 1].route.index &&\n hasNakedIndexQuery(search || \"\")\n ) {\n // Return the leaf index route when index is present\n return matches[matches.length - 1];\n }\n // Otherwise grab the deepest \"path contributing\" match (ignoring index and\n // pathless layout routes)\n let pathMatches = getPathContributingMatches(matches);\n return pathMatches[pathMatches.length - 1];\n}\n//#endregion\n", "import * as React from \"react\";\nimport type {\n AgnosticRouteMatch,\n AgnosticIndexRouteObject,\n AgnosticNonIndexRouteObject,\n History,\n Location,\n RelativeRoutingType,\n Router,\n StaticHandlerContext,\n To,\n TrackedPromise,\n LazyRouteFunction,\n} from \"@remix-run/router\";\nimport type { Action as NavigationType } from \"@remix-run/router\";\n\n// Create react-specific types from the agnostic types in @remix-run/router to\n// export from react-router\nexport interface IndexRouteObject {\n caseSensitive?: AgnosticIndexRouteObject[\"caseSensitive\"];\n path?: AgnosticIndexRouteObject[\"path\"];\n id?: AgnosticIndexRouteObject[\"id\"];\n loader?: AgnosticIndexRouteObject[\"loader\"];\n action?: AgnosticIndexRouteObject[\"action\"];\n hasErrorBoundary?: AgnosticIndexRouteObject[\"hasErrorBoundary\"];\n shouldRevalidate?: AgnosticIndexRouteObject[\"shouldRevalidate\"];\n handle?: AgnosticIndexRouteObject[\"handle\"];\n index: true;\n children?: undefined;\n element?: React.ReactNode | null;\n errorElement?: React.ReactNode | null;\n Component?: React.ComponentType | null;\n ErrorBoundary?: React.ComponentType | null;\n lazy?: LazyRouteFunction<IndexRouteObject>;\n}\n\nexport interface NonIndexRouteObject {\n caseSensitive?: AgnosticNonIndexRouteObject[\"caseSensitive\"];\n path?: AgnosticNonIndexRouteObject[\"path\"];\n id?: AgnosticNonIndexRouteObject[\"id\"];\n loader?: AgnosticNonIndexRouteObject[\"loader\"];\n action?: AgnosticNonIndexRouteObject[\"action\"];\n hasErrorBoundary?: AgnosticNonIndexRouteObject[\"hasErrorBoundary\"];\n shouldRevalidate?: AgnosticNonIndexRouteObject[\"shouldRevalidate\"];\n handle?: AgnosticNonIndexRouteObject[\"handle\"];\n index?: false;\n children?: RouteObject[];\n element?: React.ReactNode | null;\n errorElement?: React.ReactNode | null;\n Component?: React.ComponentType | null;\n ErrorBoundary?: React.ComponentType | null;\n lazy?: LazyRouteFunction<NonIndexRouteObject>;\n}\n\nexport type RouteObject = IndexRouteObject | NonIndexRouteObject;\n\nexport type DataRouteObject = RouteObject & {\n children?: DataRouteObject[];\n id: string;\n};\n\nexport interface RouteMatch<\n ParamKey extends string = string,\n RouteObjectType extends RouteObject = RouteObject\n> extends AgnosticRouteMatch<ParamKey, RouteObjectType> {}\n\nexport interface DataRouteMatch extends RouteMatch<string, DataRouteObject> {}\n\nexport interface DataRouterContextObject extends NavigationContextObject {\n router: Router;\n staticContext?: StaticHandlerContext;\n}\n\nexport const DataRouterContext =\n React.createContext<DataRouterContextObject | null>(null);\nif (__DEV__) {\n DataRouterContext.displayName = \"DataRouter\";\n}\n\nexport const DataRouterStateContext = React.createContext<\n Router[\"state\"] | null\n>(null);\nif (__DEV__) {\n DataRouterStateContext.displayName = \"DataRouterState\";\n}\n\nexport const AwaitContext = React.createContext<TrackedPromise | null>(null);\nif (__DEV__) {\n AwaitContext.displayName = \"Await\";\n}\n\nexport interface NavigateOptions {\n replace?: boolean;\n state?: any;\n preventScrollReset?: boolean;\n relative?: RelativeRoutingType;\n}\n\n/**\n * A Navigator is a \"location changer\"; it's how you get to different locations.\n *\n * Every history instance conforms to the Navigator interface, but the\n * distinction is useful primarily when it comes to the low-level <Router> API\n * where both the location and a navigator must be provided separately in order\n * to avoid \"tearing\" that may occur in a suspense-enabled app if the action\n * and/or location were to be read directly from the history instance.\n */\nexport interface Navigator {\n createHref: History[\"createHref\"];\n // Optional for backwards-compat with Router/HistoryRouter usage (edge case)\n encodeLocation?: History[\"encodeLocation\"];\n go: History[\"go\"];\n push(to: To, state?: any, opts?: NavigateOptions): void;\n replace(to: To, state?: any, opts?: NavigateOptions): void;\n}\n\ninterface NavigationContextObject {\n basename: string;\n navigator: Navigator;\n static: boolean;\n}\n\nexport const NavigationContext = React.createContext<NavigationContextObject>(\n null!\n);\n\nif (__DEV__) {\n NavigationContext.displayName = \"Navigation\";\n}\n\ninterface LocationContextObject {\n location: Location;\n navigationType: NavigationType;\n}\n\nexport const LocationContext = React.createContext<LocationContextObject>(\n null!\n);\n\nif (__DEV__) {\n LocationContext.displayName = \"Location\";\n}\n\nexport interface RouteContextObject {\n outlet: React.ReactElement | null;\n matches: RouteMatch[];\n isDataRoute: boolean;\n}\n\nexport const RouteContext = React.createContext<RouteContextObject>({\n outlet: null,\n matches: [],\n isDataRoute: false,\n});\n\nif (__DEV__) {\n RouteContext.displayName = \"Route\";\n}\n\nexport const RouteErrorContext = React.createContext<any>(null);\n\nif (__DEV__) {\n RouteErrorContext.displayName = \"RouteError\";\n}\n", "import * as React from \"react\";\nimport type {\n Blocker,\n BlockerFunction,\n Location,\n ParamParseKey,\n Params,\n Path,\n PathMatch,\n PathPattern,\n RelativeRoutingType,\n Router as RemixRouter,\n RevalidationState,\n To,\n} from \"@remix-run/router\";\nimport {\n Action as NavigationType,\n UNSAFE_invariant as invariant,\n isRouteErrorResponse,\n joinPaths,\n matchPath,\n matchRoutes,\n parsePath,\n resolveTo,\n UNSAFE_getPathContributingMatches as getPathContributingMatches,\n UNSAFE_warning as warning,\n} from \"@remix-run/router\";\n\nimport type {\n NavigateOptions,\n RouteContextObject,\n RouteMatch,\n RouteObject,\n DataRouteMatch,\n} from \"./context\";\nimport {\n DataRouterContext,\n DataRouterStateContext,\n LocationContext,\n NavigationContext,\n RouteContext,\n RouteErrorContext,\n AwaitContext,\n} from \"./context\";\n\n/**\n * Returns the full href for the given \"to\" value. This is useful for building\n * custom links that are also accessible and preserve right-click behavior.\n *\n * @see https://reactrouter.com/hooks/use-href\n */\nexport function useHref(\n to: To,\n { relative }: { relative?: RelativeRoutingType } = {}\n): string {\n invariant(\n useInRouterContext(),\n // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n `useHref() may be used only in the context of a <Router> component.`\n );\n\n let { basename, navigator } = React.useContext(NavigationContext);\n let { hash, pathname, search } = useResolvedPath(to, { relative });\n\n let joinedPathname = pathname;\n\n // If we're operating within a basename, prepend it to the pathname prior\n // to creating the href. If this is a root navigation, then just use the raw\n // basename which allows the basename to have full control over the presence\n // of a trailing slash on root links\n if (basename !== \"/\") {\n joinedPathname =\n pathname === \"/\" ? basename : joinPaths([basename, pathname]);\n }\n\n return navigator.createHref({ pathname: joinedPathname, search, hash });\n}\n\n/**\n * Returns true if this component is a descendant of a <Router>.\n *\n * @see https://reactrouter.com/hooks/use-in-router-context\n */\nexport function useInRouterContext(): boolean {\n return React.useContext(LocationContext) != null;\n}\n\n/**\n * Returns the current location object, which represents the current URL in web\n * browsers.\n *\n * Note: If you're using this it may mean you're doing some of your own\n * \"routing\" in your app, and we'd like to know what your use case is. We may\n * be able to provide something higher-level to better suit your needs.\n *\n * @see https://reactrouter.com/hooks/use-location\n */\nexport function useLocation(): Location {\n invariant(\n useInRouterContext(),\n // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n `useLocation() may be used only in the context of a <Router> component.`\n );\n\n return React.useContext(LocationContext).location;\n}\n\n/**\n * Returns the current navigation action which describes how the router came to\n * the current location, either by a pop, push, or replace on the history stack.\n *\n * @see https://reactrouter.com/hooks/use-navigation-type\n */\nexport function useNavigationType(): NavigationType {\n return React.useContext(LocationContext).navigationType;\n}\n\n/**\n * Returns a PathMatch object if the given pattern matches the current URL.\n * This is useful for components that need to know \"active\" state, e.g.\n * <NavLink>.\n *\n * @see https://reactrouter.com/hooks/use-match\n */\nexport function useMatch<\n ParamKey extends ParamParseKey<Path>,\n Path extends string\n>(pattern: PathPattern<Path> | Path): PathMatch<ParamKey> | null {\n invariant(\n useInRouterContext(),\n // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n `useMatch() may be used only in the context of a <Router> component.`\n );\n\n let { pathname } = useLocation();\n return React.useMemo(\n () => matchPath<ParamKey, Path>(pattern, pathname),\n [pathname, pattern]\n );\n}\n\n/**\n * The interface for the navigate() function returned from useNavigate().\n */\nexport interface NavigateFunction {\n (to: To, options?: NavigateOptions): void;\n (delta: number): void;\n}\n\nconst navigateEffectWarning =\n `You should call navigate() in a React.useEffect(), not when ` +\n `your component is first rendered.`;\n\n// Mute warnings for calls to useNavigate in SSR environments\nfunction useIsomorphicLayoutEffect(\n cb: Parameters<typeof React.useLayoutEffect>[0]\n) {\n let isStatic = React.useContext(NavigationContext).static;\n if (!isStatic) {\n // We should be able to get rid of this once react 18.3 is released\n // See: https://github.com/facebook/react/pull/26395\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useLayoutEffect(cb);\n }\n}\n\n/**\n * Returns an imperative method for changing the location. Used by <Link>s, but\n * may also be used by other elements to change the location.\n *\n * @see https://reactrouter.com/hooks/use-navigate\n */\nexport function useNavigate(): NavigateFunction {\n let { isDataRoute } = React.useContext(RouteContext);\n // Conditional usage is OK here because the usage of a data router is static\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return isDataRoute ? useNavigateStable() : useNavigateUnstable();\n}\n\nfunction useNavigateUnstable(): NavigateFunction {\n invariant(\n useInRouterContext(),\n // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n `useNavigate() may be used only in the context of a <Router> component.`\n );\n\n let dataRouterContext = React.useContext(DataRouterContext);\n let { basename, navigator } = React.useContext(NavigationContext);\n let { matches } = React.useContext(RouteContext);\n let { pathname: locationPathname } = useLocation();\n\n let routePathnamesJson = JSON.stringify(\n getPathContributingMatches(matches).map((match) => match.pathnameBase)\n );\n\n let activeRef = React.useRef(false);\n useIsomorphicLayoutEffect(() => {\n activeRef.current = true;\n });\n\n let navigate: NavigateFunction = React.useCallback(\n (to: To | number, options: NavigateOptions = {}) => {\n warning(activeRef.current, navigateEffectWarning);\n\n // Short circuit here since if this happens on first render the navigate\n // is useless because we haven't wired up our history listener yet\n if (!activeRef.current) return;\n\n if (typeof to === \"number\") {\n navigator.go(to);\n return;\n }\n\n let path = resolveTo(\n to,\n JSON.parse(routePathnamesJson),\n locationPathname,\n options.relative === \"path\"\n );\n\n // If we're operating within a basename, prepend it to the pathname prior\n // to handing off to history (but only if we're not in a data router,\n // otherwise it'll prepend the basename inside of the router).\n // If this is a root navigation, then we navigate to the raw basename\n // which allows the basename to have full control over the presence of a\n // trailing slash on root links\n if (dataRouterContext == null && basename !== \"/\") {\n path.pathname =\n path.pathname === \"/\"\n ? basename\n : joinPaths([basename, path.pathname]);\n }\n\n (!!options.replace ? navigator.replace : navigator.push)(\n path,\n options.state,\n options\n );\n },\n [\n basename,\n navigator,\n routePathnamesJson,\n locationPathname,\n dataRouterContext,\n ]\n );\n\n return navigate;\n}\n\nconst OutletContext = React.createContext<unknown>(null);\n\n/**\n * Returns the context (if provided) for the child route at this level of the route\n * hierarchy.\n * @see https://reactrouter.com/hooks/use-outlet-context\n */\nexport function useOutletContext<Context = unknown>(): Context {\n return React.useContext(OutletContext) as Context;\n}\n\n/**\n * Returns the element for the child route at this level of the route\n * hierarchy. Used internally by <Outlet> to render child routes.\n *\n * @see https://reactrouter.com/hooks/use-outlet\n */\nexport function useOutlet(context?: unknown): React.ReactElement | null {\n let outlet = React.useContext(RouteContext).outlet;\n if (outlet) {\n return (\n <OutletContext.Provider value={context}>{outlet}</OutletContext.Provider>\n );\n }\n return outlet;\n}\n\n/**\n * Returns an object of key/value pairs of the dynamic params from the current\n * URL that were matched by the route path.\n *\n * @see https://reactrouter.com/hooks/use-params\n */\nexport function useParams<\n ParamsOrKey extends string | Record<string, string | undefined> = string\n>(): Readonly<\n [ParamsOrKey] extends [string] ? Params<ParamsOrKey> : Partial<ParamsOrKey>\n> {\n let { matches } = React.useContext(RouteContext);\n let routeMatch = matches[matches.length - 1];\n return routeMatch ? (routeMatch.params as any) : {};\n}\n\n/**\n * Resolves the pathname of the given `to` value against the current location.\n *\n * @see https://reactrouter.com/hooks/use-resolved-path\n */\nexport function useResolvedPath(\n to: To,\n { relative }: { relative?: RelativeRoutingType } = {}\n): Path {\n let { matches } = React.useContext(RouteContext);\n let { pathname: locationPathname } = useLocation();\n\n let routePathnamesJson = JSON.stringify(\n getPathContributingMatches(matches).map((match) => match.pathnameBase)\n );\n\n return React.useMemo(\n () =>\n resolveTo(\n to,\n JSON.parse(routePathnamesJson),\n locationPathname,\n relative === \"path\"\n ),\n [to, routePathnamesJson, locationPathname, relative]\n );\n}\n\n/**\n * Returns the element of the route that matched the current location, prepared\n * with the correct context to render the remainder of the route tree. Route\n * elements in the tree must render an <Outlet> to render their child route's\n * element.\n *\n * @see https://reactrouter.com/hooks/use-routes\n */\nexport function useRoutes(\n routes: RouteObject[],\n locationArg?: Partial<Location> | string\n): React.ReactElement | null {\n return useRoutesImpl(routes, locationArg);\n}\n\n// Internal implementation with accept optional param for RouterProvider usage\nexport function useRoutesImpl(\n routes: RouteObject[],\n locationArg?: Partial<Location> | string,\n dataRouterState?: RemixRouter[\"state\"]\n): React.ReactElement | null {\n invariant(\n useInRouterContext(),\n // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n `useRoutes() may be used only in the context of a <Router> component.`\n );\n\n let { navigator } = React.useContext(NavigationContext);\n let { matches: parentMatches } = React.useContext(RouteContext);\n let routeMatch = parentMatches[parentMatches.length - 1];\n let parentParams = routeMatch ? routeMatch.params : {};\n let parentPathname = routeMatch ? routeMatch.pathname : \"/\";\n let parentPathnameBase = routeMatch ? routeMatch.pathnameBase : \"/\";\n let parentRoute = routeMatch && routeMatch.route;\n\n if (__DEV__) {\n // You won't get a warning about 2 different <Routes> under a <Route>\n // without a trailing *, but this is a best-effort warning anyway since we\n // cannot even give the warning unless they land at the parent route.\n //\n // Example:\n //\n // <Routes>\n // {/* This route path MUST end with /* because otherwise\n // it will never match /blog/post/123 */}\n // <Route path=\"blog\" element={<Blog />} />\n // <Route path=\"blog/feed\" element={<BlogFeed />} />\n // </Routes>\n //\n // function Blog() {\n // return (\n // <Routes>\n // <Route path=\"post/:id\" element={<Post />} />\n // </Routes>\n // );\n // }\n let parentPath = (parentRoute && parentRoute.path) || \"\";\n warningOnce(\n parentPathname,\n !parentRoute || parentPath.endsWith(\"*\"),\n `You rendered descendant <Routes> (or called \\`useRoutes()\\`) at ` +\n `\"${parentPathname}\" (under <Route path=\"${parentPath}\">) but the ` +\n `parent route path has no trailing \"*\". This means if you navigate ` +\n `deeper, the parent won't match anymore and therefore the child ` +\n `routes will never render.\\n\\n` +\n `Please change the parent <Route path=\"${parentPath}\"> to <Route ` +\n `path=\"${parentPath === \"/\" ? \"*\" : `${parentPath}/*`}\">.`\n );\n }\n\n let locationFromContext = useLocation();\n\n let location;\n if (locationArg) {\n let parsedLocationArg =\n typeof locationArg === \"string\" ? parsePath(locationArg) : locationArg;\n\n invariant(\n parentPathnameBase === \"/\" ||\n parsedLocationArg.pathname?.startsWith(parentPathnameBase),\n `When overriding the location using \\`<Routes location>\\` or \\`useRoutes(routes, location)\\`, ` +\n `the location pathname must begin with the portion of the URL pathname that was ` +\n `matched by all parent routes. The current pathname base is \"${parentPathnameBase}\" ` +\n `but pathname \"${parsedLocationArg.pathname}\" was given in the \\`location\\` prop.`\n );\n\n location = parsedLocationArg;\n } else {\n location = locationFromContext;\n }\n\n let pathname = location.pathname || \"/\";\n let remainingPathname =\n parentPathnameBase === \"/\"\n ? pathname\n : pathname.slice(parentPathnameBase.length) || \"/\";\n\n let matches = matchRoutes(routes, { pathname: remainingPathname });\n\n if (__DEV__) {\n warning(\n parentRoute || matches != null,\n `No routes matched location \"${location.pathname}${location.search}${location.hash}\" `\n );\n\n warning(\n matches == null ||\n matches[matches.length - 1].route.element !== undefined ||\n matches[matches.length - 1].route.Component !== undefined,\n `Matched leaf route at location \"${location.pathname}${location.search}${location.hash}\" ` +\n `does not have an element or Component. This means it will render an <Outlet /> with a ` +\n `null value by default resulting in an \"empty\" page.`\n );\n }\n\n let renderedMatches = _renderMatches(\n matches &&\n matches.map((match) =>\n Object.assign({}, match, {\n params: Object.assign({}, parentParams, match.params),\n pathname: joinPaths([\n parentPathnameBase,\n // Re-encode pathnames that were decoded inside matchRoutes\n navigator.encodeLocation\n ? navigator.encodeLocation(match.pathname).pathname\n : match.pathname,\n ]),\n pathnameBase:\n match.pathnameBase === \"/\"\n ? parentPathnameBase\n : joinPaths([\n parentPathnameBase,\n // Re-encode pathnames that were decoded inside matchRoutes\n navigator.encodeLocation\n ? navigator.encodeLocation(match.pathnameBase).pathname\n : match.pathnameBase,\n ]),\n })\n ),\n parentMatches,\n dataRouterState\n );\n\n // When a user passes in a `locationArg`, the associated routes need to\n // be wrapped in a new `LocationContext.Provider` in order for `useLocation`\n // to use the scoped location instead of the global location.\n if (locationArg && renderedMatches) {\n return (\n <LocationContext.Provider\n value={{\n location: {\n pathname: \"/\",\n search: \"\",\n hash: \"\",\n state: null,\n key: \"default\",\n ...location,\n },\n navigationType: NavigationType.Pop,\n }}\n >\n {renderedMatches}\n </LocationContext.Provider>\n );\n }\n\n return renderedMatches;\n}\n\nfunction DefaultErrorComponent() {\n let error = useRouteError();\n let message = isRouteErrorResponse(error)\n ? `${error.status} ${error.statusText}`\n : error instanceof Error\n ? error.message\n : JSON.stringify(error);\n let stack = error instanceof Error ? error.stack : null;\n let lightgrey = \"rgba(200,200,200, 0.5)\";\n let preStyles = { padding: \"0.5rem\", backgroundColor: lightgrey };\n let codeStyles = { padding: \"2px 4px\", backgroundColor: lightgrey };\n\n let devInfo = null;\n if (__DEV__) {\n console.error(\n \"Error handled by React Router default ErrorBoundary:\",\n error\n );\n\n devInfo = (\n <>\n <p>💿 Hey developer 👋</p>\n <p>\n You can provide a way better UX than this when your app throws errors\n by providing your own <code style={codeStyles}>ErrorBoundary</code> or{\" \"}\n <code style={codeStyles}>errorElement</code> prop on your route.\n </p>\n </>\n );\n }\n\n return (\n <>\n <h2>Unexpected Application Error!</h2>\n <h3 style={{ fontStyle: \"italic\" }}>{message}</h3>\n {stack ? <pre style={preStyles}>{stack}</pre> : null}\n {devInfo}\n </>\n );\n}\n\nconst defaultErrorElement = <DefaultErrorComponent />;\n\ntype RenderErrorBoundaryProps = React.PropsWithChildren<{\n location: Location;\n revalidation: RevalidationState;\n error: any;\n component: React.ReactNode;\n routeContext: RouteContextObject;\n}>;\n\ntype RenderErrorBoundaryState = {\n location: Location;\n revalidation: RevalidationState;\n error: any;\n};\n\nexport class RenderErrorBoundary extends React.Component<\n RenderErrorBoundaryProps,\n RenderErrorBoundaryState\n> {\n constructor(props: RenderErrorBoundaryProps) {\n super(props);\n this.state = {\n location: props.location,\n revalidation: props.revalidation,\n error: props.error,\n };\n }\n\n static getDerivedStateFromError(error: any) {\n return { error: error };\n }\n\n static getDerivedStateFromProps(\n props: RenderErrorBoundaryProps,\n state: RenderErrorBoundaryState\n ) {\n // When we get into an error state, the user will likely click \"back\" to the\n // previous page that didn't have an error. Because this wraps the entire\n // application, that will have no effect--the error page continues to display.\n // This gives us a mechanism to recover from the error when the location changes.\n //\n // Whether we're in an error state or not, we update the location in state\n // so that when we are in an error state, it gets reset when a new location\n // comes in and the user recovers from the error.\n if (\n state.location !== props.location ||\n (state.revalidation !== \"idle\" && props.revalidation === \"idle\")\n ) {\n return {\n error: props.error,\n location: props.location,\n revalidation: props.revalidation,\n };\n }\n\n // If we're not changing locations, preserve the location but still surface\n // any new errors that may come through. We retain the existing error, we do\n // this because the error provided from the app state may be cleared without\n // the location changing.\n return {\n error: props.error || state.error,\n location: state.location,\n revalidation: props.revalidation || state.revalidation,\n };\n }\n\n componentDidCatch(error: any, errorInfo: any) {\n console.error(\n \"React Router caught the following error during render\",\n error,\n errorInfo\n );\n }\n\n render() {\n return this.state.error ? (\n <RouteContext.Provider value={this.props.routeContext}>\n <RouteErrorContext.Provider\n value={this.state.error}\n children={this.props.component}\n />\n </RouteContext.Provider>\n ) : (\n this.props.children\n );\n }\n}\n\ninterface RenderedRouteProps {\n routeContext: RouteContextObject;\n match: RouteMatch<string, RouteObject>;\n children: React.ReactNode | null;\n}\n\nfunction RenderedRoute({ routeContext, match, children }: RenderedRouteProps) {\n let dataRouterContext = React.useContext(DataRouterContext);\n\n // Track how deep we got in our render pass to emulate SSR componentDidCatch\n // in a DataStaticRouter\n if (\n dataRouterContext &&\n dataRouterContext.static &&\n dataRouterContext.staticContext &&\n (match.route.errorElement || match.route.ErrorBoundary)\n ) {\n dataRouterContext.staticContext._deepestRenderedBoundaryId = match.route.id;\n }\n\n return (\n <RouteContext.Provider value={routeContext}>\n {children}\n </RouteContext.Provider>\n );\n}\n\nexport function _renderMatches(\n matches: RouteMatch[] | null,\n parentMatches: RouteMatch[] = [],\n dataRouterState: RemixRouter[\"state\"] | null = null\n): React.ReactElement | null {\n if (matches == null) {\n if (dataRouterState?.errors) {\n // Don't bail if we have data router errors so we can render them in the\n // boundary. Use the pre-matched (or shimmed) matches\n matches = dataRouterState.matches as DataRouteMatch[];\n } else {\n return null;\n }\n }\n\n let renderedMatches = matches;\n\n // If we have data errors, trim matches to the highest error boundary\n let errors = dataRouterState?.errors;\n if (errors != null) {\n let errorIndex = renderedMatches.findIndex(\n (m) => m.route.id && errors?.[m.route.id]\n );\n invariant(\n errorIndex >= 0,\n `Could not find a matching route for errors on route IDs: ${Object.keys(\n errors\n ).join(\",\")}`\n );\n renderedMatches = renderedMatches.slice(\n 0,\n Math.min(renderedMatches.length, errorIndex + 1)\n );\n }\n\n return renderedMatches.reduceRight((outlet, match, index) => {\n let error = match.route.id ? errors?.[match.route.id] : null;\n // Only data routers handle errors\n let errorElement: React.ReactNode | null = null;\n if (dataRouterState) {\n errorElement = match.route.errorElement || defaultErrorElement;\n }\n let matches = parentMatches.concat(renderedMatches.slice(0, index + 1));\n let getChildren = () => {\n let children: React.ReactNode;\n if (error) {\n children = errorElement;\n } else if (match.route.Component) {\n // Note: This is a de-optimized path since React won't re-use the\n // ReactElement since it's identity changes with each new\n // React.createElement call. We keep this so folks can use\n // `<Route Component={...}>` in `<Routes>` but generally `Component`\n // usage is only advised in `RouterProvider` when we can convert it to\n // `element` ahead of time.\n children = <match.route.Component />;\n } else if (match.route.element) {\n children = match.route.element;\n } else {\n children = outlet;\n }\n return (\n <RenderedRoute\n match={match}\n routeContext={{\n outlet,\n matches,\n isDataRoute: dataRouterState != null,\n }}\n children={children}\n />\n );\n };\n // Only wrap in an error boundary within data router usages when we have an\n // ErrorBoundary/errorElement on this route. Otherwise let it bubble up to\n // an ancestor ErrorBoundary/errorElement\n return dataRouterState &&\n (match.route.ErrorBoundary || match.route.errorElement || index === 0) ? (\n <RenderErrorBoundary\n location={dataRouterState.location}\n revalidation={dataRouterState.revalidation}\n component={errorElement}\n error={error}\n children={getChildren()}\n routeContext={{ outlet: null, matches, isDataRoute: true }}\n />\n ) : (\n getChildren()\n );\n }, null as React.ReactElement | null);\n}\n\nenum DataRouterHook {\n UseBlocker = \"useBlocker\",\n UseRevalidator = \"useRevalidator\",\n UseNavigateStable = \"useNavigate\",\n}\n\nenum DataRouterStateHook {\n UseBlocker = \"useBlocker\",\n UseLoaderData = \"useLoaderData\",\n UseActionData = \"useActionData\",\n UseRouteError = \"useRouteError\",\n UseNavigation = \"useNavigation\",\n UseRouteLoaderData = \"useRouteLoaderData\",\n UseMatches = \"useMatches\",\n UseRevalidator = \"useRevalidator\",\n UseNavigateStable = \"useNavigate\",\n UseRouteId = \"useRouteId\",\n}\n\nfunction getDataRouterConsoleError(\n hookName: DataRouterHook | DataRouterStateHook\n) {\n return `${hookName} must be used within a data router. See https://reactrouter.com/routers/picking-a-router.`;\n}\n\nfunction useDataRouterContext(hookName: DataRouterHook) {\n let ctx = React.useContext(DataRouterContext);\n invariant(ctx, getDataRouterConsoleError(hookName));\n return ctx;\n}\n\nfunction useDataRouterState(hookName: DataRouterStateHook) {\n let state = React.useContext(DataRouterStateContext);\n invariant(state, getDataRouterConsoleError(hookName));\n return state;\n}\n\nfunction useRouteContext(hookName: DataRouterStateHook) {\n let route = React.useContext(RouteContext);\n invariant(route, getDataRouterConsoleError(hookName));\n return route;\n}\n\n// Internal version with hookName-aware debugging\nfunction useCurrentRouteId(hookName: DataRouterStateHook) {\n let route = useRouteContext(hookName);\n let thisRoute = route.matches[route.matches.length - 1];\n invariant(\n thisRoute.route.id,\n `${hookName} can only be used on routes that contain a unique \"id\"`\n );\n return thisRoute.route.id;\n}\n\n/**\n * Returns the ID for the nearest contextual route\n */\nexport function useRouteId() {\n return useCurrentRouteId(DataRouterStateHook.UseRouteId);\n}\n\n/**\n * Returns the current navigation, defaulting to an \"idle\" navigation when\n * no navigation is in progress\n */\nexport function useNavigation() {\n let state = useDataRouterState(DataRouterStateHook.UseNavigation);\n return state.navigation;\n}\n\n/**\n * Returns a revalidate function for manually triggering revalidation, as well\n * as the current state of any manual revalidations\n */\nexport function useRevalidator() {\n let dataRouterContext = useDataRouterContext(DataRouterHook.UseRevalidator);\n let state = useDataRouterState(DataRouterStateHook.UseRevalidator);\n return {\n revalidate: dataRouterContext.router.revalidate,\n state: state.revalidation,\n };\n}\n\n/**\n * Returns the active route matches, useful for accessing loaderData for\n * parent/child routes or the route \"handle\" property\n */\nexport function useMatches() {\n let { matches, loaderData } = useDataRouterState(\n DataRouterStateHook.UseMatches\n );\n return React.useMemo(\n () =>\n matches.map((match) => {\n let { pathname, params } = match;\n // Note: This structure matches that created by createUseMatchesMatch\n // in the @remix-run/router , so if you change this please also change\n // that :) Eventually we'll DRY this up\n return {\n id: match.route.id,\n pathname,\n params,\n data: loaderData[match.route.id] as unknown,\n handle: match.route.handle as unknown,\n };\n }),\n [matches, loaderData]\n );\n}\n\n/**\n * Returns the loader data for the nearest ancestor Route loader\n */\nexport function useLoaderData(): unknown {\n let state = useDataRouterState(DataRouterStateHook.UseLoaderData);\n let routeId = useCurrentRouteId(DataRouterStateHook.UseLoaderData);\n\n if (state.errors && state.errors[routeId] != null) {\n console.error(\n `You cannot \\`useLoaderData\\` in an errorElement (routeId: ${routeId})`\n );\n return undefined;\n }\n return state.loaderData[routeId];\n}\n\n/**\n * Returns the loaderData for the given routeId\n */\nexport function useRouteLoaderData(routeId: string): unknown {\n let state = useDataRouterState(DataRouterStateHook.UseRouteLoaderData);\n return state.loaderData[routeId];\n}\n\n/**\n * Returns the action data for the nearest ancestor Route action\n */\nexport function useActionData(): unknown {\n let state = useDataRouterState(DataRouterStateHook.UseActionData);\n\n let route = React.useContext(RouteContext);\n invariant(route, `useActionData must be used inside a RouteContext`);\n\n return Object.values(state?.actionData || {})[0];\n}\n\n/**\n * Returns the nearest ancestor Route error, which could be a loader/action\n * error or a render error. This is intended to be called from your\n * ErrorBoundary/errorElement to display a proper error message.\n */\nexport function useRouteError(): unknown {\n let error = React.useContext(RouteErrorContext);\n let state = useDataRouterState(DataRouterStateHook.UseRouteError);\n let routeId = useCurrentRouteId(DataRouterStateHook.UseRouteError);\n\n // If this was a render error, we put it in a RouteError context inside\n // of RenderErrorBoundary\n if (error) {\n return error;\n }\n\n // Otherwise look for errors from our data router state\n return state.errors?.[routeId];\n}\n\n/**\n * Returns the happy-path data from the nearest ancestor <Await /> value\n */\nexport function useAsyncValue(): unknown {\n let value = React.useContext(AwaitContext);\n return value?._data;\n}\n\n/**\n * Returns the error from the nearest ancestor <Await /> value\n */\nexport function useAsyncError(): unknown {\n let value = React.useContext(AwaitContext);\n return value?._error;\n}\n\nlet blockerId = 0;\n\n/**\n * Allow the application to block navigations within the SPA and present the\n * user a confirmation dialog to confirm the navigation. Mostly used to avoid\n * using half-filled form data. This does not handle hard-reloads or\n * cross-origin navigations.\n */\nexport function useBlocker(shouldBlock: boolean | BlockerFunction): Blocker {\n let { router } = useDataRouterContext(DataRouterHook.UseBlocker);\n let state = useDataRouterState(DataRouterStateHook.UseBlocker);\n let [blockerKey] = React.useState(() => String(++blockerId));\n\n let blockerFunction = React.useCallback<BlockerFunction>(\n (args) => {\n return typeof shouldBlock === \"function\"\n ? !!shouldBlock(args)\n : !!shouldBlock;\n },\n [shouldBlock]\n );\n\n let blocker = router.getBlocker(blockerKey, blockerFunction);\n\n // Cleanup on unmount\n React.useEffect(\n () => () => router.deleteBlocker(blockerKey),\n [router, blockerKey]\n );\n\n // Prefer the blocker from state since DataRouterContext is memoized so this\n // ensures we update on blocker state updates\n return state.blockers.get(blockerKey) || blocker;\n}\n\n/**\n * Stable version of useNavigate that is used when we are in the context of\n * a RouterProvider.\n */\nfunction useNavigateStable(): NavigateFunction {\n let { router } = useDataRouterContext(DataRouterHook.UseNavigateStable);\n let id = useCurrentRouteId(DataRouterStateHook.UseNavigateStable);\n\n let activeRef = React.useRef(false);\n useIsomorphicLayoutEffect(() => {\n activeRef.current = true;\n });\n\n let navigate: NavigateFunction = React.useCallback(\n (to: To | number, options: NavigateOptions = {}) => {\n warning(activeRef.current, navigateEffectWarning);\n\n // Short circuit here since if this happens on first render the navigate\n // is useless because we haven't wired up our router subscriber yet\n if (!activeRef.current) return;\n\n if (typeof to === \"number\") {\n router.navigate(to);\n } else {\n router.navigate(to, { fromRouteId: id, ...options });\n }\n },\n [router, id]\n );\n\n return navigate;\n}\n\nconst alreadyWarned: Record<string, boolean> = {};\n\nfunction warningOnce(key: string, cond: boolean, message: string) {\n if (!cond && !alreadyWarned[key]) {\n alreadyWarned[key] = true;\n warning(false, message);\n }\n}\n", "import * as React from \"react\";\nimport type {\n TrackedPromise,\n InitialEntry,\n Location,\n MemoryHistory,\n Router as RemixRouter,\n To,\n LazyRouteFunction,\n RelativeRoutingType,\n RouterState,\n} from \"@remix-run/router\";\nimport {\n Action as NavigationType,\n AbortedDeferredError,\n createMemoryHistory,\n UNSAFE_invariant as invariant,\n parsePath,\n resolveTo,\n stripBasename,\n UNSAFE_warning as warning,\n UNSAFE_getPathContributingMatches as getPathContributingMatches,\n} from \"@remix-run/router\";\n\nimport type {\n DataRouteObject,\n IndexRouteObject,\n RouteMatch,\n RouteObject,\n Navigator,\n NonIndexRouteObject,\n} from \"./context\";\nimport {\n LocationContext,\n NavigationContext,\n DataRouterContext,\n DataRouterStateContext,\n AwaitContext,\n RouteContext,\n} from \"./context\";\nimport {\n useAsyncValue,\n useInRouterContext,\n useNavigate,\n useOutlet,\n useRoutes,\n _renderMatches,\n useRoutesImpl,\n useLocation,\n} from \"./hooks\";\n\nexport interface RouterProviderProps {\n fallbackElement?: React.ReactNode;\n router: RemixRouter;\n}\n\n/**\n * Given a Remix Router instance, render the appropriate UI\n */\nexport function RouterProvider({\n fallbackElement,\n router,\n}: RouterProviderProps): React.ReactElement {\n // Need to use a layout effect here so we are subscribed early enough to\n // pick up on any render-driven redirects/navigations (useEffect/<Navigate>)\n let [state, setState] = React.useState(router.state);\n React.useLayoutEffect(() => router.subscribe(setState), [router, setState]);\n\n let navigator = React.useMemo((): Navigator => {\n return {\n createHref: router.createHref,\n encodeLocation: router.encodeLocation,\n go: (n) => router.navigate(n),\n push: (to, state, opts) =>\n router.navigate(to, {\n state,\n preventScrollReset: opts?.preventScrollReset,\n }),\n replace: (to, state, opts) =>\n router.navigate(to, {\n replace: true,\n state,\n preventScrollReset: opts?.preventScrollReset,\n }),\n };\n }, [router]);\n\n let basename = router.basename || \"/\";\n\n let dataRouterContext = React.useMemo(\n () => ({\n router,\n navigator,\n static: false,\n basename,\n }),\n [router, navigator, basename]\n );\n\n // The fragment and {null} here are important! We need them to keep React 18's\n // useId happy when we are server-rendering since we may have a <script> here\n // containing the hydrated server-side staticContext (from StaticRouterProvider).\n // useId relies on the component tree structure to generate deterministic id's\n // so we need to ensure it remains the same on the client even though\n // we don't need the <script> tag\n return (\n <>\n <DataRouterContext.Provider value={dataRouterContext}>\n <DataRouterStateContext.Provider value={state}>\n <Router\n basename={router.basename}\n location={router.state.location}\n navigationType={router.state.historyAction}\n navigator={navigator}\n >\n {router.state.initialized ? (\n <DataRoutes routes={router.routes} state={state} />\n ) : (\n fallbackElement\n )}\n </Router>\n </DataRouterStateContext.Provider>\n </DataRouterContext.Provider>\n {null}\n </>\n );\n}\n\nfunction DataRoutes({\n routes,\n state,\n}: {\n routes: DataRouteObject[];\n state: RouterState;\n}): React.ReactElement | null {\n return useRoutesImpl(routes, undefined, state);\n}\n\nexport interface MemoryRouterProps {\n basename?: string;\n children?: React.ReactNode;\n initialEntries?: InitialEntry[];\n initialIndex?: number;\n}\n\n/**\n * A <Router> that stores all entries in memory.\n *\n * @see https://reactrouter.com/router-components/memory-router\n */\nexport function MemoryRouter({\n basename,\n children,\n initialEntries,\n initialIndex,\n}: MemoryRouterProps): React.ReactElement {\n let historyRef = React.useRef<MemoryHistory>();\n if (historyRef.current == null) {\n historyRef.current = createMemoryHistory({\n initialEntries,\n initialIndex,\n v5Compat: true,\n });\n }\n\n let history = historyRef.current;\n let [state, setState] = React.useState({\n action: history.action,\n location: history.location,\n });\n\n React.useLayoutEffect(() => history.listen(setState), [history]);\n\n return (\n <Router\n basename={basename}\n children={children}\n location={state.location}\n navigationType={state.action}\n navigator={history}\n />\n );\n}\n\nexport interface NavigateProps {\n to: To;\n replace?: boolean;\n state?: any;\n relative?: RelativeRoutingType;\n}\n\n/**\n * Changes the current location.\n *\n * Note: This API is mostly useful in React.Component subclasses that are not\n * able to use hooks. In functional components, we recommend you use the\n * `useNavigate` hook instead.\n *\n * @see https://reactrouter.com/components/navigate\n */\nexport function Navigate({\n to,\n replace,\n state,\n relative,\n}: NavigateProps): null {\n invariant(\n useInRouterContext(),\n // TODO: This error is probably because they somehow have 2 versions of\n // the router loaded. We can help them understand how to avoid that.\n `<Navigate> may be used only in the context of a <Router> component.`\n );\n\n warning(\n !React.useContext(NavigationContext).static,\n `<Navigate> must not be used on the initial render in a <StaticRouter>. ` +\n `This is a no-op, but you should modify your code so the <Navigate> is ` +\n `only ever rendered in response to some user interaction or state change.`\n );\n\n let { matches } = React.useContext(RouteContext);\n let { pathname: locationPathname } = useLocation();\n let navigate = useNavigate();\n\n // Resolve the path outside of the effect so that when effects run twice in\n // StrictMode they navigate to the same place\n let path = resolveTo(\n to,\n getPathContributingMatches(matches).map((match) => match.pathnameBase),\n locationPathname,\n relative === \"path\"\n );\n let jsonPath = JSON.stringify(path);\n\n React.useEffect(\n () => navigate(JSON.parse(jsonPath), { replace, state, relative }),\n [navigate, jsonPath, relative, replace, state]\n );\n\n return null;\n}\n\nexport interface OutletProps {\n context?: unknown;\n}\n\n/**\n * Renders the child route's element, if there is one.\n *\n * @see https://reactrouter.com/components/outlet\n */\nexport function Outlet(props: OutletProps): React.ReactElement | null {\n return useOutlet(props.context);\n}\n\nexport interface PathRouteProps {\n caseSensitive?: NonIndexRouteObject[\"caseSensitive\"];\n path?: NonIndexRouteObject[\"path\"];\n id?: NonIndexRouteObject[\"id\"];\n lazy?: LazyRouteFunction<NonIndexRouteObject>;\n loader?: NonIndexRouteObject[\"loader\"];\n action?: NonIndexRouteObject[\"action\"];\n hasErrorBoundary?: NonIndexRouteObject[\"hasErrorBoundary\"];\n shouldRevalidate?: NonIndexRouteObject[\"shouldRevalidate\"];\n handle?: NonIndexRouteObject[\"handle\"];\n index?: false;\n children?: React.ReactNode;\n element?: React.ReactNode | null;\n errorElement?: React.ReactNode | null;\n Component?: React.ComponentType | null;\n ErrorBoundary?: React.ComponentType | null;\n}\n\nexport interface LayoutRouteProps extends PathRouteProps {}\n\nexport interface IndexRouteProps {\n caseSensitive?: IndexRouteObject[\"caseSensitive\"];\n path?: IndexRouteObject[\"path\"];\n id?: IndexRouteObject[\"id\"];\n lazy?: LazyRouteFunction<IndexRouteObject>;\n loader?: IndexRouteObject[\"loader\"];\n action?: IndexRouteObject[\"action\"];\n hasErrorBoundary?: IndexRouteObject[\"hasErrorBoundary\"];\n shouldRevalidate?: IndexRouteObject[\"shouldRevalidate\"];\n handle?: IndexRouteObject[\"handle\"];\n index: true;\n children?: undefined;\n element?: React.ReactNode | null;\n errorElement?: React.ReactNode | null;\n Component?: React.ComponentType | null;\n ErrorBoundary?: React.ComponentType | null;\n}\n\nexport type RouteProps = PathRouteProps | LayoutRouteProps | IndexRouteProps;\n\n/**\n * Declares an element that should be rendered at a certain URL path.\n *\n * @see https://reactrouter.com/components/route\n */\nexport function Route(_props: RouteProps): React.ReactElement | null {\n invariant(\n false,\n `A <Route> is only ever to be used as the child of <Routes> element, ` +\n `never rendered directly. Please wrap your <Route> in a <Routes>.`\n );\n}\n\nexport interface RouterProps {\n basename?: string;\n children?: React.ReactNode;\n location: Partial<Location> | string;\n navigationType?: NavigationType;\n navigator: Navigator;\n static?: boolean;\n}\n\n/**\n * Provides location context for the rest of the app.\n *\n * Note: You usually won't render a <Router> directly. Instead, you'll render a\n * router that is more specific to your environment such as a <BrowserRouter>\n * in web browsers or a <StaticRouter> for server rendering.\n *\n * @see https://reactrouter.com/router-components/router\n */\nexport function Router({\n basename: basenameProp = \"/\",\n children = null,\n location: locationProp,\n navigationType = NavigationType.Pop,\n navigator,\n static: staticProp = false,\n}: RouterProps): React.ReactElement | null {\n invariant(\n !useInRouterContext(),\n `You cannot render a <Router> inside another <Router>.` +\n ` You should never have more than one in your app.`\n );\n\n // Preserve trailing slashes on basename, so we can let the user control\n // the enforcement of trailing slashes throughout the app\n let basename = basenameProp.replace(/^\\/*/, \"/\");\n let navigationContext = React.useMemo(\n () => ({ basename, navigator, static: staticProp }),\n [basename, navigator, staticProp]\n );\n\n if (typeof locationProp === \"string\") {\n locationProp = parsePath(locationProp);\n }\n\n let {\n pathname = \"/\",\n search = \"\",\n hash = \"\",\n state = null,\n key = \"default\",\n } = locationProp;\n\n let locationContext = React.useMemo(() => {\n let trailingPathname = stripBasename(pathname, basename);\n\n if (trailingPathname == null) {\n return null;\n }\n\n return {\n location: {\n pathname: trailingPathname,\n search,\n hash,\n state,\n key,\n },\n navigationType,\n };\n }, [basename, pathname, search, hash, state, key, navigationType]);\n\n warning(\n locationContext != null,\n `<Router basename=\"${basename}\"> is not able to match the URL ` +\n `\"${pathname}${search}${hash}\" because it does not start with the ` +\n `basename, so the <Router> won't render anything.`\n );\n\n if (locationContext == null) {\n return null;\n }\n\n return (\n <NavigationContext.Provider value={navigationContext}>\n <LocationContext.Provider children={children} value={locationContext} />\n </NavigationContext.Provider>\n );\n}\n\nexport interface RoutesProps {\n children?: React.ReactNode;\n location?: Partial<Location> | string;\n}\n\n/**\n * A container for a nested tree of <Route> elements that renders the branch\n * that best matches the current location.\n *\n * @see https://reactrouter.com/components/routes\n */\nexport function Routes({\n children,\n location,\n}: RoutesProps): React.ReactElement | null {\n return useRoutes(createRoutesFromChildren(children), location);\n}\n\nexport interface AwaitResolveRenderFunction {\n (data: Awaited<any>): React.ReactNode;\n}\n\nexport interface AwaitProps {\n children: React.ReactNode | AwaitResolveRenderFunction;\n errorElement?: React.ReactNode;\n resolve: TrackedPromise | any;\n}\n\n/**\n * Component to use for rendering lazily loaded data from returning defer()\n * in a loader function\n */\nexport function Await({ children, errorElement, resolve }: AwaitProps) {\n return (\n <AwaitErrorBoundary resolve={resolve} errorElement={errorElement}>\n <ResolveAwait>{children}</ResolveAwait>\n </AwaitErrorBoundary>\n );\n}\n\ntype AwaitErrorBoundaryProps = React.PropsWithChildren<{\n errorElement?: React.ReactNode;\n resolve: TrackedPromise | any;\n}>;\n\ntype AwaitErrorBoundaryState = {\n error: any;\n};\n\nenum AwaitRenderStatus {\n pending,\n success,\n error,\n}\n\nconst neverSettledPromise = new Promise(() => {});\n\nclass AwaitErrorBoundary extends React.Component<\n AwaitErrorBoundaryProps,\n AwaitErrorBoundaryState\n> {\n constructor(props: AwaitErrorBoundaryProps) {\n super(props);\n this.state = { error: null };\n }\n\n static getDerivedStateFromError(error: any) {\n return { error };\n }\n\n componentDidCatch(error: any, errorInfo: any) {\n console.error(\n \"<Await> caught the following error during render\",\n error,\n errorInfo\n );\n }\n\n render() {\n let { children, errorElement, resolve } = this.props;\n\n let promise: TrackedPromise | null = null;\n let status: AwaitRenderStatus = AwaitRenderStatus.pending;\n\n if (!(resolve instanceof Promise)) {\n // Didn't get a promise - provide as a resolved promise\n status = AwaitRenderStatus.success;\n promise = Promise.resolve();\n Object.defineProperty(promise, \"_tracked\", { get: () => true });\n Object.defineProperty(promise, \"_data\", { get: () => resolve });\n } else if (this.state.error) {\n // Caught a render error, provide it as a rejected promise\n status = AwaitRenderStatus.error;\n let renderError = this.state.error;\n promise = Promise.reject().catch(() => {}); // Avoid unhandled rejection warnings\n Object.defineProperty(promise, \"_tracked\", { get: () => true });\n Object.defineProperty(promise, \"_error\", { get: () => renderError });\n } else if ((resolve as TrackedPromise)._tracked) {\n // Already tracked promise - check contents\n promise = resolve;\n status =\n promise._error !== undefined\n ? AwaitRenderStatus.error\n : promise._data !== undefined\n ? AwaitRenderStatus.success\n : AwaitRenderStatus.pending;\n } else {\n // Raw (untracked) promise - track it\n status = AwaitRenderStatus.pending;\n Object.defineProperty(resolve, \"_tracked\", { get: () => true });\n promise = resolve.then(\n (data: any) =>\n Object.defineProperty(resolve, \"_data\", { get: () => data }),\n (error: any) =>\n Object.defineProperty(resolve, \"_error\", { get: () => error })\n );\n }\n\n if (\n status === AwaitRenderStatus.error &&\n promise._error instanceof AbortedDeferredError\n ) {\n // Freeze the UI by throwing a never resolved promise\n throw neverSettledPromise;\n }\n\n if (status === AwaitRenderStatus.error && !errorElement) {\n // No errorElement, throw to the nearest route-level error boundary\n throw promise._error;\n }\n\n if (status === AwaitRenderStatus.error) {\n // Render via our errorElement\n return <AwaitContext.Provider value={promise} children={errorElement} />;\n }\n\n if (status === AwaitRenderStatus.success) {\n // Render children with resolved value\n return <AwaitContext.Provider value={promise} children={children} />;\n }\n\n // Throw to the suspense boundary\n throw promise;\n }\n}\n\n/**\n * @private\n * Indirection to leverage useAsyncValue for a render-prop API on <Await>\n */\nfunction ResolveAwait({\n children,\n}: {\n children: React.ReactNode | AwaitResolveRenderFunction;\n}) {\n let data = useAsyncValue();\n let toRender = typeof children === \"function\" ? children(data) : children;\n return <>{toRender}</>;\n}\n\n///////////////////////////////////////////////////////////////////////////////\n// UTILS\n///////////////////////////////////////////////////////////////////////////////\n\n/**\n * Creates a route config from a React \"children\" object, which is usually\n * either a `<Route>` element or an array of them. Used internally by\n * `<Routes>` to create a route config from its children.\n *\n * @see https://reactrouter.com/utils/create-routes-from-children\n */\nexport function createRoutesFromChildren(\n children: React.ReactNode,\n parentPath: number[] = []\n): RouteObject[] {\n let routes: RouteObject[] = [];\n\n React.Children.forEach(children, (element, index) => {\n if (!React.isValidElement(element)) {\n // Ignore non-elements. This allows people to more easily inline\n // conditionals in their route config.\n return;\n }\n\n let treePath = [...parentPath, index];\n\n if (element.type === React.Fragment) {\n // Transparently support React.Fragment and its children.\n routes.push.apply(\n routes,\n createRoutesFromChildren(element.props.children, treePath)\n );\n return;\n }\n\n invariant(\n element.type === Route,\n `[${\n typeof element.type === \"string\" ? element.type : element.type.name\n }] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`\n );\n\n invariant(\n !element.props.index || !element.props.children,\n \"An index route cannot have child routes.\"\n );\n\n let route: RouteObject = {\n id: element.props.id || treePath.join(\"-\"),\n caseSensitive: element.props.caseSensitive,\n element: element.props.element,\n Component: element.props.Component,\n index: element.props.index,\n path: element.props.path,\n loader: element.props.loader,\n action: element.props.action,\n errorElement: element.props.errorElement,\n ErrorBoundary: element.props.ErrorBoundary,\n hasErrorBoundary:\n element.props.ErrorBoundary != null ||\n element.props.errorElement != null,\n shouldRevalidate: element.props.shouldRevalidate,\n handle: element.props.handle,\n lazy: element.props.lazy,\n };\n\n if (element.props.children) {\n route.children = createRoutesFromChildren(\n element.props.children,\n treePath\n );\n }\n\n routes.push(route);\n });\n\n return routes;\n}\n\n/**\n * Renders the result of `matchRoutes()` into a React element.\n */\nexport function renderMatches(\n matches: RouteMatch[] | null\n): React.ReactElement | null {\n return _renderMatches(matches);\n}\n", "import * as React from \"react\";\nimport type {\n ActionFunction,\n ActionFunctionArgs,\n Blocker,\n BlockerFunction,\n Fetcher,\n HydrationState,\n JsonFunction,\n LoaderFunction,\n LoaderFunctionArgs,\n Location,\n Navigation,\n Params,\n ParamParseKey,\n Path,\n PathMatch,\n PathPattern,\n RedirectFunction,\n RelativeRoutingType,\n Router as RemixRouter,\n ShouldRevalidateFunction,\n To,\n InitialEntry,\n LazyRouteFunction,\n FutureConfig,\n} from \"@remix-run/router\";\nimport {\n AbortedDeferredError,\n Action as NavigationType,\n createMemoryHistory,\n createPath,\n createRouter,\n defer,\n generatePath,\n isRouteErrorResponse,\n json,\n matchPath,\n matchRoutes,\n parsePath,\n redirect,\n resolvePath,\n UNSAFE_warning as warning,\n} from \"@remix-run/router\";\n\nimport type {\n AwaitProps,\n MemoryRouterProps,\n NavigateProps,\n OutletProps,\n RouteProps,\n PathRouteProps,\n LayoutRouteProps,\n IndexRouteProps,\n RouterProps,\n RoutesProps,\n RouterProviderProps,\n} from \"./lib/components\";\nimport {\n createRoutesFromChildren,\n renderMatches,\n Await,\n MemoryRouter,\n Navigate,\n Outlet,\n Route,\n Router,\n RouterProvider,\n Routes,\n} from \"./lib/components\";\nimport type {\n DataRouteMatch,\n DataRouteObject,\n IndexRouteObject,\n Navigator,\n NavigateOptions,\n NonIndexRouteObject,\n RouteMatch,\n RouteObject,\n} from \"./lib/context\";\nimport {\n DataRouterContext,\n DataRouterStateContext,\n LocationContext,\n NavigationContext,\n RouteContext,\n} from \"./lib/context\";\nimport type { NavigateFunction } from \"./lib/hooks\";\nimport {\n useBlocker,\n useHref,\n useInRouterContext,\n useLocation,\n useMatch,\n useNavigationType,\n useNavigate,\n useOutlet,\n useOutletContext,\n useParams,\n useResolvedPath,\n useRoutes,\n useActionData,\n useAsyncError,\n useAsyncValue,\n useRouteId,\n useLoaderData,\n useMatches,\n useNavigation,\n useRevalidator,\n useRouteError,\n useRouteLoaderData,\n useRoutesImpl,\n} from \"./lib/hooks\";\n\n// Exported for backwards compatibility, but not being used internally anymore\ntype Hash = string;\ntype Pathname = string;\ntype Search = string;\n\n// Expose react-router public API\nexport type {\n ActionFunction,\n ActionFunctionArgs,\n AwaitProps,\n Blocker as unstable_Blocker,\n BlockerFunction as unstable_BlockerFunction,\n DataRouteMatch,\n DataRouteObject,\n Fetcher,\n Hash,\n IndexRouteObject,\n IndexRouteProps,\n JsonFunction,\n LazyRouteFunction,\n LayoutRouteProps,\n LoaderFunction,\n LoaderFunctionArgs,\n Location,\n MemoryRouterProps,\n NavigateFunction,\n NavigateOptions,\n NavigateProps,\n Navigation,\n Navigator,\n NonIndexRouteObject,\n OutletProps,\n Params,\n ParamParseKey,\n Path,\n PathMatch,\n Pathname,\n PathPattern,\n PathRouteProps,\n RedirectFunction,\n RelativeRoutingType,\n RouteMatch,\n RouteObject,\n RouteProps,\n RouterProps,\n RouterProviderProps,\n RoutesProps,\n Search,\n ShouldRevalidateFunction,\n To,\n};\nexport {\n AbortedDeferredError,\n Await,\n MemoryRouter,\n Navigate,\n NavigationType,\n Outlet,\n Route,\n Router,\n RouterProvider,\n Routes,\n createPath,\n createRoutesFromChildren,\n createRoutesFromChildren as createRoutesFromElements,\n defer,\n isRouteErrorResponse,\n generatePath,\n json,\n matchPath,\n matchRoutes,\n parsePath,\n redirect,\n renderMatches,\n resolvePath,\n useActionData,\n useAsyncError,\n useAsyncValue,\n useBlocker as unstable_useBlocker,\n useHref,\n useInRouterContext,\n useLoaderData,\n useLocation,\n useMatch,\n useMatches,\n useNavigate,\n useNavigation,\n useNavigationType,\n useOutlet,\n useOutletContext,\n useParams,\n useResolvedPath,\n useRevalidator,\n useRouteError,\n useRouteLoaderData,\n useRoutes,\n};\n\nfunction mapRouteProperties(route: RouteObject) {\n let updates: Partial<RouteObject> & { hasErrorBoundary: boolean } = {\n // Note: this check also occurs in createRoutesFromChildren so update\n // there if you change this -- please and thank you!\n hasErrorBoundary: route.ErrorBoundary != null || route.errorElement != null,\n };\n\n if (route.Component) {\n if (__DEV__) {\n if (route.element) {\n warning(\n false,\n \"You should not include both `Component` and `element` on your route - \" +\n \"`Component` will be used.\"\n );\n }\n }\n Object.assign(updates, {\n element: React.createElement(route.Component),\n Component: undefined,\n });\n }\n\n if (route.ErrorBoundary) {\n if (__DEV__) {\n if (route.errorElement) {\n warning(\n false,\n \"You should not include both `ErrorBoundary` and `errorElement` on your route - \" +\n \"`ErrorBoundary` will be used.\"\n );\n }\n }\n Object.assign(updates, {\n errorElement: React.createElement(route.ErrorBoundary),\n ErrorBoundary: undefined,\n });\n }\n\n return updates;\n}\n\nexport function createMemoryRouter(\n routes: RouteObject[],\n opts?: {\n basename?: string;\n future?: Partial<Omit<FutureConfig, \"v7_prependBasename\">>;\n hydrationData?: HydrationState;\n initialEntries?: InitialEntry[];\n initialIndex?: number;\n }\n): RemixRouter {\n return createRouter({\n basename: opts?.basename,\n future: {\n ...opts?.future,\n v7_prependBasename: true,\n },\n history: createMemoryHistory({\n initialEntries: opts?.initialEntries,\n initialIndex: opts?.initialIndex,\n }),\n hydrationData: opts?.hydrationData,\n routes,\n mapRouteProperties,\n }).initialize();\n}\n\n///////////////////////////////////////////////////////////////////////////////\n// DANGER! PLEASE READ ME!\n// We provide these exports as an escape hatch in the event that you need any\n// routing data that we don't provide an explicit API for. With that said, we\n// want to cover your use case if we can, so if you feel the need to use these\n// we want to hear from you. Let us know what you're building and we'll do our\n// best to make sure we can support you!\n//\n// We consider these exports an implementation detail and do not guarantee\n// against any breaking changes, regardless of the semver release. Use with\n// extreme caution and only if you understand the consequences. Godspeed.\n///////////////////////////////////////////////////////////////////////////////\n\n/** @internal */\nexport {\n NavigationContext as UNSAFE_NavigationContext,\n LocationContext as UNSAFE_LocationContext,\n RouteContext as UNSAFE_RouteContext,\n DataRouterContext as UNSAFE_DataRouterContext,\n DataRouterStateContext as UNSAFE_DataRouterStateContext,\n mapRouteProperties as UNSAFE_mapRouteProperties,\n useRouteId as UNSAFE_useRouteId,\n useRoutesImpl as UNSAFE_useRoutesImpl,\n};\n", "import type {\n FormEncType,\n HTMLFormMethod,\n RelativeRoutingType,\n} from \"@remix-run/router\";\nimport { stripBasename } from \"@remix-run/router\";\n\nexport const defaultMethod: HTMLFormMethod = \"get\";\nconst defaultEncType: FormEncType = \"application/x-www-form-urlencoded\";\n\nexport function isHtmlElement(object: any): object is HTMLElement {\n return object != null && typeof object.tagName === \"string\";\n}\n\nexport function isButtonElement(object: any): object is HTMLButtonElement {\n return isHtmlElement(object) && object.tagName.toLowerCase() === \"button\";\n}\n\nexport function isFormElement(object: any): object is HTMLFormElement {\n return isHtmlElement(object) && object.tagName.toLowerCase() === \"form\";\n}\n\nexport function isInputElement(object: any): object is HTMLInputElement {\n return isHtmlElement(object) && object.tagName.toLowerCase() === \"input\";\n}\n\ntype LimitedMouseEvent = Pick<\n MouseEvent,\n \"button\" | \"metaKey\" | \"altKey\" | \"ctrlKey\" | \"shiftKey\"\n>;\n\nfunction isModifiedEvent(event: LimitedMouseEvent) {\n return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);\n}\n\nexport function shouldProcessLinkClick(\n event: LimitedMouseEvent,\n target?: string\n) {\n return (\n event.button === 0 && // Ignore everything but left clicks\n (!target || target === \"_self\") && // Let browser handle \"target=_blank\" etc.\n !isModifiedEvent(event) // Ignore clicks with modifier keys\n );\n}\n\nexport type ParamKeyValuePair = [string, string];\n\nexport type URLSearchParamsInit =\n | string\n | ParamKeyValuePair[]\n | Record<string, string | string[]>\n | URLSearchParams;\n\n/**\n * Creates a URLSearchParams object using the given initializer.\n *\n * This is identical to `new URLSearchParams(init)` except it also\n * supports arrays as values in the object form of the initializer\n * instead of just strings. This is convenient when you need multiple\n * values for a given key, but don't want to use an array initializer.\n *\n * For example, instead of:\n *\n * let searchParams = new URLSearchParams([\n * ['sort', 'name'],\n * ['sort', 'price']\n * ]);\n *\n * you can do:\n *\n * let searchParams = createSearchParams({\n * sort: ['name', 'price']\n * });\n */\nexport function createSearchParams(\n init: URLSearchParamsInit = \"\"\n): URLSearchParams {\n return new URLSearchParams(\n typeof init === \"string\" ||\n Array.isArray(init) ||\n init instanceof URLSearchParams\n ? init\n : Object.keys(init).reduce((memo, key) => {\n let value = init[key];\n return memo.concat(\n Array.isArray(value) ? value.map((v) => [key, v]) : [[key, value]]\n );\n }, [] as ParamKeyValuePair[])\n );\n}\n\nexport function getSearchParamsForLocation(\n locationSearch: string,\n defaultSearchParams: URLSearchParams | null\n) {\n let searchParams = createSearchParams(locationSearch);\n\n if (defaultSearchParams) {\n for (let key of defaultSearchParams.keys()) {\n if (!searchParams.has(key)) {\n defaultSearchParams.getAll(key).forEach((value) => {\n searchParams.append(key, value);\n });\n }\n }\n }\n\n return searchParams;\n}\n\nexport interface SubmitOptions {\n /**\n * The HTTP method used to submit the form. Overrides `<form method>`.\n * Defaults to \"GET\".\n */\n method?: HTMLFormMethod;\n\n /**\n * The action URL path used to submit the form. Overrides `<form action>`.\n * Defaults to the path of the current route.\n */\n action?: string;\n\n /**\n * The action URL used to submit the form. Overrides `<form encType>`.\n * Defaults to \"application/x-www-form-urlencoded\".\n */\n encType?: FormEncType;\n\n /**\n * Set `true` to replace the current entry in the browser's history stack\n * instead of creating a new one (i.e. stay on \"the same page\"). Defaults\n * to `false`.\n */\n replace?: boolean;\n\n /**\n * Determines whether the form action is relative to the route hierarchy or\n * the pathname. Use this if you want to opt out of navigating the route\n * hierarchy and want to instead route based on /-delimited URL segments\n */\n relative?: RelativeRoutingType;\n\n /**\n * In browser-based environments, prevent resetting scroll after this\n * navigation when using the <ScrollRestoration> component\n */\n preventScrollReset?: boolean;\n}\n\nexport function getFormSubmissionInfo(\n target:\n | HTMLFormElement\n | HTMLButtonElement\n | HTMLInputElement\n | FormData\n | URLSearchParams\n | { [name: string]: string }\n | null,\n options: SubmitOptions,\n basename: string\n): {\n action: string | null;\n method: string;\n encType: string;\n formData: FormData;\n} {\n let method: string;\n let action: string | null = null;\n let encType: string;\n let formData: FormData;\n\n if (isFormElement(target)) {\n let submissionTrigger: HTMLButtonElement | HTMLInputElement = (\n options as any\n ).submissionTrigger;\n\n if (options.action) {\n action = options.action;\n } else {\n // When grabbing the action from the element, it will have had the basename\n // prefixed to ensure non-JS scenarios work, so strip it since we'll\n // re-prefix in the router\n let attr = target.getAttribute(\"action\");\n action = attr ? stripBasename(attr, basename) : null;\n }\n method = options.method || target.getAttribute(\"method\") || defaultMethod;\n encType =\n options.encType || target.getAttribute(\"enctype\") || defaultEncType;\n\n formData = new FormData(target);\n\n if (submissionTrigger && submissionTrigger.name) {\n formData.append(submissionTrigger.name, submissionTrigger.value);\n }\n } else if (\n isButtonElement(target) ||\n (isInputElement(target) &&\n (target.type === \"submit\" || target.type === \"image\"))\n ) {\n let form = target.form;\n\n if (form == null) {\n throw new Error(\n `Cannot submit a <button> or <input type=\"submit\"> without a <form>`\n );\n }\n\n // <button>/<input type=\"submit\"> may override attributes of <form>\n\n if (options.action) {\n action = options.action;\n } else {\n // When grabbing the action from the element, it will have had the basename\n // prefixed to ensure non-JS scenarios work, so strip it since we'll\n // re-prefix in the router\n let attr =\n target.getAttribute(\"formaction\") || form.getAttribute(\"action\");\n action = attr ? stripBasename(attr, basename) : null;\n }\n\n method =\n options.method ||\n target.getAttribute(\"formmethod\") ||\n form.getAttribute(\"method\") ||\n defaultMethod;\n encType =\n options.encType ||\n target.getAttribute(\"formenctype\") ||\n form.getAttribute(\"enctype\") ||\n defaultEncType;\n\n formData = new FormData(form);\n\n // Include name + value from a <button>, appending in case the button name\n // matches an existing input name\n if (target.name) {\n formData.append(target.name, target.value);\n }\n } else if (isHtmlElement(target)) {\n throw new Error(\n `Cannot submit element that is not <form>, <button>, or ` +\n `<input type=\"submit|image\">`\n );\n } else {\n method = options.method || defaultMethod;\n action = options.action || null;\n encType = options.encType || defaultEncType;\n\n if (target instanceof FormData) {\n formData = target;\n } else {\n formData = new FormData();\n\n if (target instanceof URLSearchParams) {\n for (let [name, value] of target) {\n formData.append(name, value);\n }\n } else if (target != null) {\n for (let name of Object.keys(target)) {\n formData.append(name, target[name]);\n }\n }\n }\n }\n\n return { action, method: method.toLowerCase(), encType, formData };\n}\n", "/**\n * NOTE: If you refactor this to split up the modules into separate files,\n * you'll need to update the rollup config for react-router-dom-v5-compat.\n */\nimport * as React from \"react\";\nimport type {\n NavigateOptions,\n RelativeRoutingType,\n RouteObject,\n To,\n} from \"react-router\";\nimport {\n Router,\n createPath,\n useHref,\n useLocation,\n useMatches,\n useNavigate,\n useNavigation,\n useResolvedPath,\n unstable_useBlocker as useBlocker,\n UNSAFE_DataRouterContext as DataRouterContext,\n UNSAFE_DataRouterStateContext as DataRouterStateContext,\n UNSAFE_NavigationContext as NavigationContext,\n UNSAFE_RouteContext as RouteContext,\n UNSAFE_mapRouteProperties as mapRouteProperties,\n UNSAFE_useRouteId as useRouteId,\n} from \"react-router\";\nimport type {\n BrowserHistory,\n Fetcher,\n FormEncType,\n FormMethod,\n FutureConfig,\n GetScrollRestorationKeyFunction,\n HashHistory,\n History,\n HTMLFormMethod,\n HydrationState,\n Router as RemixRouter,\n V7_FormMethod,\n} from \"@remix-run/router\";\nimport {\n createRouter,\n createBrowserHistory,\n createHashHistory,\n joinPaths,\n stripBasename,\n ErrorResponse,\n UNSAFE_invariant as invariant,\n UNSAFE_warning as warning,\n} from \"@remix-run/router\";\n\nimport type {\n SubmitOptions,\n ParamKeyValuePair,\n URLSearchParamsInit,\n} from \"./dom\";\nimport {\n createSearchParams,\n defaultMethod,\n getFormSubmissionInfo,\n getSearchParamsForLocation,\n shouldProcessLinkClick,\n} from \"./dom\";\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Re-exports\n////////////////////////////////////////////////////////////////////////////////\n\nexport type {\n FormEncType,\n FormMethod,\n GetScrollRestorationKeyFunction,\n ParamKeyValuePair,\n SubmitOptions,\n URLSearchParamsInit,\n V7_FormMethod,\n};\nexport { createSearchParams };\n\n// Note: Keep in sync with react-router exports!\nexport type {\n ActionFunction,\n ActionFunctionArgs,\n AwaitProps,\n unstable_Blocker,\n unstable_BlockerFunction,\n DataRouteMatch,\n DataRouteObject,\n Fetcher,\n Hash,\n IndexRouteObject,\n IndexRouteProps,\n JsonFunction,\n LazyRouteFunction,\n LayoutRouteProps,\n LoaderFunction,\n LoaderFunctionArgs,\n Location,\n MemoryRouterProps,\n NavigateFunction,\n NavigateOptions,\n NavigateProps,\n Navigation,\n Navigator,\n NonIndexRouteObject,\n OutletProps,\n Params,\n ParamParseKey,\n Path,\n PathMatch,\n Pathname,\n PathPattern,\n PathRouteProps,\n RedirectFunction,\n RelativeRoutingType,\n RouteMatch,\n RouteObject,\n RouteProps,\n RouterProps,\n RouterProviderProps,\n RoutesProps,\n Search,\n ShouldRevalidateFunction,\n To,\n} from \"react-router\";\nexport {\n AbortedDeferredError,\n Await,\n MemoryRouter,\n Navigate,\n NavigationType,\n Outlet,\n Route,\n Router,\n RouterProvider,\n Routes,\n createMemoryRouter,\n createPath,\n createRoutesFromChildren,\n createRoutesFromElements,\n defer,\n isRouteErrorResponse,\n generatePath,\n json,\n matchPath,\n matchRoutes,\n parsePath,\n redirect,\n renderMatches,\n resolvePath,\n useActionData,\n useAsyncError,\n useAsyncValue,\n unstable_useBlocker,\n useHref,\n useInRouterContext,\n useLoaderData,\n useLocation,\n useMatch,\n useMatches,\n useNavigate,\n useNavigation,\n useNavigationType,\n useOutlet,\n useOutletContext,\n useParams,\n useResolvedPath,\n useRevalidator,\n useRouteError,\n useRouteLoaderData,\n useRoutes,\n} from \"react-router\";\n\n///////////////////////////////////////////////////////////////////////////////\n// DANGER! PLEASE READ ME!\n// We provide these exports as an escape hatch in the event that you need any\n// routing data that we don't provide an explicit API for. With that said, we\n// want to cover your use case if we can, so if you feel the need to use these\n// we want to hear from you. Let us know what you're building and we'll do our\n// best to make sure we can support you!\n//\n// We consider these exports an implementation detail and do not guarantee\n// against any breaking changes, regardless of the semver release. Use with\n// extreme caution and only if you understand the consequences. Godspeed.\n///////////////////////////////////////////////////////////////////////////////\n\n/** @internal */\nexport {\n UNSAFE_DataRouterContext,\n UNSAFE_DataRouterStateContext,\n UNSAFE_NavigationContext,\n UNSAFE_LocationContext,\n UNSAFE_RouteContext,\n UNSAFE_useRouteId,\n} from \"react-router\";\n//#endregion\n\ndeclare global {\n var __staticRouterHydrationData: HydrationState | undefined;\n}\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Routers\n////////////////////////////////////////////////////////////////////////////////\n\ninterface DOMRouterOpts {\n basename?: string;\n future?: Partial<Omit<FutureConfig, \"v7_prependBasename\">>;\n hydrationData?: HydrationState;\n window?: Window;\n}\n\nexport function createBrowserRouter(\n routes: RouteObject[],\n opts?: DOMRouterOpts\n): RemixRouter {\n return createRouter({\n basename: opts?.basename,\n future: {\n ...opts?.future,\n v7_prependBasename: true,\n },\n history: createBrowserHistory({ window: opts?.window }),\n hydrationData: opts?.hydrationData || parseHydrationData(),\n routes,\n mapRouteProperties,\n }).initialize();\n}\n\nexport function createHashRouter(\n routes: RouteObject[],\n opts?: DOMRouterOpts\n): RemixRouter {\n return createRouter({\n basename: opts?.basename,\n future: {\n ...opts?.future,\n v7_prependBasename: true,\n },\n history: createHashHistory({ window: opts?.window }),\n hydrationData: opts?.hydrationData || parseHydrationData(),\n routes,\n mapRouteProperties,\n }).initialize();\n}\n\nfunction parseHydrationData(): HydrationState | undefined {\n let state = window?.__staticRouterHydrationData;\n if (state && state.errors) {\n state = {\n ...state,\n errors: deserializeErrors(state.errors),\n };\n }\n return state;\n}\n\nfunction deserializeErrors(\n errors: RemixRouter[\"state\"][\"errors\"]\n): RemixRouter[\"state\"][\"errors\"] {\n if (!errors) return null;\n let entries = Object.entries(errors);\n let serialized: RemixRouter[\"state\"][\"errors\"] = {};\n for (let [key, val] of entries) {\n // Hey you! If you change this, please change the corresponding logic in\n // serializeErrors in react-router-dom/server.tsx :)\n if (val && val.__type === \"RouteErrorResponse\") {\n serialized[key] = new ErrorResponse(\n val.status,\n val.statusText,\n val.data,\n val.internal === true\n );\n } else if (val && val.__type === \"Error\") {\n let error = new Error(val.message);\n // Wipe away the client-side stack trace. Nothing to fill it in with\n // because we don't serialize SSR stack traces for security reasons\n error.stack = \"\";\n serialized[key] = error;\n } else {\n serialized[key] = val;\n }\n }\n return serialized;\n}\n\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Components\n////////////////////////////////////////////////////////////////////////////////\n\nexport interface BrowserRouterProps {\n basename?: string;\n children?: React.ReactNode;\n window?: Window;\n}\n\n/**\n * A `<Router>` for use in web browsers. Provides the cleanest URLs.\n */\nexport function BrowserRouter({\n basename,\n children,\n window,\n}: BrowserRouterProps) {\n let historyRef = React.useRef<BrowserHistory>();\n if (historyRef.current == null) {\n historyRef.current = createBrowserHistory({ window, v5Compat: true });\n }\n\n let history = historyRef.current;\n let [state, setState] = React.useState({\n action: history.action,\n location: history.location,\n });\n\n React.useLayoutEffect(() => history.listen(setState), [history]);\n\n return (\n <Router\n basename={basename}\n children={children}\n location={state.location}\n navigationType={state.action}\n navigator={history}\n />\n );\n}\n\nexport interface HashRouterProps {\n basename?: string;\n children?: React.ReactNode;\n window?: Window;\n}\n\n/**\n * A `<Router>` for use in web browsers. Stores the location in the hash\n * portion of the URL so it is not sent to the server.\n */\nexport function HashRouter({ basename, children, window }: HashRouterProps) {\n let historyRef = React.useRef<HashHistory>();\n if (historyRef.current == null) {\n historyRef.current = createHashHistory({ window, v5Compat: true });\n }\n\n let history = historyRef.current;\n let [state, setState] = React.useState({\n action: history.action,\n location: history.location,\n });\n\n React.useLayoutEffect(() => history.listen(setState), [history]);\n\n return (\n <Router\n basename={basename}\n children={children}\n location={state.location}\n navigationType={state.action}\n navigator={history}\n />\n );\n}\n\nexport interface HistoryRouterProps {\n basename?: string;\n children?: React.ReactNode;\n history: History;\n}\n\n/**\n * A `<Router>` that accepts a pre-instantiated history object. It's important\n * to note that using your own history object is highly discouraged and may add\n * two versions of the history library to your bundles unless you use the same\n * version of the history library that React Router uses internally.\n */\nfunction HistoryRouter({ basename, children, history }: HistoryRouterProps) {\n const [state, setState] = React.useState({\n action: history.action,\n location: history.location,\n });\n\n React.useLayoutEffect(() => history.listen(setState), [history]);\n\n return (\n <Router\n basename={basename}\n children={children}\n location={state.location}\n navigationType={state.action}\n navigator={history}\n />\n );\n}\n\nif (__DEV__) {\n HistoryRouter.displayName = \"unstable_HistoryRouter\";\n}\n\nexport { HistoryRouter as unstable_HistoryRouter };\n\nexport interface LinkProps\n extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"href\"> {\n reloadDocument?: boolean;\n replace?: boolean;\n state?: any;\n preventScrollReset?: boolean;\n relative?: RelativeRoutingType;\n to: To;\n}\n\nconst isBrowser =\n typeof window !== \"undefined\" &&\n typeof window.document !== \"undefined\" &&\n typeof window.document.createElement !== \"undefined\";\n\nconst ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i;\n\n/**\n * The public API for rendering a history-aware <a>.\n */\nexport const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(\n function LinkWithRef(\n {\n onClick,\n relative,\n reloadDocument,\n replace,\n state,\n target,\n to,\n preventScrollReset,\n ...rest\n },\n ref\n ) {\n let { basename } = React.useContext(NavigationContext);\n\n // Rendered into <a href> for absolute URLs\n let absoluteHref;\n let isExternal = false;\n\n if (typeof to === \"string\" && ABSOLUTE_URL_REGEX.test(to)) {\n // Render the absolute href server- and client-side\n absoluteHref = to;\n\n // Only check for external origins client-side\n if (isBrowser) {\n try {\n let currentUrl = new URL(window.location.href);\n let targetUrl = to.startsWith(\"//\")\n ? new URL(currentUrl.protocol + to)\n : new URL(to);\n let path = stripBasename(targetUrl.pathname, basename);\n\n if (targetUrl.origin === currentUrl.origin && path != null) {\n // Strip the protocol/origin/basename for same-origin absolute URLs\n to = path + targetUrl.search + targetUrl.hash;\n } else {\n isExternal = true;\n }\n } catch (e) {\n // We can't do external URL detection without a valid URL\n warning(\n false,\n `<Link to=\"${to}\"> contains an invalid URL which will probably break ` +\n `when clicked - please update to a valid URL path.`\n );\n }\n }\n }\n\n // Rendered into <a href> for relative URLs\n let href = useHref(to, { relative });\n\n let internalOnClick = useLinkClickHandler(to, {\n replace,\n state,\n target,\n preventScrollReset,\n relative,\n });\n function handleClick(\n event: React.MouseEvent<HTMLAnchorElement, MouseEvent>\n ) {\n if (onClick) onClick(event);\n if (!event.defaultPrevented) {\n internalOnClick(event);\n }\n }\n\n return (\n // eslint-disable-next-line jsx-a11y/anchor-has-content\n <a\n {...rest}\n href={absoluteHref || href}\n onClick={isExternal || reloadDocument ? onClick : handleClick}\n ref={ref}\n target={target}\n />\n );\n }\n);\n\nif (__DEV__) {\n Link.displayName = \"Link\";\n}\n\nexport interface NavLinkProps\n extends Omit<LinkProps, \"className\" | \"style\" | \"children\"> {\n children?:\n | React.ReactNode\n | ((props: { isActive: boolean; isPending: boolean }) => React.ReactNode);\n caseSensitive?: boolean;\n className?:\n | string\n | ((props: {\n isActive: boolean;\n isPending: boolean;\n }) => string | undefined);\n end?: boolean;\n style?:\n | React.CSSProperties\n | ((props: {\n isActive: boolean;\n isPending: boolean;\n }) => React.CSSProperties | undefined);\n}\n\n/**\n * A <Link> wrapper that knows if it's \"active\" or not.\n */\nexport const NavLink = React.forwardRef<HTMLAnchorElement, NavLinkProps>(\n function NavLinkWithRef(\n {\n \"aria-current\": ariaCurrentProp = \"page\",\n caseSensitive = false,\n className: classNameProp = \"\",\n end = false,\n style: styleProp,\n to,\n children,\n ...rest\n },\n ref\n ) {\n let path = useResolvedPath(to, { relative: rest.relative });\n let location = useLocation();\n let routerState = React.useContext(DataRouterStateContext);\n let { navigator } = React.useContext(NavigationContext);\n\n let toPathname = navigator.encodeLocation\n ? navigator.encodeLocation(path).pathname\n : path.pathname;\n let locationPathname = location.pathname;\n let nextLocationPathname =\n routerState && routerState.navigation && routerState.navigation.location\n ? routerState.navigation.location.pathname\n : null;\n\n if (!caseSensitive) {\n locationPathname = locationPathname.toLowerCase();\n nextLocationPathname = nextLocationPathname\n ? nextLocationPathname.toLowerCase()\n : null;\n toPathname = toPathname.toLowerCase();\n }\n\n let isActive =\n locationPathname === toPathname ||\n (!end &&\n locationPathname.startsWith(toPathname) &&\n locationPathname.charAt(toPathname.length) === \"/\");\n\n let isPending =\n nextLocationPathname != null &&\n (nextLocationPathname === toPathname ||\n (!end &&\n nextLocationPathname.startsWith(toPathname) &&\n nextLocationPathname.charAt(toPathname.length) === \"/\"));\n\n let ariaCurrent = isActive ? ariaCurrentProp : undefined;\n\n let className: string | undefined;\n if (typeof classNameProp === \"function\") {\n className = classNameProp({ isActive, isPending });\n } else {\n // If the className prop is not a function, we use a default `active`\n // class for <NavLink />s that are active. In v5 `active` was the default\n // value for `activeClassName`, but we are removing that API and can still\n // use the old default behavior for a cleaner upgrade path and keep the\n // simple styling rules working as they currently do.\n className = [\n classNameProp,\n isActive ? \"active\" : null,\n isPending ? \"pending\" : null,\n ]\n .filter(Boolean)\n .join(\" \");\n }\n\n let style =\n typeof styleProp === \"function\"\n ? styleProp({ isActive, isPending })\n : styleProp;\n\n return (\n <Link\n {...rest}\n aria-current={ariaCurrent}\n className={className}\n ref={ref}\n style={style}\n to={to}\n >\n {typeof children === \"function\"\n ? children({ isActive, isPending })\n : children}\n </Link>\n );\n }\n);\n\nif (__DEV__) {\n NavLink.displayName = \"NavLink\";\n}\n\nexport interface FormProps extends React.FormHTMLAttributes<HTMLFormElement> {\n /**\n * The HTTP verb to use when the form is submit. Supports \"get\", \"post\",\n * \"put\", \"delete\", \"patch\".\n */\n method?: HTMLFormMethod;\n\n /**\n * Normal `<form action>` but supports React Router's relative paths.\n */\n action?: string;\n\n /**\n * Forces a full document navigation instead of a fetch.\n */\n reloadDocument?: boolean;\n\n /**\n * Replaces the current entry in the browser history stack when the form\n * navigates. Use this if you don't want the user to be able to click \"back\"\n * to the page with the form on it.\n */\n replace?: boolean;\n\n /**\n * Determines whether the form action is relative to the route hierarchy or\n * the pathname. Use this if you want to opt out of navigating the route\n * hierarchy and want to instead route based on /-delimited URL segments\n */\n relative?: RelativeRoutingType;\n\n /**\n * Prevent the scroll position from resetting to the top of the viewport on\n * completion of the navigation when using the <ScrollRestoration> component\n */\n preventScrollReset?: boolean;\n\n /**\n * A function to call when the form is submitted. If you call\n * `event.preventDefault()` then this form will not do anything.\n */\n onSubmit?: React.FormEventHandler<HTMLFormElement>;\n}\n\n/**\n * A `@remix-run/router`-aware `<form>`. It behaves like a normal form except\n * that the interaction with the server is with `fetch` instead of new document\n * requests, allowing components to add nicer UX to the page as the form is\n * submitted and returns with data.\n */\nexport const Form = React.forwardRef<HTMLFormElement, FormProps>(\n (props, ref) => {\n return <FormImpl {...props} ref={ref} />;\n }\n);\n\nif (__DEV__) {\n Form.displayName = \"Form\";\n}\n\ntype HTMLSubmitEvent = React.BaseSyntheticEvent<\n SubmitEvent,\n Event,\n HTMLFormElement\n>;\n\ntype HTMLFormSubmitter = HTMLButtonElement | HTMLInputElement;\n\ninterface FormImplProps extends FormProps {\n fetcherKey?: string;\n routeId?: string;\n}\n\nconst FormImpl = React.forwardRef<HTMLFormElement, FormImplProps>(\n (\n {\n reloadDocument,\n replace,\n method = defaultMethod,\n action,\n onSubmit,\n fetcherKey,\n routeId,\n relative,\n preventScrollReset,\n ...props\n },\n forwardedRef\n ) => {\n let submit = useSubmitImpl(fetcherKey, routeId);\n let formMethod: HTMLFormMethod =\n method.toLowerCase() === \"get\" ? \"get\" : \"post\";\n let formAction = useFormAction(action, { relative });\n let submitHandler: React.FormEventHandler<HTMLFormElement> = (event) => {\n onSubmit && onSubmit(event);\n if (event.defaultPrevented) return;\n event.preventDefault();\n\n let submitter = (event as unknown as HTMLSubmitEvent).nativeEvent\n .submitter as HTMLFormSubmitter | null;\n\n let submitMethod =\n (submitter?.getAttribute(\"formmethod\") as HTMLFormMethod | undefined) ||\n method;\n\n submit(submitter || event.currentTarget, {\n method: submitMethod,\n replace,\n relative,\n preventScrollReset,\n });\n };\n\n return (\n <form\n ref={forwardedRef}\n method={formMethod}\n action={formAction}\n onSubmit={reloadDocument ? onSubmit : submitHandler}\n {...props}\n />\n );\n }\n);\n\nif (__DEV__) {\n FormImpl.displayName = \"FormImpl\";\n}\n\nexport interface ScrollRestorationProps {\n getKey?: GetScrollRestorationKeyFunction;\n storageKey?: string;\n}\n\n/**\n * This component will emulate the browser's scroll restoration on location\n * changes.\n */\nexport function ScrollRestoration({\n getKey,\n storageKey,\n}: ScrollRestorationProps) {\n useScrollRestoration({ getKey, storageKey });\n return null;\n}\n\nif (__DEV__) {\n ScrollRestoration.displayName = \"ScrollRestoration\";\n}\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Hooks\n////////////////////////////////////////////////////////////////////////////////\n\nenum DataRouterHook {\n UseScrollRestoration = \"useScrollRestoration\",\n UseSubmitImpl = \"useSubmitImpl\",\n UseFetcher = \"useFetcher\",\n}\n\nenum DataRouterStateHook {\n UseFetchers = \"useFetchers\",\n UseScrollRestoration = \"useScrollRestoration\",\n}\n\nfunction getDataRouterConsoleError(\n hookName: DataRouterHook | DataRouterStateHook\n) {\n return `${hookName} must be used within a data router. See https://reactrouter.com/routers/picking-a-router.`;\n}\n\nfunction useDataRouterContext(hookName: DataRouterHook) {\n let ctx = React.useContext(DataRouterContext);\n invariant(ctx, getDataRouterConsoleError(hookName));\n return ctx;\n}\n\nfunction useDataRouterState(hookName: DataRouterStateHook) {\n let state = React.useContext(DataRouterStateContext);\n invariant(state, getDataRouterConsoleError(hookName));\n return state;\n}\n\n/**\n * Handles the click behavior for router `<Link>` components. This is useful if\n * you need to create custom `<Link>` components with the same click behavior we\n * use in our exported `<Link>`.\n */\nexport function useLinkClickHandler<E extends Element = HTMLAnchorElement>(\n to: To,\n {\n target,\n replace: replaceProp,\n state,\n preventScrollReset,\n relative,\n }: {\n target?: React.HTMLAttributeAnchorTarget;\n replace?: boolean;\n state?: any;\n preventScrollReset?: boolean;\n relative?: RelativeRoutingType;\n } = {}\n): (event: React.MouseEvent<E, MouseEvent>) => void {\n let navigate = useNavigate();\n let location = useLocation();\n let path = useResolvedPath(to, { relative });\n\n return React.useCallback(\n (event: React.MouseEvent<E, MouseEvent>) => {\n if (shouldProcessLinkClick(event, target)) {\n event.preventDefault();\n\n // If the URL hasn't changed, a regular <a> will do a replace instead of\n // a push, so do the same here unless the replace prop is explicitly set\n let replace =\n replaceProp !== undefined\n ? replaceProp\n : createPath(location) === createPath(path);\n\n navigate(to, { replace, state, preventScrollReset, relative });\n }\n },\n [\n location,\n navigate,\n path,\n replaceProp,\n state,\n target,\n to,\n preventScrollReset,\n relative,\n ]\n );\n}\n\n/**\n * A convenient wrapper for reading and writing search parameters via the\n * URLSearchParams interface.\n */\nexport function useSearchParams(\n defaultInit?: URLSearchParamsInit\n): [URLSearchParams, SetURLSearchParams] {\n warning(\n typeof URLSearchParams !== \"undefined\",\n `You cannot use the \\`useSearchParams\\` hook in a browser that does not ` +\n `support the URLSearchParams API. If you need to support Internet ` +\n `Explorer 11, we recommend you load a polyfill such as ` +\n `https://github.com/ungap/url-search-params\\n\\n` +\n `If you're unsure how to load polyfills, we recommend you check out ` +\n `https://polyfill.io/v3/ which provides some recommendations about how ` +\n `to load polyfills only for users that need them, instead of for every ` +\n `user.`\n );\n\n let defaultSearchParamsRef = React.useRef(createSearchParams(defaultInit));\n let hasSetSearchParamsRef = React.useRef(false);\n\n let location = useLocation();\n let searchParams = React.useMemo(\n () =>\n // Only merge in the defaults if we haven't yet called setSearchParams.\n // Once we call that we want those to take precedence, otherwise you can't\n // remove a param with setSearchParams({}) if it has an initial value\n getSearchParamsForLocation(\n location.search,\n hasSetSearchParamsRef.current ? null : defaultSearchParamsRef.current\n ),\n [location.search]\n );\n\n let navigate = useNavigate();\n let setSearchParams = React.useCallback<SetURLSearchParams>(\n (nextInit, navigateOptions) => {\n const newSearchParams = createSearchParams(\n typeof nextInit === \"function\" ? nextInit(searchParams) : nextInit\n );\n hasSetSearchParamsRef.current = true;\n navigate(\"?\" + newSearchParams, navigateOptions);\n },\n [navigate, searchParams]\n );\n\n return [searchParams, setSearchParams];\n}\n\nexport type SetURLSearchParams = (\n nextInit?:\n | URLSearchParamsInit\n | ((prev: URLSearchParams) => URLSearchParamsInit),\n navigateOpts?: NavigateOptions\n) => void;\n\ntype SubmitTarget =\n | HTMLFormElement\n | HTMLButtonElement\n | HTMLInputElement\n | FormData\n | URLSearchParams\n | { [name: string]: string }\n | null;\n\n/**\n * Submits a HTML `<form>` to the server without reloading the page.\n */\nexport interface SubmitFunction {\n (\n /**\n * Specifies the `<form>` to be submitted to the server, a specific\n * `<button>` or `<input type=\"submit\">` to use to submit the form, or some\n * arbitrary data to submit.\n *\n * Note: When using a `<button>` its `name` and `value` will also be\n * included in the form data that is submitted.\n */\n target: SubmitTarget,\n\n /**\n * Options that override the `<form>`'s own attributes. Required when\n * submitting arbitrary data without a backing `<form>`.\n */\n options?: SubmitOptions\n ): void;\n}\n\n/**\n * Returns a function that may be used to programmatically submit a form (or\n * some arbitrary data) to the server.\n */\nexport function useSubmit(): SubmitFunction {\n return useSubmitImpl();\n}\n\nfunction useSubmitImpl(\n fetcherKey?: string,\n fetcherRouteId?: string\n): SubmitFunction {\n let { router } = useDataRouterContext(DataRouterHook.UseSubmitImpl);\n let { basename } = React.useContext(NavigationContext);\n let currentRouteId = useRouteId();\n\n return React.useCallback(\n (target, options = {}) => {\n if (typeof document === \"undefined\") {\n throw new Error(\n \"You are calling submit during the server render. \" +\n \"Try calling submit within a `useEffect` or callback instead.\"\n );\n }\n\n let { action, method, encType, formData } = getFormSubmissionInfo(\n target,\n options,\n basename\n );\n\n // Base options shared between fetch() and navigate()\n let opts = {\n preventScrollReset: options.preventScrollReset,\n formData,\n formMethod: method as HTMLFormMethod,\n formEncType: encType as FormEncType,\n };\n\n if (fetcherKey) {\n invariant(\n fetcherRouteId != null,\n \"No routeId available for useFetcher()\"\n );\n router.fetch(fetcherKey, fetcherRouteId, action, opts);\n } else {\n router.navigate(action, {\n ...opts,\n replace: options.replace,\n fromRouteId: currentRouteId,\n });\n }\n },\n [router, basename, fetcherKey, fetcherRouteId, currentRouteId]\n );\n}\n\n// v7: Eventually we should deprecate this entirely in favor of using the\n// router method directly?\nexport function useFormAction(\n action?: string,\n { relative }: { relative?: RelativeRoutingType } = {}\n): string {\n let { basename } = React.useContext(NavigationContext);\n let routeContext = React.useContext(RouteContext);\n invariant(routeContext, \"useFormAction must be used inside a RouteContext\");\n\n let [match] = routeContext.matches.slice(-1);\n // Shallow clone path so we can modify it below, otherwise we modify the\n // object referenced by useMemo inside useResolvedPath\n let path = { ...useResolvedPath(action ? action : \".\", { relative }) };\n\n // Previously we set the default action to \".\". The problem with this is that\n // `useResolvedPath(\".\")` excludes search params and the hash of the resolved\n // URL. This is the intended behavior of when \".\" is specifically provided as\n // the form action, but inconsistent w/ browsers when the action is omitted.\n // https://github.com/remix-run/remix/issues/927\n let location = useLocation();\n if (action == null) {\n // Safe to write to these directly here since if action was undefined, we\n // would have called useResolvedPath(\".\") which will never include a search\n // or hash\n path.search = location.search;\n path.hash = location.hash;\n\n // When grabbing search params from the URL, remove the automatically\n // inserted ?index param so we match the useResolvedPath search behavior\n // which would not include ?index\n if (match.route.index) {\n let params = new URLSearchParams(path.search);\n params.delete(\"index\");\n path.search = params.toString() ? `?${params.toString()}` : \"\";\n }\n }\n\n if ((!action || action === \".\") && match.route.index) {\n path.search = path.search\n ? path.search.replace(/^\\?/, \"?index&\")\n : \"?index\";\n }\n\n // If we're operating within a basename, prepend it to the pathname prior\n // to creating the form action. If this is a root navigation, then just use\n // the raw basename which allows the basename to have full control over the\n // presence of a trailing slash on root actions\n if (basename !== \"/\") {\n path.pathname =\n path.pathname === \"/\" ? basename : joinPaths([basename, path.pathname]);\n }\n\n return createPath(path);\n}\n\nfunction createFetcherForm(fetcherKey: string, routeId: string) {\n let FetcherForm = React.forwardRef<HTMLFormElement, FormProps>(\n (props, ref) => {\n return (\n <FormImpl\n {...props}\n ref={ref}\n fetcherKey={fetcherKey}\n routeId={routeId}\n />\n );\n }\n );\n if (__DEV__) {\n FetcherForm.displayName = \"fetcher.Form\";\n }\n return FetcherForm;\n}\n\nlet fetcherId = 0;\n\nexport type FetcherWithComponents<TData> = Fetcher<TData> & {\n Form: ReturnType<typeof createFetcherForm>;\n submit: (\n target: SubmitTarget,\n // Fetchers cannot replace/preventScrollReset because they are not\n // navigation events\n options?: Omit<SubmitOptions, \"replace\" | \"preventScrollReset\">\n ) => void;\n load: (href: string) => void;\n};\n\n/**\n * Interacts with route loaders and actions without causing a navigation. Great\n * for any interaction that stays on the same page.\n */\nexport function useFetcher<TData = any>(): FetcherWithComponents<TData> {\n let { router } = useDataRouterContext(DataRouterHook.UseFetcher);\n\n let route = React.useContext(RouteContext);\n invariant(route, `useFetcher must be used inside a RouteContext`);\n\n let routeId = route.matches[route.matches.length - 1]?.route.id;\n invariant(\n routeId != null,\n `useFetcher can only be used on routes that contain a unique \"id\"`\n );\n\n let [fetcherKey] = React.useState(() => String(++fetcherId));\n let [Form] = React.useState(() => {\n invariant(routeId, `No routeId available for fetcher.Form()`);\n return createFetcherForm(fetcherKey, routeId);\n });\n let [load] = React.useState(() => (href: string) => {\n invariant(router, \"No router available for fetcher.load()\");\n invariant(routeId, \"No routeId available for fetcher.load()\");\n router.fetch(fetcherKey, routeId, href);\n });\n let submit = useSubmitImpl(fetcherKey, routeId);\n\n let fetcher = router.getFetcher<TData>(fetcherKey);\n\n let fetcherWithComponents = React.useMemo(\n () => ({\n Form,\n submit,\n load,\n ...fetcher,\n }),\n [fetcher, Form, submit, load]\n );\n\n React.useEffect(() => {\n // Is this busted when the React team gets real weird and calls effects\n // twice on mount? We really just need to garbage collect here when this\n // fetcher is no longer around.\n return () => {\n if (!router) {\n console.warn(`No router available to clean up from useFetcher()`);\n return;\n }\n router.deleteFetcher(fetcherKey);\n };\n }, [router, fetcherKey]);\n\n return fetcherWithComponents;\n}\n\n/**\n * Provides all fetchers currently on the page. Useful for layouts and parent\n * routes that need to provide pending/optimistic UI regarding the fetch.\n */\nexport function useFetchers(): Fetcher[] {\n let state = useDataRouterState(DataRouterStateHook.UseFetchers);\n return [...state.fetchers.values()];\n}\n\nconst SCROLL_RESTORATION_STORAGE_KEY = \"react-router-scroll-positions\";\nlet savedScrollPositions: Record<string, number> = {};\n\n/**\n * When rendered inside a RouterProvider, will restore scroll positions on navigations\n */\nfunction useScrollRestoration({\n getKey,\n storageKey,\n}: {\n getKey?: GetScrollRestorationKeyFunction;\n storageKey?: string;\n} = {}) {\n let { router } = useDataRouterContext(DataRouterHook.UseScrollRestoration);\n let { restoreScrollPosition, preventScrollReset } = useDataRouterState(\n DataRouterStateHook.UseScrollRestoration\n );\n let location = useLocation();\n let matches = useMatches();\n let navigation = useNavigation();\n\n // Trigger manual scroll restoration while we're active\n React.useEffect(() => {\n window.history.scrollRestoration = \"manual\";\n return () => {\n window.history.scrollRestoration = \"auto\";\n };\n }, []);\n\n // Save positions on pagehide\n usePageHide(\n React.useCallback(() => {\n if (navigation.state === \"idle\") {\n let key = (getKey ? getKey(location, matches) : null) || location.key;\n savedScrollPositions[key] = window.scrollY;\n }\n sessionStorage.setItem(\n storageKey || SCROLL_RESTORATION_STORAGE_KEY,\n JSON.stringify(savedScrollPositions)\n );\n window.history.scrollRestoration = \"auto\";\n }, [storageKey, getKey, navigation.state, location, matches])\n );\n\n // Read in any saved scroll locations\n if (typeof document !== \"undefined\") {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useLayoutEffect(() => {\n try {\n let sessionPositions = sessionStorage.getItem(\n storageKey || SCROLL_RESTORATION_STORAGE_KEY\n );\n if (sessionPositions) {\n savedScrollPositions = JSON.parse(sessionPositions);\n }\n } catch (e) {\n // no-op, use default empty object\n }\n }, [storageKey]);\n\n // Enable scroll restoration in the router\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useLayoutEffect(() => {\n let disableScrollRestoration = router?.enableScrollRestoration(\n savedScrollPositions,\n () => window.scrollY,\n getKey\n );\n return () => disableScrollRestoration && disableScrollRestoration();\n }, [router, getKey]);\n\n // Restore scrolling when state.restoreScrollPosition changes\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useLayoutEffect(() => {\n // Explicit false means don't do anything (used for submissions)\n if (restoreScrollPosition === false) {\n return;\n }\n\n // been here before, scroll to it\n if (typeof restoreScrollPosition === \"number\") {\n window.scrollTo(0, restoreScrollPosition);\n return;\n }\n\n // try to scroll to the hash\n if (location.hash) {\n let el = document.getElementById(location.hash.slice(1));\n if (el) {\n el.scrollIntoView();\n return;\n }\n }\n\n // Don't reset if this navigation opted out\n if (preventScrollReset === true) {\n return;\n }\n\n // otherwise go to the top on new locations\n window.scrollTo(0, 0);\n }, [location, restoreScrollPosition, preventScrollReset]);\n }\n}\n\nexport { useScrollRestoration as UNSAFE_useScrollRestoration };\n\n/**\n * Setup a callback to be fired on the window's `beforeunload` event. This is\n * useful for saving some data to `window.localStorage` just before the page\n * refreshes.\n *\n * Note: The `callback` argument should be a function created with\n * `React.useCallback()`.\n */\nexport function useBeforeUnload(\n callback: (event: BeforeUnloadEvent) => any,\n options?: { capture?: boolean }\n): void {\n let { capture } = options || {};\n React.useEffect(() => {\n let opts = capture != null ? { capture } : undefined;\n window.addEventListener(\"beforeunload\", callback, opts);\n return () => {\n window.removeEventListener(\"beforeunload\", callback, opts);\n };\n }, [callback, capture]);\n}\n\n/**\n * Setup a callback to be fired on the window's `pagehide` event. This is\n * useful for saving some data to `window.localStorage` just before the page\n * refreshes. This event is better supported than beforeunload across browsers.\n *\n * Note: The `callback` argument should be a function created with\n * `React.useCallback()`.\n */\nfunction usePageHide(\n callback: (event: PageTransitionEvent) => any,\n options?: { capture?: boolean }\n): void {\n let { capture } = options || {};\n React.useEffect(() => {\n let opts = capture != null ? { capture } : undefined;\n window.addEventListener(\"pagehide\", callback, opts);\n return () => {\n window.removeEventListener(\"pagehide\", callback, opts);\n };\n }, [callback, capture]);\n}\n\n/**\n * Wrapper around useBlocker to show a window.confirm prompt to users instead\n * of building a custom UI with useBlocker.\n *\n * Warning: This has *a lot of rough edges* and behaves very differently (and\n * very incorrectly in some cases) across browsers if user click addition\n * back/forward navigations while the confirm is open. Use at your own risk.\n */\nfunction usePrompt({ when, message }: { when: boolean; message: string }) {\n let blocker = useBlocker(when);\n\n React.useEffect(() => {\n if (blocker.state === \"blocked\" && !when) {\n blocker.reset();\n }\n }, [blocker, when]);\n\n React.useEffect(() => {\n if (blocker.state === \"blocked\") {\n let proceed = window.confirm(message);\n if (proceed) {\n setTimeout(blocker.proceed, 0);\n } else {\n blocker.reset();\n }\n }\n }, [blocker, message]);\n}\n\nexport { usePrompt as unstable_usePrompt };\n\n//#endregion\n", "/**\n * @remix-run/react v1.16.1\n *\n * Copyright (c) Remix Software Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nimport * as React from 'react';\nimport { createBrowserRouter, RouterProvider } from 'react-router-dom';\nimport { RemixContext } from './components.js';\nimport { RemixErrorBoundary, RemixRootDefaultErrorBoundary } from './errorBoundaries.js';\nimport { deserializeErrors } from './errors.js';\nimport { createClientRoutesWithHMRRevalidationOptOut, createClientRoutes } from './routes.js';\n\n/* eslint-disable prefer-let/prefer-let */\n\n/* eslint-enable prefer-let/prefer-let */\n\nlet router;\nlet hmrAbortController;\nif (import.meta && import.meta.hot) {\n import.meta.hot.accept(\"remix:manifest\", async ({\n assetsManifest,\n needsRevalidation\n }) => {\n let routeIds = [...new Set(router.state.matches.map(m => m.route.id).concat(Object.keys(window.__remixRouteModules)))];\n if (hmrAbortController) {\n hmrAbortController.abort();\n }\n hmrAbortController = new AbortController();\n let signal = hmrAbortController.signal;\n\n // Load new route modules that we've seen.\n let newRouteModules = Object.assign({}, window.__remixRouteModules, Object.fromEntries((await Promise.all(routeIds.map(async id => {\n var _assetsManifest$hmr, _window$__remixRouteM, _window$__remixRouteM2, _window$__remixRouteM3;\n if (!assetsManifest.routes[id]) {\n return null;\n }\n let imported = await import(assetsManifest.routes[id].module + `?t=${(_assetsManifest$hmr = assetsManifest.hmr) === null || _assetsManifest$hmr === void 0 ? void 0 : _assetsManifest$hmr.timestamp}`);\n return [id, {\n ...imported,\n // react-refresh takes care of updating these in-place,\n // if we don't preserve existing values we'll loose state.\n default: imported.default ? ((_window$__remixRouteM = window.__remixRouteModules[id]) === null || _window$__remixRouteM === void 0 ? void 0 : _window$__remixRouteM.default) ?? imported.default : imported.default,\n CatchBoundary: imported.CatchBoundary ? ((_window$__remixRouteM2 = window.__remixRouteModules[id]) === null || _window$__remixRouteM2 === void 0 ? void 0 : _window$__remixRouteM2.CatchBoundary) ?? imported.CatchBoundary : imported.CatchBoundary,\n ErrorBoundary: imported.ErrorBoundary ? ((_window$__remixRouteM3 = window.__remixRouteModules[id]) === null || _window$__remixRouteM3 === void 0 ? void 0 : _window$__remixRouteM3.ErrorBoundary) ?? imported.ErrorBoundary : imported.ErrorBoundary\n }];\n }))).filter(Boolean)));\n Object.assign(window.__remixRouteModules, newRouteModules);\n // Create new routes\n let routes = createClientRoutesWithHMRRevalidationOptOut(needsRevalidation, assetsManifest.routes, window.__remixRouteModules, window.__remixContext.future);\n\n // This is temporary API and will be more granular before release\n router._internalSetRoutes(routes);\n\n // Wait for router to be idle before updating the manifest and route modules\n // and triggering a react-refresh\n let unsub = router.subscribe(state => {\n if (state.revalidation === \"idle\") {\n unsub();\n // Abort if a new update comes in while we're waiting for the\n // router to be idle.\n if (signal.aborted) return;\n // Ensure RouterProvider setState has flushed before re-rendering\n setTimeout(() => {\n Object.assign(window.__remixManifest, assetsManifest);\n window.$RefreshRuntime$.performReactRefresh();\n }, 1);\n }\n });\n router.revalidate();\n });\n}\n\n/**\n * The entry point for a Remix app when it is rendered in the browser (in\n * `app/entry.client.js`). This component is used by React to hydrate the HTML\n * that was received from the server.\n */\nfunction RemixBrowser(_props) {\n if (!router) {\n let routes = createClientRoutes(window.__remixManifest.routes, window.__remixRouteModules, window.__remixContext.future);\n let hydrationData = window.__remixContext.state;\n if (hydrationData && hydrationData.errors) {\n hydrationData = {\n ...hydrationData,\n errors: deserializeErrors(hydrationData.errors)\n };\n }\n router = createBrowserRouter(routes, {\n hydrationData,\n future: {\n // Pass through the Remix future flag to avoid a v1 breaking change in\n // useNavigation() - users can control the casing via the flag in v1.\n // useFetcher still always uppercases in the back-compat layer in v1.\n // In v2 we can just always pass true here and remove the back-compat\n // layer\n v7_normalizeFormMethod: window.__remixContext.future.v2_normalizeFormMethod\n }\n });\n }\n let [location, setLocation] = React.useState(router.state.location);\n React.useLayoutEffect(() => {\n return router.subscribe(newState => {\n if (newState.location !== location) {\n setLocation(newState.location);\n }\n });\n }, [location]);\n\n // We need to include a wrapper RemixErrorBoundary here in case the root error\n // boundary also throws and we need to bubble up outside of the router entirely.\n // Then we need a stateful location here so the user can back-button navigate\n // out of there\n return /*#__PURE__*/React.createElement(RemixContext.Provider, {\n value: {\n manifest: window.__remixManifest,\n routeModules: window.__remixRouteModules,\n future: window.__remixContext.future\n }\n }, /*#__PURE__*/React.createElement(RemixErrorBoundary, {\n location: location,\n component: RemixRootDefaultErrorBoundary\n }, /*#__PURE__*/React.createElement(RouterProvider, {\n router: router,\n fallbackElement: null\n })));\n}\n\nexport { RemixBrowser };\n", "/**\n * @remix-run/react v1.16.1\n *\n * Copyright (c) Remix Software Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nimport { extends as _extends } from './_virtual/_rollupPluginBabelHelpers.js';\nimport * as React from 'react';\nimport { useHref, NavLink as NavLink$1, Link as Link$1, matchRoutes, useLocation, Await as Await$1, useNavigation, useAsyncError, useMatches as useMatches$1, useLoaderData as useLoaderData$1, useActionData as useActionData$1, useFetchers as useFetchers$1, useFetcher as useFetcher$1, UNSAFE_DataRouterContext, UNSAFE_DataRouterStateContext, Outlet, useRouteError, isRouteErrorResponse } from 'react-router-dom';\nimport { RemixRootDefaultErrorBoundary, RemixCatchBoundary, V2_RemixRootDefaultErrorBoundary, RemixRootDefaultCatchBoundary } from './errorBoundaries.js';\nimport invariant from './invariant.js';\nimport { getLinksForMatches, isPageLinkDescriptor, getNewMatchesForLinks, getDataLinkHrefs, getModuleLinkHrefs, getStylesheetPrefetchLinks } from './links.js';\nimport { escapeHtml, createHtml } from './markup.js';\nimport { IDLE_TRANSITION, IDLE_FETCHER } from './transition.js';\nimport { logDeprecationOnce } from './warnings.js';\n\nfunction useDataRouterContext() {\n let context = React.useContext(UNSAFE_DataRouterContext);\n invariant(context, \"You must render this element inside a <DataRouterContext.Provider> element\");\n return context;\n}\nfunction useDataRouterStateContext() {\n let context = React.useContext(UNSAFE_DataRouterStateContext);\n invariant(context, \"You must render this element inside a <DataRouterStateContext.Provider> element\");\n return context;\n}\n\n////////////////////////////////////////////////////////////////////////////////\n// RemixContext\n\nconst RemixContext = /*#__PURE__*/React.createContext(undefined);\nRemixContext.displayName = \"Remix\";\nfunction useRemixContext() {\n let context = React.useContext(RemixContext);\n invariant(context, \"You must render this element inside a <Remix> element\");\n return context;\n}\n\n////////////////////////////////////////////////////////////////////////////////\n// RemixRoute\n\nfunction RemixRoute({\n id\n}) {\n let {\n routeModules,\n future\n } = useRemixContext();\n invariant(routeModules, \"Cannot initialize 'routeModules'. This normally occurs when you have server code in your client modules.\\n\" + \"Check this link for more details:\\nhttps://remix.run/pages/gotchas#server-code-in-client-bundles\");\n let {\n default: Component,\n ErrorBoundary,\n CatchBoundary\n } = routeModules[id];\n\n // Default Component to Outlet if we expose boundary UI components\n if (!Component && (ErrorBoundary || !future.v2_errorBoundary && CatchBoundary)) {\n Component = Outlet;\n }\n invariant(Component, `Route \"${id}\" has no component! Please go add a \\`default\\` export in the route module file.\\n` + \"If you were trying to navigate or submit to a resource route, use `<a>` instead of `<Link>` or `<Form reloadDocument>`.\");\n return /*#__PURE__*/React.createElement(Component, null);\n}\nfunction RemixRouteError({\n id\n}) {\n let {\n future,\n routeModules\n } = useRemixContext();\n\n // This checks prevent cryptic error messages such as: 'Cannot read properties of undefined (reading 'root')'\n invariant(routeModules, \"Cannot initialize 'routeModules'. This normally occurs when you have server code in your client modules.\\n\" + \"Check this link for more details:\\nhttps://remix.run/pages/gotchas#server-code-in-client-bundles\");\n let error = useRouteError();\n let {\n CatchBoundary,\n ErrorBoundary\n } = routeModules[id];\n if (future.v2_errorBoundary) {\n // Provide defaults for the root route if they are not present\n if (id === \"root\") {\n ErrorBoundary || (ErrorBoundary = V2_RemixRootDefaultErrorBoundary);\n }\n if (ErrorBoundary) {\n // TODO: Unsure if we can satisfy the typings here\n // @ts-expect-error\n return /*#__PURE__*/React.createElement(ErrorBoundary, null);\n }\n throw error;\n }\n\n // Provide defaults for the root route if they are not present\n if (id === \"root\") {\n CatchBoundary || (CatchBoundary = RemixRootDefaultCatchBoundary);\n ErrorBoundary || (ErrorBoundary = RemixRootDefaultErrorBoundary);\n }\n if (isRouteErrorResponse(error)) {\n let tError = error;\n if ((tError === null || tError === void 0 ? void 0 : tError.error) instanceof Error && tError.status !== 404 && ErrorBoundary) {\n // Internal framework-thrown ErrorResponses\n return /*#__PURE__*/React.createElement(ErrorBoundary, {\n error: tError.error\n });\n }\n if (CatchBoundary) {\n // User-thrown ErrorResponses\n return /*#__PURE__*/React.createElement(RemixCatchBoundary, {\n component: CatchBoundary,\n catch: error\n });\n }\n }\n if (error instanceof Error && ErrorBoundary) {\n // User- or framework-thrown Errors\n return /*#__PURE__*/React.createElement(ErrorBoundary, {\n error: error\n });\n }\n throw error;\n}\n////////////////////////////////////////////////////////////////////////////////\n// Public API\n\n/**\n * Defines the prefetching behavior of the link:\n *\n * - \"intent\": Fetched when the user focuses or hovers the link\n * - \"render\": Fetched when the link is rendered\n * - \"none\": Never fetched\n */\nfunction usePrefetchBehavior(prefetch, theirElementProps) {\n let [maybePrefetch, setMaybePrefetch] = React.useState(false);\n let [shouldPrefetch, setShouldPrefetch] = React.useState(false);\n let {\n onFocus,\n onBlur,\n onMouseEnter,\n onMouseLeave,\n onTouchStart\n } = theirElementProps;\n React.useEffect(() => {\n if (prefetch === \"render\") {\n setShouldPrefetch(true);\n }\n }, [prefetch]);\n let setIntent = () => {\n if (prefetch === \"intent\") {\n setMaybePrefetch(true);\n }\n };\n let cancelIntent = () => {\n if (prefetch === \"intent\") {\n setMaybePrefetch(false);\n setShouldPrefetch(false);\n }\n };\n React.useEffect(() => {\n if (maybePrefetch) {\n let id = setTimeout(() => {\n setShouldPrefetch(true);\n }, 100);\n return () => {\n clearTimeout(id);\n };\n }\n }, [maybePrefetch]);\n return [shouldPrefetch, {\n onFocus: composeEventHandlers(onFocus, setIntent),\n onBlur: composeEventHandlers(onBlur, cancelIntent),\n onMouseEnter: composeEventHandlers(onMouseEnter, setIntent),\n onMouseLeave: composeEventHandlers(onMouseLeave, cancelIntent),\n onTouchStart: composeEventHandlers(onTouchStart, setIntent)\n }];\n}\nconst ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i;\n\n/**\n * A special kind of `<Link>` that knows whether or not it is \"active\".\n *\n * @see https://remix.run/components/nav-link\n */\nlet NavLink = /*#__PURE__*/React.forwardRef(({\n to,\n prefetch = \"none\",\n ...props\n}, forwardedRef) => {\n let isAbsolute = typeof to === \"string\" && ABSOLUTE_URL_REGEX.test(to);\n let href = useHref(to);\n let [shouldPrefetch, prefetchHandlers] = usePrefetchBehavior(prefetch, props);\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(NavLink$1, _extends({\n ref: forwardedRef,\n to: to\n }, props, prefetchHandlers)), shouldPrefetch && !isAbsolute ? /*#__PURE__*/React.createElement(PrefetchPageLinks, {\n page: href\n }) : null);\n});\nNavLink.displayName = \"NavLink\";\n\n/**\n * This component renders an anchor tag and is the primary way the user will\n * navigate around your website.\n *\n * @see https://remix.run/components/link\n */\nlet Link = /*#__PURE__*/React.forwardRef(({\n to,\n prefetch = \"none\",\n ...props\n}, forwardedRef) => {\n let isAbsolute = typeof to === \"string\" && ABSOLUTE_URL_REGEX.test(to);\n let href = useHref(to);\n let [shouldPrefetch, prefetchHandlers] = usePrefetchBehavior(prefetch, props);\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Link$1, _extends({\n ref: forwardedRef,\n to: to\n }, props, prefetchHandlers)), shouldPrefetch && !isAbsolute ? /*#__PURE__*/React.createElement(PrefetchPageLinks, {\n page: href\n }) : null);\n});\nLink.displayName = \"Link\";\nfunction composeEventHandlers(theirHandler, ourHandler) {\n return event => {\n theirHandler && theirHandler(event);\n if (!event.defaultPrevented) {\n ourHandler(event);\n }\n };\n}\nlet linksWarning = \"\u26A0\uFE0F REMIX FUTURE CHANGE: The behavior of links `imagesizes` and `imagesrcset` will be changing in v2. \" + \"Only the React camel case versions will be valid. Please change to `imageSizes` and `imageSrcSet`.\" + \"For instructions on making this change see \" + \"https://remix.run/docs/en/v1.15.0/pages/v2#links-imagesizes-and-imagesrcset\";\nlet useTransitionWarning = \"\u26A0\uFE0F REMIX FUTURE CHANGE: `useTransition` will be removed in v2 in favor of `useNavigation`. \" + \"You can prepare for this change at your convenience by updating to `useNavigation`.\" + \"For instructions on making this change see \" + \"https://remix.run/docs/en/v1.15.0/pages/v2#usetransition\";\nlet fetcherTypeWarning = \"\u26A0\uFE0F REMIX FUTURE CHANGE: `fetcher.type` will be removed in v2. \" + \"Please use `fetcher.state`, `fetcher.formData`, and `fetcher.data` to achieve the same UX.\" + \"For instructions on making this change see \" + \"https://remix.run/docs/en/v1.15.0/pages/v2#usefetcher\";\nlet fetcherSubmissionWarning = \"\u26A0\uFE0F REMIX FUTURE CHANGE : `fetcher.submission` will be removed in v2. \" + \"The submission fields are now part of the fetcher object itself (`fetcher.formData`). \" + \"For instructions on making this change see \" + \"https://remix.run/docs/en/v1.15.0/pages/v2#usefetcher\";\n\n/**\n * Renders the `<link>` tags for the current routes.\n *\n * @see https://remix.run/components/links\n */\nfunction Links() {\n let {\n manifest,\n routeModules\n } = useRemixContext();\n let {\n errors,\n matches: routerMatches\n } = useDataRouterStateContext();\n let matches = errors ? routerMatches.slice(0, routerMatches.findIndex(m => errors[m.route.id]) + 1) : routerMatches;\n let links = React.useMemo(() => getLinksForMatches(matches, routeModules, manifest), [matches, routeModules, manifest]);\n React.useEffect(() => {\n if (links.some(link => \"imagesizes\" in link || \"imagesrcset\" in link)) {\n logDeprecationOnce(linksWarning);\n }\n }, [links]);\n return /*#__PURE__*/React.createElement(React.Fragment, null, links.map(link => {\n if (isPageLinkDescriptor(link)) {\n return /*#__PURE__*/React.createElement(PrefetchPageLinks, _extends({\n key: link.page\n }, link));\n }\n let imageSrcSet = null;\n\n // In React 17, <link imageSrcSet> and <link imageSizes> will warn\n // because the DOM attributes aren't recognized, so users need to pass\n // them in all lowercase to forward the attributes to the node without a\n // warning. Normalize so that either property can be used in Remix.\n if (\"useId\" in React) {\n if (link.imagesrcset) {\n link.imageSrcSet = imageSrcSet = link.imagesrcset;\n delete link.imagesrcset;\n }\n if (link.imagesizes) {\n link.imageSizes = link.imagesizes;\n delete link.imagesizes;\n }\n } else {\n if (link.imageSrcSet) {\n link.imagesrcset = imageSrcSet = link.imageSrcSet;\n delete link.imageSrcSet;\n }\n if (link.imageSizes) {\n link.imagesizes = link.imageSizes;\n delete link.imageSizes;\n }\n }\n return /*#__PURE__*/React.createElement(\"link\", _extends({\n key: link.rel + (link.href || \"\") + (imageSrcSet || \"\")\n }, link));\n }));\n}\n\n/**\n * This component renders all of the `<link rel=\"prefetch\">` and\n * `<link rel=\"modulepreload\"/>` tags for all the assets (data, modules, css) of\n * a given page.\n *\n * @param props\n * @param props.page\n * @see https://remix.run/components/prefetch-page-links\n */\nfunction PrefetchPageLinks({\n page,\n ...dataLinkProps\n}) {\n let {\n router\n } = useDataRouterContext();\n let matches = React.useMemo(() => matchRoutes(router.routes, page), [router.routes, page]);\n if (!matches) {\n console.warn(`Tried to prefetch ${page} but no routes matched.`);\n return null;\n }\n return /*#__PURE__*/React.createElement(PrefetchPageLinksImpl, _extends({\n page: page,\n matches: matches\n }, dataLinkProps));\n}\nfunction usePrefetchedStylesheets(matches) {\n let {\n manifest,\n routeModules\n } = useRemixContext();\n let [styleLinks, setStyleLinks] = React.useState([]);\n React.useEffect(() => {\n let interrupted = false;\n getStylesheetPrefetchLinks(matches, manifest, routeModules).then(links => {\n if (!interrupted) setStyleLinks(links);\n });\n return () => {\n interrupted = true;\n };\n }, [matches, manifest, routeModules]);\n return styleLinks;\n}\nfunction PrefetchPageLinksImpl({\n page,\n matches: nextMatches,\n ...linkProps\n}) {\n let location = useLocation();\n let {\n manifest\n } = useRemixContext();\n let {\n matches\n } = useDataRouterStateContext();\n let newMatchesForData = React.useMemo(() => getNewMatchesForLinks(page, nextMatches, matches, manifest, location, \"data\"), [page, nextMatches, matches, manifest, location]);\n let newMatchesForAssets = React.useMemo(() => getNewMatchesForLinks(page, nextMatches, matches, manifest, location, \"assets\"), [page, nextMatches, matches, manifest, location]);\n let dataHrefs = React.useMemo(() => getDataLinkHrefs(page, newMatchesForData, manifest), [newMatchesForData, page, manifest]);\n let moduleHrefs = React.useMemo(() => getModuleLinkHrefs(newMatchesForAssets, manifest), [newMatchesForAssets, manifest]);\n\n // needs to be a hook with async behavior because we need the modules, not\n // just the manifest like the other links in here.\n let styleLinks = usePrefetchedStylesheets(newMatchesForAssets);\n return /*#__PURE__*/React.createElement(React.Fragment, null, dataHrefs.map(href => /*#__PURE__*/React.createElement(\"link\", _extends({\n key: href,\n rel: \"prefetch\",\n as: \"fetch\",\n href: href\n }, linkProps))), moduleHrefs.map(href => /*#__PURE__*/React.createElement(\"link\", _extends({\n key: href,\n rel: \"modulepreload\",\n href: href\n }, linkProps))), styleLinks.map(link =>\n /*#__PURE__*/\n // these don't spread `linkProps` because they are full link descriptors\n // already with their own props\n React.createElement(\"link\", _extends({\n key: link.href\n }, link))));\n}\n\n/**\n * Renders the `<title>` and `<meta>` tags for the current routes.\n *\n * @see https://remix.run/components/meta\n */\nfunction V1Meta() {\n let {\n routeModules\n } = useRemixContext();\n let {\n errors,\n matches: routerMatches,\n loaderData\n } = useDataRouterStateContext();\n let location = useLocation();\n let matches = errors ? routerMatches.slice(0, routerMatches.findIndex(m => errors[m.route.id]) + 1) : routerMatches;\n let meta = {};\n let parentsData = {};\n for (let match of matches) {\n let routeId = match.route.id;\n let data = loaderData[routeId];\n let params = match.params;\n let routeModule = routeModules[routeId];\n if (routeModule.meta) {\n let routeMeta = typeof routeModule.meta === \"function\" ? routeModule.meta({\n data,\n parentsData,\n params,\n location\n }) : routeModule.meta;\n if (routeMeta && Array.isArray(routeMeta)) {\n throw new Error(\"The route at \" + match.route.path + \" returns an array. This is only supported with the `v2_meta` future flag \" + \"in the Remix config. Either set the flag to `true` or update the route's \" + \"meta function to return an object.\" + \"\\n\\nTo reference the v1 meta function API, see https://remix.run/route/meta\"\n // TODO: Add link to the docs once they are written\n // + \"\\n\\nTo reference future flags and the v2 meta API, see https://remix.run/file-conventions/remix-config#future-v2-meta.\"\n );\n }\n\n Object.assign(meta, routeMeta);\n }\n parentsData[routeId] = data;\n }\n return /*#__PURE__*/React.createElement(React.Fragment, null, Object.entries(meta).map(([name, value]) => {\n if (!value) {\n return null;\n }\n if ([\"charset\", \"charSet\"].includes(name)) {\n return /*#__PURE__*/React.createElement(\"meta\", {\n key: \"charSet\",\n charSet: value\n });\n }\n if (name === \"title\") {\n return /*#__PURE__*/React.createElement(\"title\", {\n key: \"title\"\n }, String(value));\n }\n\n // Open Graph tags use the `property` attribute, while other meta tags\n // use `name`. See https://ogp.me/\n //\n // Namespaced attributes:\n // - https://ogp.me/#type_music\n // - https://ogp.me/#type_video\n // - https://ogp.me/#type_article\n // - https://ogp.me/#type_book\n // - https://ogp.me/#type_profile\n //\n // Facebook specific tags begin with `fb:` and also use the `property`\n // attribute.\n //\n // Twitter specific tags begin with `twitter:` but they use `name`, so\n // they are excluded.\n let isOpenGraphTag = /^(og|music|video|article|book|profile|fb):.+$/.test(name);\n return [value].flat().map(content => {\n if (isOpenGraphTag) {\n return /*#__PURE__*/React.createElement(\"meta\", {\n property: name,\n content: content,\n key: name + content\n });\n }\n if (typeof content === \"string\") {\n return /*#__PURE__*/React.createElement(\"meta\", {\n name: name,\n content: content,\n key: name + content\n });\n }\n return /*#__PURE__*/React.createElement(\"meta\", _extends({\n key: name + JSON.stringify(content)\n }, content));\n });\n }));\n}\nfunction V2Meta() {\n let {\n routeModules\n } = useRemixContext();\n let {\n errors,\n matches: routerMatches,\n loaderData\n } = useDataRouterStateContext();\n let location = useLocation();\n let _matches = errors ? routerMatches.slice(0, routerMatches.findIndex(m => errors[m.route.id]) + 1) : routerMatches;\n let meta = [];\n let leafMeta = null;\n let matches = [];\n for (let i = 0; i < _matches.length; i++) {\n let _match = _matches[i];\n let routeId = _match.route.id;\n let data = loaderData[routeId];\n let params = _match.params;\n let routeModule = routeModules[routeId];\n let routeMeta = [];\n let match = {\n id: routeId,\n data,\n meta: [],\n params: _match.params,\n pathname: _match.pathname,\n handle: _match.route.handle,\n // TODO: Remove in v2. Only leaving it for now because we used it in\n // examples and there's no reason to crash someone's build for one line.\n // They'll get a TS error from the type updates anyway.\n // @ts-expect-error\n get route() {\n console.warn(\"The meta function in \" + _match.route.path + \" accesses the `route` property on `matches`. This is deprecated and will be removed in Remix version 2. See\");\n return _match.route;\n }\n };\n matches[i] = match;\n if (routeModule !== null && routeModule !== void 0 && routeModule.meta) {\n routeMeta = typeof routeModule.meta === \"function\" ? routeModule.meta({\n data,\n params,\n location,\n matches\n }) : Array.isArray(routeModule.meta) ? [...routeModule.meta] : routeModule.meta;\n } else if (leafMeta) {\n // We only assign the route's meta to the nearest leaf if there is no meta\n // export in the route. The meta function may return a falsey value which\n // is effectively the same as an empty array.\n routeMeta = [...leafMeta];\n }\n routeMeta = routeMeta || [];\n if (!Array.isArray(routeMeta)) {\n throw new Error(\"The `v2_meta` API is enabled in the Remix config, but the route at \" + _match.route.path + \" returns an invalid value. In v2, all route meta functions must \" + \"return an array of meta objects.\" +\n // TODO: Add link to the docs once they are written\n // \"\\n\\nTo reference future flags and the v2 meta API, see https://remix.run/file-conventions/remix-config#future-v2-meta.\" +\n \"\\n\\nTo reference the v1 meta function API, see https://remix.run/route/meta\");\n }\n match.meta = routeMeta;\n matches[i] = match;\n meta = [...routeMeta];\n leafMeta = meta;\n }\n return /*#__PURE__*/React.createElement(React.Fragment, null, meta.flat().map(metaProps => {\n if (!metaProps) {\n return null;\n }\n if (\"tagName\" in metaProps) {\n let tagName = metaProps.tagName;\n delete metaProps.tagName;\n if (!isValidMetaTag(tagName)) {\n console.warn(`A meta object uses an invalid tagName: ${tagName}. Expected either 'link' or 'meta'`);\n return null;\n }\n let Comp = tagName;\n return /*#__PURE__*/React.createElement(Comp, _extends({\n key: JSON.stringify(metaProps)\n }, metaProps));\n }\n if (\"title\" in metaProps) {\n return /*#__PURE__*/React.createElement(\"title\", {\n key: \"title\"\n }, String(metaProps.title));\n }\n if (\"charset\" in metaProps) {\n metaProps.charSet ?? (metaProps.charSet = metaProps.charset);\n delete metaProps.charset;\n }\n if (\"charSet\" in metaProps && metaProps.charSet != null) {\n return typeof metaProps.charSet === \"string\" ? /*#__PURE__*/React.createElement(\"meta\", {\n key: \"charSet\",\n charSet: metaProps.charSet\n }) : null;\n }\n if (\"script:ld+json\" in metaProps) {\n let json = null;\n try {\n json = JSON.stringify(metaProps[\"script:ld+json\"]);\n } catch (err) {}\n return json != null && /*#__PURE__*/React.createElement(\"script\", {\n key: \"script:ld+json\",\n type: \"application/ld+json\",\n dangerouslySetInnerHTML: {\n __html: JSON.stringify(metaProps[\"script:ld+json\"])\n }\n });\n }\n return /*#__PURE__*/React.createElement(\"meta\", _extends({\n key: JSON.stringify(metaProps)\n }, metaProps));\n }));\n}\nfunction isValidMetaTag(tagName) {\n return typeof tagName === \"string\" && /^(meta|link)$/.test(tagName);\n}\nfunction Meta() {\n let {\n future\n } = useRemixContext();\n return future !== null && future !== void 0 && future.v2_meta ? /*#__PURE__*/React.createElement(V2Meta, null) : /*#__PURE__*/React.createElement(V1Meta, null);\n}\nfunction Await(props) {\n return /*#__PURE__*/React.createElement(Await$1, props);\n}\n\n/**\n * Tracks whether Remix has finished hydrating or not, so scripts can be skipped\n * during client-side updates.\n */\nlet isHydrated = false;\n/**\n * Renders the `<script>` tags needed for the initial render. Bundles for\n * additional routes are loaded later as needed.\n *\n * @param props Additional properties to add to each script tag that is rendered.\n * In addition to scripts, \\<link rel=\"modulepreload\"> tags receive the crossOrigin\n * property if provided.\n *\n * @see https://remix.run/components/scripts\n */\nfunction Scripts(props) {\n let {\n manifest,\n serverHandoffString,\n abortDelay\n } = useRemixContext();\n let {\n router,\n static: isStatic,\n staticContext\n } = useDataRouterContext();\n let {\n matches\n } = useDataRouterStateContext();\n let navigation = useNavigation();\n React.useEffect(() => {\n isHydrated = true;\n }, []);\n let deferredScripts = [];\n let initialScripts = React.useMemo(() => {\n var _manifest$hmr;\n let contextScript = staticContext ? `window.__remixContext = ${serverHandoffString};` : \" \";\n let activeDeferreds = staticContext === null || staticContext === void 0 ? void 0 : staticContext.activeDeferreds;\n // This sets up the __remixContext with utility functions used by the\n // deferred scripts.\n // - __remixContext.p is a function that takes a resolved value or error and returns a promise.\n // This is used for transmitting pre-resolved promises from the server to the client.\n // - __remixContext.n is a function that takes a routeID and key to returns a promise for later\n // resolution by the subsequently streamed chunks.\n // - __remixContext.r is a function that takes a routeID, key and value or error and resolves\n // the promise created by __remixContext.n.\n // - __remixContext.t is a a map or routeId to keys to an object containing `e` and `r` methods\n // to resolve or reject the promise created by __remixContext.n.\n // - __remixContext.a is the active number of deferred scripts that should be rendered to match\n // the SSR tree for hydration on the client.\n contextScript += !activeDeferreds ? \"\" : [\"__remixContext.p = function(v,e,p,x) {\", \" if (typeof e !== 'undefined') {\", process.env.NODE_ENV === \"development\" ? \" x=new Error(e.message);\\n x.stack=e.stack;\" : ' x=new Error(\"Unexpected Server Error\");\\n x.stack=undefined;', \" p=Promise.reject(x);\", \" } else {\", \" p=Promise.resolve(v);\", \" }\", \" return p;\", \"};\", \"__remixContext.n = function(i,k) {\", \" __remixContext.t = __remixContext.t || {};\", \" __remixContext.t[i] = __remixContext.t[i] || {};\", \" let p = new Promise((r, e) => {__remixContext.t[i][k] = {r:(v)=>{r(v);},e:(v)=>{e(v);}};});\", typeof abortDelay === \"number\" ? `setTimeout(() => {if(typeof p._error !== \"undefined\" || typeof p._data !== \"undefined\"){return;} __remixContext.t[i][k].e(new Error(\"Server timeout.\"))}, ${abortDelay});` : \"\", \" return p;\", \"};\", \"__remixContext.r = function(i,k,v,e,p,x) {\", \" p = __remixContext.t[i][k];\", \" if (typeof e !== 'undefined') {\", process.env.NODE_ENV === \"development\" ? \" x=new Error(e.message);\\n x.stack=e.stack;\" : ' x=new Error(\"Unexpected Server Error\");\\n x.stack=undefined;', \" p.e(x);\", \" } else {\", \" p.r(v);\", \" }\", \"};\"].join(\"\\n\") + Object.entries(activeDeferreds).map(([routeId, deferredData]) => {\n let pendingKeys = new Set(deferredData.pendingKeys);\n let promiseKeyValues = deferredData.deferredKeys.map(key => {\n if (pendingKeys.has(key)) {\n deferredScripts.push( /*#__PURE__*/React.createElement(DeferredHydrationScript, {\n key: `${routeId} | ${key}`,\n deferredData: deferredData,\n routeId: routeId,\n dataKey: key\n }));\n return `${JSON.stringify(key)}:__remixContext.n(${JSON.stringify(routeId)}, ${JSON.stringify(key)})`;\n } else {\n let trackedPromise = deferredData.data[key];\n if (typeof trackedPromise._error !== \"undefined\") {\n let toSerialize = process.env.NODE_ENV === \"development\" ? {\n message: trackedPromise._error.message,\n stack: trackedPromise._error.stack\n } : {\n message: \"Unexpected Server Error\",\n stack: undefined\n };\n return `${JSON.stringify(key)}:__remixContext.p(!1, ${escapeHtml(JSON.stringify(toSerialize))})`;\n } else {\n if (typeof trackedPromise._data === \"undefined\") {\n throw new Error(`The deferred data for ${key} was not resolved, did you forget to return data from a deferred promise?`);\n }\n return `${JSON.stringify(key)}:__remixContext.p(${escapeHtml(JSON.stringify(trackedPromise._data))})`;\n }\n }\n }).join(\",\\n\");\n return `Object.assign(__remixContext.state.loaderData[${JSON.stringify(routeId)}], {${promiseKeyValues}});`;\n }).join(\"\\n\") + (deferredScripts.length > 0 ? `__remixContext.a=${deferredScripts.length};` : \"\");\n let routeModulesScript = !isStatic ? \" \" : `${(_manifest$hmr = manifest.hmr) !== null && _manifest$hmr !== void 0 && _manifest$hmr.runtime ? `import ${JSON.stringify(manifest.hmr.runtime)};` : \"\"}import ${JSON.stringify(manifest.url)};\n${matches.map((match, index) => `import * as route${index} from ${JSON.stringify(manifest.routes[match.route.id].module)};`).join(\"\\n\")}\nwindow.__remixRouteModules = {${matches.map((match, index) => `${JSON.stringify(match.route.id)}:route${index}`).join(\",\")}};\n\nimport(${JSON.stringify(manifest.entry.module)});`;\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"script\", _extends({}, props, {\n suppressHydrationWarning: true,\n dangerouslySetInnerHTML: createHtml(contextScript),\n type: undefined\n })), /*#__PURE__*/React.createElement(\"script\", _extends({}, props, {\n suppressHydrationWarning: true,\n dangerouslySetInnerHTML: createHtml(routeModulesScript),\n type: \"module\",\n async: true\n })));\n // disabled deps array because we are purposefully only rendering this once\n // for hydration, after that we want to just continue rendering the initial\n // scripts as they were when the page first loaded\n // eslint-disable-next-line\n }, []);\n if (!isStatic && typeof __remixContext === \"object\" && __remixContext.a) {\n for (let i = 0; i < __remixContext.a; i++) {\n deferredScripts.push( /*#__PURE__*/React.createElement(DeferredHydrationScript, {\n key: i\n }));\n }\n }\n\n // avoid waterfall when importing the next route module\n let nextMatches = React.useMemo(() => {\n if (navigation.location) {\n // FIXME: can probably use transitionManager `nextMatches`\n let matches = matchRoutes(router.routes, navigation.location);\n invariant(matches, `No routes match path \"${navigation.location.pathname}\"`);\n return matches;\n }\n return [];\n }, [navigation.location, router.routes]);\n let routePreloads = matches.concat(nextMatches).map(match => {\n let route = manifest.routes[match.route.id];\n return (route.imports || []).concat([route.module]);\n }).flat(1);\n let preloads = isHydrated ? [] : manifest.entry.imports.concat(routePreloads);\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"link\", {\n rel: \"modulepreload\",\n href: manifest.url,\n crossOrigin: props.crossOrigin\n }), /*#__PURE__*/React.createElement(\"link\", {\n rel: \"modulepreload\",\n href: manifest.entry.module,\n crossOrigin: props.crossOrigin\n }), dedupe(preloads).map(path => /*#__PURE__*/React.createElement(\"link\", {\n key: path,\n rel: \"modulepreload\",\n href: path,\n crossOrigin: props.crossOrigin\n })), !isHydrated && initialScripts, !isHydrated && deferredScripts);\n}\nfunction DeferredHydrationScript({\n dataKey,\n deferredData,\n routeId\n}) {\n if (typeof document === \"undefined\" && deferredData && dataKey && routeId) {\n invariant(deferredData.pendingKeys.includes(dataKey), `Deferred data for route ${routeId} with key ${dataKey} was not pending but tried to render a script for it.`);\n }\n return /*#__PURE__*/React.createElement(React.Suspense, {\n fallback:\n // This makes absolutely no sense. The server renders null as a fallback,\n // but when hydrating, we need to render a script tag to avoid a hydration issue.\n // To reproduce a hydration mismatch, just render null as a fallback.\n typeof document === \"undefined\" && deferredData && dataKey && routeId ? null : /*#__PURE__*/React.createElement(\"script\", {\n async: true,\n suppressHydrationWarning: true,\n dangerouslySetInnerHTML: {\n __html: \" \"\n }\n })\n }, typeof document === \"undefined\" && deferredData && dataKey && routeId ? /*#__PURE__*/React.createElement(Await, {\n resolve: deferredData.data[dataKey],\n errorElement: /*#__PURE__*/React.createElement(ErrorDeferredHydrationScript, {\n dataKey: dataKey,\n routeId: routeId\n }),\n children: data => /*#__PURE__*/React.createElement(\"script\", {\n async: true,\n suppressHydrationWarning: true,\n dangerouslySetInnerHTML: {\n __html: `__remixContext.r(${JSON.stringify(routeId)}, ${JSON.stringify(dataKey)}, ${escapeHtml(JSON.stringify(data))});`\n }\n })\n }) : /*#__PURE__*/React.createElement(\"script\", {\n async: true,\n suppressHydrationWarning: true,\n dangerouslySetInnerHTML: {\n __html: \" \"\n }\n }));\n}\nfunction ErrorDeferredHydrationScript({\n dataKey,\n routeId\n}) {\n let error = useAsyncError();\n let toSerialize = process.env.NODE_ENV === \"development\" ? {\n message: error.message,\n stack: error.stack\n } : {\n message: \"Unexpected Server Error\",\n stack: undefined\n };\n return /*#__PURE__*/React.createElement(\"script\", {\n suppressHydrationWarning: true,\n dangerouslySetInnerHTML: {\n __html: `__remixContext.r(${JSON.stringify(routeId)}, ${JSON.stringify(dataKey)}, !1, ${escapeHtml(JSON.stringify(toSerialize))});`\n }\n });\n}\nfunction dedupe(array) {\n return [...new Set(array)];\n}\n\n// TODO: Can this be re-exported from RR?\n\nfunction useMatches() {\n let {\n routeModules\n } = useRemixContext();\n let matches = useMatches$1();\n return React.useMemo(() => matches.map(match => {\n let remixMatch = {\n id: match.id,\n pathname: match.pathname,\n params: match.params,\n data: match.data,\n // Need to grab handle here since we don't have it at client-side route\n // creation time\n handle: routeModules[match.id].handle\n };\n return remixMatch;\n }), [matches, routeModules]);\n}\n\n/**\n * Returns the JSON parsed data from the current route's `loader`.\n *\n * @see https://remix.run/hooks/use-loader-data\n */\nfunction useLoaderData() {\n return useLoaderData$1();\n}\n\n/**\n * Returns the JSON parsed data from the current route's `action`.\n *\n * @see https://remix.run/hooks/use-action-data\n */\nfunction useActionData() {\n return useActionData$1();\n}\n\n/**\n * Returns everything you need to know about a page transition to build pending\n * navigation indicators and optimistic UI on data mutations.\n *\n * @deprecated in favor of useNavigation\n *\n * @see https://remix.run/hooks/use-transition\n */\nfunction useTransition() {\n let navigation = useNavigation();\n React.useEffect(() => {\n logDeprecationOnce(useTransitionWarning);\n }, []);\n return React.useMemo(() => convertNavigationToTransition(navigation), [navigation]);\n}\nfunction convertNavigationToTransition(navigation) {\n let {\n location,\n state,\n formMethod,\n formAction,\n formEncType,\n formData\n } = navigation;\n if (!location) {\n return IDLE_TRANSITION;\n }\n let isActionSubmission = formMethod != null && [\"POST\", \"PUT\", \"PATCH\", \"DELETE\"].includes(formMethod.toUpperCase());\n if (state === \"submitting\" && formMethod && formAction && formEncType && formData) {\n if (isActionSubmission) {\n // Actively submitting to an action\n let transition = {\n location,\n state,\n submission: {\n method: formMethod.toUpperCase(),\n action: formAction,\n encType: formEncType,\n formData: formData,\n key: \"\"\n },\n type: \"actionSubmission\"\n };\n return transition;\n } else {\n // @remix-run/router doesn't mark loader submissions as state: \"submitting\"\n invariant(false, \"Encountered an unexpected navigation scenario in useTransition()\");\n }\n }\n if (state === \"loading\") {\n let {\n _isRedirect,\n _isFetchActionRedirect\n } = location.state || {};\n if (formMethod && formAction && formEncType && formData) {\n if (!_isRedirect) {\n if (isActionSubmission) {\n // We're reloading the same location after an action submission\n let transition = {\n location,\n state,\n submission: {\n method: formMethod.toUpperCase(),\n action: formAction,\n encType: formEncType,\n formData: formData,\n key: \"\"\n },\n type: \"actionReload\"\n };\n return transition;\n } else {\n // The new router fixes a bug in useTransition where the submission\n // \"action\" represents the request URL not the state of the <form> in\n // the DOM. Back-port it here to maintain behavior, but useNavigation\n // will fix this bug.\n let url = new URL(formAction, window.location.origin);\n\n // This typing override should be safe since this is only running for\n // GET submissions and over in @remix-run/router we have an invariant\n // if you have any non-string values in your FormData when we attempt\n // to convert them to URLSearchParams\n url.search = new URLSearchParams(formData.entries()).toString();\n\n // Actively \"submitting\" to a loader\n let transition = {\n location,\n state: \"submitting\",\n submission: {\n method: formMethod.toUpperCase(),\n action: url.pathname + url.search,\n encType: formEncType,\n formData: formData,\n key: \"\"\n },\n type: \"loaderSubmission\"\n };\n return transition;\n }\n } else {\n // Redirecting after a submission\n if (isActionSubmission) {\n let transition = {\n location,\n state,\n submission: {\n method: formMethod.toUpperCase(),\n action: formAction,\n encType: formEncType,\n formData: formData,\n key: \"\"\n },\n type: \"actionRedirect\"\n };\n return transition;\n } else {\n let transition = {\n location,\n state,\n submission: {\n method: formMethod.toUpperCase(),\n action: formAction,\n encType: formEncType,\n formData: formData,\n key: \"\"\n },\n type: \"loaderSubmissionRedirect\"\n };\n return transition;\n }\n }\n } else if (_isRedirect) {\n if (_isFetchActionRedirect) {\n let transition = {\n location,\n state,\n submission: undefined,\n type: \"fetchActionRedirect\"\n };\n return transition;\n } else {\n let transition = {\n location,\n state,\n submission: undefined,\n type: \"normalRedirect\"\n };\n return transition;\n }\n }\n }\n\n // If no scenarios above match, then it's a normal load!\n let transition = {\n location,\n state: \"loading\",\n submission: undefined,\n type: \"normalLoad\"\n };\n return transition;\n}\n\n/**\n * Provides all fetchers currently on the page. Useful for layouts and parent\n * routes that need to provide pending/optimistic UI regarding the fetch.\n *\n * @see https://remix.run/api/remix#usefetchers\n */\nfunction useFetchers() {\n let fetchers = useFetchers$1();\n return fetchers.map(f => {\n let fetcher = convertRouterFetcherToRemixFetcher({\n state: f.state,\n data: f.data,\n formMethod: f.formMethod,\n formAction: f.formAction,\n formData: f.formData,\n formEncType: f.formEncType,\n \" _hasFetcherDoneAnything \": f[\" _hasFetcherDoneAnything \"]\n });\n addFetcherDeprecationWarnings(fetcher);\n return fetcher;\n });\n}\n/**\n * Interacts with route loaders and actions without causing a navigation. Great\n * for any interaction that stays on the same page.\n *\n * @see https://remix.run/hooks/use-fetcher\n */\nfunction useFetcher() {\n let fetcherRR = useFetcher$1();\n return React.useMemo(() => {\n let remixFetcher = convertRouterFetcherToRemixFetcher({\n state: fetcherRR.state,\n data: fetcherRR.data,\n formMethod: fetcherRR.formMethod,\n formAction: fetcherRR.formAction,\n formData: fetcherRR.formData,\n formEncType: fetcherRR.formEncType,\n \" _hasFetcherDoneAnything \": fetcherRR[\" _hasFetcherDoneAnything \"]\n });\n let fetcherWithComponents = {\n ...remixFetcher,\n load: fetcherRR.load,\n submit: fetcherRR.submit,\n Form: fetcherRR.Form\n };\n addFetcherDeprecationWarnings(fetcherWithComponents);\n return fetcherWithComponents;\n }, [fetcherRR]);\n}\nfunction addFetcherDeprecationWarnings(fetcher) {\n let type = fetcher.type;\n Object.defineProperty(fetcher, \"type\", {\n get() {\n logDeprecationOnce(fetcherTypeWarning);\n return type;\n },\n set(value) {\n // Devs should *not* be doing this but we don't want to break their\n // current app if they are\n type = value;\n },\n // These settings should make this behave like a normal object `type` field\n configurable: true,\n enumerable: true\n });\n let submission = fetcher.submission;\n Object.defineProperty(fetcher, \"submission\", {\n get() {\n logDeprecationOnce(fetcherSubmissionWarning);\n return submission;\n },\n set(value) {\n // Devs should *not* be doing this but we don't want to break their\n // current app if they are\n submission = value;\n },\n // These settings should make this behave like a normal object `type` field\n configurable: true,\n enumerable: true\n });\n}\nfunction convertRouterFetcherToRemixFetcher(fetcherRR) {\n let {\n state,\n formMethod,\n formAction,\n formEncType,\n formData,\n data\n } = fetcherRR;\n let isActionSubmission = formMethod != null && [\"POST\", \"PUT\", \"PATCH\", \"DELETE\"].includes(formMethod.toUpperCase());\n if (state === \"idle\") {\n if (fetcherRR[\" _hasFetcherDoneAnything \"] === true) {\n let fetcher = {\n state: \"idle\",\n type: \"done\",\n formMethod: undefined,\n formAction: undefined,\n formData: undefined,\n formEncType: undefined,\n submission: undefined,\n data\n };\n return fetcher;\n } else {\n let fetcher = IDLE_FETCHER;\n return fetcher;\n }\n }\n if (state === \"submitting\" && formMethod && formAction && formEncType && formData) {\n if (isActionSubmission) {\n // Actively submitting to an action\n let fetcher = {\n state,\n type: \"actionSubmission\",\n formMethod: formMethod.toUpperCase(),\n formAction: formAction,\n formEncType: formEncType,\n formData: formData,\n submission: {\n method: formMethod.toUpperCase(),\n action: formAction,\n encType: formEncType,\n formData: formData,\n key: \"\"\n },\n data\n };\n return fetcher;\n } else {\n // @remix-run/router doesn't mark loader submissions as state: \"submitting\"\n invariant(false, \"Encountered an unexpected fetcher scenario in useFetcher()\");\n }\n }\n if (state === \"loading\") {\n if (formMethod && formAction && formEncType && formData) {\n if (isActionSubmission) {\n if (data) {\n // In a loading state but we have data - must be an actionReload\n let fetcher = {\n state,\n type: \"actionReload\",\n formMethod: formMethod.toUpperCase(),\n formAction: formAction,\n formEncType: formEncType,\n formData: formData,\n submission: {\n method: formMethod.toUpperCase(),\n action: formAction,\n encType: formEncType,\n formData: formData,\n key: \"\"\n },\n data\n };\n return fetcher;\n } else {\n let fetcher = {\n state,\n type: \"actionRedirect\",\n formMethod: formMethod.toUpperCase(),\n formAction: formAction,\n formEncType: formEncType,\n formData: formData,\n submission: {\n method: formMethod.toUpperCase(),\n action: formAction,\n encType: formEncType,\n formData: formData,\n key: \"\"\n },\n data: undefined\n };\n return fetcher;\n }\n } else {\n // The new router fixes a bug in useTransition where the submission\n // \"action\" represents the request URL not the state of the <form> in\n // the DOM. Back-port it here to maintain behavior, but useNavigation\n // will fix this bug.\n let url = new URL(formAction, window.location.origin);\n\n // This typing override should be safe since this is only running for\n // GET submissions and over in @remix-run/router we have an invariant\n // if you have any non-string values in your FormData when we attempt\n // to convert them to URLSearchParams\n url.search = new URLSearchParams(formData.entries()).toString();\n\n // Actively \"submitting\" to a loader\n let fetcher = {\n state: \"submitting\",\n type: \"loaderSubmission\",\n formMethod: formMethod.toUpperCase(),\n formAction: formAction,\n formEncType: formEncType,\n formData: formData,\n submission: {\n method: formMethod.toUpperCase(),\n action: url.pathname + url.search,\n encType: formEncType,\n formData: formData,\n key: \"\"\n },\n data\n };\n return fetcher;\n }\n }\n }\n\n // If all else fails, it's a normal load!\n let fetcher = {\n state: \"loading\",\n type: \"normalLoad\",\n formMethod: undefined,\n formAction: undefined,\n formData: undefined,\n formEncType: undefined,\n submission: undefined,\n data\n };\n return fetcher;\n}\n\n// Dead Code Elimination magic for production builds.\n// This way devs don't have to worry about doing the NODE_ENV check themselves.\n// If running an un-bundled server outside of `remix dev` you will still need\n// to set the REMIX_DEV_SERVER_WS_PORT manually.\nconst LiveReload = process.env.NODE_ENV !== \"development\" ? () => null : function LiveReload({\n // TODO: remove REMIX_DEV_SERVER_WS_PORT in v2\n port = Number(process.env.REMIX_DEV_SERVER_WS_PORT || 8002),\n timeoutMs = 1000,\n nonce = undefined\n}) {\n let js = String.raw;\n return /*#__PURE__*/React.createElement(\"script\", {\n nonce: nonce,\n suppressHydrationWarning: true,\n dangerouslySetInnerHTML: {\n __html: js`\n function remixLiveReloadConnect(config) {\n let protocol = location.protocol === \"https:\" ? \"wss:\" : \"ws:\";\n let host = location.hostname;\n let port = (window.__remixContext && window.__remixContext.dev && window.__remixContext.dev.websocketPort) || ${String(port)};\n let socketPath = protocol + \"//\" + host + \":\" + port + \"/socket\";\n let ws = new WebSocket(socketPath);\n ws.onmessage = async (message) => {\n let event = JSON.parse(message.data);\n if (event.type === \"LOG\") {\n console.log(event.message);\n }\n if (event.type === \"RELOAD\") {\n console.log(\"\uD83D\uDCBF Reloading window ...\");\n window.location.reload();\n }\n if (event.type === \"HMR\") {\n if (!window.__hmr__ || !window.__hmr__.contexts) {\n console.log(\"\uD83D\uDCBF [HMR] No HMR context, reloading window ...\");\n window.location.reload();\n return;\n }\n if (!event.updates || !event.updates.length) return;\n let updateAccepted = false;\n let needsRevalidation = new Set();\n for (let update of event.updates) {\n console.log(\"[HMR] \" + update.reason + \" [\" + update.id +\"]\")\n if (update.revalidate) {\n needsRevalidation.add(update.routeId);\n console.log(\"[HMR] Revalidating [\" + update.routeId + \"]\");\n }\n let imported = await import(update.url + '?t=' + event.assetsManifest.hmr.timestamp);\n if (window.__hmr__.contexts[update.id]) {\n let accepted = window.__hmr__.contexts[update.id].emit(\n imported\n );\n if (accepted) {\n console.log(\"[HMR] Updated accepted by\", update.id);\n updateAccepted = true;\n }\n }\n }\n if (event.assetsManifest && window.__hmr__.contexts[\"remix:manifest\"]) {\n let accepted = window.__hmr__.contexts[\"remix:manifest\"].emit(\n { needsRevalidation, assetsManifest: event.assetsManifest }\n );\n if (accepted) {\n console.log(\"[HMR] Updated accepted by\", \"remix:manifest\");\n updateAccepted = true;\n }\n }\n if (!updateAccepted) {\n console.log(\"[HMR] Updated rejected, reloading...\");\n window.location.reload();\n }\n }\n };\n ws.onopen = () => {\n if (config && typeof config.onOpen === \"function\") {\n config.onOpen();\n }\n };\n ws.onclose = (event) => {\n if (event.code === 1006) {\n console.log(\"Remix dev asset server web socket closed. Reconnecting...\");\n setTimeout(\n () =>\n remixLiveReloadConnect({\n onOpen: () => window.location.reload(),\n }),\n ${String(timeoutMs)}\n );\n }\n };\n ws.onerror = (error) => {\n console.log(\"Remix dev asset server web socket error:\");\n console.error(error);\n };\n }\n remixLiveReloadConnect();\n `\n }\n });\n};\n\nexport { Await, Link, Links, LiveReload, Meta, NavLink, PrefetchPageLinks, RemixContext, RemixRoute, RemixRouteError, Scripts, composeEventHandlers, useActionData, useFetcher, useFetchers, useLoaderData, useMatches, useTransition };\n", "/**\n * @remix-run/react v1.16.1\n *\n * Copyright (c) Remix Software Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nfunction _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\n\nexport { _extends as extends };\n", "/**\n * @remix-run/react v1.16.1\n *\n * Copyright (c) Remix Software Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nimport React__default, { useContext } from 'react';\nimport { useRouteError, isRouteErrorResponse } from 'react-router-dom';\n\nclass RemixErrorBoundary extends React__default.Component {\n constructor(props) {\n super(props);\n this.state = {\n error: props.error || null,\n location: props.location\n };\n }\n static getDerivedStateFromError(error) {\n return {\n error\n };\n }\n static getDerivedStateFromProps(props, state) {\n // When we get into an error state, the user will likely click \"back\" to the\n // previous page that didn't have an error. Because this wraps the entire\n // application (even the HTML!) that will have no effect--the error page\n // continues to display. This gives us a mechanism to recover from the error\n // when the location changes.\n //\n // Whether we're in an error state or not, we update the location in state\n // so that when we are in an error state, it gets reset when a new location\n // comes in and the user recovers from the error.\n if (state.location !== props.location) {\n return {\n error: props.error || null,\n location: props.location\n };\n }\n\n // If we're not changing locations, preserve the location but still surface\n // any new errors that may come through. We retain the existing error, we do\n // this because the error provided from the app state may be cleared without\n // the location changing.\n return {\n error: props.error || state.error,\n location: state.location\n };\n }\n render() {\n if (this.state.error) {\n return /*#__PURE__*/React__default.createElement(this.props.component, {\n error: this.state.error\n });\n } else {\n return this.props.children;\n }\n }\n}\n\n/**\n * When app's don't provide a root level ErrorBoundary, we default to this.\n */\nfunction RemixRootDefaultErrorBoundary({\n error\n}) {\n console.error(error);\n return /*#__PURE__*/React__default.createElement(\"html\", {\n lang: \"en\"\n }, /*#__PURE__*/React__default.createElement(\"head\", null, /*#__PURE__*/React__default.createElement(\"meta\", {\n charSet: \"utf-8\"\n }), /*#__PURE__*/React__default.createElement(\"meta\", {\n name: \"viewport\",\n content: \"width=device-width, initial-scale=1, viewport-fit=cover\"\n }), /*#__PURE__*/React__default.createElement(\"title\", null, \"Application Error!\")), /*#__PURE__*/React__default.createElement(\"body\", null, /*#__PURE__*/React__default.createElement(\"main\", {\n style: {\n fontFamily: \"system-ui, sans-serif\",\n padding: \"2rem\"\n }\n }, /*#__PURE__*/React__default.createElement(\"h1\", {\n style: {\n fontSize: \"24px\"\n }\n }, \"Application Error\"), /*#__PURE__*/React__default.createElement(\"pre\", {\n style: {\n padding: \"2rem\",\n background: \"hsla(10, 50%, 50%, 0.1)\",\n color: \"red\",\n overflow: \"auto\"\n }\n }, error.stack)), /*#__PURE__*/React__default.createElement(\"script\", {\n dangerouslySetInnerHTML: {\n __html: `\n console.log(\n \"\uD83D\uDCBF Hey developer\uD83D\uDC4B. You can provide a way better UX than this when your app throws errors. Check out https://remix.run/guides/errors for more information.\"\n );\n `\n }\n })));\n}\nfunction V2_RemixRootDefaultErrorBoundary() {\n let error = useRouteError();\n if (isRouteErrorResponse(error)) {\n return /*#__PURE__*/React__default.createElement(RemixRootDefaultCatchBoundaryImpl, {\n caught: error\n });\n } else if (error instanceof Error) {\n return /*#__PURE__*/React__default.createElement(RemixRootDefaultErrorBoundary, {\n error: error\n });\n } else {\n let errorString = error == null ? \"Unknown Error\" : typeof error === \"object\" && \"toString\" in error ? error.toString() : JSON.stringify(error);\n return /*#__PURE__*/React__default.createElement(RemixRootDefaultErrorBoundary, {\n error: new Error(errorString)\n });\n }\n}\nlet RemixCatchContext = /*#__PURE__*/React__default.createContext(undefined);\n\n/**\n * Returns the status code and thrown response data.\n *\n * @deprecated Please enable the v2_errorBoundary flag\n *\n * @see https://remix.run/route/catch-boundary\n */\nfunction useCatch() {\n return useContext(RemixCatchContext);\n}\nfunction RemixCatchBoundary({\n catch: catchVal,\n component: Component,\n children\n}) {\n if (catchVal) {\n return /*#__PURE__*/React__default.createElement(RemixCatchContext.Provider, {\n value: catchVal\n }, /*#__PURE__*/React__default.createElement(Component, null));\n }\n return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, children);\n}\n\n/**\n * When app's don't provide a root level CatchBoundary, we default to this.\n */\nfunction RemixRootDefaultCatchBoundary() {\n let caught = useCatch();\n return /*#__PURE__*/React__default.createElement(RemixRootDefaultCatchBoundaryImpl, {\n caught: caught\n });\n}\nfunction RemixRootDefaultCatchBoundaryImpl({\n caught\n}) {\n return /*#__PURE__*/React__default.createElement(\"html\", {\n lang: \"en\"\n }, /*#__PURE__*/React__default.createElement(\"head\", null, /*#__PURE__*/React__default.createElement(\"meta\", {\n charSet: \"utf-8\"\n }), /*#__PURE__*/React__default.createElement(\"meta\", {\n name: \"viewport\",\n content: \"width=device-width, initial-scale=1, viewport-fit=cover\"\n }), /*#__PURE__*/React__default.createElement(\"title\", null, \"Unhandled Thrown Response!\")), /*#__PURE__*/React__default.createElement(\"body\", null, /*#__PURE__*/React__default.createElement(\"h1\", {\n style: {\n fontFamily: \"system-ui, sans-serif\",\n padding: \"2rem\"\n }\n }, caught.status, \" \", caught.statusText), /*#__PURE__*/React__default.createElement(\"script\", {\n dangerouslySetInnerHTML: {\n __html: `\n console.log(\n \"\uD83D\uDCBF Hey developer\uD83D\uDC4B. You can provide a way better UX than this when your app throws 404s (and other responses). Check out https://remix.run/guides/not-found for more information.\"\n );\n `\n }\n })));\n}\n\nexport { RemixCatchBoundary, RemixErrorBoundary, RemixRootDefaultCatchBoundary, RemixRootDefaultErrorBoundary, V2_RemixRootDefaultErrorBoundary, useCatch };\n", "/**\n * @remix-run/react v1.16.1\n *\n * Copyright (c) Remix Software Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nfunction invariant(value, message) {\n if (value === false || value === null || typeof value === \"undefined\") {\n throw new Error(message);\n }\n}\n\nexport { invariant as default };\n", "/**\n * @remix-run/react v1.16.1\n *\n * Copyright (c) Remix Software Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nimport { parsePath } from 'react-router-dom';\nimport { loadRouteModule } from './routeModules.js';\n\n/**\n * Represents a `<link>` element.\n *\n * WHATWG Specification: https://html.spec.whatwg.org/multipage/semantics.html#the-link-element\n */\n\n////////////////////////////////////////////////////////////////////////////////\n/**\n * Gets all the links for a set of matches. The modules are assumed to have been\n * loaded already.\n */\nfunction getLinksForMatches(matches, routeModules, manifest) {\n let descriptors = matches.map(match => {\n var _module$links;\n let module = routeModules[match.route.id];\n return ((_module$links = module.links) === null || _module$links === void 0 ? void 0 : _module$links.call(module)) || [];\n }).flat(1);\n let preloads = getCurrentPageModulePreloadHrefs(matches, manifest);\n return dedupe(descriptors, preloads);\n}\nasync function prefetchStyleLinks(routeModule) {\n if (!routeModule.links) return;\n let descriptors = routeModule.links();\n if (!descriptors) return;\n let styleLinks = [];\n for (let descriptor of descriptors) {\n if (!isPageLinkDescriptor(descriptor) && descriptor.rel === \"stylesheet\") {\n styleLinks.push({\n ...descriptor,\n rel: \"preload\",\n as: \"style\"\n });\n }\n }\n\n // don't block for non-matching media queries\n let matchingLinks = styleLinks.filter(link => !link.media || window.matchMedia(link.media).matches);\n await Promise.all(matchingLinks.map(prefetchStyleLink));\n}\nasync function prefetchStyleLink(descriptor) {\n return new Promise(resolve => {\n let link = document.createElement(\"link\");\n Object.assign(link, descriptor);\n function removeLink() {\n // if a navigation interrupts this prefetch React will update the <head>\n // and remove the link we put in there manually, so we check if it's still\n // there before trying to remove it\n if (document.head.contains(link)) {\n document.head.removeChild(link);\n }\n }\n link.onload = () => {\n removeLink();\n resolve();\n };\n link.onerror = () => {\n removeLink();\n resolve();\n };\n document.head.appendChild(link);\n });\n}\n\n////////////////////////////////////////////////////////////////////////////////\nfunction isPageLinkDescriptor(object) {\n return object != null && typeof object.page === \"string\";\n}\nfunction isHtmlLinkDescriptor(object) {\n if (object == null) return false;\n\n // <link> may not have an href if <link rel=\"preload\"> is used with imagesrcset + imagesizes\n // https://github.com/remix-run/remix/issues/184\n // https://html.spec.whatwg.org/commit-snapshots/cb4f5ff75de5f4cbd7013c4abad02f21c77d4d1c/#attr-link-imagesrcset\n if (object.href == null) {\n return object.rel === \"preload\" && (typeof object.imageSrcSet === \"string\" || typeof object.imagesrcset === \"string\") && (typeof object.imageSizes === \"string\" || typeof object.imagesizes === \"string\");\n }\n return typeof object.rel === \"string\" && typeof object.href === \"string\";\n}\nasync function getStylesheetPrefetchLinks(matches, manifest, routeModules) {\n let links = await Promise.all(matches.map(async match => {\n let mod = await loadRouteModule(manifest.routes[match.route.id], routeModules);\n return mod.links ? mod.links() : [];\n }));\n return links.flat(1).filter(isHtmlLinkDescriptor).filter(link => link.rel === \"stylesheet\" || link.rel === \"preload\").map(link => link.rel === \"preload\" ? {\n ...link,\n rel: \"prefetch\"\n } : {\n ...link,\n rel: \"prefetch\",\n as: \"style\"\n });\n}\n\n// This is ridiculously identical to transition.ts `filterMatchesToLoad`\nfunction getNewMatchesForLinks(page, nextMatches, currentMatches, manifest, location, mode) {\n let path = parsePathPatch(page);\n let isNew = (match, index) => {\n if (!currentMatches[index]) return true;\n return match.route.id !== currentMatches[index].route.id;\n };\n let matchPathChanged = (match, index) => {\n var _currentMatches$index;\n return (\n // param change, /users/123 -> /users/456\n currentMatches[index].pathname !== match.pathname ||\n // splat param changed, which is not present in match.path\n // e.g. /files/images/avatar.jpg -> files/finances.xls\n ((_currentMatches$index = currentMatches[index].route.path) === null || _currentMatches$index === void 0 ? void 0 : _currentMatches$index.endsWith(\"*\")) && currentMatches[index].params[\"*\"] !== match.params[\"*\"]\n );\n };\n\n // NOTE: keep this mostly up-to-date w/ the transition data diff, but this\n // version doesn't care about submissions\n let newMatches = mode === \"data\" && location.search !== path.search ?\n // this is really similar to stuff in transition.ts, maybe somebody smarter\n // than me (or in less of a hurry) can share some of it. You're the best.\n nextMatches.filter((match, index) => {\n let manifestRoute = manifest.routes[match.route.id];\n if (!manifestRoute.hasLoader) {\n return false;\n }\n if (isNew(match, index) || matchPathChanged(match, index)) {\n return true;\n }\n if (match.route.shouldRevalidate) {\n var _currentMatches$;\n let routeChoice = match.route.shouldRevalidate({\n currentUrl: new URL(location.pathname + location.search + location.hash, window.origin),\n currentParams: ((_currentMatches$ = currentMatches[0]) === null || _currentMatches$ === void 0 ? void 0 : _currentMatches$.params) || {},\n nextUrl: new URL(page, window.origin),\n nextParams: match.params,\n defaultShouldRevalidate: true\n });\n if (typeof routeChoice === \"boolean\") {\n return routeChoice;\n }\n }\n return true;\n }) : nextMatches.filter((match, index) => {\n let manifestRoute = manifest.routes[match.route.id];\n return (mode === \"assets\" || manifestRoute.hasLoader) && (isNew(match, index) || matchPathChanged(match, index));\n });\n return newMatches;\n}\nfunction getDataLinkHrefs(page, matches, manifest) {\n let path = parsePathPatch(page);\n return dedupeHrefs(matches.filter(match => manifest.routes[match.route.id].hasLoader).map(match => {\n let {\n pathname,\n search\n } = path;\n let searchParams = new URLSearchParams(search);\n searchParams.set(\"_data\", match.route.id);\n return `${pathname}?${searchParams}`;\n }));\n}\nfunction getModuleLinkHrefs(matches, manifestPatch) {\n return dedupeHrefs(matches.map(match => {\n let route = manifestPatch.routes[match.route.id];\n let hrefs = [route.module];\n if (route.imports) {\n hrefs = hrefs.concat(route.imports);\n }\n return hrefs;\n }).flat(1));\n}\n\n// The `<Script>` will render rel=modulepreload for the current page, we don't\n// need to include them in a page prefetch, this gives us the list to remove\n// while deduping.\nfunction getCurrentPageModulePreloadHrefs(matches, manifest) {\n return dedupeHrefs(matches.map(match => {\n let route = manifest.routes[match.route.id];\n let hrefs = [route.module];\n if (route.imports) {\n hrefs = hrefs.concat(route.imports);\n }\n return hrefs;\n }).flat(1));\n}\nfunction dedupeHrefs(hrefs) {\n return [...new Set(hrefs)];\n}\nfunction dedupe(descriptors, preloads) {\n let set = new Set();\n let preloadsSet = new Set(preloads);\n return descriptors.reduce((deduped, descriptor) => {\n let alreadyModulePreload = !isPageLinkDescriptor(descriptor) && descriptor.as === \"script\" && descriptor.href && preloadsSet.has(descriptor.href);\n if (alreadyModulePreload) {\n return deduped;\n }\n let str = JSON.stringify(descriptor);\n if (!set.has(str)) {\n set.add(str);\n deduped.push(descriptor);\n }\n return deduped;\n }, []);\n}\n\n// https://github.com/remix-run/history/issues/897\nfunction parsePathPatch(href) {\n let path = parsePath(href);\n if (path.search === undefined) path.search = \"\";\n return path;\n}\n\nexport { dedupe, getDataLinkHrefs, getLinksForMatches, getModuleLinkHrefs, getNewMatchesForLinks, getStylesheetPrefetchLinks, isHtmlLinkDescriptor, isPageLinkDescriptor, prefetchStyleLinks };\n", "/**\n * @remix-run/react v1.16.1\n *\n * Copyright (c) Remix Software Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\n/**\n * A React component that is rendered when the server throws a Response.\n *\n * @deprecated Please enable the v2_errorBoundary flag\n *\n * @see https://remix.run/route/catch-boundary\n */\n\n/**\n * A React component that is rendered when there is an error on a route.\n *\n * @deprecated Please enable the v2_errorBoundary flag\n *\n * @see https://remix.run/route/error-boundary\n */\n\n/**\n * V2 version of the ErrorBoundary that eliminates the distinction between\n * Error and Catch Boundaries and behaves like RR 6.4 errorElement and captures\n * errors with useRouteError()\n */\n\n/**\n * A function that defines `<link>` tags to be inserted into the `<head>` of\n * the document on route transitions.\n *\n * @see https://remix.run/route/meta\n */\n\n/**\n * A function that returns an object of name + content pairs to use for\n * `<meta>` tags for a route. These tags will be merged with (and take\n * precedence over) tags from parent routes.\n *\n * @see https://remix.run/route/meta\n */\n\n// TODO: Replace in v2\n\n/**\n * A name/content pair used to render `<meta>` tags in a meta function for a\n * route. The value can be either a string, which will render a single `<meta>`\n * tag, or an array of strings that will render multiple tags with the same\n * `name` attribute.\n */\n\n// TODO: Replace in v2\n\n/**\n * A React component that is rendered for a route.\n */\n\n/**\n * An arbitrary object that is associated with a route.\n *\n * @see https://remix.run/route/handle\n */\n\nasync function loadRouteModule(route, routeModulesCache) {\n if (route.id in routeModulesCache) {\n return routeModulesCache[route.id];\n }\n try {\n let routeModule = await import( /* webpackIgnore: true */route.module);\n routeModulesCache[route.id] = routeModule;\n return routeModule;\n } catch (error) {\n // User got caught in the middle of a deploy and the CDN no longer has the\n // asset we're trying to import! Reload from the server and the user\n // (should) get the new manifest--unless the developer purged the static\n // assets, the manifest path, but not the documents \uD83D\uDE2C\n window.location.reload();\n return new Promise(() => {\n // check out of this hook cause the DJs never gonna re[s]olve this\n });\n }\n}\n\n/**\n * @deprecated The `unstable_shouldReload` function has been removed, so this\n * function will never run and route data will be revalidated on every request.\n * Please update the function name to `shouldRevalidate` and use the\n * `ShouldRevalidateFunction` interface.\n */\n\nexport { loadRouteModule };\n", "/**\n * @remix-run/react v1.16.1\n *\n * Copyright (c) Remix Software Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\n// This escapeHtml utility is based on https://github.com/zertosh/htmlescape\n// License: https://github.com/zertosh/htmlescape/blob/0527ca7156a524d256101bb310a9f970f63078ad/LICENSE\n\n// We've chosen to inline the utility here to reduce the number of npm dependencies we have,\n// slightly decrease the code size compared the original package and make it esm compatible.\n\nconst ESCAPE_LOOKUP = {\n \"&\": \"\\\\u0026\",\n \">\": \"\\\\u003e\",\n \"<\": \"\\\\u003c\",\n \"\\u2028\": \"\\\\u2028\",\n \"\\u2029\": \"\\\\u2029\"\n};\nconst ESCAPE_REGEX = /[&><\\u2028\\u2029]/g;\nfunction escapeHtml(html) {\n return html.replace(ESCAPE_REGEX, match => ESCAPE_LOOKUP[match]);\n}\nfunction createHtml(html) {\n return {\n __html: html\n };\n}\n\nexport { createHtml, escapeHtml };\n", "/**\n * @remix-run/react v1.16.1\n *\n * Copyright (c) Remix Software Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nconst alreadyWarned = {};\nfunction logDeprecationOnce(message, key = message) {\n if (process.env.NODE_ENV !== \"production\" && !alreadyWarned[key]) {\n alreadyWarned[key] = true;\n console.warn(message);\n }\n}\n\nexport { logDeprecationOnce };\n", "/**\n * @remix-run/react v1.16.1\n *\n * Copyright (c) Remix Software Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nimport { ErrorResponse } from '@remix-run/router';\n\n/**\n * @deprecated in favor of the `ErrorResponse` class in React Router. Please\n * enable the `future.v2_errorBoundary` flag to ease your migration to Remix v2.\n */\n\nfunction deserializeErrors(errors) {\n if (!errors) return null;\n let entries = Object.entries(errors);\n let serialized = {};\n for (let [key, val] of entries) {\n // Hey you! If you change this, please change the corresponding logic in\n // serializeErrors in remix-server-runtime/errors.ts :)\n if (val && val.__type === \"RouteErrorResponse\") {\n serialized[key] = new ErrorResponse(val.status, val.statusText, val.data, val.internal === true);\n } else if (val && val.__type === \"Error\") {\n let error = new Error(val.message);\n error.stack = val.stack;\n serialized[key] = error;\n } else {\n serialized[key] = val;\n }\n }\n return serialized;\n}\n\nexport { deserializeErrors };\n", "/**\n * @remix-run/react v1.16.1\n *\n * Copyright (c) Remix Software Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nimport * as React from 'react';\nimport { redirect } from 'react-router-dom';\nimport { loadRouteModule } from './routeModules.js';\nimport { fetchData, isRedirectResponse, isCatchResponse, isDeferredResponse, parseDeferredReadableStream } from './data.js';\nimport { prefetchStyleLinks } from './links.js';\nimport invariant from './invariant.js';\nimport { RemixRoute, RemixRouteError } from './components.js';\n\n// NOTE: make sure to change the Route in server-runtime if you change this\n\n// NOTE: make sure to change the EntryRoute in server-runtime if you change this\n\n// Create a map of routes by parentId to use recursively instead of\n// repeatedly filtering the manifest.\nfunction groupRoutesByParentId(manifest) {\n let routes = {};\n Object.values(manifest).forEach(route => {\n let parentId = route.parentId || \"\";\n if (!routes[parentId]) {\n routes[parentId] = [];\n }\n routes[parentId].push(route);\n });\n return routes;\n}\nfunction createServerRoutes(manifest, routeModules, future, parentId = \"\", routesByParentId = groupRoutesByParentId(manifest)) {\n return (routesByParentId[parentId] || []).map(route => {\n let hasErrorBoundary = future.v2_errorBoundary === true ? route.id === \"root\" || route.hasErrorBoundary : route.id === \"root\" || route.hasCatchBoundary || route.hasErrorBoundary;\n let dataRoute = {\n caseSensitive: route.caseSensitive,\n element: /*#__PURE__*/React.createElement(RemixRoute, {\n id: route.id\n }),\n errorElement: hasErrorBoundary ? /*#__PURE__*/React.createElement(RemixRouteError, {\n id: route.id\n }) : undefined,\n id: route.id,\n index: route.index,\n path: route.path,\n handle: routeModules[route.id].handle\n // Note: we don't need loader/action/shouldRevalidate on these routes\n // since they're for a static render\n };\n\n let children = createServerRoutes(manifest, routeModules, future, route.id, routesByParentId);\n if (children.length > 0) dataRoute.children = children;\n return dataRoute;\n });\n}\nfunction createClientRoutesWithHMRRevalidationOptOut(needsRevalidation, manifest, routeModulesCache, future) {\n return createClientRoutes(manifest, routeModulesCache, future, \"\", groupRoutesByParentId(manifest), needsRevalidation);\n}\nfunction createClientRoutes(manifest, routeModulesCache, future, parentId = \"\", routesByParentId = groupRoutesByParentId(manifest), needsRevalidation) {\n return (routesByParentId[parentId] || []).map(route => {\n let hasErrorBoundary = future.v2_errorBoundary === true ? route.id === \"root\" || route.hasErrorBoundary : route.id === \"root\" || route.hasCatchBoundary || route.hasErrorBoundary;\n let dataRoute = {\n caseSensitive: route.caseSensitive,\n element: /*#__PURE__*/React.createElement(RemixRoute, {\n id: route.id\n }),\n errorElement: hasErrorBoundary ? /*#__PURE__*/React.createElement(RemixRouteError, {\n id: route.id\n }) : undefined,\n id: route.id,\n index: route.index,\n path: route.path,\n // handle gets added in via useMatches since we aren't guaranteed to\n // have the route module available here\n handle: undefined,\n loader: createDataFunction(route, routeModulesCache, false),\n action: createDataFunction(route, routeModulesCache, true),\n shouldRevalidate: createShouldRevalidate(route, routeModulesCache, needsRevalidation)\n };\n let children = createClientRoutes(manifest, routeModulesCache, future, route.id, routesByParentId, needsRevalidation);\n if (children.length > 0) dataRoute.children = children;\n return dataRoute;\n });\n}\nfunction createShouldRevalidate(route, routeModules, needsRevalidation) {\n let handledRevalidation = false;\n return function (arg) {\n let module = routeModules[route.id];\n invariant(module, `Expected route module to be loaded for ${route.id}`);\n\n // When an HMR / HDR update happens we opt out of all user-defined\n // revalidation logic and the do as the dev server tells us the first\n // time router.revalidate() is called.\n if (needsRevalidation !== undefined && !handledRevalidation) {\n handledRevalidation = true;\n return needsRevalidation.has(route.id);\n }\n if (module.shouldRevalidate) {\n return module.shouldRevalidate(arg);\n }\n return arg.defaultShouldRevalidate;\n };\n}\nasync function loadRouteModuleWithBlockingLinks(route, routeModules) {\n let routeModule = await loadRouteModule(route, routeModules);\n await prefetchStyleLinks(routeModule);\n return routeModule;\n}\nfunction createDataFunction(route, routeModules, isAction) {\n return async ({\n request\n }) => {\n let routeModulePromise = loadRouteModuleWithBlockingLinks(route, routeModules);\n try {\n if (isAction && !route.hasAction) {\n let msg = `Route \"${route.id}\" does not have an action, but you are trying ` + `to submit to it. To fix this, please add an \\`action\\` function to the route`;\n console.error(msg);\n throw new Error(msg);\n } else if (!isAction && !route.hasLoader) {\n return null;\n }\n let result = await fetchData(request, route.id);\n if (result instanceof Error) {\n throw result;\n }\n if (isRedirectResponse(result)) {\n throw getRedirect(result);\n }\n if (isCatchResponse(result)) {\n throw result;\n }\n if (isDeferredResponse(result) && result.body) {\n return await parseDeferredReadableStream(result.body);\n }\n return result;\n } finally {\n await routeModulePromise;\n }\n };\n}\nfunction getRedirect(response) {\n let status = parseInt(response.headers.get(\"X-Remix-Status\"), 10) || 302;\n let url = response.headers.get(\"X-Remix-Redirect\");\n let headers = {};\n let revalidate = response.headers.get(\"X-Remix-Revalidate\");\n if (revalidate) {\n headers[\"X-Remix-Revalidate\"] = revalidate;\n }\n return redirect(url, {\n status,\n headers\n });\n}\n\nexport { createClientRoutes, createClientRoutesWithHMRRevalidationOptOut, createServerRoutes };\n", "/**\n * @remix-run/react v1.16.1\n *\n * Copyright (c) Remix Software Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nimport { AbortedDeferredError, UNSAFE_DeferredData } from '@remix-run/router';\n\n/**\n * Data for a route that was returned from a `loader()`.\n *\n * Note: This moves to unknown in ReactRouter and eventually likely in Remix\n */\n\nfunction isCatchResponse(response) {\n return response instanceof Response && response.headers.get(\"X-Remix-Catch\") != null;\n}\nfunction isErrorResponse(response) {\n return response instanceof Response && response.headers.get(\"X-Remix-Error\") != null;\n}\nfunction isRedirectResponse(response) {\n return response instanceof Response && response.headers.get(\"X-Remix-Redirect\") != null;\n}\nfunction isDeferredResponse(response) {\n var _response$headers$get;\n return response instanceof Response && !!((_response$headers$get = response.headers.get(\"Content-Type\")) !== null && _response$headers$get !== void 0 && _response$headers$get.match(/text\\/remix-deferred/));\n}\nasync function fetchData(request, routeId) {\n let url = new URL(request.url);\n url.searchParams.set(\"_data\", routeId);\n let init = {\n signal: request.signal\n };\n if (request.method !== \"GET\") {\n init.method = request.method;\n let contentType = request.headers.get(\"Content-Type\");\n init.body =\n // Check between word boundaries instead of startsWith() due to the last\n // paragraph of https://httpwg.org/specs/rfc9110.html#field.content-type\n contentType && /\\bapplication\\/x-www-form-urlencoded\\b/.test(contentType) ? new URLSearchParams(await request.text()) : await request.formData();\n }\n let response = await fetch(url.href, init);\n if (isErrorResponse(response)) {\n let data = await response.json();\n let error = new Error(data.message);\n error.stack = data.stack;\n return error;\n }\n return response;\n}\nconst DEFERRED_VALUE_PLACEHOLDER_PREFIX = \"__deferred_promise:\";\nasync function parseDeferredReadableStream(stream) {\n if (!stream) {\n throw new Error(\"parseDeferredReadableStream requires stream argument\");\n }\n let deferredData;\n let deferredResolvers = {};\n try {\n let sectionReader = readStreamSections(stream);\n\n // Read the first section to get the critical data\n let initialSectionResult = await sectionReader.next();\n let initialSection = initialSectionResult.value;\n if (!initialSection) throw new Error(\"no critical data\");\n let criticalData = JSON.parse(initialSection);\n\n // Setup deferred data and resolvers for later based on the critical data\n if (typeof criticalData === \"object\" && criticalData !== null) {\n for (let [eventKey, value] of Object.entries(criticalData)) {\n if (typeof value !== \"string\" || !value.startsWith(DEFERRED_VALUE_PLACEHOLDER_PREFIX)) {\n continue;\n }\n deferredData = deferredData || {};\n deferredData[eventKey] = new Promise((resolve, reject) => {\n deferredResolvers[eventKey] = {\n resolve: value => {\n resolve(value);\n delete deferredResolvers[eventKey];\n },\n reject: error => {\n reject(error);\n delete deferredResolvers[eventKey];\n }\n };\n });\n }\n }\n\n // Read the rest of the stream and resolve deferred promises\n (async () => {\n try {\n for await (let section of sectionReader) {\n // Determine event type and data\n let [event, ...sectionDataStrings] = section.split(\":\");\n let sectionDataString = sectionDataStrings.join(\":\");\n let data = JSON.parse(sectionDataString);\n if (event === \"data\") {\n for (let [key, value] of Object.entries(data)) {\n if (deferredResolvers[key]) {\n deferredResolvers[key].resolve(value);\n }\n }\n } else if (event === \"error\") {\n for (let [key, value] of Object.entries(data)) {\n let err = new Error(value.message);\n err.stack = value.stack;\n if (deferredResolvers[key]) {\n deferredResolvers[key].reject(err);\n }\n }\n }\n }\n for (let [key, resolver] of Object.entries(deferredResolvers)) {\n resolver.reject(new AbortedDeferredError(`Deferred ${key} will never be resolved`));\n }\n } catch (error) {\n // Reject any existing deferred promises if something blows up\n for (let resolver of Object.values(deferredResolvers)) {\n resolver.reject(error);\n }\n }\n })();\n return new UNSAFE_DeferredData({\n ...criticalData,\n ...deferredData\n });\n } catch (error) {\n for (let resolver of Object.values(deferredResolvers)) {\n resolver.reject(error);\n }\n throw error;\n }\n}\nasync function* readStreamSections(stream) {\n let reader = stream.getReader();\n let buffer = [];\n let sections = [];\n let closed = false;\n let encoder = new TextEncoder();\n let decoder = new TextDecoder();\n let readStreamSection = async () => {\n if (sections.length > 0) return sections.shift();\n\n // Read from the stream until we have at least one complete section to process\n while (!closed && sections.length === 0) {\n let chunk = await reader.read();\n if (chunk.done) {\n closed = true;\n break;\n }\n // Buffer the raw chunks\n buffer.push(chunk.value);\n try {\n // Attempt to split off a section from the buffer\n let bufferedString = decoder.decode(mergeArrays(...buffer));\n let splitSections = bufferedString.split(\"\\n\\n\");\n if (splitSections.length >= 2) {\n // We have a complete section, so add it to the sections array\n sections.push(...splitSections.slice(0, -1));\n // Remove the section from the buffer and store the rest for future processing\n buffer = [encoder.encode(splitSections.slice(-1).join(\"\\n\\n\"))];\n }\n\n // If we successfully parsed at least one section, break out of reading the stream\n // to allow upstream processing of the processable sections\n if (sections.length > 0) {\n break;\n }\n } catch {\n // If we failed to parse the buffer it was because we failed to decode the stream\n // because we are missing bytes that we haven't yet received, so continue reading\n // from the stream until we have a complete section\n continue;\n }\n }\n\n // If we have a complete section, return it\n if (sections.length > 0) {\n return sections.shift();\n }\n\n // If we have no complete section, but we have no more chunks to process,\n // split those sections and clear out the buffer as there is no more data\n // to process. If this errors, let it bubble up as the stream ended\n // without valid data\n if (buffer.length > 0) {\n let bufferedString = decoder.decode(mergeArrays(...buffer));\n sections = bufferedString.split(\"\\n\\n\").filter(s => s);\n buffer = [];\n }\n\n // Return any remaining sections that have been processed\n return sections.shift();\n };\n let section = await readStreamSection();\n while (section) {\n yield section;\n section = await readStreamSection();\n }\n}\nfunction mergeArrays(...arrays) {\n let out = new Uint8Array(arrays.reduce((total, arr) => total + arr.length, 0));\n let offset = 0;\n for (let arr of arrays) {\n out.set(arr, offset);\n offset += arr.length;\n }\n return out;\n}\n\nexport { fetchData, isCatchResponse, isDeferredResponse, isErrorResponse, isRedirectResponse, parseDeferredReadableStream };\n", "/**\n * @remix-run/react v1.16.1\n *\n * Copyright (c) Remix Software Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nexport { RemixBrowser } from './browser.js';\nexport { Form, Outlet, isRouteErrorResponse, unstable_useBlocker, unstable_usePrompt, useAsyncError, useAsyncValue, useBeforeUnload, useFormAction, useHref, useLocation, useMatch, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useSearchParams, useSubmit } from 'react-router-dom';\nexport { Await, Link, Links, LiveReload, Meta, NavLink, PrefetchPageLinks, Scripts, RemixContext as UNSAFE_RemixContext, useActionData, useFetcher, useFetchers, useLoaderData, useMatches, useTransition } from './components.js';\nexport { useCatch } from './errorBoundaries.js';\nexport { ScrollRestoration } from './scroll-restoration.js';\nexport { RemixServer } from './server.js';\n", "/**\n * @remix-run/react v1.16.1\n *\n * Copyright (c) Remix Software Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nimport { extends as _extends } from './_virtual/_rollupPluginBabelHelpers.js';\nimport * as React from 'react';\nimport { useLocation, UNSAFE_useScrollRestoration } from 'react-router-dom';\nimport { useMatches } from './components.js';\n\nlet STORAGE_KEY = \"positions\";\n\n/**\n * This component will emulate the browser's scroll restoration on location\n * changes.\n *\n * @see https://remix.run/components/scroll-restoration\n */\nfunction ScrollRestoration({\n getKey,\n ...props\n}) {\n let location = useLocation();\n let matches = useMatches();\n UNSAFE_useScrollRestoration({\n getKey,\n storageKey: STORAGE_KEY\n });\n\n // In order to support `getKey`, we need to compute a \"key\" here so we can\n // hydrate that up so that SSR scroll restoration isn't waiting on React to\n // hydrate. *However*, our key on the server is not the same as our key on\n // the client! So if the user's getKey implementation returns the SSR\n // location key, then let's ignore it and let our inline <script> below pick\n // up the client side history state key\n let key = React.useMemo(() => {\n if (!getKey) return null;\n let userKey = getKey(location, matches);\n return userKey !== location.key ? userKey : null;\n },\n // Nah, we only need this the first time for the SSR render\n // eslint-disable-next-line react-hooks/exhaustive-deps\n []);\n let restoreScroll = ((STORAGE_KEY, restoreKey) => {\n if (!window.history.state || !window.history.state.key) {\n let key = Math.random().toString(32).slice(2);\n window.history.replaceState({\n key\n }, \"\");\n }\n try {\n let positions = JSON.parse(sessionStorage.getItem(STORAGE_KEY) || \"{}\");\n let storedY = positions[restoreKey || window.history.state.key];\n if (typeof storedY === \"number\") {\n window.scrollTo(0, storedY);\n }\n } catch (error) {\n console.error(error);\n sessionStorage.removeItem(STORAGE_KEY);\n }\n }).toString();\n return /*#__PURE__*/React.createElement(\"script\", _extends({}, props, {\n suppressHydrationWarning: true,\n dangerouslySetInnerHTML: {\n __html: `(${restoreScroll})(${JSON.stringify(STORAGE_KEY)}, ${JSON.stringify(key)})`\n }\n }));\n}\n\nexport { ScrollRestoration };\n"],- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;AAoWgB,SAAAA,qBACdC,SAAmC;AAAA,MAAnCA,YAAmC,QAAA;AAAnCA,cAAiC,CAAA;EAAE;AAEnC,WAASC,sBACPC,SACAC,eAAgC;AAEhC,QAAI;MAAEC;MAAUC;MAAQC;QAASJ,QAAOK;AACxC,WAAOC;MACL;MACA;QAAEJ;QAAUC;QAAQC;MAApB;;MAECH,cAAcM,SAASN,cAAcM,MAAMC,OAAQ;MACnDP,cAAcM,SAASN,cAAcM,MAAME,OAAQ;IALjC;EAOtB;AAED,WAASC,kBAAkBV,SAAgBW,IAAM;AAC/C,WAAO,OAAOA,OAAO,WAAWA,KAAKC,WAAWD,EAAD;EAChD;AAED,SAAOE,mBACLd,uBACAW,mBACA,MACAZ,OAJuB;AAM1B;AA8Fe,SAAAgB,UAAUC,OAAYC,SAAgB;AACpD,MAAID,UAAU,SAASA,UAAU,QAAQ,OAAOA,UAAU,aAAa;AACrE,UAAM,IAAIE,MAAMD,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YAAW;AACzB,uBAA4B;AAAA,IAC1B;AAAA,IACA,YAAY;AAAA,EACd,CAAC;AAQD,MAAI,MAAY;AAAA,IAAQ,MAAM;AAC5B,UAAI,CAAC;AAAQ,eAAO;AACpB,UAAI,UAAU,OAAO,UAAU,OAAO;AACtC,aAAO,YAAY,SAAS,MAAM,UAAU;AAAA,IAC9C;AAAA;AAAA;AAAA,IAGA,CAAC;AAAA,EAAC;AACF,MAAI,iBAAiB,CAACC,cAAa,eAAe;AAChD,QAAI,CAAC,OAAO,QAAQ,SAAS,CAAC,OAAO,QAAQ,MAAM,KAAK;AACtD,UAAIC,OAAM,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,MAAM,CAAC;AAC5C,aAAO,QAAQ,aAAa;AAAA,QAC1B,KAAAA;AAAA,MACF,GAAG,EAAE;AAAA,IACP;AACA,QAAI;AACF,UAAI,YAAY,KAAK,MAAM,eAAe,QAAQD,YAAW,KAAK,IAAI;AACtE,UAAI,UAAU,UAAU,cAAc,OAAO,QAAQ,MAAM,GAAG;AAC9D,UAAI,OAAO,YAAY,UAAU;AAC/B,eAAO,SAAS,GAAG,OAAO;AAAA,MAC5B;AAAA,IACF,SAAS,OAAP;AACA,cAAQ,MAAM,KAAK;AACnB,qBAAe,WAAWA,YAAW;AAAA,IACvC;AAAA,EACF,GAAG,SAAS;AACZ,SAAoB,gBAAM,qBAAc,UAAUE,UAAS,CAAC,GAAG,OAAO;AAAA,IACpE,0BAA0B;AAAA,IAC1B,yBAAyB;AAAA,MACvB,QAAQ,IAAI,kBAAkB,KAAK,UAAU,WAAW,MAAM,KAAK,UAAU,GAAG;AAAA,IAClF;AAAA,EACF,CAAC,CAAC;AACJ;",- "names": ["createBrowserHistory", "options", "createBrowserLocation", "window", "globalHistory", "pathname", "search", "hash", "location", "createLocation", "state", "usr", "key", "createBrowserHref", "to", "createPath", "getUrlBasedHistory", "invariant", "value", "message", "Error", "warning", "cond", "console", "warn", "e", "createKey", "Math", "random", "toString", "substr", "getHistoryState", "index", "idx", "current", "parsePath", "charAt", "path", "parsedPath", "hashIndex", "indexOf", "searchIndex", "getLocation", "createHref", "validateLocation", "document", "defaultView", "v5Compat", "history", "action", "Action", "Pop", "listener", "getIndex", "replaceState", "handlePop", "nextIndex", "delta", "push", "Push", "historyState", "url", "pushState", "error", "assign", "replace", "Replace", "createURL", "base", "origin", "href", "URL", "listen", "fn", "addEventListener", "PopStateEventType", "removeEventListener", "encodeLocation", "go", "n", "isIndexRoute", "route", "convertRoutesToDataRoutes", "routes", "mapRouteProperties", "parentPath", "manifest", "map", "treePath", "id", "join", "children", "indexRoute", "pathOrLayoutRoute", "undefined", "matchRoutes", "locationArg", "basename", "stripBasename", "branches", "flattenRoutes", "rankRouteBranches", "matches", "i", "length", "matchRouteBranch", "safelyDecodeURI", "parentsMeta", "flattenRoute", "relativePath", "meta", "caseSensitive", "childrenIndex", "startsWith", "slice", "joinPaths", "routesMeta", "concat", "score", "computeScore", "forEach", "includes", "exploded", "explodeOptionalSegments", "segments", "split", "first", "rest", "isOptional", "endsWith", "required", "restExploded", "result", "subpath", "sort", "a", "b", "compareIndexes", "initialScore", "some", "isSplat", "splatPenalty", "indexRouteValue", "filter", "s", "reduce", "segment", "paramRe", "test", "dynamicSegmentValue", "emptySegmentValue", "staticSegmentValue", "siblings", "every", "branch", "matchedParams", "matchedPathname", "end", "remainingPathname", "match", "matchPath", "Object", "params", "pathnameBase", "normalizePathname", "pattern", "matcher", "paramNames", "compilePath", "captureGroups", "memo", "paramName", "splatValue", "safelyDecodeURIComponent", "regexpSource", "_", "RegExp", "decodeURI", "decodeURIComponent", "toLowerCase", "startIndex", "nextChar", "resolvePath", "fromPathname", "toPathname", "resolvePathname", "normalizeSearch", "normalizeHash", "relativeSegments", "pop", "getInvalidPathError", "char", "field", "dest", "JSON", "stringify", "getPathContributingMatches", "resolveTo", "toArg", "routePathnames", "locationPathname", "isPathRelative", "isEmptyPath", "from", "routePathnameIndex", "toSegments", "shift", "hasExplicitTrailingSlash", "hasCurrentTrailingSlash", "isTrackedPromise", "Promise", "_tracked", "unwrapTrackedPromise", "_error", "_data", "isRouteErrorResponse", "status", "statusText", "internal", "createRouter", "init", "detectErrorBoundary", "hasErrorBoundary", "defaultMapRouteProperties", "dataRoutes", "inFlightDataRoutes", "future", "v7_normalizeFormMethod", "v7_prependBasename", "unlistenHistory", "subscribers", "Set", "savedScrollPositions", "getScrollRestorationKey", "getScrollPosition", "initialScrollRestored", "hydrationData", "initialMatches", "initialErrors", "getInternalRouterError", "getShortCircuitMatches", "initialized", "m", "lazy", "loader", "router", "historyAction", "navigation", "IDLE_NAVIGATION", "restoreScrollPosition", "preventScrollReset", "revalidation", "loaderData", "actionData", "errors", "fetchers", "Map", "blockers", "pendingAction", "HistoryAction", "pendingPreventScrollReset", "pendingNavigationController", "isUninterruptedRevalidation", "isRevalidationRequired", "cancelledDeferredRoutes", "cancelledFetcherLoads", "fetchControllers", "incrementingLoadId", "pendingNavigationLoadId", "fetchReloadIds", "fetchRedirectIds", "fetchLoadMatches", "activeDeferreds", "blockerFunctions", "ignoreNextHistoryUpdate", "initialize", "size", "blockerKey", "shouldBlockNavigation", "currentLocation", "nextLocation", "updateBlocker", "proceed", "reset", "deleteBlocker", "updateState", "startNavigation", "dispose", "clear", "abort", "deleteFetcher", "subscribe", "add", "delete", "newState", "subscriber", "completeNavigation", "isActionReload", "formMethod", "isMutationMethod", "_isRedirect", "keys", "mergeLoaderData", "getSavedScrollPosition", "navigate", "opts", "normalizedPath", "normalizeTo", "fromRouteId", "relative", "submission", "normalizeNavigateOptions", "userReplace", "formAction", "pendingError", "revalidate", "interruptActiveLoads", "startUninterruptedRevalidation", "overrideNavigation", "saveScrollPosition", "routesToUse", "loadingNavigation", "notFoundMatches", "cancelActiveDeferreds", "isHashChangeOnly", "AbortController", "request", "createClientSideRequest", "signal", "pendingActionData", "findNearestBoundary", "actionOutput", "handleAction", "shortCircuited", "pendingActionError", "Request", "handleLoaders", "fetcherSubmission", "actionMatch", "getTargetMatch", "type", "ResultType", "method", "routeId", "callLoaderOrAction", "aborted", "isRedirectResult", "startRedirectNavigation", "isErrorResult", "boundaryMatch", "isDeferredResult", "data", "formEncType", "formData", "activeSubmission", "matchesToLoad", "revalidatingFetchers", "getMatchesToLoad", "updatedFetchers", "markFetchRedirectsDone", "rf", "fetcher", "get", "revalidatingFetcher", "set", "controller", "abortPendingFetchRevalidations", "f", "abortFetcher", "results", "loaderResults", "fetcherResults", "callLoadersAndMaybeResolveData", "redirect", "findRedirect", "processLoaderData", "deferredData", "done", "didAbortFetchLoads", "abortStaleFetchLoads", "shouldUpdateFetchers", "getFetcher", "IDLE_FETCHER", "fetch", "isServer", "has", "setFetcherError", "handleFetcherAction", "handleFetcherLoader", "requestMatches", "existingFetcher", "abortController", "fetchRequest", "actionResult", "loadingFetcher", "isFetchActionRedirect", "revalidationRequest", "loadId", "loadFetcher", "staleKey", "r", "doneFetcher", "resolveDeferredData", "redirectLocation", "_isFetchActionRedirect", "ABSOLUTE_URL_REGEX", "isBrowser", "isDifferentBasename", "redirectHistoryAction", "redirectPreserveMethodStatusCodes", "currentMatches", "fetchersToLoad", "all", "resolveDeferredResults", "markFetchersDone", "doneKeys", "landedId", "yeetedKeys", "getBlocker", "blocker", "IDLE_BLOCKER", "newBlocker", "entries", "Array", "blockerFunction", "predicate", "cancelledRouteIds", "dfd", "cancel", "enableScrollRestoration", "positions", "getPosition", "getKey", "y", "userMatches", "createUseMatchesMatch", "_internalSetRoutes", "newRoutes", "_internalFetchControllers", "_internalActiveDeferreds", "isSubmissionNavigation", "prependBasename", "contextualMatches", "activeRouteMatch", "hasNakedIndexQuery", "normalizeFormMethod", "isFetcher", "isValidMethod", "toUpperCase", "stripHashFromPath", "searchParams", "convertFormDataToSearchParams", "append", "getLoaderMatchesUntilBoundary", "boundaryId", "boundaryMatches", "findIndex", "values", "currentUrl", "nextUrl", "navigationMatches", "isNewLoader", "currentRouteMatch", "nextRouteMatch", "shouldRevalidateLoader", "currentParams", "nextParams", "defaultShouldRevalidate", "isNewRouteInstance", "fetcherMatches", "fetcherMatch", "shouldRevalidate", "currentLoaderData", "currentMatch", "isNew", "isMissingData", "currentPath", "loaderMatch", "arg", "routeChoice", "loadLazyRouteModule", "lazyRoute", "routeToUpdate", "routeUpdates", "lazyRouteProperty", "staticRouteValue", "isPropertyStaticallyDefined", "immutableRouteKeys", "isStaticRequest", "isRouteRequest", "requestContext", "resultType", "onReject", "runHandler", "handler", "reject", "abortPromise", "race", "context", "isResponse", "redirectStatusCodes", "headers", "protocol", "isSameBasename", "response", "contentType", "json", "text", "ErrorResponse", "statusCode", "isDeferredData", "deferred", "Headers", "body", "URLSearchParams", "File", "name", "processRouteLoaderData", "foundError", "loaderHeaders", "newLoaderData", "mergedLoaderData", "hasOwnProperty", "eligibleMatches", "reverse", "find", "errorMessage", "resolveData", "validRequestMethods", "validMutationMethods", "signals", "isRevalidatingLoader", "then", "unwrap", "unwrappedData", "getAll", "v", "handle", "pathMatches", "AbortedDeferredError", "DeferredData", "validMutationMethodsArr", "validRequestMethodsArr", "UNSAFE_DEFERRED_SYMBOL", "paths", "constructor", "responseInit", "pendingKeysSet", "deferredKeys", "isArray", "onAbort", "unlistenAbortSignal", "acc", "trackPromise", "promise", "onSettle", "catch", "defineProperty", "emit", "settledKey", "k", "resolve", "pendingKeys", "Response", "createElement", "Boolean", "Symbol", "useHref", "to", "relative", "useInRouterContext", "invariant", "basename", "navigator", "useContext", "NavigationContext", "hash", "pathname", "search", "useResolvedPath", "joinedPathname", "joinPaths", "createHref", "LocationContext", "useLocation", "location", "useIsomorphicLayoutEffect", "cb", "isStatic", "static", "React", "useLayoutEffect", "useNavigate", "isDataRoute", "RouteContext", "useNavigateStable", "useNavigateUnstable", "dataRouterContext", "DataRouterContext", "matches", "locationPathname", "routePathnamesJson", "JSON", "stringify", "getPathContributingMatches", "map", "match", "pathnameBase", "activeRef", "useRef", "current", "navigate", "useCallback", "options", "warning", "navigateEffectWarning", "go", "path", "resolveTo", "parse", "replace", "push", "state", "useOutlet", "context", "outlet", "useMemo", "useRoutesImpl", "routes", "locationArg", "dataRouterState", "parentMatches", "routeMatch", "length", "parentParams", "params", "parentPathname", "parentPathnameBase", "parentRoute", "route", "parentPath", "warningOnce", "endsWith", "locationFromContext", "parsedLocationArg", "parsePath", "startsWith", "remainingPathname", "slice", "matchRoutes", "element", "undefined", "Component", "renderedMatches", "_renderMatches", "Object", "assign", "encodeLocation", "_extends", "key", "navigationType", "NavigationType", "Pop", "DefaultErrorComponent", "error", "useRouteError", "message", "isRouteErrorResponse", "status", "statusText", "Error", "stack", "lightgrey", "preStyles", "padding", "backgroundColor", "codeStyles", "devInfo", "console", "fontStyle", "RenderedRoute", "routeContext", "children", "staticContext", "errorElement", "ErrorBoundary", "_deepestRenderedBoundaryId", "id", "errors", "errorIndex", "findIndex", "m", "keys", "join", "Math", "min", "reduceRight", "index", "defaultErrorElement", "concat", "getChildren", "revalidation", "getDataRouterConsoleError", "hookName", "useDataRouterContext", "ctx", "useDataRouterState", "DataRouterStateContext", "useRouteContext", "useCurrentRouteId", "thisRoute", "useRouteId", "DataRouterStateHook", "UseRouteId", "useNavigation", "UseNavigation", "navigation", "useMatches", "loaderData", "UseMatches", "data", "handle", "RouteErrorContext", "UseRouteError", "routeId", "useAsyncValue", "value", "AwaitContext", "_data", "useAsyncError", "_error", "router", "DataRouterHook", "UseNavigateStable", "fromRouteId", "cond", "alreadyWarned", "RouterProvider", "fallbackElement", "setState", "useState", "subscribe", "n", "opts", "preventScrollReset", "historyAction", "initialized", "DataRoutes", "Outlet", "props", "Router", "basenameProp", "locationProp", "staticProp", "navigationContext", "locationContext", "trailingPathname", "stripBasename", "Await", "resolve", "ResolveAwait", "toRender", "mapRouteProperties", "updates", "hasErrorBoundary", "createElement", "OutletContext", "RenderErrorBoundary", "AwaitRenderStatus", "neverSettledPromise", "AwaitErrorBoundary", "createContext", "displayName", "constructor", "getDerivedStateFromError", "getDerivedStateFromProps", "componentDidCatch", "errorInfo", "render", "component", "Promise", "promise", "pending", "success", "defineProperty", "get", "renderError", "reject", "catch", "_tracked", "then", "AbortedDeferredError", "isHtmlElement", "object", "tagName", "isButtonElement", "toLowerCase", "isFormElement", "isInputElement", "isModifiedEvent", "event", "metaKey", "altKey", "ctrlKey", "shiftKey", "shouldProcessLinkClick", "target", "button", "getFormSubmissionInfo", "options", "basename", "method", "action", "encType", "formData", "submissionTrigger", "attr", "getAttribute", "stripBasename", "defaultMethod", "defaultEncType", "FormData", "name", "append", "value", "type", "form", "Error", "URLSearchParams", "Object", "keys", "createBrowserRouter", "routes", "opts", "createRouter", "future", "v7_prependBasename", "history", "createBrowserHistory", "window", "hydrationData", "parseHydrationData", "mapRouteProperties", "initialize", "state", "__staticRouterHydrationData", "errors", "_extends", "deserializeErrors", "entries", "serialized", "key", "val", "__type", "ErrorResponse", "status", "statusText", "data", "internal", "error", "message", "stack", "HistoryRouter", "children", "setState", "useState", "location", "React", "useLayoutEffect", "listen", "createElement", "Router", "navigationType", "navigator", "ScrollRestoration", "getKey", "storageKey", "useScrollRestoration", "getDataRouterConsoleError", "hookName", "useDataRouterContext", "ctx", "useContext", "DataRouterContext", "invariant", "useDataRouterState", "DataRouterStateContext", "useLinkClickHandler", "to", "replace", "replaceProp", "preventScrollReset", "relative", "navigate", "useNavigate", "useLocation", "path", "useResolvedPath", "useCallback", "preventDefault", "undefined", "createPath", "useSubmitImpl", "fetcherKey", "fetcherRouteId", "router", "DataRouterHook", "UseSubmitImpl", "NavigationContext", "currentRouteId", "useRouteId", "document", "formMethod", "formEncType", "fetch", "fromRouteId", "useFormAction", "routeContext", "RouteContext", "match", "matches", "slice", "search", "hash", "route", "index", "params", "delete", "toString", "pathname", "joinPaths", "UseScrollRestoration", "restoreScrollPosition", "DataRouterStateHook", "useMatches", "navigation", "useNavigation", "useEffect", "scrollRestoration", "usePageHide", "savedScrollPositions", "scrollY", "sessionStorage", "setItem", "SCROLL_RESTORATION_STORAGE_KEY", "JSON", "stringify", "sessionPositions", "getItem", "parse", "e", "disableScrollRestoration", "enableScrollRestoration", "scrollTo", "el", "getElementById", "scrollIntoView", "callback", "capture", "addEventListener", "removeEventListener", "isBrowser", "ABSOLUTE_URL_REGEX", "Link", "NavLink", "Form", "FormImpl", "displayName", "forwardRef", "LinkWithRef", "ref", "onClick", "reloadDocument", "rest", "absoluteHref", "isExternal", "test", "currentUrl", "URL", "href", "targetUrl", "startsWith", "protocol", "origin", "warning", "useHref", "internalOnClick", "handleClick", "defaultPrevented", "NavLinkWithRef", "ariaCurrentProp", "caseSensitive", "className", "classNameProp", "end", "style", "styleProp", "routerState", "toPathname", "encodeLocation", "locationPathname", "nextLocationPathname", "isActive", "charAt", "length", "isPending", "ariaCurrent", "filter", "Boolean", "join", "props", "forwardedRef", "onSubmit", "routeId", "submit", "formAction", "submitHandler", "submitter", "nativeEvent", "submitMethod", "currentTarget", "React", "init_dist", "_extends", "React", "init_dist", "init_dist", "React__default", "Component", "invariant", "init_dist", "alreadyWarned", "useDataRouterContext", "invariant", "Component", "ABSOLUTE_URL_REGEX", "NavLink", "_extends", "Link", "_extends", "React", "router", "useDataRouterContext", "json", "Await", "matches", "invariant", "dedupe", "useMatches", "LiveReload", "deserializeErrors", "React", "init_dist", "value", "invariant", "deserializeErrors", "init_dist", "React", "init_dist", "ScrollRestoration", "useMatches", "STORAGE_KEY", "key", "_extends"]-}diff --git a/tsconfig.json b/tsconfig.jsonindex 20f8a386a..ce7c7d609 100644--- a/tsconfig.json+++ b/tsconfig.json@@ -13,7 +13,7 @@"forceConsistentCasingInFileNames": true,"baseUrl": ".","paths": {- "~/*": ["./app/*"]+ "~/*": ["./app/*"],},// Remix takes care of building everything in `remix build`.