This commit is contained in:
2024-03-22 03:47:51 +05:30
parent 8bcf3d211e
commit 89819f6fe2
28440 changed files with 3211033 additions and 2 deletions

22
node_modules/react-router/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,22 @@
MIT License
Copyright (c) React Training 2015-2019
Copyright (c) Remix Software 2020-2022
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

3
node_modules/react-router/MemoryRouter.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
"use strict";
require("./warnAboutDeprecatedCJSRequire")("MemoryRouter");
module.exports = require("./index.js").MemoryRouter;

3
node_modules/react-router/Prompt.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
"use strict";
require("./warnAboutDeprecatedCJSRequire")("Prompt");
module.exports = require("./index.js").Prompt;

39
node_modules/react-router/README.md generated vendored Normal file
View File

@@ -0,0 +1,39 @@
# react-router
Declarative routing for [React](https://facebook.github.io/react).
## Installation
Using [npm](https://www.npmjs.com/):
$ npm install --save react-router
**Note:** This package provides the core routing functionality for React Router, but you might not want to install it directly. If you are writing an application that will run in the browser, you should instead install `react-router-dom`. Similarly, if you are writing a React Native application, you should instead install `react-router-native`. Both of those will install `react-router` as a dependency.
Then with a module bundler like [webpack](https://webpack.github.io/), use as you would anything else:
```js
// using ES6 modules
import { Router, Route, Switch } from "react-router";
// using CommonJS modules
var Router = require("react-router").Router;
var Route = require("react-router").Route;
var Switch = require("react-router").Switch;
```
The UMD build is also available on [unpkg](https://unpkg.com):
```html
<script src="https://unpkg.com/react-router/umd/react-router.min.js"></script>
```
You can find the library on `window.ReactRouter`.
## Issues
If you find a bug, please file an issue on [our issue tracker on GitHub](https://github.com/remix-run/react-router/issues).
## Credits
React Router is built and maintained by [Remix Software](https://remix.run).

3
node_modules/react-router/Redirect.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
"use strict";
require("./warnAboutDeprecatedCJSRequire")("Redirect");
module.exports = require("./index.js").Redirect;

3
node_modules/react-router/Route.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
"use strict";
require("./warnAboutDeprecatedCJSRequire")("Route");
module.exports = require("./index.js").Route;

3
node_modules/react-router/Router.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
"use strict";
require("./warnAboutDeprecatedCJSRequire")("Router");
module.exports = require("./index.js").Router;

3
node_modules/react-router/StaticRouter.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
"use strict";
require("./warnAboutDeprecatedCJSRequire")("StaticRouter");
module.exports = require("./index.js").StaticRouter;

3
node_modules/react-router/Switch.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
"use strict";
require("./warnAboutDeprecatedCJSRequire")("Switch");
module.exports = require("./index.js").Switch;

1015
node_modules/react-router/cjs/react-router.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

1
node_modules/react-router/cjs/react-router.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

2
node_modules/react-router/cjs/react-router.min.js generated vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

5
node_modules/react-router/es/MemoryRouter.js generated vendored Normal file
View File

@@ -0,0 +1,5 @@
import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
warnAboutDeprecatedESMImport("MemoryRouter");
import { MemoryRouter } from "../esm/react-router.js";
export default MemoryRouter;

5
node_modules/react-router/es/Prompt.js generated vendored Normal file
View File

@@ -0,0 +1,5 @@
import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
warnAboutDeprecatedESMImport("Prompt");
import { Prompt } from "../esm/react-router.js";
export default Prompt;

5
node_modules/react-router/es/Redirect.js generated vendored Normal file
View File

@@ -0,0 +1,5 @@
import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
warnAboutDeprecatedESMImport("Redirect");
import { Redirect } from "../esm/react-router.js";
export default Redirect;

5
node_modules/react-router/es/Route.js generated vendored Normal file
View File

@@ -0,0 +1,5 @@
import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
warnAboutDeprecatedESMImport("Route");
import { Route } from "../esm/react-router.js";
export default Route;

5
node_modules/react-router/es/Router.js generated vendored Normal file
View File

@@ -0,0 +1,5 @@
import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
warnAboutDeprecatedESMImport("Router");
import { Router } from "../esm/react-router.js";
export default Router;

5
node_modules/react-router/es/StaticRouter.js generated vendored Normal file
View File

@@ -0,0 +1,5 @@
import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
warnAboutDeprecatedESMImport("StaticRouter");
import { StaticRouter } from "../esm/react-router.js";
export default StaticRouter;

5
node_modules/react-router/es/Switch.js generated vendored Normal file
View File

@@ -0,0 +1,5 @@
import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
warnAboutDeprecatedESMImport("Switch");
import { Switch } from "../esm/react-router.js";
export default Switch;

5
node_modules/react-router/es/generatePath.js generated vendored Normal file
View File

@@ -0,0 +1,5 @@
import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
warnAboutDeprecatedESMImport("generatePath");
import { generatePath } from "../esm/react-router.js";
export default generatePath;

5
node_modules/react-router/es/matchPath.js generated vendored Normal file
View File

@@ -0,0 +1,5 @@
import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
warnAboutDeprecatedESMImport("matchPath");
import { matchPath } from "../esm/react-router.js";
export default matchPath;

View File

@@ -0,0 +1,34 @@
/* eslint-disable prefer-arrow-callback, no-empty */
var printWarning = function() {};
if (process.env.NODE_ENV !== "production") {
printWarning = function(format, subs) {
var index = 0;
var message =
"Warning: " +
(subs.length > 0
? format.replace(/%s/g, function() {
return subs[index++];
})
: format);
if (typeof console !== "undefined") {
console.error(message);
}
try {
// --- Welcome to debugging React Router ---
// This error was thrown as a convenience so that you can use the
// stack trace to find the callsite that triggered this warning.
throw new Error(message);
} catch (e) {}
};
}
export default function(member) {
printWarning(
'Please use `import { %s } from "react-router"` instead of `import %s from "react-router/es/%s"`. ' +
"Support for the latter will be removed in the next major release.",
[member, member]
);
}

5
node_modules/react-router/es/withRouter.js generated vendored Normal file
View File

@@ -0,0 +1,5 @@
import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
warnAboutDeprecatedESMImport("withRouter");
import { withRouter } from "../esm/react-router.js";
export default withRouter;

950
node_modules/react-router/esm/react-router.js generated vendored Normal file
View File

@@ -0,0 +1,950 @@
import _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';
import React from 'react';
import PropTypes from 'prop-types';
import { createMemoryHistory, createLocation, locationsAreEqual, createPath } from 'history';
import warning from 'tiny-warning';
import invariant from 'tiny-invariant';
import _extends from '@babel/runtime/helpers/esm/extends';
import pathToRegexp from 'path-to-regexp';
import { isValidElementType } from 'react-is';
import _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';
import hoistStatics from 'hoist-non-react-statics';
var MAX_SIGNED_31_BIT_INT = 1073741823;
var commonjsGlobal = typeof globalThis !== "undefined" // 'global proper'
? // eslint-disable-next-line no-undef
globalThis : typeof window !== "undefined" ? window // Browser
: typeof global !== "undefined" ? global // node.js
: {};
function getUniqueId() {
var key = "__global_unique_id__";
return commonjsGlobal[key] = (commonjsGlobal[key] || 0) + 1;
} // Inlined Object.is polyfill.
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
function objectIs(x, y) {
if (x === y) {
return x !== 0 || 1 / x === 1 / y;
} else {
// eslint-disable-next-line no-self-compare
return x !== x && y !== y;
}
}
function createEventEmitter(value) {
var handlers = [];
return {
on: function on(handler) {
handlers.push(handler);
},
off: function off(handler) {
handlers = handlers.filter(function (h) {
return h !== handler;
});
},
get: function get() {
return value;
},
set: function set(newValue, changedBits) {
value = newValue;
handlers.forEach(function (handler) {
return handler(value, changedBits);
});
}
};
}
function onlyChild(children) {
return Array.isArray(children) ? children[0] : children;
}
function createReactContext(defaultValue, calculateChangedBits) {
var _Provider$childContex, _Consumer$contextType;
var contextProp = "__create-react-context-" + getUniqueId() + "__";
var Provider = /*#__PURE__*/function (_React$Component) {
_inheritsLoose(Provider, _React$Component);
function Provider() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
_this.emitter = createEventEmitter(_this.props.value);
return _this;
}
var _proto = Provider.prototype;
_proto.getChildContext = function getChildContext() {
var _ref;
return _ref = {}, _ref[contextProp] = this.emitter, _ref;
};
_proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
if (this.props.value !== nextProps.value) {
var oldValue = this.props.value;
var newValue = nextProps.value;
var changedBits;
if (objectIs(oldValue, newValue)) {
changedBits = 0; // No change
} else {
changedBits = typeof calculateChangedBits === "function" ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;
if (process.env.NODE_ENV !== "production") {
process.env.NODE_ENV !== "production" ? warning((changedBits & MAX_SIGNED_31_BIT_INT) === changedBits, "calculateChangedBits: Expected the return value to be a " + "31-bit integer. Instead received: " + changedBits) : void 0;
}
changedBits |= 0;
if (changedBits !== 0) {
this.emitter.set(nextProps.value, changedBits);
}
}
}
};
_proto.render = function render() {
return this.props.children;
};
return Provider;
}(React.Component);
Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = PropTypes.object.isRequired, _Provider$childContex);
var Consumer = /*#__PURE__*/function (_React$Component2) {
_inheritsLoose(Consumer, _React$Component2);
function Consumer() {
var _this2;
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
_this2 = _React$Component2.call.apply(_React$Component2, [this].concat(args)) || this;
_this2.observedBits = void 0;
_this2.state = {
value: _this2.getValue()
};
_this2.onUpdate = function (newValue, changedBits) {
var observedBits = _this2.observedBits | 0;
if ((observedBits & changedBits) !== 0) {
_this2.setState({
value: _this2.getValue()
});
}
};
return _this2;
}
var _proto2 = Consumer.prototype;
_proto2.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
var observedBits = nextProps.observedBits;
this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default
: observedBits;
};
_proto2.componentDidMount = function componentDidMount() {
if (this.context[contextProp]) {
this.context[contextProp].on(this.onUpdate);
}
var observedBits = this.props.observedBits;
this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default
: observedBits;
};
_proto2.componentWillUnmount = function componentWillUnmount() {
if (this.context[contextProp]) {
this.context[contextProp].off(this.onUpdate);
}
};
_proto2.getValue = function getValue() {
if (this.context[contextProp]) {
return this.context[contextProp].get();
} else {
return defaultValue;
}
};
_proto2.render = function render() {
return onlyChild(this.props.children)(this.state.value);
};
return Consumer;
}(React.Component);
Consumer.contextTypes = (_Consumer$contextType = {}, _Consumer$contextType[contextProp] = PropTypes.object, _Consumer$contextType);
return {
Provider: Provider,
Consumer: Consumer
};
}
// MIT License
var createContext = React.createContext || createReactContext;
// TODO: Replace with React.createContext once we can assume React 16+
var createNamedContext = function createNamedContext(name) {
var context = createContext();
context.displayName = name;
return context;
};
var historyContext = /*#__PURE__*/createNamedContext("Router-History");
var context = /*#__PURE__*/createNamedContext("Router");
/**
* The public API for putting history on context.
*/
var Router = /*#__PURE__*/function (_React$Component) {
_inheritsLoose(Router, _React$Component);
Router.computeRootMatch = function computeRootMatch(pathname) {
return {
path: "/",
url: "/",
params: {},
isExact: pathname === "/"
};
};
function Router(props) {
var _this;
_this = _React$Component.call(this, props) || this;
_this.state = {
location: props.history.location
}; // This is a bit of a hack. We have to start listening for location
// changes here in the constructor in case there are any <Redirect>s
// on the initial render. If there are, they will replace/push when
// they mount and since cDM fires in children before parents, we may
// get a new location before the <Router> is mounted.
_this._isMounted = false;
_this._pendingLocation = null;
if (!props.staticContext) {
_this.unlisten = props.history.listen(function (location) {
_this._pendingLocation = location;
});
}
return _this;
}
var _proto = Router.prototype;
_proto.componentDidMount = function componentDidMount() {
var _this2 = this;
this._isMounted = true;
if (this.unlisten) {
// Any pre-mount location changes have been captured at
// this point, so unregister the listener.
this.unlisten();
}
if (!this.props.staticContext) {
this.unlisten = this.props.history.listen(function (location) {
if (_this2._isMounted) {
_this2.setState({
location: location
});
}
});
}
if (this._pendingLocation) {
this.setState({
location: this._pendingLocation
});
}
};
_proto.componentWillUnmount = function componentWillUnmount() {
if (this.unlisten) {
this.unlisten();
this._isMounted = false;
this._pendingLocation = null;
}
};
_proto.render = function render() {
return /*#__PURE__*/React.createElement(context.Provider, {
value: {
history: this.props.history,
location: this.state.location,
match: Router.computeRootMatch(this.state.location.pathname),
staticContext: this.props.staticContext
}
}, /*#__PURE__*/React.createElement(historyContext.Provider, {
children: this.props.children || null,
value: this.props.history
}));
};
return Router;
}(React.Component);
if (process.env.NODE_ENV !== "production") {
Router.propTypes = {
children: PropTypes.node,
history: PropTypes.object.isRequired,
staticContext: PropTypes.object
};
Router.prototype.componentDidUpdate = function (prevProps) {
process.env.NODE_ENV !== "production" ? warning(prevProps.history === this.props.history, "You cannot change <Router history>") : void 0;
};
}
/**
* The public API for a <Router> that stores location in memory.
*/
var MemoryRouter = /*#__PURE__*/function (_React$Component) {
_inheritsLoose(MemoryRouter, _React$Component);
function MemoryRouter() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
_this.history = createMemoryHistory(_this.props);
return _this;
}
var _proto = MemoryRouter.prototype;
_proto.render = function render() {
return /*#__PURE__*/React.createElement(Router, {
history: this.history,
children: this.props.children
});
};
return MemoryRouter;
}(React.Component);
if (process.env.NODE_ENV !== "production") {
MemoryRouter.propTypes = {
initialEntries: PropTypes.array,
initialIndex: PropTypes.number,
getUserConfirmation: PropTypes.func,
keyLength: PropTypes.number,
children: PropTypes.node
};
MemoryRouter.prototype.componentDidMount = function () {
process.env.NODE_ENV !== "production" ? warning(!this.props.history, "<MemoryRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { MemoryRouter as Router }`.") : void 0;
};
}
var Lifecycle = /*#__PURE__*/function (_React$Component) {
_inheritsLoose(Lifecycle, _React$Component);
function Lifecycle() {
return _React$Component.apply(this, arguments) || this;
}
var _proto = Lifecycle.prototype;
_proto.componentDidMount = function componentDidMount() {
if (this.props.onMount) this.props.onMount.call(this, this);
};
_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
if (this.props.onUpdate) this.props.onUpdate.call(this, this, prevProps);
};
_proto.componentWillUnmount = function componentWillUnmount() {
if (this.props.onUnmount) this.props.onUnmount.call(this, this);
};
_proto.render = function render() {
return null;
};
return Lifecycle;
}(React.Component);
/**
* The public API for prompting the user before navigating away from a screen.
*/
function Prompt(_ref) {
var message = _ref.message,
_ref$when = _ref.when,
when = _ref$when === void 0 ? true : _ref$when;
return /*#__PURE__*/React.createElement(context.Consumer, null, function (context) {
!context ? process.env.NODE_ENV !== "production" ? invariant(false, "You should not use <Prompt> outside a <Router>") : invariant(false) : void 0;
if (!when || context.staticContext) return null;
var method = context.history.block;
return /*#__PURE__*/React.createElement(Lifecycle, {
onMount: function onMount(self) {
self.release = method(message);
},
onUpdate: function onUpdate(self, prevProps) {
if (prevProps.message !== message) {
self.release();
self.release = method(message);
}
},
onUnmount: function onUnmount(self) {
self.release();
},
message: message
});
});
}
if (process.env.NODE_ENV !== "production") {
var messageType = PropTypes.oneOfType([PropTypes.func, PropTypes.string]);
Prompt.propTypes = {
when: PropTypes.bool,
message: messageType.isRequired
};
}
var cache = {};
var cacheLimit = 10000;
var cacheCount = 0;
function compilePath(path) {
if (cache[path]) return cache[path];
var generator = pathToRegexp.compile(path);
if (cacheCount < cacheLimit) {
cache[path] = generator;
cacheCount++;
}
return generator;
}
/**
* Public API for generating a URL pathname from a path and parameters.
*/
function generatePath(path, params) {
if (path === void 0) {
path = "/";
}
if (params === void 0) {
params = {};
}
return path === "/" ? path : compilePath(path)(params, {
pretty: true
});
}
/**
* The public API for navigating programmatically with a component.
*/
function Redirect(_ref) {
var computedMatch = _ref.computedMatch,
to = _ref.to,
_ref$push = _ref.push,
push = _ref$push === void 0 ? false : _ref$push;
return /*#__PURE__*/React.createElement(context.Consumer, null, function (context) {
!context ? process.env.NODE_ENV !== "production" ? invariant(false, "You should not use <Redirect> outside a <Router>") : invariant(false) : void 0;
var history = context.history,
staticContext = context.staticContext;
var method = push ? history.push : history.replace;
var location = createLocation(computedMatch ? typeof to === "string" ? generatePath(to, computedMatch.params) : _extends({}, to, {
pathname: generatePath(to.pathname, computedMatch.params)
}) : to); // When rendering in a static context,
// set the new location immediately.
if (staticContext) {
method(location);
return null;
}
return /*#__PURE__*/React.createElement(Lifecycle, {
onMount: function onMount() {
method(location);
},
onUpdate: function onUpdate(self, prevProps) {
var prevLocation = createLocation(prevProps.to);
if (!locationsAreEqual(prevLocation, _extends({}, location, {
key: prevLocation.key
}))) {
method(location);
}
},
to: to
});
});
}
if (process.env.NODE_ENV !== "production") {
Redirect.propTypes = {
push: PropTypes.bool,
from: PropTypes.string,
to: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired
};
}
var cache$1 = {};
var cacheLimit$1 = 10000;
var cacheCount$1 = 0;
function compilePath$1(path, options) {
var cacheKey = "" + options.end + options.strict + options.sensitive;
var pathCache = cache$1[cacheKey] || (cache$1[cacheKey] = {});
if (pathCache[path]) return pathCache[path];
var keys = [];
var regexp = pathToRegexp(path, keys, options);
var result = {
regexp: regexp,
keys: keys
};
if (cacheCount$1 < cacheLimit$1) {
pathCache[path] = result;
cacheCount$1++;
}
return result;
}
/**
* Public API for matching a URL pathname to a path.
*/
function matchPath(pathname, options) {
if (options === void 0) {
options = {};
}
if (typeof options === "string" || Array.isArray(options)) {
options = {
path: options
};
}
var _options = options,
path = _options.path,
_options$exact = _options.exact,
exact = _options$exact === void 0 ? false : _options$exact,
_options$strict = _options.strict,
strict = _options$strict === void 0 ? false : _options$strict,
_options$sensitive = _options.sensitive,
sensitive = _options$sensitive === void 0 ? false : _options$sensitive;
var paths = [].concat(path);
return paths.reduce(function (matched, path) {
if (!path && path !== "") return null;
if (matched) return matched;
var _compilePath = compilePath$1(path, {
end: exact,
strict: strict,
sensitive: sensitive
}),
regexp = _compilePath.regexp,
keys = _compilePath.keys;
var match = regexp.exec(pathname);
if (!match) return null;
var url = match[0],
values = match.slice(1);
var isExact = pathname === url;
if (exact && !isExact) return null;
return {
path: path,
// the path used to match
url: path === "/" && url === "" ? "/" : url,
// the matched portion of the URL
isExact: isExact,
// whether or not we matched exactly
params: keys.reduce(function (memo, key, index) {
memo[key.name] = values[index];
return memo;
}, {})
};
}, null);
}
function isEmptyChildren(children) {
return React.Children.count(children) === 0;
}
function evalChildrenDev(children, props, path) {
var value = children(props);
process.env.NODE_ENV !== "production" ? warning(value !== undefined, "You returned `undefined` from the `children` function of " + ("<Route" + (path ? " path=\"" + path + "\"" : "") + ">, but you ") + "should have returned a React element or `null`") : void 0;
return value || null;
}
/**
* The public API for matching a single path and rendering.
*/
var Route = /*#__PURE__*/function (_React$Component) {
_inheritsLoose(Route, _React$Component);
function Route() {
return _React$Component.apply(this, arguments) || this;
}
var _proto = Route.prototype;
_proto.render = function render() {
var _this = this;
return /*#__PURE__*/React.createElement(context.Consumer, null, function (context$1) {
!context$1 ? process.env.NODE_ENV !== "production" ? invariant(false, "You should not use <Route> outside a <Router>") : invariant(false) : void 0;
var location = _this.props.location || context$1.location;
var match = _this.props.computedMatch ? _this.props.computedMatch // <Switch> already computed the match for us
: _this.props.path ? matchPath(location.pathname, _this.props) : context$1.match;
var props = _extends({}, context$1, {
location: location,
match: match
});
var _this$props = _this.props,
children = _this$props.children,
component = _this$props.component,
render = _this$props.render; // Preact uses an empty array as children by
// default, so use null if that's the case.
if (Array.isArray(children) && isEmptyChildren(children)) {
children = null;
}
return /*#__PURE__*/React.createElement(context.Provider, {
value: props
}, props.match ? children ? typeof children === "function" ? process.env.NODE_ENV !== "production" ? evalChildrenDev(children, props, _this.props.path) : children(props) : children : component ? /*#__PURE__*/React.createElement(component, props) : render ? render(props) : null : typeof children === "function" ? process.env.NODE_ENV !== "production" ? evalChildrenDev(children, props, _this.props.path) : children(props) : null);
});
};
return Route;
}(React.Component);
if (process.env.NODE_ENV !== "production") {
Route.propTypes = {
children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
component: function component(props, propName) {
if (props[propName] && !isValidElementType(props[propName])) {
return new Error("Invalid prop 'component' supplied to 'Route': the prop is not a valid React component");
}
},
exact: PropTypes.bool,
location: PropTypes.object,
path: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
render: PropTypes.func,
sensitive: PropTypes.bool,
strict: PropTypes.bool
};
Route.prototype.componentDidMount = function () {
process.env.NODE_ENV !== "production" ? warning(!(this.props.children && !isEmptyChildren(this.props.children) && this.props.component), "You should not use <Route component> and <Route children> in the same route; <Route component> will be ignored") : void 0;
process.env.NODE_ENV !== "production" ? warning(!(this.props.children && !isEmptyChildren(this.props.children) && this.props.render), "You should not use <Route render> and <Route children> in the same route; <Route render> will be ignored") : void 0;
process.env.NODE_ENV !== "production" ? warning(!(this.props.component && this.props.render), "You should not use <Route component> and <Route render> in the same route; <Route render> will be ignored") : void 0;
};
Route.prototype.componentDidUpdate = function (prevProps) {
process.env.NODE_ENV !== "production" ? warning(!(this.props.location && !prevProps.location), '<Route> elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.') : void 0;
process.env.NODE_ENV !== "production" ? warning(!(!this.props.location && prevProps.location), '<Route> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.') : void 0;
};
}
function addLeadingSlash(path) {
return path.charAt(0) === "/" ? path : "/" + path;
}
function addBasename(basename, location) {
if (!basename) return location;
return _extends({}, location, {
pathname: addLeadingSlash(basename) + location.pathname
});
}
function stripBasename(basename, location) {
if (!basename) return location;
var base = addLeadingSlash(basename);
if (location.pathname.indexOf(base) !== 0) return location;
return _extends({}, location, {
pathname: location.pathname.substr(base.length)
});
}
function createURL(location) {
return typeof location === "string" ? location : createPath(location);
}
function staticHandler(methodName) {
return function () {
process.env.NODE_ENV !== "production" ? invariant(false, "You cannot %s with <StaticRouter>", methodName) : invariant(false) ;
};
}
function noop() {}
/**
* The public top-level API for a "static" <Router>, so-called because it
* can't actually change the current location. Instead, it just records
* location changes in a context object. Useful mainly in testing and
* server-rendering scenarios.
*/
var StaticRouter = /*#__PURE__*/function (_React$Component) {
_inheritsLoose(StaticRouter, _React$Component);
function StaticRouter() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
_this.handlePush = function (location) {
return _this.navigateTo(location, "PUSH");
};
_this.handleReplace = function (location) {
return _this.navigateTo(location, "REPLACE");
};
_this.handleListen = function () {
return noop;
};
_this.handleBlock = function () {
return noop;
};
return _this;
}
var _proto = StaticRouter.prototype;
_proto.navigateTo = function navigateTo(location, action) {
var _this$props = this.props,
_this$props$basename = _this$props.basename,
basename = _this$props$basename === void 0 ? "" : _this$props$basename,
_this$props$context = _this$props.context,
context = _this$props$context === void 0 ? {} : _this$props$context;
context.action = action;
context.location = addBasename(basename, createLocation(location));
context.url = createURL(context.location);
};
_proto.render = function render() {
var _this$props2 = this.props,
_this$props2$basename = _this$props2.basename,
basename = _this$props2$basename === void 0 ? "" : _this$props2$basename,
_this$props2$context = _this$props2.context,
context = _this$props2$context === void 0 ? {} : _this$props2$context,
_this$props2$location = _this$props2.location,
location = _this$props2$location === void 0 ? "/" : _this$props2$location,
rest = _objectWithoutPropertiesLoose(_this$props2, ["basename", "context", "location"]);
var history = {
createHref: function createHref(path) {
return addLeadingSlash(basename + createURL(path));
},
action: "POP",
location: stripBasename(basename, createLocation(location)),
push: this.handlePush,
replace: this.handleReplace,
go: staticHandler("go"),
goBack: staticHandler("goBack"),
goForward: staticHandler("goForward"),
listen: this.handleListen,
block: this.handleBlock
};
return /*#__PURE__*/React.createElement(Router, _extends({}, rest, {
history: history,
staticContext: context
}));
};
return StaticRouter;
}(React.Component);
if (process.env.NODE_ENV !== "production") {
StaticRouter.propTypes = {
basename: PropTypes.string,
context: PropTypes.object,
location: PropTypes.oneOfType([PropTypes.string, PropTypes.object])
};
StaticRouter.prototype.componentDidMount = function () {
process.env.NODE_ENV !== "production" ? warning(!this.props.history, "<StaticRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { StaticRouter as Router }`.") : void 0;
};
}
/**
* The public API for rendering the first <Route> that matches.
*/
var Switch = /*#__PURE__*/function (_React$Component) {
_inheritsLoose(Switch, _React$Component);
function Switch() {
return _React$Component.apply(this, arguments) || this;
}
var _proto = Switch.prototype;
_proto.render = function render() {
var _this = this;
return /*#__PURE__*/React.createElement(context.Consumer, null, function (context) {
!context ? process.env.NODE_ENV !== "production" ? invariant(false, "You should not use <Switch> outside a <Router>") : invariant(false) : void 0;
var location = _this.props.location || context.location;
var element, match; // We use React.Children.forEach instead of React.Children.toArray().find()
// here because toArray adds keys to all child elements and we do not want
// to trigger an unmount/remount for two <Route>s that render the same
// component at different URLs.
React.Children.forEach(_this.props.children, function (child) {
if (match == null && /*#__PURE__*/React.isValidElement(child)) {
element = child;
var path = child.props.path || child.props.from;
match = path ? matchPath(location.pathname, _extends({}, child.props, {
path: path
})) : context.match;
}
});
return match ? /*#__PURE__*/React.cloneElement(element, {
location: location,
computedMatch: match
}) : null;
});
};
return Switch;
}(React.Component);
if (process.env.NODE_ENV !== "production") {
Switch.propTypes = {
children: PropTypes.node,
location: PropTypes.object
};
Switch.prototype.componentDidUpdate = function (prevProps) {
process.env.NODE_ENV !== "production" ? warning(!(this.props.location && !prevProps.location), '<Switch> elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.') : void 0;
process.env.NODE_ENV !== "production" ? warning(!(!this.props.location && prevProps.location), '<Switch> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.') : void 0;
};
}
/**
* A public higher-order component to access the imperative API
*/
function withRouter(Component) {
var displayName = "withRouter(" + (Component.displayName || Component.name) + ")";
var C = function C(props) {
var wrappedComponentRef = props.wrappedComponentRef,
remainingProps = _objectWithoutPropertiesLoose(props, ["wrappedComponentRef"]);
return /*#__PURE__*/React.createElement(context.Consumer, null, function (context) {
!context ? process.env.NODE_ENV !== "production" ? invariant(false, "You should not use <" + displayName + " /> outside a <Router>") : invariant(false) : void 0;
return /*#__PURE__*/React.createElement(Component, _extends({}, remainingProps, context, {
ref: wrappedComponentRef
}));
});
};
C.displayName = displayName;
C.WrappedComponent = Component;
if (process.env.NODE_ENV !== "production") {
C.propTypes = {
wrappedComponentRef: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.object])
};
}
return hoistStatics(C, Component);
}
var useContext = React.useContext;
function useHistory() {
if (process.env.NODE_ENV !== "production") {
!(typeof useContext === "function") ? process.env.NODE_ENV !== "production" ? invariant(false, "You must use React >= 16.8 in order to use useHistory()") : invariant(false) : void 0;
}
return useContext(historyContext);
}
function useLocation() {
if (process.env.NODE_ENV !== "production") {
!(typeof useContext === "function") ? process.env.NODE_ENV !== "production" ? invariant(false, "You must use React >= 16.8 in order to use useLocation()") : invariant(false) : void 0;
}
return useContext(context).location;
}
function useParams() {
if (process.env.NODE_ENV !== "production") {
!(typeof useContext === "function") ? process.env.NODE_ENV !== "production" ? invariant(false, "You must use React >= 16.8 in order to use useParams()") : invariant(false) : void 0;
}
var match = useContext(context).match;
return match ? match.params : {};
}
function useRouteMatch(path) {
if (process.env.NODE_ENV !== "production") {
!(typeof useContext === "function") ? process.env.NODE_ENV !== "production" ? invariant(false, "You must use React >= 16.8 in order to use useRouteMatch()") : invariant(false) : void 0;
}
var location = useLocation();
var match = useContext(context).match;
return path ? matchPath(location.pathname, path) : match;
}
if (process.env.NODE_ENV !== "production") {
if (typeof window !== "undefined") {
var global$1 = window;
var key = "__react_router_build__";
var buildNames = {
cjs: "CommonJS",
esm: "ES modules",
umd: "UMD"
};
if (global$1[key] && global$1[key] !== "esm") {
var initialBuildName = buildNames[global$1[key]];
var secondaryBuildName = buildNames["esm"]; // TODO: Add link to article that explains in detail how to avoid
// loading 2 different builds.
throw new Error("You are loading the " + secondaryBuildName + " build of React Router " + ("on a page that is already running the " + initialBuildName + " ") + "build, so things won't work right.");
}
global$1[key] = "esm";
}
}
export { MemoryRouter, Prompt, Redirect, Route, Router, StaticRouter, Switch, historyContext as __HistoryContext, context as __RouterContext, generatePath, matchPath, useHistory, useLocation, useParams, useRouteMatch, withRouter };
//# sourceMappingURL=react-router.js.map

