@dr.pogodin/react-utils 1.41.4 → 1.41.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/development/client/index.js +7 -8
- package/build/development/client/index.js.map +1 -1
- package/build/development/server/renderer.js +34 -29
- package/build/development/server/renderer.js.map +1 -1
- package/build/development/shared/components/GenericLink/index.js +2 -1
- package/build/development/shared/components/GenericLink/index.js.map +1 -1
- package/build/development/shared/components/Link.js +2 -2
- package/build/development/shared/components/Link.js.map +1 -1
- package/build/development/shared/components/MetaTags.js +2 -2
- package/build/development/shared/components/MetaTags.js.map +1 -1
- package/build/development/shared/components/NavLink.js +2 -2
- package/build/development/shared/components/NavLink.js.map +1 -1
- package/build/development/shared/utils/jest/E2eSsrEnv.js +16 -0
- package/build/development/shared/utils/jest/E2eSsrEnv.js.map +1 -1
- package/build/development/web.bundle.js +140 -23
- package/build/production/client/index.js +2 -2
- package/build/production/client/index.js.map +1 -1
- package/build/production/server/renderer.js +4 -5
- package/build/production/server/renderer.js.map +1 -1
- package/build/production/shared/components/GenericLink/index.js +1 -1
- package/build/production/shared/components/GenericLink/index.js.map +1 -1
- package/build/production/shared/components/Link.js +2 -2
- package/build/production/shared/components/Link.js.map +1 -1
- package/build/production/shared/components/MetaTags.js +2 -2
- package/build/production/shared/components/MetaTags.js.map +1 -1
- package/build/production/shared/components/NavLink.js +1 -1
- package/build/production/shared/components/NavLink.js.map +1 -1
- package/build/production/shared/utils/jest/E2eSsrEnv.js +14 -2
- package/build/production/shared/utils/jest/E2eSsrEnv.js.map +1 -1
- package/build/production/web.bundle.js +1 -1
- package/build/production/web.bundle.js.map +1 -1
- package/build/types-code/shared/components/GenericLink/index.d.ts +1 -1
- package/build/types-code/shared/components/Link.d.ts +1 -1
- package/build/types-code/shared/components/NavLink.d.ts +1 -1
- package/config/jest/resolver.js +5 -3
- package/config/jest/setup.js +11 -1
- package/package.json +19 -20
- package/src/client/index.tsx +7 -10
- package/src/server/renderer.tsx +33 -38
- package/src/shared/components/GenericLink/index.tsx +2 -1
- package/src/shared/components/Link.tsx +1 -1
- package/src/shared/components/MetaTags.tsx +1 -1
- package/src/shared/components/NavLink.tsx +1 -1
- package/src/shared/utils/jest/E2eSsrEnv.ts +18 -0
|
@@ -8,16 +8,15 @@
|
|
|
8
8
|
*/
|
|
9
9
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
10
10
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
11
|
-
module.exports = factory(require("@dr.pogodin/js-utils"), require("@dr.pogodin/react-global-state"), require("@dr.pogodin/react-themes"), require("cookie"), require("dayjs"), require("node-forge/lib/aes"), require("node-forge/lib/forge"), require("qs"), require("react"), require("react-dom"), require("react-dom/client")
|
|
11
|
+
module.exports = factory(require("@dr.pogodin/js-utils"), require("@dr.pogodin/react-global-state"), require("@dr.pogodin/react-themes"), require("cookie"), require("dayjs"), require("node-forge/lib/aes"), require("node-forge/lib/forge"), require("qs"), require("react"), require("react-dom"), require("react-dom/client"));
|
|
12
12
|
else if(typeof define === 'function' && define.amd)
|
|
13
|
-
define(["@dr.pogodin/js-utils", "@dr.pogodin/react-global-state", "@dr.pogodin/react-themes", "cookie", "dayjs", "node-forge/lib/aes", "node-forge/lib/forge", "qs", "react", "react-dom", "react-dom/client"
|
|
13
|
+
define(["@dr.pogodin/js-utils", "@dr.pogodin/react-global-state", "@dr.pogodin/react-themes", "cookie", "dayjs", "node-forge/lib/aes", "node-forge/lib/forge", "qs", "react", "react-dom", "react-dom/client"], factory);
|
|
14
14
|
else if(typeof exports === 'object')
|
|
15
|
-
exports["@dr.pogodin/react-utils"] = factory(require("@dr.pogodin/js-utils"), require("@dr.pogodin/react-global-state"), require("@dr.pogodin/react-themes"), require("cookie"), require("dayjs"), require("node-forge/lib/aes"), require("node-forge/lib/forge"), require("qs"), require("react"), require("react-dom"), require("react-dom/client")
|
|
15
|
+
exports["@dr.pogodin/react-utils"] = factory(require("@dr.pogodin/js-utils"), require("@dr.pogodin/react-global-state"), require("@dr.pogodin/react-themes"), require("cookie"), require("dayjs"), require("node-forge/lib/aes"), require("node-forge/lib/forge"), require("qs"), require("react"), require("react-dom"), require("react-dom/client"));
|
|
16
16
|
else
|
|
17
|
-
root["@dr.pogodin/react-utils"] = factory(root["@dr.pogodin/js-utils"], root["@dr.pogodin/react-global-state"], root["@dr.pogodin/react-themes"], root["cookie"], root["dayjs"], root["node-forge/lib/aes"], root["node-forge/lib/forge"], root["qs"], root["react"], root["react-dom"], root["react-dom/client"]
|
|
18
|
-
})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE__dr_pogodin_js_utils__, __WEBPACK_EXTERNAL_MODULE__dr_pogodin_react_global_state__, __WEBPACK_EXTERNAL_MODULE__dr_pogodin_react_themes__, __WEBPACK_EXTERNAL_MODULE_cookie__, __WEBPACK_EXTERNAL_MODULE_dayjs__, __WEBPACK_EXTERNAL_MODULE_node_forge_lib_aes__, __WEBPACK_EXTERNAL_MODULE_node_forge_lib_forge__, __WEBPACK_EXTERNAL_MODULE_qs__, __WEBPACK_EXTERNAL_MODULE_react__, __WEBPACK_EXTERNAL_MODULE_react_dom__, __WEBPACK_EXTERNAL_MODULE_react_dom_client__
|
|
17
|
+
root["@dr.pogodin/react-utils"] = factory(root["@dr.pogodin/js-utils"], root["@dr.pogodin/react-global-state"], root["@dr.pogodin/react-themes"], root["cookie"], root["dayjs"], root["node-forge/lib/aes"], root["node-forge/lib/forge"], root["qs"], root["react"], root["react-dom"], root["react-dom/client"]);
|
|
18
|
+
})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE__dr_pogodin_js_utils__, __WEBPACK_EXTERNAL_MODULE__dr_pogodin_react_global_state__, __WEBPACK_EXTERNAL_MODULE__dr_pogodin_react_themes__, __WEBPACK_EXTERNAL_MODULE_cookie__, __WEBPACK_EXTERNAL_MODULE_dayjs__, __WEBPACK_EXTERNAL_MODULE_node_forge_lib_aes__, __WEBPACK_EXTERNAL_MODULE_node_forge_lib_forge__, __WEBPACK_EXTERNAL_MODULE_qs__, __WEBPACK_EXTERNAL_MODULE_react__, __WEBPACK_EXTERNAL_MODULE_react_dom__, __WEBPACK_EXTERNAL_MODULE_react_dom_client__) {
|
|
19
19
|
return /******/ (function() { // webpackBootstrap
|
|
20
|
-
/******/ "use strict";
|
|
21
20
|
/******/ var __webpack_modules__ = ({
|
|
22
21
|
|
|
23
22
|
/***/ "./src/client/getInj.ts":
|
|
@@ -26,6 +25,7 @@ return /******/ (function() { // webpackBootstrap
|
|
|
26
25
|
\******************************/
|
|
27
26
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
28
27
|
|
|
28
|
+
"use strict";
|
|
29
29
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": function() { return /* binding */ getInj; }\n/* harmony export */ });\n/* harmony import */ var node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node-forge/lib/forge */ \"node-forge/lib/forge\");\n/* harmony import */ var node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var node_forge_lib_aes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! node-forge/lib/aes */ \"node-forge/lib/aes\");\n/* harmony import */ var node_forge_lib_aes__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(node_forge_lib_aes__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _shared_utils_isomorphy_buildInfo__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../shared/utils/isomorphy/buildInfo */ \"./src/shared/utils/isomorphy/buildInfo.ts\");\n// Encapsulates retrieval of server-side data injection into HTML template.\n\n/* global document */\n\n// Note: this way, only required part of \"node-forge\": AES, and some utils,\n// is bundled into client-side code.\n\n\n\n\n// Safeguard is needed here, because the server-side version of Docusaurus docs\n// is compiled (at least now) with settings suggesting it is a client-side\n// environment, but there is no document.\nlet inj = {};\nconst metaElement = typeof document !== 'undefined' ? document.querySelector('meta[itemprop=\"drpruinj\"]') : null;\nif (metaElement) {\n metaElement.remove();\n let data = node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0___default().util.decode64(metaElement.content);\n const {\n key\n } = (0,_shared_utils_isomorphy_buildInfo__WEBPACK_IMPORTED_MODULE_2__.getBuildInfo)();\n const d = node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0___default().cipher.createDecipher('AES-CBC', key);\n d.start({\n iv: data.slice(0, key.length)\n });\n d.update(node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0___default().util.createBuffer(data.slice(key.length)));\n d.finish();\n data = node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0___default().util.decodeUtf8(d.output.data);\n inj = eval(`(${data})`); // eslint-disable-line no-eval\n} else if (typeof window !== 'undefined' && window.REACT_UTILS_INJECTION) {\n inj = window.REACT_UTILS_INJECTION;\n delete window.REACT_UTILS_INJECTION;\n} else {\n // Otherwise, a bunch of dependent stuff will easily fail in non-standard\n // environments, where no client-side initialization is performed. Like tests,\n // Docusaurus examples, etc.\n inj = {};\n}\nfunction getInj() {\n return inj;\n}\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/client/getInj.ts?");
|
|
30
30
|
|
|
31
31
|
/***/ }),
|
|
@@ -36,7 +36,8 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
36
36
|
\******************************/
|
|
37
37
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
"use strict";
|
|
40
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": function() { return /* binding */ Launch; }\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_dom_client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom/client */ \"react-dom/client\");\n/* harmony import */ var react_dom_client__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom_client__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react_helmet_async__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react-helmet-async */ \"./node_modules/react-helmet-async/lib/index.esm.js\");\n/* harmony import */ var react_router__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-router */ \"./node_modules/react-router/dist/development/chunk-V7UHCZHK.mjs\");\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @dr.pogodin/react-global-state */ \"@dr.pogodin/react-global-state\");\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _getInj__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getInj */ \"./src/client/getInj.ts\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n// Initialization of client-side code.\n/* global document */\n\n\n\n\n\n\n\n\n/**\n * Prepares and launches the app at client side.\n * @param Application Root application component\n * @param [options={}] Optional. Additional settings.\n */\nfunction Launch(Application) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const container = document.getElementById('react-view');\n if (!container) throw Error('Failed to find container for React app');\n const scene = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2__.GlobalStateProvider, {\n initialState: (0,_getInj__WEBPACK_IMPORTED_MODULE_3__[\"default\"])().ISTATE || options.initialState,\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_router__WEBPACK_IMPORTED_MODULE_5__.BrowserRouter, {\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_helmet_async__WEBPACK_IMPORTED_MODULE_6__.HelmetProvider, {\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(Application, {})\n })\n })\n });\n if (options.dontHydrate) {\n const root = (0,react_dom_client__WEBPACK_IMPORTED_MODULE_1__.createRoot)(container);\n root.render(scene);\n } else (0,react_dom_client__WEBPACK_IMPORTED_MODULE_1__.hydrateRoot)(container, scene);\n}\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/client/index.tsx?");
|
|
40
41
|
|
|
41
42
|
/***/ }),
|
|
42
43
|
|
|
@@ -46,6 +47,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
46
47
|
\**********************/
|
|
47
48
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
48
49
|
|
|
50
|
+
"use strict";
|
|
49
51
|
eval("var __dirname = \"/\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Barrier: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.Barrier; },\n/* harmony export */ BaseButton: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.BaseButton; },\n/* harmony export */ BaseModal: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.BaseModal; },\n/* harmony export */ Button: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.Button; },\n/* harmony export */ Checkbox: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.Checkbox; },\n/* harmony export */ CustomDropdown: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.CustomDropdown; },\n/* harmony export */ Dropdown: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.Dropdown; },\n/* harmony export */ Emitter: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.Emitter; },\n/* harmony export */ GlobalStateProvider: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2__.GlobalStateProvider; },\n/* harmony export */ Input: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.Input; },\n/* harmony export */ Link: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.Link; },\n/* harmony export */ MetaTags: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.MetaTags; },\n/* harmony export */ Modal: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.Modal; },\n/* harmony export */ NavLink: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.NavLink; },\n/* harmony export */ PageLayout: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.PageLayout; },\n/* harmony export */ Semaphore: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.Semaphore; },\n/* harmony export */ Switch: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.Switch; },\n/* harmony export */ TextArea: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.TextArea; },\n/* harmony export */ ThemeProvider: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.ThemeProvider; },\n/* harmony export */ Throbber: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.Throbber; },\n/* harmony export */ WithTooltip: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.WithTooltip; },\n/* harmony export */ YouTubeVideo: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.YouTubeVideo; },\n/* harmony export */ client: function() { return /* binding */ client; },\n/* harmony export */ config: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.config; },\n/* harmony export */ getGlobalState: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2__.getGlobalState; },\n/* harmony export */ getSsrContext: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.getSsrContext; },\n/* harmony export */ isomorphy: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.isomorphy; },\n/* harmony export */ newAsyncDataEnvelope: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2__.newAsyncDataEnvelope; },\n/* harmony export */ server: function() { return /* binding */ server; },\n/* harmony export */ splitComponent: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.splitComponent; },\n/* harmony export */ themed: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.themed; },\n/* harmony export */ time: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.time; },\n/* harmony export */ useAsyncCollection: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2__.useAsyncCollection; },\n/* harmony export */ useAsyncData: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2__.useAsyncData; },\n/* harmony export */ useGlobalState: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2__.useGlobalState; },\n/* harmony export */ webpack: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.webpack; },\n/* harmony export */ withGlobalStateType: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2__.withGlobalStateType; },\n/* harmony export */ withRetries: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.withRetries; }\n/* harmony export */ });\n/* harmony import */ var _styles_global_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./styles/global.scss */ \"./src/styles/global.scss\");\n/* harmony import */ var _shared_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shared/utils */ \"./src/shared/utils/index.ts\");\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @dr.pogodin/react-global-state */ \"@dr.pogodin/react-global-state\");\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _shared_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shared/components */ \"./src/shared/components/index.ts\");\n\n\nconst server = _shared_utils__WEBPACK_IMPORTED_MODULE_1__.webpack.requireWeak('./server', __dirname);\nconst client = server ? undefined : (__webpack_require__(/*! ./client */ \"./src/client/index.tsx\")[\"default\"]);\n\n\n\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/index.ts?");
|
|
50
52
|
|
|
51
53
|
/***/ }),
|
|
@@ -56,6 +58,7 @@ eval("var __dirname = \"/\";\n__webpack_require__.r(__webpack_exports__);\n/* ha
|
|
|
56
58
|
\************************************************/
|
|
57
59
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
58
60
|
|
|
61
|
+
"use strict";
|
|
59
62
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BaseButton: function() { return /* binding */ BaseButton; }\n/* harmony export */ });\n/* harmony import */ var _Link__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Link */ \"./src/shared/components/Link.tsx\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style.scss */ \"./src/shared/components/Button/style.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n// The <Button> component implements a standard button / button-like link.\n\n\n\n\n\n/* eslint-disable react/function-component-definition */\nconst BaseButton = _ref => {\n let {\n active,\n children,\n disabled,\n enforceA,\n onClick,\n onMouseDown,\n onPointerDown,\n openNewTab,\n replace,\n testId,\n theme,\n to\n } = _ref;\n let className = theme.button;\n if (active && theme.active) className += ` ${theme.active}`;\n if (disabled) {\n if (theme.disabled) className += ` ${theme.disabled}`;\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"div\", {\n className: className,\n \"data-testid\": false ? 0 : testId,\n children: children\n });\n }\n if (to) {\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_Link__WEBPACK_IMPORTED_MODULE_0__[\"default\"], {\n className: className,\n \"data-testid\": false ? 0 : testId,\n enforceA: enforceA,\n onClick: onClick,\n onMouseDown: onMouseDown,\n onPointerDown: onPointerDown,\n openNewTab: openNewTab,\n replace: replace,\n to: to,\n children: children\n });\n }\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"div\", {\n className: className,\n \"data-testid\": false ? 0 : testId,\n onClick: onClick,\n onKeyDown: onClick && (e => {\n if (e.key === 'Enter') onClick(e);\n }),\n onMouseDown: onMouseDown,\n onPointerDown: onPointerDown,\n role: \"button\",\n tabIndex: 0,\n children: children\n });\n};\n\n/**\n * Button component theme: a map of CSS\n * class names to append to button elements:\n * @prop {string} [active] to the root element of active button.\n * @prop {string} [button] to the root element of any button.\n * @prop {string} [disabled] to the root element of disabled button.\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1___default()(BaseButton, 'Button', _style_scss__WEBPACK_IMPORTED_MODULE_2__[\"default\"]));\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/Button/index.tsx?");
|
|
60
63
|
|
|
61
64
|
/***/ }),
|
|
@@ -66,6 +69,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
66
69
|
\**************************************************/
|
|
67
70
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
68
71
|
|
|
72
|
+
"use strict";
|
|
69
73
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _theme_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme.scss */ \"./src/shared/components/Checkbox/theme.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\nconst Checkbox = _ref => {\n let {\n checked,\n disabled,\n label,\n onChange,\n testId,\n theme\n } = _ref;\n let containerClassName = theme.container;\n if (disabled) containerClassName += ` ${theme.disabled}`;\n let checkboxClassName = theme.checkbox;\n if (checked === 'indeterminate') checkboxClassName += ` ${theme.indeterminate}`;\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(\"div\", {\n className: containerClassName,\n children: [label === undefined ? null : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"div\", {\n className: theme.label,\n children: label\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"input\", {\n checked: checked === undefined ? undefined : checked === true,\n className: checkboxClassName,\n \"data-testid\": false ? 0 : testId,\n disabled: disabled,\n onChange: onChange,\n onClick: e => e.stopPropagation(),\n type: \"checkbox\"\n })]\n });\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default()(Checkbox, 'Checkbox', _theme_scss__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/Checkbox/index.tsx?");
|
|
70
74
|
|
|
71
75
|
/***/ }),
|
|
@@ -76,7 +80,8 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dr_
|
|
|
76
80
|
\*****************************************************/
|
|
77
81
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
78
82
|
|
|
79
|
-
|
|
83
|
+
"use strict";
|
|
84
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./style.scss */ \"./src/shared/components/GenericLink/style.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n/**\n * The `<Link>` component, and almost identical `<NavLink>` component, are\n * auxiliary wrappers around\n * [React Router](https://github.com/ReactTraining/react-router)'s\n * `<Link>` and `<NavLink>` components; they help to handle external and\n * internal links in uniform manner.\n *\n * @param [props] Component properties.\n * @param [props.className] CSS classes to apply to the link.\n * @param [props.disabled] Disables the link.\n * @param [props.enforceA] `true` enforces rendering of the link as\n * a simple `<a>` element.\n * @param [props.keepScrollPosition] If `true`, and the link is\n * rendered as a React Router's component, it won't reset the viewport scrolling\n * position to the origin when clicked.\n * @param [props.onClick] Event handler to trigger upon click.\n * @param [props.onMouseDown] Event handler to trigger on MouseDown\n * event.\n * @param [props.openNewTab] If `true` the link opens in a new tab.\n * @param [props.replace] When `true`, the link will replace current\n * entry in the history stack instead of adding a new one.\n * @param [props.to] Link URL.\n * @param [props.activeClassName] **`<NavLink>`** only: CSS class(es)\n * to apply to rendered link when it is active.\n * @param [props.activeStyle] **`<NavLink>`** only: CSS styles\n * to apply to the rendered link when it is active.\n * @param [props.exact] **`<NavLink>`** only: if `true`, the active\n * class/style will only be applied if the location is matched exactly.\n * @param [props.isActive] **`<NavLink>`** only: Add extra\n * logic for determining whether the link is active. This should be used if you\n * want to do more than verify that the link’s pathname matches the current URL\n * pathname.\n * @param [props.location] **`<NavLink>`** only: `isActive` compares\n * current history location (usually the current browser URL). To compare to\n * a different location, a custom `location` can be passed.\n * @param [props.strict] **`<NavLink>`** only: . When `true`, trailing\n * slash on a location’s pathname will be taken into consideration when\n * determining if the location matches the current URL. See the `<Route strict>`\n * documentation for more information.\n */\nconst GenericLink = _ref => {\n let {\n children,\n className,\n disabled,\n enforceA,\n keepScrollPosition,\n onClick,\n onMouseDown,\n openNewTab,\n replace,\n routerLinkType,\n to,\n ...rest\n } = _ref;\n /* Renders Link as <a> element if:\n * - It is opted explicitely by `enforceA` prop;\n * - It should be opened in a new tab;\n * - It is an absolte URL (starts with http:// or https://);\n * - It is anchor link (starts with #). */\n if (disabled || enforceA || openNewTab || to !== null && to !== void 0 && to.match(/^(#|(https?|mailto):)/)) {\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(\"a\", {\n className: (className ? className + \" \" : \"\") + \"-dr-pogodin-react-utils___src-shared-components-GenericLink-style___link___zH52sA\"\n // TODO: This requires a fix: disabled is not really an attribute of <a>\n // tag, thus for disabled option we rather should render a plain text\n // styled as a link.\n // disabled={disabled}\n ,\n href: to,\n onClick: disabled ? e => e.preventDefault() : onClick,\n onMouseDown: disabled ? e => e.preventDefault() : onMouseDown,\n rel: \"noopener noreferrer\",\n target: openNewTab ? '_blank' : '',\n children: children\n });\n }\n const L = routerLinkType;\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(L, {\n className: className,\n discover: \"none\"\n // disabled\n ,\n onMouseDown: onMouseDown,\n replace: replace,\n to: to,\n onClick: e => {\n // Executes the user-provided event handler, if any.\n if (onClick) onClick(e);\n\n // By default, clicking the link scrolls the page to beginning.\n if (!keepScrollPosition) window.scroll(0, 0);\n },\n ...rest,\n children: children\n });\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (GenericLink);\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/GenericLink/index.tsx?");
|
|
80
85
|
|
|
81
86
|
/***/ }),
|
|
82
87
|
|
|
@@ -86,6 +91,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _sty
|
|
|
86
91
|
\***********************************************/
|
|
87
92
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
88
93
|
|
|
94
|
+
"use strict";
|
|
89
95
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _theme_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme.scss */ \"./src/shared/components/Input/theme.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\n/**\n * Themeable input field, based on the standard HTML `<input>` element.\n * @param [props.label] Input label.\n * @param [props.theme] _Ad hoc_ theme.\n * @param [props...] [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)\n * @param [props...] Any other properties are passed to the underlying\n * `<input>` element.\n */\nconst Input = _ref => {\n let {\n label,\n ref,\n testId,\n theme,\n ...rest\n } = _ref;\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(\"span\", {\n className: theme.container,\n children: [label === undefined ? null : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"div\", {\n className: theme.label,\n children: label\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"input\", {\n className: theme.input,\n \"data-testid\": false ? 0 : testId,\n ref: ref,\n ...rest\n })]\n });\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default()(Input, 'Input', _theme_scss__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/Input/index.tsx?");
|
|
90
96
|
|
|
91
97
|
/***/ }),
|
|
@@ -96,7 +102,8 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dr_
|
|
|
96
102
|
\****************************************/
|
|
97
103
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
98
104
|
|
|
99
|
-
|
|
105
|
+
"use strict";
|
|
106
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-router */ \"./node_modules/react-router/dist/development/chunk-V7UHCZHK.mjs\");\n/* harmony import */ var _GenericLink__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./GenericLink */ \"./src/shared/components/GenericLink/index.tsx\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n/**\n * The Link wraps around React Router's Link component, to automatically replace\n * it by the regular <a> element when:\n * - The target reference points to another domain;\n * - User opts to open the reference in a new tab;\n * - User explicitely opts to use <a>.\n */\n\n\n\n\nconst Link = props =>\n/*#__PURE__*/\n/* eslint-disable react/jsx-props-no-spreading */\n(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_GenericLink__WEBPACK_IMPORTED_MODULE_0__[\"default\"], {\n ...props,\n routerLinkType: react_router__WEBPACK_IMPORTED_MODULE_2__.Link\n})\n/* eslint-enable react/jsx-props-no-spreading */;\n/* harmony default export */ __webpack_exports__[\"default\"] = (Link);\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/Link.tsx?");
|
|
100
107
|
|
|
101
108
|
/***/ }),
|
|
102
109
|
|
|
@@ -106,7 +113,8 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var reac
|
|
|
106
113
|
\********************************************/
|
|
107
114
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
108
115
|
|
|
109
|
-
|
|
116
|
+
"use strict";
|
|
117
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_helmet_async__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-helmet-async */ \"./node_modules/react-helmet-async/lib/index.esm.js\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\nconst Context = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)({\n description: '',\n title: ''\n});\n\n/**\n * Auxiliary wrapper around \"react-helmet\", which helps to inject meta tags\n * (page title, a brief content description, and social media thumbnails) into\n * generated pages.\n */\nconst MetaTags = _ref => {\n let {\n children,\n description,\n extraMetaTags,\n image,\n siteName,\n socialDescription,\n socialTitle,\n title,\n url\n } = _ref;\n const socTitle = socialTitle || title;\n const socDesc = socialDescription || description;\n const context = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({\n description,\n image,\n siteName,\n socialDescription,\n socialTitle,\n title,\n url\n }), [description, image, siteName, socialDescription, socialTitle, title, url]);\n const extra = [];\n if (extraMetaTags !== null && extraMetaTags !== void 0 && extraMetaTags.length) {\n for (let i = 0; i < extraMetaTags.length; ++i) {\n const {\n content,\n name\n } = extraMetaTags[i];\n extra.push(/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(\"meta\", {\n content: content,\n name: name\n }, `extra-meta-tag-${i}`));\n }\n }\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.Fragment, {\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(react_helmet_async__WEBPACK_IMPORTED_MODULE_2__.Helmet, {\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(\"title\", {\n children: title\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(\"meta\", {\n name: \"description\",\n content: description\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(\"meta\", {\n name: \"twitter:card\",\n content: \"summary_large_image\"\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(\"meta\", {\n name: \"twitter:title\",\n content: socTitle\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(\"meta\", {\n name: \"twitter:description\",\n content: socDesc\n }), image ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(\"meta\", {\n name: \"twitter:image\",\n content: image\n }) : null, siteName ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(\"meta\", {\n name: \"twitter:site\",\n content: `@${siteName}`\n }) : null, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(\"meta\", {\n name: \"og:title\",\n content: socTitle\n }), image ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(\"meta\", {\n name: \"og:image\",\n content: image\n }) : null, image ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(\"meta\", {\n name: \"og:image:alt\",\n content: socTitle\n }) : null, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(\"meta\", {\n name: \"og:description\",\n content: socDesc\n }), siteName ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(\"meta\", {\n name: \"og:sitename\",\n content: siteName\n }) : null, url ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(\"meta\", {\n name: \"og:url\",\n content: url\n }) : null, extra]\n }), children ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Context.Provider, {\n value: context,\n children: children\n }) : null]\n });\n};\nMetaTags.Context = Context;\n/* harmony default export */ __webpack_exports__[\"default\"] = (MetaTags);\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/MetaTags.tsx?");
|
|
110
118
|
|
|
111
119
|
/***/ }),
|
|
112
120
|
|
|
@@ -116,6 +124,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var reac
|
|
|
116
124
|
\***********************************************/
|
|
117
125
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
118
126
|
|
|
127
|
+
"use strict";
|
|
119
128
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BaseModal: function() { return /* binding */ BaseModal; }\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ \"react-dom\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _base_theme_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./base-theme.scss */ \"./src/shared/components/Modal/base-theme.scss\");\n/* harmony import */ var _styles_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./styles.scss */ \"./src/shared/components/Modal/styles.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n/* global document */\n\n\n\n\n\n\n\n/**\n * The `<Modal>` component implements a simple themeable modal window, wrapped\n * into the default theme. `<BaseModal>` exposes the base non-themed component.\n * **Children:** Component children are rendered as the modal content.\n * @param {object} props Component properties. Beside props documented below,\n * [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties) are supported as well.\n * @param {function} [props.onCancel] The callback to trigger when user\n * clicks outside the modal, or presses Escape. It is expected to hide the\n * modal.\n * @param {ModalTheme} [props.theme] _Ad hoc_ theme.\n */\nconst BaseModal = _ref => {\n let {\n cancelOnScrolling,\n children,\n containerStyle,\n dontDisableScrolling,\n onCancel,\n style,\n testId,\n testIdForOverlay,\n theme\n } = _ref;\n const containerRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);\n const overlayRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);\n const [portal, setPortal] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {\n const p = document.createElement('div');\n document.body.appendChild(p);\n setPortal(p);\n return () => {\n document.body.removeChild(p);\n };\n }, []);\n\n // Sets up modal cancellation of scrolling, if opted-in.\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {\n if (cancelOnScrolling && onCancel) {\n window.addEventListener('scroll', onCancel);\n window.addEventListener('wheel', onCancel);\n }\n return () => {\n if (cancelOnScrolling && onCancel) {\n window.removeEventListener('scroll', onCancel);\n window.removeEventListener('wheel', onCancel);\n }\n };\n }, [cancelOnScrolling, onCancel]);\n\n // Disables window scrolling, if it is not opted-out.\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {\n if (!dontDisableScrolling) {\n document.body.classList.add(_styles_scss__WEBPACK_IMPORTED_MODULE_4__[\"default\"].scrollingDisabledByModal);\n }\n return () => {\n if (!dontDisableScrolling) {\n document.body.classList.remove(_styles_scss__WEBPACK_IMPORTED_MODULE_4__[\"default\"].scrollingDisabledByModal);\n }\n };\n }, [dontDisableScrolling]);\n const focusLast = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"div\", {\n onFocus: () => {\n var _containerRef$current, _overlayRef$current;\n const elems = (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.querySelectorAll('*');\n for (let i = elems.length - 1; i >= 0; --i) {\n var _elems$i;\n (_elems$i = elems[i]) === null || _elems$i === void 0 || _elems$i.focus();\n if (document.activeElement === elems[i]) return;\n }\n (_overlayRef$current = overlayRef.current) === null || _overlayRef$current === void 0 || _overlayRef$current.focus();\n }\n /* eslint-disable jsx-a11y/no-noninteractive-tabindex */,\n tabIndex: 0\n /* eslint-enable jsx-a11y/no-noninteractive-tabindex */\n }), []);\n return portal ? /*#__PURE__*/react_dom__WEBPACK_IMPORTED_MODULE_1___default().createPortal(/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, {\n children: [focusLast, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"div\", {\n \"aria-label\": \"Cancel\",\n className: theme.overlay,\n \"data-testid\": false ? 0 : testIdForOverlay,\n onClick: e => {\n if (onCancel) {\n onCancel();\n e.stopPropagation();\n }\n },\n onKeyDown: e => {\n if (e.key === 'Escape' && onCancel) {\n onCancel();\n e.stopPropagation();\n }\n },\n ref: node => {\n if (node && node !== overlayRef.current) {\n overlayRef.current = node;\n node.focus();\n }\n },\n role: \"button\",\n tabIndex: 0\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"div\", {\n \"aria-modal\": \"true\",\n className: theme.container,\n \"data-testid\": false ? 0 : testId,\n onClick: e => e.stopPropagation(),\n onWheel: event => event.stopPropagation(),\n ref: containerRef,\n role: \"dialog\",\n style: style !== null && style !== void 0 ? style : containerStyle,\n children: children\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"div\", {\n onFocus: () => {\n var _overlayRef$current2;\n (_overlayRef$current2 = overlayRef.current) === null || _overlayRef$current2 === void 0 || _overlayRef$current2.focus();\n }\n /* eslint-disable jsx-a11y/no-noninteractive-tabindex */,\n tabIndex: 0\n /* eslint-enable jsx-a11y/no-noninteractive-tabindex */\n }), focusLast]\n }), portal) : null;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2___default()(BaseModal, 'Modal', _base_theme_scss__WEBPACK_IMPORTED_MODULE_3__[\"default\"]));\n\n/* Non-themed version of the Modal. */\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/Modal/index.tsx?");
|
|
120
129
|
|
|
121
130
|
/***/ }),
|
|
@@ -126,7 +135,8 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
126
135
|
\*******************************************/
|
|
127
136
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
128
137
|
|
|
129
|
-
|
|
138
|
+
"use strict";
|
|
139
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-router */ \"./node_modules/react-router/dist/development/chunk-V7UHCZHK.mjs\");\n/* harmony import */ var _GenericLink__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./GenericLink */ \"./src/shared/components/GenericLink/index.tsx\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\nconst NavLink = props =>\n/*#__PURE__*/\n/* eslint-disable react/jsx-props-no-spreading */\n(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_GenericLink__WEBPACK_IMPORTED_MODULE_0__[\"default\"], {\n ...props,\n routerLinkType: react_router__WEBPACK_IMPORTED_MODULE_2__.NavLink\n})\n/* eslint-enable react/jsx-props-no-spreading */;\n/* harmony default export */ __webpack_exports__[\"default\"] = (NavLink);\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/NavLink.tsx?");
|
|
130
140
|
|
|
131
141
|
/***/ }),
|
|
132
142
|
|
|
@@ -136,6 +146,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var reac
|
|
|
136
146
|
\****************************************************/
|
|
137
147
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
138
148
|
|
|
149
|
+
"use strict";
|
|
139
150
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _base_theme_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./base-theme.scss */ \"./src/shared/components/PageLayout/base-theme.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\n/**\n * Simple and themeable page layout. It keeps the main content centered in\n * a column of limited width, which fills entire viewport on small screens\n * (under `$screen-md = 1024px` size). At larger screens the column keeps\n * `$screen-md` size, and it is centered at the page, surrounded by side\n * panels, where additional content can be displayed.\n *\n * **Children:** Component children are rendered as the content of main panel.\n * @param {object} [props] Component properties.\n * @param {Node} [props.leftSidePanelContent] The content for left side panel.\n * @param {Node} [props.rightSidePanelContent] The content for right side panel.\n * @param {PageLayoutTheme} [props.theme] _Ad hoc_ theme.\n * @param {...any} [props....]\n * [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)\n */\nconst PageLayout = _ref => {\n let {\n children,\n leftSidePanelContent,\n rightSidePanelContent,\n theme\n } = _ref;\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(\"div\", {\n className: theme.container,\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"div\", {\n className: [theme.sidePanel, theme.leftSidePanel].join(' '),\n children: leftSidePanelContent\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"div\", {\n className: theme.mainPanel,\n children: children\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"div\", {\n className: [theme.sidePanel, theme.rightSidePanel].join(' '),\n children: rightSidePanelContent\n })]\n });\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default()(PageLayout, 'PageLayout', _base_theme_scss__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/PageLayout/index.tsx?");
|
|
140
151
|
|
|
141
152
|
/***/ }),
|
|
@@ -146,6 +157,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dr_
|
|
|
146
157
|
\**************************************************/
|
|
147
158
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
148
159
|
|
|
160
|
+
"use strict";
|
|
149
161
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style.scss */ \"./src/shared/components/TextArea/style.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\n\nconst TextArea = _ref => {\n let {\n disabled,\n onChange,\n onKeyDown,\n placeholder,\n theme,\n value\n } = _ref;\n const hiddenAreaRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);\n const [height, setHeight] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();\n const [localValue, setLocalValue] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(value || '');\n if (value !== undefined && localValue !== value) setLocalValue(value);\n\n // This resizes text area's height when its width is changed for any reason.\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {\n const el = hiddenAreaRef.current;\n if (!el) return undefined;\n const cb = () => {\n setHeight(el.scrollHeight);\n };\n const observer = new ResizeObserver(cb);\n observer.observe(el);\n return () => {\n observer.disconnect();\n };\n }, []);\n\n // This resizes the text area when its content is modified.\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {\n const el = hiddenAreaRef.current;\n if (el) setHeight(el.scrollHeight);\n }, [localValue]);\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(\"div\", {\n className: theme.container,\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"textarea\", {\n // This text area is hidden underneath the primary one below,\n // and it is used for text measurements, to implement auto-scaling\n // of the primary textarea's height.\n readOnly: true,\n ref: hiddenAreaRef,\n className: `${theme.textarea} ${theme.hidden}`,\n value: localValue\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"textarea\", {\n disabled: disabled\n // When value is \"undefined\" the text area is not-managed, and we should\n // manage it internally for the measurement / resizing functionality\n // to work.\n ,\n onChange: value === undefined ? e => {\n setLocalValue(e.target.value);\n } : onChange,\n onKeyDown: onKeyDown,\n placeholder: placeholder,\n style: {\n height\n },\n className: theme.textarea,\n value: localValue\n })]\n });\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1___default()(TextArea, 'TextArea', _style_scss__WEBPACK_IMPORTED_MODULE_2__[\"default\"]));\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/TextArea/index.tsx?");
|
|
150
162
|
|
|
151
163
|
/***/ }),
|
|
@@ -156,6 +168,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var reac
|
|
|
156
168
|
\**************************************************/
|
|
157
169
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
158
170
|
|
|
171
|
+
"use strict";
|
|
159
172
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _theme_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme.scss */ \"./src/shared/components/Throbber/theme.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\n/**\n * Throbber is an \"action in progress\" indicator, which renders\n * three bouncing circles as a simple pending activity indicator,\n * and can be further themed to a certain degree.\n * @param {object} [props] Component properties.\n * @param {ThrobberTheme} [props.theme] _Ad hoc_ theme.\n * @param {...any} [props....]\n * [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)\n */\nconst Throbber = _ref => {\n let {\n theme\n } = _ref;\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(\"span\", {\n className: theme.container,\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"span\", {\n className: theme.circle\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"span\", {\n className: theme.circle\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"span\", {\n className: theme.circle\n })]\n });\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default()(Throbber, 'Throbber', _theme_scss__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/Throbber/index.tsx?");
|
|
160
173
|
|
|
161
174
|
/***/ }),
|
|
@@ -166,6 +179,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dr_
|
|
|
166
179
|
\*******************************************************/
|
|
167
180
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
168
181
|
|
|
182
|
+
"use strict";
|
|
169
183
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ PLACEMENTS: function() { return /* binding */ PLACEMENTS; }\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ \"react-dom\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);\n/**\n * The actual tooltip component. It is rendered outside the regular document\n * hierarchy, and with sub-components managed without React to achieve the best\n * performance during animation.\n */\n\n\n\n/* Valid placements of the rendered tooltip. They will be overriden when\n * necessary to fit the tooltip within the viewport. */\nlet PLACEMENTS = /*#__PURE__*/function (PLACEMENTS) {\n PLACEMENTS[\"ABOVE_CURSOR\"] = \"ABOVE_CURSOR\";\n PLACEMENTS[\"ABOVE_ELEMENT\"] = \"ABOVE_ELEMENT\";\n PLACEMENTS[\"BELOW_CURSOR\"] = \"BELOW_CURSOR\";\n PLACEMENTS[\"BELOW_ELEMENT\"] = \"BELOW_ELEMENT\";\n return PLACEMENTS;\n}({});\nconst ARROW_STYLE_DOWN = ['border-bottom-color:transparent', 'border-left-color:transparent', 'border-right-color:transparent'].join(';');\nconst ARROW_STYLE_UP = ['border-top-color:transparent', 'border-left-color:transparent', 'border-right-color:transparent'].join(';');\n/**\n * Creates tooltip components.\n * @ignore\n * @param {object} theme Themes to use for tooltip container, arrow,\n * and content.\n * @return {object} Object with DOM references to the container components:\n * container, arrow, content.\n */\nfunction createTooltipComponents(theme) {\n const arrow = document.createElement('div');\n if (theme.arrow) arrow.setAttribute('class', theme.arrow);\n const content = document.createElement('div');\n if (theme.content) content.setAttribute('class', theme.content);\n const container = document.createElement('div');\n if (theme.container) container.setAttribute('class', theme.container);\n container.appendChild(arrow);\n container.appendChild(content);\n document.body.appendChild(container);\n return {\n container,\n arrow,\n content\n };\n}\n/**\n * Generates bounding client rectangles for tooltip components.\n * @ignore\n * @param tooltip DOM references to the tooltip components.\n * @param tooltip.arrow\n * @param tooltip.container\n * @return Object holding tooltip rectangles in\n * two fields.\n */\nfunction calcTooltipRects(tooltip) {\n return {\n arrow: tooltip.arrow.getBoundingClientRect(),\n container: tooltip.container.getBoundingClientRect()\n };\n}\n\n/**\n * Calculates the document viewport size.\n * @ignore\n * @return {{x, y, width, height}}\n */\nfunction calcViewportRect() {\n const {\n scrollX,\n scrollY\n } = window;\n const {\n documentElement: {\n clientHeight,\n clientWidth\n }\n } = document;\n return {\n left: scrollX,\n right: scrollX + clientWidth,\n top: scrollY,\n bottom: scrollY + clientHeight\n };\n}\n\n/**\n * Calculates tooltip and arrow positions for the placement just above\n * the cursor.\n * @ignore\n * @param {number} x Cursor page-x position.\n * @param {number} y Cursor page-y position.\n * @param {object} tooltipRects Bounding client rectangles of tooltip parts.\n * @param {object} tooltipRects.arrow\n * @param {object} tooltipRects.container\n * @return {object} Contains the following fields:\n * - {number} arrowX\n * - {number} arrowY\n * - {number} containerX\n * - {number} containerY\n * - {string} baseArrowStyle\n */\nfunction calcPositionAboveXY(x, y, tooltipRects) {\n const {\n arrow,\n container\n } = tooltipRects;\n return {\n arrowX: 0.5 * (container.width - arrow.width),\n arrowY: container.height,\n containerX: x - container.width / 2,\n containerY: y - container.height - arrow.height / 1.5,\n // TODO: Instead of already setting the base style here, we should\n // introduce a set of constants for arrow directions, which will help\n // to do checks dependant on the arrow direction.\n baseArrowStyle: ARROW_STYLE_DOWN\n };\n}\n\n/*\nconst HIT = {\n NONE: false,\n LEFT: 'LEFT',\n RIGHT: 'RIGHT',\n TOP: 'TOP',\n BOTTOM: 'BOTTOM',\n};\n*/\n\n/**\n * Checks whether\n * @param {object} pos\n * @param {object} tooltipRects\n * @param {object} viewportRect\n * @return {HIT}\n */\n/*\nfunction checkViewportFit(pos, tooltipRects, viewportRect) {\n const { containerX, containerY } = pos;\n if (containerX < viewportRect.left + 6) return HIT.LEFT;\n if (containerX > viewportRect.right - 6) return HIT.RIGHT;\n return HIT.NONE;\n}\n*/\n\n/**\n * Shifts tooltip horizontally to fit into the viewport, while keeping\n * the arrow pointed to the XY point.\n * @param {number} x\n * @param {number} y\n * @param {object} pos\n * @param {number} pageXOffset\n * @param {number} pageXWidth\n */\n/*\nfunction xPageFitCorrection(x, y, pos, pageXOffset, pageXWidth) {\n if (pos.containerX < pageXOffset + 6) {\n pos.containerX = pageXOffset + 6;\n pos.arrowX = Math.max(6, pageX - containerX - arrowRect.width / 2);\n } else {\n const maxX = pageXOffset + docRect.width - containerRect.width - 6;\n if (containerX > maxX) {\n containerX = maxX;\n arrowX = Math.min(\n containerRect.width - 6,\n pageX - containerX - arrowRect.width / 2,\n );\n }\n }\n}\n*/\n\n/**\n * Sets positions of tooltip components to point the tooltip to the specified\n * page point.\n * @ignore\n * @param pageX\n * @param pageY\n * @param placement\n * @param element DOM reference to the element wrapped by the tooltip.\n * @param tooltip\n * @param tooltip.arrow DOM reference to the tooltip arrow.\n * @param tooltip.container DOM reference to the tooltip container.\n */\nfunction setComponentPositions(pageX, pageY, placement, element, tooltip) {\n const tooltipRects = calcTooltipRects(tooltip);\n const viewportRect = calcViewportRect();\n\n /* Default container coords: tooltip at the top. */\n const pos = calcPositionAboveXY(pageX, pageY, tooltipRects);\n if (pos.containerX < viewportRect.left + 6) {\n pos.containerX = viewportRect.left + 6;\n pos.arrowX = Math.max(6, pageX - pos.containerX - tooltipRects.arrow.width / 2);\n } else {\n const maxX = viewportRect.right - 6 - tooltipRects.container.width;\n if (pos.containerX > maxX) {\n pos.containerX = maxX;\n pos.arrowX = Math.min(tooltipRects.container.width - 6, pageX - pos.containerX - tooltipRects.arrow.width / 2);\n }\n }\n\n /* If tooltip has not enough space on top - make it bottom tooltip. */\n if (pos.containerY < viewportRect.top + 6) {\n pos.containerY += tooltipRects.container.height + 2 * tooltipRects.arrow.height;\n pos.arrowY -= tooltipRects.container.height + tooltipRects.arrow.height;\n pos.baseArrowStyle = ARROW_STYLE_UP;\n }\n const containerStyle = `left:${pos.containerX}px;top:${pos.containerY}px`;\n tooltip.container.setAttribute('style', containerStyle);\n const arrowStyle = `${pos.baseArrowStyle};left:${pos.arrowX}px;top:${pos.arrowY}px`;\n tooltip.arrow.setAttribute('style', arrowStyle);\n}\n\n/* The Tooltip component itself. */\nconst Tooltip = _ref => {\n let {\n children,\n ref,\n theme\n } = _ref;\n // NOTE: The way it has to be implemented, for clean mounting and unmounting\n // at the client side, the <Tooltip> is fully mounted into DOM in the next\n // rendering cycles, and only then it can be correctly measured and positioned.\n // Thus, when we create the <Tooltip> we have to record its target positioning\n // details, and then apply them when it is created.\n\n const {\n current: heap\n } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({\n lastElement: undefined,\n lastPageX: 0,\n lastPageY: 0,\n lastPlacement: undefined\n });\n const [components, setComponents] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);\n const pointTo = (pageX, pageY, placement, element) => {\n heap.lastElement = element;\n heap.lastPageX = pageX;\n heap.lastPageY = pageY;\n heap.lastPlacement = placement;\n if (components) {\n setComponentPositions(pageX, pageY, placement, element, components);\n }\n };\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useImperativeHandle)(ref, () => ({\n pointTo\n }));\n\n /* Inits and destroys tooltip components. */\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {\n const x = createTooltipComponents(theme);\n setComponents(x);\n return () => {\n document.body.removeChild(x.container);\n setComponents(null);\n };\n }, [theme]);\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {\n if (components) {\n setComponentPositions(heap.lastPageX, heap.lastPageY, heap.lastPlacement, heap.lastElement, components);\n }\n }, [components,\n // BEWARE: Careful about these dependencies - they are updated when mouse\n // is moved over the tool-tipped element, thus potentially may cause\n // unnecessary firing of this effect on each mouse event. It does not\n // happen now just because the mouse movements themselves are not causing\n // the component re-rendering, thus dependencies of this effect are not\n // really re-evaluated.\n heap.lastPageX, heap.lastPageY, heap.lastPlacement, heap.lastElement]);\n return components ? /*#__PURE__*/(0,react_dom__WEBPACK_IMPORTED_MODULE_1__.createPortal)(children, components.content) : null;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Tooltip);\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/WithTooltip/Tooltip.tsx?");
|
|
170
184
|
|
|
171
185
|
/***/ }),
|
|
@@ -176,6 +190,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
176
190
|
\*****************************************************/
|
|
177
191
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
178
192
|
|
|
193
|
+
"use strict";
|
|
179
194
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _Tooltip__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Tooltip */ \"./src/shared/components/WithTooltip/Tooltip.tsx\");\n/* harmony import */ var _default_theme_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./default-theme.scss */ \"./src/shared/components/WithTooltip/default-theme.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n/* global window */\n\n\n\n\n\n\n/**\n * Implements a simple to use and themeable tooltip component, _e.g._\n * ```js\n * <WithTooltip tip=\"This is example tooltip.\">\n * <p>Hover to see the tooltip.</p>\n * </WithTooltip>\n * ```\n * **Children:** Children are rendered in the place of `<WithTooltip>`,\n * and when hovered the tooltip is shown. By default the wrapper itself is\n * `<div>` block with `display: inline-block`.\n * @param tip – Anything React is able to render,\n * _e.g._ a tooltip text. This will be the tooltip content.\n * @param {WithTooltipTheme} props.theme _Ad hoc_ theme.\n */\nconst Wrapper = _ref => {\n let {\n children,\n placement = _Tooltip__WEBPACK_IMPORTED_MODULE_2__.PLACEMENTS.ABOVE_CURSOR,\n tip,\n theme\n } = _ref;\n const {\n current: heap\n } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({\n lastCursorX: 0,\n lastCursorY: 0,\n triggeredByTouch: false,\n timerId: undefined\n });\n const tooltipRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);\n const wrapperRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);\n const [showTooltip, setShowTooltip] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);\n const updatePortalPosition = (cursorX, cursorY) => {\n if (!showTooltip) {\n heap.lastCursorX = cursorX;\n heap.lastCursorY = cursorY;\n\n // If tooltip was triggered by a touch, we delay its opening by a bit,\n // to ensure it was not a touch-click - in the case of touch click we\n // want to do the click, rather than show the tooltip, and the delay\n // gives click handler a chance to abort the tooltip openning.\n if (heap.triggeredByTouch) {\n if (!heap.timerId) {\n heap.timerId = setTimeout(() => {\n heap.triggeredByTouch = false;\n heap.timerId = undefined;\n setShowTooltip(true);\n }, 300);\n }\n\n // Otherwise we can just open the tooltip right away.\n } else setShowTooltip(true);\n } else {\n const wrapperRect = wrapperRef.current.getBoundingClientRect();\n if (cursorX < wrapperRect.left || cursorX > wrapperRect.right || cursorY < wrapperRect.top || cursorY > wrapperRect.bottom) {\n setShowTooltip(false);\n } else if (tooltipRef.current) {\n tooltipRef.current.pointTo(cursorX + window.scrollX, cursorY + window.scrollY, placement, wrapperRef.current);\n }\n }\n };\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {\n if (showTooltip && tip !== null) {\n // This is necessary to ensure that even when a single mouse event\n // arrives to a tool-tipped component, the tooltip is correctly positioned\n // once opened (because similar call above does not have effect until\n // the tooltip is fully mounted, and that is delayed to future rendering\n // cycle due to the implementation).\n if (tooltipRef.current) {\n tooltipRef.current.pointTo(heap.lastCursorX + window.scrollX, heap.lastCursorY + window.scrollY, placement, wrapperRef.current);\n }\n const listener = () => setShowTooltip(false);\n window.addEventListener('scroll', listener);\n return () => window.removeEventListener('scroll', listener);\n }\n return undefined;\n }, [heap.lastCursorX, heap.lastCursorY, placement, showTooltip, tip]);\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(\"div\", {\n className: theme.wrapper,\n onMouseLeave: () => setShowTooltip(false),\n onMouseMove: e => updatePortalPosition(e.clientX, e.clientY),\n onClick: () => {\n if (heap.timerId) {\n clearTimeout(heap.timerId);\n heap.timerId = undefined;\n heap.triggeredByTouch = false;\n }\n },\n onTouchStart: () => {\n heap.triggeredByTouch = true;\n },\n ref: wrapperRef,\n role: \"presentation\",\n children: [showTooltip && tip !== null ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_Tooltip__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n ref: tooltipRef,\n theme: theme,\n children: tip\n }) : null, children]\n });\n};\nconst ThemedWrapper = _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1___default()(Wrapper, 'WithTooltip', _default_theme_scss__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\nconst e = ThemedWrapper;\ne.PLACEMENTS = _Tooltip__WEBPACK_IMPORTED_MODULE_2__.PLACEMENTS;\n/* harmony default export */ __webpack_exports__[\"default\"] = (e);\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/WithTooltip/index.tsx?");
|
|
180
195
|
|
|
181
196
|
/***/ }),
|
|
@@ -186,6 +201,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var reac
|
|
|
186
201
|
\******************************************************/
|
|
187
202
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
188
203
|
|
|
204
|
+
"use strict";
|
|
189
205
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! qs */ \"qs\");\n/* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(qs__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _Throbber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Throbber */ \"./src/shared/components/Throbber/index.tsx\");\n/* harmony import */ var _base_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./base.scss */ \"./src/shared/components/YouTubeVideo/base.scss\");\n/* harmony import */ var _throbber_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./throbber.scss */ \"./src/shared/components/YouTubeVideo/throbber.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\n\n\n\n/**\n * A component for embeding a YouTube video.\n * @param [props] Component properties.\n * @param [props.autoplay] If `true` the video will start to play\n * automatically once loaded.\n * @param [props.src] URL of the video to play. Can be in any of\n * the following formats, and keeps any additional query parameters understood\n * by the YouTube IFrame player:\n * - `https://www.youtube.com/watch?v=NdF6Rmt6Ado`\n * - `https://youtu.be/NdF6Rmt6Ado`\n * - `https://www.youtube.com/embed/NdF6Rmt6Ado`\n * @param [props.theme] _Ad hoc_ theme.\n * @param [props.title] The `title` attribute to add to the player\n * IFrame.\n */\nconst YouTubeVideo = _ref => {\n var _url;\n let {\n autoplay,\n src,\n theme,\n title\n } = _ref;\n const srcParts = src.split('?');\n let url = srcParts[0];\n const queryString = srcParts[1];\n const query = queryString ? qs__WEBPACK_IMPORTED_MODULE_0___default().parse(queryString) : {};\n const videoId = query.v || ((_url = url) === null || _url === void 0 || (_url = _url.match(/\\/([a-zA-Z0-9-_]*)$/)) === null || _url === void 0 ? void 0 : _url[1]);\n url = `https://www.youtube.com/embed/${videoId}`;\n delete query.v;\n query.autoplay = autoplay ? '1' : '0';\n url += `?${qs__WEBPACK_IMPORTED_MODULE_0___default().stringify(query)}`;\n\n // TODO: https://developers.google.com/youtube/player_parameters\n // More query parameters can be exposed via the component props.\n\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"div\", {\n className: theme.container,\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_Throbber__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n theme: _throbber_scss__WEBPACK_IMPORTED_MODULE_4__[\"default\"]\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"iframe\", {\n allow: \"autoplay\",\n allowFullScreen: true,\n className: theme.video,\n src: url,\n title: title\n })]\n });\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1___default()(YouTubeVideo, 'YouTubeVideo', _base_scss__WEBPACK_IMPORTED_MODULE_3__[\"default\"]));\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/YouTubeVideo/index.tsx?");
|
|
190
206
|
|
|
191
207
|
/***/ }),
|
|
@@ -196,6 +212,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var qs__
|
|
|
196
212
|
\****************************************/
|
|
197
213
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
198
214
|
|
|
215
|
+
"use strict";
|
|
199
216
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BaseButton: function() { return /* reexport safe */ _Button__WEBPACK_IMPORTED_MODULE_1__.BaseButton; },\n/* harmony export */ BaseModal: function() { return /* reexport safe */ _Modal__WEBPACK_IMPORTED_MODULE_7__.BaseModal; },\n/* harmony export */ Button: function() { return /* reexport safe */ _Button__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; },\n/* harmony export */ Checkbox: function() { return /* reexport safe */ _Checkbox__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; },\n/* harmony export */ CustomDropdown: function() { return /* reexport safe */ _selectors__WEBPACK_IMPORTED_MODULE_0__.CustomDropdown; },\n/* harmony export */ Dropdown: function() { return /* reexport safe */ _selectors__WEBPACK_IMPORTED_MODULE_0__.Dropdown; },\n/* harmony export */ Input: function() { return /* reexport safe */ _Input__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; },\n/* harmony export */ Link: function() { return /* reexport safe */ _Link__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; },\n/* harmony export */ MetaTags: function() { return /* reexport safe */ _MetaTags__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; },\n/* harmony export */ Modal: function() { return /* reexport safe */ _Modal__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; },\n/* harmony export */ NavLink: function() { return /* reexport safe */ _NavLink__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; },\n/* harmony export */ PageLayout: function() { return /* reexport safe */ _PageLayout__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; },\n/* harmony export */ Switch: function() { return /* reexport safe */ _selectors__WEBPACK_IMPORTED_MODULE_0__.Switch; },\n/* harmony export */ TextArea: function() { return /* reexport safe */ _TextArea__WEBPACK_IMPORTED_MODULE_12__[\"default\"]; },\n/* harmony export */ Throbber: function() { return /* reexport safe */ _Throbber__WEBPACK_IMPORTED_MODULE_9__[\"default\"]; },\n/* harmony export */ WithTooltip: function() { return /* reexport safe */ _WithTooltip__WEBPACK_IMPORTED_MODULE_10__[\"default\"]; },\n/* harmony export */ YouTubeVideo: function() { return /* reexport safe */ _YouTubeVideo__WEBPACK_IMPORTED_MODULE_11__[\"default\"]; }\n/* harmony export */ });\n/* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./selectors */ \"./src/shared/components/selectors/index.ts\");\n/* harmony import */ var _Button__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Button */ \"./src/shared/components/Button/index.tsx\");\n/* harmony import */ var _Checkbox__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Checkbox */ \"./src/shared/components/Checkbox/index.tsx\");\n/* harmony import */ var _Input__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Input */ \"./src/shared/components/Input/index.tsx\");\n/* harmony import */ var _Link__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Link */ \"./src/shared/components/Link.tsx\");\n/* harmony import */ var _PageLayout__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./PageLayout */ \"./src/shared/components/PageLayout/index.tsx\");\n/* harmony import */ var _MetaTags__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./MetaTags */ \"./src/shared/components/MetaTags.tsx\");\n/* harmony import */ var _Modal__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Modal */ \"./src/shared/components/Modal/index.tsx\");\n/* harmony import */ var _NavLink__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./NavLink */ \"./src/shared/components/NavLink.tsx\");\n/* harmony import */ var _Throbber__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Throbber */ \"./src/shared/components/Throbber/index.tsx\");\n/* harmony import */ var _WithTooltip__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./WithTooltip */ \"./src/shared/components/WithTooltip/index.tsx\");\n/* harmony import */ var _YouTubeVideo__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./YouTubeVideo */ \"./src/shared/components/YouTubeVideo/index.tsx\");\n/* harmony import */ var _TextArea__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./TextArea */ \"./src/shared/components/TextArea/index.tsx\");\n/**\n * Just an aggregation of all exported components into a single module.\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/index.ts?");
|
|
200
217
|
|
|
201
218
|
/***/ }),
|
|
@@ -206,6 +223,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
206
223
|
\**************************************************************************/
|
|
207
224
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
208
225
|
|
|
226
|
+
"use strict";
|
|
209
227
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ areEqual: function() { return /* binding */ areEqual; }\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Modal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../Modal */ \"./src/shared/components/Modal/index.tsx\");\n/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style.scss */ \"./src/shared/components/selectors/CustomDropdown/Options/style.scss\");\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common */ \"./src/shared/components/selectors/common.ts\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\n\n\nfunction areEqual(a, b) {\n return (a === null || a === void 0 ? void 0 : a.left) === (b === null || b === void 0 ? void 0 : b.left) && (a === null || a === void 0 ? void 0 : a.top) === (b === null || b === void 0 ? void 0 : b.top) && (a === null || a === void 0 ? void 0 : a.width) === (b === null || b === void 0 ? void 0 : b.width);\n}\nconst Options = _ref => {\n let {\n containerClass,\n containerStyle,\n filter,\n onCancel,\n onChange,\n optionClass,\n options,\n ref\n } = _ref;\n const opsRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useImperativeHandle)(ref, () => ({\n measure: () => {\n var _opsRef$current;\n const e = (_opsRef$current = opsRef.current) === null || _opsRef$current === void 0 ? void 0 : _opsRef$current.parentElement;\n if (!e) return undefined;\n const rect = opsRef.current.getBoundingClientRect();\n const style = window.getComputedStyle(e);\n const mBottom = parseFloat(style.marginBottom);\n const mTop = parseFloat(style.marginTop);\n rect.height += mBottom + mTop;\n return rect;\n }\n }), []);\n const optionNodes = [];\n for (let i = 0; i < options.length; ++i) {\n const option = options[i];\n if (option !== undefined && (!filter || filter(option))) {\n const [iValue, iName] = (0,_common__WEBPACK_IMPORTED_MODULE_3__.optionValueName)(option);\n optionNodes.push(/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(\"div\", {\n className: optionClass,\n onClick: e => {\n onChange(iValue);\n e.stopPropagation();\n },\n onKeyDown: e => {\n if (e.key === 'Enter') {\n onChange(iValue);\n e.stopPropagation();\n }\n },\n role: \"button\",\n tabIndex: 0,\n children: iName\n }, iValue));\n }\n }\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_Modal__WEBPACK_IMPORTED_MODULE_1__.BaseModal\n // Closes the dropdown (cancels the selection) on any page scrolling attempt.\n // This is the same native <select> elements do on scrolling, and at least for\n // now we have no reason to deal with complications needed to support open\n // dropdowns during the scrolling (that would need to re-position it in\n // response to the position changes of the root dropdown element).\n , {\n cancelOnScrolling: true,\n style: containerStyle,\n dontDisableScrolling: true,\n onCancel: onCancel,\n theme: {\n ad: '',\n hoc: '',\n container: containerClass,\n context: '',\n overlay: _style_scss__WEBPACK_IMPORTED_MODULE_2__[\"default\"].overlay\n },\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(\"div\", {\n ref: opsRef,\n children: optionNodes\n })\n });\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Options);\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/selectors/CustomDropdown/Options/index.tsx?");
|
|
210
228
|
|
|
211
229
|
/***/ }),
|
|
@@ -216,6 +234,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
216
234
|
\******************************************************************/
|
|
217
235
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
218
236
|
|
|
237
|
+
"use strict";
|
|
219
238
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _Options__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Options */ \"./src/shared/components/selectors/CustomDropdown/Options/index.tsx\");\n/* harmony import */ var _theme_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./theme.scss */ \"./src/shared/components/selectors/CustomDropdown/theme.scss\");\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common */ \"./src/shared/components/selectors/common.ts\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\n\n\n\nconst BaseCustomDropdown = _ref => {\n let {\n filter,\n label,\n onChange,\n options,\n theme,\n value\n } = _ref;\n if (!options) throw Error('Internal error');\n const [active, setActive] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);\n const dropdownRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);\n const opsRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);\n const [opsPos, setOpsPos] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();\n const [upward, setUpward] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {\n if (!active) return undefined;\n let id;\n const cb = () => {\n var _dropdownRef$current, _opsRef$current;\n const anchor = (_dropdownRef$current = dropdownRef.current) === null || _dropdownRef$current === void 0 ? void 0 : _dropdownRef$current.getBoundingClientRect();\n const opsRect = (_opsRef$current = opsRef.current) === null || _opsRef$current === void 0 ? void 0 : _opsRef$current.measure();\n if (anchor && opsRect) {\n var _window$visualViewpor, _window$visualViewpor2;\n const fitsDown = anchor.bottom + opsRect.height < ((_window$visualViewpor = (_window$visualViewpor2 = window.visualViewport) === null || _window$visualViewpor2 === void 0 ? void 0 : _window$visualViewpor2.height) !== null && _window$visualViewpor !== void 0 ? _window$visualViewpor : 0);\n const fitsUp = anchor.top - opsRect.height > 0;\n const up = !fitsDown && fitsUp;\n setUpward(up);\n const pos = up ? {\n top: anchor.top - opsRect.height - 1,\n left: anchor.left,\n width: anchor.width\n } : {\n left: anchor.left,\n top: anchor.bottom,\n width: anchor.width\n };\n setOpsPos(now => (0,_Options__WEBPACK_IMPORTED_MODULE_2__.areEqual)(now, pos) ? now : pos);\n }\n id = requestAnimationFrame(cb);\n };\n requestAnimationFrame(cb);\n return () => {\n cancelAnimationFrame(id);\n };\n }, [active]);\n const openList = e => {\n const view = window.visualViewport;\n const rect = dropdownRef.current.getBoundingClientRect();\n setActive(true);\n\n // NOTE: This first opens the dropdown off-screen, where it is measured\n // by an effect declared above, and then positioned below, or above\n // the original dropdown element, depending where it fits best\n // (if we first open it downward, it would flick if we immediately\n // move it above, at least with the current position update via local\n // react state, and not imperatively).\n setOpsPos({\n left: (view === null || view === void 0 ? void 0 : view.width) || 0,\n top: (view === null || view === void 0 ? void 0 : view.height) || 0,\n width: rect.width\n });\n e.stopPropagation();\n };\n let selected = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, {\n children: \"\\u200C\"\n });\n for (let i = 0; i < options.length; ++i) {\n const option = options[i];\n if (option !== undefined && (!filter || filter(option))) {\n const [iValue, iName] = (0,_common__WEBPACK_IMPORTED_MODULE_4__.optionValueName)(option);\n if (iValue === value) {\n selected = iName;\n break;\n }\n }\n }\n let containerClassName = theme.container;\n if (active) containerClassName += ` ${theme.active}`;\n let opsContainerClass = theme.select || '';\n if (upward) {\n containerClassName += ` ${theme.upward}`;\n opsContainerClass += ` ${theme.upward}`;\n }\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"div\", {\n className: containerClassName,\n children: [label === undefined ? null : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"div\", {\n className: theme.label,\n children: label\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"div\", {\n className: theme.dropdown,\n onClick: openList,\n onKeyDown: e => {\n if (e.key === 'Enter') openList(e);\n },\n ref: dropdownRef,\n role: \"listbox\",\n tabIndex: 0,\n children: [selected, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"div\", {\n className: theme.arrow\n })]\n }), active ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_Options__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n containerClass: opsContainerClass,\n containerStyle: opsPos,\n onCancel: () => {\n setActive(false);\n },\n onChange: newValue => {\n setActive(false);\n if (onChange) onChange(newValue);\n },\n optionClass: theme.option || '',\n options: options,\n ref: opsRef\n }) : null]\n });\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1___default()(BaseCustomDropdown, 'CustomDropdown', _theme_scss__WEBPACK_IMPORTED_MODULE_3__[\"default\"]));\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/selectors/CustomDropdown/index.tsx?");
|
|
220
239
|
|
|
221
240
|
/***/ }),
|
|
@@ -226,6 +245,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var reac
|
|
|
226
245
|
\******************************************************************/
|
|
227
246
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
228
247
|
|
|
248
|
+
"use strict";
|
|
229
249
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _theme_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme.scss */ \"./src/shared/components/selectors/NativeDropdown/theme.scss\");\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common */ \"./src/shared/components/selectors/common.ts\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n// Implements dropdown based on the native HTML <select> element.\n\n\n\n\n\n/**\n * Implements a themeable dropdown list. Internally it is rendered with help of\n * the standard HTML `<select>` element, thus the styling support is somewhat\n * limited.\n * @param [props] Component properties.\n * @param [props.filter] Options filter function. If provided, only\n * those elements of `options` list will be used by the dropdown, for which this\n * filter returns `true`.\n * @param [props.label] Dropdown label.\n * @param [props.onChange] Selection event handler.\n * @param [props.options=[]] Array of dropdown\n * options. For string elements the option value and name will be the same.\n * It is allowed to mix DropdownOption and string elements in the same option\n * list.\n * @param [props.theme] _Ad hoc_ theme.\n * @param [props.value] Currently selected value.\n * @param [props....]\n * [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)\n */\n\nconst Dropdown = _ref => {\n let {\n filter,\n label,\n onChange,\n options,\n testId,\n theme,\n value\n } = _ref;\n if (!options) throw Error('Internal error');\n let isValidValue = false;\n const optionElements = [];\n for (let i = 0; i < options.length; ++i) {\n const option = options[i];\n if (option !== undefined && (!filter || filter(option))) {\n const [iValue, iName] = (0,_common__WEBPACK_IMPORTED_MODULE_2__.optionValueName)(option);\n isValidValue || (isValidValue = iValue === value);\n optionElements.push(/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"option\", {\n className: theme.option,\n value: iValue,\n children: iName\n }, iValue));\n }\n }\n\n // NOTE: This element represents the current `value` when it does not match\n // any valid option. In Chrome, and some other browsers, we are able to hide\n // it from the opened dropdown; in others, e.g. Safari, the best we can do is\n // to show it as disabled.\n const hiddenOption = isValidValue ? null : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"option\", {\n disabled: true,\n className: theme.hiddenOption,\n value: value,\n children: value\n }, \"__reactUtilsHiddenOption\");\n let selectClassName = theme.select;\n if (!isValidValue) selectClassName += ` ${theme.invalid}`;\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(\"div\", {\n className: theme.container,\n children: [label === undefined ? null : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"div\", {\n className: theme.label,\n children: label\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(\"div\", {\n className: theme.dropdown,\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(\"select\", {\n className: selectClassName,\n \"data-testid\": false ? 0 : testId,\n onChange: onChange,\n value: value,\n children: [hiddenOption, optionElements]\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"div\", {\n className: theme.arrow\n })]\n })]\n });\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default()(Dropdown, 'Dropdown', _theme_scss__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/selectors/NativeDropdown/index.tsx?");
|
|
230
250
|
|
|
231
251
|
/***/ }),
|
|
@@ -236,6 +256,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dr_
|
|
|
236
256
|
\**********************************************************/
|
|
237
257
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
238
258
|
|
|
259
|
+
"use strict";
|
|
239
260
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common */ \"./src/shared/components/selectors/common.ts\");\n/* harmony import */ var _theme_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./theme.scss */ \"./src/shared/components/selectors/Switch/theme.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\n\nconst BaseSwitch = _ref => {\n let {\n label,\n onChange,\n options,\n theme,\n value\n } = _ref;\n if (!options || !theme.option) throw Error('Internal error');\n const optionNodes = [];\n for (let i = 0; i < (options === null || options === void 0 ? void 0 : options.length); ++i) {\n const option = options[i];\n if (option !== undefined) {\n const [iValue, iName] = (0,_common__WEBPACK_IMPORTED_MODULE_1__.optionValueName)(option);\n let className = theme.option;\n let onPress;\n if (iValue === value) className += ` ${theme.selected}`;else if (onChange) onPress = () => onChange(iValue);\n optionNodes.push(onPress ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"div\", {\n className: className,\n onClick: onPress,\n onKeyDown: e => {\n if (onPress && e.key === 'Enter') onPress();\n },\n role: \"button\",\n tabIndex: 0,\n children: iName\n }, iValue) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"div\", {\n className: className,\n children: iName\n }, iValue));\n }\n }\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(\"div\", {\n className: theme.container,\n children: [label ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"div\", {\n className: theme.label,\n children: label\n }) : null, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"div\", {\n className: theme.options,\n children: optionNodes\n })]\n });\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default()(BaseSwitch, 'Switch', _theme_scss__WEBPACK_IMPORTED_MODULE_2__[\"default\"]));\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/selectors/Switch/index.tsx?");
|
|
240
261
|
|
|
241
262
|
/***/ }),
|
|
@@ -246,6 +267,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dr_
|
|
|
246
267
|
\***************************************************/
|
|
247
268
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
248
269
|
|
|
270
|
+
"use strict";
|
|
249
271
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ optionValueName: function() { return /* binding */ optionValueName; }\n/* harmony export */ });\n// The stuff common between different dropdown implementations.\n\nfunction isValue(x) {\n const type = typeof x;\n return type === 'number' || type === 'string';\n}\n\n/** Returns option value and name as a tuple. */\nfunction optionValueName(option) {\n var _option$name;\n return isValue(option) ? [option, option] : [option.value, (_option$name = option.name) !== null && _option$name !== void 0 ? _option$name : option.value];\n}\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/selectors/common.ts?");
|
|
250
272
|
|
|
251
273
|
/***/ }),
|
|
@@ -256,6 +278,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
256
278
|
\**************************************************/
|
|
257
279
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
258
280
|
|
|
281
|
+
"use strict";
|
|
259
282
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CustomDropdown: function() { return /* reexport safe */ _CustomDropdown__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; },\n/* harmony export */ Dropdown: function() { return /* reexport safe */ _NativeDropdown__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; },\n/* harmony export */ Switch: function() { return /* reexport safe */ _Switch__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; }\n/* harmony export */ });\n/* harmony import */ var _CustomDropdown__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CustomDropdown */ \"./src/shared/components/selectors/CustomDropdown/index.tsx\");\n/* harmony import */ var _NativeDropdown__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./NativeDropdown */ \"./src/shared/components/selectors/NativeDropdown/index.tsx\");\n/* harmony import */ var _Switch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Switch */ \"./src/shared/components/selectors/Switch/index.tsx\");\n\n\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/selectors/index.ts?");
|
|
260
283
|
|
|
261
284
|
/***/ }),
|
|
@@ -266,6 +289,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
266
289
|
\************************************/
|
|
267
290
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
268
291
|
|
|
292
|
+
"use strict";
|
|
269
293
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _isomorphy_environment_check__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isomorphy/environment-check */ \"./src/shared/utils/isomorphy/environment-check.ts\");\n/* harmony import */ var _webpack__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./webpack */ \"./src/shared/utils/webpack.ts\");\n/* global document */\n\n\n\nconst config = (_isomorphy_environment_check__WEBPACK_IMPORTED_MODULE_0__.IS_CLIENT_SIDE\n// eslint-disable-next-line global-require\n? (__webpack_require__(/*! ../../client/getInj */ \"./src/client/getInj.ts\")[\"default\"])().CONFIG : (0,_webpack__WEBPACK_IMPORTED_MODULE_1__.requireWeak)('config')) || {};\n\n// The safeguard for \"document\" is necessary because in non-Node environments,\n// like React Native, IS_CLIENT_SIDE is \"true\", however \"document\" and a bunch\n// of other browser-world features are not available.\nif (_isomorphy_environment_check__WEBPACK_IMPORTED_MODULE_0__.IS_CLIENT_SIDE && typeof document !== 'undefined') {\n const cookie = __webpack_require__(/*! cookie */ \"cookie\"); // eslint-disable-line global-require\n config.CSRF = cookie.parse(document.cookie).csrfToken;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (config);\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/config.ts?");
|
|
270
294
|
|
|
271
295
|
/***/ }),
|
|
@@ -276,6 +300,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _iso
|
|
|
276
300
|
\*****************************************/
|
|
277
301
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
278
302
|
|
|
303
|
+
"use strict";
|
|
279
304
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getSsrContext: function() { return /* binding */ getSsrContext; }\n/* harmony export */ });\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @dr.pogodin/react-global-state */ \"@dr.pogodin/react-global-state\");\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_0__);\n\n\n// The type of data object injected by server into generated markup.\n\nconst {\n getSsrContext\n} = (0,_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_0__.withGlobalStateType)();\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/globalState.ts?");
|
|
280
305
|
|
|
281
306
|
/***/ }),
|
|
@@ -286,6 +311,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
286
311
|
\***********************************/
|
|
287
312
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
288
313
|
|
|
314
|
+
"use strict";
|
|
289
315
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Barrier: function() { return /* reexport safe */ _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5__.Barrier; },\n/* harmony export */ Emitter: function() { return /* reexport safe */ _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5__.Emitter; },\n/* harmony export */ Semaphore: function() { return /* reexport safe */ _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5__.Semaphore; },\n/* harmony export */ ThemeProvider: function() { return /* reexport safe */ _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__.ThemeProvider; },\n/* harmony export */ config: function() { return /* reexport safe */ _config__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; },\n/* harmony export */ getSsrContext: function() { return /* reexport safe */ _globalState__WEBPACK_IMPORTED_MODULE_6__.getSsrContext; },\n/* harmony export */ isomorphy: function() { return /* reexport module object */ _isomorphy__WEBPACK_IMPORTED_MODULE_2__; },\n/* harmony export */ splitComponent: function() { return /* reexport safe */ _splitComponent__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; },\n/* harmony export */ themed: function() { return /* binding */ themed; },\n/* harmony export */ time: function() { return /* reexport safe */ _time__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; },\n/* harmony export */ webpack: function() { return /* reexport module object */ _webpack__WEBPACK_IMPORTED_MODULE_4__; },\n/* harmony export */ withRetries: function() { return /* reexport safe */ _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5__.withRetries; }\n/* harmony export */ });\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./config */ \"./src/shared/utils/config.ts\");\n/* harmony import */ var _isomorphy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isomorphy */ \"./src/shared/utils/isomorphy/index.ts\");\n/* harmony import */ var _time__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./time */ \"./src/shared/utils/time.ts\");\n/* harmony import */ var _webpack__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./webpack */ \"./src/shared/utils/webpack.ts\");\n/* harmony import */ var _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @dr.pogodin/js-utils */ \"@dr.pogodin/js-utils\");\n/* harmony import */ var _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _globalState__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./globalState */ \"./src/shared/utils/globalState.ts\");\n/* harmony import */ var _splitComponent__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./splitComponent */ \"./src/shared/utils/splitComponent.tsx\");\n\n\n\n\n\n\n\n\nconst themed = (_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default());\nthemed.COMPOSE = _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__.COMPOSE;\nthemed.PRIORITY = _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__.PRIORITY;\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/index.ts?");
|
|
290
316
|
|
|
291
317
|
/***/ }),
|
|
@@ -296,6 +322,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
296
322
|
\*************************************************/
|
|
297
323
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
298
324
|
|
|
325
|
+
"use strict";
|
|
299
326
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getBuildInfo: function() { return /* binding */ getBuildInfo; },\n/* harmony export */ setBuildInfo: function() { return /* binding */ setBuildInfo; }\n/* harmony export */ });\n// Encapsulates access to \"Build Info\" data.\n\n// BEWARE: This should match the type of build info object generated by\n// Webpack build (see \"/config/webpack/app-base.js\"), and currently this\n// match is not checked automatically.\n\n// Depending on the build mode & environment, BUILD_INFO is either a global\n// variable defined at the app launch, or it is replaced by the actual value\n// by the Webpack build.\n\nlet buildInfo;\n\n// On the client side \"BUILD_INFO\" should be injected by Webpack. Note, however,\n// that in test environment we may need situations were environment is mocked as\n// client-side, although no proper Webpack compilation is executed, thus no info\n// injected; because of this we don't do a hard environment check here.\nif (typeof window.__DEV_BUILD_INFO__ !== 'undefined') buildInfo = window.__DEV_BUILD_INFO__;\n\n/**\n * In scenarious where \"BUILD_INFO\" is not injected by Webpack (server-side,\n * tests, etc.) we expect the host codebase to explicitly set it before it is\n * ever requested. As a precaution, this function throws if build info has been\n * set already, unless `force` flag is explicitly set.\n * @param info\n * @param force\n */\nfunction setBuildInfo(info) {\n let force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n if (buildInfo !== undefined && !force) {\n throw Error('\"Build Info\" is already initialized');\n }\n buildInfo = info;\n}\n\n/**\n * Returns \"Build Info\" object; throws if it has not been initialized yet.\n * @returns\n */\nfunction getBuildInfo() {\n if (buildInfo === undefined) {\n throw Error('\"Build Info\" has not been initialized yet');\n }\n return buildInfo;\n}\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/isomorphy/buildInfo.ts?");
|
|
300
327
|
|
|
301
328
|
/***/ }),
|
|
@@ -306,6 +333,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
306
333
|
\*********************************************************/
|
|
307
334
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
308
335
|
|
|
336
|
+
"use strict";
|
|
309
337
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ IS_CLIENT_SIDE: function() { return /* binding */ IS_CLIENT_SIDE; },\n/* harmony export */ IS_SERVER_SIDE: function() { return /* binding */ IS_SERVER_SIDE; }\n/* harmony export */ });\n// Checks for client- vs. server-side environment detection.\n\n/**\n * `true` within client-side environment (browser), `false` at server-side.\n */\nconst IS_CLIENT_SIDE = typeof process !== 'object' || !process.versions || !process.versions.node || !!__webpack_require__.g.REACT_UTILS_FORCE_CLIENT_SIDE;\n\n/**\n * `true` within the server-side environment (node), `false` at client-side.\n */\nconst IS_SERVER_SIDE = !IS_CLIENT_SIDE;\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/isomorphy/environment-check.ts?");
|
|
310
338
|
|
|
311
339
|
/***/ }),
|
|
@@ -316,6 +344,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
316
344
|
\*********************************************/
|
|
317
345
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
318
346
|
|
|
347
|
+
"use strict";
|
|
319
348
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ IS_CLIENT_SIDE: function() { return /* reexport safe */ _environment_check__WEBPACK_IMPORTED_MODULE_1__.IS_CLIENT_SIDE; },\n/* harmony export */ IS_SERVER_SIDE: function() { return /* reexport safe */ _environment_check__WEBPACK_IMPORTED_MODULE_1__.IS_SERVER_SIDE; },\n/* harmony export */ buildTimestamp: function() { return /* binding */ buildTimestamp; },\n/* harmony export */ getBuildInfo: function() { return /* reexport safe */ _buildInfo__WEBPACK_IMPORTED_MODULE_0__.getBuildInfo; },\n/* harmony export */ isDevBuild: function() { return /* binding */ isDevBuild; },\n/* harmony export */ isProdBuild: function() { return /* binding */ isProdBuild; }\n/* harmony export */ });\n/* harmony import */ var _buildInfo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./buildInfo */ \"./src/shared/utils/isomorphy/buildInfo.ts\");\n/* harmony import */ var _environment_check__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./environment-check */ \"./src/shared/utils/isomorphy/environment-check.ts\");\n\n\n\n/**\n * @ignore\n * @return {string} Code mode: \"development\" or \"production\".\n */\nfunction getMode() {\n return \"development\";\n}\n\n/**\n * Returns `true` if development version of the code is running;\n * `false` otherwise.\n * @return {boolean}\n */\nfunction isDevBuild() {\n return getMode() === 'development';\n}\n\n/**\n * Returns `true` if production build of the code is running;\n * `false` otherwise.\n * @return {boolean}\n */\nfunction isProdBuild() {\n return getMode() === 'production';\n}\n\n/**\n * Returns build timestamp of the front-end JS bundle.\n * @return {string} ISO date/time string.\n */\nfunction buildTimestamp() {\n return (0,_buildInfo__WEBPACK_IMPORTED_MODULE_0__.getBuildInfo)().timestamp;\n}\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/isomorphy/index.ts?");
|
|
320
349
|
|
|
321
350
|
/***/ }),
|
|
@@ -326,6 +355,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
326
355
|
\*********************************************/
|
|
327
356
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
328
357
|
|
|
358
|
+
"use strict";
|
|
329
359
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ bookStyleSheets: function() { return /* binding */ bookStyleSheets; },\n/* harmony export */ \"default\": function() { return /* binding */ splitComponent; },\n/* harmony export */ freeStyleSheets: function() { return /* binding */ freeStyleSheets; }\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @dr.pogodin/js-utils */ \"@dr.pogodin/js-utils\");\n/* harmony import */ var _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _globalState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./globalState */ \"./src/shared/utils/globalState.ts\");\n/* harmony import */ var _isomorphy__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isomorphy */ \"./src/shared/utils/isomorphy/index.ts\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n/* eslint-disable react/jsx-props-no-spreading */\n/* global document */\n\n\n\n\n\n\n// Note: At the client side we can get chunk groups immediately when loading\n// the module; at the server-side we only can get them within React render flow.\n// Thus, we set and use the following variable at the client-side, and then when\n// needed on the server side, we'll fetch it differently.\n\nlet clientChunkGroups;\nif (_isomorphy__WEBPACK_IMPORTED_MODULE_3__.IS_CLIENT_SIDE) {\n // eslint-disable-next-line global-require\n clientChunkGroups = (__webpack_require__(/*! ../../client/getInj */ \"./src/client/getInj.ts\")[\"default\"])().CHUNK_GROUPS || {};\n}\nconst refCounts = {};\nfunction getPublicPath() {\n return (0,_isomorphy__WEBPACK_IMPORTED_MODULE_3__.getBuildInfo)().publicPath;\n}\n\n/**\n * Client-side only! Ensures the specified CSS stylesheet is loaded into\n * the document; loads if it is missing; and does simple reference counting\n * to facilitate future clean-up.\n * @param name\n * @param loadedSheets\n * @param refCount\n * @return\n */\nfunction bookStyleSheet(name, loadedSheets, refCount) {\n let res;\n const path = `${getPublicPath()}/${name}`;\n const fullPath = `${document.location.origin}${path}`;\n if (!loadedSheets.has(fullPath)) {\n let link = document.querySelector(`link[href=\"${path}\"]`);\n if (!link) {\n link = document.createElement('link');\n link.setAttribute('rel', 'stylesheet');\n link.setAttribute('href', path);\n document.head.appendChild(link);\n }\n res = new _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_1__.Barrier();\n link.addEventListener('load', () => res.resolve());\n link.addEventListener('error', () => res.resolve());\n }\n if (refCount) {\n const current = refCounts[path] || 0;\n refCounts[path] = 1 + current;\n }\n return res;\n}\n\n/**\n * Generates the set of URLs for currently loaded, linked stylesheets.\n * @return\n */\nfunction getLoadedStyleSheets() {\n const res = new Set();\n const {\n styleSheets\n } = document;\n for (let i = 0; i < styleSheets.length; ++i) {\n var _styleSheets$i;\n const href = (_styleSheets$i = styleSheets[i]) === null || _styleSheets$i === void 0 ? void 0 : _styleSheets$i.href;\n if (href) res.add(href);\n }\n return res;\n}\nfunction assertChunkName(chunkName, chunkGroups) {\n if (chunkGroups[chunkName]) return;\n throw Error(`Unknown chunk name \"${chunkName}\"`);\n}\n\n/**\n * Client-side only! Ensures all CSS stylesheets required for the specified\n * code chunk are loaded into the document; loads the missing ones; and does\n * simple reference counting to facilitate future clean-up.\n * @param chunkName Chunk name.\n * @param refCount\n * @return Resolves once all pending stylesheets, necessary for\n * the chunk, are either loaded, or failed to load.\n */\nfunction bookStyleSheets(chunkName, chunkGroups, refCount) {\n const promises = [];\n const assets = chunkGroups[chunkName];\n if (!assets) return Promise.resolve();\n const loadedSheets = getLoadedStyleSheets();\n for (let i = 0; i < assets.length; ++i) {\n const asset = assets[i];\n if (asset !== null && asset !== void 0 && asset.endsWith('.css')) {\n const promise = bookStyleSheet(asset, loadedSheets, refCount);\n if (promise) promises.push(promise);\n }\n }\n return promises.length ? Promise.allSettled(promises).then() : Promise.resolve();\n}\n\n/**\n * Client-side only! Frees from the document all CSS stylesheets that are\n * required by the specified chunk, and have reference counter equal to one\n * (for chunks with larger reference counter values, it just decrements\n * the reference counter).\n * @param {string} chunkName\n */\nfunction freeStyleSheets(chunkName, chunkGroups) {\n const assets = chunkGroups[chunkName];\n if (!assets) return;\n for (let i = 0; i < assets.length; ++i) {\n const asset = assets[i];\n if (asset !== null && asset !== void 0 && asset.endsWith('.css')) {\n const path = `${getPublicPath()}/${asset}`;\n const pathRefCount = refCounts[path];\n if (pathRefCount) {\n if (pathRefCount <= 1) {\n document.head.querySelector(`link[href=\"${path}\"]`).remove();\n delete refCounts[path];\n } else refCounts[path] = pathRefCount - 1;\n }\n }\n }\n}\n\n// Holds the set of chunk names already used for splitComponent() calls.\nconst usedChunkNames = new Set();\n/**\n * Given an async component retrieval function `getComponent()` it creates\n * a special \"code split\" component, which uses <Suspense> to asynchronously\n * load on demand the code required by `getComponent()`.\n * @param options\n * @param options.chunkName\n * @param {function} options.getComponent\n * @param {React.Element} [options.placeholder]\n * @return {React.ElementType}\n */\nfunction splitComponent(_ref) {\n let {\n chunkName,\n getComponent,\n placeholder\n } = _ref;\n // On the client side we can check right away if the chunk name is known.\n if (_isomorphy__WEBPACK_IMPORTED_MODULE_3__.IS_CLIENT_SIDE) assertChunkName(chunkName, clientChunkGroups);\n\n // The correct usage of splitComponent() assumes a single call per chunk.\n if (usedChunkNames.has(chunkName)) {\n throw Error(`Repeated splitComponent() call for the chunk \"${chunkName}\"`);\n } else usedChunkNames.add(chunkName);\n const LazyComponent = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.lazy)(async () => {\n const resolved = await getComponent();\n const Component = 'default' in resolved ? resolved.default : resolved;\n\n // This pre-loads necessary stylesheets prior to the first mount of\n // the component (the lazy load function is executed by React one at\n // the frist mount).\n if (_isomorphy__WEBPACK_IMPORTED_MODULE_3__.IS_CLIENT_SIDE) {\n await bookStyleSheets(chunkName, clientChunkGroups, false);\n }\n const Wrapper = _ref2 => {\n let {\n children,\n ref,\n ...rest\n } = _ref2;\n // On the server side we'll assert the chunk name here,\n // and also push it to the SSR chunks array.\n if (_isomorphy__WEBPACK_IMPORTED_MODULE_3__.IS_SERVER_SIDE) {\n const {\n chunkGroups,\n chunks\n } = (0,_globalState__WEBPACK_IMPORTED_MODULE_2__.getSsrContext)();\n assertChunkName(chunkName, chunkGroups);\n if (!chunks.includes(chunkName)) chunks.push(chunkName);\n }\n\n // This takes care about stylesheets management every time an instance of\n // this component is mounted / unmounted.\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useInsertionEffect)(() => {\n bookStyleSheets(chunkName, clientChunkGroups, true);\n return () => freeStyleSheets(chunkName, clientChunkGroups);\n }, []);\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(Component, {\n ...rest,\n ref: ref,\n children: children\n });\n };\n return {\n default: Wrapper\n };\n });\n const CodeSplit = _ref3 => {\n let {\n children,\n ...rest\n } = _ref3;\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react__WEBPACK_IMPORTED_MODULE_0__.Suspense, {\n fallback: placeholder,\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(LazyComponent, {\n ...rest,\n children: children\n })\n });\n };\n return CodeSplit;\n}\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/splitComponent.tsx?");
|
|
330
360
|
|
|
331
361
|
/***/ }),
|
|
@@ -336,6 +366,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
336
366
|
\**********************************/
|
|
337
367
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
338
368
|
|
|
369
|
+
"use strict";
|
|
339
370
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ useCurrent: function() { return /* binding */ useCurrent; },\n/* harmony export */ useTimezoneOffset: function() { return /* binding */ useTimezoneOffset; }\n/* harmony export */ });\n/* harmony import */ var cookie__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! cookie */ \"cookie\");\n/* harmony import */ var cookie__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(cookie__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dayjs */ \"dayjs\");\n/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @dr.pogodin/js-utils */ \"@dr.pogodin/js-utils\");\n/* harmony import */ var _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @dr.pogodin/react-global-state */ \"@dr.pogodin/react-global-state\");\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _globalState__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./globalState */ \"./src/shared/utils/globalState.ts\");\n\n\n\n\n\n\n\n/**\n * This react hook wraps Date.now() function in a SSR friendly way,\n * ensuring that all calls to useCurrent() within the same render return\n * exactly the same time (which is retrieved from Date.now() first, and\n * then stored in the global state to be reused in all other calls), which\n * is also passed and used in the first client side render, and then updated\n * with a finite precision to avoid infinite re-rendering loops.\n */\n// TODO: Should we request the state type as generic parameter, to be able\n// to verify the give globalStatePath is correct?\nfunction useCurrent() {\n let {\n autorefresh = false,\n globalStatePath = 'currentTime',\n precision = 5 * _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_3__.SEC_MS\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const [now, setter] = (0,_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.useGlobalState)(globalStatePath, Date.now);\n (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {\n let timerId;\n const update = () => {\n setter(old => {\n const neu = Date.now();\n return Math.abs(neu - old) > precision ? neu : old;\n });\n if (autorefresh) timerId = setTimeout(update, precision);\n };\n update();\n return () => {\n if (timerId) clearTimeout(timerId);\n };\n }, [autorefresh, precision, setter]);\n return now;\n}\n\n/**\n * Wraps the standard Date.getTimezoneOffset() method in a SSR-friendly way.\n * This hook retrieves the offset value at the client side and uses a cookie\n * to pass it to the server in subsequent requests from that user. At the server\n * side the value from cookie is used in renders and passed back to the client\n * via the global state. Prior to the value being known (in the very first\n * request from the user, when the cookie is still missing), zero value is used\n * as the default value.\n */\n// TODO: Should we request the state type as generic parameter, to be able\n// to verify the give globalStatePath is correct?\nfunction useTimezoneOffset() {\n let {\n cookieName = 'timezoneOffset',\n globalStatePath = 'timezoneOffset'\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const ssrContext = (0,_globalState__WEBPACK_IMPORTED_MODULE_5__.getSsrContext)(false);\n const [offset, setOffset] = (0,_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.useGlobalState)(globalStatePath, () => {\n var _ssrContext$req;\n const value = cookieName && (ssrContext === null || ssrContext === void 0 || (_ssrContext$req = ssrContext.req) === null || _ssrContext$req === void 0 || (_ssrContext$req = _ssrContext$req.cookies) === null || _ssrContext$req === void 0 ? void 0 : _ssrContext$req[cookieName]);\n return value ? parseInt(value, 10) : 0;\n });\n (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {\n const date = new Date();\n const value = date.getTimezoneOffset();\n setOffset(value);\n if (cookieName) {\n document.cookie = (0,cookie__WEBPACK_IMPORTED_MODULE_0__.serialize)(cookieName, value.toString(), {\n path: '/'\n });\n }\n }, [cookieName, setOffset]);\n return offset;\n}\nconst time = {\n DAY_MS: _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_3__.DAY_MS,\n HOUR_MS: _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_3__.HOUR_MS,\n MIN_MS: _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_3__.MIN_MS,\n SEC_MS: _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_3__.SEC_MS,\n YEAR_MS: _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_3__.YEAR_MS,\n now: Date.now,\n timer: _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_3__.timer,\n useCurrent,\n useTimezoneOffset\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object.assign((dayjs__WEBPACK_IMPORTED_MODULE_1___default()), time));\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/time.ts?");
|
|
340
371
|
|
|
341
372
|
/***/ }),
|
|
@@ -346,6 +377,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
346
377
|
\*************************************/
|
|
347
378
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
348
379
|
|
|
380
|
+
"use strict";
|
|
349
381
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ requireWeak: function() { return /* binding */ requireWeak; },\n/* harmony export */ resolveWeak: function() { return /* binding */ resolveWeak; }\n/* harmony export */ });\n/* harmony import */ var _isomorphy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isomorphy */ \"./src/shared/utils/isomorphy/index.ts\");\n\n\n/**\n * Requires the specified module without including it into the bundle during\n * Webpack build.\n * @param modulePath\n * @param [basePath]\n * @return Required module.\n */\nfunction requireWeak(modulePath, basePath) {\n if (_isomorphy__WEBPACK_IMPORTED_MODULE_0__.IS_CLIENT_SIDE) return null;\n try {\n /* eslint-disable no-eval */\n const {\n resolve\n } = eval('require')('path');\n const path = basePath ? resolve(basePath, modulePath) : modulePath;\n const module = eval('require')(path);\n /* eslint-enable no-eval */\n\n if (!('default' in module)) return module;\n const {\n default: def,\n ...named\n } = module;\n const res = def;\n Object.entries(named).forEach(_ref => {\n let [name, value] = _ref;\n const assigned = res[name];\n if (assigned !== undefined) {\n if (assigned !== value) {\n throw Error('Conflict between default and named exports');\n }\n } else res[name] = value;\n });\n return res;\n } catch {\n return null;\n }\n}\n\n/**\n * Resolves specified module path with help of Babel's module resolver.\n * Yes, the function itself just returns its argument to the caller, but Babel\n * is configured to resolve the first argument of resolveWeak(..) function, thus\n * the result will be the resolved path.\n * @param {string} modulePath\n * @return {string} Absolute or relative path to the module.\n */\nfunction resolveWeak(modulePath) {\n return modulePath;\n}\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/webpack.ts?");
|
|
350
382
|
|
|
351
383
|
/***/ }),
|
|
@@ -356,6 +388,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
356
388
|
\*************************************************/
|
|
357
389
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
358
390
|
|
|
391
|
+
"use strict";
|
|
359
392
|
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\"context\":\"-dr-pogodin-react-utils___src-shared-components-Button-style___context___KM0v4f\",\"ad\":\"-dr-pogodin-react-utils___src-shared-components-Button-style___ad___3jm1-Q\",\"hoc\":\"-dr-pogodin-react-utils___src-shared-components-Button-style___hoc___0plpDL\",\"button\":\"-dr-pogodin-react-utils___src-shared-components-Button-style___button___E1FNQT\",\"active\":\"-dr-pogodin-react-utils___src-shared-components-Button-style___active___MAe9O6\",\"disabled\":\"-dr-pogodin-react-utils___src-shared-components-Button-style___disabled___Br9IWV\"});\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/Button/style.scss?");
|
|
360
393
|
|
|
361
394
|
/***/ }),
|
|
@@ -366,6 +399,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extr
|
|
|
366
399
|
\***************************************************/
|
|
367
400
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
368
401
|
|
|
402
|
+
"use strict";
|
|
369
403
|
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\"checkbox\":\"-dr-pogodin-react-utils___src-shared-components-Checkbox-theme___checkbox___A-f8qJ\",\"context\":\"-dr-pogodin-react-utils___src-shared-components-Checkbox-theme___context___dNQcC6\",\"ad\":\"-dr-pogodin-react-utils___src-shared-components-Checkbox-theme___ad___earXxa\",\"hoc\":\"-dr-pogodin-react-utils___src-shared-components-Checkbox-theme___hoc___qAPfQ6\",\"indeterminate\":\"-dr-pogodin-react-utils___src-shared-components-Checkbox-theme___indeterminate___N9bCb8\",\"container\":\"-dr-pogodin-react-utils___src-shared-components-Checkbox-theme___container___Kr0g3M\",\"label\":\"-dr-pogodin-react-utils___src-shared-components-Checkbox-theme___label___3dML-O\",\"disabled\":\"-dr-pogodin-react-utils___src-shared-components-Checkbox-theme___disabled___EzQra1\"});\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/Checkbox/theme.scss?");
|
|
370
404
|
|
|
371
405
|
/***/ }),
|
|
@@ -376,6 +410,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extr
|
|
|
376
410
|
\******************************************************/
|
|
377
411
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
378
412
|
|
|
413
|
+
"use strict";
|
|
379
414
|
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\"link\":\"-dr-pogodin-react-utils___src-shared-components-GenericLink-style___link___zH52sA\"});\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/GenericLink/style.scss?");
|
|
380
415
|
|
|
381
416
|
/***/ }),
|
|
@@ -386,6 +421,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extr
|
|
|
386
421
|
\************************************************/
|
|
387
422
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
388
423
|
|
|
424
|
+
"use strict";
|
|
389
425
|
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\"container\":\"-dr-pogodin-react-utils___src-shared-components-Input-theme___container___Cxx397\",\"context\":\"-dr-pogodin-react-utils___src-shared-components-Input-theme___context___X5WszA\",\"ad\":\"-dr-pogodin-react-utils___src-shared-components-Input-theme___ad___8s7GCr\",\"hoc\":\"-dr-pogodin-react-utils___src-shared-components-Input-theme___hoc___TVlBYc\",\"input\":\"-dr-pogodin-react-utils___src-shared-components-Input-theme___input___M07d4s\",\"label\":\"-dr-pogodin-react-utils___src-shared-components-Input-theme___label___gfbdq-\"});\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/Input/theme.scss?");
|
|
390
426
|
|
|
391
427
|
/***/ }),
|
|
@@ -396,6 +432,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extr
|
|
|
396
432
|
\*****************************************************/
|
|
397
433
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
398
434
|
|
|
435
|
+
"use strict";
|
|
399
436
|
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\"overlay\":\"-dr-pogodin-react-utils___src-shared-components-Modal-base-theme___overlay___ye2BZo\",\"context\":\"-dr-pogodin-react-utils___src-shared-components-Modal-base-theme___context___Szmbbz\",\"ad\":\"-dr-pogodin-react-utils___src-shared-components-Modal-base-theme___ad___Ah-Nsc\",\"hoc\":\"-dr-pogodin-react-utils___src-shared-components-Modal-base-theme___hoc___Wki41G\",\"container\":\"-dr-pogodin-react-utils___src-shared-components-Modal-base-theme___container___gyZ4rc\"});\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/Modal/base-theme.scss?");
|
|
400
437
|
|
|
401
438
|
/***/ }),
|
|
@@ -406,6 +443,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extr
|
|
|
406
443
|
\*************************************************/
|
|
407
444
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
408
445
|
|
|
446
|
+
"use strict";
|
|
409
447
|
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\"scrollingDisabledByModal\":\"-dr-pogodin-react-utils___src-shared-components-Modal-styles___scrollingDisabledByModal___5fRFtF\"});\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/Modal/styles.scss?");
|
|
410
448
|
|
|
411
449
|
/***/ }),
|
|
@@ -416,6 +454,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extr
|
|
|
416
454
|
\**********************************************************/
|
|
417
455
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
418
456
|
|
|
457
|
+
"use strict";
|
|
419
458
|
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\"container\":\"-dr-pogodin-react-utils___src-shared-components-PageLayout-base-theme___container___T3cuHB\",\"context\":\"-dr-pogodin-react-utils___src-shared-components-PageLayout-base-theme___context___m4mL-M\",\"ad\":\"-dr-pogodin-react-utils___src-shared-components-PageLayout-base-theme___ad___m3-mdC\",\"hoc\":\"-dr-pogodin-react-utils___src-shared-components-PageLayout-base-theme___hoc___J15Z4H\",\"mainPanel\":\"-dr-pogodin-react-utils___src-shared-components-PageLayout-base-theme___mainPanel___pPlQO2\",\"sidePanel\":\"-dr-pogodin-react-utils___src-shared-components-PageLayout-base-theme___sidePanel___lqNh4h\"});\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/PageLayout/base-theme.scss?");
|
|
420
459
|
|
|
421
460
|
/***/ }),
|
|
@@ -426,6 +465,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extr
|
|
|
426
465
|
\***************************************************/
|
|
427
466
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
428
467
|
|
|
468
|
+
"use strict";
|
|
429
469
|
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\"container\":\"-dr-pogodin-react-utils___src-shared-components-TextArea-style___container___dzMVIB\",\"context\":\"-dr-pogodin-react-utils___src-shared-components-TextArea-style___context___KVPc7g\",\"ad\":\"-dr-pogodin-react-utils___src-shared-components-TextArea-style___ad___z2GQ0Z\",\"hoc\":\"-dr-pogodin-react-utils___src-shared-components-TextArea-style___hoc___8R1Qdj\",\"textarea\":\"-dr-pogodin-react-utils___src-shared-components-TextArea-style___textarea___zd-OFg\",\"hidden\":\"-dr-pogodin-react-utils___src-shared-components-TextArea-style___hidden___GiHBXI\"});\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/TextArea/style.scss?");
|
|
430
470
|
|
|
431
471
|
/***/ }),
|
|
@@ -436,6 +476,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extr
|
|
|
436
476
|
\***************************************************/
|
|
437
477
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
438
478
|
|
|
479
|
+
"use strict";
|
|
439
480
|
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\"container\":\"-dr-pogodin-react-utils___src-shared-components-Throbber-theme___container___7zdld4\",\"context\":\"-dr-pogodin-react-utils___src-shared-components-Throbber-theme___context___uIObt7\",\"ad\":\"-dr-pogodin-react-utils___src-shared-components-Throbber-theme___ad___XIxe9o\",\"hoc\":\"-dr-pogodin-react-utils___src-shared-components-Throbber-theme___hoc___YOyORH\",\"circle\":\"-dr-pogodin-react-utils___src-shared-components-Throbber-theme___circle___dBrB4g\",\"bouncing\":\"-dr-pogodin-react-utils___src-shared-components-Throbber-theme___bouncing___TJe-6j\"});\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/Throbber/theme.scss?");
|
|
440
481
|
|
|
441
482
|
/***/ }),
|
|
@@ -446,6 +487,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extr
|
|
|
446
487
|
\**************************************************************/
|
|
447
488
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
448
489
|
|
|
490
|
+
"use strict";
|
|
449
491
|
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\"ad\":\"-dr-pogodin-react-utils___src-shared-components-WithTooltip-default-theme___ad___4xT7zE\",\"hoc\":\"-dr-pogodin-react-utils___src-shared-components-WithTooltip-default-theme___hoc___zd-vnH\",\"context\":\"-dr-pogodin-react-utils___src-shared-components-WithTooltip-default-theme___context___GdZucr\",\"arrow\":\"-dr-pogodin-react-utils___src-shared-components-WithTooltip-default-theme___arrow___M9gywF\",\"container\":\"-dr-pogodin-react-utils___src-shared-components-WithTooltip-default-theme___container___f9gY8K\",\"appearance\":\"-dr-pogodin-react-utils___src-shared-components-WithTooltip-default-theme___appearance___L4ubm-\",\"wrapper\":\"-dr-pogodin-react-utils___src-shared-components-WithTooltip-default-theme___wrapper___4qDBRM\"});\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/WithTooltip/default-theme.scss?");
|
|
450
492
|
|
|
451
493
|
/***/ }),
|
|
@@ -456,6 +498,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extr
|
|
|
456
498
|
\******************************************************/
|
|
457
499
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
458
500
|
|
|
501
|
+
"use strict";
|
|
459
502
|
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\"container\":\"-dr-pogodin-react-utils___src-shared-components-YouTubeVideo-base___container___sXHM81\",\"context\":\"-dr-pogodin-react-utils___src-shared-components-YouTubeVideo-base___context___veKyYi\",\"ad\":\"-dr-pogodin-react-utils___src-shared-components-YouTubeVideo-base___ad___r3ABzd\",\"hoc\":\"-dr-pogodin-react-utils___src-shared-components-YouTubeVideo-base___hoc___YKcPnR\",\"video\":\"-dr-pogodin-react-utils___src-shared-components-YouTubeVideo-base___video___SlV2zw\"});\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/YouTubeVideo/base.scss?");
|
|
460
503
|
|
|
461
504
|
/***/ }),
|
|
@@ -466,6 +509,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extr
|
|
|
466
509
|
\**********************************************************/
|
|
467
510
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
468
511
|
|
|
512
|
+
"use strict";
|
|
469
513
|
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\"container\":\"-dr-pogodin-react-utils___src-shared-components-YouTubeVideo-throbber___container___jTxmOX\",\"context\":\"-dr-pogodin-react-utils___src-shared-components-YouTubeVideo-throbber___context___dzIcLh\",\"ad\":\"-dr-pogodin-react-utils___src-shared-components-YouTubeVideo-throbber___ad___5a9XX1\",\"hoc\":\"-dr-pogodin-react-utils___src-shared-components-YouTubeVideo-throbber___hoc___7sH52O\"});\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/YouTubeVideo/throbber.scss?");
|
|
470
514
|
|
|
471
515
|
/***/ }),
|
|
@@ -476,6 +520,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extr
|
|
|
476
520
|
\***************************************************************************/
|
|
477
521
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
478
522
|
|
|
523
|
+
"use strict";
|
|
479
524
|
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\"overlay\":\"-dr-pogodin-react-utils___src-shared-components-selectors-CustomDropdown-Options-style___overlay___jKsMKG\"});\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/selectors/CustomDropdown/Options/style.scss?");
|
|
480
525
|
|
|
481
526
|
/***/ }),
|
|
@@ -486,6 +531,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extr
|
|
|
486
531
|
\*******************************************************************/
|
|
487
532
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
488
533
|
|
|
534
|
+
"use strict";
|
|
489
535
|
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\"container\":\"-dr-pogodin-react-utils___src-shared-components-selectors-CustomDropdown-theme___container___oQKv0Y\",\"context\":\"-dr-pogodin-react-utils___src-shared-components-selectors-CustomDropdown-theme___context___9Tod5r\",\"ad\":\"-dr-pogodin-react-utils___src-shared-components-selectors-CustomDropdown-theme___ad___R58zIg\",\"hoc\":\"-dr-pogodin-react-utils___src-shared-components-selectors-CustomDropdown-theme___hoc___O-Tp1i\",\"label\":\"-dr-pogodin-react-utils___src-shared-components-selectors-CustomDropdown-theme___label___YUPUNs\",\"dropdown\":\"-dr-pogodin-react-utils___src-shared-components-selectors-CustomDropdown-theme___dropdown___pNEyAA\",\"option\":\"-dr-pogodin-react-utils___src-shared-components-selectors-CustomDropdown-theme___option___LD2Kzy\",\"select\":\"-dr-pogodin-react-utils___src-shared-components-selectors-CustomDropdown-theme___select___LP5azC\",\"arrow\":\"-dr-pogodin-react-utils___src-shared-components-selectors-CustomDropdown-theme___arrow___-wscve\",\"active\":\"-dr-pogodin-react-utils___src-shared-components-selectors-CustomDropdown-theme___active___k2UDsV\",\"upward\":\"-dr-pogodin-react-utils___src-shared-components-selectors-CustomDropdown-theme___upward___HWRvu4\"});\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/selectors/CustomDropdown/theme.scss?");
|
|
490
536
|
|
|
491
537
|
/***/ }),
|
|
@@ -496,6 +542,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extr
|
|
|
496
542
|
\*******************************************************************/
|
|
497
543
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
498
544
|
|
|
545
|
+
"use strict";
|
|
499
546
|
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\"dropdown\":\"-dr-pogodin-react-utils___src-shared-components-selectors-NativeDropdown-theme___dropdown___kI9A9U\",\"context\":\"-dr-pogodin-react-utils___src-shared-components-selectors-NativeDropdown-theme___context___xHyZo4\",\"ad\":\"-dr-pogodin-react-utils___src-shared-components-selectors-NativeDropdown-theme___ad___ADu59e\",\"hoc\":\"-dr-pogodin-react-utils___src-shared-components-selectors-NativeDropdown-theme___hoc___FTP2bb\",\"arrow\":\"-dr-pogodin-react-utils___src-shared-components-selectors-NativeDropdown-theme___arrow___DubGkT\",\"container\":\"-dr-pogodin-react-utils___src-shared-components-selectors-NativeDropdown-theme___container___WtSZPd\",\"active\":\"-dr-pogodin-react-utils___src-shared-components-selectors-NativeDropdown-theme___active___ayMn7O\",\"label\":\"-dr-pogodin-react-utils___src-shared-components-selectors-NativeDropdown-theme___label___K7JYKw\",\"option\":\"-dr-pogodin-react-utils___src-shared-components-selectors-NativeDropdown-theme___option___27pZ6W\",\"hiddenOption\":\"-dr-pogodin-react-utils___src-shared-components-selectors-NativeDropdown-theme___hiddenOption___clAKFJ\",\"select\":\"-dr-pogodin-react-utils___src-shared-components-selectors-NativeDropdown-theme___select___N0Fc14\",\"invalid\":\"-dr-pogodin-react-utils___src-shared-components-selectors-NativeDropdown-theme___invalid___wL4umU\"});\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/selectors/NativeDropdown/theme.scss?");
|
|
500
547
|
|
|
501
548
|
/***/ }),
|
|
@@ -506,6 +553,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extr
|
|
|
506
553
|
\***********************************************************/
|
|
507
554
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
508
555
|
|
|
556
|
+
"use strict";
|
|
509
557
|
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\"container\":\"-dr-pogodin-react-utils___src-shared-components-selectors-Switch-theme___container___AWNvRj\",\"context\":\"-dr-pogodin-react-utils___src-shared-components-selectors-Switch-theme___context___VMHfnP\",\"ad\":\"-dr-pogodin-react-utils___src-shared-components-selectors-Switch-theme___ad___HNliRC\",\"hoc\":\"-dr-pogodin-react-utils___src-shared-components-selectors-Switch-theme___hoc___2Ue-db\",\"option\":\"-dr-pogodin-react-utils___src-shared-components-selectors-Switch-theme___option___fUfIAd\",\"selected\":\"-dr-pogodin-react-utils___src-shared-components-selectors-Switch-theme___selected___Wco-qk\",\"options\":\"-dr-pogodin-react-utils___src-shared-components-selectors-Switch-theme___options___CZYtcC\"});\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/selectors/Switch/theme.scss?");
|
|
510
558
|
|
|
511
559
|
/***/ }),
|
|
@@ -516,16 +564,50 @@ eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extr
|
|
|
516
564
|
\********************************/
|
|
517
565
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
518
566
|
|
|
567
|
+
"use strict";
|
|
519
568
|
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n/* harmony default export */ __webpack_exports__[\"default\"] = ({});\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/styles/global.scss?");
|
|
520
569
|
|
|
521
570
|
/***/ }),
|
|
522
571
|
|
|
572
|
+
/***/ "./node_modules/invariant/browser.js":
|
|
573
|
+
/*!*******************************************!*\
|
|
574
|
+
!*** ./node_modules/invariant/browser.js ***!
|
|
575
|
+
\*******************************************/
|
|
576
|
+
/***/ (function(module) {
|
|
577
|
+
|
|
578
|
+
"use strict";
|
|
579
|
+
eval("/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar invariant = function(condition, format, a, b, c, d, e, f) {\n if (true) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n }\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error(\n 'Minified exception occurred; use the non-minified dev environment ' +\n 'for the full error message and additional helpful warnings.'\n );\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(\n format.replace(/%s/g, function() { return args[argIndex++]; })\n );\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n};\n\nmodule.exports = invariant;\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./node_modules/invariant/browser.js?");
|
|
580
|
+
|
|
581
|
+
/***/ }),
|
|
582
|
+
|
|
583
|
+
/***/ "./node_modules/react-fast-compare/index.js":
|
|
584
|
+
/*!**************************************************!*\
|
|
585
|
+
!*** ./node_modules/react-fast-compare/index.js ***!
|
|
586
|
+
\**************************************************/
|
|
587
|
+
/***/ (function(module) {
|
|
588
|
+
|
|
589
|
+
eval("/* global Map:readonly, Set:readonly, ArrayBuffer:readonly */\n\nvar hasElementType = typeof Element !== 'undefined';\nvar hasMap = typeof Map === 'function';\nvar hasSet = typeof Set === 'function';\nvar hasArrayBuffer = typeof ArrayBuffer === 'function' && !!ArrayBuffer.isView;\n\n// Note: We **don't** need `envHasBigInt64Array` in fde es6/index.js\n\nfunction equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.3\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n // START: Modifications:\n // Apply guards for `Object.create(null)` handling. See:\n // - https://github.com/FormidableLabs/react-fast-compare/issues/64\n // - https://github.com/epoberezkin/fast-deep-equal/issues/49\n if (a.valueOf !== Object.prototype.valueOf && typeof a.valueOf === 'function' && typeof b.valueOf === 'function') return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString && typeof a.toString === 'function' && typeof b.toString === 'function') return a.toString() === b.toString();\n // END: Modifications\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n}\n// end fast-deep-equal\n\nmodule.exports = function isEqual(a, b) {\n try {\n return equal(a, b);\n } catch (error) {\n if (((error.message || '').match(/stack|recursion/i))) {\n // warn on circular references, don't crash\n // browsers give this different errors name and messages:\n // chrome/safari: \"RangeError\", \"Maximum call stack size exceeded\"\n // firefox: \"InternalError\", too much recursion\"\n // edge: \"Error\", \"Out of stack space\"\n console.warn('react-fast-compare cannot handle circular refs');\n return false;\n }\n // some other error. we should definitely know about these\n throw error;\n }\n};\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./node_modules/react-fast-compare/index.js?");
|
|
590
|
+
|
|
591
|
+
/***/ }),
|
|
592
|
+
|
|
593
|
+
/***/ "./node_modules/react-helmet-async/lib/index.esm.js":
|
|
594
|
+
/*!**********************************************************!*\
|
|
595
|
+
!*** ./node_modules/react-helmet-async/lib/index.esm.js ***!
|
|
596
|
+
\**********************************************************/
|
|
597
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
598
|
+
|
|
599
|
+
"use strict";
|
|
600
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Helmet: function() { return /* binding */ Helmet; },\n/* harmony export */ HelmetData: function() { return /* binding */ HelmetData; },\n/* harmony export */ HelmetProvider: function() { return /* binding */ HelmetProvider; }\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-fast-compare */ \"./node_modules/react-fast-compare/index.js\");\n/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_fast_compare__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\n/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var shallowequal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shallowequal */ \"./node_modules/shallowequal/index.js\");\n/* harmony import */ var shallowequal__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(shallowequal__WEBPACK_IMPORTED_MODULE_3__);\n// src/index.tsx\n\n\n\n\n// src/Provider.tsx\n\n\n// src/server.ts\n\n\n// src/constants.ts\nvar TAG_NAMES = /* @__PURE__ */ ((TAG_NAMES2) => {\n TAG_NAMES2[\"BASE\"] = \"base\";\n TAG_NAMES2[\"BODY\"] = \"body\";\n TAG_NAMES2[\"HEAD\"] = \"head\";\n TAG_NAMES2[\"HTML\"] = \"html\";\n TAG_NAMES2[\"LINK\"] = \"link\";\n TAG_NAMES2[\"META\"] = \"meta\";\n TAG_NAMES2[\"NOSCRIPT\"] = \"noscript\";\n TAG_NAMES2[\"SCRIPT\"] = \"script\";\n TAG_NAMES2[\"STYLE\"] = \"style\";\n TAG_NAMES2[\"TITLE\"] = \"title\";\n TAG_NAMES2[\"FRAGMENT\"] = \"Symbol(react.fragment)\";\n return TAG_NAMES2;\n})(TAG_NAMES || {});\nvar SEO_PRIORITY_TAGS = {\n link: { rel: [\"amphtml\", \"canonical\", \"alternate\"] },\n script: { type: [\"application/ld+json\"] },\n meta: {\n charset: \"\",\n name: [\"generator\", \"robots\", \"description\"],\n property: [\n \"og:type\",\n \"og:title\",\n \"og:url\",\n \"og:image\",\n \"og:image:alt\",\n \"og:description\",\n \"twitter:url\",\n \"twitter:title\",\n \"twitter:description\",\n \"twitter:image\",\n \"twitter:image:alt\",\n \"twitter:card\",\n \"twitter:site\"\n ]\n }\n};\nvar VALID_TAG_NAMES = Object.values(TAG_NAMES);\nvar REACT_TAG_MAP = {\n accesskey: \"accessKey\",\n charset: \"charSet\",\n class: \"className\",\n contenteditable: \"contentEditable\",\n contextmenu: \"contextMenu\",\n \"http-equiv\": \"httpEquiv\",\n itemprop: \"itemProp\",\n tabindex: \"tabIndex\"\n};\nvar HTML_TAG_MAP = Object.entries(REACT_TAG_MAP).reduce(\n (carry, [key, value]) => {\n carry[value] = key;\n return carry;\n },\n {}\n);\nvar HELMET_ATTRIBUTE = \"data-rh\";\n\n// src/utils.ts\nvar HELMET_PROPS = {\n DEFAULT_TITLE: \"defaultTitle\",\n DEFER: \"defer\",\n ENCODE_SPECIAL_CHARACTERS: \"encodeSpecialCharacters\",\n ON_CHANGE_CLIENT_STATE: \"onChangeClientState\",\n TITLE_TEMPLATE: \"titleTemplate\",\n PRIORITIZE_SEO_TAGS: \"prioritizeSeoTags\"\n};\nvar getInnermostProperty = (propsList, property) => {\n for (let i = propsList.length - 1; i >= 0; i -= 1) {\n const props = propsList[i];\n if (Object.prototype.hasOwnProperty.call(props, property)) {\n return props[property];\n }\n }\n return null;\n};\nvar getTitleFromPropsList = (propsList) => {\n let innermostTitle = getInnermostProperty(propsList, \"title\" /* TITLE */);\n const innermostTemplate = getInnermostProperty(propsList, HELMET_PROPS.TITLE_TEMPLATE);\n if (Array.isArray(innermostTitle)) {\n innermostTitle = innermostTitle.join(\"\");\n }\n if (innermostTemplate && innermostTitle) {\n return innermostTemplate.replace(/%s/g, () => innermostTitle);\n }\n const innermostDefaultTitle = getInnermostProperty(propsList, HELMET_PROPS.DEFAULT_TITLE);\n return innermostTitle || innermostDefaultTitle || void 0;\n};\nvar getOnChangeClientState = (propsList) => getInnermostProperty(propsList, HELMET_PROPS.ON_CHANGE_CLIENT_STATE) || (() => {\n});\nvar getAttributesFromPropsList = (tagType, propsList) => propsList.filter((props) => typeof props[tagType] !== \"undefined\").map((props) => props[tagType]).reduce((tagAttrs, current) => ({ ...tagAttrs, ...current }), {});\nvar getBaseTagFromPropsList = (primaryAttributes, propsList) => propsList.filter((props) => typeof props[\"base\" /* BASE */] !== \"undefined\").map((props) => props[\"base\" /* BASE */]).reverse().reduce((innermostBaseTag, tag) => {\n if (!innermostBaseTag.length) {\n const keys = Object.keys(tag);\n for (let i = 0; i < keys.length; i += 1) {\n const attributeKey = keys[i];\n const lowerCaseAttributeKey = attributeKey.toLowerCase();\n if (primaryAttributes.indexOf(lowerCaseAttributeKey) !== -1 && tag[lowerCaseAttributeKey]) {\n return innermostBaseTag.concat(tag);\n }\n }\n }\n return innermostBaseTag;\n}, []);\nvar warn = (msg) => console && typeof console.warn === \"function\" && console.warn(msg);\nvar getTagsFromPropsList = (tagName, primaryAttributes, propsList) => {\n const approvedSeenTags = {};\n return propsList.filter((props) => {\n if (Array.isArray(props[tagName])) {\n return true;\n }\n if (typeof props[tagName] !== \"undefined\") {\n warn(\n `Helmet: ${tagName} should be of type \"Array\". Instead found type \"${typeof props[tagName]}\"`\n );\n }\n return false;\n }).map((props) => props[tagName]).reverse().reduce((approvedTags, instanceTags) => {\n const instanceSeenTags = {};\n instanceTags.filter((tag) => {\n let primaryAttributeKey;\n const keys2 = Object.keys(tag);\n for (let i = 0; i < keys2.length; i += 1) {\n const attributeKey = keys2[i];\n const lowerCaseAttributeKey = attributeKey.toLowerCase();\n if (primaryAttributes.indexOf(lowerCaseAttributeKey) !== -1 && !(primaryAttributeKey === \"rel\" /* REL */ && tag[primaryAttributeKey].toLowerCase() === \"canonical\") && !(lowerCaseAttributeKey === \"rel\" /* REL */ && tag[lowerCaseAttributeKey].toLowerCase() === \"stylesheet\")) {\n primaryAttributeKey = lowerCaseAttributeKey;\n }\n if (primaryAttributes.indexOf(attributeKey) !== -1 && (attributeKey === \"innerHTML\" /* INNER_HTML */ || attributeKey === \"cssText\" /* CSS_TEXT */ || attributeKey === \"itemprop\" /* ITEM_PROP */)) {\n primaryAttributeKey = attributeKey;\n }\n }\n if (!primaryAttributeKey || !tag[primaryAttributeKey]) {\n return false;\n }\n const value = tag[primaryAttributeKey].toLowerCase();\n if (!approvedSeenTags[primaryAttributeKey]) {\n approvedSeenTags[primaryAttributeKey] = {};\n }\n if (!instanceSeenTags[primaryAttributeKey]) {\n instanceSeenTags[primaryAttributeKey] = {};\n }\n if (!approvedSeenTags[primaryAttributeKey][value]) {\n instanceSeenTags[primaryAttributeKey][value] = true;\n return true;\n }\n return false;\n }).reverse().forEach((tag) => approvedTags.push(tag));\n const keys = Object.keys(instanceSeenTags);\n for (let i = 0; i < keys.length; i += 1) {\n const attributeKey = keys[i];\n const tagUnion = {\n ...approvedSeenTags[attributeKey],\n ...instanceSeenTags[attributeKey]\n };\n approvedSeenTags[attributeKey] = tagUnion;\n }\n return approvedTags;\n }, []).reverse();\n};\nvar getAnyTrueFromPropsList = (propsList, checkedTag) => {\n if (Array.isArray(propsList) && propsList.length) {\n for (let index = 0; index < propsList.length; index += 1) {\n const prop = propsList[index];\n if (prop[checkedTag]) {\n return true;\n }\n }\n }\n return false;\n};\nvar reducePropsToState = (propsList) => ({\n baseTag: getBaseTagFromPropsList([\"href\" /* HREF */], propsList),\n bodyAttributes: getAttributesFromPropsList(\"bodyAttributes\" /* BODY */, propsList),\n defer: getInnermostProperty(propsList, HELMET_PROPS.DEFER),\n encode: getInnermostProperty(propsList, HELMET_PROPS.ENCODE_SPECIAL_CHARACTERS),\n htmlAttributes: getAttributesFromPropsList(\"htmlAttributes\" /* HTML */, propsList),\n linkTags: getTagsFromPropsList(\n \"link\" /* LINK */,\n [\"rel\" /* REL */, \"href\" /* HREF */],\n propsList\n ),\n metaTags: getTagsFromPropsList(\n \"meta\" /* META */,\n [\n \"name\" /* NAME */,\n \"charset\" /* CHARSET */,\n \"http-equiv\" /* HTTPEQUIV */,\n \"property\" /* PROPERTY */,\n \"itemprop\" /* ITEM_PROP */\n ],\n propsList\n ),\n noscriptTags: getTagsFromPropsList(\"noscript\" /* NOSCRIPT */, [\"innerHTML\" /* INNER_HTML */], propsList),\n onChangeClientState: getOnChangeClientState(propsList),\n scriptTags: getTagsFromPropsList(\n \"script\" /* SCRIPT */,\n [\"src\" /* SRC */, \"innerHTML\" /* INNER_HTML */],\n propsList\n ),\n styleTags: getTagsFromPropsList(\"style\" /* STYLE */, [\"cssText\" /* CSS_TEXT */], propsList),\n title: getTitleFromPropsList(propsList),\n titleAttributes: getAttributesFromPropsList(\"titleAttributes\" /* TITLE */, propsList),\n prioritizeSeoTags: getAnyTrueFromPropsList(propsList, HELMET_PROPS.PRIORITIZE_SEO_TAGS)\n});\nvar flattenArray = (possibleArray) => Array.isArray(possibleArray) ? possibleArray.join(\"\") : possibleArray;\nvar checkIfPropsMatch = (props, toMatch) => {\n const keys = Object.keys(props);\n for (let i = 0; i < keys.length; i += 1) {\n if (toMatch[keys[i]] && toMatch[keys[i]].includes(props[keys[i]])) {\n return true;\n }\n }\n return false;\n};\nvar prioritizer = (elementsList, propsToMatch) => {\n if (Array.isArray(elementsList)) {\n return elementsList.reduce(\n (acc, elementAttrs) => {\n if (checkIfPropsMatch(elementAttrs, propsToMatch)) {\n acc.priority.push(elementAttrs);\n } else {\n acc.default.push(elementAttrs);\n }\n return acc;\n },\n { priority: [], default: [] }\n );\n }\n return { default: elementsList, priority: [] };\n};\nvar without = (obj, key) => {\n return {\n ...obj,\n [key]: void 0\n };\n};\n\n// src/server.ts\nvar SELF_CLOSING_TAGS = [\"noscript\" /* NOSCRIPT */, \"script\" /* SCRIPT */, \"style\" /* STYLE */];\nvar encodeSpecialCharacters = (str, encode = true) => {\n if (encode === false) {\n return String(str);\n }\n return String(str).replace(/&/g, \"&\").replace(/</g, \"<\").replace(/>/g, \">\").replace(/\"/g, \""\").replace(/'/g, \"'\");\n};\nvar generateElementAttributesAsString = (attributes) => Object.keys(attributes).reduce((str, key) => {\n const attr = typeof attributes[key] !== \"undefined\" ? `${key}=\"${attributes[key]}\"` : `${key}`;\n return str ? `${str} ${attr}` : attr;\n}, \"\");\nvar generateTitleAsString = (type, title, attributes, encode) => {\n const attributeString = generateElementAttributesAsString(attributes);\n const flattenedTitle = flattenArray(title);\n return attributeString ? `<${type} ${HELMET_ATTRIBUTE}=\"true\" ${attributeString}>${encodeSpecialCharacters(\n flattenedTitle,\n encode\n )}</${type}>` : `<${type} ${HELMET_ATTRIBUTE}=\"true\">${encodeSpecialCharacters(\n flattenedTitle,\n encode\n )}</${type}>`;\n};\nvar generateTagsAsString = (type, tags, encode = true) => tags.reduce((str, t) => {\n const tag = t;\n const attributeHtml = Object.keys(tag).filter(\n (attribute) => !(attribute === \"innerHTML\" /* INNER_HTML */ || attribute === \"cssText\" /* CSS_TEXT */)\n ).reduce((string, attribute) => {\n const attr = typeof tag[attribute] === \"undefined\" ? attribute : `${attribute}=\"${encodeSpecialCharacters(tag[attribute], encode)}\"`;\n return string ? `${string} ${attr}` : attr;\n }, \"\");\n const tagContent = tag.innerHTML || tag.cssText || \"\";\n const isSelfClosing = SELF_CLOSING_TAGS.indexOf(type) === -1;\n return `${str}<${type} ${HELMET_ATTRIBUTE}=\"true\" ${attributeHtml}${isSelfClosing ? `/>` : `>${tagContent}</${type}>`}`;\n}, \"\");\nvar convertElementAttributesToReactProps = (attributes, initProps = {}) => Object.keys(attributes).reduce((obj, key) => {\n const mapped = REACT_TAG_MAP[key];\n obj[mapped || key] = attributes[key];\n return obj;\n}, initProps);\nvar generateTitleAsReactComponent = (_type, title, attributes) => {\n const initProps = {\n key: title,\n [HELMET_ATTRIBUTE]: true\n };\n const props = convertElementAttributesToReactProps(attributes, initProps);\n return [react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"title\" /* TITLE */, props, title)];\n};\nvar generateTagsAsReactComponent = (type, tags) => tags.map((tag, i) => {\n const mappedTag = {\n key: i,\n [HELMET_ATTRIBUTE]: true\n };\n Object.keys(tag).forEach((attribute) => {\n const mapped = REACT_TAG_MAP[attribute];\n const mappedAttribute = mapped || attribute;\n if (mappedAttribute === \"innerHTML\" /* INNER_HTML */ || mappedAttribute === \"cssText\" /* CSS_TEXT */) {\n const content = tag.innerHTML || tag.cssText;\n mappedTag.dangerouslySetInnerHTML = { __html: content };\n } else {\n mappedTag[mappedAttribute] = tag[attribute];\n }\n });\n return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(type, mappedTag);\n});\nvar getMethodsForTag = (type, tags, encode = true) => {\n switch (type) {\n case \"title\" /* TITLE */:\n return {\n toComponent: () => generateTitleAsReactComponent(type, tags.title, tags.titleAttributes),\n toString: () => generateTitleAsString(type, tags.title, tags.titleAttributes, encode)\n };\n case \"bodyAttributes\" /* BODY */:\n case \"htmlAttributes\" /* HTML */:\n return {\n toComponent: () => convertElementAttributesToReactProps(tags),\n toString: () => generateElementAttributesAsString(tags)\n };\n default:\n return {\n toComponent: () => generateTagsAsReactComponent(type, tags),\n toString: () => generateTagsAsString(type, tags, encode)\n };\n }\n};\nvar getPriorityMethods = ({ metaTags, linkTags, scriptTags, encode }) => {\n const meta = prioritizer(metaTags, SEO_PRIORITY_TAGS.meta);\n const link = prioritizer(linkTags, SEO_PRIORITY_TAGS.link);\n const script = prioritizer(scriptTags, SEO_PRIORITY_TAGS.script);\n const priorityMethods = {\n toComponent: () => [\n ...generateTagsAsReactComponent(\"meta\" /* META */, meta.priority),\n ...generateTagsAsReactComponent(\"link\" /* LINK */, link.priority),\n ...generateTagsAsReactComponent(\"script\" /* SCRIPT */, script.priority)\n ],\n toString: () => (\n // generate all the tags as strings and concatenate them\n `${getMethodsForTag(\"meta\" /* META */, meta.priority, encode)} ${getMethodsForTag(\n \"link\" /* LINK */,\n link.priority,\n encode\n )} ${getMethodsForTag(\"script\" /* SCRIPT */, script.priority, encode)}`\n )\n };\n return {\n priorityMethods,\n metaTags: meta.default,\n linkTags: link.default,\n scriptTags: script.default\n };\n};\nvar mapStateOnServer = (props) => {\n const {\n baseTag,\n bodyAttributes,\n encode = true,\n htmlAttributes,\n noscriptTags,\n styleTags,\n title = \"\",\n titleAttributes,\n prioritizeSeoTags\n } = props;\n let { linkTags, metaTags, scriptTags } = props;\n let priorityMethods = {\n toComponent: () => {\n },\n toString: () => \"\"\n };\n if (prioritizeSeoTags) {\n ({ priorityMethods, linkTags, metaTags, scriptTags } = getPriorityMethods(props));\n }\n return {\n priority: priorityMethods,\n base: getMethodsForTag(\"base\" /* BASE */, baseTag, encode),\n bodyAttributes: getMethodsForTag(\"bodyAttributes\" /* BODY */, bodyAttributes, encode),\n htmlAttributes: getMethodsForTag(\"htmlAttributes\" /* HTML */, htmlAttributes, encode),\n link: getMethodsForTag(\"link\" /* LINK */, linkTags, encode),\n meta: getMethodsForTag(\"meta\" /* META */, metaTags, encode),\n noscript: getMethodsForTag(\"noscript\" /* NOSCRIPT */, noscriptTags, encode),\n script: getMethodsForTag(\"script\" /* SCRIPT */, scriptTags, encode),\n style: getMethodsForTag(\"style\" /* STYLE */, styleTags, encode),\n title: getMethodsForTag(\"title\" /* TITLE */, { title, titleAttributes }, encode)\n };\n};\nvar server_default = mapStateOnServer;\n\n// src/HelmetData.ts\nvar instances = [];\nvar isDocument = !!(typeof window !== \"undefined\" && window.document && window.document.createElement);\nvar HelmetData = class {\n instances = [];\n canUseDOM = isDocument;\n context;\n value = {\n setHelmet: (serverState) => {\n this.context.helmet = serverState;\n },\n helmetInstances: {\n get: () => this.canUseDOM ? instances : this.instances,\n add: (instance) => {\n (this.canUseDOM ? instances : this.instances).push(instance);\n },\n remove: (instance) => {\n const index = (this.canUseDOM ? instances : this.instances).indexOf(instance);\n (this.canUseDOM ? instances : this.instances).splice(index, 1);\n }\n }\n };\n constructor(context, canUseDOM) {\n this.context = context;\n this.canUseDOM = canUseDOM || false;\n if (!canUseDOM) {\n context.helmet = server_default({\n baseTag: [],\n bodyAttributes: {},\n encodeSpecialCharacters: true,\n htmlAttributes: {},\n linkTags: [],\n metaTags: [],\n noscriptTags: [],\n scriptTags: [],\n styleTags: [],\n title: \"\",\n titleAttributes: {}\n });\n }\n }\n};\n\n// src/Provider.tsx\nvar defaultValue = {};\nvar Context = react__WEBPACK_IMPORTED_MODULE_0___default().createContext(defaultValue);\nvar HelmetProvider = class _HelmetProvider extends react__WEBPACK_IMPORTED_MODULE_0__.Component {\n static canUseDOM = isDocument;\n helmetData;\n constructor(props) {\n super(props);\n this.helmetData = new HelmetData(this.props.context || {}, _HelmetProvider.canUseDOM);\n }\n render() {\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Context.Provider, { value: this.helmetData.value }, this.props.children);\n }\n};\n\n// src/Dispatcher.tsx\n\n\n\n// src/client.ts\nvar updateTags = (type, tags) => {\n const headElement = document.head || document.querySelector(\"head\" /* HEAD */);\n const tagNodes = headElement.querySelectorAll(`${type}[${HELMET_ATTRIBUTE}]`);\n const oldTags = [].slice.call(tagNodes);\n const newTags = [];\n let indexToDelete;\n if (tags && tags.length) {\n tags.forEach((tag) => {\n const newElement = document.createElement(type);\n for (const attribute in tag) {\n if (Object.prototype.hasOwnProperty.call(tag, attribute)) {\n if (attribute === \"innerHTML\" /* INNER_HTML */) {\n newElement.innerHTML = tag.innerHTML;\n } else if (attribute === \"cssText\" /* CSS_TEXT */) {\n if (newElement.styleSheet) {\n newElement.styleSheet.cssText = tag.cssText;\n } else {\n newElement.appendChild(document.createTextNode(tag.cssText));\n }\n } else {\n const attr = attribute;\n const value = typeof tag[attr] === \"undefined\" ? \"\" : tag[attr];\n newElement.setAttribute(attribute, value);\n }\n }\n }\n newElement.setAttribute(HELMET_ATTRIBUTE, \"true\");\n if (oldTags.some((existingTag, index) => {\n indexToDelete = index;\n return newElement.isEqualNode(existingTag);\n })) {\n oldTags.splice(indexToDelete, 1);\n } else {\n newTags.push(newElement);\n }\n });\n }\n oldTags.forEach((tag) => tag.parentNode?.removeChild(tag));\n newTags.forEach((tag) => headElement.appendChild(tag));\n return {\n oldTags,\n newTags\n };\n};\nvar updateAttributes = (tagName, attributes) => {\n const elementTag = document.getElementsByTagName(tagName)[0];\n if (!elementTag) {\n return;\n }\n const helmetAttributeString = elementTag.getAttribute(HELMET_ATTRIBUTE);\n const helmetAttributes = helmetAttributeString ? helmetAttributeString.split(\",\") : [];\n const attributesToRemove = [...helmetAttributes];\n const attributeKeys = Object.keys(attributes);\n for (const attribute of attributeKeys) {\n const value = attributes[attribute] || \"\";\n if (elementTag.getAttribute(attribute) !== value) {\n elementTag.setAttribute(attribute, value);\n }\n if (helmetAttributes.indexOf(attribute) === -1) {\n helmetAttributes.push(attribute);\n }\n const indexToSave = attributesToRemove.indexOf(attribute);\n if (indexToSave !== -1) {\n attributesToRemove.splice(indexToSave, 1);\n }\n }\n for (let i = attributesToRemove.length - 1; i >= 0; i -= 1) {\n elementTag.removeAttribute(attributesToRemove[i]);\n }\n if (helmetAttributes.length === attributesToRemove.length) {\n elementTag.removeAttribute(HELMET_ATTRIBUTE);\n } else if (elementTag.getAttribute(HELMET_ATTRIBUTE) !== attributeKeys.join(\",\")) {\n elementTag.setAttribute(HELMET_ATTRIBUTE, attributeKeys.join(\",\"));\n }\n};\nvar updateTitle = (title, attributes) => {\n if (typeof title !== \"undefined\" && document.title !== title) {\n document.title = flattenArray(title);\n }\n updateAttributes(\"title\" /* TITLE */, attributes);\n};\nvar commitTagChanges = (newState, cb) => {\n const {\n baseTag,\n bodyAttributes,\n htmlAttributes,\n linkTags,\n metaTags,\n noscriptTags,\n onChangeClientState,\n scriptTags,\n styleTags,\n title,\n titleAttributes\n } = newState;\n updateAttributes(\"body\" /* BODY */, bodyAttributes);\n updateAttributes(\"html\" /* HTML */, htmlAttributes);\n updateTitle(title, titleAttributes);\n const tagUpdates = {\n baseTag: updateTags(\"base\" /* BASE */, baseTag),\n linkTags: updateTags(\"link\" /* LINK */, linkTags),\n metaTags: updateTags(\"meta\" /* META */, metaTags),\n noscriptTags: updateTags(\"noscript\" /* NOSCRIPT */, noscriptTags),\n scriptTags: updateTags(\"script\" /* SCRIPT */, scriptTags),\n styleTags: updateTags(\"style\" /* STYLE */, styleTags)\n };\n const addedTags = {};\n const removedTags = {};\n Object.keys(tagUpdates).forEach((tagType) => {\n const { newTags, oldTags } = tagUpdates[tagType];\n if (newTags.length) {\n addedTags[tagType] = newTags;\n }\n if (oldTags.length) {\n removedTags[tagType] = tagUpdates[tagType].oldTags;\n }\n });\n if (cb) {\n cb();\n }\n onChangeClientState(newState, addedTags, removedTags);\n};\nvar _helmetCallback = null;\nvar handleStateChangeOnClient = (newState) => {\n if (_helmetCallback) {\n cancelAnimationFrame(_helmetCallback);\n }\n if (newState.defer) {\n _helmetCallback = requestAnimationFrame(() => {\n commitTagChanges(newState, () => {\n _helmetCallback = null;\n });\n });\n } else {\n commitTagChanges(newState);\n _helmetCallback = null;\n }\n};\nvar client_default = handleStateChangeOnClient;\n\n// src/Dispatcher.tsx\nvar HelmetDispatcher = class extends react__WEBPACK_IMPORTED_MODULE_0__.Component {\n rendered = false;\n shouldComponentUpdate(nextProps) {\n return !shallowequal__WEBPACK_IMPORTED_MODULE_3___default()(nextProps, this.props);\n }\n componentDidUpdate() {\n this.emitChange();\n }\n componentWillUnmount() {\n const { helmetInstances } = this.props.context;\n helmetInstances.remove(this);\n this.emitChange();\n }\n emitChange() {\n const { helmetInstances, setHelmet } = this.props.context;\n let serverState = null;\n const state = reducePropsToState(\n helmetInstances.get().map((instance) => {\n const props = { ...instance.props };\n delete props.context;\n return props;\n })\n );\n if (HelmetProvider.canUseDOM) {\n client_default(state);\n } else if (server_default) {\n serverState = server_default(state);\n }\n setHelmet(serverState);\n }\n // componentWillMount will be deprecated\n // for SSR, initialize on first render\n // constructor is also unsafe in StrictMode\n init() {\n if (this.rendered) {\n return;\n }\n this.rendered = true;\n const { helmetInstances } = this.props.context;\n helmetInstances.add(this);\n this.emitChange();\n }\n render() {\n this.init();\n return null;\n }\n};\n\n// src/index.tsx\nvar Helmet = class extends react__WEBPACK_IMPORTED_MODULE_0__.Component {\n static defaultProps = {\n defer: true,\n encodeSpecialCharacters: true,\n prioritizeSeoTags: false\n };\n shouldComponentUpdate(nextProps) {\n return !react_fast_compare__WEBPACK_IMPORTED_MODULE_1___default()(without(this.props, \"helmetData\"), without(nextProps, \"helmetData\"));\n }\n mapNestedChildrenToProps(child, nestedChildren) {\n if (!nestedChildren) {\n return null;\n }\n switch (child.type) {\n case \"script\" /* SCRIPT */:\n case \"noscript\" /* NOSCRIPT */:\n return {\n innerHTML: nestedChildren\n };\n case \"style\" /* STYLE */:\n return {\n cssText: nestedChildren\n };\n default:\n throw new Error(\n `<${child.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`\n );\n }\n }\n flattenArrayTypeChildren(child, arrayTypeChildren, newChildProps, nestedChildren) {\n return {\n ...arrayTypeChildren,\n [child.type]: [\n ...arrayTypeChildren[child.type] || [],\n {\n ...newChildProps,\n ...this.mapNestedChildrenToProps(child, nestedChildren)\n }\n ]\n };\n }\n mapObjectTypeChildren(child, newProps, newChildProps, nestedChildren) {\n switch (child.type) {\n case \"title\" /* TITLE */:\n return {\n ...newProps,\n [child.type]: nestedChildren,\n titleAttributes: { ...newChildProps }\n };\n case \"body\" /* BODY */:\n return {\n ...newProps,\n bodyAttributes: { ...newChildProps }\n };\n case \"html\" /* HTML */:\n return {\n ...newProps,\n htmlAttributes: { ...newChildProps }\n };\n default:\n return {\n ...newProps,\n [child.type]: { ...newChildProps }\n };\n }\n }\n mapArrayTypeChildrenToProps(arrayTypeChildren, newProps) {\n let newFlattenedProps = { ...newProps };\n Object.keys(arrayTypeChildren).forEach((arrayChildName) => {\n newFlattenedProps = {\n ...newFlattenedProps,\n [arrayChildName]: arrayTypeChildren[arrayChildName]\n };\n });\n return newFlattenedProps;\n }\n warnOnInvalidChildren(child, nestedChildren) {\n invariant__WEBPACK_IMPORTED_MODULE_2___default()(\n VALID_TAG_NAMES.some((name) => child.type === name),\n typeof child.type === \"function\" ? `You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.` : `Only elements types ${VALID_TAG_NAMES.join(\n \", \"\n )} are allowed. Helmet does not support rendering <${child.type}> elements. Refer to our API for more information.`\n );\n invariant__WEBPACK_IMPORTED_MODULE_2___default()(\n !nestedChildren || typeof nestedChildren === \"string\" || Array.isArray(nestedChildren) && !nestedChildren.some((nestedChild) => typeof nestedChild !== \"string\"),\n `Helmet expects a string as a child of <${child.type}>. Did you forget to wrap your children in braces? ( <${child.type}>{\\`\\`}</${child.type}> ) Refer to our API for more information.`\n );\n return true;\n }\n mapChildrenToProps(children, newProps) {\n let arrayTypeChildren = {};\n react__WEBPACK_IMPORTED_MODULE_0___default().Children.forEach(children, (child) => {\n if (!child || !child.props) {\n return;\n }\n const { children: nestedChildren, ...childProps } = child.props;\n const newChildProps = Object.keys(childProps).reduce((obj, key) => {\n obj[HTML_TAG_MAP[key] || key] = childProps[key];\n return obj;\n }, {});\n let { type } = child;\n if (typeof type === \"symbol\") {\n type = type.toString();\n } else {\n this.warnOnInvalidChildren(child, nestedChildren);\n }\n switch (type) {\n case \"Symbol(react.fragment)\" /* FRAGMENT */:\n newProps = this.mapChildrenToProps(nestedChildren, newProps);\n break;\n case \"link\" /* LINK */:\n case \"meta\" /* META */:\n case \"noscript\" /* NOSCRIPT */:\n case \"script\" /* SCRIPT */:\n case \"style\" /* STYLE */:\n arrayTypeChildren = this.flattenArrayTypeChildren(\n child,\n arrayTypeChildren,\n newChildProps,\n nestedChildren\n );\n break;\n default:\n newProps = this.mapObjectTypeChildren(child, newProps, newChildProps, nestedChildren);\n break;\n }\n });\n return this.mapArrayTypeChildrenToProps(arrayTypeChildren, newProps);\n }\n render() {\n const { children, ...props } = this.props;\n let newProps = { ...props };\n let { helmetData } = props;\n if (children) {\n newProps = this.mapChildrenToProps(children, newProps);\n }\n if (helmetData && !(helmetData instanceof HelmetData)) {\n const data = helmetData;\n helmetData = new HelmetData(data.context, true);\n delete newProps.helmetData;\n }\n return helmetData ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(HelmetDispatcher, { ...newProps, context: helmetData.value }) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Context.Consumer, null, (context) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(HelmetDispatcher, { ...newProps, context }));\n }\n};\n\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./node_modules/react-helmet-async/lib/index.esm.js?");
|
|
601
|
+
|
|
602
|
+
/***/ }),
|
|
603
|
+
|
|
523
604
|
/***/ "./node_modules/react/cjs/react-jsx-runtime.development.js":
|
|
524
605
|
/*!*****************************************************************!*\
|
|
525
606
|
!*** ./node_modules/react/cjs/react-jsx-runtime.development.js ***!
|
|
526
607
|
\*****************************************************************/
|
|
527
608
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
528
609
|
|
|
610
|
+
"use strict";
|
|
529
611
|
eval("/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and 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\n true &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE$2\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_CONTEXT_TYPE:\n return (type.displayName || \"Context\") + \".Provider\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function disabledLog() {}\n function disableLogs() {\n if (0 === disabledDepth) {\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;\n var props = {\n configurable: !0,\n enumerable: !0,\n value: disabledLog,\n writable: !0\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 }\n disabledDepth++;\n }\n function reenableLogs() {\n disabledDepth--;\n if (0 === disabledDepth) {\n var props = { configurable: !0, enumerable: !0, writable: !0 };\n Object.defineProperties(console, {\n log: assign({}, props, { value: prevLog }),\n info: assign({}, props, { value: prevInfo }),\n warn: assign({}, props, { value: prevWarn }),\n error: assign({}, props, { value: prevError }),\n group: assign({}, props, { value: prevGroup }),\n groupCollapsed: assign({}, props, { value: prevGroupCollapsed }),\n groupEnd: assign({}, props, { value: prevGroupEnd })\n });\n }\n 0 > disabledDepth &&\n console.error(\n \"disabledDepth fell below zero. This is a bug in React. Please file an issue.\"\n );\n }\n function describeBuiltInComponentFrame(name) {\n if (void 0 === prefix)\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = (match && match[1]) || \"\";\n suffix =\n -1 < x.stack.indexOf(\"\\n at\")\n ? \" (<anonymous>)\"\n : -1 < x.stack.indexOf(\"@\")\n ? \"@unknown:0:0\"\n : \"\";\n }\n return \"\\n\" + prefix + name + suffix;\n }\n function describeNativeComponentFrame(fn, construct) {\n if (!fn || reentry) return \"\";\n var frame = componentFrameCache.get(fn);\n if (void 0 !== frame) return frame;\n reentry = !0;\n frame = Error.prepareStackTrace;\n Error.prepareStackTrace = void 0;\n var previousDispatcher = null;\n previousDispatcher = ReactSharedInternals.H;\n ReactSharedInternals.H = null;\n disableLogs();\n try {\n var RunInRootFrame = {\n DetermineComponentFrameRoot: function () {\n try {\n if (construct) {\n var Fake = function () {\n throw Error();\n };\n Object.defineProperty(Fake.prototype, \"props\", {\n set: function () {\n throw Error();\n }\n });\n if (\"object\" === typeof Reflect && Reflect.construct) {\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n var control = x;\n }\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x$0) {\n control = x$0;\n }\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x$1) {\n control = x$1;\n }\n (Fake = fn()) &&\n \"function\" === typeof Fake.catch &&\n Fake.catch(function () {});\n }\n } catch (sample) {\n if (sample && control && \"string\" === typeof sample.stack)\n return [sample.stack, control.stack];\n }\n return [null, null];\n }\n };\n RunInRootFrame.DetermineComponentFrameRoot.displayName =\n \"DetermineComponentFrameRoot\";\n var namePropDescriptor = Object.getOwnPropertyDescriptor(\n RunInRootFrame.DetermineComponentFrameRoot,\n \"name\"\n );\n namePropDescriptor &&\n namePropDescriptor.configurable &&\n Object.defineProperty(\n RunInRootFrame.DetermineComponentFrameRoot,\n \"name\",\n { value: \"DetermineComponentFrameRoot\" }\n );\n var _RunInRootFrame$Deter =\n RunInRootFrame.DetermineComponentFrameRoot(),\n sampleStack = _RunInRootFrame$Deter[0],\n controlStack = _RunInRootFrame$Deter[1];\n if (sampleStack && controlStack) {\n var sampleLines = sampleStack.split(\"\\n\"),\n controlLines = controlStack.split(\"\\n\");\n for (\n _RunInRootFrame$Deter = namePropDescriptor = 0;\n namePropDescriptor < sampleLines.length &&\n !sampleLines[namePropDescriptor].includes(\n \"DetermineComponentFrameRoot\"\n );\n\n )\n namePropDescriptor++;\n for (\n ;\n _RunInRootFrame$Deter < controlLines.length &&\n !controlLines[_RunInRootFrame$Deter].includes(\n \"DetermineComponentFrameRoot\"\n );\n\n )\n _RunInRootFrame$Deter++;\n if (\n namePropDescriptor === sampleLines.length ||\n _RunInRootFrame$Deter === controlLines.length\n )\n for (\n namePropDescriptor = sampleLines.length - 1,\n _RunInRootFrame$Deter = controlLines.length - 1;\n 1 <= namePropDescriptor &&\n 0 <= _RunInRootFrame$Deter &&\n sampleLines[namePropDescriptor] !==\n controlLines[_RunInRootFrame$Deter];\n\n )\n _RunInRootFrame$Deter--;\n for (\n ;\n 1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter;\n namePropDescriptor--, _RunInRootFrame$Deter--\n )\n if (\n sampleLines[namePropDescriptor] !==\n controlLines[_RunInRootFrame$Deter]\n ) {\n if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) {\n do\n if (\n (namePropDescriptor--,\n _RunInRootFrame$Deter--,\n 0 > _RunInRootFrame$Deter ||\n sampleLines[namePropDescriptor] !==\n controlLines[_RunInRootFrame$Deter])\n ) {\n var _frame =\n \"\\n\" +\n sampleLines[namePropDescriptor].replace(\n \" at new \",\n \" at \"\n );\n fn.displayName &&\n _frame.includes(\"<anonymous>\") &&\n (_frame = _frame.replace(\"<anonymous>\", fn.displayName));\n \"function\" === typeof fn &&\n componentFrameCache.set(fn, _frame);\n return _frame;\n }\n while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter);\n }\n break;\n }\n }\n } finally {\n (reentry = !1),\n (ReactSharedInternals.H = previousDispatcher),\n reenableLogs(),\n (Error.prepareStackTrace = frame);\n }\n sampleLines = (sampleLines = fn ? fn.displayName || fn.name : \"\")\n ? describeBuiltInComponentFrame(sampleLines)\n : \"\";\n \"function\" === typeof fn && componentFrameCache.set(fn, sampleLines);\n return sampleLines;\n }\n function describeUnknownElementTypeFrameInDEV(type) {\n if (null == type) return \"\";\n if (\"function\" === typeof type) {\n var prototype = type.prototype;\n return describeNativeComponentFrame(\n type,\n !(!prototype || !prototype.isReactComponent)\n );\n }\n if (\"string\" === typeof type) return describeBuiltInComponentFrame(type);\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame(\"Suspense\");\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame(\"SuspenseList\");\n }\n if (\"object\" === typeof type)\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return (type = describeNativeComponentFrame(type.render, !1)), type;\n case REACT_MEMO_TYPE:\n return describeUnknownElementTypeFrameInDEV(type.type);\n case REACT_LAZY_TYPE:\n prototype = type._payload;\n type = type._init;\n try {\n return describeUnknownElementTypeFrameInDEV(type(prototype));\n } catch (x) {}\n }\n return \"\";\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%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://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, self, source, owner, props) {\n self = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== self ? self : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n source,\n self\n ) {\n if (\n \"string\" === typeof type ||\n \"function\" === typeof type ||\n type === REACT_FRAGMENT_TYPE ||\n type === REACT_PROFILER_TYPE ||\n type === REACT_STRICT_MODE_TYPE ||\n type === REACT_SUSPENSE_TYPE ||\n type === REACT_SUSPENSE_LIST_TYPE ||\n type === REACT_OFFSCREEN_TYPE ||\n (\"object\" === typeof type &&\n null !== type &&\n (type.$$typeof === REACT_LAZY_TYPE ||\n type.$$typeof === REACT_MEMO_TYPE ||\n type.$$typeof === REACT_CONTEXT_TYPE ||\n type.$$typeof === REACT_CONSUMER_TYPE ||\n type.$$typeof === REACT_FORWARD_REF_TYPE ||\n type.$$typeof === REACT_CLIENT_REFERENCE$1 ||\n void 0 !== type.getModuleId))\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren], type);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"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 validateChildKeys(children, type);\n } else {\n children = \"\";\n if (\n void 0 === type ||\n (\"object\" === typeof type &&\n null !== type &&\n 0 === Object.keys(type).length)\n )\n children +=\n \" 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 null === type\n ? (isStaticChildren = \"null\")\n : isArrayImpl(type)\n ? (isStaticChildren = \"array\")\n : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE\n ? ((isStaticChildren =\n \"<\" +\n (getComponentNameFromType(type.type) || \"Unknown\") +\n \" />\"),\n (children =\n \" Did you accidentally export a JSX literal instead of a component?\"))\n : (isStaticChildren = typeof type);\n console.error(\n \"React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s\",\n isStaticChildren,\n children\n );\n }\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(type, children, self, source, getOwner(), maybeKey);\n }\n function validateChildKeys(node, parentType) {\n if (\n \"object\" === typeof node &&\n node &&\n node.$$typeof !== REACT_CLIENT_REFERENCE\n )\n if (isArrayImpl(node))\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n isValidElement(child) && validateExplicitKey(child, parentType);\n }\n else if (isValidElement(node))\n node._store && (node._store.validated = 1);\n else if (\n (null === node || \"object\" !== typeof node\n ? (i = null)\n : ((i =\n (MAYBE_ITERATOR_SYMBOL && node[MAYBE_ITERATOR_SYMBOL]) ||\n node[\"@@iterator\"]),\n (i = \"function\" === typeof i ? i : null)),\n \"function\" === typeof i &&\n i !== node.entries &&\n ((i = i.call(node)), i !== node))\n )\n for (; !(node = i.next()).done; )\n isValidElement(node.value) &&\n validateExplicitKey(node.value, parentType);\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n function validateExplicitKey(element, parentType) {\n if (\n element._store &&\n !element._store.validated &&\n null == element.key &&\n ((element._store.validated = 1),\n (parentType = getCurrentComponentErrorInfo(parentType)),\n !ownerHasKeyUseWarning[parentType])\n ) {\n ownerHasKeyUseWarning[parentType] = !0;\n var childOwner = \"\";\n element &&\n null != element._owner &&\n element._owner !== getOwner() &&\n ((childOwner = null),\n \"number\" === typeof element._owner.tag\n ? (childOwner = getComponentNameFromType(element._owner.type))\n : \"string\" === typeof element._owner.name &&\n (childOwner = element._owner.name),\n (childOwner = \" It was passed a child from \" + childOwner + \".\"));\n var prevGetCurrentStack = ReactSharedInternals.getCurrentStack;\n ReactSharedInternals.getCurrentStack = function () {\n var stack = describeUnknownElementTypeFrameInDEV(element.type);\n prevGetCurrentStack && (stack += prevGetCurrentStack() || \"\");\n return stack;\n };\n console.error(\n 'Each child in a list should have a unique \"key\" prop.%s%s See https://react.dev/link/warning-keys for more information.',\n parentType,\n childOwner\n );\n ReactSharedInternals.getCurrentStack = prevGetCurrentStack;\n }\n }\n function getCurrentComponentErrorInfo(parentType) {\n var info = \"\",\n owner = getOwner();\n owner &&\n (owner = getComponentNameFromType(owner.type)) &&\n (info = \"\\n\\nCheck the render method of `\" + owner + \"`.\");\n info ||\n ((parentType = getComponentNameFromType(parentType)) &&\n (info =\n \"\\n\\nCheck the top-level render call using <\" + parentType + \">.\"));\n return info;\n }\n var React = __webpack_require__(/*! react */ \"react\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\");\n Symbol.for(\"react.provider\");\n var REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_OFFSCREEN_TYPE = Symbol.for(\"react.offscreen\"),\n MAYBE_ITERATOR_SYMBOL = Symbol.iterator,\n REACT_CLIENT_REFERENCE$2 = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n assign = Object.assign,\n REACT_CLIENT_REFERENCE$1 = Symbol.for(\"react.client.reference\"),\n isArrayImpl = Array.isArray,\n disabledDepth = 0,\n prevLog,\n prevInfo,\n prevWarn,\n prevError,\n prevGroup,\n prevGroupCollapsed,\n prevGroupEnd;\n disabledLog.__reactDisabledLog = !0;\n var prefix,\n suffix,\n reentry = !1;\n var componentFrameCache = new (\n \"function\" === typeof WeakMap ? WeakMap : Map\n )();\n var REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var didWarnAboutKeySpread = {},\n ownerHasKeyUseWarning = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsx = function (type, config, maybeKey, source, self) {\n return jsxDEVImpl(type, config, maybeKey, !1, source, self);\n };\n exports.jsxs = function (type, config, maybeKey, source, self) {\n return jsxDEVImpl(type, config, maybeKey, !0, source, self);\n };\n })();\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./node_modules/react/cjs/react-jsx-runtime.development.js?");
|
|
530
612
|
|
|
531
613
|
/***/ }),
|
|
@@ -536,16 +618,39 @@ eval("/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyri
|
|
|
536
618
|
\*******************************************/
|
|
537
619
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
538
620
|
|
|
621
|
+
"use strict";
|
|
539
622
|
eval("\n\nif (false) {} else {\n module.exports = __webpack_require__(/*! ./cjs/react-jsx-runtime.development.js */ \"./node_modules/react/cjs/react-jsx-runtime.development.js\");\n}\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./node_modules/react/jsx-runtime.js?");
|
|
540
623
|
|
|
541
624
|
/***/ }),
|
|
542
625
|
|
|
626
|
+
/***/ "./node_modules/set-cookie-parser/lib/set-cookie.js":
|
|
627
|
+
/*!**********************************************************!*\
|
|
628
|
+
!*** ./node_modules/set-cookie-parser/lib/set-cookie.js ***!
|
|
629
|
+
\**********************************************************/
|
|
630
|
+
/***/ (function(module) {
|
|
631
|
+
|
|
632
|
+
"use strict";
|
|
633
|
+
eval("\n\nvar defaultParseOptions = {\n decodeValues: true,\n map: false,\n silent: false,\n};\n\nfunction isNonEmptyString(str) {\n return typeof str === \"string\" && !!str.trim();\n}\n\nfunction parseString(setCookieValue, options) {\n var parts = setCookieValue.split(\";\").filter(isNonEmptyString);\n\n var nameValuePairStr = parts.shift();\n var parsed = parseNameValuePair(nameValuePairStr);\n var name = parsed.name;\n var value = parsed.value;\n\n options = options\n ? Object.assign({}, defaultParseOptions, options)\n : defaultParseOptions;\n\n try {\n value = options.decodeValues ? decodeURIComponent(value) : value; // decode cookie value\n } catch (e) {\n console.error(\n \"set-cookie-parser encountered an error while decoding a cookie with value '\" +\n value +\n \"'. Set options.decodeValues to false to disable this feature.\",\n e\n );\n }\n\n var cookie = {\n name: name,\n value: value,\n };\n\n parts.forEach(function (part) {\n var sides = part.split(\"=\");\n var key = sides.shift().trimLeft().toLowerCase();\n var value = sides.join(\"=\");\n if (key === \"expires\") {\n cookie.expires = new Date(value);\n } else if (key === \"max-age\") {\n cookie.maxAge = parseInt(value, 10);\n } else if (key === \"secure\") {\n cookie.secure = true;\n } else if (key === \"httponly\") {\n cookie.httpOnly = true;\n } else if (key === \"samesite\") {\n cookie.sameSite = value;\n } else if (key === \"partitioned\") {\n cookie.partitioned = true;\n } else {\n cookie[key] = value;\n }\n });\n\n return cookie;\n}\n\nfunction parseNameValuePair(nameValuePairStr) {\n // Parses name-value-pair according to rfc6265bis draft\n\n var name = \"\";\n var value = \"\";\n var nameValueArr = nameValuePairStr.split(\"=\");\n if (nameValueArr.length > 1) {\n name = nameValueArr.shift();\n value = nameValueArr.join(\"=\"); // everything after the first =, joined by a \"=\" if there was more than one part\n } else {\n value = nameValuePairStr;\n }\n\n return { name: name, value: value };\n}\n\nfunction parse(input, options) {\n options = options\n ? Object.assign({}, defaultParseOptions, options)\n : defaultParseOptions;\n\n if (!input) {\n if (!options.map) {\n return [];\n } else {\n return {};\n }\n }\n\n if (input.headers) {\n if (typeof input.headers.getSetCookie === \"function\") {\n // for fetch responses - they combine headers of the same type in the headers array,\n // but getSetCookie returns an uncombined array\n input = input.headers.getSetCookie();\n } else if (input.headers[\"set-cookie\"]) {\n // fast-path for node.js (which automatically normalizes header names to lower-case\n input = input.headers[\"set-cookie\"];\n } else {\n // slow-path for other environments - see #25\n var sch =\n input.headers[\n Object.keys(input.headers).find(function (key) {\n return key.toLowerCase() === \"set-cookie\";\n })\n ];\n // warn if called on a request-like object with a cookie header rather than a set-cookie header - see #34, 36\n if (!sch && input.headers.cookie && !options.silent) {\n console.warn(\n \"Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning.\"\n );\n }\n input = sch;\n }\n }\n if (!Array.isArray(input)) {\n input = [input];\n }\n\n if (!options.map) {\n return input.filter(isNonEmptyString).map(function (str) {\n return parseString(str, options);\n });\n } else {\n var cookies = {};\n return input.filter(isNonEmptyString).reduce(function (cookies, str) {\n var cookie = parseString(str, options);\n cookies[cookie.name] = cookie;\n return cookies;\n }, cookies);\n }\n}\n\n/*\n Set-Cookie header field-values are sometimes comma joined in one string. This splits them without choking on commas\n that are within a single set-cookie field-value, such as in the Expires portion.\n\n This is uncommon, but explicitly allowed - see https://tools.ietf.org/html/rfc2616#section-4.2\n Node.js does this for every header *except* set-cookie - see https://github.com/nodejs/node/blob/d5e363b77ebaf1caf67cd7528224b651c86815c1/lib/_http_incoming.js#L128\n React Native's fetch does this for *every* header, including set-cookie.\n\n Based on: https://github.com/google/j2objc/commit/16820fdbc8f76ca0c33472810ce0cb03d20efe25\n Credits to: https://github.com/tomball for original and https://github.com/chrusart for JavaScript implementation\n*/\nfunction splitCookiesString(cookiesString) {\n if (Array.isArray(cookiesString)) {\n return cookiesString;\n }\n if (typeof cookiesString !== \"string\") {\n return [];\n }\n\n var cookiesStrings = [];\n var pos = 0;\n var start;\n var ch;\n var lastComma;\n var nextStart;\n var cookiesSeparatorFound;\n\n function skipWhitespace() {\n while (pos < cookiesString.length && /\\s/.test(cookiesString.charAt(pos))) {\n pos += 1;\n }\n return pos < cookiesString.length;\n }\n\n function notSpecialChar() {\n ch = cookiesString.charAt(pos);\n\n return ch !== \"=\" && ch !== \";\" && ch !== \",\";\n }\n\n while (pos < cookiesString.length) {\n start = pos;\n cookiesSeparatorFound = false;\n\n while (skipWhitespace()) {\n ch = cookiesString.charAt(pos);\n if (ch === \",\") {\n // ',' is a cookie separator if we have later first '=', not ';' or ','\n lastComma = pos;\n pos += 1;\n\n skipWhitespace();\n nextStart = pos;\n\n while (pos < cookiesString.length && notSpecialChar()) {\n pos += 1;\n }\n\n // currently special character\n if (pos < cookiesString.length && cookiesString.charAt(pos) === \"=\") {\n // we found cookies separator\n cookiesSeparatorFound = true;\n // pos is inside the next cookie, so back up and return it.\n pos = nextStart;\n cookiesStrings.push(cookiesString.substring(start, lastComma));\n start = pos;\n } else {\n // in param ',' or param separator ';',\n // we continue from that comma\n pos = lastComma + 1;\n }\n } else {\n pos += 1;\n }\n }\n\n if (!cookiesSeparatorFound || pos >= cookiesString.length) {\n cookiesStrings.push(cookiesString.substring(start, cookiesString.length));\n }\n }\n\n return cookiesStrings;\n}\n\nmodule.exports = parse;\nmodule.exports.parse = parse;\nmodule.exports.parseString = parseString;\nmodule.exports.splitCookiesString = splitCookiesString;\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./node_modules/set-cookie-parser/lib/set-cookie.js?");
|
|
634
|
+
|
|
635
|
+
/***/ }),
|
|
636
|
+
|
|
637
|
+
/***/ "./node_modules/shallowequal/index.js":
|
|
638
|
+
/*!********************************************!*\
|
|
639
|
+
!*** ./node_modules/shallowequal/index.js ***!
|
|
640
|
+
\********************************************/
|
|
641
|
+
/***/ (function(module) {
|
|
642
|
+
|
|
643
|
+
eval("//\n\nmodule.exports = function shallowEqual(objA, objB, compare, compareContext) {\n var ret = compare ? compare.call(compareContext, objA, objB) : void 0;\n\n if (ret !== void 0) {\n return !!ret;\n }\n\n if (objA === objB) {\n return true;\n }\n\n if (typeof objA !== \"object\" || !objA || typeof objB !== \"object\" || !objB) {\n return false;\n }\n\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);\n\n // Test for A's keys different from B.\n for (var idx = 0; idx < keysA.length; idx++) {\n var key = keysA[idx];\n\n if (!bHasOwnProperty(key)) {\n return false;\n }\n\n var valueA = objA[key];\n var valueB = objB[key];\n\n ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0;\n\n if (ret === false || (ret === void 0 && valueA !== valueB)) {\n return false;\n }\n }\n\n return true;\n};\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./node_modules/shallowequal/index.js?");
|
|
644
|
+
|
|
645
|
+
/***/ }),
|
|
646
|
+
|
|
543
647
|
/***/ "@dr.pogodin/js-utils":
|
|
544
648
|
/*!***************************************!*\
|
|
545
649
|
!*** external "@dr.pogodin/js-utils" ***!
|
|
546
650
|
\***************************************/
|
|
547
651
|
/***/ (function(module) {
|
|
548
652
|
|
|
653
|
+
"use strict";
|
|
549
654
|
module.exports = __WEBPACK_EXTERNAL_MODULE__dr_pogodin_js_utils__;
|
|
550
655
|
|
|
551
656
|
/***/ }),
|
|
@@ -556,6 +661,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__dr_pogodin_js_utils__;
|
|
|
556
661
|
\*************************************************/
|
|
557
662
|
/***/ (function(module) {
|
|
558
663
|
|
|
664
|
+
"use strict";
|
|
559
665
|
module.exports = __WEBPACK_EXTERNAL_MODULE__dr_pogodin_react_global_state__;
|
|
560
666
|
|
|
561
667
|
/***/ }),
|
|
@@ -566,6 +672,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__dr_pogodin_react_global_state__;
|
|
|
566
672
|
\*******************************************/
|
|
567
673
|
/***/ (function(module) {
|
|
568
674
|
|
|
675
|
+
"use strict";
|
|
569
676
|
module.exports = __WEBPACK_EXTERNAL_MODULE__dr_pogodin_react_themes__;
|
|
570
677
|
|
|
571
678
|
/***/ }),
|
|
@@ -576,6 +683,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__dr_pogodin_react_themes__;
|
|
|
576
683
|
\*************************/
|
|
577
684
|
/***/ (function(module) {
|
|
578
685
|
|
|
686
|
+
"use strict";
|
|
579
687
|
module.exports = __WEBPACK_EXTERNAL_MODULE_cookie__;
|
|
580
688
|
|
|
581
689
|
/***/ }),
|
|
@@ -586,6 +694,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_cookie__;
|
|
|
586
694
|
\************************/
|
|
587
695
|
/***/ (function(module) {
|
|
588
696
|
|
|
697
|
+
"use strict";
|
|
589
698
|
module.exports = __WEBPACK_EXTERNAL_MODULE_dayjs__;
|
|
590
699
|
|
|
591
700
|
/***/ }),
|
|
@@ -596,6 +705,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_dayjs__;
|
|
|
596
705
|
\*************************************/
|
|
597
706
|
/***/ (function(module) {
|
|
598
707
|
|
|
708
|
+
"use strict";
|
|
599
709
|
module.exports = __WEBPACK_EXTERNAL_MODULE_node_forge_lib_aes__;
|
|
600
710
|
|
|
601
711
|
/***/ }),
|
|
@@ -606,6 +716,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_node_forge_lib_aes__;
|
|
|
606
716
|
\***************************************/
|
|
607
717
|
/***/ (function(module) {
|
|
608
718
|
|
|
719
|
+
"use strict";
|
|
609
720
|
module.exports = __WEBPACK_EXTERNAL_MODULE_node_forge_lib_forge__;
|
|
610
721
|
|
|
611
722
|
/***/ }),
|
|
@@ -616,6 +727,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_node_forge_lib_forge__;
|
|
|
616
727
|
\*********************/
|
|
617
728
|
/***/ (function(module) {
|
|
618
729
|
|
|
730
|
+
"use strict";
|
|
619
731
|
module.exports = __WEBPACK_EXTERNAL_MODULE_qs__;
|
|
620
732
|
|
|
621
733
|
/***/ }),
|
|
@@ -626,6 +738,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_qs__;
|
|
|
626
738
|
\************************/
|
|
627
739
|
/***/ (function(module) {
|
|
628
740
|
|
|
741
|
+
"use strict";
|
|
629
742
|
module.exports = __WEBPACK_EXTERNAL_MODULE_react__;
|
|
630
743
|
|
|
631
744
|
/***/ }),
|
|
@@ -636,6 +749,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_react__;
|
|
|
636
749
|
\****************************/
|
|
637
750
|
/***/ (function(module) {
|
|
638
751
|
|
|
752
|
+
"use strict";
|
|
639
753
|
module.exports = __WEBPACK_EXTERNAL_MODULE_react_dom__;
|
|
640
754
|
|
|
641
755
|
/***/ }),
|
|
@@ -646,27 +760,30 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_react_dom__;
|
|
|
646
760
|
\***********************************/
|
|
647
761
|
/***/ (function(module) {
|
|
648
762
|
|
|
763
|
+
"use strict";
|
|
649
764
|
module.exports = __WEBPACK_EXTERNAL_MODULE_react_dom_client__;
|
|
650
765
|
|
|
651
766
|
/***/ }),
|
|
652
767
|
|
|
653
|
-
/***/ "react-
|
|
654
|
-
|
|
655
|
-
!***
|
|
656
|
-
|
|
657
|
-
/***/ (function(
|
|
768
|
+
/***/ "./node_modules/react-router/dist/development/chunk-V7UHCZHK.mjs":
|
|
769
|
+
/*!***********************************************************************!*\
|
|
770
|
+
!*** ./node_modules/react-router/dist/development/chunk-V7UHCZHK.mjs ***!
|
|
771
|
+
\***********************************************************************/
|
|
772
|
+
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
658
773
|
|
|
659
|
-
|
|
774
|
+
"use strict";
|
|
775
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Action: function() { return /* binding */ Action; },\n/* harmony export */ Await: function() { return /* binding */ Await; },\n/* harmony export */ BrowserRouter: function() { return /* binding */ BrowserRouter; },\n/* harmony export */ DataRouterContext: function() { return /* binding */ DataRouterContext; },\n/* harmony export */ DataRouterStateContext: function() { return /* binding */ DataRouterStateContext; },\n/* harmony export */ ErrorResponseImpl: function() { return /* binding */ ErrorResponseImpl; },\n/* harmony export */ FetchersContext: function() { return /* binding */ FetchersContext; },\n/* harmony export */ Form: function() { return /* binding */ Form; },\n/* harmony export */ FrameworkContext: function() { return /* binding */ FrameworkContext; },\n/* harmony export */ HashRouter: function() { return /* binding */ HashRouter; },\n/* harmony export */ HistoryRouter: function() { return /* binding */ HistoryRouter; },\n/* harmony export */ IDLE_BLOCKER: function() { return /* binding */ IDLE_BLOCKER; },\n/* harmony export */ IDLE_FETCHER: function() { return /* binding */ IDLE_FETCHER; },\n/* harmony export */ IDLE_NAVIGATION: function() { return /* binding */ IDLE_NAVIGATION; },\n/* harmony export */ Link: function() { return /* binding */ Link; },\n/* harmony export */ Links: function() { return /* binding */ Links; },\n/* harmony export */ LocationContext: function() { return /* binding */ LocationContext; },\n/* harmony export */ MemoryRouter: function() { return /* binding */ MemoryRouter; },\n/* harmony export */ Meta: function() { return /* binding */ Meta; },\n/* harmony export */ NavLink: function() { return /* binding */ NavLink; },\n/* harmony export */ Navigate: function() { return /* binding */ Navigate; },\n/* harmony export */ NavigationContext: function() { return /* binding */ NavigationContext; },\n/* harmony export */ Outlet: function() { return /* binding */ Outlet; },\n/* harmony export */ PrefetchPageLinks: function() { return /* binding */ PrefetchPageLinks; },\n/* harmony export */ RemixErrorBoundary: function() { return /* binding */ RemixErrorBoundary; },\n/* harmony export */ Route: function() { return /* binding */ Route; },\n/* harmony export */ RouteContext: function() { return /* binding */ RouteContext; },\n/* harmony export */ Router: function() { return /* binding */ Router; },\n/* harmony export */ RouterProvider: function() { return /* binding */ RouterProvider; },\n/* harmony export */ Routes: function() { return /* binding */ Routes; },\n/* harmony export */ Scripts: function() { return /* binding */ Scripts; },\n/* harmony export */ ScrollRestoration: function() { return /* binding */ ScrollRestoration; },\n/* harmony export */ ServerMode: function() { return /* binding */ ServerMode; },\n/* harmony export */ ServerRouter: function() { return /* binding */ ServerRouter; },\n/* harmony export */ SingleFetchRedirectSymbol: function() { return /* binding */ SingleFetchRedirectSymbol; },\n/* harmony export */ StaticRouter: function() { return /* binding */ StaticRouter; },\n/* harmony export */ StaticRouterProvider: function() { return /* binding */ StaticRouterProvider; },\n/* harmony export */ ViewTransitionContext: function() { return /* binding */ ViewTransitionContext; },\n/* harmony export */ createBrowserHistory: function() { return /* binding */ createBrowserHistory; },\n/* harmony export */ createBrowserRouter: function() { return /* binding */ createBrowserRouter; },\n/* harmony export */ createClientRoutes: function() { return /* binding */ createClientRoutes; },\n/* harmony export */ createClientRoutesWithHMRRevalidationOptOut: function() { return /* binding */ createClientRoutesWithHMRRevalidationOptOut; },\n/* harmony export */ createCookie: function() { return /* binding */ createCookie; },\n/* harmony export */ createCookieSessionStorage: function() { return /* binding */ createCookieSessionStorage; },\n/* harmony export */ createHashRouter: function() { return /* binding */ createHashRouter; },\n/* harmony export */ createMemoryRouter: function() { return /* binding */ createMemoryRouter; },\n/* harmony export */ createMemorySessionStorage: function() { return /* binding */ createMemorySessionStorage; },\n/* harmony export */ createPath: function() { return /* binding */ createPath; },\n/* harmony export */ createRequestHandler: function() { return /* binding */ createRequestHandler; },\n/* harmony export */ createRouter: function() { return /* binding */ createRouter; },\n/* harmony export */ createRoutesFromChildren: function() { return /* binding */ createRoutesFromChildren; },\n/* harmony export */ createRoutesFromElements: function() { return /* binding */ createRoutesFromElements; },\n/* harmony export */ createRoutesStub: function() { return /* binding */ createRoutesStub; },\n/* harmony export */ createSearchParams: function() { return /* binding */ createSearchParams; },\n/* harmony export */ createSession: function() { return /* binding */ createSession; },\n/* harmony export */ createSessionStorage: function() { return /* binding */ createSessionStorage; },\n/* harmony export */ createStaticHandler: function() { return /* binding */ createStaticHandler2; },\n/* harmony export */ createStaticRouter: function() { return /* binding */ createStaticRouter; },\n/* harmony export */ data: function() { return /* binding */ data; },\n/* harmony export */ decodeViaTurboStream: function() { return /* binding */ decodeViaTurboStream; },\n/* harmony export */ deserializeErrors: function() { return /* binding */ deserializeErrors2; },\n/* harmony export */ generatePath: function() { return /* binding */ generatePath; },\n/* harmony export */ getPatchRoutesOnNavigationFunction: function() { return /* binding */ getPatchRoutesOnNavigationFunction; },\n/* harmony export */ getSingleFetchDataStrategy: function() { return /* binding */ getSingleFetchDataStrategy; },\n/* harmony export */ invariant: function() { return /* binding */ invariant; },\n/* harmony export */ isCookie: function() { return /* binding */ isCookie; },\n/* harmony export */ isRouteErrorResponse: function() { return /* binding */ isRouteErrorResponse; },\n/* harmony export */ isSession: function() { return /* binding */ isSession; },\n/* harmony export */ mapRouteProperties: function() { return /* binding */ mapRouteProperties; },\n/* harmony export */ matchPath: function() { return /* binding */ matchPath; },\n/* harmony export */ matchRoutes: function() { return /* binding */ matchRoutes; },\n/* harmony export */ parsePath: function() { return /* binding */ parsePath; },\n/* harmony export */ redirect: function() { return /* binding */ redirect; },\n/* harmony export */ redirectDocument: function() { return /* binding */ redirectDocument; },\n/* harmony export */ renderMatches: function() { return /* binding */ renderMatches; },\n/* harmony export */ replace: function() { return /* binding */ replace; },\n/* harmony export */ resolvePath: function() { return /* binding */ resolvePath; },\n/* harmony export */ setDevServerHooks: function() { return /* binding */ setDevServerHooks; },\n/* harmony export */ shouldHydrateRouteLoader: function() { return /* binding */ shouldHydrateRouteLoader; },\n/* harmony export */ useActionData: function() { return /* binding */ useActionData; },\n/* harmony export */ useAsyncError: function() { return /* binding */ useAsyncError; },\n/* harmony export */ useAsyncValue: function() { return /* binding */ useAsyncValue; },\n/* harmony export */ useBeforeUnload: function() { return /* binding */ useBeforeUnload; },\n/* harmony export */ useBlocker: function() { return /* binding */ useBlocker; },\n/* harmony export */ useFetcher: function() { return /* binding */ useFetcher; },\n/* harmony export */ useFetchers: function() { return /* binding */ useFetchers; },\n/* harmony export */ useFogOFWarDiscovery: function() { return /* binding */ useFogOFWarDiscovery; },\n/* harmony export */ useFormAction: function() { return /* binding */ useFormAction; },\n/* harmony export */ useHref: function() { return /* binding */ useHref; },\n/* harmony export */ useInRouterContext: function() { return /* binding */ useInRouterContext; },\n/* harmony export */ useLinkClickHandler: function() { return /* binding */ useLinkClickHandler; },\n/* harmony export */ useLoaderData: function() { return /* binding */ useLoaderData; },\n/* harmony export */ useLocation: function() { return /* binding */ useLocation; },\n/* harmony export */ useMatch: function() { return /* binding */ useMatch; },\n/* harmony export */ useMatches: function() { return /* binding */ useMatches; },\n/* harmony export */ useNavigate: function() { return /* binding */ useNavigate; },\n/* harmony export */ useNavigation: function() { return /* binding */ useNavigation; },\n/* harmony export */ useNavigationType: function() { return /* binding */ useNavigationType; },\n/* harmony export */ useOutlet: function() { return /* binding */ useOutlet; },\n/* harmony export */ useOutletContext: function() { return /* binding */ useOutletContext; },\n/* harmony export */ useParams: function() { return /* binding */ useParams; },\n/* harmony export */ usePrompt: function() { return /* binding */ usePrompt; },\n/* harmony export */ useResolvedPath: function() { return /* binding */ useResolvedPath; },\n/* harmony export */ useRevalidator: function() { return /* binding */ useRevalidator; },\n/* harmony export */ useRouteError: function() { return /* binding */ useRouteError; },\n/* harmony export */ useRouteLoaderData: function() { return /* binding */ useRouteLoaderData; },\n/* harmony export */ useRoutes: function() { return /* binding */ useRoutes; },\n/* harmony export */ useScrollRestoration: function() { return /* binding */ useScrollRestoration; },\n/* harmony export */ useSearchParams: function() { return /* binding */ useSearchParams; },\n/* harmony export */ useSubmit: function() { return /* binding */ useSubmit; },\n/* harmony export */ useViewTransitionState: function() { return /* binding */ useViewTransitionState; }\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var turbo_stream__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! turbo-stream */ \"./node_modules/turbo-stream/dist/turbo-stream.mjs\");\n/* harmony import */ var cookie__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! cookie */ \"cookie\");\n/* harmony import */ var set_cookie_parser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! set-cookie-parser */ \"./node_modules/set-cookie-parser/lib/set-cookie.js\");\n/**\n * react-router v7.1.2\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// lib/router/history.ts\nvar Action = /* @__PURE__ */ ((Action2) => {\n Action2[\"Pop\"] = \"POP\";\n Action2[\"Push\"] = \"PUSH\";\n Action2[\"Replace\"] = \"REPLACE\";\n return Action2;\n})(Action || {});\nvar PopStateEventType = \"popstate\";\nfunction createMemoryHistory(options = {}) {\n let { initialEntries = [\"/\"], initialIndex, v5Compat = false } = options;\n let entries;\n entries = initialEntries.map(\n (entry, index2) => createMemoryLocation(\n entry,\n typeof entry === \"string\" ? null : entry.state,\n index2 === 0 ? \"default\" : void 0\n )\n );\n let index = clampIndex(\n initialIndex == null ? entries.length - 1 : initialIndex\n );\n let action = \"POP\" /* Pop */;\n let listener = null;\n function clampIndex(n) {\n return Math.min(Math.max(n, 0), entries.length - 1);\n }\n function getCurrentLocation() {\n return entries[index];\n }\n function createMemoryLocation(to, state = null, key) {\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 function createHref2(to) {\n return typeof to === \"string\" ? to : createPath(to);\n }\n let history = {\n get index() {\n return index;\n },\n get action() {\n return action;\n },\n get location() {\n return getCurrentLocation();\n },\n createHref: createHref2,\n createURL(to) {\n return new URL(createHref2(to), \"http://localhost\");\n },\n encodeLocation(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 = \"PUSH\" /* 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 = \"REPLACE\" /* 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 = \"POP\" /* 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) {\n listener = fn;\n return () => {\n listener = null;\n };\n }\n };\n return history;\n}\nfunction createBrowserHistory(options = {}) {\n function createBrowserLocation(window2, globalHistory) {\n let { pathname, search, hash } = window2.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 function createBrowserHref(window2, to) {\n return typeof to === \"string\" ? to : createPath(to);\n }\n return getUrlBasedHistory(\n createBrowserLocation,\n createBrowserHref,\n null,\n options\n );\n}\nfunction createHashHistory(options = {}) {\n function createHashLocation(window2, globalHistory) {\n let {\n pathname = \"/\",\n search = \"\",\n hash = \"\"\n } = parsePath(window2.location.hash.substring(1));\n if (!pathname.startsWith(\"/\") && !pathname.startsWith(\".\")) {\n pathname = \"/\" + pathname;\n }\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 function createHashHref(window2, to) {\n let base = window2.document.querySelector(\"base\");\n let href = \"\";\n if (base && base.getAttribute(\"href\")) {\n let url = window2.location.href;\n let hashIndex = url.indexOf(\"#\");\n href = hashIndex === -1 ? url : url.slice(0, hashIndex);\n }\n return href + \"#\" + (typeof to === \"string\" ? to : createPath(to));\n }\n function validateHashLocation(location, 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 return getUrlBasedHistory(\n createHashLocation,\n createHashHref,\n validateHashLocation,\n options\n );\n}\nfunction invariant(value, message) {\n if (value === false || value === null || typeof value === \"undefined\") {\n throw new Error(message);\n }\n}\nfunction warning(cond, message) {\n if (!cond) {\n if (typeof console !== \"undefined\") console.warn(message);\n try {\n throw new Error(message);\n } catch (e) {\n }\n }\n}\nfunction createKey() {\n return Math.random().toString(36).substring(2, 10);\n}\nfunction getHistoryState(location, index) {\n return {\n usr: location.state,\n key: location.key,\n idx: index\n };\n}\nfunction createLocation(current, to, state = null, key) {\n let 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.key || key || createKey()\n };\n return location;\n}\nfunction createPath({\n pathname = \"/\",\n search = \"\",\n hash = \"\"\n}) {\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}\nfunction parsePath(path) {\n let parsedPath = {};\n if (path) {\n let hashIndex = path.indexOf(\"#\");\n if (hashIndex >= 0) {\n parsedPath.hash = path.substring(hashIndex);\n path = path.substring(0, hashIndex);\n }\n let searchIndex = path.indexOf(\"?\");\n if (searchIndex >= 0) {\n parsedPath.search = path.substring(searchIndex);\n path = path.substring(0, searchIndex);\n }\n if (path) {\n parsedPath.pathname = path;\n }\n }\n return parsedPath;\n}\nfunction getUrlBasedHistory(getLocation, createHref2, validateLocation, options = {}) {\n let { window: window2 = document.defaultView, v5Compat = false } = options;\n let globalHistory = window2.history;\n let action = \"POP\" /* Pop */;\n let listener = null;\n let index = getIndex();\n if (index == null) {\n index = 0;\n globalHistory.replaceState({ ...globalHistory.state, idx: index }, \"\");\n }\n function getIndex() {\n let state = globalHistory.state || { idx: null };\n return state.idx;\n }\n function handlePop() {\n action = \"POP\" /* 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 function push(to, state) {\n action = \"PUSH\" /* Push */;\n let location = createLocation(history.location, to, state);\n if (validateLocation) validateLocation(location, to);\n index = getIndex() + 1;\n let historyState = getHistoryState(location, index);\n let url = history.createHref(location);\n try {\n globalHistory.pushState(historyState, \"\", url);\n } catch (error) {\n if (error instanceof DOMException && error.name === \"DataCloneError\") {\n throw error;\n }\n window2.location.assign(url);\n }\n if (v5Compat && listener) {\n listener({ action, location: history.location, delta: 1 });\n }\n }\n function replace2(to, state) {\n action = \"REPLACE\" /* Replace */;\n let location = createLocation(history.location, to, state);\n if (validateLocation) validateLocation(location, to);\n index = getIndex();\n let historyState = getHistoryState(location, index);\n let url = history.createHref(location);\n globalHistory.replaceState(historyState, \"\", url);\n if (v5Compat && listener) {\n listener({ action, location: history.location, delta: 0 });\n }\n }\n function createURL(to) {\n let base = window2.location.origin !== \"null\" ? window2.location.origin : window2.location.href;\n let href = typeof to === \"string\" ? to : createPath(to);\n href = href.replace(/ $/, \"%20\");\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 let history = {\n get action() {\n return action;\n },\n get location() {\n return getLocation(window2, globalHistory);\n },\n listen(fn) {\n if (listener) {\n throw new Error(\"A history only accepts one active listener\");\n }\n window2.addEventListener(PopStateEventType, handlePop);\n listener = fn;\n return () => {\n window2.removeEventListener(PopStateEventType, handlePop);\n listener = null;\n };\n },\n createHref(to) {\n return createHref2(window2, to);\n },\n createURL,\n encodeLocation(to) {\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: replace2,\n go(n) {\n return globalHistory.go(n);\n }\n };\n return history;\n}\n\n// lib/router/utils.ts\nvar immutableRouteKeys = /* @__PURE__ */ new Set([\n \"lazy\",\n \"caseSensitive\",\n \"path\",\n \"id\",\n \"index\",\n \"children\"\n]);\nfunction isIndexRoute(route) {\n return route.index === true;\n}\nfunction convertRoutesToDataRoutes(routes, mapRouteProperties2, parentPath = [], manifest = {}) {\n return routes.map((route, index) => {\n let treePath = [...parentPath, String(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 id's must be globally unique within Data Router usages`\n );\n if (isIndexRoute(route)) {\n let indexRoute = {\n ...route,\n ...mapRouteProperties2(route),\n id\n };\n manifest[id] = indexRoute;\n return indexRoute;\n } else {\n let pathOrLayoutRoute = {\n ...route,\n ...mapRouteProperties2(route),\n id,\n children: void 0\n };\n manifest[id] = pathOrLayoutRoute;\n if (route.children) {\n pathOrLayoutRoute.children = convertRoutesToDataRoutes(\n route.children,\n mapRouteProperties2,\n treePath,\n manifest\n );\n }\n return pathOrLayoutRoute;\n }\n });\n}\nfunction matchRoutes(routes, locationArg, basename = \"/\") {\n return matchRoutesImpl(routes, locationArg, basename, false);\n}\nfunction matchRoutesImpl(routes, locationArg, basename, allowPartial) {\n let location = typeof locationArg === \"string\" ? parsePath(locationArg) : locationArg;\n let pathname = stripBasename(location.pathname || \"/\", basename);\n if (pathname == null) {\n return null;\n }\n let branches = flattenRoutes(routes);\n rankRouteBranches(branches);\n let matches = null;\n for (let i = 0; matches == null && i < branches.length; ++i) {\n let decoded = decodePath(pathname);\n matches = matchRouteBranch(\n branches[i],\n decoded,\n allowPartial\n );\n }\n return matches;\n}\nfunction convertRouteMatchToUiMatch(match, loaderData) {\n let { route, pathname, params } = match;\n return {\n id: route.id,\n pathname,\n params,\n data: loaderData[route.id],\n handle: route.handle\n };\n}\nfunction flattenRoutes(routes, branches = [], parentsMeta = [], parentPath = \"\") {\n let flattenRoute = (route, index, relativePath) => {\n let meta = {\n relativePath: relativePath === void 0 ? route.path || \"\" : relativePath,\n caseSensitive: route.caseSensitive === true,\n childrenIndex: index,\n route\n };\n if (meta.relativePath.startsWith(\"/\")) {\n invariant(\n meta.relativePath.startsWith(parentPath),\n `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.`\n );\n meta.relativePath = meta.relativePath.slice(parentPath.length);\n }\n let path = joinPaths([parentPath, meta.relativePath]);\n let routesMeta = parentsMeta.concat(meta);\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 all child routes from route path \"${path}\".`\n );\n flattenRoutes(route.children, branches, routesMeta, path);\n }\n if (route.path == null && !route.index) {\n return;\n }\n branches.push({\n path,\n score: computeScore(path, route.index),\n routesMeta\n });\n };\n routes.forEach((route, index) => {\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 return branches;\n}\nfunction explodeOptionalSegments(path) {\n let segments = path.split(\"/\");\n if (segments.length === 0) return [];\n let [first, ...rest] = segments;\n let isOptional = first.endsWith(\"?\");\n let required = first.replace(/\\?$/, \"\");\n if (rest.length === 0) {\n return isOptional ? [required, \"\"] : [required];\n }\n let restExploded = explodeOptionalSegments(rest.join(\"/\"));\n let result = [];\n result.push(\n ...restExploded.map(\n (subpath) => subpath === \"\" ? required : [required, subpath].join(\"/\")\n )\n );\n if (isOptional) {\n result.push(...restExploded);\n }\n return result.map(\n (exploded) => path.startsWith(\"/\") && exploded === \"\" ? \"/\" : exploded\n );\n}\nfunction rankRouteBranches(branches) {\n branches.sort(\n (a, b) => a.score !== b.score ? b.score - a.score : compareIndexes(\n a.routesMeta.map((meta) => meta.childrenIndex),\n b.routesMeta.map((meta) => meta.childrenIndex)\n )\n );\n}\nvar paramRe = /^:[\\w-]+$/;\nvar dynamicSegmentValue = 3;\nvar indexRouteValue = 2;\nvar emptySegmentValue = 1;\nvar staticSegmentValue = 10;\nvar splatPenalty = -2;\nvar isSplat = (s) => s === \"*\";\nfunction computeScore(path, index) {\n let segments = path.split(\"/\");\n let initialScore = segments.length;\n if (segments.some(isSplat)) {\n initialScore += splatPenalty;\n }\n if (index) {\n initialScore += indexRouteValue;\n }\n return segments.filter((s) => !isSplat(s)).reduce(\n (score, segment) => score + (paramRe.test(segment) ? dynamicSegmentValue : segment === \"\" ? emptySegmentValue : staticSegmentValue),\n initialScore\n );\n}\nfunction compareIndexes(a, b) {\n let siblings = a.length === b.length && a.slice(0, -1).every((n, i) => n === b[i]);\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 ) : (\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(branch, pathname, allowPartial = false) {\n let { routesMeta } = branch;\n let matchedParams = {};\n let matchedPathname = \"/\";\n let matches = [];\n for (let i = 0; i < routesMeta.length; ++i) {\n let meta = routesMeta[i];\n let end = i === routesMeta.length - 1;\n let remainingPathname = matchedPathname === \"/\" ? pathname : pathname.slice(matchedPathname.length) || \"/\";\n let match = matchPath(\n { path: meta.relativePath, caseSensitive: meta.caseSensitive, end },\n remainingPathname\n );\n let route = meta.route;\n if (!match && end && allowPartial && !routesMeta[routesMeta.length - 1].route.index) {\n match = matchPath(\n {\n path: meta.relativePath,\n caseSensitive: meta.caseSensitive,\n end: false\n },\n remainingPathname\n );\n }\n if (!match) {\n return null;\n }\n Object.assign(matchedParams, match.params);\n matches.push({\n // TODO: Can this as be avoided?\n params: matchedParams,\n pathname: joinPaths([matchedPathname, match.pathname]),\n pathnameBase: normalizePathname(\n joinPaths([matchedPathname, match.pathnameBase])\n ),\n route\n });\n if (match.pathnameBase !== \"/\") {\n matchedPathname = joinPaths([matchedPathname, match.pathnameBase]);\n }\n }\n return matches;\n}\nfunction generatePath(originalPath, params = {}) {\n let path = originalPath;\n if (path.endsWith(\"*\") && path !== \"*\" && !path.endsWith(\"/*\")) {\n warning(\n false,\n `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(/\\*$/, \"/*\")}\".`\n );\n path = path.replace(/\\*$/, \"/*\");\n }\n const prefix = path.startsWith(\"/\") ? \"/\" : \"\";\n const stringify = (p) => p == null ? \"\" : typeof p === \"string\" ? p : String(p);\n const segments = path.split(/\\/+/).map((segment, index, array) => {\n const isLastSegment = index === array.length - 1;\n if (isLastSegment && segment === \"*\") {\n const star = \"*\";\n return stringify(params[star]);\n }\n const keyMatch = segment.match(/^:([\\w-]+)(\\??)$/);\n if (keyMatch) {\n const [, key, optional] = keyMatch;\n let param = params[key];\n invariant(optional === \"?\" || param != null, `Missing \":${key}\" param`);\n return stringify(param);\n }\n return segment.replace(/\\?$/g, \"\");\n }).filter((segment) => !!segment);\n return prefix + segments.join(\"/\");\n}\nfunction matchPath(pattern, pathname) {\n if (typeof pattern === \"string\") {\n pattern = { path: pattern, caseSensitive: false, end: true };\n }\n let [matcher, compiledParams] = compilePath(\n pattern.path,\n pattern.caseSensitive,\n pattern.end\n );\n let match = pathname.match(matcher);\n if (!match) return null;\n let matchedPathname = match[0];\n let pathnameBase = matchedPathname.replace(/(.)\\/+$/, \"$1\");\n let captureGroups = match.slice(1);\n let params = compiledParams.reduce(\n (memo2, { paramName, isOptional }, index) => {\n if (paramName === \"*\") {\n let splatValue = captureGroups[index] || \"\";\n pathnameBase = matchedPathname.slice(0, matchedPathname.length - splatValue.length).replace(/(.)\\/+$/, \"$1\");\n }\n const value = captureGroups[index];\n if (isOptional && !value) {\n memo2[paramName] = void 0;\n } else {\n memo2[paramName] = (value || \"\").replace(/%2F/g, \"/\");\n }\n return memo2;\n },\n {}\n );\n return {\n params,\n pathname: matchedPathname,\n pathnameBase,\n pattern\n };\n}\nfunction compilePath(path, caseSensitive = false, end = true) {\n warning(\n path === \"*\" || !path.endsWith(\"*\") || path.endsWith(\"/*\"),\n `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(/\\*$/, \"/*\")}\".`\n );\n let params = [];\n let regexpSource = \"^\" + path.replace(/\\/*\\*?$/, \"\").replace(/^\\/*/, \"/\").replace(/[\\\\.*+^${}|()[\\]]/g, \"\\\\$&\").replace(\n /\\/:([\\w-]+)(\\?)?/g,\n (_, paramName, isOptional) => {\n params.push({ paramName, isOptional: isOptional != null });\n return isOptional ? \"/?([^\\\\/]+)?\" : \"/([^\\\\/]+)\";\n }\n );\n if (path.endsWith(\"*\")) {\n params.push({ paramName: \"*\" });\n regexpSource += path === \"*\" || path === \"/*\" ? \"(.*)$\" : \"(?:\\\\/(.+)|\\\\/*)$\";\n } else if (end) {\n regexpSource += \"\\\\/*$\";\n } else if (path !== \"\" && path !== \"/\") {\n regexpSource += \"(?:(?=\\\\/|$))\";\n } else {\n }\n let matcher = new RegExp(regexpSource, caseSensitive ? void 0 : \"i\");\n return [matcher, params];\n}\nfunction decodePath(value) {\n try {\n return value.split(\"/\").map((v) => decodeURIComponent(v).replace(/\\//g, \"%2F\")).join(\"/\");\n } catch (error) {\n warning(\n false,\n `The URL path \"${value}\" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${error}).`\n );\n return value;\n }\n}\nfunction stripBasename(pathname, basename) {\n if (basename === \"/\") return pathname;\n if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) {\n return null;\n }\n let startIndex = basename.endsWith(\"/\") ? basename.length - 1 : basename.length;\n let nextChar = pathname.charAt(startIndex);\n if (nextChar && nextChar !== \"/\") {\n return null;\n }\n return pathname.slice(startIndex) || \"/\";\n}\nfunction resolvePath(to, fromPathname = \"/\") {\n let {\n pathname: toPathname,\n search = \"\",\n hash = \"\"\n } = typeof to === \"string\" ? parsePath(to) : to;\n let pathname = toPathname ? toPathname.startsWith(\"/\") ? toPathname : resolvePathname(toPathname, fromPathname) : fromPathname;\n return {\n pathname,\n search: normalizeSearch(search),\n hash: normalizeHash(hash)\n };\n}\nfunction resolvePathname(relativePath, fromPathname) {\n let segments = fromPathname.replace(/\\/+$/, \"\").split(\"/\");\n let relativeSegments = relativePath.split(\"/\");\n relativeSegments.forEach((segment) => {\n if (segment === \"..\") {\n if (segments.length > 1) segments.pop();\n } else if (segment !== \".\") {\n segments.push(segment);\n }\n });\n return segments.length > 1 ? segments.join(\"/\") : \"/\";\n}\nfunction getInvalidPathError(char, field, dest, path) {\n return `Cannot include a '${char}' character in a manually specified \\`to.${field}\\` field [${JSON.stringify(\n path\n )}]. 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.`;\n}\nfunction getPathContributingMatches(matches) {\n return matches.filter(\n (match, index) => index === 0 || match.route.path && match.route.path.length > 0\n );\n}\nfunction getResolveToMatches(matches) {\n let pathMatches = getPathContributingMatches(matches);\n return pathMatches.map(\n (match, idx) => idx === pathMatches.length - 1 ? match.pathname : match.pathnameBase\n );\n}\nfunction resolveTo(toArg, routePathnames, locationPathname, isPathRelative = false) {\n let to;\n if (typeof toArg === \"string\") {\n to = parsePath(toArg);\n } else {\n to = { ...toArg };\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 let isEmptyPath = toArg === \"\" || to.pathname === \"\";\n let toPathname = isEmptyPath ? \"/\" : to.pathname;\n let from;\n if (toPathname == null) {\n from = locationPathname;\n } else {\n let routePathnameIndex = routePathnames.length - 1;\n if (!isPathRelative && toPathname.startsWith(\"..\")) {\n let toSegments = toPathname.split(\"/\");\n while (toSegments[0] === \"..\") {\n toSegments.shift();\n routePathnameIndex -= 1;\n }\n to.pathname = toSegments.join(\"/\");\n }\n from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : \"/\";\n }\n let path = resolvePath(to, from);\n let hasExplicitTrailingSlash = toPathname && toPathname !== \"/\" && toPathname.endsWith(\"/\");\n let hasCurrentTrailingSlash = (isEmptyPath || toPathname === \".\") && locationPathname.endsWith(\"/\");\n if (!path.pathname.endsWith(\"/\") && (hasExplicitTrailingSlash || hasCurrentTrailingSlash)) {\n path.pathname += \"/\";\n }\n return path;\n}\nvar joinPaths = (paths) => paths.join(\"/\").replace(/\\/\\/+/g, \"/\");\nvar normalizePathname = (pathname) => pathname.replace(/\\/+$/, \"\").replace(/^\\/*/, \"/\");\nvar normalizeSearch = (search) => !search || search === \"?\" ? \"\" : search.startsWith(\"?\") ? search : \"?\" + search;\nvar normalizeHash = (hash) => !hash || hash === \"#\" ? \"\" : hash.startsWith(\"#\") ? hash : \"#\" + hash;\nvar DataWithResponseInit = class {\n constructor(data2, init) {\n this.type = \"DataWithResponseInit\";\n this.data = data2;\n this.init = init || null;\n }\n};\nfunction data(data2, init) {\n return new DataWithResponseInit(\n data2,\n typeof init === \"number\" ? { status: init } : init\n );\n}\nvar redirect = (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 let headers = new Headers(responseInit.headers);\n headers.set(\"Location\", url);\n return new Response(null, { ...responseInit, headers });\n};\nvar redirectDocument = (url, init) => {\n let response = redirect(url, init);\n response.headers.set(\"X-Remix-Reload-Document\", \"true\");\n return response;\n};\nvar replace = (url, init) => {\n let response = redirect(url, init);\n response.headers.set(\"X-Remix-Replace\", \"true\");\n return response;\n};\nvar ErrorResponseImpl = class {\n constructor(status, statusText, data2, internal = false) {\n this.status = status;\n this.statusText = statusText || \"\";\n this.internal = internal;\n if (data2 instanceof Error) {\n this.data = data2.toString();\n this.error = data2;\n } else {\n this.data = data2;\n }\n }\n};\nfunction isRouteErrorResponse(error) {\n return error != null && typeof error.status === \"number\" && typeof error.statusText === \"string\" && typeof error.internal === \"boolean\" && \"data\" in error;\n}\n\n// lib/router/router.ts\nvar validMutationMethodsArr = [\n \"POST\",\n \"PUT\",\n \"PATCH\",\n \"DELETE\"\n];\nvar validMutationMethods = new Set(\n validMutationMethodsArr\n);\nvar validRequestMethodsArr = [\n \"GET\",\n ...validMutationMethodsArr\n];\nvar validRequestMethods = new Set(validRequestMethodsArr);\nvar redirectStatusCodes = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);\nvar redirectPreserveMethodStatusCodes = /* @__PURE__ */ new Set([307, 308]);\nvar IDLE_NAVIGATION = {\n state: \"idle\",\n location: void 0,\n formMethod: void 0,\n formAction: void 0,\n formEncType: void 0,\n formData: void 0,\n json: void 0,\n text: void 0\n};\nvar IDLE_FETCHER = {\n state: \"idle\",\n data: void 0,\n formMethod: void 0,\n formAction: void 0,\n formEncType: void 0,\n formData: void 0,\n json: void 0,\n text: void 0\n};\nvar IDLE_BLOCKER = {\n state: \"unblocked\",\n proceed: void 0,\n reset: void 0,\n location: void 0\n};\nvar ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i;\nvar defaultMapRouteProperties = (route) => ({\n hasErrorBoundary: Boolean(route.hasErrorBoundary)\n});\nvar TRANSITIONS_STORAGE_KEY = \"remix-router-transitions\";\nvar ResetLoaderDataSymbol = Symbol(\"ResetLoaderData\");\nfunction createRouter(init) {\n const routerWindow = init.window ? init.window : typeof window !== \"undefined\" ? window : void 0;\n const isBrowser2 = typeof routerWindow !== \"undefined\" && typeof routerWindow.document !== \"undefined\" && typeof routerWindow.document.createElement !== \"undefined\";\n invariant(\n init.routes.length > 0,\n \"You must provide a non-empty routes array to createRouter\"\n );\n let mapRouteProperties2 = init.mapRouteProperties || defaultMapRouteProperties;\n let manifest = {};\n let dataRoutes = convertRoutesToDataRoutes(\n init.routes,\n mapRouteProperties2,\n void 0,\n manifest\n );\n let inFlightDataRoutes;\n let basename = init.basename || \"/\";\n let dataStrategyImpl = init.dataStrategy || defaultDataStrategy;\n let patchRoutesOnNavigationImpl = init.patchRoutesOnNavigation;\n let future = {\n ...init.future\n };\n let unlistenHistory = null;\n let subscribers = /* @__PURE__ */ new Set();\n let savedScrollPositions2 = null;\n let getScrollRestorationKey2 = null;\n let getScrollPosition = null;\n let initialScrollRestored = init.hydrationData != null;\n let initialMatches = matchRoutes(dataRoutes, init.history.location, basename);\n let initialErrors = null;\n if (initialMatches == null && !patchRoutesOnNavigationImpl) {\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 if (initialMatches && !init.hydrationData) {\n let fogOfWar = checkFogOfWar(\n initialMatches,\n dataRoutes,\n init.history.location.pathname\n );\n if (fogOfWar.active) {\n initialMatches = null;\n }\n }\n let initialized;\n if (!initialMatches) {\n initialized = false;\n initialMatches = [];\n let fogOfWar = checkFogOfWar(\n null,\n dataRoutes,\n init.history.location.pathname\n );\n if (fogOfWar.active && fogOfWar.matches) {\n initialMatches = fogOfWar.matches;\n }\n } else if (initialMatches.some((m) => m.route.lazy)) {\n initialized = false;\n } else if (!initialMatches.some((m) => m.route.loader)) {\n initialized = true;\n } else {\n let loaderData = init.hydrationData ? init.hydrationData.loaderData : null;\n let errors = init.hydrationData ? init.hydrationData.errors : null;\n if (errors) {\n let idx = initialMatches.findIndex(\n (m) => errors[m.route.id] !== void 0\n );\n initialized = initialMatches.slice(0, idx + 1).every((m) => !shouldLoadRouteOnHydration(m.route, loaderData, errors));\n } else {\n initialized = initialMatches.every(\n (m) => !shouldLoadRouteOnHydration(m.route, loaderData, errors)\n );\n }\n }\n let router;\n let state = {\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: /* @__PURE__ */ new Map(),\n blockers: /* @__PURE__ */ new Map()\n };\n let pendingAction = \"POP\" /* Pop */;\n let pendingPreventScrollReset = false;\n let pendingNavigationController;\n let pendingViewTransitionEnabled = false;\n let appliedViewTransitions = /* @__PURE__ */ new Map();\n let removePageHideEventListener = null;\n let isUninterruptedRevalidation = false;\n let isRevalidationRequired = false;\n let cancelledFetcherLoads = /* @__PURE__ */ new Set();\n let fetchControllers = /* @__PURE__ */ new Map();\n let incrementingLoadId = 0;\n let pendingNavigationLoadId = -1;\n let fetchReloadIds = /* @__PURE__ */ new Map();\n let fetchRedirectIds = /* @__PURE__ */ new Set();\n let fetchLoadMatches = /* @__PURE__ */ new Map();\n let activeFetchers = /* @__PURE__ */ new Map();\n let fetchersQueuedForDeletion = /* @__PURE__ */ new Set();\n let blockerFunctions = /* @__PURE__ */ new Map();\n let unblockBlockerHistoryUpdate = void 0;\n let pendingRevalidationDfd = null;\n function initialize() {\n unlistenHistory = init.history.listen(\n ({ action: historyAction, location, delta }) => {\n if (unblockBlockerHistoryUpdate) {\n unblockBlockerHistoryUpdate();\n unblockBlockerHistoryUpdate = void 0;\n return;\n }\n warning(\n blockerFunctions.size === 0 || delta != null,\n \"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.\"\n );\n let blockerKey = shouldBlockNavigation({\n currentLocation: state.location,\n nextLocation: location,\n historyAction\n });\n if (blockerKey && delta != null) {\n let nextHistoryUpdatePromise = new Promise((resolve) => {\n unblockBlockerHistoryUpdate = resolve;\n });\n init.history.go(delta * -1);\n updateBlocker(blockerKey, {\n state: \"blocked\",\n location,\n proceed() {\n updateBlocker(blockerKey, {\n state: \"proceeding\",\n proceed: void 0,\n reset: void 0,\n location\n });\n nextHistoryUpdatePromise.then(() => init.history.go(delta));\n },\n reset() {\n let blockers = new Map(state.blockers);\n blockers.set(blockerKey, IDLE_BLOCKER);\n updateState({ blockers });\n }\n });\n return;\n }\n return startNavigation(historyAction, location);\n }\n );\n if (isBrowser2) {\n restoreAppliedTransitions(routerWindow, appliedViewTransitions);\n let _saveAppliedTransitions = () => persistAppliedTransitions(routerWindow, appliedViewTransitions);\n routerWindow.addEventListener(\"pagehide\", _saveAppliedTransitions);\n removePageHideEventListener = () => routerWindow.removeEventListener(\"pagehide\", _saveAppliedTransitions);\n }\n if (!state.initialized) {\n startNavigation(\"POP\" /* Pop */, state.location, {\n initialHydration: true\n });\n }\n return router;\n }\n function dispose() {\n if (unlistenHistory) {\n unlistenHistory();\n }\n if (removePageHideEventListener) {\n removePageHideEventListener();\n }\n subscribers.clear();\n pendingNavigationController && pendingNavigationController.abort();\n state.fetchers.forEach((_, key) => deleteFetcher(key));\n state.blockers.forEach((_, key) => deleteBlocker(key));\n }\n function subscribe(fn) {\n subscribers.add(fn);\n return () => subscribers.delete(fn);\n }\n function updateState(newState, opts = {}) {\n state = {\n ...state,\n ...newState\n };\n let unmountedFetchers = [];\n let mountedFetchers = [];\n state.fetchers.forEach((fetcher, key) => {\n if (fetcher.state === \"idle\") {\n if (fetchersQueuedForDeletion.has(key)) {\n unmountedFetchers.push(key);\n } else {\n mountedFetchers.push(key);\n }\n }\n });\n fetchersQueuedForDeletion.forEach((key) => {\n if (!state.fetchers.has(key) && !fetchControllers.has(key)) {\n unmountedFetchers.push(key);\n }\n });\n [...subscribers].forEach(\n (subscriber) => subscriber(state, {\n deletedFetchers: unmountedFetchers,\n viewTransitionOpts: opts.viewTransitionOpts,\n flushSync: opts.flushSync === true\n })\n );\n unmountedFetchers.forEach((key) => deleteFetcher(key));\n mountedFetchers.forEach((key) => state.fetchers.delete(key));\n }\n function completeNavigation(location, newState, { flushSync } = {}) {\n let isActionReload = state.actionData != null && state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && state.navigation.state === \"loading\" && location.state?._isRedirect !== true;\n let actionData;\n if (newState.actionData) {\n if (Object.keys(newState.actionData).length > 0) {\n actionData = newState.actionData;\n } else {\n actionData = null;\n }\n } else if (isActionReload) {\n actionData = state.actionData;\n } else {\n actionData = null;\n }\n let loaderData = newState.loaderData ? mergeLoaderData(\n state.loaderData,\n newState.loaderData,\n newState.matches || [],\n newState.errors\n ) : state.loaderData;\n let blockers = state.blockers;\n if (blockers.size > 0) {\n blockers = new Map(blockers);\n blockers.forEach((_, k) => blockers.set(k, IDLE_BLOCKER));\n }\n let preventScrollReset = pendingPreventScrollReset === true || state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && location.state?._isRedirect !== true;\n if (inFlightDataRoutes) {\n dataRoutes = inFlightDataRoutes;\n inFlightDataRoutes = void 0;\n }\n if (isUninterruptedRevalidation) {\n } else if (pendingAction === \"POP\" /* Pop */) {\n } else if (pendingAction === \"PUSH\" /* Push */) {\n init.history.push(location, location.state);\n } else if (pendingAction === \"REPLACE\" /* Replace */) {\n init.history.replace(location, location.state);\n }\n let viewTransitionOpts;\n if (pendingAction === \"POP\" /* Pop */) {\n let priorPaths = appliedViewTransitions.get(state.location.pathname);\n if (priorPaths && priorPaths.has(location.pathname)) {\n viewTransitionOpts = {\n currentLocation: state.location,\n nextLocation: location\n };\n } else if (appliedViewTransitions.has(location.pathname)) {\n viewTransitionOpts = {\n currentLocation: location,\n nextLocation: state.location\n };\n }\n } else if (pendingViewTransitionEnabled) {\n let toPaths = appliedViewTransitions.get(state.location.pathname);\n if (toPaths) {\n toPaths.add(location.pathname);\n } else {\n toPaths = /* @__PURE__ */ new Set([location.pathname]);\n appliedViewTransitions.set(state.location.pathname, toPaths);\n }\n viewTransitionOpts = {\n currentLocation: state.location,\n nextLocation: location\n };\n }\n updateState(\n {\n ...newState,\n // 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\n },\n {\n viewTransitionOpts,\n flushSync: flushSync === true\n }\n );\n pendingAction = \"POP\" /* Pop */;\n pendingPreventScrollReset = false;\n pendingViewTransitionEnabled = false;\n isUninterruptedRevalidation = false;\n isRevalidationRequired = false;\n pendingRevalidationDfd?.resolve();\n pendingRevalidationDfd = null;\n }\n async function navigate(to, opts) {\n if (typeof to === \"number\") {\n init.history.go(to);\n return;\n }\n let normalizedPath = normalizeTo(\n state.location,\n state.matches,\n basename,\n to,\n opts?.fromRouteId,\n opts?.relative\n );\n let { path, submission, error } = normalizeNavigateOptions(\n false,\n normalizedPath,\n opts\n );\n let currentLocation = state.location;\n let nextLocation = createLocation(state.location, path, opts && opts.state);\n nextLocation = {\n ...nextLocation,\n ...init.history.encodeLocation(nextLocation)\n };\n let userReplace = opts && opts.replace != null ? opts.replace : void 0;\n let historyAction = \"PUSH\" /* Push */;\n if (userReplace === true) {\n historyAction = \"REPLACE\" /* Replace */;\n } else if (userReplace === false) {\n } else if (submission != null && isMutationMethod(submission.formMethod) && submission.formAction === state.location.pathname + state.location.search) {\n historyAction = \"REPLACE\" /* Replace */;\n }\n let preventScrollReset = opts && \"preventScrollReset\" in opts ? opts.preventScrollReset === true : void 0;\n let flushSync = (opts && opts.flushSync) === true;\n let blockerKey = shouldBlockNavigation({\n currentLocation,\n nextLocation,\n historyAction\n });\n if (blockerKey) {\n updateBlocker(blockerKey, {\n state: \"blocked\",\n location: nextLocation,\n proceed() {\n updateBlocker(blockerKey, {\n state: \"proceeding\",\n proceed: void 0,\n reset: void 0,\n location: nextLocation\n });\n navigate(to, opts);\n },\n reset() {\n let blockers = new Map(state.blockers);\n blockers.set(blockerKey, IDLE_BLOCKER);\n updateState({ blockers });\n }\n });\n return;\n }\n 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 enableViewTransition: opts && opts.viewTransition,\n flushSync\n });\n }\n function revalidate() {\n if (!pendingRevalidationDfd) {\n pendingRevalidationDfd = createDeferred();\n }\n interruptActiveLoads();\n updateState({ revalidation: \"loading\" });\n let promise = pendingRevalidationDfd.promise;\n if (state.navigation.state === \"submitting\") {\n return promise;\n }\n if (state.navigation.state === \"idle\") {\n startNavigation(state.historyAction, state.location, {\n startUninterruptedRevalidation: true\n });\n return promise;\n }\n startNavigation(\n pendingAction || state.historyAction,\n state.navigation.location,\n {\n overrideNavigation: state.navigation,\n // Proxy through any rending view transition\n enableViewTransition: pendingViewTransitionEnabled === true\n }\n );\n return promise;\n }\n async function startNavigation(historyAction, location, opts) {\n pendingNavigationController && pendingNavigationController.abort();\n pendingNavigationController = null;\n pendingAction = historyAction;\n isUninterruptedRevalidation = (opts && opts.startUninterruptedRevalidation) === true;\n saveScrollPosition(state.location, state.matches);\n pendingPreventScrollReset = (opts && opts.preventScrollReset) === true;\n pendingViewTransitionEnabled = (opts && opts.enableViewTransition) === true;\n let routesToUse = inFlightDataRoutes || dataRoutes;\n let loadingNavigation = opts && opts.overrideNavigation;\n let matches = matchRoutes(routesToUse, location, basename);\n let flushSync = (opts && opts.flushSync) === true;\n let fogOfWar = checkFogOfWar(matches, routesToUse, location.pathname);\n if (fogOfWar.active && fogOfWar.matches) {\n matches = fogOfWar.matches;\n }\n if (!matches) {\n let { error, notFoundMatches, route } = handleNavigational404(\n location.pathname\n );\n completeNavigation(\n location,\n {\n matches: notFoundMatches,\n loaderData: {},\n errors: {\n [route.id]: error\n }\n },\n { flushSync }\n );\n return;\n }\n if (state.initialized && !isRevalidationRequired && isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {\n completeNavigation(location, { matches }, { flushSync });\n return;\n }\n pendingNavigationController = new AbortController();\n let request = createClientSideRequest(\n init.history,\n location,\n pendingNavigationController.signal,\n opts && opts.submission\n );\n let pendingActionResult;\n if (opts && opts.pendingError) {\n pendingActionResult = [\n findNearestBoundary(matches).route.id,\n { type: \"error\" /* error */, error: opts.pendingError }\n ];\n } else if (opts && opts.submission && isMutationMethod(opts.submission.formMethod)) {\n let actionResult = await handleAction(\n request,\n location,\n opts.submission,\n matches,\n fogOfWar.active,\n { replace: opts.replace, flushSync }\n );\n if (actionResult.shortCircuited) {\n return;\n }\n if (actionResult.pendingActionResult) {\n let [routeId, result] = actionResult.pendingActionResult;\n if (isErrorResult(result) && isRouteErrorResponse(result.error) && result.error.status === 404) {\n pendingNavigationController = null;\n completeNavigation(location, {\n matches: actionResult.matches,\n loaderData: {},\n errors: {\n [routeId]: result.error\n }\n });\n return;\n }\n }\n matches = actionResult.matches || matches;\n pendingActionResult = actionResult.pendingActionResult;\n loadingNavigation = getLoadingNavigation(location, opts.submission);\n flushSync = false;\n fogOfWar.active = false;\n request = createClientSideRequest(\n init.history,\n request.url,\n request.signal\n );\n }\n let {\n shortCircuited,\n matches: updatedMatches,\n loaderData,\n errors\n } = await handleLoaders(\n request,\n location,\n matches,\n fogOfWar.active,\n loadingNavigation,\n opts && opts.submission,\n opts && opts.fetcherSubmission,\n opts && opts.replace,\n opts && opts.initialHydration === true,\n flushSync,\n pendingActionResult\n );\n if (shortCircuited) {\n return;\n }\n pendingNavigationController = null;\n completeNavigation(location, {\n matches: updatedMatches || matches,\n ...getActionDataForCommit(pendingActionResult),\n loaderData,\n errors\n });\n }\n async function handleAction(request, location, submission, matches, isFogOfWar, opts = {}) {\n interruptActiveLoads();\n let navigation = getSubmittingNavigation(location, submission);\n updateState({ navigation }, { flushSync: opts.flushSync === true });\n if (isFogOfWar) {\n let discoverResult = await discoverRoutes(\n matches,\n location.pathname,\n request.signal\n );\n if (discoverResult.type === \"aborted\") {\n return { shortCircuited: true };\n } else if (discoverResult.type === \"error\") {\n let boundaryId = findNearestBoundary(discoverResult.partialMatches).route.id;\n return {\n matches: discoverResult.partialMatches,\n pendingActionResult: [\n boundaryId,\n {\n type: \"error\" /* error */,\n error: discoverResult.error\n }\n ]\n };\n } else if (!discoverResult.matches) {\n let { notFoundMatches, error, route } = handleNavigational404(\n location.pathname\n );\n return {\n matches: notFoundMatches,\n pendingActionResult: [\n route.id,\n {\n type: \"error\" /* error */,\n error\n }\n ]\n };\n } else {\n matches = discoverResult.matches;\n }\n }\n let result;\n let actionMatch = getTargetMatch(matches, location);\n if (!actionMatch.route.action && !actionMatch.route.lazy) {\n result = {\n type: \"error\" /* error */,\n error: getInternalRouterError(405, {\n method: request.method,\n pathname: location.pathname,\n routeId: actionMatch.route.id\n })\n };\n } else {\n let results = await callDataStrategy(\n \"action\",\n state,\n request,\n [actionMatch],\n matches,\n null\n );\n result = results[actionMatch.route.id];\n if (request.signal.aborted) {\n return { shortCircuited: true };\n }\n }\n if (isRedirectResult(result)) {\n let replace2;\n if (opts && opts.replace != null) {\n replace2 = opts.replace;\n } else {\n let location2 = normalizeRedirectLocation(\n result.response.headers.get(\"Location\"),\n new URL(request.url),\n basename\n );\n replace2 = location2 === state.location.pathname + state.location.search;\n }\n await startRedirectNavigation(request, result, true, {\n submission,\n replace: replace2\n });\n return { shortCircuited: true };\n }\n if (isErrorResult(result)) {\n let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id);\n if ((opts && opts.replace) !== true) {\n pendingAction = \"PUSH\" /* Push */;\n }\n return {\n matches,\n pendingActionResult: [boundaryMatch.route.id, result]\n };\n }\n return {\n matches,\n pendingActionResult: [actionMatch.route.id, result]\n };\n }\n async function handleLoaders(request, location, matches, isFogOfWar, overrideNavigation, submission, fetcherSubmission, replace2, initialHydration, flushSync, pendingActionResult) {\n let loadingNavigation = overrideNavigation || getLoadingNavigation(location, submission);\n let activeSubmission = submission || fetcherSubmission || getSubmissionFromNavigation(loadingNavigation);\n let shouldUpdateNavigationState = !isUninterruptedRevalidation && !initialHydration;\n if (isFogOfWar) {\n if (shouldUpdateNavigationState) {\n let actionData = getUpdatedActionData(pendingActionResult);\n updateState(\n {\n navigation: loadingNavigation,\n ...actionData !== void 0 ? { actionData } : {}\n },\n {\n flushSync\n }\n );\n }\n let discoverResult = await discoverRoutes(\n matches,\n location.pathname,\n request.signal\n );\n if (discoverResult.type === \"aborted\") {\n return { shortCircuited: true };\n } else if (discoverResult.type === \"error\") {\n let boundaryId = findNearestBoundary(discoverResult.partialMatches).route.id;\n return {\n matches: discoverResult.partialMatches,\n loaderData: {},\n errors: {\n [boundaryId]: discoverResult.error\n }\n };\n } else if (!discoverResult.matches) {\n let { error, notFoundMatches, route } = handleNavigational404(\n location.pathname\n );\n return {\n matches: notFoundMatches,\n loaderData: {},\n errors: {\n [route.id]: error\n }\n };\n } else {\n matches = discoverResult.matches;\n }\n }\n let routesToUse = inFlightDataRoutes || dataRoutes;\n let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(\n init.history,\n state,\n matches,\n activeSubmission,\n location,\n initialHydration === true,\n isRevalidationRequired,\n cancelledFetcherLoads,\n fetchersQueuedForDeletion,\n fetchLoadMatches,\n fetchRedirectIds,\n routesToUse,\n basename,\n pendingActionResult\n );\n pendingNavigationLoadId = ++incrementingLoadId;\n if (matchesToLoad.length === 0 && revalidatingFetchers.length === 0) {\n let updatedFetchers2 = markFetchRedirectsDone();\n completeNavigation(\n location,\n {\n matches,\n loaderData: {},\n // Commit pending error if we're short circuiting\n errors: pendingActionResult && isErrorResult(pendingActionResult[1]) ? { [pendingActionResult[0]]: pendingActionResult[1].error } : null,\n ...getActionDataForCommit(pendingActionResult),\n ...updatedFetchers2 ? { fetchers: new Map(state.fetchers) } : {}\n },\n { flushSync }\n );\n return { shortCircuited: true };\n }\n if (shouldUpdateNavigationState) {\n let updates = {};\n if (!isFogOfWar) {\n updates.navigation = loadingNavigation;\n let actionData = getUpdatedActionData(pendingActionResult);\n if (actionData !== void 0) {\n updates.actionData = actionData;\n }\n }\n if (revalidatingFetchers.length > 0) {\n updates.fetchers = getUpdatedRevalidatingFetchers(revalidatingFetchers);\n }\n updateState(updates, { flushSync });\n }\n revalidatingFetchers.forEach((rf) => {\n abortFetcher(rf.key);\n if (rf.controller) {\n fetchControllers.set(rf.key, rf.controller);\n }\n });\n let abortPendingFetchRevalidations = () => revalidatingFetchers.forEach((f) => abortFetcher(f.key));\n if (pendingNavigationController) {\n pendingNavigationController.signal.addEventListener(\n \"abort\",\n abortPendingFetchRevalidations\n );\n }\n let { loaderResults, fetcherResults } = await callLoadersAndMaybeResolveData(\n state,\n matches,\n matchesToLoad,\n revalidatingFetchers,\n request\n );\n if (request.signal.aborted) {\n return { shortCircuited: true };\n }\n if (pendingNavigationController) {\n pendingNavigationController.signal.removeEventListener(\n \"abort\",\n abortPendingFetchRevalidations\n );\n }\n revalidatingFetchers.forEach((rf) => fetchControllers.delete(rf.key));\n let redirect2 = findRedirect(loaderResults);\n if (redirect2) {\n await startRedirectNavigation(request, redirect2.result, true, {\n replace: replace2\n });\n return { shortCircuited: true };\n }\n redirect2 = findRedirect(fetcherResults);\n if (redirect2) {\n fetchRedirectIds.add(redirect2.key);\n await startRedirectNavigation(request, redirect2.result, true, {\n replace: replace2\n });\n return { shortCircuited: true };\n }\n let { loaderData, errors } = processLoaderData(\n state,\n matches,\n loaderResults,\n pendingActionResult,\n revalidatingFetchers,\n fetcherResults\n );\n if (initialHydration && state.errors) {\n errors = { ...state.errors, ...errors };\n }\n let updatedFetchers = markFetchRedirectsDone();\n let didAbortFetchLoads = abortStaleFetchLoads(pendingNavigationLoadId);\n let shouldUpdateFetchers = updatedFetchers || didAbortFetchLoads || revalidatingFetchers.length > 0;\n return {\n matches,\n loaderData,\n errors,\n ...shouldUpdateFetchers ? { fetchers: new Map(state.fetchers) } : {}\n };\n }\n function getUpdatedActionData(pendingActionResult) {\n if (pendingActionResult && !isErrorResult(pendingActionResult[1])) {\n return {\n [pendingActionResult[0]]: pendingActionResult[1].data\n };\n } else if (state.actionData) {\n if (Object.keys(state.actionData).length === 0) {\n return null;\n } else {\n return state.actionData;\n }\n }\n }\n function getUpdatedRevalidatingFetchers(revalidatingFetchers) {\n revalidatingFetchers.forEach((rf) => {\n let fetcher = state.fetchers.get(rf.key);\n let revalidatingFetcher = getLoadingFetcher(\n void 0,\n fetcher ? fetcher.data : void 0\n );\n state.fetchers.set(rf.key, revalidatingFetcher);\n });\n return new Map(state.fetchers);\n }\n async function fetch2(key, routeId, href, opts) {\n abortFetcher(key);\n let flushSync = (opts && opts.flushSync) === true;\n let routesToUse = inFlightDataRoutes || dataRoutes;\n let normalizedPath = normalizeTo(\n state.location,\n state.matches,\n basename,\n href,\n routeId,\n opts?.relative\n );\n let matches = matchRoutes(routesToUse, normalizedPath, basename);\n let fogOfWar = checkFogOfWar(matches, routesToUse, normalizedPath);\n if (fogOfWar.active && fogOfWar.matches) {\n matches = fogOfWar.matches;\n }\n if (!matches) {\n setFetcherError(\n key,\n routeId,\n getInternalRouterError(404, { pathname: normalizedPath }),\n { flushSync }\n );\n return;\n }\n let { path, submission, error } = normalizeNavigateOptions(\n true,\n normalizedPath,\n opts\n );\n if (error) {\n setFetcherError(key, routeId, error, { flushSync });\n return;\n }\n let match = getTargetMatch(matches, path);\n let preventScrollReset = (opts && opts.preventScrollReset) === true;\n if (submission && isMutationMethod(submission.formMethod)) {\n await handleFetcherAction(\n key,\n routeId,\n path,\n match,\n matches,\n fogOfWar.active,\n flushSync,\n preventScrollReset,\n submission\n );\n return;\n }\n fetchLoadMatches.set(key, { routeId, path });\n await handleFetcherLoader(\n key,\n routeId,\n path,\n match,\n matches,\n fogOfWar.active,\n flushSync,\n preventScrollReset,\n submission\n );\n }\n async function handleFetcherAction(key, routeId, path, match, requestMatches, isFogOfWar, flushSync, preventScrollReset, submission) {\n interruptActiveLoads();\n fetchLoadMatches.delete(key);\n function detectAndHandle405Error(m) {\n if (!m.route.action && !m.route.lazy) {\n let error = getInternalRouterError(405, {\n method: submission.formMethod,\n pathname: path,\n routeId\n });\n setFetcherError(key, routeId, error, { flushSync });\n return true;\n }\n return false;\n }\n if (!isFogOfWar && detectAndHandle405Error(match)) {\n return;\n }\n let existingFetcher = state.fetchers.get(key);\n updateFetcherState(key, getSubmittingFetcher(submission, existingFetcher), {\n flushSync\n });\n let abortController = new AbortController();\n let fetchRequest = createClientSideRequest(\n init.history,\n path,\n abortController.signal,\n submission\n );\n if (isFogOfWar) {\n let discoverResult = await discoverRoutes(\n requestMatches,\n path,\n fetchRequest.signal\n );\n if (discoverResult.type === \"aborted\") {\n return;\n } else if (discoverResult.type === \"error\") {\n setFetcherError(key, routeId, discoverResult.error, { flushSync });\n return;\n } else if (!discoverResult.matches) {\n setFetcherError(\n key,\n routeId,\n getInternalRouterError(404, { pathname: path }),\n { flushSync }\n );\n return;\n } else {\n requestMatches = discoverResult.matches;\n match = getTargetMatch(requestMatches, path);\n if (detectAndHandle405Error(match)) {\n return;\n }\n }\n }\n fetchControllers.set(key, abortController);\n let originatingLoadId = incrementingLoadId;\n let actionResults = await callDataStrategy(\n \"action\",\n state,\n fetchRequest,\n [match],\n requestMatches,\n key\n );\n let actionResult = actionResults[match.route.id];\n if (fetchRequest.signal.aborted) {\n if (fetchControllers.get(key) === abortController) {\n fetchControllers.delete(key);\n }\n return;\n }\n if (fetchersQueuedForDeletion.has(key)) {\n if (isRedirectResult(actionResult) || isErrorResult(actionResult)) {\n updateFetcherState(key, getDoneFetcher(void 0));\n return;\n }\n } else {\n if (isRedirectResult(actionResult)) {\n fetchControllers.delete(key);\n if (pendingNavigationLoadId > originatingLoadId) {\n updateFetcherState(key, getDoneFetcher(void 0));\n return;\n } else {\n fetchRedirectIds.add(key);\n updateFetcherState(key, getLoadingFetcher(submission));\n return startRedirectNavigation(fetchRequest, actionResult, false, {\n fetcherSubmission: submission,\n preventScrollReset\n });\n }\n }\n if (isErrorResult(actionResult)) {\n setFetcherError(key, routeId, actionResult.error);\n return;\n }\n }\n let nextLocation = state.navigation.location || state.location;\n let revalidationRequest = createClientSideRequest(\n init.history,\n nextLocation,\n abortController.signal\n );\n let routesToUse = inFlightDataRoutes || dataRoutes;\n let matches = state.navigation.state !== \"idle\" ? matchRoutes(routesToUse, state.navigation.location, basename) : state.matches;\n invariant(matches, \"Didn't find any matches after fetcher action\");\n let loadId = ++incrementingLoadId;\n fetchReloadIds.set(key, loadId);\n let loadFetcher = getLoadingFetcher(submission, actionResult.data);\n state.fetchers.set(key, loadFetcher);\n let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(\n init.history,\n state,\n matches,\n submission,\n nextLocation,\n false,\n isRevalidationRequired,\n cancelledFetcherLoads,\n fetchersQueuedForDeletion,\n fetchLoadMatches,\n fetchRedirectIds,\n routesToUse,\n basename,\n [match.route.id, actionResult]\n );\n revalidatingFetchers.filter((rf) => rf.key !== key).forEach((rf) => {\n let staleKey = rf.key;\n let existingFetcher2 = state.fetchers.get(staleKey);\n let revalidatingFetcher = getLoadingFetcher(\n void 0,\n existingFetcher2 ? existingFetcher2.data : void 0\n );\n state.fetchers.set(staleKey, revalidatingFetcher);\n abortFetcher(staleKey);\n if (rf.controller) {\n fetchControllers.set(staleKey, rf.controller);\n }\n });\n updateState({ fetchers: new Map(state.fetchers) });\n let abortPendingFetchRevalidations = () => revalidatingFetchers.forEach((rf) => abortFetcher(rf.key));\n abortController.signal.addEventListener(\n \"abort\",\n abortPendingFetchRevalidations\n );\n let { loaderResults, fetcherResults } = await callLoadersAndMaybeResolveData(\n state,\n matches,\n matchesToLoad,\n revalidatingFetchers,\n revalidationRequest\n );\n if (abortController.signal.aborted) {\n return;\n }\n abortController.signal.removeEventListener(\n \"abort\",\n abortPendingFetchRevalidations\n );\n fetchReloadIds.delete(key);\n fetchControllers.delete(key);\n revalidatingFetchers.forEach((r) => fetchControllers.delete(r.key));\n let redirect2 = findRedirect(loaderResults);\n if (redirect2) {\n return startRedirectNavigation(\n revalidationRequest,\n redirect2.result,\n false,\n { preventScrollReset }\n );\n }\n redirect2 = findRedirect(fetcherResults);\n if (redirect2) {\n fetchRedirectIds.add(redirect2.key);\n return startRedirectNavigation(\n revalidationRequest,\n redirect2.result,\n false,\n { preventScrollReset }\n );\n }\n let { loaderData, errors } = processLoaderData(\n state,\n matches,\n loaderResults,\n void 0,\n revalidatingFetchers,\n fetcherResults\n );\n if (state.fetchers.has(key)) {\n let doneFetcher = getDoneFetcher(actionResult.data);\n state.fetchers.set(key, doneFetcher);\n }\n abortStaleFetchLoads(loadId);\n if (state.navigation.state === \"loading\" && loadId > pendingNavigationLoadId) {\n invariant(pendingAction, \"Expected pending action\");\n pendingNavigationController && pendingNavigationController.abort();\n completeNavigation(state.navigation.location, {\n matches,\n loaderData,\n errors,\n fetchers: new Map(state.fetchers)\n });\n } else {\n updateState({\n errors,\n loaderData: mergeLoaderData(\n state.loaderData,\n loaderData,\n matches,\n errors\n ),\n fetchers: new Map(state.fetchers)\n });\n isRevalidationRequired = false;\n }\n }\n async function handleFetcherLoader(key, routeId, path, match, matches, isFogOfWar, flushSync, preventScrollReset, submission) {\n let existingFetcher = state.fetchers.get(key);\n updateFetcherState(\n key,\n getLoadingFetcher(\n submission,\n existingFetcher ? existingFetcher.data : void 0\n ),\n { flushSync }\n );\n let abortController = new AbortController();\n let fetchRequest = createClientSideRequest(\n init.history,\n path,\n abortController.signal\n );\n if (isFogOfWar) {\n let discoverResult = await discoverRoutes(\n matches,\n path,\n fetchRequest.signal\n );\n if (discoverResult.type === \"aborted\") {\n return;\n } else if (discoverResult.type === \"error\") {\n setFetcherError(key, routeId, discoverResult.error, { flushSync });\n return;\n } else if (!discoverResult.matches) {\n setFetcherError(\n key,\n routeId,\n getInternalRouterError(404, { pathname: path }),\n { flushSync }\n );\n return;\n } else {\n matches = discoverResult.matches;\n match = getTargetMatch(matches, path);\n }\n }\n fetchControllers.set(key, abortController);\n let originatingLoadId = incrementingLoadId;\n let results = await callDataStrategy(\n \"loader\",\n state,\n fetchRequest,\n [match],\n matches,\n key\n );\n let result = results[match.route.id];\n if (fetchControllers.get(key) === abortController) {\n fetchControllers.delete(key);\n }\n if (fetchRequest.signal.aborted) {\n return;\n }\n if (fetchersQueuedForDeletion.has(key)) {\n updateFetcherState(key, getDoneFetcher(void 0));\n return;\n }\n if (isRedirectResult(result)) {\n if (pendingNavigationLoadId > originatingLoadId) {\n updateFetcherState(key, getDoneFetcher(void 0));\n return;\n } else {\n fetchRedirectIds.add(key);\n await startRedirectNavigation(fetchRequest, result, false, {\n preventScrollReset\n });\n return;\n }\n }\n if (isErrorResult(result)) {\n setFetcherError(key, routeId, result.error);\n return;\n }\n updateFetcherState(key, getDoneFetcher(result.data));\n }\n async function startRedirectNavigation(request, redirect2, isNavigation, {\n submission,\n fetcherSubmission,\n preventScrollReset,\n replace: replace2\n } = {}) {\n if (redirect2.response.headers.has(\"X-Remix-Revalidate\")) {\n isRevalidationRequired = true;\n }\n let location = redirect2.response.headers.get(\"Location\");\n invariant(location, \"Expected a Location header on the redirect Response\");\n location = normalizeRedirectLocation(\n location,\n new URL(request.url),\n basename\n );\n let redirectLocation = createLocation(state.location, location, {\n _isRedirect: true\n });\n if (isBrowser2) {\n let isDocumentReload = false;\n if (redirect2.response.headers.has(\"X-Remix-Reload-Document\")) {\n isDocumentReload = true;\n } else if (ABSOLUTE_URL_REGEX.test(location)) {\n const url = init.history.createURL(location);\n isDocumentReload = // Hard reload if it's an absolute URL to a new origin\n url.origin !== routerWindow.location.origin || // Hard reload if it's an absolute URL that does not match our basename\n stripBasename(url.pathname, basename) == null;\n }\n if (isDocumentReload) {\n if (replace2) {\n routerWindow.location.replace(location);\n } else {\n routerWindow.location.assign(location);\n }\n return;\n }\n }\n pendingNavigationController = null;\n let redirectNavigationType = replace2 === true || redirect2.response.headers.has(\"X-Remix-Replace\") ? \"REPLACE\" /* Replace */ : \"PUSH\" /* Push */;\n let { formMethod, formAction, formEncType } = state.navigation;\n if (!submission && !fetcherSubmission && formMethod && formAction && formEncType) {\n submission = getSubmissionFromNavigation(state.navigation);\n }\n let activeSubmission = submission || fetcherSubmission;\n if (redirectPreserveMethodStatusCodes.has(redirect2.response.status) && activeSubmission && isMutationMethod(activeSubmission.formMethod)) {\n await startNavigation(redirectNavigationType, redirectLocation, {\n submission: {\n ...activeSubmission,\n formAction: location\n },\n // Preserve these flags across redirects\n preventScrollReset: preventScrollReset || pendingPreventScrollReset,\n enableViewTransition: isNavigation ? pendingViewTransitionEnabled : void 0\n });\n } else {\n let overrideNavigation = getLoadingNavigation(\n redirectLocation,\n submission\n );\n await startNavigation(redirectNavigationType, redirectLocation, {\n overrideNavigation,\n // Send fetcher submissions through for shouldRevalidate\n fetcherSubmission,\n // Preserve these flags across redirects\n preventScrollReset: preventScrollReset || pendingPreventScrollReset,\n enableViewTransition: isNavigation ? pendingViewTransitionEnabled : void 0\n });\n }\n }\n async function callDataStrategy(type, state2, request, matchesToLoad, matches, fetcherKey) {\n let results;\n let dataResults = {};\n try {\n results = await callDataStrategyImpl(\n dataStrategyImpl,\n type,\n state2,\n request,\n matchesToLoad,\n matches,\n fetcherKey,\n manifest,\n mapRouteProperties2\n );\n } catch (e) {\n matchesToLoad.forEach((m) => {\n dataResults[m.route.id] = {\n type: \"error\" /* error */,\n error: e\n };\n });\n return dataResults;\n }\n for (let [routeId, result] of Object.entries(results)) {\n if (isRedirectDataStrategyResult(result)) {\n let response = result.result;\n dataResults[routeId] = {\n type: \"redirect\" /* redirect */,\n response: normalizeRelativeRoutingRedirectResponse(\n response,\n request,\n routeId,\n matches,\n basename\n )\n };\n } else {\n dataResults[routeId] = await convertDataStrategyResultToDataResult(\n result\n );\n }\n }\n return dataResults;\n }\n async function callLoadersAndMaybeResolveData(state2, matches, matchesToLoad, fetchersToLoad, request) {\n let loaderResultsPromise = callDataStrategy(\n \"loader\",\n state2,\n request,\n matchesToLoad,\n matches,\n null\n );\n let fetcherResultsPromise = Promise.all(\n fetchersToLoad.map(async (f) => {\n if (f.matches && f.match && f.controller) {\n let results = await callDataStrategy(\n \"loader\",\n state2,\n createClientSideRequest(init.history, f.path, f.controller.signal),\n [f.match],\n f.matches,\n f.key\n );\n let result = results[f.match.route.id];\n return { [f.key]: result };\n } else {\n return Promise.resolve({\n [f.key]: {\n type: \"error\" /* error */,\n error: getInternalRouterError(404, {\n pathname: f.path\n })\n }\n });\n }\n })\n );\n let loaderResults = await loaderResultsPromise;\n let fetcherResults = (await fetcherResultsPromise).reduce(\n (acc, r) => Object.assign(acc, r),\n {}\n );\n return {\n loaderResults,\n fetcherResults\n };\n }\n function interruptActiveLoads() {\n isRevalidationRequired = true;\n fetchLoadMatches.forEach((_, key) => {\n if (fetchControllers.has(key)) {\n cancelledFetcherLoads.add(key);\n }\n abortFetcher(key);\n });\n }\n function updateFetcherState(key, fetcher, opts = {}) {\n state.fetchers.set(key, fetcher);\n updateState(\n { fetchers: new Map(state.fetchers) },\n { flushSync: (opts && opts.flushSync) === true }\n );\n }\n function setFetcherError(key, routeId, error, opts = {}) {\n let boundaryMatch = findNearestBoundary(state.matches, routeId);\n deleteFetcher(key);\n updateState(\n {\n errors: {\n [boundaryMatch.route.id]: error\n },\n fetchers: new Map(state.fetchers)\n },\n { flushSync: (opts && opts.flushSync) === true }\n );\n }\n function getFetcher(key) {\n activeFetchers.set(key, (activeFetchers.get(key) || 0) + 1);\n if (fetchersQueuedForDeletion.has(key)) {\n fetchersQueuedForDeletion.delete(key);\n }\n return state.fetchers.get(key) || IDLE_FETCHER;\n }\n function deleteFetcher(key) {\n let fetcher = state.fetchers.get(key);\n if (fetchControllers.has(key) && !(fetcher && fetcher.state === \"loading\" && fetchReloadIds.has(key))) {\n abortFetcher(key);\n }\n fetchLoadMatches.delete(key);\n fetchReloadIds.delete(key);\n fetchRedirectIds.delete(key);\n fetchersQueuedForDeletion.delete(key);\n cancelledFetcherLoads.delete(key);\n state.fetchers.delete(key);\n }\n function queueFetcherForDeletion(key) {\n let count = (activeFetchers.get(key) || 0) - 1;\n if (count <= 0) {\n activeFetchers.delete(key);\n fetchersQueuedForDeletion.add(key);\n } else {\n activeFetchers.set(key, count);\n }\n updateState({ fetchers: new Map(state.fetchers) });\n }\n function abortFetcher(key) {\n let controller = fetchControllers.get(key);\n if (controller) {\n controller.abort();\n fetchControllers.delete(key);\n }\n }\n function markFetchersDone(keys) {\n for (let key of keys) {\n let fetcher = getFetcher(key);\n let doneFetcher = getDoneFetcher(fetcher.data);\n state.fetchers.set(key, doneFetcher);\n }\n }\n function markFetchRedirectsDone() {\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 function abortStaleFetchLoads(landedId) {\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 function getBlocker(key, fn) {\n let blocker = state.blockers.get(key) || IDLE_BLOCKER;\n if (blockerFunctions.get(key) !== fn) {\n blockerFunctions.set(key, fn);\n }\n return blocker;\n }\n function deleteBlocker(key) {\n state.blockers.delete(key);\n blockerFunctions.delete(key);\n }\n function updateBlocker(key, newBlocker) {\n let blocker = state.blockers.get(key) || IDLE_BLOCKER;\n invariant(\n 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\",\n `Invalid blocker state transition: ${blocker.state} -> ${newBlocker.state}`\n );\n let blockers = new Map(state.blockers);\n blockers.set(key, newBlocker);\n updateState({ blockers });\n }\n function shouldBlockNavigation({\n currentLocation,\n nextLocation,\n historyAction\n }) {\n if (blockerFunctions.size === 0) {\n return;\n }\n if (blockerFunctions.size > 1) {\n warning(false, \"A router only supports one blocker at a time\");\n }\n let entries = Array.from(blockerFunctions.entries());\n let [blockerKey, blockerFunction] = entries[entries.length - 1];\n let blocker = state.blockers.get(blockerKey);\n if (blocker && blocker.state === \"proceeding\") {\n return;\n }\n if (blockerFunction({ currentLocation, nextLocation, historyAction })) {\n return blockerKey;\n }\n }\n function handleNavigational404(pathname) {\n let error = getInternalRouterError(404, { pathname });\n let routesToUse = inFlightDataRoutes || dataRoutes;\n let { matches, route } = getShortCircuitMatches(routesToUse);\n return { notFoundMatches: matches, route, error };\n }\n function enableScrollRestoration(positions, getPosition, getKey) {\n savedScrollPositions2 = positions;\n getScrollPosition = getPosition;\n getScrollRestorationKey2 = getKey || null;\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 return () => {\n savedScrollPositions2 = null;\n getScrollPosition = null;\n getScrollRestorationKey2 = null;\n };\n }\n function getScrollKey(location, matches) {\n if (getScrollRestorationKey2) {\n let key = getScrollRestorationKey2(\n location,\n matches.map((m) => convertRouteMatchToUiMatch(m, state.loaderData))\n );\n return key || location.key;\n }\n return location.key;\n }\n function saveScrollPosition(location, matches) {\n if (savedScrollPositions2 && getScrollPosition) {\n let key = getScrollKey(location, matches);\n savedScrollPositions2[key] = getScrollPosition();\n }\n }\n function getSavedScrollPosition(location, matches) {\n if (savedScrollPositions2) {\n let key = getScrollKey(location, matches);\n let y = savedScrollPositions2[key];\n if (typeof y === \"number\") {\n return y;\n }\n }\n return null;\n }\n function checkFogOfWar(matches, routesToUse, pathname) {\n if (patchRoutesOnNavigationImpl) {\n if (!matches) {\n let fogMatches = matchRoutesImpl(\n routesToUse,\n pathname,\n basename,\n true\n );\n return { active: true, matches: fogMatches || [] };\n } else {\n if (Object.keys(matches[0].params).length > 0) {\n let partialMatches = matchRoutesImpl(\n routesToUse,\n pathname,\n basename,\n true\n );\n return { active: true, matches: partialMatches };\n }\n }\n }\n return { active: false, matches: null };\n }\n async function discoverRoutes(matches, pathname, signal) {\n if (!patchRoutesOnNavigationImpl) {\n return { type: \"success\", matches };\n }\n let partialMatches = matches;\n while (true) {\n let isNonHMR = inFlightDataRoutes == null;\n let routesToUse = inFlightDataRoutes || dataRoutes;\n let localManifest = manifest;\n try {\n await patchRoutesOnNavigationImpl({\n path: pathname,\n matches: partialMatches,\n patch: (routeId, children) => {\n if (signal.aborted) return;\n patchRoutesImpl(\n routeId,\n children,\n routesToUse,\n localManifest,\n mapRouteProperties2\n );\n }\n });\n } catch (e) {\n return { type: \"error\", error: e, partialMatches };\n } finally {\n if (isNonHMR && !signal.aborted) {\n dataRoutes = [...dataRoutes];\n }\n }\n if (signal.aborted) {\n return { type: \"aborted\" };\n }\n let newMatches = matchRoutes(routesToUse, pathname, basename);\n if (newMatches) {\n return { type: \"success\", matches: newMatches };\n }\n let newPartialMatches = matchRoutesImpl(\n routesToUse,\n pathname,\n basename,\n true\n );\n if (!newPartialMatches || partialMatches.length === newPartialMatches.length && partialMatches.every(\n (m, i) => m.route.id === newPartialMatches[i].route.id\n )) {\n return { type: \"success\", matches: null };\n }\n partialMatches = newPartialMatches;\n }\n }\n function _internalSetRoutes(newRoutes) {\n manifest = {};\n inFlightDataRoutes = convertRoutesToDataRoutes(\n newRoutes,\n mapRouteProperties2,\n void 0,\n manifest\n );\n }\n function patchRoutes(routeId, children) {\n let isNonHMR = inFlightDataRoutes == null;\n let routesToUse = inFlightDataRoutes || dataRoutes;\n patchRoutesImpl(\n routeId,\n children,\n routesToUse,\n manifest,\n mapRouteProperties2\n );\n if (isNonHMR) {\n dataRoutes = [...dataRoutes];\n updateState({});\n }\n }\n router = {\n get basename() {\n return basename;\n },\n get future() {\n return future;\n },\n get state() {\n return state;\n },\n get routes() {\n return dataRoutes;\n },\n get window() {\n return routerWindow;\n },\n initialize,\n subscribe,\n enableScrollRestoration,\n navigate,\n fetch: fetch2,\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) => init.history.createHref(to),\n encodeLocation: (to) => init.history.encodeLocation(to),\n getFetcher,\n deleteFetcher: queueFetcherForDeletion,\n dispose,\n getBlocker,\n deleteBlocker,\n patchRoutes,\n _internalFetchControllers: fetchControllers,\n // TODO: Remove setRoutes, it's temporary to avoid dealing with\n // updating the tree while validating the update algorithm.\n _internalSetRoutes\n };\n return router;\n}\nfunction createStaticHandler(routes, opts) {\n invariant(\n routes.length > 0,\n \"You must provide a non-empty routes array to createStaticHandler\"\n );\n let manifest = {};\n let basename = (opts ? opts.basename : null) || \"/\";\n let mapRouteProperties2 = opts?.mapRouteProperties || defaultMapRouteProperties;\n let dataRoutes = convertRoutesToDataRoutes(\n routes,\n mapRouteProperties2,\n void 0,\n manifest\n );\n async function query(request, {\n requestContext,\n skipLoaderErrorBubbling,\n dataStrategy\n } = {}) {\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 if (!isValidMethod(method) && method !== \"HEAD\") {\n let error = getInternalRouterError(405, { method });\n let { matches: methodNotAllowedMatches, route } = 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 };\n } else if (!matches) {\n let error = getInternalRouterError(404, { pathname: location.pathname });\n let { matches: notFoundMatches, route } = 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 };\n }\n let result = await queryImpl(\n request,\n location,\n matches,\n requestContext,\n dataStrategy || null,\n skipLoaderErrorBubbling === true,\n null\n );\n if (isResponse(result)) {\n return result;\n }\n return { location, basename, ...result };\n }\n async function queryRoute(request, {\n routeId,\n requestContext,\n dataStrategy\n } = {}) {\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 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 let match = routeId ? matches.find((m) => m.route.id === routeId) : getTargetMatch(matches, location);\n if (routeId && !match) {\n throw getInternalRouterError(403, {\n pathname: location.pathname,\n routeId\n });\n } else if (!match) {\n throw getInternalRouterError(404, { pathname: location.pathname });\n }\n let result = await queryImpl(\n request,\n location,\n matches,\n requestContext,\n dataStrategy || null,\n false,\n match\n );\n if (isResponse(result)) {\n return result;\n }\n let error = result.errors ? Object.values(result.errors)[0] : void 0;\n if (error !== void 0) {\n throw error;\n }\n if (result.actionData) {\n return Object.values(result.actionData)[0];\n }\n if (result.loaderData) {\n return Object.values(result.loaderData)[0];\n }\n return void 0;\n }\n async function queryImpl(request, location, matches, requestContext, dataStrategy, skipLoaderErrorBubbling, routeMatch) {\n invariant(\n request.signal,\n \"query()/queryRoute() requests must contain an AbortController signal\"\n );\n try {\n if (isMutationMethod(request.method)) {\n let result2 = await submit(\n request,\n matches,\n routeMatch || getTargetMatch(matches, location),\n requestContext,\n dataStrategy,\n skipLoaderErrorBubbling,\n routeMatch != null\n );\n return result2;\n }\n let result = await loadRouteData(\n request,\n matches,\n requestContext,\n dataStrategy,\n skipLoaderErrorBubbling,\n routeMatch\n );\n return isResponse(result) ? result : {\n ...result,\n actionData: null,\n actionHeaders: {}\n };\n } catch (e) {\n if (isDataStrategyResult(e) && isResponse(e.result)) {\n if (e.type === \"error\" /* error */) {\n throw e.result;\n }\n return e.result;\n }\n if (isRedirectResponse(e)) {\n return e;\n }\n throw e;\n }\n }\n async function submit(request, matches, actionMatch, requestContext, dataStrategy, skipLoaderErrorBubbling, isRouteRequest) {\n let result;\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: \"error\" /* error */,\n error\n };\n } else {\n let results = await callDataStrategy(\n \"action\",\n request,\n [actionMatch],\n matches,\n isRouteRequest,\n requestContext,\n dataStrategy\n );\n result = results[actionMatch.route.id];\n if (request.signal.aborted) {\n throwStaticHandlerAbortedError(request, isRouteRequest);\n }\n }\n if (isRedirectResult(result)) {\n throw new Response(null, {\n status: result.response.status,\n headers: {\n Location: result.response.headers.get(\"Location\")\n }\n });\n }\n if (isRouteRequest) {\n if (isErrorResult(result)) {\n throw result.error;\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 };\n }\n let loaderRequest = new Request(request.url, {\n headers: request.headers,\n redirect: request.redirect,\n signal: request.signal\n });\n if (isErrorResult(result)) {\n let boundaryMatch = skipLoaderErrorBubbling ? actionMatch : findNearestBoundary(matches, actionMatch.route.id);\n let context2 = await loadRouteData(\n loaderRequest,\n matches,\n requestContext,\n dataStrategy,\n skipLoaderErrorBubbling,\n null,\n [boundaryMatch.route.id, result]\n );\n return {\n ...context2,\n statusCode: isRouteErrorResponse(result.error) ? result.error.status : result.statusCode != null ? result.statusCode : 500,\n actionData: null,\n actionHeaders: {\n ...result.headers ? { [actionMatch.route.id]: result.headers } : {}\n }\n };\n }\n let context = await loadRouteData(\n loaderRequest,\n matches,\n requestContext,\n dataStrategy,\n skipLoaderErrorBubbling,\n null\n );\n return {\n ...context,\n actionData: {\n [actionMatch.route.id]: result.data\n },\n // action status codes take precedence over loader status codes\n ...result.statusCode ? { statusCode: result.statusCode } : {},\n actionHeaders: result.headers ? { [actionMatch.route.id]: result.headers } : {}\n };\n }\n async function loadRouteData(request, matches, requestContext, dataStrategy, skipLoaderErrorBubbling, routeMatch, pendingActionResult) {\n let isRouteRequest = routeMatch != null;\n if (isRouteRequest && !routeMatch?.route.loader && !routeMatch?.route.lazy) {\n throw getInternalRouterError(400, {\n method: request.method,\n pathname: new URL(request.url).pathname,\n routeId: routeMatch?.route.id\n });\n }\n let requestMatches = routeMatch ? [routeMatch] : pendingActionResult && isErrorResult(pendingActionResult[1]) ? getLoaderMatchesUntilBoundary(matches, pendingActionResult[0]) : matches;\n let matchesToLoad = requestMatches.filter(\n (m) => m.route.loader || m.route.lazy\n );\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: pendingActionResult && isErrorResult(pendingActionResult[1]) ? {\n [pendingActionResult[0]]: pendingActionResult[1].error\n } : null,\n statusCode: 200,\n loaderHeaders: {}\n };\n }\n let results = await callDataStrategy(\n \"loader\",\n request,\n matchesToLoad,\n matches,\n isRouteRequest,\n requestContext,\n dataStrategy\n );\n if (request.signal.aborted) {\n throwStaticHandlerAbortedError(request, isRouteRequest);\n }\n let context = processRouteLoaderData(\n matches,\n results,\n pendingActionResult,\n true,\n skipLoaderErrorBubbling\n );\n let executedLoaders = new Set(\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 return {\n ...context,\n matches\n };\n }\n async function callDataStrategy(type, request, matchesToLoad, matches, isRouteRequest, requestContext, dataStrategy) {\n let results = await callDataStrategyImpl(\n dataStrategy || defaultDataStrategy,\n type,\n null,\n request,\n matchesToLoad,\n matches,\n null,\n manifest,\n mapRouteProperties2,\n requestContext\n );\n let dataResults = {};\n await Promise.all(\n matches.map(async (match) => {\n if (!(match.route.id in results)) {\n return;\n }\n let result = results[match.route.id];\n if (isRedirectDataStrategyResult(result)) {\n let response = result.result;\n throw normalizeRelativeRoutingRedirectResponse(\n response,\n request,\n match.route.id,\n matches,\n basename\n );\n }\n if (isResponse(result.result) && isRouteRequest) {\n throw result;\n }\n dataResults[match.route.id] = await convertDataStrategyResultToDataResult(result);\n })\n );\n return dataResults;\n }\n return {\n dataRoutes,\n query,\n queryRoute\n };\n}\nfunction getStaticContextFromError(routes, context, error) {\n let newContext = {\n ...context,\n statusCode: isRouteErrorResponse(error) ? error.status : 500,\n errors: {\n [context._deepestRenderedBoundaryId || routes[0].id]: error\n }\n };\n return newContext;\n}\nfunction throwStaticHandlerAbortedError(request, isRouteRequest) {\n if (request.signal.reason !== void 0) {\n throw request.signal.reason;\n }\n let method = isRouteRequest ? \"queryRoute\" : \"query\";\n throw new Error(\n `${method}() call aborted without an \\`AbortSignal.reason\\`: ${request.method} ${request.url}`\n );\n}\nfunction isSubmissionNavigation(opts) {\n return opts != null && (\"formData\" in opts && opts.formData != null || \"body\" in opts && opts.body !== void 0);\n}\nfunction normalizeTo(location, matches, basename, to, fromRouteId, relative) {\n let contextualMatches;\n let activeRouteMatch;\n if (fromRouteId) {\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 let path = resolveTo(\n to ? to : \".\",\n getResolveToMatches(contextualMatches),\n stripBasename(location.pathname, basename) || location.pathname,\n relative === \"path\"\n );\n if (to == null) {\n path.search = location.search;\n path.hash = location.hash;\n }\n if ((to == null || to === \"\" || to === \".\") && activeRouteMatch) {\n let nakedIndex = hasNakedIndexQuery(path.search);\n if (activeRouteMatch.route.index && !nakedIndex) {\n path.search = path.search ? path.search.replace(/^\\?/, \"?index&\") : \"?index\";\n } else if (!activeRouteMatch.route.index && nakedIndex) {\n let params = new URLSearchParams(path.search);\n let indexValues = params.getAll(\"index\");\n params.delete(\"index\");\n indexValues.filter((v) => v).forEach((v) => params.append(\"index\", v));\n let qs = params.toString();\n path.search = qs ? `?${qs}` : \"\";\n }\n }\n if (basename !== \"/\") {\n path.pathname = path.pathname === \"/\" ? basename : joinPaths([basename, path.pathname]);\n }\n return createPath(path);\n}\nfunction normalizeNavigateOptions(isFetcher, path, opts) {\n if (!opts || !isSubmissionNavigation(opts)) {\n return { path };\n }\n if (opts.formMethod && !isValidMethod(opts.formMethod)) {\n return {\n path,\n error: getInternalRouterError(405, { method: opts.formMethod })\n };\n }\n let getInvalidBodyError = () => ({\n path,\n error: getInternalRouterError(400, { type: \"invalid-body\" })\n });\n let rawFormMethod = opts.formMethod || \"get\";\n let formMethod = rawFormMethod.toUpperCase();\n let formAction = stripHashFromPath(path);\n if (opts.body !== void 0) {\n if (opts.formEncType === \"text/plain\") {\n if (!isMutationMethod(formMethod)) {\n return getInvalidBodyError();\n }\n let text = typeof opts.body === \"string\" ? opts.body : opts.body instanceof FormData || opts.body instanceof URLSearchParams ? (\n // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#plain-text-form-data\n Array.from(opts.body.entries()).reduce(\n (acc, [name, value]) => `${acc}${name}=${value}\n`,\n \"\"\n )\n ) : String(opts.body);\n return {\n path,\n submission: {\n formMethod,\n formAction,\n formEncType: opts.formEncType,\n formData: void 0,\n json: void 0,\n text\n }\n };\n } else if (opts.formEncType === \"application/json\") {\n if (!isMutationMethod(formMethod)) {\n return getInvalidBodyError();\n }\n try {\n let json = typeof opts.body === \"string\" ? JSON.parse(opts.body) : opts.body;\n return {\n path,\n submission: {\n formMethod,\n formAction,\n formEncType: opts.formEncType,\n formData: void 0,\n json,\n text: void 0\n }\n };\n } catch (e) {\n return getInvalidBodyError();\n }\n }\n }\n invariant(\n typeof FormData === \"function\",\n \"FormData is not available in this environment\"\n );\n let searchParams;\n let formData;\n if (opts.formData) {\n searchParams = convertFormDataToSearchParams(opts.formData);\n formData = opts.formData;\n } else if (opts.body instanceof FormData) {\n searchParams = convertFormDataToSearchParams(opts.body);\n formData = opts.body;\n } else if (opts.body instanceof URLSearchParams) {\n searchParams = opts.body;\n formData = convertSearchParamsToFormData(searchParams);\n } else if (opts.body == null) {\n searchParams = new URLSearchParams();\n formData = new FormData();\n } else {\n try {\n searchParams = new URLSearchParams(opts.body);\n formData = convertSearchParamsToFormData(searchParams);\n } catch (e) {\n return getInvalidBodyError();\n }\n }\n let submission = {\n formMethod,\n formAction,\n formEncType: opts && opts.formEncType || \"application/x-www-form-urlencoded\",\n formData,\n json: void 0,\n text: void 0\n };\n if (isMutationMethod(submission.formMethod)) {\n return { path, submission };\n }\n let parsedPath = parsePath(path);\n if (isFetcher && parsedPath.search && hasNakedIndexQuery(parsedPath.search)) {\n searchParams.append(\"index\", \"\");\n }\n parsedPath.search = `?${searchParams}`;\n return { path: createPath(parsedPath), submission };\n}\nfunction getLoaderMatchesUntilBoundary(matches, boundaryId, includeBoundary = false) {\n let index = matches.findIndex((m) => m.route.id === boundaryId);\n if (index >= 0) {\n return matches.slice(0, includeBoundary ? index + 1 : index);\n }\n return matches;\n}\nfunction getMatchesToLoad(history, state, matches, submission, location, initialHydration, isRevalidationRequired, cancelledFetcherLoads, fetchersQueuedForDeletion, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, pendingActionResult) {\n let actionResult = pendingActionResult ? isErrorResult(pendingActionResult[1]) ? pendingActionResult[1].error : pendingActionResult[1].data : void 0;\n let currentUrl = history.createURL(state.location);\n let nextUrl = history.createURL(location);\n let boundaryMatches = matches;\n if (initialHydration && state.errors) {\n boundaryMatches = getLoaderMatchesUntilBoundary(\n matches,\n Object.keys(state.errors)[0],\n true\n );\n } else if (pendingActionResult && isErrorResult(pendingActionResult[1])) {\n boundaryMatches = getLoaderMatchesUntilBoundary(\n matches,\n pendingActionResult[0]\n );\n }\n let actionStatus = pendingActionResult ? pendingActionResult[1].statusCode : void 0;\n let shouldSkipRevalidation = actionStatus && actionStatus >= 400;\n let navigationMatches = boundaryMatches.filter((match, index) => {\n let { route } = match;\n if (route.lazy) {\n return true;\n }\n if (route.loader == null) {\n return false;\n }\n if (initialHydration) {\n return shouldLoadRouteOnHydration(route, state.loaderData, state.errors);\n }\n if (isNewLoader(state.loaderData, state.matches[index], match)) {\n return true;\n }\n let currentRouteMatch = state.matches[index];\n let nextRouteMatch = match;\n return shouldRevalidateLoader(match, {\n currentUrl,\n currentParams: currentRouteMatch.params,\n nextUrl,\n nextParams: nextRouteMatch.params,\n ...submission,\n actionResult,\n actionStatus,\n defaultShouldRevalidate: shouldSkipRevalidation ? false : (\n // Forced revalidation due to submission, useRevalidator, or X-Remix-Revalidate\n isRevalidationRequired || currentUrl.pathname + currentUrl.search === nextUrl.pathname + nextUrl.search || // Search params affect all loaders\n currentUrl.search !== nextUrl.search || isNewRouteInstance(currentRouteMatch, nextRouteMatch)\n )\n });\n });\n let revalidatingFetchers = [];\n fetchLoadMatches.forEach((f, key) => {\n if (initialHydration || !matches.some((m) => m.route.id === f.routeId) || fetchersQueuedForDeletion.has(key)) {\n return;\n }\n let fetcherMatches = matchRoutes(routesToUse, f.path, basename);\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 let fetcher = state.fetchers.get(key);\n let fetcherMatch = getTargetMatch(fetcherMatches, f.path);\n let shouldRevalidate = false;\n if (fetchRedirectIds.has(key)) {\n shouldRevalidate = false;\n } else if (cancelledFetcherLoads.has(key)) {\n cancelledFetcherLoads.delete(key);\n shouldRevalidate = true;\n } else if (fetcher && fetcher.state !== \"idle\" && fetcher.data === void 0) {\n shouldRevalidate = isRevalidationRequired;\n } else {\n 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 actionStatus,\n defaultShouldRevalidate: shouldSkipRevalidation ? false : isRevalidationRequired\n });\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 return [navigationMatches, revalidatingFetchers];\n}\nfunction shouldLoadRouteOnHydration(route, loaderData, errors) {\n if (route.lazy) {\n return true;\n }\n if (!route.loader) {\n return false;\n }\n let hasData = loaderData != null && loaderData[route.id] !== void 0;\n let hasError = errors != null && errors[route.id] !== void 0;\n if (!hasData && hasError) {\n return false;\n }\n if (typeof route.loader === \"function\" && route.loader.hydrate === true) {\n return true;\n }\n return !hasData && !hasError;\n}\nfunction isNewLoader(currentLoaderData, currentMatch, match) {\n let isNew = (\n // [a] -> [a, b]\n !currentMatch || // [a, b] -> [a, c]\n match.route.id !== currentMatch.route.id\n );\n let isMissingData = !currentLoaderData.hasOwnProperty(match.route.id);\n return isNew || isMissingData;\n}\nfunction isNewRouteInstance(currentMatch, match) {\n let currentPath = currentMatch.route.path;\n return (\n // param change for this match, /users/123 -> /users/456\n currentMatch.pathname !== match.pathname || // splat param changed, which is not present in match.path\n // e.g. /files/images/avatar.jpg -> files/finances.xls\n currentPath != null && currentPath.endsWith(\"*\") && currentMatch.params[\"*\"] !== match.params[\"*\"]\n );\n}\nfunction shouldRevalidateLoader(loaderMatch, arg) {\n if (loaderMatch.route.shouldRevalidate) {\n let routeChoice = loaderMatch.route.shouldRevalidate(arg);\n if (typeof routeChoice === \"boolean\") {\n return routeChoice;\n }\n }\n return arg.defaultShouldRevalidate;\n}\nfunction patchRoutesImpl(routeId, children, routesToUse, manifest, mapRouteProperties2) {\n let childrenToPatch;\n if (routeId) {\n let route = manifest[routeId];\n invariant(\n route,\n `No route found to patch children into: routeId = ${routeId}`\n );\n if (!route.children) {\n route.children = [];\n }\n childrenToPatch = route.children;\n } else {\n childrenToPatch = routesToUse;\n }\n let uniqueChildren = children.filter(\n (newRoute) => !childrenToPatch.some(\n (existingRoute) => isSameRoute(newRoute, existingRoute)\n )\n );\n let newRoutes = convertRoutesToDataRoutes(\n uniqueChildren,\n mapRouteProperties2,\n [routeId || \"_\", \"patch\", String(childrenToPatch?.length || \"0\")],\n manifest\n );\n childrenToPatch.push(...newRoutes);\n}\nfunction isSameRoute(newRoute, existingRoute) {\n if (\"id\" in newRoute && \"id\" in existingRoute && newRoute.id === existingRoute.id) {\n return true;\n }\n if (!(newRoute.index === existingRoute.index && newRoute.path === existingRoute.path && newRoute.caseSensitive === existingRoute.caseSensitive)) {\n return false;\n }\n if ((!newRoute.children || newRoute.children.length === 0) && (!existingRoute.children || existingRoute.children.length === 0)) {\n return true;\n }\n return newRoute.children.every(\n (aChild, i) => existingRoute.children?.some((bChild) => isSameRoute(aChild, bChild))\n );\n}\nasync function loadLazyRouteModule(route, mapRouteProperties2, manifest) {\n if (!route.lazy) {\n return;\n }\n let lazyRoute = await route.lazy();\n if (!route.lazy) {\n return;\n }\n let routeToUpdate = manifest[route.id];\n invariant(routeToUpdate, \"No route found in manifest\");\n let routeUpdates = {};\n for (let lazyRouteProperty in lazyRoute) {\n let staticRouteValue = routeToUpdate[lazyRouteProperty];\n let isPropertyStaticallyDefined = staticRouteValue !== void 0 && // This property isn't static since it should always be updated based\n // on the route updates\n lazyRouteProperty !== \"hasErrorBoundary\";\n warning(\n !isPropertyStaticallyDefined,\n `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.`\n );\n if (!isPropertyStaticallyDefined && !immutableRouteKeys.has(lazyRouteProperty)) {\n routeUpdates[lazyRouteProperty] = lazyRoute[lazyRouteProperty];\n }\n }\n Object.assign(routeToUpdate, routeUpdates);\n Object.assign(routeToUpdate, {\n // To keep things framework agnostic, we use the provided `mapRouteProperties`\n // function to set the framework-aware properties (`element`/`hasErrorBoundary`)\n // since the logic will differ between frameworks.\n ...mapRouteProperties2(routeToUpdate),\n lazy: void 0\n });\n}\nasync function defaultDataStrategy({\n matches\n}) {\n let matchesToLoad = matches.filter((m) => m.shouldLoad);\n let results = await Promise.all(matchesToLoad.map((m) => m.resolve()));\n return results.reduce(\n (acc, result, i) => Object.assign(acc, { [matchesToLoad[i].route.id]: result }),\n {}\n );\n}\nasync function callDataStrategyImpl(dataStrategyImpl, type, state, request, matchesToLoad, matches, fetcherKey, manifest, mapRouteProperties2, requestContext) {\n let loadRouteDefinitionsPromises = matches.map(\n (m) => m.route.lazy ? loadLazyRouteModule(m.route, mapRouteProperties2, manifest) : void 0\n );\n let dsMatches = matches.map((match, i) => {\n let loadRoutePromise = loadRouteDefinitionsPromises[i];\n let shouldLoad = matchesToLoad.some((m) => m.route.id === match.route.id);\n let resolve = async (handlerOverride) => {\n if (handlerOverride && request.method === \"GET\" && (match.route.lazy || match.route.loader)) {\n shouldLoad = true;\n }\n return shouldLoad ? callLoaderOrAction(\n type,\n request,\n match,\n loadRoutePromise,\n handlerOverride,\n requestContext\n ) : Promise.resolve({ type: \"data\" /* data */, result: void 0 });\n };\n return {\n ...match,\n shouldLoad,\n resolve\n };\n });\n let results = await dataStrategyImpl({\n matches: dsMatches,\n request,\n params: matches[0].params,\n fetcherKey,\n context: requestContext\n });\n try {\n await Promise.all(loadRouteDefinitionsPromises);\n } catch (e) {\n }\n return results;\n}\nasync function callLoaderOrAction(type, request, match, loadRoutePromise, handlerOverride, staticContext) {\n let result;\n let onReject;\n let runHandler = (handler) => {\n let reject;\n let abortPromise = new Promise((_, r) => reject = r);\n onReject = () => reject();\n request.signal.addEventListener(\"abort\", onReject);\n let actualHandler = (ctx) => {\n if (typeof handler !== \"function\") {\n return Promise.reject(\n new Error(\n `You cannot call the handler for a route which defines a boolean \"${type}\" [routeId: ${match.route.id}]`\n )\n );\n }\n return handler(\n {\n request,\n params: match.params,\n context: staticContext\n },\n ...ctx !== void 0 ? [ctx] : []\n );\n };\n let handlerPromise = (async () => {\n try {\n let val = await (handlerOverride ? handlerOverride((ctx) => actualHandler(ctx)) : actualHandler());\n return { type: \"data\", result: val };\n } catch (e) {\n return { type: \"error\", result: e };\n }\n })();\n return Promise.race([handlerPromise, abortPromise]);\n };\n try {\n let handler = match.route[type];\n if (loadRoutePromise) {\n if (handler) {\n let handlerError;\n let [value] = await Promise.all([\n // If the handler throws, don't let it immediately bubble out,\n // since we need to let the lazy() execution finish so we know if this\n // route has a boundary that can handle the error\n runHandler(handler).catch((e) => {\n handlerError = e;\n }),\n loadRoutePromise\n ]);\n if (handlerError !== void 0) {\n throw handlerError;\n }\n result = value;\n } else {\n await loadRoutePromise;\n handler = match.route[type];\n if (handler) {\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 return { type: \"data\" /* data */, result: void 0 };\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 } catch (e) {\n return { type: \"error\" /* error */, result: e };\n } finally {\n if (onReject) {\n request.signal.removeEventListener(\"abort\", onReject);\n }\n }\n return result;\n}\nasync function convertDataStrategyResultToDataResult(dataStrategyResult) {\n let { result, type } = dataStrategyResult;\n if (isResponse(result)) {\n let data2;\n try {\n let contentType = result.headers.get(\"Content-Type\");\n if (contentType && /\\bapplication\\/json\\b/.test(contentType)) {\n if (result.body == null) {\n data2 = null;\n } else {\n data2 = await result.json();\n }\n } else {\n data2 = await result.text();\n }\n } catch (e) {\n return { type: \"error\" /* error */, error: e };\n }\n if (type === \"error\" /* error */) {\n return {\n type: \"error\" /* error */,\n error: new ErrorResponseImpl(result.status, result.statusText, data2),\n statusCode: result.status,\n headers: result.headers\n };\n }\n return {\n type: \"data\" /* data */,\n data: data2,\n statusCode: result.status,\n headers: result.headers\n };\n }\n if (type === \"error\" /* error */) {\n if (isDataWithResponseInit(result)) {\n if (result.data instanceof Error) {\n return {\n type: \"error\" /* error */,\n error: result.data,\n statusCode: result.init?.status\n };\n }\n result = new ErrorResponseImpl(\n result.init?.status || 500,\n void 0,\n result.data\n );\n }\n return {\n type: \"error\" /* error */,\n error: result,\n statusCode: isRouteErrorResponse(result) ? result.status : void 0\n };\n }\n if (isDataWithResponseInit(result)) {\n return {\n type: \"data\" /* data */,\n data: result.data,\n statusCode: result.init?.status,\n headers: result.init?.headers ? new Headers(result.init.headers) : void 0\n };\n }\n return { type: \"data\" /* data */, data: result };\n}\nfunction normalizeRelativeRoutingRedirectResponse(response, request, routeId, matches, basename) {\n let location = response.headers.get(\"Location\");\n invariant(\n location,\n \"Redirects returned/thrown from loaders/actions must have a Location header\"\n );\n if (!ABSOLUTE_URL_REGEX.test(location)) {\n let trimmedMatches = matches.slice(\n 0,\n matches.findIndex((m) => m.route.id === routeId) + 1\n );\n location = normalizeTo(\n new URL(request.url),\n trimmedMatches,\n basename,\n location\n );\n response.headers.set(\"Location\", location);\n }\n return response;\n}\nfunction normalizeRedirectLocation(location, currentUrl, basename) {\n if (ABSOLUTE_URL_REGEX.test(location)) {\n let normalizedLocation = location;\n let url = normalizedLocation.startsWith(\"//\") ? new URL(currentUrl.protocol + normalizedLocation) : new URL(normalizedLocation);\n let isSameBasename = stripBasename(url.pathname, basename) != null;\n if (url.origin === currentUrl.origin && isSameBasename) {\n return url.pathname + url.search + url.hash;\n }\n }\n return location;\n}\nfunction createClientSideRequest(history, location, signal, submission) {\n let url = history.createURL(stripHashFromPath(location)).toString();\n let init = { signal };\n if (submission && isMutationMethod(submission.formMethod)) {\n let { formMethod, formEncType } = submission;\n init.method = formMethod.toUpperCase();\n if (formEncType === \"application/json\") {\n init.headers = new Headers({ \"Content-Type\": formEncType });\n init.body = JSON.stringify(submission.json);\n } else if (formEncType === \"text/plain\") {\n init.body = submission.text;\n } else if (formEncType === \"application/x-www-form-urlencoded\" && submission.formData) {\n init.body = convertFormDataToSearchParams(submission.formData);\n } else {\n init.body = submission.formData;\n }\n }\n return new Request(url, init);\n}\nfunction convertFormDataToSearchParams(formData) {\n let searchParams = new URLSearchParams();\n for (let [key, value] of formData.entries()) {\n searchParams.append(key, typeof value === \"string\" ? value : value.name);\n }\n return searchParams;\n}\nfunction convertSearchParamsToFormData(searchParams) {\n let formData = new FormData();\n for (let [key, value] of searchParams.entries()) {\n formData.append(key, value);\n }\n return formData;\n}\nfunction processRouteLoaderData(matches, results, pendingActionResult, isStaticHandler = false, skipLoaderErrorBubbling = false) {\n let loaderData = {};\n let errors = null;\n let statusCode;\n let foundError = false;\n let loaderHeaders = {};\n let pendingError = pendingActionResult && isErrorResult(pendingActionResult[1]) ? pendingActionResult[1].error : void 0;\n matches.forEach((match) => {\n if (!(match.route.id in results)) {\n return;\n }\n let id = match.route.id;\n let result = results[id];\n invariant(\n !isRedirectResult(result),\n \"Cannot handle redirect results in processLoaderData\"\n );\n if (isErrorResult(result)) {\n let error = result.error;\n if (pendingError !== void 0) {\n error = pendingError;\n pendingError = void 0;\n }\n errors = errors || {};\n if (skipLoaderErrorBubbling) {\n errors[id] = error;\n } else {\n let boundaryMatch = findNearestBoundary(matches, id);\n if (errors[boundaryMatch.route.id] == null) {\n errors[boundaryMatch.route.id] = error;\n }\n }\n if (!isStaticHandler) {\n loaderData[id] = ResetLoaderDataSymbol;\n }\n if (!foundError) {\n foundError = true;\n statusCode = isRouteErrorResponse(result.error) ? result.error.status : 500;\n }\n if (result.headers) {\n loaderHeaders[id] = result.headers;\n }\n } else {\n loaderData[id] = result.data;\n if (result.statusCode && result.statusCode !== 200 && !foundError) {\n statusCode = result.statusCode;\n }\n if (result.headers) {\n loaderHeaders[id] = result.headers;\n }\n }\n });\n if (pendingError !== void 0 && pendingActionResult) {\n errors = { [pendingActionResult[0]]: pendingError };\n loaderData[pendingActionResult[0]] = void 0;\n }\n return {\n loaderData,\n errors,\n statusCode: statusCode || 200,\n loaderHeaders\n };\n}\nfunction processLoaderData(state, matches, results, pendingActionResult, revalidatingFetchers, fetcherResults) {\n let { loaderData, errors } = processRouteLoaderData(\n matches,\n results,\n pendingActionResult\n );\n revalidatingFetchers.forEach((rf) => {\n let { key, match, controller } = rf;\n let result = fetcherResults[key];\n invariant(result, \"Did not find corresponding fetcher result\");\n if (controller && controller.signal.aborted) {\n return;\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 invariant(false, \"Unhandled fetcher revalidation redirect\");\n } else {\n let doneFetcher = getDoneFetcher(result.data);\n state.fetchers.set(key, doneFetcher);\n }\n });\n return { loaderData, errors };\n}\nfunction mergeLoaderData(loaderData, newLoaderData, matches, errors) {\n let mergedLoaderData = Object.entries(newLoaderData).filter(([, v]) => v !== ResetLoaderDataSymbol).reduce((merged, [k, v]) => {\n merged[k] = v;\n return merged;\n }, {});\n for (let match of matches) {\n let id = match.route.id;\n if (!newLoaderData.hasOwnProperty(id) && loaderData.hasOwnProperty(id) && match.route.loader) {\n mergedLoaderData[id] = loaderData[id];\n }\n if (errors && errors.hasOwnProperty(id)) {\n break;\n }\n }\n return mergedLoaderData;\n}\nfunction getActionDataForCommit(pendingActionResult) {\n if (!pendingActionResult) {\n return {};\n }\n return isErrorResult(pendingActionResult[1]) ? {\n // Clear out prior actionData on errors\n actionData: {}\n } : {\n actionData: {\n [pendingActionResult[0]]: pendingActionResult[1].data\n }\n };\n}\nfunction findNearestBoundary(matches, routeId) {\n let eligibleMatches = routeId ? matches.slice(0, matches.findIndex((m) => m.route.id === routeId) + 1) : [...matches];\n return eligibleMatches.reverse().find((m) => m.route.hasErrorBoundary === true) || matches[0];\n}\nfunction getShortCircuitMatches(routes) {\n let route = routes.length === 1 ? routes[0] : routes.find((r) => r.index || !r.path || r.path === \"/\") || {\n id: `__shim-error-route__`\n };\n return {\n matches: [\n {\n params: {},\n pathname: \"\",\n pathnameBase: \"\",\n route\n }\n ],\n route\n };\n}\nfunction getInternalRouterError(status, {\n pathname,\n routeId,\n method,\n type,\n message\n} = {}) {\n let statusText = \"Unknown Server Error\";\n let errorMessage = \"Unknown @remix-run/router error\";\n if (status === 400) {\n statusText = \"Bad Request\";\n if (method && pathname && routeId) {\n 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.`;\n } else if (type === \"invalid-body\") {\n errorMessage = \"Unable to encode submission body\";\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 = `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.`;\n } else if (method) {\n errorMessage = `Invalid request method \"${method.toUpperCase()}\"`;\n }\n }\n return new ErrorResponseImpl(\n status || 500,\n statusText,\n new Error(errorMessage),\n true\n );\n}\nfunction findRedirect(results) {\n let entries = Object.entries(results);\n for (let i = entries.length - 1; i >= 0; i--) {\n let [key, result] = entries[i];\n if (isRedirectResult(result)) {\n return { key, result };\n }\n }\n}\nfunction stripHashFromPath(path) {\n let parsedPath = typeof path === \"string\" ? parsePath(path) : path;\n return createPath({ ...parsedPath, hash: \"\" });\n}\nfunction isHashChangeOnly(a, b) {\n if (a.pathname !== b.pathname || a.search !== b.search) {\n return false;\n }\n if (a.hash === \"\") {\n return b.hash !== \"\";\n } else if (a.hash === b.hash) {\n return true;\n } else if (b.hash !== \"\") {\n return true;\n }\n return false;\n}\nfunction isDataStrategyResult(result) {\n return result != null && typeof result === \"object\" && \"type\" in result && \"result\" in result && (result.type === \"data\" /* data */ || result.type === \"error\" /* error */);\n}\nfunction isRedirectDataStrategyResult(result) {\n return isResponse(result.result) && redirectStatusCodes.has(result.result.status);\n}\nfunction isErrorResult(result) {\n return result.type === \"error\" /* error */;\n}\nfunction isRedirectResult(result) {\n return (result && result.type) === \"redirect\" /* redirect */;\n}\nfunction isDataWithResponseInit(value) {\n return typeof value === \"object\" && value != null && \"type\" in value && \"data\" in value && \"init\" in value && value.type === \"DataWithResponseInit\";\n}\nfunction isResponse(value) {\n return value != null && typeof value.status === \"number\" && typeof value.statusText === \"string\" && typeof value.headers === \"object\" && typeof value.body !== \"undefined\";\n}\nfunction isRedirectStatusCode(statusCode) {\n return redirectStatusCodes.has(statusCode);\n}\nfunction isRedirectResponse(result) {\n return isResponse(result) && isRedirectStatusCode(result.status) && result.headers.has(\"Location\");\n}\nfunction isValidMethod(method) {\n return validRequestMethods.has(method.toUpperCase());\n}\nfunction isMutationMethod(method) {\n return validMutationMethods.has(method.toUpperCase());\n}\nfunction hasNakedIndexQuery(search) {\n return new URLSearchParams(search).getAll(\"index\").some((v) => v === \"\");\n}\nfunction getTargetMatch(matches, location) {\n let search = typeof location === \"string\" ? parsePath(location).search : location.search;\n if (matches[matches.length - 1].route.index && hasNakedIndexQuery(search || \"\")) {\n return matches[matches.length - 1];\n }\n let pathMatches = getPathContributingMatches(matches);\n return pathMatches[pathMatches.length - 1];\n}\nfunction getSubmissionFromNavigation(navigation) {\n let { formMethod, formAction, formEncType, text, formData, json } = navigation;\n if (!formMethod || !formAction || !formEncType) {\n return;\n }\n if (text != null) {\n return {\n formMethod,\n formAction,\n formEncType,\n formData: void 0,\n json: void 0,\n text\n };\n } else if (formData != null) {\n return {\n formMethod,\n formAction,\n formEncType,\n formData,\n json: void 0,\n text: void 0\n };\n } else if (json !== void 0) {\n return {\n formMethod,\n formAction,\n formEncType,\n formData: void 0,\n json,\n text: void 0\n };\n }\n}\nfunction getLoadingNavigation(location, submission) {\n if (submission) {\n let navigation = {\n state: \"loading\",\n location,\n formMethod: submission.formMethod,\n formAction: submission.formAction,\n formEncType: submission.formEncType,\n formData: submission.formData,\n json: submission.json,\n text: submission.text\n };\n return navigation;\n } else {\n let navigation = {\n state: \"loading\",\n location,\n formMethod: void 0,\n formAction: void 0,\n formEncType: void 0,\n formData: void 0,\n json: void 0,\n text: void 0\n };\n return navigation;\n }\n}\nfunction getSubmittingNavigation(location, submission) {\n let navigation = {\n state: \"submitting\",\n location,\n formMethod: submission.formMethod,\n formAction: submission.formAction,\n formEncType: submission.formEncType,\n formData: submission.formData,\n json: submission.json,\n text: submission.text\n };\n return navigation;\n}\nfunction getLoadingFetcher(submission, data2) {\n if (submission) {\n let fetcher = {\n state: \"loading\",\n formMethod: submission.formMethod,\n formAction: submission.formAction,\n formEncType: submission.formEncType,\n formData: submission.formData,\n json: submission.json,\n text: submission.text,\n data: data2\n };\n return fetcher;\n } else {\n let fetcher = {\n state: \"loading\",\n formMethod: void 0,\n formAction: void 0,\n formEncType: void 0,\n formData: void 0,\n json: void 0,\n text: void 0,\n data: data2\n };\n return fetcher;\n }\n}\nfunction getSubmittingFetcher(submission, existingFetcher) {\n let fetcher = {\n state: \"submitting\",\n formMethod: submission.formMethod,\n formAction: submission.formAction,\n formEncType: submission.formEncType,\n formData: submission.formData,\n json: submission.json,\n text: submission.text,\n data: existingFetcher ? existingFetcher.data : void 0\n };\n return fetcher;\n}\nfunction getDoneFetcher(data2) {\n let fetcher = {\n state: \"idle\",\n formMethod: void 0,\n formAction: void 0,\n formEncType: void 0,\n formData: void 0,\n json: void 0,\n text: void 0,\n data: data2\n };\n return fetcher;\n}\nfunction restoreAppliedTransitions(_window, transitions) {\n try {\n let sessionPositions = _window.sessionStorage.getItem(\n TRANSITIONS_STORAGE_KEY\n );\n if (sessionPositions) {\n let json = JSON.parse(sessionPositions);\n for (let [k, v] of Object.entries(json || {})) {\n if (v && Array.isArray(v)) {\n transitions.set(k, new Set(v || []));\n }\n }\n }\n } catch (e) {\n }\n}\nfunction persistAppliedTransitions(_window, transitions) {\n if (transitions.size > 0) {\n let json = {};\n for (let [k, v] of transitions) {\n json[k] = [...v];\n }\n try {\n _window.sessionStorage.setItem(\n TRANSITIONS_STORAGE_KEY,\n JSON.stringify(json)\n );\n } catch (error) {\n warning(\n false,\n `Failed to save applied view transitions in sessionStorage (${error}).`\n );\n }\n }\n}\nfunction createDeferred() {\n let resolve;\n let reject;\n let promise = new Promise((res, rej) => {\n resolve = async (val) => {\n res(val);\n try {\n await promise;\n } catch (e) {\n }\n };\n reject = async (error) => {\n rej(error);\n try {\n await promise;\n } catch (e) {\n }\n };\n });\n return {\n promise,\n //@ts-ignore\n resolve,\n //@ts-ignore\n reject\n };\n}\n\n// lib/components.tsx\n\n\n// lib/context.ts\n\nvar DataRouterContext = react__WEBPACK_IMPORTED_MODULE_0__.createContext(null);\nDataRouterContext.displayName = \"DataRouter\";\nvar DataRouterStateContext = react__WEBPACK_IMPORTED_MODULE_0__.createContext(null);\nDataRouterStateContext.displayName = \"DataRouterState\";\nvar ViewTransitionContext = react__WEBPACK_IMPORTED_MODULE_0__.createContext({\n isTransitioning: false\n});\nViewTransitionContext.displayName = \"ViewTransition\";\nvar FetchersContext = react__WEBPACK_IMPORTED_MODULE_0__.createContext(\n /* @__PURE__ */ new Map()\n);\nFetchersContext.displayName = \"Fetchers\";\nvar AwaitContext = react__WEBPACK_IMPORTED_MODULE_0__.createContext(null);\nAwaitContext.displayName = \"Await\";\nvar NavigationContext = react__WEBPACK_IMPORTED_MODULE_0__.createContext(\n null\n);\nNavigationContext.displayName = \"Navigation\";\nvar LocationContext = react__WEBPACK_IMPORTED_MODULE_0__.createContext(\n null\n);\nLocationContext.displayName = \"Location\";\nvar RouteContext = react__WEBPACK_IMPORTED_MODULE_0__.createContext({\n outlet: null,\n matches: [],\n isDataRoute: false\n});\nRouteContext.displayName = \"Route\";\nvar RouteErrorContext = react__WEBPACK_IMPORTED_MODULE_0__.createContext(null);\nRouteErrorContext.displayName = \"RouteError\";\n\n// lib/hooks.tsx\n\nvar ENABLE_DEV_WARNINGS = true;\nfunction useHref(to, { relative } = {}) {\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 let { basename, navigator: navigator2 } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(NavigationContext);\n let { hash, pathname, search } = useResolvedPath(to, { relative });\n let joinedPathname = pathname;\n if (basename !== \"/\") {\n joinedPathname = pathname === \"/\" ? basename : joinPaths([basename, pathname]);\n }\n return navigator2.createHref({ pathname: joinedPathname, search, hash });\n}\nfunction useInRouterContext() {\n return react__WEBPACK_IMPORTED_MODULE_0__.useContext(LocationContext) != null;\n}\nfunction useLocation() {\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 return react__WEBPACK_IMPORTED_MODULE_0__.useContext(LocationContext).location;\n}\nfunction useNavigationType() {\n return react__WEBPACK_IMPORTED_MODULE_0__.useContext(LocationContext).navigationType;\n}\nfunction useMatch(pattern) {\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 let { pathname } = useLocation();\n return react__WEBPACK_IMPORTED_MODULE_0__.useMemo(\n () => matchPath(pattern, decodePath(pathname)),\n [pathname, pattern]\n );\n}\nvar navigateEffectWarning = `You should call navigate() in a React.useEffect(), not when your component is first rendered.`;\nfunction useIsomorphicLayoutEffect(cb) {\n let isStatic = react__WEBPACK_IMPORTED_MODULE_0__.useContext(NavigationContext).static;\n if (!isStatic) {\n react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect(cb);\n }\n}\nfunction useNavigate() {\n let { isDataRoute } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteContext);\n return isDataRoute ? useNavigateStable() : useNavigateUnstable();\n}\nfunction useNavigateUnstable() {\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 let dataRouterContext = react__WEBPACK_IMPORTED_MODULE_0__.useContext(DataRouterContext);\n let { basename, navigator: navigator2 } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(NavigationContext);\n let { matches } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteContext);\n let { pathname: locationPathname } = useLocation();\n let routePathnamesJson = JSON.stringify(getResolveToMatches(matches));\n let activeRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(false);\n useIsomorphicLayoutEffect(() => {\n activeRef.current = true;\n });\n let navigate = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(\n (to, options = {}) => {\n warning(activeRef.current, navigateEffectWarning);\n if (!activeRef.current) return;\n if (typeof to === \"number\") {\n navigator2.go(to);\n return;\n }\n let path = resolveTo(\n to,\n JSON.parse(routePathnamesJson),\n locationPathname,\n options.relative === \"path\"\n );\n if (dataRouterContext == null && basename !== \"/\") {\n path.pathname = path.pathname === \"/\" ? basename : joinPaths([basename, path.pathname]);\n }\n (!!options.replace ? navigator2.replace : navigator2.push)(\n path,\n options.state,\n options\n );\n },\n [\n basename,\n navigator2,\n routePathnamesJson,\n locationPathname,\n dataRouterContext\n ]\n );\n return navigate;\n}\nvar OutletContext = react__WEBPACK_IMPORTED_MODULE_0__.createContext(null);\nfunction useOutletContext() {\n return react__WEBPACK_IMPORTED_MODULE_0__.useContext(OutletContext);\n}\nfunction useOutlet(context) {\n let outlet = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteContext).outlet;\n if (outlet) {\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(OutletContext.Provider, { value: context }, outlet);\n }\n return outlet;\n}\nfunction useParams() {\n let { matches } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteContext);\n let routeMatch = matches[matches.length - 1];\n return routeMatch ? routeMatch.params : {};\n}\nfunction useResolvedPath(to, { relative } = {}) {\n let { matches } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteContext);\n let { pathname: locationPathname } = useLocation();\n let routePathnamesJson = JSON.stringify(getResolveToMatches(matches));\n return react__WEBPACK_IMPORTED_MODULE_0__.useMemo(\n () => resolveTo(\n to,\n JSON.parse(routePathnamesJson),\n locationPathname,\n relative === \"path\"\n ),\n [to, routePathnamesJson, locationPathname, relative]\n );\n}\nfunction useRoutes(routes, locationArg) {\n return useRoutesImpl(routes, locationArg);\n}\nfunction useRoutesImpl(routes, locationArg, dataRouterState, future) {\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 let { navigator: navigator2 } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(NavigationContext);\n let { matches: parentMatches } = react__WEBPACK_IMPORTED_MODULE_0__.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 if (ENABLE_DEV_WARNINGS) {\n let parentPath = parentRoute && parentRoute.path || \"\";\n warningOnce(\n parentPathname,\n !parentRoute || parentPath.endsWith(\"*\") || parentPath.endsWith(\"*?\"),\n `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.\n\nPlease change the parent <Route path=\"${parentPath}\"> to <Route path=\"${parentPath === \"/\" ? \"*\" : `${parentPath}/*`}\">.`\n );\n }\n let locationFromContext = useLocation();\n let location;\n if (locationArg) {\n let parsedLocationArg = typeof locationArg === \"string\" ? parsePath(locationArg) : locationArg;\n invariant(\n parentPathnameBase === \"/\" || parsedLocationArg.pathname?.startsWith(parentPathnameBase),\n `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.`\n );\n location = parsedLocationArg;\n } else {\n location = locationFromContext;\n }\n let pathname = location.pathname || \"/\";\n let remainingPathname = pathname;\n if (parentPathnameBase !== \"/\") {\n let parentSegments = parentPathnameBase.replace(/^\\//, \"\").split(\"/\");\n let segments = pathname.replace(/^\\//, \"\").split(\"/\");\n remainingPathname = \"/\" + segments.slice(parentSegments.length).join(\"/\");\n }\n let matches = matchRoutes(routes, { pathname: remainingPathname });\n if (ENABLE_DEV_WARNINGS) {\n warning(\n parentRoute || matches != null,\n `No routes matched location \"${location.pathname}${location.search}${location.hash}\" `\n );\n warning(\n matches == null || matches[matches.length - 1].route.element !== void 0 || matches[matches.length - 1].route.Component !== void 0 || matches[matches.length - 1].route.lazy !== void 0,\n `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.`\n );\n }\n let renderedMatches = _renderMatches(\n matches && matches.map(\n (match) => 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 navigator2.encodeLocation ? navigator2.encodeLocation(match.pathname).pathname : match.pathname\n ]),\n pathnameBase: match.pathnameBase === \"/\" ? parentPathnameBase : joinPaths([\n parentPathnameBase,\n // Re-encode pathnames that were decoded inside matchRoutes\n navigator2.encodeLocation ? navigator2.encodeLocation(match.pathnameBase).pathname : match.pathnameBase\n ])\n })\n ),\n parentMatches,\n dataRouterState,\n future\n );\n if (locationArg && renderedMatches) {\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n LocationContext.Provider,\n {\n value: {\n location: {\n pathname: \"/\",\n search: \"\",\n hash: \"\",\n state: null,\n key: \"default\",\n ...location\n },\n navigationType: \"POP\" /* Pop */\n }\n },\n renderedMatches\n );\n }\n return renderedMatches;\n}\nfunction DefaultErrorComponent() {\n let error = useRouteError();\n let message = isRouteErrorResponse(error) ? `${error.status} ${error.statusText}` : error instanceof Error ? error.message : 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 let devInfo = null;\n if (ENABLE_DEV_WARNINGS) {\n console.error(\n \"Error handled by React Router default ErrorBoundary:\",\n error\n );\n devInfo = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"p\", null, \"\\u{1F4BF} Hey developer \\u{1F44B}\"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"p\", null, \"You can provide a way better UX than this when your app throws errors by providing your own \", /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"code\", { style: codeStyles }, \"ErrorBoundary\"), \" or\", \" \", /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"code\", { style: codeStyles }, \"errorElement\"), \" prop on your route.\"));\n }\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"h2\", null, \"Unexpected Application Error!\"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"h3\", { style: { fontStyle: \"italic\" } }, message), stack ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"pre\", { style: preStyles }, stack) : null, devInfo);\n}\nvar defaultErrorElement = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(DefaultErrorComponent, null);\nvar RenderErrorBoundary = class extends react__WEBPACK_IMPORTED_MODULE_0__.Component {\n constructor(props) {\n super(props);\n this.state = {\n location: props.location,\n revalidation: props.revalidation,\n error: props.error\n };\n }\n static getDerivedStateFromError(error) {\n return { error };\n }\n static getDerivedStateFromProps(props, state) {\n if (state.location !== props.location || state.revalidation !== \"idle\" && props.revalidation === \"idle\") {\n return {\n error: props.error,\n location: props.location,\n revalidation: props.revalidation\n };\n }\n return {\n error: props.error !== void 0 ? props.error : state.error,\n location: state.location,\n revalidation: props.revalidation || state.revalidation\n };\n }\n componentDidCatch(error, errorInfo) {\n console.error(\n \"React Router caught the following error during render\",\n error,\n errorInfo\n );\n }\n render() {\n return this.state.error !== void 0 ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RouteContext.Provider, { value: this.props.routeContext }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n RouteErrorContext.Provider,\n {\n value: this.state.error,\n children: this.props.component\n }\n )) : this.props.children;\n }\n};\nfunction RenderedRoute({ routeContext, match, children }) {\n let dataRouterContext = react__WEBPACK_IMPORTED_MODULE_0__.useContext(DataRouterContext);\n if (dataRouterContext && dataRouterContext.static && dataRouterContext.staticContext && (match.route.errorElement || match.route.ErrorBoundary)) {\n dataRouterContext.staticContext._deepestRenderedBoundaryId = match.route.id;\n }\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RouteContext.Provider, { value: routeContext }, children);\n}\nfunction _renderMatches(matches, parentMatches = [], dataRouterState = null, future = null) {\n if (matches == null) {\n if (!dataRouterState) {\n return null;\n }\n if (dataRouterState.errors) {\n matches = dataRouterState.matches;\n } else if (parentMatches.length === 0 && !dataRouterState.initialized && dataRouterState.matches.length > 0) {\n matches = dataRouterState.matches;\n } else {\n return null;\n }\n }\n let renderedMatches = matches;\n let errors = dataRouterState?.errors;\n if (errors != null) {\n let errorIndex = renderedMatches.findIndex(\n (m) => m.route.id && errors?.[m.route.id] !== void 0\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 let renderFallback = false;\n let fallbackIndex = -1;\n if (dataRouterState) {\n for (let i = 0; i < renderedMatches.length; i++) {\n let match = renderedMatches[i];\n if (match.route.HydrateFallback || match.route.hydrateFallbackElement) {\n fallbackIndex = i;\n }\n if (match.route.id) {\n let { loaderData, errors: errors2 } = dataRouterState;\n let needsToRunLoader = match.route.loader && !loaderData.hasOwnProperty(match.route.id) && (!errors2 || errors2[match.route.id] === void 0);\n if (match.route.lazy || needsToRunLoader) {\n renderFallback = true;\n if (fallbackIndex >= 0) {\n renderedMatches = renderedMatches.slice(0, fallbackIndex + 1);\n } else {\n renderedMatches = [renderedMatches[0]];\n }\n break;\n }\n }\n }\n }\n return renderedMatches.reduceRight((outlet, match, index) => {\n let error;\n let shouldRenderHydrateFallback = false;\n let errorElement = null;\n let hydrateFallbackElement = null;\n if (dataRouterState) {\n error = errors && match.route.id ? errors[match.route.id] : void 0;\n errorElement = match.route.errorElement || defaultErrorElement;\n if (renderFallback) {\n if (fallbackIndex < 0 && index === 0) {\n warningOnce(\n \"route-fallback\",\n false,\n \"No `HydrateFallback` element provided to render during initial hydration\"\n );\n shouldRenderHydrateFallback = true;\n hydrateFallbackElement = null;\n } else if (fallbackIndex === index) {\n shouldRenderHydrateFallback = true;\n hydrateFallbackElement = match.route.hydrateFallbackElement || null;\n }\n }\n }\n let matches2 = parentMatches.concat(renderedMatches.slice(0, index + 1));\n let getChildren = () => {\n let children;\n if (error) {\n children = errorElement;\n } else if (shouldRenderHydrateFallback) {\n children = hydrateFallbackElement;\n } else if (match.route.Component) {\n children = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(match.route.Component, null);\n } else if (match.route.element) {\n children = match.route.element;\n } else {\n children = outlet;\n }\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n RenderedRoute,\n {\n match,\n routeContext: {\n outlet,\n matches: matches2,\n isDataRoute: dataRouterState != null\n },\n children\n }\n );\n };\n return dataRouterState && (match.route.ErrorBoundary || match.route.errorElement || index === 0) ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n RenderErrorBoundary,\n {\n location: dataRouterState.location,\n revalidation: dataRouterState.revalidation,\n component: errorElement,\n error,\n children: getChildren(),\n routeContext: { outlet: null, matches: matches2, isDataRoute: true }\n }\n ) : getChildren();\n }, null);\n}\nfunction getDataRouterConsoleError(hookName) {\n return `${hookName} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;\n}\nfunction useDataRouterContext(hookName) {\n let ctx = react__WEBPACK_IMPORTED_MODULE_0__.useContext(DataRouterContext);\n invariant(ctx, getDataRouterConsoleError(hookName));\n return ctx;\n}\nfunction useDataRouterState(hookName) {\n let state = react__WEBPACK_IMPORTED_MODULE_0__.useContext(DataRouterStateContext);\n invariant(state, getDataRouterConsoleError(hookName));\n return state;\n}\nfunction useRouteContext(hookName) {\n let route = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteContext);\n invariant(route, getDataRouterConsoleError(hookName));\n return route;\n}\nfunction useCurrentRouteId(hookName) {\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}\nfunction useRouteId() {\n return useCurrentRouteId(\"useRouteId\" /* UseRouteId */);\n}\nfunction useNavigation() {\n let state = useDataRouterState(\"useNavigation\" /* UseNavigation */);\n return state.navigation;\n}\nfunction useRevalidator() {\n let dataRouterContext = useDataRouterContext(\"useRevalidator\" /* UseRevalidator */);\n let state = useDataRouterState(\"useRevalidator\" /* UseRevalidator */);\n return react__WEBPACK_IMPORTED_MODULE_0__.useMemo(\n () => ({\n async revalidate() {\n await dataRouterContext.router.revalidate();\n },\n state: state.revalidation\n }),\n [dataRouterContext.router, state.revalidation]\n );\n}\nfunction useMatches() {\n let { matches, loaderData } = useDataRouterState(\n \"useMatches\" /* UseMatches */\n );\n return react__WEBPACK_IMPORTED_MODULE_0__.useMemo(\n () => matches.map((m) => convertRouteMatchToUiMatch(m, loaderData)),\n [matches, loaderData]\n );\n}\nfunction useLoaderData() {\n let state = useDataRouterState(\"useLoaderData\" /* UseLoaderData */);\n let routeId = useCurrentRouteId(\"useLoaderData\" /* UseLoaderData */);\n return state.loaderData[routeId];\n}\nfunction useRouteLoaderData(routeId) {\n let state = useDataRouterState(\"useRouteLoaderData\" /* UseRouteLoaderData */);\n return state.loaderData[routeId];\n}\nfunction useActionData() {\n let state = useDataRouterState(\"useActionData\" /* UseActionData */);\n let routeId = useCurrentRouteId(\"useLoaderData\" /* UseLoaderData */);\n return state.actionData ? state.actionData[routeId] : void 0;\n}\nfunction useRouteError() {\n let error = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteErrorContext);\n let state = useDataRouterState(\"useRouteError\" /* UseRouteError */);\n let routeId = useCurrentRouteId(\"useRouteError\" /* UseRouteError */);\n if (error !== void 0) {\n return error;\n }\n return state.errors?.[routeId];\n}\nfunction useAsyncValue() {\n let value = react__WEBPACK_IMPORTED_MODULE_0__.useContext(AwaitContext);\n return value?._data;\n}\nfunction useAsyncError() {\n let value = react__WEBPACK_IMPORTED_MODULE_0__.useContext(AwaitContext);\n return value?._error;\n}\nvar blockerId = 0;\nfunction useBlocker(shouldBlock) {\n let { router, basename } = useDataRouterContext(\"useBlocker\" /* UseBlocker */);\n let state = useDataRouterState(\"useBlocker\" /* UseBlocker */);\n let [blockerKey, setBlockerKey] = react__WEBPACK_IMPORTED_MODULE_0__.useState(\"\");\n let blockerFunction = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(\n (arg) => {\n if (typeof shouldBlock !== \"function\") {\n return !!shouldBlock;\n }\n if (basename === \"/\") {\n return shouldBlock(arg);\n }\n let { currentLocation, nextLocation, historyAction } = arg;\n return shouldBlock({\n currentLocation: {\n ...currentLocation,\n pathname: stripBasename(currentLocation.pathname, basename) || currentLocation.pathname\n },\n nextLocation: {\n ...nextLocation,\n pathname: stripBasename(nextLocation.pathname, basename) || nextLocation.pathname\n },\n historyAction\n });\n },\n [basename, shouldBlock]\n );\n react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {\n let key = String(++blockerId);\n setBlockerKey(key);\n return () => router.deleteBlocker(key);\n }, [router]);\n react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {\n if (blockerKey !== \"\") {\n router.getBlocker(blockerKey, blockerFunction);\n }\n }, [router, blockerKey, blockerFunction]);\n return blockerKey && state.blockers.has(blockerKey) ? state.blockers.get(blockerKey) : IDLE_BLOCKER;\n}\nfunction useNavigateStable() {\n let { router } = useDataRouterContext(\"useNavigate\" /* UseNavigateStable */);\n let id = useCurrentRouteId(\"useNavigate\" /* UseNavigateStable */);\n let activeRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(false);\n useIsomorphicLayoutEffect(() => {\n activeRef.current = true;\n });\n let navigate = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(\n async (to, options = {}) => {\n warning(activeRef.current, navigateEffectWarning);\n if (!activeRef.current) return;\n if (typeof to === \"number\") {\n router.navigate(to);\n } else {\n await router.navigate(to, { fromRouteId: id, ...options });\n }\n },\n [router, id]\n );\n return navigate;\n}\nvar alreadyWarned = {};\nfunction warningOnce(key, cond, message) {\n if (!cond && !alreadyWarned[key]) {\n alreadyWarned[key] = true;\n warning(false, message);\n }\n}\n\n// lib/server-runtime/warnings.ts\nvar alreadyWarned2 = {};\nfunction warnOnce(condition, message) {\n if (!condition && !alreadyWarned2[message]) {\n alreadyWarned2[message] = true;\n console.warn(message);\n }\n}\n\n// lib/components.tsx\nvar ENABLE_DEV_WARNINGS2 = true;\nfunction mapRouteProperties(route) {\n let updates = {\n // Note: this check also occurs in createRoutesFromChildren so update\n // there if you change this -- please and thank you!\n hasErrorBoundary: route.hasErrorBoundary || route.ErrorBoundary != null || route.errorElement != null\n };\n if (route.Component) {\n if (ENABLE_DEV_WARNINGS2) {\n if (route.element) {\n warning(\n false,\n \"You should not include both `Component` and `element` on your route - `Component` will be used.\"\n );\n }\n }\n Object.assign(updates, {\n element: react__WEBPACK_IMPORTED_MODULE_0__.createElement(route.Component),\n Component: void 0\n });\n }\n if (route.HydrateFallback) {\n if (ENABLE_DEV_WARNINGS2) {\n if (route.hydrateFallbackElement) {\n warning(\n false,\n \"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used.\"\n );\n }\n }\n Object.assign(updates, {\n hydrateFallbackElement: react__WEBPACK_IMPORTED_MODULE_0__.createElement(route.HydrateFallback),\n HydrateFallback: void 0\n });\n }\n if (route.ErrorBoundary) {\n if (ENABLE_DEV_WARNINGS2) {\n if (route.errorElement) {\n warning(\n false,\n \"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used.\"\n );\n }\n }\n Object.assign(updates, {\n errorElement: react__WEBPACK_IMPORTED_MODULE_0__.createElement(route.ErrorBoundary),\n ErrorBoundary: void 0\n });\n }\n return updates;\n}\nfunction createMemoryRouter(routes, opts) {\n return createRouter({\n basename: opts?.basename,\n future: opts?.future,\n history: createMemoryHistory({\n initialEntries: opts?.initialEntries,\n initialIndex: opts?.initialIndex\n }),\n hydrationData: opts?.hydrationData,\n routes,\n mapRouteProperties,\n dataStrategy: opts?.dataStrategy,\n patchRoutesOnNavigation: opts?.patchRoutesOnNavigation\n }).initialize();\n}\nvar Deferred = class {\n constructor() {\n this.status = \"pending\";\n this.promise = new Promise((resolve, reject) => {\n this.resolve = (value) => {\n if (this.status === \"pending\") {\n this.status = \"resolved\";\n resolve(value);\n }\n };\n this.reject = (reason) => {\n if (this.status === \"pending\") {\n this.status = \"rejected\";\n reject(reason);\n }\n };\n });\n }\n};\nfunction RouterProvider({\n router,\n flushSync: reactDomFlushSyncImpl\n}) {\n let [state, setStateImpl] = react__WEBPACK_IMPORTED_MODULE_0__.useState(router.state);\n let [pendingState, setPendingState] = react__WEBPACK_IMPORTED_MODULE_0__.useState();\n let [vtContext, setVtContext] = react__WEBPACK_IMPORTED_MODULE_0__.useState({\n isTransitioning: false\n });\n let [renderDfd, setRenderDfd] = react__WEBPACK_IMPORTED_MODULE_0__.useState();\n let [transition, setTransition] = react__WEBPACK_IMPORTED_MODULE_0__.useState();\n let [interruption, setInterruption] = react__WEBPACK_IMPORTED_MODULE_0__.useState();\n let fetcherData = react__WEBPACK_IMPORTED_MODULE_0__.useRef(/* @__PURE__ */ new Map());\n let setState = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(\n (newState, { deletedFetchers, flushSync, viewTransitionOpts }) => {\n newState.fetchers.forEach((fetcher, key) => {\n if (fetcher.data !== void 0) {\n fetcherData.current.set(key, fetcher.data);\n }\n });\n deletedFetchers.forEach((key) => fetcherData.current.delete(key));\n warnOnce(\n flushSync === false || reactDomFlushSyncImpl != null,\n 'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from \"react-router/dom\"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.'\n );\n let isViewTransitionAvailable = router.window != null && router.window.document != null && typeof router.window.document.startViewTransition === \"function\";\n warnOnce(\n viewTransitionOpts == null || isViewTransitionAvailable,\n \"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available.\"\n );\n if (!viewTransitionOpts || !isViewTransitionAvailable) {\n if (reactDomFlushSyncImpl && flushSync) {\n reactDomFlushSyncImpl(() => setStateImpl(newState));\n } else {\n react__WEBPACK_IMPORTED_MODULE_0__.startTransition(() => setStateImpl(newState));\n }\n return;\n }\n if (reactDomFlushSyncImpl && flushSync) {\n reactDomFlushSyncImpl(() => {\n if (transition) {\n renderDfd && renderDfd.resolve();\n transition.skipTransition();\n }\n setVtContext({\n isTransitioning: true,\n flushSync: true,\n currentLocation: viewTransitionOpts.currentLocation,\n nextLocation: viewTransitionOpts.nextLocation\n });\n });\n let t = router.window.document.startViewTransition(() => {\n reactDomFlushSyncImpl(() => setStateImpl(newState));\n });\n t.finished.finally(() => {\n reactDomFlushSyncImpl(() => {\n setRenderDfd(void 0);\n setTransition(void 0);\n setPendingState(void 0);\n setVtContext({ isTransitioning: false });\n });\n });\n reactDomFlushSyncImpl(() => setTransition(t));\n return;\n }\n if (transition) {\n renderDfd && renderDfd.resolve();\n transition.skipTransition();\n setInterruption({\n state: newState,\n currentLocation: viewTransitionOpts.currentLocation,\n nextLocation: viewTransitionOpts.nextLocation\n });\n } else {\n setPendingState(newState);\n setVtContext({\n isTransitioning: true,\n flushSync: false,\n currentLocation: viewTransitionOpts.currentLocation,\n nextLocation: viewTransitionOpts.nextLocation\n });\n }\n },\n [router.window, reactDomFlushSyncImpl, transition, renderDfd]\n );\n react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect(() => router.subscribe(setState), [router, setState]);\n react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {\n if (vtContext.isTransitioning && !vtContext.flushSync) {\n setRenderDfd(new Deferred());\n }\n }, [vtContext]);\n react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {\n if (renderDfd && pendingState && router.window) {\n let newState = pendingState;\n let renderPromise = renderDfd.promise;\n let transition2 = router.window.document.startViewTransition(async () => {\n react__WEBPACK_IMPORTED_MODULE_0__.startTransition(() => setStateImpl(newState));\n await renderPromise;\n });\n transition2.finished.finally(() => {\n setRenderDfd(void 0);\n setTransition(void 0);\n setPendingState(void 0);\n setVtContext({ isTransitioning: false });\n });\n setTransition(transition2);\n }\n }, [pendingState, renderDfd, router.window]);\n react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {\n if (renderDfd && pendingState && state.location.key === pendingState.location.key) {\n renderDfd.resolve();\n }\n }, [renderDfd, transition, state.location, pendingState]);\n react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {\n if (!vtContext.isTransitioning && interruption) {\n setPendingState(interruption.state);\n setVtContext({\n isTransitioning: true,\n flushSync: false,\n currentLocation: interruption.currentLocation,\n nextLocation: interruption.nextLocation\n });\n setInterruption(void 0);\n }\n }, [vtContext.isTransitioning, interruption]);\n let navigator2 = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => {\n return {\n createHref: router.createHref,\n encodeLocation: router.encodeLocation,\n go: (n) => router.navigate(n),\n push: (to, state2, opts) => router.navigate(to, {\n state: state2,\n preventScrollReset: opts?.preventScrollReset\n }),\n replace: (to, state2, opts) => router.navigate(to, {\n replace: true,\n state: state2,\n preventScrollReset: opts?.preventScrollReset\n })\n };\n }, [router]);\n let basename = router.basename || \"/\";\n let dataRouterContext = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(\n () => ({\n router,\n navigator: navigator2,\n static: false,\n basename\n }),\n [router, navigator2, basename]\n );\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(DataRouterContext.Provider, { value: dataRouterContext }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(DataRouterStateContext.Provider, { value: state }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(FetchersContext.Provider, { value: fetcherData.current }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(ViewTransitionContext.Provider, { value: vtContext }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n Router,\n {\n basename,\n location: state.location,\n navigationType: state.historyAction,\n navigator: navigator2\n },\n /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n MemoizedDataRoutes,\n {\n routes: router.routes,\n future: router.future,\n state\n }\n )\n ))))), null);\n}\nvar MemoizedDataRoutes = react__WEBPACK_IMPORTED_MODULE_0__.memo(DataRoutes);\nfunction DataRoutes({\n routes,\n future,\n state\n}) {\n return useRoutesImpl(routes, void 0, state, future);\n}\nfunction MemoryRouter({\n basename,\n children,\n initialEntries,\n initialIndex\n}) {\n let historyRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef();\n if (historyRef.current == null) {\n historyRef.current = createMemoryHistory({\n initialEntries,\n initialIndex,\n v5Compat: true\n });\n }\n let history = historyRef.current;\n let [state, setStateImpl] = react__WEBPACK_IMPORTED_MODULE_0__.useState({\n action: history.action,\n location: history.location\n });\n let setState = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(\n (newState) => {\n react__WEBPACK_IMPORTED_MODULE_0__.startTransition(() => setStateImpl(newState));\n },\n [setStateImpl]\n );\n react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect(() => history.listen(setState), [history, setState]);\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n Router,\n {\n basename,\n children,\n location: state.location,\n navigationType: state.action,\n navigator: history\n }\n );\n}\nfunction Navigate({\n to,\n replace: replace2,\n state,\n relative\n}) {\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 let { static: isStatic } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(NavigationContext);\n warning(\n !isStatic,\n `<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`\n );\n let { matches } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteContext);\n let { pathname: locationPathname } = useLocation();\n let navigate = useNavigate();\n let path = resolveTo(\n to,\n getResolveToMatches(matches),\n locationPathname,\n relative === \"path\"\n );\n let jsonPath = JSON.stringify(path);\n react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {\n navigate(JSON.parse(jsonPath), { replace: replace2, state, relative });\n }, [navigate, jsonPath, relative, replace2, state]);\n return null;\n}\nfunction Outlet(props) {\n return useOutlet(props.context);\n}\nfunction Route(_props) {\n invariant(\n false,\n `A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`\n );\n}\nfunction Router({\n basename: basenameProp = \"/\",\n children = null,\n location: locationProp,\n navigationType = \"POP\" /* Pop */,\n navigator: navigator2,\n static: staticProp = false\n}) {\n invariant(\n !useInRouterContext(),\n `You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`\n );\n let basename = basenameProp.replace(/^\\/*/, \"/\");\n let navigationContext = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(\n () => ({\n basename,\n navigator: navigator2,\n static: staticProp,\n future: {}\n }),\n [basename, navigator2, staticProp]\n );\n if (typeof locationProp === \"string\") {\n locationProp = parsePath(locationProp);\n }\n let {\n pathname = \"/\",\n search = \"\",\n hash = \"\",\n state = null,\n key = \"default\"\n } = locationProp;\n let locationContext = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => {\n let trailingPathname = stripBasename(pathname, basename);\n if (trailingPathname == null) {\n return null;\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 warning(\n locationContext != null,\n `<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.`\n );\n if (locationContext == null) {\n return null;\n }\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(NavigationContext.Provider, { value: navigationContext }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(LocationContext.Provider, { children, value: locationContext }));\n}\nfunction Routes({\n children,\n location\n}) {\n return useRoutes(createRoutesFromChildren(children), location);\n}\nfunction Await({\n children,\n errorElement,\n resolve\n}) {\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(AwaitErrorBoundary, { resolve, errorElement }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(ResolveAwait, null, children));\n}\nvar AwaitErrorBoundary = class extends react__WEBPACK_IMPORTED_MODULE_0__.Component {\n constructor(props) {\n super(props);\n this.state = { error: null };\n }\n static getDerivedStateFromError(error) {\n return { error };\n }\n componentDidCatch(error, errorInfo) {\n console.error(\n \"<Await> caught the following error during render\",\n error,\n errorInfo\n );\n }\n render() {\n let { children, errorElement, resolve } = this.props;\n let promise = null;\n let status = 0 /* pending */;\n if (!(resolve instanceof Promise)) {\n status = 1 /* 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 status = 2 /* error */;\n let renderError = this.state.error;\n promise = Promise.reject().catch(() => {\n });\n Object.defineProperty(promise, \"_tracked\", { get: () => true });\n Object.defineProperty(promise, \"_error\", { get: () => renderError });\n } else if (resolve._tracked) {\n promise = resolve;\n status = \"_error\" in promise ? 2 /* error */ : \"_data\" in promise ? 1 /* success */ : 0 /* pending */;\n } else {\n status = 0 /* pending */;\n Object.defineProperty(resolve, \"_tracked\", { get: () => true });\n promise = resolve.then(\n (data2) => Object.defineProperty(resolve, \"_data\", { get: () => data2 }),\n (error) => Object.defineProperty(resolve, \"_error\", { get: () => error })\n );\n }\n if (status === 2 /* error */ && !errorElement) {\n throw promise._error;\n }\n if (status === 2 /* error */) {\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(AwaitContext.Provider, { value: promise, children: errorElement });\n }\n if (status === 1 /* success */) {\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(AwaitContext.Provider, { value: promise, children });\n }\n throw promise;\n }\n};\nfunction ResolveAwait({\n children\n}) {\n let data2 = useAsyncValue();\n let toRender = typeof children === \"function\" ? children(data2) : children;\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, toRender);\n}\nfunction createRoutesFromChildren(children, parentPath = []) {\n let routes = [];\n react__WEBPACK_IMPORTED_MODULE_0__.Children.forEach(children, (element, index) => {\n if (!react__WEBPACK_IMPORTED_MODULE_0__.isValidElement(element)) {\n return;\n }\n let treePath = [...parentPath, index];\n if (element.type === react__WEBPACK_IMPORTED_MODULE_0__.Fragment) {\n routes.push.apply(\n routes,\n createRoutesFromChildren(element.props.children, treePath)\n );\n return;\n }\n invariant(\n element.type === Route,\n `[${typeof element.type === \"string\" ? element.type : element.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`\n );\n invariant(\n !element.props.index || !element.props.children,\n \"An index route cannot have child routes.\"\n );\n let route = {\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 hydrateFallbackElement: element.props.hydrateFallbackElement,\n HydrateFallback: element.props.HydrateFallback,\n errorElement: element.props.errorElement,\n ErrorBoundary: element.props.ErrorBoundary,\n hasErrorBoundary: element.props.hasErrorBoundary === true || element.props.ErrorBoundary != null || element.props.errorElement != null,\n shouldRevalidate: element.props.shouldRevalidate,\n handle: element.props.handle,\n lazy: element.props.lazy\n };\n if (element.props.children) {\n route.children = createRoutesFromChildren(\n element.props.children,\n treePath\n );\n }\n routes.push(route);\n });\n return routes;\n}\nvar createRoutesFromElements = createRoutesFromChildren;\nfunction renderMatches(matches) {\n return _renderMatches(matches);\n}\n\n// lib/dom/lib.tsx\n\n\n// lib/dom/dom.ts\nvar defaultMethod = \"get\";\nvar defaultEncType = \"application/x-www-form-urlencoded\";\nfunction isHtmlElement(object) {\n return object != null && typeof object.tagName === \"string\";\n}\nfunction isButtonElement(object) {\n return isHtmlElement(object) && object.tagName.toLowerCase() === \"button\";\n}\nfunction isFormElement(object) {\n return isHtmlElement(object) && object.tagName.toLowerCase() === \"form\";\n}\nfunction isInputElement(object) {\n return isHtmlElement(object) && object.tagName.toLowerCase() === \"input\";\n}\nfunction isModifiedEvent(event) {\n return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);\n}\nfunction shouldProcessLinkClick(event, target) {\n return event.button === 0 && // Ignore everything but left clicks\n (!target || target === \"_self\") && // Let browser handle \"target=_blank\" etc.\n !isModifiedEvent(event);\n}\nfunction createSearchParams(init = \"\") {\n return new URLSearchParams(\n typeof init === \"string\" || Array.isArray(init) || init instanceof URLSearchParams ? init : Object.keys(init).reduce((memo2, key) => {\n let value = init[key];\n return memo2.concat(\n Array.isArray(value) ? value.map((v) => [key, v]) : [[key, value]]\n );\n }, [])\n );\n}\nfunction getSearchParamsForLocation(locationSearch, defaultSearchParams) {\n let searchParams = createSearchParams(locationSearch);\n if (defaultSearchParams) {\n defaultSearchParams.forEach((_, key) => {\n if (!searchParams.has(key)) {\n defaultSearchParams.getAll(key).forEach((value) => {\n searchParams.append(key, value);\n });\n }\n });\n }\n return searchParams;\n}\nvar _formDataSupportsSubmitter = null;\nfunction isFormDataSubmitterSupported() {\n if (_formDataSupportsSubmitter === null) {\n try {\n new FormData(\n document.createElement(\"form\"),\n // @ts-expect-error if FormData supports the submitter parameter, this will throw\n 0\n );\n _formDataSupportsSubmitter = false;\n } catch (e) {\n _formDataSupportsSubmitter = true;\n }\n }\n return _formDataSupportsSubmitter;\n}\nvar supportedFormEncTypes = /* @__PURE__ */ new Set([\n \"application/x-www-form-urlencoded\",\n \"multipart/form-data\",\n \"text/plain\"\n]);\nfunction getFormEncType(encType) {\n if (encType != null && !supportedFormEncTypes.has(encType)) {\n warning(\n false,\n `\"${encType}\" is not a valid \\`encType\\` for \\`<Form>\\`/\\`<fetcher.Form>\\` and will default to \"${defaultEncType}\"`\n );\n return null;\n }\n return encType;\n}\nfunction getFormSubmissionInfo(target, basename) {\n let method;\n let action;\n let encType;\n let formData;\n let body;\n if (isFormElement(target)) {\n let attr = target.getAttribute(\"action\");\n action = attr ? stripBasename(attr, basename) : null;\n method = target.getAttribute(\"method\") || defaultMethod;\n encType = getFormEncType(target.getAttribute(\"enctype\")) || defaultEncType;\n formData = new FormData(target);\n } else if (isButtonElement(target) || isInputElement(target) && (target.type === \"submit\" || target.type === \"image\")) {\n let form = target.form;\n if (form == null) {\n throw new Error(\n `Cannot submit a <button> or <input type=\"submit\"> without a <form>`\n );\n }\n let attr = target.getAttribute(\"formaction\") || form.getAttribute(\"action\");\n action = attr ? stripBasename(attr, basename) : null;\n method = target.getAttribute(\"formmethod\") || form.getAttribute(\"method\") || defaultMethod;\n encType = getFormEncType(target.getAttribute(\"formenctype\")) || getFormEncType(form.getAttribute(\"enctype\")) || defaultEncType;\n formData = new FormData(form, target);\n if (!isFormDataSubmitterSupported()) {\n let { name, type, value } = target;\n if (type === \"image\") {\n let prefix = name ? `${name}.` : \"\";\n formData.append(`${prefix}x`, \"0\");\n formData.append(`${prefix}y`, \"0\");\n } else if (name) {\n formData.append(name, value);\n }\n }\n } else if (isHtmlElement(target)) {\n throw new Error(\n `Cannot submit element that is not <form>, <button>, or <input type=\"submit|image\">`\n );\n } else {\n method = defaultMethod;\n action = null;\n encType = defaultEncType;\n body = target;\n }\n if (formData && encType === \"text/plain\") {\n body = formData;\n formData = void 0;\n }\n return { action, method: method.toLowerCase(), encType, formData, body };\n}\n\n// lib/dom/ssr/components.tsx\n\n\n// lib/dom/ssr/invariant.ts\nfunction invariant2(value, message) {\n if (value === false || value === null || typeof value === \"undefined\") {\n throw new Error(message);\n }\n}\n\n// lib/dom/ssr/routeModules.ts\nasync function loadRouteModule(route, routeModulesCache) {\n if (route.id in routeModulesCache) {\n return routeModulesCache[route.id];\n }\n try {\n let routeModule = await import(\n /* @vite-ignore */\n /* webpackIgnore: true */\n route.module\n );\n routeModulesCache[route.id] = routeModule;\n return routeModule;\n } catch (error) {\n console.error(\n `Error loading route module \\`${route.module}\\`, reloading page...`\n );\n console.error(error);\n if (window.__reactRouterContext && window.__reactRouterContext.isSpaMode && // @ts-expect-error\n /* unsupported import.meta.hot */ undefined) {}\n window.location.reload();\n return new Promise(() => {\n });\n }\n}\n\n// lib/dom/ssr/links.ts\nfunction getKeyedLinksForMatches(matches, routeModules, manifest) {\n let descriptors = matches.map((match) => {\n let module = routeModules[match.route.id];\n let route = manifest.routes[match.route.id];\n return [\n route && route.css ? route.css.map((href) => ({ rel: \"stylesheet\", href })) : [],\n module?.links?.() || []\n ];\n }).flat(2);\n let preloads = getCurrentPageModulePreloadHrefs(matches, manifest);\n return dedupeLinkDescriptors(descriptors, preloads);\n}\nasync function prefetchStyleLinks(route, routeModule) {\n if (!route.css && !routeModule.links || !isPreloadSupported()) return;\n let descriptors = [];\n if (route.css) {\n descriptors.push(...route.css.map((href) => ({ rel: \"stylesheet\", href })));\n }\n if (routeModule.links) {\n descriptors.push(...routeModule.links());\n }\n if (descriptors.length === 0) 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 let matchingLinks = styleLinks.filter(\n (link) => (!link.media || window.matchMedia(link.media).matches) && !document.querySelector(`link[rel=\"stylesheet\"][href=\"${link.href}\"]`)\n );\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 (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}\nfunction isPageLinkDescriptor(object) {\n return object != null && typeof object.page === \"string\";\n}\nfunction isHtmlLinkDescriptor(object) {\n if (object == null) {\n return false;\n }\n if (object.href == null) {\n return object.rel === \"preload\" && typeof object.imageSrcSet === \"string\" && typeof object.imageSizes === \"string\";\n }\n return typeof object.rel === \"string\" && typeof object.href === \"string\";\n}\nasync function getKeyedPrefetchLinks(matches, manifest, routeModules) {\n let links = await Promise.all(\n matches.map(async (match) => {\n let route = manifest.routes[match.route.id];\n if (route) {\n let mod = await loadRouteModule(route, routeModules);\n return mod.links ? mod.links() : [];\n }\n return [];\n })\n );\n return dedupeLinkDescriptors(\n links.flat(1).filter(isHtmlLinkDescriptor).filter((link) => link.rel === \"stylesheet\" || link.rel === \"preload\").map(\n (link) => link.rel === \"stylesheet\" ? { ...link, rel: \"prefetch\", as: \"style\" } : { ...link, rel: \"prefetch\" }\n )\n );\n}\nfunction getNewMatchesForLinks(page, nextMatches, currentMatches, manifest, location, mode) {\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 return (\n // param change, /users/123 -> /users/456\n currentMatches[index].pathname !== match.pathname || // splat param changed, which is not present in match.path\n // e.g. /files/images/avatar.jpg -> files/finances.xls\n currentMatches[index].route.path?.endsWith(\"*\") && currentMatches[index].params[\"*\"] !== match.params[\"*\"]\n );\n };\n if (mode === \"assets\") {\n return nextMatches.filter(\n (match, index) => isNew(match, index) || matchPathChanged(match, index)\n );\n }\n if (mode === \"data\") {\n return nextMatches.filter((match, index) => {\n let manifestRoute = manifest.routes[match.route.id];\n if (!manifestRoute || !manifestRoute.hasLoader) {\n return false;\n }\n if (isNew(match, index) || matchPathChanged(match, index)) {\n return true;\n }\n if (match.route.shouldRevalidate) {\n let routeChoice = match.route.shouldRevalidate({\n currentUrl: new URL(\n location.pathname + location.search + location.hash,\n window.origin\n ),\n currentParams: currentMatches[0]?.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 });\n }\n return [];\n}\nfunction getModuleLinkHrefs(matches, manifestPatch) {\n return dedupeHrefs(\n matches.map((match) => {\n let route = manifestPatch.routes[match.route.id];\n if (!route) return [];\n let hrefs = [route.module];\n if (route.imports) {\n hrefs = hrefs.concat(route.imports);\n }\n return hrefs;\n }).flat(1)\n );\n}\nfunction getCurrentPageModulePreloadHrefs(matches, manifest) {\n return dedupeHrefs(\n matches.map((match) => {\n let route = manifest.routes[match.route.id];\n if (!route) return [];\n let hrefs = [route.module];\n if (route.imports) {\n hrefs = hrefs.concat(route.imports);\n }\n return hrefs;\n }).flat(1)\n );\n}\nfunction dedupeHrefs(hrefs) {\n return [...new Set(hrefs)];\n}\nfunction sortKeys(obj) {\n let sorted = {};\n let keys = Object.keys(obj).sort();\n for (let key of keys) {\n sorted[key] = obj[key];\n }\n return sorted;\n}\nfunction dedupeLinkDescriptors(descriptors, preloads) {\n let set = /* @__PURE__ */ new Set();\n let preloadsSet = new Set(preloads);\n return descriptors.reduce((deduped, descriptor) => {\n let alreadyModulePreload = preloads && !isPageLinkDescriptor(descriptor) && descriptor.as === \"script\" && descriptor.href && preloadsSet.has(descriptor.href);\n if (alreadyModulePreload) {\n return deduped;\n }\n let key = JSON.stringify(sortKeys(descriptor));\n if (!set.has(key)) {\n set.add(key);\n deduped.push({ key, link: descriptor });\n }\n return deduped;\n }, []);\n}\nvar _isPreloadSupported;\nfunction isPreloadSupported() {\n if (_isPreloadSupported !== void 0) {\n return _isPreloadSupported;\n }\n let el = document.createElement(\"link\");\n _isPreloadSupported = el.relList.supports(\"preload\");\n el = null;\n return _isPreloadSupported;\n}\n\n// lib/dom/ssr/markup.ts\nvar ESCAPE_LOOKUP = {\n \"&\": \"\\\\u0026\",\n \">\": \"\\\\u003e\",\n \"<\": \"\\\\u003c\",\n \"\\u2028\": \"\\\\u2028\",\n \"\\u2029\": \"\\\\u2029\"\n};\nvar ESCAPE_REGEX = /[&><\\u2028\\u2029]/g;\nfunction escapeHtml(html) {\n return html.replace(ESCAPE_REGEX, (match) => ESCAPE_LOOKUP[match]);\n}\nfunction createHtml(html) {\n return { __html: html };\n}\n\n// lib/dom/ssr/single-fetch.tsx\n\n\n\n// lib/dom/ssr/data.ts\nasync function createRequestInit(request) {\n let init = { signal: request.signal };\n if (request.method !== \"GET\") {\n init.method = request.method;\n let contentType = request.headers.get(\"Content-Type\");\n if (contentType && /\\bapplication\\/json\\b/.test(contentType)) {\n init.headers = { \"Content-Type\": contentType };\n init.body = JSON.stringify(await request.json());\n } else if (contentType && /\\btext\\/plain\\b/.test(contentType)) {\n init.headers = { \"Content-Type\": contentType };\n init.body = await request.text();\n } else if (contentType && /\\bapplication\\/x-www-form-urlencoded\\b/.test(contentType)) {\n init.body = new URLSearchParams(await request.text());\n } else {\n init.body = await request.formData();\n }\n }\n return init;\n}\n\n// lib/dom/ssr/single-fetch.tsx\nvar SingleFetchRedirectSymbol = Symbol(\"SingleFetchRedirect\");\nfunction StreamTransfer({\n context,\n identifier,\n reader,\n textDecoder,\n nonce\n}) {\n if (!context.renderMeta || !context.renderMeta.didRenderScripts) {\n return null;\n }\n if (!context.renderMeta.streamCache) {\n context.renderMeta.streamCache = {};\n }\n let { streamCache } = context.renderMeta;\n let promise = streamCache[identifier];\n if (!promise) {\n promise = streamCache[identifier] = reader.read().then((result) => {\n streamCache[identifier].result = {\n done: result.done,\n value: textDecoder.decode(result.value, { stream: true })\n };\n }).catch((e) => {\n streamCache[identifier].error = e;\n });\n }\n if (promise.error) {\n throw promise.error;\n }\n if (promise.result === void 0) {\n throw promise;\n }\n let { done, value } = promise.result;\n let scriptTag = value ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n \"script\",\n {\n nonce,\n dangerouslySetInnerHTML: {\n __html: `window.__reactRouterContext.streamController.enqueue(${escapeHtml(\n JSON.stringify(value)\n )});`\n }\n }\n ) : null;\n if (done) {\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, scriptTag, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n \"script\",\n {\n nonce,\n dangerouslySetInnerHTML: {\n __html: `window.__reactRouterContext.streamController.close();`\n }\n }\n ));\n } else {\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, scriptTag, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Suspense, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n StreamTransfer,\n {\n context,\n identifier: identifier + 1,\n reader,\n textDecoder,\n nonce\n }\n )));\n }\n}\nfunction getSingleFetchDataStrategy(manifest, routeModules, getRouter) {\n return async ({ request, matches, fetcherKey }) => {\n if (request.method !== \"GET\") {\n return singleFetchActionStrategy(request, matches);\n }\n if (fetcherKey) {\n return singleFetchLoaderFetcherStrategy(request, matches);\n }\n return singleFetchLoaderNavigationStrategy(\n manifest,\n routeModules,\n getRouter(),\n request,\n matches\n );\n };\n}\nasync function singleFetchActionStrategy(request, matches) {\n let actionMatch = matches.find((m) => m.shouldLoad);\n invariant2(actionMatch, \"No action match found\");\n let actionStatus = void 0;\n let result = await actionMatch.resolve(async (handler) => {\n let result2 = await handler(async () => {\n let url = singleFetchUrl(request.url);\n let init = await createRequestInit(request);\n let { data: data2, status } = await fetchAndDecode(url, init);\n actionStatus = status;\n return unwrapSingleFetchResult(\n data2,\n actionMatch.route.id\n );\n });\n return result2;\n });\n if (isResponse(result.result) || isRouteErrorResponse(result.result)) {\n return { [actionMatch.route.id]: result };\n }\n return {\n [actionMatch.route.id]: {\n type: result.type,\n result: data(result.result, actionStatus)\n }\n };\n}\nasync function singleFetchLoaderNavigationStrategy(manifest, routeModules, router, request, matches) {\n let routesParams = /* @__PURE__ */ new Set();\n let foundOptOutRoute = false;\n let routeDfds = matches.map(() => createDeferred2());\n let routesLoadedPromise = Promise.all(routeDfds.map((d) => d.promise));\n let singleFetchDfd = createDeferred2();\n let url = stripIndexParam(singleFetchUrl(request.url));\n let init = await createRequestInit(request);\n let results = {};\n let resolvePromise = Promise.all(\n matches.map(\n async (m, i) => m.resolve(async (handler) => {\n routeDfds[i].resolve();\n let manifestRoute = manifest.routes[m.route.id];\n if (!m.shouldLoad) {\n if (!router.state.initialized) {\n return;\n }\n if (m.route.id in router.state.loaderData && manifestRoute && manifestRoute.hasLoader && routeModules[m.route.id]?.shouldRevalidate) {\n foundOptOutRoute = true;\n return;\n }\n }\n if (manifestRoute && manifestRoute.hasClientLoader) {\n if (manifestRoute.hasLoader) {\n foundOptOutRoute = true;\n }\n try {\n let result = await fetchSingleLoader(\n handler,\n url,\n init,\n m.route.id\n );\n results[m.route.id] = { type: \"data\", result };\n } catch (e) {\n results[m.route.id] = { type: \"error\", result: e };\n }\n return;\n }\n if (manifestRoute && manifestRoute.hasLoader) {\n routesParams.add(m.route.id);\n }\n try {\n let result = await handler(async () => {\n let data2 = await singleFetchDfd.promise;\n return unwrapSingleFetchResults(data2, m.route.id);\n });\n results[m.route.id] = {\n type: \"data\",\n result\n };\n } catch (e) {\n results[m.route.id] = {\n type: \"error\",\n result: e\n };\n }\n })\n )\n );\n await routesLoadedPromise;\n if ((!router.state.initialized || routesParams.size === 0) && !window.__reactRouterHdrActive) {\n singleFetchDfd.resolve({});\n } else {\n try {\n if (foundOptOutRoute && routesParams.size > 0) {\n url.searchParams.set(\n \"_routes\",\n matches.filter((m) => routesParams.has(m.route.id)).map((m) => m.route.id).join(\",\")\n );\n }\n let data2 = await fetchAndDecode(url, init);\n singleFetchDfd.resolve(data2.data);\n } catch (e) {\n singleFetchDfd.reject(e);\n }\n }\n await resolvePromise;\n return results;\n}\nasync function singleFetchLoaderFetcherStrategy(request, matches) {\n let fetcherMatch = matches.find((m) => m.shouldLoad);\n invariant2(fetcherMatch, \"No fetcher match found\");\n let result = await fetcherMatch.resolve(async (handler) => {\n let url = stripIndexParam(singleFetchUrl(request.url));\n let init = await createRequestInit(request);\n return fetchSingleLoader(handler, url, init, fetcherMatch.route.id);\n });\n return { [fetcherMatch.route.id]: result };\n}\nfunction fetchSingleLoader(handler, url, init, routeId) {\n return handler(async () => {\n let singleLoaderUrl = new URL(url);\n singleLoaderUrl.searchParams.set(\"_routes\", routeId);\n let { data: data2 } = await fetchAndDecode(singleLoaderUrl, init);\n return unwrapSingleFetchResults(data2, routeId);\n });\n}\nfunction stripIndexParam(url) {\n let indexValues = url.searchParams.getAll(\"index\");\n url.searchParams.delete(\"index\");\n let indexValuesToKeep = [];\n for (let indexValue of indexValues) {\n if (indexValue) {\n indexValuesToKeep.push(indexValue);\n }\n }\n for (let toKeep of indexValuesToKeep) {\n url.searchParams.append(\"index\", toKeep);\n }\n return url;\n}\nfunction singleFetchUrl(reqUrl) {\n let url = typeof reqUrl === \"string\" ? new URL(\n reqUrl,\n // This can be called during the SSR flow via PrefetchPageLinksImpl so\n // don't assume window is available\n typeof window === \"undefined\" ? \"server://singlefetch/\" : window.location.origin\n ) : reqUrl;\n if (url.pathname === \"/\") {\n url.pathname = \"_root.data\";\n } else {\n url.pathname = `${url.pathname.replace(/\\/$/, \"\")}.data`;\n }\n return url;\n}\nasync function fetchAndDecode(url, init) {\n let res = await fetch(url, init);\n if (res.status === 404 && !res.headers.has(\"X-Remix-Response\")) {\n throw new ErrorResponseImpl(404, \"Not Found\", true);\n }\n invariant2(res.body, \"No response body to decode\");\n try {\n let decoded = await decodeViaTurboStream(res.body, window);\n return { status: res.status, data: decoded.value };\n } catch (e) {\n throw new Error(\"Unable to decode turbo-stream response\");\n }\n}\nfunction decodeViaTurboStream(body, global2) {\n return (0,turbo_stream__WEBPACK_IMPORTED_MODULE_1__.decode)(body, {\n plugins: [\n (type, ...rest) => {\n if (type === \"SanitizedError\") {\n let [name, message, stack] = rest;\n let Constructor = Error;\n if (name && name in global2 && typeof global2[name] === \"function\") {\n Constructor = global2[name];\n }\n let error = new Constructor(message);\n error.stack = stack;\n return { value: error };\n }\n if (type === \"ErrorResponse\") {\n let [data2, status, statusText] = rest;\n return {\n value: new ErrorResponseImpl(status, statusText, data2)\n };\n }\n if (type === \"SingleFetchRedirect\") {\n return { value: { [SingleFetchRedirectSymbol]: rest[0] } };\n }\n if (type === \"SingleFetchClassInstance\") {\n return { value: rest[0] };\n }\n if (type === \"SingleFetchFallback\") {\n return { value: void 0 };\n }\n }\n ]\n });\n}\nfunction unwrapSingleFetchResults(results, routeId) {\n let redirect2 = results[SingleFetchRedirectSymbol];\n if (redirect2) {\n return unwrapSingleFetchResult(redirect2, routeId);\n }\n return results[routeId] !== void 0 ? unwrapSingleFetchResult(results[routeId], routeId) : null;\n}\nfunction unwrapSingleFetchResult(result, routeId) {\n if (\"error\" in result) {\n throw result.error;\n } else if (\"redirect\" in result) {\n let headers = {};\n if (result.revalidate) {\n headers[\"X-Remix-Revalidate\"] = \"yes\";\n }\n if (result.reload) {\n headers[\"X-Remix-Reload-Document\"] = \"yes\";\n }\n if (result.replace) {\n headers[\"X-Remix-Replace\"] = \"yes\";\n }\n throw redirect(result.redirect, { status: result.status, headers });\n } else if (\"data\" in result) {\n return result.data;\n } else {\n throw new Error(`No response found for routeId \"${routeId}\"`);\n }\n}\nfunction createDeferred2() {\n let resolve;\n let reject;\n let promise = new Promise((res, rej) => {\n resolve = async (val) => {\n res(val);\n try {\n await promise;\n } catch (e) {\n }\n };\n reject = async (error) => {\n rej(error);\n try {\n await promise;\n } catch (e) {\n }\n };\n });\n return {\n promise,\n //@ts-ignore\n resolve,\n //@ts-ignore\n reject\n };\n}\n\n// lib/dom/ssr/fog-of-war.ts\n\n\n// lib/dom/ssr/routes.tsx\n\n\n// lib/dom/ssr/errorBoundaries.tsx\n\nvar RemixErrorBoundary = class extends react__WEBPACK_IMPORTED_MODULE_0__.Component {\n constructor(props) {\n super(props);\n this.state = { error: props.error || null, location: props.location };\n }\n static getDerivedStateFromError(error) {\n return { error };\n }\n static getDerivedStateFromProps(props, state) {\n if (state.location !== props.location) {\n return { error: props.error || null, location: props.location };\n }\n return { error: props.error || state.error, location: state.location };\n }\n render() {\n if (this.state.error) {\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n RemixRootDefaultErrorBoundary,\n {\n error: this.state.error,\n isOutsideRemixApp: true\n }\n );\n } else {\n return this.props.children;\n }\n }\n};\nfunction RemixRootDefaultErrorBoundary({\n error,\n isOutsideRemixApp\n}) {\n console.error(error);\n let heyDeveloper = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n \"script\",\n {\n dangerouslySetInnerHTML: {\n __html: `\n console.log(\n \"\\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.\"\n );\n `\n }\n }\n );\n if (isRouteErrorResponse(error)) {\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(BoundaryShell, { title: \"Unhandled Thrown Response!\" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"h1\", { style: { fontSize: \"24px\" } }, error.status, \" \", error.statusText), heyDeveloper);\n }\n let errorInstance;\n if (error instanceof Error) {\n errorInstance = error;\n } else {\n let errorString = error == null ? \"Unknown Error\" : typeof error === \"object\" && \"toString\" in error ? error.toString() : JSON.stringify(error);\n errorInstance = new Error(errorString);\n }\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n BoundaryShell,\n {\n title: \"Application Error!\",\n isOutsideRemixApp\n },\n /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"h1\", { style: { fontSize: \"24px\" } }, \"Application Error\"),\n /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n \"pre\",\n {\n style: {\n padding: \"2rem\",\n background: \"hsla(10, 50%, 50%, 0.1)\",\n color: \"red\",\n overflow: \"auto\"\n }\n },\n errorInstance.stack\n ),\n heyDeveloper\n );\n}\nfunction BoundaryShell({\n title,\n renderScripts,\n isOutsideRemixApp,\n children\n}) {\n let { routeModules } = useFrameworkContext();\n if (routeModules.root?.Layout && !isOutsideRemixApp) {\n return children;\n }\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"html\", { lang: \"en\" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"head\", null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"meta\", { charSet: \"utf-8\" }), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n \"meta\",\n {\n name: \"viewport\",\n content: \"width=device-width,initial-scale=1,viewport-fit=cover\"\n }\n ), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"title\", null, title)), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"body\", null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"main\", { style: { fontFamily: \"system-ui, sans-serif\", padding: \"2rem\" } }, children, renderScripts ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Scripts, null) : null)));\n}\n\n// lib/dom/ssr/fallback.tsx\n\nfunction RemixRootDefaultHydrateFallback() {\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(BoundaryShell, { title: \"Loading...\", renderScripts: true }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n \"script\",\n {\n dangerouslySetInnerHTML: {\n __html: `\n console.log(\n \"\\u{1F4BF} Hey developer \\u{1F44B}. You can provide a way better UX than this \" +\n \"when your app is loading JS modules and/or running \\`clientLoader\\` \" +\n \"functions. Check out https://remix.run/route/hydrate-fallback \" +\n \"for more information.\"\n );\n `\n }\n }\n ));\n}\n\n// lib/dom/ssr/routes.tsx\nfunction groupRoutesByParentId(manifest) {\n let routes = {};\n Object.values(manifest).forEach((route) => {\n if (route) {\n let parentId = route.parentId || \"\";\n if (!routes[parentId]) {\n routes[parentId] = [];\n }\n routes[parentId].push(route);\n }\n });\n return routes;\n}\nfunction getRouteComponents(route, routeModule, isSpaMode) {\n let Component4 = getRouteModuleComponent(routeModule);\n let HydrateFallback = routeModule.HydrateFallback && (!isSpaMode || route.id === \"root\") ? routeModule.HydrateFallback : route.id === \"root\" ? RemixRootDefaultHydrateFallback : void 0;\n let ErrorBoundary = routeModule.ErrorBoundary ? routeModule.ErrorBoundary : route.id === \"root\" ? () => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RemixRootDefaultErrorBoundary, { error: useRouteError() }) : void 0;\n if (route.id === \"root\" && routeModule.Layout) {\n return {\n ...Component4 ? {\n element: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(routeModule.Layout, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Component4, null))\n } : { Component: Component4 },\n ...ErrorBoundary ? {\n errorElement: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(routeModule.Layout, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(ErrorBoundary, null))\n } : { ErrorBoundary },\n ...HydrateFallback ? {\n hydrateFallbackElement: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(routeModule.Layout, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(HydrateFallback, null))\n } : { HydrateFallback }\n };\n }\n return { Component: Component4, ErrorBoundary, HydrateFallback };\n}\nfunction createServerRoutes(manifest, routeModules, future, isSpaMode, parentId = \"\", routesByParentId = groupRoutesByParentId(manifest), spaModeLazyPromise = Promise.resolve({ Component: () => null })) {\n return (routesByParentId[parentId] || []).map((route) => {\n let routeModule = routeModules[route.id];\n invariant2(\n routeModule,\n \"No `routeModule` available to create server routes\"\n );\n let dataRoute = {\n ...getRouteComponents(route, routeModule, isSpaMode),\n caseSensitive: route.caseSensitive,\n id: route.id,\n index: route.index,\n path: route.path,\n handle: routeModule.handle,\n // For SPA Mode, all routes are lazy except root. However we tell the\n // router root is also lazy here too since we don't need a full\n // implementation - we just need a `lazy` prop to tell the RR rendering\n // where to stop which is always at the root route in SPA mode\n lazy: isSpaMode ? () => spaModeLazyPromise : void 0,\n // For partial hydration rendering, we need to indicate when the route\n // has a loader/clientLoader, but it won't ever be called during the static\n // render, so just give it a no-op function so we can render down to the\n // proper fallback\n loader: route.hasLoader || route.hasClientLoader ? () => null : void 0\n // We don't need action/shouldRevalidate on these routes since they're\n // for a static render\n };\n let children = createServerRoutes(\n manifest,\n routeModules,\n future,\n isSpaMode,\n route.id,\n routesByParentId,\n spaModeLazyPromise\n );\n if (children.length > 0) dataRoute.children = children;\n return dataRoute;\n });\n}\nfunction createClientRoutesWithHMRRevalidationOptOut(needsRevalidation, manifest, routeModulesCache, initialState, future, isSpaMode) {\n return createClientRoutes(\n manifest,\n routeModulesCache,\n initialState,\n isSpaMode,\n \"\",\n groupRoutesByParentId(manifest),\n needsRevalidation\n );\n}\nfunction preventInvalidServerHandlerCall(type, route, isSpaMode) {\n if (isSpaMode) {\n let fn2 = type === \"action\" ? \"serverAction()\" : \"serverLoader()\";\n let msg2 = `You cannot call ${fn2} in SPA Mode (routeId: \"${route.id}\")`;\n console.error(msg2);\n throw new ErrorResponseImpl(400, \"Bad Request\", new Error(msg2), true);\n }\n let fn = type === \"action\" ? \"serverAction()\" : \"serverLoader()\";\n let msg = `You are trying to call ${fn} on a route that does not have a server ${type} (routeId: \"${route.id}\")`;\n if (type === \"loader\" && !route.hasLoader || type === \"action\" && !route.hasAction) {\n console.error(msg);\n throw new ErrorResponseImpl(400, \"Bad Request\", new Error(msg), true);\n }\n}\nfunction noActionDefinedError(type, routeId) {\n let article = type === \"clientAction\" ? \"a\" : \"an\";\n let msg = `Route \"${routeId}\" does not have ${article} ${type}, but you are trying to submit to it. To fix this, please add ${article} \\`${type}\\` function to the route`;\n console.error(msg);\n throw new ErrorResponseImpl(405, \"Method Not Allowed\", new Error(msg), true);\n}\nfunction createClientRoutes(manifest, routeModulesCache, initialState, isSpaMode, parentId = \"\", routesByParentId = groupRoutesByParentId(manifest), needsRevalidation) {\n return (routesByParentId[parentId] || []).map((route) => {\n let routeModule = routeModulesCache[route.id];\n function fetchServerHandler(singleFetch) {\n invariant2(\n typeof singleFetch === \"function\",\n \"No single fetch function available for route handler\"\n );\n return singleFetch();\n }\n function fetchServerLoader(singleFetch) {\n if (!route.hasLoader) return Promise.resolve(null);\n return fetchServerHandler(singleFetch);\n }\n function fetchServerAction(singleFetch) {\n if (!route.hasAction) {\n throw noActionDefinedError(\"action\", route.id);\n }\n return fetchServerHandler(singleFetch);\n }\n async function prefetchStylesAndCallHandler(handler) {\n let cachedModule = routeModulesCache[route.id];\n let linkPrefetchPromise = cachedModule ? prefetchStyleLinks(route, cachedModule) : Promise.resolve();\n try {\n return handler();\n } finally {\n await linkPrefetchPromise;\n }\n }\n let dataRoute = {\n id: route.id,\n index: route.index,\n path: route.path\n };\n if (routeModule) {\n Object.assign(dataRoute, {\n ...dataRoute,\n ...getRouteComponents(route, routeModule, isSpaMode),\n handle: routeModule.handle,\n shouldRevalidate: getShouldRevalidateFunction(\n routeModule,\n route.id,\n needsRevalidation\n )\n });\n let hasInitialData = initialState && initialState.loaderData && route.id in initialState.loaderData;\n let initialData = hasInitialData ? initialState?.loaderData?.[route.id] : void 0;\n let hasInitialError = initialState && initialState.errors && route.id in initialState.errors;\n let initialError = hasInitialError ? initialState?.errors?.[route.id] : void 0;\n let isHydrationRequest = needsRevalidation == null && (routeModule.clientLoader?.hydrate === true || !route.hasLoader);\n dataRoute.loader = async ({ request, params }, singleFetch) => {\n try {\n let result = await prefetchStylesAndCallHandler(async () => {\n invariant2(\n routeModule,\n \"No `routeModule` available for critical-route loader\"\n );\n if (!routeModule.clientLoader) {\n if (isSpaMode) return null;\n return fetchServerLoader(singleFetch);\n }\n return routeModule.clientLoader({\n request,\n params,\n async serverLoader() {\n preventInvalidServerHandlerCall(\"loader\", route, isSpaMode);\n if (isHydrationRequest) {\n if (hasInitialData) {\n return initialData;\n }\n if (hasInitialError) {\n throw initialError;\n }\n }\n return fetchServerLoader(singleFetch);\n }\n });\n });\n return result;\n } finally {\n isHydrationRequest = false;\n }\n };\n dataRoute.loader.hydrate = shouldHydrateRouteLoader(\n route,\n routeModule,\n isSpaMode\n );\n dataRoute.action = ({ request, params }, singleFetch) => {\n return prefetchStylesAndCallHandler(async () => {\n invariant2(\n routeModule,\n \"No `routeModule` available for critical-route action\"\n );\n if (!routeModule.clientAction) {\n if (isSpaMode) {\n throw noActionDefinedError(\"clientAction\", route.id);\n }\n return fetchServerAction(singleFetch);\n }\n return routeModule.clientAction({\n request,\n params,\n async serverAction() {\n preventInvalidServerHandlerCall(\"action\", route, isSpaMode);\n return fetchServerAction(singleFetch);\n }\n });\n });\n };\n } else {\n if (!route.hasClientLoader) {\n dataRoute.loader = ({ request }, singleFetch) => prefetchStylesAndCallHandler(() => {\n if (isSpaMode) return Promise.resolve(null);\n return fetchServerLoader(singleFetch);\n });\n }\n if (!route.hasClientAction) {\n dataRoute.action = ({ request }, singleFetch) => prefetchStylesAndCallHandler(() => {\n if (isSpaMode) {\n throw noActionDefinedError(\"clientAction\", route.id);\n }\n return fetchServerAction(singleFetch);\n });\n }\n dataRoute.lazy = async () => {\n let mod = await loadRouteModuleWithBlockingLinks(\n route,\n routeModulesCache\n );\n let lazyRoute = { ...mod };\n if (mod.clientLoader) {\n let clientLoader = mod.clientLoader;\n lazyRoute.loader = (args, singleFetch) => clientLoader({\n ...args,\n async serverLoader() {\n preventInvalidServerHandlerCall(\"loader\", route, isSpaMode);\n return fetchServerLoader(singleFetch);\n }\n });\n }\n if (mod.clientAction) {\n let clientAction = mod.clientAction;\n lazyRoute.action = (args, singleFetch) => clientAction({\n ...args,\n async serverAction() {\n preventInvalidServerHandlerCall(\"action\", route, isSpaMode);\n return fetchServerAction(singleFetch);\n }\n });\n }\n return {\n ...lazyRoute.loader ? { loader: lazyRoute.loader } : {},\n ...lazyRoute.action ? { action: lazyRoute.action } : {},\n hasErrorBoundary: lazyRoute.hasErrorBoundary,\n shouldRevalidate: getShouldRevalidateFunction(\n lazyRoute,\n route.id,\n needsRevalidation\n ),\n handle: lazyRoute.handle,\n // No need to wrap these in layout since the root route is never\n // loaded via route.lazy()\n Component: lazyRoute.Component,\n ErrorBoundary: lazyRoute.ErrorBoundary\n };\n };\n }\n let children = createClientRoutes(\n manifest,\n routeModulesCache,\n initialState,\n isSpaMode,\n route.id,\n routesByParentId,\n needsRevalidation\n );\n if (children.length > 0) dataRoute.children = children;\n return dataRoute;\n });\n}\nfunction getShouldRevalidateFunction(route, routeId, needsRevalidation) {\n if (needsRevalidation) {\n return wrapShouldRevalidateForHdr(\n routeId,\n route.shouldRevalidate,\n needsRevalidation\n );\n }\n if (route.shouldRevalidate) {\n let fn = route.shouldRevalidate;\n return (opts) => fn({ ...opts, defaultShouldRevalidate: true });\n }\n return route.shouldRevalidate;\n}\nfunction wrapShouldRevalidateForHdr(routeId, routeShouldRevalidate, needsRevalidation) {\n let handledRevalidation = false;\n return (arg) => {\n if (!handledRevalidation) {\n handledRevalidation = true;\n return needsRevalidation.has(routeId);\n }\n return routeShouldRevalidate ? routeShouldRevalidate(arg) : arg.defaultShouldRevalidate;\n };\n}\nasync function loadRouteModuleWithBlockingLinks(route, routeModules) {\n let routeModule = await loadRouteModule(route, routeModules);\n await prefetchStyleLinks(route, routeModule);\n return {\n Component: getRouteModuleComponent(routeModule),\n ErrorBoundary: routeModule.ErrorBoundary,\n clientAction: routeModule.clientAction,\n clientLoader: routeModule.clientLoader,\n handle: routeModule.handle,\n links: routeModule.links,\n meta: routeModule.meta,\n shouldRevalidate: routeModule.shouldRevalidate\n };\n}\nfunction getRouteModuleComponent(routeModule) {\n if (routeModule.default == null) return void 0;\n let isEmptyObject = typeof routeModule.default === \"object\" && Object.keys(routeModule.default).length === 0;\n if (!isEmptyObject) {\n return routeModule.default;\n }\n}\nfunction shouldHydrateRouteLoader(route, routeModule, isSpaMode) {\n return isSpaMode && route.id !== \"root\" || routeModule.clientLoader != null && (routeModule.clientLoader.hydrate === true || route.hasLoader !== true);\n}\n\n// lib/dom/ssr/fog-of-war.ts\nvar nextPaths = /* @__PURE__ */ new Set();\nvar discoveredPathsMaxSize = 1e3;\nvar discoveredPaths = /* @__PURE__ */ new Set();\nvar URL_LIMIT = 7680;\nfunction isFogOfWarEnabled(isSpaMode) {\n return !isSpaMode;\n}\nfunction getPartialManifest(manifest, router) {\n let routeIds = new Set(router.state.matches.map((m) => m.route.id));\n let segments = router.state.location.pathname.split(\"/\").filter(Boolean);\n let paths = [\"/\"];\n segments.pop();\n while (segments.length > 0) {\n paths.push(`/${segments.join(\"/\")}`);\n segments.pop();\n }\n paths.forEach((path) => {\n let matches = matchRoutes(router.routes, path, router.basename);\n if (matches) {\n matches.forEach((m) => routeIds.add(m.route.id));\n }\n });\n let initialRoutes = [...routeIds].reduce(\n (acc, id) => Object.assign(acc, { [id]: manifest.routes[id] }),\n {}\n );\n return {\n ...manifest,\n routes: initialRoutes\n };\n}\nfunction getPatchRoutesOnNavigationFunction(manifest, routeModules, isSpaMode, basename) {\n if (!isFogOfWarEnabled(isSpaMode)) {\n return void 0;\n }\n return async ({ path, patch }) => {\n if (discoveredPaths.has(path)) {\n return;\n }\n await fetchAndApplyManifestPatches(\n [path],\n manifest,\n routeModules,\n isSpaMode,\n basename,\n patch\n );\n };\n}\nfunction useFogOFWarDiscovery(router, manifest, routeModules, isSpaMode) {\n react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {\n if (!isFogOfWarEnabled(isSpaMode) || navigator.connection?.saveData === true) {\n return;\n }\n function registerElement(el) {\n let path = el.tagName === \"FORM\" ? el.getAttribute(\"action\") : el.getAttribute(\"href\");\n if (!path) {\n return;\n }\n let url = new URL(path, window.location.origin);\n if (!discoveredPaths.has(url.pathname)) {\n nextPaths.add(url.pathname);\n }\n }\n async function fetchPatches() {\n let lazyPaths = Array.from(nextPaths.keys()).filter((path) => {\n if (discoveredPaths.has(path)) {\n nextPaths.delete(path);\n return false;\n }\n return true;\n });\n if (lazyPaths.length === 0) {\n return;\n }\n try {\n await fetchAndApplyManifestPatches(\n lazyPaths,\n manifest,\n routeModules,\n isSpaMode,\n router.basename,\n router.patchRoutes\n );\n } catch (e) {\n console.error(\"Failed to fetch manifest patches\", e);\n }\n }\n document.body.querySelectorAll(\"a[data-discover], form[data-discover]\").forEach((el) => registerElement(el));\n fetchPatches();\n let debouncedFetchPatches = debounce(fetchPatches, 100);\n function isElement(node) {\n return node.nodeType === Node.ELEMENT_NODE;\n }\n let observer = new MutationObserver((records) => {\n let elements = /* @__PURE__ */ new Set();\n records.forEach((r) => {\n [r.target, ...r.addedNodes].forEach((node) => {\n if (!isElement(node)) return;\n if (node.tagName === \"A\" && node.getAttribute(\"data-discover\")) {\n elements.add(node);\n } else if (node.tagName === \"FORM\" && node.getAttribute(\"data-discover\")) {\n elements.add(node);\n }\n if (node.tagName !== \"A\") {\n node.querySelectorAll(\"a[data-discover], form[data-discover]\").forEach((el) => elements.add(el));\n }\n });\n });\n elements.forEach((el) => registerElement(el));\n debouncedFetchPatches();\n });\n observer.observe(document.documentElement, {\n subtree: true,\n childList: true,\n attributes: true,\n attributeFilter: [\"data-discover\", \"href\", \"action\"]\n });\n return () => observer.disconnect();\n }, [isSpaMode, manifest, routeModules, router]);\n}\nasync function fetchAndApplyManifestPatches(paths, manifest, routeModules, isSpaMode, basename, patchRoutes) {\n let manifestPath = `${basename != null ? basename : \"/\"}/__manifest`.replace(\n /\\/+/g,\n \"/\"\n );\n let url = new URL(manifestPath, window.location.origin);\n paths.sort().forEach((path) => url.searchParams.append(\"p\", path));\n url.searchParams.set(\"version\", manifest.version);\n if (url.toString().length > URL_LIMIT) {\n nextPaths.clear();\n return;\n }\n let res = await fetch(url);\n if (!res.ok) {\n throw new Error(`${res.status} ${res.statusText}`);\n } else if (res.status >= 400) {\n throw new Error(await res.text());\n }\n let serverPatches = await res.json();\n let knownRoutes = new Set(Object.keys(manifest.routes));\n let patches = Object.values(serverPatches).reduce((acc, route) => {\n if (route && !knownRoutes.has(route.id)) {\n acc[route.id] = route;\n }\n return acc;\n }, {});\n Object.assign(manifest.routes, patches);\n paths.forEach((p) => addToFifoQueue(p, discoveredPaths));\n let parentIds = /* @__PURE__ */ new Set();\n Object.values(patches).forEach((patch) => {\n if (patch && (!patch.parentId || !patches[patch.parentId])) {\n parentIds.add(patch.parentId);\n }\n });\n parentIds.forEach(\n (parentId) => patchRoutes(\n parentId || null,\n createClientRoutes(patches, routeModules, null, isSpaMode, parentId)\n )\n );\n}\nfunction addToFifoQueue(path, queue) {\n if (queue.size >= discoveredPathsMaxSize) {\n let first = queue.values().next().value;\n queue.delete(first);\n }\n queue.add(path);\n}\nfunction debounce(callback, wait) {\n let timeoutId;\n return (...args) => {\n window.clearTimeout(timeoutId);\n timeoutId = window.setTimeout(() => callback(...args), wait);\n };\n}\n\n// lib/dom/ssr/components.tsx\nfunction useDataRouterContext2() {\n let context = react__WEBPACK_IMPORTED_MODULE_0__.useContext(DataRouterContext);\n invariant2(\n context,\n \"You must render this element inside a <DataRouterContext.Provider> element\"\n );\n return context;\n}\nfunction useDataRouterStateContext() {\n let context = react__WEBPACK_IMPORTED_MODULE_0__.useContext(DataRouterStateContext);\n invariant2(\n context,\n \"You must render this element inside a <DataRouterStateContext.Provider> element\"\n );\n return context;\n}\nvar FrameworkContext = react__WEBPACK_IMPORTED_MODULE_0__.createContext(void 0);\nFrameworkContext.displayName = \"FrameworkContext\";\nfunction useFrameworkContext() {\n let context = react__WEBPACK_IMPORTED_MODULE_0__.useContext(FrameworkContext);\n invariant2(\n context,\n \"You must render this element inside a <HydratedRouter> element\"\n );\n return context;\n}\nfunction usePrefetchBehavior(prefetch, theirElementProps) {\n let frameworkContext = react__WEBPACK_IMPORTED_MODULE_0__.useContext(FrameworkContext);\n let [maybePrefetch, setMaybePrefetch] = react__WEBPACK_IMPORTED_MODULE_0__.useState(false);\n let [shouldPrefetch, setShouldPrefetch] = react__WEBPACK_IMPORTED_MODULE_0__.useState(false);\n let { onFocus, onBlur, onMouseEnter, onMouseLeave, onTouchStart } = theirElementProps;\n let ref = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);\n react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {\n if (prefetch === \"render\") {\n setShouldPrefetch(true);\n }\n if (prefetch === \"viewport\") {\n let callback = (entries) => {\n entries.forEach((entry) => {\n setShouldPrefetch(entry.isIntersecting);\n });\n };\n let observer = new IntersectionObserver(callback, { threshold: 0.5 });\n if (ref.current) observer.observe(ref.current);\n return () => {\n observer.disconnect();\n };\n }\n }, [prefetch]);\n react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {\n if (maybePrefetch) {\n let id = setTimeout(() => {\n setShouldPrefetch(true);\n }, 100);\n return () => {\n clearTimeout(id);\n };\n }\n }, [maybePrefetch]);\n let setIntent = () => {\n setMaybePrefetch(true);\n };\n let cancelIntent = () => {\n setMaybePrefetch(false);\n setShouldPrefetch(false);\n };\n if (!frameworkContext) {\n return [false, ref, {}];\n }\n if (prefetch !== \"intent\") {\n return [shouldPrefetch, ref, {}];\n }\n return [\n shouldPrefetch,\n ref,\n {\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 ];\n}\nfunction composeEventHandlers(theirHandler, ourHandler) {\n return (event) => {\n theirHandler && theirHandler(event);\n if (!event.defaultPrevented) {\n ourHandler(event);\n }\n };\n}\nfunction getActiveMatches(matches, errors, isSpaMode) {\n if (isSpaMode && !isHydrated) {\n return [matches[0]];\n }\n if (errors) {\n let errorIdx = matches.findIndex((m) => errors[m.route.id] !== void 0);\n return matches.slice(0, errorIdx + 1);\n }\n return matches;\n}\nfunction Links() {\n let { isSpaMode, manifest, routeModules, criticalCss } = useFrameworkContext();\n let { errors, matches: routerMatches } = useDataRouterStateContext();\n let matches = getActiveMatches(routerMatches, errors, isSpaMode);\n let keyedLinks = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(\n () => getKeyedLinksForMatches(matches, routeModules, manifest),\n [matches, routeModules, manifest]\n );\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, criticalCss ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"style\", { dangerouslySetInnerHTML: { __html: criticalCss } }) : null, keyedLinks.map(\n ({ key, link }) => isPageLinkDescriptor(link) ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(PrefetchPageLinks, { key, ...link }) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"link\", { key, ...link })\n ));\n}\nfunction PrefetchPageLinks({\n page,\n ...dataLinkProps\n}) {\n let { router } = useDataRouterContext2();\n let matches = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(\n () => matchRoutes(router.routes, page, router.basename),\n [router.routes, page, router.basename]\n );\n if (!matches) {\n return null;\n }\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(PrefetchPageLinksImpl, { page, matches, ...dataLinkProps });\n}\nfunction useKeyedPrefetchLinks(matches) {\n let { manifest, routeModules } = useFrameworkContext();\n let [keyedPrefetchLinks, setKeyedPrefetchLinks] = react__WEBPACK_IMPORTED_MODULE_0__.useState([]);\n react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {\n let interrupted = false;\n void getKeyedPrefetchLinks(matches, manifest, routeModules).then(\n (links) => {\n if (!interrupted) {\n setKeyedPrefetchLinks(links);\n }\n }\n );\n return () => {\n interrupted = true;\n };\n }, [matches, manifest, routeModules]);\n return keyedPrefetchLinks;\n}\nfunction PrefetchPageLinksImpl({\n page,\n matches: nextMatches,\n ...linkProps\n}) {\n let location = useLocation();\n let { manifest, routeModules } = useFrameworkContext();\n let { loaderData, matches } = useDataRouterStateContext();\n let newMatchesForData = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(\n () => getNewMatchesForLinks(\n page,\n nextMatches,\n matches,\n manifest,\n location,\n \"data\"\n ),\n [page, nextMatches, matches, manifest, location]\n );\n let newMatchesForAssets = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(\n () => getNewMatchesForLinks(\n page,\n nextMatches,\n matches,\n manifest,\n location,\n \"assets\"\n ),\n [page, nextMatches, matches, manifest, location]\n );\n let dataHrefs = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => {\n if (page === location.pathname + location.search + location.hash) {\n return [];\n }\n let routesParams = /* @__PURE__ */ new Set();\n let foundOptOutRoute = false;\n nextMatches.forEach((m) => {\n let manifestRoute = manifest.routes[m.route.id];\n if (!manifestRoute || !manifestRoute.hasLoader) {\n return;\n }\n if (!newMatchesForData.some((m2) => m2.route.id === m.route.id) && m.route.id in loaderData && routeModules[m.route.id]?.shouldRevalidate) {\n foundOptOutRoute = true;\n } else if (manifestRoute.hasClientLoader) {\n foundOptOutRoute = true;\n } else {\n routesParams.add(m.route.id);\n }\n });\n if (routesParams.size === 0) {\n return [];\n }\n let url = singleFetchUrl(page);\n if (foundOptOutRoute && routesParams.size > 0) {\n url.searchParams.set(\n \"_routes\",\n nextMatches.filter((m) => routesParams.has(m.route.id)).map((m) => m.route.id).join(\",\")\n );\n }\n return [url.pathname + url.search];\n }, [\n loaderData,\n location,\n manifest,\n newMatchesForData,\n nextMatches,\n page,\n routeModules\n ]);\n let moduleHrefs = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(\n () => getModuleLinkHrefs(newMatchesForAssets, manifest),\n [newMatchesForAssets, manifest]\n );\n let keyedPrefetchLinks = useKeyedPrefetchLinks(newMatchesForAssets);\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, dataHrefs.map((href) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"link\", { key: href, rel: \"prefetch\", as: \"fetch\", href, ...linkProps })), moduleHrefs.map((href) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"link\", { key: href, rel: \"modulepreload\", href, ...linkProps })), keyedPrefetchLinks.map(({ key, link }) => (\n // these don't spread `linkProps` because they are full link descriptors\n // already with their own props\n /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"link\", { key, ...link })\n )));\n}\nfunction Meta() {\n let { isSpaMode, routeModules } = useFrameworkContext();\n let {\n errors,\n matches: routerMatches,\n loaderData\n } = useDataRouterStateContext();\n let location = useLocation();\n let _matches = getActiveMatches(routerMatches, errors, isSpaMode);\n let error = null;\n if (errors) {\n error = errors[_matches[_matches.length - 1].route.id];\n }\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 data2 = loaderData[routeId];\n let params = _match.params;\n let routeModule = routeModules[routeId];\n let routeMeta = [];\n let match = {\n id: routeId,\n data: data2,\n meta: [],\n params: _match.params,\n pathname: _match.pathname,\n handle: _match.route.handle,\n error\n };\n matches[i] = match;\n if (routeModule?.meta) {\n routeMeta = typeof routeModule.meta === \"function\" ? routeModule.meta({\n data: data2,\n params,\n location,\n matches,\n error\n }) : Array.isArray(routeModule.meta) ? [...routeModule.meta] : routeModule.meta;\n } else if (leafMeta) {\n routeMeta = [...leafMeta];\n }\n routeMeta = routeMeta || [];\n if (!Array.isArray(routeMeta)) {\n throw new Error(\n \"The route at \" + _match.route.path + \" returns an invalid value. All route meta functions must return an array of meta objects.\\n\\nTo reference the meta function API, see https://remix.run/route/meta\"\n );\n }\n match.meta = routeMeta;\n matches[i] = match;\n meta = [...routeMeta];\n leafMeta = meta;\n }\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, meta.flat().map((metaProps) => {\n if (!metaProps) {\n return null;\n }\n if (\"tagName\" in metaProps) {\n let { tagName, ...rest } = metaProps;\n if (!isValidMetaTag(tagName)) {\n console.warn(\n `A meta object uses an invalid tagName: ${tagName}. Expected either 'link' or 'meta'`\n );\n return null;\n }\n let Comp = tagName;\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Comp, { key: JSON.stringify(rest), ...rest });\n }\n if (\"title\" in metaProps) {\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"title\", { key: \"title\" }, 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__WEBPACK_IMPORTED_MODULE_0__.createElement(\"meta\", { key: \"charSet\", charSet: metaProps.charSet }) : null;\n }\n if (\"script:ld+json\" in metaProps) {\n try {\n let json = JSON.stringify(metaProps[\"script:ld+json\"]);\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n \"script\",\n {\n key: `script:ld+json:${json}`,\n type: \"application/ld+json\",\n dangerouslySetInnerHTML: { __html: json }\n }\n );\n } catch (err) {\n return null;\n }\n }\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"meta\", { key: JSON.stringify(metaProps), ...metaProps });\n }));\n}\nfunction isValidMetaTag(tagName) {\n return typeof tagName === \"string\" && /^(meta|link)$/.test(tagName);\n}\nvar isHydrated = false;\nfunction Scripts(props) {\n let { manifest, serverHandoffString, isSpaMode, renderMeta } = useFrameworkContext();\n let { router, static: isStatic, staticContext } = useDataRouterContext2();\n let { matches: routerMatches } = useDataRouterStateContext();\n let enableFogOfWar = isFogOfWarEnabled(isSpaMode);\n if (renderMeta) {\n renderMeta.didRenderScripts = true;\n }\n let matches = getActiveMatches(routerMatches, null, isSpaMode);\n react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {\n isHydrated = true;\n }, []);\n let initialScripts = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => {\n let streamScript = \"window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());\";\n let contextScript = staticContext ? `window.__reactRouterContext = ${serverHandoffString};${streamScript}` : \" \";\n let routeModulesScript = !isStatic ? \" \" : `${manifest.hmr?.runtime ? `import ${JSON.stringify(manifest.hmr.runtime)};` : \"\"}${!enableFogOfWar ? `import ${JSON.stringify(manifest.url)}` : \"\"};\n${matches.map(\n (match, index) => `import * as route${index} from ${JSON.stringify(\n manifest.routes[match.route.id].module\n )};`\n ).join(\"\\n\")}\n ${enableFogOfWar ? (\n // Inline a minimal manifest with the SSR matches\n `window.__reactRouterManifest = ${JSON.stringify(\n getPartialManifest(manifest, router),\n null,\n 2\n )};`\n ) : \"\"}\n window.__reactRouterRouteModules = {${matches.map((match, index) => `${JSON.stringify(match.route.id)}:route${index}`).join(\",\")}};\n\nimport(${JSON.stringify(manifest.entry.module)});`;\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n \"script\",\n {\n ...props,\n suppressHydrationWarning: true,\n dangerouslySetInnerHTML: createHtml(contextScript),\n type: void 0\n }\n ), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n \"script\",\n {\n ...props,\n suppressHydrationWarning: true,\n dangerouslySetInnerHTML: createHtml(routeModulesScript),\n type: \"module\",\n async: true\n }\n ));\n }, []);\n let routePreloads = matches.map((match) => {\n let route = manifest.routes[match.route.id];\n return route ? (route.imports || []).concat([route.module]) : [];\n }).flat(1);\n let preloads = isHydrated ? [] : manifest.entry.imports.concat(routePreloads);\n return isHydrated ? null : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, !enableFogOfWar ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n \"link\",\n {\n rel: \"modulepreload\",\n href: manifest.url,\n crossOrigin: props.crossOrigin\n }\n ) : null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n \"link\",\n {\n rel: \"modulepreload\",\n href: manifest.entry.module,\n crossOrigin: props.crossOrigin\n }\n ), dedupe(preloads).map((path) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n \"link\",\n {\n key: path,\n rel: \"modulepreload\",\n href: path,\n crossOrigin: props.crossOrigin\n }\n )), initialScripts);\n}\nfunction dedupe(array) {\n return [...new Set(array)];\n}\nfunction mergeRefs(...refs) {\n return (value) => {\n refs.forEach((ref) => {\n if (typeof ref === \"function\") {\n ref(value);\n } else if (ref != null) {\n ref.current = value;\n }\n });\n };\n}\n\n// lib/dom/lib.tsx\nvar isBrowser = typeof window !== \"undefined\" && typeof window.document !== \"undefined\" && typeof window.document.createElement !== \"undefined\";\ntry {\n if (isBrowser) {\n window.__reactRouterVersion = \"7.1.2\";\n }\n} catch (e) {\n}\nfunction createBrowserRouter(routes, opts) {\n return createRouter({\n basename: opts?.basename,\n future: opts?.future,\n history: createBrowserHistory({ window: opts?.window }),\n hydrationData: opts?.hydrationData || parseHydrationData(),\n routes,\n mapRouteProperties,\n dataStrategy: opts?.dataStrategy,\n patchRoutesOnNavigation: opts?.patchRoutesOnNavigation,\n window: opts?.window\n }).initialize();\n}\nfunction createHashRouter(routes, opts) {\n return createRouter({\n basename: opts?.basename,\n future: opts?.future,\n history: createHashHistory({ window: opts?.window }),\n hydrationData: opts?.hydrationData || parseHydrationData(),\n routes,\n mapRouteProperties,\n dataStrategy: opts?.dataStrategy,\n patchRoutesOnNavigation: opts?.patchRoutesOnNavigation,\n window: opts?.window\n }).initialize();\n}\nfunction parseHydrationData() {\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}\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 if (val && val.__type === \"RouteErrorResponse\") {\n serialized[key] = new ErrorResponseImpl(\n val.status,\n val.statusText,\n val.data,\n val.internal === true\n );\n } else if (val && val.__type === \"Error\") {\n if (val.__subType) {\n let ErrorConstructor = window[val.__subType];\n if (typeof ErrorConstructor === \"function\") {\n try {\n let error = new ErrorConstructor(val.message);\n error.stack = \"\";\n serialized[key] = error;\n } catch (e) {\n }\n }\n }\n if (serialized[key] == null) {\n let error = new Error(val.message);\n error.stack = \"\";\n serialized[key] = error;\n }\n } else {\n serialized[key] = val;\n }\n }\n return serialized;\n}\nfunction BrowserRouter({\n basename,\n children,\n window: window2\n}) {\n let historyRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef();\n if (historyRef.current == null) {\n historyRef.current = createBrowserHistory({ window: window2, v5Compat: true });\n }\n let history = historyRef.current;\n let [state, setStateImpl] = react__WEBPACK_IMPORTED_MODULE_0__.useState({\n action: history.action,\n location: history.location\n });\n let setState = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(\n (newState) => {\n react__WEBPACK_IMPORTED_MODULE_0__.startTransition(() => setStateImpl(newState));\n },\n [setStateImpl]\n );\n react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect(() => history.listen(setState), [history, setState]);\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n Router,\n {\n basename,\n children,\n location: state.location,\n navigationType: state.action,\n navigator: history\n }\n );\n}\nfunction HashRouter({ basename, children, window: window2 }) {\n let historyRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef();\n if (historyRef.current == null) {\n historyRef.current = createHashHistory({ window: window2, v5Compat: true });\n }\n let history = historyRef.current;\n let [state, setStateImpl] = react__WEBPACK_IMPORTED_MODULE_0__.useState({\n action: history.action,\n location: history.location\n });\n let setState = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(\n (newState) => {\n react__WEBPACK_IMPORTED_MODULE_0__.startTransition(() => setStateImpl(newState));\n },\n [setStateImpl]\n );\n react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect(() => history.listen(setState), [history, setState]);\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n Router,\n {\n basename,\n children,\n location: state.location,\n navigationType: state.action,\n navigator: history\n }\n );\n}\nfunction HistoryRouter({\n basename,\n children,\n history\n}) {\n let [state, setStateImpl] = react__WEBPACK_IMPORTED_MODULE_0__.useState({\n action: history.action,\n location: history.location\n });\n let setState = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(\n (newState) => {\n react__WEBPACK_IMPORTED_MODULE_0__.startTransition(() => setStateImpl(newState));\n },\n [setStateImpl]\n );\n react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect(() => history.listen(setState), [history, setState]);\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n Router,\n {\n basename,\n children,\n location: state.location,\n navigationType: state.action,\n navigator: history\n }\n );\n}\nHistoryRouter.displayName = \"unstable_HistoryRouter\";\nvar ABSOLUTE_URL_REGEX2 = /^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i;\nvar Link = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(\n function LinkWithRef({\n onClick,\n discover = \"render\",\n prefetch = \"none\",\n relative,\n reloadDocument,\n replace: replace2,\n state,\n target,\n to,\n preventScrollReset,\n viewTransition,\n ...rest\n }, forwardedRef) {\n let { basename } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(NavigationContext);\n let isAbsolute = typeof to === \"string\" && ABSOLUTE_URL_REGEX2.test(to);\n let absoluteHref;\n let isExternal = false;\n if (typeof to === \"string\" && isAbsolute) {\n absoluteHref = to;\n if (isBrowser) {\n try {\n let currentUrl = new URL(window.location.href);\n let targetUrl = to.startsWith(\"//\") ? new URL(currentUrl.protocol + to) : new URL(to);\n let path = stripBasename(targetUrl.pathname, basename);\n if (targetUrl.origin === currentUrl.origin && path != null) {\n to = path + targetUrl.search + targetUrl.hash;\n } else {\n isExternal = true;\n }\n } catch (e) {\n warning(\n false,\n `<Link to=\"${to}\"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`\n );\n }\n }\n }\n let href = useHref(to, { relative });\n let [shouldPrefetch, prefetchRef, prefetchHandlers] = usePrefetchBehavior(\n prefetch,\n rest\n );\n let internalOnClick = useLinkClickHandler(to, {\n replace: replace2,\n state,\n target,\n preventScrollReset,\n relative,\n viewTransition\n });\n function handleClick(event) {\n if (onClick) onClick(event);\n if (!event.defaultPrevented) {\n internalOnClick(event);\n }\n }\n let link = (\n // eslint-disable-next-line jsx-a11y/anchor-has-content\n /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n \"a\",\n {\n ...rest,\n ...prefetchHandlers,\n href: absoluteHref || href,\n onClick: isExternal || reloadDocument ? onClick : handleClick,\n ref: mergeRefs(forwardedRef, prefetchRef),\n target,\n \"data-discover\": !isAbsolute && discover === \"render\" ? \"true\" : void 0\n }\n )\n );\n return shouldPrefetch && !isAbsolute ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, link, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(PrefetchPageLinks, { page: href })) : link;\n }\n);\nLink.displayName = \"Link\";\nvar NavLink = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(\n function NavLinkWithRef({\n \"aria-current\": ariaCurrentProp = \"page\",\n caseSensitive = false,\n className: classNameProp = \"\",\n end = false,\n style: styleProp,\n to,\n viewTransition,\n children,\n ...rest\n }, ref) {\n let path = useResolvedPath(to, { relative: rest.relative });\n let location = useLocation();\n let routerState = react__WEBPACK_IMPORTED_MODULE_0__.useContext(DataRouterStateContext);\n let { navigator: navigator2, basename } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(NavigationContext);\n let isTransitioning = routerState != null && // 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 useViewTransitionState(path) && viewTransition === true;\n let toPathname = navigator2.encodeLocation ? navigator2.encodeLocation(path).pathname : path.pathname;\n let locationPathname = location.pathname;\n let nextLocationPathname = routerState && routerState.navigation && routerState.navigation.location ? routerState.navigation.location.pathname : null;\n if (!caseSensitive) {\n locationPathname = locationPathname.toLowerCase();\n nextLocationPathname = nextLocationPathname ? nextLocationPathname.toLowerCase() : null;\n toPathname = toPathname.toLowerCase();\n }\n if (nextLocationPathname && basename) {\n nextLocationPathname = stripBasename(nextLocationPathname, basename) || nextLocationPathname;\n }\n const endSlashPosition = toPathname !== \"/\" && toPathname.endsWith(\"/\") ? toPathname.length - 1 : toPathname.length;\n let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(endSlashPosition) === \"/\";\n let isPending = nextLocationPathname != null && (nextLocationPathname === toPathname || !end && nextLocationPathname.startsWith(toPathname) && nextLocationPathname.charAt(toPathname.length) === \"/\");\n let renderProps = {\n isActive,\n isPending,\n isTransitioning\n };\n let ariaCurrent = isActive ? ariaCurrentProp : void 0;\n let className;\n if (typeof classNameProp === \"function\") {\n className = classNameProp(renderProps);\n } else {\n className = [\n classNameProp,\n isActive ? \"active\" : null,\n isPending ? \"pending\" : null,\n isTransitioning ? \"transitioning\" : null\n ].filter(Boolean).join(\" \");\n }\n let style = typeof styleProp === \"function\" ? styleProp(renderProps) : styleProp;\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n Link,\n {\n ...rest,\n \"aria-current\": ariaCurrent,\n className,\n ref,\n style,\n to,\n viewTransition\n },\n typeof children === \"function\" ? children(renderProps) : children\n );\n }\n);\nNavLink.displayName = \"NavLink\";\nvar Form = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(\n ({\n discover = \"render\",\n fetcherKey,\n navigate,\n reloadDocument,\n replace: replace2,\n state,\n method = defaultMethod,\n action,\n onSubmit,\n relative,\n preventScrollReset,\n viewTransition,\n ...props\n }, forwardedRef) => {\n let submit = useSubmit();\n let formAction = useFormAction(action, { relative });\n let formMethod = method.toLowerCase() === \"get\" ? \"get\" : \"post\";\n let isAbsolute = typeof action === \"string\" && ABSOLUTE_URL_REGEX2.test(action);\n let submitHandler = (event) => {\n onSubmit && onSubmit(event);\n if (event.defaultPrevented) return;\n event.preventDefault();\n let submitter = event.nativeEvent.submitter;\n let submitMethod = submitter?.getAttribute(\"formmethod\") || method;\n submit(submitter || event.currentTarget, {\n fetcherKey,\n method: submitMethod,\n navigate,\n replace: replace2,\n state,\n relative,\n preventScrollReset,\n viewTransition\n });\n };\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n \"form\",\n {\n ref: forwardedRef,\n method: formMethod,\n action: formAction,\n onSubmit: reloadDocument ? onSubmit : submitHandler,\n ...props,\n \"data-discover\": !isAbsolute && discover === \"render\" ? \"true\" : void 0\n }\n );\n }\n);\nForm.displayName = \"Form\";\nfunction ScrollRestoration({\n getKey,\n storageKey,\n ...props\n}) {\n let remixContext = react__WEBPACK_IMPORTED_MODULE_0__.useContext(FrameworkContext);\n let { basename } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(NavigationContext);\n let location = useLocation();\n let matches = useMatches();\n useScrollRestoration({ getKey, storageKey });\n let ssrKey = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(\n () => {\n if (!remixContext || !getKey) return null;\n let userKey = getScrollRestorationKey(\n location,\n matches,\n basename,\n getKey\n );\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 );\n if (!remixContext || remixContext.isSpaMode) {\n return null;\n }\n let restoreScroll = ((storageKey2, restoreKey) => {\n if (!window.history.state || !window.history.state.key) {\n let key = Math.random().toString(32).slice(2);\n window.history.replaceState({ key }, \"\");\n }\n try {\n let positions = JSON.parse(sessionStorage.getItem(storageKey2) || \"{}\");\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(storageKey2);\n }\n }).toString();\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n \"script\",\n {\n ...props,\n suppressHydrationWarning: true,\n dangerouslySetInnerHTML: {\n __html: `(${restoreScroll})(${JSON.stringify(\n storageKey || SCROLL_RESTORATION_STORAGE_KEY\n )}, ${JSON.stringify(ssrKey)})`\n }\n }\n );\n}\nScrollRestoration.displayName = \"ScrollRestoration\";\nfunction getDataRouterConsoleError2(hookName) {\n return `${hookName} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;\n}\nfunction useDataRouterContext3(hookName) {\n let ctx = react__WEBPACK_IMPORTED_MODULE_0__.useContext(DataRouterContext);\n invariant(ctx, getDataRouterConsoleError2(hookName));\n return ctx;\n}\nfunction useDataRouterState2(hookName) {\n let state = react__WEBPACK_IMPORTED_MODULE_0__.useContext(DataRouterStateContext);\n invariant(state, getDataRouterConsoleError2(hookName));\n return state;\n}\nfunction useLinkClickHandler(to, {\n target,\n replace: replaceProp,\n state,\n preventScrollReset,\n relative,\n viewTransition\n} = {}) {\n let navigate = useNavigate();\n let location = useLocation();\n let path = useResolvedPath(to, { relative });\n return react__WEBPACK_IMPORTED_MODULE_0__.useCallback(\n (event) => {\n if (shouldProcessLinkClick(event, target)) {\n event.preventDefault();\n let replace2 = replaceProp !== void 0 ? replaceProp : createPath(location) === createPath(path);\n navigate(to, {\n replace: replace2,\n state,\n preventScrollReset,\n relative,\n viewTransition\n });\n }\n },\n [\n location,\n navigate,\n path,\n replaceProp,\n state,\n target,\n to,\n preventScrollReset,\n relative,\n viewTransition\n ]\n );\n}\nfunction useSearchParams(defaultInit) {\n warning(\n typeof URLSearchParams !== \"undefined\",\n `You cannot use the \\`useSearchParams\\` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.`\n );\n let defaultSearchParamsRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(createSearchParams(defaultInit));\n let hasSetSearchParamsRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(false);\n let location = useLocation();\n let searchParams = react__WEBPACK_IMPORTED_MODULE_0__.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 ),\n [location.search]\n );\n let navigate = useNavigate();\n let setSearchParams = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(\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 return [searchParams, setSearchParams];\n}\nvar fetcherId = 0;\nvar getUniqueFetcherId = () => `__${String(++fetcherId)}__`;\nfunction useSubmit() {\n let { router } = useDataRouterContext3(\"useSubmit\" /* UseSubmit */);\n let { basename } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(NavigationContext);\n let currentRouteId = useRouteId();\n return react__WEBPACK_IMPORTED_MODULE_0__.useCallback(\n async (target, options = {}) => {\n let { action, method, encType, formData, body } = getFormSubmissionInfo(\n target,\n basename\n );\n if (options.navigate === false) {\n let key = options.fetcherKey || getUniqueFetcherId();\n await router.fetch(key, currentRouteId, options.action || action, {\n preventScrollReset: options.preventScrollReset,\n formData,\n body,\n formMethod: options.method || method,\n formEncType: options.encType || encType,\n flushSync: options.flushSync\n });\n } else {\n await router.navigate(options.action || action, {\n preventScrollReset: options.preventScrollReset,\n formData,\n body,\n formMethod: options.method || method,\n formEncType: options.encType || encType,\n replace: options.replace,\n state: options.state,\n fromRouteId: currentRouteId,\n flushSync: options.flushSync,\n viewTransition: options.viewTransition\n });\n }\n },\n [router, basename, currentRouteId]\n );\n}\nfunction useFormAction(action, { relative } = {}) {\n let { basename } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(NavigationContext);\n let routeContext = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteContext);\n invariant(routeContext, \"useFormAction must be used inside a RouteContext\");\n let [match] = routeContext.matches.slice(-1);\n let path = { ...useResolvedPath(action ? action : \".\", { relative }) };\n let location = useLocation();\n if (action == null) {\n path.search = location.search;\n let params = new URLSearchParams(path.search);\n let indexValues = params.getAll(\"index\");\n let hasNakedIndexParam = indexValues.some((v) => v === \"\");\n if (hasNakedIndexParam) {\n params.delete(\"index\");\n indexValues.filter((v) => v).forEach((v) => params.append(\"index\", v));\n let qs = params.toString();\n path.search = qs ? `?${qs}` : \"\";\n }\n }\n if ((!action || action === \".\") && match.route.index) {\n path.search = path.search ? path.search.replace(/^\\?/, \"?index&\") : \"?index\";\n }\n if (basename !== \"/\") {\n path.pathname = path.pathname === \"/\" ? basename : joinPaths([basename, path.pathname]);\n }\n return createPath(path);\n}\nfunction useFetcher({\n key\n} = {}) {\n let { router } = useDataRouterContext3(\"useFetcher\" /* UseFetcher */);\n let state = useDataRouterState2(\"useFetcher\" /* UseFetcher */);\n let fetcherData = react__WEBPACK_IMPORTED_MODULE_0__.useContext(FetchersContext);\n let route = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteContext);\n let routeId = route.matches[route.matches.length - 1]?.route.id;\n invariant(fetcherData, `useFetcher must be used inside a FetchersContext`);\n invariant(route, `useFetcher must be used inside a RouteContext`);\n invariant(\n routeId != null,\n `useFetcher can only be used on routes that contain a unique \"id\"`\n );\n let defaultKey = react__WEBPACK_IMPORTED_MODULE_0__.useId();\n let [fetcherKey, setFetcherKey] = react__WEBPACK_IMPORTED_MODULE_0__.useState(key || defaultKey);\n if (key && key !== fetcherKey) {\n setFetcherKey(key);\n }\n react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {\n router.getFetcher(fetcherKey);\n return () => router.deleteFetcher(fetcherKey);\n }, [router, fetcherKey]);\n let load = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(\n async (href, opts) => {\n invariant(routeId, \"No routeId available for fetcher.load()\");\n await router.fetch(fetcherKey, routeId, href, opts);\n },\n [fetcherKey, routeId, router]\n );\n let submitImpl = useSubmit();\n let submit = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(\n async (target, opts) => {\n await submitImpl(target, {\n ...opts,\n navigate: false,\n fetcherKey\n });\n },\n [fetcherKey, submitImpl]\n );\n let FetcherForm = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => {\n let FetcherForm2 = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(\n (props, ref) => {\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Form, { ...props, navigate: false, fetcherKey, ref });\n }\n );\n FetcherForm2.displayName = \"fetcher.Form\";\n return FetcherForm2;\n }, [fetcherKey]);\n let fetcher = state.fetchers.get(fetcherKey) || IDLE_FETCHER;\n let data2 = fetcherData.get(fetcherKey);\n let fetcherWithComponents = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(\n () => ({\n Form: FetcherForm,\n submit,\n load,\n ...fetcher,\n data: data2\n }),\n [FetcherForm, submit, load, fetcher, data2]\n );\n return fetcherWithComponents;\n}\nfunction useFetchers() {\n let state = useDataRouterState2(\"useFetchers\" /* UseFetchers */);\n return Array.from(state.fetchers.entries()).map(([key, fetcher]) => ({\n ...fetcher,\n key\n }));\n}\nvar SCROLL_RESTORATION_STORAGE_KEY = \"react-router-scroll-positions\";\nvar savedScrollPositions = {};\nfunction getScrollRestorationKey(location, matches, basename, getKey) {\n let key = null;\n if (getKey) {\n if (basename !== \"/\") {\n key = getKey(\n {\n ...location,\n pathname: stripBasename(location.pathname, basename) || location.pathname\n },\n matches\n );\n } else {\n key = getKey(location, matches);\n }\n }\n if (key == null) {\n key = location.key;\n }\n return key;\n}\nfunction useScrollRestoration({\n getKey,\n storageKey\n} = {}) {\n let { router } = useDataRouterContext3(\"useScrollRestoration\" /* UseScrollRestoration */);\n let { restoreScrollPosition, preventScrollReset } = useDataRouterState2(\n \"useScrollRestoration\" /* UseScrollRestoration */\n );\n let { basename } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(NavigationContext);\n let location = useLocation();\n let matches = useMatches();\n let navigation = useNavigation();\n react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {\n window.history.scrollRestoration = \"manual\";\n return () => {\n window.history.scrollRestoration = \"auto\";\n };\n }, []);\n usePageHide(\n react__WEBPACK_IMPORTED_MODULE_0__.useCallback(() => {\n if (navigation.state === \"idle\") {\n let key = getScrollRestorationKey(location, matches, basename, getKey);\n savedScrollPositions[key] = window.scrollY;\n }\n try {\n sessionStorage.setItem(\n storageKey || SCROLL_RESTORATION_STORAGE_KEY,\n JSON.stringify(savedScrollPositions)\n );\n } catch (error) {\n warning(\n false,\n `Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${error}).`\n );\n }\n window.history.scrollRestoration = \"auto\";\n }, [navigation.state, getKey, basename, location, matches, storageKey])\n );\n if (typeof document !== \"undefined\") {\n react__WEBPACK_IMPORTED_MODULE_0__.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 }\n }, [storageKey]);\n react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect(() => {\n let disableScrollRestoration = router?.enableScrollRestoration(\n savedScrollPositions,\n () => window.scrollY,\n getKey ? (location2, matches2) => getScrollRestorationKey(location2, matches2, basename, getKey) : void 0\n );\n return () => disableScrollRestoration && disableScrollRestoration();\n }, [router, basename, getKey]);\n react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect(() => {\n if (restoreScrollPosition === false) {\n return;\n }\n if (typeof restoreScrollPosition === \"number\") {\n window.scrollTo(0, restoreScrollPosition);\n return;\n }\n if (location.hash) {\n let el = document.getElementById(\n decodeURIComponent(location.hash.slice(1))\n );\n if (el) {\n el.scrollIntoView();\n return;\n }\n }\n if (preventScrollReset === true) {\n return;\n }\n window.scrollTo(0, 0);\n }, [location, restoreScrollPosition, preventScrollReset]);\n }\n}\nfunction useBeforeUnload(callback, options) {\n let { capture } = options || {};\n react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {\n let opts = capture != null ? { capture } : void 0;\n window.addEventListener(\"beforeunload\", callback, opts);\n return () => {\n window.removeEventListener(\"beforeunload\", callback, opts);\n };\n }, [callback, capture]);\n}\nfunction usePageHide(callback, options) {\n let { capture } = options || {};\n react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {\n let opts = capture != null ? { capture } : void 0;\n window.addEventListener(\"pagehide\", callback, opts);\n return () => {\n window.removeEventListener(\"pagehide\", callback, opts);\n };\n }, [callback, capture]);\n}\nfunction usePrompt({\n when,\n message\n}) {\n let blocker = useBlocker(when);\n react__WEBPACK_IMPORTED_MODULE_0__.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 react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {\n if (blocker.state === \"blocked\" && !when) {\n blocker.reset();\n }\n }, [blocker, when]);\n}\nfunction useViewTransitionState(to, opts = {}) {\n let vtContext = react__WEBPACK_IMPORTED_MODULE_0__.useContext(ViewTransitionContext);\n invariant(\n vtContext != null,\n \"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?\"\n );\n let { basename } = useDataRouterContext3(\n \"useViewTransitionState\" /* useViewTransitionState */\n );\n let path = useResolvedPath(to, { relative: opts.relative });\n if (!vtContext.isTransitioning) {\n return false;\n }\n let currentPath = stripBasename(vtContext.currentLocation.pathname, basename) || vtContext.currentLocation.pathname;\n let nextPath = stripBasename(vtContext.nextLocation.pathname, basename) || vtContext.nextLocation.pathname;\n return matchPath(path.pathname, nextPath) != null || matchPath(path.pathname, currentPath) != null;\n}\n\n// lib/dom/server.tsx\n\nfunction StaticRouter({\n basename,\n children,\n location: locationProp = \"/\"\n}) {\n if (typeof locationProp === \"string\") {\n locationProp = parsePath(locationProp);\n }\n let action = \"POP\" /* Pop */;\n let location = {\n pathname: locationProp.pathname || \"/\",\n search: locationProp.search || \"\",\n hash: locationProp.hash || \"\",\n state: locationProp.state != null ? locationProp.state : null,\n key: locationProp.key || \"default\"\n };\n let staticNavigator = getStatelessNavigator();\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n Router,\n {\n basename,\n children,\n location,\n navigationType: action,\n navigator: staticNavigator,\n static: true\n }\n );\n}\nfunction StaticRouterProvider({\n context,\n router,\n hydrate = true,\n nonce\n}) {\n invariant(\n router && context,\n \"You must provide `router` and `context` to <StaticRouterProvider>\"\n );\n let dataRouterContext = {\n router,\n navigator: getStatelessNavigator(),\n static: true,\n staticContext: context,\n basename: context.basename || \"/\"\n };\n let fetchersContext = /* @__PURE__ */ new Map();\n let hydrateScript = \"\";\n if (hydrate !== false) {\n let data2 = {\n loaderData: context.loaderData,\n actionData: context.actionData,\n errors: serializeErrors(context.errors)\n };\n let json = htmlEscape(JSON.stringify(JSON.stringify(data2)));\n hydrateScript = `window.__staticRouterHydrationData = JSON.parse(${json});`;\n }\n let { state } = dataRouterContext.router;\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(DataRouterContext.Provider, { value: dataRouterContext }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(DataRouterStateContext.Provider, { value: state }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(FetchersContext.Provider, { value: fetchersContext }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(ViewTransitionContext.Provider, { value: { isTransitioning: false } }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n Router,\n {\n basename: dataRouterContext.basename,\n location: state.location,\n navigationType: state.historyAction,\n navigator: dataRouterContext.navigator,\n static: dataRouterContext.static\n },\n /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n DataRoutes2,\n {\n routes: router.routes,\n future: router.future,\n state\n }\n )\n ))))), hydrateScript ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n \"script\",\n {\n suppressHydrationWarning: true,\n nonce,\n dangerouslySetInnerHTML: { __html: hydrateScript }\n }\n ) : null);\n}\nfunction DataRoutes2({\n routes,\n future,\n state\n}) {\n return useRoutesImpl(routes, void 0, state, future);\n}\nfunction serializeErrors(errors) {\n if (!errors) return null;\n let entries = Object.entries(errors);\n let serialized = {};\n for (let [key, val] of entries) {\n if (isRouteErrorResponse(val)) {\n serialized[key] = { ...val, __type: \"RouteErrorResponse\" };\n } else if (val instanceof Error) {\n serialized[key] = {\n message: val.message,\n __type: \"Error\",\n // If this is a subclass (i.e., ReferenceError), send up the type so we\n // can re-create the same type during hydration.\n ...val.name !== \"Error\" ? {\n __subType: val.name\n } : {}\n };\n } else {\n serialized[key] = val;\n }\n }\n return serialized;\n}\nfunction getStatelessNavigator() {\n return {\n createHref,\n encodeLocation,\n push(to) {\n throw new Error(\n `You cannot use navigator.push() on the server because it is a stateless environment. This error was probably triggered when you did a \\`navigate(${JSON.stringify(to)})\\` somewhere in your app.`\n );\n },\n replace(to) {\n throw new Error(\n `You cannot use navigator.replace() on the server because it is a stateless environment. This error was probably triggered when you did a \\`navigate(${JSON.stringify(to)}, { replace: true })\\` somewhere in your app.`\n );\n },\n go(delta) {\n throw new Error(\n `You cannot use navigator.go() on the server because it is a stateless environment. This error was probably triggered when you did a \\`navigate(${delta})\\` somewhere in your app.`\n );\n },\n back() {\n throw new Error(\n `You cannot use navigator.back() on the server because it is a stateless environment.`\n );\n },\n forward() {\n throw new Error(\n `You cannot use navigator.forward() on the server because it is a stateless environment.`\n );\n }\n };\n}\nfunction createStaticHandler2(routes, opts) {\n return createStaticHandler(routes, {\n ...opts,\n mapRouteProperties\n });\n}\nfunction createStaticRouter(routes, context, opts = {}) {\n let manifest = {};\n let dataRoutes = convertRoutesToDataRoutes(\n routes,\n mapRouteProperties,\n void 0,\n manifest\n );\n let matches = context.matches.map((match) => {\n let route = manifest[match.route.id] || match.route;\n return {\n ...match,\n route\n };\n });\n let msg = (method) => `You cannot use router.${method}() on the server because it is a stateless environment`;\n return {\n get basename() {\n return context.basename;\n },\n get future() {\n return {\n ...opts?.future\n };\n },\n get state() {\n return {\n historyAction: \"POP\" /* Pop */,\n location: context.location,\n matches,\n loaderData: context.loaderData,\n actionData: context.actionData,\n errors: context.errors,\n initialized: true,\n navigation: IDLE_NAVIGATION,\n restoreScrollPosition: null,\n preventScrollReset: false,\n revalidation: \"idle\",\n fetchers: /* @__PURE__ */ new Map(),\n blockers: /* @__PURE__ */ new Map()\n };\n },\n get routes() {\n return dataRoutes;\n },\n get window() {\n return void 0;\n },\n initialize() {\n throw msg(\"initialize\");\n },\n subscribe() {\n throw msg(\"subscribe\");\n },\n enableScrollRestoration() {\n throw msg(\"enableScrollRestoration\");\n },\n navigate() {\n throw msg(\"navigate\");\n },\n fetch() {\n throw msg(\"fetch\");\n },\n revalidate() {\n throw msg(\"revalidate\");\n },\n createHref,\n encodeLocation,\n getFetcher() {\n return IDLE_FETCHER;\n },\n deleteFetcher() {\n throw msg(\"deleteFetcher\");\n },\n dispose() {\n throw msg(\"dispose\");\n },\n getBlocker() {\n return IDLE_BLOCKER;\n },\n deleteBlocker() {\n throw msg(\"deleteBlocker\");\n },\n patchRoutes() {\n throw msg(\"patchRoutes\");\n },\n _internalFetchControllers: /* @__PURE__ */ new Map(),\n _internalSetRoutes() {\n throw msg(\"_internalSetRoutes\");\n }\n };\n}\nfunction createHref(to) {\n return typeof to === \"string\" ? to : createPath(to);\n}\nfunction encodeLocation(to) {\n let href = typeof to === \"string\" ? to : createPath(to);\n href = href.replace(/ $/, \"%20\");\n let encoded = ABSOLUTE_URL_REGEX3.test(href) ? new URL(href) : new URL(href, \"http://localhost\");\n return {\n pathname: encoded.pathname,\n search: encoded.search,\n hash: encoded.hash\n };\n}\nvar ABSOLUTE_URL_REGEX3 = /^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i;\nvar ESCAPE_LOOKUP2 = {\n \"&\": \"\\\\u0026\",\n \">\": \"\\\\u003e\",\n \"<\": \"\\\\u003c\",\n \"\\u2028\": \"\\\\u2028\",\n \"\\u2029\": \"\\\\u2029\"\n};\nvar ESCAPE_REGEX2 = /[&><\\u2028\\u2029]/g;\nfunction htmlEscape(str) {\n return str.replace(ESCAPE_REGEX2, (match) => ESCAPE_LOOKUP2[match]);\n}\n\n// lib/dom/ssr/server.tsx\n\nfunction ServerRouter({\n context,\n url,\n nonce\n}) {\n if (typeof url === \"string\") {\n url = new URL(url);\n }\n let { manifest, routeModules, criticalCss, serverHandoffString } = context;\n let routes = createServerRoutes(\n manifest.routes,\n routeModules,\n context.future,\n context.isSpaMode\n );\n context.staticHandlerContext.loaderData = {\n ...context.staticHandlerContext.loaderData\n };\n for (let match of context.staticHandlerContext.matches) {\n let routeId = match.route.id;\n let route = routeModules[routeId];\n let manifestRoute = context.manifest.routes[routeId];\n if (route && manifestRoute && shouldHydrateRouteLoader(manifestRoute, route, context.isSpaMode) && (route.HydrateFallback || !manifestRoute.hasLoader)) {\n delete context.staticHandlerContext.loaderData[routeId];\n }\n }\n let router = createStaticRouter(routes, context.staticHandlerContext);\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n FrameworkContext.Provider,\n {\n value: {\n manifest,\n routeModules,\n criticalCss,\n serverHandoffString,\n future: context.future,\n isSpaMode: context.isSpaMode,\n serializeError: context.serializeError,\n renderMeta: context.renderMeta\n }\n },\n /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RemixErrorBoundary, { location: router.state.location }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n StaticRouterProvider,\n {\n router,\n context: context.staticHandlerContext,\n hydrate: false\n }\n ))\n ), context.serverHandoffStream ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Suspense, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(\n StreamTransfer,\n {\n context,\n identifier: 0,\n reader: context.serverHandoffStream.getReader(),\n textDecoder: new TextDecoder(),\n nonce\n }\n )) : null);\n}\n\n// lib/dom/ssr/routes-test-stub.tsx\n\nfunction createRoutesStub(routes, context = {}) {\n return function RoutesTestStub({\n initialEntries,\n initialIndex,\n hydrationData,\n future\n }) {\n let routerRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef();\n let remixContextRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef();\n if (routerRef.current == null) {\n remixContextRef.current = {\n future: {},\n manifest: {\n routes: {},\n entry: { imports: [], module: \"\" },\n url: \"\",\n version: \"\"\n },\n routeModules: {},\n isSpaMode: false\n };\n let patched = processRoutes(\n // @ts-expect-error loader/action context types don't match :/\n convertRoutesToDataRoutes(routes, (r) => r),\n context,\n remixContextRef.current.manifest,\n remixContextRef.current.routeModules\n );\n routerRef.current = createMemoryRouter(patched, {\n initialEntries,\n initialIndex,\n hydrationData\n });\n }\n return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(FrameworkContext.Provider, { value: remixContextRef.current }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RouterProvider, { router: routerRef.current }));\n };\n}\nfunction processRoutes(routes, context, manifest, routeModules, parentId) {\n return routes.map((route) => {\n if (!route.id) {\n throw new Error(\n \"Expected a route.id in @remix-run/testing processRoutes() function\"\n );\n }\n let { loader, action } = route;\n let newRoute = {\n id: route.id,\n path: route.path,\n index: route.index,\n Component: route.Component,\n HydrateFallback: route.HydrateFallback,\n ErrorBoundary: route.ErrorBoundary,\n action: action ? (args) => action({ ...args, context }) : void 0,\n loader: loader ? (args) => loader({ ...args, context }) : void 0,\n handle: route.handle,\n shouldRevalidate: route.shouldRevalidate\n };\n let entryRoute = {\n id: route.id,\n path: route.path,\n index: route.index,\n parentId,\n hasAction: route.action != null,\n hasLoader: route.loader != null,\n // When testing routes, you should just be stubbing loader/action, not\n // trying to re-implement the full loader/clientLoader/SSR/hydration flow.\n // That is better tested via E2E tests.\n hasClientAction: false,\n hasClientLoader: false,\n hasErrorBoundary: route.ErrorBoundary != null,\n module: \"build/stub-path-to-module.js\"\n // any need for this?\n };\n manifest.routes[newRoute.id] = entryRoute;\n routeModules[route.id] = {\n default: route.Component || Outlet,\n ErrorBoundary: route.ErrorBoundary || void 0,\n handle: route.handle,\n links: route.links,\n meta: route.meta,\n shouldRevalidate: route.shouldRevalidate\n };\n if (route.children) {\n newRoute.children = processRoutes(\n route.children,\n context,\n manifest,\n routeModules,\n newRoute.id\n );\n }\n return newRoute;\n });\n}\n\n// lib/server-runtime/cookies.ts\n\n\n// lib/server-runtime/crypto.ts\nvar encoder = new TextEncoder();\nvar sign = async (value, secret) => {\n let data2 = encoder.encode(value);\n let key = await createKey2(secret, [\"sign\"]);\n let signature = await crypto.subtle.sign(\"HMAC\", key, data2);\n let hash = btoa(String.fromCharCode(...new Uint8Array(signature))).replace(\n /=+$/,\n \"\"\n );\n return value + \".\" + hash;\n};\nvar unsign = async (cookie, secret) => {\n let index = cookie.lastIndexOf(\".\");\n let value = cookie.slice(0, index);\n let hash = cookie.slice(index + 1);\n let data2 = encoder.encode(value);\n let key = await createKey2(secret, [\"verify\"]);\n let signature = byteStringToUint8Array(atob(hash));\n let valid = await crypto.subtle.verify(\"HMAC\", key, signature, data2);\n return valid ? value : false;\n};\nvar createKey2 = async (secret, usages) => crypto.subtle.importKey(\n \"raw\",\n encoder.encode(secret),\n { name: \"HMAC\", hash: \"SHA-256\" },\n false,\n usages\n);\nfunction byteStringToUint8Array(byteString) {\n let array = new Uint8Array(byteString.length);\n for (let i = 0; i < byteString.length; i++) {\n array[i] = byteString.charCodeAt(i);\n }\n return array;\n}\n\n// lib/server-runtime/cookies.ts\nvar createCookie = (name, cookieOptions = {}) => {\n let { secrets = [], ...options } = {\n path: \"/\",\n sameSite: \"lax\",\n ...cookieOptions\n };\n warnOnceAboutExpiresCookie(name, options.expires);\n return {\n get name() {\n return name;\n },\n get isSigned() {\n return secrets.length > 0;\n },\n get expires() {\n return typeof options.maxAge !== \"undefined\" ? new Date(Date.now() + options.maxAge * 1e3) : options.expires;\n },\n async parse(cookieHeader, parseOptions) {\n if (!cookieHeader) return null;\n let cookies = (0,cookie__WEBPACK_IMPORTED_MODULE_2__.parse)(cookieHeader, { ...options, ...parseOptions });\n if (name in cookies) {\n let value = cookies[name];\n if (typeof value === \"string\" && value !== \"\") {\n let decoded = await decodeCookieValue(value, secrets);\n return decoded;\n } else {\n return \"\";\n }\n } else {\n return null;\n }\n },\n async serialize(value, serializeOptions) {\n return (0,cookie__WEBPACK_IMPORTED_MODULE_2__.serialize)(\n name,\n value === \"\" ? \"\" : await encodeCookieValue(value, secrets),\n {\n ...options,\n ...serializeOptions\n }\n );\n }\n };\n};\nvar isCookie = (object) => {\n return object != null && typeof object.name === \"string\" && typeof object.isSigned === \"boolean\" && typeof object.parse === \"function\" && typeof object.serialize === \"function\";\n};\nasync function encodeCookieValue(value, secrets) {\n let encoded = encodeData(value);\n if (secrets.length > 0) {\n encoded = await sign(encoded, secrets[0]);\n }\n return encoded;\n}\nasync function decodeCookieValue(value, secrets) {\n if (secrets.length > 0) {\n for (let secret of secrets) {\n let unsignedValue = await unsign(value, secret);\n if (unsignedValue !== false) {\n return decodeData(unsignedValue);\n }\n }\n return null;\n }\n return decodeData(value);\n}\nfunction encodeData(value) {\n return btoa(myUnescape(encodeURIComponent(JSON.stringify(value))));\n}\nfunction decodeData(value) {\n try {\n return JSON.parse(decodeURIComponent(myEscape(atob(value))));\n } catch (error) {\n return {};\n }\n}\nfunction myEscape(value) {\n let str = value.toString();\n let result = \"\";\n let index = 0;\n let chr, code;\n while (index < str.length) {\n chr = str.charAt(index++);\n if (/[\\w*+\\-./@]/.exec(chr)) {\n result += chr;\n } else {\n code = chr.charCodeAt(0);\n if (code < 256) {\n result += \"%\" + hex(code, 2);\n } else {\n result += \"%u\" + hex(code, 4).toUpperCase();\n }\n }\n }\n return result;\n}\nfunction hex(code, length) {\n let result = code.toString(16);\n while (result.length < length) result = \"0\" + result;\n return result;\n}\nfunction myUnescape(value) {\n let str = value.toString();\n let result = \"\";\n let index = 0;\n let chr, part;\n while (index < str.length) {\n chr = str.charAt(index++);\n if (chr === \"%\") {\n if (str.charAt(index) === \"u\") {\n part = str.slice(index + 1, index + 5);\n if (/^[\\da-f]{4}$/i.exec(part)) {\n result += String.fromCharCode(parseInt(part, 16));\n index += 5;\n continue;\n }\n } else {\n part = str.slice(index, index + 2);\n if (/^[\\da-f]{2}$/i.exec(part)) {\n result += String.fromCharCode(parseInt(part, 16));\n index += 2;\n continue;\n }\n }\n }\n result += chr;\n }\n return result;\n}\nfunction warnOnceAboutExpiresCookie(name, expires) {\n warnOnce(\n !expires,\n `The \"${name}\" cookie has an \"expires\" property set. This will cause the expires value to not be updated when the session is committed. Instead, you should set the expires value when serializing the cookie. You can use \\`commitSession(session, { expires })\\` if using a session storage object, or \\`cookie.serialize(\"value\", { expires })\\` if you're using the cookie directly.`\n );\n}\n\n// lib/server-runtime/entry.ts\nfunction createEntryRouteModules(manifest) {\n return Object.keys(manifest).reduce((memo2, routeId) => {\n let route = manifest[routeId];\n if (route) {\n memo2[routeId] = route.module;\n }\n return memo2;\n }, {});\n}\n\n// lib/server-runtime/mode.ts\nvar ServerMode = /* @__PURE__ */ ((ServerMode2) => {\n ServerMode2[\"Development\"] = \"development\";\n ServerMode2[\"Production\"] = \"production\";\n ServerMode2[\"Test\"] = \"test\";\n return ServerMode2;\n})(ServerMode || {});\nfunction isServerMode(value) {\n return value === \"development\" /* Development */ || value === \"production\" /* Production */ || value === \"test\" /* Test */;\n}\n\n// lib/server-runtime/errors.ts\nfunction sanitizeError(error, serverMode) {\n if (error instanceof Error && serverMode !== \"development\" /* Development */) {\n let sanitized = new Error(\"Unexpected Server Error\");\n sanitized.stack = void 0;\n return sanitized;\n }\n return error;\n}\nfunction sanitizeErrors(errors, serverMode) {\n return Object.entries(errors).reduce((acc, [routeId, error]) => {\n return Object.assign(acc, { [routeId]: sanitizeError(error, serverMode) });\n }, {});\n}\nfunction serializeError(error, serverMode) {\n let sanitized = sanitizeError(error, serverMode);\n return {\n message: sanitized.message,\n stack: sanitized.stack\n };\n}\nfunction serializeErrors2(errors, serverMode) {\n if (!errors) return null;\n let entries = Object.entries(errors);\n let serialized = {};\n for (let [key, val] of entries) {\n if (isRouteErrorResponse(val)) {\n serialized[key] = { ...val, __type: \"RouteErrorResponse\" };\n } else if (val instanceof Error) {\n let sanitized = sanitizeError(val, serverMode);\n serialized[key] = {\n message: sanitized.message,\n stack: sanitized.stack,\n __type: \"Error\",\n // If this is a subclass (i.e., ReferenceError), send up the type so we\n // can re-create the same type during hydration. This will only apply\n // in dev mode since all production errors are sanitized to normal\n // Error instances\n ...sanitized.name !== \"Error\" ? {\n __subType: sanitized.name\n } : {}\n };\n } else {\n serialized[key] = val;\n }\n }\n return serialized;\n}\n\n// lib/server-runtime/routeMatching.ts\nfunction matchServerRoutes(routes, pathname, basename) {\n let matches = matchRoutes(\n routes,\n pathname,\n basename\n );\n if (!matches) return null;\n return matches.map((match) => ({\n params: match.params,\n pathname: match.pathname,\n route: match.route\n }));\n}\n\n// lib/server-runtime/data.ts\nasync function callRouteHandler(handler, args) {\n let result = await handler({\n request: stripRoutesParam(stripIndexParam2(args.request)),\n params: args.params,\n context: args.context\n });\n if (isDataWithResponseInit(result) && result.init && result.init.status && isRedirectStatusCode(result.init.status)) {\n throw new Response(null, result.init);\n }\n return result;\n}\nfunction stripIndexParam2(request) {\n let url = new URL(request.url);\n let indexValues = url.searchParams.getAll(\"index\");\n url.searchParams.delete(\"index\");\n let indexValuesToKeep = [];\n for (let indexValue of indexValues) {\n if (indexValue) {\n indexValuesToKeep.push(indexValue);\n }\n }\n for (let toKeep of indexValuesToKeep) {\n url.searchParams.append(\"index\", toKeep);\n }\n let init = {\n method: request.method,\n body: request.body,\n headers: request.headers,\n signal: request.signal\n };\n if (init.body) {\n init.duplex = \"half\";\n }\n return new Request(url.href, init);\n}\nfunction stripRoutesParam(request) {\n let url = new URL(request.url);\n url.searchParams.delete(\"_routes\");\n let init = {\n method: request.method,\n body: request.body,\n headers: request.headers,\n signal: request.signal\n };\n if (init.body) {\n init.duplex = \"half\";\n }\n return new Request(url.href, init);\n}\n\n// lib/server-runtime/invariant.ts\nfunction invariant3(value, message) {\n if (value === false || value === null || typeof value === \"undefined\") {\n console.error(\n \"The following error is a bug in React Router; please open an issue! https://github.com/remix-run/react-router/issues/new/choose\"\n );\n throw new Error(message);\n }\n}\n\n// lib/server-runtime/routes.ts\nfunction groupRoutesByParentId2(manifest) {\n let routes = {};\n Object.values(manifest).forEach((route) => {\n if (route) {\n let parentId = route.parentId || \"\";\n if (!routes[parentId]) {\n routes[parentId] = [];\n }\n routes[parentId].push(route);\n }\n });\n return routes;\n}\nfunction createRoutes(manifest, parentId = \"\", routesByParentId = groupRoutesByParentId2(manifest)) {\n return (routesByParentId[parentId] || []).map((route) => ({\n ...route,\n children: createRoutes(manifest, route.id, routesByParentId)\n }));\n}\nfunction createStaticHandlerDataRoutes(manifest, future, parentId = \"\", routesByParentId = groupRoutesByParentId2(manifest)) {\n return (routesByParentId[parentId] || []).map((route) => {\n let commonRoute = {\n // Always include root due to default boundaries\n hasErrorBoundary: route.id === \"root\" || route.module.ErrorBoundary != null,\n id: route.id,\n path: route.path,\n // Need to use RR's version in the param typed here to permit the optional\n // context even though we know it'll always be provided in remix\n loader: route.module.loader ? async (args) => {\n if (args.request.headers.has(\"X-React-Router-Prerender-Data\")) {\n const preRenderedData = args.request.headers.get(\n \"X-React-Router-Prerender-Data\"\n );\n let encoded = preRenderedData ? decodeURI(preRenderedData) : preRenderedData;\n invariant3(encoded, \"Missing prerendered data for route\");\n let uint8array = new TextEncoder().encode(encoded);\n let stream = new ReadableStream({\n start(controller) {\n controller.enqueue(uint8array);\n controller.close();\n }\n });\n let decoded = await decodeViaTurboStream(stream, global);\n let data2 = decoded.value;\n invariant3(\n data2 && route.id in data2,\n \"Unable to decode prerendered data\"\n );\n let result = data2[route.id];\n invariant3(\"data\" in result, \"Unable to process prerendered data\");\n return result.data;\n }\n let val = await callRouteHandler(route.module.loader, args);\n return val;\n } : void 0,\n action: route.module.action ? (args) => callRouteHandler(route.module.action, args) : void 0,\n handle: route.module.handle\n };\n return route.index ? {\n index: true,\n ...commonRoute\n } : {\n caseSensitive: route.caseSensitive,\n children: createStaticHandlerDataRoutes(\n manifest,\n future,\n route.id,\n routesByParentId\n ),\n ...commonRoute\n };\n });\n}\n\n// lib/server-runtime/markup.ts\nvar ESCAPE_LOOKUP3 = {\n \"&\": \"\\\\u0026\",\n \">\": \"\\\\u003e\",\n \"<\": \"\\\\u003c\",\n \"\\u2028\": \"\\\\u2028\",\n \"\\u2029\": \"\\\\u2029\"\n};\nvar ESCAPE_REGEX3 = /[&><\\u2028\\u2029]/g;\nfunction escapeHtml2(html) {\n return html.replace(ESCAPE_REGEX3, (match) => ESCAPE_LOOKUP3[match]);\n}\n\n// lib/server-runtime/serverHandoff.ts\nfunction createServerHandoffString(serverHandoff) {\n return escapeHtml2(JSON.stringify(serverHandoff));\n}\n\n// lib/server-runtime/dev.ts\nvar globalDevServerHooksKey = \"__reactRouterDevServerHooks\";\nfunction setDevServerHooks(devServerHooks) {\n globalThis[globalDevServerHooksKey] = devServerHooks;\n}\nfunction getDevServerHooks() {\n return globalThis[globalDevServerHooksKey];\n}\n\n// lib/server-runtime/single-fetch.ts\n\n\n// lib/server-runtime/headers.ts\n\nfunction getDocumentHeaders(build, context) {\n let boundaryIdx = context.errors ? context.matches.findIndex((m) => context.errors[m.route.id]) : -1;\n let matches = boundaryIdx >= 0 ? context.matches.slice(0, boundaryIdx + 1) : context.matches;\n let errorHeaders;\n if (boundaryIdx >= 0) {\n let { actionHeaders, actionData, loaderHeaders, loaderData } = context;\n context.matches.slice(boundaryIdx).some((match) => {\n let id = match.route.id;\n if (actionHeaders[id] && (!actionData || !actionData.hasOwnProperty(id))) {\n errorHeaders = actionHeaders[id];\n } else if (loaderHeaders[id] && !loaderData.hasOwnProperty(id)) {\n errorHeaders = loaderHeaders[id];\n }\n return errorHeaders != null;\n });\n }\n return matches.reduce((parentHeaders, match, idx) => {\n let { id } = match.route;\n let route = build.routes[id];\n invariant3(route, `Route with id \"${id}\" not found in build`);\n let routeModule = route.module;\n let loaderHeaders = context.loaderHeaders[id] || new Headers();\n let actionHeaders = context.actionHeaders[id] || new Headers();\n let includeErrorHeaders = errorHeaders != null && idx === matches.length - 1;\n let includeErrorCookies = includeErrorHeaders && errorHeaders !== loaderHeaders && errorHeaders !== actionHeaders;\n if (routeModule.headers == null) {\n let headers2 = new Headers(parentHeaders);\n if (includeErrorCookies) {\n prependCookies(errorHeaders, headers2);\n }\n prependCookies(actionHeaders, headers2);\n prependCookies(loaderHeaders, headers2);\n return headers2;\n }\n let headers = new Headers(\n routeModule.headers ? typeof routeModule.headers === \"function\" ? routeModule.headers({\n loaderHeaders,\n parentHeaders,\n actionHeaders,\n errorHeaders: includeErrorHeaders ? errorHeaders : void 0\n }) : routeModule.headers : void 0\n );\n if (includeErrorCookies) {\n prependCookies(errorHeaders, headers);\n }\n prependCookies(actionHeaders, headers);\n prependCookies(loaderHeaders, headers);\n prependCookies(parentHeaders, headers);\n return headers;\n }, new Headers());\n}\nfunction prependCookies(parentHeaders, childHeaders) {\n let parentSetCookieString = parentHeaders.get(\"Set-Cookie\");\n if (parentSetCookieString) {\n let cookies = (0,set_cookie_parser__WEBPACK_IMPORTED_MODULE_3__.splitCookiesString)(parentSetCookieString);\n cookies.forEach((cookie) => {\n childHeaders.append(\"Set-Cookie\", cookie);\n });\n }\n}\n\n// lib/server-runtime/single-fetch.ts\nvar SINGLE_FETCH_REDIRECT_STATUS = 202;\nfunction getSingleFetchDataStrategy2({\n isActionDataRequest,\n loadRouteIds\n} = {}) {\n return async ({ request, matches }) => {\n if (isActionDataRequest && request.method === \"GET\") {\n return {};\n }\n let matchesToLoad = loadRouteIds ? matches.filter((m) => loadRouteIds.includes(m.route.id)) : matches;\n let results = await Promise.all(\n matchesToLoad.map((match) => match.resolve())\n );\n return results.reduce(\n (acc, result, i) => Object.assign(acc, { [matchesToLoad[i].route.id]: result }),\n {}\n );\n };\n}\nasync function singleFetchAction(build, serverMode, staticHandler, request, handlerUrl, loadContext, handleError) {\n try {\n let handlerRequest = new Request(handlerUrl, {\n method: request.method,\n body: request.body,\n headers: request.headers,\n signal: request.signal,\n ...request.body ? { duplex: \"half\" } : void 0\n });\n let result = await staticHandler.query(handlerRequest, {\n requestContext: loadContext,\n skipLoaderErrorBubbling: true,\n dataStrategy: getSingleFetchDataStrategy2({\n isActionDataRequest: true\n })\n });\n if (isResponse(result)) {\n return {\n result: getSingleFetchRedirect(\n result.status,\n result.headers,\n build.basename\n ),\n headers: result.headers,\n status: SINGLE_FETCH_REDIRECT_STATUS\n };\n }\n let context = result;\n let headers = getDocumentHeaders(build, context);\n if (isRedirectStatusCode(context.statusCode) && headers.has(\"Location\")) {\n return {\n result: getSingleFetchRedirect(\n context.statusCode,\n headers,\n build.basename\n ),\n headers,\n status: SINGLE_FETCH_REDIRECT_STATUS\n };\n }\n if (context.errors) {\n Object.values(context.errors).forEach((err) => {\n if (!isRouteErrorResponse(err) || err.error) {\n handleError(err);\n }\n });\n context.errors = sanitizeErrors(context.errors, serverMode);\n }\n let singleFetchResult;\n if (context.errors) {\n singleFetchResult = { error: Object.values(context.errors)[0] };\n } else {\n singleFetchResult = { data: Object.values(context.actionData || {})[0] };\n }\n return {\n result: singleFetchResult,\n headers,\n status: context.statusCode\n };\n } catch (error) {\n handleError(error);\n return {\n result: { error },\n headers: new Headers(),\n status: 500\n };\n }\n}\nasync function singleFetchLoaders(build, serverMode, staticHandler, request, handlerUrl, loadContext, handleError) {\n try {\n let handlerRequest = new Request(handlerUrl, {\n headers: request.headers,\n signal: request.signal\n });\n let loadRouteIds = new URL(request.url).searchParams.get(\"_routes\")?.split(\",\") || void 0;\n let result = await staticHandler.query(handlerRequest, {\n requestContext: loadContext,\n skipLoaderErrorBubbling: true,\n dataStrategy: getSingleFetchDataStrategy2({\n loadRouteIds\n })\n });\n if (isResponse(result)) {\n return {\n result: {\n [SingleFetchRedirectSymbol]: getSingleFetchRedirect(\n result.status,\n result.headers,\n build.basename\n )\n },\n headers: result.headers,\n status: SINGLE_FETCH_REDIRECT_STATUS\n };\n }\n let context = result;\n let headers = getDocumentHeaders(build, context);\n if (isRedirectStatusCode(context.statusCode) && headers.has(\"Location\")) {\n return {\n result: {\n [SingleFetchRedirectSymbol]: getSingleFetchRedirect(\n context.statusCode,\n headers,\n build.basename\n )\n },\n headers,\n status: SINGLE_FETCH_REDIRECT_STATUS\n };\n }\n if (context.errors) {\n Object.values(context.errors).forEach((err) => {\n if (!isRouteErrorResponse(err) || err.error) {\n handleError(err);\n }\n });\n context.errors = sanitizeErrors(context.errors, serverMode);\n }\n let results = {};\n let loadedMatches = loadRouteIds ? context.matches.filter(\n (m) => m.route.loader && loadRouteIds.includes(m.route.id)\n ) : context.matches;\n loadedMatches.forEach((m) => {\n let { id } = m.route;\n if (context.errors && context.errors.hasOwnProperty(id)) {\n results[id] = { error: context.errors[id] };\n } else if (context.loaderData.hasOwnProperty(id)) {\n results[id] = { data: context.loaderData[id] };\n }\n });\n return {\n result: results,\n headers,\n status: context.statusCode\n };\n } catch (error) {\n handleError(error);\n return {\n result: { root: { error } },\n headers: new Headers(),\n status: 500\n };\n }\n}\nfunction getSingleFetchRedirect(status, headers, basename) {\n let redirect2 = headers.get(\"Location\");\n if (basename) {\n redirect2 = stripBasename(redirect2, basename) || redirect2;\n }\n return {\n redirect: redirect2,\n status,\n revalidate: (\n // Technically X-Remix-Revalidate isn't needed here - that was an implementation\n // detail of ?_data requests as our way to tell the front end to revalidate when\n // we didn't have a response body to include that information in.\n // With single fetch, we tell the front end via this revalidate boolean field.\n // However, we're respecting it for now because it may be something folks have\n // used in their own responses\n // TODO(v3): Consider removing or making this official public API\n headers.has(\"X-Remix-Revalidate\") || headers.has(\"Set-Cookie\")\n ),\n reload: headers.has(\"X-Remix-Reload-Document\"),\n replace: headers.has(\"X-Remix-Replace\")\n };\n}\nfunction encodeViaTurboStream(data2, requestSignal, streamTimeout, serverMode) {\n let controller = new AbortController();\n let timeoutId = setTimeout(\n () => controller.abort(new Error(\"Server Timeout\")),\n typeof streamTimeout === \"number\" ? streamTimeout : 4950\n );\n requestSignal.addEventListener(\"abort\", () => clearTimeout(timeoutId));\n return (0,turbo_stream__WEBPACK_IMPORTED_MODULE_1__.encode)(data2, {\n signal: controller.signal,\n plugins: [\n (value) => {\n if (value instanceof Error) {\n let { name, message, stack } = serverMode === \"production\" /* Production */ ? sanitizeError(value, serverMode) : value;\n return [\"SanitizedError\", name, message, stack];\n }\n if (value instanceof ErrorResponseImpl) {\n let { data: data3, status, statusText } = value;\n return [\"ErrorResponse\", data3, status, statusText];\n }\n if (value && typeof value === \"object\" && SingleFetchRedirectSymbol in value) {\n return [\"SingleFetchRedirect\", value[SingleFetchRedirectSymbol]];\n }\n }\n ],\n postPlugins: [\n (value) => {\n if (!value) return;\n if (typeof value !== \"object\") return;\n return [\n \"SingleFetchClassInstance\",\n Object.fromEntries(Object.entries(value))\n ];\n },\n () => [\"SingleFetchFallback\"]\n ]\n });\n}\n\n// lib/server-runtime/server.ts\nfunction derive(build, mode) {\n let routes = createRoutes(build.routes);\n let dataRoutes = createStaticHandlerDataRoutes(build.routes, build.future);\n let serverMode = isServerMode(mode) ? mode : \"production\" /* Production */;\n let staticHandler = createStaticHandler(dataRoutes, {\n basename: build.basename\n });\n let errorHandler = build.entry.module.handleError || ((error, { request }) => {\n if (serverMode !== \"test\" /* Test */ && !request.signal.aborted) {\n console.error(\n // @ts-expect-error This is \"private\" from users but intended for internal use\n isRouteErrorResponse(error) && error.error ? error.error : error\n );\n }\n });\n return {\n routes,\n dataRoutes,\n serverMode,\n staticHandler,\n errorHandler\n };\n}\nvar createRequestHandler = (build, mode) => {\n let _build;\n let routes;\n let serverMode;\n let staticHandler;\n let errorHandler;\n return async function requestHandler(request, loadContext = {}) {\n _build = typeof build === \"function\" ? await build() : build;\n if (typeof build === \"function\") {\n let derived = derive(_build, mode);\n routes = derived.routes;\n serverMode = derived.serverMode;\n staticHandler = derived.staticHandler;\n errorHandler = derived.errorHandler;\n } else if (!routes || !serverMode || !staticHandler || !errorHandler) {\n let derived = derive(_build, mode);\n routes = derived.routes;\n serverMode = derived.serverMode;\n staticHandler = derived.staticHandler;\n errorHandler = derived.errorHandler;\n }\n let url = new URL(request.url);\n let params = {};\n let handleError = (error) => {\n if (mode === \"development\" /* Development */) {\n getDevServerHooks()?.processRequestError?.(error);\n }\n errorHandler(error, {\n context: loadContext,\n params,\n request\n });\n };\n let manifestUrl = `${_build.basename ?? \"/\"}/__manifest`.replace(\n /\\/+/g,\n \"/\"\n );\n if (url.pathname === manifestUrl) {\n try {\n let res = await handleManifestRequest(_build, routes, url);\n return res;\n } catch (e) {\n handleError(e);\n return new Response(\"Unknown Server Error\", { status: 500 });\n }\n }\n let matches = matchServerRoutes(routes, url.pathname, _build.basename);\n if (matches && matches.length > 0) {\n Object.assign(params, matches[0].params);\n }\n let response;\n if (url.pathname.endsWith(\".data\")) {\n let handlerUrl = new URL(request.url);\n handlerUrl.pathname = handlerUrl.pathname.replace(/\\.data$/, \"\").replace(/^\\/_root$/, \"/\");\n let singleFetchMatches = matchServerRoutes(\n routes,\n handlerUrl.pathname,\n _build.basename\n );\n response = await handleSingleFetchRequest(\n serverMode,\n _build,\n staticHandler,\n request,\n handlerUrl,\n loadContext,\n handleError\n );\n if (_build.entry.module.handleDataRequest) {\n response = await _build.entry.module.handleDataRequest(response, {\n context: loadContext,\n params: singleFetchMatches ? singleFetchMatches[0].params : {},\n request\n });\n if (isRedirectResponse(response)) {\n let result = getSingleFetchRedirect(\n response.status,\n response.headers,\n _build.basename\n );\n if (request.method === \"GET\") {\n result = {\n [SingleFetchRedirectSymbol]: result\n };\n }\n let headers = new Headers(response.headers);\n headers.set(\"Content-Type\", \"text/x-script\");\n return new Response(\n encodeViaTurboStream(\n result,\n request.signal,\n _build.entry.module.streamTimeout,\n serverMode\n ),\n {\n status: SINGLE_FETCH_REDIRECT_STATUS,\n headers\n }\n );\n }\n }\n } else if (matches && matches[matches.length - 1].route.module.default == null && matches[matches.length - 1].route.module.ErrorBoundary == null) {\n response = await handleResourceRequest(\n serverMode,\n staticHandler,\n matches.slice(-1)[0].route.id,\n request,\n loadContext,\n handleError\n );\n } else {\n let criticalCss = mode === \"development\" /* Development */ ? await getDevServerHooks()?.getCriticalCss?.(_build, url.pathname) : void 0;\n response = await handleDocumentRequest(\n serverMode,\n _build,\n staticHandler,\n request,\n loadContext,\n handleError,\n criticalCss\n );\n }\n if (request.method === \"HEAD\") {\n return new Response(null, {\n headers: response.headers,\n status: response.status,\n statusText: response.statusText\n });\n }\n return response;\n };\n};\nasync function handleManifestRequest(build, routes, url) {\n let patches = {};\n if (url.searchParams.has(\"p\")) {\n for (let path of url.searchParams.getAll(\"p\")) {\n let matches = matchServerRoutes(routes, path, build.basename);\n if (matches) {\n for (let match of matches) {\n let routeId = match.route.id;\n let route = build.assets.routes[routeId];\n if (route) {\n patches[routeId] = route;\n }\n }\n }\n }\n return Response.json(patches, {\n headers: {\n \"Cache-Control\": \"public, max-age=31536000, immutable\"\n }\n });\n }\n return new Response(\"Invalid Request\", { status: 400 });\n}\nasync function handleSingleFetchRequest(serverMode, build, staticHandler, request, handlerUrl, loadContext, handleError) {\n let { result, headers, status } = request.method !== \"GET\" ? await singleFetchAction(\n build,\n serverMode,\n staticHandler,\n request,\n handlerUrl,\n loadContext,\n handleError\n ) : await singleFetchLoaders(\n build,\n serverMode,\n staticHandler,\n request,\n handlerUrl,\n loadContext,\n handleError\n );\n let resultHeaders = new Headers(headers);\n resultHeaders.set(\"X-Remix-Response\", \"yes\");\n if (status === 304) {\n return new Response(null, { status: 304, headers: resultHeaders });\n }\n resultHeaders.set(\"Content-Type\", \"text/x-script\");\n return new Response(\n encodeViaTurboStream(\n result,\n request.signal,\n build.entry.module.streamTimeout,\n serverMode\n ),\n {\n status: status || 200,\n headers: resultHeaders\n }\n );\n}\nasync function handleDocumentRequest(serverMode, build, staticHandler, request, loadContext, handleError, criticalCss) {\n let context;\n try {\n context = await staticHandler.query(request, {\n requestContext: loadContext\n });\n } catch (error) {\n handleError(error);\n return new Response(null, { status: 500 });\n }\n if (isResponse(context)) {\n return context;\n }\n let headers = getDocumentHeaders(build, context);\n if (context.statusCode === 304) {\n return new Response(null, { status: 304, headers });\n }\n if (context.errors) {\n Object.values(context.errors).forEach((err) => {\n if (!isRouteErrorResponse(err) || err.error) {\n handleError(err);\n }\n });\n context.errors = sanitizeErrors(context.errors, serverMode);\n }\n let state = {\n loaderData: context.loaderData,\n actionData: context.actionData,\n errors: serializeErrors2(context.errors, serverMode)\n };\n let entryContext = {\n manifest: build.assets,\n routeModules: createEntryRouteModules(build.routes),\n staticHandlerContext: context,\n criticalCss,\n serverHandoffString: createServerHandoffString({\n basename: build.basename,\n criticalCss,\n future: build.future,\n isSpaMode: build.isSpaMode\n }),\n serverHandoffStream: encodeViaTurboStream(\n state,\n request.signal,\n build.entry.module.streamTimeout,\n serverMode\n ),\n renderMeta: {},\n future: build.future,\n isSpaMode: build.isSpaMode,\n serializeError: (err) => serializeError(err, serverMode)\n };\n let handleDocumentRequestFunction = build.entry.module.default;\n try {\n return await handleDocumentRequestFunction(\n request,\n context.statusCode,\n headers,\n entryContext,\n loadContext\n );\n } catch (error) {\n handleError(error);\n let errorForSecondRender = error;\n if (isResponse(error)) {\n try {\n let data2 = await unwrapResponse(error);\n errorForSecondRender = new ErrorResponseImpl(\n error.status,\n error.statusText,\n data2\n );\n } catch (e) {\n }\n }\n context = getStaticContextFromError(\n staticHandler.dataRoutes,\n context,\n errorForSecondRender\n );\n if (context.errors) {\n context.errors = sanitizeErrors(context.errors, serverMode);\n }\n let state2 = {\n loaderData: context.loaderData,\n actionData: context.actionData,\n errors: serializeErrors2(context.errors, serverMode)\n };\n entryContext = {\n ...entryContext,\n staticHandlerContext: context,\n serverHandoffString: createServerHandoffString({\n basename: build.basename,\n future: build.future,\n isSpaMode: build.isSpaMode\n }),\n serverHandoffStream: encodeViaTurboStream(\n state2,\n request.signal,\n build.entry.module.streamTimeout,\n serverMode\n ),\n renderMeta: {}\n };\n try {\n return await handleDocumentRequestFunction(\n request,\n context.statusCode,\n headers,\n entryContext,\n loadContext\n );\n } catch (error2) {\n handleError(error2);\n return returnLastResortErrorResponse(error2, serverMode);\n }\n }\n}\nasync function handleResourceRequest(serverMode, staticHandler, routeId, request, loadContext, handleError) {\n try {\n let response = await staticHandler.queryRoute(request, {\n routeId,\n requestContext: loadContext\n });\n invariant3(\n isResponse(response),\n \"Expected a Response to be returned from resource route handler\"\n );\n return response;\n } catch (error) {\n if (isResponse(error)) {\n error.headers.set(\"X-Remix-Catch\", \"yes\");\n return error;\n }\n if (isRouteErrorResponse(error)) {\n if (error) {\n handleError(error);\n }\n return errorResponseToJson(error, serverMode);\n }\n handleError(error);\n return returnLastResortErrorResponse(error, serverMode);\n }\n}\nfunction errorResponseToJson(errorResponse, serverMode) {\n return Response.json(\n serializeError(\n // @ts-expect-error This is \"private\" from users but intended for internal use\n errorResponse.error || new Error(\"Unexpected Server Error\"),\n serverMode\n ),\n {\n status: errorResponse.status,\n statusText: errorResponse.statusText,\n headers: {\n \"X-Remix-Error\": \"yes\"\n }\n }\n );\n}\nfunction returnLastResortErrorResponse(error, serverMode) {\n let message = \"Unexpected Server Error\";\n if (serverMode !== \"production\" /* Production */) {\n message += `\n\n${String(error)}`;\n }\n return new Response(message, {\n status: 500,\n headers: {\n \"Content-Type\": \"text/plain\"\n }\n });\n}\nfunction unwrapResponse(response) {\n let contentType = response.headers.get(\"Content-Type\");\n return contentType && /\\bapplication\\/json\\b/.test(contentType) ? response.body == null ? null : response.json() : response.text();\n}\n\n// lib/server-runtime/sessions.ts\nfunction flash(name) {\n return `__flash_${name}__`;\n}\nvar createSession = (initialData = {}, id = \"\") => {\n let map = new Map(Object.entries(initialData));\n return {\n get id() {\n return id;\n },\n get data() {\n return Object.fromEntries(map);\n },\n has(name) {\n return map.has(name) || map.has(flash(name));\n },\n get(name) {\n if (map.has(name)) return map.get(name);\n let flashName = flash(name);\n if (map.has(flashName)) {\n let value = map.get(flashName);\n map.delete(flashName);\n return value;\n }\n return void 0;\n },\n set(name, value) {\n map.set(name, value);\n },\n flash(name, value) {\n map.set(flash(name), value);\n },\n unset(name) {\n map.delete(name);\n }\n };\n};\nvar isSession = (object) => {\n return object != null && typeof object.id === \"string\" && typeof object.data !== \"undefined\" && typeof object.has === \"function\" && typeof object.get === \"function\" && typeof object.set === \"function\" && typeof object.flash === \"function\" && typeof object.unset === \"function\";\n};\nfunction createSessionStorage({\n cookie: cookieArg,\n createData,\n readData,\n updateData,\n deleteData\n}) {\n let cookie = isCookie(cookieArg) ? cookieArg : createCookie(cookieArg?.name || \"__session\", cookieArg);\n warnOnceAboutSigningSessionCookie(cookie);\n return {\n async getSession(cookieHeader, options) {\n let id = cookieHeader && await cookie.parse(cookieHeader, options);\n let data2 = id && await readData(id);\n return createSession(data2 || {}, id || \"\");\n },\n async commitSession(session, options) {\n let { id, data: data2 } = session;\n let expires = options?.maxAge != null ? new Date(Date.now() + options.maxAge * 1e3) : options?.expires != null ? options.expires : cookie.expires;\n if (id) {\n await updateData(id, data2, expires);\n } else {\n id = await createData(data2, expires);\n }\n return cookie.serialize(id, options);\n },\n async destroySession(session, options) {\n await deleteData(session.id);\n return cookie.serialize(\"\", {\n ...options,\n maxAge: void 0,\n expires: /* @__PURE__ */ new Date(0)\n });\n }\n };\n}\nfunction warnOnceAboutSigningSessionCookie(cookie) {\n warnOnce(\n cookie.isSigned,\n `The \"${cookie.name}\" cookie is not signed, but session cookies should be signed to prevent tampering on the client before they are sent back to the server. See https://remix.run/utils/cookies#signing-cookies for more information.`\n );\n}\n\n// lib/server-runtime/sessions/cookieStorage.ts\nfunction createCookieSessionStorage({ cookie: cookieArg } = {}) {\n let cookie = isCookie(cookieArg) ? cookieArg : createCookie(cookieArg?.name || \"__session\", cookieArg);\n warnOnceAboutSigningSessionCookie(cookie);\n return {\n async getSession(cookieHeader, options) {\n return createSession(\n cookieHeader && await cookie.parse(cookieHeader, options) || {}\n );\n },\n async commitSession(session, options) {\n let serializedCookie = await cookie.serialize(session.data, options);\n if (serializedCookie.length > 4096) {\n throw new Error(\n \"Cookie length will exceed browser maximum. Length: \" + serializedCookie.length\n );\n }\n return serializedCookie;\n },\n async destroySession(_session, options) {\n return cookie.serialize(\"\", {\n ...options,\n maxAge: void 0,\n expires: /* @__PURE__ */ new Date(0)\n });\n }\n };\n}\n\n// lib/server-runtime/sessions/memoryStorage.ts\nfunction createMemorySessionStorage({ cookie } = {}) {\n let map = /* @__PURE__ */ new Map();\n return createSessionStorage({\n cookie,\n async createData(data2, expires) {\n let id = Math.random().toString(36).substring(2, 10);\n map.set(id, { data: data2, expires });\n return id;\n },\n async readData(id) {\n if (map.has(id)) {\n let { data: data2, expires } = map.get(id);\n if (!expires || expires > /* @__PURE__ */ new Date()) {\n return data2;\n }\n if (expires) map.delete(id);\n }\n return null;\n },\n async updateData(id, data2, expires) {\n map.set(id, { data: data2, expires });\n },\n async deleteData(id) {\n map.delete(id);\n }\n });\n}\n\n// lib/dom/ssr/errors.ts\nfunction deserializeErrors2(errors) {\n if (!errors) return null;\n let entries = Object.entries(errors);\n let serialized = {};\n for (let [key, val] of entries) {\n if (val && val.__type === \"RouteErrorResponse\") {\n serialized[key] = new ErrorResponseImpl(\n val.status,\n val.statusText,\n val.data,\n val.internal === true\n );\n } else if (val && val.__type === \"Error\") {\n if (val.__subType) {\n let ErrorConstructor = window[val.__subType];\n if (typeof ErrorConstructor === \"function\") {\n try {\n let error = new ErrorConstructor(val.message);\n error.stack = val.stack;\n serialized[key] = error;\n } catch (e) {\n }\n }\n }\n if (serialized[key] == null) {\n let error = new Error(val.message);\n error.stack = val.stack;\n serialized[key] = error;\n }\n } else {\n serialized[key] = val;\n }\n }\n return serialized;\n}\n\n\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./node_modules/react-router/dist/development/chunk-V7UHCZHK.mjs?");
|
|
660
776
|
|
|
661
777
|
/***/ }),
|
|
662
778
|
|
|
663
|
-
/***/ "
|
|
664
|
-
|
|
665
|
-
!***
|
|
666
|
-
|
|
667
|
-
/***/ (function(
|
|
779
|
+
/***/ "./node_modules/turbo-stream/dist/turbo-stream.mjs":
|
|
780
|
+
/*!*********************************************************!*\
|
|
781
|
+
!*** ./node_modules/turbo-stream/dist/turbo-stream.mjs ***!
|
|
782
|
+
\*********************************************************/
|
|
783
|
+
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
668
784
|
|
|
669
|
-
|
|
785
|
+
"use strict";
|
|
786
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ decode: function() { return /* binding */ decode; },\n/* harmony export */ encode: function() { return /* binding */ encode; }\n/* harmony export */ });\n// src/utils.ts\nvar HOLE = -1;\nvar NAN = -2;\nvar NEGATIVE_INFINITY = -3;\nvar NEGATIVE_ZERO = -4;\nvar NULL = -5;\nvar POSITIVE_INFINITY = -6;\nvar UNDEFINED = -7;\nvar TYPE_BIGINT = \"B\";\nvar TYPE_DATE = \"D\";\nvar TYPE_ERROR = \"E\";\nvar TYPE_MAP = \"M\";\nvar TYPE_NULL_OBJECT = \"N\";\nvar TYPE_PROMISE = \"P\";\nvar TYPE_REGEXP = \"R\";\nvar TYPE_SET = \"S\";\nvar TYPE_SYMBOL = \"Y\";\nvar TYPE_URL = \"U\";\nvar TYPE_PREVIOUS_RESOLVED = \"Z\";\nvar Deferred = class {\n promise;\n resolve;\n reject;\n constructor() {\n this.promise = new Promise((resolve, reject) => {\n this.resolve = resolve;\n this.reject = reject;\n });\n }\n};\nfunction createLineSplittingTransform() {\n const decoder = new TextDecoder();\n let leftover = \"\";\n return new TransformStream({\n transform(chunk, controller) {\n const str = decoder.decode(chunk, { stream: true });\n const parts = (leftover + str).split(\"\\n\");\n leftover = parts.pop() || \"\";\n for (const part of parts) {\n controller.enqueue(part);\n }\n },\n flush(controller) {\n if (leftover) {\n controller.enqueue(leftover);\n }\n }\n });\n}\n\n// src/flatten.ts\nfunction flatten(input) {\n const { indices } = this;\n const existing = indices.get(input);\n if (existing)\n return [existing];\n if (input === void 0)\n return UNDEFINED;\n if (input === null)\n return NULL;\n if (Number.isNaN(input))\n return NAN;\n if (input === Number.POSITIVE_INFINITY)\n return POSITIVE_INFINITY;\n if (input === Number.NEGATIVE_INFINITY)\n return NEGATIVE_INFINITY;\n if (input === 0 && 1 / input < 0)\n return NEGATIVE_ZERO;\n const index = this.index++;\n indices.set(input, index);\n stringify.call(this, input, index);\n return index;\n}\nfunction stringify(input, index) {\n const { deferred, plugins, postPlugins } = this;\n const str = this.stringified;\n const stack = [[input, index]];\n while (stack.length > 0) {\n const [input2, index2] = stack.pop();\n const partsForObj = (obj) => Object.keys(obj).map((k) => `\"_${flatten.call(this, k)}\":${flatten.call(this, obj[k])}`).join(\",\");\n let error = null;\n switch (typeof input2) {\n case \"boolean\":\n case \"number\":\n case \"string\":\n str[index2] = JSON.stringify(input2);\n break;\n case \"bigint\":\n str[index2] = `[\"${TYPE_BIGINT}\",\"${input2}\"]`;\n break;\n case \"symbol\": {\n const keyFor = Symbol.keyFor(input2);\n if (!keyFor) {\n error = new Error(\n \"Cannot encode symbol unless created with Symbol.for()\"\n );\n } else {\n str[index2] = `[\"${TYPE_SYMBOL}\",${JSON.stringify(keyFor)}]`;\n }\n break;\n }\n case \"object\": {\n if (!input2) {\n str[index2] = `${NULL}`;\n break;\n }\n const isArray = Array.isArray(input2);\n let pluginHandled = false;\n if (!isArray && plugins) {\n for (const plugin of plugins) {\n const pluginResult = plugin(input2);\n if (Array.isArray(pluginResult)) {\n pluginHandled = true;\n const [pluginIdentifier, ...rest] = pluginResult;\n str[index2] = `[${JSON.stringify(pluginIdentifier)}`;\n if (rest.length > 0) {\n str[index2] += `,${rest.map((v) => flatten.call(this, v)).join(\",\")}`;\n }\n str[index2] += \"]\";\n break;\n }\n }\n }\n if (!pluginHandled) {\n let result = isArray ? \"[\" : \"{\";\n if (isArray) {\n for (let i = 0; i < input2.length; i++)\n result += (i ? \",\" : \"\") + (i in input2 ? flatten.call(this, input2[i]) : HOLE);\n str[index2] = `${result}]`;\n } else if (input2 instanceof Date) {\n str[index2] = `[\"${TYPE_DATE}\",${input2.getTime()}]`;\n } else if (input2 instanceof URL) {\n str[index2] = `[\"${TYPE_URL}\",${JSON.stringify(input2.href)}]`;\n } else if (input2 instanceof RegExp) {\n str[index2] = `[\"${TYPE_REGEXP}\",${JSON.stringify(\n input2.source\n )},${JSON.stringify(input2.flags)}]`;\n } else if (input2 instanceof Set) {\n if (input2.size > 0) {\n str[index2] = `[\"${TYPE_SET}\",${[...input2].map((val) => flatten.call(this, val)).join(\",\")}]`;\n } else {\n str[index2] = `[\"${TYPE_SET}\"]`;\n }\n } else if (input2 instanceof Map) {\n if (input2.size > 0) {\n str[index2] = `[\"${TYPE_MAP}\",${[...input2].flatMap(([k, v]) => [\n flatten.call(this, k),\n flatten.call(this, v)\n ]).join(\",\")}]`;\n } else {\n str[index2] = `[\"${TYPE_MAP}\"]`;\n }\n } else if (input2 instanceof Promise) {\n str[index2] = `[\"${TYPE_PROMISE}\",${index2}]`;\n deferred[index2] = input2;\n } else if (input2 instanceof Error) {\n str[index2] = `[\"${TYPE_ERROR}\",${JSON.stringify(input2.message)}`;\n if (input2.name !== \"Error\") {\n str[index2] += `,${JSON.stringify(input2.name)}`;\n }\n str[index2] += \"]\";\n } else if (Object.getPrototypeOf(input2) === null) {\n str[index2] = `[\"${TYPE_NULL_OBJECT}\",{${partsForObj(input2)}}]`;\n } else if (isPlainObject(input2)) {\n str[index2] = `{${partsForObj(input2)}}`;\n } else {\n error = new Error(\"Cannot encode object with prototype\");\n }\n }\n break;\n }\n default: {\n const isArray = Array.isArray(input2);\n let pluginHandled = false;\n if (!isArray && plugins) {\n for (const plugin of plugins) {\n const pluginResult = plugin(input2);\n if (Array.isArray(pluginResult)) {\n pluginHandled = true;\n const [pluginIdentifier, ...rest] = pluginResult;\n str[index2] = `[${JSON.stringify(pluginIdentifier)}`;\n if (rest.length > 0) {\n str[index2] += `,${rest.map((v) => flatten.call(this, v)).join(\",\")}`;\n }\n str[index2] += \"]\";\n break;\n }\n }\n }\n if (!pluginHandled) {\n error = new Error(\"Cannot encode function or unexpected type\");\n }\n }\n }\n if (error) {\n let pluginHandled = false;\n if (postPlugins) {\n for (const plugin of postPlugins) {\n const pluginResult = plugin(input2);\n if (Array.isArray(pluginResult)) {\n pluginHandled = true;\n const [pluginIdentifier, ...rest] = pluginResult;\n str[index2] = `[${JSON.stringify(pluginIdentifier)}`;\n if (rest.length > 0) {\n str[index2] += `,${rest.map((v) => flatten.call(this, v)).join(\",\")}`;\n }\n str[index2] += \"]\";\n break;\n }\n }\n }\n if (!pluginHandled) {\n throw error;\n }\n }\n }\n}\nvar objectProtoNames = Object.getOwnPropertyNames(Object.prototype).sort().join(\"\\0\");\nfunction isPlainObject(thing) {\n const proto = Object.getPrototypeOf(thing);\n return proto === Object.prototype || proto === null || Object.getOwnPropertyNames(proto).sort().join(\"\\0\") === objectProtoNames;\n}\n\n// src/unflatten.ts\nvar globalObj = typeof window !== \"undefined\" ? window : typeof globalThis !== \"undefined\" ? globalThis : void 0;\nfunction unflatten(parsed) {\n const { hydrated, values } = this;\n if (typeof parsed === \"number\")\n return hydrate.call(this, parsed);\n if (!Array.isArray(parsed) || !parsed.length)\n throw new SyntaxError();\n const startIndex = values.length;\n for (const value of parsed) {\n values.push(value);\n }\n hydrated.length = values.length;\n return hydrate.call(this, startIndex);\n}\nfunction hydrate(index) {\n const { hydrated, values, deferred, plugins } = this;\n let result;\n const stack = [\n [\n index,\n (v) => {\n result = v;\n }\n ]\n ];\n let postRun = [];\n while (stack.length > 0) {\n const [index2, set] = stack.pop();\n switch (index2) {\n case UNDEFINED:\n set(void 0);\n continue;\n case NULL:\n set(null);\n continue;\n case NAN:\n set(NaN);\n continue;\n case POSITIVE_INFINITY:\n set(Infinity);\n continue;\n case NEGATIVE_INFINITY:\n set(-Infinity);\n continue;\n case NEGATIVE_ZERO:\n set(-0);\n continue;\n }\n if (hydrated[index2]) {\n set(hydrated[index2]);\n continue;\n }\n const value = values[index2];\n if (!value || typeof value !== \"object\") {\n hydrated[index2] = value;\n set(value);\n continue;\n }\n if (Array.isArray(value)) {\n if (typeof value[0] === \"string\") {\n const [type, b, c] = value;\n switch (type) {\n case TYPE_DATE:\n set(hydrated[index2] = new Date(b));\n continue;\n case TYPE_URL:\n set(hydrated[index2] = new URL(b));\n continue;\n case TYPE_BIGINT:\n set(hydrated[index2] = BigInt(b));\n continue;\n case TYPE_REGEXP:\n set(hydrated[index2] = new RegExp(b, c));\n continue;\n case TYPE_SYMBOL:\n set(hydrated[index2] = Symbol.for(b));\n continue;\n case TYPE_SET:\n const newSet = /* @__PURE__ */ new Set();\n hydrated[index2] = newSet;\n for (let i = 1; i < value.length; i++)\n stack.push([\n value[i],\n (v) => {\n newSet.add(v);\n }\n ]);\n set(newSet);\n continue;\n case TYPE_MAP:\n const map = /* @__PURE__ */ new Map();\n hydrated[index2] = map;\n for (let i = 1; i < value.length; i += 2) {\n const r = [];\n stack.push([\n value[i + 1],\n (v) => {\n r[1] = v;\n }\n ]);\n stack.push([\n value[i],\n (k) => {\n r[0] = k;\n }\n ]);\n postRun.push(() => {\n map.set(r[0], r[1]);\n });\n }\n set(map);\n continue;\n case TYPE_NULL_OBJECT:\n const obj = /* @__PURE__ */ Object.create(null);\n hydrated[index2] = obj;\n for (const key of Object.keys(b).reverse()) {\n const r = [];\n stack.push([\n b[key],\n (v) => {\n r[1] = v;\n }\n ]);\n stack.push([\n Number(key.slice(1)),\n (k) => {\n r[0] = k;\n }\n ]);\n postRun.push(() => {\n obj[r[0]] = r[1];\n });\n }\n set(obj);\n continue;\n case TYPE_PROMISE:\n if (hydrated[b]) {\n set(hydrated[index2] = hydrated[b]);\n } else {\n const d = new Deferred();\n deferred[b] = d;\n set(hydrated[index2] = d.promise);\n }\n continue;\n case TYPE_ERROR:\n const [, message, errorType] = value;\n let error = errorType && globalObj && globalObj[errorType] ? new globalObj[errorType](message) : new Error(message);\n hydrated[index2] = error;\n set(error);\n continue;\n case TYPE_PREVIOUS_RESOLVED:\n set(hydrated[index2] = hydrated[b]);\n continue;\n default:\n if (Array.isArray(plugins)) {\n const r = [];\n const vals = value.slice(1);\n for (let i = 0; i < vals.length; i++) {\n const v = vals[i];\n stack.push([\n v,\n (v2) => {\n r[i] = v2;\n }\n ]);\n }\n postRun.push(() => {\n for (const plugin of plugins) {\n const result2 = plugin(value[0], ...r);\n if (result2) {\n set(hydrated[index2] = result2.value);\n return;\n }\n }\n throw new SyntaxError();\n });\n continue;\n }\n throw new SyntaxError();\n }\n } else {\n const array = [];\n hydrated[index2] = array;\n for (let i = 0; i < value.length; i++) {\n const n = value[i];\n if (n !== HOLE) {\n stack.push([\n n,\n (v) => {\n array[i] = v;\n }\n ]);\n }\n }\n set(array);\n continue;\n }\n } else {\n const object = {};\n hydrated[index2] = object;\n for (const key of Object.keys(value).reverse()) {\n const r = [];\n stack.push([\n value[key],\n (v) => {\n r[1] = v;\n }\n ]);\n stack.push([\n Number(key.slice(1)),\n (k) => {\n r[0] = k;\n }\n ]);\n postRun.push(() => {\n object[r[0]] = r[1];\n });\n }\n set(object);\n continue;\n }\n }\n while (postRun.length > 0) {\n postRun.pop()();\n }\n return result;\n}\n\n// src/turbo-stream.ts\nasync function decode(readable, options) {\n const { plugins } = options ?? {};\n const done = new Deferred();\n const reader = readable.pipeThrough(createLineSplittingTransform()).getReader();\n const decoder = {\n values: [],\n hydrated: [],\n deferred: {},\n plugins\n };\n const decoded = await decodeInitial.call(decoder, reader);\n let donePromise = done.promise;\n if (decoded.done) {\n done.resolve();\n } else {\n donePromise = decodeDeferred.call(decoder, reader).then(done.resolve).catch((reason) => {\n for (const deferred of Object.values(decoder.deferred)) {\n deferred.reject(reason);\n }\n done.reject(reason);\n });\n }\n return {\n done: donePromise.then(() => reader.closed),\n value: decoded.value\n };\n}\nasync function decodeInitial(reader) {\n const read = await reader.read();\n if (!read.value) {\n throw new SyntaxError();\n }\n let line;\n try {\n line = JSON.parse(read.value);\n } catch (reason) {\n throw new SyntaxError();\n }\n return {\n done: read.done,\n value: unflatten.call(this, line)\n };\n}\nasync function decodeDeferred(reader) {\n let read = await reader.read();\n while (!read.done) {\n if (!read.value)\n continue;\n const line = read.value;\n switch (line[0]) {\n case TYPE_PROMISE: {\n const colonIndex = line.indexOf(\":\");\n const deferredId = Number(line.slice(1, colonIndex));\n const deferred = this.deferred[deferredId];\n if (!deferred) {\n throw new Error(`Deferred ID ${deferredId} not found in stream`);\n }\n const lineData = line.slice(colonIndex + 1);\n let jsonLine;\n try {\n jsonLine = JSON.parse(lineData);\n } catch (reason) {\n throw new SyntaxError();\n }\n const value = unflatten.call(this, jsonLine);\n deferred.resolve(value);\n break;\n }\n case TYPE_ERROR: {\n const colonIndex = line.indexOf(\":\");\n const deferredId = Number(line.slice(1, colonIndex));\n const deferred = this.deferred[deferredId];\n if (!deferred) {\n throw new Error(`Deferred ID ${deferredId} not found in stream`);\n }\n const lineData = line.slice(colonIndex + 1);\n let jsonLine;\n try {\n jsonLine = JSON.parse(lineData);\n } catch (reason) {\n throw new SyntaxError();\n }\n const value = unflatten.call(this, jsonLine);\n deferred.reject(value);\n break;\n }\n default:\n throw new SyntaxError();\n }\n read = await reader.read();\n }\n}\nfunction encode(input, options) {\n const { plugins, postPlugins, signal } = options ?? {};\n const encoder = {\n deferred: {},\n index: 0,\n indices: /* @__PURE__ */ new Map(),\n stringified: [],\n plugins,\n postPlugins,\n signal\n };\n const textEncoder = new TextEncoder();\n let lastSentIndex = 0;\n const readable = new ReadableStream({\n async start(controller) {\n const id = flatten.call(encoder, input);\n if (Array.isArray(id)) {\n throw new Error(\"This should never happen\");\n }\n if (id < 0) {\n controller.enqueue(textEncoder.encode(`${id}\n`));\n } else {\n controller.enqueue(\n textEncoder.encode(`[${encoder.stringified.join(\",\")}]\n`)\n );\n lastSentIndex = encoder.stringified.length - 1;\n }\n const seenPromises = /* @__PURE__ */ new WeakSet();\n while (Object.keys(encoder.deferred).length > 0) {\n for (const [deferredId, deferred] of Object.entries(encoder.deferred)) {\n if (seenPromises.has(deferred))\n continue;\n seenPromises.add(\n encoder.deferred[Number(deferredId)] = raceSignal(\n deferred,\n encoder.signal\n ).then(\n (resolved) => {\n const id2 = flatten.call(encoder, resolved);\n if (Array.isArray(id2)) {\n controller.enqueue(\n textEncoder.encode(\n `${TYPE_PROMISE}${deferredId}:[[\"${TYPE_PREVIOUS_RESOLVED}\",${id2[0]}]]\n`\n )\n );\n encoder.index++;\n lastSentIndex++;\n } else if (id2 < 0) {\n controller.enqueue(\n textEncoder.encode(`${TYPE_PROMISE}${deferredId}:${id2}\n`)\n );\n } else {\n const values = encoder.stringified.slice(lastSentIndex + 1).join(\",\");\n controller.enqueue(\n textEncoder.encode(\n `${TYPE_PROMISE}${deferredId}:[${values}]\n`\n )\n );\n lastSentIndex = encoder.stringified.length - 1;\n }\n },\n (reason) => {\n if (!reason || typeof reason !== \"object\" || !(reason instanceof Error)) {\n reason = new Error(\"An unknown error occurred\");\n }\n const id2 = flatten.call(encoder, reason);\n if (Array.isArray(id2)) {\n controller.enqueue(\n textEncoder.encode(\n `${TYPE_ERROR}${deferredId}:[[\"${TYPE_PREVIOUS_RESOLVED}\",${id2[0]}]]\n`\n )\n );\n encoder.index++;\n lastSentIndex++;\n } else if (id2 < 0) {\n controller.enqueue(\n textEncoder.encode(`${TYPE_ERROR}${deferredId}:${id2}\n`)\n );\n } else {\n const values = encoder.stringified.slice(lastSentIndex + 1).join(\",\");\n controller.enqueue(\n textEncoder.encode(\n `${TYPE_ERROR}${deferredId}:[${values}]\n`\n )\n );\n lastSentIndex = encoder.stringified.length - 1;\n }\n }\n ).finally(() => {\n delete encoder.deferred[Number(deferredId)];\n })\n );\n }\n await Promise.race(Object.values(encoder.deferred));\n }\n await Promise.all(Object.values(encoder.deferred));\n controller.close();\n }\n });\n return readable;\n}\nfunction raceSignal(promise, signal) {\n if (!signal)\n return promise;\n if (signal.aborted)\n return Promise.reject(signal.reason || new Error(\"Signal was aborted.\"));\n const abort = new Promise((resolve, reject) => {\n signal.addEventListener(\"abort\", (event) => {\n reject(signal.reason || new Error(\"Signal was aborted.\"));\n });\n promise.then(resolve).catch(reject);\n });\n abort.catch(() => {\n });\n return Promise.race([abort, promise]);\n}\n\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./node_modules/turbo-stream/dist/turbo-stream.mjs?");
|
|
670
787
|
|
|
671
788
|
/***/ })
|
|
672
789
|
|