1
node_modules/react-router/esm/react-router.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

3
node_modules/react-router/generatePath.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
"use strict";
require("./warnAboutDeprecatedCJSRequire")("generatePath");
module.exports = require("./index.js").generatePath;

7
node_modules/react-router/index.js generated vendored Normal file
View File

@@ -0,0 +1,7 @@
"use strict";
if (process.env.NODE_ENV === "production") {
module.exports = require("./cjs/react-router.min.js");
} else {
module.exports = require("./cjs/react-router.js");
}

3
node_modules/react-router/matchPath.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
"use strict";
require("./warnAboutDeprecatedCJSRequire")("matchPath");
module.exports = require("./index.js").matchPath;

4
node_modules/react-router/modules/HistoryContext.js generated vendored Normal file
View File

@@ -0,0 +1,4 @@
import createNamedContext from "./createNamedContext";
const historyContext = /*#__PURE__*/ createNamedContext("Router-History");
export default historyContext;

21
node_modules/react-router/modules/Lifecycle.js generated vendored Normal file
View File

@@ -0,0 +1,21 @@
import React from "react";
class Lifecycle extends React.Component {
componentDidMount() {
if (this.props.onMount) this.props.onMount.call(this, this);
}
componentDidUpdate(prevProps) {
if (this.props.onUpdate) this.props.onUpdate.call(this, this, prevProps);
}
componentWillUnmount() {
if (this.props.onUnmount) this.props.onUnmount.call(this, this);
}
render() {
return null;
}
}
export default Lifecycle;

37
node_modules/react-router/modules/MemoryRouter.js generated vendored Normal file
View File

@@ -0,0 +1,37 @@
import React from "react";
import PropTypes from "prop-types";
import { createMemoryHistory as createHistory } from "history";
import warning from "tiny-warning";
import Router from "./Router.js";
/**
* The public API for a <Router> that stores location in memory.
*/
class MemoryRouter extends React.Component {
history = createHistory(this.props);
render() {
return <Router history={this.history} children={this.props.children} />;
}
}
if (__DEV__) {
MemoryRouter.propTypes = {
initialEntries: PropTypes.array,
initialIndex: PropTypes.number,
getUserConfirmation: PropTypes.func,
keyLength: PropTypes.number,
children: PropTypes.node
};
MemoryRouter.prototype.componentDidMount = function() {
warning(
!this.props.history,
"<MemoryRouter> ignores the history prop. To use a custom history, " +
"use `import { Router }` instead of `import { MemoryRouter as Router }`."
);
};
}
export default MemoryRouter;

52
node_modules/react-router/modules/Prompt.js generated vendored Normal file
View File

@@ -0,0 +1,52 @@
import React from "react";
import PropTypes from "prop-types";
import invariant from "tiny-invariant";
import Lifecycle from "./Lifecycle.js";
import RouterContext from "./RouterContext.js";
/**
* The public API for prompting the user before navigating away from a screen.
*/
function Prompt({ message, when = true }) {
return (
<RouterContext.Consumer>
{context => {
invariant(context, "You should not use <Prompt> outside a <Router>");
if (!when || context.staticContext) return null;
const method = context.history.block;
return (
<Lifecycle
onMount={self => {
self.release = method(message);
}}
onUpdate={(self, prevProps) => {
if (prevProps.message !== message) {
self.release();
self.release = method(message);
}
}}
onUnmount={self => {
self.release();
}}
message={message}
/>
);
}}
</RouterContext.Consumer>
);
}
if (__DEV__) {
const messageType = PropTypes.oneOfType([PropTypes.func, PropTypes.string]);
Prompt.propTypes = {
when: PropTypes.bool,
message: messageType.isRequired
};
}
export default Prompt;

72
node_modules/react-router/modules/Redirect.js generated vendored Normal file
View File

@@ -0,0 +1,72 @@
import React from "react";
import PropTypes from "prop-types";
import { createLocation, locationsAreEqual } from "history";
import invariant from "tiny-invariant";
import Lifecycle from "./Lifecycle.js";
import RouterContext from "./RouterContext.js";
import generatePath from "./generatePath.js";
/**
* The public API for navigating programmatically with a component.
*/
function Redirect({ computedMatch, to, push = false }) {
return (
<RouterContext.Consumer>
{context => {
invariant(context, "You should not use <Redirect> outside a <Router>");
const { history, staticContext } = context;
const method = push ? history.push : history.replace;
const location = createLocation(
computedMatch
? typeof to === "string"
? generatePath(to, computedMatch.params)
: {
...to,
pathname: generatePath(to.pathname, computedMatch.params)
}
: to
);
// When rendering in a static context,
// set the new location immediately.
if (staticContext) {
method(location);
return null;
}
return (
<Lifecycle
onMount={() => {
method(location);
}}
onUpdate={(self, prevProps) => {
const prevLocation = createLocation(prevProps.to);
if (
!locationsAreEqual(prevLocation, {
...location,
key: prevLocation.key
})
) {
method(location);
}
}}
to={to}
/>
);
}}
</RouterContext.Consumer>
);
}
if (__DEV__) {
Redirect.propTypes = {
push: PropTypes.bool,
from: PropTypes.string,
to: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired
};
}
export default Redirect;

140
node_modules/react-router/modules/Route.js generated vendored Normal file
View File

@@ -0,0 +1,140 @@
import React from "react";
import { isValidElementType } from "react-is";
import PropTypes from "prop-types";
import invariant from "tiny-invariant";
import warning from "tiny-warning";
import RouterContext from "./RouterContext.js";
import matchPath from "./matchPath.js";
function isEmptyChildren(children) {
return React.Children.count(children) === 0;
}
function evalChildrenDev(children, props, path) {
const value = children(props);
warning(
value !== undefined,
"You returned `undefined` from the `children` function of " +
`<Route${path ? ` path="${path}"` : ""}>, but you ` +
"should have returned a React element or `null`"
);
return value || null;
}
/**
* The public API for matching a single path and rendering.
*/
class Route extends React.Component {
render() {
return (
<RouterContext.Consumer>
{context => {
invariant(context, "You should not use <Route> outside a <Router>");
const location = this.props.location || context.location;
const match = this.props.computedMatch
? this.props.computedMatch // <Switch> already computed the match for us
: this.props.path
? matchPath(location.pathname, this.props)
: context.match;
const props = { ...context, location, match };
let { children, component, render } = this.props;
// Preact uses an empty array as children by
// default, so use null if that's the case.
if (Array.isArray(children) && isEmptyChildren(children)) {
children = null;
}
return (
<RouterContext.Provider value={props}>
{props.match
? children
? typeof children === "function"
? __DEV__
? evalChildrenDev(children, props, this.props.path)
: children(props)
: children
: component
? React.createElement(component, props)
: render
? render(props)
: null
: typeof children === "function"
? __DEV__
? evalChildrenDev(children, props, this.props.path)
: children(props)
: null}
</RouterContext.Provider>
);
}}
</RouterContext.Consumer>
);
}
}
if (__DEV__) {
Route.propTypes = {
children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
component: (props, propName) => {
if (props[propName] && !isValidElementType(props[propName])) {
return new Error(
`Invalid prop 'component' supplied to 'Route': the prop is not a valid React component`
);
}
},
exact: PropTypes.bool,
location: PropTypes.object,
path: PropTypes.oneOfType([
PropTypes.string,
PropTypes.arrayOf(PropTypes.string)
]),
render: PropTypes.func,
sensitive: PropTypes.bool,
strict: PropTypes.bool
};
Route.prototype.componentDidMount = function() {
warning(
!(
this.props.children &&
!isEmptyChildren(this.props.children) &&
this.props.component
),
"You should not use <Route component> and <Route children> in the same route; <Route component> will be ignored"
);
warning(
!(
this.props.children &&
!isEmptyChildren(this.props.children) &&
this.props.render
),
"You should not use <Route render> and <Route children> in the same route; <Route render> will be ignored"
);
warning(
!(this.props.component && this.props.render),
"You should not use <Route component> and <Route render> in the same route; <Route render> will be ignored"
);
};
Route.prototype.componentDidUpdate = function(prevProps) {
warning(
!(this.props.location && !prevProps.location),
'<Route> elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'
);
warning(
!(!this.props.location && prevProps.location),
'<Route> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.'
);
};
}
export default Route;

100
node_modules/react-router/modules/Router.js generated vendored Normal file
View File

@@ -0,0 +1,100 @@
import React from "react";
import PropTypes from "prop-types";
import warning from "tiny-warning";
import HistoryContext from "./HistoryContext.js";
import RouterContext from "./RouterContext.js";
/**
* The public API for putting history on context.
*/
class Router extends React.Component {
static computeRootMatch(pathname) {
return { path: "/", url: "/", params: {}, isExact: pathname === "/" };
}
constructor(props) {
super(props);
this.state = {
location: props.history.location
};
// This is a bit of a hack. We have to start listening for location
// changes here in the constructor in case there are any <Redirect>s
// on the initial render. If there are, they will replace/push when
// they mount and since cDM fires in children before parents, we may
// get a new location before the <Router> is mounted.
this._isMounted = false;
this._pendingLocation = null;
if (!props.staticContext) {
this.unlisten = props.history.listen(location => {
this._pendingLocation = location;
});
}
}
componentDidMount() {
this._isMounted = true;
if (this.unlisten) {
// Any pre-mount location changes have been captured at
// this point, so unregister the listener.
this.unlisten();
}
if (!this.props.staticContext) {
this.unlisten = this.props.history.listen(location => {
if (this._isMounted) {
this.setState({ location });
}
});
}
if (this._pendingLocation) {
this.setState({ location: this._pendingLocation });
}
}
componentWillUnmount() {
if (this.unlisten) {
this.unlisten();
this._isMounted = false;
this._pendingLocation = null;
}
}
render() {
return (
<RouterContext.Provider
value={{
history: this.props.history,
location: this.state.location,
match: Router.computeRootMatch(this.state.location.pathname),
staticContext: this.props.staticContext
}}
>
<HistoryContext.Provider
children={this.props.children || null}
value={this.props.history}
/>
</RouterContext.Provider>
);
}
}
if (__DEV__) {
Router.propTypes = {
children: PropTypes.node,
history: PropTypes.object.isRequired,
staticContext: PropTypes.object
};
Router.prototype.componentDidUpdate = function(prevProps) {
warning(
prevProps.history === this.props.history,
"You cannot change <Router history>"
);
};
}
export default Router;

4
node_modules/react-router/modules/RouterContext.js generated vendored Normal file
View File

@@ -0,0 +1,4 @@
import createNamedContext from "./createNamedContext";
const context = /*#__PURE__*/ createNamedContext("Router");
export default context;

102
node_modules/react-router/modules/StaticRouter.js generated vendored Normal file
View File

@@ -0,0 +1,102 @@
import React from "react";
import PropTypes from "prop-types";
import { createLocation, createPath } from "history";
import invariant from "tiny-invariant";
import warning from "tiny-warning";
import Router from "./Router.js";
function addLeadingSlash(path) {
return path.charAt(0) === "/" ? path : "/" + path;
}
function addBasename(basename, location) {
if (!basename) return location;
return {
...location,
pathname: addLeadingSlash(basename) + location.pathname
};
}
function stripBasename(basename, location) {
if (!basename) return location;
const base = addLeadingSlash(basename);
if (location.pathname.indexOf(base) !== 0) return location;
return {
...location,
pathname: location.pathname.substr(base.length)
};
}
function createURL(location) {
return typeof location === "string" ? location : createPath(location);
}
function staticHandler(methodName) {
return () => {
invariant(false, "You cannot %s with <StaticRouter>", methodName);
};
}
function noop() {}
/**
* The public top-level API for a "static" <Router>, so-called because it
* can't actually change the current location. Instead, it just records
* location changes in a context object. Useful mainly in testing and
* server-rendering scenarios.
*/
class StaticRouter extends React.Component {
navigateTo(location, action) {
const { basename = "", context = {} } = this.props;
context.action = action;
context.location = addBasename(basename, createLocation(location));
context.url = createURL(context.location);
}
handlePush = location => this.navigateTo(location, "PUSH");
handleReplace = location => this.navigateTo(location, "REPLACE");
handleListen = () => noop;
handleBlock = () => noop;
render() {
const { basename = "", context = {}, location = "/", ...rest } = this.props;
const history = {
createHref: path => addLeadingSlash(basename + createURL(path)),
action: "POP",
location: stripBasename(basename, createLocation(location)),
push: this.handlePush,
replace: this.handleReplace,
go: staticHandler("go"),
goBack: staticHandler("goBack"),
goForward: staticHandler("goForward"),
listen: this.handleListen,
block: this.handleBlock
};
return <Router {...rest} history={history} staticContext={context} />;
}
}
if (__DEV__) {
StaticRouter.propTypes = {
basename: PropTypes.string,
context: PropTypes.object,
location: PropTypes.oneOfType([PropTypes.string, PropTypes.object])
};
StaticRouter.prototype.componentDidMount = function() {
warning(
!this.props.history,
"<StaticRouter> ignores the history prop. To use a custom history, " +
"use `import { Router }` instead of `import { StaticRouter as Router }`."
);
};
}
export default StaticRouter;

67
node_modules/react-router/modules/Switch.js generated vendored Normal file
View File

@@ -0,0 +1,67 @@
import React from "react";
import PropTypes from "prop-types";
import invariant from "tiny-invariant";
import warning from "tiny-warning";
import RouterContext from "./RouterContext.js";
import matchPath from "./matchPath.js";
/**
* The public API for rendering the first <Route> that matches.
*/
class Switch extends React.Component {
render() {
return (
<RouterContext.Consumer>
{context => {
invariant(context, "You should not use <Switch> outside a <Router>");
const location = this.props.location || context.location;
let element, match;
// We use React.Children.forEach instead of React.Children.toArray().find()
// here because toArray adds keys to all child elements and we do not want
// to trigger an unmount/remount for two <Route>s that render the same
// component at different URLs.
React.Children.forEach(this.props.children, child => {
if (match == null && React.isValidElement(child)) {
element = child;
const path = child.props.path || child.props.from;
match = path
? matchPath(location.pathname, { ...child.props, path })
: context.match;
}
});
return match
? React.cloneElement(element, { location, computedMatch: match })
: null;
}}
</RouterContext.Consumer>
);
}
}
if (__DEV__) {
Switch.propTypes = {
children: PropTypes.node,
location: PropTypes.object
};
Switch.prototype.componentDidUpdate = function(prevProps) {
warning(
!(this.props.location && !prevProps.location),
'<Switch> elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'
);
warning(
!(!this.props.location && prevProps.location),
'<Switch> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.'
);
};
}
export default Switch;

8
node_modules/react-router/modules/createContext.js generated vendored Normal file
View File

@@ -0,0 +1,8 @@
// MIT License
// Copyright (c) 2019-present StringEpsilon <StringEpsilon@gmail.com>
// Copyright (c) 2017-2019 James Kyle <me@thejameskyle.com>
// https://github.com/StringEpsilon/mini-create-react-context
import React from "react";
import createReactContext from "./miniCreateReactContext";
export default React.createContext || createReactContext;

View File

@@ -0,0 +1,11 @@
// TODO: Replace with React.createContext once we can assume React 16+
import createContext from "./createContext";
const createNamedContext = name => {
const context = createContext();
context.displayName = name;
return context;
};
export default createNamedContext;

27
node_modules/react-router/modules/generatePath.js generated vendored Normal file
View File

@@ -0,0 +1,27 @@
import pathToRegexp from "path-to-regexp";
const cache = {};
const cacheLimit = 10000;
let cacheCount = 0;
function compilePath(path) {
if (cache[path]) return cache[path];
const generator = pathToRegexp.compile(path);
if (cacheCount < cacheLimit) {
cache[path] = generator;
cacheCount++;
}
return generator;
}
/**
* Public API for generating a URL pathname from a path and parameters.
*/
function generatePath(path = "/", params = {}) {
return path === "/" ? path : compilePath(path)(params, { pretty: true });
}
export default generatePath;

55
node_modules/react-router/modules/hooks.js generated vendored Normal file
View File

@@ -0,0 +1,55 @@
import React from "react";
import invariant from "tiny-invariant";
import RouterContext from "./RouterContext.js";
import HistoryContext from "./HistoryContext.js";
import matchPath from "./matchPath.js";
const useContext = React.useContext;
export function useHistory() {
if (__DEV__) {
invariant(
typeof useContext === "function",
"You must use React >= 16.8 in order to use useHistory()"
);
}
return useContext(HistoryContext);
}
export function useLocation() {
if (__DEV__) {
invariant(
typeof useContext === "function",
"You must use React >= 16.8 in order to use useLocation()"
);
}
return useContext(RouterContext).location;
}
export function useParams() {
if (__DEV__) {
invariant(
typeof useContext === "function",
"You must use React >= 16.8 in order to use useParams()"
);
}
const match = useContext(RouterContext).match;
return match ? match.params : {};
}
export function useRouteMatch(path) {
if (__DEV__) {
invariant(
typeof useContext === "function",
"You must use React >= 16.8 in order to use useRouteMatch()"
);
}
const location = useLocation();
const match = useContext(RouterContext).match;
return path ? matchPath(location.pathname, path) : match;
}

38
node_modules/react-router/modules/index.js generated vendored Normal file
View File

@@ -0,0 +1,38 @@
if (__DEV__) {
if (typeof window !== "undefined") {
const global = window;
const key = "__react_router_build__";
const buildNames = { cjs: "CommonJS", esm: "ES modules", umd: "UMD" };
if (global[key] && global[key] !== process.env.BUILD_FORMAT) {
const initialBuildName = buildNames[global[key]];
const secondaryBuildName = buildNames[process.env.BUILD_FORMAT];
// TODO: Add link to article that explains in detail how to avoid
// loading 2 different builds.
throw new Error(
`You are loading the ${secondaryBuildName} build of React Router ` +
`on a page that is already running the ${initialBuildName} ` +
`build, so things won't work right.`
);
}
global[key] = process.env.BUILD_FORMAT;
}
}
export { default as MemoryRouter } from "./MemoryRouter.js";
export { default as Prompt } from "./Prompt.js";
export { default as Redirect } from "./Redirect.js";
export { default as Route } from "./Route.js";
export { default as Router } from "./Router.js";
export { default as StaticRouter } from "./StaticRouter.js";
export { default as Switch } from "./Switch.js";
export { default as generatePath } from "./generatePath.js";
export { default as matchPath } from "./matchPath.js";
export { default as withRouter } from "./withRouter.js";
export { default as __HistoryContext } from "./HistoryContext.js";
export { default as __RouterContext } from "./RouterContext.js";
export { useHistory, useLocation, useParams, useRouteMatch } from "./hooks.js";

67
node_modules/react-router/modules/matchPath.js generated vendored Normal file
View File

@@ -0,0 +1,67 @@
import pathToRegexp from "path-to-regexp";
const cache = {};
const cacheLimit = 10000;
let cacheCount = 0;
function compilePath(path, options) {
const cacheKey = `${options.end}${options.strict}${options.sensitive}`;
const pathCache = cache[cacheKey] || (cache[cacheKey] = {});
if (pathCache[path]) return pathCache[path];
const keys = [];
const regexp = pathToRegexp(path, keys, options);
const result = { regexp, keys };
if (cacheCount < cacheLimit) {
pathCache[path] = result;
cacheCount++;
}
return result;
}
/**
* Public API for matching a URL pathname to a path.
*/
function matchPath(pathname, options = {}) {
if (typeof options === "string" || Array.isArray(options)) {
options = { path: options };
}
const { path, exact = false, strict = false, sensitive = false } = options;
const paths = [].concat(path);
return paths.reduce((matched, path) => {
if (!path && path !== "") return null;
if (matched) return matched;
const { regexp, keys } = compilePath(path, {
end: exact,
strict,
sensitive
});
const match = regexp.exec(pathname);
if (!match) return null;
const [url, ...values] = match;
const isExact = pathname === url;
if (exact && !isExact) return null;
return {
path, // the path used to match
url: path === "/" && url === "" ? "/" : url, // the matched portion of the URL
isExact, // whether or not we matched exactly
params: keys.reduce((memo, key, index) => {
memo[key.name] = values[index];
return memo;
}, {})
};
}, null);
}
export default matchPath;

View File

@@ -0,0 +1,175 @@
// MIT License
// Copyright (c) 2019-present StringEpsilon <StringEpsilon@gmail.com>
// Copyright (c) 2017-2019 James Kyle <me@thejameskyle.com>
// https://github.com/StringEpsilon/mini-create-react-context
import React from "react";
import PropTypes from "prop-types";
import warning from "tiny-warning";
const MAX_SIGNED_31_BIT_INT = 1073741823;
const commonjsGlobal =
typeof globalThis !== "undefined" // 'global proper'
? // eslint-disable-next-line no-undef
globalThis
: typeof window !== "undefined"
? window // Browser
: typeof global !== "undefined"
? global // node.js
: {};
function getUniqueId() {
let key = "__global_unique_id__";
return (commonjsGlobal[key] = (commonjsGlobal[key] || 0) + 1);
}
// Inlined Object.is polyfill.
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
function objectIs(x, y) {
if (x === y) {
return x !== 0 || 1 / x === 1 / y;
} else {
// eslint-disable-next-line no-self-compare
return x !== x && y !== y;
}
}
function createEventEmitter(value) {
let handlers = [];
return {
on(handler) {
handlers.push(handler);
},
off(handler) {
handlers = handlers.filter(h => h !== handler);
},
get() {
return value;
},
set(newValue, changedBits) {
value = newValue;
handlers.forEach(handler => handler(value, changedBits));
}
};
}
function onlyChild(children) {
return Array.isArray(children) ? children[0] : children;
}
export default function createReactContext(defaultValue, calculateChangedBits) {
const contextProp = "__create-react-context-" + getUniqueId() + "__";
class Provider extends React.Component {
emitter = createEventEmitter(this.props.value);
static childContextTypes = {
[contextProp]: PropTypes.object.isRequired
};
getChildContext() {
return {
[contextProp]: this.emitter
};
}
componentWillReceiveProps(nextProps) {
if (this.props.value !== nextProps.value) {
let oldValue = this.props.value;
let newValue = nextProps.value;
let changedBits;
if (objectIs(oldValue, newValue)) {
changedBits = 0; // No change
} else {
changedBits =
typeof calculateChangedBits === "function"
? calculateChangedBits(oldValue, newValue)
: MAX_SIGNED_31_BIT_INT;
if (process.env.NODE_ENV !== "production") {
warning(
(changedBits & MAX_SIGNED_31_BIT_INT) === changedBits,
"calculateChangedBits: Expected the return value to be a " +
"31-bit integer. Instead received: " +
changedBits
);
}
changedBits |= 0;
if (changedBits !== 0) {
this.emitter.set(nextProps.value, changedBits);
}
}
}
}
render() {
return this.props.children;
}
}
class Consumer extends React.Component {
static contextTypes = {
[contextProp]: PropTypes.object
};
observedBits;
state = {
value: this.getValue()
};
componentWillReceiveProps(nextProps) {
let { observedBits } = nextProps;
this.observedBits =
observedBits === undefined || observedBits === null
? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default
: observedBits;
}
componentDidMount() {
if (this.context[contextProp]) {
this.context[contextProp].on(this.onUpdate);
}
let { observedBits } = this.props;
this.observedBits =
observedBits === undefined || observedBits === null
? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default
: observedBits;
}
componentWillUnmount() {
if (this.context[contextProp]) {
this.context[contextProp].off(this.onUpdate);
}
}
getValue() {
if (this.context[contextProp]) {
return this.context[contextProp].get();
} else {
return defaultValue;
}
}
onUpdate = (newValue, changedBits) => {
const observedBits = this.observedBits | 0;
if ((observedBits & changedBits) !== 0) {
this.setState({ value: this.getValue() });
}
};
render() {
return onlyChild(this.props.children)(this.state.value);
}
}
return {
Provider,
Consumer
};
}

51
node_modules/react-router/modules/withRouter.js generated vendored Normal file
View File

@@ -0,0 +1,51 @@
import React from "react";
import PropTypes from "prop-types";
import hoistStatics from "hoist-non-react-statics";
import invariant from "tiny-invariant";
import RouterContext from "./RouterContext.js";
/**
* A public higher-order component to access the imperative API
*/
function withRouter(Component) {
const displayName = `withRouter(${Component.displayName || Component.name})`;
const C = props => {
const { wrappedComponentRef, ...remainingProps } = props;
return (
<RouterContext.Consumer>
{context => {
invariant(
context,
`You should not use <${displayName} /> outside a <Router>`
);
return (
<Component
{...remainingProps}
{...context}
ref={wrappedComponentRef}
/>
);
}}
</RouterContext.Consumer>
);
};
C.displayName = displayName;
C.WrappedComponent = Component;
if (__DEV__) {
C.propTypes = {
wrappedComponentRef: PropTypes.oneOfType([
PropTypes.string,
PropTypes.func,
PropTypes.object
])
};
}
return hoistStatics(C, Component);
}
export default withRouter;

69
node_modules/react-router/package.json generated vendored Normal file
View File

@@ -0,0 +1,69 @@
{
"name": "react-router",
"version": "5.3.4",
"description": "Declarative routing for React",
"homepage": "https://reactrouter.com/",
"repository": {
"url": "https://github.com/remix-run/react-router.git",
"type": "git",
"directory": "packages/react-router"
},
"license": "MIT",
"author": "Remix Software <hello@remix.run>",
"files": [
"LICENSE",
"README.md",
"MemoryRouter.js",
"Prompt.js",
"Redirect.js",
"Route.js",
"Router.js",
"StaticRouter.js",
"Switch.js",
"cjs",
"es",
"esm",
"index.js",
"generatePath.js",
"matchPath.js",
"modules/*.js",
"modules/utils/*.js",
"withRouter.js",
"warnAboutDeprecatedCJSRequire.js",
"umd"
],
"main": "index.js",
"module": "esm/react-router.js",
"sideEffects": false,
"scripts": {
"build": "rollup -c",
"lint": "eslint modules"
},
"peerDependencies": {
"react": ">=15"
},
"dependencies": {
"@babel/runtime": "^7.12.13",
"history": "^4.9.0",
"hoist-non-react-statics": "^3.1.0",
"loose-envify": "^1.3.1",
"path-to-regexp": "^1.7.0",
"prop-types": "^15.6.2",
"react-is": "^16.6.0",
"tiny-invariant": "^1.0.2",
"tiny-warning": "^1.0.0"
},
"browserify": {
"transform": [
"loose-envify"
]
},
"keywords": [
"react",
"router",
"route",
"routing",
"history",
"link"
]
}

3089
node_modules/react-router/umd/react-router.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

1
node_modules/react-router/umd/react-router.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

2
node_modules/react-router/umd/react-router.min.js generated vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,36 @@
/* eslint-disable prefer-arrow-callback, no-empty */
"use strict";
var printWarning = function() {};
if (process.env.NODE_ENV !== "production") {
printWarning = function(format, subs) {
var index = 0;
var message =
"Warning: " +
(subs.length > 0
? format.replace(/%s/g, function() {
return subs[index++];
})
: format);
if (typeof console !== "undefined") {
console.error(message);
}
try {
// --- Welcome to debugging React Router ---
// This error was thrown as a convenience so that you can use the
// stack trace to find the callsite that triggered this warning.
throw new Error(message);
} catch (e) {}
};
}
module.exports = function(member) {
printWarning(
'Please use `require("react-router").%s` instead of `require("react-router/%s")`. ' +
"Support for the latter will be removed in the next major release.",
[member, member]
);
};

3
node_modules/react-router/withRouter.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
"use strict";
require("./warnAboutDeprecatedCJSRequire")("withRouter");
module.exports = require("./index.js").withRouter;